@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.
Files changed (335) hide show
  1. package/bin/client.js +1 -1
  2. package/components/AGUI/components/HelpModal/icons.tsx +68 -0
  3. package/components/AGUI/components/HelpModal/index.tsx +1 -0
  4. package/components/AGUI/components/HelpModal/modal.tsx +101 -0
  5. package/components/AGUI/components/chat/Button.tsx +18 -0
  6. package/components/AGUI/components/chat/Chat.tsx +780 -0
  7. package/components/AGUI/components/chat/ChatContext.tsx +248 -0
  8. package/components/AGUI/components/chat/CodeBlock.tsx +406 -0
  9. package/components/AGUI/components/chat/Header.tsx +22 -0
  10. package/components/AGUI/components/chat/Icons.tsx +237 -0
  11. package/components/AGUI/components/chat/ImageUploadQueue.tsx +77 -0
  12. package/components/AGUI/components/chat/Input.tsx +24 -0
  13. package/components/AGUI/components/chat/Markdown.tsx +134 -0
  14. package/components/AGUI/components/chat/Messages.tsx +259 -0
  15. package/components/AGUI/components/chat/Modal.tsx +133 -0
  16. package/components/AGUI/components/chat/Popup.tsx +57 -0
  17. package/components/AGUI/components/chat/PoweredByTag.tsx +29 -0
  18. package/components/AGUI/components/chat/Sidebar.tsx +74 -0
  19. package/components/AGUI/components/chat/Suggestion.tsx +132 -0
  20. package/components/AGUI/components/chat/Suggestions.tsx +20 -0
  21. package/components/AGUI/components/chat/Textarea.tsx +61 -0
  22. package/components/AGUI/components/chat/Window.tsx +152 -0
  23. package/components/AGUI/components/chat/index.tsx +11 -0
  24. package/components/AGUI/components/chat/messages/AssistantMessage.tsx +69 -0
  25. package/components/AGUI/components/chat/messages/RenderActionExecutionMessage.tsx +129 -0
  26. package/components/AGUI/components/chat/messages/RenderAgentStateMessage.tsx +116 -0
  27. package/components/AGUI/components/chat/messages/RenderImageMessage.tsx +64 -0
  28. package/components/AGUI/components/chat/messages/RenderResultMessage.tsx +26 -0
  29. package/components/AGUI/components/chat/messages/RenderTextMessage.tsx +51 -0
  30. package/components/AGUI/components/chat/messages/UserMessage.tsx +10 -0
  31. package/components/AGUI/components/chat/props.ts +186 -0
  32. package/components/AGUI/components/index.ts +1 -0
  33. package/components/AGUI/context/index.ts +1 -0
  34. package/components/AGUI/hooks/index.ts +1 -0
  35. package/components/AGUI/hooks/use-copilot-chat-suggestions.tsx +122 -0
  36. package/components/AGUI/hooks/use-copy-to-clipboard.tsx +29 -0
  37. package/components/AGUI/hooks/use-dark-mode.ts +10 -0
  38. package/components/AGUI/hooks/use-push-to-talk.tsx +166 -0
  39. package/components/AGUI/index.tsx +4 -0
  40. package/components/AGUI/lib/utils.test.ts +7 -0
  41. package/components/AGUI/lib/utils.ts +27 -0
  42. package/components/AGUI/styles.css +0 -0
  43. package/components/AGUI/types/css.ts +0 -0
  44. package/components/AGUI/types/index.ts +1 -0
  45. package/components/AGUI/types/suggestions.ts +6 -0
  46. package/components/Accordion/Accordion.tsx +203 -0
  47. package/components/Accordion/BodyContent.tsx +28 -0
  48. package/components/Accordion/DeepThinking.tsx +91 -0
  49. package/components/Accordion/SoftLightTitle.tsx +13 -0
  50. package/components/Accordion/demo/search.tsx +39 -0
  51. package/components/Accordion/demo/steps.tsx +135 -0
  52. package/components/Accordion/demo/thinking.tsx +62 -0
  53. package/components/Accordion/index.en-US.md +34 -0
  54. package/components/Accordion/index.tsx +3 -0
  55. package/components/Accordion/index.zh-CN.md +34 -0
  56. package/components/Accordion/style.ts +208 -0
  57. package/components/AgentScopeRuntimeWebUI/demo/index.tsx +4 -0
  58. package/components/AgentScopeRuntimeWebUI/index.tsx +3 -0
  59. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Builder.tsx +82 -0
  60. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Request/Card.tsx +52 -0
  61. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Actions.tsx +39 -0
  62. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Builder.tsx +205 -0
  63. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Card.tsx +44 -0
  64. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Error.tsx +7 -0
  65. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Message.tsx +23 -0
  66. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Reasoning.tsx +16 -0
  67. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/Response/Tool.tsx +19 -0
  68. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/index.tsx +0 -0
  69. package/components/AgentScopeRuntimeWebUI/lib/AgentScopeRuntime/types.tsx +100 -0
  70. package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/index.tsx +77 -0
  71. package/components/AgentScopeRuntimeWebUI/lib/Chat/Input/useAttachments.tsx +53 -0
  72. package/components/AgentScopeRuntimeWebUI/lib/Chat/MessageList/index.tsx +30 -0
  73. package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/index.tsx +66 -0
  74. package/components/AgentScopeRuntimeWebUI/lib/Chat/Welcome/styles.ts +51 -0
  75. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/index.tsx +5 -0
  76. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatController.tsx +130 -0
  77. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatMessageHandler.tsx +87 -0
  78. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatRequest.tsx +114 -0
  79. package/components/AgentScopeRuntimeWebUI/lib/Chat/hooks/useChatSessionHandler.tsx +50 -0
  80. package/components/AgentScopeRuntimeWebUI/lib/Chat/index.tsx +18 -0
  81. package/components/AgentScopeRuntimeWebUI/lib/Chat/styles.tsx +59 -0
  82. package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/ComposedProvider.tsx +27 -0
  83. package/components/AgentScopeRuntimeWebUI/lib/ChatAnywhere/index.tsx +29 -0
  84. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereControl.tsx +0 -0
  85. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereInputContext.tsx +27 -0
  86. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereLayoutContext.tsx +27 -0
  87. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereMessagesContext.tsx +82 -0
  88. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereOptionsContext.tsx +76 -0
  89. package/components/AgentScopeRuntimeWebUI/lib/Context/ChatAnywhereSessionsContext.tsx +111 -0
  90. package/components/AgentScopeRuntimeWebUI/lib/Context/useChatAnywhereEventEmitter.tsx +30 -0
  91. package/components/AgentScopeRuntimeWebUI/lib/Header/index.tsx +45 -0
  92. package/components/AgentScopeRuntimeWebUI/lib/Header/styles.ts +23 -0
  93. package/components/AgentScopeRuntimeWebUI/lib/Layout/index.tsx +45 -0
  94. package/components/AgentScopeRuntimeWebUI/lib/Layout/styles.tsx +104 -0
  95. package/components/AgentScopeRuntimeWebUI/lib/Sessions/index.tsx +114 -0
  96. package/components/AgentScopeRuntimeWebUI/lib/Sessions/styles.tsx +0 -0
  97. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/FormItem.tsx +37 -0
  98. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/OptionsEditor.tsx +163 -0
  99. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/defaultConfig.ts +43 -0
  100. package/components/AgentScopeRuntimeWebUI/lib/demo/OptionsPanel/index.tsx +27 -0
  101. package/components/AgentScopeRuntimeWebUI/lib/demo/index.tsx +57 -0
  102. package/components/AgentScopeRuntimeWebUI/lib/demo/sessionApi/index.ts +51 -0
  103. package/components/AgentScopeRuntimeWebUI/lib/types/IChatAnywhere.ts +358 -0
  104. package/components/AgentScopeRuntimeWebUI/lib/types/IMessages.tsx +52 -0
  105. package/components/AgentScopeRuntimeWebUI/lib/types/ISessions.tsx +29 -0
  106. package/components/AgentScopeRuntimeWebUI/lib/types/index.tsx +3 -0
  107. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.tsx +37 -0
  108. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.tsx +163 -0
  109. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.ts +43 -0
  110. package/components/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.tsx +27 -0
  111. package/components/AgentScopeRuntimeWebUI/starter/index.tsx +57 -0
  112. package/components/AgentScopeRuntimeWebUI/starter/sessionApi/index.ts +51 -0
  113. package/components/Attachments/DropArea.tsx +97 -0
  114. package/components/Attachments/FileList/AudioIcon.tsx +20 -0
  115. package/components/Attachments/FileList/FileListCard.tsx +270 -0
  116. package/components/Attachments/FileList/Progress.tsx +30 -0
  117. package/components/Attachments/FileList/VideoIcon.tsx +20 -0
  118. package/components/Attachments/FileList/index.tsx +201 -0
  119. package/components/Attachments/PlaceholderUploader.tsx +124 -0
  120. package/components/Attachments/SilentUploader.tsx +39 -0
  121. package/components/Attachments/context.tsx +11 -0
  122. package/components/Attachments/demo/basic.tsx +71 -0
  123. package/components/Attachments/index.en-US.md.bk +10 -0
  124. package/components/Attachments/index.tsx +274 -0
  125. package/components/Attachments/index.zh-CN.md.bk +10 -0
  126. package/components/Attachments/style/fileCard.ts +163 -0
  127. package/components/Attachments/style/index.ts +232 -0
  128. package/components/Attachments/util.ts +56 -0
  129. package/components/Bubble/Avatar.tsx +39 -0
  130. package/components/Bubble/Bubble.tsx +131 -0
  131. package/components/Bubble/BubbleList.tsx +105 -0
  132. package/components/Bubble/Cards.tsx +61 -0
  133. package/components/Bubble/Footer.tsx +55 -0
  134. package/components/Bubble/Interrupted.tsx +82 -0
  135. package/components/Bubble/ScrollToBottom.tsx +42 -0
  136. package/components/Bubble/Spin.tsx +13 -0
  137. package/components/Bubble/demo/assistantWithCode.tsx +60 -0
  138. package/components/Bubble/demo/assistantWithErrorStatus.tsx +102 -0
  139. package/components/Bubble/demo/assistantWithImage.tsx +46 -0
  140. package/components/Bubble/demo/assistantWithProcess.tsx +103 -0
  141. package/components/Bubble/demo/assistantWithSearch.tsx +69 -0
  142. package/components/Bubble/demo/assistantWithThinking.tsx +54 -0
  143. package/components/Bubble/demo/basic.tsx +55 -0
  144. package/components/Bubble/demo/userWithFile.tsx +27 -0
  145. package/components/Bubble/demo/userWithImage.tsx +26 -0
  146. package/components/Bubble/hooks/useDisplayData.ts +0 -0
  147. package/components/Bubble/hooks/useListData.ts +0 -0
  148. package/components/Bubble/index.en-US.md +33 -0
  149. package/components/Bubble/index.tsx +21 -0
  150. package/components/Bubble/index.zh-CN.md +33 -0
  151. package/components/Bubble/interface.ts +71 -0
  152. package/components/Bubble/loading.tsx +15 -0
  153. package/components/Bubble/style/avatar.ts +43 -0
  154. package/components/Bubble/style/footer.ts +45 -0
  155. package/components/Bubble/style/index.ts +192 -0
  156. package/components/Bubble/style/list.ts +51 -0
  157. package/components/ChatAnywhere/Chat/Ref.tsx +20 -0
  158. package/components/ChatAnywhere/Chat/index.tsx +56 -0
  159. package/components/ChatAnywhere/Chat/style.ts +59 -0
  160. package/components/ChatAnywhere/Header/index.tsx +37 -0
  161. package/components/ChatAnywhere/Header/style.ts +27 -0
  162. package/components/ChatAnywhere/Input/index.tsx +158 -0
  163. package/components/ChatAnywhere/Input/style.ts +14 -0
  164. package/components/ChatAnywhere/Layout/index.tsx +70 -0
  165. package/components/ChatAnywhere/Layout/style.ts +51 -0
  166. package/components/ChatAnywhere/SessionList/index.tsx +122 -0
  167. package/components/ChatAnywhere/SessionList/style.ts +53 -0
  168. package/components/ChatAnywhere/hooks/ChatAnywhereProvider.tsx +219 -0
  169. package/components/ChatAnywhere/hooks/types.ts +333 -0
  170. package/components/ChatAnywhere/hooks/useInput.tsx +22 -0
  171. package/components/ChatAnywhere/hooks/useMessages.tsx +63 -0
  172. package/components/ChatAnywhere/hooks/useSessionList.tsx +123 -0
  173. package/components/ChatAnywhere/index.tsx +49 -0
  174. package/components/Conversations/GroupTitle.tsx +28 -0
  175. package/components/Conversations/Item.tsx +189 -0
  176. package/components/Conversations/demo/basic.tsx +107 -0
  177. package/components/Conversations/demo/timeline.tsx +111 -0
  178. package/components/Conversations/demo/timestamp.tsx +110 -0
  179. package/components/Conversations/hooks/useGroupable.ts +81 -0
  180. package/components/Conversations/index.en-US.md +32 -0
  181. package/components/Conversations/index.tsx +176 -0
  182. package/components/Conversations/index.zh-CN.md +31 -0
  183. package/components/Conversations/interface.ts +69 -0
  184. package/components/Conversations/style.ts +153 -0
  185. package/components/DefaultCards/DeepThinking/index.tsx +33 -0
  186. package/components/DefaultCards/Files/index.tsx +69 -0
  187. package/components/DefaultCards/Footer/index.tsx +16 -0
  188. package/components/DefaultCards/Images/index.tsx +53 -0
  189. package/components/DefaultCards/Interrupted/index.tsx +13 -0
  190. package/components/DefaultCards/Text/index.tsx +13 -0
  191. package/components/DefaultCards/index.tsx +6 -0
  192. package/components/DeviceAction/actionMap.tsx +100 -0
  193. package/components/DeviceAction/demo/index.tsx +132 -0
  194. package/components/DeviceAction/index.en-US.md +19 -0
  195. package/components/DeviceAction/index.tsx +75 -0
  196. package/components/DeviceAction/index.zh-CN.md +19 -0
  197. package/components/Disclaimer/demo/index.tsx +4 -0
  198. package/components/Disclaimer/demo/withLink.tsx +4 -0
  199. package/components/Disclaimer/index.en-US.md +23 -0
  200. package/components/Disclaimer/index.tsx +42 -0
  201. package/components/Disclaimer/index.zh-CN.md +24 -0
  202. package/components/Disclaimer/style.ts +17 -0
  203. package/components/ImageGenerator/demo/basic.tsx +23 -0
  204. package/components/ImageGenerator/demo/custom.tsx +56 -0
  205. package/components/ImageGenerator/demo/size.tsx +15 -0
  206. package/components/ImageGenerator/index.en-US.md +23 -0
  207. package/components/ImageGenerator/index.tsx +124 -0
  208. package/components/ImageGenerator/index.zh-CN.md +23 -0
  209. package/components/ImageGenerator/style.ts +99 -0
  210. package/components/Markdown/Markdown/AnimationNode.tsx +89 -0
  211. package/components/Markdown/Markdown/Markdown.tsx +61 -0
  212. package/components/Markdown/Markdown/core/Parser.ts +52 -0
  213. package/components/Markdown/Markdown/core/Renderer.ts +121 -0
  214. package/components/Markdown/Markdown/core/index.ts +4 -0
  215. package/components/Markdown/Markdown/defaultComponents/CodeBlock.tsx +113 -0
  216. package/components/Markdown/Markdown/defaultComponents/DisabledImage.tsx +3 -0
  217. package/components/Markdown/Markdown/defaultComponents/Media.tsx +71 -0
  218. package/components/Markdown/Markdown/hooks/index.ts +4 -0
  219. package/components/Markdown/Markdown/hooks/useAnimation.tsx +27 -0
  220. package/components/Markdown/Markdown/hooks/useCitationsData.tsx +36 -0
  221. package/components/Markdown/Markdown/hooks/useStreaming.ts +503 -0
  222. package/components/Markdown/Markdown/hooks/useTyping.ts +22 -0
  223. package/components/Markdown/Markdown/index.tsx +198 -0
  224. package/components/Markdown/Markdown/interface.ts +217 -0
  225. package/components/Markdown/Markdown/style.ts +152 -0
  226. package/components/Markdown/demo/basic.tsx +107 -0
  227. package/components/Markdown/demo/citations.tsx +47 -0
  228. package/components/Markdown/demo/cursor.tsx +9 -0
  229. package/components/Markdown/demo/latex.tsx +77 -0
  230. package/components/Markdown/demo/typing.tsx +82 -0
  231. package/components/Markdown/index.en-US.md +27 -0
  232. package/components/Markdown/index.ts +1 -0
  233. package/components/Markdown/index.zh-CN.md +28 -0
  234. package/components/Markdown/plugins/citations/CitationComponent.tsx +72 -0
  235. package/components/Markdown/plugins/citations/index.tsx +37 -0
  236. package/components/Markdown/plugins/cursor/Dot.tsx +106 -0
  237. package/components/Markdown/plugins/cursor/Underline.tsx +38 -0
  238. package/components/Markdown/plugins/cursor/index.tsx +59 -0
  239. package/components/Markdown/plugins/latex/index.ts +109 -0
  240. package/components/Markdown/plugins/type.ts +71 -0
  241. package/components/Mermaid/demo/basic.tsx +12 -0
  242. package/components/Mermaid/demo/class.tsx +31 -0
  243. package/components/Mermaid/demo/flowchart.tsx +13 -0
  244. package/components/Mermaid/demo/sequence.tsx +18 -0
  245. package/components/Mermaid/demo/state.tsx +16 -0
  246. package/components/Mermaid/demo/timeline.tsx +15 -0
  247. package/components/Mermaid/index.en-US.md +27 -0
  248. package/components/Mermaid/index.tsx +118 -0
  249. package/components/Mermaid/index.zh-CN.md +27 -0
  250. package/components/OperateCard/OperateCard.tsx +93 -0
  251. package/components/OperateCard/demo/index.tsx +35 -0
  252. package/components/OperateCard/demo/rag.tsx +19 -0
  253. package/components/OperateCard/demo/thinking.tsx +17 -0
  254. package/components/OperateCard/demo/todo.tsx +28 -0
  255. package/components/OperateCard/demo/toolCall.tsx +14 -0
  256. package/components/OperateCard/demo/webSearch.tsx +12 -0
  257. package/components/OperateCard/index.en-US.md +51 -0
  258. package/components/OperateCard/index.tsx +1 -0
  259. package/components/OperateCard/index.zh-CN.md +51 -0
  260. package/components/OperateCard/preset/Rag.tsx +90 -0
  261. package/components/OperateCard/preset/Thinking.tsx +45 -0
  262. package/components/OperateCard/preset/TodoList.tsx +73 -0
  263. package/components/OperateCard/preset/ToolCall.tsx +67 -0
  264. package/components/OperateCard/preset/WebSearch.tsx +65 -0
  265. package/components/OperateCard/preset/index.tsx +5 -0
  266. package/components/OperateCard/style.ts +268 -0
  267. package/components/Provider/CustomCardsProvider.tsx +17 -0
  268. package/components/Provider/GlobalProvider.tsx +17 -0
  269. package/components/Provider/index.tsx +33 -0
  270. package/components/Provider/types.ts +23 -0
  271. package/components/ResponsesAPI/index.tsx +0 -0
  272. package/components/Sender/ModeSelect/index.tsx +160 -0
  273. package/components/Sender/ModeSelect/styles.ts +0 -0
  274. package/components/Sender/SenderHeader.tsx +164 -0
  275. package/components/Sender/StopLoading.tsx +48 -0
  276. package/components/Sender/components/ActionButton.tsx +106 -0
  277. package/components/Sender/components/ClearButton.tsx +10 -0
  278. package/components/Sender/components/LoadingButton.tsx +26 -0
  279. package/components/Sender/components/SendButton.tsx +22 -0
  280. package/components/Sender/components/SpeechButton/RecordingIcon.tsx +68 -0
  281. package/components/Sender/components/SpeechButton/index.tsx +30 -0
  282. package/components/Sender/demo/asr.tsx +7 -0
  283. package/components/Sender/demo/basic.tsx +7 -0
  284. package/components/Sender/demo/loading.tsx +5 -0
  285. package/components/Sender/demo/moreMode.tsx +45 -0
  286. package/components/Sender/demo/morePrefixAction.tsx +40 -0
  287. package/components/Sender/demo/withFile.tsx +54 -0
  288. package/components/Sender/demo/withImage.tsx +52 -0
  289. package/components/Sender/index.en-US.md +29 -0
  290. package/components/Sender/index.tsx +491 -0
  291. package/components/Sender/index.zh-CN.md +30 -0
  292. package/components/Sender/style/index.ts +150 -0
  293. package/components/Sender/useSpeech.ts +133 -0
  294. package/components/StatusCard/demo/index.tsx +32 -0
  295. package/components/StatusCard/index.en-US.md +30 -0
  296. package/components/StatusCard/index.tsx +162 -0
  297. package/components/StatusCard/index.zh-CN.md +27 -0
  298. package/components/StatusCard/style.ts +119 -0
  299. package/components/Stream/index.ts +203 -0
  300. package/components/Util/hooks/use-proxy-imperative-handle.ts +25 -0
  301. package/components/Util/sleep.ts +3 -0
  302. package/components/Util/type.ts +1 -0
  303. package/components/Util/warning.ts +118 -0
  304. package/components/Version/index.ts +3 -0
  305. package/components/Voice/Recorder.tsx +3 -0
  306. package/components/Voice/demo/index.tsx +0 -0
  307. package/components/Voice/index.en-US.md +8 -0
  308. package/components/Voice/index.tsx +0 -0
  309. package/components/Voice/index.zh-CN.md +9 -0
  310. package/components/Welcome/demo/EyeFollower.tsx +161 -0
  311. package/components/Welcome/demo/demo0.tsx +14 -0
  312. package/components/Welcome/demo/demo1.tsx +16 -0
  313. package/components/Welcome/demo/demo2.tsx +30 -0
  314. package/components/Welcome/demo/demo3.tsx +16 -0
  315. package/components/Welcome/index.en-US.md +28 -0
  316. package/components/Welcome/index.tsx +72 -0
  317. package/components/Welcome/index.zh-CN.md +28 -0
  318. package/components/index.ts +88 -0
  319. package/components/overview.en-US.md +10 -0
  320. package/components/overview.zh-CN.md +10 -0
  321. package/lib/AgentScopeRuntimeWebUI/index.d.ts +1 -0
  322. package/lib/AgentScopeRuntimeWebUI/index.js +1 -0
  323. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.d.ts +9 -0
  324. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/FormItem.js +33 -0
  325. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.d.ts +7 -0
  326. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/OptionsEditor.js +188 -0
  327. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.d.ts +29 -0
  328. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/defaultConfig.js +35 -0
  329. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.d.ts +6 -0
  330. package/lib/AgentScopeRuntimeWebUI/starter/OptionsPanel/index.js +49 -0
  331. package/lib/AgentScopeRuntimeWebUI/starter/index.d.ts +1 -0
  332. package/lib/AgentScopeRuntimeWebUI/starter/index.js +70 -0
  333. package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.d.ts +14 -0
  334. package/lib/AgentScopeRuntimeWebUI/starter/sessionApi/index.js +143 -0
  335. package/package.json +3 -2
@@ -0,0 +1,43 @@
1
+ export default () => {
2
+ return {
3
+ theme: {
4
+ colorPrimary: '#615CED',
5
+ darkMode: true,
6
+ prefix: 'agentscope-runtime-webui',
7
+ leftHeader: {
8
+ logo: 'https://img.alicdn.com/imgextra/i2/O1CN01lmoGYn1kjoXATy4PX_!!6000000004720-2-tps-200-200.png',
9
+ title: 'Runtime WebUI',
10
+ },
11
+ },
12
+ sender: {
13
+ // @ts-ignore
14
+ attachments: true,
15
+ maxLength: 10000,
16
+ disclaimer:
17
+ 'AI can also make mistakes, so please check carefully and use it with caution',
18
+ },
19
+
20
+ welcome: {
21
+ greeting: 'Hello, how can I help you today?',
22
+ description:
23
+ 'I am a helpful assistant that can help you with your questions.',
24
+ avatar:
25
+ 'https://img.alicdn.com/imgextra/i2/O1CN01lmoGYn1kjoXATy4PX_!!6000000004720-2-tps-200-200.png',
26
+ prompts: [
27
+ {
28
+ value: 'Hello',
29
+ },
30
+ {
31
+ value: 'How are you?',
32
+ },
33
+ {
34
+ value: 'What can you do?',
35
+ },
36
+ ],
37
+ },
38
+ api: {
39
+ baseURL: '',
40
+ token: '',
41
+ },
42
+ };
43
+ };
@@ -0,0 +1,27 @@
1
+ import { SparkSettingLine } from "@agentscope-ai/icons";
2
+ import { IconButton, Drawer } from "@agentscope-ai/design";
3
+ import { useState } from "react";
4
+ import OptionsEditor from "./OptionsEditor";
5
+
6
+ interface OptionsPanelProps {
7
+ value?: any;
8
+ onChange?: any;
9
+ }
10
+
11
+ export default function OptionsPanel(props: OptionsPanelProps) {
12
+ const [open, setOpen] = useState(false);
13
+
14
+ return <>
15
+ <IconButton onClick={() => setOpen(true)} icon={<SparkSettingLine />} bordered={false} />
16
+ <Drawer
17
+ destroyOnHidden
18
+ open={open}
19
+ onClose={() => setOpen(false)}
20
+ styles={{ body: { padding: 0 }, header: { padding: 8 } }}>
21
+ <OptionsEditor value={props.value} onChange={v => {
22
+ setOpen(false);
23
+ props.onChange(v);
24
+ }} />
25
+ </Drawer>
26
+ </>
27
+ }
@@ -0,0 +1,57 @@
1
+ import { AgentScopeRuntimeWebUI } from '@agentscope-ai/chat';
2
+ import OptionsPanel from './OptionsPanel';
3
+ import { useMemo, useState } from 'react';
4
+ import sessionApi from './sessionApi';
5
+ import defaultConfig from './OptionsPanel/defaultConfig';
6
+ import { useLocalStorageState } from 'ahooks';
7
+
8
+ export default function () {
9
+
10
+ const [optionsConfig, setOptionsConfig] = useLocalStorageState('agent-scope-runtime-webui-options', {
11
+ defaultValue: defaultConfig(),
12
+ listenStorageChange: true,
13
+ });
14
+
15
+ const options = useMemo(() => {
16
+ const rightHeader = <OptionsPanel value={optionsConfig} onChange={v => {
17
+ setOptionsConfig(prev => ({
18
+ ...prev,
19
+ ...v,
20
+ }));
21
+ }} />;
22
+
23
+ return {
24
+ ...optionsConfig,
25
+ session: {
26
+ multiple: true,
27
+ api: sessionApi,
28
+ },
29
+ sender: {
30
+ ...optionsConfig.sender,
31
+ attachments: optionsConfig.sender.attachments ? {
32
+ customRequest(options) {
33
+ // 模拟上传进度
34
+ options.onProgress({
35
+ percent: 100,
36
+ });
37
+ // 当前是一个 mock 的上传行为
38
+ // 实际情况需要具体实现一个文件上传服务,将文件转化为 url
39
+ options.onSuccess({
40
+ url: URL.createObjectURL(options.file as Blob)
41
+ });
42
+ }
43
+ } : undefined,
44
+ },
45
+ theme: {
46
+ ...optionsConfig.theme,
47
+ rightHeader,
48
+ },
49
+ };
50
+ }, [optionsConfig]);
51
+
52
+ return <div style={{ height: '100dvh' }}>
53
+ <AgentScopeRuntimeWebUI
54
+ options={options}
55
+ />
56
+ </div>;
57
+ }
@@ -0,0 +1,51 @@
1
+ import { IAgentScopeRuntimeWebUISessionAPI } from '@agentscope-ai/chat';
2
+ import { IAgentScopeRuntimeWebUISession } from '../../lib/types/ISessions';
3
+
4
+ class SessionApi implements IAgentScopeRuntimeWebUISessionAPI {
5
+ private lsKey: string;
6
+ private sessionList: IAgentScopeRuntimeWebUISession[];
7
+
8
+ constructor() {
9
+ this.lsKey = 'agent-scope-runtime-webui-sessions';
10
+ this.sessionList = [];
11
+ }
12
+
13
+ async getSessionList() {
14
+ this.sessionList = JSON.parse(localStorage.getItem(this.lsKey) || '[]');
15
+ return [...this.sessionList];
16
+ }
17
+
18
+ async getSession(sessionId) {
19
+ return this.sessionList.find((session) => session.id === sessionId);
20
+ }
21
+
22
+ async updateSession(session) {
23
+ const index = this.sessionList.findIndex((item) => item.id === session.id);
24
+ if (index > -1) {
25
+ this.sessionList[index] = {
26
+ ...this.sessionList[index],
27
+ ...session,
28
+ };
29
+ localStorage.setItem(this.lsKey, JSON.stringify(this.sessionList));
30
+ }
31
+
32
+ return [...this.sessionList];
33
+ }
34
+
35
+ async createSession(session) {
36
+ session.id = Date.now().toString();
37
+ this.sessionList.unshift(session);
38
+ localStorage.setItem(this.lsKey, JSON.stringify(this.sessionList));
39
+ return [...this.sessionList];
40
+ }
41
+
42
+ async removeSession(session) {
43
+ this.sessionList = this.sessionList.filter(
44
+ (item) => item.id !== session.id,
45
+ );
46
+ localStorage.setItem(this.lsKey, JSON.stringify(this.sessionList));
47
+ return [...this.sessionList];
48
+ }
49
+ }
50
+
51
+ export default new SessionApi();
@@ -0,0 +1,97 @@
1
+ import classnames from 'classnames';
2
+ import React from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { AttachmentContext } from './context';
5
+
6
+ export interface DropUploaderProps {
7
+ /**
8
+ * @description 自定义CSS类名前缀,用于样式隔离和主题定制
9
+ * @descriptionEn Custom CSS class name prefix for style isolation and theme customization
10
+ */
11
+ prefixCls: string;
12
+ /**
13
+ * @description 拖拽区域的CSS类名
14
+ * @descriptionEn CSS class name for the drop area
15
+ */
16
+ className: string;
17
+ /**
18
+ * @description 获取拖拽容器的函数,用于自定义拖拽区域
19
+ * @descriptionEn Function to get drop container for customizing drop area
20
+ */
21
+ getDropContainer?: null | (() => HTMLElement | null | undefined);
22
+ /**
23
+ * @description 拖拽区域内的子元素,用于显示拖拽提示内容
24
+ * @descriptionEn Child elements within the drop area for displaying drop prompt content
25
+ */
26
+ children?: React.ReactNode;
27
+ }
28
+
29
+ export default function DropArea(props: DropUploaderProps) {
30
+ const { getDropContainer, className, prefixCls, children } = props;
31
+ const { disabled } = React.useContext(AttachmentContext);
32
+
33
+ const [container, setContainer] = React.useState<HTMLElement | null | undefined>();
34
+ const [showArea, setShowArea] = React.useState<boolean | null>(null);
35
+
36
+ React.useEffect(() => {
37
+ const nextContainer = getDropContainer?.();
38
+ if (container !== nextContainer) {
39
+ setContainer(nextContainer);
40
+ }
41
+ }, [getDropContainer]);
42
+
43
+ React.useEffect(() => {
44
+ // Add global drop event
45
+ if (container) {
46
+ const onDragEnter = () => {
47
+ setShowArea(true);
48
+ };
49
+
50
+ // Should prevent default to make drop event work
51
+ const onDragOver = (e: DragEvent) => {
52
+ e.preventDefault();
53
+ };
54
+
55
+ const onDragLeave = (e: DragEvent) => {
56
+ if (!e.relatedTarget) {
57
+ setShowArea(false);
58
+ }
59
+ };
60
+ const onDrop = (e: DragEvent) => {
61
+ setShowArea(false);
62
+ e.preventDefault();
63
+ };
64
+
65
+ document.addEventListener('dragenter', onDragEnter);
66
+ document.addEventListener('dragover', onDragOver);
67
+ document.addEventListener('dragleave', onDragLeave);
68
+ document.addEventListener('drop', onDrop);
69
+ return () => {
70
+ document.removeEventListener('dragenter', onDragEnter);
71
+ document.removeEventListener('dragover', onDragOver);
72
+ document.removeEventListener('dragleave', onDragLeave);
73
+ document.removeEventListener('drop', onDrop);
74
+ };
75
+ }
76
+ }, [!!container]);
77
+
78
+ const showDropdown = getDropContainer && container && !disabled;
79
+
80
+ if (!showDropdown) {
81
+ return null;
82
+ }
83
+
84
+ const areaCls = `${prefixCls}-drop-area`;
85
+
86
+ return createPortal(
87
+ <div
88
+ className={classnames(areaCls, className, {
89
+ [`${areaCls}-on-body`]: container.tagName === 'BODY',
90
+ })}
91
+ style={{ display: showArea ? 'block' : 'none' }}
92
+ >
93
+ {children}
94
+ </div>,
95
+ container,
96
+ );
97
+ }
@@ -0,0 +1,20 @@
1
+ export default function AudioIcon() {
2
+ return (
3
+ <svg
4
+ width="1em"
5
+ height="1em"
6
+ viewBox="0 0 16 16"
7
+ version="1.1"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlnsXlink="http://www.w3.org/1999/xlink"
10
+ >
11
+ <title>audio</title>
12
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
13
+ <path
14
+ d="M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M10.7315824,7.11216117 C10.7428131,7.15148751 10.7485063,7.19218979 10.7485063,7.23309113 L10.7485063,8.07742614 C10.7484199,8.27364959 10.6183424,8.44607275 10.4296853,8.50003683 L8.32984514,9.09986306 L8.32984514,11.7071803 C8.32986605,12.5367078 7.67249692,13.217028 6.84345686,13.2454634 L6.79068592,13.2463395 C6.12766108,13.2463395 5.53916361,12.8217001 5.33010655,12.1924966 C5.1210495,11.563293 5.33842118,10.8709227 5.86959669,10.4741173 C6.40077221,10.0773119 7.12636292,10.0652587 7.67042486,10.4442027 L7.67020842,7.74937024 L7.68449368,7.74937024 C7.72405122,7.59919041 7.83988806,7.48101083 7.98924584,7.4384546 L10.1880418,6.81004755 C10.42156,6.74340323 10.6648954,6.87865515 10.7315824,7.11216117 Z M9.60714286,1.31785714 L12.9678571,4.67857143 L9.60714286,4.67857143 L9.60714286,1.31785714 Z"
15
+ fill="currentColor"
16
+ />
17
+ </g>
18
+ </svg>
19
+ );
20
+ }
@@ -0,0 +1,270 @@
1
+ import classnames from 'classnames';
2
+ import React from 'react';
3
+ import type { Attachment } from '..';
4
+ import { AttachmentContext } from '../context';
5
+ import { previewImage } from '../util';
6
+ import AudioIcon from './AudioIcon';
7
+ import Progress from './Progress';
8
+ import VideoIcon from './VideoIcon';
9
+ import Style from '../style/fileCard';
10
+ import { useProviderContext } from '@agentscope-ai/chat';
11
+ import { SparkFalseLine } from '@agentscope-ai/icons';
12
+
13
+
14
+ export interface FileListCardProps {
15
+ /**
16
+ * @description 自定义CSS类名前缀,用于样式隔离和主题定制
17
+ * @descriptionEn Custom CSS class name prefix for style isolation and theme customization
18
+ */
19
+ prefixCls?: string;
20
+ /**
21
+ * @description 文件附件数据对象,包含文件的基本信息
22
+ * @descriptionEn File attachment data object containing basic file information
23
+ */
24
+ item: Attachment;
25
+ /**
26
+ * @description 文件移除时的回调函数,用于处理文件删除操作
27
+ * @descriptionEn Callback function when file is removed for handling file deletion operations
28
+ */
29
+ onRemove?: (item: Attachment) => void;
30
+ /**
31
+ * @description 组件的CSS类名
32
+ * @descriptionEn CSS class name for the component
33
+ */
34
+ className?: string;
35
+ /**
36
+ * @description 组件的内联样式对象
37
+ * @descriptionEn Inline style object for the component
38
+ */
39
+ style?: React.CSSProperties;
40
+ /**
41
+ * @description 渲染类型,目前仅支持默认渲染模式
42
+ * @descriptionEn Render type, currently only supports default render mode
43
+ */
44
+ renderType?: 'default',
45
+
46
+ }
47
+
48
+ const EMPTY = '\u00A0';
49
+
50
+ const DEFAULT_ICON_COLOR = '#8c8c8c';
51
+
52
+ const IMG_EXTS = ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp', 'svg'];
53
+
54
+ const IconImage = ({ url }) => <img src={url} width={32} height={32} />
55
+
56
+ const PRESET_FILE_ICONS: {
57
+ ext: string[];
58
+ color: string;
59
+ icon: React.ReactElement;
60
+ }[] = [
61
+ {
62
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i1/O1CN01cVtZXI23tPVhiZoPJ_!!6000000007313-55-tps-40-40.svg" />,
63
+ color: '#22b35e',
64
+ ext: ['xlsx', 'xls'],
65
+ },
66
+ {
67
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i1/O1CN01uDnnuz1XMNEjgFMul_!!6000000002909-55-tps-40-40.svg" />,
68
+ color: DEFAULT_ICON_COLOR,
69
+ ext: IMG_EXTS,
70
+ },
71
+ {
72
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i1/O1CN01PaXli01DDPAO68fsI_!!6000000000182-55-tps-40-40.svg" />,
73
+ color: DEFAULT_ICON_COLOR,
74
+ ext: ['md', 'mdx'],
75
+ },
76
+ {
77
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i3/O1CN01mB5PzD27fuIWK661W_!!6000000007825-55-tps-40-40.svg" />,
78
+ color: '#ff4d4f',
79
+ ext: ['pdf'],
80
+ },
81
+ {
82
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i3/O1CN01a8j7Jv1nW1QyFme7k_!!6000000005096-55-tps-40-40.svg" />,
83
+ color: '#ff6e31',
84
+ ext: ['ppt', 'pptx'],
85
+ },
86
+ {
87
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i1/O1CN01XaNi8P1UkhQXoQdUL_!!6000000002556-55-tps-40-40.svg" />,
88
+ color: '#1677ff',
89
+ ext: ['doc', 'docx'],
90
+ },
91
+ {
92
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i1/O1CN01K7jgEj1sywWTkPSGY_!!6000000005836-55-tps-40-40.svg" />,
93
+ color: '#fab714',
94
+ ext: ['zip', 'rar', '7z', 'tar', 'gz'],
95
+ },
96
+ {
97
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i2/O1CN01zTTe0q1Xg4GkZgJol_!!6000000002952-55-tps-40-40.svg" />,
98
+
99
+ color: '#ff4d4f',
100
+ ext: ['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv'],
101
+ },
102
+ {
103
+ icon: <IconImage url="https://gw.alicdn.com/imgextra/i2/O1CN01qOBdXG1UpHO6f3Vvc_!!6000000002566-55-tps-40-40.svg" />,
104
+
105
+ color: '#8c8c8c',
106
+ ext: ['mp3', 'wav', 'flac', 'ape', 'aac', 'ogg'],
107
+ },
108
+ ];
109
+
110
+ function matchExt(suffix: string, ext: string[]) {
111
+ return ext.some((e) => suffix.toLowerCase() === `.${e}`);
112
+ }
113
+
114
+ function getSize(size: number) {
115
+ let retSize = size;
116
+ const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'];
117
+ let unitIndex = 0;
118
+
119
+ while (retSize >= 1024 && unitIndex < units.length - 1) {
120
+ retSize /= 1024;
121
+ unitIndex++;
122
+ }
123
+
124
+ return `${retSize.toFixed(0)} ${units[unitIndex]}`;
125
+ }
126
+
127
+ function FileListCard(props: FileListCardProps, ref: React.Ref<HTMLDivElement>) {
128
+ const { getPrefixCls } = useProviderContext();
129
+ const { item, onRemove, className, style } = props;
130
+ const context = React.useContext(AttachmentContext);
131
+ const { disabled } = context || {};
132
+ const { name, size, percent, status = 'done', description } = item;
133
+ const prefixCls = getPrefixCls('attachment');
134
+ const cardCls = `${prefixCls}-list-card`;
135
+
136
+ const [namePrefix, nameSuffix] = React.useMemo(() => {
137
+ const nameStr = name || '';
138
+ const match = nameStr.match(/^(.*)\.[^.]+$/);
139
+ return match ? [match[1], nameStr.slice(match[1].length)] : [nameStr, ''];
140
+ }, [name]);
141
+
142
+ const isImg = React.useMemo(() => matchExt(nameSuffix, IMG_EXTS), [nameSuffix]);
143
+
144
+ const desc = React.useMemo(() => {
145
+ if (description) {
146
+ return description;
147
+ }
148
+
149
+ if (status === 'uploading') {
150
+ return `${percent || 0}%`;
151
+ }
152
+
153
+ if (status === 'error') {
154
+ return item.response || EMPTY;
155
+ }
156
+
157
+ return size ? getSize(size) : EMPTY;
158
+ }, [status, percent]);
159
+
160
+ const [icon, iconColor] = React.useMemo(() => {
161
+ for (const { ext, icon, color } of PRESET_FILE_ICONS) {
162
+ if (matchExt(nameSuffix, ext)) {
163
+ return [icon, color];
164
+ }
165
+ }
166
+
167
+ return [<IconImage url="https://gw.alicdn.com/imgextra/i1/O1CN01K7jgEj1sywWTkPSGY_!!6000000005836-55-tps-40-40.svg" key="defaultIcon" />, DEFAULT_ICON_COLOR];
168
+ }, [nameSuffix]);
169
+
170
+ const [previewImg, setPreviewImg] = React.useState<string>();
171
+
172
+ React.useEffect(() => {
173
+ if (item.originFileObj) {
174
+ let synced = true;
175
+ previewImage(item.originFileObj).then((url) => {
176
+ if (synced) {
177
+ setPreviewImg(url);
178
+ }
179
+ });
180
+
181
+ return () => {
182
+ synced = false;
183
+ };
184
+ }
185
+ setPreviewImg(undefined);
186
+ }, [item.originFileObj]);
187
+
188
+ let content: React.ReactNode = null;
189
+ const previewUrl = item.thumbUrl || item.url || previewImg;
190
+ const renderType = props.renderType || 'default';
191
+ const isImgPreview = isImg && (item.originFileObj || previewUrl) && renderType === 'default';
192
+
193
+ if (isImgPreview) {
194
+ content = (
195
+ <>
196
+ {
197
+ previewUrl && (
198
+ <img alt="preview" src={previewUrl} />
199
+ )
200
+ }
201
+
202
+ {status !== 'done' && (
203
+ <div className={`${cardCls}-img-mask`}>
204
+ {status === 'uploading' && percent !== undefined && (
205
+ <Progress percent={percent} prefixCls={cardCls} />
206
+ )}
207
+ {status === 'error' && (
208
+ <div className={`${cardCls}-desc`}>
209
+ <div className={`${cardCls}-ellipsis-prefix`}>{desc}</div>
210
+ </div>
211
+ )}
212
+ </div>
213
+ )}
214
+ </>
215
+ );
216
+ } else {
217
+ content = (
218
+ <>
219
+ <div className={`${cardCls}-icon`} style={{ color: iconColor }}>
220
+ {icon}
221
+ </div>
222
+ <div className={`${cardCls}-content`}>
223
+ <div className={`${cardCls}-name`}>
224
+ {namePrefix ?? EMPTY}{nameSuffix}
225
+ </div>
226
+ <div className={`${cardCls}-desc`}>
227
+ <div className={`${cardCls}-ellipsis-prefix`}>{desc}</div>
228
+ </div>
229
+ </div>
230
+ </>
231
+ );
232
+ }
233
+
234
+ return <>
235
+ <Style />
236
+ <div
237
+ className={classnames(
238
+ cardCls,
239
+ {
240
+ [`${cardCls}-status-${status}`]: status,
241
+ [`${cardCls}-type-preview`]: isImgPreview,
242
+ [`${cardCls}-type-overview`]: !isImgPreview,
243
+ [`${cardCls}-type-${renderType}`]: true,
244
+ [`${cardCls}-hoverable`]: !disabled && onRemove,
245
+ },
246
+ className,
247
+ )}
248
+ style={style}
249
+ ref={ref}
250
+ >
251
+ {content}
252
+
253
+ <button
254
+ style={{
255
+ opacity: !disabled && onRemove ? 1 : 0,
256
+ }}
257
+ className={`${cardCls}-remove`}
258
+ onClick={() => {
259
+ if (!disabled && onRemove) {
260
+ onRemove(item);
261
+ }
262
+ }}
263
+ >
264
+ <SparkFalseLine />
265
+
266
+ </button>
267
+ </div></>
268
+ }
269
+
270
+ export default React.forwardRef(FileListCard);
@@ -0,0 +1,30 @@
1
+ import { Progress as AntdProgress, theme } from 'antd';
2
+
3
+ export interface ProgressProps {
4
+ /**
5
+ * @description 自定义CSS类名前缀,用于样式隔离和主题定制
6
+ * @descriptionEn Custom CSS class name prefix for style isolation and theme customization
7
+ */
8
+ prefixCls: string;
9
+ /**
10
+ * @description 进度百分比值,范围0-100,用于显示上传进度
11
+ * @descriptionEn Progress percentage value, range 0-100, for displaying upload progress
12
+ */
13
+ percent: number;
14
+ }
15
+
16
+ export default function Progress(props: ProgressProps) {
17
+ const { percent } = props;
18
+ const { token } = theme.useToken();
19
+
20
+ return (
21
+ <AntdProgress
22
+ type="circle"
23
+ percent={percent}
24
+ size={40}
25
+ strokeColor="#FFF"
26
+ trailColor="rgba(255, 255, 255, 0.3)"
27
+ format={(ptg) => <span style={{ color: '#FFF' }}>{(ptg || 0).toFixed(0)}%</span>}
28
+ />
29
+ );
30
+ }
@@ -0,0 +1,20 @@
1
+ export default function VideoIcon() {
2
+ return (
3
+ <svg
4
+ width="1em"
5
+ height="1em"
6
+ viewBox="0 0 16 16"
7
+ version="1.1"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlnsXlink="http://www.w3.org/1999/xlink"
10
+ >
11
+ <title>video</title>
12
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
13
+ <path
14
+ d="M14.1178571,4.0125 C14.225,4.11964286 14.2857143,4.26428571 14.2857143,4.41607143 L14.2857143,15.4285714 C14.2857143,15.7446429 14.0303571,16 13.7142857,16 L2.28571429,16 C1.96964286,16 1.71428571,15.7446429 1.71428571,15.4285714 L1.71428571,0.571428571 C1.71428571,0.255357143 1.96964286,0 2.28571429,0 L9.86964286,0 C10.0214286,0 10.1678571,0.0607142857 10.275,0.167857143 L14.1178571,4.0125 Z M12.9678571,4.67857143 L9.60714286,1.31785714 L9.60714286,4.67857143 L12.9678571,4.67857143 Z M10.5379461,10.3101106 L6.68957555,13.0059749 C6.59910784,13.0693494 6.47439406,13.0473861 6.41101953,12.9569184 C6.3874624,12.9232903 6.37482581,12.8832269 6.37482581,12.8421686 L6.37482581,7.45043999 C6.37482581,7.33998304 6.46436886,7.25043999 6.57482581,7.25043999 C6.61588409,7.25043999 6.65594753,7.26307658 6.68957555,7.28663371 L10.5379461,9.98249803 C10.6284138,10.0458726 10.6503772,10.1705863 10.5870027,10.2610541 C10.5736331,10.2801392 10.5570312,10.2967411 10.5379461,10.3101106 Z"
15
+ fill="currentColor"
16
+ />
17
+ </g>
18
+ </svg>
19
+ );
20
+ }