@baishuyun/chat-sdk 0.1.9 → 1.0.1

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 (431) hide show
  1. package/.turbo/turbo-build.log +8 -107
  2. package/CHANGELOG.md +21 -0
  3. package/dist/chat-sdk.js +14087 -13890
  4. package/dist/chat-sdk.js.map +1 -1
  5. package/dist/chat-sdk.umd.cjs +150 -150
  6. package/dist/chat-sdk.umd.cjs.map +1 -1
  7. package/dist/index.css +1 -1
  8. package/dist/src/chat.d.ts +5 -0
  9. package/dist/src/chat.d.ts.map +1 -0
  10. package/dist/src/components/biz-comp/FakeBotMsg.d.ts +8 -0
  11. package/dist/src/components/biz-comp/FakeBotMsg.d.ts.map +1 -0
  12. package/dist/src/components/biz-comp/FieldChecker.d.ts +19 -0
  13. package/dist/src/components/biz-comp/FieldChecker.d.ts.map +1 -0
  14. package/dist/src/components/biz-comp/FieldCheckerListMsg.d.ts +19 -0
  15. package/dist/src/components/biz-comp/FieldCheckerListMsg.d.ts.map +1 -0
  16. package/dist/src/components/biz-comp/FieldValueChecker.d.ts +16 -0
  17. package/dist/src/components/biz-comp/FieldValueChecker.d.ts.map +1 -0
  18. package/dist/src/components/biz-comp/SubformFieldsValueChecker.d.ts +22 -0
  19. package/dist/src/components/biz-comp/SubformFieldsValueChecker.d.ts.map +1 -0
  20. package/dist/src/components/biz-comp/chat-client.d.ts +13 -0
  21. package/dist/src/components/biz-comp/chat-client.d.ts.map +1 -0
  22. package/dist/src/components/biz-comp/chat-frame.d.ts +6 -0
  23. package/dist/src/components/biz-comp/chat-frame.d.ts.map +1 -0
  24. package/dist/src/components/biz-comp/conversation.d.ts +10 -0
  25. package/dist/src/components/biz-comp/conversation.d.ts.map +1 -0
  26. package/dist/src/components/biz-comp/dash-widget-icon.d.ts +7 -0
  27. package/dist/src/components/biz-comp/dash-widget-icon.d.ts.map +1 -0
  28. package/dist/src/components/biz-comp/dock-btn.d.ts +2 -0
  29. package/dist/src/components/biz-comp/dock-btn.d.ts.map +1 -0
  30. package/dist/src/components/biz-comp/error-boundary.d.ts +15 -0
  31. package/dist/src/components/biz-comp/error-boundary.d.ts.map +1 -0
  32. package/dist/src/components/biz-comp/error-msg.d.ts +4 -0
  33. package/dist/src/components/biz-comp/error-msg.d.ts.map +1 -0
  34. package/dist/src/components/biz-comp/field-icon.d.ts +5 -0
  35. package/dist/src/components/biz-comp/field-icon.d.ts.map +1 -0
  36. package/dist/src/components/biz-comp/highlight-msg.d.ts +4 -0
  37. package/dist/src/components/biz-comp/highlight-msg.d.ts.map +1 -0
  38. package/dist/src/components/biz-comp/markdown-part.d.ts +7 -0
  39. package/dist/src/components/biz-comp/markdown-part.d.ts.map +1 -0
  40. package/dist/src/components/biz-comp/markdown.d.ts +5 -0
  41. package/dist/src/components/biz-comp/markdown.d.ts.map +1 -0
  42. package/dist/src/components/biz-comp/message-content.d.ts +6 -0
  43. package/dist/src/components/biz-comp/message-content.d.ts.map +1 -0
  44. package/dist/src/components/biz-comp/messages.d.ts +3 -0
  45. package/dist/src/components/biz-comp/messages.d.ts.map +1 -0
  46. package/dist/src/components/biz-comp/multi-modal-input/attachment-btn.d.ts +9 -0
  47. package/dist/src/components/biz-comp/multi-modal-input/attachment-btn.d.ts.map +1 -0
  48. package/dist/src/components/biz-comp/multi-modal-input/clear-btn.d.ts +8 -0
  49. package/dist/src/components/biz-comp/multi-modal-input/clear-btn.d.ts.map +1 -0
  50. package/dist/src/components/biz-comp/multi-modal-input/index.d.ts +22 -0
  51. package/dist/src/components/biz-comp/multi-modal-input/index.d.ts.map +1 -0
  52. package/dist/src/components/biz-comp/multi-modal-input/preview-attachment.d.ts +12 -0
  53. package/dist/src/components/biz-comp/multi-modal-input/preview-attachment.d.ts.map +1 -0
  54. package/dist/src/components/biz-comp/multi-modal-input/prompt-input.d.ts +36 -0
  55. package/dist/src/components/biz-comp/multi-modal-input/prompt-input.d.ts.map +1 -0
  56. package/dist/src/components/biz-comp/multi-modal-input/voice-btn.d.ts +9 -0
  57. package/dist/src/components/biz-comp/multi-modal-input/voice-btn.d.ts.map +1 -0
  58. package/dist/src/components/biz-comp/opening-lines.d.ts +3 -0
  59. package/dist/src/components/biz-comp/opening-lines.d.ts.map +1 -0
  60. package/dist/src/components/biz-comp/preview-message-wrapper.d.ts +12 -0
  61. package/dist/src/components/biz-comp/preview-message-wrapper.d.ts.map +1 -0
  62. package/dist/src/components/biz-comp/preview-message.d.ts +13 -0
  63. package/dist/src/components/biz-comp/preview-message.d.ts.map +1 -0
  64. package/dist/src/components/biz-comp/response.d.ts +6 -0
  65. package/dist/src/components/biz-comp/response.d.ts.map +1 -0
  66. package/dist/src/components/biz-comp/suggestions.d.ts +8 -0
  67. package/dist/src/components/biz-comp/suggestions.d.ts.map +1 -0
  68. package/dist/src/components/ui/badge.d.ts +10 -0
  69. package/dist/src/components/ui/badge.d.ts.map +1 -0
  70. package/dist/src/components/ui/button.d.ts +12 -0
  71. package/dist/src/components/ui/button.d.ts.map +1 -0
  72. package/dist/src/components/ui/card.d.ts +9 -0
  73. package/dist/src/components/ui/card.d.ts.map +1 -0
  74. package/dist/src/components/ui/checkbox.d.ts +5 -0
  75. package/dist/src/components/ui/checkbox.d.ts.map +1 -0
  76. package/dist/src/components/ui/collapsible.d.ts +6 -0
  77. package/dist/src/components/ui/collapsible.d.ts.map +1 -0
  78. package/dist/src/components/ui/dialog.d.ts +24 -0
  79. package/dist/src/components/ui/dialog.d.ts.map +1 -0
  80. package/dist/src/components/ui/dropdown-menu.d.ts +28 -0
  81. package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -0
  82. package/dist/src/components/ui/icons.d.ts +176 -0
  83. package/dist/src/components/ui/icons.d.ts.map +1 -0
  84. package/dist/src/components/ui/input-group.d.ts +17 -0
  85. package/dist/src/components/ui/input-group.d.ts.map +1 -0
  86. package/dist/src/components/ui/input.d.ts +4 -0
  87. package/dist/src/components/ui/input.d.ts.map +1 -0
  88. package/dist/src/components/ui/label.d.ts +6 -0
  89. package/dist/src/components/ui/label.d.ts.map +1 -0
  90. package/dist/src/components/ui/one-time-click-btn.d.ts +4 -0
  91. package/dist/src/components/ui/one-time-click-btn.d.ts.map +1 -0
  92. package/dist/src/components/ui/select.d.ts +14 -0
  93. package/dist/src/components/ui/select.d.ts.map +1 -0
  94. package/dist/src/components/ui/spinner.d.ts +3 -0
  95. package/dist/src/components/ui/spinner.d.ts.map +1 -0
  96. package/dist/src/components/ui/tabs.d.ts +8 -0
  97. package/dist/src/components/ui/tabs.d.ts.map +1 -0
  98. package/dist/src/components/ui/textarea.d.ts +4 -0
  99. package/dist/src/components/ui/textarea.d.ts.map +1 -0
  100. package/dist/src/components/ui/tooltip.d.ts +13 -0
  101. package/dist/src/components/ui/tooltip.d.ts.map +1 -0
  102. package/dist/src/components/web-comp/fields-previewer-web-component.d.ts +60 -0
  103. package/dist/src/components/web-comp/fields-previewer-web-component.d.ts.map +1 -0
  104. package/dist/src/const/index.d.ts +5 -0
  105. package/dist/src/const/index.d.ts.map +1 -0
  106. package/dist/src/const/ui.d.ts +7 -0
  107. package/dist/src/const/ui.d.ts.map +1 -0
  108. package/dist/src/hooks/use-chat-preference.d.ts +3 -0
  109. package/dist/src/hooks/use-chat-preference.d.ts.map +1 -0
  110. package/dist/src/hooks/use-draggable.d.ts +24 -0
  111. package/dist/src/hooks/use-draggable.d.ts.map +1 -0
  112. package/dist/src/hooks/use-evt-bus.d.ts +2 -0
  113. package/dist/src/hooks/use-evt-bus.d.ts.map +1 -0
  114. package/dist/src/hooks/use-evt.d.ts +3 -0
  115. package/dist/src/hooks/use-evt.d.ts.map +1 -0
  116. package/dist/src/hooks/use-frame-mode.d.ts +20 -0
  117. package/dist/src/hooks/use-frame-mode.d.ts.map +1 -0
  118. package/dist/src/hooks/use-merged-chat.d.ts +7 -0
  119. package/dist/src/hooks/use-merged-chat.d.ts.map +1 -0
  120. package/dist/src/hooks/use-msg-status-broadcast.d.ts +3 -0
  121. package/dist/src/hooks/use-msg-status-broadcast.d.ts.map +1 -0
  122. package/dist/src/hooks/use-plugin-component.d.ts +5 -0
  123. package/dist/src/hooks/use-plugin-component.d.ts.map +1 -0
  124. package/dist/src/hooks/use-plugin-ctx.d.ts +3 -0
  125. package/dist/src/hooks/use-plugin-ctx.d.ts.map +1 -0
  126. package/dist/src/hooks/use-plugin-custom-components.d.ts +5 -0
  127. package/dist/src/hooks/use-plugin-custom-components.d.ts.map +1 -0
  128. package/dist/src/hooks/use-plugin-life-cycle-chain-runner.d.ts +5 -0
  129. package/dist/src/hooks/use-plugin-life-cycle-chain-runner.d.ts.map +1 -0
  130. package/dist/src/hooks/use-plugin-list.d.ts +2 -0
  131. package/dist/src/hooks/use-plugin-list.d.ts.map +1 -0
  132. package/dist/src/hooks/use-plugin.d.ts +2 -0
  133. package/dist/src/hooks/use-plugin.d.ts.map +1 -0
  134. package/dist/src/hooks/use-scroll-to-bottom.d.ts +9 -0
  135. package/dist/src/hooks/use-scroll-to-bottom.d.ts.map +1 -0
  136. package/dist/src/hooks/use-shadow.d.ts +25 -0
  137. package/dist/src/hooks/use-shadow.d.ts.map +1 -0
  138. package/dist/src/hooks/use-streaming-anchor.d.ts +11 -0
  139. package/dist/src/hooks/use-streaming-anchor.d.ts.map +1 -0
  140. package/dist/src/hooks/use-toast.d.ts +3 -0
  141. package/dist/src/hooks/use-toast.d.ts.map +1 -0
  142. package/dist/src/hooks/use-voice-input.d.ts +31 -0
  143. package/dist/src/hooks/use-voice-input.d.ts.map +1 -0
  144. package/dist/src/index.d.ts +6 -0
  145. package/dist/src/index.d.ts.map +1 -0
  146. package/dist/src/lib/clone.d.ts +32 -0
  147. package/dist/src/lib/clone.d.ts.map +1 -0
  148. package/dist/src/lib/event-emitter.d.ts +39 -0
  149. package/dist/src/lib/event-emitter.d.ts.map +1 -0
  150. package/dist/src/lib/parse-design-doc.d.ts +16 -0
  151. package/dist/src/lib/parse-design-doc.d.ts.map +1 -0
  152. package/dist/src/lib/readonly.d.ts +14 -0
  153. package/dist/src/lib/readonly.d.ts.map +1 -0
  154. package/dist/src/lib/utils.d.ts +72 -0
  155. package/dist/src/lib/utils.d.ts.map +1 -0
  156. package/dist/src/plugins/form-builder-base-plugin/const.d.ts +3 -0
  157. package/dist/src/plugins/form-builder-base-plugin/const.d.ts.map +1 -0
  158. package/dist/src/plugins/form-builder-base-plugin/index.d.ts +7 -0
  159. package/dist/src/plugins/form-builder-base-plugin/index.d.ts.map +1 -0
  160. package/dist/src/plugins/form-builder-base-plugin/types.d.ts +12 -0
  161. package/dist/src/plugins/form-builder-base-plugin/types.d.ts.map +1 -0
  162. package/dist/src/plugins/form-builder-plugin/components/create-form-confirm.d.ts +7 -0
  163. package/dist/src/plugins/form-builder-plugin/components/create-form-confirm.d.ts.map +1 -0
  164. package/dist/src/plugins/form-builder-plugin/components/design-doc-part.d.ts +4 -0
  165. package/dist/src/plugins/form-builder-plugin/components/design-doc-part.d.ts.map +1 -0
  166. package/dist/src/plugins/form-builder-plugin/components/design-info.d.ts +6 -0
  167. package/dist/src/plugins/form-builder-plugin/components/design-info.d.ts.map +1 -0
  168. package/dist/src/plugins/form-builder-plugin/components/entry-btn.d.ts +3 -0
  169. package/dist/src/plugins/form-builder-plugin/components/entry-btn.d.ts.map +1 -0
  170. package/dist/src/plugins/form-builder-plugin/components/fields-part.d.ts +4 -0
  171. package/dist/src/plugins/form-builder-plugin/components/fields-part.d.ts.map +1 -0
  172. package/dist/src/plugins/form-builder-plugin/components/follow-up.d.ts +3 -0
  173. package/dist/src/plugins/form-builder-plugin/components/follow-up.d.ts.map +1 -0
  174. package/dist/src/plugins/form-builder-plugin/components/msg-part.d.ts +3 -0
  175. package/dist/src/plugins/form-builder-plugin/components/msg-part.d.ts.map +1 -0
  176. package/dist/src/plugins/form-builder-plugin/components/opening-lines.d.ts +3 -0
  177. package/dist/src/plugins/form-builder-plugin/components/opening-lines.d.ts.map +1 -0
  178. package/dist/src/plugins/form-builder-plugin/components/suggestion-part.d.ts +5 -0
  179. package/dist/src/plugins/form-builder-plugin/components/suggestion-part.d.ts.map +1 -0
  180. package/dist/src/plugins/form-builder-plugin/const/index.d.ts +12 -0
  181. package/dist/src/plugins/form-builder-plugin/const/index.d.ts.map +1 -0
  182. package/dist/src/plugins/form-builder-plugin/hooks/index.d.ts +4 -0
  183. package/dist/src/plugins/form-builder-plugin/hooks/index.d.ts.map +1 -0
  184. package/dist/src/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts +2 -0
  185. package/dist/src/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts.map +1 -0
  186. package/dist/src/plugins/form-builder-plugin/index.d.ts +30 -0
  187. package/dist/src/plugins/form-builder-plugin/index.d.ts.map +1 -0
  188. package/dist/src/plugins/form-builder-plugin/types.d.ts +28 -0
  189. package/dist/src/plugins/form-builder-plugin/types.d.ts.map +1 -0
  190. package/dist/src/plugins/form-builder-plugin/utils/get-render-strategy.d.ts +3 -0
  191. package/dist/src/plugins/form-builder-plugin/utils/get-render-strategy.d.ts.map +1 -0
  192. package/dist/src/plugins/form-builder-plugin/utils/index.d.ts +57 -0
  193. package/dist/src/plugins/form-builder-plugin/utils/index.d.ts.map +1 -0
  194. package/dist/src/plugins/form-filling-plugin/batch-filling-data-manager.d.ts +26 -0
  195. package/dist/src/plugins/form-filling-plugin/batch-filling-data-manager.d.ts.map +1 -0
  196. package/dist/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts +3 -0
  197. package/dist/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts.map +1 -0
  198. package/dist/src/plugins/form-filling-plugin/components/avatar.d.ts +5 -0
  199. package/dist/src/plugins/form-filling-plugin/components/avatar.d.ts.map +1 -0
  200. package/dist/src/plugins/form-filling-plugin/components/batch-fill-part.d.ts +4 -0
  201. package/dist/src/plugins/form-filling-plugin/components/batch-fill-part.d.ts.map +1 -0
  202. package/dist/src/plugins/form-filling-plugin/components/batch-generator-action.d.ts +14 -0
  203. package/dist/src/plugins/form-filling-plugin/components/batch-generator-action.d.ts.map +1 -0
  204. package/dist/src/plugins/form-filling-plugin/components/entry-btn.d.ts +3 -0
  205. package/dist/src/plugins/form-filling-plugin/components/entry-btn.d.ts.map +1 -0
  206. package/dist/src/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts +2 -0
  207. package/dist/src/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts.map +1 -0
  208. package/dist/src/plugins/form-filling-plugin/components/generated-data-counter.d.ts +5 -0
  209. package/dist/src/plugins/form-filling-plugin/components/generated-data-counter.d.ts.map +1 -0
  210. package/dist/src/plugins/form-filling-plugin/components/mode-select.d.ts +2 -0
  211. package/dist/src/plugins/form-filling-plugin/components/mode-select.d.ts.map +1 -0
  212. package/dist/src/plugins/form-filling-plugin/components/msg-part.d.ts +3 -0
  213. package/dist/src/plugins/form-filling-plugin/components/msg-part.d.ts.map +1 -0
  214. package/dist/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts +2 -0
  215. package/dist/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts.map +1 -0
  216. package/dist/src/plugins/form-filling-plugin/components/single-fill-part.d.ts +4 -0
  217. package/dist/src/plugins/form-filling-plugin/components/single-fill-part.d.ts.map +1 -0
  218. package/dist/src/plugins/form-filling-plugin/const.d.ts +615 -0
  219. package/dist/src/plugins/form-filling-plugin/const.d.ts.map +1 -0
  220. package/dist/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts +3 -0
  221. package/dist/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts.map +1 -0
  222. package/dist/src/plugins/form-filling-plugin/hooks/use-fields-data.d.ts +4 -0
  223. package/dist/src/plugins/form-filling-plugin/hooks/use-fields-data.d.ts.map +1 -0
  224. package/dist/src/plugins/form-filling-plugin/index.d.ts +22 -0
  225. package/dist/src/plugins/form-filling-plugin/index.d.ts.map +1 -0
  226. package/dist/src/plugins/form-filling-plugin/types.d.ts +22 -0
  227. package/dist/src/plugins/form-filling-plugin/types.d.ts.map +1 -0
  228. package/dist/src/plugins/form-filling-plugin/utils.d.ts +6 -0
  229. package/dist/src/plugins/form-filling-plugin/utils.d.ts.map +1 -0
  230. package/dist/src/plugins/report-query-plugin/components/avatar.d.ts +5 -0
  231. package/dist/src/plugins/report-query-plugin/components/avatar.d.ts.map +1 -0
  232. package/dist/src/plugins/report-query-plugin/components/query-entry-btn.d.ts +3 -0
  233. package/dist/src/plugins/report-query-plugin/components/query-entry-btn.d.ts.map +1 -0
  234. package/dist/src/plugins/report-query-plugin/components/query-msg-part.d.ts +3 -0
  235. package/dist/src/plugins/report-query-plugin/components/query-msg-part.d.ts.map +1 -0
  236. package/dist/src/plugins/report-query-plugin/components/query-opening-lines.d.ts +2 -0
  237. package/dist/src/plugins/report-query-plugin/components/query-opening-lines.d.ts.map +1 -0
  238. package/dist/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts +7 -0
  239. package/dist/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts.map +1 -0
  240. package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts +5 -0
  241. package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts.map +1 -0
  242. package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts +18 -0
  243. package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts.map +1 -0
  244. package/dist/src/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts +4 -0
  245. package/dist/src/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts.map +1 -0
  246. package/dist/src/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts +8 -0
  247. package/dist/src/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts.map +1 -0
  248. package/dist/src/plugins/report-query-plugin/const.d.ts +5 -0
  249. package/dist/src/plugins/report-query-plugin/const.d.ts.map +1 -0
  250. package/dist/src/plugins/report-query-plugin/index.d.ts +19 -0
  251. package/dist/src/plugins/report-query-plugin/index.d.ts.map +1 -0
  252. package/dist/src/plugins/report-query-plugin/types.d.ts +18 -0
  253. package/dist/src/plugins/report-query-plugin/types.d.ts.map +1 -0
  254. package/dist/src/plugins/report-query-plugin/utils/build-dash-component.d.ts +17 -0
  255. package/dist/src/plugins/report-query-plugin/utils/build-dash-component.d.ts.map +1 -0
  256. package/dist/src/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts +30 -0
  257. package/dist/src/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts.map +1 -0
  258. package/dist/src/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts +60 -0
  259. package/dist/src/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts.map +1 -0
  260. package/dist/src/plugins/report-query-plugin/utils/field-enhance.d.ts +31 -0
  261. package/dist/src/plugins/report-query-plugin/utils/field-enhance.d.ts.map +1 -0
  262. package/dist/src/plugins/report-query-plugin/utils/get-field-group.d.ts +208 -0
  263. package/dist/src/plugins/report-query-plugin/utils/get-field-group.d.ts.map +1 -0
  264. package/dist/src/plugins/report-query-plugin/utils/get-field-icon.d.ts +4 -0
  265. package/dist/src/plugins/report-query-plugin/utils/get-field-icon.d.ts.map +1 -0
  266. package/dist/src/plugins/report-query-plugin/utils/get-group-rule.d.ts +4 -0
  267. package/dist/src/plugins/report-query-plugin/utils/get-group-rule.d.ts.map +1 -0
  268. package/dist/src/plugins/report-query-plugin/utils/index.d.ts +5 -0
  269. package/dist/src/plugins/report-query-plugin/utils/index.d.ts.map +1 -0
  270. package/dist/src/sdk.impl.d.ts +44 -0
  271. package/dist/src/sdk.impl.d.ts.map +1 -0
  272. package/dist/src/store/context.d.ts +12 -0
  273. package/dist/src/store/context.d.ts.map +1 -0
  274. package/dist/src/store/index.d.ts +14 -0
  275. package/dist/src/store/index.d.ts.map +1 -0
  276. package/dist/src/stories/FormulaField.stories.d.ts +24 -0
  277. package/dist/src/stories/FormulaField.stories.d.ts.map +1 -0
  278. package/package.json +5 -4
  279. package/src/components/biz-comp/FakeBotMsg.tsx +1 -1
  280. package/src/components/biz-comp/FieldChecker.tsx +2 -2
  281. package/src/components/biz-comp/FieldCheckerListMsg.tsx +3 -3
  282. package/src/components/biz-comp/FieldValueChecker.tsx +1 -1
  283. package/src/components/biz-comp/SubformFieldsValueChecker.tsx +1 -1
  284. package/src/components/biz-comp/chat-client.tsx +3 -3
  285. package/src/components/biz-comp/conversation.tsx +1 -1
  286. package/src/components/biz-comp/dash-widget-icon.tsx +1 -1
  287. package/src/components/biz-comp/field-icon.tsx +2 -2
  288. package/src/components/biz-comp/markdown-part.tsx +3 -3
  289. package/src/components/biz-comp/message-content.tsx +1 -1
  290. package/src/components/biz-comp/messages.tsx +5 -2
  291. package/src/components/biz-comp/multi-modal-input/clear-btn.tsx +2 -2
  292. package/src/components/biz-comp/multi-modal-input/index.tsx +4 -4
  293. package/src/components/biz-comp/multi-modal-input/prompt-input.tsx +2 -2
  294. package/src/components/biz-comp/multi-modal-input/voice-btn.tsx +2 -2
  295. package/src/components/biz-comp/preview-message-wrapper.tsx +14 -7
  296. package/src/components/biz-comp/preview-message.tsx +5 -5
  297. package/src/components/biz-comp/suggestions.tsx +2 -2
  298. package/src/components/web-comp/fields-previewer-web-component.ts +1 -1
  299. package/src/const/ui.ts +1 -1
  300. package/src/hooks/use-streaming-anchor.ts +42 -0
  301. package/src/plugins/form-builder-plugin/components/create-form-confirm.tsx +4 -4
  302. package/src/plugins/form-builder-plugin/components/design-info.tsx +3 -3
  303. package/src/plugins/form-builder-plugin/components/entry-btn.tsx +3 -3
  304. package/src/plugins/form-builder-plugin/components/fields-part.tsx +2 -2
  305. package/src/plugins/form-builder-plugin/components/follow-up.tsx +2 -2
  306. package/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.tsx +1 -1
  307. package/src/plugins/form-filling-plugin/components/avatar.tsx +2 -2
  308. package/src/plugins/form-filling-plugin/components/batch-generator-action.tsx +1 -1
  309. package/src/plugins/form-filling-plugin/components/entry-btn.tsx +3 -3
  310. package/src/plugins/form-filling-plugin/components/first-batch-generating-animation.tsx +2 -2
  311. package/src/plugins/form-filling-plugin/components/generated-data-counter.tsx +1 -1
  312. package/src/plugins/form-filling-plugin/components/mode-select.tsx +1 -1
  313. package/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.tsx +3 -3
  314. package/src/plugins/form-filling-plugin/components/single-fill-part.tsx +1 -1
  315. package/src/plugins/report-query-plugin/components/avatar.tsx +2 -2
  316. package/src/plugins/report-query-plugin/components/query-entry-btn.tsx +2 -2
  317. package/src/plugins/report-query-plugin/components/query-opening-lines.tsx +1 -1
  318. package/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.tsx +1 -1
  319. package/src/plugins/report-query-plugin/components/result-cards/DataTableCard.tsx +3 -3
  320. package/src/plugins/report-query-plugin/components/result-cards/DataTableFields.tsx +3 -3
  321. package/src/plugins/report-query-plugin/components/result-cards/FormulaField.tsx +2 -2
  322. package/src/plugins/report-query-plugin/const.ts +1 -1
  323. package/src/style.css +2 -0
  324. package/tsconfig.json +5 -5
  325. package/src/components/bs-ui/abs-fullscreen-gradient-bg.tsx +0 -35
  326. package/src/components/bs-ui/attachment-part-group.tsx +0 -35
  327. package/src/components/bs-ui/attachment-part.tsx +0 -179
  328. package/src/components/bs-ui/attachments-previewer.tsx +0 -324
  329. package/src/components/bs-ui/base-button.tsx +0 -49
  330. package/src/components/bs-ui/border-animation.tsx +0 -107
  331. package/src/components/bs-ui/border-color-animation.tsx +0 -66
  332. package/src/components/bs-ui/bot-avatar-name.tsx +0 -25
  333. package/src/components/bs-ui/bot-icon.tsx +0 -23
  334. package/src/components/bs-ui/bs-icons.tsx +0 -1115
  335. package/src/components/bs-ui/card-field.tsx +0 -23
  336. package/src/components/bs-ui/card.tsx +0 -36
  337. package/src/components/bs-ui/chat-area-header.tsx +0 -65
  338. package/src/components/bs-ui/circle-checker.tsx +0 -66
  339. package/src/components/bs-ui/collapsible-txt-msg.tsx +0 -63
  340. package/src/components/bs-ui/confirm-dialog.tsx +0 -139
  341. package/src/components/bs-ui/fields-design-info-table.tsx +0 -160
  342. package/src/components/bs-ui/fields-generating-indicator.tsx +0 -95
  343. package/src/components/bs-ui/fields-portal.tsx +0 -18
  344. package/src/components/bs-ui/fields-previewer.tsx +0 -210
  345. package/src/components/bs-ui/font-icon.tsx +0 -17
  346. package/src/components/bs-ui/form-info-editor.tsx +0 -259
  347. package/src/components/bs-ui/formula-tag.tsx +0 -32
  348. package/src/components/bs-ui/generate-animation.tsx +0 -56
  349. package/src/components/bs-ui/icon-btn.tsx +0 -43
  350. package/src/components/bs-ui/img-part.tsx +0 -27
  351. package/src/components/bs-ui/line-checker.tsx +0 -160
  352. package/src/components/bs-ui/linear-gradient-border-btn.tsx +0 -48
  353. package/src/components/bs-ui/linear-gradient-color-bg-animation.tsx +0 -103
  354. package/src/components/bs-ui/number-part.tsx +0 -46
  355. package/src/components/bs-ui/option-item.tsx +0 -28
  356. package/src/components/bs-ui/previewer-header.tsx +0 -233
  357. package/src/components/bs-ui/primary-confirm-btn.tsx +0 -58
  358. package/src/components/bs-ui/primary-entry-btn.tsx +0 -48
  359. package/src/components/bs-ui/scroll-to-bottom-btn.tsx +0 -28
  360. package/src/components/bs-ui/split-line.tsx +0 -9
  361. package/src/components/bs-ui/square-checker.tsx +0 -87
  362. package/src/components/bs-ui/tab-radio-group.tsx +0 -82
  363. package/src/components/bs-ui/tooltip.tsx +0 -53
  364. package/src/components/bs-ui/user-txt-msg-bubble.tsx +0 -19
  365. package/src/components/bs-ui/warning-msg.tsx +0 -27
  366. package/src/stories/AbsFullscreenGradientBg.stories.tsx +0 -36
  367. package/src/stories/AttachmentPart.stories.tsx +0 -122
  368. package/src/stories/AttachmentPartGroup.stories.tsx +0 -151
  369. package/src/stories/AttachmentsPreviewer.stories.tsx +0 -306
  370. package/src/stories/BaseButton.stories.tsx +0 -33
  371. package/src/stories/BorderAnimation.stories.tsx +0 -116
  372. package/src/stories/BorderColorAnimation.stories.tsx +0 -63
  373. package/src/stories/BotAvatarAndName.stories.ts +0 -24
  374. package/src/stories/BotIcon.stories.ts +0 -22
  375. package/src/stories/BsTooltip.stories.tsx +0 -32
  376. package/src/stories/Card.stories.tsx +0 -28
  377. package/src/stories/CardField.stories.tsx +0 -87
  378. package/src/stories/ChatAreaHeader.stories.ts +0 -26
  379. package/src/stories/CircleChecker.stories.tsx +0 -89
  380. package/src/stories/CollapsibleTextMsg.stories.ts +0 -44
  381. package/src/stories/ConfirmDialog.stories.tsx +0 -123
  382. package/src/stories/DashWidgetIcon.stories.tsx +0 -132
  383. package/src/stories/FormInfoEditor.stories.tsx +0 -173
  384. package/src/stories/FormulaTag.stories.tsx +0 -68
  385. package/src/stories/GenerateAnimation.stories.ts +0 -20
  386. package/src/stories/IconBtn.stories.tsx +0 -32
  387. package/src/stories/IconLib.tsx +0 -45
  388. package/src/stories/Icons.stories.ts +0 -22
  389. package/src/stories/ImgMsgPart.stories.tsx +0 -42
  390. package/src/stories/LineChecker.stories.tsx +0 -134
  391. package/src/stories/LinearGradientBorderBtn.stories.tsx +0 -86
  392. package/src/stories/LinearGradientColorBgAnimation.stories.tsx +0 -60
  393. package/src/stories/NumbersMsgPart.stories.tsx +0 -42
  394. package/src/stories/OptionItem.stories.tsx +0 -77
  395. package/src/stories/PreviewerHeader.stories.tsx +0 -91
  396. package/src/stories/PrimaryConfirmBtn.stories.tsx +0 -60
  397. package/src/stories/PrimaryEntryBtn.stories.tsx +0 -74
  398. package/src/stories/ScrollToBottom.stories.tsx +0 -24
  399. package/src/stories/SplitLine.stories.tsx +0 -40
  400. package/src/stories/SquareChecker.stories.tsx +0 -96
  401. package/src/stories/TabRadioGroup.stories.tsx +0 -84
  402. package/src/stories/UserTextMsgBubble.stories.ts +0 -24
  403. package/src/stories/WarningMessage.stories.tsx +0 -23
  404. package/src/stories/assets/accessibility.png +0 -0
  405. package/src/stories/assets/accessibility.svg +0 -1
  406. package/src/stories/assets/addon-library.png +0 -0
  407. package/src/stories/assets/assets.png +0 -0
  408. package/src/stories/assets/avif-test-image.avif +0 -0
  409. package/src/stories/assets/context.png +0 -0
  410. package/src/stories/assets/demo.css +0 -539
  411. package/src/stories/assets/demo_index.html +0 -7988
  412. package/src/stories/assets/discord.svg +0 -1
  413. package/src/stories/assets/docs.png +0 -0
  414. package/src/stories/assets/figma-plugin.png +0 -0
  415. package/src/stories/assets/github.svg +0 -1
  416. package/src/stories/assets/iconfont.css +0 -1377
  417. package/src/stories/assets/iconfont.eot +0 -0
  418. package/src/stories/assets/iconfont.json +0 -2382
  419. package/src/stories/assets/iconfont.svg +0 -697
  420. package/src/stories/assets/iconfont.ttf +0 -0
  421. package/src/stories/assets/iconfont.woff +0 -0
  422. package/src/stories/assets/iconfont.woff2 +0 -0
  423. package/src/stories/assets/share.png +0 -0
  424. package/src/stories/assets/styling.png +0 -0
  425. package/src/stories/assets/testing.png +0 -0
  426. package/src/stories/assets/theming.png +0 -0
  427. package/src/stories/assets/tutorials.svg +0 -1
  428. package/src/stories/assets/youtube.svg +0 -1
  429. package/src/stories/fields-design-info-table.stories.tsx +0 -203
  430. package/src/stories/fields-generating.stories.tsx +0 -41
  431. package/src/stories/fields-previewer.stories.tsx +0 -77
@@ -1,23 +0,0 @@
1
- import { cn } from '@/lib/utils';
2
- import { ReactNode } from 'react';
3
-
4
- export interface CardFieldProps {
5
- label: string;
6
- children?: ReactNode;
7
- className?: string;
8
- }
9
-
10
- export const CardField = ({ label, children, className }: CardFieldProps) => {
11
- return (
12
- <div className={cn('flex gap-2 items-start w-full', className)}>
13
- <div className="w-[100px] shrink-0 text-[#666] text-sm leading-normal truncate">{label}</div>
14
- <div className="flex-1 min-w-0 text-sm leading-normal whitespace-pre-wrap break-words">
15
- {children ?? <span className="text-[#666]">无</span>}
16
- </div>
17
- </div>
18
- );
19
- };
20
-
21
- export const CardFieldsWrapper = ({ children }: { children: ReactNode }) => {
22
- return <div className="flex flex-col gap-[10px] w-full">{children}</div>;
23
- };
@@ -1,36 +0,0 @@
1
- import { transCls } from '@/const/ui';
2
- import { cn } from '@/lib/utils';
3
- import { ReactNode } from 'react';
4
-
5
- export interface CardProps {
6
- title: string;
7
- desc?: string;
8
- index?: number;
9
- icon?: ReactNode;
10
- iconCode?: string;
11
- onClick?: (title: string, iconCode?: string) => void;
12
- }
13
-
14
- export const Card = ({ title, desc, index, icon, onClick, iconCode }: CardProps) => {
15
- return (
16
- <div
17
- className={cn(
18
- 'bs-card group flex flex-col cursor-pointer p-2.5 gap-2.5 rounded-lg bg-[#F5F7FA] max-w-[350px] border border-transparent hover:border-[#e0e0e0] hover:bg-white',
19
- {
20
- transCls,
21
- }
22
- )}
23
- onClick={() => {
24
- onClick?.(title, iconCode);
25
- }}
26
- >
27
- <div className="px-2.5 flex items-center gap-1.5 rounded-[4px] h-[34px] bg-white">
28
- {index === undefined ? null : <div>{index}</div>}
29
- {icon === undefined ? null : <div className="text-[#0265FF]">{icon}</div>}
30
- {/* make title text ellipsis */}
31
- <div className="truncate !text-[#12111] group-hover:text-[#0265FF]">{title}</div>
32
- </div>
33
- <div className="text-[#666] leading-5 text-[12px]">{desc}</div>
34
- </div>
35
- );
36
- };
@@ -1,65 +0,0 @@
1
- import { cn } from '@/lib/utils';
2
- import { ChatHeaderBgImgUrl } from '@/const/ui';
3
- import { IconBtn } from './icon-btn';
4
- import { CloseIcon, DockIcon, FloatIcon } from './bs-icons';
5
-
6
- export interface ChatAreaHeaderProps {
7
- title?: string;
8
- width?: number;
9
- onDockClick?: () => void;
10
- onCloseClick?: () => void;
11
- avatar?: React.ReactNode;
12
- draggable?: boolean;
13
- isDragging?: boolean;
14
- isDocked?: boolean;
15
- onDragStart?: (e: React.MouseEvent) => void;
16
- }
17
-
18
- export const ChatAreaHeader = ({
19
- avatar,
20
- width,
21
- onDockClick,
22
- onCloseClick,
23
- draggable,
24
- isDragging,
25
- isDocked,
26
- onDragStart,
27
- }: ChatAreaHeaderProps) => {
28
- return (
29
- <div
30
- className={cn('flex items-center justify-between', 'px-4', 'h-[52px] min-w-[200px]', {
31
- 'w-full': !width,
32
- [`w-[${width}px]`]: width,
33
- 'cursor-grab': draggable && !isDragging,
34
- 'cursor-grabbing': isDragging,
35
- })}
36
- style={{
37
- backgroundImage: ChatHeaderBgImgUrl,
38
- backgroundSize: 'cover',
39
- backgroundRepeat: 'no-repeat',
40
- }}
41
- onMouseDown={draggable ? onDragStart : undefined}
42
- >
43
- {avatar}
44
-
45
- <div className="actions flex items-center gap-2.5 text-[#666]">
46
- <IconBtn
47
- onMouseDown={(e) => {
48
- // 阻止事件冒泡,避免触发拖拽
49
- e.stopPropagation();
50
- }}
51
- tooltip={isDocked ? '悬浮' : '右侧打开'}
52
- // className="hover:!bg-[#ffffff]"
53
- icon={isDocked ? <FloatIcon /> : <DockIcon />}
54
- onClick={onDockClick}
55
- />
56
- <IconBtn
57
- // tooltip="关闭"
58
- // className="hover:!bg-[#ffffff]"
59
- icon={<CloseIcon />}
60
- onClick={onCloseClick}
61
- />
62
- </div>
63
- </div>
64
- );
65
- };
@@ -1,66 +0,0 @@
1
- import { useState } from 'react';
2
- import { cn } from '@/lib/utils';
3
- import { CheckerInBoxIcon } from './bs-icons';
4
-
5
- export interface CircleCheckerProps {
6
- defaultChecked?: boolean;
7
- checked?: boolean;
8
- onCheckedChange?: (checked: boolean) => void;
9
- children?: React.ReactNode;
10
- disabled?: boolean;
11
- className?: string;
12
- }
13
-
14
- export const CircleChecker = ({
15
- defaultChecked = false,
16
- checked: controlledChecked,
17
- onCheckedChange,
18
- children,
19
- disabled = false,
20
- className,
21
- }: CircleCheckerProps) => {
22
- const [internalChecked, setInternalChecked] = useState(defaultChecked);
23
-
24
- const isControlled = controlledChecked !== undefined;
25
- const isChecked = isControlled ? controlledChecked : internalChecked;
26
-
27
- const handleClick = () => {
28
- if (disabled) return;
29
-
30
- const newChecked = !isChecked;
31
- if (!isControlled) {
32
- setInternalChecked(newChecked);
33
- }
34
- onCheckedChange?.(newChecked);
35
- };
36
-
37
- return (
38
- <button
39
- type="button"
40
- role="checkbox"
41
- aria-checked={isChecked}
42
- disabled={disabled}
43
- onClick={handleClick}
44
- className={cn(
45
- 'inline-flex items-center gap-[6px] cursor-pointer select-none',
46
- 'text-[#121111] text-[14px]',
47
- disabled && 'cursor-not-allowed opacity-50',
48
- className
49
- )}
50
- >
51
- <span
52
- className={cn(
53
- 'inline-flex items-center justify-center w-4 h-4 rounded-full transition-colors duration-200 box-border border',
54
- isChecked ? 'bg-[#2E60FF] border-transparent' : 'bg-white border-[#e0e0e0]'
55
- )}
56
- >
57
- {isChecked && (
58
- <span className="text-white">
59
- <CheckerInBoxIcon />
60
- </span>
61
- )}
62
- </span>
63
- {children && <span className="text-sm">{children}</span>}
64
- </button>
65
- );
66
- };
@@ -1,63 +0,0 @@
1
- import { ReactNode, useState } from 'react';
2
- import { cn } from '@/lib/utils';
3
- import { transCls } from '@/const/ui';
4
- import { AnalysisIcon, ChevronIcon } from './bs-icons';
5
-
6
- export interface CollapsibleTxtMsgProps {
7
- title: string;
8
- content?: string;
9
- icon?: ReactNode;
10
- defaultOpen?: boolean;
11
- children?: ReactNode;
12
-
13
- disableExpand?: boolean;
14
- }
15
-
16
- export const CollapsibleTxtMsg = ({
17
- title,
18
- content,
19
- icon,
20
- disableExpand,
21
- children,
22
- defaultOpen,
23
- }: CollapsibleTxtMsgProps) => {
24
- const [isOpen, setIsOpen] = useState(defaultOpen);
25
-
26
- return (
27
- <div className="bg-[#fafafa] border border-[#e0e0e0] border-solid flex flex-col gap-2.5 p-2.5 rounded-[10px] w-full">
28
- <div
29
- className={cn('flex items-center justify-between w-full', {
30
- 'cursor-pointer': !disableExpand,
31
- })}
32
- onClick={() => {
33
- if (disableExpand) return;
34
-
35
- setIsOpen(!isOpen);
36
- }}
37
- >
38
- <div className="flex gap-[10px] items-center">
39
- <div className="w-4 h-4 shrink-0 flex items-center">{icon || <AnalysisIcon />}</div>
40
- <p className="text-[#666] text-[14px] leading-normal">{title}</p>
41
- </div>
42
- <button
43
- onClick={() => {
44
- if (disableExpand) return;
45
- setIsOpen(!isOpen);
46
- }}
47
- className={cn(
48
- 'flex items-center justify-center w-5 h-5 rounded-[4px] cursor-pointer hover:bg-[#EFF0F6]',
49
- transCls,
50
- {
51
- 'pointer-events-none opacity-0': disableExpand,
52
- }
53
- )}
54
- >
55
- <ChevronIcon isOpen={isOpen} />
56
- </button>
57
- </div>
58
- {isOpen && !disableExpand && (
59
- <div className="text-[#121111] text-[14px] word-wrap">{content || children}</div>
60
- )}
61
- </div>
62
- );
63
- };
@@ -1,139 +0,0 @@
1
- import {
2
- Dialog,
3
- DialogContent,
4
- DialogDescription,
5
- DialogFooter,
6
- DialogHeader,
7
- DialogTitle,
8
- } from '@/components/ui/dialog';
9
- import { QuestionIcon } from './bs-icons';
10
- import { cn } from '@/lib/utils';
11
- import { BaseButton } from './base-button';
12
-
13
- export interface ConfirmDialogProps {
14
- open?: boolean;
15
- onOpenChange?: (open: boolean) => void;
16
- title: string;
17
- description?: string;
18
- /** Text for the left link button */
19
- linkText?: string;
20
- /** Callback when link button is clicked */
21
- onLinkClick?: () => void;
22
- /** Text for the cancel button */
23
- cancelText?: string;
24
- /** Callback when cancel button is clicked */
25
- onCancel?: () => void;
26
- /** Text for the confirm button */
27
- confirmText?: string;
28
- /** Callback when confirm button is clicked */
29
- onConfirm?: () => void;
30
- /** Whether to show the link button */
31
- showLink?: boolean;
32
- /** Whether to show the cancel button */
33
- showCancel?: boolean;
34
- /** Container element for the dialog portal */
35
- container?: HTMLElement;
36
- }
37
-
38
- export function ConfirmDialog({
39
- open,
40
- onOpenChange,
41
- title,
42
- description,
43
- linkText = '留在此页',
44
- onLinkClick,
45
- cancelText = '不保存',
46
- onCancel,
47
- confirmText = '保存并继续',
48
- onConfirm,
49
- container,
50
- showLink = true,
51
- showCancel = true,
52
- }: ConfirmDialogProps) {
53
- const btnStyle = {
54
- borderRadius: 4,
55
- padding: '6px 20px',
56
- };
57
-
58
- return (
59
- <Dialog open={open} onOpenChange={onOpenChange}>
60
- <DialogContent
61
- container={container}
62
- className={cn(
63
- 'w-[480px] max-w-[480px] p-0 gap-0 rounded-[10px] border-none',
64
- 'shadow-[0px_0px_10px_0px_rgba(0,0,0,0.04)]',
65
- '[&>button]:hidden'
66
- )}
67
- >
68
- <DialogHeader className="flex flex-row items-start gap-[10px] p-9 pb-0">
69
- <div className="size-[30px] shrink-0 text-[#0265FF]">
70
- <QuestionIcon />
71
- </div>
72
- <div className="flex flex-col gap-2">
73
- <DialogTitle className="text-[16px] font-[700] text-[#030303] leading-normal">
74
- {title}
75
- </DialogTitle>
76
- {description && (
77
- <DialogDescription className="text-[14px] text-[#666] leading-normal">
78
- {description}
79
- </DialogDescription>
80
- )}
81
- </div>
82
- </DialogHeader>
83
-
84
- <DialogFooter className="flex flex-row items-center !justify-between p-9 pt-6">
85
- {showLink ? (
86
- <button
87
- type="button"
88
- className="text-[14px] text-[#0265ff] hover:text-[#0265ff]/80 bg-transparent border-none cursor-pointer"
89
- onClick={onLinkClick || (() => {
90
- console.log('Link clicked');
91
-
92
- onOpenChange?.(false);
93
- })}
94
- >
95
- {linkText}
96
- </button>
97
- ) : (
98
- <div />
99
- )}
100
-
101
- <div className="flex items-center gap-3">
102
- {showCancel && (
103
- <BaseButton
104
- className="hover:text-[#121111]"
105
- onClick={onCancel}
106
- >
107
- {cancelText}
108
- </BaseButton>
109
- // <button
110
- // type="button"
111
- // onClick={onCancel}
112
- // style={btnStyle}
113
- // className={cn(
114
- // 'h-8 px-5 py-1.5 rounded border border-[#e0e0e0]',
115
- // 'text-[14px] text-[#030303] bg-white',
116
- // 'hover:bg-gray-50 cursor-pointer'
117
- // )}
118
- // >
119
- // {cancelText}
120
- // </button>
121
- )}
122
- <button
123
- type="button"
124
- onClick={onConfirm}
125
- style={btnStyle}
126
- className={cn(
127
- // 'h-8 px-5 py-1.5 rounded',
128
- 'text-[14px] text-white bg-[#0265ff]',
129
- 'hover:bg-[#0265ff]/80 cursor-pointer border-none'
130
- )}
131
- >
132
- {confirmText}
133
- </button>
134
- </div>
135
- </DialogFooter>
136
- </DialogContent>
137
- </Dialog>
138
- );
139
- }
@@ -1,160 +0,0 @@
1
- import { useState, useCallback, useMemo } from 'react';
2
- import { IFieldDesignInfo } from '@baishuyun/types';
3
- import { cn } from '@/lib/utils';
4
- import { ChevronIcon } from './bs-icons';
5
-
6
- interface FieldsDesignInfoTableProps {
7
- fields: IFieldDesignInfo[];
8
- }
9
-
10
- /** Group fields into top-level items and subform groups */
11
- function groupFields(fields: IFieldDesignInfo[]) {
12
- const groups: Array<
13
- | { kind: 'field'; field: IFieldDesignInfo }
14
- | { kind: 'subform'; parent: IFieldDesignInfo; children: IFieldDesignInfo[] }
15
- > = [];
16
-
17
- let i = 0;
18
- while (i < fields.length) {
19
- const f = fields[i];
20
- if (f.isSubForm) {
21
- const children: IFieldDesignInfo[] = [];
22
- let j = i + 1;
23
- while (
24
- j < fields.length &&
25
- fields[j].isFieldInSubForm &&
26
- fields[j].parentFormName === f.fieldName
27
- ) {
28
- children.push(fields[j]);
29
- j++;
30
- }
31
- groups.push({ kind: 'subform', parent: f, children });
32
- i = j;
33
- } else {
34
- groups.push({ kind: 'field', field: f });
35
- i++;
36
- }
37
- }
38
- return groups;
39
- }
40
-
41
- const cellCls = 'flex items-center px-1.5 py-2.5 text-xs leading-normal';
42
-
43
- function FieldRow({
44
- field,
45
- isSubFormChild = false,
46
- }: {
47
- field: IFieldDesignInfo;
48
- isSubFormChild?: boolean;
49
- }) {
50
- return (
51
- <div className="flex items-center w-full">
52
- {/* 名称 */}
53
- <div className={cn(cellCls, 'w-20 shrink-0 min-h-[34px]')}>
54
- {isSubFormChild && (
55
- <span className="inline-flex items-center justify-center shrink-0 w-5 h-5 opacity-0">
56
- <ChevronIcon />
57
- </span>
58
- )}
59
- <span>{field.fieldName}</span>
60
- </div>
61
- {/* 类型 */}
62
- <div className={cn(cellCls, 'w-[72px] shrink-0 min-h-[34px]')}>
63
- {field.type}
64
- </div>
65
- {/* 必填 */}
66
- <div className={cn(cellCls, 'w-9 shrink-0 min-h-[34px]')}>
67
- {field.required ? '是' : '否'}
68
- </div>
69
- {/* 说明 */}
70
- <div className={cn(cellCls, 'flex-1 min-w-0 min-h-[34px]')}>
71
- <span className="break-words min-w-0">{field.description}</span>
72
- </div>
73
- </div>
74
- );
75
- }
76
-
77
- function SubFormGroup({
78
- parent,
79
- children,
80
- }: {
81
- parent: IFieldDesignInfo;
82
- children: IFieldDesignInfo[];
83
- }) {
84
- const [isOpen, setIsOpen] = useState(true);
85
- const toggle = useCallback(() => setIsOpen((v) => !v), []);
86
-
87
- return (
88
- <>
89
- {/* 子表单 parent row */}
90
- <div className="flex items-center w-full">
91
- {/* 名称 */}
92
- <div className={cn(cellCls, 'w-20 shrink-0 min-h-[34px]')}>
93
- <button
94
- type="button"
95
- onClick={toggle}
96
- className="inline-flex items-center justify-center shrink-0 w-5 h-5 rounded cursor-pointer text-[#666] relative -left-[2px]"
97
- >
98
- <ChevronIcon isOpen={isOpen} />
99
- </button>
100
- <span>{parent.fieldName}</span>
101
- </div>
102
- {/* 类型 */}
103
- <div className={cn(cellCls, 'w-[72px] shrink-0 min-h-[34px] ')}>
104
- {parent.type}
105
- </div>
106
- {/* 必填 */}
107
- <div className={cn(cellCls, 'w-9 shrink-0 min-h-[34px]')}>
108
- {parent.required ? '是' : '否'}
109
- </div>
110
- {/* 说明 */}
111
- <div className={cn(cellCls, 'flex-1 min-w-0 min-h-[34px]')}>
112
- <span className="break-words min-w-0">{parent.description}</span>
113
- </div>
114
- </div>
115
-
116
- {/* 子表单 children */}
117
- {isOpen && children.map((child, idx) => <FieldRow key={idx} field={child} isSubFormChild />)}
118
- </>
119
- );
120
- }
121
-
122
- export function FieldsDesignInfoTable({ fields }: FieldsDesignInfoTableProps) {
123
- const groups = useMemo(() => groupFields(fields), [fields]);
124
-
125
- return (
126
- <div className="flex flex-col items-start w-full bg-white rounded-[10px] overflow-hidden text-black my-[10px] border border-[#E0E0E0]">
127
- {/* 表头 */}
128
- <div className="flex items-center w-full shrink-0 bg-[#E5E6EB] rounded-t-[10px] border-b border-[#E0E0E0]">
129
- <div className={cn(cellCls, 'w-20 shrink-0 h-[34px] font-bold')}>
130
- 名称
131
- </div>
132
- <div className={cn(cellCls, 'w-[72px] shrink-0 h-[34px] font-bold')}>
133
- 类型
134
- </div>
135
- <div
136
- className={cn(
137
- cellCls,
138
- 'w-9 shrink-0 h-[34px] font-bold justify-center'
139
- )}
140
- >
141
- 必填
142
- </div>
143
- <div className={cn(cellCls, 'flex-1 min-w-0 h-[34px] font-bold')}>
144
- 说明
145
- </div>
146
- </div>
147
-
148
- {/* 表体 */}
149
- <div className="flex flex-col items-start w-full">
150
- {groups.map((g, idx) =>
151
- g.kind === 'field' ? (
152
- <FieldRow key={idx} field={g.field} />
153
- ) : (
154
- <SubFormGroup key={idx} parent={g.parent} children={g.children} />
155
- )
156
- )}
157
- </div>
158
- </div>
159
- );
160
- }
@@ -1,95 +0,0 @@
1
- import { useEffect, useLayoutEffect, useRef, useState } from 'react';
2
- import { BorderColorAnimation } from './border-color-animation';
3
- import { MagicIcon } from './bs-icons';
4
-
5
- export const DotAnimation = () => {
6
- return (
7
- <>
8
- <div className="flex gap-[2px] flex-shrink-0 relative -left-[4px] top-[3px]">
9
- <div
10
- className="w-[2px] h-[2px] rounded-full bg-[#0265FF] flex-shrink-0"
11
- style={{
12
- animation: 'pulse 1.4s ease-in-out infinite',
13
- animationDelay: '0s',
14
- marginRight: '2px',
15
- }}
16
- />
17
- <div
18
- className="w-[2px] h-[2px] rounded-full bg-[#0265FF] flex-shrink-0"
19
- style={{
20
- animation: 'pulse 1.4s ease-in-out infinite',
21
- animationDelay: '0.2s',
22
- marginRight: '2px',
23
- }}
24
- />
25
- <div
26
- className="w-[2px] h-[2px] rounded-full bg-[#0265FF] flex-shrink-0"
27
- style={{
28
- animation: 'pulse 1.4s ease-in-out infinite',
29
- animationDelay: '0.4s',
30
- }}
31
- />
32
- </div>
33
- <style>{`
34
- @keyframes pulse {
35
- 0%, 60%, 100% {
36
- opacity: 0.3;
37
- transform: scale(1);
38
- }
39
- 30% {
40
- opacity: 1;
41
- transform: scale(1.2);
42
- }
43
- }
44
- `}</style>
45
- </>
46
- );
47
- };
48
-
49
- export const FieldsGeneratingIndicator = ({
50
- children,
51
- loading = true,
52
- }: {
53
- children?: React.ReactNode;
54
- loading?: boolean;
55
- }) => {
56
- const paddingAndGap = 16 * 2 + 6; // padding + gap
57
- const animationWidth = loading ? 14 : 0;
58
- const magicIconWidth = 16;
59
- const textRef = useRef<HTMLSpanElement>(null);
60
- const [textWidth, setWidth] = useState(0);
61
-
62
- // get text width + padding + gap
63
- const fullWidth = textWidth + paddingAndGap + animationWidth + magicIconWidth;
64
-
65
- // when text changes, update width
66
- useLayoutEffect(() => {
67
- if (textRef.current) {
68
- const rect = textRef.current.getBoundingClientRect();
69
- setWidth(rect.width);
70
- }
71
- }, [children]);
72
-
73
- // when text not change, get init width
74
- useEffect(() => {
75
- if (textRef.current) {
76
- const rect = textRef.current.getBoundingClientRect();
77
- console.log('rect.width', rect.width);
78
- setWidth(rect.width);
79
- }
80
- }, []);
81
-
82
- return (
83
- <BorderColorAnimation borderRadius={100} width={fullWidth} height={34} borderWidth={1}>
84
- <div className="flex items-center gap-[6px] h-[31px] ml-[16px]">
85
- <div className="shrink-0">
86
- <MagicIcon />
87
- </div>
88
- <span className="text-[14px] text-[#0265FF] shrink-0" ref={textRef}>
89
- {children || '字段生成中'}
90
- </span>
91
- {loading && <DotAnimation />}
92
- </div>
93
- </BorderColorAnimation>
94
- );
95
- };
@@ -1,18 +0,0 @@
1
- import { useShadow } from '@/hooks/use-shadow';
2
- import { createPortal } from 'react-dom';
3
- import { FieldsPreviewer, FieldsPreviewerProps } from './fields-previewer';
4
- import { ReactPortal } from 'react';
5
-
6
- export interface FieldsPortalProps extends FieldsPreviewerProps {
7
- portalEl: HTMLElement;
8
- children?: React.ReactNode;
9
- }
10
-
11
- export const FieldsPortal = ({ portalEl, children, ...rest }: FieldsPortalProps): ReactPortal => {
12
- const { shadowContainer: shadowEntry } = useShadow({
13
- rootEl: portalEl,
14
- id: 'chat-sdk-fields-portal',
15
- });
16
-
17
- return createPortal(<FieldsPreviewer {...rest}>{children}</FieldsPreviewer>, shadowEntry!);
18
- };