@agentscope-ai/chat 1.1.20 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/client.js +1 -1
- package/components/AGUI/components/HelpModal/icons.tsx +68 -0
- package/components/AGUI/components/HelpModal/index.tsx +1 -0
- package/components/AGUI/components/HelpModal/modal.tsx +101 -0
- package/components/AGUI/components/chat/Button.tsx +18 -0
- package/components/AGUI/components/chat/Chat.tsx +780 -0
- package/components/AGUI/components/chat/ChatContext.tsx +248 -0
- package/components/AGUI/components/chat/CodeBlock.tsx +406 -0
- package/components/AGUI/components/chat/Header.tsx +22 -0
- package/components/AGUI/components/chat/Icons.tsx +237 -0
- package/components/AGUI/components/chat/ImageUploadQueue.tsx +77 -0
- package/components/AGUI/components/chat/Input.tsx +24 -0
- package/components/AGUI/components/chat/Markdown.tsx +134 -0
- package/components/AGUI/components/chat/Messages.tsx +259 -0
- package/components/AGUI/components/chat/Modal.tsx +133 -0
- package/components/AGUI/components/chat/Popup.tsx +57 -0
- package/components/AGUI/components/chat/PoweredByTag.tsx +29 -0
- package/components/AGUI/components/chat/Sidebar.tsx +74 -0
- package/components/AGUI/components/chat/Suggestion.tsx +132 -0
- package/components/AGUI/components/chat/Suggestions.tsx +20 -0
- package/components/AGUI/components/chat/Textarea.tsx +61 -0
- package/components/AGUI/components/chat/Window.tsx +152 -0
- package/components/AGUI/components/chat/index.tsx +11 -0
- package/components/AGUI/components/chat/messages/AssistantMessage.tsx +69 -0
- package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +129 -0
- package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +116 -0
- package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +64 -0
- package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +26 -0
- package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +51 -0
- package/components/AGUI/components/chat/messages/UserMessage.tsx +10 -0
- package/components/AGUI/components/chat/props.ts +186 -0
- package/components/AGUI/components/index.ts +1 -0
- package/components/AGUI/context/index.ts +1 -0
- package/components/AGUI/hooks/index.ts +1 -0
- package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +122 -0
- package/components/AGUI/hooks/use-copy-to-clipboard.tsx +29 -0
- package/components/AGUI/hooks/use-dark-mode.ts +10 -0
- package/components/AGUI/hooks/use-push-to-talk.tsx +166 -0
- package/components/AGUI/index.tsx +4 -0
- package/components/AGUI/lib/utils.test.ts +7 -0
- package/components/AGUI/lib/utils.ts +27 -0
- package/components/AGUI/styles.css +0 -0
- package/components/AGUI/types/css.ts +0 -0
- package/components/AGUI/types/index.ts +1 -0
- package/components/AGUI/types/suggestions.ts +6 -0
- package/components/Accordion/Accordion.tsx +203 -0
- package/components/Accordion/BodyContent.tsx +28 -0
- package/components/Accordion/DeepThinking.tsx +91 -0
- package/components/Accordion/SoftLightTitle.tsx +13 -0
- package/components/Accordion/demo/search.tsx +39 -0
- package/components/Accordion/demo/steps.tsx +135 -0
- package/components/Accordion/demo/thinking.tsx +62 -0
- package/components/Accordion/index.en-US.md +34 -0
- package/components/Accordion/index.tsx +3 -0
- package/components/Accordion/index.zh-CN.md +34 -0
- package/components/Accordion/style.ts +208 -0
- package/components/AgentScopeRuntimeWebUI/demo/index.tsx +4 -0
- package/components/AgentScopeRuntimeWebUI/index.tsx +3 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Builder.tsx +82 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Card.tsx +52 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Actions.tsx +39 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Builder.tsx +205 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Card.tsx +44 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Error.tsx +7 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Message.tsx +23 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Reasoning.tsx +16 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Tool.tsx +19 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/index.tsx +0 -0
- package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/types.tsx +100 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/index.tsx +77 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/useAttachments.tsx +53 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/MessageList/index.tsx +30 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/index.tsx +66 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/styles.ts +51 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/index.tsx +5 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatController.tsx +130 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatMessageHandler.tsx +87 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatRequest.tsx +114 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatSessionHandler.tsx +50 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/index.tsx +18 -0
- package/components/AgentScopeRuntimeWebUI/lib/Chat/styles.tsx +59 -0
- package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/ComposedProvider.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/index.tsx +29 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereControl.tsx +0 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereInputContext.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereLayoutContext.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereMessagesContext.tsx +82 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereOptionsContext.tsx +76 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereSessionsContext.tsx +111 -0
- package/components/AgentScopeRuntimeWebUI/lib/Context/useChatAnywhereEventEmitter.tsx +30 -0
- package/components/AgentScopeRuntimeWebUI/lib/Header/index.tsx +45 -0
- package/components/AgentScopeRuntimeWebUI/lib/Header/styles.ts +23 -0
- package/components/AgentScopeRuntimeWebUI/lib/Layout/index.tsx +45 -0
- package/components/AgentScopeRuntimeWebUI/lib/Layout/styles.tsx +104 -0
- package/components/AgentScopeRuntimeWebUI/lib/Sessions/index.tsx +114 -0
- package/components/AgentScopeRuntimeWebUI/lib/Sessions/styles.tsx +0 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/FormItem.tsx +37 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/OptionsEditor.tsx +163 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/defaultConfig.ts +43 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/index.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/index.tsx +57 -0
- package/components/AgentScopeRuntimeWebUI/lib/demo/sessionApi/index.ts +51 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/IChatAnywhere.ts +358 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/IMessages.tsx +52 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/ISessions.tsx +29 -0
- package/components/AgentScopeRuntimeWebUI/lib/types/index.tsx +3 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.tsx +37 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.tsx +163 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.ts +43 -0
- package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.tsx +27 -0
- package/components/AgentScopeRuntimeWebUI/starter/index.tsx +57 -0
- package/components/AgentScopeRuntimeWebUI/starter/sessionApi/index.ts +51 -0
- package/components/Attachments/DropArea.tsx +97 -0
- package/components/Attachments/FileList/AudioIcon.tsx +20 -0
- package/components/Attachments/FileList/FileListCard.tsx +270 -0
- package/components/Attachments/FileList/Progress.tsx +30 -0
- package/components/Attachments/FileList/VideoIcon.tsx +20 -0
- package/components/Attachments/FileList/index.tsx +201 -0
- package/components/Attachments/PlaceholderUploader.tsx +124 -0
- package/components/Attachments/SilentUploader.tsx +39 -0
- package/components/Attachments/context.tsx +11 -0
- package/components/Attachments/demo/basic.tsx +71 -0
- package/components/Attachments/index.en-US.md.bk +10 -0
- package/components/Attachments/index.tsx +274 -0
- package/components/Attachments/index.zh-CN.md.bk +10 -0
- package/components/Attachments/style/fileCard.ts +163 -0
- package/components/Attachments/style/index.ts +232 -0
- package/components/Attachments/util.ts +56 -0
- package/components/Bubble/Avatar.tsx +39 -0
- package/components/Bubble/Bubble.tsx +131 -0
- package/components/Bubble/BubbleList.tsx +105 -0
- package/components/Bubble/Cards.tsx +61 -0
- package/components/Bubble/Footer.tsx +55 -0
- package/components/Bubble/Interrupted.tsx +82 -0
- package/components/Bubble/ScrollToBottom.tsx +42 -0
- package/components/Bubble/Spin.tsx +13 -0
- package/components/Bubble/demo/assistantWithCode.tsx +60 -0
- package/components/Bubble/demo/assistantWithErrorStatus.tsx +102 -0
- package/components/Bubble/demo/assistantWithImage.tsx +46 -0
- package/components/Bubble/demo/assistantWithProcess.tsx +103 -0
- package/components/Bubble/demo/assistantWithSearch.tsx +69 -0
- package/components/Bubble/demo/assistantWithThinking.tsx +54 -0
- package/components/Bubble/demo/basic.tsx +55 -0
- package/components/Bubble/demo/userWithFile.tsx +27 -0
- package/components/Bubble/demo/userWithImage.tsx +26 -0
- package/components/Bubble/hooks/useDisplayData.ts +0 -0
- package/components/Bubble/hooks/useListData.ts +0 -0
- package/components/Bubble/index.en-US.md +33 -0
- package/components/Bubble/index.tsx +21 -0
- package/components/Bubble/index.zh-CN.md +33 -0
- package/components/Bubble/interface.ts +71 -0
- package/components/Bubble/loading.tsx +15 -0
- package/components/Bubble/style/avatar.ts +43 -0
- package/components/Bubble/style/footer.ts +45 -0
- package/components/Bubble/style/index.ts +192 -0
- package/components/Bubble/style/list.ts +51 -0
- package/components/ChatAnywhere/Chat/Ref.tsx +20 -0
- package/components/ChatAnywhere/Chat/index.tsx +56 -0
- package/components/ChatAnywhere/Chat/style.ts +59 -0
- package/components/ChatAnywhere/Header/index.tsx +37 -0
- package/components/ChatAnywhere/Header/style.ts +27 -0
- package/components/ChatAnywhere/Input/index.tsx +158 -0
- package/components/ChatAnywhere/Input/style.ts +14 -0
- package/components/ChatAnywhere/Layout/index.tsx +70 -0
- package/components/ChatAnywhere/Layout/style.ts +51 -0
- package/components/ChatAnywhere/SessionList/index.tsx +122 -0
- package/components/ChatAnywhere/SessionList/style.ts +53 -0
- package/components/ChatAnywhere/hooks/ChatAnywhereProvider.tsx +219 -0
- package/components/ChatAnywhere/hooks/types.ts +333 -0
- package/components/ChatAnywhere/hooks/useInput.tsx +22 -0
- package/components/ChatAnywhere/hooks/useMessages.tsx +63 -0
- package/components/ChatAnywhere/hooks/useSessionList.tsx +123 -0
- package/components/ChatAnywhere/index.tsx +49 -0
- package/components/Conversations/GroupTitle.tsx +28 -0
- package/components/Conversations/Item.tsx +189 -0
- package/components/Conversations/demo/basic.tsx +107 -0
- package/components/Conversations/demo/timeline.tsx +111 -0
- package/components/Conversations/demo/timestamp.tsx +110 -0
- package/components/Conversations/hooks/useGroupable.ts +81 -0
- package/components/Conversations/index.en-US.md +32 -0
- package/components/Conversations/index.tsx +176 -0
- package/components/Conversations/index.zh-CN.md +31 -0
- package/components/Conversations/interface.ts +69 -0
- package/components/Conversations/style.ts +153 -0
- package/components/DefaultCards/DeepThinking/index.tsx +33 -0
- package/components/DefaultCards/Files/index.tsx +69 -0
- package/components/DefaultCards/Footer/index.tsx +16 -0
- package/components/DefaultCards/Images/index.tsx +53 -0
- package/components/DefaultCards/Interrupted/index.tsx +13 -0
- package/components/DefaultCards/Text/index.tsx +13 -0
- package/components/DefaultCards/index.tsx +6 -0
- package/components/DeviceAction/actionMap.tsx +100 -0
- package/components/DeviceAction/demo/index.tsx +132 -0
- package/components/DeviceAction/index.en-US.md +19 -0
- package/components/DeviceAction/index.tsx +75 -0
- package/components/DeviceAction/index.zh-CN.md +19 -0
- package/components/Disclaimer/demo/index.tsx +4 -0
- package/components/Disclaimer/demo/withLink.tsx +4 -0
- package/components/Disclaimer/index.en-US.md +23 -0
- package/components/Disclaimer/index.tsx +42 -0
- package/components/Disclaimer/index.zh-CN.md +24 -0
- package/components/Disclaimer/style.ts +17 -0
- package/components/ImageGenerator/demo/basic.tsx +23 -0
- package/components/ImageGenerator/demo/custom.tsx +56 -0
- package/components/ImageGenerator/demo/size.tsx +15 -0
- package/components/ImageGenerator/index.en-US.md +23 -0
- package/components/ImageGenerator/index.tsx +124 -0
- package/components/ImageGenerator/index.zh-CN.md +23 -0
- package/components/ImageGenerator/style.ts +99 -0
- package/components/Markdown/Markdown/AnimationNode.tsx +89 -0
- package/components/Markdown/Markdown/Markdown.tsx +61 -0
- package/components/Markdown/Markdown/core/Parser.ts +52 -0
- package/components/Markdown/Markdown/core/Renderer.ts +121 -0
- package/components/Markdown/Markdown/core/index.ts +4 -0
- package/components/Markdown/Markdown/defaultComponents/CodeBlock.tsx +113 -0
- package/components/Markdown/Markdown/defaultComponents/DisabledImage.tsx +3 -0
- package/components/Markdown/Markdown/defaultComponents/Media.tsx +71 -0
- package/components/Markdown/Markdown/hooks/index.ts +4 -0
- package/components/Markdown/Markdown/hooks/useAnimation.tsx +27 -0
- package/components/Markdown/Markdown/hooks/useCitationsData.tsx +36 -0
- package/components/Markdown/Markdown/hooks/useStreaming.ts +503 -0
- package/components/Markdown/Markdown/hooks/useTyping.ts +22 -0
- package/components/Markdown/Markdown/index.tsx +198 -0
- package/components/Markdown/Markdown/interface.ts +217 -0
- package/components/Markdown/Markdown/style.ts +152 -0
- package/components/Markdown/demo/basic.tsx +107 -0
- package/components/Markdown/demo/citations.tsx +47 -0
- package/components/Markdown/demo/cursor.tsx +9 -0
- package/components/Markdown/demo/latex.tsx +77 -0
- package/components/Markdown/demo/typing.tsx +82 -0
- package/components/Markdown/index.en-US.md +27 -0
- package/components/Markdown/index.ts +1 -0
- package/components/Markdown/index.zh-CN.md +28 -0
- package/components/Markdown/plugins/citations/CitationComponent.tsx +72 -0
- package/components/Markdown/plugins/citations/index.tsx +37 -0
- package/components/Markdown/plugins/cursor/Dot.tsx +106 -0
- package/components/Markdown/plugins/cursor/Underline.tsx +38 -0
- package/components/Markdown/plugins/cursor/index.tsx +59 -0
- package/components/Markdown/plugins/latex/index.ts +109 -0
- package/components/Markdown/plugins/type.ts +71 -0
- package/components/Mermaid/demo/basic.tsx +12 -0
- package/components/Mermaid/demo/class.tsx +31 -0
- package/components/Mermaid/demo/flowchart.tsx +13 -0
- package/components/Mermaid/demo/sequence.tsx +18 -0
- package/components/Mermaid/demo/state.tsx +16 -0
- package/components/Mermaid/demo/timeline.tsx +15 -0
- package/components/Mermaid/index.en-US.md +27 -0
- package/components/Mermaid/index.tsx +118 -0
- package/components/Mermaid/index.zh-CN.md +27 -0
- package/components/OperateCard/OperateCard.tsx +93 -0
- package/components/OperateCard/demo/index.tsx +35 -0
- package/components/OperateCard/demo/rag.tsx +19 -0
- package/components/OperateCard/demo/thinking.tsx +17 -0
- package/components/OperateCard/demo/todo.tsx +28 -0
- package/components/OperateCard/demo/toolCall.tsx +14 -0
- package/components/OperateCard/demo/webSearch.tsx +12 -0
- package/components/OperateCard/index.en-US.md +51 -0
- package/components/OperateCard/index.tsx +1 -0
- package/components/OperateCard/index.zh-CN.md +51 -0
- package/components/OperateCard/preset/Rag.tsx +90 -0
- package/components/OperateCard/preset/Thinking.tsx +45 -0
- package/components/OperateCard/preset/TodoList.tsx +73 -0
- package/components/OperateCard/preset/ToolCall.tsx +67 -0
- package/components/OperateCard/preset/WebSearch.tsx +65 -0
- package/components/OperateCard/preset/index.tsx +5 -0
- package/components/OperateCard/style.ts +268 -0
- package/components/Provider/CustomCardsProvider.tsx +17 -0
- package/components/Provider/GlobalProvider.tsx +17 -0
- package/components/Provider/index.tsx +33 -0
- package/components/Provider/types.ts +23 -0
- package/components/ResponsesAPI/index.tsx +0 -0
- package/components/Sender/ModeSelect/index.tsx +160 -0
- package/components/Sender/ModeSelect/styles.ts +0 -0
- package/components/Sender/SenderHeader.tsx +164 -0
- package/components/Sender/StopLoading.tsx +48 -0
- package/components/Sender/components/ActionButton.tsx +106 -0
- package/components/Sender/components/ClearButton.tsx +10 -0
- package/components/Sender/components/LoadingButton.tsx +26 -0
- package/components/Sender/components/SendButton.tsx +22 -0
- package/components/Sender/components/SpeechButton/RecordingIcon.tsx +68 -0
- package/components/Sender/components/SpeechButton/index.tsx +30 -0
- package/components/Sender/demo/asr.tsx +7 -0
- package/components/Sender/demo/basic.tsx +7 -0
- package/components/Sender/demo/loading.tsx +5 -0
- package/components/Sender/demo/moreMode.tsx +45 -0
- package/components/Sender/demo/morePrefixAction.tsx +40 -0
- package/components/Sender/demo/withFile.tsx +54 -0
- package/components/Sender/demo/withImage.tsx +52 -0
- package/components/Sender/index.en-US.md +29 -0
- package/components/Sender/index.tsx +491 -0
- package/components/Sender/index.zh-CN.md +30 -0
- package/components/Sender/style/index.ts +150 -0
- package/components/Sender/useSpeech.ts +133 -0
- package/components/StatusCard/demo/index.tsx +32 -0
- package/components/StatusCard/index.en-US.md +30 -0
- package/components/StatusCard/index.tsx +162 -0
- package/components/StatusCard/index.zh-CN.md +27 -0
- package/components/StatusCard/style.ts +119 -0
- package/components/Stream/index.ts +203 -0
- package/components/Util/hooks/use-proxy-imperative-handle.ts +25 -0
- package/components/Util/sleep.ts +3 -0
- package/components/Util/type.ts +1 -0
- package/components/Util/warning.ts +118 -0
- package/components/Version/index.ts +3 -0
- package/components/Voice/Recorder.tsx +3 -0
- package/components/Voice/demo/index.tsx +0 -0
- package/components/Voice/index.en-US.md +8 -0
- package/components/Voice/index.tsx +0 -0
- package/components/Voice/index.zh-CN.md +9 -0
- package/components/Welcome/demo/EyeFollower.tsx +161 -0
- package/components/Welcome/demo/demo0.tsx +14 -0
- package/components/Welcome/demo/demo1.tsx +16 -0
- package/components/Welcome/demo/demo2.tsx +30 -0
- package/components/Welcome/demo/demo3.tsx +16 -0
- package/components/Welcome/index.en-US.md +28 -0
- package/components/Welcome/index.tsx +72 -0
- package/components/Welcome/index.zh-CN.md +28 -0
- package/components/index.ts +88 -0
- package/components/overview.en-US.md +10 -0
- package/components/overview.zh-CN.md +10 -0
- package/lib/AgentScopeRuntimeWebUI/index.d.ts +1 -0
- package/lib/AgentScopeRuntimeWebUI/index.js +1 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.d.ts +9 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.js +33 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.d.ts +7 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.js +188 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.d.ts +29 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.js +35 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.d.ts +6 -0
- package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.js +49 -0
- package/lib/AgentScopeRuntimeWebUI/starter/index.d.ts +1 -0
- package/lib/AgentScopeRuntimeWebUI/starter/index.js +70 -0
- package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.d.ts +14 -0
- package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.js +143 -0
- package/package.json +3 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Proxy the dom ref with `{ nativeElement, otherFn }` type
|
|
2
|
+
// ref: https://github.com/ant-design/ant-design/discussions/45242
|
|
3
|
+
|
|
4
|
+
import { useImperativeHandle } from 'react';
|
|
5
|
+
import type { Ref } from 'react';
|
|
6
|
+
|
|
7
|
+
export default function useProxyImperativeHandle<
|
|
8
|
+
NativeELementType extends HTMLElement,
|
|
9
|
+
ReturnRefType extends { nativeElement: NativeELementType },
|
|
10
|
+
>(ref: Ref<any> | undefined, init: () => ReturnRefType) {
|
|
11
|
+
return useImperativeHandle(ref, () => {
|
|
12
|
+
const refObj = init();
|
|
13
|
+
const { nativeElement } = refObj;
|
|
14
|
+
|
|
15
|
+
return new Proxy(nativeElement, {
|
|
16
|
+
get(obj: any, prop: any) {
|
|
17
|
+
if ((refObj as any)[prop]) {
|
|
18
|
+
return (refObj as any)[prop];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return Reflect.get(obj, prop);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AnyObject = Record<PropertyKey, any>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import rcWarning, { resetWarned as rcResetWarned } from 'rc-util/lib/warning';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/* istanbul ignore next */
|
|
5
|
+
export function noop() {}
|
|
6
|
+
|
|
7
|
+
let deprecatedWarnList: Record<string, string[]> | null = null;
|
|
8
|
+
|
|
9
|
+
export function resetWarned() {
|
|
10
|
+
deprecatedWarnList = null;
|
|
11
|
+
rcResetWarned();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type Warning = (valid: boolean, component: string, message?: string) => void;
|
|
15
|
+
|
|
16
|
+
let warning: Warning = noop;
|
|
17
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
18
|
+
warning = (valid, component, message) => {
|
|
19
|
+
rcWarning(valid, `[antd: ${component}] ${message}`);
|
|
20
|
+
|
|
21
|
+
// StrictMode will inject console which will not throw warning in React 17.
|
|
22
|
+
if (process.env.NODE_ENV === 'test') {
|
|
23
|
+
resetWarned();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type BaseTypeWarning = (
|
|
29
|
+
valid: boolean,
|
|
30
|
+
/**
|
|
31
|
+
* - deprecated: Some API will be removed in future but still support now.
|
|
32
|
+
* - usage: Some API usage is not correct.
|
|
33
|
+
* - breaking: Breaking change like API is removed.
|
|
34
|
+
*/
|
|
35
|
+
type: 'deprecated' | 'usage' | 'breaking',
|
|
36
|
+
message?: string,
|
|
37
|
+
) => void;
|
|
38
|
+
|
|
39
|
+
type TypeWarning = BaseTypeWarning & {
|
|
40
|
+
deprecated: (
|
|
41
|
+
valid: boolean,
|
|
42
|
+
oldProp: string,
|
|
43
|
+
newProp: string,
|
|
44
|
+
message?: string,
|
|
45
|
+
) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export interface WarningContextProps {
|
|
49
|
+
/**
|
|
50
|
+
* @description 设置警告等级,当设置为false时会将废弃相关信息聚合为单条信息
|
|
51
|
+
* @descriptionEn Set the warning level. When set to `false`, discard related information will be aggregated into a single message.
|
|
52
|
+
*/
|
|
53
|
+
strict?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const WarningContext = React.createContext<WarningContextProps>({});
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* This is a hook but we not named as `useWarning`
|
|
60
|
+
* since this is only used in development.
|
|
61
|
+
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
|
|
62
|
+
*/
|
|
63
|
+
export const devUseWarning: (component: string) => TypeWarning =
|
|
64
|
+
process.env.NODE_ENV !== 'production'
|
|
65
|
+
? (component) => {
|
|
66
|
+
const { strict } = React.useContext(WarningContext);
|
|
67
|
+
|
|
68
|
+
const typeWarning: TypeWarning = (valid, type, message) => {
|
|
69
|
+
if (!valid) {
|
|
70
|
+
if (strict === false && type === 'deprecated') {
|
|
71
|
+
const existWarning = deprecatedWarnList;
|
|
72
|
+
|
|
73
|
+
if (!deprecatedWarnList) {
|
|
74
|
+
deprecatedWarnList = {};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
deprecatedWarnList[component] =
|
|
78
|
+
deprecatedWarnList[component] || [];
|
|
79
|
+
|
|
80
|
+
if (!deprecatedWarnList[component].includes(message || '')) {
|
|
81
|
+
deprecatedWarnList[component].push(message || '');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Warning for the first time
|
|
85
|
+
if (!existWarning) {
|
|
86
|
+
// eslint-disable-next-line no-console
|
|
87
|
+
console.warn(
|
|
88
|
+
'[antd] There exists deprecated usage in your code:',
|
|
89
|
+
deprecatedWarnList,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
warning(valid, component, message);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
typeWarning.deprecated = (valid, oldProp, newProp, message) => {
|
|
99
|
+
typeWarning(
|
|
100
|
+
valid,
|
|
101
|
+
'deprecated',
|
|
102
|
+
`\`${oldProp}\` is deprecated. Please use \`${newProp}\` instead.${
|
|
103
|
+
message ? ` ${message}` : ''
|
|
104
|
+
}`,
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return typeWarning;
|
|
109
|
+
}
|
|
110
|
+
: () => {
|
|
111
|
+
const noopWarning: TypeWarning = () => {};
|
|
112
|
+
|
|
113
|
+
noopWarning.deprecated = noop;
|
|
114
|
+
|
|
115
|
+
return noopWarning;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default warning;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
|
|
2
|
+
import { createStyles } from "antd-style";
|
|
3
|
+
import React, { useState, useEffect, useRef } from "react";
|
|
4
|
+
|
|
5
|
+
interface MousePosition {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface EyePosition {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const EyeFollower: React.FC = () => {
|
|
16
|
+
const [mousePosition, setMousePosition] = useState<MousePosition>({
|
|
17
|
+
x: 0,
|
|
18
|
+
y: 0,
|
|
19
|
+
});
|
|
20
|
+
const [isBlinking, setIsBlinking] = useState<boolean>(false);
|
|
21
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
22
|
+
const { styles, cx } = useStyle();
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const handleMouseMove = (e: MouseEvent) => {
|
|
26
|
+
if (containerRef.current) {
|
|
27
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
28
|
+
setMousePosition({
|
|
29
|
+
x: e.clientX - rect.left,
|
|
30
|
+
y: e.clientY - rect.top,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
36
|
+
return () => window.removeEventListener("mousemove", handleMouseMove);
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const blinkInterval = setInterval(() => {
|
|
41
|
+
setIsBlinking(true);
|
|
42
|
+
setTimeout(() => setIsBlinking(false), 150);
|
|
43
|
+
}, 5000);
|
|
44
|
+
|
|
45
|
+
return () => clearInterval(blinkInterval);
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
const calculateEyePosition = (): EyePosition => {
|
|
49
|
+
const containerCenterX = 32;
|
|
50
|
+
const containerCenterY = 32;
|
|
51
|
+
|
|
52
|
+
const deltaX = mousePosition.x - containerCenterX;
|
|
53
|
+
const deltaY = mousePosition.y - containerCenterY;
|
|
54
|
+
|
|
55
|
+
const maxMoveX = 6;
|
|
56
|
+
const maxMoveY = 6;
|
|
57
|
+
|
|
58
|
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
59
|
+
const maxDistance = 50;
|
|
60
|
+
|
|
61
|
+
if (distance === 0) return { x: 0, y: 0 };
|
|
62
|
+
|
|
63
|
+
const moveRatio = Math.min(distance / maxDistance, 1);
|
|
64
|
+
|
|
65
|
+
const moveX = (deltaX / distance) * maxMoveX * moveRatio;
|
|
66
|
+
const moveY = (deltaY / distance) * maxMoveY * moveRatio;
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
x: Math.max(-maxMoveX, Math.min(maxMoveX, moveX)),
|
|
70
|
+
y: Math.max(-maxMoveY, Math.min(maxMoveY, moveY)),
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const calculateEyeScale = (isLeftEye: boolean) => {
|
|
75
|
+
const containerCenterX = 32;
|
|
76
|
+
const deltaX = mousePosition.x - containerCenterX;
|
|
77
|
+
const threshold = 400;
|
|
78
|
+
|
|
79
|
+
if (Math.abs(deltaX) < threshold) {
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const extremeDelta = Math.abs(deltaX) - threshold;
|
|
84
|
+
const maxExtremeDelta = 32 - threshold;
|
|
85
|
+
const scaleRatio = Math.min(extremeDelta / maxExtremeDelta, 1);
|
|
86
|
+
|
|
87
|
+
if (deltaX > threshold) {
|
|
88
|
+
if (isLeftEye) {
|
|
89
|
+
return 1 - scaleRatio * 0.5;
|
|
90
|
+
} else {
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
} else if (deltaX < -threshold) {
|
|
94
|
+
if (isLeftEye) {
|
|
95
|
+
return 1;
|
|
96
|
+
} else {
|
|
97
|
+
return 1 - scaleRatio * 0.5;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return 1;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const leftEyePosition = calculateEyePosition();
|
|
105
|
+
const rightEyePosition = calculateEyePosition();
|
|
106
|
+
const leftEyeScale = calculateEyeScale(true);
|
|
107
|
+
const rightEyeScale = calculateEyeScale(false);
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<div ref={containerRef} className={styles.container}>
|
|
111
|
+
<div
|
|
112
|
+
className={cx(styles.eye, styles.leftEye, isBlinking ? styles.blinkingEye : '')}
|
|
113
|
+
style={{
|
|
114
|
+
transform: `translate(${leftEyePosition.x}px, ${leftEyePosition.y
|
|
115
|
+
}px) ${isBlinking ? "scaleY(0.1)" : `scaleY(${leftEyeScale})`}`,
|
|
116
|
+
}}
|
|
117
|
+
/>
|
|
118
|
+
<div
|
|
119
|
+
className={cx(styles.eye, styles.rightEye, isBlinking ? styles.blinkingEye : '')}
|
|
120
|
+
style={{
|
|
121
|
+
transform: `translate(${rightEyePosition.x}px, ${rightEyePosition.y
|
|
122
|
+
}px) ${isBlinking ? "scaleY(0.1)" : `scaleY(${rightEyeScale})`}`,
|
|
123
|
+
}}
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export default EyeFollower;
|
|
130
|
+
|
|
131
|
+
const useStyle = createStyles(({ css, token }) => ({
|
|
132
|
+
container: {
|
|
133
|
+
width: 64,
|
|
134
|
+
height: 64,
|
|
135
|
+
backgroundColor: "black",
|
|
136
|
+
borderRadius: 12,
|
|
137
|
+
position: 'relative',
|
|
138
|
+
cursor: 'pointer',
|
|
139
|
+
overflow: 'hidden',
|
|
140
|
+
boxShadow:
|
|
141
|
+
"15px 0px 30px -10px rgba(131, 88, 246, 0.4), 0px 0px 30px -10px rgba(255, 142, 168, 0.4), -15px 0px 30px -10px rgba(225, 163, 37, 0.4)",
|
|
142
|
+
},
|
|
143
|
+
eye: {
|
|
144
|
+
width: 6,
|
|
145
|
+
height: 12,
|
|
146
|
+
backgroundColor: 'white',
|
|
147
|
+
borderRadius: 99,
|
|
148
|
+
position: 'absolute',
|
|
149
|
+
top: 16,
|
|
150
|
+
transition: 'transform 0.1s ease-out',
|
|
151
|
+
},
|
|
152
|
+
leftEye: {
|
|
153
|
+
left: 22,
|
|
154
|
+
},
|
|
155
|
+
rightEye: {
|
|
156
|
+
left: 36,
|
|
157
|
+
},
|
|
158
|
+
blinkingEye: {
|
|
159
|
+
transition: "transform 0.05s ease-out",
|
|
160
|
+
},
|
|
161
|
+
}))
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Welcome, ChatInput } from '@agentscope-ai/chat';
|
|
2
|
+
import { Flex } from 'antd';
|
|
3
|
+
|
|
4
|
+
export default function () {
|
|
5
|
+
return <Flex vertical style={{ height: '100%', }}>
|
|
6
|
+
<Welcome
|
|
7
|
+
style={{ justifyContent: 'center', flex: 1 }}
|
|
8
|
+
logo={null}
|
|
9
|
+
title={<div style={{ textAlign: 'center' }}>Nice to meet you!</div>}
|
|
10
|
+
desc="How can I help you today?"
|
|
11
|
+
/>
|
|
12
|
+
<ChatInput placeholder='Please type here...' />
|
|
13
|
+
</Flex>
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChatInput, Welcome } from '@agentscope-ai/chat';
|
|
2
|
+
import { Flex } from "antd";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default function () {
|
|
6
|
+
return <Flex vertical style={{ height: '100%', }}>
|
|
7
|
+
<Welcome
|
|
8
|
+
style={{ justifyContent: 'center', flex: 1 }}
|
|
9
|
+
title="Nice to meet you!"
|
|
10
|
+
desc="How can I help you today?"
|
|
11
|
+
logo="https://gw.alicdn.com/imgextra/i3/O1CN01VFloZL1oERpBMx2Nv_!!6000000005193-55-tps-56-56.svg"
|
|
12
|
+
/>
|
|
13
|
+
|
|
14
|
+
<ChatInput placeholder='Please type here...' />
|
|
15
|
+
</Flex>
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ChatInput, Welcome } from '@agentscope-ai/chat';
|
|
3
|
+
import { Flex } from "antd";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default function () {
|
|
7
|
+
return <Flex vertical style={{ height: '100%', }}>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<Welcome
|
|
11
|
+
style={{ display: 'block', marginTop: 32, flex: 1 }}
|
|
12
|
+
title="How can I help you today?"
|
|
13
|
+
desc={null}
|
|
14
|
+
logo={
|
|
15
|
+
<img
|
|
16
|
+
style={{
|
|
17
|
+
width: 40,
|
|
18
|
+
height: 40,
|
|
19
|
+
marginBottom: 10,
|
|
20
|
+
}}
|
|
21
|
+
src="https://gw.alicdn.com/imgextra/i3/O1CN01VFloZL1oERpBMx2Nv_!!6000000005193-55-tps-56-56.svg" />
|
|
22
|
+
}
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<ChatInput placeholder='Please type here...' />
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</Flex>
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChatInput } from '@agentscope-ai/chat';
|
|
2
|
+
import { Flex } from "antd";
|
|
3
|
+
import EyeFollower from './EyeFollower';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export default function () {
|
|
7
|
+
|
|
8
|
+
return <Flex vertical style={{ height: '100%', }}>
|
|
9
|
+
<Flex justify='center' style={{ margin: '64px 0 32px 0', }}>
|
|
10
|
+
<EyeFollower />
|
|
11
|
+
</Flex>
|
|
12
|
+
|
|
13
|
+
<ChatInput placeholder='Please type here...' />
|
|
14
|
+
</Flex>
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 3
|
|
3
|
+
|
|
4
|
+
group:
|
|
5
|
+
title: Display
|
|
6
|
+
order: 1
|
|
7
|
+
title: Welcome
|
|
8
|
+
description: Landing welcome page for conversations
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<DemoTitle title="Welcome" desc="Landing welcome page for conversations"></DemoTitle>
|
|
12
|
+
|
|
13
|
+
<code src="./demo/demo0.tsx">Example</code>
|
|
14
|
+
|
|
15
|
+
<Install>import { Welcome } from '@agentscope-ai/chat'</Install>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
#### Welcome Examples
|
|
19
|
+
|
|
20
|
+
The following are examples and variations of the welcome page component
|
|
21
|
+
|
|
22
|
+
<code src="./demo/demo1.tsx">With Branding - A</code>
|
|
23
|
+
<code src="./demo/demo2.tsx">With Branding - B</code>
|
|
24
|
+
<code src="./demo/demo3.tsx" height="400">Custom</code>
|
|
25
|
+
|
|
26
|
+
#### API
|
|
27
|
+
|
|
28
|
+
<ApiParser source="./index.tsx" id="IWelcomeProps"></ApiParser>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { createGlobalStyle } from 'antd-style';
|
|
3
|
+
import { useProviderContext } from '@agentscope-ai/chat';
|
|
4
|
+
export interface IWelcomeProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 欢迎页面的主标题,支持文本或React元素
|
|
7
|
+
* @descriptionEn Main title of the welcome page, supports text or React elements
|
|
8
|
+
*/
|
|
9
|
+
title?: React.ReactNode | string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @description 欢迎页面的描述文本,用于补充说明或引导用户
|
|
13
|
+
* @descriptionEn Description text of the welcome page for supplementary explanation or user guidance
|
|
14
|
+
*/
|
|
15
|
+
desc?: React.ReactNode | string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @description 欢迎页面的品牌标识,支持图片URL或自定义React元素
|
|
19
|
+
* @descriptionEn Brand logo of the welcome page, supports image URL or custom React elements
|
|
20
|
+
*/
|
|
21
|
+
logo?: React.ReactNode | string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @description 欢迎组件的内联样式对象,用于自定义外观
|
|
25
|
+
* @descriptionEn Inline style object for the welcome component for customizing appearance
|
|
26
|
+
*/
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const Style = createGlobalStyle`
|
|
31
|
+
.${(p) => p.theme.prefixCls}-welcome {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
|
|
35
|
+
&-logo {
|
|
36
|
+
display: block;
|
|
37
|
+
margin-right: 20px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&-title {
|
|
41
|
+
font-size: 24px;
|
|
42
|
+
line-height: 36px;
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
color: ${(p) => p.theme.colorText};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&-desc {
|
|
48
|
+
margin-top: 4px;
|
|
49
|
+
font-size: 24px;
|
|
50
|
+
line-height: 36px;
|
|
51
|
+
color: ${(p) => p.theme.colorTextSecondary};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export default function (props: IWelcomeProps) {
|
|
57
|
+
const { getPrefixCls } = useProviderContext();
|
|
58
|
+
const prefix = getPrefixCls('welcome');
|
|
59
|
+
const logoEle = typeof props.logo === 'string' ? <img className={prefix + '-logo'} src={props.logo} /> : props.logo;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return <>
|
|
63
|
+
<Style />
|
|
64
|
+
<div className={prefix} style={props.style}>
|
|
65
|
+
{logoEle}
|
|
66
|
+
<div>
|
|
67
|
+
{<div className={prefix + '-title'}>{props.title}</div>}
|
|
68
|
+
{<div className={prefix + '-desc'}>{props.desc}</div>}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 3
|
|
3
|
+
|
|
4
|
+
group:
|
|
5
|
+
title: 展现
|
|
6
|
+
order: 1
|
|
7
|
+
title: Welcome
|
|
8
|
+
description: 对话的落地欢迎页
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<DemoTitle title="Welcome" desc="对话的落地欢迎页"></DemoTitle>
|
|
12
|
+
|
|
13
|
+
<code src="./demo/demo0.tsx">示例</code>
|
|
14
|
+
|
|
15
|
+
<Install>import { Welcome } from '@agentscope-ai/chat'</Install>
|
|
16
|
+
|
|
17
|
+
#### 欢迎页示例
|
|
18
|
+
|
|
19
|
+
以下是欢迎页组件的示例和变体
|
|
20
|
+
|
|
21
|
+
<code src="./demo/demo1.tsx">附带品牌 - A</code>
|
|
22
|
+
<code src="./demo/demo2.tsx">附带品牌 - B</code>
|
|
23
|
+
<code src="./demo/demo3.tsx" height="400">自定义</code>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
#### API
|
|
27
|
+
|
|
28
|
+
<ApiParser source="./index.tsx" id="IWelcomeProps"></ApiParser>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export { ConfigProvider } from 'antd';
|
|
2
|
+
|
|
3
|
+
export { default as version } from './Version';
|
|
4
|
+
|
|
5
|
+
export * from '@copilotkit/react-core';
|
|
6
|
+
export * from './AGUI';
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
CustomCardsContext,
|
|
10
|
+
CustomCardsProvider,
|
|
11
|
+
default as SparkChatProvider,
|
|
12
|
+
useCustomCardsContext,
|
|
13
|
+
useGlobalContext,
|
|
14
|
+
useProviderContext,
|
|
15
|
+
} from './Provider';
|
|
16
|
+
|
|
17
|
+
export { default as Stream } from './Stream';
|
|
18
|
+
export type { StreamOptions as StreamOptions } from './Stream';
|
|
19
|
+
|
|
20
|
+
export { createCard } from './Bubble/Cards';
|
|
21
|
+
export {
|
|
22
|
+
default as ChatAnywhere,
|
|
23
|
+
useChatAnywhere,
|
|
24
|
+
useInput,
|
|
25
|
+
useMessages,
|
|
26
|
+
useSessionList,
|
|
27
|
+
uuid,
|
|
28
|
+
} from './ChatAnywhere';
|
|
29
|
+
export type { ChatAnywhereRef, TMessage, TSession } from './ChatAnywhere';
|
|
30
|
+
export * as DefaultCards from './DefaultCards';
|
|
31
|
+
|
|
32
|
+
export { default as AgentScopeRuntimeWebUI } from './AgentScopeRuntimeWebUI';
|
|
33
|
+
export * from './AgentScopeRuntimeWebUI/lib/types';
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
Accordion,
|
|
37
|
+
Accordion as Process,
|
|
38
|
+
type IAccordionProps,
|
|
39
|
+
type IAccordionProps as IProcess,
|
|
40
|
+
} from './Accordion';
|
|
41
|
+
export {
|
|
42
|
+
default as DeepThink,
|
|
43
|
+
default as DeepThinking,
|
|
44
|
+
type IDeepThinking,
|
|
45
|
+
} from './Accordion/DeepThinking';
|
|
46
|
+
export {
|
|
47
|
+
default as Attachments,
|
|
48
|
+
type AttachmentsProps,
|
|
49
|
+
type AttachmentsProps as IAttachmentsProps,
|
|
50
|
+
} from './Attachments';
|
|
51
|
+
export {
|
|
52
|
+
default as Bubble,
|
|
53
|
+
type BubbleProps,
|
|
54
|
+
type BubbleProps as IBubbleProps,
|
|
55
|
+
} from './Bubble';
|
|
56
|
+
export {
|
|
57
|
+
default as Conversations,
|
|
58
|
+
default as HistoryPanel,
|
|
59
|
+
type ConversationsProps,
|
|
60
|
+
type ConversationsProps as IHistoryPanel,
|
|
61
|
+
} from './Conversations';
|
|
62
|
+
export {
|
|
63
|
+
default as DeviceAction,
|
|
64
|
+
type IDeviceActionProps,
|
|
65
|
+
} from './DeviceAction';
|
|
66
|
+
export { default as Disclaimer, type IDisclaimerProps } from './Disclaimer';
|
|
67
|
+
export {
|
|
68
|
+
default as ImageGenerator,
|
|
69
|
+
type IImageGeneratorProps,
|
|
70
|
+
} from './ImageGenerator';
|
|
71
|
+
export { default as Mermaid, type IMermaidProps } from './Mermaid';
|
|
72
|
+
export { default as OperateCard, type IOperateCardProps } from './OperateCard';
|
|
73
|
+
export * from './OperateCard/preset';
|
|
74
|
+
export {
|
|
75
|
+
default as ChatInput,
|
|
76
|
+
default as Sender,
|
|
77
|
+
type SenderProps as IChatInputProps,
|
|
78
|
+
type SenderProps,
|
|
79
|
+
} from './Sender';
|
|
80
|
+
export { default as StatusCard, type IStatusCardProps } from './StatusCard';
|
|
81
|
+
export { default as sleep } from './Util/sleep';
|
|
82
|
+
export { default as Welcome, type IWelcomeProps } from './Welcome';
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
default as Markdown,
|
|
86
|
+
type MarkdownProps as IMarkdownProps,
|
|
87
|
+
type MarkdownProps,
|
|
88
|
+
} from './Markdown';
|