@opentiny/tiny-robot 0.2.0-alpha.0 → 0.2.0-alpha.2

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 (164) 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.type.d.ts +17 -0
  5. package/dist/bubble/index.d.ts +2 -2
  6. package/dist/bubble/index.type.d.ts +16 -18
  7. package/dist/feedback/components/SourceList.vue.d.ts +11 -0
  8. package/dist/feedback/components/index.d.ts +1 -0
  9. package/dist/feedback/index.d.ts +7 -0
  10. package/dist/feedback/index.type.d.ts +25 -0
  11. package/dist/feedback/index.vue.d.ts +13 -0
  12. package/dist/history/components/index.d.ts +2 -0
  13. package/dist/history/components/item-tag.vue.d.ts +5 -0
  14. package/dist/history/components/search-empty.vue.d.ts +7 -0
  15. package/dist/history/composables/index.d.ts +1 -0
  16. package/dist/history/composables/useEditItemTitle.d.ts +12 -0
  17. package/dist/history/index.d.ts +6 -0
  18. package/dist/history/index.type.d.ts +43 -0
  19. package/dist/history/index.vue.d.ts +2 -0
  20. package/dist/icon-button/index.d.ts +7 -0
  21. package/dist/icon-button/index.type.d.ts +6 -0
  22. package/dist/icon-button/index.vue.d.ts +6 -0
  23. package/dist/index.d.ts +10 -1
  24. package/dist/index.js +57 -27
  25. package/dist/node_modules/.pnpm/@opentiny_utils@3.22.0/node_modules/@opentiny/utils/dist/index.es.js +1335 -884
  26. package/dist/node_modules/.pnpm/@opentiny_vue-common@3.22.0/node_modules/@opentiny/vue-common/lib/index.js +660 -144
  27. package/dist/node_modules/.pnpm/@opentiny_vue-hooks@3.22.0/node_modules/@opentiny/vue-hooks/dist/src/vue-popper.js +85 -0
  28. package/dist/node_modules/.pnpm/@opentiny_vue-locale@3.22.0/node_modules/@opentiny/vue-locale/lib/index.js +1783 -0
  29. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/index.js +77 -0
  30. package/dist/node_modules/.pnpm/@opentiny_vue-renderless@3.22.0/node_modules/@opentiny/vue-renderless/tooltip/vue.js +90 -0
  31. package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/index.js +176 -0
  32. package/dist/node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/pc.js +248 -0
  33. package/dist/node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js +310 -0
  34. package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +110 -0
  35. package/dist/packages/components/src/action-group/ActionGroup.vue.js +7 -0
  36. package/dist/packages/components/src/action-group/ActionGroup.vue2.js +121 -0
  37. package/dist/packages/components/src/action-group/ActionGroupItem.vue.js +14 -0
  38. package/dist/packages/components/src/action-group/ActionGroupItem.vue2.js +4 -0
  39. package/dist/packages/components/src/action-group/index.js +17 -0
  40. package/dist/packages/components/src/bubble/Bubble.vue.js +7 -0
  41. package/dist/packages/components/src/bubble/Bubble.vue2.js +76 -0
  42. package/dist/packages/components/src/bubble/BubbleList.vue.js +7 -0
  43. package/dist/packages/components/src/bubble/BubbleList.vue2.js +50 -0
  44. package/dist/packages/components/src/bubble/index.js +2 -2
  45. package/dist/packages/components/src/container/index.vue.js +2 -2
  46. package/dist/packages/components/src/container/index.vue2.js +36 -36
  47. package/dist/packages/components/src/feedback/components/SourceList.vue.js +7 -0
  48. package/dist/packages/components/src/feedback/components/SourceList.vue2.js +52 -0
  49. package/dist/packages/components/src/feedback/index.js +9 -0
  50. package/dist/packages/components/src/feedback/index.vue.js +7 -0
  51. package/dist/packages/components/src/feedback/index.vue2.js +143 -0
  52. package/dist/packages/components/src/history/components/item-tag.vue.js +7 -0
  53. package/dist/packages/components/src/history/components/item-tag.vue2.js +21 -0
  54. package/dist/packages/components/src/history/components/search-empty.vue.js +7 -0
  55. package/dist/packages/components/src/history/components/search-empty.vue2.js +20 -0
  56. package/dist/packages/components/src/history/composables/useEditItemTitle.js +43 -0
  57. package/dist/packages/components/src/history/index.js +11 -0
  58. package/dist/packages/components/src/history/index.vue.js +7 -0
  59. package/dist/packages/components/src/history/index.vue2.js +130 -0
  60. package/dist/packages/components/src/icon-button/index.js +9 -0
  61. package/dist/packages/components/src/icon-button/index.vue.js +7 -0
  62. package/dist/packages/components/src/icon-button/index.vue2.js +22 -0
  63. package/dist/packages/components/src/prompts/prompt.vue.js +2 -2
  64. package/dist/packages/components/src/prompts/prompt.vue2.js +17 -15
  65. package/dist/packages/components/src/question/components/HotQuestions.vue.js +23 -23
  66. package/dist/packages/components/src/question/index.vue.js +18 -18
  67. package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +7 -0
  68. package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +175 -0
  69. package/dist/packages/components/src/sender/index.vue.js +149 -128
  70. package/dist/packages/components/src/suggestion/components/CategoryNav.vue.js +38 -0
  71. package/dist/packages/components/src/suggestion/components/CategoryNav.vue2.js +4 -0
  72. package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue.js +107 -0
  73. package/dist/packages/components/src/suggestion/components/SuggestionCapsule.vue2.js +4 -0
  74. package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue.js +123 -0
  75. package/dist/packages/components/src/suggestion/components/SuggestionPanel.vue2.js +4 -0
  76. package/dist/packages/components/src/suggestion/composables/useKeyboardNavigation.js +45 -0
  77. package/dist/packages/components/src/suggestion/composables/useTriggerDetection.js +17 -0
  78. package/dist/packages/components/src/suggestion/index.js +9 -0
  79. package/dist/packages/components/src/suggestion/index.vue.js +179 -0
  80. package/dist/packages/components/src/suggestion/index.vue2.js +4 -0
  81. package/dist/packages/components/src/suggestion/utils/dom.js +18 -0
  82. package/dist/packages/svgs/dist/tiny-robot-svgs.js +306 -90
  83. package/dist/question/components/HotQuestions.vue.d.ts +2 -2
  84. package/dist/sender/components/TemplateEditor.vue.d.ts +18 -0
  85. package/dist/sender/index.type.d.ts +47 -0
  86. package/dist/sender/index.vue.d.ts +70 -5
  87. package/dist/style.css +1 -1
  88. package/dist/suggestion/components/CategoryNav.vue.d.ts +45 -0
  89. package/dist/suggestion/components/SuggestionCapsule.vue.d.ts +32 -0
  90. package/dist/suggestion/components/SuggestionPanel.vue.d.ts +84 -0
  91. package/dist/suggestion/composables/useKeyboardNavigation.d.ts +18 -0
  92. package/dist/suggestion/composables/useSuggestionFilter.d.ts +10 -0
  93. package/dist/suggestion/composables/useTriggerDetection.d.ts +11 -0
  94. package/dist/suggestion/index.d.ts +7 -0
  95. package/dist/suggestion/index.type.d.ts +94 -0
  96. package/dist/suggestion/index.vue.d.ts +343 -0
  97. package/dist/suggestion/utils/dom.d.ts +20 -0
  98. package/package.json +4 -3
  99. package/src/action-group/ActionGroup.vue +247 -0
  100. package/src/action-group/ActionGroupItem.vue +9 -0
  101. package/src/action-group/index.ts +25 -0
  102. package/src/action-group/index.type.ts +21 -0
  103. package/src/bubble/Bubble.vue +153 -0
  104. package/src/bubble/BubbleList.vue +55 -0
  105. package/src/bubble/index.ts +2 -2
  106. package/src/bubble/index.type.ts +7 -21
  107. package/src/container/index.vue +10 -36
  108. package/src/feedback/components/SourceList.vue +112 -0
  109. package/src/feedback/components/index.ts +1 -0
  110. package/src/feedback/index.ts +12 -0
  111. package/src/feedback/index.type.ts +27 -0
  112. package/src/feedback/index.vue +166 -0
  113. package/src/history/components/index.ts +2 -0
  114. package/src/history/components/item-tag.vue +49 -0
  115. package/src/history/components/search-empty.vue +38 -0
  116. package/src/history/composables/index.ts +1 -0
  117. package/src/history/composables/useEditItemTitle.ts +75 -0
  118. package/src/history/index.ts +12 -0
  119. package/src/history/index.type.ts +50 -0
  120. package/src/history/index.vue +292 -0
  121. package/src/icon-button/index.ts +12 -0
  122. package/src/icon-button/index.type.ts +7 -0
  123. package/src/icon-button/index.vue +58 -0
  124. package/src/index.ts +33 -1
  125. package/src/prompts/prompt.vue +7 -21
  126. package/src/question/components/HotQuestions.vue +1 -1
  127. package/src/question/index.less +9 -10
  128. package/src/sender/components/TemplateEditor.vue +465 -0
  129. package/src/sender/index.less +17 -7
  130. package/src/sender/index.type.ts +51 -0
  131. package/src/sender/index.vue +56 -8
  132. package/src/sender/vars.less +3 -3
  133. package/src/suggestion/components/CategoryNav.vue +38 -0
  134. package/src/suggestion/components/SuggestionCapsule.vue +183 -0
  135. package/src/suggestion/components/SuggestionPanel.vue +147 -0
  136. package/src/suggestion/composables/useKeyboardNavigation.ts +101 -0
  137. package/src/suggestion/composables/useSuggestionFilter.ts +34 -0
  138. package/src/suggestion/composables/useTriggerDetection.ts +46 -0
  139. package/src/suggestion/index.less +497 -0
  140. package/src/suggestion/index.ts +12 -0
  141. package/src/suggestion/index.type.ts +101 -0
  142. package/src/suggestion/index.vue +338 -0
  143. package/src/suggestion/utils/dom.ts +66 -0
  144. package/src/suggestion/vars.less +141 -0
  145. package/dist/bubble/components/actions/copy.vue.d.ts +0 -10
  146. package/dist/bubble/components/actions/index.d.ts +0 -2
  147. package/dist/bubble/components/actions/refresh.vue.d.ts +0 -2
  148. package/dist/bubble/useScroll.d.ts +0 -4
  149. package/dist/packages/components/src/bubble/bubble-list.vue.js +0 -7
  150. package/dist/packages/components/src/bubble/bubble-list.vue2.js +0 -37
  151. package/dist/packages/components/src/bubble/bubble.vue.js +0 -7
  152. package/dist/packages/components/src/bubble/bubble.vue2.js +0 -118
  153. package/dist/packages/components/src/bubble/components/actions/copy.vue.js +0 -7
  154. package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +0 -35
  155. package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +0 -7
  156. package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +0 -16
  157. package/dist/packages/components/src/bubble/useScroll.js +0 -13
  158. package/src/bubble/bubble-list.vue +0 -42
  159. package/src/bubble/bubble.vue +0 -247
  160. package/src/bubble/components/actions/copy.vue +0 -54
  161. package/src/bubble/components/actions/index.ts +0 -2
  162. package/src/bubble/components/actions/refresh.vue +0 -31
  163. package/src/bubble/useScroll.ts +0 -14
  164. /package/dist/bubble/{bubble-list.vue.d.ts → BubbleList.vue.d.ts} +0 -0
@@ -0,0 +1,310 @@
1
+ import { noop as I, useThrottleFn as J, tryOnMounted as G, isClient as K, toArray as k, watchImmediate as U, tryOnScopeDispose as Z, useDebounceFn as q, isObject as ee, isIOS as te, pxValue as B, injectLocal as oe } from "../../../../@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js";
2
+ import { createFilterWrapper as ye, debounceFilter as Te, getLifeCycleTarget as we, throttleFilter as Me } from "../../../../@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js";
3
+ import { shallowRef as w, computed as H, toValue as p, reactive as Y, unref as ne, watch as le, watchEffect as re, hasInjectionContext as ie, getCurrentInstance as se, onMounted as ue } from "vue";
4
+ const P = K ? window : void 0;
5
+ function V(t) {
6
+ var n;
7
+ const c = p(t);
8
+ return (n = c == null ? void 0 : c.$el) != null ? n : c;
9
+ }
10
+ function T(...t) {
11
+ const n = [], c = () => {
12
+ n.forEach((l) => l()), n.length = 0;
13
+ }, a = (l, r, i, d) => (l.addEventListener(r, i, d), () => l.removeEventListener(r, i, d)), g = H(() => {
14
+ const l = k(p(t[0])).filter((r) => r != null);
15
+ return l.every((r) => typeof r != "string") ? l : void 0;
16
+ }), y = U(
17
+ () => {
18
+ var l, r;
19
+ return [
20
+ (r = (l = g.value) == null ? void 0 : l.map((i) => V(i))) != null ? r : [P].filter((i) => i != null),
21
+ k(p(g.value ? t[1] : t[0])),
22
+ k(ne(g.value ? t[2] : t[1])),
23
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
24
+ p(g.value ? t[3] : t[2])
25
+ ];
26
+ },
27
+ ([l, r, i, d]) => {
28
+ if (c(), !(l != null && l.length) || !(r != null && r.length) || !(i != null && i.length))
29
+ return;
30
+ const v = ee(d) ? { ...d } : d;
31
+ n.push(
32
+ ...l.flatMap(
33
+ (m) => r.flatMap(
34
+ (h) => i.map((b) => a(m, h, b, v))
35
+ )
36
+ )
37
+ );
38
+ },
39
+ { flush: "post" }
40
+ ), f = () => {
41
+ y(), c();
42
+ };
43
+ return Z(c), f;
44
+ }
45
+ let Q = !1;
46
+ function pe(t, n, c = {}) {
47
+ const { window: a = P, ignore: g = [], capture: y = !0, detectIframe: f = !1, controls: l = !1 } = c;
48
+ if (!a)
49
+ return l ? { stop: I, cancel: I, trigger: I } : I;
50
+ if (te && !Q) {
51
+ Q = !0;
52
+ const e = { passive: !0 };
53
+ Array.from(a.document.body.children).forEach((o) => T(o, "click", I, e)), T(a.document.documentElement, "click", I, e);
54
+ }
55
+ let r = !0;
56
+ const i = (e) => p(g).some((o) => {
57
+ if (typeof o == "string")
58
+ return Array.from(a.document.querySelectorAll(o)).some((u) => u === e.target || e.composedPath().includes(u));
59
+ {
60
+ const u = V(o);
61
+ return u && (e.target === u || e.composedPath().includes(u));
62
+ }
63
+ });
64
+ function d(e) {
65
+ const o = p(e);
66
+ return o && o.$.subTree.shapeFlag === 16;
67
+ }
68
+ function v(e, o) {
69
+ const u = p(e), L = u.$.subTree && u.$.subTree.children;
70
+ return L == null || !Array.isArray(L) ? !1 : L.some((C) => C.el === o.target || o.composedPath().includes(C.el));
71
+ }
72
+ const m = (e) => {
73
+ const o = V(t);
74
+ if (e.target != null && !(!(o instanceof Element) && d(t) && v(t, e)) && !(!o || o === e.target || e.composedPath().includes(o))) {
75
+ if ("detail" in e && e.detail === 0 && (r = !i(e)), !r) {
76
+ r = !0;
77
+ return;
78
+ }
79
+ n(e);
80
+ }
81
+ };
82
+ let h = !1;
83
+ const b = [
84
+ T(a, "click", (e) => {
85
+ h || (h = !0, setTimeout(() => {
86
+ h = !1;
87
+ }, 0), m(e));
88
+ }, { passive: !0, capture: y }),
89
+ T(a, "pointerdown", (e) => {
90
+ const o = V(t);
91
+ r = !i(e) && !!(o && !e.composedPath().includes(o));
92
+ }, { passive: !0 }),
93
+ f && T(a, "blur", (e) => {
94
+ setTimeout(() => {
95
+ var o;
96
+ const u = V(t);
97
+ ((o = a.document.activeElement) == null ? void 0 : o.tagName) === "IFRAME" && !(u != null && u.contains(a.document.activeElement)) && n(e);
98
+ }, 0);
99
+ }, { passive: !0 })
100
+ ].filter(Boolean), _ = () => b.forEach((e) => e());
101
+ return l ? {
102
+ stop: _,
103
+ cancel: () => {
104
+ r = !1;
105
+ },
106
+ trigger: (e) => {
107
+ r = !0, m(e), r = !1;
108
+ }
109
+ } : _;
110
+ }
111
+ function ce() {
112
+ const t = w(!1), n = se();
113
+ return n && ue(() => {
114
+ t.value = !0;
115
+ }, n), t;
116
+ }
117
+ function ae(t) {
118
+ const n = ce();
119
+ return H(() => (n.value, !!t()));
120
+ }
121
+ const de = Symbol("vueuse-ssr-width");
122
+ function fe() {
123
+ const t = ie() ? oe(de, null) : null;
124
+ return typeof t == "number" ? t : void 0;
125
+ }
126
+ function me(t, n = {}) {
127
+ const { window: c = P, ssrWidth: a = fe() } = n, g = ae(() => c && "matchMedia" in c && typeof c.matchMedia == "function"), y = w(typeof a == "number"), f = w(), l = w(!1), r = (i) => {
128
+ l.value = i.matches;
129
+ };
130
+ return re(() => {
131
+ if (y.value) {
132
+ y.value = !g.value;
133
+ const i = p(t).split(",");
134
+ l.value = i.some((d) => {
135
+ const v = d.includes("not all"), m = d.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), h = d.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
136
+ let b = !!(m || h);
137
+ return m && b && (b = a >= B(m[1])), h && b && (b = a <= B(h[1])), v ? !b : b;
138
+ });
139
+ return;
140
+ }
141
+ g.value && (f.value = c.matchMedia(p(t)), l.value = f.value.matches);
142
+ }), T(f, "change", r, { passive: !0 }), H(() => l.value);
143
+ }
144
+ const X = 1;
145
+ function be(t, n = {}) {
146
+ const {
147
+ throttle: c = 0,
148
+ idle: a = 200,
149
+ onStop: g = I,
150
+ onScroll: y = I,
151
+ offset: f = {
152
+ left: 0,
153
+ right: 0,
154
+ top: 0,
155
+ bottom: 0
156
+ },
157
+ eventListenerOptions: l = {
158
+ capture: !1,
159
+ passive: !0
160
+ },
161
+ behavior: r = "auto",
162
+ window: i = P,
163
+ onError: d = (s) => {
164
+ console.error(s);
165
+ }
166
+ } = n, v = w(0), m = w(0), h = H({
167
+ get() {
168
+ return v.value;
169
+ },
170
+ set(s) {
171
+ _(s, void 0);
172
+ }
173
+ }), b = H({
174
+ get() {
175
+ return m.value;
176
+ },
177
+ set(s) {
178
+ _(void 0, s);
179
+ }
180
+ });
181
+ function _(s, W) {
182
+ var E, x, A, F;
183
+ if (!i)
184
+ return;
185
+ const S = p(t);
186
+ if (!S)
187
+ return;
188
+ (A = S instanceof Document ? i.document.body : S) == null || A.scrollTo({
189
+ top: (E = p(W)) != null ? E : b.value,
190
+ left: (x = p(s)) != null ? x : h.value,
191
+ behavior: p(r)
192
+ });
193
+ const M = ((F = S == null ? void 0 : S.document) == null ? void 0 : F.documentElement) || (S == null ? void 0 : S.documentElement) || S;
194
+ h != null && (v.value = M.scrollLeft), b != null && (m.value = M.scrollTop);
195
+ }
196
+ const e = w(!1), o = Y({
197
+ left: !0,
198
+ right: !1,
199
+ top: !0,
200
+ bottom: !1
201
+ }), u = Y({
202
+ left: !1,
203
+ right: !1,
204
+ top: !1,
205
+ bottom: !1
206
+ }), L = (s) => {
207
+ e.value && (e.value = !1, u.left = !1, u.right = !1, u.top = !1, u.bottom = !1, g(s));
208
+ }, C = q(L, c + a), R = (s) => {
209
+ var W;
210
+ if (!i)
211
+ return;
212
+ const E = ((W = s == null ? void 0 : s.document) == null ? void 0 : W.documentElement) || (s == null ? void 0 : s.documentElement) || V(s), { display: x, flexDirection: A, direction: F } = getComputedStyle(E), S = F === "rtl" ? -1 : 1, M = E.scrollLeft;
213
+ u.left = M < v.value, u.right = M > v.value;
214
+ const N = Math.abs(M * S) <= (f.left || 0), z = Math.abs(M * S) + E.clientWidth >= E.scrollWidth - (f.right || 0) - X;
215
+ x === "flex" && A === "row-reverse" ? (o.left = z, o.right = N) : (o.left = N, o.right = z), v.value = M;
216
+ let O = E.scrollTop;
217
+ s === i.document && !O && (O = i.document.body.scrollTop), u.top = O < m.value, u.bottom = O > m.value;
218
+ const $ = Math.abs(O) <= (f.top || 0), j = Math.abs(O) + E.clientHeight >= E.scrollHeight - (f.bottom || 0) - X;
219
+ x === "flex" && A === "column-reverse" ? (o.top = j, o.bottom = $) : (o.top = $, o.bottom = j), m.value = O;
220
+ }, D = (s) => {
221
+ var W;
222
+ if (!i)
223
+ return;
224
+ const E = (W = s.target.documentElement) != null ? W : s.target;
225
+ R(E), e.value = !0, C(s), y(s);
226
+ };
227
+ return T(
228
+ t,
229
+ "scroll",
230
+ c ? J(D, c, !0, !1) : D,
231
+ l
232
+ ), G(() => {
233
+ try {
234
+ const s = p(t);
235
+ if (!s)
236
+ return;
237
+ R(s);
238
+ } catch (s) {
239
+ d(s);
240
+ }
241
+ }), T(
242
+ t,
243
+ "scrollend",
244
+ L,
245
+ l
246
+ ), {
247
+ x: h,
248
+ y: b,
249
+ isScrolling: e,
250
+ arrivedState: o,
251
+ directions: u,
252
+ measure() {
253
+ const s = p(t);
254
+ i && s && R(s);
255
+ }
256
+ };
257
+ }
258
+ function ge(t = {}) {
259
+ const {
260
+ window: n = P,
261
+ initialWidth: c = Number.POSITIVE_INFINITY,
262
+ initialHeight: a = Number.POSITIVE_INFINITY,
263
+ listenOrientation: g = !0,
264
+ includeScrollbar: y = !0,
265
+ type: f = "inner"
266
+ } = t, l = w(c), r = w(a), i = () => {
267
+ if (n)
268
+ if (f === "outer")
269
+ l.value = n.outerWidth, r.value = n.outerHeight;
270
+ else if (f === "visual" && n.visualViewport) {
271
+ const { width: v, height: m, scale: h } = n.visualViewport;
272
+ l.value = Math.round(v * h), r.value = Math.round(m * h);
273
+ } else y ? (l.value = n.innerWidth, r.value = n.innerHeight) : (l.value = n.document.documentElement.clientWidth, r.value = n.document.documentElement.clientHeight);
274
+ };
275
+ i(), G(i);
276
+ const d = { passive: !0 };
277
+ if (T("resize", i, d), n && f === "visual" && n.visualViewport && T(n.visualViewport, "resize", i, d), g) {
278
+ const v = me("(orientation: portrait)");
279
+ le(v, () => i());
280
+ }
281
+ return { width: l, height: r };
282
+ }
283
+ export {
284
+ ye as createFilterWrapper,
285
+ Te as debounceFilter,
286
+ P as defaultWindow,
287
+ we as getLifeCycleTarget,
288
+ oe as injectLocal,
289
+ K as isClient,
290
+ te as isIOS,
291
+ ee as isObject,
292
+ I as noop,
293
+ pe as onClickOutside,
294
+ B as pxValue,
295
+ Me as throttleFilter,
296
+ k as toArray,
297
+ G as tryOnMounted,
298
+ Z as tryOnScopeDispose,
299
+ V as unrefElement,
300
+ q as useDebounceFn,
301
+ T as useEventListener,
302
+ me as useMediaQuery,
303
+ ce as useMounted,
304
+ fe as useSSRWidth,
305
+ be as useScroll,
306
+ ae as useSupported,
307
+ J as useThrottleFn,
308
+ ge as useWindowSize,
309
+ U as watchImmediate
310
+ };
@@ -0,0 +1,110 @@
1
+ import { onMounted as S, nextTick as x, watch as O, getCurrentScope as P, onScopeDispose as D, isRef as A, getCurrentInstance as j, toValue as g, hasInjectionContext as C, inject as F } from "vue";
2
+ function V(e) {
3
+ return P() ? (D(e), !0) : !1;
4
+ }
5
+ const h = /* @__PURE__ */ new WeakMap(), E = (...e) => {
6
+ var o;
7
+ const n = e[0], t = (o = j()) == null ? void 0 : o.proxy;
8
+ if (t == null && !C())
9
+ throw new Error("injectLocal must be called in setup");
10
+ return t && h.has(t) && n in h.get(t) ? h.get(t)[n] : F(...e);
11
+ }, I = typeof window < "u" && typeof document < "u";
12
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
+ const M = Object.prototype.toString, G = (e) => M.call(e) === "[object Object]", m = () => {
14
+ }, N = /* @__PURE__ */ W();
15
+ function W() {
16
+ var e, o;
17
+ return I && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((o = window == null ? void 0 : window.navigator) == null ? void 0 : o.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
18
+ }
19
+ function T(e, o) {
20
+ function n(...t) {
21
+ return new Promise((r, i) => {
22
+ Promise.resolve(e(() => o.apply(this, t), { fn: o, thisArg: this, args: t })).then(r).catch(i);
23
+ });
24
+ }
25
+ return n;
26
+ }
27
+ function k(e, o = {}) {
28
+ let n, t, r = m;
29
+ const i = (l) => {
30
+ clearTimeout(l), r(), r = m;
31
+ };
32
+ let a;
33
+ return (l) => {
34
+ const c = g(e), u = g(o.maxWait);
35
+ return n && i(n), c <= 0 || u !== void 0 && u <= 0 ? (t && (i(t), t = null), Promise.resolve(l())) : new Promise((f, w) => {
36
+ r = o.rejectOnCancel ? w : f, a = l, u && !t && (t = setTimeout(() => {
37
+ n && i(n), t = null, f(a());
38
+ }, u)), n = setTimeout(() => {
39
+ t && i(t), t = null, f(l());
40
+ }, c);
41
+ });
42
+ };
43
+ }
44
+ function L(...e) {
45
+ let o = 0, n, t = !0, r = m, i, a, s, l, c;
46
+ !A(e[0]) && typeof e[0] == "object" ? { delay: a, trailing: s = !0, leading: l = !0, rejectOnCancel: c = !1 } = e[0] : [a, s = !0, l = !0, c = !1] = e;
47
+ const u = () => {
48
+ n && (clearTimeout(n), n = void 0, r(), r = m);
49
+ };
50
+ return (w) => {
51
+ const d = g(a), y = Date.now() - o, p = () => i = w();
52
+ return u(), d <= 0 ? (o = Date.now(), p()) : (y > d && (l || !t) ? (o = Date.now(), p()) : s && (i = new Promise((b, v) => {
53
+ r = c ? v : b, n = setTimeout(() => {
54
+ o = Date.now(), t = !0, b(p()), u();
55
+ }, Math.max(0, d - y));
56
+ })), !l && !n && (n = setTimeout(() => t = !0, d)), t = !1, i);
57
+ };
58
+ }
59
+ function q(e) {
60
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
61
+ }
62
+ function z(e) {
63
+ return Array.isArray(e) ? e : [e];
64
+ }
65
+ function _(e) {
66
+ return j();
67
+ }
68
+ function B(e, o = 200, n = {}) {
69
+ return T(
70
+ k(o, n),
71
+ e
72
+ );
73
+ }
74
+ function H(e, o = 200, n = !1, t = !0, r = !1) {
75
+ return T(
76
+ L(o, n, t, r),
77
+ e
78
+ );
79
+ }
80
+ function J(e, o = !0, n) {
81
+ _() ? S(e, n) : o ? e() : x(e);
82
+ }
83
+ function K(e, o, n) {
84
+ return O(
85
+ e,
86
+ o,
87
+ {
88
+ ...n,
89
+ immediate: !0
90
+ }
91
+ );
92
+ }
93
+ export {
94
+ T as createFilterWrapper,
95
+ k as debounceFilter,
96
+ _ as getLifeCycleTarget,
97
+ E as injectLocal,
98
+ I as isClient,
99
+ N as isIOS,
100
+ G as isObject,
101
+ m as noop,
102
+ q as pxValue,
103
+ L as throttleFilter,
104
+ z as toArray,
105
+ J as tryOnMounted,
106
+ V as tryOnScopeDispose,
107
+ B as useDebounceFn,
108
+ H as useThrottleFn,
109
+ K as watchImmediate
110
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./ActionGroup.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-43d0f1ba"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,121 @@
1
+ import { defineComponent as z, useSlots as P, computed as c, useTemplateRef as S, ref as B, watch as D, nextTick as X, createElementBlock as u, openBlock as n, createBlock as p, createCommentVNode as R, Fragment as N, renderList as T, unref as m, withCtx as g, createElementVNode as d, resolveDynamicComponent as E, renderSlot as q, createVNode as x, Transition as H, withDirectives as W, normalizeClass as j, withModifiers as J, toDisplayString as K, vShow as Q } from "vue";
2
+ import { IconMenu as U } from "../../../svgs/dist/tiny-robot-svgs.js";
3
+ import A from "../../../../node_modules/.pnpm/@opentiny_vue-tooltip@3.22.0/node_modules/@opentiny/vue-tooltip/lib/index.js";
4
+ import { onClickOutside as Y, useWindowSize as Z } from "../../../../node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js";
5
+ import "../icon-button/index.js";
6
+ import ee from "../icon-button/index.vue.js";
7
+ const te = { class: "tr-action-group" }, oe = ["onClick"], ne = ["onClick"], re = { class: "tr-action-group__dropdown-item-text" }, pe = /* @__PURE__ */ z({
8
+ __name: "ActionGroup",
9
+ props: {
10
+ maxNum: {},
11
+ showTooltip: { type: Boolean },
12
+ dropDownShowLabelOnly: { type: Boolean }
13
+ },
14
+ emits: ["item-click"],
15
+ setup(M, { emit: I }) {
16
+ const i = M, L = P(), F = I, s = c(() => {
17
+ var o, t;
18
+ const e = L.default();
19
+ return Array.isArray(e) ? e.length === 1 && ((o = e[0].type) == null ? void 0 : o.toString()) === "Symbol(v-fgt)" ? e[0].children : e : ((t = e.type) == null ? void 0 : t.toString()) === "Symbol(v-fgt)" ? e.children : [e];
20
+ }), f = c(() => {
21
+ const e = i.maxNum ?? Number.MAX_SAFE_INTEGER;
22
+ return e > 0 ? e : Number.MAX_SAFE_INTEGER;
23
+ }), v = c(() => s.value.length > f.value), G = c(() => v.value ? s.value.slice(0, f.value) : s.value), O = c(() => v.value ? s.value.slice(f.value) : []), w = S("moreBtnRef"), _ = S("dropDownRef"), r = B(!1), V = () => {
24
+ r.value = !r.value;
25
+ };
26
+ Y(_, (e) => {
27
+ var o;
28
+ (o = w.value) != null && o.contains(e.target) || (r.value = !1);
29
+ });
30
+ const k = (e) => {
31
+ F("item-click", e), r.value = !1;
32
+ }, b = B("placement-bottom"), { height: y } = Z(), C = () => {
33
+ if (!_.value || !w.value)
34
+ return "placement-bottom";
35
+ const e = _.value.getBoundingClientRect(), o = w.value.getBoundingClientRect();
36
+ b.value = o.bottom + e.height + 16 > y.value ? "placement-top" : "placement-bottom";
37
+ };
38
+ return D(r, (e) => {
39
+ e && X(() => {
40
+ C();
41
+ });
42
+ }), D(y, () => {
43
+ r.value && C();
44
+ }), (e, o) => (n(), u("div", te, [
45
+ (n(!0), u(N, null, T(G.value, (t, h) => {
46
+ var l;
47
+ return n(), p(m(A), {
48
+ key: h,
49
+ content: (l = t.props) == null ? void 0 : l.label,
50
+ effect: "dark",
51
+ placement: "top",
52
+ "open-delay": 500,
53
+ disabled: !i.showTooltip
54
+ }, {
55
+ default: g(() => [
56
+ d("span", {
57
+ class: "tr-action-group__btn-wrapper",
58
+ onClick: ($) => {
59
+ var a;
60
+ return k((a = t.props) == null ? void 0 : a.name);
61
+ }
62
+ }, [
63
+ (n(), p(E(t)))
64
+ ], 8, oe)
65
+ ]),
66
+ _: 2
67
+ }, 1032, ["content", "disabled"]);
68
+ }), 128)),
69
+ v.value ? (n(), p(m(A), {
70
+ key: 0,
71
+ content: "更多",
72
+ effect: "dark",
73
+ placement: "top",
74
+ "open-delay": 500,
75
+ disabled: !i.showTooltip
76
+ }, {
77
+ default: g(() => [
78
+ d("span", {
79
+ ref: "moreBtnRef",
80
+ class: "tr-action-group__btn-wrapper",
81
+ onClick: V
82
+ }, [
83
+ q(e.$slots, "moreBtn", {}, () => [
84
+ x(m(ee), { icon: m(U) }, null, 8, ["icon"])
85
+ ], !0),
86
+ x(H, { name: "tr-action-group-dropdown" }, {
87
+ default: g(() => [
88
+ W(d("ul", {
89
+ ref: "dropDownRef",
90
+ class: j(["tr-action-group__dropdown", b.value])
91
+ }, [
92
+ (n(!0), u(N, null, T(O.value, (t, h) => {
93
+ var l;
94
+ return n(), u("li", {
95
+ class: "tr-action-group__dropdown-item",
96
+ key: h,
97
+ onClick: J(($) => {
98
+ var a;
99
+ return k((a = t.props) == null ? void 0 : a.name);
100
+ }, ["stop"])
101
+ }, [
102
+ i.dropDownShowLabelOnly ? R("", !0) : (n(), p(E(t), { key: 0 })),
103
+ d("span", re, K((l = t.props) == null ? void 0 : l.label), 1)
104
+ ], 8, ne);
105
+ }), 128))
106
+ ], 2), [
107
+ [Q, r.value]
108
+ ])
109
+ ]),
110
+ _: 1
111
+ })
112
+ ], 512)
113
+ ]),
114
+ _: 3
115
+ }, 8, ["disabled"])) : R("", !0)
116
+ ]));
117
+ }
118
+ });
119
+ export {
120
+ pe as default
121
+ };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as t, renderSlot as o } from "vue";
2
+ const a = /* @__PURE__ */ t({
3
+ __name: "ActionGroupItem",
4
+ props: {
5
+ name: {},
6
+ label: {}
7
+ },
8
+ setup(r) {
9
+ return (e, n) => o(e.$slots, "default");
10
+ }
11
+ });
12
+ export {
13
+ a as default
14
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ActionGroupItem.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,17 @@
1
+ import o from "./ActionGroup.vue.js";
2
+ import n from "./ActionGroupItem.vue.js";
3
+ o.name = "TrActionGroup";
4
+ const i = function(t) {
5
+ t.component(o.name, o);
6
+ };
7
+ o.install = i;
8
+ n.name = "TrActionGroupItem";
9
+ const m = function(t) {
10
+ t.component(n.name, n);
11
+ };
12
+ n.install = m;
13
+ const a = n;
14
+ export {
15
+ a as ActionGroupItem,
16
+ o as default
17
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./Bubble.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-56d84731"]]);
5
+ export {
6
+ _ as default
7
+ };
@@ -0,0 +1,76 @@
1
+ import { defineComponent as m, useCssVars as v, useSlots as f, computed as s, createElementBlock as o, openBlock as t, normalizeClass as c, createCommentVNode as r, createElementVNode as n, createBlock as y, resolveDynamicComponent as k, renderSlot as l, toDisplayString as h } from "vue";
2
+ import C from "../../../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/index.js";
3
+ const g = {
4
+ key: 0,
5
+ class: "tr-bubble__avatar"
6
+ }, B = { class: "tr-bubble__content-wrapper" }, w = {
7
+ key: 1,
8
+ class: /* @__PURE__ */ c(["tr-bubble__content"])
9
+ }, S = { class: "tr-bubbule__body" }, x = ["innerHTML"], I = { key: 1 }, M = {
10
+ key: 2,
11
+ class: "tr-bubbule__aborted"
12
+ }, P = {
13
+ key: 0,
14
+ class: "tr-bubbule__footer"
15
+ }, D = /* @__PURE__ */ m({
16
+ __name: "Bubble",
17
+ props: {
18
+ content: { default: "" },
19
+ id: {},
20
+ placement: { default: "start" },
21
+ avatar: {},
22
+ role: {},
23
+ type: { default: "text" },
24
+ loading: { type: Boolean },
25
+ aborted: { type: Boolean },
26
+ mdConfig: {},
27
+ maxWidth: { default: "80%" }
28
+ },
29
+ setup(i) {
30
+ v((a) => ({
31
+ "6f4262cc": e.maxWidth
32
+ }));
33
+ const e = i, p = f(), _ = s(() => C(e.mdConfig || {})), d = s(() => e.type === "markdown" ? _.value.render(e.content) : e.content), u = s(() => e.placement === "start");
34
+ return (a, b) => (t(), o("div", {
35
+ class: c([
36
+ "tr-bubble",
37
+ {
38
+ "placement-start": u.value,
39
+ "placement-end": !u.value
40
+ }
41
+ ])
42
+ }, [
43
+ e.avatar ? (t(), o("div", g, [
44
+ (t(), y(k(e.avatar)))
45
+ ])) : r("", !0),
46
+ n("div", B, [
47
+ e.loading ? l(a.$slots, "loading", {
48
+ key: 0,
49
+ bubbleProps: e
50
+ }, () => [
51
+ b[0] || (b[0] = n("div", { class: "tr-bubble__loading" }, [
52
+ n("span"),
53
+ n("span"),
54
+ n("span")
55
+ ], -1))
56
+ ], !0) : (t(), o("div", w, [
57
+ n("div", S, [
58
+ l(a.$slots, "default", { bubbleProps: e }, () => [
59
+ e.type === "markdown" ? (t(), o("span", {
60
+ key: 0,
61
+ innerHTML: d.value
62
+ }, null, 8, x)) : (t(), o("span", I, h(d.value), 1)),
63
+ e.aborted ? (t(), o("span", M, "(用户停止)")) : r("", !0)
64
+ ], !0)
65
+ ]),
66
+ p.footer ? (t(), o("div", P, [
67
+ l(a.$slots, "footer", { bubbleProps: e }, void 0, !0)
68
+ ])) : r("", !0)
69
+ ]))
70
+ ])
71
+ ], 2));
72
+ }
73
+ });
74
+ export {
75
+ D as default
76
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./BubbleList.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bd672305"]]);
5
+ export {
6
+ s as default
7
+ };