From 3e616ad0c4ce4f36e8178ba5122a3f2e96b4149a Mon Sep 17 00:00:00 2001 From: Aman Soni Date: Sat, 15 Jun 2024 17:46:04 +0530 Subject: [PATCH] Embed Chat configuration updated --- packages/ui/src/views/chatflows/EmbedChat.jsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/ui/src/views/chatflows/EmbedChat.jsx b/packages/ui/src/views/chatflows/EmbedChat.jsx index d2c4f8ae7b9..b13c1a22de2 100644 --- a/packages/ui/src/views/chatflows/EmbedChat.jsx +++ b/packages/ui/src/views/chatflows/EmbedChat.jsx @@ -104,6 +104,24 @@ const buttonConfig = (isReact = false) => { }` } +const tooltipConfig = (isReact = false) => { + return isReact + ? `tooltip: { + showTooltip: true, + tooltipMessage: 'Hi There 👋!', + tooltipBackgroundColor: 'black', + tooltipTextColor: 'white', + tooltipFontSize: 16, + }` + : `tooltip: { + showTooltip: true, + tooltipMessage: 'Hi There 👋!', + tooltipBackgroundColor: 'black', + tooltipTextColor: 'white', + tooltipFontSize: 16, + }` +} + const chatwindowConfig = (isReact = false) => { return isReact ? `chatWindow: { @@ -136,6 +154,7 @@ const chatwindowConfig = (isReact = false) => { sendButtonColor: '#3B81F6', maxChars: 50, maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.', + autoFocus: true, // If not used, autofocus is disabled on mobile and enabled on desktop. true enables it on both, false disables it on both. }, feedback: { color: '#303235', @@ -177,6 +196,7 @@ const chatwindowConfig = (isReact = false) => { sendButtonColor: '#3B81F6', maxChars: 50, maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.', + autoFocus: true, // If not used, autofocus is disabled on mobile and enabled on desktop. true enables it on both, false disables it on both. }, feedback: { color: '#303235', @@ -201,6 +221,7 @@ const embedPopupHtmlCodeCustomization = (chatflowid) => { }, theme: { ${buttonConfig()}, + ${tooltipConfig()}, ${chatwindowConfig()} } }) @@ -217,6 +238,7 @@ const App = () => { apiHost="${baseURL}" theme={{ ${buttonConfig(true)}, + ${tooltipConfig(true)}, ${chatwindowConfig(true)} }} />