@opentiny/tiny-robot 0.1.0-alpha.0 → 0.1.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/dist/{bubble-item → bubble}/components/actions/copy.vue.d.ts +3 -3
- package/dist/{bubble-item → bubble}/components/actions/refresh.vue.d.ts +1 -1
- package/dist/bubble/index.d.ts +12 -0
- package/dist/bubble/index.type.d.ts +53 -0
- package/dist/bubble/useScroll.d.ts +4 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.js +25 -18
- package/dist/node_modules/.pnpm/@opentiny_utils@1.0.0/node_modules/@opentiny/utils/dist/opentiny-utils.es.js +832 -0
- package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +959 -1496
- package/dist/node_modules/.pnpm/{@opentiny_vue-button@3.22.0 → @opentiny_vue-button@3.21.0}/node_modules/@opentiny/vue-button/lib/index.js +21 -21
- package/dist/node_modules/.pnpm/{@opentiny_vue-button@3.22.0 → @opentiny_vue-button@3.21.0}/node_modules/@opentiny/vue-button/lib/pc.js +3 -3
- package/dist/node_modules/.pnpm/@opentiny_vue-common@3.21.0/node_modules/@opentiny/vue-common/lib/index.js +727 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +144 -675
- package/dist/node_modules/.pnpm/{@opentiny_vue-dialog-box@3.22.0 → @opentiny_vue-dialog-box@3.21.0}/node_modules/@opentiny/vue-dialog-box/lib/index.js +9 -9
- package/dist/node_modules/.pnpm/{@opentiny_vue-dialog-box@3.22.0 → @opentiny_vue-dialog-box@3.21.0}/node_modules/@opentiny/vue-dialog-box/lib/pc.js +5 -5
- package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/close.js +29 -0
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/eyeclose.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/eyeopen.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/finish.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/fullscreen.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/loading-shadow.js +21 -22
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/minscreen.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-add-column-after.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-add-column-before.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-add-row-after.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-add-row-before.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-align-center.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-align-left.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-align-right.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-bold.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-code-block.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-code-view.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-color.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-delete-column.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-delete-row.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-delete-table.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-font-size.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-format-clear.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-h1.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-h2.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-h3.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-h4.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-h5.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-h6.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-heading.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-high-light.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-image.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-italic.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-line-height.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-link-unlink.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-link.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-list-ordered.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-list-unordered.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-merge-cells-vertical.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-merge-cells.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-node-delete.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-paragraph.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-quote-text.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-redo.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-split-cells-horizontal.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-split-cells-vertical.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-strike-through.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-subscript.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-superscript.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-table.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-task-list.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-underline.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/rich-text-undo.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/sub-script.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-icon@3.22.0 → @opentiny_vue-icon@3.21.0}/node_modules/@opentiny/vue-icon/lib/warn.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-input@3.22.0 → @opentiny_vue-input@3.21.0}/node_modules/@opentiny/vue-input/lib/index.js +3 -3
- package/dist/node_modules/.pnpm/{@opentiny_vue-input@3.22.0 → @opentiny_vue-input@3.21.0}/node_modules/@opentiny/vue-input/lib/pc.js +36 -36
- package/dist/node_modules/.pnpm/{@opentiny_vue-locale@3.22.0 → @opentiny_vue-locale@3.21.0}/node_modules/@opentiny/vue-locale/lib/index.js +63 -63
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/button/index.js +1 -1
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/browser.js +36 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/clickoutside.js +47 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/debounce.js +7 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/dom.js +45 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popper.js +320 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popup-manager.js +118 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/throttle.js +23 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useEventListener.js +9 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useInstanceSlots.js +14 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useRelation.js +54 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popper.js +84 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popup.js +73 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/event.js +13 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/function.js +5 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/index.js +11 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/object.js +84 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/string.js +28 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/type.js +28 -0
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/dialog-box/index.js +136 -0
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/dialog-box/vue.js +33 -34
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/input/index.js +22 -22
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/input/vue.js +9 -9
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/tall-storage/index.js +1 -1
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/tall-storage/vue.js +5 -5
- package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/tooltip/index.js +41 -40
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tooltip/vue.js +90 -0
- package/dist/node_modules/.pnpm/{@opentiny_vue-tooltip@3.22.0 → @opentiny_vue-tooltip@3.21.0}/node_modules/@opentiny/vue-tooltip/lib/index.js +3 -6
- package/dist/node_modules/.pnpm/{@opentiny_vue-tooltip@3.22.0 → @opentiny_vue-tooltip@3.21.0}/node_modules/@opentiny/vue-tooltip/lib/pc.js +2 -2
- package/dist/packages/components/src/{bubble-list → bubble}/bubble-list.vue.js +2 -2
- package/dist/packages/components/src/bubble/bubble-list.vue2.js +38 -0
- package/dist/packages/components/src/bubble/bubble.vue.js +7 -0
- package/dist/packages/components/src/bubble/bubble.vue2.js +118 -0
- package/dist/packages/components/src/bubble/components/actions/copy.vue.js +7 -0
- package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +35 -0
- package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +7 -0
- package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +16 -0
- package/dist/packages/components/src/bubble/index.js +18 -0
- package/dist/packages/components/src/bubble/useScroll.js +13 -0
- package/dist/packages/components/src/conversations/index.js +1 -1
- package/dist/packages/components/src/prompts/index.js +18 -0
- package/dist/packages/components/src/prompts/prompt.vue.js +7 -0
- package/dist/packages/components/src/prompts/prompt.vue2.js +37 -0
- package/dist/packages/components/src/prompts/prompts.vue.js +7 -0
- package/dist/packages/components/src/prompts/prompts.vue2.js +36 -0
- package/dist/packages/components/src/question/components/CommonQuestions.vue.js +89 -0
- package/dist/packages/components/src/question/components/CommonQuestions.vue2.js +4 -0
- package/dist/packages/components/src/question/components/HotQuestions.vue.js +140 -0
- package/dist/packages/components/src/question/components/HotQuestions.vue2.js +4 -0
- package/dist/packages/components/src/question/composables/useQuestions.js +48 -0
- package/dist/packages/components/src/question/index.js +9 -0
- package/dist/packages/components/src/question/index.vue.js +113 -0
- package/dist/packages/components/src/question/index.vue2.js +4 -0
- package/dist/packages/components/src/sender/components/ActionButtons.vue.js +105 -123
- package/dist/packages/components/src/sender/composables/useInputHandler.js +26 -22
- package/dist/packages/components/src/sender/composables/useKeyboardHandler.js +11 -11
- package/dist/packages/components/src/sender/composables/useSpeechHandler.js +9 -9
- package/dist/packages/components/src/sender/index.vue.js +67 -66
- package/dist/packages/components/src/welcome/index.vue.js +5 -7
- package/dist/packages/components/src/welcome/index.vue2.js +32 -0
- package/dist/packages/svgs/dist/tiny-robot-svgs.js +144 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.type.d.ts +55 -0
- package/dist/prompts/prompt.vue.d.ts +3 -0
- package/dist/prompts/prompts.vue.d.ts +20 -0
- package/dist/question/components/CommonQuestions.vue.d.ts +32 -0
- package/dist/question/components/HotQuestions.vue.d.ts +89 -0
- package/dist/question/composables/useQuestions.d.ts +17 -0
- package/dist/question/index.d.ts +7 -0
- package/dist/question/index.type.d.ts +74 -0
- package/dist/question/index.vue.d.ts +46 -0
- package/dist/sender/components/ActionButtons.vue.d.ts +6 -4
- package/dist/sender/composables/useSpeechHandler.d.ts +0 -6
- package/dist/sender/index.type.d.ts +1 -1
- package/dist/sender/index.vue.d.ts +1 -2
- package/dist/style.css +1 -1
- package/dist/welcome/index.type.d.ts +10 -0
- package/dist/welcome/index.vue.d.ts +17 -1
- package/package.json +5 -3
- package/src/bubble/bubble-list.vue +44 -0
- package/src/bubble/bubble.vue +247 -0
- package/src/bubble/components/actions/copy.vue +54 -0
- package/src/bubble/components/actions/refresh.vue +31 -0
- package/src/bubble/index.ts +23 -0
- package/src/bubble/index.type.ts +63 -0
- package/src/bubble/useScroll.ts +14 -0
- package/src/conversations/index.ts +1 -1
- package/src/index.ts +23 -12
- package/src/prompts/index.ts +25 -0
- package/src/prompts/index.type.ts +59 -0
- package/src/prompts/prompt.vue +115 -0
- package/src/prompts/prompts.vue +50 -0
- package/src/question/components/CommonQuestions.vue +146 -0
- package/src/question/components/HotQuestions.vue +148 -0
- package/src/question/composables/useQuestions.ts +106 -0
- package/src/question/index.less +448 -0
- package/src/question/index.ts +12 -0
- package/src/question/index.type.ts +86 -0
- package/src/question/index.vue +140 -0
- package/src/question/vars.less +135 -0
- package/src/sender/components/ActionButtons.vue +42 -39
- package/src/sender/composables/useInputHandler.ts +15 -10
- package/src/sender/composables/useKeyboardHandler.ts +6 -4
- package/src/sender/composables/useSpeechHandler.ts +5 -11
- package/src/sender/index.less +3 -5
- package/src/sender/index.type.ts +1 -1
- package/src/sender/index.vue +3 -2
- package/src/welcome/index.type.ts +12 -0
- package/src/welcome/index.vue +68 -2
- package/dist/bubble-item/components/icons/ai.vue.d.ts +0 -2
- package/dist/bubble-item/components/icons/index.d.ts +0 -2
- package/dist/bubble-item/components/icons/user.vue.d.ts +0 -2
- package/dist/bubble-item/index.d.ts +0 -7
- package/dist/bubble-list/index.d.ts +0 -8
- package/dist/bubble-list/index.type.d.ts +0 -55
- package/dist/node_modules/.pnpm/@opentiny_vue-directive@3.22.0/node_modules/@opentiny/vue-directive/index.js +0 -57
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +0 -85
- package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popup.js +0 -69
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/dialog-box/index.js +0 -135
- package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +0 -90
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +0 -15
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +0 -54
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +0 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/packages/components/src/bubble-item/bubble-item.vue.js +0 -7
- package/dist/packages/components/src/bubble-item/bubble-item.vue2.js +0 -111
- package/dist/packages/components/src/bubble-item/components/actions/copy.vue.js +0 -46
- package/dist/packages/components/src/bubble-item/components/actions/copy.vue2.js +0 -4
- package/dist/packages/components/src/bubble-item/components/actions/refresh.vue.js +0 -12
- package/dist/packages/components/src/bubble-item/components/icons/ai.vue.js +0 -45
- package/dist/packages/components/src/bubble-item/components/icons/user.vue.js +0 -63
- package/dist/packages/components/src/bubble-item/index.js +0 -9
- package/dist/packages/components/src/bubble-list/bubble-list.vue2.js +0 -52
- package/dist/packages/components/src/bubble-list/index.js +0 -9
- package/src/bubble-item/bubble-item.vue +0 -264
- package/src/bubble-item/components/actions/copy.vue +0 -47
- package/src/bubble-item/components/actions/refresh.vue +0 -27
- package/src/bubble-item/components/icons/ai.vue +0 -30
- package/src/bubble-item/components/icons/index.ts +0 -2
- package/src/bubble-item/components/icons/user.vue +0 -78
- package/src/bubble-item/index.ts +0 -12
- package/src/bubble-list/bubble-list.vue +0 -53
- package/src/bubble-list/index.ts +0 -14
- package/src/bubble-list/index.type.ts +0 -65
- package/src/sender/global.d.ts +0 -44
- /package/dist/{bubble-list → bubble}/bubble-list.vue.d.ts +0 -0
- /package/dist/{bubble-item → bubble}/components/actions/index.d.ts +0 -0
- /package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/button/vue.js +0 -0
- /package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/chunk-G2ADBYYC.js +0 -0
- /package/dist/node_modules/.pnpm/{@opentiny_vue-renderless@3.22.0 → @opentiny_vue-renderless@3.21.2}/node_modules/@opentiny/vue-renderless/tall-storage/vue-storage-box.js +0 -0
- /package/src/{bubble-item → bubble}/components/actions/index.ts +0 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
@import './vars.less';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TR Question 组件样式
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* ================ 滚动穿透防止 ================ */
|
|
8
|
+
/**
|
|
9
|
+
* 当弹窗打开时应用于body的类
|
|
10
|
+
* 解决滚动穿透问题 - 防止弹窗打开时背景内容滚动
|
|
11
|
+
*/
|
|
12
|
+
body.tr-modal-open {
|
|
13
|
+
overflow: hidden !important;
|
|
14
|
+
position: fixed;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ================ 基础容器样式 ================ */
|
|
20
|
+
/**
|
|
21
|
+
* 组件根容器
|
|
22
|
+
*/
|
|
23
|
+
.tr-question-container {
|
|
24
|
+
position: relative;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
height: var(--tr-question-container-height);
|
|
28
|
+
padding: 0;
|
|
29
|
+
font-size: var(--tr-question-font-size);
|
|
30
|
+
line-height: var(--tr-question-line-height);
|
|
31
|
+
color: var(--tr-question-text-color);
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ================ 触发按钮样式 ================ */
|
|
36
|
+
/**
|
|
37
|
+
* 热门问题触发按钮
|
|
38
|
+
* 位于左侧,点击显示弹窗
|
|
39
|
+
*/
|
|
40
|
+
.tr-question-trigger {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 5px;
|
|
43
|
+
left: 0;
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
align-items: center;
|
|
47
|
+
margin: 2px 8px 0 0;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
transform: scale(1.05);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* 按钮图标 */
|
|
55
|
+
& > svg {
|
|
56
|
+
width: 28px;
|
|
57
|
+
height: 28px;
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
fill: #ffffff;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
& > svg:hover {
|
|
63
|
+
fill: #f5f5f5;
|
|
64
|
+
transform: scale(1.05);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ================ 弹窗样式 ================ */
|
|
69
|
+
/**
|
|
70
|
+
* 弹窗外层遮罩
|
|
71
|
+
* 全屏遮罩层,内部包含问题弹窗
|
|
72
|
+
*/
|
|
73
|
+
.tr-question-modal-backdrop {
|
|
74
|
+
position: fixed;
|
|
75
|
+
top: 0;
|
|
76
|
+
left: 0;
|
|
77
|
+
right: 0;
|
|
78
|
+
bottom: 0;
|
|
79
|
+
background-color: var(--tr-question-modal-backdrop-color);
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
align-items: center;
|
|
83
|
+
z-index: 1000;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
overscroll-behavior: contain; /* 防止滚动传递 */
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 问题弹窗面板
|
|
90
|
+
* 包含标题、分类标签和问题列表
|
|
91
|
+
*/
|
|
92
|
+
.tr-question-panel {
|
|
93
|
+
position: relative;
|
|
94
|
+
border: none;
|
|
95
|
+
border-radius: var(--tr-question-border-radius);
|
|
96
|
+
padding: var(--tr-question-modal-padding);
|
|
97
|
+
box-shadow: var(--tr-question-panel-shadow);
|
|
98
|
+
background-color: var(--tr-question-modal-background-color);
|
|
99
|
+
max-height: var(--tr-question-modal-max-height);
|
|
100
|
+
max-width: var(--tr-question-modal-max-width);
|
|
101
|
+
width: 100%;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
box-sizing: border-box;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 弹窗标题栏
|
|
110
|
+
* 包含标题文本和关闭按钮
|
|
111
|
+
*/
|
|
112
|
+
.tr-question-header {
|
|
113
|
+
display: flex;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
align-items: center;
|
|
116
|
+
margin-bottom: var(--tr-question-spacing);
|
|
117
|
+
|
|
118
|
+
/* 标题文本 */
|
|
119
|
+
&-title {
|
|
120
|
+
font-size: var(--tr-question-title-font-size);
|
|
121
|
+
font-weight: var(--tr-question-title-font-weight);
|
|
122
|
+
color: var(--tr-question-title-color);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* 关闭按钮 */
|
|
126
|
+
.tr-question-close-btn {
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
color: var(--tr-question-close-icon-color);
|
|
132
|
+
transition: var(--tr-question-hover-transition);
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
color: var(--tr-question-text-color);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ================ 分类标签样式 ================ */
|
|
141
|
+
/**
|
|
142
|
+
* 分类标签容器
|
|
143
|
+
* 水平展示问题分类,支持点击切换
|
|
144
|
+
*/
|
|
145
|
+
.tr-question-categories {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-wrap: wrap;
|
|
148
|
+
gap: 8px;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 单个分类标签
|
|
152
|
+
* 支持悬停和激活状态样式
|
|
153
|
+
*/
|
|
154
|
+
&-item {
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
border-radius: var(--tr-question-category-border-radius);
|
|
157
|
+
background: var(--tr-question-category-bg);
|
|
158
|
+
border: 1px solid transparent;
|
|
159
|
+
height: var(--tr-question-category-height);
|
|
160
|
+
padding: 10px 16px;
|
|
161
|
+
margin-right: 8px;
|
|
162
|
+
color: var(--tr-question-tab-text);
|
|
163
|
+
transition: var(--tr-question-hover-transition);
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 4px;
|
|
167
|
+
|
|
168
|
+
/* 分类图标 */
|
|
169
|
+
.category-icon {
|
|
170
|
+
font-size: var(--tr-question-icon-size);
|
|
171
|
+
margin-right: 4px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* 悬停效果 */
|
|
175
|
+
&:hover {
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
background: var(--tr-question-category-hover-bg);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* 激活状态 */
|
|
181
|
+
&.active {
|
|
182
|
+
background: var(--tr-question-common-bg) !important;
|
|
183
|
+
border: 1px solid var(--tr-question-category-active-border) !important;
|
|
184
|
+
color: var(--tr-question-text-color);
|
|
185
|
+
font-weight: 500;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* ================ 问题列表样式 ================ */
|
|
191
|
+
/**
|
|
192
|
+
* 问题内容区
|
|
193
|
+
* 包含问题列表,支持滚动
|
|
194
|
+
*/
|
|
195
|
+
.tr-question-content {
|
|
196
|
+
flex: 1;
|
|
197
|
+
max-height: var(--tr-question-content-max-height);
|
|
198
|
+
overflow-y: auto;
|
|
199
|
+
padding: 10px 0;
|
|
200
|
+
overscroll-behavior: contain;
|
|
201
|
+
position: relative;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 自定义滚动条样式
|
|
205
|
+
*/
|
|
206
|
+
&::-webkit-scrollbar {
|
|
207
|
+
width: var(--tr-question-scrollbar-width);
|
|
208
|
+
height: 10px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&::-webkit-scrollbar-track {
|
|
212
|
+
background: var(--tr-question-scrollbar-track-bg);
|
|
213
|
+
border-radius: var(--tr-question-scrollbar-border-radius);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&::-webkit-scrollbar-thumb {
|
|
217
|
+
background-color: var(--tr-question-scrollbar-thumb-bg);
|
|
218
|
+
border-radius: var(--tr-question-scrollbar-border-radius);
|
|
219
|
+
transition: background-color var(--tr-question-transition-duration);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
223
|
+
background-color: var(--tr-question-scrollbar-thumb-hover-bg);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* 问题列表
|
|
228
|
+
*/
|
|
229
|
+
& > ul {
|
|
230
|
+
list-style: none;
|
|
231
|
+
padding: 0;
|
|
232
|
+
margin: 0;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 问题项
|
|
236
|
+
* 支持悬停效果和溢出文本处理
|
|
237
|
+
*/
|
|
238
|
+
& > li {
|
|
239
|
+
color: var(--tr-question-common-text);
|
|
240
|
+
font-size: var(--tr-question-font-size);
|
|
241
|
+
font-weight: var(--tr-question-item-font-weight);
|
|
242
|
+
line-height: var(--tr-question-item-height);
|
|
243
|
+
text-align: left;
|
|
244
|
+
height: var(--tr-question-item-height);
|
|
245
|
+
border-radius: var(--tr-question-list-border-radius);
|
|
246
|
+
background: var(--tr-question-list-item-bg);
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
margin: 5px 1px 2px 1px;
|
|
249
|
+
padding: 0 var(--tr-question-spacing);
|
|
250
|
+
white-space: nowrap;
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
text-overflow: ellipsis;
|
|
253
|
+
border-bottom: 1px solid var(--tr-question-item-border-color);
|
|
254
|
+
transition: var(--tr-question-hover-transition);
|
|
255
|
+
|
|
256
|
+
/* 序号样式 */
|
|
257
|
+
span:first-child {
|
|
258
|
+
display: inline-block;
|
|
259
|
+
margin-right: 4px;
|
|
260
|
+
color: var(--tr-question-text-color-secondary);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* 最后一项去除底部边框 */
|
|
264
|
+
&:last-child {
|
|
265
|
+
border-bottom: none;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* 悬停效果 */
|
|
269
|
+
&:hover {
|
|
270
|
+
box-shadow: 0 2px 12px var(--tr-question-list-hover-shadow);
|
|
271
|
+
position: relative;
|
|
272
|
+
z-index: 10;
|
|
273
|
+
transform: translateY(-2px);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* 换行模式下的问题项样式
|
|
280
|
+
*/
|
|
281
|
+
&-wrap .tr-question-list-item {
|
|
282
|
+
white-space: normal;
|
|
283
|
+
height: auto;
|
|
284
|
+
min-height: var(--tr-question-item-height);
|
|
285
|
+
line-height: var(--tr-question-item-line-height);
|
|
286
|
+
padding-top: 8px;
|
|
287
|
+
padding-bottom: 8px;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* ================ 常见问题样式 ================ */
|
|
292
|
+
/**
|
|
293
|
+
* 常见问题容器
|
|
294
|
+
* 横向展示常见问题
|
|
295
|
+
*/
|
|
296
|
+
.tr-common-questions {
|
|
297
|
+
margin-left: 40px;
|
|
298
|
+
width: calc(100% - 40px);
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
flex: 1;
|
|
302
|
+
height: 100%;
|
|
303
|
+
overflow-x: auto;
|
|
304
|
+
overflow-y: hidden;
|
|
305
|
+
white-space: nowrap;
|
|
306
|
+
flex-wrap: nowrap;
|
|
307
|
+
transition: all 0.3s ease;
|
|
308
|
+
position: relative;
|
|
309
|
+
|
|
310
|
+
&.expanded {
|
|
311
|
+
flex-wrap: wrap;
|
|
312
|
+
align-content: flex-end;
|
|
313
|
+
height: auto;
|
|
314
|
+
max-height: 200px; /* 可以根据需要调整 */
|
|
315
|
+
overflow-y: auto;
|
|
316
|
+
position: absolute;
|
|
317
|
+
bottom: 0;
|
|
318
|
+
z-index: 5;
|
|
319
|
+
padding: 8px 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* 常见问题项
|
|
324
|
+
* 支持悬停效果和溢出文本处理
|
|
325
|
+
*/
|
|
326
|
+
&_item {
|
|
327
|
+
max-width: 515px;
|
|
328
|
+
text-overflow: ellipsis;
|
|
329
|
+
overflow: hidden;
|
|
330
|
+
display: flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
gap: 8px;
|
|
333
|
+
white-space: nowrap;
|
|
334
|
+
color: var(--tr-question-common-text);
|
|
335
|
+
border: none;
|
|
336
|
+
background: var(--tr-question-common-bg);
|
|
337
|
+
margin: 1px 8px 4px 0;
|
|
338
|
+
cursor: pointer;
|
|
339
|
+
text-decoration: none;
|
|
340
|
+
height: var(--tr-question-common-item-height);
|
|
341
|
+
padding: 0 16px;
|
|
342
|
+
border-radius: var(--tr-question-common-border-radius);
|
|
343
|
+
box-shadow: var(--tr-question-common-item-shadow);
|
|
344
|
+
transition: var(--tr-question-hover-transition);
|
|
345
|
+
|
|
346
|
+
& > svg {
|
|
347
|
+
width: 16px;
|
|
348
|
+
height: 16px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* 悬停效果 */
|
|
352
|
+
&:hover {
|
|
353
|
+
background-color: var(--tr-question-common-hover-bg);
|
|
354
|
+
transform: translateY(-1px);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* 自定义滚动条 */
|
|
359
|
+
&::-webkit-scrollbar {
|
|
360
|
+
height: var(--tr-question-scrollbar-width);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
&::-webkit-scrollbar-track {
|
|
364
|
+
background: var(--tr-question-scrollbar-track-bg);
|
|
365
|
+
border-radius: var(--tr-question-scrollbar-border-radius);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
&::-webkit-scrollbar-thumb {
|
|
369
|
+
background-color: var(--tr-question-scrollbar-thumb-bg);
|
|
370
|
+
border-radius: var(--tr-question-scrollbar-border-radius);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
374
|
+
background-color: var(--tr-question-scrollbar-thumb-hover-bg);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* ================ 切换按钮样式 ================ */
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* 换行切换按钮
|
|
382
|
+
* 控制问题展示方式
|
|
383
|
+
*/
|
|
384
|
+
.tr-question-wrap-trigger {
|
|
385
|
+
position: absolute;
|
|
386
|
+
right: 0;
|
|
387
|
+
z-index: 10;
|
|
388
|
+
cursor: pointer;
|
|
389
|
+
display: flex;
|
|
390
|
+
align-items: center;
|
|
391
|
+
justify-content: center;
|
|
392
|
+
width: 26px;
|
|
393
|
+
height: 26px;
|
|
394
|
+
|
|
395
|
+
/* 按钮图标 */
|
|
396
|
+
& > svg {
|
|
397
|
+
width: 1em;
|
|
398
|
+
height: 1em;
|
|
399
|
+
font-size: 32px;
|
|
400
|
+
border-radius: 50%;
|
|
401
|
+
fill: #ffffff;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
& > svg:hover {
|
|
405
|
+
fill: #f5f5f5;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/* ================ 状态指示器样式 ================ */
|
|
410
|
+
/**
|
|
411
|
+
* 加载状态
|
|
412
|
+
*/
|
|
413
|
+
.tr-question-loading {
|
|
414
|
+
padding: var(--tr-question-spacing);
|
|
415
|
+
text-align: center;
|
|
416
|
+
|
|
417
|
+
&-spinner {
|
|
418
|
+
width: 24px;
|
|
419
|
+
height: 24px;
|
|
420
|
+
border: 2px solid var(--tr-question-border-color);
|
|
421
|
+
border-top-color: var(--tr-question-primary-color);
|
|
422
|
+
border-radius: 50%;
|
|
423
|
+
margin: 0 auto;
|
|
424
|
+
animation: tr-question-spin 1s linear infinite;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* 空状态
|
|
430
|
+
*/
|
|
431
|
+
.tr-question-empty {
|
|
432
|
+
padding: var(--tr-question-spacing);
|
|
433
|
+
text-align: center;
|
|
434
|
+
color: var(--tr-question-text-color-secondary);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* ================ 动画效果 ================ */
|
|
438
|
+
/**
|
|
439
|
+
* 加载动画
|
|
440
|
+
*/
|
|
441
|
+
@keyframes tr-question-spin {
|
|
442
|
+
0% {
|
|
443
|
+
transform: rotate(0deg);
|
|
444
|
+
}
|
|
445
|
+
100% {
|
|
446
|
+
transform: rotate(360deg);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue'
|
|
2
|
+
import Question from './index.vue'
|
|
3
|
+
|
|
4
|
+
Question.name = 'TrQuestion'
|
|
5
|
+
|
|
6
|
+
const install = function <T>(app: App<T>) {
|
|
7
|
+
app.component(Question.name!, Question)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Question.install = install
|
|
11
|
+
|
|
12
|
+
export default Question as typeof Question & { install: typeof install }
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export interface Category {
|
|
2
|
+
id: string
|
|
3
|
+
label: string
|
|
4
|
+
icon?: string
|
|
5
|
+
questions: Question[]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Question {
|
|
9
|
+
id: string
|
|
10
|
+
text: string
|
|
11
|
+
keywords?: string[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TrQuestionPanel {
|
|
15
|
+
openModal: () => void
|
|
16
|
+
closeModal: () => void
|
|
17
|
+
toggleFloating: () => void
|
|
18
|
+
setActiveCategory: (categoryId: string) => void
|
|
19
|
+
refreshData: () => Promise<void>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type ThemeType = 'light' | 'dark'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Question组件属性定义
|
|
26
|
+
*/
|
|
27
|
+
export interface QuestionProps {
|
|
28
|
+
/**
|
|
29
|
+
* 问题分类列表
|
|
30
|
+
* 包含多个分类,每个分类下有多个问题
|
|
31
|
+
*/
|
|
32
|
+
categories: Category[]
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 浮动显示的问题列表
|
|
36
|
+
* 显示在组件底部的常见问题胶囊
|
|
37
|
+
*/
|
|
38
|
+
commonQuestions: Question[]
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 是否初始展开常见问题
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
initialExpanded?: boolean
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 弹窗宽度
|
|
48
|
+
* @default '640px'
|
|
49
|
+
*/
|
|
50
|
+
modalWidth?: string
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 主题类型
|
|
54
|
+
* @default 'light'
|
|
55
|
+
*/
|
|
56
|
+
theme?: ThemeType
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 是否点击外部关闭弹窗
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
closeOnClickOutside?: boolean
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 是否显示加载中状态
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
loading?: boolean
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Question组件事件定义
|
|
73
|
+
*/
|
|
74
|
+
export type QuestionEmits = {
|
|
75
|
+
/**
|
|
76
|
+
* 问题点击事件
|
|
77
|
+
* @param question 被点击的问题对象
|
|
78
|
+
*/
|
|
79
|
+
'question-click': [question: Question]
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 分类选择事件
|
|
83
|
+
* @param category 被选择的分类对象
|
|
84
|
+
*/
|
|
85
|
+
'select-category': [category: Category]
|
|
86
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, defineProps, defineEmits, defineExpose, watch, onMounted, withDefaults } from 'vue'
|
|
3
|
+
import { useQuestions } from './composables/useQuestions'
|
|
4
|
+
import CommonQuestions from './components/CommonQuestions.vue'
|
|
5
|
+
import HotQuestions from './components/HotQuestions.vue'
|
|
6
|
+
import type { Category, Question, QuestionProps, QuestionEmits } from './index.type'
|
|
7
|
+
|
|
8
|
+
import { IconHotQuestion, IconArrowUp, IconArrowDown, IconTypeAll } from '@opentiny/tiny-robot-svgs'
|
|
9
|
+
import './index.less'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<QuestionProps>(), {
|
|
12
|
+
categories: () => [] as Category[],
|
|
13
|
+
commonQuestions: () => [] as Question[],
|
|
14
|
+
initialExpanded: false,
|
|
15
|
+
modalWidth: '640px',
|
|
16
|
+
theme: 'light',
|
|
17
|
+
closeOnClickOutside: true,
|
|
18
|
+
loading: false,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
// 切换问题展示
|
|
22
|
+
const toggleExpand = () => {
|
|
23
|
+
isExpanded.value = !isExpanded.value
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const emit = defineEmits<QuestionEmits>()
|
|
27
|
+
|
|
28
|
+
const categories = computed(() => props.categories)
|
|
29
|
+
const isExpanded = ref(props.initialExpanded)
|
|
30
|
+
|
|
31
|
+
const { modalVisible, currentTheme, setActiveCategory, openModal, closeModal, setTheme, refreshData } =
|
|
32
|
+
useQuestions(categories)
|
|
33
|
+
|
|
34
|
+
// 同步 props 到内部状态
|
|
35
|
+
watch(
|
|
36
|
+
() => props.theme,
|
|
37
|
+
(value) => {
|
|
38
|
+
setTheme(value)
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
// 处理问题点击
|
|
43
|
+
const handleQuestionClick = (question: Question) => {
|
|
44
|
+
closeModal()
|
|
45
|
+
emit('question-click', question)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 处理分类选择
|
|
49
|
+
const handleCategorySelect = (category: Category) => {
|
|
50
|
+
if (category) {
|
|
51
|
+
setActiveCategory(category.id)
|
|
52
|
+
emit('select-category', category)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 处理按钮隐藏
|
|
57
|
+
const showExpandButton = ref(false)
|
|
58
|
+
|
|
59
|
+
const handleShowExpandButton = (value: boolean) => {
|
|
60
|
+
showExpandButton.value = value
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 组件挂载时初始化主题
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
document.documentElement.setAttribute('data-theme', currentTheme.value)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// 暴露实例方法
|
|
69
|
+
defineExpose({
|
|
70
|
+
openModal,
|
|
71
|
+
closeModal,
|
|
72
|
+
toggleFloating: toggleExpand,
|
|
73
|
+
setActiveCategory,
|
|
74
|
+
refreshData,
|
|
75
|
+
})
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<div class="tr-question-container" :class="[`theme-${theme}`]" :data-theme="theme">
|
|
80
|
+
<!-- 热门问题弹窗触发按钮 -->
|
|
81
|
+
<div class="tr-question-trigger" @click="openModal">
|
|
82
|
+
<IconHotQuestion />
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<!-- 热门问题弹窗 -->
|
|
86
|
+
<HotQuestions
|
|
87
|
+
:visible="modalVisible"
|
|
88
|
+
:categories="categories"
|
|
89
|
+
:modal-width="modalWidth"
|
|
90
|
+
:loading="loading"
|
|
91
|
+
:close-on-click-outside="closeOnClickOutside"
|
|
92
|
+
@update:visible="modalVisible = $event"
|
|
93
|
+
@close="modalVisible = false"
|
|
94
|
+
@question-click="handleQuestionClick"
|
|
95
|
+
@select-category="handleCategorySelect"
|
|
96
|
+
>
|
|
97
|
+
<!-- 传递插槽内容 -->
|
|
98
|
+
<template #category-label="{ category }">
|
|
99
|
+
<slot name="category-label" :category="category">
|
|
100
|
+
<div class="category-icon">
|
|
101
|
+
<IconTypeAll />
|
|
102
|
+
</div>
|
|
103
|
+
<span>{{ category.label }}</span>
|
|
104
|
+
</slot>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<template #question-item="{ question, index }">
|
|
108
|
+
<slot name="question-item" :question="question" :index="index">
|
|
109
|
+
<span>{{ index + 1 }}.</span> {{ question.text }}
|
|
110
|
+
</slot>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<template #loading-indicator>
|
|
114
|
+
<slot name="loading-indicator">
|
|
115
|
+
<div class="tr-question-loading-spinner"></div>
|
|
116
|
+
</slot>
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<template #empty-state>
|
|
120
|
+
<slot name="empty-state">
|
|
121
|
+
<p>暂无相关问题</p>
|
|
122
|
+
</slot>
|
|
123
|
+
</template>
|
|
124
|
+
</HotQuestions>
|
|
125
|
+
|
|
126
|
+
<!-- 常见问题胶囊 -->
|
|
127
|
+
<CommonQuestions
|
|
128
|
+
:isExpanded="isExpanded"
|
|
129
|
+
:questions="commonQuestions"
|
|
130
|
+
@show-expand-button="handleShowExpandButton"
|
|
131
|
+
@question-click="handleQuestionClick"
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<!-- 常规问题完整内容触发按钮 -->
|
|
135
|
+
<div v-if="showExpandButton" class="tr-question-wrap-trigger" @click="toggleExpand">
|
|
136
|
+
<IconArrowUp v-if="!isExpanded" />
|
|
137
|
+
<IconArrowDown v-else />
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</template>
|