@opentiny/tiny-robot 0.3.0-alpha.1 → 0.3.0-alpha.3
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.js +16 -16
- package/dist/bubble/index.js +788 -777
- package/dist/container/index.js +10 -10
- package/dist/feedback/index.js +43 -43
- package/dist/flow-layout-buttons/index.js +10 -10
- package/dist/history/index.js +39 -39
- package/dist/index.d.ts +23 -7
- package/dist/question/index.js +66 -66
- package/dist/sender/index.js +130 -130
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +58 -58
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +25 -25
- package/dist/tiny-robot-svgs.js +172 -172
- package/package.json +3 -3
package/dist/container/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as c, unref as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as c, unref as i } from "vue";
|
|
2
|
+
import { r as h, a as $, f as C } from "../tiny-robot-svgs.js";
|
|
3
3
|
import u from "../icon-button/index.js";
|
|
4
4
|
import { _ as b } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k = { class: "tr-container__header-operations" }, y = { class: "tr-container__footer" }, E = /* @__PURE__ */ m({
|
|
@@ -29,16 +29,16 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
|
|
|
29
29
|
]),
|
|
30
30
|
n("div", k, [
|
|
31
31
|
r(t.$slots, "operations"),
|
|
32
|
-
c(
|
|
32
|
+
c(i(u), {
|
|
33
33
|
size: "28",
|
|
34
34
|
"svg-size": "20",
|
|
35
35
|
icon: f.value,
|
|
36
36
|
onClick: e[0] || (e[0] = (p) => t.$emit("update:fullscreen", !s.value))
|
|
37
37
|
}, null, 8, ["icon"]),
|
|
38
|
-
c(
|
|
38
|
+
c(i(u), {
|
|
39
39
|
size: "28",
|
|
40
40
|
"svg-size": "20",
|
|
41
|
-
icon:
|
|
41
|
+
icon: i(C),
|
|
42
42
|
onClick: e[1] || (e[1] = (p) => t.$emit("update:show", !1))
|
|
43
43
|
}, null, 8, ["icon"])
|
|
44
44
|
])
|
|
@@ -49,12 +49,12 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
|
|
|
49
49
|
])
|
|
50
50
|
]));
|
|
51
51
|
}
|
|
52
|
-
}),
|
|
53
|
-
|
|
52
|
+
}), a = /* @__PURE__ */ b(E, [["__scopeId", "data-v-6a9b9126"]]);
|
|
53
|
+
a.name = "TrContainer";
|
|
54
54
|
const I = function(o) {
|
|
55
|
-
o.component(
|
|
55
|
+
o.component(a.name, a);
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
a.install = I;
|
|
58
58
|
export {
|
|
59
|
-
|
|
59
|
+
a as default
|
|
60
60
|
};
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as X, ref as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as X, ref as E, computed as z, onMounted as D, watch as O, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as S, toDisplayString as y, createVNode as b, unref as l, nextTick as q, createElementVNode as _, createBlock as p, withCtx as f, createTextVNode as j, resolveDynamicComponent as C } from "vue";
|
|
2
|
+
import { l as T, n as N, c as H, h as J, y as K, d as Q } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { B as R } from "../index3.js";
|
|
4
4
|
import $, { ActionGroupItem as V } from "../action-group/index.js";
|
|
5
5
|
import U from "../icon-button/index.js";
|
|
@@ -10,8 +10,8 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
10
10
|
sources: {},
|
|
11
11
|
linesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
const m =
|
|
13
|
+
setup(h) {
|
|
14
|
+
const m = h, e = E(!1), g = E([]), c = E(null), L = () => {
|
|
15
15
|
q(() => {
|
|
16
16
|
const u = g.value.slice(0, m.sources.length).map((o) => (o == null ? void 0 : o.offsetTop) || 0), n = Array.from(new Set(u));
|
|
17
17
|
if (n.length > m.linesLimit) {
|
|
@@ -20,33 +20,33 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
20
20
|
} else
|
|
21
21
|
c.value = null;
|
|
22
22
|
});
|
|
23
|
-
},
|
|
23
|
+
}, A = z(() => m.sources.length - (c.value || 0));
|
|
24
24
|
D(L), O(() => m.sources, L);
|
|
25
|
-
const
|
|
25
|
+
const d = (u, n) => {
|
|
26
26
|
u && (g.value[n] = u);
|
|
27
27
|
};
|
|
28
28
|
return (u, n) => (t(), a("div", W, [
|
|
29
|
-
(t(!0), a(
|
|
29
|
+
(t(!0), a(I, null, S(m.sources, (o, s) => (t(), a(I, { key: s }, [
|
|
30
30
|
!c.value || e.value || s < c.value ? (t(), a("a", {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "pill",
|
|
33
33
|
href: o.link,
|
|
34
34
|
target: "_blank",
|
|
35
35
|
ref_for: !0,
|
|
36
|
-
ref: (r) =>
|
|
36
|
+
ref: (r) => d(r, s)
|
|
37
37
|
}, y(o.label), 9, Y)) : k("", !0),
|
|
38
38
|
c.value && !e.value && s === c.value ? (t(), a("span", {
|
|
39
39
|
key: 1,
|
|
40
40
|
class: "pill",
|
|
41
41
|
onClick: n[0] || (n[0] = (r) => e.value = !0)
|
|
42
|
-
}, y(
|
|
42
|
+
}, y(A.value) + "+ ", 1)) : k("", !0)
|
|
43
43
|
], 64))), 128)),
|
|
44
44
|
e.value ? (t(), a("span", {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "pill collapse-pill",
|
|
47
47
|
onClick: n[1] || (n[1] = (o) => e.value = !1)
|
|
48
48
|
}, [
|
|
49
|
-
|
|
49
|
+
b(l(T))
|
|
50
50
|
])) : k("", !0)
|
|
51
51
|
]));
|
|
52
52
|
}
|
|
@@ -64,8 +64,8 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
64
64
|
sourcesLinesLimit: { default: Number.MAX_SAFE_INTEGER }
|
|
65
65
|
},
|
|
66
66
|
emits: ["operation", "action"],
|
|
67
|
-
setup(
|
|
68
|
-
const e =
|
|
67
|
+
setup(h, { emit: m }) {
|
|
68
|
+
const e = h, g = {
|
|
69
69
|
copy: Q,
|
|
70
70
|
refresh: K,
|
|
71
71
|
like: J,
|
|
@@ -73,18 +73,18 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
73
73
|
}, c = m, L = (n) => {
|
|
74
74
|
var o, s, r;
|
|
75
75
|
(r = (s = (o = e.operations) == null ? void 0 : o.find((v) => v.name === n)) == null ? void 0 : s.onClick) == null || r.call(s), c("operation", n);
|
|
76
|
-
},
|
|
76
|
+
}, A = (n) => {
|
|
77
77
|
var o, s, r;
|
|
78
78
|
(r = (s = (o = e.actions) == null ? void 0 : o.find((v) => v.name === n)) == null ? void 0 : s.onClick) == null || r.call(s), c("action", n);
|
|
79
|
-
},
|
|
80
|
-
|
|
79
|
+
}, d = E(!1), u = () => {
|
|
80
|
+
d.value = !d.value;
|
|
81
81
|
};
|
|
82
82
|
return (n, o) => {
|
|
83
83
|
var s, r, v, w, B, F, M, G;
|
|
84
84
|
return t(), a("div", te, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(s = e.operations) != null && s.length ? (t(),
|
|
85
|
+
_("div", se, [
|
|
86
|
+
_("div", oe, [
|
|
87
|
+
(s = e.operations) != null && s.length ? (t(), p(l($), {
|
|
88
88
|
key: 0,
|
|
89
89
|
"max-num": e.operationsLimit,
|
|
90
90
|
"drop-down-show-label-only": !0,
|
|
@@ -92,28 +92,28 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
92
92
|
class: "tr-feedback__operations-left-action-group"
|
|
93
93
|
}, {
|
|
94
94
|
moreBtn: f(() => [
|
|
95
|
-
|
|
95
|
+
b(l(R), {
|
|
96
96
|
round: "",
|
|
97
97
|
size: "mini",
|
|
98
98
|
"reset-time": 0,
|
|
99
99
|
class: "tr-feedback__operations-more-btn"
|
|
100
100
|
}, {
|
|
101
101
|
default: f(() => [
|
|
102
|
-
o[0] || (o[0] =
|
|
103
|
-
|
|
102
|
+
o[0] || (o[0] = _("span", null, "更多", -1)),
|
|
103
|
+
b(l(N))
|
|
104
104
|
]),
|
|
105
105
|
_: 1,
|
|
106
106
|
__: [0]
|
|
107
107
|
})
|
|
108
108
|
]),
|
|
109
109
|
default: f(() => [
|
|
110
|
-
(t(!0), a(
|
|
110
|
+
(t(!0), a(I, null, S(e.operations, (i) => (t(), p(l(V), {
|
|
111
111
|
key: i.name,
|
|
112
112
|
name: i.name,
|
|
113
113
|
label: i.label
|
|
114
114
|
}, {
|
|
115
115
|
default: f(() => [
|
|
116
|
-
|
|
116
|
+
b(l(R), {
|
|
117
117
|
round: "",
|
|
118
118
|
"reset-time": 0,
|
|
119
119
|
size: "mini"
|
|
@@ -129,32 +129,32 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
129
129
|
]),
|
|
130
130
|
_: 1
|
|
131
131
|
}, 8, ["max-num"])) : (r = e.sources) != null && r.length ? (t(), a("div", ne, [
|
|
132
|
-
|
|
132
|
+
_("span", {
|
|
133
133
|
class: "tr-feedback__source",
|
|
134
134
|
onClick: u
|
|
135
135
|
}, [
|
|
136
|
-
|
|
137
|
-
(t(),
|
|
136
|
+
_("span", null, y((v = e.sources) == null ? void 0 : v.length) + "条来源", 1),
|
|
137
|
+
(t(), p(C(d.value ? l(T) : l(N))))
|
|
138
138
|
])
|
|
139
139
|
])) : k("", !0)
|
|
140
140
|
]),
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
_("div", le, [
|
|
142
|
+
b(l($), {
|
|
143
143
|
"max-num": e.actionsLimit,
|
|
144
144
|
"show-tooltip": !0,
|
|
145
|
-
onItemClick:
|
|
145
|
+
onItemClick: A
|
|
146
146
|
}, {
|
|
147
147
|
default: f(() => [
|
|
148
|
-
(t(!0), a(
|
|
148
|
+
(t(!0), a(I, null, S(e.actions, (i) => (t(), p(l(V), {
|
|
149
149
|
key: i.name,
|
|
150
150
|
name: i.name,
|
|
151
151
|
label: i.label
|
|
152
152
|
}, {
|
|
153
153
|
default: f(() => [
|
|
154
|
-
typeof i.icon == "string" ? (t(),
|
|
154
|
+
typeof i.icon == "string" ? (t(), p(l(U), {
|
|
155
155
|
key: 0,
|
|
156
156
|
icon: g[i.icon]
|
|
157
|
-
}, null, 8, ["icon"])) : (t(),
|
|
157
|
+
}, null, 8, ["icon"])) : (t(), p(C(i.icon), { key: 1 }))
|
|
158
158
|
]),
|
|
159
159
|
_: 2
|
|
160
160
|
}, 1032, ["name", "label"]))), 128))
|
|
@@ -163,17 +163,17 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
163
163
|
}, 8, ["max-num"])
|
|
164
164
|
])
|
|
165
165
|
]),
|
|
166
|
-
(w = e.operations) != null && w.length && ((B = e.sources) != null && B.length) ||
|
|
166
|
+
(w = e.operations) != null && w.length && ((B = e.sources) != null && B.length) || d.value && e.sources ? (t(), a("div", ae, [
|
|
167
167
|
(F = e.operations) != null && F.length && ((M = e.sources) != null && M.length) ? (t(), a("div", re, [
|
|
168
|
-
|
|
168
|
+
_("span", {
|
|
169
169
|
class: "tr-feedback__source",
|
|
170
170
|
onClick: u
|
|
171
171
|
}, [
|
|
172
|
-
|
|
173
|
-
(t(),
|
|
172
|
+
_("span", null, y((G = e.sources) == null ? void 0 : G.length) + "条来源", 1),
|
|
173
|
+
(t(), p(C(d.value ? l(T) : l(N))))
|
|
174
174
|
])
|
|
175
175
|
])) : k("", !0),
|
|
176
|
-
|
|
176
|
+
d.value && e.sources ? (t(), p(l(ee), {
|
|
177
177
|
key: 1,
|
|
178
178
|
sources: e.sources,
|
|
179
179
|
"lines-limit": e.sourcesLinesLimit
|
|
@@ -182,12 +182,12 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
|
|
|
182
182
|
]);
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
}),
|
|
186
|
-
|
|
187
|
-
const ce = function(
|
|
188
|
-
|
|
185
|
+
}), x = /* @__PURE__ */ P(ie, [["__scopeId", "data-v-cc6ef316"]]);
|
|
186
|
+
x.name = "TrFeedback";
|
|
187
|
+
const ce = function(h) {
|
|
188
|
+
h.component(x.name, x);
|
|
189
189
|
};
|
|
190
|
-
|
|
190
|
+
x.install = ce;
|
|
191
191
|
export {
|
|
192
|
-
|
|
192
|
+
x as default
|
|
193
193
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as b, createBlock as x, resolveDynamicComponent as B, toDisplayString as D, nextTick as H } from "vue";
|
|
2
|
+
import { n as X } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { b as j, o as J } from "../index2.js";
|
|
4
4
|
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const P = ["onClick"], Q = {
|
|
@@ -18,7 +18,7 @@ const P = ["onClick"], Q = {
|
|
|
18
18
|
selectedModifiers: {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
|
|
21
|
-
setup(d, { emit:
|
|
21
|
+
setup(d, { emit: F }) {
|
|
22
22
|
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
@@ -27,7 +27,7 @@ const P = ["onClick"], Q = {
|
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
|
-
const
|
|
30
|
+
const N = F, y = i(null), w = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), A = (t, o) => {
|
|
31
31
|
t && (M.value[o] = t);
|
|
32
32
|
}, L = () => {
|
|
33
33
|
s.value = null, m.value = !1, H(() => {
|
|
@@ -48,7 +48,7 @@ const P = ["onClick"], Q = {
|
|
|
48
48
|
t > 0 && L();
|
|
49
49
|
});
|
|
50
50
|
const z = $(() => s.value !== null ? n.items.slice(s.value) : []), O = $(() => s.value === null ? !1 : n.items.findIndex((o) => o.id === u.value) >= s.value), R = (t) => {
|
|
51
|
-
u.value = t, c.value = !1,
|
|
51
|
+
u.value = t, c.value = !1, N("item-click", t);
|
|
52
52
|
}, V = () => {
|
|
53
53
|
n.showMoreTrigger === "click" && (c.value = !c.value);
|
|
54
54
|
}, v = (t) => {
|
|
@@ -62,18 +62,18 @@ const P = ["onClick"], Q = {
|
|
|
62
62
|
ref_key: "containerRef",
|
|
63
63
|
ref: y
|
|
64
64
|
}, [
|
|
65
|
-
(l(!0), a(I, null,
|
|
65
|
+
(l(!0), a(I, null, S(n.items, (e, f) => (l(), a(I, {
|
|
66
66
|
key: e.id
|
|
67
67
|
}, [
|
|
68
68
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
69
69
|
key: 0,
|
|
70
70
|
class: b(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
71
71
|
ref_for: !0,
|
|
72
|
-
ref: (r) =>
|
|
72
|
+
ref: (r) => A(r, f),
|
|
73
73
|
onClick: (r) => R(e.id)
|
|
74
74
|
}, [
|
|
75
75
|
(l(), x(B(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
76
|
-
e.label ? (l(), a("span", Q,
|
|
76
|
+
e.label ? (l(), a("span", Q, D(e.label), 1)) : _("", !0)
|
|
77
77
|
], 10, P)) : _("", !0)
|
|
78
78
|
], 64))), 128)),
|
|
79
79
|
C("div", U, [
|
|
@@ -99,13 +99,13 @@ const P = ["onClick"], Q = {
|
|
|
99
99
|
ref_key: "dropDownRef",
|
|
100
100
|
ref: k
|
|
101
101
|
}, [
|
|
102
|
-
(l(!0), a(I, null,
|
|
102
|
+
(l(!0), a(I, null, S(z.value, (e) => (l(), a("button", {
|
|
103
103
|
class: b(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
104
104
|
key: e.id,
|
|
105
105
|
onClick: (f) => R(e.id)
|
|
106
106
|
}, [
|
|
107
107
|
(l(), x(B(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
108
|
-
C("span", Z,
|
|
108
|
+
C("span", Z, D(e.label), 1)
|
|
109
109
|
], 10, Y))), 128))
|
|
110
110
|
], 512)) : _("", !0)
|
|
111
111
|
], 32)
|
package/dist/history/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as G, watchEffect as Y, nextTick as Z, mergeModels as N, useCssVars as q, computed as h, useModel as P, createCommentVNode as E, Fragment as T, renderList as $, createBlock as R, withDirectives as ee, mergeProps as te, withCtx as H, withModifiers as S, vModelText as re } from "vue";
|
|
2
|
+
import { w as oe, b as se, p as ae, A as ne, f as ie } from "../tiny-robot-svgs.js";
|
|
3
3
|
import { I as le } from "../index5.js";
|
|
4
4
|
import { T as U } from "../index4.js";
|
|
5
5
|
import B from "../icon-button/index.js";
|
|
6
6
|
import { o as ce } from "../index2.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { _ as A } from "../_plugin-vue_export-helper.js";
|
|
8
8
|
const ue = /* @__PURE__ */ V({
|
|
9
9
|
__name: "item-tag",
|
|
10
10
|
props: {
|
|
@@ -21,7 +21,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
21
21
|
p("span", null, k(t.text), 1)
|
|
22
22
|
], 6));
|
|
23
23
|
}
|
|
24
|
-
}), de = /* @__PURE__ */
|
|
24
|
+
}), de = /* @__PURE__ */ A(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, me = /* @__PURE__ */ V({
|
|
25
25
|
__name: "search-empty",
|
|
26
26
|
props: {
|
|
27
27
|
text: { default: "暂无内容" }
|
|
@@ -30,25 +30,25 @@ const ue = /* @__PURE__ */ V({
|
|
|
30
30
|
const t = i;
|
|
31
31
|
return (a, _) => (n(), u("div", _e, [
|
|
32
32
|
p("span", pe, [
|
|
33
|
-
|
|
33
|
+
m(e(oe))
|
|
34
34
|
]),
|
|
35
|
-
p("span",
|
|
35
|
+
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
38
|
+
}), fe = /* @__PURE__ */ A(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
|
|
39
39
|
const t = G(), a = (l) => {
|
|
40
40
|
t.value = {
|
|
41
41
|
id: l.id,
|
|
42
42
|
title: l.title,
|
|
43
43
|
rawData: l
|
|
44
44
|
};
|
|
45
|
-
}, _ = G(null),
|
|
45
|
+
}, _ = G(null), f = (l) => {
|
|
46
46
|
l && Z(() => {
|
|
47
47
|
_.value = l, _.value.focus();
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
let r;
|
|
51
|
-
const
|
|
51
|
+
const v = () => {
|
|
52
52
|
if (t.value) {
|
|
53
53
|
if (t.value.title !== t.value.rawData.title) {
|
|
54
54
|
const { title: l, rawData: I } = t.value;
|
|
@@ -60,19 +60,19 @@ const ue = /* @__PURE__ */ V({
|
|
|
60
60
|
}, g = () => {
|
|
61
61
|
t.value = void 0, r == null || r(), r = void 0;
|
|
62
62
|
}, b = (l) => {
|
|
63
|
-
l.key === "Enter" ?
|
|
63
|
+
l.key === "Enter" ? v() : l.key === "Escape" && g();
|
|
64
64
|
};
|
|
65
65
|
return Y(() => {
|
|
66
66
|
_.value && (r == null || r(), r = ce(_, () => {
|
|
67
|
-
|
|
67
|
+
v();
|
|
68
68
|
}));
|
|
69
69
|
}), {
|
|
70
70
|
editingItem: t,
|
|
71
71
|
handleEdit: a,
|
|
72
|
-
handleEditorInputRef:
|
|
72
|
+
handleEditorInputRef: f,
|
|
73
73
|
handleKeyDown: b
|
|
74
74
|
};
|
|
75
|
-
},
|
|
75
|
+
}, ye = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
|
|
76
76
|
key: 0,
|
|
77
77
|
class: "tr-history__search"
|
|
78
78
|
}, xe = { class: "tr-history__content" }, Ce = {
|
|
@@ -102,36 +102,36 @@ const ue = /* @__PURE__ */ V({
|
|
|
102
102
|
d4b77bae: b.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
103
103
|
"659130e6": b.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
104
104
|
}));
|
|
105
|
-
const a = i, _ = P(i, "activeTab"),
|
|
105
|
+
const a = i, _ = P(i, "activeTab"), f = P(i, "searchQuery"), r = t, v = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || v.value[0].id), b = h(() => v.value.length > 1), l = (c) => {
|
|
106
106
|
var s;
|
|
107
107
|
const o = typeof ((s = c[0]) == null ? void 0 : s.group);
|
|
108
108
|
return o === "string" || o === "symbol";
|
|
109
|
-
}, I =
|
|
109
|
+
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), M = h(() => {
|
|
110
110
|
const c = I.value;
|
|
111
111
|
return l(c) ? c : [{ group: w, items: c }];
|
|
112
|
-
}), x =
|
|
112
|
+
}), x = h(() => a.searchBar ? M.value.map((o) => ({
|
|
113
113
|
...o,
|
|
114
|
-
items: o.items.filter((s) => a.searchFn(
|
|
115
|
-
})).filter((o) => o.items.length > 0) :
|
|
114
|
+
items: o.items.filter((s) => a.searchFn(f.value || "", s))
|
|
115
|
+
})).filter((o) => o.items.length > 0) : M.value), L = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), z = (c) => {
|
|
116
116
|
var o;
|
|
117
117
|
c.id !== ((o = C.value) == null ? void 0 : o.id) && r("item-click", c);
|
|
118
118
|
}, W = () => {
|
|
119
119
|
r("close");
|
|
120
120
|
}, F = (c) => {
|
|
121
121
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown:
|
|
123
|
-
return (c, o) => (n(), u("div",
|
|
122
|
+
}, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: O } = ve(r);
|
|
123
|
+
return (c, o) => (n(), u("div", ye, [
|
|
124
124
|
p("div", ke, [
|
|
125
|
-
(n(!0), u(T, null, $(
|
|
125
|
+
(n(!0), u(T, null, $(v.value, (s) => (n(), u("div", {
|
|
126
126
|
key: s.id,
|
|
127
127
|
class: D(["tr-history__tab", { active: g.value === s.id }]),
|
|
128
128
|
onClick: (d) => _.value = s.id
|
|
129
129
|
}, k(s.title), 11, ge))), 128))
|
|
130
130
|
]),
|
|
131
131
|
a.searchBar ? (n(), u("div", be, [
|
|
132
|
-
|
|
133
|
-
modelValue:
|
|
134
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) =>
|
|
132
|
+
m(e(le), {
|
|
133
|
+
modelValue: f.value,
|
|
134
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => f.value = s),
|
|
135
135
|
placeholder: a.searchPlaceholder || "搜索对话名称",
|
|
136
136
|
"prefix-icon": e(se),
|
|
137
137
|
clearable: ""
|
|
@@ -146,43 +146,43 @@ const ue = /* @__PURE__ */ V({
|
|
|
146
146
|
p("span", null, k(s.group), 1)
|
|
147
147
|
])) : E("", !0),
|
|
148
148
|
(n(!0), u(T, null, $(s.items, (d) => {
|
|
149
|
-
var
|
|
149
|
+
var Q;
|
|
150
150
|
return n(), u("div", {
|
|
151
151
|
key: `${d.id}-${d.title}`,
|
|
152
152
|
class: D(["tr-history__item", { selected: a.selected === d.id }]),
|
|
153
|
-
onClick: (
|
|
153
|
+
onClick: (y) => z(d)
|
|
154
154
|
}, [
|
|
155
|
-
((
|
|
155
|
+
((Q = e(C)) == null ? void 0 : Q.id) !== d.id ? (n(), u(T, { key: 0 }, [
|
|
156
156
|
p("span", Ie, k(d.title), 1),
|
|
157
157
|
d.tag ? (n(), R(e(de), te({
|
|
158
158
|
key: 0,
|
|
159
159
|
class: "tr-history__item-tag"
|
|
160
160
|
}, { ref_for: !0 }, d.tag), null, 16)) : E("", !0),
|
|
161
161
|
p("div", we, [
|
|
162
|
-
|
|
162
|
+
m(e(U), {
|
|
163
163
|
content: "编辑",
|
|
164
164
|
effect: "dark",
|
|
165
165
|
placement: "top",
|
|
166
166
|
"open-delay": 500
|
|
167
167
|
}, {
|
|
168
168
|
default: H(() => [
|
|
169
|
-
|
|
169
|
+
m(e(B), {
|
|
170
170
|
icon: e(ae),
|
|
171
|
-
onClick: S((
|
|
171
|
+
onClick: S((y) => e(j)(d), ["stop"])
|
|
172
172
|
}, null, 8, ["icon", "onClick"])
|
|
173
173
|
]),
|
|
174
174
|
_: 2
|
|
175
175
|
}, 1024),
|
|
176
|
-
|
|
176
|
+
m(e(U), {
|
|
177
177
|
content: "删除",
|
|
178
178
|
effect: "dark",
|
|
179
179
|
placement: "top",
|
|
180
180
|
"open-delay": 500
|
|
181
181
|
}, {
|
|
182
182
|
default: H(() => [
|
|
183
|
-
|
|
183
|
+
m(e(B), {
|
|
184
184
|
icon: e(ne),
|
|
185
|
-
onClick: S((
|
|
185
|
+
onClick: S((y) => F(d), ["stop"])
|
|
186
186
|
}, null, 8, ["icon", "onClick"])
|
|
187
187
|
]),
|
|
188
188
|
_: 2
|
|
@@ -190,24 +190,24 @@ const ue = /* @__PURE__ */ V({
|
|
|
190
190
|
])
|
|
191
191
|
], 64)) : ee((n(), u("input", {
|
|
192
192
|
key: 1,
|
|
193
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
193
|
+
"onUpdate:modelValue": o[1] || (o[1] = (y) => e(C).title = y),
|
|
194
194
|
class: "tr-history__item-edit",
|
|
195
195
|
ref_for: !0,
|
|
196
196
|
ref: e(J),
|
|
197
197
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
198
|
-
(...
|
|
198
|
+
(...y) => e(O) && e(O)(...y))
|
|
199
199
|
}, null, 544)), [
|
|
200
200
|
[re, e(C).title]
|
|
201
201
|
])
|
|
202
202
|
], 10, Te);
|
|
203
203
|
}), 128))
|
|
204
|
-
]))), 128)) : (n(), R(e(
|
|
204
|
+
]))), 128)) : (n(), R(e(fe), {
|
|
205
205
|
key: 1,
|
|
206
|
-
text:
|
|
206
|
+
text: f.value ? "暂无搜索结果" : "暂无内容"
|
|
207
207
|
}, null, 8, ["text"]))
|
|
208
208
|
]),
|
|
209
209
|
p("div", Ee, [
|
|
210
|
-
|
|
210
|
+
m(e(B), {
|
|
211
211
|
icon: e(ie),
|
|
212
212
|
rounded: "",
|
|
213
213
|
onClick: W
|
|
@@ -215,7 +215,7 @@ const ue = /* @__PURE__ */ V({
|
|
|
215
215
|
])
|
|
216
216
|
]));
|
|
217
217
|
}
|
|
218
|
-
}), K = /* @__PURE__ */
|
|
218
|
+
}), K = /* @__PURE__ */ A($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
|
|
219
219
|
i.component("TrHistory", K);
|
|
220
220
|
}, Ne = {
|
|
221
221
|
...K,
|
package/dist/index.d.ts
CHANGED
|
@@ -1832,10 +1832,12 @@ export declare const BubbleChainMessageRenderer: DefineComponent< {
|
|
|
1832
1832
|
items: ChainItem[];
|
|
1833
1833
|
html?: boolean;
|
|
1834
1834
|
contentClass?: string;
|
|
1835
|
+
contentRenderer?: (content: string) => string;
|
|
1835
1836
|
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
1836
1837
|
items: ChainItem[];
|
|
1837
1838
|
html?: boolean;
|
|
1838
1839
|
contentClass?: string;
|
|
1840
|
+
contentRenderer?: (content: string) => string;
|
|
1839
1841
|
}> & Readonly<{}>, {
|
|
1840
1842
|
html: boolean;
|
|
1841
1843
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1892,14 +1894,15 @@ export declare interface BubbleListProps {
|
|
|
1892
1894
|
}
|
|
1893
1895
|
|
|
1894
1896
|
export declare class BubbleMarkdownMessageRenderer extends BubbleMessageClassRenderer {
|
|
1897
|
+
readonly md: default_2;
|
|
1895
1898
|
readonly mdConfig: Options;
|
|
1896
|
-
readonly dompurifyConfig: Config
|
|
1897
|
-
|
|
1899
|
+
readonly dompurifyConfig: Config;
|
|
1900
|
+
readonly sanitizeDisabled: boolean;
|
|
1901
|
+
readonly styleOptions: {
|
|
1902
|
+
class?: string;
|
|
1903
|
+
style?: string;
|
|
1898
1904
|
};
|
|
1899
|
-
|
|
1900
|
-
constructor(mdConfig?: Options, dompurifyConfig?: Config & {
|
|
1901
|
-
disable?: boolean;
|
|
1902
|
-
});
|
|
1905
|
+
constructor({ mdConfig, dompurifyConfig, sanitizeDisabled, styleOptions }?: BubbleMarkdownRendererOptions);
|
|
1903
1906
|
render(options: {
|
|
1904
1907
|
content?: string;
|
|
1905
1908
|
}): VNode<RendererNode, RendererElement, {
|
|
@@ -1907,6 +1910,16 @@ export declare class BubbleMarkdownMessageRenderer extends BubbleMessageClassRen
|
|
|
1907
1910
|
}>;
|
|
1908
1911
|
}
|
|
1909
1912
|
|
|
1913
|
+
declare interface BubbleMarkdownRendererOptions {
|
|
1914
|
+
mdConfig?: Options;
|
|
1915
|
+
dompurifyConfig?: Config;
|
|
1916
|
+
sanitizeDisabled?: boolean;
|
|
1917
|
+
styleOptions?: {
|
|
1918
|
+
class?: string;
|
|
1919
|
+
style?: string;
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1910
1923
|
export declare abstract class BubbleMessageClassRenderer {
|
|
1911
1924
|
abstract render(options: {
|
|
1912
1925
|
[key: string]: any;
|
|
@@ -1922,7 +1935,10 @@ export declare interface BubbleMessageProps {
|
|
|
1922
1935
|
[key: string]: any;
|
|
1923
1936
|
}
|
|
1924
1937
|
|
|
1925
|
-
export declare type BubbleMessageRenderer = BubbleMessageFunctionRenderer | BubbleMessageClassRenderer | Component
|
|
1938
|
+
export declare type BubbleMessageRenderer = BubbleMessageFunctionRenderer | BubbleMessageClassRenderer | Component | {
|
|
1939
|
+
component: Component;
|
|
1940
|
+
defaultProps: Record<string, unknown>;
|
|
1941
|
+
};
|
|
1926
1942
|
|
|
1927
1943
|
export declare interface BubbleProps extends BubbleCommonProps {
|
|
1928
1944
|
/**
|