@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.impl.d.ts","sourceRoot":"","sources":["../../src/sdk.impl.tsx"],"names":[],"mappings":"AAGA,OAAO,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,OAAO,EAER,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EA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S,CAAC,EAAE,WAAW;IAQtD,YAAY,CAAC,KAAK,EAAE,MAAM;IAa1B,aAAa;IAIb,aAAa;IAIb,YAAY;IAIZ,YAAY,CAAC,SAAS,CAAC,EAAE,WAAW;IAWpC,cAAc;IAMd,WAAW;IAIX,YAAY;IAIZ,mBAAmB,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,GAAE,OAAmB,EAAE,EAAE,CAAC,EAAE,MAAM;IAW/E,mBAAmB,CAAC,EAAE,CAAC,EAAE,MAAM;IAWtC,OAAO,CAAC,qBAAqB;IAStB,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAIhC,OAAO;CASf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ChatStore } from '.';
|
|
3
|
+
import { ChatContextType } from '@baishuyun/types';
|
|
4
|
+
export declare const ChatStoreCtx: import('react').Context<{
|
|
5
|
+
chatStore: ChatStore;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const ChatStoreProvider: FC<{
|
|
8
|
+
store: ChatStore;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const useChatStore: <T>(selector: (store: ChatContextType) => T) => T;
|
|
12
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/store/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,EAAE,EAAc,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,eAAO,MAAM,YAAY;eACZ,SAAS;EAET,CAAC;AAEd,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC;IACjC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAEA,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,CAAC,KAAK,CAG1E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChatContextType, IChatSDKOption } from '@baishuyun/types';
|
|
2
|
+
import { ChatSDK } from '..';
|
|
3
|
+
export declare const createStore: (sdkInst: ChatSDK) => import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<ChatContextType>, "subscribe"> & {
|
|
4
|
+
subscribe: {
|
|
5
|
+
(listener: (selectedState: ChatContextType, previousSelectedState: ChatContextType) => void): () => void;
|
|
6
|
+
<U>(selector: (state: ChatContextType) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
7
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
8
|
+
fireImmediately?: boolean;
|
|
9
|
+
} | undefined): () => void;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
export declare const setupStoreSubscriptions: (store: ChatStore, option: IChatSDKOption) => void;
|
|
13
|
+
export type ChatStore = ReturnType<typeof createStore>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAIf,cAAc,EAGf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAI7B,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO;;;;;;;;EAsG3C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,SAAS,EAAE,QAAQ,cAAc,SAY/E,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FormulaField } from '../plugins/report-query-plugin/components/result-cards/FormulaField';
|
|
3
|
+
declare const meta: Meta<typeof FormulaField>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
/** COUNT → 计数 */
|
|
7
|
+
export declare const Count: Story;
|
|
8
|
+
/** SUM → 求和 */
|
|
9
|
+
export declare const Sum: Story;
|
|
10
|
+
/** MAX → 最大值 */
|
|
11
|
+
export declare const Max: Story;
|
|
12
|
+
/** MIN → 最小值 */
|
|
13
|
+
export declare const Min: Story;
|
|
14
|
+
/** AVERAGE → 平均 */
|
|
15
|
+
export declare const Average: Story;
|
|
16
|
+
/** COUNTDISTINCT → 去重计数 */
|
|
17
|
+
export declare const CountDistinct: Story;
|
|
18
|
+
/** 算术表达式(无聚合函数) → 不显示 tag */
|
|
19
|
+
export declare const ArithmeticExpression: Story;
|
|
20
|
+
/** 长标题截断 */
|
|
21
|
+
export declare const LongTitle: Story;
|
|
22
|
+
/** 多条公式一览 */
|
|
23
|
+
export declare const MultipleFormulas: Story;
|
|
24
|
+
//# sourceMappingURL=FormulaField.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormulaField.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/FormulaField.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,oEAAoE,CAAC;AAElG,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAqBC,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,iBAAiB;AACjB,eAAO,MAAM,KAAK,EAAE,KAAU,CAAC;AAE/B,eAAe;AACf,eAAO,MAAM,GAAG,EAAE,KAQjB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,GAAG,EAAE,KAQjB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,GAAG,EAAE,KAQjB,CAAC;AAEF,mBAAmB;AACnB,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,aAAa,EAAE,KAQ3B,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,oBAAoB,EAAE,KAQlC,CAAC;AAEF,YAAY;AACZ,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC;AAEF,aAAa;AACb,eAAO,MAAM,gBAAgB,EAAE,KAgC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/chat-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.jsx",
|
|
6
6
|
"module": "dist/chat-sdk.js",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"tw-animate-css": "^1.4.0",
|
|
36
36
|
"use-stick-to-bottom": "^1.1.1",
|
|
37
37
|
"zustand": "^5.0.8",
|
|
38
|
-
"@baishuyun/agents": "
|
|
38
|
+
"@baishuyun/agents": "1.0.0",
|
|
39
|
+
"@baishuyun/ai-design": "1.0.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@storybook/react-vite": "^10.1.11",
|
|
@@ -51,8 +52,8 @@
|
|
|
51
52
|
"tailwindcss": "^4.1.17",
|
|
52
53
|
"vite": "^5.1.4",
|
|
53
54
|
"vite-plugin-dts": "^4.5.4",
|
|
54
|
-
"@baishuyun/
|
|
55
|
-
"@baishuyun/
|
|
55
|
+
"@baishuyun/types": "2.0.0",
|
|
56
|
+
"@baishuyun/typescript-config": "1.0.0"
|
|
56
57
|
},
|
|
57
58
|
"exports": {
|
|
58
59
|
".": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import { MessageContent } from './message-content';
|
|
3
3
|
import { cn } from '@/lib/utils';
|
|
4
|
-
import { BotAvatarAndName } from '
|
|
4
|
+
import { BotAvatarAndName } from '@baishuyun/ai-design/bot-avatar-name';
|
|
5
5
|
import { useDefaultPluginCustomComponent } from '@/hooks/use-plugin-custom-components';
|
|
6
6
|
import { useChatStore } from '@/store/context';
|
|
7
7
|
|
|
@@ -3,8 +3,8 @@ import { FieldType, ValueOf } from '@baishuyun/types';
|
|
|
3
3
|
import { FieldTypeNameMap } from '@/const';
|
|
4
4
|
import { ToolUIPart } from 'ai';
|
|
5
5
|
import { FieldsTools, Option } from '@baishuyun/agents';
|
|
6
|
-
import LineChecker from '
|
|
7
|
-
import { OptionItem } from '
|
|
6
|
+
import LineChecker from '@baishuyun/ai-design/line-checker';
|
|
7
|
+
import { OptionItem } from '@baishuyun/ai-design/option-item';
|
|
8
8
|
import { FieldIcon } from '@/components/biz-comp/field-icon';
|
|
9
9
|
|
|
10
10
|
type Field = ValueOf<Pick<ToolUIPart<FieldsTools>, 'output'>>;
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
useMemo,
|
|
8
8
|
useState,
|
|
9
9
|
} from 'react';
|
|
10
|
-
import { CollapsibleTxtMsg } from '
|
|
10
|
+
import { CollapsibleTxtMsg } from '@baishuyun/ai-design/collapsible-txt-msg';
|
|
11
11
|
import { FieldChecker, FieldCheckerProps } from './FieldChecker';
|
|
12
|
-
import { EditIcon, LetterAIcon } from '
|
|
12
|
+
import { EditIcon, LetterAIcon } from '@baishuyun/ai-design/bs-icons';
|
|
13
13
|
import { FieldValueChecker, FieldValueCheckerProps } from './FieldValueChecker';
|
|
14
|
-
import { SquareChecker } from '
|
|
14
|
+
import { SquareChecker } from '@baishuyun/ai-design/square-checker';
|
|
15
15
|
import { cn } from '@/lib/utils';
|
|
16
16
|
|
|
17
17
|
export interface FieldCheckerListMsgRef {
|
|
@@ -6,7 +6,7 @@ import { FieldsTools } from '@baishuyun/agents';
|
|
|
6
6
|
import { isSubformFieldEqual } from '@/lib/utils';
|
|
7
7
|
import { toHumanReadable } from '@/plugins/form-filling-plugin/utils';
|
|
8
8
|
import { SubformFieldsValueChecker } from './SubformFieldsValueChecker';
|
|
9
|
-
import LineChecker from '
|
|
9
|
+
import LineChecker from '@baishuyun/ai-design/line-checker';
|
|
10
10
|
|
|
11
11
|
type Field = ValueOf<Pick<ToolUIPart<FieldsTools>, 'output'>>;
|
|
12
12
|
|
|
@@ -5,7 +5,7 @@ import { ToolUIPart } from 'ai';
|
|
|
5
5
|
import { FieldsTools } from '@baishuyun/agents';
|
|
6
6
|
import { toHumanReadable } from '@/plugins/form-filling-plugin/utils';
|
|
7
7
|
import { Collapsible, /* CollapsibleTrigger,*/ CollapsibleContent } from '../ui/collapsible';
|
|
8
|
-
import LineChecker from '
|
|
8
|
+
import LineChecker from '@baishuyun/ai-design/line-checker';
|
|
9
9
|
|
|
10
10
|
const Checker = ({
|
|
11
11
|
disabled,
|
|
@@ -7,11 +7,11 @@ import { cn } from '@/lib/utils';
|
|
|
7
7
|
import { ReactPortal } from 'react';
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { useChatStatus } from '@/hooks/use-frame-mode';
|
|
10
|
-
import { PrimaryEntryBtn } from '
|
|
10
|
+
import { PrimaryEntryBtn } from '@baishuyun/ai-design/primary-entry-btn';
|
|
11
11
|
import { useShadow } from '@/hooks/use-shadow';
|
|
12
|
-
import { ChatAreaHeader } from '
|
|
12
|
+
import { ChatAreaHeader } from '@baishuyun/ai-design/chat-area-header';
|
|
13
13
|
import { useDefaultPluginCustomComponent } from '@/hooks/use-plugin-custom-components';
|
|
14
|
-
import { BotAvatarAndName } from '
|
|
14
|
+
import { BotAvatarAndName } from '@baishuyun/ai-design/bot-avatar-name';
|
|
15
15
|
import { ChatEntryButtonConfig } from '@baishuyun/types';
|
|
16
16
|
import { useDraggable } from '@/hooks/use-draggable';
|
|
17
17
|
import { TooltipProvider } from '../ui/tooltip';
|
|
@@ -3,7 +3,7 @@ import React, { useCallback } from 'react';
|
|
|
3
3
|
import { StickToBottom, StickToBottomProps, useStickToBottomContext } from 'use-stick-to-bottom';
|
|
4
4
|
import { Button } from '@/components/ui/button';
|
|
5
5
|
import cn from 'classnames';
|
|
6
|
-
import { ScrollToBottomBtn } from '
|
|
6
|
+
import { ScrollToBottomBtn } from '@baishuyun/ai-design/scroll-to-bottom-btn';
|
|
7
7
|
|
|
8
8
|
export type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FIELD_ICON_CODE_MAP } from '@/const';
|
|
2
2
|
import { FieldType } from '@baishuyun/types';
|
|
3
|
-
import { FontIcon } from '
|
|
4
|
-
import { FormulasIcon } from '
|
|
3
|
+
import { FontIcon } from '@baishuyun/ai-design/font-icon';
|
|
4
|
+
import { FormulasIcon } from '@baishuyun/ai-design/bs-icons';
|
|
5
5
|
|
|
6
6
|
export const FieldIcon = ({ type }: { type: FieldType }) => {
|
|
7
7
|
const code = FIELD_ICON_CODE_MAP[type] || 'unknown';
|
|
@@ -2,9 +2,9 @@ import { MsgPartCompProps } from '@baishuyun/types';
|
|
|
2
2
|
import { MessageContent } from './message-content';
|
|
3
3
|
import { cn, sanitizeText } from '@/lib/utils';
|
|
4
4
|
import { MemoizedMarkdown } from './markdown';
|
|
5
|
-
import { UserTextMsgBubble } from '
|
|
6
|
-
import { CollapsibleTxtMsg } from '
|
|
7
|
-
import { AnalysisIcon } from '
|
|
5
|
+
import { UserTextMsgBubble } from '@baishuyun/ai-design/user-txt-msg-bubble';
|
|
6
|
+
import { CollapsibleTxtMsg } from '@baishuyun/ai-design/collapsible-txt-msg';
|
|
7
|
+
import { AnalysisIcon } from '@baishuyun/ai-design/bs-icons';
|
|
8
8
|
import { UIDataTypes, UIMessagePart, UITools } from 'ai';
|
|
9
9
|
import { formatJSONIfValid } from '@/lib/utils';
|
|
10
10
|
|
|
@@ -8,7 +8,7 @@ export type MessageContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
8
8
|
export const MessageContent = ({ children, className, ...props }: MessageContentProps) => (
|
|
9
9
|
<div
|
|
10
10
|
className={cn(
|
|
11
|
-
'flex flex-col gap-
|
|
11
|
+
'flex flex-col gap-2.5 overflow-hidden p-0 text-foreground text-[14px]',
|
|
12
12
|
'group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground',
|
|
13
13
|
'group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground',
|
|
14
14
|
'is-user:dark overflow-visible',
|
|
@@ -5,7 +5,7 @@ import { FakeBotMessage } from './FakeBotMsg';
|
|
|
5
5
|
import { OpeningLines } from './opening-lines';
|
|
6
6
|
import { useRef } from 'react';
|
|
7
7
|
import { useFakeGlobalLoadingMessage } from '@/hooks/use-frame-mode';
|
|
8
|
-
import { GenerateAnimation } from '
|
|
8
|
+
import { GenerateAnimation } from '@baishuyun/ai-design/generate-animation';
|
|
9
9
|
|
|
10
10
|
export const Messages = (props: MessagesProps) => {
|
|
11
11
|
const messagesContainerRef = useRef(null);
|
|
@@ -20,7 +20,10 @@ export const Messages = (props: MessagesProps) => {
|
|
|
20
20
|
ref={messagesContainerRef}
|
|
21
21
|
style={{ overflowAnchor: 'none', overscrollBehavior: 'contain' }}
|
|
22
22
|
>
|
|
23
|
-
<Conversation
|
|
23
|
+
<Conversation
|
|
24
|
+
className="mx-auto flex min-w-0 max-w-4xl flex-col"
|
|
25
|
+
resize={props.status === 'streaming' ? 'instant' : 'smooth'}
|
|
26
|
+
>
|
|
24
27
|
<ConversationContent className="flex flex-col px-2 py-4 md:px-4">
|
|
25
28
|
{messages.length === 0 && (
|
|
26
29
|
<FakeBotMessage>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TrashIcon } from '
|
|
1
|
+
import { TrashIcon } from '@baishuyun/ai-design/bs-icons';
|
|
2
2
|
import type { UseChatHelpers } from '@ai-sdk/react';
|
|
3
3
|
import { usePluginLifeCycleChainRunner } from '@/hooks/use-plugin-life-cycle-chain-runner';
|
|
4
4
|
import { ChatMessage } from '@baishuyun/types';
|
|
5
5
|
import { useCallback, useEffect } from 'react';
|
|
6
6
|
import { useChatStore } from '@/store/context';
|
|
7
|
-
import { IconBtn } from '
|
|
7
|
+
import { IconBtn } from '@baishuyun/ai-design/icon-btn';
|
|
8
8
|
|
|
9
9
|
export const ClearBtn = ({
|
|
10
10
|
setMessages,
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
PromptInputToolbar,
|
|
20
20
|
PromptInputTools,
|
|
21
21
|
} from './prompt-input';
|
|
22
|
-
import { AttachmentsPreviewer } from '
|
|
22
|
+
import { AttachmentsPreviewer } from '@baishuyun/ai-design/attachments-previewer';
|
|
23
23
|
import { ChatMessage, Attachment } from '@baishuyun/types';
|
|
24
24
|
import { Button } from '@/components/ui/button';
|
|
25
25
|
import { usePluginLifeCycleChainRunner } from '@/hooks/use-plugin-life-cycle-chain-runner';
|
|
26
26
|
import { ClearBtn } from './clear-btn';
|
|
27
|
-
import { IconBtn } from '
|
|
28
|
-
import { DividerIcon, PlaneIcon, UploadIcon } from '
|
|
27
|
+
import { IconBtn } from '@baishuyun/ai-design/icon-btn';
|
|
28
|
+
import { DividerIcon, PlaneIcon, UploadIcon } from '@baishuyun/ai-design/bs-icons';
|
|
29
29
|
import { useChatPreference } from '@/hooks/use-chat-preference';
|
|
30
30
|
import { useToast } from '@/hooks/use-toast';
|
|
31
|
-
import { BsTooltip } from '
|
|
31
|
+
import { BsTooltip } from '@baishuyun/ai-design/tooltip';
|
|
32
32
|
import { useChatStatus } from '@/hooks/use-frame-mode';
|
|
33
33
|
import { useVoiceInput } from '@/hooks/use-voice-input';
|
|
34
34
|
import { VoiceButton } from './voice-btn';
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
} from '@/components/ui/select';
|
|
14
14
|
import { Textarea } from '@/components/ui/textarea';
|
|
15
15
|
import { cn } from '@/lib/utils';
|
|
16
|
-
import { StopIcon } from '
|
|
17
|
-
import { BsTooltip } from '
|
|
16
|
+
import { StopIcon } from '@baishuyun/ai-design/bs-icons';
|
|
17
|
+
import { BsTooltip } from '@baishuyun/ai-design/tooltip';
|
|
18
18
|
|
|
19
19
|
export type PromptInputProps = HTMLAttributes<HTMLFormElement>;
|
|
20
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { memo } from 'react';
|
|
2
|
-
import { IconBtn } from '
|
|
3
|
-
import { MicrophoneIcon } from '
|
|
2
|
+
import { IconBtn } from '@baishuyun/ai-design/icon-btn';
|
|
3
|
+
import { MicrophoneIcon } from '@baishuyun/ai-design/bs-icons';
|
|
4
4
|
|
|
5
5
|
export interface VoiceButtonProps {
|
|
6
6
|
isRecording: boolean;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { MsgSenderRole } from '@baishuyun/types';
|
|
3
|
-
import { BotAvatarAndName } from '
|
|
4
|
-
import { useState } from 'react';
|
|
3
|
+
import { BotAvatarAndName } from '@baishuyun/ai-design/bot-avatar-name';
|
|
5
4
|
import { useDefaultPluginCustomComponent } from '@/hooks/use-plugin-custom-components';
|
|
6
5
|
import { ComponentType } from 'react';
|
|
7
|
-
import { IconBtn } from '
|
|
8
|
-
import { CopyIcon, RefreshIcon } from '
|
|
6
|
+
import { IconBtn } from '@baishuyun/ai-design/icon-btn';
|
|
7
|
+
import { CopyIcon, RefreshIcon } from '@baishuyun/ai-design/bs-icons';
|
|
9
8
|
import { useChatPreference } from '@/hooks/use-chat-preference';
|
|
10
|
-
import { GenerateAnimation } from '
|
|
9
|
+
import { GenerateAnimation } from '@baishuyun/ai-design/generate-animation';
|
|
11
10
|
import { useChatStore } from '@/store/context';
|
|
11
|
+
import { useStreamingAnchor } from '@/hooks/use-streaming-anchor';
|
|
12
12
|
|
|
13
13
|
export const PreviewMessageWrapper = ({
|
|
14
14
|
role,
|
|
@@ -32,6 +32,8 @@ export const PreviewMessageWrapper = ({
|
|
|
32
32
|
const isBot = role === 'assistant';
|
|
33
33
|
const isUser = role === 'user';
|
|
34
34
|
|
|
35
|
+
const [containerRef, streamingMinHeight] = useStreamingAnchor(isLoading);
|
|
36
|
+
|
|
35
37
|
const chatPref = useChatPreference();
|
|
36
38
|
const botInfo = useChatStore((state) => state.botInfo);
|
|
37
39
|
|
|
@@ -50,7 +52,7 @@ export const PreviewMessageWrapper = ({
|
|
|
50
52
|
const actionBarJsx = (
|
|
51
53
|
<div
|
|
52
54
|
className={cn(
|
|
53
|
-
'flex items-center gap-2.5 text-[#666] h-
|
|
55
|
+
'flex items-center gap-2.5 text-[#666] h-10',
|
|
54
56
|
visibilityCls,
|
|
55
57
|
pointerEventsCls
|
|
56
58
|
)}
|
|
@@ -76,7 +78,12 @@ export const PreviewMessageWrapper = ({
|
|
|
76
78
|
|
|
77
79
|
return (
|
|
78
80
|
<div
|
|
81
|
+
ref={containerRef}
|
|
79
82
|
className="group/message w-full"
|
|
83
|
+
style={{
|
|
84
|
+
contain: 'layout',
|
|
85
|
+
minHeight: isLoading && streamingMinHeight ? streamingMinHeight : undefined,
|
|
86
|
+
}}
|
|
80
87
|
data-role={role}
|
|
81
88
|
data-testid={`message-${role}`}
|
|
82
89
|
// onMouseEnter={() => setIsHovered(true)}
|
|
@@ -92,7 +99,7 @@ export const PreviewMessageWrapper = ({
|
|
|
92
99
|
|
|
93
100
|
<div
|
|
94
101
|
className={cn('flex flex-col min-w-0', {
|
|
95
|
-
'gap-
|
|
102
|
+
'gap-2.5': hasTextPart,
|
|
96
103
|
grow: isBot,
|
|
97
104
|
'items-end': role === 'user',
|
|
98
105
|
'min-h-96': isBot && requiresScrollPadding,
|
|
@@ -19,13 +19,13 @@ import {
|
|
|
19
19
|
getMetaErrorMsg,
|
|
20
20
|
} from '@/lib/utils';
|
|
21
21
|
import { FakeBotMessage } from './FakeBotMsg';
|
|
22
|
-
import { WarningMessage } from '
|
|
23
|
-
import { GenerateAnimation } from '
|
|
24
|
-
import { AttachmentPartGroup } from '
|
|
25
|
-
import { AttachmentPart } from '
|
|
22
|
+
import { WarningMessage } from '@baishuyun/ai-design/warning-msg';
|
|
23
|
+
import { GenerateAnimation } from '@baishuyun/ai-design/generate-animation';
|
|
24
|
+
import { AttachmentPartGroup } from '@baishuyun/ai-design/attachment-part-group';
|
|
25
|
+
import { AttachmentPart } from '@baishuyun/ai-design/attachment-part';
|
|
26
26
|
import { useChatStatus } from '@/hooks/use-frame-mode';
|
|
27
27
|
import { useEvtBus } from '@/hooks/use-evt-bus';
|
|
28
|
-
import type { FilePart } from '
|
|
28
|
+
import type { FilePart } from '@baishuyun/ai-design/attachment-part';
|
|
29
29
|
import { useChatStore } from '@/store/context';
|
|
30
30
|
|
|
31
31
|
const PurePreviewMessage = ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Card, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
|
2
2
|
import { cn } from '@/lib/utils';
|
|
3
|
-
import { Card as BsCard } from '
|
|
3
|
+
import { Card as BsCard } from '@baishuyun/ai-design/card';
|
|
4
4
|
import { ISuggestion, SuggestionCardProps } from '@baishuyun/types';
|
|
5
|
-
import { BagIcon, BuildingIcon, UserIcon } from '
|
|
5
|
+
import { BagIcon, BuildingIcon, UserIcon } from '@baishuyun/ai-design/bs-icons';
|
|
6
6
|
|
|
7
7
|
export const SuggestionCard = ({
|
|
8
8
|
title,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRoot, Root } from 'react-dom/client';
|
|
2
2
|
import { createElement } from 'react';
|
|
3
|
-
import { FieldsPreviewer, FieldsPreviewerProps } from '
|
|
3
|
+
import { FieldsPreviewer, FieldsPreviewerProps } from '@baishuyun/ai-design/fields-previewer';
|
|
4
4
|
|
|
5
5
|
// Declare the global SDK styles injected by vite
|
|
6
6
|
declare const __SDK_STYLES__: string;
|
package/src/const/ui.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormIconOption } from '
|
|
1
|
+
import { FormIconOption } from '@baishuyun/ai-design/form-info-editor';
|
|
2
2
|
|
|
3
3
|
export const BotImgUrl = `
|
|
4
4
|
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABMdSURBVHgB7VoJlF1Vld33vffnX79+TalKqpKQEQQiGhIUJYDKqIZBxVYQW9FWWQuWK7at3SBL2rZdirYRAV3gkrZbXS3EAUEMtEoEHJgbYiDzWEmlUuOv+vN/793b+9z3E7FAkkjbq9tVN3n577//hrvvOWfvc84LMD2mx/SYHtNjekyP6XFkQ3Fzzj///MQVV1wxq3kshr/gob770NNXjWpj+qvabJ5oDDePu/hLHOdceOHs0BizuWTCX48as2EsCB7oL/zyaO7h4P/RWPraMxfcuqWOsQYc7Wgg6Thtyj/+aO6h8OcZcl8jO5dccomb5PD9WOurXnVix0S5lHW0VhJ5TuiEqdZ8cf0TTxe2locLT95zT2XKPXDwPgfHt31TfmZXkFzW5ah4SmPR4NBnlszt/cep5/05hyUSOzNj1Gc+8/kl996/7tPb+wcfm2gEE2UerHOrcpsIo09fNsahH2rj+6EJxU85eEhPFP3hnbv3/2bNmvs//dFPfOrYKc+JXf31x97X8pXAfKzujz21ZdM/NX/7X/HUQ0C/9rXbzti3f+SRSmD0+qGieXS4ZDaU62bAD0yBaAq1uhkr+2a0WONWN+Plhhnh/hj3J3heteqbet03OgiMCULTmAxNraB1vazNEBfioW171q1effNSedaNu4zJf9yYqXM4mkn/KcPjFtxz3y/e/5Zz33jz9n1jaU5cz+7OO62pBGgwiNdqo6E5H36zj7KzlLkqx84y0PKV54RAqDW36DqXs0qSd1NJBwnHQX+guChGFROYvOCfg5zetflDI3e+8l/lFjjKcbR0blf0hhtu6Lr3p/ftj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/H7h90AXvfnf3yvMuOnvBkqUX6QUzlqS8bM9xnHp1ogzix04hN0fqf74FlAuTbJ4LYzOGyzw2ydx5dGQMhVIJY/SAOqujGWefgTZpz6ZRV9XauN49smn3M8/+pLTz8R/efN11O/H7N//h0U78f+I/tbxI09uoM898QyLV1dXitc1KFZl6LTl+fjpMtsRr5XIq0GHSDWPa1EMVVoxJ6oqfcbO1Lds3ljKzZpb3bNpYDGZnqk/edtsRuen0mB7TY3pMj+kxPabH9Pi/MP4bmKmJQPnWQYkAAAAASUVORK5CYII=)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 在流式输出期间为元素锁定高度下限,防止内容回缩导致的视觉抖动。
|
|
5
|
+
*
|
|
6
|
+
* 当 `isStreaming` 从 false 变为 true 时,记录当前元素高度并设为 min-height;
|
|
7
|
+
* 当流式结束时,自动释放 min-height 限制。
|
|
8
|
+
*
|
|
9
|
+
* @param isStreaming 是否处于流式输出状态
|
|
10
|
+
* @returns [ref, minHeight] - ref 绑定到目标元素,minHeight 为应设置的样式值
|
|
11
|
+
*/
|
|
12
|
+
export function useStreamingAnchor(isStreaming?: boolean) {
|
|
13
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
14
|
+
const [streamingMinHeight, setStreamingMinHeight] = useState<number | undefined>(undefined);
|
|
15
|
+
const wasStreamingRef = useRef(isStreaming);
|
|
16
|
+
const heightRef = useRef(0);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!containerRef.current) return;
|
|
20
|
+
|
|
21
|
+
const observer = new ResizeObserver((entries) => {
|
|
22
|
+
const entry = entries[0];
|
|
23
|
+
if (entry) {
|
|
24
|
+
heightRef.current = entry.contentRect.height;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
observer.observe(containerRef.current);
|
|
29
|
+
return () => observer.disconnect();
|
|
30
|
+
}, []);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!wasStreamingRef.current && isStreaming) {
|
|
34
|
+
setStreamingMinHeight(heightRef.current);
|
|
35
|
+
} else if (wasStreamingRef.current && !isStreaming) {
|
|
36
|
+
setStreamingMinHeight(undefined);
|
|
37
|
+
}
|
|
38
|
+
wasStreamingRef.current = isStreaming;
|
|
39
|
+
}, [isStreaming]);
|
|
40
|
+
|
|
41
|
+
return [containerRef, streamingMinHeight] as const;
|
|
42
|
+
}
|
|
@@ -7,12 +7,12 @@ import { ChatMessage, RealFormInfo, UseChatHelpers } from '@baishuyun/types';
|
|
|
7
7
|
import { useEvt } from '@/hooks/use-evt';
|
|
8
8
|
import { parseFormDesignInfo } from '../utils';
|
|
9
9
|
import { useEvtBus } from '@/hooks/use-evt-bus';
|
|
10
|
-
import { PrimaryConfirmBtn } from '
|
|
11
|
-
import FormInfoEditor from '
|
|
10
|
+
import { PrimaryConfirmBtn } from '@baishuyun/ai-design/primary-confirm-btn';
|
|
11
|
+
import FormInfoEditor from '@baishuyun/ai-design/form-info-editor';
|
|
12
12
|
import { FORM_ICON_OPTIONS } from '@/const/ui';
|
|
13
13
|
import { FakeBotMessage } from '@/components/biz-comp/FakeBotMsg';
|
|
14
|
-
import { GenerateAnimation } from '
|
|
15
|
-
import { WarningMessage } from '
|
|
14
|
+
import { GenerateAnimation } from '@baishuyun/ai-design/generate-animation';
|
|
15
|
+
import { WarningMessage } from '@baishuyun/ai-design/warning-msg';
|
|
16
16
|
import { usePluginCtx } from '@/hooks/use-plugin-ctx';
|
|
17
17
|
import { FormInfo, McpFormBuilderPluginCtx } from '../types';
|
|
18
18
|
import { getIconOption } from '@/lib/utils';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MemoizedMarkdown } from '@/components/biz-comp/markdown';
|
|
2
2
|
import { MessageContent } from '@/components/biz-comp/message-content';
|
|
3
|
-
import { AnalysisIcon } from '
|
|
4
|
-
import { CollapsibleTxtMsg } from '
|
|
3
|
+
import { AnalysisIcon } from '@baishuyun/ai-design/bs-icons';
|
|
4
|
+
import { CollapsibleTxtMsg } from '@baishuyun/ai-design/collapsible-txt-msg';
|
|
5
5
|
import { cn, sanitizeText } from '@/lib/utils';
|
|
6
6
|
import { parseRawFormText } from '../utils';
|
|
7
|
-
import { FieldsDesignInfoTable } from '
|
|
7
|
+
import { FieldsDesignInfoTable } from '@baishuyun/ai-design/fields-design-info-table';
|
|
8
8
|
import { parseFormMarkdownDynamic } from '@/lib/parse-design-doc';
|
|
9
9
|
|
|
10
10
|
export const DesignInfo = ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseButton } from '
|
|
2
|
-
import { MagicIcon } from '
|
|
3
|
-
import { PrimaryEntryBtn } from '
|
|
1
|
+
import { BaseButton } from '@baishuyun/ai-design/base-button';
|
|
2
|
+
import { MagicIcon } from '@baishuyun/ai-design/bs-icons';
|
|
3
|
+
import { PrimaryEntryBtn } from '@baishuyun/ai-design/primary-entry-btn';
|
|
4
4
|
import { usePlugin } from '@/hooks/use-plugin';
|
|
5
5
|
import { EntryButtonProps } from '@baishuyun/types';
|
|
6
6
|
import { FormBuilderPlugin } from '..';
|
|
@@ -11,8 +11,8 @@ import { TextUIPart } from 'ai';
|
|
|
11
11
|
import { FormBuilderPlugin } from '..';
|
|
12
12
|
import { MCP_PLUGIN_NAME } from '../const';
|
|
13
13
|
import { usePlugin } from '@/hooks/use-plugin';
|
|
14
|
-
import { PrimaryConfirmBtn } from '
|
|
15
|
-
import { CheckerIcon } from '
|
|
14
|
+
import { PrimaryConfirmBtn } from '@baishuyun/ai-design/primary-confirm-btn';
|
|
15
|
+
import { CheckerIcon } from '@baishuyun/ai-design/bs-icons';
|
|
16
16
|
import { useEvtBus } from '@/hooks/use-evt-bus';
|
|
17
17
|
|
|
18
18
|
export const FieldsPart: React.FC<MsgPartCompProps & IExtraPartProps> = (props) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseButton } from '
|
|
2
|
-
import { FontIcon } from '
|
|
1
|
+
import { BaseButton } from '@baishuyun/ai-design/base-button';
|
|
2
|
+
import { FontIcon } from '@baishuyun/ai-design/font-icon';
|
|
3
3
|
import { SuggestionCardProps } from '@baishuyun/types';
|
|
4
4
|
|
|
5
5
|
const extractFontIconCodeFrom = (desc: string) => {
|
|
@@ -2,7 +2,7 @@ import { usePluginCtx } from '@/hooks/use-plugin-ctx';
|
|
|
2
2
|
import { FormFillingPluginCtx } from '../types';
|
|
3
3
|
import { FormFillingPlugin } from '..';
|
|
4
4
|
import { DATA_COUNT_PER_BATCH, PLUGIN_NAME } from '../const';
|
|
5
|
-
import { PrimaryConfirmBtn } from '
|
|
5
|
+
import { PrimaryConfirmBtn } from '@baishuyun/ai-design/primary-confirm-btn';
|
|
6
6
|
import { OpeningLinesProps } from '@baishuyun/types';
|
|
7
7
|
import { useEvtBus } from '@/hooks/use-evt-bus';
|
|
8
8
|
import { GetSafeFormStructure } from '../utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BotAvatarAndName } from '
|
|
2
|
-
import { ColorfulEditIcon } from '
|
|
1
|
+
import { BotAvatarAndName } from '@baishuyun/ai-design/bot-avatar-name';
|
|
2
|
+
import { ColorfulEditIcon } from '@baishuyun/ai-design/bs-icons';
|
|
3
3
|
import { PLUGIN_NAME } from '../const';
|
|
4
4
|
import { FormFillingPlugin } from '@/index';
|
|
5
5
|
import { FormFillingPluginCtx } from '../types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrimaryConfirmBtn } from '
|
|
1
|
+
import { PrimaryConfirmBtn } from '@baishuyun/ai-design/primary-confirm-btn';
|
|
2
2
|
import { TextUIPart } from 'ai';
|
|
3
3
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { GetSafeFormStructure, valueNormalizer } from '../utils';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ColorfulEditIcon } from '
|
|
2
|
-
import { PrimaryEntryBtn } from '
|
|
1
|
+
import { ColorfulEditIcon } from '@baishuyun/ai-design/bs-icons';
|
|
2
|
+
import { PrimaryEntryBtn } from '@baishuyun/ai-design/primary-entry-btn';
|
|
3
3
|
import { usePluginCtx } from '@/hooks/use-plugin-ctx';
|
|
4
4
|
import { EntryButtonProps, FormFillingMode } from '@baishuyun/types';
|
|
5
5
|
import { FormFillingPluginCtx } from '../types';
|
|
6
6
|
import { FormFillingPlugin } from '..';
|
|
7
7
|
import { PLUGIN_NAME } from '../const';
|
|
8
|
-
import { BaseButton } from '
|
|
8
|
+
import { BaseButton } from '@baishuyun/ai-design/base-button';
|
|
9
9
|
// import { useEvtBus } from '@/hooks/use-evt-bus';
|
|
10
10
|
export const EntryButton = ({ style, onClick, variant }: EntryButtonProps) => {
|
|
11
11
|
const ctx = usePluginCtx<FormFillingPluginCtx, FormFillingPlugin>(PLUGIN_NAME);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import BorderAnimation from '
|
|
2
|
-
import { GenerateAnimation } from '
|
|
1
|
+
import BorderAnimation from '@baishuyun/ai-design/border-animation';
|
|
2
|
+
import { GenerateAnimation } from '@baishuyun/ai-design/generate-animation';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
|
|
5
5
|
export const FirstBatchGeneratingAnimation = memo(() => {
|