@opentiny/tiny-robot 0.3.0-alpha.8 → 0.3.0-rc.0
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 +19 -19
- package/dist/attachments/index.js +266 -266
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +1460 -1435
- package/dist/container/index.js +35 -35
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +123 -51
- package/dist/feedback/index.js +72 -72
- package/dist/flow-layout-buttons/index.js +15 -15
- package/dist/history/index.js +72 -73
- package/dist/index.d.ts +210 -202
- package/dist/index.js +98 -98
- package/dist/index2.js +680 -608
- package/dist/index3.js +148 -675
- package/dist/mcp-server-picker/index.js +572 -29518
- package/dist/no-data.js +4 -0
- package/dist/sender/index.js +883 -815
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +31 -31
- package/dist/suggestion-popover/index.js +169 -162
- package/dist/useSlotRefs.js +13 -13
- package/dist/utils.js +8 -2
- package/package.json +4 -14
- package/dist/close.js +0 -29
- package/dist/index4.js +0 -146
- package/dist/index5.js +0 -316
- package/dist/index6.js +0 -2352
- package/dist/index7.js +0 -6654
- package/dist/question/index.js +0 -429
- package/dist/suggestion/index.js +0 -497
- package/dist/tiny-robot-svgs.js +0 -1139
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import { e as j, o as J } from "../
|
|
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 I, Fragment as C, renderList as D, createCommentVNode as _, normalizeClass as x, createBlock as B, resolveDynamicComponent as b, toDisplayString as S, nextTick as H } from "vue";
|
|
2
|
+
import { IconArrowDown as X } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { e 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 = {
|
|
6
6
|
key: 0,
|
|
@@ -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: A }) {
|
|
22
22
|
const n = d, u = G(d, "selected");
|
|
23
23
|
g(
|
|
24
24
|
() => n.items,
|
|
@@ -27,11 +27,11 @@ const P = ["onClick"], Q = {
|
|
|
27
27
|
},
|
|
28
28
|
{ immediate: !0 }
|
|
29
29
|
);
|
|
30
|
-
const F =
|
|
30
|
+
const F = A, w = i(null), y = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), N = (t, o) => {
|
|
31
31
|
t && (M.value[o] = t);
|
|
32
32
|
}, L = () => {
|
|
33
33
|
s.value = null, m.value = !1, H(() => {
|
|
34
|
-
const t =
|
|
34
|
+
const t = w.value, o = y.value;
|
|
35
35
|
if (!t || !o)
|
|
36
36
|
return;
|
|
37
37
|
const e = M.value.slice(0, n.items.length).filter((r) => !!r).map((r) => r.offsetTop), f = Array.from(new Set(e));
|
|
@@ -43,7 +43,7 @@ const P = ["onClick"], Q = {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
g(() => n.items, L);
|
|
46
|
-
const { width: W } = j(
|
|
46
|
+
const { width: W } = j(w);
|
|
47
47
|
g(W, (t) => {
|
|
48
48
|
t > 0 && L();
|
|
49
49
|
});
|
|
@@ -59,13 +59,13 @@ const P = ["onClick"], Q = {
|
|
|
59
59
|
() => {
|
|
60
60
|
c.value = !1;
|
|
61
61
|
},
|
|
62
|
-
{ ignore: [k,
|
|
62
|
+
{ ignore: [k, y] }
|
|
63
63
|
), (t, o) => (l(), a("div", {
|
|
64
64
|
class: "tr-flow-layout",
|
|
65
65
|
ref_key: "containerRef",
|
|
66
|
-
ref:
|
|
66
|
+
ref: w
|
|
67
67
|
}, [
|
|
68
|
-
(l(!0), a(
|
|
68
|
+
(l(!0), a(C, null, D(n.items, (e, f) => (l(), a(C, {
|
|
69
69
|
key: e.id
|
|
70
70
|
}, [
|
|
71
71
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
@@ -79,19 +79,19 @@ const P = ["onClick"], Q = {
|
|
|
79
79
|
e.label ? (l(), a("span", Q, S(e.label), 1)) : _("", !0)
|
|
80
80
|
], 10, P)) : _("", !0)
|
|
81
81
|
], 64))), 128)),
|
|
82
|
-
|
|
82
|
+
I("div", U, [
|
|
83
83
|
m.value ? _("", !0) : (l(), a("button", {
|
|
84
84
|
key: 0,
|
|
85
85
|
class: x(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
86
86
|
ref_key: "moreButtonRef",
|
|
87
|
-
ref:
|
|
87
|
+
ref: y,
|
|
88
88
|
onClick: V,
|
|
89
89
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
90
90
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
91
91
|
}, [
|
|
92
92
|
(l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
93
93
|
], 34)),
|
|
94
|
-
|
|
94
|
+
I("div", {
|
|
95
95
|
class: "tr-flow-layout__dropdown-container",
|
|
96
96
|
onMouseenter: o[2] || (o[2] = (e) => v(!0)),
|
|
97
97
|
onMouseleave: o[3] || (o[3] = (e) => v(!1))
|
|
@@ -102,13 +102,13 @@ const P = ["onClick"], Q = {
|
|
|
102
102
|
ref_key: "dropDownRef",
|
|
103
103
|
ref: k
|
|
104
104
|
}, [
|
|
105
|
-
(l(!0), a(
|
|
105
|
+
(l(!0), a(C, null, D(z.value, (e) => (l(), a("button", {
|
|
106
106
|
class: x(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
107
107
|
key: e.id,
|
|
108
108
|
onClick: (f) => R(e.id)
|
|
109
109
|
}, [
|
|
110
110
|
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
111
|
-
|
|
111
|
+
I("span", Z, S(e.label), 1)
|
|
112
112
|
], 10, Y))), 128))
|
|
113
113
|
], 512)) : _("", !0)
|
|
114
114
|
], 32)
|
package/dist/history/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { defineComponent as V, createElementBlock as u, openBlock as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { T as H } from "../index2.js";
|
|
1
|
+
import { defineComponent as V, createElementBlock as u, openBlock as a, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as y, unref as e, ref as S, watchEffect as Y, nextTick as Z, mergeModels as A, useCssVars as q, computed as h, useModel as G, createCommentVNode as w, Fragment as T, renderList as $, createBlock as N, withDirectives as ee, mergeProps as te, withCtx as R, withModifiers as H, vModelText as re } from "vue";
|
|
2
|
+
import { IconEmptySearch as oe, IconSearch as se, IconEditPen as ne, IconDelete as ae, IconClose as ie } from "@opentiny/tiny-robot-svgs";
|
|
3
|
+
import { TinyInput as le, TinyTooltip as U } from "@opentiny/vue";
|
|
5
4
|
import B from "../icon-button/index.js";
|
|
6
|
-
import { o as ce } from "../
|
|
7
|
-
import { _ as
|
|
5
|
+
import { o as ce } from "../index2.js";
|
|
6
|
+
import { _ as M } from "../_plugin-vue_export-helper.js";
|
|
8
7
|
const ue = /* @__PURE__ */ V({
|
|
9
8
|
__name: "item-tag",
|
|
10
9
|
props: {
|
|
@@ -14,41 +13,41 @@ const ue = /* @__PURE__ */ V({
|
|
|
14
13
|
},
|
|
15
14
|
setup(i) {
|
|
16
15
|
const t = i;
|
|
17
|
-
return (
|
|
16
|
+
return (n, _) => (a(), u("div", {
|
|
18
17
|
class: D(["tr-history__item-tag", t.type]),
|
|
19
18
|
style: X(t.style)
|
|
20
19
|
}, [
|
|
21
20
|
p("span", null, k(t.text), 1)
|
|
22
21
|
], 6));
|
|
23
22
|
}
|
|
24
|
-
}), de = /* @__PURE__ */
|
|
23
|
+
}), de = /* @__PURE__ */ M(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, ye = /* @__PURE__ */ V({
|
|
25
24
|
__name: "search-empty",
|
|
26
25
|
props: {
|
|
27
26
|
text: { default: "暂无内容" }
|
|
28
27
|
},
|
|
29
28
|
setup(i) {
|
|
30
29
|
const t = i;
|
|
31
|
-
return (
|
|
30
|
+
return (n, _) => (a(), u("div", _e, [
|
|
32
31
|
p("span", pe, [
|
|
33
|
-
|
|
32
|
+
y(e(oe))
|
|
34
33
|
]),
|
|
35
34
|
p("span", he, k(t.text), 1)
|
|
36
35
|
]));
|
|
37
36
|
}
|
|
38
|
-
}),
|
|
39
|
-
const t =
|
|
37
|
+
}), me = /* @__PURE__ */ M(ye, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
|
|
38
|
+
const t = S(), n = (l) => {
|
|
40
39
|
t.value = {
|
|
41
40
|
id: l.id,
|
|
42
41
|
title: l.title,
|
|
43
42
|
rawData: l
|
|
44
43
|
};
|
|
45
|
-
}, _ =
|
|
44
|
+
}, _ = S(null), m = (l) => {
|
|
46
45
|
l && Z(() => {
|
|
47
46
|
_.value = l, _.value.focus();
|
|
48
47
|
});
|
|
49
48
|
};
|
|
50
49
|
let r;
|
|
51
|
-
const
|
|
50
|
+
const v = () => {
|
|
52
51
|
if (t.value) {
|
|
53
52
|
if (t.value.title !== t.value.rawData.title) {
|
|
54
53
|
const { title: l, rawData: I } = t.value;
|
|
@@ -60,27 +59,27 @@ const ue = /* @__PURE__ */ V({
|
|
|
60
59
|
}, g = () => {
|
|
61
60
|
t.value = void 0, r == null || r(), r = void 0;
|
|
62
61
|
}, b = (l) => {
|
|
63
|
-
l.key === "Enter" ?
|
|
62
|
+
l.key === "Enter" ? v() : l.key === "Escape" && g();
|
|
64
63
|
};
|
|
65
64
|
return Y(() => {
|
|
66
65
|
_.value && (r == null || r(), r = ce(_, () => {
|
|
67
|
-
|
|
66
|
+
v();
|
|
68
67
|
}));
|
|
69
68
|
}), {
|
|
70
69
|
editingItem: t,
|
|
71
|
-
handleEdit:
|
|
72
|
-
handleEditorInputRef:
|
|
70
|
+
handleEdit: n,
|
|
71
|
+
handleEditorInputRef: m,
|
|
73
72
|
handleKeyDown: b
|
|
74
73
|
};
|
|
75
74
|
}, fe = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
|
|
76
75
|
key: 0,
|
|
77
76
|
class: "tr-history__search"
|
|
78
|
-
},
|
|
77
|
+
}, Ce = { class: "tr-history__content" }, xe = {
|
|
79
78
|
key: 0,
|
|
80
79
|
class: "tr-history__group-title"
|
|
81
|
-
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" },
|
|
80
|
+
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, Ee = { class: "tr-history__item-actions" }, we = { class: "tr-history__close" }, $e = /* @__PURE__ */ V({
|
|
82
81
|
__name: "index",
|
|
83
|
-
props: /* @__PURE__ */
|
|
82
|
+
props: /* @__PURE__ */ A({
|
|
84
83
|
tabTitle: {},
|
|
85
84
|
data: {},
|
|
86
85
|
activeTab: {},
|
|
@@ -96,118 +95,118 @@ const ue = /* @__PURE__ */ V({
|
|
|
96
95
|
searchQuery: {},
|
|
97
96
|
searchQueryModifiers: {}
|
|
98
97
|
}),
|
|
99
|
-
emits: /* @__PURE__ */
|
|
98
|
+
emits: /* @__PURE__ */ A(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
|
|
100
99
|
setup(i, { emit: t }) {
|
|
101
100
|
q((c) => ({
|
|
102
|
-
|
|
103
|
-
"
|
|
101
|
+
"3a9ca538": b.value ? "1px solid rgb(240, 240, 240)" : "none",
|
|
102
|
+
"0b9d3e32": b.value ? "2px solid rgb(25, 25, 25)" : "none"
|
|
104
103
|
}));
|
|
105
|
-
const
|
|
104
|
+
const n = i, _ = G(i, "activeTab"), m = G(i, "searchQuery"), r = t, v = h(() => Array.isArray(n.tabs) ? n.tabs : [{ title: n.tabTitle, id: "0" }]), g = h(() => _.value || v.value[0].id), b = h(() => v.value.length > 1), l = (c) => {
|
|
106
105
|
var s;
|
|
107
106
|
const o = typeof ((s = c[0]) == null ? void 0 : s.group);
|
|
108
107
|
return o === "string" || o === "symbol";
|
|
109
|
-
}, I = h(() => Array.isArray(
|
|
108
|
+
}, I = h(() => Array.isArray(n.data) ? n.data || [] : n.data[g.value] || []), E = Symbol("NO_GROUP"), O = h(() => {
|
|
110
109
|
const c = I.value;
|
|
111
|
-
return l(c) ? c : [{ group:
|
|
112
|
-
}),
|
|
110
|
+
return l(c) ? c : [{ group: E, items: c }];
|
|
111
|
+
}), C = h(() => n.searchBar ? O.value.map((o) => ({
|
|
113
112
|
...o,
|
|
114
|
-
items: o.items.filter((s) =>
|
|
115
|
-
})).filter((o) => o.items.length > 0) :
|
|
113
|
+
items: o.items.filter((s) => n.searchFn(m.value || "", s))
|
|
114
|
+
})).filter((o) => o.items.length > 0) : O.value), L = h(() => C.value.length === 0 ? !1 : C.value[0].group === E ? C.value[0].items.length > 0 : !0), z = (c) => {
|
|
116
115
|
var o;
|
|
117
|
-
c.id !== ((o =
|
|
116
|
+
c.id !== ((o = x.value) == null ? void 0 : o.id) && r("item-click", c);
|
|
118
117
|
}, W = () => {
|
|
119
118
|
r("close");
|
|
120
119
|
}, F = (c) => {
|
|
121
120
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem:
|
|
123
|
-
return (c, o) => (
|
|
121
|
+
}, { editingItem: x, handleEdit: j, handleEditorInputRef: J, handleKeyDown: P } = ve(r);
|
|
122
|
+
return (c, o) => (a(), u("div", fe, [
|
|
124
123
|
p("div", ke, [
|
|
125
|
-
(
|
|
124
|
+
(a(!0), u(T, null, $(v.value, (s) => (a(), u("div", {
|
|
126
125
|
key: s.id,
|
|
127
126
|
class: D(["tr-history__tab", { active: g.value === s.id }]),
|
|
128
127
|
onClick: (d) => _.value = s.id
|
|
129
128
|
}, k(s.title), 11, ge))), 128))
|
|
130
129
|
]),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
modelValue:
|
|
134
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) =>
|
|
135
|
-
placeholder:
|
|
130
|
+
n.searchBar ? (a(), u("div", be, [
|
|
131
|
+
y(e(le), {
|
|
132
|
+
modelValue: m.value,
|
|
133
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => m.value = s),
|
|
134
|
+
placeholder: n.searchPlaceholder || "搜索对话名称",
|
|
136
135
|
"prefix-icon": e(se),
|
|
137
136
|
clearable: ""
|
|
138
137
|
}, null, 8, ["modelValue", "placeholder", "prefix-icon"])
|
|
139
|
-
])) :
|
|
140
|
-
p("div",
|
|
141
|
-
|
|
138
|
+
])) : w("", !0),
|
|
139
|
+
p("div", Ce, [
|
|
140
|
+
L.value ? (a(!0), u(T, { key: 0 }, $(C.value, (s) => (a(), u("div", {
|
|
142
141
|
key: s.group,
|
|
143
142
|
class: "tr-history__group"
|
|
144
143
|
}, [
|
|
145
|
-
s.group !== e(
|
|
144
|
+
s.group !== e(E) ? (a(), u("div", xe, [
|
|
146
145
|
p("span", null, k(s.group), 1)
|
|
147
|
-
])) :
|
|
148
|
-
(
|
|
146
|
+
])) : w("", !0),
|
|
147
|
+
(a(!0), u(T, null, $(s.items, (d) => {
|
|
149
148
|
var Q;
|
|
150
|
-
return
|
|
149
|
+
return a(), u("div", {
|
|
151
150
|
key: `${d.id}-${d.title}`,
|
|
152
|
-
class: D(["tr-history__item", { selected:
|
|
153
|
-
onClick: (f) =>
|
|
151
|
+
class: D(["tr-history__item", { selected: n.selected === d.id }]),
|
|
152
|
+
onClick: (f) => z(d)
|
|
154
153
|
}, [
|
|
155
|
-
((Q = e(
|
|
154
|
+
((Q = e(x)) == null ? void 0 : Q.id) !== d.id ? (a(), u(T, { key: 0 }, [
|
|
156
155
|
p("span", Ie, k(d.title), 1),
|
|
157
|
-
d.tag ? (
|
|
156
|
+
d.tag ? (a(), N(e(de), te({
|
|
158
157
|
key: 0,
|
|
159
158
|
class: "tr-history__item-tag"
|
|
160
|
-
}, { ref_for: !0 }, d.tag), null, 16)) :
|
|
161
|
-
p("div",
|
|
162
|
-
|
|
159
|
+
}, { ref_for: !0 }, d.tag), null, 16)) : w("", !0),
|
|
160
|
+
p("div", Ee, [
|
|
161
|
+
y(e(U), {
|
|
163
162
|
content: "编辑",
|
|
164
163
|
effect: "dark",
|
|
165
164
|
placement: "top",
|
|
166
165
|
"open-delay": 500
|
|
167
166
|
}, {
|
|
168
167
|
default: R(() => [
|
|
169
|
-
|
|
170
|
-
icon: e(
|
|
171
|
-
onClick:
|
|
168
|
+
y(e(B), {
|
|
169
|
+
icon: e(ne),
|
|
170
|
+
onClick: H((f) => e(j)(d), ["stop"])
|
|
172
171
|
}, null, 8, ["icon", "onClick"])
|
|
173
172
|
]),
|
|
174
173
|
_: 2
|
|
175
174
|
}, 1024),
|
|
176
|
-
|
|
175
|
+
y(e(U), {
|
|
177
176
|
content: "删除",
|
|
178
177
|
effect: "dark",
|
|
179
178
|
placement: "top",
|
|
180
179
|
"open-delay": 500
|
|
181
180
|
}, {
|
|
182
181
|
default: R(() => [
|
|
183
|
-
|
|
184
|
-
icon: e(
|
|
185
|
-
onClick:
|
|
182
|
+
y(e(B), {
|
|
183
|
+
icon: e(ae),
|
|
184
|
+
onClick: H((f) => F(d), ["stop"])
|
|
186
185
|
}, null, 8, ["icon", "onClick"])
|
|
187
186
|
]),
|
|
188
187
|
_: 2
|
|
189
188
|
}, 1024)
|
|
190
189
|
])
|
|
191
|
-
], 64)) : ee((
|
|
190
|
+
], 64)) : ee((a(), u("input", {
|
|
192
191
|
key: 1,
|
|
193
|
-
"onUpdate:modelValue": o[1] || (o[1] = (f) => e(
|
|
192
|
+
"onUpdate:modelValue": o[1] || (o[1] = (f) => e(x).title = f),
|
|
194
193
|
class: "tr-history__item-edit",
|
|
195
194
|
ref_for: !0,
|
|
196
195
|
ref: e(J),
|
|
197
196
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
198
|
-
(...f) => e(
|
|
197
|
+
(...f) => e(P) && e(P)(...f))
|
|
199
198
|
}, null, 544)), [
|
|
200
|
-
[re, e(
|
|
199
|
+
[re, e(x).title]
|
|
201
200
|
])
|
|
202
201
|
], 10, Te);
|
|
203
202
|
}), 128))
|
|
204
|
-
]))), 128)) : (
|
|
203
|
+
]))), 128)) : (a(), N(e(me), {
|
|
205
204
|
key: 1,
|
|
206
|
-
text:
|
|
205
|
+
text: m.value ? "暂无搜索结果" : "暂无内容"
|
|
207
206
|
}, null, 8, ["text"]))
|
|
208
207
|
]),
|
|
209
|
-
p("div",
|
|
210
|
-
|
|
208
|
+
p("div", we, [
|
|
209
|
+
y(e(B), {
|
|
211
210
|
icon: e(ie),
|
|
212
211
|
rounded: "",
|
|
213
212
|
onClick: W
|
|
@@ -215,13 +214,13 @@ const ue = /* @__PURE__ */ V({
|
|
|
215
214
|
])
|
|
216
215
|
]));
|
|
217
216
|
}
|
|
218
|
-
}),
|
|
219
|
-
i.component("TrHistory",
|
|
220
|
-
},
|
|
221
|
-
...
|
|
217
|
+
}), K = /* @__PURE__ */ M($e, [["__scopeId", "data-v-87ea1242"]]), Be = function(i) {
|
|
218
|
+
i.component("TrHistory", K);
|
|
219
|
+
}, Se = {
|
|
220
|
+
...K,
|
|
222
221
|
install: Be,
|
|
223
222
|
name: "TrHistory"
|
|
224
223
|
};
|
|
225
224
|
export {
|
|
226
|
-
|
|
225
|
+
Se as default
|
|
227
226
|
};
|