@baishuyun/chat-sdk 0.0.1-alpha.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/.storybook/main.ts +21 -0
- package/.storybook/preview-head.html +1 -0
- package/.storybook/preview.ts +16 -0
- package/.turbo/turbo-build.log +82 -0
- package/components.json +22 -0
- package/dist/chat-sdk.js +55613 -0
- package/dist/chat-sdk.js.map +1 -0
- package/dist/chat-sdk.umd.cjs +661 -0
- package/dist/chat-sdk.umd.cjs.map +1 -0
- package/dist/chat.d.ts +5 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/components/biz-comp/FakeBotMsg.d.ts +7 -0
- package/dist/components/biz-comp/FakeBotMsg.d.ts.map +1 -0
- package/dist/components/biz-comp/FieldChecker.d.ts +16 -0
- package/dist/components/biz-comp/FieldChecker.d.ts.map +1 -0
- package/dist/components/biz-comp/FieldCheckerListMsg.d.ts +12 -0
- package/dist/components/biz-comp/FieldCheckerListMsg.d.ts.map +1 -0
- package/dist/components/biz-comp/FieldValueChecker.d.ts +14 -0
- package/dist/components/biz-comp/FieldValueChecker.d.ts.map +1 -0
- package/dist/components/biz-comp/SubformFieldsValueChecker.d.ts +20 -0
- package/dist/components/biz-comp/SubformFieldsValueChecker.d.ts.map +1 -0
- package/dist/components/biz-comp/chat-client.d.ts +13 -0
- package/dist/components/biz-comp/chat-client.d.ts.map +1 -0
- package/dist/components/biz-comp/chat-frame.d.ts +6 -0
- package/dist/components/biz-comp/chat-frame.d.ts.map +1 -0
- package/dist/components/biz-comp/conversation.d.ts +10 -0
- package/dist/components/biz-comp/conversation.d.ts.map +1 -0
- package/dist/components/biz-comp/dock-btn.d.ts +2 -0
- package/dist/components/biz-comp/dock-btn.d.ts.map +1 -0
- package/dist/components/biz-comp/field-icon.d.ts +5 -0
- package/dist/components/biz-comp/field-icon.d.ts.map +1 -0
- package/dist/components/biz-comp/markdown-part.d.ts +5 -0
- package/dist/components/biz-comp/markdown-part.d.ts.map +1 -0
- package/dist/components/biz-comp/markdown.d.ts +5 -0
- package/dist/components/biz-comp/markdown.d.ts.map +1 -0
- package/dist/components/biz-comp/message-content.d.ts +6 -0
- package/dist/components/biz-comp/message-content.d.ts.map +1 -0
- package/dist/components/biz-comp/messages.d.ts +3 -0
- package/dist/components/biz-comp/messages.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/attachment-btn.d.ts +9 -0
- package/dist/components/biz-comp/multi-modal-input/attachment-btn.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/clear-btn.d.ts +7 -0
- package/dist/components/biz-comp/multi-modal-input/clear-btn.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/index.d.ts +21 -0
- package/dist/components/biz-comp/multi-modal-input/index.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/preview-attachment.d.ts +12 -0
- package/dist/components/biz-comp/multi-modal-input/preview-attachment.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/prompt-input.d.ts +35 -0
- package/dist/components/biz-comp/multi-modal-input/prompt-input.d.ts.map +1 -0
- package/dist/components/biz-comp/opening-lines.d.ts +3 -0
- package/dist/components/biz-comp/opening-lines.d.ts.map +1 -0
- package/dist/components/biz-comp/preview-message-wrapper.d.ts +9 -0
- package/dist/components/biz-comp/preview-message-wrapper.d.ts.map +1 -0
- package/dist/components/biz-comp/preview-message.d.ts +11 -0
- package/dist/components/biz-comp/preview-message.d.ts.map +1 -0
- package/dist/components/biz-comp/response.d.ts +6 -0
- package/dist/components/biz-comp/response.d.ts.map +1 -0
- package/dist/components/biz-comp/suggestions.d.ts +7 -0
- package/dist/components/biz-comp/suggestions.d.ts.map +1 -0
- package/dist/components/bs-ui/abs-fullscreen-gradient-bg.d.ts +9 -0
- package/dist/components/bs-ui/abs-fullscreen-gradient-bg.d.ts.map +1 -0
- package/dist/components/bs-ui/attachments-previewer.d.ts +15 -0
- package/dist/components/bs-ui/attachments-previewer.d.ts.map +1 -0
- package/dist/components/bs-ui/border-color-animation.d.ts +9 -0
- package/dist/components/bs-ui/border-color-animation.d.ts.map +1 -0
- package/dist/components/bs-ui/bot-avatar-name.d.ts +6 -0
- package/dist/components/bs-ui/bot-avatar-name.d.ts.map +1 -0
- package/dist/components/bs-ui/bot-icon.d.ts +5 -0
- package/dist/components/bs-ui/bot-icon.d.ts.map +1 -0
- package/dist/components/bs-ui/bs-icons.d.ts +39 -0
- package/dist/components/bs-ui/bs-icons.d.ts.map +1 -0
- package/dist/components/bs-ui/card.d.ts +10 -0
- package/dist/components/bs-ui/card.d.ts.map +1 -0
- package/dist/components/bs-ui/chat-area-header.d.ts +9 -0
- package/dist/components/bs-ui/chat-area-header.d.ts.map +1 -0
- package/dist/components/bs-ui/collapsible-txt-msg.d.ts +10 -0
- package/dist/components/bs-ui/collapsible-txt-msg.d.ts.map +1 -0
- package/dist/components/bs-ui/confirm-dialog.d.ts +26 -0
- package/dist/components/bs-ui/confirm-dialog.d.ts.map +1 -0
- package/dist/components/bs-ui/fields-generating-indicator.d.ts +2 -0
- package/dist/components/bs-ui/fields-generating-indicator.d.ts.map +1 -0
- package/dist/components/bs-ui/fields-portal.d.ts +8 -0
- package/dist/components/bs-ui/fields-portal.d.ts.map +1 -0
- package/dist/components/bs-ui/fields-previewer.d.ts +12 -0
- package/dist/components/bs-ui/fields-previewer.d.ts.map +1 -0
- package/dist/components/bs-ui/font-icon.d.ts +6 -0
- package/dist/components/bs-ui/font-icon.d.ts.map +1 -0
- package/dist/components/bs-ui/form-info-editor.d.ts +37 -0
- package/dist/components/bs-ui/form-info-editor.d.ts.map +1 -0
- package/dist/components/bs-ui/generate-animation.d.ts +4 -0
- package/dist/components/bs-ui/generate-animation.d.ts.map +1 -0
- package/dist/components/bs-ui/icon-btn.d.ts +7 -0
- package/dist/components/bs-ui/icon-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/line-checker.d.ts +15 -0
- package/dist/components/bs-ui/line-checker.d.ts.map +1 -0
- package/dist/components/bs-ui/linear-gradient-border-btn.d.ts +10 -0
- package/dist/components/bs-ui/linear-gradient-border-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/linear-gradient-color-bg-animation.d.ts +8 -0
- package/dist/components/bs-ui/linear-gradient-color-bg-animation.d.ts.map +1 -0
- package/dist/components/bs-ui/option-item.d.ts +9 -0
- package/dist/components/bs-ui/option-item.d.ts.map +1 -0
- package/dist/components/bs-ui/previewer-header.d.ts +13 -0
- package/dist/components/bs-ui/previewer-header.d.ts.map +1 -0
- package/dist/components/bs-ui/primary-confirm-btn.d.ts +7 -0
- package/dist/components/bs-ui/primary-confirm-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/primary-entry-btn.d.ts +9 -0
- package/dist/components/bs-ui/primary-entry-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/tab-radio-group.d.ts +16 -0
- package/dist/components/bs-ui/tab-radio-group.d.ts.map +1 -0
- package/dist/components/bs-ui/tooltip.d.ts +5 -0
- package/dist/components/bs-ui/tooltip.d.ts.map +1 -0
- package/dist/components/bs-ui/user-txt-msg-bubble.d.ts +6 -0
- package/dist/components/bs-ui/user-txt-msg-bubble.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +24 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/icons.d.ts +176 -0
- package/dist/components/ui/icons.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/one-time-click-btn.d.ts +4 -0
- package/dist/components/ui/one-time-click-btn.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/web-comp/fields-previewer-web-component.d.ts +61 -0
- package/dist/components/web-comp/fields-previewer-web-component.d.ts.map +1 -0
- package/dist/const/index.d.ts +4 -0
- package/dist/const/index.d.ts.map +1 -0
- package/dist/const/ui.d.ts +4 -0
- package/dist/const/ui.d.ts.map +1 -0
- package/dist/hooks/use-evt-bus.d.ts +2 -0
- package/dist/hooks/use-evt-bus.d.ts.map +1 -0
- package/dist/hooks/use-evt.d.ts +3 -0
- package/dist/hooks/use-evt.d.ts.map +1 -0
- package/dist/hooks/use-frame-mode.d.ts +5 -0
- package/dist/hooks/use-frame-mode.d.ts.map +1 -0
- package/dist/hooks/use-plugin-component.d.ts +5 -0
- package/dist/hooks/use-plugin-component.d.ts.map +1 -0
- package/dist/hooks/use-plugin-ctx.d.ts +3 -0
- package/dist/hooks/use-plugin-ctx.d.ts.map +1 -0
- package/dist/hooks/use-plugin-custom-components.d.ts +4 -0
- package/dist/hooks/use-plugin-custom-components.d.ts.map +1 -0
- package/dist/hooks/use-plugin-life-cycle-chain-runner.d.ts +5 -0
- package/dist/hooks/use-plugin-life-cycle-chain-runner.d.ts.map +1 -0
- package/dist/hooks/use-plugin-list.d.ts +2 -0
- package/dist/hooks/use-plugin-list.d.ts.map +1 -0
- package/dist/hooks/use-plugin.d.ts +2 -0
- package/dist/hooks/use-plugin.d.ts.map +1 -0
- package/dist/hooks/use-shadow.d.ts +25 -0
- package/dist/hooks/use-shadow.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/event-emitter.d.ts +39 -0
- package/dist/lib/event-emitter.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +30 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/plugins/form-builder-base-plugin/const.d.ts +3 -0
- package/dist/plugins/form-builder-base-plugin/const.d.ts.map +1 -0
- package/dist/plugins/form-builder-base-plugin/index.d.ts +7 -0
- package/dist/plugins/form-builder-base-plugin/index.d.ts.map +1 -0
- package/dist/plugins/form-builder-base-plugin/types.d.ts +12 -0
- package/dist/plugins/form-builder-base-plugin/types.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts +2 -0
- package/dist/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/avatar.d.ts +5 -0
- package/dist/plugins/form-filling-plugin/components/avatar.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/entry-btn.d.ts +3 -0
- package/dist/plugins/form-filling-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/msg-part.d.ts +3 -0
- package/dist/plugins/form-filling-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/const.d.ts +612 -0
- package/dist/plugins/form-filling-plugin/const.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/index.d.ts +13 -0
- package/dist/plugins/form-filling-plugin/index.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/types.d.ts +8 -0
- package/dist/plugins/form-filling-plugin/types.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/utils.d.ts +4 -0
- package/dist/plugins/form-filling-plugin/utils.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/confirmer.d.ts +9 -0
- package/dist/plugins/general-model-form-builder-plugin/components/confirmer.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.d.ts +10 -0
- package/dist/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/msg-part.d.ts +3 -0
- package/dist/plugins/general-model-form-builder-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/new-confirmer.d.ts +10 -0
- package/dist/plugins/general-model-form-builder-plugin/components/new-confirmer.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/const.d.ts +3 -0
- package/dist/plugins/general-model-form-builder-plugin/const.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/index.d.ts +9 -0
- package/dist/plugins/general-model-form-builder-plugin/index.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/types.d.ts +3 -0
- package/dist/plugins/general-model-form-builder-plugin/types.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/create-form-confirm.d.ts +7 -0
- package/dist/plugins/mcp-form-builder-plugin/components/create-form-confirm.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/entry-btn.d.ts +3 -0
- package/dist/plugins/mcp-form-builder-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/follow-up.d.ts +3 -0
- package/dist/plugins/mcp-form-builder-plugin/components/follow-up.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/msg-part.d.ts +3 -0
- package/dist/plugins/mcp-form-builder-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/const/index.d.ts +12 -0
- package/dist/plugins/mcp-form-builder-plugin/const/index.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/index.d.ts +1 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/index.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/use-fields-confirmed.d.ts +2 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/use-fields-confirmed.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/index.d.ts +23 -0
- package/dist/plugins/mcp-form-builder-plugin/index.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/types.d.ts +17 -0
- package/dist/plugins/mcp-form-builder-plugin/types.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/utils/index.d.ts +51 -0
- package/dist/plugins/mcp-form-builder-plugin/utils/index.d.ts.map +1 -0
- package/dist/sdk.impl.d.ts +21 -0
- package/dist/sdk.impl.d.ts.map +1 -0
- package/dist/store/context.d.ts +12 -0
- package/dist/store/context.d.ts.map +1 -0
- package/dist/store/index.d.ts +13 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/stories/AbsFullscreenGradientBg.stories.d.ts +17 -0
- package/dist/stories/AbsFullscreenGradientBg.stories.d.ts.map +1 -0
- package/dist/stories/AttachmentsPreviewer.stories.d.ts +16 -0
- package/dist/stories/AttachmentsPreviewer.stories.d.ts.map +1 -0
- package/dist/stories/BorderColorAnimation.stories.d.ts +24 -0
- package/dist/stories/BorderColorAnimation.stories.d.ts.map +1 -0
- package/dist/stories/BotAvatarAndName.stories.d.ts +18 -0
- package/dist/stories/BotAvatarAndName.stories.d.ts.map +1 -0
- package/dist/stories/BotIcon.stories.d.ts +17 -0
- package/dist/stories/BotIcon.stories.d.ts.map +1 -0
- package/dist/stories/BsTooltip.stories.d.ts +7 -0
- package/dist/stories/BsTooltip.stories.d.ts.map +1 -0
- package/dist/stories/Card.stories.d.ts +14 -0
- package/dist/stories/Card.stories.d.ts.map +1 -0
- package/dist/stories/ChatAreaHeader.stories.d.ts +14 -0
- package/dist/stories/ChatAreaHeader.stories.d.ts.map +1 -0
- package/dist/stories/CollapsibleTextMsg.stories.d.ts +16 -0
- package/dist/stories/CollapsibleTextMsg.stories.d.ts.map +1 -0
- package/dist/stories/ConfirmDialog.stories.d.ts +61 -0
- package/dist/stories/ConfirmDialog.stories.d.ts.map +1 -0
- package/dist/stories/FormInfoEditor.stories.d.ts +15 -0
- package/dist/stories/FormInfoEditor.stories.d.ts.map +1 -0
- package/dist/stories/GenerateAnimation.stories.d.ts +16 -0
- package/dist/stories/GenerateAnimation.stories.d.ts.map +1 -0
- package/dist/stories/IconBtn.stories.d.ts +14 -0
- package/dist/stories/IconBtn.stories.d.ts.map +1 -0
- package/dist/stories/IconLib.d.ts +12 -0
- package/dist/stories/IconLib.d.ts.map +1 -0
- package/dist/stories/Icons.stories.d.ts +24 -0
- package/dist/stories/Icons.stories.d.ts.map +1 -0
- package/dist/stories/LineChecker.stories.d.ts +23 -0
- package/dist/stories/LineChecker.stories.d.ts.map +1 -0
- package/dist/stories/LinearGradientBorderBtn.stories.d.ts +22 -0
- package/dist/stories/LinearGradientBorderBtn.stories.d.ts.map +1 -0
- package/dist/stories/LinearGradientColorBgAnimation.stories.d.ts +23 -0
- package/dist/stories/LinearGradientColorBgAnimation.stories.d.ts.map +1 -0
- package/dist/stories/OptionItem.stories.d.ts +20 -0
- package/dist/stories/OptionItem.stories.d.ts.map +1 -0
- package/dist/stories/PreviewerHeader.stories.d.ts +9 -0
- package/dist/stories/PreviewerHeader.stories.d.ts.map +1 -0
- package/dist/stories/PrimaryConfirmBtn.stories.d.ts +16 -0
- package/dist/stories/PrimaryConfirmBtn.stories.d.ts.map +1 -0
- package/dist/stories/PrimaryEntryBtn.stories.d.ts +26 -0
- package/dist/stories/PrimaryEntryBtn.stories.d.ts.map +1 -0
- package/dist/stories/TabRadioGroup.stories.d.ts +18 -0
- package/dist/stories/TabRadioGroup.stories.d.ts.map +1 -0
- package/dist/stories/UserTextMsgBubble.stories.d.ts +14 -0
- package/dist/stories/UserTextMsgBubble.stories.d.ts.map +1 -0
- package/dist/stories/fields-generating.stories.d.ts +14 -0
- package/dist/stories/fields-generating.stories.d.ts.map +1 -0
- package/dist/stories/fields-previewer.stories.d.ts +18 -0
- package/dist/stories/fields-previewer.stories.d.ts.map +1 -0
- package/package.json +76 -0
- package/scripts/inline-style-inject.ts +36 -0
- package/src/chat.tsx +56 -0
- package/src/components/biz-comp/FakeBotMsg.tsx +52 -0
- package/src/components/biz-comp/FieldChecker.tsx +114 -0
- package/src/components/biz-comp/FieldCheckerListMsg.tsx +34 -0
- package/src/components/biz-comp/FieldValueChecker.tsx +98 -0
- package/src/components/biz-comp/SubformFieldsValueChecker.tsx +166 -0
- package/src/components/biz-comp/chat-client.tsx +206 -0
- package/src/components/biz-comp/chat-frame.tsx +25 -0
- package/src/components/biz-comp/conversation.tsx +70 -0
- package/src/components/biz-comp/dock-btn.tsx +52 -0
- package/src/components/biz-comp/field-icon.tsx +8 -0
- package/src/components/biz-comp/markdown-part.tsx +48 -0
- package/src/components/biz-comp/markdown.tsx +36 -0
- package/src/components/biz-comp/message-content.tsx +21 -0
- package/src/components/biz-comp/messages.tsx +42 -0
- package/src/components/biz-comp/multi-modal-input/attachment-btn.tsx +30 -0
- package/src/components/biz-comp/multi-modal-input/clear-btn.tsx +42 -0
- package/src/components/biz-comp/multi-modal-input/index.tsx +422 -0
- package/src/components/biz-comp/multi-modal-input/preview-attachment.tsx +72 -0
- package/src/components/biz-comp/multi-modal-input/prompt-input.tsx +260 -0
- package/src/components/biz-comp/opening-lines.tsx +34 -0
- package/src/components/biz-comp/preview-message-wrapper.tsx +55 -0
- package/src/components/biz-comp/preview-message.tsx +91 -0
- package/src/components/biz-comp/response.tsx +23 -0
- package/src/components/biz-comp/suggestions.tsx +78 -0
- package/src/components/bs-ui/abs-fullscreen-gradient-bg.tsx +34 -0
- package/src/components/bs-ui/attachments-previewer.tsx +229 -0
- package/src/components/bs-ui/border-color-animation.tsx +58 -0
- package/src/components/bs-ui/bot-avatar-name.tsx +25 -0
- package/src/components/bs-ui/bot-icon.tsx +23 -0
- package/src/components/bs-ui/bs-icons.tsx +801 -0
- package/src/components/bs-ui/card.tsx +37 -0
- package/src/components/bs-ui/chat-area-header.tsx +41 -0
- package/src/components/bs-ui/collapsible-txt-msg.tsx +50 -0
- package/src/components/bs-ui/confirm-dialog.tsx +128 -0
- package/src/components/bs-ui/fields-generating-indicator.tsx +50 -0
- package/src/components/bs-ui/fields-portal.tsx +18 -0
- package/src/components/bs-ui/fields-previewer.tsx +109 -0
- package/src/components/bs-ui/font-icon.tsx +17 -0
- package/src/components/bs-ui/form-info-editor.tsx +286 -0
- package/src/components/bs-ui/generate-animation.tsx +54 -0
- package/src/components/bs-ui/icon-btn.tsx +31 -0
- package/src/components/bs-ui/line-checker.tsx +129 -0
- package/src/components/bs-ui/linear-gradient-border-btn.tsx +48 -0
- package/src/components/bs-ui/linear-gradient-color-bg-animation.tsx +103 -0
- package/src/components/bs-ui/option-item.tsx +28 -0
- package/src/components/bs-ui/previewer-header.tsx +134 -0
- package/src/components/bs-ui/primary-confirm-btn.tsx +46 -0
- package/src/components/bs-ui/primary-entry-btn.tsx +37 -0
- package/src/components/bs-ui/tab-radio-group.tsx +73 -0
- package/src/components/bs-ui/tooltip.tsx +18 -0
- package/src/components/bs-ui/user-txt-msg-bubble.tsx +19 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/button.tsx +51 -0
- package/src/components/ui/card.tsx +76 -0
- package/src/components/ui/checkbox.tsx +29 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/dropdown-menu.tsx +199 -0
- package/src/components/ui/icons.tsx +1288 -0
- package/src/components/ui/input-group.tsx +172 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/one-time-click-btn.tsx +32 -0
- package/src/components/ui/select.tsx +157 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/tooltip.tsx +34 -0
- package/src/components/web-comp/fields-previewer-web-component.ts +259 -0
- package/src/const/index.ts +61 -0
- package/src/const/ui.ts +7 -0
- package/src/global.d.ts +1 -0
- package/src/hooks/use-evt-bus.ts +11 -0
- package/src/hooks/use-evt.ts +17 -0
- package/src/hooks/use-frame-mode.ts +13 -0
- package/src/hooks/use-plugin-component.ts +12 -0
- package/src/hooks/use-plugin-ctx.ts +12 -0
- package/src/hooks/use-plugin-custom-components.ts +31 -0
- package/src/hooks/use-plugin-life-cycle-chain-runner.ts +26 -0
- package/src/hooks/use-plugin-list.ts +11 -0
- package/src/hooks/use-plugin.ts +11 -0
- package/src/hooks/use-shadow.ts +128 -0
- package/src/index.tsx +10 -0
- package/src/lib/event-emitter.ts +93 -0
- package/src/lib/utils.ts +222 -0
- package/src/plugins/form-builder-base-plugin/const.ts +27 -0
- package/src/plugins/form-builder-base-plugin/index.ts +45 -0
- package/src/plugins/form-builder-base-plugin/types.ts +13 -0
- package/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.tsx +3 -0
- package/src/plugins/form-filling-plugin/components/avatar.tsx +14 -0
- package/src/plugins/form-filling-plugin/components/entry-btn.tsx +15 -0
- package/src/plugins/form-filling-plugin/components/msg-part.tsx +90 -0
- package/src/plugins/form-filling-plugin/const.ts +595 -0
- package/src/plugins/form-filling-plugin/index.ts +135 -0
- package/src/plugins/form-filling-plugin/types.ts +11 -0
- package/src/plugins/form-filling-plugin/utils.ts +63 -0
- package/src/plugins/general-model-form-builder-plugin/components/confirmer.tsx +90 -0
- package/src/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.tsx +69 -0
- package/src/plugins/general-model-form-builder-plugin/components/msg-part.tsx +147 -0
- package/src/plugins/general-model-form-builder-plugin/components/new-confirmer.tsx +191 -0
- package/src/plugins/general-model-form-builder-plugin/const.ts +3 -0
- package/src/plugins/general-model-form-builder-plugin/index.ts +20 -0
- package/src/plugins/general-model-form-builder-plugin/types.ts +1 -0
- package/src/plugins/mcp-form-builder-plugin/components/create-form-confirm.tsx +126 -0
- package/src/plugins/mcp-form-builder-plugin/components/entry-btn.tsx +9 -0
- package/src/plugins/mcp-form-builder-plugin/components/follow-up.tsx +15 -0
- package/src/plugins/mcp-form-builder-plugin/components/msg-part.tsx +135 -0
- package/src/plugins/mcp-form-builder-plugin/const/index.ts +13 -0
- package/src/plugins/mcp-form-builder-plugin/hooks/index.ts +0 -0
- package/src/plugins/mcp-form-builder-plugin/hooks/use-fields-confirmed.ts +12 -0
- package/src/plugins/mcp-form-builder-plugin/index.ts +225 -0
- package/src/plugins/mcp-form-builder-plugin/types.ts +21 -0
- package/src/plugins/mcp-form-builder-plugin/utils/index.ts +450 -0
- package/src/sdk.impl.tsx +108 -0
- package/src/store/context.tsx +22 -0
- package/src/store/index.ts +53 -0
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +36 -0
- package/src/stories/AttachmentsPreviewer.stories.tsx +188 -0
- package/src/stories/BorderColorAnimation.stories.tsx +60 -0
- package/src/stories/BotAvatarAndName.stories.ts +24 -0
- package/src/stories/BotIcon.stories.ts +22 -0
- package/src/stories/BsTooltip.stories.tsx +32 -0
- package/src/stories/Card.stories.tsx +28 -0
- package/src/stories/ChatAreaHeader.stories.ts +26 -0
- package/src/stories/CollapsibleTextMsg.stories.ts +44 -0
- package/src/stories/ConfirmDialog.stories.tsx +123 -0
- package/src/stories/FormInfoEditor.stories.tsx +183 -0
- package/src/stories/GenerateAnimation.stories.ts +20 -0
- package/src/stories/IconBtn.stories.tsx +26 -0
- package/src/stories/IconLib.tsx +47 -0
- package/src/stories/Icons.stories.ts +22 -0
- package/src/stories/LineChecker.stories.tsx +134 -0
- package/src/stories/LinearGradientBorderBtn.stories.tsx +86 -0
- package/src/stories/LinearGradientColorBgAnimation.stories.tsx +60 -0
- package/src/stories/OptionItem.stories.tsx +77 -0
- package/src/stories/PreviewerHeader.stories.tsx +45 -0
- package/src/stories/PrimaryConfirmBtn.stories.ts +37 -0
- package/src/stories/PrimaryEntryBtn.stories.tsx +74 -0
- package/src/stories/TabRadioGroup.stories.tsx +84 -0
- package/src/stories/UserTextMsgBubble.stories.ts +24 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- 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 +539 -0
- package/src/stories/assets/demo_index.html +7988 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/iconfont.css +1377 -0
- package/src/stories/assets/iconfont.eot +0 -0
- package/src/stories/assets/iconfont.json +2382 -0
- package/src/stories/assets/iconfont.svg +697 -0
- 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 +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/fields-generating.stories.tsx +22 -0
- package/src/stories/fields-previewer.stories.tsx +67 -0
- package/src/style.css +172 -0
- package/stats.html +4949 -0
- package/tailwind.config.js +49 -0
- package/tsconfig.json +13 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
import { FormFillingEventKey } from '@baishuyun/types';
|
|
2
|
+
|
|
3
|
+
export const PLUGIN_NAME = 'form-filling-plugin';
|
|
4
|
+
|
|
5
|
+
export const FILLING_EVENTS: Record<string, FormFillingEventKey> = {
|
|
6
|
+
// 表单结构识别完成
|
|
7
|
+
FORM_STRUCTURE_READY: 'form-filling-structure-ready',
|
|
8
|
+
|
|
9
|
+
// 字段填写完成
|
|
10
|
+
FIELD_FILLED_UPDATE: 'form-filling-field-filling-update',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const MOCK_FORM_STRUCTURE = [
|
|
14
|
+
{
|
|
15
|
+
description: '唯一标识供应商的编号',
|
|
16
|
+
label: '供应商编号',
|
|
17
|
+
lineWidth: 6,
|
|
18
|
+
widget: {
|
|
19
|
+
customCls: null,
|
|
20
|
+
enable: true,
|
|
21
|
+
importMode: 1,
|
|
22
|
+
labelStyle: '供应商编号',
|
|
23
|
+
rules: [
|
|
24
|
+
{
|
|
25
|
+
digitsNum: 5,
|
|
26
|
+
fixedLength: true,
|
|
27
|
+
resetDuration: 'none',
|
|
28
|
+
startValue: 1,
|
|
29
|
+
type: 'incNumber',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
chars: 'SUPP-',
|
|
33
|
+
type: 'fixedChars',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
triggerEvent: 0,
|
|
37
|
+
type: 'sn',
|
|
38
|
+
visible: true,
|
|
39
|
+
widgetName: '_widget_1766977888256',
|
|
40
|
+
widgetNameAlias: '',
|
|
41
|
+
width: 350,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
description: '输入供应商的全称',
|
|
46
|
+
label: '供应商名称',
|
|
47
|
+
lineWidth: 6,
|
|
48
|
+
widget: {
|
|
49
|
+
alertinfo: {
|
|
50
|
+
icon: 'error',
|
|
51
|
+
},
|
|
52
|
+
allowBlank: true,
|
|
53
|
+
customCls: null,
|
|
54
|
+
enable: true,
|
|
55
|
+
enterClearText: true,
|
|
56
|
+
eventAlert: true,
|
|
57
|
+
extendSet: {
|
|
58
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
59
|
+
status: true,
|
|
60
|
+
triggerField: '',
|
|
61
|
+
triggerFieldMode: 'none',
|
|
62
|
+
version: 1,
|
|
63
|
+
},
|
|
64
|
+
generateQR: false,
|
|
65
|
+
height: 34,
|
|
66
|
+
labelStyle: '供应商名称',
|
|
67
|
+
libs: [],
|
|
68
|
+
noRepeat: true,
|
|
69
|
+
regex: '',
|
|
70
|
+
rely: null,
|
|
71
|
+
scan: null,
|
|
72
|
+
text: null,
|
|
73
|
+
textMode: 'text',
|
|
74
|
+
triggerEvent: false,
|
|
75
|
+
type: 'text',
|
|
76
|
+
value: null,
|
|
77
|
+
visible: true,
|
|
78
|
+
widgetName: '_widget_1766977888332',
|
|
79
|
+
widgetNameAlias: '',
|
|
80
|
+
width: 350,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
description: '供应商对接人的姓名',
|
|
85
|
+
label: '联系人',
|
|
86
|
+
lineWidth: 6,
|
|
87
|
+
widget: {
|
|
88
|
+
alertinfo: {
|
|
89
|
+
icon: 'error',
|
|
90
|
+
},
|
|
91
|
+
allowBlank: true,
|
|
92
|
+
customCls: null,
|
|
93
|
+
enable: true,
|
|
94
|
+
enterClearText: true,
|
|
95
|
+
eventAlert: true,
|
|
96
|
+
extendSet: {
|
|
97
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
98
|
+
status: true,
|
|
99
|
+
triggerField: '',
|
|
100
|
+
triggerFieldMode: 'none',
|
|
101
|
+
version: 1,
|
|
102
|
+
},
|
|
103
|
+
generateQR: false,
|
|
104
|
+
height: 34,
|
|
105
|
+
labelStyle: '联系人',
|
|
106
|
+
libs: [],
|
|
107
|
+
noRepeat: true,
|
|
108
|
+
regex: '',
|
|
109
|
+
rely: null,
|
|
110
|
+
scan: null,
|
|
111
|
+
text: null,
|
|
112
|
+
textMode: 'text',
|
|
113
|
+
triggerEvent: false,
|
|
114
|
+
type: 'text',
|
|
115
|
+
value: null,
|
|
116
|
+
visible: true,
|
|
117
|
+
widgetName: '_widget_1766977888380',
|
|
118
|
+
widgetNameAlias: '',
|
|
119
|
+
width: 350,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
description: '供应商的联系电话',
|
|
124
|
+
label: '联系电话',
|
|
125
|
+
lineWidth: 6,
|
|
126
|
+
widget: {
|
|
127
|
+
alertinfo: {
|
|
128
|
+
icon: 'error',
|
|
129
|
+
},
|
|
130
|
+
allowBlank: true,
|
|
131
|
+
customCls: null,
|
|
132
|
+
enable: true,
|
|
133
|
+
enterClearText: true,
|
|
134
|
+
eventAlert: true,
|
|
135
|
+
extendSet: {
|
|
136
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
137
|
+
status: true,
|
|
138
|
+
triggerField: '',
|
|
139
|
+
triggerFieldMode: 'none',
|
|
140
|
+
version: 1,
|
|
141
|
+
},
|
|
142
|
+
generateQR: false,
|
|
143
|
+
height: 34,
|
|
144
|
+
labelStyle: '联系电话',
|
|
145
|
+
libs: [],
|
|
146
|
+
noRepeat: true,
|
|
147
|
+
regex: '',
|
|
148
|
+
rely: null,
|
|
149
|
+
scan: null,
|
|
150
|
+
text: null,
|
|
151
|
+
textMode: 'text',
|
|
152
|
+
triggerEvent: false,
|
|
153
|
+
type: 'text',
|
|
154
|
+
value: null,
|
|
155
|
+
visible: true,
|
|
156
|
+
widgetName: '_widget_1766977888435',
|
|
157
|
+
widgetNameAlias: '',
|
|
158
|
+
width: 350,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
description: '供应商的官方邮箱',
|
|
163
|
+
label: '邮箱',
|
|
164
|
+
lineWidth: 6,
|
|
165
|
+
widget: {
|
|
166
|
+
alertinfo: {
|
|
167
|
+
icon: 'error',
|
|
168
|
+
},
|
|
169
|
+
allowBlank: true,
|
|
170
|
+
customCls: null,
|
|
171
|
+
enable: true,
|
|
172
|
+
enterClearText: true,
|
|
173
|
+
eventAlert: true,
|
|
174
|
+
extendSet: {
|
|
175
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
176
|
+
status: true,
|
|
177
|
+
triggerField: '',
|
|
178
|
+
triggerFieldMode: 'none',
|
|
179
|
+
version: 1,
|
|
180
|
+
},
|
|
181
|
+
generateQR: false,
|
|
182
|
+
height: 34,
|
|
183
|
+
labelStyle: '邮箱',
|
|
184
|
+
libs: [],
|
|
185
|
+
noRepeat: true,
|
|
186
|
+
regex: '',
|
|
187
|
+
rely: null,
|
|
188
|
+
scan: null,
|
|
189
|
+
text: null,
|
|
190
|
+
textMode: 'text',
|
|
191
|
+
triggerEvent: false,
|
|
192
|
+
type: 'text',
|
|
193
|
+
value: null,
|
|
194
|
+
visible: true,
|
|
195
|
+
widgetName: '_widget_1766977888467',
|
|
196
|
+
widgetNameAlias: '',
|
|
197
|
+
width: 350,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
description: '选择供应商所属行业',
|
|
202
|
+
label: '所属行业',
|
|
203
|
+
lineWidth: 6,
|
|
204
|
+
widget: {
|
|
205
|
+
allowAddLinkData: false,
|
|
206
|
+
allowBlank: true,
|
|
207
|
+
colorEnable: true,
|
|
208
|
+
customCls: null,
|
|
209
|
+
enable: true,
|
|
210
|
+
extendSet: {
|
|
211
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
212
|
+
status: true,
|
|
213
|
+
triggerField: '',
|
|
214
|
+
triggerFieldMode: 'none',
|
|
215
|
+
version: 1,
|
|
216
|
+
},
|
|
217
|
+
funMode: 'module',
|
|
218
|
+
height: 34,
|
|
219
|
+
items: [
|
|
220
|
+
{
|
|
221
|
+
color: '#F06648',
|
|
222
|
+
text: '电子',
|
|
223
|
+
value: '电子',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
color: '#FFC502',
|
|
227
|
+
selected: true,
|
|
228
|
+
text: '机械',
|
|
229
|
+
value: '机械',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
color: '#4ACC8C',
|
|
233
|
+
text: '化工',
|
|
234
|
+
value: '化工',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
color: '#FFC502',
|
|
238
|
+
text: '建材',
|
|
239
|
+
value: '建材',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
labelStyle: '所属行业',
|
|
243
|
+
libs: [],
|
|
244
|
+
mode: 1,
|
|
245
|
+
module: null,
|
|
246
|
+
noRepeat: false,
|
|
247
|
+
type: 'combo',
|
|
248
|
+
visible: true,
|
|
249
|
+
widgetName: '_widget_1766977890174',
|
|
250
|
+
widgetNameAlias: '',
|
|
251
|
+
width: 350,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
description: '选择与供应商的合作状态',
|
|
256
|
+
label: '单选按钮组',
|
|
257
|
+
lineWidth: 6,
|
|
258
|
+
widget: {
|
|
259
|
+
allowBlank: true,
|
|
260
|
+
colorEnable: true,
|
|
261
|
+
customCls: null,
|
|
262
|
+
enable: true,
|
|
263
|
+
extendSet: {
|
|
264
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
265
|
+
status: true,
|
|
266
|
+
triggerField: '',
|
|
267
|
+
triggerFieldMode: 'none',
|
|
268
|
+
version: 1,
|
|
269
|
+
},
|
|
270
|
+
funMode: 'module',
|
|
271
|
+
items: [
|
|
272
|
+
{
|
|
273
|
+
color: '#F06648',
|
|
274
|
+
text: '合作中',
|
|
275
|
+
value: '合作中',
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
color: '#FFC502',
|
|
279
|
+
selected: true,
|
|
280
|
+
text: '暂停合作',
|
|
281
|
+
value: '暂停合作',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
color: '#4ACC8C',
|
|
285
|
+
text: '终止合作',
|
|
286
|
+
value: '终止合作',
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
labelStyle: '单选按钮组',
|
|
290
|
+
layout: 'horizontal',
|
|
291
|
+
libs: [],
|
|
292
|
+
module: null,
|
|
293
|
+
stopCancel: false,
|
|
294
|
+
type: 'radiogroup',
|
|
295
|
+
value: null,
|
|
296
|
+
visible: true,
|
|
297
|
+
widgetName: '_widget_1766977891799',
|
|
298
|
+
widgetNameAlias: '',
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
description: null,
|
|
303
|
+
label: '产品信息',
|
|
304
|
+
lineWidth: 12,
|
|
305
|
+
tab: null,
|
|
306
|
+
widget: {
|
|
307
|
+
allowAddData: false,
|
|
308
|
+
allowBlank: true,
|
|
309
|
+
allowImportV2: false,
|
|
310
|
+
allowLoadData: false,
|
|
311
|
+
customCls: null,
|
|
312
|
+
enable: true,
|
|
313
|
+
extendSet: {
|
|
314
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
315
|
+
status: true,
|
|
316
|
+
triggerField: '',
|
|
317
|
+
triggerFieldMode: 'none',
|
|
318
|
+
version: 1,
|
|
319
|
+
},
|
|
320
|
+
items: [
|
|
321
|
+
{
|
|
322
|
+
label: '产品名称',
|
|
323
|
+
labelHidden: false,
|
|
324
|
+
widget: {
|
|
325
|
+
alertinfo: {
|
|
326
|
+
icon: 'error',
|
|
327
|
+
},
|
|
328
|
+
allowBlank: true,
|
|
329
|
+
customCls: null,
|
|
330
|
+
enable: true,
|
|
331
|
+
enterClearText: true,
|
|
332
|
+
eventAlert: true,
|
|
333
|
+
extendSet: {
|
|
334
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
335
|
+
status: true,
|
|
336
|
+
triggerField: '',
|
|
337
|
+
triggerFieldMode: 'none',
|
|
338
|
+
version: 1,
|
|
339
|
+
},
|
|
340
|
+
generateQR: false,
|
|
341
|
+
height: 34,
|
|
342
|
+
labelStyle: '产品名称',
|
|
343
|
+
libs: [],
|
|
344
|
+
noRepeat: true,
|
|
345
|
+
regex: '',
|
|
346
|
+
rely: null,
|
|
347
|
+
scan: null,
|
|
348
|
+
text: null,
|
|
349
|
+
textMode: 'text',
|
|
350
|
+
type: 'text',
|
|
351
|
+
value: '',
|
|
352
|
+
visible: true,
|
|
353
|
+
widgetName: '_widget_1766977895560',
|
|
354
|
+
widgetNameAlias: '',
|
|
355
|
+
width: 350,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
label: '产品型号',
|
|
360
|
+
labelHidden: false,
|
|
361
|
+
widget: {
|
|
362
|
+
alertinfo: {
|
|
363
|
+
icon: 'error',
|
|
364
|
+
},
|
|
365
|
+
allowBlank: true,
|
|
366
|
+
customCls: null,
|
|
367
|
+
enable: true,
|
|
368
|
+
enterClearText: true,
|
|
369
|
+
eventAlert: true,
|
|
370
|
+
extendSet: {
|
|
371
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
372
|
+
status: true,
|
|
373
|
+
triggerField: '',
|
|
374
|
+
triggerFieldMode: 'none',
|
|
375
|
+
version: 1,
|
|
376
|
+
},
|
|
377
|
+
generateQR: false,
|
|
378
|
+
height: 34,
|
|
379
|
+
labelStyle: '产品型号',
|
|
380
|
+
libs: [],
|
|
381
|
+
noRepeat: true,
|
|
382
|
+
regex: '',
|
|
383
|
+
rely: null,
|
|
384
|
+
scan: null,
|
|
385
|
+
text: null,
|
|
386
|
+
textMode: 'text',
|
|
387
|
+
type: 'text',
|
|
388
|
+
value: '',
|
|
389
|
+
visible: true,
|
|
390
|
+
widgetName: '_widget_1766977895561',
|
|
391
|
+
widgetNameAlias: '',
|
|
392
|
+
width: 350,
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
label: '单价',
|
|
397
|
+
labelHidden: false,
|
|
398
|
+
widget: {
|
|
399
|
+
afterSuffix: {
|
|
400
|
+
en_us: '¥',
|
|
401
|
+
zh_cn: '元',
|
|
402
|
+
zh_tw: '圆',
|
|
403
|
+
},
|
|
404
|
+
alertinfo: {
|
|
405
|
+
icon: 'success',
|
|
406
|
+
tip: '请设置提示内容',
|
|
407
|
+
},
|
|
408
|
+
allowBlank: true,
|
|
409
|
+
allowDecimals: true,
|
|
410
|
+
allowNegative: true,
|
|
411
|
+
customCls: null,
|
|
412
|
+
displayMode: 'number',
|
|
413
|
+
enable: true,
|
|
414
|
+
extendSet: {
|
|
415
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
416
|
+
status: true,
|
|
417
|
+
triggerField: '',
|
|
418
|
+
triggerFieldMode: 'none',
|
|
419
|
+
version: 1,
|
|
420
|
+
},
|
|
421
|
+
format: '',
|
|
422
|
+
funMode: 'module',
|
|
423
|
+
height: 34,
|
|
424
|
+
labelStyle: '单价',
|
|
425
|
+
libs: [],
|
|
426
|
+
minNumber: 0,
|
|
427
|
+
module: null,
|
|
428
|
+
noRepeat: false,
|
|
429
|
+
notround: true,
|
|
430
|
+
precision: 2,
|
|
431
|
+
thousandsSeparator: false,
|
|
432
|
+
triggerEvent: false,
|
|
433
|
+
type: 'number',
|
|
434
|
+
value: null,
|
|
435
|
+
visible: true,
|
|
436
|
+
widgetName: '_widget_1766977895562',
|
|
437
|
+
widgetNameAlias: '',
|
|
438
|
+
width: 350,
|
|
439
|
+
},
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
label: '库存数量',
|
|
443
|
+
labelHidden: false,
|
|
444
|
+
widget: {
|
|
445
|
+
afterSuffix: {
|
|
446
|
+
en_us: 'pcs',
|
|
447
|
+
zh_cn: '件',
|
|
448
|
+
zh_tw: '件',
|
|
449
|
+
},
|
|
450
|
+
alertinfo: {
|
|
451
|
+
icon: 'success',
|
|
452
|
+
tip: '请设置提示内容',
|
|
453
|
+
},
|
|
454
|
+
allowBlank: true,
|
|
455
|
+
allowDecimals: true,
|
|
456
|
+
allowNegative: true,
|
|
457
|
+
customCls: null,
|
|
458
|
+
displayMode: 'number',
|
|
459
|
+
enable: true,
|
|
460
|
+
extendSet: {
|
|
461
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
462
|
+
status: true,
|
|
463
|
+
triggerField: '',
|
|
464
|
+
triggerFieldMode: 'none',
|
|
465
|
+
version: 1,
|
|
466
|
+
},
|
|
467
|
+
format: '',
|
|
468
|
+
funMode: 'module',
|
|
469
|
+
height: 34,
|
|
470
|
+
labelStyle: '库存数量',
|
|
471
|
+
libs: [],
|
|
472
|
+
minNumber: 0,
|
|
473
|
+
module: null,
|
|
474
|
+
noRepeat: false,
|
|
475
|
+
notround: true,
|
|
476
|
+
precision: 0,
|
|
477
|
+
thousandsSeparator: false,
|
|
478
|
+
triggerEvent: false,
|
|
479
|
+
type: 'number',
|
|
480
|
+
value: null,
|
|
481
|
+
visible: true,
|
|
482
|
+
widgetName: '_widget_1766977895563',
|
|
483
|
+
widgetNameAlias: '',
|
|
484
|
+
width: 350,
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
label: '产品描述',
|
|
489
|
+
labelHidden: false,
|
|
490
|
+
widget: {
|
|
491
|
+
alertinfo: {
|
|
492
|
+
icon: 'success',
|
|
493
|
+
tip: '请设置提示内容',
|
|
494
|
+
},
|
|
495
|
+
allowBlank: true,
|
|
496
|
+
autoHeight: true,
|
|
497
|
+
customCls: null,
|
|
498
|
+
enable: true,
|
|
499
|
+
extendSet: {
|
|
500
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
501
|
+
status: true,
|
|
502
|
+
triggerField: '',
|
|
503
|
+
triggerFieldMode: 'none',
|
|
504
|
+
version: 1,
|
|
505
|
+
},
|
|
506
|
+
funMode: 'module',
|
|
507
|
+
height: 140,
|
|
508
|
+
labelStyle: '产品描述',
|
|
509
|
+
libs: [],
|
|
510
|
+
maxLength: 5000,
|
|
511
|
+
module: null,
|
|
512
|
+
noRepeat: false,
|
|
513
|
+
triggerEvent: false,
|
|
514
|
+
type: 'textarea',
|
|
515
|
+
value: '',
|
|
516
|
+
visible: true,
|
|
517
|
+
widgetName: '_widget_1766977895564',
|
|
518
|
+
widgetNameAlias: '',
|
|
519
|
+
width: 734,
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
],
|
|
523
|
+
labelStyle: '产品信息',
|
|
524
|
+
loaddataconfig: {
|
|
525
|
+
extendSet: {
|
|
526
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
527
|
+
status: true,
|
|
528
|
+
triggerField: '',
|
|
529
|
+
triggerFieldMode: 'none',
|
|
530
|
+
},
|
|
531
|
+
mode: 'tree',
|
|
532
|
+
},
|
|
533
|
+
mobileStyle: 'table',
|
|
534
|
+
quick_fill: true,
|
|
535
|
+
sortable: true,
|
|
536
|
+
sticky_column: {
|
|
537
|
+
enable: true,
|
|
538
|
+
limit: 2,
|
|
539
|
+
},
|
|
540
|
+
sticky_column_mobile: {
|
|
541
|
+
enable: true,
|
|
542
|
+
limit: 1,
|
|
543
|
+
},
|
|
544
|
+
subFieldShowRules: [],
|
|
545
|
+
subform_create: true,
|
|
546
|
+
subform_dataload: true,
|
|
547
|
+
subform_delete: true,
|
|
548
|
+
subform_edit: true,
|
|
549
|
+
subform_fill: true,
|
|
550
|
+
subform_import: true,
|
|
551
|
+
subform_insert: true,
|
|
552
|
+
subformloaddataTitle: '数据加载',
|
|
553
|
+
type: 'subform',
|
|
554
|
+
visible: true,
|
|
555
|
+
widgetName: '_widget_1766977895562',
|
|
556
|
+
widgetNameAlias: '',
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
description: '补充其他说明信息',
|
|
561
|
+
label: '备注',
|
|
562
|
+
lineWidth: 6,
|
|
563
|
+
widget: {
|
|
564
|
+
alertinfo: {
|
|
565
|
+
icon: 'success',
|
|
566
|
+
tip: '请设置提示内容',
|
|
567
|
+
},
|
|
568
|
+
allowBlank: true,
|
|
569
|
+
autoHeight: true,
|
|
570
|
+
customCls: null,
|
|
571
|
+
enable: true,
|
|
572
|
+
extendSet: {
|
|
573
|
+
sort: ['datahelp', 'module', 'formEvent'],
|
|
574
|
+
status: true,
|
|
575
|
+
triggerField: '',
|
|
576
|
+
triggerFieldMode: 'none',
|
|
577
|
+
version: 1,
|
|
578
|
+
},
|
|
579
|
+
funMode: 'module',
|
|
580
|
+
height: 140,
|
|
581
|
+
labelStyle: '备注',
|
|
582
|
+
libs: [],
|
|
583
|
+
maxLength: 5000,
|
|
584
|
+
module: null,
|
|
585
|
+
noRepeat: false,
|
|
586
|
+
triggerEvent: false,
|
|
587
|
+
type: 'textarea',
|
|
588
|
+
value: '',
|
|
589
|
+
visible: true,
|
|
590
|
+
widgetName: '_widget_1766977896220',
|
|
591
|
+
widgetNameAlias: '',
|
|
592
|
+
width: 734,
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
];
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChatAreaPlugin,
|
|
3
|
+
EventHandler,
|
|
4
|
+
FormStructure,
|
|
5
|
+
IChatSDK,
|
|
6
|
+
MsgPartCompProps,
|
|
7
|
+
PluginCustomComponent,
|
|
8
|
+
PluginHooks,
|
|
9
|
+
PluginRegistryEntry,
|
|
10
|
+
ValueOf,
|
|
11
|
+
} from '@baishuyun/types';
|
|
12
|
+
import { FormFillingPluginCtx } from './types';
|
|
13
|
+
import { FILLING_EVENTS, PLUGIN_NAME, MOCK_FORM_STRUCTURE } from './const';
|
|
14
|
+
import { FormFillingOpeningLines } from './components/FormFillingOpeningLines';
|
|
15
|
+
import { FillMessagePart } from './components/msg-part';
|
|
16
|
+
import { UIDataTypes, UIMessagePart, UITools } from 'ai';
|
|
17
|
+
import {
|
|
18
|
+
extractTextPartMeta,
|
|
19
|
+
IsFieldsJsonPart,
|
|
20
|
+
mergeConsecutiveTargets,
|
|
21
|
+
mergeParts,
|
|
22
|
+
} from '@/lib/utils';
|
|
23
|
+
import { EntryButton } from './components/entry-btn';
|
|
24
|
+
import { FillingAvatar } from './components/avatar';
|
|
25
|
+
|
|
26
|
+
type part = ValueOf<Pick<MsgPartCompProps, 'part'>>;
|
|
27
|
+
|
|
28
|
+
// 填表插件
|
|
29
|
+
export class FormFillingPlugin extends ChatAreaPlugin<FormFillingPluginCtx> {
|
|
30
|
+
public pluginName: string = PLUGIN_NAME;
|
|
31
|
+
|
|
32
|
+
public customComponents?: Partial<PluginCustomComponent> | undefined = {
|
|
33
|
+
OpeningLines: FormFillingOpeningLines,
|
|
34
|
+
MessagePart: FillMessagePart,
|
|
35
|
+
EntryButton,
|
|
36
|
+
AvatarAndName: FillingAvatar,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
private sdkInst!: IChatSDK;
|
|
40
|
+
|
|
41
|
+
public init?: ((sdk: IChatSDK) => void) | undefined = (sdk: IChatSDK) => {
|
|
42
|
+
this.sdkInst = sdk;
|
|
43
|
+
|
|
44
|
+
sdk.eventBus.on<'form-filling-structure-ready'>(
|
|
45
|
+
FILLING_EVENTS.FORM_STRUCTURE_READY,
|
|
46
|
+
this.handleFormStructureReady
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// this.handleFormStructureReady({
|
|
50
|
+
// fields: MOCK_FORM_STRUCTURE,
|
|
51
|
+
// });
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
public dispose?: (() => void) | undefined = () => {
|
|
55
|
+
this.sdkInst.eventBus.off<'form-filling-structure-ready'>(
|
|
56
|
+
FILLING_EVENTS.FORM_STRUCTURE_READY,
|
|
57
|
+
this.handleFormStructureReady
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
private handleFormStructureReady: EventHandler<FormStructure> = (params: FormStructure) => {
|
|
62
|
+
const { fields } = params;
|
|
63
|
+
|
|
64
|
+
if (!fields || !fields.length) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
fields.forEach((field) => {
|
|
69
|
+
this.Context?.fieldMap.set(field.widget.widgetName, field);
|
|
70
|
+
|
|
71
|
+
// 存放子表单字段映射关系
|
|
72
|
+
if (field.widget.type === 'subform') {
|
|
73
|
+
for (const subfield of field.widget.items) {
|
|
74
|
+
this.Context?.subFieldsNameMap.set(subfield.widget.widgetName, field.widget.widgetName);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
public lifecycleHooks?: PluginHooks | undefined = {
|
|
81
|
+
onBeforeMessagePartsRender: (parts: Array<part>) => {
|
|
82
|
+
// todo: reduce loops
|
|
83
|
+
const mergedParts = mergeParts(parts as UIMessagePart<UIDataTypes, UITools>[], (p0, p1) => {
|
|
84
|
+
const meta0 = extractTextPartMeta(p0);
|
|
85
|
+
const meta1 = extractTextPartMeta(p1);
|
|
86
|
+
return meta0?.field?.fieldName == meta1?.field?.fieldName;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return mergeConsecutiveTargets<part>(mergedParts, IsFieldsJsonPart) as part[];
|
|
90
|
+
},
|
|
91
|
+
onBeforeMessagesClear: () => {
|
|
92
|
+
const conversationId = this.Context?.conversationId || '';
|
|
93
|
+
if (!conversationId) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const req = async () => {
|
|
98
|
+
await fetch(`http://192.168.50.10:3001/api/form/conversation/clear`, {
|
|
99
|
+
method: 'POST',
|
|
100
|
+
body: JSON.stringify({ conversationId }),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
this.Context = FormFillingPluginRegisterEntry.createContext();
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
req();
|
|
107
|
+
},
|
|
108
|
+
onBeforeMessageSend: (ctx) => {
|
|
109
|
+
const formStructure = Array.from(this.Context?.fieldMap.values() || []);
|
|
110
|
+
return {
|
|
111
|
+
...ctx,
|
|
112
|
+
options: {
|
|
113
|
+
body: {
|
|
114
|
+
stage: 'fill',
|
|
115
|
+
// formStructure: MOCK_FORM_STRUCTURE,
|
|
116
|
+
formStructure,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const FormFillingPluginRegisterEntry: PluginRegistryEntry<FormFillingPluginCtx> = {
|
|
125
|
+
EVENTS: FILLING_EVENTS,
|
|
126
|
+
Plugin: FormFillingPlugin,
|
|
127
|
+
createContext: () => {
|
|
128
|
+
return {
|
|
129
|
+
fieldMap: new Map(),
|
|
130
|
+
valueMap: new Map(),
|
|
131
|
+
subFieldsNameMap: new Map(),
|
|
132
|
+
conversationId: '',
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
};
|