@baishuyun/chat-sdk 0.0.17 → 0.1.0

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 (493) hide show
  1. package/.turbo/turbo-build.log +76 -16
  2. package/CHANGELOG.md +27 -0
  3. package/dist/chat-sdk.js +37511 -45236
  4. package/dist/chat-sdk.js.map +1 -1
  5. package/dist/chat-sdk.umd.cjs +221 -296
  6. package/dist/chat-sdk.umd.cjs.map +1 -1
  7. package/dist/chat.d.ts +5 -0
  8. package/dist/chat.d.ts.map +1 -0
  9. package/dist/components/biz-comp/FakeBotMsg.d.ts +8 -0
  10. package/dist/components/biz-comp/FakeBotMsg.d.ts.map +1 -0
  11. package/dist/components/biz-comp/FieldChecker.d.ts +19 -0
  12. package/dist/components/biz-comp/FieldChecker.d.ts.map +1 -0
  13. package/dist/components/biz-comp/FieldCheckerListMsg.d.ts +19 -0
  14. package/dist/components/biz-comp/FieldCheckerListMsg.d.ts.map +1 -0
  15. package/dist/components/biz-comp/FieldValueChecker.d.ts +16 -0
  16. package/dist/components/biz-comp/FieldValueChecker.d.ts.map +1 -0
  17. package/dist/components/biz-comp/SubformFieldsValueChecker.d.ts +22 -0
  18. package/dist/components/biz-comp/SubformFieldsValueChecker.d.ts.map +1 -0
  19. package/dist/components/biz-comp/chat-client.d.ts +13 -0
  20. package/dist/components/biz-comp/chat-client.d.ts.map +1 -0
  21. package/dist/components/biz-comp/chat-frame.d.ts +6 -0
  22. package/dist/components/biz-comp/chat-frame.d.ts.map +1 -0
  23. package/dist/components/biz-comp/conversation.d.ts +10 -0
  24. package/dist/components/biz-comp/conversation.d.ts.map +1 -0
  25. package/dist/components/biz-comp/dash-widget-icon.d.ts +7 -0
  26. package/dist/components/biz-comp/dash-widget-icon.d.ts.map +1 -0
  27. package/dist/components/biz-comp/dock-btn.d.ts +2 -0
  28. package/dist/components/biz-comp/dock-btn.d.ts.map +1 -0
  29. package/dist/components/biz-comp/error-boundary.d.ts +15 -0
  30. package/dist/components/biz-comp/error-boundary.d.ts.map +1 -0
  31. package/dist/components/biz-comp/error-msg.d.ts +4 -0
  32. package/dist/components/biz-comp/error-msg.d.ts.map +1 -0
  33. package/dist/components/biz-comp/field-icon.d.ts +5 -0
  34. package/dist/components/biz-comp/field-icon.d.ts.map +1 -0
  35. package/dist/components/biz-comp/highlight-msg.d.ts +4 -0
  36. package/dist/components/biz-comp/highlight-msg.d.ts.map +1 -0
  37. package/dist/components/biz-comp/markdown-part.d.ts +7 -0
  38. package/dist/components/biz-comp/markdown-part.d.ts.map +1 -0
  39. package/dist/components/biz-comp/markdown.d.ts +5 -0
  40. package/dist/components/biz-comp/markdown.d.ts.map +1 -0
  41. package/dist/components/biz-comp/message-content.d.ts +6 -0
  42. package/dist/components/biz-comp/message-content.d.ts.map +1 -0
  43. package/dist/components/biz-comp/messages.d.ts +3 -0
  44. package/dist/components/biz-comp/messages.d.ts.map +1 -0
  45. package/dist/components/biz-comp/multi-modal-input/attachment-btn.d.ts +9 -0
  46. package/dist/components/biz-comp/multi-modal-input/attachment-btn.d.ts.map +1 -0
  47. package/dist/components/biz-comp/multi-modal-input/clear-btn.d.ts +8 -0
  48. package/dist/components/biz-comp/multi-modal-input/clear-btn.d.ts.map +1 -0
  49. package/dist/components/biz-comp/multi-modal-input/index.d.ts +21 -0
  50. package/dist/components/biz-comp/multi-modal-input/index.d.ts.map +1 -0
  51. package/dist/components/biz-comp/multi-modal-input/preview-attachment.d.ts +12 -0
  52. package/dist/components/biz-comp/multi-modal-input/preview-attachment.d.ts.map +1 -0
  53. package/dist/components/biz-comp/multi-modal-input/prompt-input.d.ts +36 -0
  54. package/dist/components/biz-comp/multi-modal-input/prompt-input.d.ts.map +1 -0
  55. package/dist/components/biz-comp/opening-lines.d.ts +3 -0
  56. package/dist/components/biz-comp/opening-lines.d.ts.map +1 -0
  57. package/dist/components/biz-comp/preview-message-wrapper.d.ts +12 -0
  58. package/dist/components/biz-comp/preview-message-wrapper.d.ts.map +1 -0
  59. package/dist/components/biz-comp/preview-message.d.ts +13 -0
  60. package/dist/components/biz-comp/preview-message.d.ts.map +1 -0
  61. package/dist/components/biz-comp/response.d.ts +6 -0
  62. package/dist/components/biz-comp/response.d.ts.map +1 -0
  63. package/dist/components/biz-comp/suggestions.d.ts +8 -0
  64. package/dist/components/biz-comp/suggestions.d.ts.map +1 -0
  65. package/dist/components/bs-ui/abs-fullscreen-gradient-bg.d.ts +10 -0
  66. package/dist/components/bs-ui/abs-fullscreen-gradient-bg.d.ts.map +1 -0
  67. package/dist/components/bs-ui/attachment-part-group.d.ts +16 -0
  68. package/dist/components/bs-ui/attachment-part-group.d.ts.map +1 -0
  69. package/dist/components/bs-ui/attachment-part.d.ts +19 -0
  70. package/dist/components/bs-ui/attachment-part.d.ts.map +1 -0
  71. package/dist/components/bs-ui/attachments-previewer.d.ts +18 -0
  72. package/dist/components/bs-ui/attachments-previewer.d.ts.map +1 -0
  73. package/dist/components/bs-ui/base-button.d.ts +8 -0
  74. package/dist/components/bs-ui/base-button.d.ts.map +1 -0
  75. package/dist/components/bs-ui/border-animation.d.ts +23 -0
  76. package/dist/components/bs-ui/border-animation.d.ts.map +1 -0
  77. package/dist/components/bs-ui/border-color-animation.d.ts +11 -0
  78. package/dist/components/bs-ui/border-color-animation.d.ts.map +1 -0
  79. package/dist/components/bs-ui/bot-avatar-name.d.ts +6 -0
  80. package/dist/components/bs-ui/bot-avatar-name.d.ts.map +1 -0
  81. package/dist/components/bs-ui/bot-icon.d.ts +5 -0
  82. package/dist/components/bs-ui/bot-icon.d.ts.map +1 -0
  83. package/dist/components/bs-ui/bs-icons.d.ts +65 -0
  84. package/dist/components/bs-ui/bs-icons.d.ts.map +1 -0
  85. package/dist/components/bs-ui/card-field.d.ts +11 -0
  86. package/dist/components/bs-ui/card-field.d.ts.map +1 -0
  87. package/dist/components/bs-ui/card.d.ts +11 -0
  88. package/dist/components/bs-ui/card.d.ts.map +1 -0
  89. package/dist/components/bs-ui/chat-area-header.d.ts +13 -0
  90. package/dist/components/bs-ui/chat-area-header.d.ts.map +1 -0
  91. package/dist/components/bs-ui/circle-checker.d.ts +10 -0
  92. package/dist/components/bs-ui/circle-checker.d.ts.map +1 -0
  93. package/dist/components/bs-ui/collapsible-txt-msg.d.ts +11 -0
  94. package/dist/components/bs-ui/collapsible-txt-msg.d.ts.map +1 -0
  95. package/dist/components/bs-ui/confirm-dialog.d.ts +26 -0
  96. package/dist/components/bs-ui/confirm-dialog.d.ts.map +1 -0
  97. package/dist/components/bs-ui/fields-design-info-table.d.ts +7 -0
  98. package/dist/components/bs-ui/fields-design-info-table.d.ts.map +1 -0
  99. package/dist/components/bs-ui/fields-generating-indicator.d.ts +6 -0
  100. package/dist/components/bs-ui/fields-generating-indicator.d.ts.map +1 -0
  101. package/dist/components/bs-ui/fields-portal.d.ts +8 -0
  102. package/dist/components/bs-ui/fields-portal.d.ts.map +1 -0
  103. package/dist/components/bs-ui/fields-previewer.d.ts +18 -0
  104. package/dist/components/bs-ui/fields-previewer.d.ts.map +1 -0
  105. package/dist/components/bs-ui/font-icon.d.ts +6 -0
  106. package/dist/components/bs-ui/font-icon.d.ts.map +1 -0
  107. package/dist/components/bs-ui/form-info-editor.d.ts +37 -0
  108. package/dist/components/bs-ui/form-info-editor.d.ts.map +1 -0
  109. package/dist/components/bs-ui/formula-tag.d.ts +8 -0
  110. package/dist/components/bs-ui/formula-tag.d.ts.map +1 -0
  111. package/dist/components/bs-ui/generate-animation.d.ts +5 -0
  112. package/dist/components/bs-ui/generate-animation.d.ts.map +1 -0
  113. package/dist/components/bs-ui/icon-btn.d.ts +9 -0
  114. package/dist/components/bs-ui/icon-btn.d.ts.map +1 -0
  115. package/dist/components/bs-ui/img-part.d.ts +10 -0
  116. package/dist/components/bs-ui/img-part.d.ts.map +1 -0
  117. package/dist/components/bs-ui/line-checker.d.ts +19 -0
  118. package/dist/components/bs-ui/line-checker.d.ts.map +1 -0
  119. package/dist/components/bs-ui/linear-gradient-border-btn.d.ts +10 -0
  120. package/dist/components/bs-ui/linear-gradient-border-btn.d.ts.map +1 -0
  121. package/dist/components/bs-ui/linear-gradient-color-bg-animation.d.ts +8 -0
  122. package/dist/components/bs-ui/linear-gradient-color-bg-animation.d.ts.map +1 -0
  123. package/dist/components/bs-ui/number-part.d.ts +9 -0
  124. package/dist/components/bs-ui/number-part.d.ts.map +1 -0
  125. package/dist/components/bs-ui/option-item.d.ts +9 -0
  126. package/dist/components/bs-ui/option-item.d.ts.map +1 -0
  127. package/dist/components/bs-ui/previewer-header.d.ts +20 -0
  128. package/dist/components/bs-ui/previewer-header.d.ts.map +1 -0
  129. package/dist/components/bs-ui/primary-confirm-btn.d.ts +10 -0
  130. package/dist/components/bs-ui/primary-confirm-btn.d.ts.map +1 -0
  131. package/dist/components/bs-ui/primary-entry-btn.d.ts +9 -0
  132. package/dist/components/bs-ui/primary-entry-btn.d.ts.map +1 -0
  133. package/dist/components/bs-ui/scroll-to-bottom-btn.d.ts +6 -0
  134. package/dist/components/bs-ui/scroll-to-bottom-btn.d.ts.map +1 -0
  135. package/dist/components/bs-ui/split-line.d.ts +5 -0
  136. package/dist/components/bs-ui/split-line.d.ts.map +1 -0
  137. package/dist/components/bs-ui/square-checker.d.ts +15 -0
  138. package/dist/components/bs-ui/square-checker.d.ts.map +1 -0
  139. package/dist/components/bs-ui/tab-radio-group.d.ts +19 -0
  140. package/dist/components/bs-ui/tab-radio-group.d.ts.map +1 -0
  141. package/dist/components/bs-ui/tooltip.d.ts +6 -0
  142. package/dist/components/bs-ui/tooltip.d.ts.map +1 -0
  143. package/dist/components/bs-ui/user-txt-msg-bubble.d.ts +6 -0
  144. package/dist/components/bs-ui/user-txt-msg-bubble.d.ts.map +1 -0
  145. package/dist/components/bs-ui/warning-msg.d.ts +6 -0
  146. package/dist/components/bs-ui/warning-msg.d.ts.map +1 -0
  147. package/dist/components/ui/badge.d.ts +10 -0
  148. package/dist/components/ui/badge.d.ts.map +1 -0
  149. package/dist/components/ui/button.d.ts +12 -0
  150. package/dist/components/ui/button.d.ts.map +1 -0
  151. package/dist/components/ui/card.d.ts +9 -0
  152. package/dist/components/ui/card.d.ts.map +1 -0
  153. package/dist/components/ui/checkbox.d.ts +5 -0
  154. package/dist/components/ui/checkbox.d.ts.map +1 -0
  155. package/dist/components/ui/collapsible.d.ts +6 -0
  156. package/dist/components/ui/collapsible.d.ts.map +1 -0
  157. package/dist/components/ui/dialog.d.ts +24 -0
  158. package/dist/components/ui/dialog.d.ts.map +1 -0
  159. package/dist/components/ui/dropdown-menu.d.ts +28 -0
  160. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  161. package/dist/components/ui/icons.d.ts +176 -0
  162. package/dist/components/ui/icons.d.ts.map +1 -0
  163. package/dist/components/ui/input-group.d.ts +17 -0
  164. package/dist/components/ui/input-group.d.ts.map +1 -0
  165. package/dist/components/ui/input.d.ts +4 -0
  166. package/dist/components/ui/input.d.ts.map +1 -0
  167. package/dist/components/ui/label.d.ts +6 -0
  168. package/dist/components/ui/label.d.ts.map +1 -0
  169. package/dist/components/ui/one-time-click-btn.d.ts +4 -0
  170. package/dist/components/ui/one-time-click-btn.d.ts.map +1 -0
  171. package/dist/components/ui/select.d.ts +14 -0
  172. package/dist/components/ui/select.d.ts.map +1 -0
  173. package/dist/components/ui/spinner.d.ts +3 -0
  174. package/dist/components/ui/spinner.d.ts.map +1 -0
  175. package/dist/components/ui/tabs.d.ts +8 -0
  176. package/dist/components/ui/tabs.d.ts.map +1 -0
  177. package/dist/components/ui/textarea.d.ts +4 -0
  178. package/dist/components/ui/textarea.d.ts.map +1 -0
  179. package/dist/components/ui/tooltip.d.ts +13 -0
  180. package/dist/components/ui/tooltip.d.ts.map +1 -0
  181. package/dist/components/web-comp/fields-previewer-web-component.d.ts +60 -0
  182. package/dist/components/web-comp/fields-previewer-web-component.d.ts.map +1 -0
  183. package/dist/const/index.d.ts +5 -0
  184. package/dist/const/index.d.ts.map +1 -0
  185. package/dist/const/ui.d.ts +7 -0
  186. package/dist/const/ui.d.ts.map +1 -0
  187. package/dist/hooks/use-chat-preference.d.ts +3 -0
  188. package/dist/hooks/use-chat-preference.d.ts.map +1 -0
  189. package/dist/hooks/use-draggable.d.ts +24 -0
  190. package/dist/hooks/use-draggable.d.ts.map +1 -0
  191. package/dist/hooks/use-evt-bus.d.ts +2 -0
  192. package/dist/hooks/use-evt-bus.d.ts.map +1 -0
  193. package/dist/hooks/use-evt.d.ts +3 -0
  194. package/dist/hooks/use-evt.d.ts.map +1 -0
  195. package/dist/hooks/use-frame-mode.d.ts +20 -0
  196. package/dist/hooks/use-frame-mode.d.ts.map +1 -0
  197. package/dist/hooks/use-merged-chat.d.ts +7 -0
  198. package/dist/hooks/use-merged-chat.d.ts.map +1 -0
  199. package/dist/hooks/use-msg-status-broadcast.d.ts +3 -0
  200. package/dist/hooks/use-msg-status-broadcast.d.ts.map +1 -0
  201. package/dist/hooks/use-plugin-component.d.ts +5 -0
  202. package/dist/hooks/use-plugin-component.d.ts.map +1 -0
  203. package/dist/hooks/use-plugin-ctx.d.ts +3 -0
  204. package/dist/hooks/use-plugin-ctx.d.ts.map +1 -0
  205. package/dist/hooks/use-plugin-custom-components.d.ts +5 -0
  206. package/dist/hooks/use-plugin-custom-components.d.ts.map +1 -0
  207. package/dist/hooks/use-plugin-life-cycle-chain-runner.d.ts +5 -0
  208. package/dist/hooks/use-plugin-life-cycle-chain-runner.d.ts.map +1 -0
  209. package/dist/hooks/use-plugin-list.d.ts +2 -0
  210. package/dist/hooks/use-plugin-list.d.ts.map +1 -0
  211. package/dist/hooks/use-plugin.d.ts +2 -0
  212. package/dist/hooks/use-plugin.d.ts.map +1 -0
  213. package/dist/hooks/use-scroll-to-bottom.d.ts +9 -0
  214. package/dist/hooks/use-scroll-to-bottom.d.ts.map +1 -0
  215. package/dist/hooks/use-shadow.d.ts +25 -0
  216. package/dist/hooks/use-shadow.d.ts.map +1 -0
  217. package/dist/hooks/use-toast.d.ts +3 -0
  218. package/dist/hooks/use-toast.d.ts.map +1 -0
  219. package/dist/index.css +1 -1
  220. package/dist/index.d.ts +6 -0
  221. package/dist/index.d.ts.map +1 -0
  222. package/dist/lib/clone.d.ts +32 -0
  223. package/dist/lib/clone.d.ts.map +1 -0
  224. package/dist/lib/event-emitter.d.ts +39 -0
  225. package/dist/lib/event-emitter.d.ts.map +1 -0
  226. package/dist/lib/parse-design-doc.d.ts +16 -0
  227. package/dist/lib/parse-design-doc.d.ts.map +1 -0
  228. package/dist/lib/readonly.d.ts +14 -0
  229. package/dist/lib/readonly.d.ts.map +1 -0
  230. package/dist/lib/utils.d.ts +55 -0
  231. package/dist/lib/utils.d.ts.map +1 -0
  232. package/dist/plugins/form-builder-base-plugin/const.d.ts +3 -0
  233. package/dist/plugins/form-builder-base-plugin/const.d.ts.map +1 -0
  234. package/dist/plugins/form-builder-base-plugin/index.d.ts +7 -0
  235. package/dist/plugins/form-builder-base-plugin/index.d.ts.map +1 -0
  236. package/dist/plugins/form-builder-base-plugin/types.d.ts +12 -0
  237. package/dist/plugins/form-builder-base-plugin/types.d.ts.map +1 -0
  238. package/dist/plugins/form-builder-plugin/components/create-form-confirm.d.ts +7 -0
  239. package/dist/plugins/form-builder-plugin/components/create-form-confirm.d.ts.map +1 -0
  240. package/dist/plugins/form-builder-plugin/components/design-doc-part.d.ts +4 -0
  241. package/dist/plugins/form-builder-plugin/components/design-doc-part.d.ts.map +1 -0
  242. package/dist/plugins/form-builder-plugin/components/design-info.d.ts +6 -0
  243. package/dist/plugins/form-builder-plugin/components/design-info.d.ts.map +1 -0
  244. package/dist/plugins/form-builder-plugin/components/entry-btn.d.ts +3 -0
  245. package/dist/plugins/form-builder-plugin/components/entry-btn.d.ts.map +1 -0
  246. package/dist/plugins/form-builder-plugin/components/fields-part.d.ts +4 -0
  247. package/dist/plugins/form-builder-plugin/components/fields-part.d.ts.map +1 -0
  248. package/dist/plugins/form-builder-plugin/components/follow-up.d.ts +3 -0
  249. package/dist/plugins/form-builder-plugin/components/follow-up.d.ts.map +1 -0
  250. package/dist/plugins/form-builder-plugin/components/msg-part.d.ts +3 -0
  251. package/dist/plugins/form-builder-plugin/components/msg-part.d.ts.map +1 -0
  252. package/dist/plugins/form-builder-plugin/components/opening-lines.d.ts +3 -0
  253. package/dist/plugins/form-builder-plugin/components/opening-lines.d.ts.map +1 -0
  254. package/dist/plugins/form-builder-plugin/components/suggestion-part.d.ts +5 -0
  255. package/dist/plugins/form-builder-plugin/components/suggestion-part.d.ts.map +1 -0
  256. package/dist/plugins/form-builder-plugin/const/index.d.ts +12 -0
  257. package/dist/plugins/form-builder-plugin/const/index.d.ts.map +1 -0
  258. package/dist/plugins/form-builder-plugin/hooks/index.d.ts +4 -0
  259. package/dist/plugins/form-builder-plugin/hooks/index.d.ts.map +1 -0
  260. package/dist/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts +2 -0
  261. package/dist/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts.map +1 -0
  262. package/dist/plugins/form-builder-plugin/index.d.ts +30 -0
  263. package/dist/plugins/form-builder-plugin/index.d.ts.map +1 -0
  264. package/dist/plugins/form-builder-plugin/types.d.ts +28 -0
  265. package/dist/plugins/form-builder-plugin/types.d.ts.map +1 -0
  266. package/dist/plugins/form-builder-plugin/utils/get-render-strategy.d.ts +3 -0
  267. package/dist/plugins/form-builder-plugin/utils/get-render-strategy.d.ts.map +1 -0
  268. package/dist/plugins/form-builder-plugin/utils/index.d.ts +57 -0
  269. package/dist/plugins/form-builder-plugin/utils/index.d.ts.map +1 -0
  270. package/dist/plugins/form-filling-plugin/batch-filling-data-manager.d.ts +26 -0
  271. package/dist/plugins/form-filling-plugin/batch-filling-data-manager.d.ts.map +1 -0
  272. package/dist/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts +3 -0
  273. package/dist/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts.map +1 -0
  274. package/dist/plugins/form-filling-plugin/components/avatar.d.ts +5 -0
  275. package/dist/plugins/form-filling-plugin/components/avatar.d.ts.map +1 -0
  276. package/dist/plugins/form-filling-plugin/components/batch-fill-part.d.ts +4 -0
  277. package/dist/plugins/form-filling-plugin/components/batch-fill-part.d.ts.map +1 -0
  278. package/dist/plugins/form-filling-plugin/components/batch-generator-action.d.ts +14 -0
  279. package/dist/plugins/form-filling-plugin/components/batch-generator-action.d.ts.map +1 -0
  280. package/dist/plugins/form-filling-plugin/components/entry-btn.d.ts +3 -0
  281. package/dist/plugins/form-filling-plugin/components/entry-btn.d.ts.map +1 -0
  282. package/dist/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts +2 -0
  283. package/dist/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts.map +1 -0
  284. package/dist/plugins/form-filling-plugin/components/generated-data-counter.d.ts +5 -0
  285. package/dist/plugins/form-filling-plugin/components/generated-data-counter.d.ts.map +1 -0
  286. package/dist/plugins/form-filling-plugin/components/mode-select.d.ts +2 -0
  287. package/dist/plugins/form-filling-plugin/components/mode-select.d.ts.map +1 -0
  288. package/dist/plugins/form-filling-plugin/components/msg-part.d.ts +3 -0
  289. package/dist/plugins/form-filling-plugin/components/msg-part.d.ts.map +1 -0
  290. package/dist/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts +2 -0
  291. package/dist/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts.map +1 -0
  292. package/dist/plugins/form-filling-plugin/components/single-fill-part.d.ts +4 -0
  293. package/dist/plugins/form-filling-plugin/components/single-fill-part.d.ts.map +1 -0
  294. package/dist/plugins/form-filling-plugin/const.d.ts +615 -0
  295. package/dist/plugins/form-filling-plugin/const.d.ts.map +1 -0
  296. package/dist/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts +3 -0
  297. package/dist/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts.map +1 -0
  298. package/dist/plugins/form-filling-plugin/hooks/use-fields-data.d.ts +4 -0
  299. package/dist/plugins/form-filling-plugin/hooks/use-fields-data.d.ts.map +1 -0
  300. package/dist/plugins/form-filling-plugin/index.d.ts +22 -0
  301. package/dist/plugins/form-filling-plugin/index.d.ts.map +1 -0
  302. package/dist/plugins/form-filling-plugin/types.d.ts +22 -0
  303. package/dist/plugins/form-filling-plugin/types.d.ts.map +1 -0
  304. package/dist/plugins/form-filling-plugin/utils.d.ts +6 -0
  305. package/dist/plugins/form-filling-plugin/utils.d.ts.map +1 -0
  306. package/dist/plugins/report-query-plugin/components/avatar.d.ts +5 -0
  307. package/dist/plugins/report-query-plugin/components/avatar.d.ts.map +1 -0
  308. package/dist/plugins/report-query-plugin/components/query-entry-btn.d.ts +3 -0
  309. package/dist/plugins/report-query-plugin/components/query-entry-btn.d.ts.map +1 -0
  310. package/dist/plugins/report-query-plugin/components/query-msg-part.d.ts +3 -0
  311. package/dist/plugins/report-query-plugin/components/query-msg-part.d.ts.map +1 -0
  312. package/dist/plugins/report-query-plugin/components/query-opening-lines.d.ts +2 -0
  313. package/dist/plugins/report-query-plugin/components/query-opening-lines.d.ts.map +1 -0
  314. package/dist/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts +7 -0
  315. package/dist/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts.map +1 -0
  316. package/dist/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts +5 -0
  317. package/dist/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts.map +1 -0
  318. package/dist/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts +18 -0
  319. package/dist/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts.map +1 -0
  320. package/dist/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts +4 -0
  321. package/dist/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts.map +1 -0
  322. package/dist/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts +8 -0
  323. package/dist/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts.map +1 -0
  324. package/dist/plugins/report-query-plugin/const.d.ts +5 -0
  325. package/dist/plugins/report-query-plugin/const.d.ts.map +1 -0
  326. package/dist/plugins/report-query-plugin/index.d.ts +19 -0
  327. package/dist/plugins/report-query-plugin/index.d.ts.map +1 -0
  328. package/dist/plugins/report-query-plugin/types.d.ts +18 -0
  329. package/dist/plugins/report-query-plugin/types.d.ts.map +1 -0
  330. package/dist/plugins/report-query-plugin/utils/build-dash-component.d.ts +17 -0
  331. package/dist/plugins/report-query-plugin/utils/build-dash-component.d.ts.map +1 -0
  332. package/dist/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts +30 -0
  333. package/dist/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts.map +1 -0
  334. package/dist/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts +60 -0
  335. package/dist/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts.map +1 -0
  336. package/dist/plugins/report-query-plugin/utils/field-enhance.d.ts +31 -0
  337. package/dist/plugins/report-query-plugin/utils/field-enhance.d.ts.map +1 -0
  338. package/dist/plugins/report-query-plugin/utils/get-field-group.d.ts +208 -0
  339. package/dist/plugins/report-query-plugin/utils/get-field-group.d.ts.map +1 -0
  340. package/dist/plugins/report-query-plugin/utils/get-field-icon.d.ts +4 -0
  341. package/dist/plugins/report-query-plugin/utils/get-field-icon.d.ts.map +1 -0
  342. package/dist/plugins/report-query-plugin/utils/get-group-rule.d.ts +4 -0
  343. package/dist/plugins/report-query-plugin/utils/get-group-rule.d.ts.map +1 -0
  344. package/dist/plugins/report-query-plugin/utils/index.d.ts +5 -0
  345. package/dist/plugins/report-query-plugin/utils/index.d.ts.map +1 -0
  346. package/dist/sdk.impl.d.ts +42 -0
  347. package/dist/sdk.impl.d.ts.map +1 -0
  348. package/dist/store/context.d.ts +12 -0
  349. package/dist/store/context.d.ts.map +1 -0
  350. package/dist/store/index.d.ts +14 -0
  351. package/dist/store/index.d.ts.map +1 -0
  352. package/dist/stories/AbsFullscreenGradientBg.stories.d.ts +17 -0
  353. package/dist/stories/AbsFullscreenGradientBg.stories.d.ts.map +1 -0
  354. package/dist/stories/AttachmentPart.stories.d.ts +23 -0
  355. package/dist/stories/AttachmentPart.stories.d.ts.map +1 -0
  356. package/dist/stories/AttachmentPartGroup.stories.d.ts +21 -0
  357. package/dist/stories/AttachmentPartGroup.stories.d.ts.map +1 -0
  358. package/dist/stories/AttachmentsPreviewer.stories.d.ts +20 -0
  359. package/dist/stories/AttachmentsPreviewer.stories.d.ts.map +1 -0
  360. package/dist/stories/BaseButton.stories.d.ts +18 -0
  361. package/dist/stories/BaseButton.stories.d.ts.map +1 -0
  362. package/dist/stories/BorderAnimation.stories.d.ts +21 -0
  363. package/dist/stories/BorderAnimation.stories.d.ts.map +1 -0
  364. package/dist/stories/BorderColorAnimation.stories.d.ts +26 -0
  365. package/dist/stories/BorderColorAnimation.stories.d.ts.map +1 -0
  366. package/dist/stories/BotAvatarAndName.stories.d.ts +18 -0
  367. package/dist/stories/BotAvatarAndName.stories.d.ts.map +1 -0
  368. package/dist/stories/BotIcon.stories.d.ts +17 -0
  369. package/dist/stories/BotIcon.stories.d.ts.map +1 -0
  370. package/dist/stories/BsTooltip.stories.d.ts +7 -0
  371. package/dist/stories/BsTooltip.stories.d.ts.map +1 -0
  372. package/dist/stories/Card.stories.d.ts +14 -0
  373. package/dist/stories/Card.stories.d.ts.map +1 -0
  374. package/dist/stories/CardField.stories.d.ts +13 -0
  375. package/dist/stories/CardField.stories.d.ts.map +1 -0
  376. package/dist/stories/ChatAreaHeader.stories.d.ts +14 -0
  377. package/dist/stories/ChatAreaHeader.stories.d.ts.map +1 -0
  378. package/dist/stories/CircleChecker.stories.d.ts +21 -0
  379. package/dist/stories/CircleChecker.stories.d.ts.map +1 -0
  380. package/dist/stories/CollapsibleTextMsg.stories.d.ts +16 -0
  381. package/dist/stories/CollapsibleTextMsg.stories.d.ts.map +1 -0
  382. package/dist/stories/ConfirmDialog.stories.d.ts +61 -0
  383. package/dist/stories/ConfirmDialog.stories.d.ts.map +1 -0
  384. package/dist/stories/DashWidgetIcon.stories.d.ts +13 -0
  385. package/dist/stories/DashWidgetIcon.stories.d.ts.map +1 -0
  386. package/dist/stories/FormInfoEditor.stories.d.ts +15 -0
  387. package/dist/stories/FormInfoEditor.stories.d.ts.map +1 -0
  388. package/dist/stories/FormulaField.stories.d.ts +24 -0
  389. package/dist/stories/FormulaField.stories.d.ts.map +1 -0
  390. package/dist/stories/FormulaTag.stories.d.ts +37 -0
  391. package/dist/stories/FormulaTag.stories.d.ts.map +1 -0
  392. package/dist/stories/GenerateAnimation.stories.d.ts +17 -0
  393. package/dist/stories/GenerateAnimation.stories.d.ts.map +1 -0
  394. package/dist/stories/IconBtn.stories.d.ts +15 -0
  395. package/dist/stories/IconBtn.stories.d.ts.map +1 -0
  396. package/dist/stories/IconLib.d.ts +12 -0
  397. package/dist/stories/IconLib.d.ts.map +1 -0
  398. package/dist/stories/Icons.stories.d.ts +24 -0
  399. package/dist/stories/Icons.stories.d.ts.map +1 -0
  400. package/dist/stories/ImgMsgPart.stories.d.ts +20 -0
  401. package/dist/stories/ImgMsgPart.stories.d.ts.map +1 -0
  402. package/dist/stories/LineChecker.stories.d.ts +23 -0
  403. package/dist/stories/LineChecker.stories.d.ts.map +1 -0
  404. package/dist/stories/LinearGradientBorderBtn.stories.d.ts +22 -0
  405. package/dist/stories/LinearGradientBorderBtn.stories.d.ts.map +1 -0
  406. package/dist/stories/LinearGradientColorBgAnimation.stories.d.ts +23 -0
  407. package/dist/stories/LinearGradientColorBgAnimation.stories.d.ts.map +1 -0
  408. package/dist/stories/NumbersMsgPart.stories.d.ts +19 -0
  409. package/dist/stories/NumbersMsgPart.stories.d.ts.map +1 -0
  410. package/dist/stories/OptionItem.stories.d.ts +20 -0
  411. package/dist/stories/OptionItem.stories.d.ts.map +1 -0
  412. package/dist/stories/PreviewerHeader.stories.d.ts +12 -0
  413. package/dist/stories/PreviewerHeader.stories.d.ts.map +1 -0
  414. package/dist/stories/PrimaryConfirmBtn.stories.d.ts +19 -0
  415. package/dist/stories/PrimaryConfirmBtn.stories.d.ts.map +1 -0
  416. package/dist/stories/PrimaryEntryBtn.stories.d.ts +26 -0
  417. package/dist/stories/PrimaryEntryBtn.stories.d.ts.map +1 -0
  418. package/dist/stories/ScrollToBottom.stories.d.ts +15 -0
  419. package/dist/stories/ScrollToBottom.stories.d.ts.map +1 -0
  420. package/dist/stories/SplitLine.stories.d.ts +9 -0
  421. package/dist/stories/SplitLine.stories.d.ts.map +1 -0
  422. package/dist/stories/SquareChecker.stories.d.ts +26 -0
  423. package/dist/stories/SquareChecker.stories.d.ts.map +1 -0
  424. package/dist/stories/TabRadioGroup.stories.d.ts +18 -0
  425. package/dist/stories/TabRadioGroup.stories.d.ts.map +1 -0
  426. package/dist/stories/UserTextMsgBubble.stories.d.ts +14 -0
  427. package/dist/stories/UserTextMsgBubble.stories.d.ts.map +1 -0
  428. package/dist/stories/WarningMessage.stories.d.ts +16 -0
  429. package/dist/stories/WarningMessage.stories.d.ts.map +1 -0
  430. package/dist/stories/fields-design-info-table.stories.d.ts +14 -0
  431. package/dist/stories/fields-design-info-table.stories.d.ts.map +1 -0
  432. package/dist/stories/fields-generating.stories.d.ts +20 -0
  433. package/dist/stories/fields-generating.stories.d.ts.map +1 -0
  434. package/dist/stories/fields-previewer.stories.d.ts +19 -0
  435. package/dist/stories/fields-previewer.stories.d.ts.map +1 -0
  436. package/package.json +4 -4
  437. package/src/chat.tsx +63 -2
  438. package/src/components/biz-comp/FakeBotMsg.tsx +4 -1
  439. package/src/components/biz-comp/chat-client.tsx +2 -2
  440. package/src/components/biz-comp/markdown-part.tsx +17 -4
  441. package/src/components/biz-comp/multi-modal-input/index.tsx +28 -9
  442. package/src/components/biz-comp/preview-message-wrapper.tsx +3 -1
  443. package/src/components/biz-comp/preview-message.tsx +40 -3
  444. package/src/components/bs-ui/attachment-part-group.tsx +5 -2
  445. package/src/components/bs-ui/attachment-part.tsx +14 -9
  446. package/src/components/bs-ui/attachments-previewer.tsx +2 -2
  447. package/src/components/bs-ui/base-button.tsx +14 -4
  448. package/src/components/bs-ui/border-animation.tsx +107 -0
  449. package/src/components/bs-ui/bs-icons.tsx +6 -0
  450. package/src/components/bs-ui/confirm-dialog.tsx +17 -11
  451. package/src/components/bs-ui/fields-previewer.tsx +16 -8
  452. package/src/components/bs-ui/img-part.tsx +4 -2
  453. package/src/components/bs-ui/previewer-header.tsx +26 -7
  454. package/src/components/bs-ui/primary-entry-btn.tsx +2 -1
  455. package/src/index.tsx +0 -1
  456. package/src/lib/utils.ts +94 -2
  457. package/src/plugins/form-builder-plugin/components/create-form-confirm.tsx +0 -2
  458. package/src/plugins/form-builder-plugin/components/design-doc-part.tsx +19 -0
  459. package/src/plugins/form-builder-plugin/components/fields-part.tsx +78 -0
  460. package/src/plugins/form-builder-plugin/components/msg-part.tsx +20 -165
  461. package/src/plugins/form-builder-plugin/components/suggestion-part.tsx +62 -0
  462. package/src/plugins/form-builder-plugin/hooks/index.tsx +50 -0
  463. package/src/plugins/form-builder-plugin/index.ts +39 -30
  464. package/src/plugins/form-builder-plugin/types.ts +19 -2
  465. package/src/plugins/form-builder-plugin/utils/get-render-strategy.ts +27 -0
  466. package/src/plugins/form-builder-plugin/utils/index.ts +44 -37
  467. package/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.tsx +4 -0
  468. package/src/plugins/form-filling-plugin/components/batch-fill-part.tsx +17 -0
  469. package/src/plugins/form-filling-plugin/components/batch-generator-action.tsx +6 -1
  470. package/src/plugins/form-filling-plugin/components/entry-btn.tsx +1 -1
  471. package/src/plugins/form-filling-plugin/components/first-batch-generating-animation.tsx +6 -16
  472. package/src/plugins/form-filling-plugin/components/msg-part.tsx +39 -122
  473. package/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.tsx +9 -19
  474. package/src/plugins/form-filling-plugin/components/single-fill-part.tsx +42 -0
  475. package/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.ts +13 -0
  476. package/src/plugins/form-filling-plugin/hooks/use-fields-data.ts +110 -0
  477. package/src/plugins/form-filling-plugin/index.ts +49 -43
  478. package/src/plugins/form-filling-plugin/types.ts +19 -1
  479. package/src/plugins/report-query-plugin/components/query-msg-part.tsx +13 -4
  480. package/src/plugins/report-query-plugin/index.ts +20 -11
  481. package/src/sdk.impl.tsx +54 -7
  482. package/src/store/index.ts +8 -1
  483. package/src/stories/BorderAnimation.stories.tsx +116 -0
  484. package/src/stories/PreviewerHeader.stories.tsx +24 -0
  485. package/src/style.css +25 -0
  486. package/src/plugins/form-builder-plugin/hooks/index.ts +0 -0
  487. package/src/plugins/general-model-form-builder-plugin/components/confirmer.tsx +0 -90
  488. package/src/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.tsx +0 -69
  489. package/src/plugins/general-model-form-builder-plugin/components/msg-part.tsx +0 -147
  490. package/src/plugins/general-model-form-builder-plugin/components/new-confirmer.tsx +0 -191
  491. package/src/plugins/general-model-form-builder-plugin/const.ts +0 -3
  492. package/src/plugins/general-model-form-builder-plugin/index.ts +0 -20
  493. package/src/plugins/general-model-form-builder-plugin/types.ts +0 -1
@@ -46,7 +46,7 @@ const ChatSlot = ({ client }: { client?: ChatSDK }) => {
46
46
  const avatarJsx = Avatar ? (
47
47
  <Avatar variant="active" />
48
48
  ) : (
49
- <BotAvatarAndName name={'AI表单搭建'} variant="active" />
49
+ <BotAvatarAndName name={client?.options?.botInfo?.name || 'AI表单搭建'} variant="active" />
50
50
  );
51
51
 
52
52
  const modeStyle = isFloat
@@ -107,7 +107,7 @@ const ChatContent: React.FC<{ client?: ChatSDK }> = ({ client }): ReactPortal |
107
107
  };
108
108
 
109
109
  export const ChatEntryBtn = ({ client }: { client: ChatSDK }) => {
110
- const { bottom = 10, right = 10 } = client?.options?.btnOffset || {};
110
+ const { bottom = 15, right = 40 } = client?.options?.btnOffset || {};
111
111
 
112
112
  const { entryVisible, status, entryWrapper, setStatus, isVisible, entryVariant } = useChatStore(
113
113
  (store) => ({
@@ -6,6 +6,7 @@ import { UserTextMsgBubble } from '../bs-ui/user-txt-msg-bubble';
6
6
  import { CollapsibleTxtMsg } from '../bs-ui/collapsible-txt-msg';
7
7
  import { AnalysisIcon } from '../bs-ui/bs-icons';
8
8
  import { UIDataTypes, UIMessagePart, UITools } from 'ai';
9
+ import { formatJSONIfValid } from '@/lib/utils';
9
10
 
10
11
  export const MarkdownMsgpart = (
11
12
  props: MsgPartCompProps & {
@@ -14,7 +15,7 @@ export const MarkdownMsgpart = (
14
15
  collapsibleTitle?: string;
15
16
  }
16
17
  ) => {
17
- const { part: p, role, id, collapsible = true, collapsibleTitle = '表单设计' } = props;
18
+ const { part: p, role, id, collapsible = true, collapsibleTitle, title, status } = props;
18
19
 
19
20
  const part = p as UIMessagePart<UIDataTypes, UITools>;
20
21
 
@@ -30,6 +31,18 @@ export const MarkdownMsgpart = (
30
31
  return <UserTextMsgBubble>{part.text}</UserTextMsgBubble>;
31
32
  }
32
33
 
34
+ const rawContent = sanitizeText(part.text);
35
+ let displayContent = rawContent;
36
+
37
+ if (status === 'ready') {
38
+
39
+ // 如果是合法 JSON,包装为代码块格式
40
+ const formattedJSON = formatJSONIfValid(rawContent);
41
+ if (formattedJSON) {
42
+ displayContent = `\`\`\`json\n${formattedJSON}\n\`\`\``;
43
+ }
44
+ }
45
+
33
46
  if (!collapsible) {
34
47
  return (
35
48
  <div>
@@ -42,7 +55,7 @@ export const MarkdownMsgpart = (
42
55
  data-testid="message-content"
43
56
  >
44
57
  <article className={typoCls} style={{ fontSize: 14 }}>
45
- <MemoizedMarkdown id={id} content={sanitizeText(part.text)} />
58
+ <MemoizedMarkdown id={id} content={displayContent} />
46
59
  </article>
47
60
  {props.children}
48
61
  </MessageContent>
@@ -60,9 +73,9 @@ export const MarkdownMsgpart = (
60
73
  })}
61
74
  data-testid="message-content"
62
75
  >
63
- <CollapsibleTxtMsg title={collapsibleTitle} icon={<AnalysisIcon />} defaultOpen>
76
+ <CollapsibleTxtMsg title={collapsibleTitle || title || '表单设计'} icon={<AnalysisIcon />} defaultOpen>
64
77
  <article className={typoCls} style={{ fontSize: 14 }}>
65
- <MemoizedMarkdown id={id} content={sanitizeText(part.text)} />
78
+ <MemoizedMarkdown id={id} content={displayContent} />
66
79
  </article>
67
80
  </CollapsibleTxtMsg>
68
81
  {props.children}
@@ -101,6 +101,7 @@ function PureMultimodalInput({
101
101
 
102
102
  const fileInputRef = useRef<HTMLInputElement>(null);
103
103
  const [uploadQueue, setUploadQueue] = useState<string[]>([]);
104
+ const uploadAbortControllers = useRef<Map<string, AbortController>>(new Map());
104
105
 
105
106
  const { exec: onBeforeSendMsg } = usePluginLifeCycleChainRunner('onBeforeMessageSend');
106
107
  const { exec: onAfterSendMsg } = usePluginLifeCycleChainRunner('onAfterMessageSend');
@@ -153,7 +154,7 @@ function PureMultimodalInput({
153
154
 
154
155
  const toast = useToast();
155
156
 
156
- const uploadFile = useCallback(async (file: File) => {
157
+ const uploadFile = useCallback(async (file: File, signal?: AbortSignal) => {
157
158
  const formData = new FormData();
158
159
  formData.append('file', file);
159
160
 
@@ -161,6 +162,7 @@ function PureMultimodalInput({
161
162
  const response = await fetch(fileUploadEndpoint, {
162
163
  method: 'POST',
163
164
  body: formData,
165
+ signal,
164
166
  });
165
167
 
166
168
  if (response.ok) {
@@ -182,7 +184,7 @@ function PureMultimodalInput({
182
184
  return;
183
185
  }
184
186
 
185
- if (attachments.length + files.length >= maxCount) {
187
+ if (attachments.length + files.length > maxCount) {
186
188
  toast({
187
189
  type: 'error',
188
190
  msg: `最多只能上传${maxCount}个附件`,
@@ -203,7 +205,11 @@ function PureMultimodalInput({
203
205
  setUploadQueue(files.map((file) => file.name));
204
206
 
205
207
  try {
206
- const uploadPromises = files.map((file) => uploadFile(file));
208
+ const uploadPromises = files.map((file) => {
209
+ const controller = new AbortController();
210
+ uploadAbortControllers.current.set(file.name, controller);
211
+ return uploadFile(file, controller.signal);
212
+ });
207
213
  const uploadedAttachments = await Promise.all(uploadPromises);
208
214
  const successfullyUploadedAttachments = uploadedAttachments.filter(
209
215
  (attachment) => attachment !== undefined
@@ -219,6 +225,7 @@ function PureMultimodalInput({
219
225
  console.error('Error uploading files!', error);
220
226
  } finally {
221
227
  setUploadQueue([]);
228
+ uploadAbortControllers.current.clear();
222
229
  }
223
230
  },
224
231
  [setAttachments, uploadFile, attachments]
@@ -296,12 +303,14 @@ function PureMultimodalInput({
296
303
  className="border border-[#e0e0e0] bg-background p-[10px] shadow-xs transition-all duration-200 focus-within:border-border hover:border-[#0265ff]"
297
304
  onSubmit={(event) => {
298
305
  event.preventDefault();
299
- if (status !== 'ready') {
300
- // toast.error("Please wait for the model to finish its response!");
301
- } else {
306
+ // if (status !== 'ready') {
307
+ // console.error("Please wait for the model to finish its response!");
308
+ // } else {
309
+ // submitForm();
310
+ // }
311
+ if (status === 'ready' || status === 'error') {
302
312
  submitForm();
303
313
  }
304
- // submitForm();
305
314
  }}
306
315
  >
307
316
  {(attachments.length > 0 || uploadQueue.length > 0) && (
@@ -320,8 +329,18 @@ function PureMultimodalInput({
320
329
  isLoading: true,
321
330
  })),
322
331
  ]}
332
+ imageSize={52}
323
333
  onImageRemove={(item) => {
324
- if (item.id.startsWith('uploading-')) return;
334
+ if (item.id.startsWith('uploading-')) {
335
+ const filename = item.alt || '';
336
+ const controller = uploadAbortControllers.current.get(filename);
337
+ if (controller) {
338
+ controller.abort();
339
+ uploadAbortControllers.current.delete(filename);
340
+ }
341
+ setUploadQueue((cur) => cur.filter((f) => f !== filename));
342
+ return;
343
+ }
325
344
  setAttachments((cur) => cur.filter((a) => a.url !== item.id));
326
345
  if (fileInputRef.current) {
327
346
  fileInputRef.current.value = '';
@@ -354,7 +373,7 @@ function PureMultimodalInput({
354
373
  <PromptInputSubmit
355
374
  className="cursor-pointer rounded-full bg-[#0265FF] text-primary-foreground transition-colors duration-200 hover:bg-[#0265FF]/90 disabled:bg-[#E5E6EB] disabled:text-white h-[26px] w-[26px] disabled:opacity-100"
356
375
  data-testid="send-button"
357
- disabled={!input.trim() || uploadQueue.length > 0}
376
+ disabled={(!input.trim() && attachments.length <= 0) || uploadQueue.length > 0}
358
377
  status={status}
359
378
  >
360
379
  <PlaneIcon />
@@ -8,6 +8,7 @@ import { IconBtn } from '../bs-ui/icon-btn';
8
8
  import { CopyIcon, RefreshIcon } from '../bs-ui/bs-icons';
9
9
  import { useChatPreference } from '@/hooks/use-chat-preference';
10
10
  import { GenerateAnimation } from '../bs-ui/generate-animation';
11
+ import { useChatStore } from '@/store/context';
11
12
 
12
13
  export const PreviewMessageWrapper = ({
13
14
  role,
@@ -32,11 +33,12 @@ export const PreviewMessageWrapper = ({
32
33
  const isUser = role === 'user';
33
34
 
34
35
  const chatPref = useChatPreference();
36
+ const botInfo = useChatStore((state) => state.botInfo);
35
37
 
36
38
  const avatarComInfo = useDefaultPluginCustomComponent('AvatarAndName');
37
39
  const Avatar: ComponentType<{ variant?: 'default' | 'active' }> | undefined =
38
40
  avatarComInfo?.Component;
39
- const avatarJsx = Avatar ? <Avatar /> : <BotAvatarAndName name={'AI表单搭建'} />;
41
+ const avatarJsx = Avatar ? <Avatar /> : <BotAvatarAndName name={botInfo?.name || 'AI表单搭建'} />;
40
42
 
41
43
  // const [isHovered, setIsHovered] = useState(false);
42
44
 
@@ -14,14 +14,19 @@ import {
14
14
  IsFilePart,
15
15
  IsLoadingPart,
16
16
  mergeFileParts,
17
+ imageUrlToBase64,
18
+ IsFakeMsgPart,
19
+ getMetaErrorMsg,
17
20
  } from '@/lib/utils';
18
21
  import { FakeBotMessage } from './FakeBotMsg';
19
22
  import { WarningMessage } from '../bs-ui/warning-msg';
20
23
  import { GenerateAnimation } from '../bs-ui/generate-animation';
21
24
  import { AttachmentPartGroup } from '../bs-ui/attachment-part-group';
22
25
  import { AttachmentPart } from '../bs-ui/attachment-part';
23
- import { useChatStatus, useFakeGlobalLoadingMessage } from '@/hooks/use-frame-mode';
26
+ import { useChatStatus } from '@/hooks/use-frame-mode';
24
27
  import { useEvtBus } from '@/hooks/use-evt-bus';
28
+ import type { FilePart } from '../bs-ui/attachment-part';
29
+ import { useChatStore } from '@/store/context';
25
30
 
26
31
  const PurePreviewMessage = ({
27
32
  message,
@@ -49,6 +54,8 @@ const PurePreviewMessage = ({
49
54
 
50
55
  const chatStatus = useChatStatus();
51
56
 
57
+ const botInfo = useChatStore((state) => state.botInfo);
58
+
52
59
  const hasFileType = message.parts?.some((p: any) => {
53
60
  if (Array.isArray(p)) {
54
61
  return p.some((subP) => subP?.type === 'file');
@@ -72,6 +79,26 @@ const PurePreviewMessage = ({
72
79
 
73
80
  const evtBus = useEvtBus();
74
81
 
82
+ const handleAttachmentClick = async (part: FilePart) => {
83
+ const isImage = part.mediaType?.startsWith('image/');
84
+ const resolvedUrl = isImage
85
+ ? await imageUrlToBase64(part.url, part.mediaType)
86
+ : part.url;
87
+
88
+ evtBus.emit('send-attachment-info', {
89
+ widgetType: isImage ? 'image' : 'file',
90
+ title: part.name,
91
+ files: [{
92
+ imageUrl: isImage ? resolvedUrl : undefined,
93
+ // url: resolvedUrl,
94
+ // name: part.name,
95
+ // mediaType: part.mediaType,
96
+ }],
97
+ currentItem: 0,
98
+ autoClose: false,
99
+ });
100
+ };
101
+
75
102
  const { exec: onBeforeSendMsg } = usePluginLifeCycleChainRunner('onBeforeMessageSend');
76
103
  const { exec: onAfterSendMsg } = usePluginLifeCycleChainRunner('onAfterMessageSend');
77
104
 
@@ -119,11 +146,11 @@ const PurePreviewMessage = ({
119
146
  const key = `message-${message.id}-part-${index}-${Array.isArray(part) ? 'file-group' : part.type}`;
120
147
 
121
148
  if (IsFilePart(part)) {
122
- return <AttachmentPart key={key} part={part as FileUIPart} iconOnly />;
149
+ return <AttachmentPart key={key} part={part as FileUIPart} iconOnly onClick={handleAttachmentClick} />;
123
150
  }
124
151
 
125
152
  if (IsFileGroupPart(part)) {
126
- return <AttachmentPartGroup key={key} parts={part as FileUIPart[]} iconOnly />;
153
+ return <AttachmentPartGroup key={key} parts={part as FileUIPart[]} iconOnly onPartClick={handleAttachmentClick} />;
127
154
  }
128
155
 
129
156
  if (IsErrorPart(part)) {
@@ -131,6 +158,15 @@ const PurePreviewMessage = ({
131
158
  return <WarningMessage key={key} message={errMsg}></WarningMessage>;
132
159
  }
133
160
 
161
+ if (IsFakeMsgPart(part)) {
162
+ const errMsg = getMetaErrorMsg(part);
163
+ return (
164
+ <FakeBotMessage key={key} headless>
165
+ {errMsg}
166
+ </FakeBotMessage>
167
+ );
168
+ }
169
+
134
170
  if (IsLoadingPart(part)) {
135
171
  return (
136
172
  <FakeBotMessage key={key} headless>
@@ -142,6 +178,7 @@ const PurePreviewMessage = ({
142
178
  return (
143
179
  <ErrorBoundary>
144
180
  <MsgPartCom
181
+ title={botInfo?.name}
145
182
  setMessages={setMessages}
146
183
  sendMessage={sendMessage}
147
184
  addToolOutput={addToolOutput}
@@ -11,21 +11,24 @@ export interface AttachmentPartGroupProps {
11
11
  gap?: number;
12
12
  /** Show only icons without file names */
13
13
  iconOnly?: boolean;
14
+ /** Click handler for individual parts */
15
+ onPartClick?: (part: FilePart) => void;
14
16
  }
15
17
 
16
18
  export const AttachmentPartGroup = ({
17
19
  parts,
18
20
  className,
19
- size = 102,
21
+ size = 100,
20
22
  gap = 10,
21
23
  iconOnly,
24
+ onPartClick,
22
25
  }: AttachmentPartGroupProps) => {
23
26
  if (!parts.length) return null;
24
27
 
25
28
  return (
26
29
  <div className={cn('flex flex-wrap content-center items-center', className)} style={{ gap }}>
27
30
  {parts.map((part, index) => (
28
- <AttachmentPart key={part.url || index} part={part} size={size} iconOnly={iconOnly} />
31
+ <AttachmentPart key={part.url || index} part={part} size={size} iconOnly={iconOnly} onClick={onPartClick} />
29
32
  ))}
30
33
  </div>
31
34
  );
@@ -18,6 +18,8 @@ export interface AttachmentPartProps {
18
18
  size?: number;
19
19
  /** Show only the icon without file name */
20
20
  iconOnly?: boolean;
21
+ /** Click handler for the attachment */
22
+ onClick?: (part: FilePart) => void;
21
23
  }
22
24
 
23
25
  type FileIconComponent = ComponentType;
@@ -150,12 +152,13 @@ const FileMsgPart = ({
150
152
  );
151
153
  };
152
154
 
153
- export const AttachmentPart = ({ part, className, size = 102, iconOnly }: AttachmentPartProps) => {
155
+ export const AttachmentPart = ({ part, className, size = 102, iconOnly, onClick }: AttachmentPartProps) => {
154
156
  const { url, name, mediaType } = part;
157
+ const handleClick = onClick ? () => onClick(part) : undefined;
155
158
 
156
159
  // Render image for image types
157
160
  if (isImageType(mediaType)) {
158
- return <ImgMsgPart url={url} alt={name} className={className} size={size} />;
161
+ return <ImgMsgPart url={url} alt={name} className={className} size={size} onClick={handleClick} />;
159
162
  }
160
163
 
161
164
  // Render file icon for other types
@@ -163,12 +166,14 @@ export const AttachmentPart = ({ part, className, size = 102, iconOnly }: Attach
163
166
  const displayName = iconOnly ? undefined : getDisplayFileName(name);
164
167
 
165
168
  return (
166
- <FileMsgPart
167
- fileName={displayName}
168
- icon={icon}
169
- iconSize={iconSize}
170
- className={className}
171
- size={size}
172
- />
169
+ <div onClick={handleClick} className={onClick ? 'cursor-pointer' : undefined}>
170
+ <FileMsgPart
171
+ fileName={displayName}
172
+ icon={icon}
173
+ iconSize={iconSize}
174
+ className={className}
175
+ size={size}
176
+ />
177
+ </div>
173
178
  );
174
179
  };
@@ -270,14 +270,14 @@ export const AttachmentsPreviewer = ({
270
270
  )}
271
271
 
272
272
  {attachment.isLoading && (
273
- <div className="absolute inset-0 flex items-center justify-center rounded-[10px] bg-black/50">
273
+ <div className="absolute inset-0 flex items-center justify-center rounded-[10px] bg-black/50 pointer-events-none">
274
274
  <div className="inline-flex animate-spin items-center justify-center">
275
275
  <LoaderIcon size={16} />
276
276
  </div>
277
277
  </div>
278
278
  )}
279
279
 
280
- {onImageRemove && !attachment.isLoading && (
280
+ {onImageRemove /* && !attachment.isLoading*/ && (
281
281
  <button
282
282
  className={cn(
283
283
  'absolute -top-[6px] -right-[6px]',
@@ -2,21 +2,23 @@ import { forwardRef } from 'react';
2
2
  import type { ButtonHTMLAttributes, ReactNode } from 'react';
3
3
  import { cn } from '@/lib/utils';
4
4
  import { transCls } from '@/const/ui';
5
+ import { BsTooltip } from './tooltip';
5
6
 
6
7
  export interface BaseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
8
  icon?: ReactNode;
9
+ tooltip?: string;
8
10
  hoverTextCls?: string;
9
11
  }
10
12
 
11
13
  export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
12
- ({ className, children, hoverTextCls, icon, type, ...rest }, ref) => {
13
- return (
14
+ ({ className, children, hoverTextCls, tooltip, icon, type, ...rest }, ref) => {
15
+ const btn = (
14
16
  <button
15
17
  ref={ref}
16
18
  type={type ?? 'button'}
17
19
  className={cn(
18
20
  'group inline-flex items-center gap-[6px] px-[16px] rounded-[4px] h-[34px]',
19
- 'border border-[#E0E0E0] bg-transparent',
21
+ 'border border-solid border-[#E0E0E0] bg-transparent',
20
22
  'text-[14px] font-[400] leading-[normal] text-[#030303]',
21
23
  'hover:bg-[#EFF0F6] hover:border-transparent',
22
24
  'cursor-pointer',
@@ -30,9 +32,17 @@ export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
30
32
  {...rest}
31
33
  >
32
34
  {icon ? <span className="shrink-0">{icon}</span> : null}
33
- <span className="whitespace-nowrap">{children}</span>
35
+ {children ? (
36
+ <span className="whitespace-nowrap">{children}</span>
37
+ ) : null}
34
38
  </button>
35
39
  );
40
+
41
+ if (tooltip) {
42
+ return <BsTooltip content={tooltip}>{btn}</BsTooltip>;
43
+ }
44
+
45
+ return btn;
36
46
  }
37
47
  );
38
48
 
@@ -0,0 +1,107 @@
1
+ import React from 'react';
2
+ import { cn } from '@/lib/utils';
3
+
4
+ export interface BorderAnimationProps {
5
+ children?: React.ReactNode;
6
+ className?: string;
7
+ /** Duration of one full animation cycle in seconds @default 2 */
8
+ duration?: number;
9
+ /** Border radius in pixels @default 4 */
10
+ borderRadius?: number;
11
+ /** Width of the animated beam in pixels @default 30 */
12
+ beamWidth?: number;
13
+ /** Height of the animated beam in pixels @default 4 */
14
+ beamHeight?: number;
15
+ /** Gradient for the animated beam */
16
+ gradient?: string;
17
+ height?: string | number;
18
+ /** Border width in pixels @default 1.5 */
19
+ borderWidth?: number;
20
+ /** Default border color @default '#E5E5E5' */
21
+ borderColor?: string;
22
+ }
23
+
24
+ const defaultGradient = `linear-gradient(90deg,
25
+ rgba(132, 180, 255, 0) 0%,
26
+ rgba(132, 180, 255, 0.5) 10%,
27
+ rgba(132, 180, 255, 1) 25%,
28
+ rgb(2, 101, 255) 50%,
29
+ rgba(177, 250, 255, 1) 75%,
30
+ rgba(177, 250, 255, 0.5) 90%,
31
+ rgba(177, 250, 255, 0) 100%
32
+ )`;
33
+
34
+ export const BorderAnimation: React.FC<BorderAnimationProps> = ({
35
+ children,
36
+ className,
37
+ duration = 2,
38
+ borderRadius = 4,
39
+ beamWidth = 170,
40
+ beamHeight = 4,
41
+ // gradient = 'linear-gradient(180deg, #84B4FF 0%, #0265FF 50%, #B1FAFF 100%)',
42
+ // gradient = 'linear-gradient(90deg, rgb(132, 180, 255) 0%, rgb(2, 101, 255) 50%, rgb(177, 250, 255) 100%)',
43
+ gradient = defaultGradient,
44
+ borderWidth = 1,
45
+ height,
46
+ borderColor = 'transparent',
47
+ }) => {
48
+ const pseudoCls = "gradient-border"
49
+ return (
50
+ <div
51
+ className={cn('relative w-full overflow-hidden', className, pseudoCls)}
52
+ style={{
53
+ borderRadius: `${borderRadius}px`,
54
+ border: `${borderWidth}px solid ${borderColor}`,
55
+ ...(height ? { height } : {}),
56
+ }}
57
+ >
58
+ {children}
59
+ {/* Animated border overlay */}
60
+ <div
61
+ style={{
62
+ position: 'absolute',
63
+ // inset: `${-borderWidth}px`,
64
+ inset: 0,
65
+ pointerEvents: 'none',
66
+ border: `${borderWidth}px solid transparent`,
67
+ borderRadius: 'inherit',
68
+ // contain: 'layout style paint',
69
+ maskImage:
70
+ 'linear-gradient(transparent, transparent), linear-gradient(white, white)',
71
+ WebkitMaskImage:
72
+ 'linear-gradient(transparent, transparent), linear-gradient(white, white)',
73
+ maskOrigin: 'border-box, border-box',
74
+ WebkitMaskOrigin: 'border-box, border-box',
75
+ maskClip: 'padding-box, border-box',
76
+ WebkitMaskClip: 'padding-box, border-box',
77
+ maskComposite: 'intersect',
78
+ WebkitMaskComposite: 'source-in',
79
+ }}
80
+ >
81
+ {/* Traveling beam */}
82
+ <div
83
+ style={{
84
+ position: 'absolute',
85
+ aspectRatio: '1 / 1',
86
+ width: `${beamWidth}px`,
87
+ height: `${beamHeight}px`,
88
+ background: gradient,
89
+ offsetPath: `rect(0px auto auto 0px round ${borderRadius}px)`,
90
+ animation: `bs-border-travel ${duration}s linear infinite`,
91
+ willChange: 'offset-distance',
92
+ transform: 'translateZ(0)',
93
+ backfaceVisibility: 'hidden',
94
+ }}
95
+ />
96
+ </div>
97
+ <style>{`
98
+ @keyframes bs-border-travel {
99
+ 0% { offset-distance: 0%; }
100
+ 100% { offset-distance: 100%; }
101
+ }
102
+ `}</style>
103
+ </div>
104
+ );
105
+ };
106
+
107
+ export default BorderAnimation;
@@ -1094,3 +1094,9 @@ export const DataReportIcon = () => (
1094
1094
  />
1095
1095
  </svg>
1096
1096
  );
1097
+
1098
+ export const BrushIcon = () => (
1099
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="currentColor">
1100
+ <path d="M14.72 2.64C14.72 2.16 14.56 1.76 14.24 1.44L13.28 0.48C12.64 -0.16 11.6 -0.16 10.96 0.48L8.8 2.64L7.04 0.96C6.4 0.32 5.36 0.32 4.72 0.96L3.12 2.56L0.48 5.28C0.16 5.6 0 6 0 6.4C0 6.8 0.16 7.28 0.48 7.6L2 9.12L7.12 14.24C7.44 14.56 7.84 14.72 8.24 14.72H8.32C8.72 14.72 9.2 14.56 9.52 14.24L12.08 11.68C12.08 11.68 12.16 11.68 12.16 11.6C12.16 11.6 12.16 11.52 12.24 11.52L13.76 10C14.08 9.68 14.24 9.28 14.24 8.8C14.24 8.32 14.08 7.92 13.76 7.6L12.08 5.92L14.24 3.76C14.48 3.44 14.72 3.04 14.72 2.64ZM8.64 13.44C8.56 13.52 8.4 13.6 8.24 13.6H8.16C8 13.6 7.92 13.52 7.76 13.44L6.8 12.48L7.6 11.68C7.84 11.44 7.84 11.12 7.6 10.88C7.36 10.64 7.04 10.64 6.8 10.88L6 11.68L4.96 10.64L6.24 9.36C6.48 9.12 6.48 8.8 6.24 8.56C6 8.32 5.68 8.32 5.44 8.56L4.16 9.84L2.96 8.64L3.6 8C3.84 7.76 3.84 7.44 3.6 7.2C3.36 6.96 3.04 6.96 2.8 7.2L2.16 7.84L1.2 6.8C1.12 6.72 1.12 6.56 1.12 6.4C1.12 6.24 1.2 6.16 1.28 6L3.52 3.76L10.96 11.2L8.64 13.44ZM13.44 2.96L10.88 5.52C10.64 5.76 10.64 6.08 10.88 6.32L12.96 8.4C13.04 8.48 13.12 8.64 13.12 8.8C13.12 8.96 13.04 9.04 12.96 9.2L11.68 10.4L4.32 2.96L5.52 1.76C5.68 1.6 6.08 1.6 6.24 1.76L8.32 3.84C8.56 4.08 8.88 4.08 9.12 3.84L11.68 1.28C11.84 1.12 12.24 1.12 12.4 1.28L13.36 2.24C13.44 2.32 13.52 2.48 13.52 2.64C13.52 2.8 13.52 2.88 13.44 2.96Z"/>
1101
+ </svg>
1102
+ )
@@ -8,6 +8,7 @@ import {
8
8
  } from '@/components/ui/dialog';
9
9
  import { QuestionIcon } from './bs-icons';
10
10
  import { cn } from '@/lib/utils';
11
+ import { BaseButton } from './base-button';
11
12
 
12
13
  export interface ConfirmDialogProps {
13
14
  open?: boolean;
@@ -84,7 +85,6 @@ export function ConfirmDialog({
84
85
  {showLink ? (
85
86
  <button
86
87
  type="button"
87
- onClick={onLinkClick}
88
88
  className="text-[14px] text-[#0265ff] hover:text-[#0265ff]/80 bg-transparent border-none cursor-pointer"
89
89
  >
90
90
  {linkText}
@@ -95,25 +95,31 @@ export function ConfirmDialog({
95
95
 
96
96
  <div className="flex items-center gap-3">
97
97
  {showCancel && (
98
- <button
99
- type="button"
98
+ <BaseButton
99
+ className="hover:text-[#121111]"
100
100
  onClick={onCancel}
101
- style={btnStyle}
102
- className={cn(
103
- 'h-8 px-5 py-1.5 rounded border border-[#e0e0e0]',
104
- 'text-[14px] text-[#030303] bg-white',
105
- 'hover:bg-gray-50 cursor-pointer'
106
- )}
107
101
  >
108
102
  {cancelText}
109
- </button>
103
+ </BaseButton>
104
+ // <button
105
+ // type="button"
106
+ // onClick={onCancel}
107
+ // style={btnStyle}
108
+ // className={cn(
109
+ // 'h-8 px-5 py-1.5 rounded border border-[#e0e0e0]',
110
+ // 'text-[14px] text-[#030303] bg-white',
111
+ // 'hover:bg-gray-50 cursor-pointer'
112
+ // )}
113
+ // >
114
+ // {cancelText}
115
+ // </button>
110
116
  )}
111
117
  <button
112
118
  type="button"
113
119
  onClick={onConfirm}
114
120
  style={btnStyle}
115
121
  className={cn(
116
- 'h-8 px-5 py-1.5 rounded',
122
+ // 'h-8 px-5 py-1.5 rounded',
117
123
  'text-[14px] text-white bg-[#0265ff]',
118
124
  'hover:bg-[#0265ff]/80 cursor-pointer border-none'
119
125
  )}
@@ -5,6 +5,7 @@ import { BorderColorAnimation } from './border-color-animation';
5
5
  import { FieldsGeneratingIndicator } from './fields-generating-indicator';
6
6
  import { PreviewerHeader, PreviewerHeaderProps } from './previewer-header';
7
7
  import { useShadow } from '@/hooks/use-shadow';
8
+ import { TooltipProvider } from '../ui/tooltip';
8
9
 
9
10
  export interface FieldsPreviewerProps extends PreviewerHeaderProps {
10
11
  fullscreen?: boolean;
@@ -67,6 +68,7 @@ export const FieldsPreviewer = forwardRef<HTMLDivElement, FieldsPreviewerProps>(
67
68
  variant = 'fields-previewer',
68
69
  onSave,
69
70
  onCancel,
71
+ onClear,
70
72
  style,
71
73
  confirmContent,
72
74
  fullContent,
@@ -139,6 +141,7 @@ export const FieldsPreviewer = forwardRef<HTMLDivElement, FieldsPreviewerProps>(
139
141
  closeBtnLabel={closeBtnLabel}
140
142
  disableOperation={disableOperation}
141
143
  disableConfirm={disableConfirm}
144
+ onClear={onClear}
142
145
  />
143
146
  <div className={contentCls} style={fullContentStyle}>
144
147
  {empty && isFields ? <PlaceholderDashedBox /> : children}
@@ -187,16 +190,21 @@ export const FieldsPreviewer = forwardRef<HTMLDivElement, FieldsPreviewerProps>(
187
190
  );
188
191
 
189
192
  return (
190
- <AbsFullscreenGradientBg
193
+ <TooltipProvider
194
+ delayDuration={100}
191
195
  zIndex={zIndex}
192
- padding={isFields ? p : 0}
193
- disableGradient={fullscreen || !isFields}
194
- bgColor={isFields ? '#fff' : '#F5F7FA'}
195
- ref={setAbsContainer}
196
196
  >
197
- {fullscreen ? contentJsx : content}
198
- {rightArea}
199
- </AbsFullscreenGradientBg>
197
+ <AbsFullscreenGradientBg
198
+ zIndex={zIndex}
199
+ padding={isFields ? p : 0}
200
+ disableGradient={fullscreen || !isFields}
201
+ bgColor={isFields ? '#fff' : '#F5F7FA'}
202
+ ref={setAbsContainer}
203
+ >
204
+ {fullscreen ? contentJsx : content}
205
+ {rightArea}
206
+ </AbsFullscreenGradientBg>
207
+ </TooltipProvider>
200
208
  );
201
209
  }
202
210
  );