From 4aac3476b6db099b6dd10ea304194ac8b7b2c11e Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Wed, 28 May 2025 02:33:14 -0600 Subject: [PATCH] refactor: update Chatwoot widget settings and types to enhance configuration options --- .../components/shared/ChatwootWidget.tsx | 2 -- apps/dokploy/types/chatwoot.d.ts | 30 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/apps/dokploy/components/shared/ChatwootWidget.tsx b/apps/dokploy/components/shared/ChatwootWidget.tsx index acd263b0..6694b13c 100644 --- a/apps/dokploy/components/shared/ChatwootWidget.tsx +++ b/apps/dokploy/components/shared/ChatwootWidget.tsx @@ -39,7 +39,6 @@ export const ChatwootWidget = ({ // Configurar los settings de Chatwoot window.chatwootSettings = { position: "right", - darkMode: false, }; (window as any).chatwootSDKReady = () => { @@ -52,7 +51,6 @@ export const ChatwootWidget = ({ name: user.name, avatar_url: user.avatarUrl, phone_number: user.phoneNumber, - ...user.customAttributes, }); } }; diff --git a/apps/dokploy/types/chatwoot.d.ts b/apps/dokploy/types/chatwoot.d.ts index 81cc98f5..88fa50f9 100644 --- a/apps/dokploy/types/chatwoot.d.ts +++ b/apps/dokploy/types/chatwoot.d.ts @@ -1,27 +1,21 @@ declare global { interface Window { chatwootSettings?: { - position?: "left" | "right"; - type?: "standard" | "expanded_bubble"; - launcherTitle?: string; - darkMode?: boolean; hideMessageBubble?: boolean; - placement?: "right" | "left"; + showUnreadMessagesDialog?: boolean; + position?: "left" | "right"; + locale?: string; + useBrowserLanguage?: boolean; + type?: "standard" | "expanded_bubble"; + darkMode?: "light" | "auto"; + launcherTitle?: string; showPopoutButton?: boolean; - widgetStyle?: "standard" | "bubble"; + baseDomain?: string; }; chatwootSDK?: { run: (config: { websiteToken: string; baseUrl: string; - user?: { - identifier?: string; - name?: string; - email?: string; - phone?: string; - avatar_url?: string; - custom_attributes?: Record; - }; }) => void; }; $chatwoot?: { @@ -29,8 +23,14 @@ declare global { identifier: string, userAttributes: Record, ) => void; + setCustomAttributes: (attributes: Record) => void; reset: () => void; - toggle: () => void; + toggle: (state?: "open" | "close") => void; + popoutChatWindow: () => void; + toggleBubbleVisibility: (visibility: "show" | "hide") => void; + setLocale: (locale: string) => void; + setLabel: (label: string) => void; + removeLabel: (label: string) => void; }; chatwootSDKReady?: () => void; }