@opentiny/tiny-robot 0.2.0-alpha.1 → 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 (56) hide show
  1. package/dist/action-group/index.type.d.ts +1 -0
  2. package/dist/bubble/index.d.ts +2 -2
  3. package/dist/bubble/index.type.d.ts +16 -18
  4. package/dist/feedback/index.vue.d.ts +2 -2
  5. package/dist/icon-button/index.type.d.ts +2 -3
  6. package/dist/icon-button/index.vue.d.ts +3 -3
  7. package/dist/node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js +262 -142
  8. package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +96 -39
  9. package/dist/packages/components/src/action-group/ActionGroup.vue.js +2 -2
  10. package/dist/packages/components/src/action-group/ActionGroup.vue2.js +96 -72
  11. package/dist/packages/components/src/bubble/Bubble.vue.js +7 -0
  12. package/dist/packages/components/src/bubble/Bubble.vue2.js +76 -0
  13. package/dist/packages/components/src/bubble/BubbleList.vue.js +7 -0
  14. package/dist/packages/components/src/bubble/BubbleList.vue2.js +50 -0
  15. package/dist/packages/components/src/bubble/index.js +2 -2
  16. package/dist/packages/components/src/container/index.vue.js +2 -2
  17. package/dist/packages/components/src/container/index.vue2.js +36 -36
  18. package/dist/packages/components/src/feedback/index.vue.js +2 -2
  19. package/dist/packages/components/src/feedback/index.vue2.js +72 -71
  20. package/dist/packages/components/src/icon-button/index.vue.js +2 -2
  21. package/dist/packages/components/src/icon-button/index.vue2.js +9 -27
  22. package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +2 -2
  23. package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +137 -83
  24. package/dist/sender/index.vue.d.ts +2 -2
  25. package/dist/style.css +1 -1
  26. package/package.json +3 -3
  27. package/src/action-group/ActionGroup.vue +38 -23
  28. package/src/action-group/index.type.ts +1 -0
  29. package/src/bubble/{bubble.vue → Bubble.vue} +13 -97
  30. package/src/bubble/BubbleList.vue +55 -0
  31. package/src/bubble/index.ts +2 -2
  32. package/src/bubble/index.type.ts +7 -21
  33. package/src/container/index.vue +10 -35
  34. package/src/feedback/index.vue +14 -14
  35. package/src/icon-button/index.type.ts +2 -3
  36. package/src/icon-button/index.vue +16 -10
  37. package/src/sender/components/TemplateEditor.vue +301 -110
  38. package/dist/bubble/components/actions/copy.vue.d.ts +0 -10
  39. package/dist/bubble/components/actions/index.d.ts +0 -2
  40. package/dist/bubble/components/actions/refresh.vue.d.ts +0 -2
  41. package/dist/bubble/useScroll.d.ts +0 -4
  42. package/dist/packages/components/src/bubble/bubble-list.vue.js +0 -7
  43. package/dist/packages/components/src/bubble/bubble-list.vue2.js +0 -37
  44. package/dist/packages/components/src/bubble/bubble.vue.js +0 -7
  45. package/dist/packages/components/src/bubble/bubble.vue2.js +0 -118
  46. package/dist/packages/components/src/bubble/components/actions/copy.vue.js +0 -7
  47. package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +0 -35
  48. package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +0 -7
  49. package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +0 -16
  50. package/dist/packages/components/src/bubble/useScroll.js +0 -13
  51. package/src/bubble/bubble-list.vue +0 -42
  52. package/src/bubble/components/actions/copy.vue +0 -54
  53. package/src/bubble/components/actions/index.ts +0 -2
  54. package/src/bubble/components/actions/refresh.vue +0 -31
  55. package/src/bubble/useScroll.ts +0 -14
  56. /package/dist/bubble/{bubble-list.vue.d.ts → BubbleList.vue.d.ts} +0 -0
@@ -1,53 +1,110 @@
1
- import { onMounted as a, nextTick as c, watch as s, getCurrentScope as u, onScopeDispose as l, getCurrentInstance as r, hasInjectionContext as d, inject as w } from "vue";
2
- function b(t) {
3
- return u() ? (l(t), !0) : !1;
4
- }
5
- const i = /* @__PURE__ */ new WeakMap(), v = (...t) => {
6
- var n;
7
- const e = t[0], o = (n = r()) == null ? void 0 : n.proxy;
8
- if (o == null && !d())
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
9
  throw new Error("injectLocal must be called in setup");
10
- return o && i.has(o) && e in i.get(o) ? i.get(o)[e] : w(...t);
11
- }, f = typeof window < "u" && typeof document < "u";
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
12
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
- const p = Object.prototype.toString, h = (t) => p.call(t) === "[object Object]", S = () => {
14
- }, j = /* @__PURE__ */ g();
15
- function g() {
16
- var t, n;
17
- return f && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
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
+ };
18
58
  }
19
- function O(t) {
20
- return t.endsWith("rem") ? Number.parseFloat(t) * 16 : Number.parseFloat(t);
59
+ function q(e) {
60
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
21
61
  }
22
- function A(t) {
23
- return Array.isArray(t) ? t : [t];
62
+ function z(e) {
63
+ return Array.isArray(e) ? e : [e];
24
64
  }
25
- function m(t) {
26
- return r();
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
+ );
27
79
  }
28
- function I(t, n = !0, e) {
29
- m() ? a(t, e) : n ? t() : c(t);
80
+ function J(e, o = !0, n) {
81
+ _() ? S(e, n) : o ? e() : x(e);
30
82
  }
31
- function k(t, n, e) {
32
- return s(
33
- t,
34
- n,
83
+ function K(e, o, n) {
84
+ return O(
85
+ e,
86
+ o,
35
87
  {
36
- ...e,
88
+ ...n,
37
89
  immediate: !0
38
90
  }
39
91
  );
40
92
  }
41
93
  export {
42
- m as getLifeCycleTarget,
43
- v as injectLocal,
44
- f as isClient,
45
- j as isIOS,
46
- h as isObject,
47
- S as noop,
48
- O as pxValue,
49
- A as toArray,
50
- I as tryOnMounted,
51
- b as tryOnScopeDispose,
52
- k as watchImmediate
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
53
110
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ActionGroup.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9d495a61"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-43d0f1ba"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,97 +1,121 @@
1
- import { defineComponent as V, useSlots as $, computed as a, useTemplateRef as y, ref as C, watch as S, nextTick as z, createElementBlock as l, openBlock as n, createCommentVNode as b, Fragment as D, renderList as B, createBlock as R, resolveDynamicComponent as N, renderSlot as P, createVNode as E, unref as x, Transition as X, withCtx as q, withDirectives as H, createElementVNode as A, normalizeClass as W, withModifiers as j, toDisplayString as J, vShow as K } from "vue";
2
- import { IconMenu as Q } from "../../../svgs/dist/tiny-robot-svgs.js";
3
- import { onClickOutside as U, useWindowSize as Y } from "../../../../node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js";
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";
4
5
  import "../icon-button/index.js";
5
- import Z from "../icon-button/index.vue.js";
6
- const ee = { class: "tr-action-group" }, te = ["onClick"], oe = ["onClick"], ne = { class: "tr-action-group__dropdown-item-text" }, se = /* @__PURE__ */ V({
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({
7
8
  __name: "ActionGroup",
8
9
  props: {
9
10
  maxNum: {},
11
+ showTooltip: { type: Boolean },
10
12
  dropDownShowLabelOnly: { type: Boolean }
11
13
  },
12
14
  emits: ["item-click"],
13
15
  setup(M, { emit: I }) {
14
- const v = M, T = $(), L = I, c = a(() => {
16
+ const i = M, L = P(), F = I, s = c(() => {
15
17
  var o, t;
16
- const e = T.default();
18
+ const e = L.default();
17
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];
18
- }), i = a(() => {
19
- const e = v.maxNum ?? Number.MAX_SAFE_INTEGER;
20
+ }), f = c(() => {
21
+ const e = i.maxNum ?? Number.MAX_SAFE_INTEGER;
20
22
  return e > 0 ? e : Number.MAX_SAFE_INTEGER;
21
- }), s = a(() => c.value.length > i.value), F = a(() => s.value ? c.value.slice(0, i.value) : c.value), G = a(() => s.value ? c.value.slice(i.value) : []), u = y("moreBtnRef"), p = y("dropDownRef"), r = C(!1), O = () => {
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 = () => {
22
24
  r.value = !r.value;
23
25
  };
24
- U(p, (e) => {
26
+ Y(_, (e) => {
25
27
  var o;
26
- (o = u.value) != null && o.contains(e.target) || (r.value = !1);
28
+ (o = w.value) != null && o.contains(e.target) || (r.value = !1);
27
29
  });
28
- const _ = (e) => {
29
- L("item-click", e), r.value = !1;
30
- }, w = C("placement-bottom"), { height: h } = Y(), g = () => {
31
- if (!p.value || !u.value)
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)
32
34
  return "placement-bottom";
33
- const e = p.value.getBoundingClientRect(), o = u.value.getBoundingClientRect();
34
- w.value = o.bottom + e.height + 16 > h.value ? "placement-top" : "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";
35
37
  };
36
- return S(r, (e) => {
37
- e && z(() => {
38
- g();
38
+ return D(r, (e) => {
39
+ e && X(() => {
40
+ C();
39
41
  });
40
- }), S(h, () => {
41
- r.value && g();
42
- }), (e, o) => (n(), l("div", ee, [
43
- (n(!0), l(D, null, B(F.value, (t, m) => (n(), l("span", {
44
- key: m,
45
- class: "tr-action-group__btn-wrapper",
46
- onClick: (d) => {
47
- var f;
48
- return _((f = t.props) == null ? void 0 : f.name);
49
- }
50
- }, [
51
- (n(), R(N(t)))
52
- ], 8, te))), 128)),
53
- s.value ? (n(), l("span", {
54
- key: 0,
55
- ref: "moreBtnRef",
56
- class: "tr-action-group__btn-wrapper",
57
- onClick: O
58
- }, [
59
- P(e.$slots, "moreBtn", {}, () => [
60
- E(x(Z), {
61
- icon: x(Q),
62
- tooltip: "更多"
63
- }, null, 8, ["icon"])
64
- ], !0),
65
- E(X, { name: "tr-action-group-dropdown" }, {
66
- default: q(() => [
67
- H(A("ul", {
68
- ref: "dropDownRef",
69
- class: W(["tr-action-group__dropdown", w.value])
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
+ }
70
62
  }, [
71
- (n(!0), l(D, null, B(G.value, (t, m) => {
72
- var d;
73
- return n(), l("li", {
74
- class: "tr-action-group__dropdown-item",
75
- key: m,
76
- onClick: j((f) => {
77
- var k;
78
- return _((k = t.props) == null ? void 0 : k.name);
79
- }, ["stop"])
80
- }, [
81
- v.dropDownShowLabelOnly ? b("", !0) : (n(), R(N(t), { key: 0 })),
82
- A("span", ne, J((d = t.props) == null ? void 0 : d.label), 1)
83
- ], 8, oe);
84
- }), 128))
85
- ], 2), [
86
- [K, r.value]
87
- ])
63
+ (n(), p(E(t)))
64
+ ], 8, oe)
88
65
  ]),
89
- _: 1
90
- })
91
- ], 512)) : b("", !0)
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)
92
116
  ]));
93
117
  }
94
118
  });
95
119
  export {
96
- se as default
120
+ pe as default
97
121
  };
@@ -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
+ };
@@ -0,0 +1,50 @@
1
+ import { defineComponent as h, useTemplateRef as v, computed as B, watch as S, createElementBlock as f, openBlock as s, Fragment as k, renderList as i, createBlock as m, mergeProps as p, createSlots as y, withCtx as x, resolveDynamicComponent as I } from "vue";
2
+ import { useScroll as w } from "../../../../node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js";
3
+ import L from "./Bubble.vue.js";
4
+ const P = {
5
+ class: "tr-bubble-list",
6
+ ref: "scrollContainer"
7
+ }, F = /* @__PURE__ */ h({
8
+ __name: "BubbleList",
9
+ props: {
10
+ items: {},
11
+ roles: {},
12
+ autoScroll: { type: Boolean }
13
+ },
14
+ setup(_) {
15
+ const o = _, n = v("scrollContainer"), { y: b } = w(n, {
16
+ behavior: "smooth",
17
+ throttle: 100
18
+ }), d = B(() => o.items.at(-1));
19
+ S([() => o.items.length, () => {
20
+ var e;
21
+ return (e = d.value) == null ? void 0 : e.content;
22
+ }], () => {
23
+ !o.autoScroll || !n.value || (b.value = n.value.scrollHeight);
24
+ });
25
+ const C = (e) => {
26
+ var l;
27
+ const c = e.role ? ((l = o.roles) == null ? void 0 : l[e.role]) || {} : {}, { slots: t, ...u } = c, { slots: g, ...r } = e;
28
+ return { ...u, ...r };
29
+ }, a = (e) => {
30
+ var t;
31
+ return { ...(e.role ? ((t = o.roles) == null ? void 0 : t[e.role]) || {} : {}).slots, ...e.slots };
32
+ };
33
+ return (e, c) => (s(), f("div", P, [
34
+ (s(!0), f(k, null, i(o.items, (t, u) => (s(), m(L, p({
35
+ key: t.id || u,
36
+ ref_for: !0
37
+ }, C(t)), y({ _: 2 }, [
38
+ i(a(t), (g, r) => ({
39
+ name: r,
40
+ fn: x((l) => [
41
+ (s(), m(I(a(t)[r]), p({ ref_for: !0 }, l), null, 16))
42
+ ])
43
+ }))
44
+ ]), 1040))), 128))
45
+ ], 512));
46
+ }
47
+ });
48
+ export {
49
+ F as default
50
+ };
@@ -1,5 +1,5 @@
1
- import n from "./bubble.vue.js";
2
- import t from "./bubble-list.vue.js";
1
+ import n from "./Bubble.vue.js";
2
+ import t from "./BubbleList.vue.js";
3
3
  n.name = "TrBubble";
4
4
  const o = function(b) {
5
5
  b.component(n.name, n);
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0ee55898"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-81c9f59e"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,6 +1,8 @@
1
- import { defineComponent as f, useCssVars as v, useModel as i, computed as p, createElementBlock as _, openBlock as m, createElementVNode as e, renderSlot as s, createVNode as a, unref as d } from "vue";
2
- import { IconCancelFullScreen as h, IconFullScreen as w, IconClose as b } from "../../../svgs/dist/tiny-robot-svgs.js";
3
- const $ = { class: "tr-container" }, g = { class: "tr-container__header" }, C = { class: "tr-container__header-operations" }, S = { class: "tr-container__body" }, k = { class: "tr-container__footer" }, F = /* @__PURE__ */ f({
1
+ import { defineComponent as f, useCssVars as v, useModel as a, computed as m, createElementBlock as _, openBlock as w, createElementVNode as n, renderSlot as t, createVNode as c, unref as r } from "vue";
2
+ import { IconCancelFullScreen as g, IconFullScreen as h, IconClose as $ } from "../../../svgs/dist/tiny-robot-svgs.js";
3
+ import "../icon-button/index.js";
4
+ import u from "../icon-button/index.vue.js";
5
+ const C = { class: "tr-container" }, b = { class: "tr-container__header" }, B = { class: "tr-container__header-operations" }, I = { class: "tr-container__footer" }, N = /* @__PURE__ */ f({
4
6
  __name: "index",
5
7
  props: {
6
8
  show: { type: Boolean, required: !0 },
@@ -9,47 +11,45 @@ const $ = { class: "tr-container" }, g = { class: "tr-container__header" }, C =
9
11
  fullscreenModifiers: {}
10
12
  },
11
13
  emits: ["update:show", "update:fullscreen"],
12
- setup(r) {
14
+ setup(l) {
13
15
  v((o) => ({
14
- "1de4f8d0": n.value ? "0" : "unset",
15
- "75a61de3": n.value ? "unset" : "var(--tr-container-width)",
16
- "1422451e": l.value ? "100" : "-1",
17
- "4bd25f52": l.value ? "1" : "0"
16
+ b67b7ee6: s.value ? "0" : "unset",
17
+ "72873ea0": s.value ? "unset" : "var(--tr-container-width)",
18
+ "224ae4c1": i.value ? "100" : "-1",
19
+ cb10cae2: i.value ? "1" : "0"
18
20
  }));
19
- const l = i(r, "show"), n = i(r, "fullscreen"), u = p(() => n.value ? h : w);
20
- return (o, t) => (m(), _("div", $, [
21
- t[3] || (t[3] = e("div", { class: "tr-container__dragging-bar-wrapper" }, [
22
- e("div", { class: "tr-container__dragging-bar" })
21
+ const i = a(l, "show"), s = a(l, "fullscreen"), d = m(() => s.value ? g : h);
22
+ return (o, e) => (w(), _("div", C, [
23
+ e[3] || (e[3] = n("div", { class: "tr-container__dragging-bar-wrapper" }, [
24
+ n("div", { class: "tr-container__dragging-bar" })
23
25
  ], -1)),
24
- e("div", g, [
25
- s(o.$slots, "title", {}, () => [
26
- t[2] || (t[2] = e("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
27
- ], !0),
28
- e("div", C, [
29
- s(o.$slots, "operations", {}, void 0, !0),
30
- e("button", {
31
- class: "icon-btn",
32
- onClick: t[0] || (t[0] = (c) => o.$emit("update:fullscreen", !n.value))
33
- }, [
34
- a(d(u))
35
- ]),
36
- e("button", {
37
- class: "icon-btn",
38
- onClick: t[1] || (t[1] = (c) => o.$emit("update:show", !1))
39
- }, [
40
- a(d(b))
41
- ])
26
+ n("div", b, [
27
+ t(o.$slots, "title", {}, () => [
28
+ e[2] || (e[2] = n("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
29
+ ]),
30
+ n("div", B, [
31
+ t(o.$slots, "operations"),
32
+ c(r(u), {
33
+ size: "28",
34
+ "svg-size": "20",
35
+ icon: d.value,
36
+ onClick: e[0] || (e[0] = (p) => o.$emit("update:fullscreen", !s.value))
37
+ }, null, 8, ["icon"]),
38
+ c(r(u), {
39
+ size: "28",
40
+ "svg-size": "20",
41
+ icon: r($),
42
+ onClick: e[1] || (e[1] = (p) => o.$emit("update:show", !1))
43
+ }, null, 8, ["icon"])
42
44
  ])
43
45
  ]),
44
- e("div", S, [
45
- s(o.$slots, "default", {}, void 0, !0)
46
- ]),
47
- e("div", k, [
48
- s(o.$slots, "footer", {}, void 0, !0)
46
+ t(o.$slots, "default"),
47
+ n("div", I, [
48
+ t(o.$slots, "footer")
49
49
  ])
50
50
  ]));
51
51
  }
52
52
  });
53
53
  export {
54
- F as default
54
+ N as default
55
55
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./index.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-762e57a9"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cc6ef316"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };