@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.
Files changed (234) 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/index.d.ts +9 -5
  7. package/dist/index.js +25 -18
  8. package/dist/node_modules/.pnpm/@opentiny_utils@1.0.0/node_modules/@opentiny/utils/dist/opentiny-utils.es.js +832 -0
  9. package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +959 -1496
  10. 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
  11. 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
  12. package/dist/node_modules/.pnpm/@opentiny_vue-common@3.21.0/node_modules/@opentiny/vue-common/lib/index.js +727 -0
  13. package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +144 -675
  14. 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
  15. 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
  16. package/dist/node_modules/.pnpm/@opentiny_vue-icon@3.21.0/node_modules/@opentiny/vue-icon/lib/close.js +29 -0
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  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
  23. 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
  24. 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
  25. 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
  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-row-before.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-align-center.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-align-left.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-align-right.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-bold.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-code-block.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-code-view.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-color.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-delete-column.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-delete-row.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-delete-table.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-font-size.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-format-clear.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-h1.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-h2.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-h3.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-h4.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-h5.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-h6.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-heading.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-high-light.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-image.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-italic.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-line-height.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-link-unlink.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-link.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-list-ordered.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-list-unordered.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-merge-cells-vertical.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-merge-cells.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-node-delete.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-paragraph.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-quote-text.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-redo.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-split-cells-horizontal.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-split-cells-vertical.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-strike-through.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-subscript.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-superscript.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-table.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-task-list.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-underline.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-undo.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/sub-script.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/warn.js +1 -1
  71. 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
  72. 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
  73. 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
  74. 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
  75. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/browser.js +36 -0
  76. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/clickoutside.js +47 -0
  77. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/debounce.js +7 -0
  78. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/dom.js +45 -0
  79. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popper.js +320 -0
  80. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/popup-manager.js +118 -0
  81. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/throttle.js +23 -0
  82. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useEventListener.js +9 -0
  83. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useInstanceSlots.js +14 -0
  84. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/useRelation.js +54 -0
  85. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popper.js +84 -0
  86. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/deps/vue-popup.js +73 -0
  87. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/event.js +13 -0
  88. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/function.js +5 -0
  89. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/index.js +11 -0
  90. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/object.js +84 -0
  91. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/string.js +28 -0
  92. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/common/type.js +28 -0
  93. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/dialog-box/index.js +136 -0
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.21.2/node_modules/@opentiny/vue-renderless/tooltip/vue.js +90 -0
  101. 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
  102. 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
  103. package/dist/packages/components/src/{bubble-list → bubble}/bubble-list.vue.js +2 -2
  104. package/dist/packages/components/src/bubble/bubble-list.vue2.js +38 -0
  105. package/dist/packages/components/src/bubble/bubble.vue.js +7 -0
  106. package/dist/packages/components/src/bubble/bubble.vue2.js +118 -0
  107. package/dist/packages/components/src/bubble/components/actions/copy.vue.js +7 -0
  108. package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +35 -0
  109. package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +7 -0
  110. package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +16 -0
  111. package/dist/packages/components/src/bubble/index.js +18 -0
  112. package/dist/packages/components/src/bubble/useScroll.js +13 -0
  113. package/dist/packages/components/src/conversations/index.js +1 -1
  114. package/dist/packages/components/src/prompts/index.js +18 -0
  115. package/dist/packages/components/src/prompts/prompt.vue.js +7 -0
  116. package/dist/packages/components/src/prompts/prompt.vue2.js +37 -0
  117. package/dist/packages/components/src/prompts/prompts.vue.js +7 -0
  118. package/dist/packages/components/src/prompts/prompts.vue2.js +36 -0
  119. package/dist/packages/components/src/question/components/CommonQuestions.vue.js +89 -0
  120. package/dist/packages/components/src/question/components/CommonQuestions.vue2.js +4 -0
  121. package/dist/packages/components/src/question/components/HotQuestions.vue.js +140 -0
  122. package/dist/packages/components/src/question/components/HotQuestions.vue2.js +4 -0
  123. package/dist/packages/components/src/question/composables/useQuestions.js +48 -0
  124. package/dist/packages/components/src/question/index.js +9 -0
  125. package/dist/packages/components/src/question/index.vue.js +113 -0
  126. package/dist/packages/components/src/question/index.vue2.js +4 -0
  127. package/dist/packages/components/src/sender/components/ActionButtons.vue.js +105 -123
  128. package/dist/packages/components/src/sender/composables/useInputHandler.js +26 -22
  129. package/dist/packages/components/src/sender/composables/useKeyboardHandler.js +11 -11
  130. package/dist/packages/components/src/sender/composables/useSpeechHandler.js +9 -9
  131. package/dist/packages/components/src/sender/index.vue.js +67 -66
  132. package/dist/packages/components/src/welcome/index.vue.js +5 -7
  133. package/dist/packages/components/src/welcome/index.vue2.js +32 -0
  134. package/dist/packages/svgs/dist/tiny-robot-svgs.js +144 -0
  135. package/dist/prompts/index.d.ts +12 -0
  136. package/dist/prompts/index.type.d.ts +55 -0
  137. package/dist/prompts/prompt.vue.d.ts +3 -0
  138. package/dist/prompts/prompts.vue.d.ts +20 -0
  139. package/dist/question/components/CommonQuestions.vue.d.ts +32 -0
  140. package/dist/question/components/HotQuestions.vue.d.ts +89 -0
  141. package/dist/question/composables/useQuestions.d.ts +17 -0
  142. package/dist/question/index.d.ts +7 -0
  143. package/dist/question/index.type.d.ts +74 -0
  144. package/dist/question/index.vue.d.ts +46 -0
  145. package/dist/sender/components/ActionButtons.vue.d.ts +6 -4
  146. package/dist/sender/composables/useSpeechHandler.d.ts +0 -6
  147. package/dist/sender/index.type.d.ts +1 -1
  148. package/dist/sender/index.vue.d.ts +1 -2
  149. package/dist/style.css +1 -1
  150. package/dist/welcome/index.type.d.ts +10 -0
  151. package/dist/welcome/index.vue.d.ts +17 -1
  152. package/package.json +5 -3
  153. package/src/bubble/bubble-list.vue +44 -0
  154. package/src/bubble/bubble.vue +247 -0
  155. package/src/bubble/components/actions/copy.vue +54 -0
  156. package/src/bubble/components/actions/refresh.vue +31 -0
  157. package/src/bubble/index.ts +23 -0
  158. package/src/bubble/index.type.ts +63 -0
  159. package/src/bubble/useScroll.ts +14 -0
  160. package/src/conversations/index.ts +1 -1
  161. package/src/index.ts +23 -12
  162. package/src/prompts/index.ts +25 -0
  163. package/src/prompts/index.type.ts +59 -0
  164. package/src/prompts/prompt.vue +115 -0
  165. package/src/prompts/prompts.vue +50 -0
  166. package/src/question/components/CommonQuestions.vue +146 -0
  167. package/src/question/components/HotQuestions.vue +148 -0
  168. package/src/question/composables/useQuestions.ts +106 -0
  169. package/src/question/index.less +448 -0
  170. package/src/question/index.ts +12 -0
  171. package/src/question/index.type.ts +86 -0
  172. package/src/question/index.vue +140 -0
  173. package/src/question/vars.less +135 -0
  174. package/src/sender/components/ActionButtons.vue +42 -39
  175. package/src/sender/composables/useInputHandler.ts +15 -10
  176. package/src/sender/composables/useKeyboardHandler.ts +6 -4
  177. package/src/sender/composables/useSpeechHandler.ts +5 -11
  178. package/src/sender/index.less +3 -5
  179. package/src/sender/index.type.ts +1 -1
  180. package/src/sender/index.vue +3 -2
  181. package/src/welcome/index.type.ts +12 -0
  182. package/src/welcome/index.vue +68 -2
  183. package/dist/bubble-item/components/icons/ai.vue.d.ts +0 -2
  184. package/dist/bubble-item/components/icons/index.d.ts +0 -2
  185. package/dist/bubble-item/components/icons/user.vue.d.ts +0 -2
  186. package/dist/bubble-item/index.d.ts +0 -7
  187. package/dist/bubble-list/index.d.ts +0 -8
  188. package/dist/bubble-list/index.type.d.ts +0 -55
  189. package/dist/node_modules/.pnpm/@opentiny_vue-directive@3.22.0/node_modules/@opentiny/vue-directive/index.js +0 -57
  190. package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +0 -85
  191. package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popup.js +0 -69
  192. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/dialog-box/index.js +0 -135
  193. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +0 -90
  194. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +0 -5
  195. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +0 -10
  196. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +0 -8
  197. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +0 -4
  198. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +0 -15
  199. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +0 -7
  200. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +0 -5
  201. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  202. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +0 -54
  203. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +0 -7
  204. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +0 -6
  205. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +0 -9
  206. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +0 -7
  207. package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +0 -22
  208. package/dist/packages/components/src/bubble-item/bubble-item.vue.js +0 -7
  209. package/dist/packages/components/src/bubble-item/bubble-item.vue2.js +0 -111
  210. package/dist/packages/components/src/bubble-item/components/actions/copy.vue.js +0 -46
  211. package/dist/packages/components/src/bubble-item/components/actions/copy.vue2.js +0 -4
  212. package/dist/packages/components/src/bubble-item/components/actions/refresh.vue.js +0 -12
  213. package/dist/packages/components/src/bubble-item/components/icons/ai.vue.js +0 -45
  214. package/dist/packages/components/src/bubble-item/components/icons/user.vue.js +0 -63
  215. package/dist/packages/components/src/bubble-item/index.js +0 -9
  216. package/dist/packages/components/src/bubble-list/bubble-list.vue2.js +0 -52
  217. package/dist/packages/components/src/bubble-list/index.js +0 -9
  218. package/src/bubble-item/bubble-item.vue +0 -264
  219. package/src/bubble-item/components/actions/copy.vue +0 -47
  220. package/src/bubble-item/components/actions/refresh.vue +0 -27
  221. package/src/bubble-item/components/icons/ai.vue +0 -30
  222. package/src/bubble-item/components/icons/index.ts +0 -2
  223. package/src/bubble-item/components/icons/user.vue +0 -78
  224. package/src/bubble-item/index.ts +0 -12
  225. package/src/bubble-list/bubble-list.vue +0 -53
  226. package/src/bubble-list/index.ts +0 -14
  227. package/src/bubble-list/index.type.ts +0 -65
  228. package/src/sender/global.d.ts +0 -44
  229. /package/dist/{bubble-list → bubble}/bubble-list.vue.d.ts +0 -0
  230. /package/dist/{bubble-item → bubble}/components/actions/index.d.ts +0 -0
  231. /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
  232. /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
  233. /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
  234. /package/src/{bubble-item → bubble}/components/actions/index.ts +0 -0
@@ -0,0 +1,135 @@
1
+ /* ----------------- 颜色变量 ----------------- */
2
+ :root {
3
+ /* 主题基础颜色 */
4
+ --tr-question-primary-color: #1890ff;
5
+ --tr-question-background-color: #ffffff;
6
+ --tr-question-modal-background-color: #ffffff;
7
+ --tr-question-text-color: #333333;
8
+ --tr-question-text-color-secondary: #666666;
9
+ --tr-question-border-color: #e8e8e8;
10
+ --tr-question-hover-color: #f5f5f5;
11
+ --tr-question-tab-hover-bg: #f0f0f0;
12
+ --tr-question-active-tab-color: var(--tr-question-primary-color);
13
+ --tr-question-active-tab-bg: #e6f7ff;
14
+
15
+ /* 弹窗相关颜色 */
16
+ --tr-question-header-bg: #f9f9f9;
17
+ --tr-question-title-color: #1d2129;
18
+ --tr-question-close-icon-color: #86909c;
19
+ --tr-question-tab-active-bg: #e8f3ff;
20
+ --tr-question-tab-active-text: #1890ff;
21
+ --tr-question-tab-text: #4e5969;
22
+ --tr-question-tab-border: #f0f0f0;
23
+ --tr-question-list-divider-color: #f0f0f0;
24
+ --tr-question-modal-backdrop-color: rgba(0, 0, 0, 0.5);
25
+
26
+ /* 常见问题颜色 */
27
+ --tr-question-common-bg: #fff;
28
+ --tr-question-common-text: #191919;
29
+ --tr-question-common-hover-bg: #ebebeb;
30
+ --tr-question-common-shadow: rgba(0, 0, 0, 0.04);
31
+
32
+ /* 背景颜色 */
33
+ --tr-question-container-bg: #f8f8f8;
34
+ --tr-question-list-item-bg: #fff;
35
+ --tr-question-list-hover-shadow: rgba(0, 0, 0, 0.08);
36
+ --tr-question-category-bg: rgba(0, 0, 0, 0.04);
37
+ --tr-question-category-hover-bg: rgba(0, 0, 0, 0.08);
38
+ --tr-question-category-active-border: #191919;
39
+ --tr-question-item-border-color: rgba(0, 0, 0, 0.04);
40
+
41
+ /* 滚动条颜色 */
42
+ --tr-question-scrollbar-track-bg: rgba(16, 31, 28, 0.1);
43
+ --tr-question-scrollbar-thumb-bg: rgba(144, 147, 153, 0.5);
44
+ --tr-question-scrollbar-thumb-hover-bg: rgba(144, 147, 153, 0.3);
45
+
46
+ /* ----------------- 尺寸变量 ----------------- */
47
+ /* 圆角 */
48
+ --tr-question-border-radius: 24px;
49
+ --tr-question-category-border-radius: 8px;
50
+ --tr-question-list-border-radius: 12px;
51
+ --tr-question-common-border-radius: 16px;
52
+ --tr-question-scrollbar-border-radius: 2em;
53
+
54
+ /* 间距和尺寸 */
55
+ --tr-question-spacing: 16px;
56
+ --tr-question-icon-size: 16px;
57
+ --tr-question-container-height: 46px;
58
+ --tr-question-item-height: 56px;
59
+ --tr-question-trigger-size: 32px;
60
+ --tr-question-common-item-height: 32px;
61
+ --tr-question-category-height: 38px;
62
+ --tr-question-scrollbar-width: 4px;
63
+ --tr-question-modal-padding: 24px;
64
+ --tr-question-modal-max-height: 80vh;
65
+ --tr-question-modal-max-width: 640px;
66
+ --tr-question-content-max-height: calc(80vh - 120px);
67
+
68
+ /* ----------------- 文字变量 ----------------- */
69
+ /* 字体 */
70
+ --tr-question-font-size: 14px;
71
+ --tr-question-title-font-size: 18px;
72
+ --tr-question-title-font-weight: 600;
73
+ --tr-question-item-font-weight: 400;
74
+ --tr-question-line-height: 1.5;
75
+ --tr-question-item-line-height: 22px;
76
+
77
+ /* ----------------- 特效变量 ----------------- */
78
+ /* 阴影 */
79
+ --tr-question-panel-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
80
+ --tr-question-trigger-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
81
+ --tr-question-common-item-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
82
+ --tr-question-list-item-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
83
+ --tr-question-wrap-trigger-shadow: 2px 0 9px rgba(0, 0, 0, 0.04);
84
+
85
+ /* 动画 */
86
+ --tr-question-transition-duration: 0.3s;
87
+ --tr-question-transition-timing: ease;
88
+ --tr-question-hover-transition: all var(--tr-question-transition-duration) var(--tr-question-transition-timing);
89
+ }
90
+
91
+ /* ----------------- 暗色主题变量 ----------------- */
92
+ [data-theme='dark'] {
93
+ /* 主题基础颜色 */
94
+ --tr-question-primary-color: #177ddc;
95
+ --tr-question-background-color: #1f1f1f;
96
+ --tr-question-modal-background-color: #2a2a2a;
97
+ --tr-question-text-color: #f0f0f0;
98
+ --tr-question-text-color-secondary: #aaaaaa;
99
+ --tr-question-border-color: #434343;
100
+ --tr-question-hover-color: #303030;
101
+ --tr-question-tab-hover-bg: #3a3a3a;
102
+ --tr-question-active-tab-color: var(--tr-question-primary-color);
103
+ --tr-question-active-tab-bg: #113a5c;
104
+
105
+ /* 弹窗相关颜色 */
106
+ --tr-question-header-bg: #2a2a2a;
107
+ --tr-question-title-color: #c9d1d9;
108
+ --tr-question-close-icon-color: #8b949e;
109
+ --tr-question-tab-active-bg: #30363d;
110
+ --tr-question-tab-active-text: #58a6ff;
111
+ --tr-question-tab-text: #8b949e;
112
+ --tr-question-tab-border: #30363d;
113
+ --tr-question-list-divider-color: #30363d;
114
+ --tr-question-modal-backdrop-color: rgba(0, 0, 0, 0.7);
115
+
116
+ /* 常见问题颜色 */
117
+ --tr-question-common-bg: #2a2a2a;
118
+ --tr-question-common-text: #e6e6e6;
119
+ --tr-question-common-hover-bg: #3a3a3a;
120
+ --tr-question-common-shadow: rgba(0, 0, 0, 0.2);
121
+
122
+ /* 背景颜色 */
123
+ --tr-question-container-bg: #141414;
124
+ --tr-question-list-item-bg: #2a2a2a;
125
+ --tr-question-list-hover-shadow: rgba(0, 0, 0, 0.3);
126
+ --tr-question-category-bg: rgba(255, 255, 255, 0.04);
127
+ --tr-question-category-hover-bg: rgba(255, 255, 255, 0.08);
128
+ --tr-question-category-active-border: #e6e6e6;
129
+ --tr-question-item-border-color: rgba(255, 255, 255, 0.04);
130
+
131
+ /* 滚动条颜色 */
132
+ --tr-question-scrollbar-track-bg: rgba(255, 255, 255, 0.05);
133
+ --tr-question-scrollbar-thumb-bg: rgba(255, 255, 255, 0.2);
134
+ --tr-question-scrollbar-thumb-hover-bg: rgba(255, 255, 255, 0.3);
135
+ }
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
- import { TinyButton, TinyTooltip } from '@opentiny/vue'
3
+ import TinyButton from '@opentiny/vue-button'
4
4
  import { IconClose } from '@opentiny/vue-icon'
5
5
  import { ActionButtonsProps } from '../index.type'
6
6
 
@@ -46,41 +46,32 @@ const props = withDefaults(defineProps<ActionButtonsProps>(), {
46
46
  submitType: 'enter',
47
47
  })
48
48
 
49
- const emit = defineEmits({
49
+ const emit = defineEmits<{
50
50
  /**
51
51
  * 清除内容事件
52
52
  */
53
- clear: () => true,
53
+ (e: 'clear'): void
54
54
  /**
55
55
  * 切换语音识别状态事件
56
- * @param {boolean} state - 新的语音识别状态
57
56
  */
58
- 'toggle-speech': (state: boolean) => Boolean(state),
57
+ (e: 'toggle-speech', state: boolean): void
59
58
  /**
60
59
  * 提交内容事件
61
60
  */
62
- submit: () => true,
63
- })
61
+ (e: 'submit'): void
62
+ /**
63
+ * 取消发送事件,用于取消加载状态
64
+ */
65
+ (e: 'cancel'): void
66
+ }>()
64
67
 
65
68
  /**
66
69
  * 是否启用语音功能
67
70
  */
68
71
  const speechEnabled = computed(() => props.allowSpeech)
69
72
 
70
- /**
71
- * 语音按钮提示文本
72
- */
73
- const speechButtonText = computed(() => (props.speechStatus.isRecording ? '停止录音' : '开始语音输入'))
74
-
75
73
  const isSpeechRecording = computed(() => props.speechStatus.isRecording)
76
74
 
77
- /**
78
- * 提交按钮tooltip
79
- */
80
- const submitTooltip = computed(() => {
81
- return props.loading ? `发送中...` : '发送消息'
82
- })
83
-
84
75
  /**
85
76
  * 整体禁用状态
86
77
  */
@@ -113,6 +104,15 @@ const handleSubmit = () => {
113
104
  emit('submit')
114
105
  }
115
106
  }
107
+
108
+ /**
109
+ * 处理取消操作
110
+ */
111
+ const handleCancel = () => {
112
+ if (!isDisabled.value) {
113
+ emit('cancel')
114
+ }
115
+ }
116
116
  </script>
117
117
 
118
118
  <template>
@@ -128,18 +128,16 @@ const handleSubmit = () => {
128
128
 
129
129
  <!-- 语音按钮:仅在启用语音功能时显示 -->
130
130
  <template v-if="speechEnabled && !loading">
131
- <tiny-tooltip :content="speechButtonText" placement="top">
132
- <tiny-button
133
- type="text"
134
- :disabled="isDisabled"
135
- @click="handleToggleSpeech"
136
- class="speech-button"
137
- :class="{ 'is-recording': isSpeechRecording }"
138
- >
139
- <img v-if="!isSpeechRecording" src="../../assets/icons/voice.svg" class="button-icon" alt="录音" />
140
- <img v-else src="../../assets/icons/loading-speech.svg" class="button-icon recording-icon" alt="语音中" />
141
- </tiny-button>
142
- </tiny-tooltip>
131
+ <tiny-button
132
+ type="text"
133
+ :disabled="isDisabled"
134
+ @click="handleToggleSpeech"
135
+ class="speech-button"
136
+ :class="{ 'is-recording': isSpeechRecording }"
137
+ >
138
+ <img v-if="!isSpeechRecording" src="../../assets/icons/voice.svg" class="button-icon" alt="录音" />
139
+ <img v-else src="../../assets/icons/loading-speech.svg" class="button-icon recording-icon" alt="语音中" />
140
+ </tiny-button>
143
141
  </template>
144
142
 
145
143
  <template v-if="showClear">
@@ -152,14 +150,19 @@ const handleSubmit = () => {
152
150
 
153
151
  <!-- 提交按钮:主操作按钮 -->
154
152
  <template v-if="hasContent || loading">
155
- <tiny-tooltip :content="submitTooltip" placement="top">
156
- <tiny-button type="text" @click="handleSubmit" class="submit-button" :disabled="isDisabled">
157
- <div class="button-content">
158
- <img v-if="!loading" src="../../assets/icons/send.svg" alt="发送" />
159
- <img v-else src="../../assets/icons/loading.svg" alt="加载中" class="loading" />
160
- </div>
161
- </tiny-button>
162
- </tiny-tooltip>
153
+ <tiny-button
154
+ type="text"
155
+ :class="loading ? 'cancel-button' : 'submit-button'"
156
+ :disabled="isDisabled"
157
+ @click="loading ? handleCancel() : handleSubmit()"
158
+ >
159
+ <div class="button-content">
160
+ <img v-if="!loading" src="../../assets/icons/send.svg" alt="发送" />
161
+ <tiny-tooltip v-else content="停止生成" placement="top">
162
+ <img src="../../assets/icons/loading.svg" alt="加载中" class="loading" />
163
+ </tiny-tooltip>
164
+ </div>
165
+ </tiny-button>
163
166
  </template>
164
167
  </div>
165
168
  </template>
@@ -1,5 +1,4 @@
1
1
  import { ref, watch } from 'vue'
2
- import { debounce } from 'lodash-es'
3
2
  import type { SenderProps, SenderEmits } from '../index.type'
4
3
 
5
4
  /**
@@ -10,7 +9,7 @@ import type { SenderProps, SenderEmits } from '../index.type'
10
9
  * @param emit 组件方法
11
10
  */
12
11
  export function useInputHandler(props: SenderProps, emit: SenderEmits) {
13
- const inputValue = ref(props.defaultValue || '')
12
+ const inputValue = ref(props.modelValue || props.defaultValue || '')
14
13
  const inputWrapper = ref<HTMLElement | null>(null)
15
14
 
16
15
  // 同步外部值变化
@@ -23,23 +22,29 @@ export function useInputHandler(props: SenderProps, emit: SenderEmits) {
23
22
  },
24
23
  )
25
24
 
25
+ // 监听内部值变化,触发update:modelValue事件
26
+ watch(
27
+ () => inputValue.value,
28
+ (val) => {
29
+ emit('update:modelValue', val)
30
+ },
31
+ )
32
+
26
33
  // 双向绑定处理
27
34
  const handleChange = (value: string) => {
28
35
  inputValue.value = value
29
36
  emit('update:modelValue', value)
30
37
  }
31
38
 
32
- // 防抖提交
33
- const debouncedSubmit = debounce((value: string) => {
34
- if (!props.disabled && !props.loading && value.trim()) {
35
- emit('submit', value)
36
- }
37
- }, props.debounceSubmit)
38
-
39
39
  // 提交处理
40
40
  const handleSubmit = (event?: Event) => {
41
41
  event?.preventDefault()
42
- debouncedSubmit(inputValue.value)
42
+
43
+ const submitValue = inputValue.value
44
+
45
+ if (!props.disabled && !props.loading && submitValue.trim()) {
46
+ emit('submit', submitValue)
47
+ }
43
48
  }
44
49
 
45
50
  // 清空输入
@@ -34,7 +34,6 @@ export function useKeyboardHandler(
34
34
  */
35
35
  const triggerSubmit = () => {
36
36
  if (!validateSubmission(inputValue.value)) return
37
- alert('提交成功')
38
37
  emit('submit', inputValue.value.trim())
39
38
  }
40
39
 
@@ -42,6 +41,12 @@ export function useKeyboardHandler(
42
41
  * 检查是否为指定的提交快捷键
43
42
  * @param event 键盘事件
44
43
  * @param submitType 提交类型
44
+ * @returns 是否触发提交
45
+ *
46
+ * 提交行为说明:
47
+ * - 当 submitType 为 enter 时:按 Enter 键提交
48
+ * - 当 submitType 为 ctrlEnter 时:按 Ctrl+Enter 提交,单独按 Enter 换行
49
+ * - 当 submitType 为 shiftEnter 时:按 Shift+Enter 提交,单独按 Enter 换行
45
50
  */
46
51
  const checkSubmitShortcut = (event: KeyboardEvent, submitType: SubmitTrigger): boolean => {
47
52
  const isEnter = event.key === 'Enter'
@@ -49,13 +54,10 @@ export function useKeyboardHandler(
49
54
 
50
55
  switch (submitType) {
51
56
  case 'enter':
52
- console.log('enter')
53
57
  return !event.shiftKey && !event.ctrlKey && !event.metaKey
54
58
  case 'ctrlEnter':
55
- console.log('ctrlEnter')
56
59
  return (event.ctrlKey || event.metaKey) && !event.shiftKey
57
60
  case 'shiftEnter':
58
- console.log('shiftEnter')
59
61
  return event.shiftKey && !event.ctrlKey && !event.metaKey
60
62
  default:
61
63
  return false
@@ -1,13 +1,6 @@
1
1
  import { reactive } from 'vue'
2
2
  import type { SpeechHookOptions, SpeechHandler, SpeechState } from '../index.type'
3
3
 
4
- declare global {
5
- interface Window {
6
- webkitSpeechRecognition: typeof SpeechRecognition
7
- SpeechRecognition: typeof SpeechRecognition
8
- }
9
- }
10
-
11
4
  /**
12
5
  * 语音识别处理 Hook
13
6
  * 集中管理语音识别相关逻辑
@@ -19,17 +12,18 @@ export function useSpeechHandler(options: SpeechHookOptions): SpeechHandler {
19
12
  // 语音识别状态
20
13
  const speechState = reactive<SpeechState>({
21
14
  isRecording: false,
22
- isSupported: 'webkitSpeechRecognition' in window || 'SpeechRecognition' in window,
15
+ isSupported:
16
+ (typeof window !== 'undefined' && 'webkitSpeechRecognition' in window) || 'SpeechRecognition' in window,
23
17
  error: undefined,
24
18
  })
25
19
 
26
20
  // 创建语音识别实例
27
- const recognition = speechState.isSupported
21
+ const recognition: SpeechRecognition | undefined = speechState.isSupported
28
22
  ? new (window.webkitSpeechRecognition || window.SpeechRecognition)()
29
- : null
23
+ : undefined
30
24
 
31
25
  // 初始化语音识别配置
32
- if (recognition) {
26
+ if (recognition !== undefined) {
33
27
  recognition.continuous = options.continuous ?? false
34
28
  recognition.interimResults = options.interimResults ?? true
35
29
  recognition.lang = options.lang ?? navigator.language
@@ -2,13 +2,9 @@
2
2
 
3
3
  // 主要组件样式
4
4
  .tiny-sender {
5
- border: 1px solid var(--tr-sender-border-color);
6
- border-radius: var(--tr-sender-border-radius);
7
5
  background: var(--tr-sender-bg-color);
8
6
  position: relative;
9
7
  color: var(--tr-sender-text-color);
10
- padding: var(--tr-sender-padding-top) var(--tr-sender-padding-right) var(--tr-sender-padding-bottom)
11
- var(--tr-sender-padding-left);
12
8
 
13
9
  // TinyUI 输入框调整
14
10
  .tiny-input__prefix {
@@ -166,11 +162,12 @@
166
162
  min-width: var(--tr-sender-prefix-min-width);
167
163
  flex: 0 0 var(--tr-sender-prefix-width); /* 固定宽度,不可伸缩 */
168
164
  display: flex;
169
- align-items: center;
165
+ align-items: start;
170
166
  justify-content: center;
171
167
  background: var(--tr-sender-bg-color);
172
168
  border-radius: var(--tr-sender-border-radius) 0 0 var(--tr-sender-border-radius);
173
169
  transition: background-color var(--tr-sender-transition-duration);
170
+ padding-top: 8px;
174
171
  padding-left: var(--tr-sender-prefix-padding-left);
175
172
  padding-right: calc(var(--tr-sender-padding-right) / 2);
176
173
 
@@ -290,6 +287,7 @@
290
287
  var(--tr-sender-padding-left);
291
288
  background: var(--tr-sender-bg-color);
292
289
  border-radius: var(--tr-sender-border-radius);
290
+ align-items: center;
293
291
 
294
292
  /* 按钮图标统一样式 */
295
293
  .button-icon {
@@ -31,7 +31,6 @@ export interface SenderProps {
31
31
  clearable?: boolean // 是否显示清除按钮
32
32
  disabled?: boolean // 禁用状态
33
33
  defaultValue?: string | null // 默认值
34
- debounceSubmit?: number // 提交防抖时间(ms)
35
34
  loading?: boolean // 加载状态
36
35
  modelValue?: string // 双向绑定值
37
36
  mode?: InputMode // 输入框模式:单行/多行
@@ -72,6 +71,7 @@ export type SenderEmits = {
72
71
  (e: 'focus', event: FocusEvent): void
73
72
  (e: 'blur', event: FocusEvent): void
74
73
  (e: 'escape-press'): void // 按下Esc键时触发
74
+ (e: 'cancel'): void // 取消发送状态时触发
75
75
  }
76
76
 
77
77
  // 语音识别状态
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, watch } from 'vue'
3
- import { TinyInput } from '@opentiny/vue'
3
+ import TinyInput from '@opentiny/vue-input'
4
4
  import type { SenderProps, SenderEmits, InputHandler, KeyboardHandler } from './index.type'
5
5
  import { useInputHandler } from './composables/useInputHandler'
6
6
  import { useKeyboardHandler } from './composables/useKeyboardHandler'
@@ -15,7 +15,6 @@ const props = withDefaults(defineProps<SenderProps>(), {
15
15
  allowFiles: false,
16
16
  clearable: false,
17
17
  disabled: false,
18
- debounceSubmit: 300,
19
18
  loading: false,
20
19
  modelValue: '',
21
20
  mode: 'single',
@@ -224,6 +223,7 @@ defineExpose({
224
223
  @clear="clearInput"
225
224
  @toggle-speech="toggleSpeech"
226
225
  @submit="triggerSubmit"
226
+ @cancel="$emit('cancel')"
227
227
  />
228
228
  </div>
229
229
  </div>
@@ -259,6 +259,7 @@ defineExpose({
259
259
  @clear="clearInput"
260
260
  @toggle-speech="toggleSpeech"
261
261
  @submit="triggerSubmit"
262
+ @cancel="$emit('cancel')"
262
263
  />
263
264
  </div>
264
265
  </div>
@@ -0,0 +1,12 @@
1
+ import { VNode } from 'vue'
2
+
3
+ export interface WelcomeProps {
4
+ title: string
5
+ description: string
6
+ align?: 'left' | 'center' | 'right' | string
7
+ icon?: VNode
8
+ }
9
+
10
+ export interface WelcomeSlots {
11
+ footer: () => unknown
12
+ }
@@ -1,3 +1,69 @@
1
- <script setup lang="ts"></script>
1
+ <script setup lang="ts">
2
+ import { WelcomeProps, WelcomeSlots } from './index.type'
2
3
 
3
- <template>Welcome</template>
4
+ const props = withDefaults(defineProps<WelcomeProps>(), {
5
+ align: 'center',
6
+ })
7
+
8
+ defineSlots<WelcomeSlots>()
9
+ </script>
10
+
11
+ <template>
12
+ <div class="tr-welcome">
13
+ <div class="tr-welcome__title-wrapper">
14
+ <span v-if="props.icon" class="tr-welcome__icon">
15
+ <component :is="props.icon"></component>
16
+ </span>
17
+ <h3 class="tr-welcome__title">{{ props.title }}</h3>
18
+ </div>
19
+ <span class="tr-welcome__description">{{ props.description }}</span>
20
+ <slot name="footer"></slot>
21
+ </div>
22
+ </template>
23
+
24
+ <style lang="less" scoped>
25
+ .tr-welcome {
26
+ --title-font: 40px;
27
+ --title-color: rgb(25, 25, 25);
28
+ --title-font-size: 40px;
29
+ --title-line-height: 56px;
30
+ --title-font-weight: 600;
31
+ --description-color: rgb(25, 25, 25);
32
+ --description-font-size: 20px;
33
+ --description-line-height: 34px;
34
+ --description-font-weight: 500;
35
+
36
+ text-align: v-bind('props.align');
37
+
38
+ display: flex;
39
+ flex-direction: column;
40
+ padding: 16px;
41
+ }
42
+
43
+ .tr-welcome__title-wrapper {
44
+ }
45
+
46
+ .tr-welcome__icon {
47
+ margin-right: 16px;
48
+ }
49
+
50
+ .tr-welcome__title {
51
+ color: var(--title-color);
52
+ font-size: var(--title-font-size);
53
+ line-height: var(--title-line-height);
54
+ font-weight: var(--title-font-weight);
55
+
56
+ padding: 0;
57
+ margin: 0;
58
+ display: inline-block;
59
+ }
60
+
61
+ .tr-welcome__description {
62
+ color: var(--description-color);
63
+ font-size: var(--description-font-size);
64
+ line-height: var(--description-line-height);
65
+ font-weight: var(--description-font-weight);
66
+
67
+ margin-top: 32px;
68
+ }
69
+ </style>
@@ -1,2 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- export { default as AIIcon } from './ai.vue';
2
- export { default as UserIcon } from './user.vue';
@@ -1,2 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
2
- export default _default;
@@ -1,7 +0,0 @@
1
- import { App } from 'vue';
2
- import { default as BubbleItem } from './bubble-item.vue';
3
- declare const install: (app: App) => void;
4
- declare const _default: typeof BubbleItem & {
5
- install: typeof install;
6
- };
7
- export default _default;
@@ -1,8 +0,0 @@
1
- import { App } from 'vue';
2
- import { default as BubbleList } from './bubble-list.vue';
3
- export type BA = typeof BubbleList;
4
- declare const install: (app: App) => void;
5
- declare const _default: typeof BubbleList & {
6
- install: typeof install;
7
- };
8
- export default _default;
@@ -1,55 +0,0 @@
1
- import { Options as MarkdownItOptions } from 'markdown-it';
2
- import { Component, CSSProperties, VNode } from 'vue';
3
- export type BubbleRole = 'ai' | 'user';
4
- export interface BubbleRoleConfig {
5
- avatar?: VNode;
6
- align: 'left' | 'right';
7
- }
8
- export type BubbleStatus = 'loading' | 'generating' | 'aborted' | 'complete' | 'error';
9
- export interface BubbleActionOptions {
10
- name: string;
11
- vnode: VNode | Component;
12
- show?: boolean | ((props: BubbleItemProps) => boolean);
13
- }
14
- export type BubbleAction = 'copy' | 'regenerate' | 'like' | 'dislike' | 'continue' | 'edit' | BubbleActionOptions;
15
- export interface BubbleItemProps {
16
- /**
17
- * 角色,`ai` 或 `user`
18
- */
19
- role: BubbleRole;
20
- /**
21
- * 内容
22
- */
23
- content?: string;
24
- /**
25
- * 内容类型
26
- */
27
- type?: 'text' | 'markdown';
28
- /**
29
- * 气泡状态
30
- */
31
- status?: BubbleStatus;
32
- /**
33
- * 角色配置项
34
- */
35
- roleConfig?: BubbleRoleConfig;
36
- /**
37
- * type 为 'markdown' 时,markdown 的配置项
38
- */
39
- mdConfig?: MarkdownItOptions;
40
- showActions?: boolean;
41
- actions?: BubbleAction[];
42
- maxWidth?: CSSProperties['maxWidth'];
43
- }
44
- export interface BubbleActionConfig {
45
- show?: boolean;
46
- actions?: BubbleAction[];
47
- }
48
- export interface BubbleListProps {
49
- items: BubbleItemProps[];
50
- roleConfigs?: Partial<Record<BubbleRole, BubbleRoleConfig>>;
51
- mdConfig?: MarkdownItOptions;
52
- actionConfigs?: Partial<Record<BubbleRole, BubbleActionConfig>>;
53
- autoScroll?: boolean;
54
- maxWidth?: CSSProperties['maxWidth'];
55
- }