@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.
Files changed (244) hide show
  1. package/dist/{bubble-item → bubble}/components/actions/copy.vue.d.ts +3 -3
  2. package/dist/{bubble-item → bubble}/components/actions/refresh.vue.d.ts +1 -1
  3. package/dist/bubble/index.d.ts +12 -0
  4. package/dist/bubble/index.type.d.ts +53 -0
  5. package/dist/bubble/useScroll.d.ts +4 -0
  6. package/dist/container/index.d.ts +7 -0
  7. package/dist/container/index.type.d.ts +16 -0
  8. package/dist/container/index.vue.d.ts +26 -0
  9. package/dist/index.d.ts +10 -5
  10. package/dist/index.js +31 -20
  11. package/dist/node_modules/.pnpm/@opentiny_utils@1.0.0/node_modules/@opentiny/utils/dist/opentiny-utils.es.js +832 -0
  12. package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +959 -1496
  13. 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
  14. 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
  15. package/dist/node_modules/.pnpm/@opentiny_vue-common@3.21.0/node_modules/@opentiny/vue-common/lib/index.js +727 -0
  16. package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +144 -675
  17. 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
  18. 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
  19. package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/close.js +29 -0
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/browser.js +36 -0
  79. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/clickoutside.js +47 -0
  80. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/debounce.js +7 -0
  81. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/dom.js +45 -0
  82. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popper.js +320 -0
  83. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popup-manager.js +118 -0
  84. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/throttle.js +23 -0
  85. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useEventListener.js +9 -0
  86. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useInstanceSlots.js +14 -0
  87. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useRelation.js +54 -0
  88. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popper.js +84 -0
  89. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popup.js +73 -0
  90. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/event.js +13 -0
  91. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/function.js +5 -0
  92. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/index.js +11 -0
  93. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/object.js +84 -0
  94. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/string.js +28 -0
  95. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/type.js +28 -0
  96. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/dialog-box/index.js +136 -0
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tooltip/vue.js +90 -0
  104. 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
  105. 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
  106. package/dist/packages/components/src/{bubble-list → bubble}/bubble-list.vue.js +2 -2
  107. package/dist/packages/components/src/bubble/bubble-list.vue2.js +37 -0
  108. package/dist/packages/components/src/bubble/bubble.vue.js +7 -0
  109. package/dist/packages/components/src/bubble/bubble.vue2.js +118 -0
  110. package/dist/packages/components/src/bubble/components/actions/copy.vue.js +7 -0
  111. package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +35 -0
  112. package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +7 -0
  113. package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +16 -0
  114. package/dist/packages/components/src/bubble/index.js +18 -0
  115. package/dist/packages/components/src/bubble/useScroll.js +13 -0
  116. package/dist/packages/components/src/container/index.js +9 -0
  117. package/dist/packages/components/src/container/index.vue.js +7 -0
  118. package/dist/packages/components/src/container/index.vue2.js +55 -0
  119. package/dist/packages/components/src/conversations/index.js +1 -1
  120. package/dist/packages/components/src/prompts/index.js +18 -0
  121. package/dist/packages/components/src/prompts/prompt.vue.js +7 -0
  122. package/dist/packages/components/src/prompts/prompt.vue2.js +37 -0
  123. package/dist/packages/components/src/prompts/prompts.vue.js +7 -0
  124. package/dist/packages/components/src/prompts/prompts.vue2.js +36 -0
  125. package/dist/packages/components/src/question/components/CommonQuestions.vue.js +89 -0
  126. package/dist/packages/components/src/question/components/CommonQuestions.vue2.js +4 -0
  127. package/dist/packages/components/src/question/components/HotQuestions.vue.js +140 -0
  128. package/dist/packages/components/src/question/components/HotQuestions.vue2.js +4 -0
  129. package/dist/packages/components/src/question/composables/useQuestions.js +48 -0
  130. package/dist/packages/components/src/question/index.js +9 -0
  131. package/dist/packages/components/src/question/index.vue.js +113 -0
  132. package/dist/packages/components/src/question/index.vue2.js +4 -0
  133. package/dist/packages/components/src/sender/components/ActionButtons.vue.js +105 -123
  134. package/dist/packages/components/src/sender/composables/useInputHandler.js +26 -22
  135. package/dist/packages/components/src/sender/composables/useKeyboardHandler.js +11 -11
  136. package/dist/packages/components/src/sender/composables/useSpeechHandler.js +9 -9
  137. package/dist/packages/components/src/sender/index.vue.js +67 -66
  138. package/dist/packages/components/src/welcome/index.vue.js +5 -7
  139. package/dist/packages/components/src/welcome/index.vue2.js +32 -0
  140. package/dist/packages/svgs/dist/tiny-robot-svgs.js +223 -0
  141. package/dist/prompts/index.d.ts +12 -0
  142. package/dist/prompts/index.type.d.ts +55 -0
  143. package/dist/prompts/prompt.vue.d.ts +3 -0
  144. package/dist/prompts/prompts.vue.d.ts +20 -0
  145. package/dist/question/components/CommonQuestions.vue.d.ts +32 -0
  146. package/dist/question/components/HotQuestions.vue.d.ts +89 -0
  147. package/dist/question/composables/useQuestions.d.ts +17 -0
  148. package/dist/question/index.d.ts +7 -0
  149. package/dist/question/index.type.d.ts +74 -0
  150. package/dist/question/index.vue.d.ts +46 -0
  151. package/dist/sender/components/ActionButtons.vue.d.ts +6 -4
  152. package/dist/sender/composables/useSpeechHandler.d.ts +0 -6
  153. package/dist/sender/index.type.d.ts +1 -1
  154. package/dist/sender/index.vue.d.ts +3 -4
  155. package/dist/style.css +1 -1
  156. package/dist/welcome/index.type.d.ts +10 -0
  157. package/dist/welcome/index.vue.d.ts +17 -1
  158. package/package.json +6 -5
  159. package/src/bubble/bubble-list.vue +42 -0
  160. package/src/bubble/bubble.vue +247 -0
  161. package/src/bubble/components/actions/copy.vue +54 -0
  162. package/src/bubble/components/actions/refresh.vue +31 -0
  163. package/src/bubble/index.ts +23 -0
  164. package/src/bubble/index.type.ts +63 -0
  165. package/src/bubble/useScroll.ts +14 -0
  166. package/src/container/index.ts +12 -0
  167. package/src/container/index.type.ts +17 -0
  168. package/src/container/index.vue +135 -0
  169. package/src/conversations/index.ts +1 -1
  170. package/src/index.ts +26 -12
  171. package/src/prompts/index.ts +25 -0
  172. package/src/prompts/index.type.ts +59 -0
  173. package/src/prompts/prompt.vue +115 -0
  174. package/src/prompts/prompts.vue +50 -0
  175. package/src/question/components/CommonQuestions.vue +146 -0
  176. package/src/question/components/HotQuestions.vue +148 -0
  177. package/src/question/composables/useQuestions.ts +106 -0
  178. package/src/question/index.less +448 -0
  179. package/src/question/index.ts +12 -0
  180. package/src/question/index.type.ts +86 -0
  181. package/src/question/index.vue +140 -0
  182. package/src/question/vars.less +135 -0
  183. package/src/sender/components/ActionButtons.vue +42 -39
  184. package/src/sender/composables/useInputHandler.ts +15 -10
  185. package/src/sender/composables/useKeyboardHandler.ts +6 -4
  186. package/src/sender/composables/useSpeechHandler.ts +5 -11
  187. package/src/sender/index.less +3 -5
  188. package/src/sender/index.type.ts +1 -1
  189. package/src/sender/index.vue +3 -2
  190. package/src/welcome/index.type.ts +12 -0
  191. package/src/welcome/index.vue +68 -2
  192. package/.vscode/extensions.json +0 -3
  193. package/dist/bubble-item/components/icons/ai.vue.d.ts +0 -2
  194. package/dist/bubble-item/components/icons/index.d.ts +0 -2
  195. package/dist/bubble-item/components/icons/user.vue.d.ts +0 -2
  196. package/dist/bubble-item/index.d.ts +0 -7
  197. package/dist/bubble-list/index.d.ts +0 -8
  198. package/dist/bubble-list/index.type.d.ts +0 -55
  199. package/dist/node_modules/.pnpm/@opentiny_vue-directive@3.22.0/node_modules/@opentiny/vue-directive/index.js +0 -57
  200. package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +0 -85
  201. package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popup.js +0 -69
  202. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/dialog-box/index.js +0 -135
  203. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +0 -90
  204. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +0 -5
  205. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +0 -10
  206. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +0 -8
  207. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +0 -4
  208. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +0 -15
  209. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +0 -7
  210. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +0 -5
  211. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  212. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +0 -54
  213. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +0 -7
  214. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +0 -6
  215. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +0 -9
  216. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +0 -7
  217. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +0 -22
  218. package/dist/packages/components/src/bubble-item/bubble-item.vue.js +0 -7
  219. package/dist/packages/components/src/bubble-item/bubble-item.vue2.js +0 -111
  220. package/dist/packages/components/src/bubble-item/components/actions/copy.vue.js +0 -46
  221. package/dist/packages/components/src/bubble-item/components/actions/copy.vue2.js +0 -4
  222. package/dist/packages/components/src/bubble-item/components/actions/refresh.vue.js +0 -12
  223. package/dist/packages/components/src/bubble-item/components/icons/ai.vue.js +0 -45
  224. package/dist/packages/components/src/bubble-item/components/icons/user.vue.js +0 -63
  225. package/dist/packages/components/src/bubble-item/index.js +0 -9
  226. package/dist/packages/components/src/bubble-list/bubble-list.vue2.js +0 -52
  227. package/dist/packages/components/src/bubble-list/index.js +0 -9
  228. package/src/bubble-item/bubble-item.vue +0 -264
  229. package/src/bubble-item/components/actions/copy.vue +0 -47
  230. package/src/bubble-item/components/actions/refresh.vue +0 -27
  231. package/src/bubble-item/components/icons/ai.vue +0 -30
  232. package/src/bubble-item/components/icons/index.ts +0 -2
  233. package/src/bubble-item/components/icons/user.vue +0 -78
  234. package/src/bubble-item/index.ts +0 -12
  235. package/src/bubble-list/bubble-list.vue +0 -53
  236. package/src/bubble-list/index.ts +0 -14
  237. package/src/bubble-list/index.type.ts +0 -65
  238. package/src/sender/global.d.ts +0 -44
  239. /package/dist/{bubble-list → bubble}/bubble-list.vue.d.ts +0 -0
  240. /package/dist/{bubble-item → bubble}/components/actions/index.d.ts +0 -0
  241. /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
  242. /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
  243. /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
  244. /package/src/{bubble-item → bubble}/components/actions/index.ts +0 -0
@@ -0,0 +1,148 @@
1
+ <script setup lang="ts">
2
+ import { ref, defineProps, defineEmits, watch, PropType, computed } from 'vue'
3
+ import { IconClose } from '@opentiny/vue-icon'
4
+ import { TinyButton } from '@opentiny/vue'
5
+ import type { Category, Question } from '../index.type'
6
+
7
+ import { IconHotQuestion, IconTypeAll } from '@opentiny/tiny-robot-svgs'
8
+
9
+ const TinyIconClose = IconClose()
10
+
11
+ const props = defineProps({
12
+ visible: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ categories: {
17
+ type: Array as PropType<Category[]>,
18
+ default: () => [],
19
+ },
20
+ modalWidth: {
21
+ type: String,
22
+ default: '640px',
23
+ },
24
+ loading: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ closeOnClickOutside: {
29
+ type: Boolean,
30
+ default: true,
31
+ },
32
+ })
33
+
34
+ const emit = defineEmits(['update:visible', 'close', 'select-category', 'question-click'])
35
+
36
+ // 当前激活的分类
37
+ const activeCategory = ref<string>('')
38
+
39
+ // 计算当前激活分类的问题列表
40
+ const activeQuestions = computed(() => {
41
+ if (!activeCategory.value && props.categories.length > 0) {
42
+ return props.categories[0].questions || []
43
+ }
44
+
45
+ const category = props.categories.find((cat) => cat.id === activeCategory.value)
46
+ return category ? category.questions : []
47
+ })
48
+
49
+ // 初始化激活的分类
50
+ watch(
51
+ () => props.categories,
52
+ (categories) => {
53
+ if (categories.length > 0 && !activeCategory.value) {
54
+ activeCategory.value = categories[0].id
55
+ }
56
+ },
57
+ { immediate: true },
58
+ )
59
+
60
+ // 关闭弹窗
61
+ const closeModal = () => {
62
+ emit('update:visible', false)
63
+ emit('close')
64
+ }
65
+
66
+ // 处理分类选择
67
+ const handleCategorySelect = (categoryId: string) => {
68
+ activeCategory.value = categoryId
69
+ emit(
70
+ 'select-category',
71
+ props.categories.find((cat) => cat.id === categoryId),
72
+ )
73
+ }
74
+
75
+ // 处理问题点击
76
+ const handleQuestionClick = (question: Question) => {
77
+ emit('question-click', question)
78
+ }
79
+
80
+ // 处理点击外部关闭
81
+ const handleClickOutside = (event: MouseEvent) => {
82
+ if (props.closeOnClickOutside && !event.composedPath().includes(modalRef.value!)) {
83
+ closeModal()
84
+ }
85
+ }
86
+
87
+ const modalRef = ref<HTMLElement | null>(null)
88
+ </script>
89
+
90
+ <template>
91
+ <div v-if="visible" class="tr-question-modal-backdrop" @mousedown="handleClickOutside">
92
+ <div ref="modalRef" class="tr-question-panel" :style="{ width: modalWidth }" @mousedown.stop>
93
+ <div class="tr-question-header">
94
+ <div style="display: flex; align-items: center; gap: 12px">
95
+ <div><IconHotQuestion /></div>
96
+ <div class="tr-question-header-title">热门问题</div>
97
+ </div>
98
+ <span class="tr-question-close-btn" @click="closeModal">
99
+ <TinyButton :icon="TinyIconClose" type="text" />
100
+ </span>
101
+ </div>
102
+
103
+ <div v-if="categories.length > 0" class="tr-question-categories">
104
+ <div
105
+ v-for="category in categories"
106
+ :key="category.id"
107
+ class="tr-question-categories-item"
108
+ :class="{ active: activeCategory === category.id }"
109
+ @click="handleCategorySelect(category.id)"
110
+ >
111
+ <slot name="category-label" :category="category">
112
+ <div class="category-icon">
113
+ <IconTypeAll />
114
+ </div>
115
+ <span>{{ category.label }}</span>
116
+ </slot>
117
+ </div>
118
+ </div>
119
+
120
+ <div class="tr-question-content">
121
+ <div v-if="loading" class="tr-question-loading">
122
+ <slot name="loading-indicator">
123
+ <div class="tr-question-loading-spinner"></div>
124
+ </slot>
125
+ </div>
126
+
127
+ <ul v-else-if="activeQuestions.length > 0">
128
+ <li
129
+ v-for="(question, index) in activeQuestions"
130
+ :key="question.id"
131
+ class="tr-question-list-item"
132
+ @click="handleQuestionClick(question)"
133
+ >
134
+ <slot name="question-item" :question="question" :index="index">
135
+ <span>{{ index + 1 }}.</span> {{ question.text }}
136
+ </slot>
137
+ </li>
138
+ </ul>
139
+
140
+ <div v-else class="tr-question-empty">
141
+ <slot name="empty-state">
142
+ <p>暂无相关问题</p>
143
+ </slot>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ </template>
@@ -0,0 +1,106 @@
1
+ import { ref, computed, Ref, watch } from 'vue'
2
+ import type { Category, ThemeType } from '../index.type'
3
+
4
+ export function useQuestions(categories: Ref<Category[]> = ref([])) {
5
+ // 当前激活的分类ID
6
+ const activeCategory = ref<string>('')
7
+
8
+ // 是否展开悬浮面板
9
+ const isFloatingExpanded = ref(false)
10
+
11
+ // 弹窗是否可见
12
+ const modalVisible = ref(false)
13
+
14
+ // 当前主题
15
+ const currentTheme = ref<ThemeType>('light')
16
+
17
+ // 计算当前激活分类的问题列表
18
+ const activeQuestions = computed(() => {
19
+ if (!activeCategory.value && categories.value.length > 0) {
20
+ return categories.value[0].questions
21
+ }
22
+
23
+ const category = categories.value.find((cat) => cat.id === activeCategory.value)
24
+ return category ? category.questions : []
25
+ })
26
+
27
+ // 设置激活的分类
28
+ const setActiveCategory = (categoryId: string) => {
29
+ activeCategory.value = categoryId
30
+ }
31
+
32
+ // 打开弹窗
33
+ const openModal = () => {
34
+ modalVisible.value = true
35
+ }
36
+
37
+ // 关闭弹窗
38
+ const closeModal = () => {
39
+ modalVisible.value = false
40
+ }
41
+
42
+ // 切换悬浮面板展开状态
43
+ const toggleFloating = () => {
44
+ isFloatingExpanded.value = !isFloatingExpanded.value
45
+ }
46
+
47
+ // 防止滚动穿透的函数
48
+ const toggleBodyScroll = (isOpen: boolean) => {
49
+ const body = document.body
50
+
51
+ if (isOpen) {
52
+ // 保存当前滚动位置
53
+ const scrollTop = window.scrollY || document.documentElement.scrollTop
54
+ body.style.position = 'fixed'
55
+ body.style.width = '100%'
56
+ body.style.top = `-${scrollTop}px`
57
+ body.style.overflowY = 'scroll' // 保持滚动条宽度,防止页面抖动
58
+ body.classList.add('tr-modal-open')
59
+ } else {
60
+ body.style.position = ''
61
+ body.style.width = ''
62
+ body.style.top = ''
63
+ body.style.overflowY = ''
64
+ body.classList.remove('tr-modal-open')
65
+ }
66
+ }
67
+
68
+ // 监听弹窗变化应用滚动锁定
69
+ watch(modalVisible, (value) => {
70
+ toggleBodyScroll(value)
71
+ })
72
+
73
+ // 切换主题
74
+ const toggleTheme = () => {
75
+ currentTheme.value = currentTheme.value === 'light' ? 'dark' : 'light'
76
+ document.documentElement.setAttribute('data-theme', currentTheme.value)
77
+ }
78
+
79
+ // 设置主题
80
+ const setTheme = (theme: ThemeType) => {
81
+ currentTheme.value = theme
82
+ document.documentElement.setAttribute('data-theme', theme)
83
+ }
84
+
85
+ // 刷新数据(模拟异步操作)
86
+ const refreshData = async () => {
87
+ // 这里可以添加实际的数据刷新逻辑
88
+ return Promise.resolve()
89
+ }
90
+
91
+ return {
92
+ activeCategory,
93
+ isFloatingExpanded,
94
+ modalVisible,
95
+ currentTheme,
96
+ activeQuestions,
97
+ setActiveCategory,
98
+ openModal,
99
+ closeModal,
100
+ toggleFloating,
101
+ toggleTheme,
102
+ setTheme,
103
+ refreshData,
104
+ toggleBodyScroll,
105
+ }
106
+ }
@@ -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 }