From 3f37b75ead8ceb424cb64557cdd3d8743fffab81 Mon Sep 17 00:00:00 2001 From: Yooco Date: Sun, 11 May 2025 23:12:00 +0800 Subject: [PATCH] feat: modify the embedded UI --- .../base/chat/chat-with-history/index.tsx | 2 +- .../base/chat/chat/chat-input-area/index.tsx | 109 ++++++++++-------- .../base/chat/chat/chat-input-area/style.scss | 25 ++++ .../base/chat/chat/content-switch.tsx | 52 +++++---- web/app/components/base/chat/chat/index.tsx | 18 +-- .../components/base/chat/chat/question.tsx | 12 +- .../chat/embedded-chatbot/header/index.tsx | 13 ++- .../base/chat/embedded-chatbot/index.tsx | 2 +- web/app/components/base/chat/types.ts | 2 +- .../base/icons/src/public/avatar/User.tsx | 2 +- .../share/text-generation/index.tsx | 2 +- web/app/layout.tsx | 2 +- web/eslint.config.mjs | 2 +- web/i18n/de-DE/custom.ts | 2 +- web/i18n/en-US/custom.ts | 2 +- web/i18n/es-ES/custom.ts | 2 +- web/i18n/fa-IR/custom.ts | 2 +- web/i18n/it-IT/custom.ts | 2 +- web/i18n/ko-KR/custom.ts | 2 +- web/i18n/pt-BR/custom.ts | 2 +- web/i18n/ro-RO/custom.ts | 2 +- web/i18n/ru-RU/custom.ts | 2 +- web/i18n/sl-SI/custom.ts | 2 +- web/i18n/tr-TR/custom.ts | 2 +- web/i18n/uk-UA/custom.ts | 2 +- web/i18n/zh-Hans/custom.ts | 2 +- web/i18n/zh-Hant/custom.ts | 2 +- web/public/embed.js | 65 +++++++++-- web/public/embed.min.js | 88 ++++++++++---- 29 files changed, 278 insertions(+), 146 deletions(-) create mode 100644 web/app/components/base/chat/chat/chat-input-area/style.scss diff --git a/web/app/components/base/chat/chat-with-history/index.tsx b/web/app/components/base/chat/chat-with-history/index.tsx index dfd7bd21a7..a4972f948c 100644 --- a/web/app/components/base/chat/chat-with-history/index.tsx +++ b/web/app/components/base/chat/chat-with-history/index.tsx @@ -49,7 +49,7 @@ const ChatWithHistory: FC = ({ if (customConfig) document.title = `${site.title}` else - document.title = `${site.title} - Powered by Dify` + document.title = `${site.title} - Powered by OCloud` } }, [site, customConfig, themeBuilder]) diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsx index 73061b7db1..2f74cc65ce 100644 --- a/web/app/components/base/chat/chat/chat-input-area/index.tsx +++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx @@ -28,6 +28,7 @@ import FeatureBar from '@/app/components/base/features/new-feature-panel/feature import type { FileUpload } from '@/app/components/base/features/types' import { TransferMethod } from '@/types/app' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' +import './style.scss' type ChatInputAreaProps = { showFeatureBar?: boolean @@ -69,6 +70,7 @@ const ChatInputArea = ({ } = useTextAreaHeight() const [query, setQuery] = useState('') const [showVoiceInput, setShowVoiceInput] = useState(false) + const [isFocus, setIsFocus] = useState(false) const filesStore = useFileStore() const { handleDragFileEnter, @@ -169,70 +171,83 @@ const ChatInputArea = ({ /> ) + const handleFocus = () => { + setIsFocus(true) + } + const handleBlur = () => { + setIsFocus(false) + } + return ( <>
-
- -
-
-
- {query} +
+
+ +
+
+
+ {query} +
+