@baishuyun/chat-sdk 0.1.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -107
- package/CHANGELOG.md +21 -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,324 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils';
|
|
2
|
-
import { transCls } from '@/const/ui';
|
|
3
|
-
import { useRef, useState, useEffect, useCallback, ComponentType } from 'react';
|
|
4
|
-
import { RemoveCircleIcon, XlsxIcon, CsvFileIcon, TxtFileIcon, UnknownFileIcon } from './bs-icons';
|
|
5
|
-
import { LoaderIcon } from '@/components/ui/icons';
|
|
6
|
-
|
|
7
|
-
export interface AttachmentItem {
|
|
8
|
-
id: string;
|
|
9
|
-
url: string;
|
|
10
|
-
alt?: string;
|
|
11
|
-
isLoading?: boolean;
|
|
12
|
-
/** MIME type, used to decide whether to show image or icon */
|
|
13
|
-
contentType?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface AttachmentsPreviewerProps {
|
|
17
|
-
attachments: AttachmentItem[];
|
|
18
|
-
className?: string;
|
|
19
|
-
imageSize?: number;
|
|
20
|
-
gap?: number;
|
|
21
|
-
onImageClick?: (attachment: AttachmentItem, index: number) => void;
|
|
22
|
-
onImageRemove?: (attachment: AttachmentItem, index: number) => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type FileIconComponent = ComponentType;
|
|
26
|
-
|
|
27
|
-
interface FileTypeConfig {
|
|
28
|
-
icon: FileIconComponent;
|
|
29
|
-
/** Icon original size for scaling */
|
|
30
|
-
iconSize: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const FILE_TYPE_MAP: Record<string, FileTypeConfig> = {
|
|
34
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': {
|
|
35
|
-
icon: XlsxIcon,
|
|
36
|
-
iconSize: 52,
|
|
37
|
-
},
|
|
38
|
-
'application/vnd.ms-excel': { icon: XlsxIcon, iconSize: 52 },
|
|
39
|
-
'text/csv': { icon: CsvFileIcon, iconSize: 16 },
|
|
40
|
-
'text/plain': { icon: TxtFileIcon, iconSize: 16 },
|
|
41
|
-
'application/octet-stream': { icon: TxtFileIcon, iconSize: 16 },
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const DEFAULT_FILE_CONFIG: FileTypeConfig = {
|
|
45
|
-
icon: UnknownFileIcon,
|
|
46
|
-
iconSize: 16,
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const isImageType = (mediaType?: string): boolean => Boolean(mediaType?.startsWith('image/'));
|
|
50
|
-
|
|
51
|
-
const getFileConfig = (mediaType?: string, fileName?: string): FileTypeConfig => {
|
|
52
|
-
if (mediaType && FILE_TYPE_MAP[mediaType]) {
|
|
53
|
-
return FILE_TYPE_MAP[mediaType];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (fileName) {
|
|
57
|
-
const ext = fileName.split('.').pop()?.toLowerCase();
|
|
58
|
-
switch (ext) {
|
|
59
|
-
case 'xlsx':
|
|
60
|
-
case 'xls':
|
|
61
|
-
return FILE_TYPE_MAP['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
|
|
62
|
-
case 'csv':
|
|
63
|
-
return FILE_TYPE_MAP['text/csv'];
|
|
64
|
-
case 'txt':
|
|
65
|
-
case 'ts':
|
|
66
|
-
case 'tsx':
|
|
67
|
-
case 'js':
|
|
68
|
-
case 'jsx':
|
|
69
|
-
case 'json':
|
|
70
|
-
case 'md':
|
|
71
|
-
return FILE_TYPE_MAP['text/plain'];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return DEFAULT_FILE_CONFIG;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const ChevronRightIcon = () => (
|
|
79
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
80
|
-
<path
|
|
81
|
-
d="M9 6L15 12L9 18"
|
|
82
|
-
stroke="currentColor"
|
|
83
|
-
strokeWidth="2"
|
|
84
|
-
strokeLinecap="round"
|
|
85
|
-
strokeLinejoin="round"
|
|
86
|
-
/>
|
|
87
|
-
</svg>
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const ChevronLeftIcon = () => (
|
|
91
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
92
|
-
<path
|
|
93
|
-
d="M15 6L9 12L15 18"
|
|
94
|
-
stroke="currentColor"
|
|
95
|
-
strokeWidth="2"
|
|
96
|
-
strokeLinecap="round"
|
|
97
|
-
strokeLinejoin="round"
|
|
98
|
-
/>
|
|
99
|
-
</svg>
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const NavButton = ({
|
|
103
|
-
direction,
|
|
104
|
-
onClick,
|
|
105
|
-
className,
|
|
106
|
-
}: {
|
|
107
|
-
direction: 'left' | 'right';
|
|
108
|
-
onClick: () => void;
|
|
109
|
-
className?: string;
|
|
110
|
-
}) => {
|
|
111
|
-
return (
|
|
112
|
-
<button
|
|
113
|
-
type="button"
|
|
114
|
-
onClick={onClick}
|
|
115
|
-
className={cn(
|
|
116
|
-
'flex items-center justify-center',
|
|
117
|
-
'size-[36px] p-1 rounded-[18px]',
|
|
118
|
-
'bg-white shadow-[0px_0px_10px_0px_rgba(0,0,0,0.06)]',
|
|
119
|
-
'cursor-pointer',
|
|
120
|
-
'hover:bg-gray-50',
|
|
121
|
-
'text-gray-600',
|
|
122
|
-
transCls,
|
|
123
|
-
className
|
|
124
|
-
)}
|
|
125
|
-
>
|
|
126
|
-
{direction === 'left' ? <ChevronLeftIcon /> : <ChevronRightIcon />}
|
|
127
|
-
</button>
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const GradientOverlay = ({
|
|
132
|
-
direction,
|
|
133
|
-
height,
|
|
134
|
-
visible,
|
|
135
|
-
}: {
|
|
136
|
-
direction: 'left' | 'right';
|
|
137
|
-
height: number;
|
|
138
|
-
visible: boolean;
|
|
139
|
-
}) => {
|
|
140
|
-
const isLeft = direction === 'left';
|
|
141
|
-
return (
|
|
142
|
-
<div
|
|
143
|
-
className={cn(
|
|
144
|
-
'absolute top-[8px] pointer-events-none z-[5]',
|
|
145
|
-
isLeft ? 'left-0' : 'right-0',
|
|
146
|
-
transCls,
|
|
147
|
-
visible ? 'opacity-100' : 'opacity-0'
|
|
148
|
-
)}
|
|
149
|
-
style={{ height: `${height}px`, width: '46px' }}
|
|
150
|
-
>
|
|
151
|
-
{/* Gradient layer - from white via white@63.57% to transparent */}
|
|
152
|
-
<div
|
|
153
|
-
className={cn(
|
|
154
|
-
'absolute inset-0',
|
|
155
|
-
isLeft
|
|
156
|
-
? 'bg-gradient-to-r from-white via-white via-[63.57%] to-transparent'
|
|
157
|
-
: 'bg-gradient-to-l from-white via-white via-[63.57%] to-transparent'
|
|
158
|
-
)}
|
|
159
|
-
/>
|
|
160
|
-
{/* Blur layer */}
|
|
161
|
-
<div className="absolute inset-0 bg-white blur-[7px]" />
|
|
162
|
-
</div>
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export const AttachmentsPreviewer = ({
|
|
167
|
-
attachments,
|
|
168
|
-
className,
|
|
169
|
-
imageSize = 53,
|
|
170
|
-
gap = 10,
|
|
171
|
-
onImageClick,
|
|
172
|
-
onImageRemove,
|
|
173
|
-
}: AttachmentsPreviewerProps) => {
|
|
174
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
175
|
-
const scrollRef = useRef<HTMLDivElement>(null);
|
|
176
|
-
const [showLeftNav, setShowLeftNav] = useState(false);
|
|
177
|
-
const [showRightNav, setShowRightNav] = useState(false);
|
|
178
|
-
|
|
179
|
-
const checkScroll = useCallback(() => {
|
|
180
|
-
const el = scrollRef.current;
|
|
181
|
-
if (!el) return;
|
|
182
|
-
|
|
183
|
-
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
184
|
-
setShowLeftNav(scrollLeft > 0);
|
|
185
|
-
setShowRightNav(scrollLeft + clientWidth < scrollWidth - 1);
|
|
186
|
-
}, []);
|
|
187
|
-
|
|
188
|
-
useEffect(() => {
|
|
189
|
-
checkScroll();
|
|
190
|
-
const el = scrollRef.current;
|
|
191
|
-
if (!el) return;
|
|
192
|
-
|
|
193
|
-
el.addEventListener('scroll', checkScroll);
|
|
194
|
-
window.addEventListener('resize', checkScroll);
|
|
195
|
-
|
|
196
|
-
return () => {
|
|
197
|
-
el.removeEventListener('scroll', checkScroll);
|
|
198
|
-
window.removeEventListener('resize', checkScroll);
|
|
199
|
-
};
|
|
200
|
-
}, [checkScroll, attachments]);
|
|
201
|
-
|
|
202
|
-
const scroll = (direction: 'left' | 'right') => {
|
|
203
|
-
const el = scrollRef.current;
|
|
204
|
-
if (!el) return;
|
|
205
|
-
|
|
206
|
-
const scrollAmount = imageSize + gap;
|
|
207
|
-
const newScrollLeft =
|
|
208
|
-
direction === 'left' ? el.scrollLeft - scrollAmount * 2 : el.scrollLeft + scrollAmount * 2;
|
|
209
|
-
|
|
210
|
-
el.scrollTo({
|
|
211
|
-
left: newScrollLeft,
|
|
212
|
-
behavior: 'smooth',
|
|
213
|
-
});
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
if (!attachments.length) {
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return (
|
|
221
|
-
<div
|
|
222
|
-
ref={containerRef}
|
|
223
|
-
className={cn('relative w-full', className)}
|
|
224
|
-
style={{ height: imageSize + 16 }}
|
|
225
|
-
>
|
|
226
|
-
{/* Scrollable images container */}
|
|
227
|
-
<div
|
|
228
|
-
ref={scrollRef}
|
|
229
|
-
className="flex overflow-x-auto scrollbar-hide py-[8px]"
|
|
230
|
-
style={{ gap, height: imageSize + 16 }}
|
|
231
|
-
>
|
|
232
|
-
{attachments.map((attachment, index) => {
|
|
233
|
-
const isImage = isImageType(attachment.contentType);
|
|
234
|
-
const { icon: Icon, iconSize } = getFileConfig(attachment.contentType, attachment.alt);
|
|
235
|
-
const scaledIconSize = (52 / 102) * imageSize;
|
|
236
|
-
const iconScale = scaledIconSize / iconSize;
|
|
237
|
-
|
|
238
|
-
return (
|
|
239
|
-
<div
|
|
240
|
-
key={attachment.id}
|
|
241
|
-
className={cn(
|
|
242
|
-
'relative shrink-0 cursor-pointer group border border-[#e0e0e0] rounded-[10px]',
|
|
243
|
-
transCls
|
|
244
|
-
)}
|
|
245
|
-
style={{ width: imageSize, height: imageSize }}
|
|
246
|
-
onClick={() => onImageClick?.(attachment, index)}
|
|
247
|
-
>
|
|
248
|
-
{isImage && attachment.url ? (
|
|
249
|
-
<img
|
|
250
|
-
src={attachment.url}
|
|
251
|
-
alt={attachment.alt || `Attachment ${index + 1}`}
|
|
252
|
-
className="absolute inset-0 h-full w-full rounded-[10px] object-cover"
|
|
253
|
-
/>
|
|
254
|
-
) : (
|
|
255
|
-
<div className="absolute inset-0 flex h-full w-full items-center justify-center rounded-[10px] bg-[#EFF0F6]">
|
|
256
|
-
<div
|
|
257
|
-
className="shrink-0 flex items-center justify-center"
|
|
258
|
-
style={{ width: scaledIconSize, height: scaledIconSize }}
|
|
259
|
-
>
|
|
260
|
-
<div
|
|
261
|
-
style={{
|
|
262
|
-
transform: iconScale !== 1 ? `scale(${iconScale})` : undefined,
|
|
263
|
-
transformOrigin: 'center',
|
|
264
|
-
}}
|
|
265
|
-
>
|
|
266
|
-
<Icon />
|
|
267
|
-
</div>
|
|
268
|
-
</div>
|
|
269
|
-
</div>
|
|
270
|
-
)}
|
|
271
|
-
|
|
272
|
-
{attachment.isLoading && (
|
|
273
|
-
<div className="absolute inset-0 flex items-center justify-center rounded-[10px] bg-black/50 pointer-events-none">
|
|
274
|
-
<div className="inline-flex animate-spin items-center justify-center">
|
|
275
|
-
<LoaderIcon size={16} />
|
|
276
|
-
</div>
|
|
277
|
-
</div>
|
|
278
|
-
)}
|
|
279
|
-
|
|
280
|
-
{onImageRemove /* && !attachment.isLoading*/ && (
|
|
281
|
-
<button
|
|
282
|
-
className={cn(
|
|
283
|
-
'absolute -top-[6px] -right-[6px]',
|
|
284
|
-
'flex items-center justify-center',
|
|
285
|
-
'opacity-0 group-hover:opacity-100 cursor-pointer',
|
|
286
|
-
transCls
|
|
287
|
-
)}
|
|
288
|
-
onClick={(e) => {
|
|
289
|
-
e.stopPropagation();
|
|
290
|
-
onImageRemove(attachment, index);
|
|
291
|
-
}}
|
|
292
|
-
>
|
|
293
|
-
<RemoveCircleIcon />
|
|
294
|
-
</button>
|
|
295
|
-
)}
|
|
296
|
-
</div>
|
|
297
|
-
);
|
|
298
|
-
})}
|
|
299
|
-
</div>
|
|
300
|
-
|
|
301
|
-
{/* Left navigation */}
|
|
302
|
-
<GradientOverlay direction="left" height={imageSize} visible={showLeftNav} />
|
|
303
|
-
<NavButton
|
|
304
|
-
direction="left"
|
|
305
|
-
onClick={() => scroll('left')}
|
|
306
|
-
className={cn(
|
|
307
|
-
'absolute left-0 top-1/2 -translate-y-1/2 z-10',
|
|
308
|
-
showLeftNav ? 'opacity-100' : 'opacity-0 pointer-events-none'
|
|
309
|
-
)}
|
|
310
|
-
/>
|
|
311
|
-
|
|
312
|
-
{/* Right navigation */}
|
|
313
|
-
<GradientOverlay direction="right" height={imageSize} visible={showRightNav} />
|
|
314
|
-
<NavButton
|
|
315
|
-
direction="right"
|
|
316
|
-
onClick={() => scroll('right')}
|
|
317
|
-
className={cn(
|
|
318
|
-
'absolute right-0 top-1/2 -translate-y-1/2 z-10',
|
|
319
|
-
showRightNav ? 'opacity-100' : 'opacity-0 pointer-events-none'
|
|
320
|
-
)}
|
|
321
|
-
/>
|
|
322
|
-
</div>
|
|
323
|
-
);
|
|
324
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from 'react';
|
|
2
|
-
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
import { transCls } from '@/const/ui';
|
|
5
|
-
import { BsTooltip } from './tooltip';
|
|
6
|
-
|
|
7
|
-
export interface BaseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
-
icon?: ReactNode;
|
|
9
|
-
tooltip?: string;
|
|
10
|
-
hoverTextCls?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const BaseButton = forwardRef<HTMLButtonElement, BaseButtonProps>(
|
|
14
|
-
({ className, children, hoverTextCls, tooltip, icon, type, ...rest }, ref) => {
|
|
15
|
-
const btn = (
|
|
16
|
-
<button
|
|
17
|
-
ref={ref}
|
|
18
|
-
type={type ?? 'button'}
|
|
19
|
-
className={cn(
|
|
20
|
-
'group inline-flex items-center gap-[6px] px-[16px] rounded-[4px] h-[34px]',
|
|
21
|
-
'border border-solid border-[#E0E0E0] bg-transparent',
|
|
22
|
-
'text-[14px] font-[400] leading-[normal] text-[#030303]',
|
|
23
|
-
'hover:bg-[#EFF0F6] hover:border-transparent',
|
|
24
|
-
'cursor-pointer',
|
|
25
|
-
{
|
|
26
|
-
'hover:text-[#0265FF]': !hoverTextCls,
|
|
27
|
-
[`hover:${hoverTextCls}`]: hoverTextCls,
|
|
28
|
-
},
|
|
29
|
-
transCls,
|
|
30
|
-
className
|
|
31
|
-
)}
|
|
32
|
-
{...rest}
|
|
33
|
-
>
|
|
34
|
-
{icon ? <span className="shrink-0">{icon}</span> : null}
|
|
35
|
-
{children ? (
|
|
36
|
-
<span className="whitespace-nowrap">{children}</span>
|
|
37
|
-
) : null}
|
|
38
|
-
</button>
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
if (tooltip) {
|
|
42
|
-
return <BsTooltip content={tooltip}>{btn}</BsTooltip>;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return btn;
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
BaseButton.displayName = 'BaseButton';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { cn } from '@/lib/utils';
|
|
3
|
-
|
|
4
|
-
export interface BorderAnimationProps {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
/** Duration of one full animation cycle in seconds @default 2 */
|
|
8
|
-
duration?: number;
|
|
9
|
-
/** Border radius in pixels @default 4 */
|
|
10
|
-
borderRadius?: number;
|
|
11
|
-
/** Width of the animated beam in pixels @default 30 */
|
|
12
|
-
beamWidth?: number;
|
|
13
|
-
/** Height of the animated beam in pixels @default 4 */
|
|
14
|
-
beamHeight?: number;
|
|
15
|
-
/** Gradient for the animated beam */
|
|
16
|
-
gradient?: string;
|
|
17
|
-
height?: string | number;
|
|
18
|
-
/** Border width in pixels @default 1.5 */
|
|
19
|
-
borderWidth?: number;
|
|
20
|
-
/** Default border color @default '#E5E5E5' */
|
|
21
|
-
borderColor?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const defaultGradient = `linear-gradient(90deg,
|
|
25
|
-
rgba(132, 180, 255, 0) 0%,
|
|
26
|
-
rgba(132, 180, 255, 0.5) 10%,
|
|
27
|
-
rgba(132, 180, 255, 1) 25%,
|
|
28
|
-
rgb(2, 101, 255) 50%,
|
|
29
|
-
rgba(177, 250, 255, 1) 75%,
|
|
30
|
-
rgba(177, 250, 255, 0.5) 90%,
|
|
31
|
-
rgba(177, 250, 255, 0) 100%
|
|
32
|
-
)`;
|
|
33
|
-
|
|
34
|
-
export const BorderAnimation: React.FC<BorderAnimationProps> = ({
|
|
35
|
-
children,
|
|
36
|
-
className,
|
|
37
|
-
duration = 2,
|
|
38
|
-
borderRadius = 4,
|
|
39
|
-
beamWidth = 170,
|
|
40
|
-
beamHeight = 4,
|
|
41
|
-
// gradient = 'linear-gradient(180deg, #84B4FF 0%, #0265FF 50%, #B1FAFF 100%)',
|
|
42
|
-
// gradient = 'linear-gradient(90deg, rgb(132, 180, 255) 0%, rgb(2, 101, 255) 50%, rgb(177, 250, 255) 100%)',
|
|
43
|
-
gradient = defaultGradient,
|
|
44
|
-
borderWidth = 1,
|
|
45
|
-
height,
|
|
46
|
-
borderColor = 'transparent',
|
|
47
|
-
}) => {
|
|
48
|
-
const pseudoCls = "gradient-border"
|
|
49
|
-
return (
|
|
50
|
-
<div
|
|
51
|
-
className={cn('relative w-full overflow-hidden', className, pseudoCls)}
|
|
52
|
-
style={{
|
|
53
|
-
borderRadius: `${borderRadius}px`,
|
|
54
|
-
border: `${borderWidth}px solid ${borderColor}`,
|
|
55
|
-
...(height ? { height } : {}),
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
{/* Animated border overlay */}
|
|
60
|
-
<div
|
|
61
|
-
style={{
|
|
62
|
-
position: 'absolute',
|
|
63
|
-
// inset: `${-borderWidth}px`,
|
|
64
|
-
inset: 0,
|
|
65
|
-
pointerEvents: 'none',
|
|
66
|
-
border: `${borderWidth}px solid transparent`,
|
|
67
|
-
borderRadius: 'inherit',
|
|
68
|
-
// contain: 'layout style paint',
|
|
69
|
-
maskImage:
|
|
70
|
-
'linear-gradient(transparent, transparent), linear-gradient(white, white)',
|
|
71
|
-
WebkitMaskImage:
|
|
72
|
-
'linear-gradient(transparent, transparent), linear-gradient(white, white)',
|
|
73
|
-
maskOrigin: 'border-box, border-box',
|
|
74
|
-
WebkitMaskOrigin: 'border-box, border-box',
|
|
75
|
-
maskClip: 'padding-box, border-box',
|
|
76
|
-
WebkitMaskClip: 'padding-box, border-box',
|
|
77
|
-
maskComposite: 'intersect',
|
|
78
|
-
WebkitMaskComposite: 'source-in',
|
|
79
|
-
}}
|
|
80
|
-
>
|
|
81
|
-
{/* Traveling beam */}
|
|
82
|
-
<div
|
|
83
|
-
style={{
|
|
84
|
-
position: 'absolute',
|
|
85
|
-
aspectRatio: '1 / 1',
|
|
86
|
-
width: `${beamWidth}px`,
|
|
87
|
-
height: `${beamHeight}px`,
|
|
88
|
-
background: gradient,
|
|
89
|
-
offsetPath: `rect(0px auto auto 0px round ${borderRadius}px)`,
|
|
90
|
-
animation: `bs-border-travel ${duration}s linear infinite`,
|
|
91
|
-
willChange: 'offset-distance',
|
|
92
|
-
transform: 'translateZ(0)',
|
|
93
|
-
backfaceVisibility: 'hidden',
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
</div>
|
|
97
|
-
<style>{`
|
|
98
|
-
@keyframes bs-border-travel {
|
|
99
|
-
0% { offset-distance: 0%; }
|
|
100
|
-
100% { offset-distance: 100%; }
|
|
101
|
-
}
|
|
102
|
-
`}</style>
|
|
103
|
-
</div>
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export default BorderAnimation;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
export const BorderColorAnimation = ({
|
|
2
|
-
children,
|
|
3
|
-
width,
|
|
4
|
-
height,
|
|
5
|
-
padding,
|
|
6
|
-
borderWidth = 2,
|
|
7
|
-
borderRadius = 12,
|
|
8
|
-
bgInset,
|
|
9
|
-
style,
|
|
10
|
-
}: {
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
width?: string | number;
|
|
13
|
-
height?: string | number;
|
|
14
|
-
borderWidth?: number;
|
|
15
|
-
padding?: number;
|
|
16
|
-
borderRadius?: number;
|
|
17
|
-
bgInset?: number;
|
|
18
|
-
style?: React.CSSProperties;
|
|
19
|
-
}) => {
|
|
20
|
-
const isNumSize = typeof width === 'number' && typeof height === 'number';
|
|
21
|
-
const safeSize = isNumSize ? Math.max(width ?? 0, height ?? 0) : 0;
|
|
22
|
-
const safeInset = isNumSize ? -1 * safeSize * 1.5 : '-150%'; // ensure the background covers the whole area during rotation
|
|
23
|
-
return (
|
|
24
|
-
<div
|
|
25
|
-
style={{
|
|
26
|
-
position: 'relative',
|
|
27
|
-
width: width ?? '100%',
|
|
28
|
-
height: height ?? '100%',
|
|
29
|
-
borderRadius,
|
|
30
|
-
overflow: 'hidden',
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
<div
|
|
34
|
-
style={{
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
inset: bgInset !== undefined ? -bgInset : safeInset,
|
|
37
|
-
background: 'conic-gradient(from 0deg, #0265FF, #00D4FF, #0265FF, #00D4FF, #0265FF)',
|
|
38
|
-
animation: 'borderRotate 4s linear infinite',
|
|
39
|
-
}}
|
|
40
|
-
/>
|
|
41
|
-
<div
|
|
42
|
-
style={{
|
|
43
|
-
...style,
|
|
44
|
-
position: 'absolute',
|
|
45
|
-
inset: borderWidth,
|
|
46
|
-
borderRadius: borderRadius - 2,
|
|
47
|
-
background: 'white',
|
|
48
|
-
zIndex: 1,
|
|
49
|
-
padding: padding || 0,
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{children}
|
|
53
|
-
</div>
|
|
54
|
-
<style>{`
|
|
55
|
-
@keyframes borderRotate {
|
|
56
|
-
0% {
|
|
57
|
-
transform: rotate(0deg);
|
|
58
|
-
}
|
|
59
|
-
100% {
|
|
60
|
-
transform: rotate(360deg);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`}</style>
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { BotIcon } from './bot-icon';
|
|
2
|
-
|
|
3
|
-
export const BotAvatarAndName = ({
|
|
4
|
-
name,
|
|
5
|
-
icon,
|
|
6
|
-
variant = 'default',
|
|
7
|
-
}: {
|
|
8
|
-
name: string;
|
|
9
|
-
icon?: React.ReactNode;
|
|
10
|
-
variant?: 'default' | 'active';
|
|
11
|
-
}) => {
|
|
12
|
-
const size = variant === 'default' ? 20 : 24;
|
|
13
|
-
|
|
14
|
-
const variantStyles = {
|
|
15
|
-
default: 'text-[#999] text-[14px] font-[400]',
|
|
16
|
-
active: 'text-[#0265FF] text-[14px] font-[700]',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div className="flex items-center gap-1.5">
|
|
21
|
-
{icon || <BotIcon size={size} />}
|
|
22
|
-
<div className={variantStyles[variant]}>{name}</div>
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BotImgUrl } from "@/const/ui";
|
|
2
|
-
|
|
3
|
-
export const BotIcon = ({
|
|
4
|
-
size = 30,
|
|
5
|
-
className,
|
|
6
|
-
}: {
|
|
7
|
-
size?: number;
|
|
8
|
-
className?: string;
|
|
9
|
-
}) => {
|
|
10
|
-
return (
|
|
11
|
-
<div
|
|
12
|
-
className={className}
|
|
13
|
-
style={{
|
|
14
|
-
backgroundImage: `${BotImgUrl}`,
|
|
15
|
-
backgroundRepeat: "no-repeat",
|
|
16
|
-
backgroundSize: "cover",
|
|
17
|
-
width: size,
|
|
18
|
-
height: size,
|
|
19
|
-
aspectRatio: "1/1",
|
|
20
|
-
}}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
};
|