@baishuyun/chat-sdk 0.1.9 → 1.0.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 (431) hide show
  1. package/.turbo/turbo-build.log +8 -107
  2. package/CHANGELOG.md +12 -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,160 +0,0 @@
1
- import React, { CSSProperties, useEffect, useState } from 'react';
2
- import classNames from 'classnames';
3
- import { cn } from '@/lib/utils';
4
- import { CheckerIcon } from './bs-icons';
5
- import { SquareChecker } from './square-checker';
6
-
7
- export interface LineCheckerProps {
8
- defaultChecked?: boolean;
9
- checked?: boolean;
10
- disabled?: boolean;
11
- onCheckedChange?: (checked: boolean) => void;
12
-
13
- icon?: React.ReactNode;
14
- title: string;
15
- shortDesc?: string;
16
- className?: string;
17
- extra?: React.ReactNode;
18
-
19
- style?: CSSProperties;
20
- streaming?: boolean;
21
- confirmed?: boolean;
22
- readonly?: boolean;
23
- }
24
-
25
- export const LineChecker: React.FC<LineCheckerProps> = ({
26
- defaultChecked = false,
27
- checked: checkedProp,
28
- disabled = false,
29
- onCheckedChange,
30
- icon,
31
- className,
32
- title,
33
- extra,
34
- style,
35
- streaming,
36
- confirmed,
37
- readonly,
38
- shortDesc,
39
- }) => {
40
- const [checked, setChecked] = useState(defaultChecked);
41
-
42
- useEffect(() => {
43
- if (checkedProp !== undefined) {
44
- setChecked(checkedProp);
45
- }
46
- }, [checkedProp]);
47
-
48
- const handleClick = () => {
49
- if (streaming || disabled) return;
50
-
51
- const newChecked = !checked;
52
- setChecked(newChecked);
53
- onCheckedChange?.(newChecked);
54
- };
55
-
56
- const hasExtra = Boolean(extra);
57
-
58
- const checker =
59
- confirmed && checked ? (
60
- <CheckerIcon className="grow-0 shrink-0 text-[#0265ff]" />
61
- ) : (
62
- <SquareChecker
63
- className={classNames('outline-none grow-0 shrink-0 cursor-pointer', {
64
- 'mt-[2px]': hasExtra,
65
- 'opacity-80 cursor-not-allowed': disabled,
66
- 'opacity-50': streaming,
67
- 'pointer-events-none': streaming,
68
- })}
69
- id={title}
70
- checked={checked}
71
- disabled={disabled || confirmed}
72
- onCheckedChange={handleClick}
73
- />
74
- );
75
-
76
- return (
77
- <div
78
- className={cn(
79
- 'flex items-center gap-[10px] px-4 py-[10px] rounded-[4px]',
80
- 'w-full transition-colors cursor-pointer',
81
- {
82
- 'cursor-not-allowed': disabled,
83
- 'hover:bg-[#EFF0F6]': !disabled,
84
- 'items-start': hasExtra,
85
- 'items-center': !hasExtra,
86
- 'pointer-events-none': streaming || disabled || readonly || confirmed,
87
- },
88
- className
89
- )}
90
- style={style}
91
- onClick={() => {
92
- handleClick();
93
- }}
94
- >
95
- {readonly ? null : checker}
96
-
97
- <div
98
- className={classNames('flex flex-col flex-1 min-w-0', {
99
- 'gap-2.5': hasExtra,
100
- })}
101
- >
102
- <div
103
- className={classNames('flex items-center justify-between w-full', {
104
- 'gap-1.5': !!icon,
105
- 'gap-2.5': !icon,
106
- })}
107
- >
108
- <div
109
- className={classNames('flex items-center gap-[6px] min-w-0', {
110
- 'flex-1': !!icon,
111
- 'w-[100px] flex-shrink-0': !icon,
112
- })}
113
- >
114
- {/* Icon */}
115
- {icon && (
116
- <div className="w-4 h-4 flex-shrink-0 text-[#6F829E] leading-[16px]">{icon}</div>
117
- )}
118
-
119
- {/* Title - truncates */}
120
- <p
121
- className={classNames(' min-w-0 text-sm text-[#121111] truncate text-[12px]', {
122
- 'flex-1': !!icon,
123
- 'flex-grow-1 flex-shrink-0': !icon,
124
- '!text-[#666]': readonly,
125
- })}
126
- >
127
- {title}
128
- </p>
129
- </div>
130
-
131
- {shortDesc && (
132
- <p
133
- className={classNames('text-sm text-[#666] text-[12px]', {
134
- 'whitespace-nowrap flex-shrink-0': !!icon,
135
- anywhere: !icon,
136
- '!text-[#121111]': readonly,
137
- })}
138
- >
139
- {shortDesc}
140
- </p>
141
- )}
142
- </div>
143
- {hasExtra ? (
144
- <div
145
- className={cn(
146
- 'overflow-x-auto whitespace-nowrap no-scrollbar flex items-center gap-2',
147
- {
148
- '!overflow-x-hidden': disabled || readonly || confirmed,
149
- }
150
- )}
151
- >
152
- {extra}
153
- </div>
154
- ) : null}
155
- </div>
156
- </div>
157
- );
158
- };
159
-
160
- export default LineChecker;
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import { cn } from '@/lib/utils';
3
-
4
- export interface LinearGradientBorderBtnProps {
5
- children?: React.ReactNode;
6
- onClick?: () => void;
7
- disabled?: boolean;
8
- className?: string;
9
- }
10
-
11
- export const LinearGradientBorderBtn: React.FC<LinearGradientBorderBtnProps> = ({
12
- children,
13
- onClick,
14
- disabled = false,
15
- className,
16
- }) => {
17
- return (
18
- <div
19
- className={cn(
20
- "relative rounded-[6px] p-[1px] cursor-pointer h-[34px] flex items-center justify-center",
21
- "bg-gradient-to-b from-[#84B4FF] to-[#B1FAFF]",
22
- className
23
- )}
24
- style={{
25
- background: 'linear-gradient(180deg, #84B4FF 0%, #B1FAFF 100%)',
26
- }}
27
- >
28
- <button
29
- className={cn(
30
- "w-full h-[32px] px-[10px]",
31
- "bg-white rounded-[5px]",
32
- "flex items-center justify-center",
33
- "text-[#0265ff] text-[14px]",
34
- "cursor-pointer",
35
- "transition-all duration-200",
36
- "hover:bg-[#f5f9ff]",
37
- "disabled:opacity-95 disabled:cursor-not-allowed"
38
- )}
39
- onClick={onClick}
40
- disabled={disabled}
41
- >
42
- {children}
43
- </button>
44
- </div>
45
- );
46
- };
47
-
48
- export default LinearGradientBorderBtn;
@@ -1,103 +0,0 @@
1
- export const LinearGradientColorBgAnimation = ({
2
- children,
3
- width,
4
- height,
5
- style,
6
- childrenContainerStyle,
7
- }: {
8
- children?: React.ReactNode;
9
- width?: string | number;
10
- height?: string | number;
11
- style?: React.CSSProperties;
12
- childrenContainerStyle?: React.CSSProperties;
13
- }) => {
14
- return (
15
- <div
16
- style={{
17
- position: 'relative',
18
- width: width ?? '100%',
19
- height: height ?? '100%',
20
- overflow: 'hidden',
21
- borderRadius: '10px 10px 0 0',
22
- ...style,
23
- }}
24
- >
25
- <div
26
- style={{
27
- position: 'absolute',
28
- width: '100%',
29
- height: '100%',
30
- top: 0,
31
- left: 0,
32
- background: '#F4FFFC',
33
- }}
34
- />
35
- <div
36
- style={{
37
- position: 'absolute',
38
- width: '100%',
39
- height: '100%',
40
- top: 0,
41
- left: 0,
42
- background: 'radial-gradient(circle at 25% -15%, #EEFFCE 0%, transparent 55%)',
43
- filter: 'blur(70px)',
44
- animation: 'floatCircle1 4s ease-in-out infinite',
45
- }}
46
- />
47
- <div
48
- style={{
49
- position: 'absolute',
50
- width: '100%',
51
- height: '100%',
52
- top: 0,
53
- left: 0,
54
- background: 'radial-gradient(circle at 80% 200%, #CEFFFB 0%, transparent 45%)',
55
- filter: 'blur(70px)',
56
- animation: 'floatCircle2 5s ease-in-out infinite 0.5s',
57
- }}
58
- />
59
- <div style={{ position: 'relative', zIndex: 1, width: '100%', height: '100%', ...childrenContainerStyle }}>
60
- {children}
61
- </div>
62
- <style>{`
63
- @keyframes floatCircle1 {
64
- 0%, 100% {
65
- transform: translate(0%, 0%) scale(1.2);
66
- opacity: 1;
67
- }
68
- 25% {
69
- transform: translate(-15%, 20%) scale(1.6);
70
- opacity: 0.95;
71
- }
72
- 50% {
73
- transform: translate(12%, -15%) scale(0.9);
74
- opacity: 1;
75
- }
76
- 75% {
77
- transform: translate(-10%, 10%) scale(1.4);
78
- opacity: 0.9;
79
- }
80
- }
81
-
82
- @keyframes floatCircle2 {
83
- 0%, 100% {
84
- transform: translate(0%, 0%) scale(1.1);
85
- opacity: 1;
86
- }
87
- 30% {
88
- transform: translate(18%, -12%) scale(1.5);
89
- opacity: 1;
90
- }
91
- 60% {
92
- transform: translate(-12%, 15%) scale(0.85);
93
- opacity: 0.95;
94
- }
95
- 85% {
96
- transform: translate(14%, -8%) scale(1.3);
97
- opacity: 0.9;
98
- }
99
- }
100
- `}</style>
101
- </div>
102
- );
103
- };
@@ -1,46 +0,0 @@
1
- import { cn } from '@/lib/utils';
2
- import { XlsxIcon } from './bs-icons';
3
-
4
- export interface NumbersMsgPartProps {
5
- /** File name to display (optional) */
6
- fileName?: string;
7
- className?: string;
8
- /** Size in pixels (width & height), defaults to 102 */
9
- size?: number;
10
- }
11
-
12
- export const NumbersMsgPart = ({ fileName, className, size = 102 }: NumbersMsgPartProps) => {
13
- // Calculate icon size proportionally (52/102 ≈ 51% of container)
14
- const iconScale = size / 102;
15
- const hasFileName = Boolean(fileName);
16
-
17
- return (
18
- <div
19
- className={cn(
20
- 'relative flex flex-col items-center justify-center rounded-[10px] bg-[#EFF0F6] px-[10px]',
21
- hasFileName && 'gap-[6px]',
22
- className
23
- )}
24
- style={{ width: size, height: size }}
25
- >
26
- <div
27
- className="shrink-0"
28
- style={{
29
- transform: iconScale !== 1 ? `scale(${iconScale})` : undefined,
30
- transformOrigin: 'center',
31
- }}
32
- >
33
- <XlsxIcon />
34
- </div>
35
- {hasFileName && (
36
- <p
37
- className="block max-w-full shrink-0 truncate text-center text-[14px] leading-normal text-[#030303]"
38
- style={{ fontSize: 14 * iconScale, maxWidth: '100%', display: 'block' }}
39
- title={fileName}
40
- >
41
- {fileName}
42
- </p>
43
- )}
44
- </div>
45
- );
46
- };
@@ -1,28 +0,0 @@
1
- import { ReactNode } from "react";
2
-
3
- export interface OptionItemProps {
4
- bgColor?: string;
5
- color?: string;
6
- label?: ReactNode;
7
- children?: ReactNode;
8
- }
9
-
10
- export const OptionItem = ({
11
- bgColor = "#E8F4FF",
12
- color = "#0265FF",
13
- label,
14
- children,
15
- }: OptionItemProps
16
- ) => {
17
- return (
18
- <div
19
- className="flex items-center justify-center gap-1.5 px-1.5 h-[26px] rounded-[100px] text-[13px]"
20
- style={{
21
- backgroundColor: bgColor,
22
- color: color,
23
- }}
24
- >
25
- {label || children}
26
- </div>
27
- )
28
- }
@@ -1,233 +0,0 @@
1
- import { useState } from 'react';
2
- import classNames from 'classnames';
3
- import { IconBtn } from './icon-btn';
4
- import { BackIcon, InfoIcon } from './bs-icons';
5
- import { LinearGradientColorBgAnimation } from './linear-gradient-color-bg-animation';
6
- import { ConfirmDialog } from './confirm-dialog';
7
- import { Spinner } from '../ui/spinner';
8
- import { BaseButton } from './base-button';
9
- import { BrushIcon } from './bs-icons';
10
- import { cn } from '@/lib/utils';
11
-
12
- export interface PreviewerHeaderProps {
13
- title: string;
14
- tips?: string;
15
- active?: boolean;
16
- className?: string;
17
- onBackClick?: () => void;
18
- onSave?: (isConfirm?: boolean) => void;
19
- onCancel?: () => void;
20
- onClear?: () => void;
21
- style?: React.CSSProperties;
22
-
23
- confirmTitle?: string;
24
- confirmContent?: string;
25
- dialogContainer?: HTMLElement;
26
- variant?: 'fields-previewer' | 'data-previewer';
27
- closeBtnLabel?: string;
28
-
29
- disableConfirm?: boolean;
30
-
31
- disableOperation?: boolean;
32
-
33
- }
34
-
35
- export const PreviewerHeader = ({
36
- title,
37
- tips,
38
- style,
39
- confirmContent,
40
- confirmTitle,
41
- className,
42
- active,
43
- onBackClick,
44
- onSave,
45
- closeBtnLabel,
46
- onCancel,
47
- onClear,
48
- variant = 'fields-previewer',
49
- dialogContainer,
50
- disableConfirm,
51
- disableOperation,
52
- }: PreviewerHeaderProps) => {
53
- const [showConfirmDialog, setShowConfirmDialog] = useState(false);
54
-
55
- const [loading, setLoading] = useState(false);
56
-
57
- const btnResetStyle = classNames(
58
- 'w-[94px] h-[34px] flex items-center justify-center rounded-[4px]'
59
- );
60
-
61
- const isData = variant === 'data-previewer';
62
- const isFields = variant === 'fields-previewer';
63
-
64
- const titleCls = classNames('font-[700]', {
65
- 'text-[16px]': isFields,
66
- 'text-[18px]': isData,
67
- });
68
-
69
- const contentJsx = (
70
- <>
71
- <div className="flex items-center gap-3">
72
- {isData ? null : (
73
- <IconBtn
74
- icon={<BackIcon />}
75
- onClick={() => {
76
- // if (disableOperation) {
77
- // return;
78
- // }
79
-
80
- if (disableConfirm) {
81
- onCancel?.();
82
- onBackClick?.();
83
- return;
84
- }
85
-
86
- setShowConfirmDialog(true);
87
- }}
88
- className="text-[#0265FF] hover:text-[#0265FF]"
89
- />
90
- )}
91
- <span className={titleCls}>{title}</span>
92
- {tips && active && (
93
- <div className="flex items-center gap-[6px] text-[#999999] text-[12px]">
94
- <InfoIcon />
95
- {tips}
96
- </div>
97
- )}
98
- </div>
99
- <div className="flex items-center gap-[10px]">
100
- {onClear && (
101
- <BaseButton
102
- className={cn('w-[34px] h-[34px] text-[#8d8d8d] p-0 flex items-center justify-center hover:border-[#e0e0e0] hover:text-[#8d8d8d] border border-solid border-[#e0e0e0] ', {
103
- 'pointer-events-none opacity-50': disableOperation || loading,
104
- })}
105
- tooltip='清除全部'
106
- icon={<BrushIcon />}
107
- onClick={() => {
108
- onClear?.();
109
- }}
110
- />
111
- )}
112
-
113
- {onSave && (
114
- <button
115
- onClick={async () => {
116
- setLoading(true);
117
- try {
118
- await onSave();
119
- } catch (error) {
120
- console.error('Save failed:', error);
121
- } finally {
122
- setLoading(false);
123
- }
124
- }}
125
- className={classNames(
126
- btnResetStyle,
127
- 'flex items-center gap-[6px]',
128
- 'bg-[#0265FF] hover:opacity-90 text-white text-[14px]',
129
- {
130
- 'w-[115px]': isData,
131
- 'pointer-events-none opacity-50': disableOperation || loading,
132
- }
133
- )}
134
- >
135
- {loading ? <Spinner /> : null}
136
- {isFields ? '保存' : '添加到表单'}
137
- </button>
138
- )}
139
- {onCancel && (
140
- <button
141
- onClick={() => {
142
- // if (disableOperation) {
143
- // return;
144
- // }
145
-
146
- if (disableConfirm) {
147
- onCancel?.();
148
- onBackClick?.();
149
- return;
150
- }
151
-
152
- setShowConfirmDialog(true);
153
- }}
154
- className={classNames(
155
- btnResetStyle,
156
- 'text-[#121111] text-[14px] bg-[#fff] border border-solid border-[#e0e0e0] hover:bg-[#f0f0f0]',
157
- {
158
- 'pointer-events-none opacity-50': loading,
159
- }
160
- )}
161
- >
162
- {closeBtnLabel || '取消'}
163
- </button>
164
- )}
165
- </div>
166
- <ConfirmDialog
167
- container={dialogContainer}
168
- open={showConfirmDialog}
169
- onOpenChange={setShowConfirmDialog}
170
- title={confirmTitle || 'AI表单搭建有修改,是否保存?'}
171
- description={confirmContent || '您修改了AI表单搭建但没有保存,是否需要保存并继续?'}
172
- onLinkClick={() => setShowConfirmDialog(false)}
173
- onCancel={() => {
174
- setShowConfirmDialog(false);
175
- onCancel?.();
176
- onBackClick?.();
177
- }}
178
- onConfirm={async () => {
179
- setShowConfirmDialog(false);
180
- setLoading(true);
181
- try {
182
- await onSave?.(true);
183
- } catch (error) {
184
- console.error('Save failed:', error);
185
- } finally {
186
- setLoading(false);
187
- }
188
- }}
189
- />
190
- </>
191
- );
192
-
193
- const borderCls = classNames({
194
- 'border-b border-solid border-[#e0e0e0]': !active && isFields,
195
- 'border-none': isData,
196
- });
197
-
198
- if (active) {
199
- return (
200
- <LinearGradientColorBgAnimation
201
- height={52}
202
- style={style}
203
- childrenContainerStyle={{
204
- display: 'flex',
205
- alignItems: 'center',
206
- justifyContent: 'space-between',
207
- padding: '0 20px',
208
- }}
209
- >
210
- {contentJsx}
211
- </LinearGradientColorBgAnimation>
212
- );
213
- }
214
-
215
- const paddingCls = classNames({
216
- 'px-[20px]': isFields,
217
- 'px-[10px]': isData,
218
- });
219
-
220
- return (
221
- <div
222
- style={style}
223
- className={classNames(
224
- 'w-full h-[52px] flex items-center justify-between',
225
- paddingCls,
226
- className,
227
- borderCls
228
- )}
229
- >
230
- {contentJsx}
231
- </div>
232
- );
233
- };
@@ -1,58 +0,0 @@
1
- import { Button, ButtonProps } from '../ui/button';
2
- import { cn } from '@/lib/utils';
3
- import { transCls } from '@/const/ui';
4
-
5
- export interface PrimaryConfirmBtnProps extends ButtonProps {
6
- text?: string;
7
- prefixDesc?: string;
8
- icon?: React.ReactNode;
9
- disabledWithInfo?: boolean;
10
- light?: boolean;
11
- }
12
-
13
- export const PrimaryConfirmBtn = ({
14
- text = '确认',
15
- prefixDesc,
16
- className,
17
- disabled,
18
- light,
19
- icon,
20
- children,
21
- ...rest
22
- }: PrimaryConfirmBtnProps) => {
23
- const btn = (
24
- <Button
25
- {...rest}
26
- variant="default"
27
- disabled={disabled}
28
- className={cn(
29
- 'px-[10px] py-0 rounded-[100px] text-[14px] leading-normal h-[34px] min-w-[100px] cursor-pointer w-full disabled:opacity-100 gap-[6px] shadow-none',
30
- disabled
31
- ? 'bg-[#f0f0f0] text-[#999] cursor-not-allowed shadow-none'
32
- : light
33
- ? 'bg-[#F0F6FF] text-[#0265FF] hover:bg-[#0265FF] hover:text-white'
34
- : 'bg-[#0265ff] text-white hover:bg-[#0265ff]/80',
35
-
36
- transCls,
37
- {
38
- '!bg-[#E5E6EB] !text-[#121111] shadow-none font-[400]': rest.disabledWithInfo,
39
- },
40
- className
41
- )}
42
- >
43
- {icon}
44
- {children || text}
45
- </Button>
46
- );
47
-
48
- if (!prefixDesc) {
49
- return btn;
50
- }
51
-
52
- return (
53
- <div className="flex flex-col items-start gap-2.5">
54
- <p className="text-[#4D609F]">{prefixDesc}</p>
55
- {btn}
56
- </div>
57
- );
58
- };