@opentiny/tiny-robot 0.3.0-alpha.8 → 0.3.0-alpha.9
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 +15 -15
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +1229 -1949
- package/dist/container/index.js +12 -12
- package/dist/dropdown-menu/index.js +38 -33
- package/dist/feedback/index.js +55 -55
- package/dist/flow-layout-buttons/index.js +24 -24
- package/dist/history/index.js +46 -46
- package/dist/index.d.ts +405 -975
- package/dist/index.js +63 -207
- package/dist/index2.js +593 -610
- package/dist/index3.js +139 -676
- package/dist/index4.js +306 -137
- package/dist/index5.js +591 -270
- package/dist/index6.js +599 -795
- package/dist/index7.js +1717 -3622
- package/dist/question/index.js +28 -28
- package/dist/sender/index.js +659 -709
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +22 -22
- package/dist/suggestion-pills/index.js +25 -25
- package/dist/suggestion-popover/index.js +185 -180
- package/dist/tiny-robot-svgs.js +178 -727
- package/dist/useSlotRefs.js +12 -12
- package/package.json +3 -9
- package/dist/attachments/index.js +0 -526
- package/dist/drag-overlay/index.js +0 -57
- package/dist/loading.js +0 -4
- package/dist/mcp-server-picker/index.js +0 -29682
package/dist/index.js
CHANGED
|
@@ -1,213 +1,69 @@
|
|
|
1
|
-
import { Bubble as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}) : !0;
|
|
28
|
-
}
|
|
29
|
-
function _(e, r) {
|
|
30
|
-
return e.size <= r;
|
|
31
|
-
}
|
|
32
|
-
function I(e, r) {
|
|
33
|
-
return e.length <= r;
|
|
34
|
-
}
|
|
35
|
-
function N(e, r) {
|
|
36
|
-
const { accept: n, multiple: t, maxSize: s, maxFiles: l } = r, o = [], a = [];
|
|
37
|
-
if (!I(e, l))
|
|
38
|
-
return {
|
|
39
|
-
acceptedFiles: o,
|
|
40
|
-
rejectedFiles: Array.from(e),
|
|
41
|
-
rejection: {
|
|
42
|
-
files: Array.from(e),
|
|
43
|
-
code: d.FileCountExceeded,
|
|
44
|
-
message: `文件数量不能超过 ${l} 个`
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
if (e.forEach((i) => {
|
|
48
|
-
$(i, n) && _(i, s) ? o.push(i) : a.push(i);
|
|
49
|
-
}), !t && o.length > 1)
|
|
50
|
-
return {
|
|
51
|
-
acceptedFiles: [],
|
|
52
|
-
rejectedFiles: o,
|
|
53
|
-
rejection: {
|
|
54
|
-
files: o,
|
|
55
|
-
code: d.FileCountExceeded,
|
|
56
|
-
message: "只允许上传一个文件"
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
if (a.length > 0) {
|
|
60
|
-
const i = a.some((m) => !_(m, s)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, c = i ? `文件大小不能超过 ${s / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${n})`;
|
|
61
|
-
return {
|
|
62
|
-
acceptedFiles: o,
|
|
63
|
-
rejectedFiles: a,
|
|
64
|
-
rejection: { files: a, code: p, message: c }
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return { acceptedFiles: o, rejectedFiles: a, rejection: null };
|
|
68
|
-
}
|
|
69
|
-
function g(e) {
|
|
70
|
-
return {
|
|
71
|
-
accept: e.accept || "*",
|
|
72
|
-
multiple: e.multiple ?? !0,
|
|
73
|
-
maxSize: e.maxSize || 1024 * 1024 * 10,
|
|
74
|
-
maxFiles: e.maxFiles || 3,
|
|
75
|
-
onDrop: e.onDrop,
|
|
76
|
-
onError: e.onError,
|
|
77
|
-
disabled: e.disabled || !1
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
const ae = {
|
|
81
|
-
/**
|
|
82
|
-
* 挂载指令
|
|
83
|
-
* @param el 元素
|
|
84
|
-
* @param binding 绑定
|
|
85
|
-
*/
|
|
86
|
-
mounted(e, r) {
|
|
87
|
-
let n = 0;
|
|
88
|
-
const { disabled: t, onDraggingChange: s } = r.value;
|
|
89
|
-
e.__vDropzoneOptions__ = g(r.value);
|
|
90
|
-
const l = {
|
|
91
|
-
/**
|
|
92
|
-
* 拖拽进入
|
|
93
|
-
*/
|
|
94
|
-
handleDragEnter: () => {
|
|
95
|
-
t || (n++, n === 1 && s(!0, e));
|
|
96
|
-
},
|
|
97
|
-
/**
|
|
98
|
-
* 拖拽覆盖
|
|
99
|
-
* @param e 事件
|
|
100
|
-
*/
|
|
101
|
-
handleDragOver: (o) => {
|
|
102
|
-
t || o.preventDefault();
|
|
103
|
-
},
|
|
104
|
-
/**
|
|
105
|
-
* 拖拽离开
|
|
106
|
-
*/
|
|
107
|
-
handleDragLeave: () => {
|
|
108
|
-
t || (n--, n === 0 && s(!1, null));
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* 拖拽放下
|
|
112
|
-
* @param e 事件
|
|
113
|
-
*/
|
|
114
|
-
handleDrop: (o) => {
|
|
115
|
-
var u;
|
|
116
|
-
if (t) return;
|
|
117
|
-
o.preventDefault(), n = 0, s(!1, null);
|
|
118
|
-
const a = (u = o.dataTransfer) == null ? void 0 : u.files, { onDrop: i, onError: p, accept: c, multiple: m, maxSize: D, maxFiles: h } = e.__vDropzoneOptions__;
|
|
119
|
-
if (a && a.length > 0) {
|
|
120
|
-
const T = Array.from(a), { acceptedFiles: v, rejection: f } = N(T, {
|
|
121
|
-
accept: c || "",
|
|
122
|
-
multiple: m ?? !0,
|
|
123
|
-
maxSize: D || 1024 * 1024 * 10,
|
|
124
|
-
maxFiles: h || 3
|
|
125
|
-
});
|
|
126
|
-
f && p(f), v.length > 0 && i(v);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
e.__vDropzoneHandlers__ = l, e.addEventListener("dragenter", l.handleDragEnter), e.addEventListener("dragover", l.handleDragOver), e.addEventListener("dragleave", l.handleDragLeave), e.addEventListener("drop", l.handleDrop);
|
|
131
|
-
},
|
|
132
|
-
updated(e, r) {
|
|
133
|
-
e.__vDropzoneOptions__ && (e.__vDropzoneOptions__ = g(r.value));
|
|
134
|
-
},
|
|
135
|
-
/**
|
|
136
|
-
* 卸载指令
|
|
137
|
-
* @param el 元素
|
|
138
|
-
*/
|
|
139
|
-
unmounted(e) {
|
|
140
|
-
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__;
|
|
141
|
-
}
|
|
142
|
-
}, R = [
|
|
143
|
-
E,
|
|
144
|
-
z,
|
|
145
|
-
F,
|
|
146
|
-
x,
|
|
147
|
-
S,
|
|
148
|
-
P,
|
|
1
|
+
import { Bubble as s, BubbleList as e } from "./bubble/index.js";
|
|
2
|
+
import n from "./container/index.js";
|
|
3
|
+
import i from "./conversations/index.js";
|
|
4
|
+
import m from "./dropdown-menu/index.js";
|
|
5
|
+
import a from "./feedback/index.js";
|
|
6
|
+
import p from "./history/index.js";
|
|
7
|
+
import l from "./icon-button/index.js";
|
|
8
|
+
import { Prompt as T, Prompts as u } from "./prompts/index.js";
|
|
9
|
+
import f from "./sender/index.js";
|
|
10
|
+
import c, { SuggestionPillButton as g } from "./suggestion-pills/index.js";
|
|
11
|
+
import b from "./suggestion-popover/index.js";
|
|
12
|
+
import P from "./welcome/index.js";
|
|
13
|
+
const d = [
|
|
14
|
+
s,
|
|
15
|
+
e,
|
|
16
|
+
n,
|
|
17
|
+
i,
|
|
18
|
+
m,
|
|
19
|
+
a,
|
|
20
|
+
p,
|
|
21
|
+
l,
|
|
22
|
+
T,
|
|
23
|
+
u,
|
|
24
|
+
f,
|
|
25
|
+
c,
|
|
26
|
+
g,
|
|
149
27
|
b,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
M,
|
|
157
|
-
j,
|
|
158
|
-
w,
|
|
159
|
-
A,
|
|
160
|
-
k,
|
|
161
|
-
W
|
|
162
|
-
], se = {
|
|
163
|
-
install(e) {
|
|
164
|
-
R.forEach((r) => {
|
|
165
|
-
const n = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
166
|
-
e.component(`Tr${n}`, r);
|
|
28
|
+
P
|
|
29
|
+
], L = {
|
|
30
|
+
install(r) {
|
|
31
|
+
d.forEach((o) => {
|
|
32
|
+
const t = o.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
33
|
+
r.component(`Tr${t}`, o);
|
|
167
34
|
});
|
|
168
35
|
}
|
|
169
36
|
};
|
|
170
37
|
export {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
W as TrMcpServerPicker,
|
|
203
|
-
O as TrPrompt,
|
|
204
|
-
H as TrPrompts,
|
|
205
|
-
M as TrSender,
|
|
206
|
-
w as TrSuggestionPillButton,
|
|
207
|
-
j as TrSuggestionPills,
|
|
208
|
-
A as TrSuggestionPopover,
|
|
209
|
-
k as TrWelcome,
|
|
210
|
-
k as Welcome,
|
|
211
|
-
se as default,
|
|
212
|
-
ae as vDropzone
|
|
38
|
+
s as Bubble,
|
|
39
|
+
e as BubbleList,
|
|
40
|
+
n as Container,
|
|
41
|
+
i as Conversations,
|
|
42
|
+
m as DropdownMenu,
|
|
43
|
+
a as Feedback,
|
|
44
|
+
p as History,
|
|
45
|
+
l as IconButton,
|
|
46
|
+
T as Prompt,
|
|
47
|
+
u as Prompts,
|
|
48
|
+
f as Sender,
|
|
49
|
+
g as SuggestionPillButton,
|
|
50
|
+
c as SuggestionPills,
|
|
51
|
+
b as SuggestionPopover,
|
|
52
|
+
s as TrBubble,
|
|
53
|
+
e as TrBubbleList,
|
|
54
|
+
n as TrContainer,
|
|
55
|
+
i as TrConversations,
|
|
56
|
+
m as TrDropdownMenu,
|
|
57
|
+
a as TrFeedback,
|
|
58
|
+
p as TrHistory,
|
|
59
|
+
l as TrIconButton,
|
|
60
|
+
T as TrPrompt,
|
|
61
|
+
u as TrPrompts,
|
|
62
|
+
f as TrSender,
|
|
63
|
+
g as TrSuggestionPillButton,
|
|
64
|
+
c as TrSuggestionPills,
|
|
65
|
+
b as TrSuggestionPopover,
|
|
66
|
+
P as TrWelcome,
|
|
67
|
+
P as Welcome,
|
|
68
|
+
L as default
|
|
213
69
|
};
|