@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,274 @@
|
|
|
1
|
+
import { type GetProp, GetRef, Upload, type UploadProps } from 'antd';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useProviderContext } from '@agentscope-ai/chat';
|
|
5
|
+
|
|
6
|
+
import { useEvent, useMergedState } from 'rc-util';
|
|
7
|
+
import DropArea from './DropArea';
|
|
8
|
+
import FileList, { type FileListProps } from './FileList';
|
|
9
|
+
import FileListCard from './FileList/FileListCard';
|
|
10
|
+
import PlaceholderUploader, {
|
|
11
|
+
type PlaceholderProps,
|
|
12
|
+
type PlaceholderType,
|
|
13
|
+
} from './PlaceholderUploader';
|
|
14
|
+
import SilentUploader from './SilentUploader';
|
|
15
|
+
import { AttachmentContext } from './context';
|
|
16
|
+
import Style from './style';
|
|
17
|
+
|
|
18
|
+
export type SemanticType = 'list' | 'item' | 'placeholder';
|
|
19
|
+
|
|
20
|
+
export type Attachment = GetProp<UploadProps, 'fileList'>[number] & {
|
|
21
|
+
description?: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export interface AttachmentsProps extends Omit<UploadProps, 'fileList'> {
|
|
25
|
+
/**
|
|
26
|
+
* @description 自定义CSS类名前缀,用于样式隔离和主题定制
|
|
27
|
+
* @descriptionEn Custom CSS class name prefix for style isolation and theme customization
|
|
28
|
+
*/
|
|
29
|
+
prefixCls?: string;
|
|
30
|
+
/**
|
|
31
|
+
* @description 自定义根容器的CSS类名,用于覆盖默认样式
|
|
32
|
+
* @descriptionEn Custom CSS class name for the root container to override default styles
|
|
33
|
+
*/
|
|
34
|
+
rootClassName?: string;
|
|
35
|
+
/**
|
|
36
|
+
* @description 根容器的内联样式对象
|
|
37
|
+
* @descriptionEn Inline style object for the root container
|
|
38
|
+
*/
|
|
39
|
+
rootStyle?: React.CSSProperties;
|
|
40
|
+
/**
|
|
41
|
+
* @description 组件容器的内联样式对象
|
|
42
|
+
* @descriptionEn Inline style object for the component container
|
|
43
|
+
*/
|
|
44
|
+
style?: React.CSSProperties;
|
|
45
|
+
/**
|
|
46
|
+
* @description 组件的CSS类名
|
|
47
|
+
* @descriptionEn CSS class name for the component
|
|
48
|
+
*/
|
|
49
|
+
className?: string;
|
|
50
|
+
/**
|
|
51
|
+
* @description 语义化CSS类名,用于为不同区域添加自定义类名
|
|
52
|
+
* @descriptionEn Semantic CSS class names for adding custom classes to different areas
|
|
53
|
+
*/
|
|
54
|
+
classNames?: Partial<Record<SemanticType, string>>;
|
|
55
|
+
/**
|
|
56
|
+
* @description 语义化样式对象,用于精确控制不同区域的样式
|
|
57
|
+
* @descriptionEn Semantic style object for precise control of different area styles
|
|
58
|
+
*/
|
|
59
|
+
styles?: Partial<Record<SemanticType, React.CSSProperties>>;
|
|
60
|
+
/**
|
|
61
|
+
* @description 自定义子元素,用于扩展组件功能
|
|
62
|
+
* @descriptionEn Custom child elements for extending component functionality
|
|
63
|
+
*/
|
|
64
|
+
children?: React.ReactElement;
|
|
65
|
+
/**
|
|
66
|
+
* @description 是否禁用整个附件组件,包括拖拽和点击上传
|
|
67
|
+
* @descriptionEn Whether to disable the entire attachment component, including drag and click upload
|
|
68
|
+
*/
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* @description 占位符配置,支持静态内容或动态函数返回
|
|
72
|
+
* @descriptionEn Placeholder configuration, supports static content or dynamic function return
|
|
73
|
+
*/
|
|
74
|
+
placeholder?: PlaceholderType | ((type: 'inline' | 'drop') => PlaceholderType);
|
|
75
|
+
/**
|
|
76
|
+
* @description 获取拖拽容器的函数,用于自定义拖拽区域
|
|
77
|
+
* @descriptionEn Function to get drag container for customizing drag area
|
|
78
|
+
*/
|
|
79
|
+
getDropContainer?: null | (() => HTMLElement | null | undefined);
|
|
80
|
+
/**
|
|
81
|
+
* @description 附件列表数据,用于显示已上传的文件
|
|
82
|
+
* @descriptionEn Attachment list data for displaying uploaded files
|
|
83
|
+
*/
|
|
84
|
+
items?: Attachment[];
|
|
85
|
+
/**
|
|
86
|
+
* @description 文件列表溢出处理方式,影响多文件的显示效果
|
|
87
|
+
* @descriptionEn File list overflow handling method, affects display effect of multiple files
|
|
88
|
+
*/
|
|
89
|
+
overflow?: FileListProps['overflow'];
|
|
90
|
+
/**
|
|
91
|
+
* @description 渲染类型,目前仅支持默认渲染模式
|
|
92
|
+
* @descriptionEn Render type, currently only supports default render mode
|
|
93
|
+
*/
|
|
94
|
+
renderType?: 'default',
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface AttachmentsRef {
|
|
98
|
+
/**
|
|
99
|
+
* @description 组件的原生DOM元素引用,用于直接操作DOM
|
|
100
|
+
* @descriptionEn Native DOM element reference of the component for direct DOM manipulation
|
|
101
|
+
*/
|
|
102
|
+
nativeElement: HTMLDivElement | null;
|
|
103
|
+
/**
|
|
104
|
+
* @description 手动触发文件上传的方法,接收File对象作为参数
|
|
105
|
+
* @descriptionEn Method to manually trigger file upload, accepts File object as parameter
|
|
106
|
+
*/
|
|
107
|
+
upload: (file: File) => void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function Attachments(props: AttachmentsProps, ref: React.Ref<AttachmentsRef>) {
|
|
111
|
+
const {
|
|
112
|
+
prefixCls: customizePrefixCls,
|
|
113
|
+
rootClassName,
|
|
114
|
+
rootStyle,
|
|
115
|
+
className,
|
|
116
|
+
style,
|
|
117
|
+
items,
|
|
118
|
+
children,
|
|
119
|
+
getDropContainer,
|
|
120
|
+
placeholder,
|
|
121
|
+
onChange,
|
|
122
|
+
overflow,
|
|
123
|
+
disabled,
|
|
124
|
+
classNames = {},
|
|
125
|
+
styles = {},
|
|
126
|
+
...uploadProps
|
|
127
|
+
} = props;
|
|
128
|
+
const { direction, getPrefixCls } = useProviderContext();
|
|
129
|
+
const prefixCls = getPrefixCls('attachment');
|
|
130
|
+
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
131
|
+
const uploadRef = React.useRef<GetRef<typeof Upload>>(null);
|
|
132
|
+
|
|
133
|
+
React.useImperativeHandle(ref, () => ({
|
|
134
|
+
nativeElement: containerRef.current,
|
|
135
|
+
upload: (file) => {
|
|
136
|
+
const fileInput = uploadRef.current?.nativeElement?.querySelector('input[type="file"]');
|
|
137
|
+
|
|
138
|
+
// Trigger native change event
|
|
139
|
+
if (fileInput) {
|
|
140
|
+
const dataTransfer = new DataTransfer();
|
|
141
|
+
dataTransfer.items.add(file);
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
fileInput.files = dataTransfer.files;
|
|
144
|
+
|
|
145
|
+
fileInput.dispatchEvent(new Event('change', { bubbles: true }));
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
}));
|
|
149
|
+
|
|
150
|
+
const [fileList, setFileList] = useMergedState([], {
|
|
151
|
+
value: items,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const triggerChange: GetProp<AttachmentsProps, 'onChange'> = useEvent((info) => {
|
|
155
|
+
setFileList(info.fileList);
|
|
156
|
+
onChange?.(info);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const mergedUploadProps: UploadProps = {
|
|
160
|
+
...uploadProps,
|
|
161
|
+
fileList,
|
|
162
|
+
onChange: triggerChange,
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const onItemRemove = (item: Attachment) => {
|
|
166
|
+
const newFileList = fileList.filter((fileItem) => fileItem.uid !== item.uid);
|
|
167
|
+
triggerChange({
|
|
168
|
+
file: item,
|
|
169
|
+
fileList: newFileList,
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
let renderChildren: React.ReactElement;
|
|
174
|
+
|
|
175
|
+
const getPlaceholderNode = (
|
|
176
|
+
type: 'inline' | 'drop',
|
|
177
|
+
props?: Pick<PlaceholderProps, 'style'>,
|
|
178
|
+
ref?: React.RefObject<GetRef<typeof Upload>>,
|
|
179
|
+
) => {
|
|
180
|
+
const placeholderContent = typeof placeholder === 'function' ? placeholder(type) : placeholder;
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<PlaceholderUploader
|
|
184
|
+
placeholder={placeholderContent}
|
|
185
|
+
upload={mergedUploadProps}
|
|
186
|
+
prefixCls={prefixCls}
|
|
187
|
+
className={classnames(classNames.placeholder)}
|
|
188
|
+
style={{
|
|
189
|
+
...styles.placeholder,
|
|
190
|
+
...props?.style,
|
|
191
|
+
}}
|
|
192
|
+
ref={ref}
|
|
193
|
+
/>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
if (children) {
|
|
198
|
+
renderChildren = (
|
|
199
|
+
<>
|
|
200
|
+
<SilentUploader upload={mergedUploadProps} rootClassName={rootClassName} ref={uploadRef}>
|
|
201
|
+
{children}
|
|
202
|
+
</SilentUploader>
|
|
203
|
+
<DropArea
|
|
204
|
+
getDropContainer={getDropContainer}
|
|
205
|
+
prefixCls={prefixCls}
|
|
206
|
+
className={classnames(rootClassName)}
|
|
207
|
+
>
|
|
208
|
+
{getPlaceholderNode('drop')}
|
|
209
|
+
</DropArea>
|
|
210
|
+
</>
|
|
211
|
+
);
|
|
212
|
+
} else {
|
|
213
|
+
const hasFileList = fileList.length > 0;
|
|
214
|
+
|
|
215
|
+
renderChildren = (
|
|
216
|
+
<div
|
|
217
|
+
className={classnames(
|
|
218
|
+
prefixCls,
|
|
219
|
+
{
|
|
220
|
+
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
221
|
+
},
|
|
222
|
+
className,
|
|
223
|
+
rootClassName,
|
|
224
|
+
)}
|
|
225
|
+
style={{
|
|
226
|
+
...rootStyle,
|
|
227
|
+
...style,
|
|
228
|
+
}}
|
|
229
|
+
dir={direction || 'ltr'}
|
|
230
|
+
ref={containerRef}
|
|
231
|
+
>
|
|
232
|
+
<FileList
|
|
233
|
+
prefixCls={prefixCls}
|
|
234
|
+
items={fileList}
|
|
235
|
+
onRemove={onItemRemove}
|
|
236
|
+
overflow={overflow}
|
|
237
|
+
upload={mergedUploadProps}
|
|
238
|
+
listClassName={classnames(classNames.list)}
|
|
239
|
+
listStyle={{
|
|
240
|
+
...styles.list,
|
|
241
|
+
...(!hasFileList && { display: 'none' }),
|
|
242
|
+
}}
|
|
243
|
+
itemClassName={classnames(classNames.item)}
|
|
244
|
+
itemStyle={{
|
|
245
|
+
...styles.item,
|
|
246
|
+
}}
|
|
247
|
+
renderType={props.renderType}
|
|
248
|
+
/>
|
|
249
|
+
{getPlaceholderNode('inline', hasFileList ? { style: { display: 'none' } } : {}, uploadRef)}
|
|
250
|
+
</div>
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return <>
|
|
255
|
+
<Style />
|
|
256
|
+
<AttachmentContext.Provider
|
|
257
|
+
value={{
|
|
258
|
+
disabled,
|
|
259
|
+
}}
|
|
260
|
+
>
|
|
261
|
+
{renderChildren}
|
|
262
|
+
</AttachmentContext.Provider>
|
|
263
|
+
</>
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const ForwardAttachments = React.forwardRef(Attachments) as React.ForwardRefExoticComponent<
|
|
267
|
+
AttachmentsProps & React.RefAttributes<AttachmentsRef>
|
|
268
|
+
> & {
|
|
269
|
+
FileCard: typeof FileListCard;
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
ForwardAttachments.FileCard = FileListCard;
|
|
273
|
+
|
|
274
|
+
export default ForwardAttachments;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'antd-style';
|
|
2
|
+
|
|
3
|
+
export default createGlobalStyle`
|
|
4
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card {
|
|
5
|
+
border-radius: ${(p) => p.theme.borderRadius}px;
|
|
6
|
+
position: relative;
|
|
7
|
+
background: ${(p) => p.theme.colorBgContainer};
|
|
8
|
+
border-width: ${(p) => p.theme.lineWidth}px;
|
|
9
|
+
border-style: solid;
|
|
10
|
+
border-color: ${(p) => p.theme.colorBorderSecondary};
|
|
11
|
+
flex: none;
|
|
12
|
+
transition: all 0.3s;
|
|
13
|
+
|
|
14
|
+
&-name,
|
|
15
|
+
&-desc {
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
text-overflow: ellipsis;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-ellipsis-prefix {
|
|
23
|
+
flex: 0 1 auto;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-ellipsis-suffix {
|
|
31
|
+
flex: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-type-overview {
|
|
35
|
+
padding: 0 8px;
|
|
36
|
+
display: flex;
|
|
37
|
+
height: 56px;
|
|
38
|
+
gap: ${(p) => p.theme.paddingXS}px;
|
|
39
|
+
align-items: center;
|
|
40
|
+
width: 140px;
|
|
41
|
+
|
|
42
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-icon {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-content {
|
|
48
|
+
flex: auto;
|
|
49
|
+
min-width: 0;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
align-items: stretch;
|
|
53
|
+
font-size: ${(p) => p.theme.fontSize}px;
|
|
54
|
+
color: ${(p) => p.theme.colorText};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-desc {
|
|
58
|
+
color: ${(p) => p.theme.colorTextQuaternary};
|
|
59
|
+
font-size: ${(p) => p.theme.fontSizeSM}px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-type-preview {
|
|
64
|
+
width: 56px;
|
|
65
|
+
height: 56px;
|
|
66
|
+
line-height: 1;
|
|
67
|
+
|
|
68
|
+
img {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
vertical-align: top;
|
|
72
|
+
object-fit: cover;
|
|
73
|
+
border-radius: 5px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-img-mask {
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset: 0;
|
|
79
|
+
display: flex;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
background: rgba(0, 0, 0, ${(p) => p.theme.opacityLoading});
|
|
83
|
+
border-radius: inherit;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.${(p) => p.theme.prefixCls}-attachment-list-card-status-error {
|
|
87
|
+
|
|
88
|
+
img,
|
|
89
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-img-mask {
|
|
90
|
+
border-radius: calc(${(p) => p.theme.borderRadius}px - ${(p) =>
|
|
91
|
+
p.theme.lineWidth}px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-desc {
|
|
95
|
+
padding-inline: ${(p) => p.theme.paddingXXS}px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-progress {
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&-remove {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: -6px;
|
|
106
|
+
right: -6px;
|
|
107
|
+
width: 16px;
|
|
108
|
+
height: 16px;
|
|
109
|
+
line-height: 1;
|
|
110
|
+
font-size: 10px;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
display: none;
|
|
113
|
+
color: ${(p) => p.theme.colorText};
|
|
114
|
+
background-color: ${(p) => p.theme.colorBgContainer};
|
|
115
|
+
border-width: ${(p) => p.theme.lineWidth}px;
|
|
116
|
+
border-style: solid;
|
|
117
|
+
border-color: ${(p) => p.theme.colorBorder};
|
|
118
|
+
border-radius: 50%;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
transition: all 0.3s;
|
|
122
|
+
|
|
123
|
+
&:dir(rtl) {
|
|
124
|
+
transform: translate(-50%, -50%);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:hover &-remove {
|
|
129
|
+
display: flex;
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&-status-error {
|
|
134
|
+
border-color: ${(p) => p.theme.colorError};
|
|
135
|
+
|
|
136
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-desc {
|
|
137
|
+
color: ${(p) => p.theme.colorError};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&-motion {
|
|
142
|
+
|
|
143
|
+
&-appear-start {
|
|
144
|
+
width: 0;
|
|
145
|
+
transition: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-leave-active {
|
|
149
|
+
opacity: 0;
|
|
150
|
+
width: 0;
|
|
151
|
+
padding-inline: 0;
|
|
152
|
+
border-inline-width: 0;
|
|
153
|
+
margin-inline-end: calc(-1 * ${(p) => p.theme.paddingSM}px);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.${(p) => p.theme.prefixCls}-attachment-list-card-hoverable {
|
|
159
|
+
&:hover {
|
|
160
|
+
border-color: ${(p) => p.theme.colorPrimary};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { createGlobalStyle } from 'antd-style';
|
|
2
|
+
|
|
3
|
+
export default createGlobalStyle`
|
|
4
|
+
.${p => p.theme.prefixCls}-attachment {
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
|
|
9
|
+
&,
|
|
10
|
+
* {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-drop-area {
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
|
+
z-index: ${(p) => p.theme.zIndexPopupBase}
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
|
|
20
|
+
&,
|
|
21
|
+
* {
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-on-body {
|
|
26
|
+
position: fixed;
|
|
27
|
+
inset: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-hide-placement {
|
|
31
|
+
.${p => p.theme.prefixCls}-attachment-placeholder-inner {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.${p => p.theme.prefixCls}-attachment-placeholder {
|
|
37
|
+
padding: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&-placeholder {
|
|
42
|
+
height: 100%;
|
|
43
|
+
border-radius: ${(p) => p.theme.borderRadius}px;
|
|
44
|
+
border-width: ${(p) => p.theme.lineWidthBold}px;
|
|
45
|
+
border-style: dashed;
|
|
46
|
+
border-color: transparent;
|
|
47
|
+
padding: ${(p) => p.theme.padding}px;
|
|
48
|
+
position: relative;
|
|
49
|
+
backdrop-filter: blur(10px);
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
|
|
52
|
+
&,
|
|
53
|
+
* {
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.${p => p.theme.prefixCls}-upload-wrapper .${p => p.theme.prefixCls}-upload.${p => p.theme.prefixCls}-upload-btn {
|
|
58
|
+
padding: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.${p => p.theme.prefixCls}-attachment-placeholder-drag-in {
|
|
62
|
+
border-color: ${(p) => p.theme.colorPrimaryHover};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.${p => p.theme.prefixCls}-attachment-placeholder-disabled {
|
|
66
|
+
opacity: 0.25;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&-inner {
|
|
71
|
+
gap: calc(${(p) => p.theme.paddingXXS}px / 2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&-icon {
|
|
75
|
+
font-size: ${(p) => p.theme.fontSizeHeading2}px;
|
|
76
|
+
line-height: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&-title.${p => p.theme.prefixCls}-attachment-placeholder-title {
|
|
80
|
+
margin: 0;
|
|
81
|
+
font-size: ${(p) => p.theme.fontSize}px;
|
|
82
|
+
line-height: ${(p) => p.theme.lineHeight};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&-list {
|
|
87
|
+
display: flex;
|
|
88
|
+
gap: ${(p) => p.theme.paddingSM}px;
|
|
89
|
+
font-size: ${(p) => p.theme.fontSize}px;
|
|
90
|
+
line-height: ${(p) => p.theme.lineHeight};
|
|
91
|
+
color: ${(p) => p.theme.colorText};
|
|
92
|
+
width: 100%;
|
|
93
|
+
overflow: auto;
|
|
94
|
+
padding: ${(p) => p.theme.padding}px;
|
|
95
|
+
padding-bottom: 0;
|
|
96
|
+
|
|
97
|
+
scrollbar-width: none;
|
|
98
|
+
-ms-overflow-style: none;
|
|
99
|
+
&::-webkit-scrollbar {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&-overflow-scrollX,
|
|
104
|
+
&-overflow-scrollY {
|
|
105
|
+
&:before,
|
|
106
|
+
&:after {
|
|
107
|
+
content: "";
|
|
108
|
+
position: absolute;
|
|
109
|
+
opacity: 0;
|
|
110
|
+
z-index: 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&-overflow-ping-start:before {
|
|
115
|
+
opacity: 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&-overflow-ping-end:after {
|
|
119
|
+
opacity: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&-overflow-scrollX {
|
|
123
|
+
overflow-x: auto;
|
|
124
|
+
overflow-y: hidden;
|
|
125
|
+
flex-wrap: nowrap;
|
|
126
|
+
|
|
127
|
+
&:before,
|
|
128
|
+
&:after {
|
|
129
|
+
inset-block: 0;
|
|
130
|
+
width: 8px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&:before {
|
|
134
|
+
inset-inline-start: 0;
|
|
135
|
+
background: linear-gradient(to right, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&:after {
|
|
139
|
+
inset-inline-end: 0;
|
|
140
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&:dir(rtl) {
|
|
144
|
+
&:before {
|
|
145
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:after {
|
|
149
|
+
background: linear-gradient(to right, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&-overflow-scrollY {
|
|
155
|
+
overflow-x: hidden;
|
|
156
|
+
overflow-y: auto;
|
|
157
|
+
max-height: calc(${(p) => p.theme.fontSize}px * ${(p) =>
|
|
158
|
+
p.theme.lineHeight}px * 2 + ${(p) => p.theme.paddingSM}px + ${(p) =>
|
|
159
|
+
p.theme.paddingSM}px * 3);
|
|
160
|
+
|
|
161
|
+
&:before,
|
|
162
|
+
&:after {
|
|
163
|
+
inset-inline: 0;
|
|
164
|
+
height: 8px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&:before {
|
|
168
|
+
inset-block-start: 0;
|
|
169
|
+
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:after {
|
|
173
|
+
inset-block-end: 0;
|
|
174
|
+
background: linear-gradient(to top, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&-upload-btn {
|
|
179
|
+
width: calc(${(p) => p.theme.fontSize}px * ${(p) =>
|
|
180
|
+
p.theme.lineHeight}px * 2 + ${(p) => p.theme.paddingSM}px + ${(p) =>
|
|
181
|
+
p.theme.paddingSM}px);
|
|
182
|
+
height: calc(${(p) => p.theme.fontSize}px * ${(p) =>
|
|
183
|
+
p.theme.lineHeight}px * 2 + ${(p) => p.theme.paddingSM}px + ${(p) =>
|
|
184
|
+
p.theme.paddingSM}px);
|
|
185
|
+
font-size: ${(p) => p.theme.fontSizeHeading2}px;
|
|
186
|
+
color: #999;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&-prev-btn,
|
|
190
|
+
&-next-btn {
|
|
191
|
+
position: absolute;
|
|
192
|
+
top: 50%;
|
|
193
|
+
transform: translateY(-50%);
|
|
194
|
+
box-shadow: ${(p) => p.theme.boxShadowTertiary};
|
|
195
|
+
opacity: 0;
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&-prev-btn {
|
|
200
|
+
left: ${(p) => p.theme.padding}px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&-next-btn {
|
|
204
|
+
right: ${(p) => p.theme.padding}px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&:dir(ltr) {
|
|
208
|
+
&.${p => p.theme.prefixCls}-attachment-list-overflow-ping-start .${p => p.theme.prefixCls}-attachment-list-prev-btn {
|
|
209
|
+
opacity: 1;
|
|
210
|
+
pointer-events: auto;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&.${p => p.theme.prefixCls}-attachment-list-overflow-ping-end .${p => p.theme.prefixCls}-attachment-list-next-btn {
|
|
214
|
+
opacity: 1;
|
|
215
|
+
pointer-events: auto;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&:dir(rtl) {
|
|
220
|
+
&.${p => p.theme.prefixCls}-attachment-list-overflow-ping-end .${p => p.theme.prefixCls}-attachment-list-prev-btn {
|
|
221
|
+
opacity: 1;
|
|
222
|
+
pointer-events: auto;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.${p => p.theme.prefixCls}-attachment-list-overflow-ping-start .${p => p.theme.prefixCls}-attachment-list-next-btn {
|
|
226
|
+
opacity: 1;
|
|
227
|
+
pointer-events: auto;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
`;
|