@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,100 @@
|
|
|
1
|
+
import { SparkHomeLine, SparkCheckCircleLine, SparkLoadingLine, SparkUndoLine, SparkTargetLine, SparkSortLine, SparkEditLine, SparkKeyboardLine, SparkOtherLine, SparkPlaying02Line, SparkCommandLine, SparkDragDotLine, SparkPlaying01Line, SparkTrackpadLine, SparkUserCheckedLine } from "@agentscope-ai/icons";
|
|
2
|
+
|
|
3
|
+
const actionMap = {
|
|
4
|
+
Click: {
|
|
5
|
+
name: '点击',
|
|
6
|
+
icon: <SparkTargetLine />,
|
|
7
|
+
},
|
|
8
|
+
Swipe: {
|
|
9
|
+
name: '滑动',
|
|
10
|
+
icon: <SparkSortLine />,
|
|
11
|
+
},
|
|
12
|
+
Type: {
|
|
13
|
+
name: '输入',
|
|
14
|
+
icon: <SparkEditLine />,
|
|
15
|
+
},
|
|
16
|
+
Back: {
|
|
17
|
+
name: '返回',
|
|
18
|
+
icon: <SparkUndoLine />,
|
|
19
|
+
},
|
|
20
|
+
Home: {
|
|
21
|
+
name: '主页',
|
|
22
|
+
icon: <SparkHomeLine />,
|
|
23
|
+
},
|
|
24
|
+
Done: {
|
|
25
|
+
name: '完成',
|
|
26
|
+
icon: <SparkCheckCircleLine />,
|
|
27
|
+
},
|
|
28
|
+
Wait: {
|
|
29
|
+
name: '等待',
|
|
30
|
+
icon: <SparkLoadingLine spin />,
|
|
31
|
+
},
|
|
32
|
+
click: {
|
|
33
|
+
name: '点击',
|
|
34
|
+
icon: <SparkTargetLine />,
|
|
35
|
+
},
|
|
36
|
+
'right click': {
|
|
37
|
+
name: '右键点击',
|
|
38
|
+
icon: <SparkTargetLine />,
|
|
39
|
+
},
|
|
40
|
+
'open app': {
|
|
41
|
+
name: '打开应用',
|
|
42
|
+
icon: <SparkOtherLine />,
|
|
43
|
+
},
|
|
44
|
+
computer_double_click: {
|
|
45
|
+
name: '双击',
|
|
46
|
+
icon: <SparkPlaying02Line />,
|
|
47
|
+
},
|
|
48
|
+
hotkey: {
|
|
49
|
+
name: '快捷键',
|
|
50
|
+
icon: <SparkCommandLine />,
|
|
51
|
+
},
|
|
52
|
+
presskey: {
|
|
53
|
+
name: '按键',
|
|
54
|
+
icon: <SparkKeyboardLine />,
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
scroll: {
|
|
58
|
+
name: '滚动',
|
|
59
|
+
icon: <SparkSortLine />,
|
|
60
|
+
},
|
|
61
|
+
drag: {
|
|
62
|
+
name: '拖拽',
|
|
63
|
+
icon: <SparkDragDotLine />,
|
|
64
|
+
},
|
|
65
|
+
type_with_clear_enter_pos: {
|
|
66
|
+
name: '输入并清除',
|
|
67
|
+
icon: <SparkEditLine />,
|
|
68
|
+
},
|
|
69
|
+
triple_click: {
|
|
70
|
+
name: '三击',
|
|
71
|
+
icon: <SparkPlaying01Line />,
|
|
72
|
+
},
|
|
73
|
+
drag_end: {
|
|
74
|
+
name: '拖拽结束',
|
|
75
|
+
icon: <SparkDragDotLine />,
|
|
76
|
+
},
|
|
77
|
+
type: {
|
|
78
|
+
name: '输入',
|
|
79
|
+
icon: <SparkEditLine />,
|
|
80
|
+
},
|
|
81
|
+
hscroll: {
|
|
82
|
+
name: '水平滚动',
|
|
83
|
+
icon: <SparkTrackpadLine />,
|
|
84
|
+
},
|
|
85
|
+
done: {
|
|
86
|
+
name: '完成',
|
|
87
|
+
icon: <SparkCheckCircleLine />,
|
|
88
|
+
},
|
|
89
|
+
wait: {
|
|
90
|
+
name: '等待',
|
|
91
|
+
icon: <SparkLoadingLine spin />,
|
|
92
|
+
},
|
|
93
|
+
call_user: {
|
|
94
|
+
name: '呼叫用户',
|
|
95
|
+
icon: <SparkUserCheckedLine />,
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export default actionMap;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { DeviceAction, IDeviceActionProps } from "@agentscope-ai/chat";
|
|
2
|
+
import { Flex } from "antd";
|
|
3
|
+
|
|
4
|
+
const actions = [
|
|
5
|
+
{
|
|
6
|
+
time: "2:00:00",
|
|
7
|
+
action: "Click",
|
|
8
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
time: "2:00:05",
|
|
12
|
+
action: "Swipe",
|
|
13
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
time: "2:00:10",
|
|
17
|
+
action: "Type",
|
|
18
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
time: "2:00:15",
|
|
22
|
+
action: "Back",
|
|
23
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
time: "2:00:20",
|
|
27
|
+
action: "Home",
|
|
28
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
time: "2:00:25",
|
|
32
|
+
action: "Done",
|
|
33
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
time: "2:00:30",
|
|
37
|
+
action: "Wait",
|
|
38
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
time: "2:00:35",
|
|
42
|
+
action: "call_user",
|
|
43
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
time: "2:00:40",
|
|
47
|
+
action: "click",
|
|
48
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
time: "2:00:45",
|
|
52
|
+
action: "right click",
|
|
53
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
time: "2:00:50",
|
|
57
|
+
action: "open app",
|
|
58
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
time: "2:00:55",
|
|
62
|
+
action: "computer_double_click",
|
|
63
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
time: "2:01:00",
|
|
67
|
+
action: "hotkey",
|
|
68
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
time: "2:01:05",
|
|
72
|
+
action: "presskey",
|
|
73
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
time: "2:01:10",
|
|
77
|
+
action: "scroll",
|
|
78
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
time: "2:01:15",
|
|
82
|
+
action: "drag",
|
|
83
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
time: "2:01:20",
|
|
87
|
+
action: "type_with_clear_enter_pos",
|
|
88
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
time: "2:01:25",
|
|
92
|
+
action: "triple_click",
|
|
93
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
time: "2:01:30",
|
|
97
|
+
action: "drag_end",
|
|
98
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
time: "2:01:35",
|
|
102
|
+
action: "type",
|
|
103
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
time: "2:01:40",
|
|
107
|
+
action: "hscroll",
|
|
108
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
time: "2:01:45",
|
|
112
|
+
action: "done",
|
|
113
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
time: "2:01:50",
|
|
117
|
+
action: "wait",
|
|
118
|
+
image: "https://gw.alicdn.com/imgextra/i3/O1CN01jnIWvS1OQC0DWx9Tu_!!6000000001699-0-tps-1200-687.jpg"
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
export default function () {
|
|
124
|
+
return <Flex gap={16} vertical>
|
|
125
|
+
{
|
|
126
|
+
actions.map((item, index) => {
|
|
127
|
+
return <DeviceAction key={index} {...item} description={`description for ${item.action}...`} action={item.action as IDeviceActionProps['action']} />
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
</Flex>
|
|
132
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 4
|
|
3
|
+
|
|
4
|
+
group:
|
|
5
|
+
title: Output
|
|
6
|
+
order: 3
|
|
7
|
+
title: DeviceAction
|
|
8
|
+
description: A card that shows AI operating the device in real time
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<DemoTitle title="DeviceAction" desc="A card that shows AI operating the device in real time" llmTxtName="DeviceAction"></DemoTitle>
|
|
12
|
+
|
|
13
|
+
<code src="./demo/index.tsx" height="auto">Example</code>
|
|
14
|
+
|
|
15
|
+
<Install>import { DeviceAction } from '@agentscope-ai/chat'</Install>
|
|
16
|
+
|
|
17
|
+
#### API
|
|
18
|
+
|
|
19
|
+
<ApiParser source="./index.tsx" id="IDeviceActionProps"></ApiParser>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
|
|
2
|
+
import { OperateCard, useProviderContext } from '@agentscope-ai/chat';
|
|
3
|
+
import { ConfigProvider, Image } from 'antd';
|
|
4
|
+
import { Locale } from 'antd/es/locale';
|
|
5
|
+
import actionMap from './actionMap';
|
|
6
|
+
|
|
7
|
+
export interface IDeviceActionProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description 时间
|
|
10
|
+
* @descriptionEn Time
|
|
11
|
+
* @default ''
|
|
12
|
+
*/
|
|
13
|
+
time?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description 动作
|
|
16
|
+
* @descriptionEn Action
|
|
17
|
+
* @default ''
|
|
18
|
+
*/
|
|
19
|
+
action: 'Click' | 'Swipe' | 'Type' | 'Back' | 'Home' | 'Done' | 'Wait' | 'click' | 'right click' | 'open app' | 'computer_double_click' | 'hotkey' | 'presskey' | 'scroll' | 'drag' | 'type_with_clear_enter_pos' | 'triple_click' | 'drag_end' | 'type' | 'hscroll' | 'done' | 'wait' | 'call_user',
|
|
20
|
+
/**
|
|
21
|
+
* @description 动作名称,通常不用传入,会根据 action 自动生成
|
|
22
|
+
* @descriptionEn Action Name, usually not passed in, will be generated automatically based on action
|
|
23
|
+
* @default ''
|
|
24
|
+
*/
|
|
25
|
+
actionName?: string;
|
|
26
|
+
/**
|
|
27
|
+
* @description 描述
|
|
28
|
+
* @descriptionEn Description
|
|
29
|
+
* @default ''
|
|
30
|
+
*/
|
|
31
|
+
description: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 操作截图
|
|
34
|
+
* @descriptionEn Operation Screenshot
|
|
35
|
+
* @default ''
|
|
36
|
+
*/
|
|
37
|
+
image?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export default function (props: IDeviceActionProps) {
|
|
42
|
+
const { getPrefixCls } = useProviderContext();
|
|
43
|
+
const prefixCls = getPrefixCls('operate-card');
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return <div>
|
|
47
|
+
<div className={`${prefixCls}-device-action-time`}>{props.time}</div>
|
|
48
|
+
|
|
49
|
+
<OperateCard header={{
|
|
50
|
+
className: `${prefixCls}-device-action`,
|
|
51
|
+
icon: <div className={`${prefixCls}-device-action-icon`}>{actionMap[props.action]?.icon}</div>,
|
|
52
|
+
title: <div className={`${prefixCls}-device-action-content`}>
|
|
53
|
+
<div className={`${prefixCls}-device-action-description`}>
|
|
54
|
+
<span>
|
|
55
|
+
{props.actionName || actionMap[props.action]?.name}
|
|
56
|
+
</span>
|
|
57
|
+
<span>
|
|
58
|
+
{props.description}
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<div className={`${prefixCls}-device-action-image`} >
|
|
63
|
+
<ConfigProvider
|
|
64
|
+
locale={{
|
|
65
|
+
Image: { preview: '' }
|
|
66
|
+
} as Locale}
|
|
67
|
+
>
|
|
68
|
+
<Image src={props.image} alt={props.description} width={'100%'} height={'100%'} />
|
|
69
|
+
|
|
70
|
+
</ConfigProvider>
|
|
71
|
+
</div>
|
|
72
|
+
</div>,
|
|
73
|
+
}} />
|
|
74
|
+
</div>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 4
|
|
3
|
+
|
|
4
|
+
group:
|
|
5
|
+
title: 输出
|
|
6
|
+
order: 3
|
|
7
|
+
title: DeviceAction
|
|
8
|
+
description: 一种展示AI对设备进行实时操作行为的卡片
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<DemoTitle title="DeviceAction" desc="一种展示AI对设备进行实时操作行为的卡片" llmTxtName="DeviceAction"></DemoTitle>
|
|
12
|
+
|
|
13
|
+
<code src="./demo/index.tsx" height="auto">示例</code>
|
|
14
|
+
|
|
15
|
+
<Install>import { DeviceAction } from '@agentscope-ai/chat'</Install>
|
|
16
|
+
|
|
17
|
+
#### API
|
|
18
|
+
|
|
19
|
+
<ApiParser source="./index.tsx" id="IDeviceActionProps"></ApiParser>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 1
|
|
3
|
+
group:
|
|
4
|
+
title: Display
|
|
5
|
+
order: 1
|
|
6
|
+
title: Disclaimer
|
|
7
|
+
description: Disclaimer
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<DemoTitle title="Disclaimer" desc="Disclaimer"></DemoTitle>
|
|
11
|
+
|
|
12
|
+
<code src="./demo/index.tsx" center>Example</code>
|
|
13
|
+
|
|
14
|
+
<Install>import { Disclaimer } from '@agentscope-ai/chat'</Install>
|
|
15
|
+
|
|
16
|
+
#### Disclaimer Examples
|
|
17
|
+
|
|
18
|
+
The following are examples and variations of this component
|
|
19
|
+
<code src="./demo/withLink.tsx" center>With Embedded Link</code>
|
|
20
|
+
|
|
21
|
+
#### API
|
|
22
|
+
|
|
23
|
+
<ApiParser source="./index.tsx" id="IDisclaimerProps"></ApiParser>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Style from './style';
|
|
3
|
+
import { useProviderContext } from '@agentscope-ai/chat';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export interface IDisclaimerProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description 免责声明的文本内容,用于提醒用户AI的局限性
|
|
10
|
+
* @descriptionEn Disclaimer text content for reminding users of AI limitations
|
|
11
|
+
*/
|
|
12
|
+
desc?: React.ReactElement | string
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @description 免责声明组件的内联样式对象,用于自定义外观
|
|
16
|
+
* @descriptionEn Inline style object for the disclaimer component for customizing appearance
|
|
17
|
+
*/
|
|
18
|
+
style?: React.CSSProperties
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @description 免责声明后的链接配置,用于提供更多相关信息
|
|
22
|
+
* @descriptionEn Link configuration after disclaimer for providing additional relevant information
|
|
23
|
+
*/
|
|
24
|
+
afterLink?: {
|
|
25
|
+
href: string
|
|
26
|
+
text: string
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default function (props: IDisclaimerProps) {
|
|
31
|
+
const { desc = 'AI can also make mistakes, so please check carefully and use it with caution' } = props;
|
|
32
|
+
const { getPrefixCls } = useProviderContext();
|
|
33
|
+
const prefixCls = getPrefixCls('disclaimer');
|
|
34
|
+
|
|
35
|
+
return <>
|
|
36
|
+
<Style />
|
|
37
|
+
<div className={prefixCls} style={props.style}>
|
|
38
|
+
{desc}
|
|
39
|
+
{props.afterLink && <a className={`${prefixCls}-after-link`} href={props.afterLink.href} target="_blank">{props.afterLink.text}</a>}
|
|
40
|
+
</div>
|
|
41
|
+
</>
|
|
42
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
order: 1
|
|
3
|
+
group:
|
|
4
|
+
title: 展现
|
|
5
|
+
order: 1
|
|
6
|
+
title: Disclaimer
|
|
7
|
+
description: 免责声明
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<DemoTitle title="Disclaimer" desc="免责声明"></DemoTitle>
|
|
11
|
+
|
|
12
|
+
<code src="./demo/index.tsx" center>示例</code>
|
|
13
|
+
|
|
14
|
+
<Install>import { Disclaimer } from '@agentscope-ai/chat'</Install>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#### 免责声明示例
|
|
18
|
+
|
|
19
|
+
以下是此组件的示例和变体
|
|
20
|
+
<code src="./demo/withLink.tsx" center>嵌入链接</code>
|
|
21
|
+
|
|
22
|
+
#### API
|
|
23
|
+
|
|
24
|
+
<ApiParser source="./index.tsx" id="IDisclaimerProps"></ApiParser>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'antd-style';
|
|
2
|
+
|
|
3
|
+
export default createGlobalStyle`
|
|
4
|
+
.${(p) => p.theme.prefixCls}-disclaimer {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
line-height: 1.5;
|
|
10
|
+
color: ${(p) => p.theme.colorTextTertiary};
|
|
11
|
+
padding: 8px 12px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.${(p) => p.theme.prefixCls}-disclaimer-after-link {
|
|
15
|
+
padding-left: 8px;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ImageGenerator } from '@agentscope-ai/chat';
|
|
2
|
+
import { useTimeout } from 'ahooks';
|
|
3
|
+
import { Flex } from 'antd';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
export default function () {
|
|
7
|
+
const [src, setSrc] = useState('');
|
|
8
|
+
|
|
9
|
+
useTimeout(() => {
|
|
10
|
+
setSrc('https://img.alicdn.com/imgextra/i1/O1CN01lS5S0a1yl6FKoBZHl_!!6000000006618-0-tps-1280-1280.jpg');
|
|
11
|
+
}, 20 * 1000)
|
|
12
|
+
|
|
13
|
+
return <Flex vertical gap="middle">
|
|
14
|
+
<ImageGenerator
|
|
15
|
+
src={src}
|
|
16
|
+
skeletonText="Painting..."
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<ImageGenerator
|
|
20
|
+
src="https://img.alicdn.com/imgextra/i1/O1CN01lS5S0a1yl6FKoBZHl_!!6000000006618-0-tps-1280-1280.jpg"
|
|
21
|
+
/>
|
|
22
|
+
</Flex>
|
|
23
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ImageGenerator } from '@agentscope-ai/chat';
|
|
2
|
+
import { Flex } from 'antd';
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const useStyles = createStyles(({ token }) => {
|
|
7
|
+
return {
|
|
8
|
+
skeleton: {
|
|
9
|
+
position: 'relative',
|
|
10
|
+
overflow: 'hidden',
|
|
11
|
+
borderRadius: 8,
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
},
|
|
16
|
+
bg: {
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
top: '50%',
|
|
19
|
+
left: '50%',
|
|
20
|
+
width: '200%',
|
|
21
|
+
height: '200%',
|
|
22
|
+
transform: 'translate(-50%, -50%) rotate(0deg)',
|
|
23
|
+
objectFit: 'cover',
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
width: 64,
|
|
27
|
+
height: 64,
|
|
28
|
+
zIndex: 1,
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export default function () {
|
|
34
|
+
const { styles } = useStyles();
|
|
35
|
+
return <Flex vertical gap="middle">
|
|
36
|
+
<ImageGenerator
|
|
37
|
+
|
|
38
|
+
skeleton={<div className={styles.skeleton} style={{ width: 320, height: 320 }}>
|
|
39
|
+
<img
|
|
40
|
+
className={styles.bg}
|
|
41
|
+
src="https://img.alicdn.com/imgextra/i2/O1CN01j5MC6r1scV7D2cNYt_!!6000000005787-2-tps-1366-1354.png"
|
|
42
|
+
alt=""
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<img
|
|
46
|
+
className={styles.icon}
|
|
47
|
+
src="https://img.alicdn.com/imgextra/i2/O1CN01tLbrX11xwGHaPhX0F_!!6000000006507-54-tps-500-500.apng"
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
</div>}
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
</Flex>
|
|
56
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ImageGenerator } from '@agentscope-ai/chat';
|
|
2
|
+
import { useTimeout } from 'ahooks';
|
|
3
|
+
import { Flex } from 'antd';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
export default function () {
|
|
7
|
+
|
|
8
|
+
return <Flex vertical gap="middle">
|
|
9
|
+
<ImageGenerator
|
|
10
|
+
width={16}
|
|
11
|
+
height={9}
|
|
12
|
+
block
|
|
13
|
+
/>
|
|
14
|
+
</Flex>
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
group:
|
|
3
|
+
title: Output
|
|
4
|
+
order: 3
|
|
5
|
+
title: ImageGenerator
|
|
6
|
+
description: Process display for image generation queries
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<DemoTitle title="ImageGenerator" desc="Process display for image generation queries"></DemoTitle>
|
|
10
|
+
|
|
11
|
+
<code src="./demo/basic.tsx" height="auto">Example</code>
|
|
12
|
+
|
|
13
|
+
<Install>import { ImageGenerator } from '@agentscope-ai/chat'</Install>
|
|
14
|
+
|
|
15
|
+
#### ImageGeneration Examples
|
|
16
|
+
|
|
17
|
+
<code src="./demo/size.tsx" height="auto">Custom Size</code>
|
|
18
|
+
|
|
19
|
+
<code src="./demo/custom.tsx" height="auto">Custom skeleton</code>
|
|
20
|
+
|
|
21
|
+
#### API
|
|
22
|
+
|
|
23
|
+
<ApiParser source="./index.tsx" id="IImageGeneratorProps"></ApiParser>
|