@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,10 @@
1
+ import { VNode } from 'vue';
2
+ export interface WelcomeProps {
3
+ title: string;
4
+ description: string;
5
+ align?: 'left' | 'center' | 'right' | string;
6
+ icon?: VNode;
7
+ }
8
+ export interface WelcomeSlots {
9
+ footer: () => unknown;
10
+ }
@@ -1,2 +1,18 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1
+ import { WelcomeProps, WelcomeSlots } from './index.type';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: Readonly<WelcomeSlots> & WelcomeSlots;
5
+ refs: {};
6
+ rootEl: HTMLDivElement;
7
+ };
8
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
9
+ declare const __VLS_component: import('vue').DefineComponent<WelcomeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<WelcomeProps> & Readonly<{}>, {
10
+ align: "left" | "center" | "right" | string;
11
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
12
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2
13
  export default _default;
14
+ type __VLS_WithTemplateSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-robot",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.2.0-alpha.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,6 +8,7 @@
8
8
  "main": "./dist/index.js",
9
9
  "module": "./dist/index.js",
10
10
  "scripts": {
11
+ "dev": "vue-tsc && vite build --watch",
11
12
  "build": "vue-tsc && vite build",
12
13
  "type-check": "vue-tsc --noEmit"
13
14
  },
@@ -15,17 +16,17 @@
15
16
  "vue": "^3.3.11"
16
17
  },
17
18
  "dependencies": {
19
+ "@opentiny/tiny-robot-svgs": "0.2.0-alpha.0",
18
20
  "@opentiny/vue": "^3.21.0",
19
21
  "@opentiny/vue-button": "^3.21.0",
20
22
  "@opentiny/vue-icon": "^3.22.0",
21
23
  "@opentiny/vue-input": "^3.21.0",
22
24
  "@opentiny/vue-tooltip": "^3.22.0",
23
- "lodash-es": "4.17.21",
24
- "markdown-it": "^14.1.0",
25
- "vue": "^3.3.11"
25
+ "markdown-it": "^14.1.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@opentiny/vue-vite-import": "^1.3.0",
29
+ "@types/dom-speech-recognition": "^0.0.6",
29
30
  "@types/lodash-es": "^4.17.12",
30
31
  "@types/markdown-it": "^14.1.2",
31
32
  "@types/node": "^22.13.17",
@@ -38,5 +39,5 @@
38
39
  "vue": "^3.3.11",
39
40
  "vue-tsc": "^2.2.8"
40
41
  },
41
- "gitHead": "726b80c0db74ae929e450edb6a7af9fbb8f0fe45"
42
+ "gitHead": "3517724651afbbb05b1be20487a9f3341c06133c"
42
43
  }
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref, watch } from 'vue'
3
+ import Bubble from './bubble.vue'
4
+ import { BubbleListProps, BubbleProps } from './index.type'
5
+ import { useElementScroll } from './useScroll'
6
+
7
+ const props = withDefaults(defineProps<BubbleListProps>(), {})
8
+
9
+ const scrollContainer = ref<HTMLDivElement>()
10
+ const { scrollToBottom } = useElementScroll(scrollContainer)
11
+
12
+ const lastBubble = computed(() => props.items.at(-1))
13
+
14
+ watch([() => props.items.length, () => lastBubble.value?.content], () => {
15
+ if (!props.autoScroll) {
16
+ return
17
+ }
18
+
19
+ scrollToBottom()
20
+ })
21
+
22
+ const getItemProps = (item: BubbleProps): BubbleProps => {
23
+ const defaultConfig = item.role ? props.roles?.[item.role] || {} : {}
24
+ return { ...defaultConfig, ...item }
25
+ }
26
+ </script>
27
+
28
+ <template>
29
+ <div class="tr-bubble-list" ref="scrollContainer">
30
+ <Bubble v-for="(item, index) in props.items" :key="item.id || index" v-bind="getItemProps(item)"></Bubble>
31
+ </div>
32
+ </template>
33
+
34
+ <style lang="less" scoped>
35
+ .tr-bubble-list {
36
+ display: flex;
37
+ flex-direction: column;
38
+ gap: 16px;
39
+ overflow-y: auto;
40
+ padding: 16px;
41
+ }
42
+ </style>
@@ -0,0 +1,247 @@
1
+ <script setup lang="ts">
2
+ import markdownit from 'markdown-it'
3
+ import { computed, defineComponent, useSlots } from 'vue'
4
+ import { BubbleActionOptions, BubbleEvents, BubbleProps, BubbleSlots } from './index.type'
5
+ import { CopyAction, RefreshAction } from './components/actions'
6
+
7
+ const props = withDefaults(defineProps<BubbleProps>(), {
8
+ content: '',
9
+ placement: 'start',
10
+ type: 'text',
11
+ maxWidth: '80%',
12
+ })
13
+
14
+ const emit = defineEmits<BubbleEvents>()
15
+
16
+ defineSlots<BubbleSlots>()
17
+
18
+ const slots = useSlots()
19
+
20
+ const bubbleContent = computed(() => {
21
+ if (props.type === 'markdown') {
22
+ return markdownit(props.mdConfig || {}).render(props.content)
23
+ }
24
+ return props.content
25
+ })
26
+
27
+ const placementStart = computed(() => props.placement === 'start')
28
+
29
+ const AvatarComp = computed(() => {
30
+ if (!props.avatar) {
31
+ return null
32
+ }
33
+
34
+ return defineComponent(() => {
35
+ return () => props.avatar
36
+ })
37
+ })
38
+
39
+ const defaultActionsMap = new Map<string, BubbleActionOptions>([
40
+ [
41
+ 'copy',
42
+ {
43
+ name: 'copy',
44
+ vnode: CopyAction,
45
+ show: true,
46
+ },
47
+ ],
48
+ [
49
+ 'refresh',
50
+ {
51
+ name: 'refresh',
52
+ vnode: RefreshAction,
53
+ show: true,
54
+ },
55
+ ],
56
+ ])
57
+
58
+ const computedActions = computed(() => {
59
+ const actions = (props.actions || []).map((action) => {
60
+ if (typeof action === 'string') {
61
+ return defaultActionsMap.get(action)
62
+ }
63
+
64
+ if (defaultActionsMap.has(action.name)) {
65
+ return {
66
+ ...defaultActionsMap.get(action.name),
67
+ ...action,
68
+ }
69
+ }
70
+
71
+ return action
72
+ })
73
+
74
+ return actions.filter((action): action is BubbleActionOptions => Boolean(action))
75
+ })
76
+
77
+ const handleActionClick = (name: string, ...args: unknown[]) => {
78
+ if (name === 'copy') {
79
+ emit('copy', args[0] as boolean)
80
+ return
81
+ }
82
+
83
+ if (name === 'refresh') {
84
+ emit('refresh')
85
+ return
86
+ }
87
+
88
+ emit('action', name, ...args)
89
+ }
90
+ </script>
91
+
92
+ <template>
93
+ <div
94
+ :class="[
95
+ 'tr-bubble',
96
+ {
97
+ 'placement-start': placementStart,
98
+ 'placement-end': !placementStart,
99
+ },
100
+ ]"
101
+ >
102
+ <div v-if="AvatarComp" class="tr-bubble__avatar">
103
+ <component :is="AvatarComp"></component>
104
+ </div>
105
+ <div class="tr-bubble__content-wrapper">
106
+ <slot v-if="props.loading" name="loading">
107
+ <div class="tr-bubble__loading">
108
+ <span></span>
109
+ <span></span>
110
+ <span></span>
111
+ </div>
112
+ </slot>
113
+ <div v-else :class="['tr-bubble__content']">
114
+ <div class="tr-bubbule__body">
115
+ <slot>
116
+ <span v-if="props.type === 'markdown'" v-html="bubbleContent"></span>
117
+ <span v-else>{{ bubbleContent }}</span>
118
+ <span v-if="props.aborted" class="tr-bubbule__aborted">(用户停止)</span>
119
+ </slot>
120
+ </div>
121
+ <div v-if="slots.footer || computedActions.length > 0" class="tr-bubbule__footer">
122
+ <div class="tr-bubbule__footer-left">
123
+ <slot name="footer"></slot>
124
+ </div>
125
+ <div class="tr-bubbule__footer-actions">
126
+ <template v-for="action in computedActions" :key="action?.name">
127
+ <component
128
+ :is="action.vnode"
129
+ v-show="typeof action.show === 'function' ? action.show(props) : action.show"
130
+ :bubbleItem="props"
131
+ @click="handleActionClick(action.name, $event)"
132
+ ></component>
133
+ </template>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </template>
140
+
141
+ <style lang="less" scoped>
142
+ .tr-bubble {
143
+ display: flex;
144
+ gap: 16px;
145
+ max-width: v-bind('props.maxWidth');
146
+
147
+ &.placement-start {
148
+ flex-direction: row;
149
+ }
150
+
151
+ &.placement-end {
152
+ flex-direction: row-reverse;
153
+ margin-left: auto;
154
+ }
155
+ }
156
+
157
+ .tr-bubble__avatar {
158
+ width: 40px;
159
+ height: 40px;
160
+ flex-shrink: 0;
161
+ display: flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ }
165
+
166
+ .tr-bubble__loading {
167
+ display: flex;
168
+ align-items: center;
169
+ justify-content: center;
170
+ padding: 8px 0;
171
+
172
+ span {
173
+ height: 8px;
174
+ width: 8px;
175
+ margin: 0 2px;
176
+ background-color: #bbb;
177
+ border-radius: 50%;
178
+ display: inline-block;
179
+ animation: typing 1.4s infinite ease-in-out both;
180
+
181
+ &:nth-child(1) {
182
+ animation-delay: 0s;
183
+ }
184
+
185
+ &:nth-child(2) {
186
+ animation-delay: 0.2s;
187
+ }
188
+
189
+ &:nth-child(3) {
190
+ animation-delay: 0.4s;
191
+ }
192
+ }
193
+
194
+ @keyframes typing {
195
+ 0%,
196
+ 80%,
197
+ 100% {
198
+ transform: scale(0);
199
+ }
200
+ 40% {
201
+ transform: scale(1);
202
+ }
203
+ }
204
+ }
205
+
206
+ .tr-bubble__content {
207
+ background-color: white;
208
+ padding: 16px 24px;
209
+ border-radius: 24px;
210
+ box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.02);
211
+
212
+ .tr-bubbule__body {
213
+ color: rgb(25, 25, 25);
214
+ font-size: 16px;
215
+ line-height: 26px;
216
+ }
217
+
218
+ .tr-bubbule__aborted {
219
+ color: rgb(128, 128, 128);
220
+ font-size: 14px;
221
+ }
222
+
223
+ .tr-bubbule__footer {
224
+ display: flex;
225
+ gap: 12px;
226
+
227
+ .tr-bubbule__footer-left {
228
+ flex: 1;
229
+ }
230
+
231
+ .tr-bubbule__footer-actions {
232
+ display: flex;
233
+ flex-shrink: 0;
234
+ gap: 4px;
235
+ margin-top: 12px;
236
+
237
+ & > * {
238
+ display: flex;
239
+ align-items: center;
240
+ justify-content: center;
241
+ width: 24px;
242
+ height: 24px;
243
+ }
244
+ }
245
+ }
246
+ }
247
+ </style>
@@ -0,0 +1,54 @@
1
+ <script setup lang="ts">
2
+ import { BubbleProps } from '../../index.type'
3
+ import { IconCopy } from '@opentiny/tiny-robot-svgs'
4
+
5
+ const { bubbleItem } = defineProps<{ bubbleItem: BubbleProps }>()
6
+
7
+ const emit = defineEmits(['click'])
8
+
9
+ async function copyToClipboard(text: string) {
10
+ try {
11
+ await navigator.clipboard.writeText(text)
12
+ return true
13
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ } catch (err: unknown) {
15
+ return false
16
+ }
17
+ }
18
+
19
+ const handleClick = async () => {
20
+ const result = bubbleItem.content ? await copyToClipboard(bubbleItem.content) : false
21
+
22
+ emit('click', result)
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <button class="icon-btn" @click="handleClick">
28
+ <IconCopy width="16px" height="16px" />
29
+ </button>
30
+ </template>
31
+
32
+ <style lang="less" scoped>
33
+ button.icon-btn {
34
+ width: 28px;
35
+ height: 28px;
36
+ display: inline-flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ border: none;
40
+ border-radius: 8px;
41
+ cursor: pointer;
42
+ padding: 0;
43
+ transition: background-color 0.3s;
44
+ background-color: white;
45
+
46
+ &:hover {
47
+ background-color: rgba(0, 0, 0, 0.04);
48
+ }
49
+
50
+ &:active {
51
+ background-color: rgba(0, 0, 0, 0.15);
52
+ }
53
+ }
54
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <button class="icon-btn"><IconRefresh width="16px" height="16px" /></button>
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import { IconRefresh } from '@opentiny/tiny-robot-svgs'
7
+ </script>
8
+
9
+ <style lang="less" scoped>
10
+ button.icon-btn {
11
+ width: 28px;
12
+ height: 28px;
13
+ display: inline-flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ border: none;
17
+ border-radius: 8px;
18
+ cursor: pointer;
19
+ padding: 0;
20
+ transition: background-color 0.3s;
21
+ background-color: white;
22
+
23
+ &:hover {
24
+ background-color: rgba(0, 0, 0, 0.04);
25
+ }
26
+
27
+ &:active {
28
+ background-color: rgba(0, 0, 0, 0.15);
29
+ }
30
+ }
31
+ </style>
@@ -0,0 +1,23 @@
1
+ import { App } from 'vue'
2
+ import BubbleComp from './bubble.vue'
3
+ import BubbleListComp from './bubble-list.vue'
4
+
5
+ BubbleComp.name = 'TrBubble'
6
+
7
+ const bubbleInstall = function (app: App) {
8
+ app.component(BubbleComp.name!, BubbleComp)
9
+ }
10
+
11
+ BubbleComp.install = bubbleInstall
12
+
13
+ export const Bubble = BubbleComp as typeof BubbleComp & { install: typeof bubbleInstall }
14
+
15
+ BubbleListComp.name = 'TrBubbleList'
16
+
17
+ const bubbleListInstall = function (app: App) {
18
+ app.component(BubbleListComp.name!, BubbleListComp)
19
+ }
20
+
21
+ BubbleListComp.install = bubbleListInstall
22
+
23
+ export const BubbleList = BubbleListComp as typeof BubbleListComp & { install: typeof bubbleListInstall }
@@ -0,0 +1,63 @@
1
+ import { Options as MarkdownItOptions } from 'markdown-it'
2
+ import { Component, CSSProperties, VNode } from 'vue'
3
+
4
+ export interface BubbleActionOptions {
5
+ name: 'copy' | 'refresh' | string
6
+ vnode?: VNode | Component
7
+ show?: boolean | ((props: BubbleProps) => boolean)
8
+ }
9
+
10
+ export type BubbleAction = 'copy' | 'refresh' | BubbleActionOptions
11
+
12
+ export type BubblePalcement = 'start' | 'end'
13
+
14
+ export interface BubbleProps {
15
+ /**
16
+ * 气泡内容
17
+ */
18
+ content?: string
19
+ id?: string | number | symbol
20
+ /**
21
+ * 气泡位置
22
+ */
23
+ placement?: BubblePalcement
24
+ avatar?: VNode
25
+ role?: string
26
+ /**
27
+ * 内容类型
28
+ */
29
+ type?: 'text' | 'markdown'
30
+ loading?: boolean
31
+ aborted?: boolean
32
+ /**
33
+ * type 为 'markdown' 时,markdown 的配置项
34
+ */
35
+ mdConfig?: MarkdownItOptions
36
+
37
+ actions?: BubbleAction[]
38
+ // 样式相关
39
+ maxWidth?: CSSProperties['maxWidth']
40
+ }
41
+
42
+ export interface BubbleSlots {
43
+ default: () => unknown
44
+ footer: () => unknown
45
+ loading: () => unknown
46
+ }
47
+
48
+ export interface BubbleEvents {
49
+ (e: 'copy', result: boolean): void
50
+ (e: 'refresh'): void
51
+ (e: 'action', name: string, ...args: unknown[]): void
52
+ }
53
+
54
+ export type BubbleRoleConfig = Pick<BubbleProps, 'placement' | 'avatar' | 'type' | 'mdConfig' | 'actions' | 'maxWidth'>
55
+
56
+ export interface BubbleListProps {
57
+ items: BubbleProps[]
58
+ /**
59
+ * 每个角色的默认配置项
60
+ */
61
+ roles?: Record<string, BubbleRoleConfig>
62
+ autoScroll?: boolean
63
+ }
@@ -0,0 +1,14 @@
1
+ import { nextTick, Ref } from 'vue'
2
+
3
+ export const useElementScroll = (elemRef: Ref<HTMLElement | null | undefined>) => {
4
+ const scrollToBottom = () => {
5
+ nextTick(() => {
6
+ elemRef.value?.scrollTo({
7
+ top: elemRef.value.scrollHeight,
8
+ behavior: 'smooth',
9
+ })
10
+ })
11
+ }
12
+
13
+ return { scrollToBottom }
14
+ }
@@ -0,0 +1,12 @@
1
+ import { App } from 'vue'
2
+ import Container from './index.vue'
3
+
4
+ Container.name = 'TrContainer'
5
+
6
+ const install = function <T>(app: App<T>) {
7
+ app.component(Container.name!, Container)
8
+ }
9
+
10
+ Container.install = install
11
+
12
+ export default Container as typeof Container & { install: typeof install }
@@ -0,0 +1,17 @@
1
+ export interface ContainerProps {
2
+ /**
3
+ * model:show
4
+ */
5
+ show: boolean
6
+ /**
7
+ * model:fullscreen
8
+ */
9
+ fullscreen?: boolean
10
+ }
11
+
12
+ export interface ContainerSlots {
13
+ default: () => unknown
14
+ title: () => unknown
15
+ operations: () => unknown
16
+ footer: () => unknown
17
+ }