@opentiny/tiny-robot 0.1.0-alpha.0 → 0.2.0-alpha.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/container/index.d.ts +7 -0
- package/dist/container/index.type.d.ts +16 -0
- package/dist/container/index.vue.d.ts +26 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +31 -20
- 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 +37 -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/container/index.js +9 -0
- package/dist/packages/components/src/container/index.vue.js +7 -0
- package/dist/packages/components/src/container/index.vue2.js +55 -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 +223 -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 +3 -4
- 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 +6 -5
- package/src/bubble/bubble-list.vue +42 -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/container/index.ts +12 -0
- package/src/container/index.type.ts +17 -0
- package/src/container/index.vue +135 -0
- package/src/conversations/index.ts +1 -1
- package/src/index.ts +26 -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/.vscode/extensions.json +0 -3
- 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,55 @@
|
|
|
1
|
+
import { defineComponent as f, useCssVars as v, useModel as i, computed as p, createElementBlock as _, openBlock as m, createElementVNode as e, renderSlot as n, createVNode as a, unref as c } from "vue";
|
|
2
|
+
import { IconCancelFullScreen as b, IconFullScreen as h, IconClose as w } from "../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
const $ = { class: "tr-container" }, g = { class: "tr-container__header" }, C = { class: "tr-container__header-operations" }, S = { class: "tr-container__body" }, k = { class: "tr-container__footer" }, I = /* @__PURE__ */ f({
|
|
4
|
+
__name: "index",
|
|
5
|
+
props: {
|
|
6
|
+
show: { type: Boolean, required: !0 },
|
|
7
|
+
showModifiers: {},
|
|
8
|
+
fullscreen: { type: Boolean },
|
|
9
|
+
fullscreenModifiers: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["update:show", "update:fullscreen"],
|
|
12
|
+
setup(r) {
|
|
13
|
+
v((o) => ({
|
|
14
|
+
"4f670360": s.value ? "0" : "unset",
|
|
15
|
+
"01550f1a": s.value ? "unset" : "var(--tr-container-width)",
|
|
16
|
+
"9b01cee4": l.value ? "100" : "-1",
|
|
17
|
+
"46b87c3c": l.value ? "1" : "0"
|
|
18
|
+
}));
|
|
19
|
+
const l = i(r, "show"), s = i(r, "fullscreen"), u = p(() => s.value ? b : h);
|
|
20
|
+
return (o, t) => (m(), _("div", $, [
|
|
21
|
+
t[3] || (t[3] = e("div", { class: "tr-container__dragging-bar-wrapper" }, [
|
|
22
|
+
e("div", { class: "tr-container__dragging-bar" })
|
|
23
|
+
], -1)),
|
|
24
|
+
e("div", g, [
|
|
25
|
+
n(o.$slots, "title", {}, () => [
|
|
26
|
+
t[2] || (t[2] = e("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
|
|
27
|
+
], !0),
|
|
28
|
+
e("div", C, [
|
|
29
|
+
n(o.$slots, "operations", {}, void 0, !0),
|
|
30
|
+
e("button", {
|
|
31
|
+
class: "icon-btn",
|
|
32
|
+
onClick: t[0] || (t[0] = (d) => o.$emit("update:fullscreen", !s.value))
|
|
33
|
+
}, [
|
|
34
|
+
a(c(u))
|
|
35
|
+
]),
|
|
36
|
+
e("button", {
|
|
37
|
+
class: "icon-btn",
|
|
38
|
+
onClick: t[1] || (t[1] = (d) => o.$emit("update:show", !1))
|
|
39
|
+
}, [
|
|
40
|
+
a(c(w))
|
|
41
|
+
])
|
|
42
|
+
])
|
|
43
|
+
]),
|
|
44
|
+
e("div", S, [
|
|
45
|
+
n(o.$slots, "default", {}, void 0, !0)
|
|
46
|
+
]),
|
|
47
|
+
e("div", k, [
|
|
48
|
+
n(o.$slots, "footer", {}, void 0, !0)
|
|
49
|
+
])
|
|
50
|
+
]));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
I as default
|
|
55
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import o from "./prompt.vue.js";
|
|
2
|
+
import t from "./prompts.vue.js";
|
|
3
|
+
o.name = "TrPrompt";
|
|
4
|
+
const n = function(m) {
|
|
5
|
+
m.component(o.name, o);
|
|
6
|
+
};
|
|
7
|
+
o.install = n;
|
|
8
|
+
const a = o;
|
|
9
|
+
t.name = "TrPrompts";
|
|
10
|
+
const p = function(m) {
|
|
11
|
+
m.component(t.name, t);
|
|
12
|
+
};
|
|
13
|
+
t.install = p;
|
|
14
|
+
const c = t;
|
|
15
|
+
export {
|
|
16
|
+
a as Prompt,
|
|
17
|
+
c as Prompts
|
|
18
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as s, computed as c, createElementBlock as p, openBlock as t, normalizeClass as a, createElementVNode as o, createBlock as i, resolveDynamicComponent as l, createCommentVNode as b, toDisplayString as d } from "vue";
|
|
2
|
+
const g = { class: "tr-prompt__icon" }, v = { class: "tr-prompt__content" }, C = { class: "tr-prompt__content-label" }, f = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "tr-prompt__content-description"
|
|
5
|
+
}, k = /* @__PURE__ */ s({
|
|
6
|
+
__name: "prompt",
|
|
7
|
+
props: {
|
|
8
|
+
label: {},
|
|
9
|
+
id: {},
|
|
10
|
+
description: {},
|
|
11
|
+
icon: {},
|
|
12
|
+
disabled: { type: Boolean },
|
|
13
|
+
badge: {}
|
|
14
|
+
},
|
|
15
|
+
setup(_) {
|
|
16
|
+
const e = _, r = (n) => n ? s(() => () => n) : null, m = c(() => r(e.icon)), u = c(() => r(e.badge));
|
|
17
|
+
return (n, h) => (t(), p("div", {
|
|
18
|
+
class: a(["tr-prompt", { disabled: e.disabled }])
|
|
19
|
+
}, [
|
|
20
|
+
o("div", g, [
|
|
21
|
+
(t(), i(l(m.value)))
|
|
22
|
+
]),
|
|
23
|
+
o("div", v, [
|
|
24
|
+
o("h6", C, d(e.label), 1),
|
|
25
|
+
e.description ? (t(), p("p", f, d(e.description), 1)) : b("", !0)
|
|
26
|
+
]),
|
|
27
|
+
o("div", {
|
|
28
|
+
class: a(["tr-prompt__badge", { label: typeof e.badge == "string" }])
|
|
29
|
+
}, [
|
|
30
|
+
(t(), i(l(u.value)))
|
|
31
|
+
], 2)
|
|
32
|
+
], 2));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
k as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineComponent as d, createElementBlock as l, openBlock as o, createElementVNode as u, renderSlot as _, normalizeClass as k, Fragment as f, renderList as C, createBlock as y, mergeProps as v, toRaw as B } from "vue";
|
|
2
|
+
import w from "./prompt.vue.js";
|
|
3
|
+
const h = { class: "tr-prompts" }, E = /* @__PURE__ */ d({
|
|
4
|
+
__name: "prompts",
|
|
5
|
+
props: {
|
|
6
|
+
items: {},
|
|
7
|
+
itemStyle: {},
|
|
8
|
+
itemClass: {},
|
|
9
|
+
vertical: { type: Boolean },
|
|
10
|
+
wrap: { type: Boolean }
|
|
11
|
+
},
|
|
12
|
+
emits: ["item-click"],
|
|
13
|
+
setup(i, { emit: c }) {
|
|
14
|
+
const e = i, n = c, a = (t, s) => {
|
|
15
|
+
n("item-click", t, B(s));
|
|
16
|
+
};
|
|
17
|
+
return (t, s) => (o(), l("div", h, [
|
|
18
|
+
u("div", {
|
|
19
|
+
class: k(["tr-prompts__list-container", { wrap: e.wrap, vertical: e.vertical }])
|
|
20
|
+
}, [
|
|
21
|
+
(o(!0), l(f, null, C(e.items, (r, m) => (o(), y(w, v({
|
|
22
|
+
key: r.id || m,
|
|
23
|
+
ref_for: !0
|
|
24
|
+
}, r, {
|
|
25
|
+
style: e.itemStyle,
|
|
26
|
+
class: e.itemClass,
|
|
27
|
+
onClick: (p) => a(p, r)
|
|
28
|
+
}), null, 16, ["style", "class", "onClick"]))), 128))
|
|
29
|
+
], 2),
|
|
30
|
+
_(t.$slots, "footer", {}, void 0, !0)
|
|
31
|
+
]));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
E as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent as W, ref as a, watch as C, onMounted as z, onBeforeUnmount as R, createElementBlock as o, openBlock as s, normalizeClass as V, createCommentVNode as L, Fragment as w, renderList as E, createElementVNode as I, createTextVNode as q, createVNode as g, unref as b, toDisplayString as Q, nextTick as T } from "vue";
|
|
2
|
+
import { IconEdit as $ } from "../../../../svgs/dist/tiny-robot-svgs.js";
|
|
3
|
+
const A = ["onClick"], D = { style: { display: "flex", "align-items": "center" } }, F = { key: 0 }, M = ["onClick"], U = /* @__PURE__ */ W({
|
|
4
|
+
__name: "CommonQuestions",
|
|
5
|
+
props: {
|
|
6
|
+
questions: {
|
|
7
|
+
type: Array,
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
isExpanded: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
emits: ["question-click", "show-expand-button"],
|
|
16
|
+
setup(B, { emit: N }) {
|
|
17
|
+
const i = B, h = N, d = a(null), r = a(!1), c = a(!1), m = a([]), u = a([]);
|
|
18
|
+
C(
|
|
19
|
+
() => i.isExpanded,
|
|
20
|
+
(n) => {
|
|
21
|
+
c.value = n;
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
const v = async () => {
|
|
25
|
+
if (await T(), d.value) {
|
|
26
|
+
const n = d.value, k = n.clientWidth;
|
|
27
|
+
if (m.value = [], u.value = [], i.questions.length === 0) {
|
|
28
|
+
r.value = !1;
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
let e = 0;
|
|
32
|
+
const l = 8, t = document.createElement("div");
|
|
33
|
+
t.className = "tr-common-questions_item", t.style.visibility = "hidden", t.style.position = "absolute", n.appendChild(t);
|
|
34
|
+
for (let p = 0; p < i.questions.length; p++) {
|
|
35
|
+
const f = i.questions[p];
|
|
36
|
+
t.textContent = f.text;
|
|
37
|
+
const y = t.offsetWidth + l;
|
|
38
|
+
e + y <= k ? (e += y, m.value.push(f)) : u.value.push(f);
|
|
39
|
+
}
|
|
40
|
+
n.removeChild(t), r.value = u.value.length > 0, c.value = !1, h("show-expand-button", r.value);
|
|
41
|
+
}
|
|
42
|
+
}, _ = (n) => {
|
|
43
|
+
h("question-click", n);
|
|
44
|
+
};
|
|
45
|
+
C(
|
|
46
|
+
() => i.questions,
|
|
47
|
+
() => {
|
|
48
|
+
v();
|
|
49
|
+
},
|
|
50
|
+
{ deep: !0 }
|
|
51
|
+
);
|
|
52
|
+
const x = () => {
|
|
53
|
+
v();
|
|
54
|
+
};
|
|
55
|
+
return z(() => {
|
|
56
|
+
v(), window.addEventListener("resize", x);
|
|
57
|
+
}), R(() => {
|
|
58
|
+
window.removeEventListener("resize", x);
|
|
59
|
+
}), (n, k) => (s(), o("div", {
|
|
60
|
+
class: V(["tr-common-questions", { expanded: c.value }]),
|
|
61
|
+
ref_key: "commonQuestionsRef",
|
|
62
|
+
ref: d
|
|
63
|
+
}, [
|
|
64
|
+
(s(!0), o(w, null, E(m.value, (e, l) => (s(), o("div", {
|
|
65
|
+
key: `visible-${e.id}-${l}`,
|
|
66
|
+
class: "tr-common-questions_item",
|
|
67
|
+
onClick: (t) => _(e)
|
|
68
|
+
}, [
|
|
69
|
+
I("div", D, [
|
|
70
|
+
g(b($))
|
|
71
|
+
]),
|
|
72
|
+
q(" " + Q(e.text), 1)
|
|
73
|
+
], 8, A))), 128)),
|
|
74
|
+
c.value ? (s(), o("div", F, [
|
|
75
|
+
(s(!0), o(w, null, E(u.value, (e, l) => (s(), o("div", {
|
|
76
|
+
key: `hidden-${e.id}-${l}`,
|
|
77
|
+
class: "tr-common-questions_item",
|
|
78
|
+
onClick: (t) => _(e)
|
|
79
|
+
}, [
|
|
80
|
+
g(b($)),
|
|
81
|
+
q(" " + Q(e.text), 1)
|
|
82
|
+
], 8, M))), 128))
|
|
83
|
+
])) : L("", !0)
|
|
84
|
+
], 2));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
U as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { defineComponent as S, ref as k, computed as _, watch as x, createElementBlock as i, createCommentVNode as h, openBlock as l, createElementVNode as s, withModifiers as M, normalizeStyle as N, createVNode as v, unref as r, Fragment as C, renderList as q, normalizeClass as Q, renderSlot as u, toDisplayString as f, createTextVNode as V } from "vue";
|
|
2
|
+
import T from "../../../../../node_modules/.pnpm/@opentiny_vue-icon@3.22.0/node_modules/@opentiny/vue-icon/lib/close.js";
|
|
3
|
+
import z from "../../../../../node_modules/.pnpm/@opentiny_vue-button@3.21.0/node_modules/@opentiny/vue-button/lib/index.js";
|
|
4
|
+
import { IconHotQuestion as A, IconTypeAll as E } from "../../../../svgs/dist/tiny-robot-svgs.js";
|
|
5
|
+
const H = { class: "tr-question-header" }, I = { style: { display: "flex", "align-items": "center", gap: "12px" } }, R = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "tr-question-categories"
|
|
8
|
+
}, W = ["onClick"], D = { class: "category-icon" }, F = { class: "tr-question-content" }, L = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "tr-question-loading"
|
|
11
|
+
}, P = { key: 1 }, j = ["onClick"], G = {
|
|
12
|
+
key: 2,
|
|
13
|
+
class: "tr-question-empty"
|
|
14
|
+
}, Z = /* @__PURE__ */ S({
|
|
15
|
+
__name: "HotQuestions",
|
|
16
|
+
props: {
|
|
17
|
+
visible: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
categories: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
modalWidth: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "640px"
|
|
28
|
+
},
|
|
29
|
+
loading: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
closeOnClickOutside: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !0
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ["update:visible", "close", "select-category", "question-click"],
|
|
39
|
+
setup(n, { emit: b }) {
|
|
40
|
+
const w = T(), a = n, c = b, d = k(""), p = _(() => {
|
|
41
|
+
if (!d.value && a.categories.length > 0)
|
|
42
|
+
return a.categories[0].questions || [];
|
|
43
|
+
const e = a.categories.find((t) => t.id === d.value);
|
|
44
|
+
return e ? e.questions : [];
|
|
45
|
+
});
|
|
46
|
+
x(
|
|
47
|
+
() => a.categories,
|
|
48
|
+
(e) => {
|
|
49
|
+
e.length > 0 && !d.value && (d.value = e[0].id);
|
|
50
|
+
},
|
|
51
|
+
{ immediate: !0 }
|
|
52
|
+
);
|
|
53
|
+
const y = () => {
|
|
54
|
+
c("update:visible", !1), c("close");
|
|
55
|
+
}, B = (e) => {
|
|
56
|
+
d.value = e, c(
|
|
57
|
+
"select-category",
|
|
58
|
+
a.categories.find((t) => t.id === e)
|
|
59
|
+
);
|
|
60
|
+
}, $ = (e) => {
|
|
61
|
+
c("question-click", e);
|
|
62
|
+
}, O = (e) => {
|
|
63
|
+
a.closeOnClickOutside && !e.composedPath().includes(g.value) && y();
|
|
64
|
+
}, g = k(null);
|
|
65
|
+
return (e, t) => n.visible ? (l(), i("div", {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "tr-question-modal-backdrop",
|
|
68
|
+
onMousedown: O
|
|
69
|
+
}, [
|
|
70
|
+
s("div", {
|
|
71
|
+
ref_key: "modalRef",
|
|
72
|
+
ref: g,
|
|
73
|
+
class: "tr-question-panel",
|
|
74
|
+
style: N({ width: n.modalWidth }),
|
|
75
|
+
onMousedown: t[0] || (t[0] = M(() => {
|
|
76
|
+
}, ["stop"]))
|
|
77
|
+
}, [
|
|
78
|
+
s("div", H, [
|
|
79
|
+
s("div", I, [
|
|
80
|
+
s("div", null, [
|
|
81
|
+
v(r(A))
|
|
82
|
+
]),
|
|
83
|
+
t[1] || (t[1] = s("div", { class: "tr-question-header-title" }, "热门问题", -1))
|
|
84
|
+
]),
|
|
85
|
+
s("span", {
|
|
86
|
+
class: "tr-question-close-btn",
|
|
87
|
+
onClick: y
|
|
88
|
+
}, [
|
|
89
|
+
v(r(z), {
|
|
90
|
+
icon: r(w),
|
|
91
|
+
type: "text"
|
|
92
|
+
}, null, 8, ["icon"])
|
|
93
|
+
])
|
|
94
|
+
]),
|
|
95
|
+
n.categories.length > 0 ? (l(), i("div", R, [
|
|
96
|
+
(l(!0), i(C, null, q(n.categories, (o) => (l(), i("div", {
|
|
97
|
+
key: o.id,
|
|
98
|
+
class: Q(["tr-question-categories-item", { active: d.value === o.id }]),
|
|
99
|
+
onClick: (m) => B(o.id)
|
|
100
|
+
}, [
|
|
101
|
+
u(e.$slots, "category-label", { category: o }, () => [
|
|
102
|
+
s("div", D, [
|
|
103
|
+
v(r(E))
|
|
104
|
+
]),
|
|
105
|
+
s("span", null, f(o.label), 1)
|
|
106
|
+
])
|
|
107
|
+
], 10, W))), 128))
|
|
108
|
+
])) : h("", !0),
|
|
109
|
+
s("div", F, [
|
|
110
|
+
n.loading ? (l(), i("div", L, [
|
|
111
|
+
u(e.$slots, "loading-indicator", {}, () => [
|
|
112
|
+
t[2] || (t[2] = s("div", { class: "tr-question-loading-spinner" }, null, -1))
|
|
113
|
+
])
|
|
114
|
+
])) : p.value.length > 0 ? (l(), i("ul", P, [
|
|
115
|
+
(l(!0), i(C, null, q(p.value, (o, m) => (l(), i("li", {
|
|
116
|
+
key: o.id,
|
|
117
|
+
class: "tr-question-list-item",
|
|
118
|
+
onClick: (J) => $(o)
|
|
119
|
+
}, [
|
|
120
|
+
u(e.$slots, "question-item", {
|
|
121
|
+
question: o,
|
|
122
|
+
index: m
|
|
123
|
+
}, () => [
|
|
124
|
+
s("span", null, f(m + 1) + ".", 1),
|
|
125
|
+
V(" " + f(o.text), 1)
|
|
126
|
+
])
|
|
127
|
+
], 8, j))), 128))
|
|
128
|
+
])) : (l(), i("div", G, [
|
|
129
|
+
u(e.$slots, "empty-state", {}, () => [
|
|
130
|
+
t[3] || (t[3] = s("p", null, "暂无相关问题", -1))
|
|
131
|
+
])
|
|
132
|
+
]))
|
|
133
|
+
])
|
|
134
|
+
], 36)
|
|
135
|
+
], 32)) : h("", !0);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
Z as default
|
|
140
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ref as l, computed as h, watch as y } from "vue";
|
|
2
|
+
function b(a = l([])) {
|
|
3
|
+
const s = l(""), c = l(!1), n = l(!1), o = l("light"), r = h(() => {
|
|
4
|
+
if (!s.value && a.value.length > 0)
|
|
5
|
+
return a.value[0].questions;
|
|
6
|
+
const t = a.value.find((e) => e.id === s.value);
|
|
7
|
+
return t ? t.questions : [];
|
|
8
|
+
}), i = (t) => {
|
|
9
|
+
s.value = t;
|
|
10
|
+
}, d = () => {
|
|
11
|
+
n.value = !0;
|
|
12
|
+
}, m = () => {
|
|
13
|
+
n.value = !1;
|
|
14
|
+
}, v = () => {
|
|
15
|
+
c.value = !c.value;
|
|
16
|
+
}, u = (t) => {
|
|
17
|
+
const e = document.body;
|
|
18
|
+
if (t) {
|
|
19
|
+
const g = window.scrollY || document.documentElement.scrollTop;
|
|
20
|
+
e.style.position = "fixed", e.style.width = "100%", e.style.top = `-${g}px`, e.style.overflowY = "scroll", e.classList.add("tr-modal-open");
|
|
21
|
+
} else
|
|
22
|
+
e.style.position = "", e.style.width = "", e.style.top = "", e.style.overflowY = "", e.classList.remove("tr-modal-open");
|
|
23
|
+
};
|
|
24
|
+
return y(n, (t) => {
|
|
25
|
+
u(t);
|
|
26
|
+
}), {
|
|
27
|
+
activeCategory: s,
|
|
28
|
+
isFloatingExpanded: c,
|
|
29
|
+
modalVisible: n,
|
|
30
|
+
currentTheme: o,
|
|
31
|
+
activeQuestions: r,
|
|
32
|
+
setActiveCategory: i,
|
|
33
|
+
openModal: d,
|
|
34
|
+
closeModal: m,
|
|
35
|
+
toggleFloating: v,
|
|
36
|
+
toggleTheme: () => {
|
|
37
|
+
o.value = o.value === "light" ? "dark" : "light", document.documentElement.setAttribute("data-theme", o.value);
|
|
38
|
+
},
|
|
39
|
+
setTheme: (t) => {
|
|
40
|
+
o.value = t, document.documentElement.setAttribute("data-theme", t);
|
|
41
|
+
},
|
|
42
|
+
refreshData: async () => Promise.resolve(),
|
|
43
|
+
toggleBodyScroll: u
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
b as useQuestions
|
|
48
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { defineComponent as N, computed as O, ref as E, watch as T, onMounted as D, createElementBlock as b, openBlock as i, normalizeClass as M, createElementVNode as l, createVNode as a, createCommentVNode as U, unref as n, withCtx as d, renderSlot as r, createTextVNode as W, toDisplayString as p, createBlock as q } from "vue";
|
|
2
|
+
import { useQuestions as z } from "./composables/useQuestions.js";
|
|
3
|
+
import F from "./components/CommonQuestions.vue.js";
|
|
4
|
+
import H from "./components/HotQuestions.vue.js";
|
|
5
|
+
import { IconHotQuestion as j, IconTypeAll as G, IconArrowUp as J, IconArrowDown as K } from "../../../svgs/dist/tiny-robot-svgs.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
const L = ["data-theme"], P = { class: "category-icon" }, te = /* @__PURE__ */ N({
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
categories: { default: () => [] },
|
|
11
|
+
commonQuestions: { default: () => [] },
|
|
12
|
+
initialExpanded: { type: Boolean, default: !1 },
|
|
13
|
+
modalWidth: { default: "640px" },
|
|
14
|
+
theme: { default: "light" },
|
|
15
|
+
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
16
|
+
loading: { type: Boolean, default: !1 }
|
|
17
|
+
},
|
|
18
|
+
emits: ["question-click", "select-category"],
|
|
19
|
+
setup(B, { expose: $, emit: Q }) {
|
|
20
|
+
const u = B, g = () => {
|
|
21
|
+
s.value = !s.value;
|
|
22
|
+
}, f = Q, v = O(() => u.categories), s = E(u.initialExpanded), { modalVisible: m, currentTheme: x, setActiveCategory: h, openModal: c, closeModal: k, setTheme: S, refreshData: A } = z(v);
|
|
23
|
+
T(
|
|
24
|
+
() => u.theme,
|
|
25
|
+
(e) => {
|
|
26
|
+
S(e);
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
const y = (e) => {
|
|
30
|
+
k(), f("question-click", e);
|
|
31
|
+
}, V = (e) => {
|
|
32
|
+
e && (h(e.id), f("select-category", e));
|
|
33
|
+
}, C = E(!1), I = (e) => {
|
|
34
|
+
C.value = e;
|
|
35
|
+
};
|
|
36
|
+
return D(() => {
|
|
37
|
+
document.documentElement.setAttribute("data-theme", x.value);
|
|
38
|
+
}), $({
|
|
39
|
+
openModal: c,
|
|
40
|
+
closeModal: k,
|
|
41
|
+
toggleFloating: g,
|
|
42
|
+
setActiveCategory: h,
|
|
43
|
+
refreshData: A
|
|
44
|
+
}), (e, t) => (i(), b("div", {
|
|
45
|
+
class: M(["tr-question-container", [`theme-${e.theme}`]]),
|
|
46
|
+
"data-theme": e.theme
|
|
47
|
+
}, [
|
|
48
|
+
l("div", {
|
|
49
|
+
class: "tr-question-trigger",
|
|
50
|
+
onClick: t[0] || (t[0] = //@ts-ignore
|
|
51
|
+
(...o) => n(c) && n(c)(...o))
|
|
52
|
+
}, [
|
|
53
|
+
a(n(j))
|
|
54
|
+
]),
|
|
55
|
+
a(H, {
|
|
56
|
+
visible: n(m),
|
|
57
|
+
categories: v.value,
|
|
58
|
+
"modal-width": e.modalWidth,
|
|
59
|
+
loading: e.loading,
|
|
60
|
+
"close-on-click-outside": e.closeOnClickOutside,
|
|
61
|
+
"onUpdate:visible": t[1] || (t[1] = (o) => m.value = o),
|
|
62
|
+
onClose: t[2] || (t[2] = (o) => m.value = !1),
|
|
63
|
+
onQuestionClick: y,
|
|
64
|
+
onSelectCategory: V
|
|
65
|
+
}, {
|
|
66
|
+
"category-label": d(({ category: o }) => [
|
|
67
|
+
r(e.$slots, "category-label", { category: o }, () => [
|
|
68
|
+
l("div", P, [
|
|
69
|
+
a(n(G))
|
|
70
|
+
]),
|
|
71
|
+
l("span", null, p(o.label), 1)
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
"question-item": d(({ question: o, index: w }) => [
|
|
75
|
+
r(e.$slots, "question-item", {
|
|
76
|
+
question: o,
|
|
77
|
+
index: w
|
|
78
|
+
}, () => [
|
|
79
|
+
l("span", null, p(w + 1) + ".", 1),
|
|
80
|
+
W(" " + p(o.text), 1)
|
|
81
|
+
])
|
|
82
|
+
]),
|
|
83
|
+
"loading-indicator": d(() => [
|
|
84
|
+
r(e.$slots, "loading-indicator", {}, () => [
|
|
85
|
+
t[3] || (t[3] = l("div", { class: "tr-question-loading-spinner" }, null, -1))
|
|
86
|
+
])
|
|
87
|
+
]),
|
|
88
|
+
"empty-state": d(() => [
|
|
89
|
+
r(e.$slots, "empty-state", {}, () => [
|
|
90
|
+
t[4] || (t[4] = l("p", null, "暂无相关问题", -1))
|
|
91
|
+
])
|
|
92
|
+
]),
|
|
93
|
+
_: 3
|
|
94
|
+
}, 8, ["visible", "categories", "modal-width", "loading", "close-on-click-outside"]),
|
|
95
|
+
a(F, {
|
|
96
|
+
isExpanded: s.value,
|
|
97
|
+
questions: e.commonQuestions,
|
|
98
|
+
onShowExpandButton: I,
|
|
99
|
+
onQuestionClick: y
|
|
100
|
+
}, null, 8, ["isExpanded", "questions"]),
|
|
101
|
+
C.value ? (i(), b("div", {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: "tr-question-wrap-trigger",
|
|
104
|
+
onClick: g
|
|
105
|
+
}, [
|
|
106
|
+
s.value ? (i(), q(n(K), { key: 1 })) : (i(), q(n(J), { key: 0 }))
|
|
107
|
+
])) : U("", !0)
|
|
108
|
+
], 10, L));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export {
|
|
112
|
+
te as default
|
|
113
|
+
};
|