@agentscope-ai/chat 1.1.4 → 1.1.7
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/LICENSE +74 -0
- package/README.md +156 -56
- package/README.zh-CN.md +188 -0
- package/lib/AGUI/components/HelpModal/icons.d.ts +5 -0
- package/lib/AGUI/components/HelpModal/icons.js +84 -0
- package/lib/AGUI/components/HelpModal/index.d.ts +1 -0
- package/lib/AGUI/components/HelpModal/index.js +1 -0
- package/lib/AGUI/components/HelpModal/modal.d.ts +1 -0
- package/lib/AGUI/components/HelpModal/modal.js +104 -0
- package/lib/AGUI/components/chat/Button.d.ts +2 -0
- package/lib/AGUI/components/chat/Button.js +27 -0
- package/lib/AGUI/components/chat/Chat.d.ts +242 -0
- package/lib/AGUI/components/chat/Chat.js +634 -0
- package/lib/AGUI/components/chat/ChatContext.d.ts +142 -0
- package/lib/AGUI/components/chat/ChatContext.js +75 -0
- package/lib/AGUI/components/chat/CodeBlock.d.ts +12 -0
- package/lib/AGUI/components/chat/CodeBlock.js +398 -0
- package/lib/AGUI/components/chat/Header.d.ts +2 -0
- package/lib/AGUI/components/chat/Header.js +28 -0
- package/lib/AGUI/components/chat/Icons.d.ts +16 -0
- package/lib/AGUI/components/chat/Icons.js +247 -0
- package/lib/AGUI/components/chat/ImageUploadQueue.d.ts +11 -0
- package/lib/AGUI/components/chat/ImageUploadQueue.js +65 -0
- package/lib/AGUI/components/chat/Input.d.ts +2 -0
- package/lib/AGUI/components/chat/Input.js +30 -0
- package/lib/AGUI/components/chat/Markdown.d.ts +7 -0
- package/lib/AGUI/components/chat/Markdown.js +187 -0
- package/lib/AGUI/components/chat/Messages.d.ts +7 -0
- package/lib/AGUI/components/chat/Messages.js +242 -0
- package/lib/AGUI/components/chat/Modal.d.ts +43 -0
- package/lib/AGUI/components/chat/Modal.js +113 -0
- package/lib/AGUI/components/chat/Popup.d.ts +49 -0
- package/lib/AGUI/components/chat/Popup.js +64 -0
- package/lib/AGUI/components/chat/PoweredByTag.d.ts +3 -0
- package/lib/AGUI/components/chat/PoweredByTag.js +27 -0
- package/lib/AGUI/components/chat/Sidebar.d.ts +2 -0
- package/lib/AGUI/components/chat/Sidebar.js +85 -0
- package/lib/AGUI/components/chat/Suggestion.d.ts +16 -0
- package/{dist/voice-chat/VoiceChatService/index.js → lib/AGUI/components/chat/Suggestion.js} +138 -201
- package/lib/AGUI/components/chat/Suggestions.d.ts +2 -0
- package/lib/AGUI/components/chat/Suggestions.js +21 -0
- package/lib/AGUI/components/chat/Textarea.d.ts +11 -0
- package/lib/AGUI/components/chat/Textarea.js +60 -0
- package/lib/AGUI/components/chat/Window.d.ts +2 -0
- package/lib/AGUI/components/chat/Window.js +115 -0
- package/lib/AGUI/components/chat/index.d.ts +11 -0
- package/lib/AGUI/components/chat/index.js +11 -0
- package/lib/AGUI/components/chat/messages/AssistantMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/AssistantMessage.js +56 -0
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderActionExecutionMessage.js +114 -0
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderAgentStateMessage.js +97 -0
- package/lib/AGUI/components/chat/messages/RenderImageMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderImageMessage.js +61 -0
- package/lib/AGUI/components/chat/messages/RenderResultMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderResultMessage.js +27 -0
- package/lib/AGUI/components/chat/messages/RenderTextMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/RenderTextMessage.js +47 -0
- package/lib/AGUI/components/chat/messages/UserMessage.d.ts +2 -0
- package/lib/AGUI/components/chat/messages/UserMessage.js +9 -0
- package/lib/AGUI/components/chat/props.d.ts +157 -0
- package/lib/AGUI/components/index.d.ts +1 -0
- package/lib/AGUI/components/index.js +1 -0
- package/lib/AGUI/context/index.d.ts +1 -0
- package/lib/AGUI/hooks/index.d.ts +1 -0
- package/lib/AGUI/hooks/index.js +1 -0
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.d.ts +87 -0
- package/lib/AGUI/hooks/use-copilot-chat-suggestions.js +95 -0
- package/lib/AGUI/hooks/use-copy-to-clipboard.d.ts +7 -0
- package/{dist/theme/genStyleUtils.js → lib/AGUI/hooks/use-copy-to-clipboard.js} +27 -42
- package/lib/AGUI/hooks/use-dark-mode.d.ts +1 -0
- package/lib/AGUI/hooks/use-dark-mode.js +4 -0
- package/lib/AGUI/hooks/use-push-to-talk.d.ts +16 -0
- package/lib/AGUI/hooks/use-push-to-talk.js +260 -0
- package/lib/AGUI/index.d.ts +4 -0
- package/lib/AGUI/index.js +4 -0
- package/lib/AGUI/lib/utils.d.ts +2 -0
- package/lib/AGUI/lib/utils.js +52 -0
- package/lib/AGUI/types/index.d.ts +1 -0
- package/lib/AGUI/types/suggestions.d.ts +6 -0
- package/lib/Accordion/Accordion.d.ts +64 -0
- package/{dist/accordion → lib/Accordion}/Accordion.js +101 -40
- package/{dist/accordion → lib/Accordion}/BodyContent.d.ts +1 -1
- package/lib/Accordion/BodyContent.js +23 -0
- package/lib/Accordion/DeepThinking.d.ts +28 -0
- package/lib/Accordion/DeepThinking.js +35 -0
- package/lib/Accordion/SoftLightTitle.d.ts +3 -0
- package/lib/Accordion/SoftLightTitle.js +17 -0
- package/lib/Accordion/index.d.ts +2 -0
- package/lib/Accordion/style.d.ts +2 -0
- package/lib/Accordion/style.js +60 -0
- package/lib/Attachments/DropArea.d.ts +24 -0
- package/{dist/attachments → lib/Attachments}/DropArea.js +5 -11
- package/lib/Attachments/FileList/AudioIcon.d.ts +1 -0
- package/lib/Attachments/FileList/AudioIcon.js +24 -0
- package/lib/Attachments/FileList/FileListCard.d.ts +36 -0
- package/{dist/attachments → lib/Attachments}/FileList/FileListCard.js +109 -83
- package/lib/Attachments/FileList/Progress.d.ts +13 -0
- package/{dist/attachments → lib/Attachments}/FileList/Progress.js +7 -5
- package/lib/Attachments/FileList/VideoIcon.d.ts +1 -0
- package/lib/Attachments/FileList/VideoIcon.js +24 -0
- package/lib/Attachments/FileList/index.d.ts +56 -0
- package/{dist/attachments → lib/Attachments}/FileList/index.js +48 -48
- package/lib/Attachments/PlaceholderUploader.d.ts +49 -0
- package/{dist/attachments → lib/Attachments}/PlaceholderUploader.js +33 -28
- package/lib/Attachments/SilentUploader.d.ts +21 -0
- package/lib/Attachments/SilentUploader.js +30 -0
- package/lib/Attachments/context.d.ts +9 -0
- package/lib/Attachments/index.d.ts +97 -0
- package/lib/Attachments/index.en-US.md.bk +10 -0
- package/{dist/attachments → lib/Attachments}/index.js +51 -55
- package/lib/Attachments/index.zh-CN.md.bk +10 -0
- package/lib/Attachments/style/fileCard.d.ts +2 -0
- package/lib/Attachments/style/fileCard.js +68 -0
- package/lib/Attachments/style/index.d.ts +2 -0
- package/lib/Attachments/style/index.js +98 -0
- package/{dist/bubble → lib/Bubble}/Avatar.d.ts +0 -1
- package/{dist/bubble → lib/Bubble}/Avatar.js +8 -5
- package/lib/Bubble/Bubble.d.ts +19 -0
- package/{dist/bubble → lib/Bubble}/Bubble.js +39 -52
- package/lib/Bubble/BubbleList.d.ts +41 -0
- package/lib/Bubble/BubbleList.js +64 -0
- package/{dist/bubble → lib/Bubble}/Cards.d.ts +2 -8
- package/{dist/bubble → lib/Bubble}/Cards.js +9 -9
- package/{dist/bubble → lib/Bubble}/ScrollToBottom.d.ts +0 -1
- package/{dist/bubble → lib/Bubble}/ScrollToBottom.js +15 -14
- package/lib/Bubble/Spin.d.ts +1 -0
- package/lib/Bubble/Spin.js +21 -0
- package/lib/Bubble/hooks/useListData.d.ts +0 -0
- package/lib/Bubble/hooks/useListData.js +0 -0
- package/lib/Bubble/interface.d.ts +62 -0
- package/lib/Bubble/loading.js +17 -0
- package/lib/Bubble/style/avatar.d.ts +2 -0
- package/lib/Bubble/style/avatar.js +8 -0
- package/lib/Bubble/style/index.d.ts +2 -0
- package/lib/Bubble/style/index.js +46 -0
- package/lib/Bubble/style/list.d.ts +2 -0
- package/lib/Bubble/style/list.js +16 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/index.d.ts +0 -1
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/index.js +39 -28
- package/lib/ChatAnywhere/Chat/style.d.ts +2 -0
- package/lib/ChatAnywhere/Chat/style.js +14 -0
- package/lib/ChatAnywhere/Header/index.d.ts +1 -0
- package/lib/ChatAnywhere/Header/index.js +39 -0
- package/lib/ChatAnywhere/Header/style.d.ts +2 -0
- package/lib/ChatAnywhere/Header/style.js +12 -0
- package/lib/ChatAnywhere/Input/index.d.ts +3 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Input/index.js +87 -68
- package/lib/ChatAnywhere/Input/style.d.ts +2 -0
- package/lib/ChatAnywhere/Input/style.js +6 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/Layout/index.d.ts +1 -2
- package/lib/ChatAnywhere/Layout/index.js +91 -0
- package/lib/ChatAnywhere/Layout/style.d.ts +2 -0
- package/lib/ChatAnywhere/Layout/style.js +16 -0
- package/lib/ChatAnywhere/SessionList/index.d.ts +3 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/SessionList/index.js +67 -55
- package/lib/ChatAnywhere/SessionList/style.d.ts +2 -0
- package/lib/ChatAnywhere/SessionList/style.js +14 -0
- package/lib/ChatAnywhere/hooks/ChatAnywhereProvider.d.ts +148 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/ChatAnywhereProvider.js +11 -5
- package/lib/ChatAnywhere/hooks/types.d.ts +312 -0
- package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.d.ts +3 -1
- package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useMessages.js +10 -2
- package/{dist/chat-anywhere → lib/ChatAnywhere}/index.d.ts +4 -1
- package/{dist/chat-anywhere → lib/ChatAnywhere}/index.js +28 -15
- package/{dist/conversations → lib/Conversations}/GroupTitle.d.ts +4 -0
- package/{dist/conversations → lib/Conversations}/GroupTitle.js +7 -5
- package/{dist/conversations → lib/Conversations}/Item.d.ts +1 -0
- package/lib/Conversations/Item.js +208 -0
- package/lib/Conversations/hooks/useGroupable.d.ts +8 -0
- package/lib/Conversations/index.d.ts +55 -0
- package/{dist/conversations → lib/Conversations}/index.js +50 -61
- package/lib/Conversations/interface.d.ts +56 -0
- package/lib/Conversations/style.d.ts +2 -0
- package/lib/Conversations/style.js +60 -0
- package/{dist/default-cards/DeepThink → lib/DefaultCards/DeepThinking}/index.d.ts +2 -3
- package/lib/DefaultCards/DeepThinking/index.js +12 -0
- package/lib/DefaultCards/Files/index.d.ts +1 -0
- package/lib/DefaultCards/Files/index.js +56 -0
- package/{dist/default-cards → lib/DefaultCards}/Footer/index.d.ts +3 -4
- package/lib/DefaultCards/Footer/index.js +74 -0
- package/lib/DefaultCards/Images/index.d.ts +1 -0
- package/lib/DefaultCards/Images/index.js +49 -0
- package/{dist/default-cards → lib/DefaultCards}/Interrupted/index.d.ts +1 -3
- package/lib/DefaultCards/Interrupted/index.js +54 -0
- package/lib/DefaultCards/Text/index.d.ts +1 -0
- package/{dist/default-cards → lib/DefaultCards}/Text/index.js +4 -2
- package/lib/DefaultCards/count/index.d.ts +1 -0
- package/lib/DefaultCards/count/index.js +36 -0
- package/{dist/default-cards → lib/DefaultCards}/index.d.ts +1 -1
- package/{dist/default-cards → lib/DefaultCards}/index.js +1 -1
- package/lib/Disclaimer/index.d.ts +22 -0
- package/lib/Disclaimer/index.js +26 -0
- package/lib/Disclaimer/style.d.ts +2 -0
- package/lib/Disclaimer/style.js +10 -0
- package/lib/ImageGenerator/index.d.ts +41 -0
- package/lib/ImageGenerator/index.js +75 -0
- package/lib/ImageGenerator/style.d.ts +2 -0
- package/lib/ImageGenerator/style.js +20 -0
- package/{dist/markdown → lib/Markdown}/Citation.js +19 -14
- package/{dist/markdown → lib/Markdown}/CodeBlock.d.ts +1 -0
- package/{dist/markdown → lib/Markdown}/CodeBlock.js +51 -30
- package/lib/Markdown/ImageOrMedia.d.ts +1 -0
- package/lib/Markdown/ImageOrMedia.js +113 -0
- package/lib/Markdown/Link.js +48 -0
- package/{dist/markdown → lib/Markdown}/Markdown.js +22 -11
- package/lib/Markdown/cursor/Dot.d.ts +1 -0
- package/lib/Markdown/cursor/Dot.js +35 -0
- package/lib/Markdown/cursor/Underline.d.ts +1 -0
- package/lib/Markdown/cursor/Underline.js +19 -0
- package/lib/Markdown/hooks/index.d.ts +0 -0
- package/lib/Markdown/hooks/index.js +0 -0
- package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.js +1 -1
- package/lib/Markdown/index.d.ts +63 -0
- package/lib/Markdown/index.js +44 -0
- package/lib/Markdown/style.d.ts +2 -0
- package/lib/Markdown/style.js +36 -0
- package/lib/Markdown/type.d.ts +186 -0
- package/{dist/markdown → lib/Markdown}/utils.js +1 -2
- package/lib/Mermaid/index.d.ts +18 -0
- package/{dist/voice-chat/Recorder → lib/Mermaid}/index.js +144 -160
- package/{dist/provider → lib/Provider}/CustomCardsProvider.d.ts +2 -1
- package/{dist/provider → lib/Provider}/CustomCardsProvider.js +5 -3
- package/{dist/provider → lib/Provider}/GlobalProvider.d.ts +1 -1
- package/{dist/provider → lib/Provider}/GlobalProvider.js +5 -3
- package/{dist/provider → lib/Provider}/index.d.ts +1 -2
- package/{dist/provider → lib/Provider}/index.js +9 -6
- package/lib/Provider/types.d.ts +24 -0
- package/lib/Provider/types.js +1 -0
- package/lib/Sender/ModeSelect/index.d.ts +17 -0
- package/lib/Sender/ModeSelect/index.js +109 -0
- package/lib/Sender/ModeSelect/styles.d.ts +0 -0
- package/lib/Sender/ModeSelect/styles.js +0 -0
- package/lib/Sender/SenderHeader.d.ts +63 -0
- package/{dist/sender → lib/Sender}/SenderHeader.js +40 -32
- package/{dist/sender → lib/Sender}/StopLoading.d.ts +1 -1
- package/lib/Sender/StopLoading.js +25 -0
- package/lib/Sender/components/ActionButton.d.ts +72 -0
- package/{dist/sender → lib/Sender}/components/ActionButton.js +9 -5
- package/lib/Sender/components/ClearButton.js +19 -0
- package/lib/Sender/components/LoadingButton.js +28 -0
- package/lib/Sender/components/SendButton.js +20 -0
- package/lib/Sender/components/SpeechButton/RecordingIcon.d.ts +8 -0
- package/lib/Sender/components/SpeechButton/RecordingIcon.js +54 -0
- package/lib/Sender/components/SpeechButton/index.js +35 -0
- package/lib/Sender/index.d.ts +142 -0
- package/{dist/sender → lib/Sender}/index.js +128 -121
- package/lib/Sender/style/index.d.ts +2 -0
- package/lib/Sender/style/index.js +41 -0
- package/{dist/stream → lib/Stream}/index.d.ts +4 -2
- package/{dist/stream → lib/Stream}/index.js +1 -1
- package/lib/Util/createStyle.d.ts +5 -0
- package/lib/Util/createStyle.js +20 -0
- package/lib/Util/sleep.d.ts +1 -0
- package/lib/Util/sleep.js +5 -0
- package/lib/Util/type.js +1 -0
- package/{dist/_util → lib/Util}/warning.d.ts +2 -2
- package/lib/Voice/Recorder.d.ts +1 -0
- package/lib/Voice/Recorder.js +6 -0
- package/lib/Voice/index.d.ts +0 -0
- package/lib/Voice/index.js +0 -0
- package/lib/Welcome/index.d.ts +24 -0
- package/lib/Welcome/index.js +39 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +24 -0
- package/lib/index.less +0 -0
- package/package.json +27 -13
- package/dist/accordion/Accordion.d.ts +0 -22
- package/dist/accordion/BodyContent.js +0 -18
- package/dist/accordion/DeepThink.d.ts +0 -7
- package/dist/accordion/DeepThink.js +0 -35
- package/dist/accordion/index.d.ts +0 -2
- package/dist/accordion/index.less +0 -170
- package/dist/attachments/DropArea.d.ts +0 -8
- package/dist/attachments/FileList/AudioIcon.d.ts +0 -2
- package/dist/attachments/FileList/AudioIcon.js +0 -19
- package/dist/attachments/FileList/FileListCard.d.ts +0 -12
- package/dist/attachments/FileList/Progress.d.ts +0 -6
- package/dist/attachments/FileList/VideoIcon.d.ts +0 -2
- package/dist/attachments/FileList/VideoIcon.js +0 -19
- package/dist/attachments/FileList/index.d.ts +0 -16
- package/dist/attachments/PlaceholderUploader.d.ts +0 -17
- package/dist/attachments/SilentUploader.d.ts +0 -9
- package/dist/attachments/SilentUploader.js +0 -23
- package/dist/attachments/context.d.ts +0 -5
- package/dist/attachments/index.d.ts +0 -33
- package/dist/attachments/style/fileCard.d.ts +0 -4
- package/dist/attachments/style/fileCard.js +0 -124
- package/dist/attachments/style/index.d.ts +0 -10
- package/dist/attachments/style/index.js +0 -211
- package/dist/bubble/Bubble.d.ts +0 -11
- package/dist/bubble/BubbleList.d.ts +0 -15
- package/dist/bubble/BubbleList.js +0 -44
- package/dist/bubble/Spin.d.ts +0 -2
- package/dist/bubble/Spin.js +0 -18
- package/dist/bubble/interface.d.ts +0 -26
- package/dist/bubble/loading.js +0 -17
- package/dist/bubble/style/avatar.less +0 -40
- package/dist/bubble/style/content.d.ts +0 -4
- package/dist/bubble/style/content.js +0 -43
- package/dist/bubble/style/index.d.ts +0 -9
- package/dist/bubble/style/index.js +0 -53
- package/dist/bubble/style/list.less +0 -15
- package/dist/bubble/style/scrollToBottom.less +0 -174
- package/dist/chat-anywhere/Chat/index.less +0 -54
- package/dist/chat-anywhere/Header/index.d.ts +0 -3
- package/dist/chat-anywhere/Header/index.js +0 -32
- package/dist/chat-anywhere/Header/index.less +0 -24
- package/dist/chat-anywhere/Input/index.d.ts +0 -3
- package/dist/chat-anywhere/Input/index.less +0 -12
- package/dist/chat-anywhere/Layout/index.js +0 -73
- package/dist/chat-anywhere/Layout/index.less +0 -61
- package/dist/chat-anywhere/SessionList/index.d.ts +0 -5
- package/dist/chat-anywhere/SessionList/index.less +0 -52
- package/dist/chat-anywhere/hooks/ChatAnywhereProvider.d.ts +0 -43
- package/dist/chat-anywhere/hooks/types.d.ts +0 -57
- package/dist/conversations/Item.js +0 -96
- package/dist/conversations/hooks/useGroupable.d.ts +0 -9
- package/dist/conversations/index.d.ts +0 -62
- package/dist/conversations/interface.d.ts +0 -60
- package/dist/conversations/style/index.d.ts +0 -9
- package/dist/conversations/style/index.js +0 -80
- package/dist/default-cards/Count/index.d.ts +0 -3
- package/dist/default-cards/Count/index.js +0 -16
- package/dist/default-cards/Count/index.less +0 -19
- package/dist/default-cards/DeepThink/index.js +0 -11
- package/dist/default-cards/Files/index.d.ts +0 -2
- package/dist/default-cards/Files/index.js +0 -18
- package/dist/default-cards/Footer/index.js +0 -50
- package/dist/default-cards/Footer/index.less +0 -41
- package/dist/default-cards/Images/index.d.ts +0 -3
- package/dist/default-cards/Images/index.js +0 -33
- package/dist/default-cards/Images/index.less +0 -17
- package/dist/default-cards/Interrupted/index.js +0 -40
- package/dist/default-cards/Interrupted/index.less +0 -57
- package/dist/default-cards/Text/index.d.ts +0 -2
- package/dist/disclaimer/index.d.ts +0 -11
- package/dist/disclaimer/index.js +0 -26
- package/dist/docs/1896.async.js +0 -457
- package/dist/docs/2710.async.js +0 -62
- package/dist/docs/2863.async.js +0 -400
- package/dist/docs/3057.async.js +0 -46
- package/dist/docs/3364.async.js +0 -25
- package/dist/docs/404.html +0 -15
- package/dist/docs/4820.async.js +0 -1381
- package/dist/docs/5623.async.js +0 -60
- package/dist/docs/5757.async.js +0 -1
- package/dist/docs/5804.async.js +0 -271
- package/dist/docs/6198.async.js +0 -18
- package/dist/docs/6671.async.js +0 -137
- package/dist/docs/7195.async.js +0 -1
- package/dist/docs/7485.async.js +0 -29
- package/dist/docs/7931.async.js +0 -19
- package/dist/docs/7997.async.js +0 -5
- package/dist/docs/8156.async.js +0 -110
- package/dist/docs/8368.async.js +0 -2
- package/dist/docs/8480.async.js +0 -1449
- package/dist/docs/8618.async.js +0 -246
- package/dist/docs/9016.async.js +0 -32
- package/dist/docs/9016.chunk.css +0 -1
- package/dist/docs/9335.async.js +0 -11
- package/dist/docs/accordion__demos.async.js +0 -9
- package/dist/docs/attachments__demos.async.js +0 -1
- package/dist/docs/bubble__demos.async.js +0 -50
- package/dist/docs/components/accordion/index.html +0 -15
- package/dist/docs/components/accordion-cn/index.html +0 -15
- package/dist/docs/components/attachments/index.html +0 -15
- package/dist/docs/components/attachments-cn/index.html +0 -15
- package/dist/docs/components/bubble/index.html +0 -15
- package/dist/docs/components/bubble-cn/index.html +0 -15
- package/dist/docs/components/bubble-list/index.html +0 -15
- package/dist/docs/components/bubble-list-cn/index.html +0 -15
- package/dist/docs/components/conversations/index.html +0 -15
- package/dist/docs/components/conversations-cn/index.html +0 -15
- package/dist/docs/components/disclaimer/index.html +0 -15
- package/dist/docs/components/disclaimer-cn/index.html +0 -15
- package/dist/docs/components/footer/index.html +0 -15
- package/dist/docs/components/footer-cn/index.html +0 -15
- package/dist/docs/components/markdown/index.html +0 -15
- package/dist/docs/components/markdown-cn/index.html +0 -15
- package/dist/docs/components/sender/index.html +0 -15
- package/dist/docs/components/sender-cn/index.html +0 -15
- package/dist/docs/components/status/index.html +0 -15
- package/dist/docs/components/status-cn/index.html +0 -15
- package/dist/docs/components/welcome/index.html +0 -15
- package/dist/docs/components/welcome-cn/index.html +0 -15
- package/dist/docs/components__accordion__index.en-US.md.async.js +0 -6
- package/dist/docs/components__accordion__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__accordion__index.zh-CN.md.async.js +0 -6
- package/dist/docs/components__accordion__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__attachments__index.en-US.md.async.js +0 -1
- package/dist/docs/components__attachments__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__attachments__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__attachments__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__bubble-list__index.en-US.md.async.js +0 -2
- package/dist/docs/components__bubble-list__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__bubble-list__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__bubble-list__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__bubble__index.en-US.md.async.js +0 -1
- package/dist/docs/components__bubble__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__bubble__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__bubble__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__conversations__index.en-US.md.async.js +0 -2
- package/dist/docs/components__conversations__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__conversations__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__conversations__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__disclaimer__index.en-US.md.async.js +0 -1
- package/dist/docs/components__disclaimer__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__disclaimer__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__disclaimer__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__footer__index.en-US.md.async.js +0 -1
- package/dist/docs/components__footer__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__footer__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__footer__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__markdown__index.en-US.md.async.js +0 -1
- package/dist/docs/components__markdown__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__markdown__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__markdown__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__sender__index.en-US.md.async.js +0 -1
- package/dist/docs/components__sender__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__sender__index.zh-CN.md.async.js +0 -1
- package/dist/docs/components__sender__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__status__index.en-US.md.async.js +0 -1
- package/dist/docs/components__status__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__status__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__status__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/components__welcome__index.en-US.md.async.js +0 -2
- package/dist/docs/components__welcome__index.en-US.md.chunk.css +0 -1
- package/dist/docs/components__welcome__index.zh-CN.md.async.js +0 -2
- package/dist/docs/components__welcome__index.zh-CN.md.chunk.css +0 -1
- package/dist/docs/conversations__demos.async.js +0 -1
- package/dist/docs/demos.async.js +0 -47
- package/dist/docs/demos.chunk.css +0 -1
- package/dist/docs/disclaimer__demos.async.js +0 -1
- package/dist/docs/docs/development/ag-ui/index.html +0 -15
- package/dist/docs/docs/development/ag-ui-cn/index.html +0 -15
- package/dist/docs/docs/development/backend/index.html +0 -15
- package/dist/docs/docs/development/backend-cn/index.html +0 -15
- package/dist/docs/docs/development/cards/index.html +0 -15
- package/dist/docs/docs/development/cards-cn/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere-api/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere-api-cn/index.html +0 -15
- package/dist/docs/docs/development/chatanywhere-cn/index.html +0 -15
- package/dist/docs/docs/development/custom/index.html +0 -15
- package/dist/docs/docs/development/custom-cn/index.html +0 -15
- package/dist/docs/docs/development/overview/index.html +0 -15
- package/dist/docs/docs/development/overview-cn/index.html +0 -15
- package/dist/docs/docs/development/qwen/index.html +0 -15
- package/dist/docs/docs/development/qwen-cn/index.html +0 -15
- package/dist/docs/docs/templates/copilot/index.html +0 -15
- package/dist/docs/docs/templates/copilot-cn/index.html +0 -15
- package/dist/docs/docs/templates/native/index.html +0 -15
- package/dist/docs/docs/templates/native-cn/index.html +0 -15
- package/dist/docs/docs/templates/voice/index.html +0 -15
- package/dist/docs/docs/templates/voice-cn/index.html +0 -15
- package/dist/docs/docs__development__ag-ui.en-US.md.async.js +0 -210
- package/dist/docs/docs__development__ag-ui.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__ag-ui.zh-CN.md.async.js +0 -210
- package/dist/docs/docs__development__ag-ui.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__backend.en-US.md.async.js +0 -12
- package/dist/docs/docs__development__backend.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__backend.zh-CN.md.async.js +0 -12
- package/dist/docs/docs__development__backend.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__cards.en-US.md.async.js +0 -27
- package/dist/docs/docs__development__cards.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__cards.zh-CN.md.async.js +0 -27
- package/dist/docs/docs__development__cards.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere-api.en-US.md.async.js +0 -69
- package/dist/docs/docs__development__chatanywhere-api.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.async.js +0 -69
- package/dist/docs/docs__development__chatanywhere-api.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere.en-US.md.async.js +0 -77
- package/dist/docs/docs__development__chatanywhere.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__chatanywhere.zh-CN.md.async.js +0 -77
- package/dist/docs/docs__development__chatanywhere.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__custom.en-US.md.async.js +0 -22
- package/dist/docs/docs__development__custom.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__custom.zh-CN.md.async.js +0 -22
- package/dist/docs/docs__development__custom.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__overview.en-US.md.async.js +0 -21
- package/dist/docs/docs__development__overview.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__overview.zh-CN.md.async.js +0 -21
- package/dist/docs/docs__development__overview.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__development__qwen.en-US.md.async.js +0 -25
- package/dist/docs/docs__development__qwen.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__development__qwen.zh-CN.md.async.js +0 -25
- package/dist/docs/docs__development__qwen.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__templates__copilot.en-US.md.async.js +0 -1
- package/dist/docs/docs__templates__copilot.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__templates__copilot.zh-CN.md.async.js +0 -1
- package/dist/docs/docs__templates__copilot.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__templates__native.en-US.md.async.js +0 -1
- package/dist/docs/docs__templates__native.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__templates__native.zh-CN.md.async.js +0 -1
- package/dist/docs/docs__templates__native.zh-CN.md.chunk.css +0 -1
- package/dist/docs/docs__templates__voice.en-US.md.async.js +0 -20
- package/dist/docs/docs__templates__voice.en-US.md.chunk.css +0 -1
- package/dist/docs/docs__templates__voice.zh-CN.md.async.js +0 -1
- package/dist/docs/docs__templates__voice.zh-CN.md.chunk.css +0 -1
- package/dist/docs/dumi__pages__index__index.en-US.async.js +0 -1
- package/dist/docs/dumi__pages__index__index.en-US.chunk.css +0 -1
- package/dist/docs/dumi__pages__index__index.zh-CN.async.js +0 -1
- package/dist/docs/dumi__pages__index__index.zh-CN.chunk.css +0 -1
- package/dist/docs/dumi__theme__layouts__DocLayout__index.async.js +0 -1
- package/dist/docs/dumi__theme__layouts__DocLayout__index.chunk.css +0 -1
- package/dist/docs/dumi__theme__layouts__GlobalLayout__index.async.js +0 -18
- package/dist/docs/dumi__theme__layouts__GlobalLayout__index.chunk.css +0 -1
- package/dist/docs/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +0 -1
- package/dist/docs/index/index.html +0 -15
- package/dist/docs/index-cn/index.html +0 -15
- package/dist/docs/markdown__demos.async.js +0 -164
- package/dist/docs/meta__components__en-US.async.js +0 -9
- package/dist/docs/meta__components__zh-CN.async.js +0 -10
- package/dist/docs/meta__docs__en-US.async.js +0 -475
- package/dist/docs/meta__docs__en-US.chunk.css +0 -1
- package/dist/docs/meta__docs__zh-CN.async.js +0 -456
- package/dist/docs/meta__docs__zh-CN.chunk.css +0 -1
- package/dist/docs/nm__dumi__dist__client__pages__404.async.js +0 -1
- package/dist/docs/nm__dumi__dist__client__pages__Demo__index.async.js +0 -1
- package/dist/docs/nm__dumi__dist__client__pages__Demo__index.chunk.css +0 -1
- package/dist/docs/preload_helper.js +0 -1
- package/dist/docs/sender__demos.async.js +0 -1
- package/dist/docs/umi.css +0 -1
- package/dist/docs/umi.js +0 -107
- package/dist/docs/welcome__demos.async.js +0 -1
- package/dist/docs/~demos/:id/index.html +0 -15
- package/dist/docs/~demos/accordion-demo-inline/index.html +0 -15
- package/dist/docs/~demos/accordion-demo-mutisteps/index.html +0 -15
- package/dist/docs/~demos/accordion-demo-thinking/index.html +0 -15
- package/dist/docs/~demos/attachments-demo-files/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-basic/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-havestopped/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-userwithfile/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-userwithimage/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-userwithnormal/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withavatar/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withcode/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-witherror/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-witherrordetail/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withimage/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withusage/index.html +0 -15
- package/dist/docs/~demos/bubble-demo-withwaitingmessage/index.html +0 -15
- package/dist/docs/~demos/components-bubble-list-demo-basic/index.html +0 -15
- package/dist/docs/~demos/components-footer-demo-basic/index.html +0 -15
- package/dist/docs/~demos/components-footer-demo-withusage/index.html +0 -15
- package/dist/docs/~demos/components-status-demo-basic/index.html +0 -15
- package/dist/docs/~demos/conversations-demo-basic/index.html +0 -15
- package/dist/docs/~demos/disclaimer-demo-demo/index.html +0 -15
- package/dist/docs/~demos/disclaimer-demo-withlink/index.html +0 -15
- package/dist/docs/~demos/docs-development-ag-ui-demo-with-copilotkit/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-file/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-footer/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-image/index.html +0 -15
- package/dist/docs/~demos/docs-development-cards-demo-text/index.html +0 -15
- package/dist/docs/~demos/docs-development-custom-demo-custom/index.html +0 -15
- package/dist/docs/~demos/docs-templates-copilot-demo-copilot/index.html +0 -15
- package/dist/docs/~demos/docs-templates-native-demo-basic/index.html +0 -15
- package/dist/docs/~demos/docs-templates-voice-demo-demo/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-citations/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-cursor/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-mathjax/index.html +0 -15
- package/dist/docs/~demos/markdown-demo-md/index.html +0 -15
- package/dist/docs/~demos/sender-demo-basic/index.html +0 -15
- package/dist/docs/~demos/sender-demo-disabled/index.html +0 -15
- package/dist/docs/~demos/sender-demo-loading/index.html +0 -15
- package/dist/docs/~demos/sender-demo-moreprefixaction/index.html +0 -15
- package/dist/docs/~demos/sender-demo-withfile/index.html +0 -15
- package/dist/docs/~demos/welcome-demo-demo0/index.html +0 -15
- package/dist/docs/~demos/welcome-demo-demo1/index.html +0 -15
- package/dist/docs/~demos/welcome-demo-demo2/index.html +0 -15
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -20
- package/dist/index.less +0 -1
- package/dist/markdown/ImageOrVideo.d.ts +0 -2
- package/dist/markdown/ImageOrVideo.js +0 -81
- package/dist/markdown/Link.js +0 -28
- package/dist/markdown/cursor/Blur.d.ts +0 -3
- package/dist/markdown/cursor/Blur.js +0 -7
- package/dist/markdown/cursor/Dot.d.ts +0 -3
- package/dist/markdown/cursor/Dot.js +0 -16
- package/dist/markdown/cursor/Underline.d.ts +0 -3
- package/dist/markdown/cursor/Underline.js +0 -7
- package/dist/markdown/cursor/index.less +0 -124
- package/dist/markdown/hooks/index.d.ts +0 -1
- package/dist/markdown/hooks/index.js +0 -49
- package/dist/markdown/index.d.ts +0 -16
- package/dist/markdown/index.js +0 -37
- package/dist/markdown/index.less +0 -204
- package/dist/markdown/type.d.ts +0 -46
- package/dist/provider/types.d.ts +0 -8
- package/dist/sender/SenderHeader.d.ts +0 -19
- package/dist/sender/StopLoading.js +0 -20
- package/dist/sender/components/ActionButton.d.ts +0 -22
- package/dist/sender/components/ClearButton.js +0 -13
- package/dist/sender/components/LoadingButton.js +0 -22
- package/dist/sender/components/SendButton.js +0 -14
- package/dist/sender/components/SpeechButton/RecordingIcon.d.ts +0 -5
- package/dist/sender/components/SpeechButton/RecordingIcon.js +0 -49
- package/dist/sender/components/SpeechButton/index.js +0 -30
- package/dist/sender/index.d.ts +0 -61
- package/dist/sender/style/header.d.ts +0 -4
- package/dist/sender/style/header.js +0 -46
- package/dist/sender/style/index.d.ts +0 -10
- package/dist/sender/style/index.js +0 -123
- package/dist/stream/index.en-US.md.bk +0 -50
- package/dist/stream/index.zh-CN.md.bk +0 -51
- package/dist/theme/components.d.ts +0 -10
- package/dist/theme/cssinjs-utils.d.ts +0 -14
- package/dist/theme/genStyleUtils.d.ts +0 -28
- package/dist/theme/useToken.d.ts +0 -18
- package/dist/theme/useToken.js +0 -110
- package/dist/voice-chat/Recorder/index.d.ts +0 -26
- package/dist/voice-chat/VoiceChatProvider/context.d.ts +0 -22
- package/dist/voice-chat/VoiceChatProvider/context.js +0 -3
- package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.d.ts +0 -1
- package/dist/voice-chat/VoiceChatProvider/hooks/useChatState.js +0 -5
- package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.d.ts +0 -8
- package/dist/voice-chat/VoiceChatProvider/hooks/useMessages.js +0 -31
- package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.d.ts +0 -5
- package/dist/voice-chat/VoiceChatProvider/hooks/useRecorder.js +0 -48
- package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.d.ts +0 -4
- package/dist/voice-chat/VoiceChatProvider/hooks/useVoiceChat.js +0 -10
- package/dist/voice-chat/VoiceChatProvider/index.d.ts +0 -9
- package/dist/voice-chat/VoiceChatProvider/index.js +0 -55
- package/dist/voice-chat/VoiceChatService/index.d.ts +0 -34
- package/dist/voice-chat/index.d.ts +0 -2
- package/dist/voice-chat/index.js +0 -2
- package/dist/voice-chat/types/index.d.ts +0 -12
- package/dist/voice-chat/types/index.js +0 -4
- package/dist/welcome/icon.d.ts +0 -2
- package/dist/welcome/icon.js +0 -38
- package/dist/welcome/index.d.ts +0 -9
- package/dist/welcome/index.js +0 -57
- /package/{dist/_util/type.js → lib/AGUI/components/chat/props.js} +0 -0
- /package/{dist/bubble/interface.js → lib/AGUI/context/index.js} +0 -0
- /package/{dist/bubble/hooks/useDisplayData.d.ts → lib/AGUI/styles.css} +0 -0
- /package/{dist/bubble/hooks/useDisplayData.js → lib/AGUI/types/css.d.ts} +0 -0
- /package/{dist/bubble/hooks/useListData.d.ts → lib/AGUI/types/css.js} +0 -0
- /package/{dist/chat-anywhere/hooks/types.js → lib/AGUI/types/index.js} +0 -0
- /package/{dist/conversations/interface.js → lib/AGUI/types/suggestions.js} +0 -0
- /package/{dist/accordion → lib/Accordion}/index.js +0 -0
- /package/{dist/attachments → lib/Attachments}/context.js +0 -0
- /package/{dist/attachments → lib/Attachments}/util.d.ts +0 -0
- /package/{dist/attachments → lib/Attachments}/util.js +0 -0
- /package/{dist/bubble/hooks/useListData.js → lib/Bubble/hooks/useDisplayData.d.ts} +0 -0
- /package/{dist/default-cards/DeepThink/index.less → lib/Bubble/hooks/useDisplayData.js} +0 -0
- /package/{dist/bubble → lib/Bubble}/index.d.ts +0 -0
- /package/{dist/bubble → lib/Bubble}/index.js +0 -0
- /package/{dist/markdown/type.js → lib/Bubble/interface.js} +0 -0
- /package/{dist/bubble → lib/Bubble}/loading.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/Chat/Ref.js +0 -0
- /package/{dist/provider → lib/ChatAnywhere/hooks}/types.js +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useInput.js +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.d.ts +0 -0
- /package/{dist/chat-anywhere → lib/ChatAnywhere}/hooks/useSessionList.js +0 -0
- /package/{dist/conversations → lib/Conversations}/hooks/useGroupable.js +0 -0
- /package/{dist/theme/components.js → lib/Conversations/interface.js} +0 -0
- /package/{dist/markdown → lib/Markdown}/Citation.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/Link.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/Markdown.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/hooks/useTypedEffect.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/footnote.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/footnote.js +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/katexDir.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/plugins/katexDir.js +0 -0
- /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.d.ts +0 -0
- /package/{dist/markdown → lib/Markdown}/rehype/fadeIn.js +0 -0
- /package/{dist/theme/cssinjs-utils.js → lib/Markdown/type.js} +0 -0
- /package/{dist/markdown → lib/Markdown}/utils.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/ClearButton.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/LoadingButton.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/SendButton.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/components/SpeechButton/index.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/useSpeech.d.ts +0 -0
- /package/{dist/sender → lib/Sender}/useSpeech.js +0 -0
- /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.d.ts +0 -0
- /package/{dist/_util → lib/Util}/hooks/use-proxy-imperative-handle.js +0 -0
- /package/{dist/_util → lib/Util}/type.d.ts +0 -0
- /package/{dist/_util → lib/Util}/warning.js +0 -0
- /package/{dist/version → lib/Version}/index.d.ts +0 -0
- /package/{dist/version → lib/Version}/index.js +0 -0
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
7
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
13
|
import React from 'react';
|
|
8
14
|
import { useChatAnywhere } from "./ChatAnywhereProvider";
|
|
9
15
|
export function useMessages() {
|
|
@@ -18,12 +24,14 @@ export function useMessages() {
|
|
|
18
24
|
setMessages = _useChatAnywhere.setMessages,
|
|
19
25
|
getMessages = _useChatAnywhere.getMessages;
|
|
20
26
|
var updateMessage = React.useCallback(function (message) {
|
|
21
|
-
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
setMessages === null || setMessages === void 0 || setMessages(function (prev) {
|
|
22
29
|
var index = prev.findIndex(function (item) {
|
|
23
30
|
return item.id === message.id;
|
|
24
31
|
});
|
|
25
32
|
if (index > -1) {
|
|
26
|
-
|
|
33
|
+
var nextMessage = _objectSpread(_objectSpread({}, prev[index]), message);
|
|
34
|
+
return [].concat(_toConsumableArray(prev.slice(0, index)), [nextMessage], _toConsumableArray(prev.slice(index + 1)));
|
|
27
35
|
} else {
|
|
28
36
|
return [].concat(_toConsumableArray(prev), [message]);
|
|
29
37
|
}
|
|
@@ -2,8 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { v4 as uuid } from 'uuid';
|
|
3
3
|
import { ChatAnywhereRef, useChatAnywhere } from './hooks/ChatAnywhereProvider';
|
|
4
4
|
import { IChatAnywhereConfig } from './hooks/types';
|
|
5
|
+
import { useMessages } from './hooks/useMessages';
|
|
6
|
+
import { useInput } from './hooks/useInput';
|
|
7
|
+
import { useSessionList } from './hooks/useSessionList';
|
|
5
8
|
export type { ChatAnywhereRef };
|
|
6
|
-
export { uuid, useChatAnywhere };
|
|
9
|
+
export { uuid, useChatAnywhere, useMessages, useInput, useSessionList };
|
|
7
10
|
export type { TMessage, TSession } from './hooks/types';
|
|
8
11
|
declare const _default: React.ForwardRefExoticComponent<IChatAnywhereConfig & React.RefAttributes<unknown>>;
|
|
9
12
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["cardConfig"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -23,8 +22,15 @@ import { v4 as uuid } from 'uuid';
|
|
|
23
22
|
import { CustomCardsProvider } from "./..";
|
|
24
23
|
import { ChatAnywhereProvider, useChatAnywhere } from "./hooks/ChatAnywhereProvider";
|
|
25
24
|
import ContextRef from "./Chat/Ref";
|
|
26
|
-
|
|
25
|
+
import { useMessages } from "./hooks/useMessages";
|
|
26
|
+
import { useInput } from "./hooks/useInput";
|
|
27
|
+
import { useSessionList } from "./hooks/useSessionList";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
import { createElement as _createElement } from "react";
|
|
31
|
+
export { uuid, useChatAnywhere, useMessages, useInput, useSessionList };
|
|
27
32
|
export default /*#__PURE__*/forwardRef(function (chatanywhereConfig, ref) {
|
|
33
|
+
var _rest$uiConfig;
|
|
28
34
|
var _useState = useState(0),
|
|
29
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
36
|
key = _useState2[0],
|
|
@@ -32,9 +38,10 @@ export default /*#__PURE__*/forwardRef(function (chatanywhereConfig, ref) {
|
|
|
32
38
|
var cardConfig = chatanywhereConfig.cardConfig,
|
|
33
39
|
rest = _objectWithoutProperties(chatanywhereConfig, _excluded);
|
|
34
40
|
var chatRef = useRef(null);
|
|
41
|
+
var inputRef = useRef(null);
|
|
35
42
|
var contextRef = useRef(null);
|
|
36
43
|
React.useImperativeHandle(ref, function () {
|
|
37
|
-
return _objectSpread(_objectSpread(_objectSpread({}, chatRef.current), contextRef.current), {}, {
|
|
44
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, chatRef.current), inputRef.current), contextRef.current), {}, {
|
|
38
45
|
reload: function reload() {
|
|
39
46
|
setKey(function (key) {
|
|
40
47
|
return key + 1;
|
|
@@ -42,17 +49,23 @@ export default /*#__PURE__*/forwardRef(function (chatanywhereConfig, ref) {
|
|
|
42
49
|
}
|
|
43
50
|
});
|
|
44
51
|
});
|
|
45
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/_createElement(ChatAnywhereProvider, _objectSpread(_objectSpread({}, rest), {}, {
|
|
46
53
|
key: key
|
|
47
|
-
}), /*#__PURE__*/
|
|
48
|
-
cardConfig: cardConfig
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
}), /*#__PURE__*/_jsxs(CustomCardsProvider, {
|
|
55
|
+
cardConfig: cardConfig,
|
|
56
|
+
children: [/*#__PURE__*/_jsx(Layout, {
|
|
57
|
+
top: (_rest$uiConfig = rest.uiConfig) !== null && _rest$uiConfig !== void 0 && _rest$uiConfig.header ? /*#__PURE__*/_jsx(Header, {}) : null,
|
|
58
|
+
left: rest.onSessionKeyChange ? /*#__PURE__*/_jsx(SessionList, {}) : null
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
,
|
|
61
|
+
right: /*#__PURE__*/_jsx(Chat, {
|
|
62
|
+
ref: {
|
|
63
|
+
chatRef: chatRef,
|
|
64
|
+
inputRef: inputRef
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}), /*#__PURE__*/_jsx(ContextRef, {
|
|
68
|
+
ref: contextRef
|
|
69
|
+
})]
|
|
70
|
+
}));
|
|
58
71
|
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ConfigProviderProps, GetProp } from 'antd';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export interface GroupTitleProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description 分组标题的内容,支持文本或React元素
|
|
6
|
+
* @descriptionEn Content of the group title, supports text or React elements
|
|
7
|
+
*/
|
|
4
8
|
children?: React.ReactNode;
|
|
5
9
|
}
|
|
6
10
|
export declare const GroupTitleContext: React.Context<{
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Typography } from 'antd';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
|
|
5
|
-
// Which should pass by context instead.
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
5
|
export var GroupTitleContext = /*#__PURE__*/React.createContext(null);
|
|
7
6
|
var GroupTitle = function GroupTitle(_ref) {
|
|
8
7
|
var children = _ref.children;
|
|
9
8
|
var _React$useContext = React.useContext(GroupTitleContext),
|
|
10
9
|
prefixCls = _React$useContext.prefixCls;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
className: classnames("".concat(prefixCls, "-group-title"))
|
|
13
|
-
|
|
10
|
+
return /*#__PURE__*/_jsx("div", {
|
|
11
|
+
className: classnames("".concat(prefixCls, "-group-title")),
|
|
12
|
+
children: children && /*#__PURE__*/_jsx(Typography.Text, {
|
|
13
|
+
children: children
|
|
14
|
+
})
|
|
15
|
+
});
|
|
14
16
|
};
|
|
15
17
|
export default GroupTitle;
|
|
@@ -10,5 +10,6 @@ export interface ConversationsItemProps extends Omit<React.HTMLAttributes<HTMLLI
|
|
|
10
10
|
active?: boolean;
|
|
11
11
|
onClick?: (info: Conversation) => void;
|
|
12
12
|
}
|
|
13
|
+
export declare function useEditable(id: any): any[];
|
|
13
14
|
declare const ConversationsItem: React.FC<ConversationsItemProps>;
|
|
14
15
|
export default ConversationsItem;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["prefixCls", "info", "className", "direction", "onClick", "active", "menu"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { Dropdown, Tooltip } from 'antd';
|
|
17
|
+
import classnames from 'classnames';
|
|
18
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
20
|
+
import { SparkMoreLine } from '@agentscope-ai/icons';
|
|
21
|
+
import { IconButton } from "@ali/agentscope-ai-design";
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
var stopPropagation = function stopPropagation(e) {
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
};
|
|
27
|
+
var editableMap = {};
|
|
28
|
+
export function useEditable(id) {
|
|
29
|
+
var _useState = useState(editableMap[id]),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
editable = _useState2[0],
|
|
32
|
+
setEditable = _useState2[1];
|
|
33
|
+
return [editable, function (value) {
|
|
34
|
+
for (var key in editableMap) {
|
|
35
|
+
editableMap[key] = false;
|
|
36
|
+
}
|
|
37
|
+
editableMap[id] = value;
|
|
38
|
+
setEditable(value);
|
|
39
|
+
}];
|
|
40
|
+
}
|
|
41
|
+
var ConversationsItem = function ConversationsItem(props) {
|
|
42
|
+
var _useEditable = useEditable(props.info.key),
|
|
43
|
+
_useEditable2 = _slicedToArray(_useEditable, 2),
|
|
44
|
+
editable = _useEditable2[0],
|
|
45
|
+
setEditable = _useEditable2[1];
|
|
46
|
+
var prefixCls = props.prefixCls,
|
|
47
|
+
info = props.info,
|
|
48
|
+
className = props.className,
|
|
49
|
+
direction = props.direction,
|
|
50
|
+
onClick = props.onClick,
|
|
51
|
+
active = props.active,
|
|
52
|
+
menu = props.menu,
|
|
53
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
54
|
+
var domProps = pickAttrs(restProps, {
|
|
55
|
+
aria: true,
|
|
56
|
+
data: true,
|
|
57
|
+
attr: true
|
|
58
|
+
});
|
|
59
|
+
var disabled = info.disabled;
|
|
60
|
+
var _React$useState = React.useState(false),
|
|
61
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62
|
+
inEllipsis = _React$useState2[0],
|
|
63
|
+
onEllipsis = _React$useState2[1];
|
|
64
|
+
var _React$useState3 = React.useState(false),
|
|
65
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
66
|
+
opened = _React$useState4[0],
|
|
67
|
+
setOpened = _React$useState4[1];
|
|
68
|
+
var mergedCls = classnames(className, "".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-active"), active && !disabled), _defineProperty({}, "".concat(prefixCls, "-item-disabled"), disabled), _defineProperty({}, "".concat(prefixCls, "-item-timeline"), info.timeline));
|
|
69
|
+
var onInternalClick = function onInternalClick() {
|
|
70
|
+
if (!disabled && onClick) {
|
|
71
|
+
onClick(info);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var onOpenChange = function onOpenChange(open) {
|
|
75
|
+
if (open) {
|
|
76
|
+
setOpened(!open);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var dropdownMenu = useMemo(function () {
|
|
80
|
+
return _objectSpread(_objectSpread({}, menu), {}, {
|
|
81
|
+
onClick: function onClick(e) {
|
|
82
|
+
e.domEvent.stopPropagation();
|
|
83
|
+
if (e.key === 'edit') {
|
|
84
|
+
setEditable(true);
|
|
85
|
+
} else {
|
|
86
|
+
var _menu$onClick;
|
|
87
|
+
(_menu$onClick = menu.onClick) === null || _menu$onClick === void 0 || _menu$onClick.call(menu, e);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
onEdit: menu.onEdit || function (label) {
|
|
92
|
+
return menu.onClick({
|
|
93
|
+
key: 'edit',
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
label: label
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}, [menu]);
|
|
100
|
+
|
|
101
|
+
// debugger;
|
|
102
|
+
|
|
103
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
104
|
+
title: info.label,
|
|
105
|
+
open: inEllipsis && opened,
|
|
106
|
+
onOpenChange: setOpened,
|
|
107
|
+
placement: direction === 'rtl' ? 'left' : 'right',
|
|
108
|
+
children: /*#__PURE__*/_jsxs("li", _objectSpread(_objectSpread({}, domProps), {}, {
|
|
109
|
+
className: mergedCls,
|
|
110
|
+
onClick: onInternalClick,
|
|
111
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
112
|
+
className: "".concat(prefixCls, "-content"),
|
|
113
|
+
children: [info.icon && /*#__PURE__*/_jsx("div", {
|
|
114
|
+
className: "".concat(prefixCls, "-icon"),
|
|
115
|
+
children: info.icon
|
|
116
|
+
}), info.timeline && /*#__PURE__*/_jsx("div", {
|
|
117
|
+
className: "".concat(prefixCls, "-timeline")
|
|
118
|
+
}), /*#__PURE__*/_jsx(Label, {
|
|
119
|
+
editable: editable,
|
|
120
|
+
setEditable: setEditable,
|
|
121
|
+
prefixCls: prefixCls,
|
|
122
|
+
info: info
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
,
|
|
125
|
+
onEdit: dropdownMenu.onEdit
|
|
126
|
+
}), menu && !disabled && /*#__PURE__*/_jsx(Dropdown, {
|
|
127
|
+
menu: dropdownMenu,
|
|
128
|
+
placement: direction === 'rtl' ? 'bottomLeft' : 'bottomRight',
|
|
129
|
+
trigger: ['click'],
|
|
130
|
+
disabled: disabled,
|
|
131
|
+
onOpenChange: onOpenChange,
|
|
132
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
133
|
+
bordered: false,
|
|
134
|
+
icon: /*#__PURE__*/_jsx(SparkMoreLine, {}),
|
|
135
|
+
onClick: stopPropagation,
|
|
136
|
+
disabled: disabled,
|
|
137
|
+
className: "".concat(prefixCls, "-menu-icon")
|
|
138
|
+
})
|
|
139
|
+
})]
|
|
140
|
+
}), info.desc && /*#__PURE__*/_jsx("div", {
|
|
141
|
+
className: "".concat(prefixCls, "-desc"),
|
|
142
|
+
style: info.timeline ? {
|
|
143
|
+
marginLeft: 16
|
|
144
|
+
} : {},
|
|
145
|
+
children: info.desc
|
|
146
|
+
})]
|
|
147
|
+
}))
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
function Label(props) {
|
|
151
|
+
var editable = props.editable,
|
|
152
|
+
prefixCls = props.prefixCls,
|
|
153
|
+
info = props.info,
|
|
154
|
+
setEditable = props.setEditable,
|
|
155
|
+
onEdit = props.onEdit;
|
|
156
|
+
var _useState3 = useState(info.label),
|
|
157
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
158
|
+
label = _useState4[0],
|
|
159
|
+
setLabel = _useState4[1];
|
|
160
|
+
return editable ? /*#__PURE__*/_jsx(Input, {
|
|
161
|
+
prefixCls: prefixCls,
|
|
162
|
+
value: label,
|
|
163
|
+
onBlur: function onBlur(v) {
|
|
164
|
+
var _onEdit;
|
|
165
|
+
if (v === label) return setEditable(false);
|
|
166
|
+
(_onEdit = onEdit(v)) === null || _onEdit === void 0 || _onEdit.then(function () {
|
|
167
|
+
setLabel(v);
|
|
168
|
+
}).catch(function () {
|
|
169
|
+
setLabel(label);
|
|
170
|
+
}).finally(function () {
|
|
171
|
+
setEditable(false);
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
setEditable: setEditable
|
|
175
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
176
|
+
className: "".concat(prefixCls, "-label"),
|
|
177
|
+
children: label
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function Input(_ref) {
|
|
181
|
+
var prefixCls = _ref.prefixCls,
|
|
182
|
+
value = _ref.value,
|
|
183
|
+
_onBlur = _ref.onBlur,
|
|
184
|
+
setEditable = _ref.setEditable;
|
|
185
|
+
var _useState5 = useState(value),
|
|
186
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
187
|
+
v = _useState6[0],
|
|
188
|
+
sv = _useState6[1];
|
|
189
|
+
var ref = useRef();
|
|
190
|
+
useEffect(function () {
|
|
191
|
+
ref.current.focus();
|
|
192
|
+
}, []);
|
|
193
|
+
useEffect(function () {
|
|
194
|
+
sv(value);
|
|
195
|
+
}, [value]);
|
|
196
|
+
return /*#__PURE__*/_jsx("input", {
|
|
197
|
+
ref: ref,
|
|
198
|
+
className: "".concat(prefixCls, "-label-edit"),
|
|
199
|
+
value: v,
|
|
200
|
+
onChange: function onChange(e) {
|
|
201
|
+
return sv(e.target.value);
|
|
202
|
+
},
|
|
203
|
+
onBlur: function onBlur() {
|
|
204
|
+
return _onBlur(v);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
export default ConversationsItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Conversation, Groupable } from '../interface';
|
|
2
|
+
type GroupList = {
|
|
3
|
+
data: Conversation[];
|
|
4
|
+
name?: string;
|
|
5
|
+
title?: Groupable['title'];
|
|
6
|
+
}[];
|
|
7
|
+
declare const useGroupable: (groupable?: boolean | Groupable, items?: Conversation[]) => [groupList: GroupList, enableGroup: boolean];
|
|
8
|
+
export default useGroupable;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { MenuProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Conversation, Groupable } from './interface';
|
|
4
|
+
export interface ConversationsProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
5
|
+
/**
|
|
6
|
+
* @description 会话列表的数据源数组,包含所有会话信息
|
|
7
|
+
* @descriptionEn Data source array for the conversation list containing all conversation information
|
|
8
|
+
*/
|
|
9
|
+
items?: Conversation[];
|
|
10
|
+
/**
|
|
11
|
+
* @description 当前激活的会话标识符,用于高亮显示选中项
|
|
12
|
+
* @descriptionEn Currently active conversation identifier for highlighting selected item
|
|
13
|
+
*/
|
|
14
|
+
activeKey?: Conversation['key'];
|
|
15
|
+
/**
|
|
16
|
+
* @description 组件初始化时的默认选中会话标识符
|
|
17
|
+
* @descriptionEn Default selected conversation identifier when component initializes
|
|
18
|
+
*/
|
|
19
|
+
defaultActiveKey?: Conversation['key'];
|
|
20
|
+
/**
|
|
21
|
+
* @description 会话选择发生变化时的回调函数,接收新的会话标识符
|
|
22
|
+
* @descriptionEn Callback function when conversation selection changes, receives new conversation identifier
|
|
23
|
+
*/
|
|
24
|
+
onActiveChange?: (value: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* @description 会话操作菜单配置,支持静态配置或动态函数返回
|
|
27
|
+
* @descriptionEn Conversation operation menu configuration, supports static config or dynamic function return
|
|
28
|
+
*/
|
|
29
|
+
menu?: MenuProps | ((value: Conversation) => MenuProps);
|
|
30
|
+
/**
|
|
31
|
+
* @description 语义化样式对象,用于精确控制不同区域的样式
|
|
32
|
+
* @descriptionEn Semantic style object for precise control of different area styles
|
|
33
|
+
*/
|
|
34
|
+
styles?: Partial<Record<'item', React.CSSProperties>>;
|
|
35
|
+
/**
|
|
36
|
+
* @description 语义化CSS类名,用于为不同区域添加自定义类名
|
|
37
|
+
* @descriptionEn Semantic CSS class names for adding custom classes to different areas
|
|
38
|
+
*/
|
|
39
|
+
classNames?: Partial<Record<'item', string>>;
|
|
40
|
+
/**
|
|
41
|
+
* @description 自定义CSS类名前缀,用于样式隔离和主题定制
|
|
42
|
+
* @descriptionEn Custom CSS class name prefix for style isolation and theme customization
|
|
43
|
+
*/
|
|
44
|
+
prefixCls?: string;
|
|
45
|
+
/**
|
|
46
|
+
* @description 自定义根容器的CSS类名,用于覆盖默认样式
|
|
47
|
+
* @descriptionEn Custom CSS class name for the root container to override default styles
|
|
48
|
+
*/
|
|
49
|
+
rootClassName?: string;
|
|
50
|
+
}
|
|
51
|
+
declare const Conversations: React.FC<ConversationsProps & {
|
|
52
|
+
groupable?: boolean | Groupable;
|
|
53
|
+
}>;
|
|
54
|
+
export type { Conversation };
|
|
55
|
+
export default Conversations;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["prefixCls", "rootClassName", "items", "activeKey", "defaultActiveKey", "onActiveChange", "menu", "styles", "classNames", "groupable", "className", "style"];
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -21,12 +22,9 @@ import { useProviderContext } from "./..";
|
|
|
21
22
|
import useGroupable from "./hooks/useGroupable";
|
|
22
23
|
import useStyle from "./style";
|
|
23
24
|
import pickAttrs from 'rc-util/lib/pickAttrs';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* @descEN Props for the conversation list component
|
|
28
|
-
*/
|
|
29
|
-
|
|
25
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
30
28
|
var Conversations = function Conversations(props) {
|
|
31
29
|
var customizePrefixCls = props.prefixCls,
|
|
32
30
|
rootClassName = props.rootClassName,
|
|
@@ -48,8 +46,6 @@ var Conversations = function Conversations(props) {
|
|
|
48
46
|
aria: true,
|
|
49
47
|
data: true
|
|
50
48
|
});
|
|
51
|
-
|
|
52
|
-
// ============================ ActiveKey ============================
|
|
53
49
|
var _useMergedState = useMergedState(defaultActiveKey, {
|
|
54
50
|
value: activeKey
|
|
55
51
|
}),
|
|
@@ -61,64 +57,57 @@ var Conversations = function Conversations(props) {
|
|
|
61
57
|
groupList = _useGroupable2[0],
|
|
62
58
|
enableGroup = _useGroupable2[1];
|
|
63
59
|
var _useProviderContext = useProviderContext(),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var prefixCls = getPrefixCls('conversations'
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
wrapCSSVar = _useStyle2[0],
|
|
70
|
-
hashId = _useStyle2[1],
|
|
71
|
-
cssVarCls = _useStyle2[2];
|
|
72
|
-
var mergedCls = classnames(prefixCls, className, rootClassName, hashId, cssVarCls, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'));
|
|
60
|
+
direction = _useProviderContext.direction,
|
|
61
|
+
getPrefixCls = _useProviderContext.getPrefixCls;
|
|
62
|
+
var prefixCls = getPrefixCls('conversations');
|
|
63
|
+
var Style = useStyle();
|
|
64
|
+
var mergedCls = classnames(prefixCls, className, rootClassName, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'));
|
|
73
65
|
var onConversationItemClick = function onConversationItemClick(info) {
|
|
74
66
|
setMergedActiveKey(info.key);
|
|
75
67
|
if (onActiveChange) {
|
|
76
68
|
onActiveChange(info.key);
|
|
77
69
|
}
|
|
78
70
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
71
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
72
|
+
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx("ul", _objectSpread(_objectSpread({}, domProps), {}, {
|
|
73
|
+
style: style,
|
|
74
|
+
className: mergedCls,
|
|
75
|
+
children: groupList.map(function (groupInfo, groupIndex) {
|
|
76
|
+
var convItems = groupInfo.data.map(function (convInfo, convIndex) {
|
|
77
|
+
return /*#__PURE__*/_jsx(ConversationsItem, {
|
|
78
|
+
info: convInfo,
|
|
79
|
+
prefixCls: prefixCls,
|
|
80
|
+
direction: direction,
|
|
81
|
+
className: classnames(classNames.item),
|
|
82
|
+
style: styles.item,
|
|
83
|
+
menu: typeof menu === 'function' ? menu(convInfo) : menu,
|
|
84
|
+
active: mergedActiveKey === convInfo.key,
|
|
85
|
+
onClick: onConversationItemClick
|
|
86
|
+
}, convInfo.key || "key-".concat(convIndex));
|
|
87
|
+
});
|
|
88
|
+
if (enableGroup) {
|
|
89
|
+
var _groupInfo$title;
|
|
90
|
+
return /*#__PURE__*/_jsxs("li", {
|
|
91
|
+
children: [/*#__PURE__*/_jsx(GroupTitleContext.Provider, {
|
|
92
|
+
value: {
|
|
93
|
+
prefixCls: prefixCls
|
|
94
|
+
},
|
|
95
|
+
children: ((_groupInfo$title = groupInfo.title) === null || _groupInfo$title === void 0 ? void 0 : _groupInfo$title.call(groupInfo, groupInfo.name, {
|
|
96
|
+
components: {
|
|
97
|
+
GroupTitle: GroupTitle
|
|
98
|
+
}
|
|
99
|
+
})) || /*#__PURE__*/_jsx(GroupTitle, {
|
|
100
|
+
children: groupInfo.name
|
|
101
|
+
}, groupInfo.name)
|
|
102
|
+
}), /*#__PURE__*/_jsx("ul", {
|
|
103
|
+
className: "".concat(prefixCls, "-list"),
|
|
104
|
+
children: convItems
|
|
105
|
+
})]
|
|
106
|
+
}, groupInfo.name || "key-".concat(groupIndex));
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
})) || /*#__PURE__*/React.createElement(GroupTitle, {
|
|
113
|
-
key: groupInfo.name
|
|
114
|
-
}, groupInfo.name)), /*#__PURE__*/React.createElement("ul", {
|
|
115
|
-
className: "".concat(prefixCls, "-list")
|
|
116
|
-
}, convItems));
|
|
117
|
-
}
|
|
118
|
-
return convItems;
|
|
119
|
-
})));
|
|
108
|
+
return convItems;
|
|
109
|
+
})
|
|
110
|
+
}))]
|
|
111
|
+
});
|
|
120
112
|
};
|
|
121
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
122
|
-
Conversations.displayName = 'Conversations';
|
|
123
|
-
}
|
|
124
113
|
export default Conversations;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { AnyObject } from '../Util/type';
|
|
3
|
+
import type { GroupTitleProps } from './GroupTitle';
|
|
4
|
+
type GroupType = string;
|
|
5
|
+
export interface Conversation extends AnyObject {
|
|
6
|
+
/**
|
|
7
|
+
* @description 会话的唯一标识符,用于区分不同的聊天会话
|
|
8
|
+
* @descriptionEn Unique identifier for the conversation to distinguish different chat sessions
|
|
9
|
+
*/
|
|
10
|
+
key: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description 会话的显示名称,支持文本或React元素
|
|
13
|
+
* @descriptionEn Display name for the conversation, supports text or React elements
|
|
14
|
+
*/
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* @description 会话创建或最后活动的时间戳,用于排序和显示
|
|
18
|
+
* @descriptionEn Timestamp of conversation creation or last activity for sorting and display
|
|
19
|
+
*/
|
|
20
|
+
timestamp?: number;
|
|
21
|
+
/**
|
|
22
|
+
* @description 会话的图标元素,用于视觉识别
|
|
23
|
+
* @descriptionEn Icon element for the conversation for visual identification
|
|
24
|
+
*/
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* @description 是否禁用该会话,影响交互功能
|
|
28
|
+
* @descriptionEn Whether to disable this conversation, affects interaction functionality
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @description 是否在时间线中显示该会话,用于分组显示
|
|
33
|
+
* @descriptionEn Whether to show this conversation in timeline for grouped display
|
|
34
|
+
*/
|
|
35
|
+
timeline?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export type GroupSorter = Parameters<GroupType[]['sort']>[0];
|
|
38
|
+
export type GroupTitleRenderComponents = {
|
|
39
|
+
components: {
|
|
40
|
+
GroupTitle: React.ComponentType<GroupTitleProps>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type GroupTitleRender = ((group: GroupType, info: GroupTitleRenderComponents) => React.ReactNode) | undefined;
|
|
44
|
+
export interface Groupable {
|
|
45
|
+
/**
|
|
46
|
+
* @description 会话分组的排序函数,用于自定义排序逻辑
|
|
47
|
+
* @descriptionEn Sorting function for conversation grouping for custom sorting logic
|
|
48
|
+
*/
|
|
49
|
+
sort?: GroupSorter;
|
|
50
|
+
/**
|
|
51
|
+
* @description 自定义分组标题的渲染函数,用于个性化显示
|
|
52
|
+
* @descriptionEn Custom rendering function for group titles for personalized display
|
|
53
|
+
*/
|
|
54
|
+
title?: GroupTitleRender;
|
|
55
|
+
}
|
|
56
|
+
export {};
|