@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.
- package/dist/action-group/index.type.d.ts +1 -0
- package/dist/bubble/index.d.ts +2 -2
- package/dist/bubble/index.type.d.ts +16 -18
- package/dist/feedback/index.vue.d.ts +2 -2
- package/dist/icon-button/index.type.d.ts +2 -3
- package/dist/icon-button/index.vue.d.ts +3 -3
- package/dist/node_modules/.pnpm/@vueuse_core@13.1.0_vue@3.5.13/node_modules/@vueuse/core/index.js +262 -142
- package/dist/node_modules/.pnpm/@vueuse_shared@13.1.0_vue@3.5.13/node_modules/@vueuse/shared/index.js +96 -39
- package/dist/packages/components/src/action-group/ActionGroup.vue.js +2 -2
- package/dist/packages/components/src/action-group/ActionGroup.vue2.js +96 -72
- package/dist/packages/components/src/bubble/Bubble.vue.js +7 -0
- package/dist/packages/components/src/bubble/Bubble.vue2.js +76 -0
- package/dist/packages/components/src/bubble/BubbleList.vue.js +7 -0
- package/dist/packages/components/src/bubble/BubbleList.vue2.js +50 -0
- package/dist/packages/components/src/bubble/index.js +2 -2
- package/dist/packages/components/src/container/index.vue.js +2 -2
- package/dist/packages/components/src/container/index.vue2.js +36 -36
- package/dist/packages/components/src/feedback/index.vue.js +2 -2
- package/dist/packages/components/src/feedback/index.vue2.js +72 -71
- package/dist/packages/components/src/icon-button/index.vue.js +2 -2
- package/dist/packages/components/src/icon-button/index.vue2.js +9 -27
- package/dist/packages/components/src/sender/components/TemplateEditor.vue.js +2 -2
- package/dist/packages/components/src/sender/components/TemplateEditor.vue2.js +137 -83
- package/dist/sender/index.vue.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/action-group/ActionGroup.vue +38 -23
- package/src/action-group/index.type.ts +1 -0
- package/src/bubble/{bubble.vue → Bubble.vue} +13 -97
- package/src/bubble/BubbleList.vue +55 -0
- package/src/bubble/index.ts +2 -2
- package/src/bubble/index.type.ts +7 -21
- package/src/container/index.vue +10 -35
- package/src/feedback/index.vue +14 -14
- package/src/icon-button/index.type.ts +2 -3
- package/src/icon-button/index.vue +16 -10
- package/src/sender/components/TemplateEditor.vue +301 -110
- package/dist/bubble/components/actions/copy.vue.d.ts +0 -10
- package/dist/bubble/components/actions/index.d.ts +0 -2
- package/dist/bubble/components/actions/refresh.vue.d.ts +0 -2
- package/dist/bubble/useScroll.d.ts +0 -4
- package/dist/packages/components/src/bubble/bubble-list.vue.js +0 -7
- package/dist/packages/components/src/bubble/bubble-list.vue2.js +0 -37
- package/dist/packages/components/src/bubble/bubble.vue.js +0 -7
- package/dist/packages/components/src/bubble/bubble.vue2.js +0 -118
- package/dist/packages/components/src/bubble/components/actions/copy.vue.js +0 -7
- package/dist/packages/components/src/bubble/components/actions/copy.vue2.js +0 -35
- package/dist/packages/components/src/bubble/components/actions/refresh.vue.js +0 -7
- package/dist/packages/components/src/bubble/components/actions/refresh.vue2.js +0 -16
- package/dist/packages/components/src/bubble/useScroll.js +0 -13
- package/src/bubble/bubble-list.vue +0 -42
- package/src/bubble/components/actions/copy.vue +0 -54
- package/src/bubble/components/actions/index.ts +0 -2
- package/src/bubble/components/actions/refresh.vue +0 -31
- package/src/bubble/useScroll.ts +0 -14
- /package/dist/bubble/{bubble-list.vue.d.ts → BubbleList.vue.d.ts} +0 -0
|
@@ -1,53 +1,110 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
}
|
|
5
|
-
const
|
|
6
|
-
var
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
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
|
|
11
|
-
},
|
|
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
|
|
14
|
-
},
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
return
|
|
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
|
|
20
|
-
return
|
|
59
|
+
function q(e) {
|
|
60
|
+
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
21
61
|
}
|
|
22
|
-
function
|
|
23
|
-
return Array.isArray(
|
|
62
|
+
function z(e) {
|
|
63
|
+
return Array.isArray(e) ? e : [e];
|
|
24
64
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
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
|
|
29
|
-
|
|
80
|
+
function J(e, o = !0, n) {
|
|
81
|
+
_() ? S(e, n) : o ? e() : x(e);
|
|
30
82
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
83
|
+
function K(e, o, n) {
|
|
84
|
+
return O(
|
|
85
|
+
e,
|
|
86
|
+
o,
|
|
35
87
|
{
|
|
36
|
-
...
|
|
88
|
+
...n,
|
|
37
89
|
immediate: !0
|
|
38
90
|
}
|
|
39
91
|
);
|
|
40
92
|
}
|
|
41
93
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-43d0f1ba"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,97 +1,121 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { IconMenu as
|
|
3
|
-
import
|
|
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
|
|
6
|
-
const
|
|
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
|
|
16
|
+
const i = M, L = P(), F = I, s = c(() => {
|
|
15
17
|
var o, t;
|
|
16
|
-
const e =
|
|
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
|
-
}),
|
|
19
|
-
const e =
|
|
20
|
+
}), f = c(() => {
|
|
21
|
+
const e = i.maxNum ?? Number.MAX_SAFE_INTEGER;
|
|
20
22
|
return e > 0 ? e : Number.MAX_SAFE_INTEGER;
|
|
21
|
-
}),
|
|
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
|
-
|
|
26
|
+
Y(_, (e) => {
|
|
25
27
|
var o;
|
|
26
|
-
(o =
|
|
28
|
+
(o = w.value) != null && o.contains(e.target) || (r.value = !1);
|
|
27
29
|
});
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
if (!
|
|
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 =
|
|
34
|
-
|
|
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
|
|
37
|
-
e &&
|
|
38
|
-
|
|
38
|
+
return D(r, (e) => {
|
|
39
|
+
e && X(() => {
|
|
40
|
+
C();
|
|
39
41
|
});
|
|
40
|
-
}),
|
|
41
|
-
r.value &&
|
|
42
|
-
}), (e, o) => (n(),
|
|
43
|
-
(n(!0),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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(
|
|
72
|
-
|
|
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
|
-
_:
|
|
90
|
-
})
|
|
91
|
-
|
|
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
|
-
|
|
120
|
+
pe as default
|
|
97
121
|
};
|
|
@@ -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,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,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
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-81c9f59e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { defineComponent as f, useCssVars as v, useModel as
|
|
2
|
-
import { IconCancelFullScreen as
|
|
3
|
-
|
|
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(
|
|
14
|
+
setup(l) {
|
|
13
15
|
v((o) => ({
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
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
|
|
20
|
-
return (o,
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cc6ef316"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|