@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.
- package/.turbo/turbo-build.log +8 -107
- package/CHANGELOG.md +12 -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 +4 -4
- 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,210 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { forwardRef, useState } from 'react';
|
|
3
|
-
import { AbsFullscreenGradientBg } from './abs-fullscreen-gradient-bg';
|
|
4
|
-
import { BorderColorAnimation } from './border-color-animation';
|
|
5
|
-
import { FieldsGeneratingIndicator } from './fields-generating-indicator';
|
|
6
|
-
import { PreviewerHeader, PreviewerHeaderProps } from './previewer-header';
|
|
7
|
-
import { useShadow } from '@/hooks/use-shadow';
|
|
8
|
-
import { TooltipProvider } from '../ui/tooltip';
|
|
9
|
-
|
|
10
|
-
export interface FieldsPreviewerProps extends PreviewerHeaderProps {
|
|
11
|
-
fullscreen?: boolean;
|
|
12
|
-
|
|
13
|
-
rightSpaceWidth?: number;
|
|
14
|
-
rightSpaceRef?: (right: HTMLDivElement) => void;
|
|
15
|
-
rightElement?: React.ReactNode;
|
|
16
|
-
|
|
17
|
-
// generating fields
|
|
18
|
-
streaming?: boolean;
|
|
19
|
-
streamingText?: string;
|
|
20
|
-
|
|
21
|
-
empty?: boolean;
|
|
22
|
-
|
|
23
|
-
zIndex?: number;
|
|
24
|
-
|
|
25
|
-
padding?: number;
|
|
26
|
-
|
|
27
|
-
containerStyle?: string;
|
|
28
|
-
|
|
29
|
-
fullContent?: boolean;
|
|
30
|
-
|
|
31
|
-
// children means the content inside the previewer, not the right side components
|
|
32
|
-
children?: React.ReactNode;
|
|
33
|
-
|
|
34
|
-
readonly?: boolean;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const PlaceholderDashedBox = () => {
|
|
38
|
-
return (
|
|
39
|
-
<div
|
|
40
|
-
style={{
|
|
41
|
-
borderRadius: 10,
|
|
42
|
-
width: '100%',
|
|
43
|
-
height: '100%',
|
|
44
|
-
border: '1px dashed var(---e0e0e0, #E0E0E0)',
|
|
45
|
-
}}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const FieldsPreviewer = forwardRef<HTMLDivElement, FieldsPreviewerProps>(
|
|
51
|
-
({
|
|
52
|
-
zIndex = 1,
|
|
53
|
-
children,
|
|
54
|
-
title,
|
|
55
|
-
tips,
|
|
56
|
-
active,
|
|
57
|
-
fullscreen,
|
|
58
|
-
padding = 10,
|
|
59
|
-
className,
|
|
60
|
-
empty,
|
|
61
|
-
rightSpaceWidth,
|
|
62
|
-
rightSpaceRef,
|
|
63
|
-
rightElement,
|
|
64
|
-
streaming,
|
|
65
|
-
streamingText,
|
|
66
|
-
onBackClick,
|
|
67
|
-
dialogContainer,
|
|
68
|
-
variant = 'fields-previewer',
|
|
69
|
-
onSave,
|
|
70
|
-
onCancel,
|
|
71
|
-
onClear,
|
|
72
|
-
style,
|
|
73
|
-
confirmContent,
|
|
74
|
-
fullContent,
|
|
75
|
-
confirmTitle,
|
|
76
|
-
containerStyle,
|
|
77
|
-
readonly,
|
|
78
|
-
|
|
79
|
-
closeBtnLabel,
|
|
80
|
-
disableOperation,
|
|
81
|
-
disableConfirm,
|
|
82
|
-
}: FieldsPreviewerProps) => {
|
|
83
|
-
const p = fullscreen ? 0 : padding;
|
|
84
|
-
const pr = fullscreen ? 0 : rightSpaceWidth;
|
|
85
|
-
|
|
86
|
-
// const absWrapperRef = useRef<HTMLDivElement>(null);
|
|
87
|
-
const [absContainer, setAbsContainer] = useState<HTMLDivElement | null>(null);
|
|
88
|
-
|
|
89
|
-
const isFields = variant === 'fields-previewer';
|
|
90
|
-
const isData = variant === 'data-previewer';
|
|
91
|
-
|
|
92
|
-
const contentCls = classNames({
|
|
93
|
-
'm-[20px]': isFields,
|
|
94
|
-
'mx-[12px] mb-[10px]': isData,
|
|
95
|
-
'p-[10px]': isFields,
|
|
96
|
-
'p-0': isData,
|
|
97
|
-
'opacity-60': streaming && isFields,
|
|
98
|
-
'w-[calc(100%-40px)] h-[calc(100%-90px)] relative overflow-x-hidden overflow-y-auto':
|
|
99
|
-
isFields,
|
|
100
|
-
'w-[calc(100%-24px)] h-[calc(100%-62px)] relative overflow-x-hidden overflow-y-auto': isData,
|
|
101
|
-
'rounded-[4px] bg-white': isData,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const fullContentStyle = fullContent
|
|
105
|
-
? {
|
|
106
|
-
width: '100%',
|
|
107
|
-
height: '100%',
|
|
108
|
-
padding: 0,
|
|
109
|
-
margin: 0,
|
|
110
|
-
}
|
|
111
|
-
: {};
|
|
112
|
-
|
|
113
|
-
const { shadowContainer } = useShadow({
|
|
114
|
-
id: 'dialog-container',
|
|
115
|
-
rootEl: dialogContainer,
|
|
116
|
-
style: containerStyle,
|
|
117
|
-
wrapperStyle: {
|
|
118
|
-
zIndex: Date.now(),
|
|
119
|
-
position: 'absolute',
|
|
120
|
-
width: '100%',
|
|
121
|
-
height: '100%',
|
|
122
|
-
pointerEvents: 'none',
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
const contentJsx = (
|
|
127
|
-
<>
|
|
128
|
-
<PreviewerHeader
|
|
129
|
-
title={title}
|
|
130
|
-
tips={tips}
|
|
131
|
-
active={active}
|
|
132
|
-
variant={variant}
|
|
133
|
-
className={className}
|
|
134
|
-
onBackClick={onBackClick}
|
|
135
|
-
onSave={streaming ? undefined : onSave}
|
|
136
|
-
onCancel={streaming ? undefined : onCancel}
|
|
137
|
-
style={style}
|
|
138
|
-
dialogContainer={shadowContainer || absContainer!}
|
|
139
|
-
confirmTitle={confirmTitle}
|
|
140
|
-
confirmContent={confirmContent}
|
|
141
|
-
closeBtnLabel={closeBtnLabel}
|
|
142
|
-
disableOperation={disableOperation}
|
|
143
|
-
disableConfirm={disableConfirm}
|
|
144
|
-
onClear={onClear}
|
|
145
|
-
/>
|
|
146
|
-
<div className={contentCls} style={fullContentStyle}>
|
|
147
|
-
{empty && isFields ? <PlaceholderDashedBox /> : children}
|
|
148
|
-
{readonly && <div className="absolute inset-0 z-50 cursor-not-allowed" />}
|
|
149
|
-
</div>
|
|
150
|
-
{streaming && (
|
|
151
|
-
// abs center
|
|
152
|
-
<div className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
|
|
153
|
-
<FieldsGeneratingIndicator>{streamingText}</FieldsGeneratingIndicator>
|
|
154
|
-
</div>
|
|
155
|
-
)}
|
|
156
|
-
</>
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
const content = isFields ? (
|
|
160
|
-
<BorderColorAnimation
|
|
161
|
-
width={pr ? `calc(100% - ${pr}px)` : '100%'}
|
|
162
|
-
style={{ overflow: 'hidden' }}
|
|
163
|
-
>
|
|
164
|
-
{contentJsx}
|
|
165
|
-
</BorderColorAnimation>
|
|
166
|
-
) : (
|
|
167
|
-
<div className="h-full" style={{ width: pr ? `calc(100% - ${pr}px)` : '100%' }}>
|
|
168
|
-
{contentJsx}
|
|
169
|
-
</div>
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
const rightArea = (
|
|
173
|
-
<div
|
|
174
|
-
style={{
|
|
175
|
-
width: fullscreen ? 0 : rightSpaceWidth,
|
|
176
|
-
position: 'absolute',
|
|
177
|
-
top: 0,
|
|
178
|
-
right: 0,
|
|
179
|
-
pointerEvents: fullscreen ? 'none' : 'auto',
|
|
180
|
-
}}
|
|
181
|
-
className="h-full"
|
|
182
|
-
ref={(n) => {
|
|
183
|
-
if (n) {
|
|
184
|
-
rightSpaceRef?.(n);
|
|
185
|
-
}
|
|
186
|
-
}}
|
|
187
|
-
>
|
|
188
|
-
{rightElement}
|
|
189
|
-
</div>
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
return (
|
|
193
|
-
<TooltipProvider
|
|
194
|
-
delayDuration={100}
|
|
195
|
-
zIndex={zIndex}
|
|
196
|
-
>
|
|
197
|
-
<AbsFullscreenGradientBg
|
|
198
|
-
zIndex={zIndex}
|
|
199
|
-
padding={isFields ? p : 0}
|
|
200
|
-
disableGradient={fullscreen || !isFields}
|
|
201
|
-
bgColor={isFields ? '#fff' : '#F5F7FA'}
|
|
202
|
-
ref={setAbsContainer}
|
|
203
|
-
>
|
|
204
|
-
{fullscreen ? contentJsx : content}
|
|
205
|
-
{rightArea}
|
|
206
|
-
</AbsFullscreenGradientBg>
|
|
207
|
-
</TooltipProvider>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const FontIcon = ({
|
|
2
|
-
code,
|
|
3
|
-
className,
|
|
4
|
-
style,
|
|
5
|
-
}: {
|
|
6
|
-
code: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
}) => {
|
|
10
|
-
return (
|
|
11
|
-
<i
|
|
12
|
-
className={`sdk-icon ${className || ''}`}
|
|
13
|
-
style={style}
|
|
14
|
-
dangerouslySetInnerHTML={{ __html: code }}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils';
|
|
2
|
-
import { FORM_ICON_OPTIONS, transCls } from '@/const/ui';
|
|
3
|
-
import { useState, memo, useEffect } from 'react';
|
|
4
|
-
import { ChevronDownIcon } from '../ui/icons';
|
|
5
|
-
import { PrimaryConfirmBtn } from './primary-confirm-btn';
|
|
6
|
-
import { EditIcon } from './bs-icons';
|
|
7
|
-
import { FontIcon } from './font-icon';
|
|
8
|
-
|
|
9
|
-
export interface FormIconOption {
|
|
10
|
-
id: string;
|
|
11
|
-
/** Unicode code for FontIcon (e.g., "") */
|
|
12
|
-
code: string;
|
|
13
|
-
label: string;
|
|
14
|
-
/** Icon class number (e.g., 25 for icon-new-bsy-form-25) */
|
|
15
|
-
value: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Form icon component with blue background - dynamically shows selected icon
|
|
19
|
-
const FormIcon = ({
|
|
20
|
-
size = 36,
|
|
21
|
-
code,
|
|
22
|
-
style,
|
|
23
|
-
}: {
|
|
24
|
-
size?: number;
|
|
25
|
-
code?: string;
|
|
26
|
-
style?: React.CSSProperties;
|
|
27
|
-
}) => {
|
|
28
|
-
const borderRadius = size * 0.238; // ~8.57px for 36px container
|
|
29
|
-
const fontSize = size * 0.6875; // Icon font size relative to container
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div
|
|
33
|
-
className="relative flex items-center justify-center bg-[#0265ff] flex-shrink-0 text-white"
|
|
34
|
-
style={{
|
|
35
|
-
width: size,
|
|
36
|
-
height: size,
|
|
37
|
-
borderRadius,
|
|
38
|
-
fontSize: fontSize,
|
|
39
|
-
...style,
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
<FontIcon code={code || FORM_ICON_OPTIONS[0].code} style={{ fontSize }} />
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export interface FormInfoEditorProps {
|
|
48
|
-
/** Form name */
|
|
49
|
-
name: string;
|
|
50
|
-
/** Callback when name changes */
|
|
51
|
-
onNameChange?: (name: string) => void;
|
|
52
|
-
/** Currently selected icon option */
|
|
53
|
-
selectedIcon?: FormIconOption;
|
|
54
|
-
/** Available icon options */
|
|
55
|
-
iconOptions?: FormIconOption[];
|
|
56
|
-
/** Callback when icon changes */
|
|
57
|
-
onIconChange?: (icon: FormIconOption) => void;
|
|
58
|
-
/** Callback when confirm button is clicked */
|
|
59
|
-
onConfirm?: (name: string, iconVal: number) => void;
|
|
60
|
-
/** Whether the editor is in expanded mode */
|
|
61
|
-
expanded?: boolean;
|
|
62
|
-
/** Callback when expanded state changes */
|
|
63
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
64
|
-
/** Custom class name */
|
|
65
|
-
className?: string;
|
|
66
|
-
onMount?: () => void;
|
|
67
|
-
readonly?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Form Info Editor Component
|
|
72
|
-
* Displays form name and icon with an expandable editor interface
|
|
73
|
-
*/
|
|
74
|
-
export const FormInfoEditor = memo(
|
|
75
|
-
({
|
|
76
|
-
name,
|
|
77
|
-
onNameChange,
|
|
78
|
-
onMount,
|
|
79
|
-
selectedIcon = FORM_ICON_OPTIONS[0],
|
|
80
|
-
iconOptions = [],
|
|
81
|
-
onIconChange,
|
|
82
|
-
readonly,
|
|
83
|
-
onConfirm,
|
|
84
|
-
expanded: controlledExpanded,
|
|
85
|
-
onExpandedChange,
|
|
86
|
-
className,
|
|
87
|
-
}: FormInfoEditorProps) => {
|
|
88
|
-
const [internalExpanded, setInternalExpanded] = useState(false);
|
|
89
|
-
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
90
|
-
|
|
91
|
-
const expanded = controlledExpanded ?? internalExpanded;
|
|
92
|
-
const setExpanded = (value: boolean) => {
|
|
93
|
-
setInternalExpanded(value);
|
|
94
|
-
onExpandedChange?.(value);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const [nameVal, setNameVal] = useState(name);
|
|
98
|
-
const [iconOpt, setIconOpt] = useState(selectedIcon);
|
|
99
|
-
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
onMount?.();
|
|
102
|
-
}, []);
|
|
103
|
-
|
|
104
|
-
// Default Status (Collapsed)
|
|
105
|
-
if (!expanded || readonly) {
|
|
106
|
-
return (
|
|
107
|
-
<div
|
|
108
|
-
className={cn(
|
|
109
|
-
'bg-white hover:bg-[#fafafa] border border-[#e0e0e0] rounded-[10px] px-[10px] py-0 flex items-center justify-between h-[56px] cursor-pointer',
|
|
110
|
-
transCls,
|
|
111
|
-
className,
|
|
112
|
-
'duration-100'
|
|
113
|
-
)}
|
|
114
|
-
onClick={() => {
|
|
115
|
-
if (readonly) return;
|
|
116
|
-
setExpanded(true);
|
|
117
|
-
}}
|
|
118
|
-
>
|
|
119
|
-
{/* Left side: Form icon and name */}
|
|
120
|
-
<div className="flex items-center gap-[10px] min-w-0 flex-1 mr-[10px]">
|
|
121
|
-
<FormIcon size={36} code={iconOpt?.code} />
|
|
122
|
-
<p className="text-[14px] text-black leading-normal truncate">{nameVal}</p>
|
|
123
|
-
</div>
|
|
124
|
-
|
|
125
|
-
<button
|
|
126
|
-
onClick={() => {
|
|
127
|
-
if (readonly) return;
|
|
128
|
-
setExpanded(true);
|
|
129
|
-
}}
|
|
130
|
-
className={cn(
|
|
131
|
-
'w-[16px] h-[16px] flex items-center justify-center cursor-pointer hover:text-[#0265ff]',
|
|
132
|
-
transCls,
|
|
133
|
-
{
|
|
134
|
-
'pointer-events-none opacity-0': readonly,
|
|
135
|
-
}
|
|
136
|
-
)}
|
|
137
|
-
>
|
|
138
|
-
<EditIcon />
|
|
139
|
-
</button>
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Expanded Status (Edit mode)
|
|
145
|
-
return (
|
|
146
|
-
<div
|
|
147
|
-
className={cn(
|
|
148
|
-
'bg-[#fafafa] border border-[#e0e0e0] rounded-[10px] p-[12px] flex flex-col gap-[22px]',
|
|
149
|
-
transCls,
|
|
150
|
-
className,
|
|
151
|
-
'duration-100'
|
|
152
|
-
)}
|
|
153
|
-
>
|
|
154
|
-
{/* Name field */}
|
|
155
|
-
<div className="flex flex-col gap-[10px] w-full">
|
|
156
|
-
<p className="text-[14px] text-[#030303] font-bold leading-normal">名称</p>
|
|
157
|
-
<input
|
|
158
|
-
type="text"
|
|
159
|
-
value={nameVal}
|
|
160
|
-
onChange={(e) => {
|
|
161
|
-
setNameVal(e.target.value);
|
|
162
|
-
}}
|
|
163
|
-
onBlur={() => {
|
|
164
|
-
onNameChange?.(nameVal);
|
|
165
|
-
}}
|
|
166
|
-
className={cn(
|
|
167
|
-
'bg-white border border-[#e0e0e0] rounded-[4px] h-[34px] px-[10px] py-[7px] w-full',
|
|
168
|
-
'text-[14px] text-[#030303] leading-normal outline-none',
|
|
169
|
-
'focus:border-[#0265ff]',
|
|
170
|
-
'hover:border-[#0265ff]',
|
|
171
|
-
transCls
|
|
172
|
-
)}
|
|
173
|
-
/>
|
|
174
|
-
</div>
|
|
175
|
-
|
|
176
|
-
{/* Icon field */}
|
|
177
|
-
<div className="flex flex-col gap-[10px] w-full">
|
|
178
|
-
<p className="text-[14px] text-[#030303] font-bold leading-normal">图标</p>
|
|
179
|
-
<div className="relative" style={{ zIndex: 10 }}>
|
|
180
|
-
<button
|
|
181
|
-
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
|
|
182
|
-
className={cn(
|
|
183
|
-
'bg-white border border-[#e0e0e0] rounded-[4px] h-[34px] px-[10px] py-[7px] w-full',
|
|
184
|
-
'flex items-center justify-between cursor-pointer',
|
|
185
|
-
'hover:border-[#0265ff]',
|
|
186
|
-
transCls
|
|
187
|
-
)}
|
|
188
|
-
>
|
|
189
|
-
{/* Selected icon */}
|
|
190
|
-
<div className="flex items-center">
|
|
191
|
-
<FormIcon size={16} code={iconOpt?.code} />
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
{/* Dropdown arrow */}
|
|
195
|
-
<div className={cn('text-[#666]', transCls, isDropdownOpen && 'rotate-180')}>
|
|
196
|
-
<ChevronDownIcon size={16} />
|
|
197
|
-
</div>
|
|
198
|
-
</button>
|
|
199
|
-
|
|
200
|
-
{/* Dropdown menu - Grid layout matching Figma design */}
|
|
201
|
-
{isDropdownOpen && iconOptions.length > 0 && (
|
|
202
|
-
<div
|
|
203
|
-
className={cn(
|
|
204
|
-
'absolute top-full left-0 mt-[4px] bg-white rounded-[10px] shadow-md z-10 p-[12px]',
|
|
205
|
-
transCls
|
|
206
|
-
)}
|
|
207
|
-
>
|
|
208
|
-
<div className="grid grid-cols-6 gap-[8px]">
|
|
209
|
-
{iconOptions.map((option) => (
|
|
210
|
-
<button
|
|
211
|
-
key={option.id}
|
|
212
|
-
onClick={() => {
|
|
213
|
-
onIconChange?.(option);
|
|
214
|
-
setIconOpt(option);
|
|
215
|
-
setIsDropdownOpen(false);
|
|
216
|
-
}}
|
|
217
|
-
className={cn(
|
|
218
|
-
'aspect-square rounded-[9.5px] border flex items-center justify-center cursor-pointer overflow-hidden',
|
|
219
|
-
iconOpt?.id === option.id
|
|
220
|
-
? 'border-[#0265ff] border-2'
|
|
221
|
-
: 'border-[#e0e0e0] hover:bg-[#eff0f6]',
|
|
222
|
-
transCls
|
|
223
|
-
)}
|
|
224
|
-
title={option.label}
|
|
225
|
-
>
|
|
226
|
-
<FormIcon
|
|
227
|
-
code={option.code}
|
|
228
|
-
style={{ background: 'transparent', color: '#0265ff' }}
|
|
229
|
-
/>
|
|
230
|
-
</button>
|
|
231
|
-
))}
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
)}
|
|
235
|
-
</div>
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
{/* Confirm button */}
|
|
239
|
-
<PrimaryConfirmBtn
|
|
240
|
-
text="确认"
|
|
241
|
-
onClick={() => {
|
|
242
|
-
onConfirm?.(nameVal, iconOpt?.value || 25);
|
|
243
|
-
setExpanded(false);
|
|
244
|
-
}}
|
|
245
|
-
/>
|
|
246
|
-
</div>
|
|
247
|
-
);
|
|
248
|
-
},
|
|
249
|
-
(p1, p2) => {
|
|
250
|
-
return (
|
|
251
|
-
p1.name === p2.name &&
|
|
252
|
-
p1.selectedIcon?.id === p2.selectedIcon?.id &&
|
|
253
|
-
p1.expanded === p2.expanded &&
|
|
254
|
-
p1.iconOptions === p2.iconOptions
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
|
|
259
|
-
export default FormInfoEditor;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils';
|
|
2
|
-
import { type FormulaOp, FORMULA_OP_LABEL } from '@baishuyun/types';
|
|
3
|
-
|
|
4
|
-
/** 统计方式 → 背景色 */
|
|
5
|
-
const FORMULA_OP_COLOR: Record<FormulaOp, string> = {
|
|
6
|
-
sum: '#3767F1',
|
|
7
|
-
max: '#F06648',
|
|
8
|
-
min: '#4ACC8C',
|
|
9
|
-
average: '#4AC0EC',
|
|
10
|
-
count: '#9362CE',
|
|
11
|
-
countDistinct: '#F168B6',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export interface FormulaTagProps {
|
|
15
|
-
/** 统计方式 */
|
|
16
|
-
type: FormulaOp;
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const FormulaTag = ({ type, className }: FormulaTagProps) => {
|
|
21
|
-
return (
|
|
22
|
-
<span
|
|
23
|
-
className={cn(
|
|
24
|
-
'inline-flex items-center justify-center rounded-[100px] px-[6px] text-[14px] leading-[20px] text-white',
|
|
25
|
-
className
|
|
26
|
-
)}
|
|
27
|
-
style={{ backgroundColor: FORMULA_OP_COLOR[type] }}
|
|
28
|
-
>
|
|
29
|
-
{FORMULA_OP_LABEL[type]}
|
|
30
|
-
</span>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
|
|
3
|
-
export const GenerateAnimation = (props: { children?: React.ReactNode, className?: string }) => {
|
|
4
|
-
return (
|
|
5
|
-
<div className={classNames("flex items-center gap-[6px]", props.className)}>
|
|
6
|
-
<div className="flex gap-[2px] flex-shrink-0" style={{ marginRight: '6px' }}>
|
|
7
|
-
<div
|
|
8
|
-
className="w-[5px] h-[5px] rounded-full bg-[#999] flex-shrink-0"
|
|
9
|
-
style={{
|
|
10
|
-
animation: 'pulse 1.0s ease-in-out infinite',
|
|
11
|
-
animationDelay: '0s',
|
|
12
|
-
width: '5px',
|
|
13
|
-
height: '5px',
|
|
14
|
-
background: '#999',
|
|
15
|
-
marginRight: '3px',
|
|
16
|
-
}}
|
|
17
|
-
/>
|
|
18
|
-
<div
|
|
19
|
-
className="w-[5px] h-[5px] rounded-full bg-[#999] flex-shrink-0"
|
|
20
|
-
style={{
|
|
21
|
-
animation: 'pulse 1.0s ease-in-out infinite',
|
|
22
|
-
width: '5px',
|
|
23
|
-
height: '5px',
|
|
24
|
-
background: '#999',
|
|
25
|
-
animationDelay: '0.2s',
|
|
26
|
-
marginRight: '3px',
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
<div
|
|
30
|
-
className="w-[5px] h-[5px] rounded-full bg-[#999] flex-shrink-0"
|
|
31
|
-
style={{
|
|
32
|
-
animation: 'pulse 1.0s ease-in-out infinite',
|
|
33
|
-
width: '5px',
|
|
34
|
-
height: '5px',
|
|
35
|
-
marginRight: '3px',
|
|
36
|
-
background: '#999',
|
|
37
|
-
animationDelay: '0.4s',
|
|
38
|
-
}}
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
<span className="text-[14px] text-[#999]">{props.children || '生成中'}</span>
|
|
42
|
-
<style>{`
|
|
43
|
-
@keyframes pulse {
|
|
44
|
-
0%, 60%, 100% {
|
|
45
|
-
opacity: 0.3;
|
|
46
|
-
transform: scale(1);
|
|
47
|
-
}
|
|
48
|
-
30% {
|
|
49
|
-
opacity: 1;
|
|
50
|
-
transform: scale(1.2);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
`}</style>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ReactNode, forwardRef } from 'react';
|
|
2
|
-
import { Button, ButtonProps } from '../ui/button';
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
import { transCls } from '@/const/ui';
|
|
5
|
-
import { BsTooltip } from './tooltip';
|
|
6
|
-
|
|
7
|
-
export interface IconBtnProps extends ButtonProps {
|
|
8
|
-
icon: ReactNode;
|
|
9
|
-
rounded?: boolean;
|
|
10
|
-
tooltip?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const IconBtn = forwardRef<HTMLButtonElement, IconBtnProps>(
|
|
14
|
-
({ icon, className, tooltip, size, ...rest }, ref) => {
|
|
15
|
-
const btn = (
|
|
16
|
-
<Button
|
|
17
|
-
ref={ref}
|
|
18
|
-
variant="ghost"
|
|
19
|
-
size="icon"
|
|
20
|
-
className={cn(
|
|
21
|
-
'p-2.5',
|
|
22
|
-
{
|
|
23
|
-
'rounded-full w-[26px] h-[26px] aspect-square !text-[#121111]': rest.rounded,
|
|
24
|
-
'rounded-[4px]': !rest.rounded,
|
|
25
|
-
},
|
|
26
|
-
'cursor-pointer',
|
|
27
|
-
'hover:!bg-[#EFF0F6]',
|
|
28
|
-
className,
|
|
29
|
-
transCls
|
|
30
|
-
)}
|
|
31
|
-
{...rest}
|
|
32
|
-
>
|
|
33
|
-
{icon}
|
|
34
|
-
</Button>
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
if (tooltip) {
|
|
38
|
-
return <BsTooltip content={tooltip}>{btn}</BsTooltip>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return btn;
|
|
42
|
-
}
|
|
43
|
-
);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils';
|
|
2
|
-
|
|
3
|
-
export interface ImgMsgPartProps {
|
|
4
|
-
url: string;
|
|
5
|
-
alt?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
/** Size in pixels (width & height), defaults to 102 */
|
|
8
|
-
size?: number;
|
|
9
|
-
onClick?: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const ImgMsgPart = ({ url, alt = '', className, size = 102, onClick }: ImgMsgPartProps) => {
|
|
13
|
-
return (
|
|
14
|
-
<div
|
|
15
|
-
className={cn('relative overflow-hidden rounded-[10px] border border-[#e0e0e0] hover:border-[#0265FF]/20 hover:cursor-pointer', onClick && 'cursor-pointer', className)}
|
|
16
|
-
style={{ width: size, height: size }}
|
|
17
|
-
onClick={onClick}
|
|
18
|
-
>
|
|
19
|
-
<img
|
|
20
|
-
src={url}
|
|
21
|
-
alt={alt}
|
|
22
|
-
className="block w-full h-full object-cover rounded-[10px]"
|
|
23
|
-
loading="lazy"
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
);
|
|
27
|
-
};
|