From 59ce71551570925772e03b0a2144033473926db5 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Wed, 8 May 2024 14:10:24 -0700 Subject: [PATCH] update stylying for dims --- embed/README.md | 4 ++-- embed/index.html | 4 +++- embed/src/App.jsx | 8 ++++---- .../ChatContainer/ChatHistory/HistoricalMessage/index.jsx | 1 - embed/src/hooks/useScriptAttributes.js | 6 +++--- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/embed/README.md b/embed/README.md index 53fa41c5..c439d786 100644 --- a/embed/README.md +++ b/embed/README.md @@ -87,9 +87,9 @@ REQUIRED data attributes: - `data-assistant-icon` - Set the icon of the chat assistant. -- `data-window-height` - Set the chat window height in pixels. +- `data-window-height` - Set the chat window height. **must include CSS suffix:** `px`,`%`,`rem` -- `data-window-width` - Set the chat window width in pixels. +- `data-window-width` - Set the chat window width. **must include CSS suffix:** `px`,`%`,`rem` - `data-text-size` - Set the text size of the chats in pixels. diff --git a/embed/index.html b/embed/index.html index 87c8b905..b5113e17 100644 --- a/embed/index.html +++ b/embed/index.html @@ -1,5 +1,6 @@ +

This is an example testing page for embedded AnythingLLM.

- + + \ No newline at end of file diff --git a/embed/src/App.jsx b/embed/src/App.jsx index 5ccbd511..dfd5b54a 100644 --- a/embed/src/App.jsx +++ b/embed/src/App.jsx @@ -27,12 +27,12 @@ export default function App() { }; const position = embedSettings.position || "bottom-right"; - const windowHeight = embedSettings.windowHeight - ? `md:max-h-[${embedSettings.windowHeight}px]` - : "md:max-h-[700px]"; const windowWidth = embedSettings.windowWidth - ? `md:max-w-[${embedSettings.windowWidth}px]` + ? `md:max-w-[${embedSettings.windowWidth}]` : "md:max-w-[400px]"; + const windowHeight = embedSettings.windowHeight + ? `md:max-h-[${embedSettings.windowHeight}]` + : "md:max-h-[700px]"; return ( <> diff --git a/embed/src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/index.jsx b/embed/src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/index.jsx index 1c623fea..2eab8cca 100644 --- a/embed/src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/index.jsx +++ b/embed/src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/index.jsx @@ -13,7 +13,6 @@ const HistoricalMessage = forwardRef( { uuid = v4(), message, role, sources = [], error = false, sentAt }, ref ) => { - console.log("text size", embedderSettings.settings.textSize); const textSize = !!embedderSettings.settings.textSize ? `text-[${embedderSettings.settings.textSize}px]` : "text-sm"; diff --git a/embed/src/hooks/useScriptAttributes.js b/embed/src/hooks/useScriptAttributes.js index a5b0e7c3..85d381a6 100644 --- a/embed/src/hooks/useScriptAttributes.js +++ b/embed/src/hooks/useScriptAttributes.js @@ -23,9 +23,9 @@ const DEFAULT_SETTINGS = { position: "bottom-right", // position of chat button/window assistantName: "AnythingLLM Chat Assistant", // default assistant name assistantIcon: null, // default assistant icon - windowHeight: null, // height of chat window in px - windowWidth: null, // width of chat window in px - textSize: null, // text size in px + windowHeight: null, // height of chat window in number:css-prefix + windowWidth: null, // width of chat window in number:css-prefix + textSize: null, // text size in px (number only) // behaviors openOnLoad: "off", // or "on"