@opentiny/tiny-robot 0.3.0-alpha.16 → 0.3.0-alpha.18
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 +44 -41
- package/dist/attachments/index.js +526 -0
- package/dist/base-popper/index.js +4 -0
- package/dist/bubble/index.js +1112 -1163
- package/dist/close.js +1 -1
- package/dist/container/index.js +30 -30
- package/dist/drag-overlay/index.js +57 -0
- package/dist/dropdown-menu/index.js +151 -64
- package/dist/feedback/index.js +52 -52
- package/dist/flow-layout-buttons/index.js +17 -14
- package/dist/history/index.js +49 -49
- package/dist/icon-button/index.js +18 -19
- package/dist/index.d.ts +1180 -926
- package/dist/index.js +206 -77
- package/dist/index2.js +610 -530
- package/dist/index3.js +692 -297
- package/dist/index4.js +146 -622
- package/dist/index5.js +227 -2067
- package/dist/index6.js +2255 -4652
- package/dist/index7.js +6654 -0
- package/dist/mcp-server-picker/index.js +29978 -0
- package/dist/question/index.js +35 -35
- package/dist/sender/index.js +1129 -1199
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +61 -61
- package/dist/suggestion-pills/index.js +131 -155
- package/dist/suggestion-popover/index.js +250 -219
- package/dist/tiny-robot-svgs.js +679 -180
- package/dist/useSlotRefs.js +36 -0
- package/dist/utils.js +8 -13
- package/package.json +10 -3
|
@@ -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 C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as
|
|
2
|
-
import {
|
|
3
|
-
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 x, createBlock as B, resolveDynamicComponent as b, toDisplayString as D, nextTick as H } from "vue";
|
|
2
|
+
import { a as X } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { e as j, o as J } from "../index3.js";
|
|
4
4
|
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const P = ["onClick"], Q = {
|
|
6
6
|
key: 0,
|
|
@@ -54,10 +54,13 @@ const P = ["onClick"], Q = {
|
|
|
54
54
|
}, v = (t) => {
|
|
55
55
|
n.showMoreTrigger === "hover" && (c.value = t);
|
|
56
56
|
};
|
|
57
|
-
return J(
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
57
|
+
return J(
|
|
58
|
+
k,
|
|
59
|
+
() => {
|
|
60
|
+
c.value = !1;
|
|
61
|
+
},
|
|
62
|
+
{ ignore: [k, w] }
|
|
63
|
+
), (t, o) => (l(), a("div", {
|
|
61
64
|
class: "tr-flow-layout",
|
|
62
65
|
ref_key: "containerRef",
|
|
63
66
|
ref: y
|
|
@@ -67,26 +70,26 @@ const P = ["onClick"], Q = {
|
|
|
67
70
|
}, [
|
|
68
71
|
s.value === null || f < s.value ? (l(), a("button", {
|
|
69
72
|
key: 0,
|
|
70
|
-
class:
|
|
73
|
+
class: x(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
|
|
71
74
|
ref_for: !0,
|
|
72
75
|
ref: (r) => A(r, f),
|
|
73
76
|
onClick: (r) => R(e.id)
|
|
74
77
|
}, [
|
|
75
|
-
(l(),
|
|
78
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
76
79
|
e.label ? (l(), a("span", Q, D(e.label), 1)) : _("", !0)
|
|
77
80
|
], 10, P)) : _("", !0)
|
|
78
81
|
], 64))), 128)),
|
|
79
82
|
C("div", U, [
|
|
80
83
|
m.value ? _("", !0) : (l(), a("button", {
|
|
81
84
|
key: 0,
|
|
82
|
-
class:
|
|
85
|
+
class: x(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
|
|
83
86
|
ref_key: "moreButtonRef",
|
|
84
87
|
ref: w,
|
|
85
88
|
onClick: V,
|
|
86
89
|
onMouseenter: o[0] || (o[0] = (e) => v(!0)),
|
|
87
90
|
onMouseleave: o[1] || (o[1] = (e) => v(!1))
|
|
88
91
|
}, [
|
|
89
|
-
(l(),
|
|
92
|
+
(l(), B(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
|
|
90
93
|
], 34)),
|
|
91
94
|
C("div", {
|
|
92
95
|
class: "tr-flow-layout__dropdown-container",
|
|
@@ -100,11 +103,11 @@ const P = ["onClick"], Q = {
|
|
|
100
103
|
ref: k
|
|
101
104
|
}, [
|
|
102
105
|
(l(!0), a(I, null, S(z.value, (e) => (l(), a("button", {
|
|
103
|
-
class:
|
|
106
|
+
class: x(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
|
|
104
107
|
key: e.id,
|
|
105
108
|
onClick: (f) => R(e.id)
|
|
106
109
|
}, [
|
|
107
|
-
(l(),
|
|
110
|
+
(l(), B(b(e.icon), { class: "tr-flow-layout__item-icon" })),
|
|
108
111
|
C("span", Z, D(e.label), 1)
|
|
109
112
|
], 10, Y))), 128))
|
|
110
113
|
], 512)) : _("", !0)
|
|
@@ -112,7 +115,7 @@ const P = ["onClick"], Q = {
|
|
|
112
115
|
])
|
|
113
116
|
], 512));
|
|
114
117
|
}
|
|
115
|
-
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-
|
|
118
|
+
}), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-f82cf3dc"]]);
|
|
116
119
|
p.name = "TrFlowLayout";
|
|
117
120
|
const te = function(d) {
|
|
118
121
|
d.component(p.name, p);
|
package/dist/history/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as
|
|
2
|
-
import {
|
|
3
|
-
import { I as le } from "../
|
|
4
|
-
import { T as U } from "../
|
|
5
|
-
import
|
|
6
|
-
import { o as ce } from "../
|
|
7
|
-
import { _ as
|
|
1
|
+
import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as J, 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 B, Fragment as T, renderList as E, createBlock as R, withDirectives as ee, mergeProps as te, withCtx as H, withModifiers as S, vModelText as re } from "vue";
|
|
2
|
+
import { B as oe, e as se, k as ae, X as ne, x as ie } from "../tiny-robot-svgs.js";
|
|
3
|
+
import { I as le } from "../index6.js";
|
|
4
|
+
import { T as U } from "../index2.js";
|
|
5
|
+
import $ from "../icon-button/index.js";
|
|
6
|
+
import { o as ce } from "../index3.js";
|
|
7
|
+
import { _ as M } from "../_plugin-vue_export-helper.js";
|
|
8
8
|
const ue = /* @__PURE__ */ V({
|
|
9
9
|
__name: "item-tag",
|
|
10
10
|
props: {
|
|
@@ -16,12 +16,12 @@ const ue = /* @__PURE__ */ V({
|
|
|
16
16
|
const t = i;
|
|
17
17
|
return (a, _) => (n(), u("div", {
|
|
18
18
|
class: D(["tr-history__item-tag", t.type]),
|
|
19
|
-
style:
|
|
19
|
+
style: J(t.style)
|
|
20
20
|
}, [
|
|
21
21
|
p("span", null, k(t.text), 1)
|
|
22
22
|
], 6));
|
|
23
23
|
}
|
|
24
|
-
}), de = /* @__PURE__ */
|
|
24
|
+
}), 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" }, me = /* @__PURE__ */ V({
|
|
25
25
|
__name: "search-empty",
|
|
26
26
|
props: {
|
|
27
27
|
text: { default: "暂无内容" }
|
|
@@ -35,20 +35,20 @@ const ue = /* @__PURE__ */ V({
|
|
|
35
35
|
p("span", he, k(t.text), 1)
|
|
36
36
|
]));
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
38
|
+
}), ve = /* @__PURE__ */ M(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (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), v = (l) => {
|
|
46
46
|
l && Z(() => {
|
|
47
47
|
_.value = l, _.value.focus();
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
let r;
|
|
51
|
-
const
|
|
51
|
+
const y = () => {
|
|
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,25 +60,25 @@ 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" ? y() : l.key === "Escape" && g();
|
|
64
64
|
};
|
|
65
65
|
return Y(() => {
|
|
66
66
|
_.value && (r == null || r(), r = ce(_, () => {
|
|
67
|
-
|
|
67
|
+
y();
|
|
68
68
|
}));
|
|
69
69
|
}), {
|
|
70
70
|
editingItem: t,
|
|
71
71
|
handleEdit: a,
|
|
72
|
-
handleEditorInputRef:
|
|
72
|
+
handleEditorInputRef: v,
|
|
73
73
|
handleKeyDown: b
|
|
74
74
|
};
|
|
75
|
-
},
|
|
75
|
+
}, fe = { 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 = {
|
|
79
79
|
key: 0,
|
|
80
80
|
class: "tr-history__group-title"
|
|
81
|
-
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" },
|
|
81
|
+
}, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Be = { class: "tr-history__close" }, Ee = /* @__PURE__ */ V({
|
|
82
82
|
__name: "index",
|
|
83
83
|
props: /* @__PURE__ */ N({
|
|
84
84
|
tabTitle: {},
|
|
@@ -102,27 +102,27 @@ 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"), v = P(i, "searchQuery"), r = t, y = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || y.value[0].id), b = h(() => y.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 = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"),
|
|
109
|
+
}, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), O = h(() => {
|
|
110
110
|
const c = I.value;
|
|
111
111
|
return l(c) ? c : [{ group: w, items: c }];
|
|
112
|
-
}), x = h(() => a.searchBar ?
|
|
112
|
+
}), x = h(() => a.searchBar ? O.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(v.value || "", s))
|
|
115
|
+
})).filter((o) => o.items.length > 0) : O.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
|
+
}, X = (c) => {
|
|
121
121
|
r("item-delete", c);
|
|
122
|
-
}, { editingItem: C, handleEdit:
|
|
123
|
-
return (c, o) => (n(), u("div",
|
|
122
|
+
}, { editingItem: C, handleEdit: F, handleEditorInputRef: j, handleKeyDown: Q } = ye(r);
|
|
123
|
+
return (c, o) => (n(), u("div", fe, [
|
|
124
124
|
p("div", ke, [
|
|
125
|
-
(n(!0), u(T, null,
|
|
125
|
+
(n(!0), u(T, null, E(y.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
|
|
@@ -130,34 +130,34 @@ const ue = /* @__PURE__ */ V({
|
|
|
130
130
|
]),
|
|
131
131
|
a.searchBar ? (n(), u("div", be, [
|
|
132
132
|
m(e(le), {
|
|
133
|
-
modelValue:
|
|
134
|
-
"onUpdate:modelValue": o[0] || (o[0] = (s) =>
|
|
133
|
+
modelValue: v.value,
|
|
134
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => v.value = s),
|
|
135
135
|
placeholder: a.searchPlaceholder || "搜索对话名称",
|
|
136
136
|
"prefix-icon": e(se),
|
|
137
137
|
clearable: ""
|
|
138
138
|
}, null, 8, ["modelValue", "placeholder", "prefix-icon"])
|
|
139
|
-
])) :
|
|
139
|
+
])) : B("", !0),
|
|
140
140
|
p("div", xe, [
|
|
141
|
-
L.value ? (n(!0), u(T, { key: 0 },
|
|
141
|
+
L.value ? (n(!0), u(T, { key: 0 }, E(x.value, (s) => (n(), u("div", {
|
|
142
142
|
key: s.group,
|
|
143
143
|
class: "tr-history__group"
|
|
144
144
|
}, [
|
|
145
145
|
s.group !== e(w) ? (n(), u("div", Ce, [
|
|
146
146
|
p("span", null, k(s.group), 1)
|
|
147
|
-
])) :
|
|
148
|
-
(n(!0), u(T, null,
|
|
149
|
-
var
|
|
147
|
+
])) : B("", !0),
|
|
148
|
+
(n(!0), u(T, null, E(s.items, (d) => {
|
|
149
|
+
var A;
|
|
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: (f) => z(d)
|
|
154
154
|
}, [
|
|
155
|
-
((
|
|
155
|
+
((A = e(C)) == null ? void 0 : A.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
|
-
}, { ref_for: !0 }, d.tag), null, 16)) :
|
|
160
|
+
}, { ref_for: !0 }, d.tag), null, 16)) : B("", !0),
|
|
161
161
|
p("div", we, [
|
|
162
162
|
m(e(U), {
|
|
163
163
|
content: "编辑",
|
|
@@ -166,9 +166,9 @@ const ue = /* @__PURE__ */ V({
|
|
|
166
166
|
"open-delay": 500
|
|
167
167
|
}, {
|
|
168
168
|
default: H(() => [
|
|
169
|
-
m(e(
|
|
169
|
+
m(e($), {
|
|
170
170
|
icon: e(ae),
|
|
171
|
-
onClick: S((
|
|
171
|
+
onClick: S((f) => e(F)(d), ["stop"])
|
|
172
172
|
}, null, 8, ["icon", "onClick"])
|
|
173
173
|
]),
|
|
174
174
|
_: 2
|
|
@@ -180,9 +180,9 @@ const ue = /* @__PURE__ */ V({
|
|
|
180
180
|
"open-delay": 500
|
|
181
181
|
}, {
|
|
182
182
|
default: H(() => [
|
|
183
|
-
m(e(
|
|
183
|
+
m(e($), {
|
|
184
184
|
icon: e(ne),
|
|
185
|
-
onClick: S((
|
|
185
|
+
onClick: S((f) => X(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] = (f) => e(C).title = f),
|
|
194
194
|
class: "tr-history__item-edit",
|
|
195
195
|
ref_for: !0,
|
|
196
|
-
ref: e(
|
|
196
|
+
ref: e(j),
|
|
197
197
|
onKeydown: o[2] || (o[2] = //@ts-ignore
|
|
198
|
-
(...
|
|
198
|
+
(...f) => e(Q) && e(Q)(...f))
|
|
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(ve), {
|
|
205
205
|
key: 1,
|
|
206
|
-
text:
|
|
206
|
+
text: v.value ? "暂无搜索结果" : "暂无内容"
|
|
207
207
|
}, null, 8, ["text"]))
|
|
208
208
|
]),
|
|
209
|
-
p("div",
|
|
210
|
-
m(e(
|
|
209
|
+
p("div", Be, [
|
|
210
|
+
m(e($), {
|
|
211
211
|
icon: e(ie),
|
|
212
212
|
rounded: "",
|
|
213
213
|
onClick: W
|
|
@@ -215,11 +215,11 @@ const ue = /* @__PURE__ */ V({
|
|
|
215
215
|
])
|
|
216
216
|
]));
|
|
217
217
|
}
|
|
218
|
-
}), K = /* @__PURE__ */
|
|
218
|
+
}), K = /* @__PURE__ */ M(Ee, [["__scopeId", "data-v-8aa5fd59"]]), $e = function(i) {
|
|
219
219
|
i.component("TrHistory", K);
|
|
220
220
|
}, Ne = {
|
|
221
221
|
...K,
|
|
222
|
-
install:
|
|
222
|
+
install: $e,
|
|
223
223
|
name: "TrHistory"
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { t as
|
|
1
|
+
import { defineComponent as r, computed as a, createElementBlock as u, openBlock as l, normalizeStyle as c, normalizeClass as p, createBlock as m, resolveDynamicComponent as d } from "vue";
|
|
2
|
+
import { t as i } from "../utils.js";
|
|
3
3
|
import { _ as f } from "../_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ r({
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
7
|
icon: {},
|
|
@@ -9,24 +9,23 @@ const v = /* @__PURE__ */ p({
|
|
|
9
9
|
svgSize: { default: "16px" },
|
|
10
10
|
rounded: { type: Boolean }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const o = t, a = n(() => c(o.size)), r = n(() => c(o.svgSize));
|
|
18
|
-
return (i, z) => (s(), u("button", {
|
|
19
|
-
class: m(["tr-icon-button", { rounded: o.rounded }])
|
|
12
|
+
setup(o) {
|
|
13
|
+
const e = o, s = a(() => i(e.size)), n = a(() => i(e.svgSize));
|
|
14
|
+
return (z, h) => (l(), u("button", {
|
|
15
|
+
class: p(["tr-icon-button", { rounded: e.rounded }]),
|
|
16
|
+
style: c({ width: s.value, height: s.value })
|
|
20
17
|
}, [
|
|
21
|
-
(
|
|
22
|
-
|
|
18
|
+
(l(), m(d(e.icon), {
|
|
19
|
+
style: c({ width: n.value, height: n.value, fontSize: n.value })
|
|
20
|
+
}, null, 8, ["style"]))
|
|
21
|
+
], 6));
|
|
23
22
|
}
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
23
|
+
}), t = /* @__PURE__ */ f(_, [["__scopeId", "data-v-159698f7"]]);
|
|
24
|
+
t.name = "TrIconButton";
|
|
25
|
+
const v = function(o) {
|
|
26
|
+
o.component(t.name, t);
|
|
28
27
|
};
|
|
29
|
-
|
|
28
|
+
t.install = v;
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
t as default
|
|
32
31
|
};
|