@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,45 @@
1
+ const n = typeof window > "u", r = (e, t, s, o = !1) => {
2
+ e && t && s && e.addEventListener(t, s, o);
3
+ }, l = (e, t, s, o = !1) => {
4
+ e && t && e.removeEventListener(t, s, o);
5
+ }, c = (e, t = "") => {
6
+ if (!e)
7
+ return;
8
+ t.split(" ").filter((o) => o).forEach((o) => e.classList.add(o));
9
+ }, d = (e, t) => {
10
+ if (!e || !t)
11
+ return;
12
+ t.split(" ").filter((o) => o).forEach((o) => e.classList.remove(o));
13
+ }, f = () => {
14
+ const e = window;
15
+ let t = e.document.documentElement, s = e.document.body;
16
+ return {
17
+ scrollTop: t.scrollTop || s.scrollTop,
18
+ scrollLeft: t.scrollLeft || s.scrollLeft,
19
+ visibleHeight: t.clientHeight || s.clientHeight,
20
+ visibleWidth: t.clientWidth || s.clientWidth
21
+ };
22
+ }, i = (e) => {
23
+ if (n)
24
+ return !1;
25
+ if (e) {
26
+ const t = getComputedStyle(e);
27
+ if (t.getPropertyValue("position") === "fixed") {
28
+ if (t.getPropertyValue("display") === "none")
29
+ return !0;
30
+ if (e.parentNode !== document.body)
31
+ return i(e.parentNode);
32
+ } else
33
+ return e.offsetParent === null;
34
+ }
35
+ return !1;
36
+ };
37
+ export {
38
+ c as addClass,
39
+ f as getDomNode,
40
+ i as isDisplayNone,
41
+ n as isServer,
42
+ l as off,
43
+ r as on,
44
+ d as removeClass
45
+ };
@@ -0,0 +1,320 @@
1
+ import { __spreadValues as E } from "../../chunk-G2ADBYYC.js";
2
+ import { isDisplayNone as j, on as g, off as O } from "./dom.js";
3
+ import v from "./popup-manager.js";
4
+ import { typeOf as U } from "../type.js";
5
+ import { isBrowser as z } from "../browser.js";
6
+ const V = ["left", "right", "top", "bottom"], L = ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"], k = {
7
+ arrowOffset: 0,
8
+ arrowElement: "[x-arrow]",
9
+ boundariesElement: "viewport",
10
+ boundariesPadding: 5,
11
+ flipBehavior: "flip",
12
+ // 全局没有修改过它,所以它一直是flip
13
+ forceAbsolute: !1,
14
+ gpuAcceleration: !0,
15
+ offset: 0,
16
+ placement: "bottom",
17
+ preventOverflowOrder: V,
18
+ modifiers: L,
19
+ // 此处是string数组, 构造函数调用之后转为函数数组
20
+ updateHiddenPopperOnScroll: !1
21
+ // 滚动过程中是否更新隐藏的弹出层位置
22
+ }, w = (i, t) => {
23
+ const o = (e) => e !== "" && !isNaN(parseFloat(e)) && isFinite(e);
24
+ Object.keys(t).forEach((e) => {
25
+ let s = "";
26
+ ~["width", "height", "top", "right", "bottom", "left"].indexOf(e) && o(t[e]) && (s = "px"), i.style[e] = t[e] + s;
27
+ });
28
+ }, x = (i) => {
29
+ let t = i.offsetParent;
30
+ return t === window.document.body || !t ? window.document.documentElement : t;
31
+ }, m = (i, t) => !i || i.nodeType !== 1 ? void 0 : window.getComputedStyle(i, null)[t], A = (i) => i === window.document.body ? !1 : m(i, "position") === "fixed" ? !0 : (i.host && (i = i.host), i.parentNode ? A(i.parentNode) : !1), S = (i) => {
32
+ let t = i.getBoundingClientRect();
33
+ return {
34
+ left: t.left,
35
+ top: t.top,
36
+ right: t.right,
37
+ bottom: t.bottom,
38
+ width: t.right - t.left,
39
+ height: t.bottom - t.top
40
+ };
41
+ }, C = (i) => {
42
+ const t = ["scroll", "auto"];
43
+ return t.includes(m(i, "overflow")) || t.includes(m(i, "overflow-x")) || t.includes(m(i, "overflow-y"));
44
+ }, N = (i) => {
45
+ const t = document.createElement("div");
46
+ w(t, {
47
+ opacity: 0,
48
+ position: "fixed",
49
+ width: 1,
50
+ height: 1,
51
+ top: 0,
52
+ left: 0,
53
+ "z-index": "-99"
54
+ }), i.appendChild(t);
55
+ const o = S(t);
56
+ return i.removeChild(t), o;
57
+ }, b = (i) => {
58
+ let t = i.parentNode;
59
+ return t ? t === window.document ? window.document.body.scrollTop || window.document.body.scrollLeft ? window.document.body : window.document.documentElement : C(t) ? t : b(t) : i;
60
+ }, D = (i, t, o, e) => {
61
+ let { top: s, left: r, width: p, height: l } = S(i);
62
+ if (o) {
63
+ if (e.parentElement) {
64
+ const { top: h, left: u } = N(e.parentElement);
65
+ s -= h, r -= u;
66
+ }
67
+ return {
68
+ top: s,
69
+ left: r,
70
+ bottom: s + l,
71
+ right: r + p,
72
+ width: p,
73
+ height: l
74
+ };
75
+ }
76
+ let n = S(t);
77
+ return {
78
+ top: s - n.top,
79
+ left: r - n.left,
80
+ bottom: s - n.top + l,
81
+ right: r - n.left + p,
82
+ width: p,
83
+ height: l
84
+ };
85
+ }, $ = (i) => i === document.body ? Math.max(document.documentElement.scrollTop, document.body.scrollTop) : i.scrollTop, q = (i) => i === document.body ? Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) : i.scrollLeft, I = (i, t) => {
86
+ const o = Math.max(i.scrollHeight, i.offsetHeight, t.clientHeight, t.scrollHeight, t.offsetHeight);
87
+ return { width: Math.max(i.scrollWidth, i.offsetWidth, t.clientWidth, t.scrollWidth, t.offsetWidth), height: o };
88
+ }, P = (i) => {
89
+ let t = i.style.display, o = i.style.visibility;
90
+ i.style.display = "block", i.style.visibility = "hidden";
91
+ let e = window.getComputedStyle(i), s = parseFloat(e.marginTop) + parseFloat(e.marginBottom), r = parseFloat(e.marginLeft) + parseFloat(e.marginRight), p = { width: i.offsetWidth + r, height: i.offsetHeight + s };
92
+ return i.style.display = t, i.style.visibility = o, p;
93
+ }, M = (i) => {
94
+ let t = { left: "right", right: "left", bottom: "top", top: "bottom" };
95
+ return i.replace(/left|right|bottom|top/g, (o) => t[o]);
96
+ }, a = (i) => {
97
+ let t = E({}, i);
98
+ return t.right = t.left + t.width, t.bottom = t.top + t.height, t;
99
+ }, H = (i, t = []) => {
100
+ const o = i.parentNode;
101
+ return o ? (C(o) && t.push(o), m(o, "position") === "fixed" ? t : H(o, t)) : t;
102
+ }, F = (i) => {
103
+ const t = {
104
+ width: i.offsetWidth,
105
+ height: i.offsetHeight,
106
+ left: i.offsetLeft,
107
+ top: i.offsetTop,
108
+ right: 0,
109
+ bottom: 0
110
+ };
111
+ return t.right = t.left + t.width, t.bottom = t.top + t.height, t;
112
+ }, R = (i) => {
113
+ i.stopPropagation();
114
+ }, B = z && typeof ResizeObserver == "function" ? new ResizeObserver((i) => {
115
+ i.forEach((t) => {
116
+ t.target.popperVm && t.contentRect.height > 50 && t.target.popperVm.update();
117
+ });
118
+ }) : null;
119
+ class G {
120
+ constructor(t, o, e) {
121
+ this.modifiers = {}, this.popperOuterSize = null, this._reference = t, this._popper = o, this.state = {}, this._options = E(E({}, k), e), this._options.modifierFns = L.map((s) => this[s]), z && (this._popper.setAttribute("x-placement", this._options.placement), this.state.position = this._getPopperPositionByRefernce(this._reference), w(this._popper, { position: this.state.position, top: 0 }), this._popper && (this._popper.popperVm = this, B && B.observe(this._popper)), this.update(), this._setupEventListeners());
122
+ }
123
+ destroy() {
124
+ return this._popper.removeAttribute("x-placement"), this._popper.style.display = "none", this._removeEventListeners(), this._options.removeOnDestroy && this._popper.remove(), this;
125
+ }
126
+ onUpdate(t) {
127
+ return this.state.updateCallback = t, this;
128
+ }
129
+ update() {
130
+ let t = { instance: this, styles: {} };
131
+ this.stopEventBubble(), this.popperOuterSize = null, t.placement = t._originalPlacement = this._options.placement, t.offsets = this._getRefPopOffsets(this._popper, this._reference, t.placement), t.boundaries = this._getBoundaries(t, this._options.boundariesPadding, this._options.boundariesElement), t = this.runModifiers(t, this._options.modifierFns), typeof this.state.updateCallback == "function" && this.state.updateCallback(t);
132
+ }
133
+ // 阻止popper的mousewheel等事件冒泡。 通过 onxxx 绑定,是为了避免重复绑定事件
134
+ stopEventBubble() {
135
+ this._popper && (this._popper.onmousewheel || (this._popper.onmousewheel = R), this._popper.onwheel || (this._popper.onwheel = R));
136
+ }
137
+ /** 按顺序执行Modifiers, 如果传入终点modifier,则执行到指定位置 */
138
+ runModifiers(t, o, e) {
139
+ let s = o.slice();
140
+ const r = this._options;
141
+ return e !== void 0 && (s = this._options.modifierFns.slice(
142
+ 0,
143
+ r.modifierFns.findIndex((p) => p === e)
144
+ )), s.forEach((p) => {
145
+ U(p) === "function" && (t = p.call(this, t));
146
+ }), t;
147
+ }
148
+ // 此时才把offsets.popper 赋值给popper dom, offsets.array赋值给array dom
149
+ applyStyle(t) {
150
+ let o = { position: t.offsets.popper.position }, e = Math.round(t.offsets.popper.left), s = Math.round(t.offsets.popper.top);
151
+ return this._options.gpuAcceleration ? (o.transform = `translate3d(${e}px, ${s}px, 0)`, Object.assign(o, { top: 0, left: 0 })) : Object.assign(o, { top: s, left: e }), Object.assign(o, t.styles), w(this._popper, o), this._popper.setAttribute("x-placement", t.placement), t.offsets.arrow && w(t.arrowElement, t.offsets.arrow), t;
152
+ }
153
+ // 判断 placement是不是2段式的,是则处理一下偏移。 修改data.offsets.popper的值
154
+ shift(t) {
155
+ let o = t.placement, e = o.split("-")[0], s = o.split("-")[1];
156
+ if (s) {
157
+ let { top: r, left: p, height: l, width: n } = t.offsets.reference, c = a(t.offsets.popper), h = {
158
+ y: {
159
+ start: { top: r },
160
+ end: { top: r + l - c.height }
161
+ },
162
+ x: {
163
+ start: { left: p },
164
+ end: { left: p + n - c.width }
165
+ }
166
+ }, u = ~["bottom", "top"].indexOf(e) ? "x" : "y";
167
+ t.offsets.popper = Object.assign(c, h[u][s]);
168
+ }
169
+ return t;
170
+ }
171
+ // 校正popper的位置在boundaries 的内部
172
+ preventOverflow(t) {
173
+ if (this._options.ignoreBoundaries)
174
+ return t;
175
+ let o = this._options.preventOverflowOrder, e = a(t.offsets.popper), s = {
176
+ top: () => {
177
+ let { top: r } = e;
178
+ return r < t.boundaries.top && (r = Math.max(r, t.boundaries.top)), { top: r };
179
+ },
180
+ right: () => {
181
+ let { left: r } = e;
182
+ return e.right > t.boundaries.right && (r = Math.min(r, t.boundaries.right - e.width)), { left: r };
183
+ },
184
+ bottom: () => {
185
+ let { top: r } = e;
186
+ return e.bottom > t.boundaries.bottom && (r = Math.min(r, t.boundaries.bottom - e.height)), { top: r };
187
+ },
188
+ left: () => {
189
+ let { left: r } = e;
190
+ return e.left < t.boundaries.left && (r = Math.max(r, t.boundaries.left)), { left: r };
191
+ }
192
+ };
193
+ return o.forEach((r) => {
194
+ t.offsets.popper = Object.assign(e, s[r]());
195
+ }), t;
196
+ }
197
+ // 校正popper的位置在reference的边上。 如果2个分离了,重新调整popper的位置。 可能是担心 modifiers.offset 带来的副作用吧
198
+ keepTogether(t) {
199
+ let o = a(t.offsets.popper), e = t.offsets.reference;
200
+ return o.right < Math.floor(e.left) && (t.offsets.popper.left = Math.floor(e.left) - o.width), o.left > Math.floor(e.right) && (t.offsets.popper.left = Math.floor(e.right)), o.bottom < Math.floor(e.top) && (t.offsets.popper.top = Math.floor(e.top) - o.height), o.top > Math.floor(e.bottom) && (t.offsets.popper.top = Math.floor(e.bottom)), t;
201
+ }
202
+ // 根据flip的策略,计算当前应该显示的位置。 空间不够要计算出flip的位置。 可能是担心preventOverflow 时,造成pop, reference会重叠。 重叠了就要flip一下
203
+ flip(t) {
204
+ if (t.flipped && t.placement === t._originalPlacement)
205
+ return t;
206
+ const o = t.placement.split("-");
207
+ let e = o[0], s = M(e), r = o[1] || "", p = [e, s];
208
+ return p.forEach((l, n) => {
209
+ if (e !== l || p.length === n + 1)
210
+ return;
211
+ e = t.placement.split("-")[0], s = M(e);
212
+ let c = a(t.offsets.popper), h = ~["right", "bottom"].indexOf(e), u = Math.floor(t.offsets.reference[e]), f = Math.floor(c[s]);
213
+ (h && u > f || !h && u < f) && (t.flipped = !0, t.placement = p[n + 1], r && (t.placement += `-${r}`), t.offsets.popper = this._getRefPopOffsets(this._popper, this._reference, t.placement).popper, t = this.runModifiers(t, this._options.modifierFns, this.flip));
214
+ }), t;
215
+ }
216
+ // 根据入参option上的offset, 给data.offset.popper进行校正
217
+ offset(t) {
218
+ let o = this._options.offset, e = t.offsets.popper;
219
+ return ~t.placement.indexOf("left") ? e.top -= o : ~t.placement.indexOf("right") ? e.top += o : ~t.placement.indexOf("top") ? e.left -= o : ~t.placement.indexOf("bottom") && (e.left += o), t;
220
+ }
221
+ // 计算arrow的位置,保存在data.offsets.arrow ={top,left}
222
+ arrow(t) {
223
+ let o = this._options.arrowElement, e = this._options.arrowOffset;
224
+ if (typeof o == "string" && (o = this._popper.querySelector(o)), !o || !this._popper.contains(o))
225
+ return t;
226
+ let s = {}, r = t.placement.split("-")[0], p = a(t.offsets.popper), l = t.offsets.reference, n = ~["left", "right"].indexOf(r), c = n ? "height" : "width", h = n ? "bottom" : "right", u = n ? "left" : "top", f = n ? "top" : "left", W = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = P(this._popper), T = P(o), d = T[c];
227
+ l[h] - d < p[f] && (t.offsets.popper[f] -= p[f] - (l[h] - d)), l[f] + d > p[h] && (t.offsets.popper[f] += l[f] + d - p[h]);
228
+ let _ = l[f] + (e || l[c] / 2 - d / 2) - p[f];
229
+ _ = Math.max(Math.min(p[c] - d - 8, _), 8), s[f] = _, s[u] = "";
230
+ const y = this._options.placement.split("-");
231
+ return this._options.adjustArrow && ~["top", "bottom"].indexOf(y[0]) && f === "left" && (y[1] === "start" ? s.left = 8 : y[1] || (s.left = (W.width - T.width) / 2)), t.offsets.arrow = s, t.arrowElement = o, t;
232
+ }
233
+ /** 判断 reference 的 offsetParent 元素是fix还是abs, 这个值会赋值给popper 的dom */
234
+ _getPopperPositionByRefernce(t) {
235
+ return this._options.forceAbsolute ? "absolute" : A(t) ? "fixed" : "absolute";
236
+ }
237
+ /** 实时计算一下popper, reference的 位置信息, 用于 */
238
+ _getRefPopOffsets(t, o, e) {
239
+ e = e.split("-")[0];
240
+ let s = { position: this.state.position }, r = s.position === "fixed", p = D(
241
+ o,
242
+ x(t),
243
+ r,
244
+ t
245
+ );
246
+ const { width: l, height: n } = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = P(t);
247
+ return ~["right", "left"].indexOf(e) ? (s.top = p.top + p.height / 2 - n / 2, e === "left" ? s.left = p.left - l : s.left = p.right) : (s.left = p.left + p.width / 2 - l / 2, e === "top" ? s.top = p.top - n : s.top = p.bottom), s.width = l, s.height = n, {
248
+ popper: s,
249
+ reference: p
250
+ };
251
+ }
252
+ _setupEventListeners() {
253
+ var t, o;
254
+ if (this.state.updateBoundFn = this.update.bind(this), this.state.scrollUpdate = () => {
255
+ if (this._options.updateHiddenPopperOnScroll)
256
+ this.state.updateBoundFn();
257
+ else {
258
+ if (j(this._reference))
259
+ return;
260
+ this.state.updateBoundFn();
261
+ }
262
+ }, g(window, "resize", this.state.updateBoundFn), this._options.boundariesElement !== "window") {
263
+ let e = this._options.scrollParent || b(this._reference);
264
+ const s = [];
265
+ if ((o = (t = e == null ? void 0 : e.dataset) == null ? void 0 : t.tag) != null && o.includes("-form")) {
266
+ s.push(e);
267
+ let r = b(e);
268
+ (r === window.document.body || r === window.document.documentElement) && (r = window), s.push(r);
269
+ }
270
+ if ((e === window.document.body || e === window.document.documentElement) && (e = window), this.state.scrollTarget = e, this._options.bubbling || v.globalScroll) {
271
+ let r = H(this._reference);
272
+ this.state.scrollTargets = r || [], r.forEach((p) => {
273
+ g(p, "scroll", this.state.scrollUpdate);
274
+ });
275
+ } else
276
+ s.length ? (this.state.scrollTargets = s, s.forEach((r) => {
277
+ g(r, "scroll", this.state.scrollUpdate);
278
+ })) : g(e, "scroll", this.state.scrollUpdate);
279
+ }
280
+ }
281
+ _removeEventListeners() {
282
+ O(window, "resize", this.state.updateBoundFn), this._options.boundariesElement !== "window" && this.state.scrollTarget && (O(this.state.scrollTarget, "scroll", this.state.scrollUpdate), this.state.scrollTarget = null, (this._options.bubbling || v.globalScroll) && ((this.state.scrollTargets || []).forEach((o) => {
283
+ O(o, "scroll", this.state.scrollUpdate);
284
+ }), this.state.scrollTargets = null)), this.state.updateBoundFn = null, this.state.scrollUpdate = null;
285
+ }
286
+ /** 实时计算一下Boundary的位置 */
287
+ _getBoundaries(t, o, e) {
288
+ let s = { right: 0, left: 0, top: 0, bottom: 0 };
289
+ if (e === "window" || e === "body") {
290
+ let r = window.document.body, p = window.document.documentElement, { width: l, height: n } = I(r, p);
291
+ s = { top: 0, right: l, bottom: n, left: 0 };
292
+ } else if (e === "viewport") {
293
+ let r = x(this._popper), p = b(this._popper), l = F(r);
294
+ const c = t.offsets.popper.position === "fixed" || !this._options.appendToBody && ["right", "left"].includes(this._options.placement);
295
+ let h = c ? 0 : $(p), u = c ? 0 : q(p);
296
+ const f = v.viewportWindow || window;
297
+ s = {
298
+ top: 0 - (l.top - h),
299
+ right: f.document.documentElement.clientWidth - (l.left - u),
300
+ bottom: f.document.documentElement.clientHeight - (l.top - h),
301
+ left: 0 - (l.left - u)
302
+ };
303
+ } else if (x(this._popper) === e) {
304
+ const { clientWidth: r, clientHeight: p } = e;
305
+ s = {
306
+ right: r,
307
+ bottom: p,
308
+ top: 0,
309
+ left: 0
310
+ };
311
+ } else
312
+ s = F(e);
313
+ return s.right -= o, s.left += o, s.bottom = s.bottom - o, s.top = s.top + o, s;
314
+ }
315
+ }
316
+ var tt = G;
317
+ export {
318
+ tt as default,
319
+ b as getScrollParent
320
+ };
@@ -0,0 +1,118 @@
1
+ import { KEY_CODE as y } from "../index.js";
2
+ import { removeClass as c, addClass as p, on as g } from "./dom.js";
3
+ const u = typeof window > "u", m = {}, s = {
4
+ leave: "v-modal-leave",
5
+ enter: "v-modal-enter",
6
+ modal: "v-modal"
7
+ }, k = (e, o) => {
8
+ for (let t = e.length - 1; t >= 0; t--)
9
+ if (e[t].id === o) {
10
+ e.splice(t, 1);
11
+ break;
12
+ }
13
+ };
14
+ let h;
15
+ const n = {
16
+ step: 2,
17
+ zIndex: 2e3,
18
+ globalScroll: !1,
19
+ // 是否打开全局滚动监听
20
+ modalFade: !0,
21
+ modalStack: [],
22
+ modalDom: null,
23
+ // 当前model挂载的div.
24
+ hasModal: !1,
25
+ // 当前是否有Modal
26
+ popLockClass: "popup-parent--hidden",
27
+ oldBodyBorder: "",
28
+ viewportWindow: null,
29
+ fixBodyBorder() {
30
+ const e = window.innerWidth - document.documentElement.clientWidth;
31
+ e && (this.oldBodyBorder = document.documentElement.style.borderRight, document.body.style.borderRight = `${e}px solid transparent`);
32
+ },
33
+ resetBodyBorder() {
34
+ document.body.style.borderRight = this.oldBodyBorder, this.oldBodyBorder = "";
35
+ },
36
+ /** 全局反注册 */
37
+ deregister: (e) => {
38
+ e && (m[e] = null, delete m[e]);
39
+ },
40
+ /** 返回全局实例 */
41
+ getInstance: (e) => m[e],
42
+ /** 全局注册 仅vue-popup.ts中使用,instance就是vm, 把vm注册到 vm._popupId 这个键值上 */
43
+ register: (e, o) => {
44
+ e && o && (m[e] = o);
45
+ },
46
+ nextZIndex: () => {
47
+ const e = n.zIndex;
48
+ return n.zIndex += n.step, e;
49
+ },
50
+ /** 打开遮罩层, 仅vue-popup.ts中使用。 dom = vm.$el 或者 undefined (appendtoBody时) */
51
+ openModal(e, o, t, l, r) {
52
+ if (u || !e || o === void 0)
53
+ return;
54
+ this.modalFade = r;
55
+ for (let i = 0, f = this.modalStack.length; i < f; i++)
56
+ if (this.modalStack[i].id === e)
57
+ return;
58
+ const d = h();
59
+ p(d, s.modal), this.modalFade && !n.hasModal && p(d, s.enter), l && l.trim().split(/\s+/).forEach((f) => p(d, f)), setTimeout(() => {
60
+ c(d, s.enter);
61
+ }, 200), o && (d.style.zIndex = o.toString()), d.style.display = "", d.tabIndex = 0;
62
+ let a;
63
+ t && t.parentNode && t.parentNode.nodeType !== 11 ? a = t.parentNode : a = document.body, a.appendChild(d), this.modalStack.push({ id: e, zIndex: o, modalClass: l });
64
+ },
65
+ /** 点击背景遮罩层时,调用栈顶的popup,调用它的close() */
66
+ doOnModalClick: () => {
67
+ const e = n.modalStack, o = e[e.length - 1];
68
+ if (!o)
69
+ return;
70
+ const t = n.getInstance(o.id);
71
+ t && t.closeOnClickModal && typeof t.close == "function" && t.close();
72
+ },
73
+ closeModal(e) {
74
+ const o = this.modalStack, t = h();
75
+ if (o.length > 0) {
76
+ const l = o[o.length - 1];
77
+ if (l.id === e) {
78
+ l.modalClass && l.modalClass.trim().split(/\s+/).forEach((a) => c(t, a)), o.pop();
79
+ const r = o.length;
80
+ r > 0 && (t.style.zIndex = o[r - 1].zIndex.toString());
81
+ } else
82
+ k(o, e);
83
+ }
84
+ o.length === 0 && (this.modalFade && p(t, s.leave), c(document.body, this.popLockClass), this.resetBodyBorder(), setTimeout(() => {
85
+ o.length === 0 && (t.parentNode && t.parentNode.removeChild(t), t.style.display = "none", n.modalDom = null), c(t, s.leave);
86
+ }, 200));
87
+ }
88
+ };
89
+ h = () => {
90
+ if (u)
91
+ return null;
92
+ let e = n.modalDom;
93
+ return e ? n.hasModal = !0 : (n.hasModal = !1, e = document.createElement("div"), n.modalDom = e, e.addEventListener(
94
+ "touchmove",
95
+ (o) => {
96
+ o.preventDefault(), o.stopPropagation();
97
+ },
98
+ { passive: !0 }
99
+ ), g(e, "click", () => {
100
+ n.doOnModalClick();
101
+ })), e;
102
+ };
103
+ u || g(window, "keydown", (e) => {
104
+ if (e.keyCode === y.Escape) {
105
+ const o = n.modalStack;
106
+ if (o.length > 0) {
107
+ const t = o[o.length - 1];
108
+ if (!t)
109
+ return;
110
+ const l = n.getInstance(t.id);
111
+ l && l.closeOnPressEscape && (l.handleClose ? l.handleClose("esc") : l.handleAction ? l.handleAction("cancel") : l.close());
112
+ }
113
+ }
114
+ });
115
+ var C = n;
116
+ export {
117
+ C as default
118
+ };
@@ -0,0 +1,23 @@
1
+ function v(i, e, n, f) {
2
+ let t, o = 0;
3
+ typeof e != "boolean" && (f = n, n = e, e = void 0);
4
+ function s() {
5
+ const r = this, c = (/* @__PURE__ */ new Date()).valueOf() - o, p = arguments;
6
+ function u() {
7
+ o = (/* @__PURE__ */ new Date()).valueOf(), n.apply(r, p);
8
+ }
9
+ function m() {
10
+ t = void 0;
11
+ }
12
+ f && !t && u(), t && clearTimeout(t);
13
+ const a = f === void 0;
14
+ a && c > i ? u() : e !== !0 && (t = setTimeout(f ? m : u, a ? i - c : i));
15
+ }
16
+ function l() {
17
+ t && (clearTimeout(t), t = null);
18
+ }
19
+ return s._cancel = l, s;
20
+ }
21
+ export {
22
+ v as default
23
+ };
@@ -0,0 +1,9 @@
1
+ const r = ({ onMounted: n, onActivated: d, nextTick: o }) => (t) => {
2
+ let e;
3
+ n(() => {
4
+ t(), o(() => e = !0);
5
+ }), d(() => e && t());
6
+ };
7
+ export {
8
+ r as onMountedOrActivated
9
+ };
@@ -0,0 +1,14 @@
1
+ const n = ({ getCurrentInstance: o, isVue2: t, nextTick: s, onUnmounted: l }) => () => {
2
+ const e = o().proxy;
3
+ t || Object.defineProperty(e, "$scopedSlots", { configurable: !0, value: null }), Object.defineProperty(e, "instanceSlots", {
4
+ configurable: !0,
5
+ get: () => e.$scopedSlots || e.$slots
6
+ }), l(() => {
7
+ s(() => {
8
+ t || delete e.$scopedSlots, delete e.instanceSlots;
9
+ });
10
+ });
11
+ };
12
+ export {
13
+ n as useInstanceSlots
14
+ };
@@ -0,0 +1,54 @@
1
+ import { noop as y } from "../function.js";
2
+ import { onMountedOrActivated as C } from "./useEventListener.js";
3
+ const V = ({
4
+ computed: l,
5
+ getCurrentInstance: i,
6
+ inject: c,
7
+ markRaw: a,
8
+ nextTick: f,
9
+ onMounted: v,
10
+ onActivated: E,
11
+ onUnmounted: h,
12
+ provide: M,
13
+ reactive: m,
14
+ toRef: k
15
+ }) => ({ relationKey: p, relationContainer: x, onChange: P, childrenKey: r, delivery: b } = {}) => {
16
+ if (!p)
17
+ throw new Error("[TINY Error]<relationKey> must exist.");
18
+ const u = i(), e = m({ children: [], indexInParent: -1 }), j = c(p, null);
19
+ let o = [];
20
+ if (j) {
21
+ const { link: t, unlink: n, callbacks: s, childrenKey: d, delivery: O } = j;
22
+ o = s, r = r || d || "instanceChildren", b = O, e.indexInParent = t(u), h(() => n(u));
23
+ } else {
24
+ r = r || "instanceChildren";
25
+ const t = C({ onMounted: v, onActivated: E, nextTick: f }), n = P ? () => f(P) : y;
26
+ let s;
27
+ f(() => {
28
+ const d = typeof x == "function" ? x() : x;
29
+ d && (s = new MutationObserver((O, $) => {
30
+ const I = [];
31
+ g(d.childNodes, I), o.forEach((A) => A(I, O, $)), n();
32
+ }), s.observe(d, { attributes: !0, childList: !0, subtree: !0 }));
33
+ }), t(() => n()), h(() => {
34
+ s && (s.disconnect(), s = null), o = null;
35
+ });
36
+ }
37
+ const w = (t) => {
38
+ const n = t.proxy;
39
+ return e.children.push(a(n)), l(() => e.children.indexOf(n));
40
+ }, N = (t) => {
41
+ const n = e.children.indexOf(t.proxy);
42
+ n > -1 && e.children.splice(n, 1);
43
+ };
44
+ return o.push((t) => D(e.children, t)), M(p, { link: w, unlink: N, callbacks: o, childrenKey: r, delivery: b }), Object.defineProperty(u.proxy, r, { configurable: !0, get: () => e.children }), h(() => delete u.proxy[r]), { children: k(e, "children"), index: k(e, "indexInParent"), delivery: b };
45
+ }, g = (l, i) => {
46
+ l.length && l.forEach((c) => {
47
+ i.push(c), c.childNodes && g(c.childNodes, i);
48
+ });
49
+ }, D = (l, i) => {
50
+ l.sort((c, a) => i.indexOf(c.$el) - i.indexOf(a.$el));
51
+ };
52
+ export {
53
+ V as useRelation
54
+ };
@@ -0,0 +1,84 @@
1
+ import { __spreadValues as B } from "../../chunk-G2ADBYYC.js";
2
+ import b from "./popup-manager.js";
3
+ import I from "./popper.js";
4
+ import { off as $, isDisplayNone as N, on as T } from "./dom.js";
5
+ const x = (t) => t.stopPropagation(), R = typeof window > "u", E = ({ state: t, props: l, vm: n, slots: d }) => {
6
+ let a = t.referenceElm || l.reference || n.$refs.reference && n.$refs.reference.$el || n.$refs.reference;
7
+ return !a && d.reference && d.reference()[0] && (t.referenceElm = d.reference()[0].elm || d.reference()[0].el, a = t.referenceElm), a;
8
+ }, z = (t) => {
9
+ if (!t || !t.nodeType)
10
+ return;
11
+ let l = (a) => parseInt(window.getComputedStyle(a).zIndex, 10) || 0, n = l(t), d;
12
+ do {
13
+ if (t = t.parentNode, t && t instanceof ShadowRoot && t.host && (t = t.host), t)
14
+ d = l(t);
15
+ else
16
+ break;
17
+ n = d > n ? d : n;
18
+ } while (t !== document.body);
19
+ return n + 1 + "";
20
+ };
21
+ var V = (t) => {
22
+ const {
23
+ parent: l,
24
+ emit: n,
25
+ nextTick: d,
26
+ onBeforeUnmount: a,
27
+ onDeactivated: S,
28
+ props: p,
29
+ watch: h,
30
+ reactive: v,
31
+ vm: i,
32
+ slots: m,
33
+ toRefs: J,
34
+ popperVmRef: P
35
+ } = t, e = v({
36
+ popperJS: null,
37
+ appended: !1,
38
+ // arrow 是否添加
39
+ popperElm: null,
40
+ showPopper: p.manual ? !!p.modelValue : !1,
41
+ referenceElm: null,
42
+ currentPlacement: ""
43
+ }), g = (o) => {
44
+ if (e.appended)
45
+ return;
46
+ e.appended = !0;
47
+ const r = document.createElement("div");
48
+ r.setAttribute("x-arrow", ""), r.className = "popper__arrow", o.appendChild(r);
49
+ }, y = (o) => {
50
+ const { followReferenceHide: r = !0 } = (p == null ? void 0 : p.popperOptions) || {}, { _popper: f, _reference: s } = o;
51
+ r && N(s) && (f.style.display = "none");
52
+ }, w = (o) => p.zIndex === "relative" ? z(o) : b.nextZIndex(), A = (o) => {
53
+ if (R || (e.currentPlacement = e.currentPlacement || p.placement, !/^(top|bottom|left|right)(-start|-end)?$/g.test(e.currentPlacement)))
54
+ return;
55
+ const r = p.popperOptions || { gpuAcceleration: !1 };
56
+ e.popperElm = e.popperElm || p.popper || i.$refs.popper || P.popper || o;
57
+ const f = e.popperElm;
58
+ let s = E({ state: e, props: p, vm: i, slots: m });
59
+ !f || !s || s.nodeType !== Node.ELEMENT_NODE || (p.visibleArrow && g(f), p.appendToBody || p.popperAppendToBody ? document.body.appendChild(e.popperElm) : (l && l.$el && l.$el.appendChild(e.popperElm), r.forceAbsolute = !0), r.placement = e.currentPlacement, r.offset = p.offset || 0, r.arrowOffset = p.arrowOffset || 0, r.adjustArrow = p.adjustArrow || !1, r.appendToBody = p.appendToBody || p.popperAppendToBody, e.popperJS = new I(s, f, r), n("created", e), typeof r.onUpdate == "function" && e.popperJS.onUpdate(r.onUpdate), e.popperJS._popper.style.zIndex = w(e.popperJS._reference), y(e.popperJS), T(e.popperElm, "click", x));
60
+ }, _ = (o) => {
61
+ o && o !== !0 && (e.popperElm = o);
62
+ const r = e.popperJS;
63
+ r ? (r._reference = E({ state: e, props: p, vm: i, slots: m }), r.update(), r._popper && o !== !0 && (r._popper.style.zIndex = w(r._reference), y(e.popperJS))) : A(o && o !== !0 ? o : void 0);
64
+ }, c = (o) => {
65
+ !e.popperJS || e.showPopper && !o || (e.popperJS.destroy(), e.popperJS = null);
66
+ }, u = (o) => {
67
+ o && e.popperElm && e.popperElm.parentNode === document.body && ($(e.popperElm, "click", x), e.popperElm.remove());
68
+ };
69
+ return h(
70
+ () => e.showPopper,
71
+ (o) => {
72
+ p.disabled || (o && d(_), p.trigger === "manual" && n("update:modelValue", o));
73
+ }
74
+ ), a(() => {
75
+ d(() => {
76
+ c(!0), (p.appendToBody || p.popperAppendToBody) && u("remove");
77
+ });
78
+ }), S(() => {
79
+ c(!0), (p.appendToBody || p.popperAppendToBody) && u("remove");
80
+ }), B({ updatePopper: _, destroyPopper: u, doDestroy: c }, J(e));
81
+ };
82
+ export {
83
+ V as default
84
+ };