@opentiny/tiny-robot 0.3.1-alpha.3 → 0.4.0-alpha.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 +1 -1
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +763 -3967
- package/dist/drag-overlay/index.js +5 -5
- package/dist/dropdown-menu/index.js +5 -5
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/index.d.ts +454 -354
- package/dist/index.js +73 -71
- package/dist/index2.js +42 -42
- package/dist/index3.js +358 -681
- package/dist/index4.js +697 -148
- package/dist/index5.js +161 -0
- package/dist/mcp-add-form/index.js +1 -1
- package/dist/mcp-server-picker/index.js +58 -59
- package/dist/sender/index.js +887 -1039
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +184 -185
- package/dist/useSlotRefs.js +3 -3
- package/dist/utils.js +1 -1
- package/package.json +8 -5
- package/dist/loading.js +0 -4
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Bubble as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { H as
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import { Prompt as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { useTheme as
|
|
1
|
+
import x from "./attachments/index.js";
|
|
2
|
+
import { Bubble as b, BubbleList as z, BubbleProvider as B } from "./bubble/index.js";
|
|
3
|
+
import { BubbleBasicBox as ve, BubbleMarkdownRenderer as fe, BubbleBasicBox as _e, BubbleMarkdownRenderer as De } from "./bubble/index.js";
|
|
4
|
+
import E from "./container/index.js";
|
|
5
|
+
import S from "./conversations/index.js";
|
|
6
|
+
import P from "./drag-overlay/index.js";
|
|
7
|
+
import L from "./dropdown-menu/index.js";
|
|
8
|
+
import y from "./feedback/index.js";
|
|
9
|
+
import { H as C } from "./index2.js";
|
|
10
|
+
import { u as he } from "./index2.js";
|
|
11
|
+
import M from "./icon-button/index.js";
|
|
12
|
+
import { Prompt as O, Prompts as w } from "./prompts/index.js";
|
|
13
|
+
import H from "./sender/index.js";
|
|
14
|
+
import j, { SuggestionPillButton as A } from "./suggestion-pills/index.js";
|
|
15
|
+
import k from "./suggestion-popover/index.js";
|
|
16
|
+
import R from "./theme-provider/index.js";
|
|
17
|
+
import { useTheme as Fe } from "./theme-provider/index.js";
|
|
18
18
|
import W from "./welcome/index.js";
|
|
19
19
|
import $ from "./mcp-server-picker/index.js";
|
|
20
20
|
import I from "./mcp-add-form/index.js";
|
|
@@ -61,11 +61,11 @@ function G(e, r) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
if (s.length > 0) {
|
|
64
|
-
const i = s.some((
|
|
64
|
+
const i = s.some((m) => !_(m, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, c = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
|
|
65
65
|
return {
|
|
66
66
|
acceptedFiles: n,
|
|
67
67
|
rejectedFiles: s,
|
|
68
|
-
rejectionReason: { code: p, message:
|
|
68
|
+
rejectionReason: { code: p, message: c }
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
|
|
@@ -119,11 +119,11 @@ const pe = {
|
|
|
119
119
|
var u;
|
|
120
120
|
if (o) return;
|
|
121
121
|
n.preventDefault(), t = 0, a(!1, null);
|
|
122
|
-
const s = (u = n.dataTransfer) == null ? void 0 : u.files, { onDrop: i, onError: p, accept:
|
|
122
|
+
const s = (u = n.dataTransfer) == null ? void 0 : u.files, { onDrop: i, onError: p, accept: c, multiple: m, maxSize: g, maxFiles: h } = e.__vDropzoneOptions__;
|
|
123
123
|
if (s && s.length > 0) {
|
|
124
124
|
const T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
|
|
125
|
-
accept:
|
|
126
|
-
multiple:
|
|
125
|
+
accept: c,
|
|
126
|
+
multiple: m,
|
|
127
127
|
maxSize: g,
|
|
128
128
|
maxFiles: h
|
|
129
129
|
});
|
|
@@ -144,28 +144,28 @@ const pe = {
|
|
|
144
144
|
e.__vDropzoneHandlers__ && (e.removeEventListener("dragenter", e.__vDropzoneHandlers__.handleDragEnter), e.removeEventListener("dragover", e.__vDropzoneHandlers__.handleDragOver), e.removeEventListener("dragleave", e.__vDropzoneHandlers__.handleDragLeave), e.removeEventListener("drop", e.__vDropzoneHandlers__.handleDrop), delete e.__vDropzoneHandlers__), delete e.__vDropzoneOptions__;
|
|
145
145
|
}
|
|
146
146
|
}, J = [
|
|
147
|
-
z,
|
|
148
147
|
x,
|
|
148
|
+
b,
|
|
149
|
+
z,
|
|
150
|
+
B,
|
|
149
151
|
E,
|
|
150
152
|
S,
|
|
151
153
|
P,
|
|
152
|
-
b,
|
|
153
154
|
L,
|
|
154
|
-
C,
|
|
155
|
-
B,
|
|
156
155
|
y,
|
|
156
|
+
C,
|
|
157
|
+
M,
|
|
157
158
|
O,
|
|
159
|
+
w,
|
|
158
160
|
H,
|
|
159
161
|
j,
|
|
160
162
|
A,
|
|
161
|
-
M,
|
|
162
|
-
w,
|
|
163
|
-
R,
|
|
164
163
|
k,
|
|
164
|
+
R,
|
|
165
165
|
W,
|
|
166
166
|
$,
|
|
167
167
|
I
|
|
168
|
-
],
|
|
168
|
+
], ce = {
|
|
169
169
|
install(e) {
|
|
170
170
|
J.forEach((r) => {
|
|
171
171
|
const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
@@ -174,52 +174,54 @@ const pe = {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
ve as
|
|
180
|
-
|
|
181
|
-
fe as
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
177
|
+
x as Attachments,
|
|
178
|
+
b as Bubble,
|
|
179
|
+
ve as BubbleBasicBox,
|
|
180
|
+
z as BubbleList,
|
|
181
|
+
fe as BubbleMarkdownRenderer,
|
|
182
|
+
B as BubbleProvider,
|
|
183
|
+
E as Container,
|
|
184
|
+
S as Conversations,
|
|
185
|
+
P as DragOverlay,
|
|
186
|
+
L as DropdownMenu,
|
|
187
|
+
y as Feedback,
|
|
188
|
+
C as History,
|
|
189
|
+
M as IconButton,
|
|
190
190
|
I as McpAddForm,
|
|
191
191
|
$ as McpServerPicker,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
192
|
+
O as Prompt,
|
|
193
|
+
w as Prompts,
|
|
194
|
+
H as Sender,
|
|
195
|
+
A as SuggestionPillButton,
|
|
196
|
+
j as SuggestionPills,
|
|
197
|
+
k as SuggestionPopover,
|
|
198
|
+
R as ThemeProvider,
|
|
199
|
+
x as TrAttachments,
|
|
200
|
+
b as TrBubble,
|
|
201
|
+
_e as TrBubbleBasicBox,
|
|
202
|
+
z as TrBubbleList,
|
|
203
|
+
De as TrBubbleMarkdownRenderer,
|
|
204
|
+
B as TrBubbleProvider,
|
|
205
|
+
E as TrContainer,
|
|
206
|
+
S as TrConversations,
|
|
207
|
+
P as TrDragOverlay,
|
|
208
|
+
L as TrDropdownMenu,
|
|
209
|
+
y as TrFeedback,
|
|
210
|
+
C as TrHistory,
|
|
211
|
+
M as TrIconButton,
|
|
210
212
|
I as TrMcpAddForm,
|
|
211
213
|
$ as TrMcpServerPicker,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
O as TrPrompt,
|
|
215
|
+
w as TrPrompts,
|
|
216
|
+
H as TrSender,
|
|
217
|
+
A as TrSuggestionPillButton,
|
|
218
|
+
j as TrSuggestionPills,
|
|
219
|
+
k as TrSuggestionPopover,
|
|
220
|
+
R as TrThemeProvider,
|
|
219
221
|
W as TrWelcome,
|
|
220
222
|
W as Welcome,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
ce as default,
|
|
224
|
+
Fe as useTheme,
|
|
225
|
+
he as useTouchDevice,
|
|
224
226
|
pe as vDropzone
|
|
225
227
|
};
|
package/dist/index2.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ref as _, onMounted as ne, onBeforeUnmount as oe, defineComponent as P, createElementBlock as
|
|
2
|
-
import { IconEmptySearch as
|
|
1
|
+
import { ref as _, onMounted as ne, onBeforeUnmount as oe, defineComponent as P, createElementBlock as u, openBlock as r, createElementVNode as w, createVNode as T, unref as n, toDisplayString as B, mergeModels as W, useModel as j, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, nextTick as se, normalizeClass as U, withDirectives as q, createCommentVNode as G, renderSlot as A, withKeys as F, withModifiers as J, isRef as le, vModelText as re, vShow as ue } from "vue";
|
|
2
|
+
import { IconEmptySearch as ae, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMenu2 as pe } from "@opentiny/tiny-robot-svgs";
|
|
3
3
|
import { _ as z } from "./_plugin-vue_export-helper.js";
|
|
4
|
-
import { o as Z,
|
|
4
|
+
import { o as Z, u as ve, c as ge, b as ye } from "./index4.js";
|
|
5
5
|
import { t as O } from "./utils.js";
|
|
6
6
|
const D = _(!1);
|
|
7
|
-
let
|
|
7
|
+
let b = 0, $;
|
|
8
8
|
function _e() {
|
|
9
9
|
const s = window.matchMedia("(hover: none) and (pointer: coarse)"), m = () => {
|
|
10
10
|
D.value = s.matches;
|
|
@@ -18,15 +18,15 @@ function _e() {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
function he() {
|
|
21
|
-
|
|
21
|
+
$ == null || $(), $ = void 0;
|
|
22
22
|
}
|
|
23
23
|
function Ce() {
|
|
24
24
|
return typeof window > "u" ? {
|
|
25
25
|
isTouchDevice: D
|
|
26
26
|
} : (ne(() => {
|
|
27
|
-
|
|
27
|
+
b++, b === 1 && ($ = _e());
|
|
28
28
|
}), oe(() => {
|
|
29
|
-
|
|
29
|
+
b = Math.max(0, b - 1), b === 0 && he();
|
|
30
30
|
}), {
|
|
31
31
|
isTouchDevice: D
|
|
32
32
|
});
|
|
@@ -38,9 +38,9 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
38
38
|
},
|
|
39
39
|
setup(s) {
|
|
40
40
|
const m = s;
|
|
41
|
-
return (t, c) => (r(),
|
|
41
|
+
return (t, c) => (r(), u("div", ke, [
|
|
42
42
|
w("span", Le, [
|
|
43
|
-
|
|
43
|
+
T(n(ae))
|
|
44
44
|
]),
|
|
45
45
|
w("span", Ee, B(m.text), 1)
|
|
46
46
|
]));
|
|
@@ -76,23 +76,23 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
76
76
|
}), v = (L) => {
|
|
77
77
|
C("item-click", L), t.value = null, c.value = null;
|
|
78
78
|
};
|
|
79
|
-
return (L, g) => (r(),
|
|
79
|
+
return (L, g) => (r(), u("ul", {
|
|
80
80
|
class: "tr-history__menu-list",
|
|
81
81
|
ref_key: "menuRef",
|
|
82
82
|
ref: E,
|
|
83
83
|
style: ie(o.value)
|
|
84
84
|
}, [
|
|
85
|
-
(r(!0),
|
|
85
|
+
(r(!0), u(S, null, V(h.items, (a) => (r(), u("li", {
|
|
86
86
|
class: "tr-history__menu-list__item",
|
|
87
|
-
key:
|
|
88
|
-
onClick: (K) => v(
|
|
87
|
+
key: a.id,
|
|
88
|
+
onClick: (K) => v(a)
|
|
89
89
|
}, [
|
|
90
|
-
(r(), H(Y(
|
|
91
|
-
w("span", null, B(
|
|
90
|
+
(r(), H(Y(a.icon))),
|
|
91
|
+
w("span", null, B(a.text), 1)
|
|
92
92
|
], 8, Ie))), 128))
|
|
93
93
|
], 4));
|
|
94
94
|
}
|
|
95
|
-
}), Me = /* @__PURE__ */ z(xe, [["__scopeId", "data-v-89fdb41c"]]),
|
|
95
|
+
}), Me = /* @__PURE__ */ z(xe, [["__scopeId", "data-v-89fdb41c"]]), be = ({
|
|
96
96
|
renameControlOnClickOutside: s,
|
|
97
97
|
onItemTitleChange: m
|
|
98
98
|
}) => {
|
|
@@ -131,10 +131,10 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
131
131
|
handleEditCancel: k,
|
|
132
132
|
handleEditConfirm: R
|
|
133
133
|
};
|
|
134
|
-
}, X = Symbol("NO_GROUP"),
|
|
134
|
+
}, X = Symbol("NO_GROUP"), Te = {
|
|
135
135
|
key: 0,
|
|
136
136
|
class: "tr-history__group-title"
|
|
137
|
-
},
|
|
137
|
+
}, $e = { class: "tr-history__group-items" }, Ge = ["onClick"], Oe = ["title"], Se = ["onClick"], Be = /* @__PURE__ */ P({
|
|
138
138
|
__name: "index",
|
|
139
139
|
props: {
|
|
140
140
|
data: {},
|
|
@@ -165,46 +165,46 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
165
165
|
handleEdit: R,
|
|
166
166
|
handleEditCancel: o,
|
|
167
167
|
handleEditConfirm: v
|
|
168
|
-
} =
|
|
168
|
+
} = be({
|
|
169
169
|
renameControlOnClickOutside: t.renameControlOnClickOutside,
|
|
170
170
|
onItemTitleChange: (i, e) => {
|
|
171
171
|
c("item-title-change", i, e);
|
|
172
172
|
}
|
|
173
|
-
}), { isTouchDevice: L } = Ce(), g = _(null),
|
|
173
|
+
}), { isTouchDevice: L } = Ce(), g = _(null), a = _(null), K = (i, e) => {
|
|
174
174
|
if (i.currentTarget instanceof HTMLButtonElement) {
|
|
175
|
-
if (
|
|
176
|
-
g.value = null,
|
|
175
|
+
if (a.value === e) {
|
|
176
|
+
g.value = null, a.value = null;
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
|
-
g.value = i.currentTarget,
|
|
179
|
+
g.value = i.currentTarget, a.value = e;
|
|
180
180
|
} else
|
|
181
|
-
g.value = null,
|
|
181
|
+
g.value = null, a.value = null;
|
|
182
182
|
}, ee = (i) => {
|
|
183
|
-
const e =
|
|
183
|
+
const e = a.value;
|
|
184
184
|
e && (i.id === "rename" && R(e), c("item-action", i, e));
|
|
185
185
|
};
|
|
186
|
-
return (i, e) => (r(),
|
|
186
|
+
return (i, e) => (r(), u("div", {
|
|
187
187
|
class: U(["tr-history", { "touch-device": n(L) }])
|
|
188
188
|
}, [
|
|
189
|
-
E.value ? (r(), H(Re, { key: 1 })) : (r(),
|
|
190
|
-
(r(!0),
|
|
189
|
+
E.value ? (r(), H(Re, { key: 1 })) : (r(), u(S, { key: 0 }, [
|
|
190
|
+
(r(!0), u(S, null, V(C.value, (f) => (r(), u("div", {
|
|
191
191
|
class: "tr-history__group",
|
|
192
192
|
key: f.group
|
|
193
193
|
}, [
|
|
194
|
-
f.group !== n(X) ? (r(),
|
|
195
|
-
w("div",
|
|
196
|
-
(r(!0),
|
|
194
|
+
f.group !== n(X) ? (r(), u("div", Te, B(f.group), 1)) : G("", !0),
|
|
195
|
+
w("div", $e, [
|
|
196
|
+
(r(!0), u(S, null, V(f.items, (l, te) => (r(), u("div", {
|
|
197
197
|
class: U(["tr-history__item", {
|
|
198
198
|
selected: l.id && l.id === t.selected,
|
|
199
199
|
editing: n(p) === l,
|
|
200
|
-
active:
|
|
200
|
+
active: a.value === l
|
|
201
201
|
}]),
|
|
202
202
|
key: l.id || te,
|
|
203
203
|
onClick: (d) => c("item-click", l)
|
|
204
204
|
}, [
|
|
205
205
|
A(i.$slots, "item-prefix", { item: l }, void 0, !0),
|
|
206
206
|
l.icon ? (r(), H(Y(l.icon), { key: 0 })) : G("", !0),
|
|
207
|
-
n(p) === l ? q((r(),
|
|
207
|
+
n(p) === l ? q((r(), u("input", {
|
|
208
208
|
key: 1,
|
|
209
209
|
class: "tr-history__item-editor",
|
|
210
210
|
type: "text",
|
|
@@ -242,7 +242,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
242
242
|
onClick: e[6] || (e[6] = J(() => {
|
|
243
243
|
}, ["stop"]))
|
|
244
244
|
}, [
|
|
245
|
-
t.showRenameControls && n(p) === l ? (r(),
|
|
245
|
+
t.showRenameControls && n(p) === l ? (r(), u("button", {
|
|
246
246
|
key: 0,
|
|
247
247
|
class: "editor-confirm",
|
|
248
248
|
ref_for: !0,
|
|
@@ -251,9 +251,9 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
251
251
|
onClick: e[4] || (e[4] = //@ts-ignore
|
|
252
252
|
(...d) => n(v) && n(v)(...d))
|
|
253
253
|
}, [
|
|
254
|
-
|
|
254
|
+
T(n(me))
|
|
255
255
|
], 512)) : G("", !0),
|
|
256
|
-
t.showRenameControls && n(p) === l ? (r(),
|
|
256
|
+
t.showRenameControls && n(p) === l ? (r(), u("button", {
|
|
257
257
|
key: 1,
|
|
258
258
|
class: "editor-cancel",
|
|
259
259
|
ref_for: !0,
|
|
@@ -262,28 +262,28 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
262
262
|
onClick: e[5] || (e[5] = //@ts-ignore
|
|
263
263
|
(...d) => n(o) && n(o)(...d))
|
|
264
264
|
}, [
|
|
265
|
-
|
|
265
|
+
T(n(fe))
|
|
266
266
|
], 512)) : G("", !0),
|
|
267
267
|
w("button", {
|
|
268
268
|
class: U(["menu", { hidden: n(p) === l }]),
|
|
269
269
|
onClick: (d) => K(d, l)
|
|
270
270
|
}, [
|
|
271
|
-
|
|
271
|
+
T(n(pe))
|
|
272
272
|
], 10, Se)
|
|
273
273
|
])
|
|
274
274
|
], 10, Ge))), 128))
|
|
275
275
|
])
|
|
276
276
|
]))), 128)),
|
|
277
|
-
q(
|
|
277
|
+
q(T(Me, {
|
|
278
278
|
trigger: g.value,
|
|
279
279
|
"onUpdate:trigger": e[7] || (e[7] = (f) => g.value = f),
|
|
280
|
-
data:
|
|
281
|
-
"onUpdate:data": e[8] || (e[8] = (f) =>
|
|
280
|
+
data: a.value,
|
|
281
|
+
"onUpdate:data": e[8] || (e[8] = (f) => a.value = f),
|
|
282
282
|
items: t.menuItems,
|
|
283
283
|
"menu-list-gap": t.menuListGap,
|
|
284
284
|
onItemClick: ee
|
|
285
285
|
}, null, 8, ["trigger", "data", "items", "menu-list-gap"]), [
|
|
286
|
-
[
|
|
286
|
+
[ue, g.value]
|
|
287
287
|
])
|
|
288
288
|
], 64))
|
|
289
289
|
], 2));
|