From 0e2f78b3a6d16c091800b7415e0bb9104f2156b4 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 29 Aug 2024 22:54:36 +0800 Subject: [PATCH] features in workflow --- .../base/chat/chat/chat-input-area/index.tsx | 101 +++++++------- .../chat/chat/chat-input-area/operation.tsx | 5 +- web/app/components/base/chat/chat/index.tsx | 9 +- .../features/new-feature-panel/citation.tsx | 3 + .../conversation-opener/index.tsx | 3 +- .../new-feature-panel/feature-bar.tsx | 127 ++++++++++++++++++ .../new-feature-panel/feature-card.tsx | 4 +- .../new-feature-panel/file-upload/index.tsx | 7 +- .../features/new-feature-panel/follow-up.tsx | 3 + .../base/features/new-feature-panel/index.tsx | 17 +-- .../new-feature-panel/moderation/index.tsx | 3 +- .../new-feature-panel/more-like-this.tsx | 3 + .../new-feature-panel/speech-to-text.tsx | 3 + .../text-to-speech/index.tsx | 7 +- .../text-to-speech/param-config-content.tsx | 2 +- web/app/components/workflow/header/index.tsx | 23 +--- .../panel/debug-and-preview/chat-wrapper.tsx | 11 +- web/i18n/en-US/app-debug.ts | 5 + web/i18n/zh-Hans/app-debug.ts | 5 + 19 files changed, 250 insertions(+), 91 deletions(-) create mode 100644 web/app/components/base/features/new-feature-panel/feature-bar.tsx 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 c1df858d95..032b37b6aa 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 @@ -10,7 +10,6 @@ import Recorder from 'js-audio-recorder' import type { EnableType, OnSend, - VisionConfig, } from '../../types' import type { Theme } from '../../embedded-chatbot/theme/theme-context' import { useTextAreaHeight } from './hooks' @@ -20,14 +19,22 @@ import { FileListFlexOperation } from '@/app/components/base/file-uploader' import { FileContextProvider } from '@/app/components/base/file-uploader/store' import VoiceInput from '@/app/components/base/voice-input' import { useToastContext } from '@/app/components/base/toast' +import FeatureBar from '@/app/components/base/features/new-feature-panel/feature-bar' +import type { FileUpload } from '@/app/components/base/features/types' type ChatInputAreaProps = { - visionConfig?: VisionConfig + showFeatureBar?: boolean + featureBarDisabled?: boolean + onFeatureBarClick?: (state: boolean) => void + visionConfig?: FileUpload speechToTextConfig?: EnableType onSend?: OnSend theme?: Theme | null } const ChatInputArea = ({ + showFeatureBar, + featureBarDisabled, + onFeatureBarClick, visionConfig, speechToTextConfig = { enabled: true }, onSend, @@ -86,6 +93,7 @@ const ChatInputArea = ({ const operation = ( -
-
- -
-
-
- {query} + <> +
+
+ +
+
+
+ {query} +
+