@opentiny/tiny-robot 0.4.2-alpha.3 → 0.4.2-alpha.5

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 (261) hide show
  1. package/dist/action-group/ActionGroup.vue.d.ts +26 -0
  2. package/dist/action-group/ActionGroupItem.vue.d.ts +18 -0
  3. package/dist/action-group/index.d.ts +12 -0
  4. package/dist/action-group/index.js +3 -3
  5. package/dist/action-group/index.type.d.ts +17 -0
  6. package/dist/anchor/components/AnchorItem.vue.d.ts +24 -0
  7. package/dist/anchor/components/AnchorList.vue.d.ts +20 -0
  8. package/dist/anchor/components/AnchorOverlay.vue.d.ts +33 -0
  9. package/dist/anchor/components/AnchorSearch.vue.d.ts +7 -0
  10. package/dist/anchor/composables/index.d.ts +5 -0
  11. package/dist/anchor/composables/useActiveSync.d.ts +10 -0
  12. package/dist/anchor/composables/useFloatingOffset.d.ts +6 -0
  13. package/dist/anchor/composables/useNavController.d.ts +12 -0
  14. package/dist/anchor/composables/useOverlayInteractions.d.ts +6 -0
  15. package/dist/anchor/composables/useTargetFeedback.d.ts +5 -0
  16. package/dist/anchor/defaults.d.ts +16 -0
  17. package/dist/anchor/index.d.ts +7 -0
  18. package/dist/anchor/index.js +44 -44
  19. package/dist/anchor/index.type.d.ts +60 -0
  20. package/dist/anchor/index.vue.d.ts +159 -0
  21. package/dist/anchor/internal.type.d.ts +103 -0
  22. package/dist/anchor/utils/scroll.d.ts +7 -0
  23. package/dist/anchor/utils/target.d.ts +6 -0
  24. package/dist/attachments/components/FileCard.vue.d.ts +18 -0
  25. package/dist/attachments/components/ImagePreview.vue.d.ts +17 -0
  26. package/dist/attachments/components/index.d.ts +2 -0
  27. package/dist/attachments/composables/index.d.ts +5 -0
  28. package/dist/attachments/composables/useFileCard.d.ts +15 -0
  29. package/dist/attachments/composables/useFileType.d.ts +20 -0
  30. package/dist/attachments/composables/useImagePreview.d.ts +18 -0
  31. package/dist/attachments/composables/useListType.d.ts +11 -0
  32. package/dist/attachments/index.d.ts +7 -0
  33. package/dist/attachments/index.js +96 -96
  34. package/dist/attachments/index.type.d.ts +70 -0
  35. package/dist/attachments/index.vue.d.ts +27 -0
  36. package/dist/attachments/utils.d.ts +3 -0
  37. package/dist/base-popper/components/Popper.vue.d.ts +28 -0
  38. package/dist/base-popper/index.d.ts +2 -0
  39. package/dist/base-popper/index.vue.d.ts +41 -0
  40. package/dist/bubble/Bubble.vue.d.ts +39 -0
  41. package/dist/bubble/BubbleBoxWrapper.vue.d.ts +22 -0
  42. package/dist/bubble/BubbleContentWrapper.vue.d.ts +16 -0
  43. package/dist/bubble/BubbleItem.vue.d.ts +36 -0
  44. package/dist/bubble/BubbleList.vue.d.ts +41 -0
  45. package/dist/bubble/BubbleProvider.vue.d.ts +18 -0
  46. package/dist/bubble/composables/index.d.ts +10 -0
  47. package/dist/bubble/composables/useBubbleBoxRenderer.d.ts +18 -0
  48. package/dist/bubble/composables/useBubbleContentRenderer.d.ts +18 -0
  49. package/dist/bubble/composables/useBubbleStateChange.d.ts +2 -0
  50. package/dist/bubble/composables/useBubbleStore.d.ts +16 -0
  51. package/dist/bubble/composables/useContentResolver.d.ts +5 -0
  52. package/dist/bubble/composables/useCopyCleanup.d.ts +6 -0
  53. package/dist/bubble/composables/useMessageContent.d.ts +5 -0
  54. package/dist/bubble/composables/useMessageGroup.d.ts +4 -0
  55. package/dist/bubble/composables/useOmitMessageFields.d.ts +12 -0
  56. package/dist/bubble/composables/useToolCall.d.ts +25 -0
  57. package/dist/bubble/constants.d.ts +42 -0
  58. package/dist/bubble/index.d.ts +19 -0
  59. package/dist/bubble/index.type.d.ts +171 -0
  60. package/dist/bubble/renderers/Box.vue.d.ts +18 -0
  61. package/dist/bubble/renderers/Image.vue.d.ts +4 -0
  62. package/dist/bubble/renderers/Loading.vue.d.ts +4 -0
  63. package/dist/bubble/renderers/Markdown.vue.d.ts +4 -0
  64. package/dist/bubble/renderers/Reasoning.vue.d.ts +9 -0
  65. package/dist/bubble/renderers/Text.vue.d.ts +4 -0
  66. package/dist/bubble/renderers/Tool.vue.d.ts +14 -0
  67. package/dist/bubble/renderers/ToolRole.vue.d.ts +4 -0
  68. package/dist/bubble/renderers/Tools.vue.d.ts +4 -0
  69. package/dist/bubble/renderers/allRenderers.d.ts +93 -0
  70. package/dist/bubble/renderers/defaultRenderers.d.ts +27 -0
  71. package/dist/bubble/utils.d.ts +7 -0
  72. package/dist/chat/components/ChatConversation.vue.d.ts +70 -0
  73. package/dist/chat/components/ChatLauncherButton.vue.d.ts +12 -0
  74. package/dist/chat/components/ChatMcpTrigger.vue.d.ts +30 -0
  75. package/dist/chat/components/ChatThemeToggleButton.vue.d.ts +2 -0
  76. package/dist/chat/components/ChatWelcome.vue.d.ts +13 -0
  77. package/dist/chat/composables/useChatConversation.d.ts +37 -0
  78. package/dist/chat/composables/useChatMcp.d.ts +29 -0
  79. package/dist/chat/composables/useChatModel.d.ts +27 -0
  80. package/dist/chat/index.d.ts +9 -0
  81. package/dist/chat/index.js +13701 -0
  82. package/dist/chat/index.type.d.ts +88 -0
  83. package/dist/chat/index.vue.d.ts +58 -0
  84. package/dist/container/index.d.ts +7 -0
  85. package/dist/container/index.js +13 -13
  86. package/dist/container/index.type.d.ts +20 -0
  87. package/dist/container/index.vue.d.ts +32 -0
  88. package/dist/conversations/index.d.ts +7 -0
  89. package/dist/conversations/index.vue.d.ts +2 -0
  90. package/dist/drag-overlay/constants.d.ts +17 -0
  91. package/dist/drag-overlay/directives/vDropzone.d.ts +14 -0
  92. package/dist/drag-overlay/index.d.ts +7 -0
  93. package/dist/drag-overlay/index.js +1 -1
  94. package/dist/drag-overlay/index.type.d.ts +105 -0
  95. package/dist/drag-overlay/index.vue.d.ts +20 -0
  96. package/dist/dropdown-menu/composables/usePopperHover.d.ts +6 -0
  97. package/dist/dropdown-menu/index.d.ts +7 -0
  98. package/dist/dropdown-menu/index.js +18 -18
  99. package/dist/dropdown-menu/index.type.d.ts +42 -0
  100. package/dist/dropdown-menu/index.vue.d.ts +217 -0
  101. package/dist/feedback/components/SourceList.vue.d.ts +11 -0
  102. package/dist/feedback/components/index.d.ts +1 -0
  103. package/dist/feedback/index.d.ts +7 -0
  104. package/dist/feedback/index.type.d.ts +25 -0
  105. package/dist/feedback/index.vue.d.ts +13 -0
  106. package/dist/flow-layout-buttons/index.d.ts +7 -0
  107. package/dist/flow-layout-buttons/index.js +1 -1
  108. package/dist/flow-layout-buttons/index.type.d.ts +35 -0
  109. package/dist/flow-layout-buttons/index.vue.d.ts +22 -0
  110. package/dist/history/components/Empty.vue.d.ts +7 -0
  111. package/dist/history/components/MenuList.vue.d.ts +24 -0
  112. package/dist/history/composables/useRenameEditor.d.ts +22 -0
  113. package/dist/history/constants.d.ts +1 -0
  114. package/dist/history/index.d.ts +7 -0
  115. package/dist/history/index.type.d.ts +33 -0
  116. package/dist/history/index.vue.d.ts +18 -0
  117. package/dist/icon-button/index.d.ts +7 -0
  118. package/dist/icon-button/index.type.d.ts +7 -0
  119. package/dist/icon-button/index.vue.d.ts +6 -0
  120. package/dist/index.d.ts +49 -4999
  121. package/dist/index.js +3 -3
  122. package/dist/index2.js +139 -121
  123. package/dist/index3.js +1 -1
  124. package/dist/index4.js +13 -13
  125. package/dist/index6.js +19 -19
  126. package/dist/index7.js +30 -30
  127. package/dist/index8.js +8 -8
  128. package/dist/mcp-add-form/components/CodeEditor.vue.d.ts +9 -0
  129. package/dist/mcp-add-form/components/FormEditor.vue.d.ts +10 -0
  130. package/dist/mcp-add-form/components/index.d.ts +2 -0
  131. package/dist/mcp-add-form/index.d.ts +7 -0
  132. package/dist/mcp-add-form/index.type.d.ts +19 -0
  133. package/dist/mcp-add-form/index.vue.d.ts +13 -0
  134. package/dist/mcp-server-picker/components/NoData.vue.d.ts +7 -0
  135. package/dist/mcp-server-picker/components/PluginCard.vue.d.ts +40 -0
  136. package/dist/mcp-server-picker/components/PluginModal.vue.d.ts +15 -0
  137. package/dist/mcp-server-picker/components/index.d.ts +3 -0
  138. package/dist/mcp-server-picker/index.d.ts +7 -0
  139. package/dist/mcp-server-picker/index.js +178 -177
  140. package/dist/mcp-server-picker/index.type.d.ts +99 -0
  141. package/dist/mcp-server-picker/index.vue.d.ts +71 -0
  142. package/dist/prompts/index.d.ts +12 -0
  143. package/dist/prompts/index.type.d.ts +59 -0
  144. package/dist/prompts/prompt.vue.d.ts +5 -0
  145. package/dist/prompts/prompts.vue.d.ts +20 -0
  146. package/dist/sender/components/editor-content/index.vue.d.ts +4 -0
  147. package/dist/sender/components/footer/index.vue.d.ts +38 -0
  148. package/dist/sender/components/layouts/MultiLineLayout.vue.d.ts +43 -0
  149. package/dist/sender/components/layouts/SingleLineLayout.vue.d.ts +32 -0
  150. package/dist/sender/composables/index.d.ts +7 -0
  151. package/dist/sender/composables/useAutoSize.d.ts +5 -0
  152. package/dist/sender/composables/useEditor.d.ts +13 -0
  153. package/dist/sender/composables/useKeyboardShortcuts.d.ts +7 -0
  154. package/dist/sender/composables/useModeSwitch.d.ts +4 -0
  155. package/dist/sender/composables/useSenderCore.d.ts +31 -0
  156. package/dist/sender/composables/useSlotScope.d.ts +10 -0
  157. package/dist/sender/context/index.d.ts +6 -0
  158. package/dist/sender/context/types.d.ts +7 -0
  159. package/dist/sender/extensions/constants.d.ts +94 -0
  160. package/dist/sender/extensions/index.d.ts +12 -0
  161. package/dist/sender/extensions/mention/commands.d.ts +20 -0
  162. package/dist/sender/extensions/mention/components/mention-list.vue.d.ts +18 -0
  163. package/dist/sender/extensions/mention/components/mention-view.vue.d.ts +19 -0
  164. package/dist/sender/extensions/mention/extension.d.ts +6 -0
  165. package/dist/sender/extensions/mention/index.d.ts +22 -0
  166. package/dist/sender/extensions/mention/plugin.d.ts +16 -0
  167. package/dist/sender/extensions/mention/types.d.ts +126 -0
  168. package/dist/sender/extensions/mention/utils.d.ts +34 -0
  169. package/dist/sender/extensions/suggestion/extension.d.ts +8 -0
  170. package/dist/sender/extensions/suggestion/index.d.ts +20 -0
  171. package/dist/sender/extensions/suggestion/plugin.d.ts +21 -0
  172. package/dist/sender/extensions/suggestion/suggestion-list.vue.d.ts +46 -0
  173. package/dist/sender/extensions/suggestion/types.d.ts +254 -0
  174. package/dist/sender/extensions/suggestion/utils/filter.d.ts +29 -0
  175. package/dist/sender/extensions/suggestion/utils/highlight.d.ts +73 -0
  176. package/dist/sender/extensions/template/block/extension.d.ts +6 -0
  177. package/dist/sender/extensions/template/block/plugins.d.ts +13 -0
  178. package/dist/sender/extensions/template/block/template-block-view.vue.d.ts +14 -0
  179. package/dist/sender/extensions/template/commands.d.ts +31 -0
  180. package/dist/sender/extensions/template/extension.d.ts +6 -0
  181. package/dist/sender/extensions/template/index.d.ts +21 -0
  182. package/dist/sender/extensions/template/select/dropdown-manager.d.ts +23 -0
  183. package/dist/sender/extensions/template/select/extension.d.ts +5 -0
  184. package/dist/sender/extensions/template/select/plugins.d.ts +34 -0
  185. package/dist/sender/extensions/template/select/template-select-view.vue.d.ts +20 -0
  186. package/dist/sender/extensions/template/types.d.ts +100 -0
  187. package/dist/sender/extensions/template/utils.d.ts +20 -0
  188. package/dist/sender/extensions/utils/id-generator.d.ts +16 -0
  189. package/dist/sender/extensions/utils/index.d.ts +7 -0
  190. package/dist/sender/extensions/utils/keyboard.d.ts +49 -0
  191. package/dist/sender/extensions/utils/position.d.ts +25 -0
  192. package/dist/sender/index.d.ts +136 -0
  193. package/dist/sender/index.js +178 -164
  194. package/dist/sender/index.type.d.ts +302 -0
  195. package/dist/sender/index.vue.d.ts +90 -0
  196. package/dist/sender/types/base.d.ts +239 -0
  197. package/dist/sender/types/components.d.ts +68 -0
  198. package/dist/sender/types/composables.d.ts +122 -0
  199. package/dist/sender/types/context.d.ts +132 -0
  200. package/dist/sender/types/slots.d.ts +67 -0
  201. package/dist/sender/utils/countGraphemes.d.ts +1 -0
  202. package/dist/sender-actions/action-button/index.vue.d.ts +23 -0
  203. package/dist/sender-actions/clear-button/index.vue.d.ts +2 -0
  204. package/dist/sender-actions/clear-button/useClearButtonState.d.ts +6 -0
  205. package/dist/sender-actions/default-actions/index.vue.d.ts +17 -0
  206. package/dist/sender-actions/index.d.ts +21 -0
  207. package/dist/sender-actions/index.js +1 -1
  208. package/dist/sender-actions/index.type.d.ts +7 -0
  209. package/dist/sender-actions/submit-button/index.vue.d.ts +2 -0
  210. package/dist/sender-actions/types/common.d.ts +40 -0
  211. package/dist/sender-actions/types/index.d.ts +5 -0
  212. package/dist/sender-actions/types/tooltip.d.ts +7 -0
  213. package/dist/sender-actions/upload-button/index.type.d.ts +57 -0
  214. package/dist/sender-actions/upload-button/index.vue.d.ts +16 -0
  215. package/dist/sender-actions/utils/tooltip.d.ts +8 -0
  216. package/dist/sender-actions/voice-button/index.type.d.ts +78 -0
  217. package/dist/sender-actions/voice-button/index.vue.d.ts +43 -0
  218. package/dist/sender-actions/voice-button/speech.types.d.ts +40 -0
  219. package/dist/sender-actions/voice-button/useSpeechHandler.d.ts +10 -0
  220. package/dist/sender-actions/voice-button/webSpeechHandler.d.ts +40 -0
  221. package/dist/sender-actions/word-counter/index.vue.d.ts +2 -0
  222. package/dist/sender-compat/index.d.ts +7 -0
  223. package/dist/sender-compat/index.type.d.ts +91 -0
  224. package/dist/sender-compat/index.vue.d.ts +532 -0
  225. package/dist/shared/composables/createTeleport.d.ts +2 -0
  226. package/dist/shared/composables/index.d.ts +5 -0
  227. package/dist/shared/composables/useAutoScroll.d.ts +25 -0
  228. package/dist/shared/composables/useSlotRefs.d.ts +12 -0
  229. package/dist/shared/composables/useTeleportTarget.d.ts +11 -0
  230. package/dist/shared/composables/useTouchDevice.d.ts +3 -0
  231. package/dist/shared/utils.d.ts +7 -0
  232. package/dist/style.css +1 -1
  233. package/dist/suggestion-pills/components/PillButton.vue.d.ts +16 -0
  234. package/dist/suggestion-pills/components/index.d.ts +1 -0
  235. package/dist/suggestion-pills/index.d.ts +13 -0
  236. package/dist/suggestion-pills/index.js +13 -13
  237. package/dist/suggestion-pills/index.type.d.ts +45 -0
  238. package/dist/suggestion-pills/index.vue.d.ts +44 -0
  239. package/dist/suggestion-popover/components/Backdrop.vue.d.ts +5 -0
  240. package/dist/suggestion-popover/components/Header.vue.d.ts +4 -0
  241. package/dist/suggestion-popover/components/Loading.vue.d.ts +17 -0
  242. package/dist/suggestion-popover/components/NoData.vue.d.ts +17 -0
  243. package/dist/suggestion-popover/components/Tooltip.vue.d.ts +19 -0
  244. package/dist/suggestion-popover/index.d.ts +7 -0
  245. package/dist/suggestion-popover/index.js +122 -125
  246. package/dist/suggestion-popover/index.type.d.ts +80 -0
  247. package/dist/suggestion-popover/index.vue.d.ts +262 -0
  248. package/dist/theme-provider/constants.d.ts +6 -0
  249. package/dist/theme-provider/index.d.ts +9 -0
  250. package/dist/theme-provider/index.js +32 -41
  251. package/dist/theme-provider/index.type.d.ts +18 -0
  252. package/dist/theme-provider/index.vue.d.ts +32 -0
  253. package/dist/theme-provider/useTheme.d.ts +11 -0
  254. package/dist/useSlotRefs.js +1 -1
  255. package/dist/useTheme.js +22 -0
  256. package/dist/utils.js +1 -1
  257. package/dist/welcome/index.d.ts +7 -0
  258. package/dist/welcome/index.type.d.ts +10 -0
  259. package/dist/welcome/index.vue.d.ts +18 -0
  260. package/package.json +22 -3
  261. package/dist/no-data.js +0 -4
@@ -1,24 +1,24 @@
1
- import { computed as k, ref as L, onUnmounted as re, defineComponent as z, useModel as se, openBlock as o, createElementBlock as u, withModifiers as R, createElementVNode as v, createVNode as F, unref as m, Fragment as O, renderList as N, normalizeClass as T, mergeModels as W, h as ie, createCommentVNode as C, toDisplayString as U, createBlock as M, withCtx as oe, resolveDynamicComponent as Y, watch as le } from "vue";
2
- import { IconFileOther as ce, IconFileFolder as Z, IconFilePpt as G, IconFileExcel as J, IconFileWord as Q, IconFilePdf as X, IconFileImage as ee, IconClose as de, IconArrowLeft as ue, IconArrowRight as fe, IconFileRemove as me, IconImageLoading as j, IconImageWarning as q } from "@opentiny/tiny-robot-svgs";
1
+ import { computed as k, ref as L, onUnmounted as ae, defineComponent as z, useModel as se, openBlock as o, createElementBlock as u, withModifiers as R, createElementVNode as v, createVNode as F, unref as m, Fragment as O, renderList as N, normalizeClass as T, mergeModels as j, h as ie, createCommentVNode as C, toDisplayString as U, createBlock as M, withCtx as oe, resolveDynamicComponent as Y, watch as le } from "vue";
2
+ import { IconFileOther as ce, IconFileFolder as Z, IconFilePpt as G, IconFileExcel as J, IconFileWord as Q, IconFilePdf as X, IconFileImage as ee, IconClose as de, IconArrowLeft as ue, IconArrowRight as fe, IconFileRemove as me, IconUploadLoading as W, IconError as q } from "@opentiny/tiny-robot-svgs";
3
3
  import { _ as V } from "../_plugin-vue_export-helper.js";
4
4
  import { TinyTooltip as pe } from "@opentiny/vue";
5
- const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\//, S = (e) => {
5
+ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\//, E = (e) => {
6
6
  try {
7
7
  return decodeURIComponent(e);
8
8
  } catch {
9
9
  return e;
10
10
  }
11
- }, P = (e, a, n = !1) => {
12
- if (!a) return;
13
- const r = (n ? S(a) : a).trim();
14
- r && !e.includes(r) && e.push(r);
11
+ }, P = (e, r, n = !1) => {
12
+ if (!r) return;
13
+ const a = (n ? E(r) : r).trim();
14
+ a && !e.includes(a) && e.push(a);
15
15
  }, ne = (e) => {
16
- const a = e.trim();
17
- if (!a)
16
+ const r = e.trim();
17
+ if (!r)
18
18
  return null;
19
19
  try {
20
- if (ve.test(a) || H.test(a)) {
21
- const s = new URL(H.test(a) ? `https:${a}` : a);
20
+ if (ve.test(r) || H.test(r)) {
21
+ const s = new URL(H.test(r) ? `https:${r}` : r);
22
22
  return {
23
23
  pathname: s.pathname,
24
24
  searchParams: s.searchParams
@@ -27,43 +27,43 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
27
27
  } catch {
28
28
  return null;
29
29
  }
30
- const [n = ""] = a.split("#"), r = n.indexOf("?");
30
+ const [n = ""] = r.split("#"), a = n.indexOf("?");
31
31
  return {
32
- pathname: r === -1 ? n : n.slice(0, r),
33
- searchParams: new URLSearchParams(r === -1 ? "" : n.slice(r + 1))
32
+ pathname: a === -1 ? n : n.slice(0, a),
33
+ searchParams: new URLSearchParams(a === -1 ? "" : n.slice(a + 1))
34
34
  };
35
- }, E = (e) => {
35
+ }, S = (e) => {
36
36
  const n = e.split("/").filter(Boolean).at(-1) || "";
37
- return S(n);
37
+ return E(n);
38
38
  }, _e = (e) => {
39
- const a = [], n = e.trim();
39
+ const r = [], n = e.trim();
40
40
  if (!n)
41
- return a;
42
- P(a, n);
43
- const r = ne(n);
44
- if (r)
41
+ return r;
42
+ P(r, n);
43
+ const a = ne(n);
44
+ if (a)
45
45
  return te.forEach((p) => {
46
- P(a, r.searchParams.get(p), !0);
47
- }), P(a, r.pathname, !0), P(a, E(r.pathname)), a;
46
+ P(r, a.searchParams.get(p), !0);
47
+ }), P(r, a.pathname, !0), P(r, S(a.pathname)), r;
48
48
  const s = n.split("#")[0].split("?")[0];
49
- return P(a, s), P(a, E(s)), a;
49
+ return P(r, s), P(r, S(s)), r;
50
50
  }, he = (e) => {
51
- const a = ne(e);
52
- if (a) {
51
+ const r = ne(e);
52
+ if (r) {
53
53
  for (const p of te) {
54
- const _ = a.searchParams.get(p);
54
+ const _ = r.searchParams.get(p);
55
55
  if (_ != null && _.trim())
56
- return S(_.trim());
56
+ return E(_.trim());
57
57
  }
58
- const r = E(a.pathname);
59
- if (r)
60
- return r;
61
- const s = S(a.pathname).replace(/^\/+/, "").trim();
58
+ const a = S(r.pathname);
59
+ if (a)
60
+ return a;
61
+ const s = E(r.pathname).replace(/^\/+/, "").trim();
62
62
  if (s)
63
63
  return s;
64
64
  }
65
65
  const n = e.trim().split("#")[0].split("?")[0];
66
- return E(n) || n;
66
+ return S(n) || n;
67
67
  }, B = {
68
68
  image: ee,
69
69
  pdf: X,
@@ -76,11 +76,11 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
76
76
  {
77
77
  type: "image",
78
78
  matcher: (e) => {
79
- var n, r;
79
+ var n, a;
80
80
  if (typeof e != "string")
81
81
  return ((n = e.type) == null ? void 0 : n.startsWith("image/")) || !1;
82
- const a = ((r = e.split(".").pop()) == null ? void 0 : r.toLowerCase()) || "";
83
- return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(a);
82
+ const r = ((a = e.split(".").pop()) == null ? void 0 : a.toLowerCase()) || "";
83
+ return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(r);
84
84
  },
85
85
  icon: ee
86
86
  },
@@ -95,8 +95,8 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
95
95
  var n;
96
96
  if (typeof e != "string")
97
97
  return e.type === "application/msword" || e.type === "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
98
- const a = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
99
- return ["doc", "docx"].includes(a);
98
+ const r = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
99
+ return ["doc", "docx"].includes(r);
100
100
  },
101
101
  icon: Q
102
102
  },
@@ -106,8 +106,8 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
106
106
  var n;
107
107
  if (typeof e != "string")
108
108
  return e.type === "application/vnd.ms-excel" || e.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
109
- const a = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
110
- return ["xls", "xlsx"].includes(a);
109
+ const r = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
110
+ return ["xls", "xlsx"].includes(r);
111
111
  },
112
112
  icon: J
113
113
  },
@@ -117,8 +117,8 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
117
117
  var n;
118
118
  if (typeof e != "string")
119
119
  return e.type === "application/vnd.ms-powerpoint" || e.type === "application/vnd.openxmlformats-officedocument.presentationml.presentation";
120
- const a = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
121
- return ["ppt", "pptx"].includes(a);
120
+ const r = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
121
+ return ["ppt", "pptx"].includes(r);
122
122
  },
123
123
  icon: G
124
124
  },
@@ -128,17 +128,17 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
128
128
  icon: Z
129
129
  }
130
130
  ];
131
- function ae(e = {}) {
132
- const { customIcons: a, fileMatchers: n } = e, r = () => {
131
+ function re(e = {}) {
132
+ const { customIcons: r, fileMatchers: n } = e, a = () => {
133
133
  let t = [];
134
134
  return n ? t = n.concat(K) : t = K, t;
135
135
  }, s = (t = "other") => k(() => {
136
- if (a != null && a[t])
137
- return a[t];
138
- const l = r().find((f) => f.type === t);
136
+ if (r != null && r[t])
137
+ return r[t];
138
+ const l = a().find((f) => f.type === t);
139
139
  return l != null && l.icon ? l.icon : B[t] ? B[t] : B.other;
140
140
  }), p = (t) => {
141
- const i = r(), l = typeof t == "string" ? _e(t) : [];
141
+ const i = a(), l = typeof t == "string" ? _e(t) : [];
142
142
  for (const f of i)
143
143
  if (typeof t != "string" && f.matcher(t) || typeof t == "string" && l.some((x) => f.matcher(x)))
144
144
  return f.type;
@@ -176,38 +176,38 @@ function ae(e = {}) {
176
176
  getIconComponent: s
177
177
  };
178
178
  }
179
- const ge = (e, a) => {
179
+ const ge = (e, r) => {
180
180
  if (e.startsWith("blob:") || e.startsWith("data:")) {
181
181
  const n = document.createElement("a");
182
- n.href = e, n.download = a, document.body.appendChild(n), requestAnimationFrame(() => {
182
+ n.href = e, n.download = r, document.body.appendChild(n), requestAnimationFrame(() => {
183
183
  n.click(), document.body.removeChild(n), URL.revokeObjectURL(e);
184
184
  });
185
185
  }
186
186
  };
187
- function ye(e, a) {
188
- const n = L([]), r = k(() => e.file.fileType === "image"), s = (d) => {
187
+ function ye(e, r) {
188
+ const n = L([]), a = k(() => e.file.fileType === "image"), s = (d) => {
189
189
  const g = URL.createObjectURL(d);
190
190
  return n.value.push(g), g;
191
191
  }, p = (d) => {
192
- a("preview", d, e.file);
192
+ r("preview", d, e.file);
193
193
  }, _ = (d) => {
194
- if (a("download", d, e.file), !d.defaultPrevented && e.file.rawFile && !e.file.url) {
194
+ if (r("download", d, e.file), !d.defaultPrevented && e.file.rawFile && !e.file.url) {
195
195
  const g = s(e.file.rawFile);
196
196
  ge(g, e.file.name || e.file.rawFile.name);
197
197
  }
198
198
  }, I = () => {
199
- a("remove", e.file);
199
+ r("remove", e.file);
200
200
  }, b = () => {
201
- a("retry", e.file);
201
+ r("retry", e.file);
202
202
  }, w = (d, g) => {
203
- g.stopPropagation(), d.handler && d.handler(e.file), d.type === "preview" ? p(g) : d.type === "download" ? _(g) : a("action", { action: d, file: e.file });
203
+ g.stopPropagation(), d.handler && d.handler(e.file), d.type === "preview" ? p(g) : d.type === "download" ? _(g) : r("action", { action: d, file: e.file });
204
204
  };
205
- return re(() => {
205
+ return ae(() => {
206
206
  n.value.forEach((d) => {
207
207
  URL.revokeObjectURL(d);
208
208
  }), n.value = [];
209
209
  }), {
210
- isImage: r,
210
+ isImage: a,
211
211
  handlePreview: p,
212
212
  downloadFile: _,
213
213
  handleRemove: I,
@@ -217,15 +217,15 @@ function ye(e, a) {
217
217
  }
218
218
  const we = { class: "tr-image-preview__main" }, Ie = ["disabled"], be = { class: "tr-image-preview__content" }, Ce = ["src", "alt"], ke = ["disabled"], xe = { class: "tr-image-preview__footer" }, Fe = { class: "tr-image-preview__thumbnails" }, Ue = ["onClick"], Pe = ["src", "alt"], Re = /* @__PURE__ */ z({
219
219
  __name: "ImagePreview",
220
- props: /* @__PURE__ */ W({
220
+ props: /* @__PURE__ */ j({
221
221
  images: {}
222
222
  }, {
223
223
  currentIndex: { required: !0 },
224
224
  currentIndexModifiers: {}
225
225
  }),
226
- emits: /* @__PURE__ */ W(["close"], ["update:currentIndex"]),
227
- setup(e, { emit: a }) {
228
- const n = e, r = a, s = se(e, "currentIndex"), p = k(() => n.images[s.value]), _ = () => {
226
+ emits: /* @__PURE__ */ j(["close"], ["update:currentIndex"]),
227
+ setup(e, { emit: r }) {
228
+ const n = e, a = r, s = se(e, "currentIndex"), p = k(() => n.images[s.value]), _ = () => {
229
229
  s.value > 0 && s.value--;
230
230
  }, I = () => {
231
231
  s.value < n.images.length - 1 && s.value++;
@@ -233,7 +233,7 @@ const we = { class: "tr-image-preview__main" }, Ie = ["disabled"], be = { class:
233
233
  s.value = d;
234
234
  };
235
235
  function w() {
236
- r("close");
236
+ a("close");
237
237
  }
238
238
  return (d, g) => {
239
239
  var c, h;
@@ -288,8 +288,8 @@ const we = { class: "tr-image-preview__main" }, Ie = ["disabled"], be = { class:
288
288
  };
289
289
  }
290
290
  }), Le = /* @__PURE__ */ V(Re, [["__scopeId", "data-v-027af77c"]]);
291
- function Te(e, a, n = {}) {
292
- const r = L(!1), s = L([]), p = L(0), _ = (c) => {
291
+ function Te(e, r, n = {}) {
292
+ const a = L(!1), s = L([]), p = L(0), _ = (c) => {
293
293
  p.value = c;
294
294
  }, I = (c) => {
295
295
  const h = e.value.findIndex((t) => t.id === c.id);
@@ -298,20 +298,20 @@ function Te(e, a, n = {}) {
298
298
  (i) => i.fileType === "image" && i.status !== "error" && i.status !== "uploading"
299
299
  );
300
300
  const t = s.value.findIndex((i) => i.id === c.id);
301
- t !== -1 && (p.value = t, r.value = !0);
301
+ t !== -1 && (p.value = t, a.value = !0);
302
302
  }
303
303
  }, b = (c, h) => {
304
- a("preview", c, h), !c.defaultPrevented && I(h);
304
+ r("preview", c, h), !c.defaultPrevented && I(h);
305
305
  }, w = () => {
306
- r.value = !1;
306
+ a.value = !1;
307
307
  }, d = (c, h) => {
308
- n.onDownload ? n.onDownload(c, h) : a("download", c, h);
308
+ n.onDownload ? n.onDownload(c, h) : r("download", c, h);
309
309
  };
310
310
  return {
311
311
  // 显示预览
312
312
  handlePreview: b,
313
313
  // 渲染预览组件
314
- renderPreview: () => r.value ? ie(Le, {
314
+ renderPreview: () => a.value ? ie(Le, {
315
315
  images: s.value,
316
316
  currentIndex: p.value,
317
317
  "onUpdate:currentIndex": _,
@@ -320,12 +320,12 @@ function Te(e, a, n = {}) {
320
320
  }) : null
321
321
  };
322
322
  }
323
- function Me(e, a) {
323
+ function Me(e, r) {
324
324
  return {
325
- actualListType: k(() => a && a !== "auto" ? a : e.value.length === 0 ? "card" : e.value.every((s) => s.fileType === "image") ? "picture" : "card")
325
+ actualListType: k(() => r && r !== "auto" ? r : e.value.length === 0 ? "card" : e.value.every((s) => s.fileType === "image") ? "picture" : "card")
326
326
  };
327
327
  }
328
- const Se = ["data-file-type"], Ee = {
328
+ const Ee = ["data-file-type"], Se = {
329
329
  key: 1,
330
330
  class: "tr-file-card__picture-container"
331
331
  }, Ae = ["src", "alt"], $e = {
@@ -346,10 +346,10 @@ const Se = ["data-file-type"], Ee = {
346
346
  }, Ne = { class: "tr-file-card__icon-wrapper" }, Ve = {
347
347
  key: 0,
348
348
  class: "tr-file-card__status-overlay tr-file-card__status-overlay--icon"
349
- }, We = {
349
+ }, je = {
350
350
  key: 0,
351
351
  class: "tr-file-card__status-icon tr-file-card__status-icon--loading"
352
- }, je = { class: "tr-file-card__content" }, qe = { class: "tr-file-card__info" }, He = ["title"], Ke = {
352
+ }, We = { class: "tr-file-card__content" }, qe = { class: "tr-file-card__info" }, He = ["title"], Ke = {
353
353
  key: 0,
354
354
  class: "tr-file-card__status"
355
355
  }, Ye = {
@@ -367,7 +367,7 @@ const Se = ["data-file-type"], Ee = {
367
367
  }, nt = {
368
368
  key: 2,
369
369
  class: "tr-file-card__status-error"
370
- }, at = /* @__PURE__ */ z({
370
+ }, rt = /* @__PURE__ */ z({
371
371
  __name: "FileCard",
372
372
  props: {
373
373
  file: {},
@@ -379,11 +379,11 @@ const Se = ["data-file-type"], Ee = {
379
379
  fileMatchers: {}
380
380
  },
381
381
  emits: ["remove", "preview", "action", "retry", "download"],
382
- setup(e, { emit: a }) {
383
- const n = e, r = a, { formatFileSize: s, getIconComponent: p } = ae({
382
+ setup(e, { emit: r }) {
383
+ const n = e, a = r, { formatFileSize: s, getIconComponent: p } = re({
384
384
  customIcons: n.fileIcons,
385
385
  fileMatchers: n.fileMatchers
386
- }), { isImage: _, handlePreview: I, handleRemove: b, handleCustomAction: w, handleRetry: d } = ye(n, r), g = k(() => p(n.file.fileType).value), c = k(() => n.file.status === "uploading"), h = k(() => n.file.status === "success"), t = k(() => n.file.status === "error"), i = k(() => [
386
+ }), { isImage: _, handlePreview: I, handleRemove: b, handleCustomAction: w, handleRetry: d } = ye(n, a), g = k(() => p(n.file.fileType).value), c = k(() => n.file.status === "uploading"), h = k(() => n.file.status === "success"), t = k(() => n.file.status === "error"), i = k(() => [
387
387
  n.variant === "picture" ? "tr-file-card--picture" : "tr-file-card",
388
388
  `tr-file-card--${n.file.fileType || "other"}`,
389
389
  {
@@ -411,7 +411,7 @@ const Se = ["data-file-type"], Ee = {
411
411
  }, [
412
412
  F(m(me))
413
413
  ])),
414
- e.variant === "picture" ? (o(), u("div", Ee, [
414
+ e.variant === "picture" ? (o(), u("div", Se, [
415
415
  v("img", {
416
416
  src: e.file.url,
417
417
  alt: e.file.name,
@@ -422,7 +422,7 @@ const Se = ["data-file-type"], Ee = {
422
422
  ])])) : C("", !0),
423
423
  c.value || t.value ? (o(), u("div", De, [
424
424
  c.value ? (o(), u("div", Be, [
425
- F(m(j)),
425
+ F(m(W)),
426
426
  e.file.message ? (o(), u("span", ze, U(e.file.message), 1)) : C("", !0)
427
427
  ])) : t.value ? (o(), M(m(pe), {
428
428
  key: 1,
@@ -444,8 +444,8 @@ const Se = ["data-file-type"], Ee = {
444
444
  v("div", Ne, [
445
445
  (o(), M(Y(g.value), { class: "tr-file-card__file-icon" })),
446
446
  c.value || t.value ? (o(), u("div", Ve, [
447
- c.value ? (o(), u("div", We, [
448
- F(m(j))
447
+ c.value ? (o(), u("div", je, [
448
+ F(m(W))
449
449
  ])) : t.value ? (o(), M(m(q), {
450
450
  key: 1,
451
451
  class: "tr-file-card__status-icon tr-file-card__status-icon--error"
@@ -453,7 +453,7 @@ const Se = ["data-file-type"], Ee = {
453
453
  ])) : C("", !0)
454
454
  ])
455
455
  ], 2),
456
- v("div", je, [
456
+ v("div", We, [
457
457
  v("div", qe, [
458
458
  v("div", {
459
459
  class: "tr-file-card__name",
@@ -497,10 +497,10 @@ const Se = ["data-file-type"], Ee = {
497
497
  ])
498
498
  ])
499
499
  ]))
500
- ], 10, Se);
500
+ ], 10, Ee);
501
501
  };
502
502
  }
503
- }), rt = /* @__PURE__ */ V(at, [["__scopeId", "data-v-a569c028"]]), st = { class: "tr-attachments" }, it = /* @__PURE__ */ z({
503
+ }), at = /* @__PURE__ */ V(rt, [["__scopeId", "data-v-1772c0c6"]]), st = { class: "tr-attachments" }, it = /* @__PURE__ */ z({
504
504
  __name: "index",
505
505
  props: {
506
506
  items: {},
@@ -521,23 +521,23 @@ const Se = ["data-file-type"], Ee = {
521
521
  fileMatchers: { default: () => [] }
522
522
  },
523
523
  emits: ["update:items", "remove", "download", "retry", "preview", "action"],
524
- setup(e, { emit: a }) {
525
- const n = e, r = a, s = L(n.items || []), { actualListType: p } = Me(s, n.variant), { handlePreview: _, renderPreview: I } = Te(s, r, { enableDownload: !0 });
524
+ setup(e, { emit: r }) {
525
+ const n = e, a = r, s = L(n.items || []), { actualListType: p } = Me(s, n.variant), { handlePreview: _, renderPreview: I } = Te(s, a, { enableDownload: !0 });
526
526
  function b(t) {
527
527
  if (n.disabled) return;
528
528
  const i = s.value.findIndex((l) => l.id === t.id);
529
- i !== -1 && (s.value.splice(i, 1), r("remove", t), r("update:items", s.value));
529
+ i !== -1 && (s.value.splice(i, 1), a("remove", t), a("update:items", s.value));
530
530
  }
531
531
  function w(t, i) {
532
- r("download", t, i);
532
+ a("download", t, i);
533
533
  }
534
534
  function d(t) {
535
- r("retry", t);
535
+ a("retry", t);
536
536
  }
537
537
  function g(t) {
538
- r("action", t);
538
+ a("action", t);
539
539
  }
540
- const c = k(() => n.wrap ? "wrap" : "no-wrap"), { normalizeAttachments: h } = ae({
540
+ const c = k(() => n.wrap ? "wrap" : "no-wrap"), { normalizeAttachments: h } = re({
541
541
  fileMatchers: n.fileMatchers
542
542
  });
543
543
  return le(
@@ -553,7 +553,7 @@ const Se = ["data-file-type"], Ee = {
553
553
  onClick: i[0] || (i[0] = R(() => {
554
554
  }, ["stop"]))
555
555
  }, [
556
- (o(!0), u(O, null, N(s.value, (l) => (o(), M(rt, {
556
+ (o(!0), u(O, null, N(s.value, (l) => (o(), M(at, {
557
557
  key: l.id,
558
558
  file: l,
559
559
  variant: m(p),
@@ -572,7 +572,7 @@ const Se = ["data-file-type"], Ee = {
572
572
  (o(), M(Y(m(I)())))
573
573
  ]));
574
574
  }
575
- }), A = /* @__PURE__ */ V(it, [["__scopeId", "data-v-4c01337e"]]);
575
+ }), A = /* @__PURE__ */ V(it, [["__scopeId", "data-v-935ed86d"]]);
576
576
  A.name = "TrAttachments";
577
577
  const ot = function(e) {
578
578
  e.component(A.name, A);
@@ -0,0 +1,70 @@
1
+ import { Component } from 'vue';
2
+ export type BaseFileType = 'image' | 'pdf' | 'word' | 'excel' | 'ppt' | 'folder' | 'other';
3
+ export type FileType = BaseFileType | string;
4
+ export type FileStatus = 'uploading' | 'success' | 'error';
5
+ export type DisplayVariant = 'picture' | 'card' | 'auto';
6
+ export interface FileTypeMatcher {
7
+ type: string;
8
+ matcher: (file: File | string) => boolean;
9
+ icon?: Component;
10
+ }
11
+ export interface BaseAttachment {
12
+ id?: string;
13
+ name?: string;
14
+ status?: FileStatus;
15
+ fileType?: FileType;
16
+ message?: string;
17
+ }
18
+ export interface UrlAttachment extends BaseAttachment {
19
+ url: string;
20
+ size?: number;
21
+ rawFile?: File;
22
+ }
23
+ export interface RawFileAttachment extends BaseAttachment {
24
+ rawFile: File;
25
+ url?: string;
26
+ size?: number;
27
+ }
28
+ export type Attachment = UrlAttachment | RawFileAttachment;
29
+ export interface ActionButton {
30
+ type: string;
31
+ label: string;
32
+ handler?: (file: Attachment) => void;
33
+ }
34
+ export interface AttachmentListProps {
35
+ items?: Attachment[];
36
+ disabled?: boolean;
37
+ wrap?: boolean;
38
+ fileIcons?: Record<string, Component>;
39
+ actions?: ActionButton[];
40
+ variant?: DisplayVariant;
41
+ fileMatchers?: FileTypeMatcher[];
42
+ }
43
+ export interface AttachmentListEmits {
44
+ (e: 'update:items', items: Attachment[]): void;
45
+ (e: 'remove', file: Attachment): void;
46
+ (e: 'download', event: MouseEvent, file: Attachment): void;
47
+ (e: 'retry', file: Attachment): void;
48
+ (e: 'preview', event: MouseEvent, file: Attachment): void;
49
+ (e: 'action', payload: {
50
+ action: ActionButton;
51
+ file: Attachment;
52
+ }): void;
53
+ }
54
+ type BaseCardProps = Pick<AttachmentListProps, 'fileIcons' | 'disabled' | 'actions' | 'fileMatchers'>;
55
+ export interface FileCardProps extends BaseCardProps {
56
+ file: Attachment;
57
+ variant: 'picture' | 'card';
58
+ showStatus?: boolean;
59
+ }
60
+ export interface FileCardEmits {
61
+ (e: 'remove', file: Attachment): void;
62
+ (e: 'preview', event: MouseEvent, file: Attachment): void;
63
+ (e: 'download', event: MouseEvent, file: Attachment): void;
64
+ (e: 'retry', file: Attachment): void;
65
+ (e: 'action', payload: {
66
+ action: ActionButton;
67
+ file: Attachment;
68
+ }): void;
69
+ }
70
+ export {};
@@ -0,0 +1,27 @@
1
+ import { AttachmentListProps, Attachment, ActionButton } from './index.type';
2
+ declare const _default: import('vue').DefineComponent<AttachmentListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ "update:items": (items: Attachment[]) => any;
4
+ remove: (file: Attachment) => any;
5
+ download: (event: MouseEvent, file: Attachment) => any;
6
+ retry: (file: Attachment) => any;
7
+ preview: (event: MouseEvent, file: Attachment) => any;
8
+ action: (payload: {
9
+ action: ActionButton;
10
+ file: Attachment;
11
+ }) => any;
12
+ }, string, import('vue').PublicProps, Readonly<AttachmentListProps> & Readonly<{
13
+ "onUpdate:items"?: ((items: Attachment[]) => any) | undefined;
14
+ onRemove?: ((file: Attachment) => any) | undefined;
15
+ onDownload?: ((event: MouseEvent, file: Attachment) => any) | undefined;
16
+ onRetry?: ((file: Attachment) => any) | undefined;
17
+ onPreview?: ((event: MouseEvent, file: Attachment) => any) | undefined;
18
+ onAction?: ((payload: {
19
+ action: ActionButton;
20
+ file: Attachment;
21
+ }) => any) | undefined;
22
+ }>, {
23
+ actions: ActionButton[];
24
+ fileMatchers: import('./index.type').FileTypeMatcher[];
25
+ variant: import('./index.type').DisplayVariant;
26
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
27
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export declare const getLastPathSegment: (value: string) => string;
2
+ export declare const getStringDetectionCandidates: (value: string) => string[];
3
+ export declare const getUrlDisplayName: (url: string) => string;
@@ -0,0 +1,28 @@
1
+ import { TransitionProps } from 'vue';
2
+ type __VLS_Props = {
3
+ show: boolean;
4
+ transitionProps?: TransitionProps;
5
+ };
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {
12
+ popperRef: HTMLDivElement;
13
+ };
14
+ rootEl: any;
15
+ };
16
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
18
+ popperRef: import('vue').Ref<HTMLDivElement | null, HTMLDivElement | null>;
19
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
20
+ popperRef: HTMLDivElement;
21
+ }, any>;
22
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
+ export default _default;
24
+ type __VLS_WithTemplateSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
@@ -0,0 +1,2 @@
1
+ import { default as BasePopper } from './index.vue';
2
+ export default BasePopper;
@@ -0,0 +1,41 @@
1
+ import { TransitionProps, VNode } from 'vue';
2
+ type TriggerEvents = Partial<Record<`on${Capitalize<string>}`, (...args: any[]) => void>>;
3
+ type __VLS_Props = {
4
+ appendTo?: string | HTMLElement;
5
+ offset?: number | {
6
+ mainAxis?: number;
7
+ crossAxis?: number;
8
+ };
9
+ placement?: 'top-center' | 'bottom-center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
10
+ preventOverflow?: boolean;
11
+ show?: boolean;
12
+ transitionProps?: TransitionProps;
13
+ triggerEvents?: TriggerEvents;
14
+ };
15
+ declare function __VLS_template(): {
16
+ attrs: Partial<{}>;
17
+ slots: Readonly<{
18
+ trigger?: () => VNode[];
19
+ content?: () => VNode[];
20
+ }> & {
21
+ trigger?: () => VNode[];
22
+ content?: () => VNode[];
23
+ };
24
+ refs: {};
25
+ rootEl: any;
26
+ };
27
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
29
+ triggerRef: import('vue').ComputedRef<HTMLElement | SVGElement | null | undefined>;
30
+ popperRef: import('vue').ComputedRef<HTMLDivElement | null>;
31
+ update: () => void;
32
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
33
+ placement: "top-center" | "bottom-center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
34
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
35
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
36
+ export default _default;
37
+ type __VLS_WithTemplateSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,39 @@
1
+ import { BubbleMessage, BubbleProps, BubbleSlots } from './index.type';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: Readonly<BubbleSlots> & BubbleSlots;
5
+ refs: {
6
+ bubbleRef: HTMLDivElement;
7
+ };
8
+ rootEl: HTMLDivElement;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<BubbleProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
12
+ "state-change": (payload: {
13
+ key: string;
14
+ value: unknown;
15
+ messageIndex: number;
16
+ contentIndex: number;
17
+ }) => any;
18
+ }, string, import('vue').PublicProps, Readonly<BubbleProps> & Readonly<{
19
+ "onState-change"?: ((payload: {
20
+ key: string;
21
+ value: unknown;
22
+ messageIndex: number;
23
+ contentIndex: number;
24
+ }) => any) | undefined;
25
+ }>, {
26
+ placement: "start" | "end";
27
+ shape: "corner" | "rounded" | "none";
28
+ contentRenderMode: "single" | "split";
29
+ contentResolver: (message: BubbleMessage) => import('./index.type').ChatMessageContent | undefined;
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
31
+ bubbleRef: HTMLDivElement;
32
+ }, HTMLDivElement>;
33
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
34
+ export default _default;
35
+ type __VLS_WithTemplateSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };