@baishuyun/chat-sdk 0.1.8 → 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.
- package/.turbo/turbo-build.log +8 -107
- package/CHANGELOG.md +18 -0
- package/dist/chat-sdk.js +14087 -13890
- package/dist/chat-sdk.js.map +1 -1
- package/dist/chat-sdk.umd.cjs +150 -150
- package/dist/chat-sdk.umd.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/src/chat.d.ts +5 -0
- package/dist/src/chat.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FakeBotMsg.d.ts +8 -0
- package/dist/src/components/biz-comp/FakeBotMsg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FieldChecker.d.ts +19 -0
- package/dist/src/components/biz-comp/FieldChecker.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FieldCheckerListMsg.d.ts +19 -0
- package/dist/src/components/biz-comp/FieldCheckerListMsg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/FieldValueChecker.d.ts +16 -0
- package/dist/src/components/biz-comp/FieldValueChecker.d.ts.map +1 -0
- package/dist/src/components/biz-comp/SubformFieldsValueChecker.d.ts +22 -0
- package/dist/src/components/biz-comp/SubformFieldsValueChecker.d.ts.map +1 -0
- package/dist/src/components/biz-comp/chat-client.d.ts +13 -0
- package/dist/src/components/biz-comp/chat-client.d.ts.map +1 -0
- package/dist/src/components/biz-comp/chat-frame.d.ts +6 -0
- package/dist/src/components/biz-comp/chat-frame.d.ts.map +1 -0
- package/dist/src/components/biz-comp/conversation.d.ts +10 -0
- package/dist/src/components/biz-comp/conversation.d.ts.map +1 -0
- package/dist/src/components/biz-comp/dash-widget-icon.d.ts +7 -0
- package/dist/src/components/biz-comp/dash-widget-icon.d.ts.map +1 -0
- package/dist/src/components/biz-comp/dock-btn.d.ts +2 -0
- package/dist/src/components/biz-comp/dock-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/error-boundary.d.ts +15 -0
- package/dist/src/components/biz-comp/error-boundary.d.ts.map +1 -0
- package/dist/src/components/biz-comp/error-msg.d.ts +4 -0
- package/dist/src/components/biz-comp/error-msg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/field-icon.d.ts +5 -0
- package/dist/src/components/biz-comp/field-icon.d.ts.map +1 -0
- package/dist/src/components/biz-comp/highlight-msg.d.ts +4 -0
- package/dist/src/components/biz-comp/highlight-msg.d.ts.map +1 -0
- package/dist/src/components/biz-comp/markdown-part.d.ts +7 -0
- package/dist/src/components/biz-comp/markdown-part.d.ts.map +1 -0
- package/dist/src/components/biz-comp/markdown.d.ts +5 -0
- package/dist/src/components/biz-comp/markdown.d.ts.map +1 -0
- package/dist/src/components/biz-comp/message-content.d.ts +6 -0
- package/dist/src/components/biz-comp/message-content.d.ts.map +1 -0
- package/dist/src/components/biz-comp/messages.d.ts +3 -0
- package/dist/src/components/biz-comp/messages.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/attachment-btn.d.ts +9 -0
- package/dist/src/components/biz-comp/multi-modal-input/attachment-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/clear-btn.d.ts +8 -0
- package/dist/src/components/biz-comp/multi-modal-input/clear-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/index.d.ts +22 -0
- package/dist/src/components/biz-comp/multi-modal-input/index.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/preview-attachment.d.ts +12 -0
- package/dist/src/components/biz-comp/multi-modal-input/preview-attachment.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/prompt-input.d.ts +36 -0
- package/dist/src/components/biz-comp/multi-modal-input/prompt-input.d.ts.map +1 -0
- package/dist/src/components/biz-comp/multi-modal-input/voice-btn.d.ts +9 -0
- package/dist/src/components/biz-comp/multi-modal-input/voice-btn.d.ts.map +1 -0
- package/dist/src/components/biz-comp/opening-lines.d.ts +3 -0
- package/dist/src/components/biz-comp/opening-lines.d.ts.map +1 -0
- package/dist/src/components/biz-comp/preview-message-wrapper.d.ts +12 -0
- package/dist/src/components/biz-comp/preview-message-wrapper.d.ts.map +1 -0
- package/dist/src/components/biz-comp/preview-message.d.ts +13 -0
- package/dist/src/components/biz-comp/preview-message.d.ts.map +1 -0
- package/dist/src/components/biz-comp/response.d.ts +6 -0
- package/dist/src/components/biz-comp/response.d.ts.map +1 -0
- package/dist/src/components/biz-comp/suggestions.d.ts +8 -0
- package/dist/src/components/biz-comp/suggestions.d.ts.map +1 -0
- package/dist/src/components/ui/badge.d.ts +10 -0
- package/dist/src/components/ui/badge.d.ts.map +1 -0
- package/dist/src/components/ui/button.d.ts +12 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/card.d.ts +9 -0
- package/dist/src/components/ui/card.d.ts.map +1 -0
- package/dist/src/components/ui/checkbox.d.ts +5 -0
- package/dist/src/components/ui/checkbox.d.ts.map +1 -0
- package/dist/src/components/ui/collapsible.d.ts +6 -0
- package/dist/src/components/ui/collapsible.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +24 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/src/components/ui/icons.d.ts +176 -0
- package/dist/src/components/ui/icons.d.ts.map +1 -0
- package/dist/src/components/ui/input-group.d.ts +17 -0
- package/dist/src/components/ui/input-group.d.ts.map +1 -0
- package/dist/src/components/ui/input.d.ts +4 -0
- package/dist/src/components/ui/input.d.ts.map +1 -0
- package/dist/src/components/ui/label.d.ts +6 -0
- package/dist/src/components/ui/label.d.ts.map +1 -0
- package/dist/src/components/ui/one-time-click-btn.d.ts +4 -0
- package/dist/src/components/ui/one-time-click-btn.d.ts.map +1 -0
- package/dist/src/components/ui/select.d.ts +14 -0
- package/dist/src/components/ui/select.d.ts.map +1 -0
- package/dist/src/components/ui/spinner.d.ts +3 -0
- package/dist/src/components/ui/spinner.d.ts.map +1 -0
- package/dist/src/components/ui/tabs.d.ts +8 -0
- package/dist/src/components/ui/tabs.d.ts.map +1 -0
- package/dist/src/components/ui/textarea.d.ts +4 -0
- package/dist/src/components/ui/textarea.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.d.ts +13 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/web-comp/fields-previewer-web-component.d.ts +60 -0
- package/dist/src/components/web-comp/fields-previewer-web-component.d.ts.map +1 -0
- package/dist/src/const/index.d.ts +5 -0
- package/dist/src/const/index.d.ts.map +1 -0
- package/dist/src/const/ui.d.ts +7 -0
- package/dist/src/const/ui.d.ts.map +1 -0
- package/dist/src/hooks/use-chat-preference.d.ts +3 -0
- package/dist/src/hooks/use-chat-preference.d.ts.map +1 -0
- package/dist/src/hooks/use-draggable.d.ts +24 -0
- package/dist/src/hooks/use-draggable.d.ts.map +1 -0
- package/dist/src/hooks/use-evt-bus.d.ts +2 -0
- package/dist/src/hooks/use-evt-bus.d.ts.map +1 -0
- package/dist/src/hooks/use-evt.d.ts +3 -0
- package/dist/src/hooks/use-evt.d.ts.map +1 -0
- package/dist/src/hooks/use-frame-mode.d.ts +20 -0
- package/dist/src/hooks/use-frame-mode.d.ts.map +1 -0
- package/dist/src/hooks/use-merged-chat.d.ts +7 -0
- package/dist/src/hooks/use-merged-chat.d.ts.map +1 -0
- package/dist/src/hooks/use-msg-status-broadcast.d.ts +3 -0
- package/dist/src/hooks/use-msg-status-broadcast.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-component.d.ts +5 -0
- package/dist/src/hooks/use-plugin-component.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-ctx.d.ts +3 -0
- package/dist/src/hooks/use-plugin-ctx.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-custom-components.d.ts +5 -0
- package/dist/src/hooks/use-plugin-custom-components.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-life-cycle-chain-runner.d.ts +5 -0
- package/dist/src/hooks/use-plugin-life-cycle-chain-runner.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin-list.d.ts +2 -0
- package/dist/src/hooks/use-plugin-list.d.ts.map +1 -0
- package/dist/src/hooks/use-plugin.d.ts +2 -0
- package/dist/src/hooks/use-plugin.d.ts.map +1 -0
- package/dist/src/hooks/use-scroll-to-bottom.d.ts +9 -0
- package/dist/src/hooks/use-scroll-to-bottom.d.ts.map +1 -0
- package/dist/src/hooks/use-shadow.d.ts +25 -0
- package/dist/src/hooks/use-shadow.d.ts.map +1 -0
- package/dist/src/hooks/use-streaming-anchor.d.ts +11 -0
- package/dist/src/hooks/use-streaming-anchor.d.ts.map +1 -0
- package/dist/src/hooks/use-toast.d.ts +3 -0
- package/dist/src/hooks/use-toast.d.ts.map +1 -0
- package/dist/src/hooks/use-voice-input.d.ts +31 -0
- package/dist/src/hooks/use-voice-input.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/clone.d.ts +32 -0
- package/dist/src/lib/clone.d.ts.map +1 -0
- package/dist/src/lib/event-emitter.d.ts +39 -0
- package/dist/src/lib/event-emitter.d.ts.map +1 -0
- package/dist/src/lib/parse-design-doc.d.ts +16 -0
- package/dist/src/lib/parse-design-doc.d.ts.map +1 -0
- package/dist/src/lib/readonly.d.ts +14 -0
- package/dist/src/lib/readonly.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +72 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-base-plugin/const.d.ts +3 -0
- package/dist/src/plugins/form-builder-base-plugin/const.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-base-plugin/index.d.ts +7 -0
- package/dist/src/plugins/form-builder-base-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-base-plugin/types.d.ts +12 -0
- package/dist/src/plugins/form-builder-base-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/create-form-confirm.d.ts +7 -0
- package/dist/src/plugins/form-builder-plugin/components/create-form-confirm.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/design-doc-part.d.ts +4 -0
- package/dist/src/plugins/form-builder-plugin/components/design-doc-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/design-info.d.ts +6 -0
- package/dist/src/plugins/form-builder-plugin/components/design-info.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/entry-btn.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/fields-part.d.ts +4 -0
- package/dist/src/plugins/form-builder-plugin/components/fields-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/follow-up.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/follow-up.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/msg-part.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/opening-lines.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/components/opening-lines.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/components/suggestion-part.d.ts +5 -0
- package/dist/src/plugins/form-builder-plugin/components/suggestion-part.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/const/index.d.ts +12 -0
- package/dist/src/plugins/form-builder-plugin/const/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/hooks/index.d.ts +4 -0
- package/dist/src/plugins/form-builder-plugin/hooks/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts +2 -0
- package/dist/src/plugins/form-builder-plugin/hooks/use-fields-confirmed.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/index.d.ts +30 -0
- package/dist/src/plugins/form-builder-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/types.d.ts +28 -0
- package/dist/src/plugins/form-builder-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/utils/get-render-strategy.d.ts +3 -0
- package/dist/src/plugins/form-builder-plugin/utils/get-render-strategy.d.ts.map +1 -0
- package/dist/src/plugins/form-builder-plugin/utils/index.d.ts +57 -0
- package/dist/src/plugins/form-builder-plugin/utils/index.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/batch-filling-data-manager.d.ts +26 -0
- package/dist/src/plugins/form-filling-plugin/batch-filling-data-manager.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/avatar.d.ts +5 -0
- package/dist/src/plugins/form-filling-plugin/components/avatar.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-fill-part.d.ts +4 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-fill-part.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-generator-action.d.ts +14 -0
- package/dist/src/plugins/form-filling-plugin/components/batch-generator-action.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/entry-btn.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts +2 -0
- package/dist/src/plugins/form-filling-plugin/components/first-batch-generating-animation.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/generated-data-counter.d.ts +5 -0
- package/dist/src/plugins/form-filling-plugin/components/generated-data-counter.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/mode-select.d.ts +2 -0
- package/dist/src/plugins/form-filling-plugin/components/mode-select.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/msg-part.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts +2 -0
- package/dist/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/components/single-fill-part.d.ts +4 -0
- package/dist/src/plugins/form-filling-plugin/components/single-fill-part.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/const.d.ts +615 -0
- package/dist/src/plugins/form-filling-plugin/const.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts +3 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-fields-data.d.ts +4 -0
- package/dist/src/plugins/form-filling-plugin/hooks/use-fields-data.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/index.d.ts +22 -0
- package/dist/src/plugins/form-filling-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/types.d.ts +22 -0
- package/dist/src/plugins/form-filling-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/form-filling-plugin/utils.d.ts +6 -0
- package/dist/src/plugins/form-filling-plugin/utils.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/avatar.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/components/avatar.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/query-entry-btn.d.ts +3 -0
- package/dist/src/plugins/report-query-plugin/components/query-entry-btn.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/query-msg-part.d.ts +3 -0
- package/dist/src/plugins/report-query-plugin/components/query-msg-part.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/query-opening-lines.d.ts +2 -0
- package/dist/src/plugins/report-query-plugin/components/query-opening-lines.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts +7 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableCard.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts +18 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/DataTableFields.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts +4 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FilterCondition.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts +8 -0
- package/dist/src/plugins/report-query-plugin/components/result-cards/FormulaField.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/const.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/const.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/index.d.ts +19 -0
- package/dist/src/plugins/report-query-plugin/index.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/types.d.ts +18 -0
- package/dist/src/plugins/report-query-plugin/types.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/build-dash-component.d.ts +17 -0
- package/dist/src/plugins/report-query-plugin/utils/build-dash-component.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts +30 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-dash-styles.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts +60 -0
- package/dist/src/plugins/report-query-plugin/utils/create-default-widget-attr-list.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/field-enhance.d.ts +31 -0
- package/dist/src/plugins/report-query-plugin/utils/field-enhance.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-group.d.ts +208 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-group.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-icon.d.ts +4 -0
- package/dist/src/plugins/report-query-plugin/utils/get-field-icon.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/get-group-rule.d.ts +4 -0
- package/dist/src/plugins/report-query-plugin/utils/get-group-rule.d.ts.map +1 -0
- package/dist/src/plugins/report-query-plugin/utils/index.d.ts +5 -0
- package/dist/src/plugins/report-query-plugin/utils/index.d.ts.map +1 -0
- package/dist/src/sdk.impl.d.ts +44 -0
- package/dist/src/sdk.impl.d.ts.map +1 -0
- package/dist/src/store/context.d.ts +12 -0
- package/dist/src/store/context.d.ts.map +1 -0
- package/dist/src/store/index.d.ts +14 -0
- package/dist/src/store/index.d.ts.map +1 -0
- package/dist/src/stories/FormulaField.stories.d.ts +24 -0
- package/dist/src/stories/FormulaField.stories.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/components/biz-comp/FakeBotMsg.tsx +1 -1
- package/src/components/biz-comp/FieldChecker.tsx +2 -2
- package/src/components/biz-comp/FieldCheckerListMsg.tsx +3 -3
- package/src/components/biz-comp/FieldValueChecker.tsx +1 -1
- package/src/components/biz-comp/SubformFieldsValueChecker.tsx +1 -1
- package/src/components/biz-comp/chat-client.tsx +3 -3
- package/src/components/biz-comp/conversation.tsx +1 -1
- package/src/components/biz-comp/dash-widget-icon.tsx +1 -1
- package/src/components/biz-comp/field-icon.tsx +2 -2
- package/src/components/biz-comp/markdown-part.tsx +3 -3
- package/src/components/biz-comp/message-content.tsx +1 -1
- package/src/components/biz-comp/messages.tsx +5 -2
- package/src/components/biz-comp/multi-modal-input/clear-btn.tsx +2 -2
- package/src/components/biz-comp/multi-modal-input/index.tsx +9 -8
- package/src/components/biz-comp/multi-modal-input/prompt-input.tsx +2 -2
- package/src/components/biz-comp/multi-modal-input/voice-btn.tsx +2 -2
- package/src/components/biz-comp/preview-message-wrapper.tsx +14 -7
- package/src/components/biz-comp/preview-message.tsx +5 -5
- package/src/components/biz-comp/suggestions.tsx +2 -2
- package/src/components/web-comp/fields-previewer-web-component.ts +1 -1
- package/src/const/ui.ts +1 -1
- package/src/hooks/use-streaming-anchor.ts +42 -0
- package/src/plugins/form-builder-plugin/components/create-form-confirm.tsx +4 -4
- package/src/plugins/form-builder-plugin/components/design-info.tsx +3 -3
- package/src/plugins/form-builder-plugin/components/entry-btn.tsx +3 -3
- package/src/plugins/form-builder-plugin/components/fields-part.tsx +2 -2
- package/src/plugins/form-builder-plugin/components/follow-up.tsx +2 -2
- package/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/avatar.tsx +2 -2
- package/src/plugins/form-filling-plugin/components/batch-generator-action.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/entry-btn.tsx +3 -3
- package/src/plugins/form-filling-plugin/components/first-batch-generating-animation.tsx +2 -2
- package/src/plugins/form-filling-plugin/components/generated-data-counter.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/mode-select.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/non-first-batch-generating-animation.tsx +3 -3
- package/src/plugins/form-filling-plugin/components/single-fill-part.tsx +1 -1
- package/src/plugins/report-query-plugin/components/avatar.tsx +2 -2
- package/src/plugins/report-query-plugin/components/query-entry-btn.tsx +2 -2
- package/src/plugins/report-query-plugin/components/query-opening-lines.tsx +1 -1
- package/src/plugins/report-query-plugin/components/result-cards/CreatedSourceMsg.tsx +1 -1
- package/src/plugins/report-query-plugin/components/result-cards/DataTableCard.tsx +3 -3
- package/src/plugins/report-query-plugin/components/result-cards/DataTableFields.tsx +3 -3
- package/src/plugins/report-query-plugin/components/result-cards/FormulaField.tsx +2 -2
- package/src/plugins/report-query-plugin/const.ts +1 -1
- package/src/style.css +2 -0
- package/tsconfig.json +5 -5
- package/src/components/bs-ui/abs-fullscreen-gradient-bg.tsx +0 -35
- package/src/components/bs-ui/attachment-part-group.tsx +0 -35
- package/src/components/bs-ui/attachment-part.tsx +0 -179
- package/src/components/bs-ui/attachments-previewer.tsx +0 -324
- package/src/components/bs-ui/base-button.tsx +0 -49
- package/src/components/bs-ui/border-animation.tsx +0 -107
- package/src/components/bs-ui/border-color-animation.tsx +0 -66
- package/src/components/bs-ui/bot-avatar-name.tsx +0 -25
- package/src/components/bs-ui/bot-icon.tsx +0 -23
- package/src/components/bs-ui/bs-icons.tsx +0 -1115
- package/src/components/bs-ui/card-field.tsx +0 -23
- package/src/components/bs-ui/card.tsx +0 -36
- package/src/components/bs-ui/chat-area-header.tsx +0 -65
- package/src/components/bs-ui/circle-checker.tsx +0 -66
- package/src/components/bs-ui/collapsible-txt-msg.tsx +0 -63
- package/src/components/bs-ui/confirm-dialog.tsx +0 -139
- package/src/components/bs-ui/fields-design-info-table.tsx +0 -160
- package/src/components/bs-ui/fields-generating-indicator.tsx +0 -95
- package/src/components/bs-ui/fields-portal.tsx +0 -18
- package/src/components/bs-ui/fields-previewer.tsx +0 -210
- package/src/components/bs-ui/font-icon.tsx +0 -17
- package/src/components/bs-ui/form-info-editor.tsx +0 -259
- package/src/components/bs-ui/formula-tag.tsx +0 -32
- package/src/components/bs-ui/generate-animation.tsx +0 -56
- package/src/components/bs-ui/icon-btn.tsx +0 -43
- package/src/components/bs-ui/img-part.tsx +0 -27
- package/src/components/bs-ui/line-checker.tsx +0 -160
- package/src/components/bs-ui/linear-gradient-border-btn.tsx +0 -48
- package/src/components/bs-ui/linear-gradient-color-bg-animation.tsx +0 -103
- package/src/components/bs-ui/number-part.tsx +0 -46
- package/src/components/bs-ui/option-item.tsx +0 -28
- package/src/components/bs-ui/previewer-header.tsx +0 -233
- package/src/components/bs-ui/primary-confirm-btn.tsx +0 -58
- package/src/components/bs-ui/primary-entry-btn.tsx +0 -48
- package/src/components/bs-ui/scroll-to-bottom-btn.tsx +0 -28
- package/src/components/bs-ui/split-line.tsx +0 -9
- package/src/components/bs-ui/square-checker.tsx +0 -87
- package/src/components/bs-ui/tab-radio-group.tsx +0 -82
- package/src/components/bs-ui/tooltip.tsx +0 -53
- package/src/components/bs-ui/user-txt-msg-bubble.tsx +0 -19
- package/src/components/bs-ui/warning-msg.tsx +0 -27
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +0 -36
- package/src/stories/AttachmentPart.stories.tsx +0 -122
- package/src/stories/AttachmentPartGroup.stories.tsx +0 -151
- package/src/stories/AttachmentsPreviewer.stories.tsx +0 -306
- package/src/stories/BaseButton.stories.tsx +0 -33
- package/src/stories/BorderAnimation.stories.tsx +0 -116
- package/src/stories/BorderColorAnimation.stories.tsx +0 -63
- package/src/stories/BotAvatarAndName.stories.ts +0 -24
- package/src/stories/BotIcon.stories.ts +0 -22
- package/src/stories/BsTooltip.stories.tsx +0 -32
- package/src/stories/Card.stories.tsx +0 -28
- package/src/stories/CardField.stories.tsx +0 -87
- package/src/stories/ChatAreaHeader.stories.ts +0 -26
- package/src/stories/CircleChecker.stories.tsx +0 -89
- package/src/stories/CollapsibleTextMsg.stories.ts +0 -44
- package/src/stories/ConfirmDialog.stories.tsx +0 -123
- package/src/stories/DashWidgetIcon.stories.tsx +0 -132
- package/src/stories/FormInfoEditor.stories.tsx +0 -173
- package/src/stories/FormulaTag.stories.tsx +0 -68
- package/src/stories/GenerateAnimation.stories.ts +0 -20
- package/src/stories/IconBtn.stories.tsx +0 -32
- package/src/stories/IconLib.tsx +0 -45
- package/src/stories/Icons.stories.ts +0 -22
- package/src/stories/ImgMsgPart.stories.tsx +0 -42
- package/src/stories/LineChecker.stories.tsx +0 -134
- package/src/stories/LinearGradientBorderBtn.stories.tsx +0 -86
- package/src/stories/LinearGradientColorBgAnimation.stories.tsx +0 -60
- package/src/stories/NumbersMsgPart.stories.tsx +0 -42
- package/src/stories/OptionItem.stories.tsx +0 -77
- package/src/stories/PreviewerHeader.stories.tsx +0 -91
- package/src/stories/PrimaryConfirmBtn.stories.tsx +0 -60
- package/src/stories/PrimaryEntryBtn.stories.tsx +0 -74
- package/src/stories/ScrollToBottom.stories.tsx +0 -24
- package/src/stories/SplitLine.stories.tsx +0 -40
- package/src/stories/SquareChecker.stories.tsx +0 -96
- package/src/stories/TabRadioGroup.stories.tsx +0 -84
- package/src/stories/UserTextMsgBubble.stories.ts +0 -24
- package/src/stories/WarningMessage.stories.tsx +0 -23
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/demo.css +0 -539
- package/src/stories/assets/demo_index.html +0 -7988
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/iconfont.css +0 -1377
- package/src/stories/assets/iconfont.eot +0 -0
- package/src/stories/assets/iconfont.json +0 -2382
- package/src/stories/assets/iconfont.svg +0 -697
- package/src/stories/assets/iconfont.ttf +0 -0
- package/src/stories/assets/iconfont.woff +0 -0
- package/src/stories/assets/iconfont.woff2 +0 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/fields-design-info-table.stories.tsx +0 -203
- package/src/stories/fields-generating.stories.tsx +0 -41
- 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
|
-
};
|