@opentiny/tiny-robot 0.3.1-alpha.4 → 0.3.1-alpha.5
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 +317 -317
- package/dist/chat-input/index.js +3151 -0
- package/dist/chat-input-actions/index.js +13 -0
- 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/history/index.js +1 -1
- package/dist/index.d.ts +2244 -1179
- package/dist/index.js +133 -101
- package/dist/index2.js +183 -285
- package/dist/index3.js +250 -683
- package/dist/index4.js +729 -147
- package/dist/index5.js +301 -0
- package/dist/index6.js +161 -0
- package/dist/mcp-add-form/index.js +1 -1
- package/dist/mcp-server-picker/index.js +1 -1
- package/dist/sender/index.js +6 -1481
- package/dist/sender-compat/index.js +233 -0
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +2 -2
- package/dist/useSlotRefs.js +3 -3
- package/dist/utils.js +1 -1
- package/package.json +13 -3
package/dist/index.js
CHANGED
|
@@ -1,46 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Bubble as
|
|
3
|
-
import { BubbleContentClassRenderer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { H as
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import { Prompt as H, Prompts as
|
|
13
|
-
import
|
|
1
|
+
import F from "./attachments/index.js";
|
|
2
|
+
import { Bubble as B, BubbleList as x, BubbleProvider as z } from "./bubble/index.js";
|
|
3
|
+
import { BubbleContentClassRenderer as ze, BubbleMarkdownContentRenderer as Ce } from "./bubble/index.js";
|
|
4
|
+
import C from "./container/index.js";
|
|
5
|
+
import E from "./conversations/index.js";
|
|
6
|
+
import b from "./drag-overlay/index.js";
|
|
7
|
+
import P from "./dropdown-menu/index.js";
|
|
8
|
+
import L from "./feedback/index.js";
|
|
9
|
+
import { H as A } from "./index5.js";
|
|
10
|
+
import { u as be } from "./index5.js";
|
|
11
|
+
import y from "./icon-button/index.js";
|
|
12
|
+
import { Prompt as H, Prompts as O } from "./prompts/index.js";
|
|
13
|
+
import W from "./sender/index.js";
|
|
14
|
+
import j from "./sender-compat/index.js";
|
|
14
15
|
import M, { SuggestionPillButton as w } from "./suggestion-pills/index.js";
|
|
15
16
|
import R from "./suggestion-popover/index.js";
|
|
16
|
-
import
|
|
17
|
-
import { useTheme as
|
|
18
|
-
import
|
|
19
|
-
import
|
|
17
|
+
import $ from "./theme-provider/index.js";
|
|
18
|
+
import { useTheme as Le } from "./theme-provider/index.js";
|
|
19
|
+
import k from "./welcome/index.js";
|
|
20
|
+
import V from "./mcp-server-picker/index.js";
|
|
20
21
|
import I from "./mcp-add-form/index.js";
|
|
22
|
+
import { A as N, S as U, _ as q, W as G, D as J } from "./index2.js";
|
|
23
|
+
import { u as ye } from "./index2.js";
|
|
24
|
+
import { _ as K, V as Q } from "./index3.js";
|
|
25
|
+
import { W as Oe, u as We } from "./index3.js";
|
|
21
26
|
var d = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(d || {});
|
|
22
|
-
function
|
|
27
|
+
function X(e, r) {
|
|
23
28
|
if (!r) return !0;
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
if (
|
|
27
|
-
return e.name.toLowerCase().endsWith(
|
|
28
|
-
if (
|
|
29
|
-
const a =
|
|
29
|
+
const o = r.split(",").map((t) => t.trim());
|
|
30
|
+
return o.includes("*") ? !0 : o.some((t) => {
|
|
31
|
+
if (t.startsWith("."))
|
|
32
|
+
return e.name.toLowerCase().endsWith(t.toLowerCase());
|
|
33
|
+
if (t.includes("/*")) {
|
|
34
|
+
const a = t.split("/")[0];
|
|
30
35
|
return e.type.startsWith(a + "/");
|
|
31
36
|
} else
|
|
32
|
-
return e.type ===
|
|
37
|
+
return e.type === t;
|
|
33
38
|
});
|
|
34
39
|
}
|
|
35
40
|
function _(e, r) {
|
|
36
41
|
return e.size <= r;
|
|
37
42
|
}
|
|
38
|
-
function
|
|
43
|
+
function Y(e, r) {
|
|
39
44
|
return e.length <= r;
|
|
40
45
|
}
|
|
41
|
-
function
|
|
42
|
-
const { accept:
|
|
43
|
-
if (!
|
|
46
|
+
function Z(e, r) {
|
|
47
|
+
const { accept: o, multiple: t, maxSize: a, maxFiles: l } = r, n = [], s = [];
|
|
48
|
+
if (!Y(e, l))
|
|
44
49
|
return {
|
|
45
50
|
acceptedFiles: n,
|
|
46
51
|
rejectedFiles: Array.from(e),
|
|
@@ -50,8 +55,8 @@ function G(e, r) {
|
|
|
50
55
|
}
|
|
51
56
|
};
|
|
52
57
|
if (e.forEach((i) => {
|
|
53
|
-
|
|
54
|
-
}), !
|
|
58
|
+
X(i, o) && _(i, a) ? n.push(i) : s.push(i);
|
|
59
|
+
}), !t && n.length > 1)
|
|
55
60
|
return {
|
|
56
61
|
acceptedFiles: [],
|
|
57
62
|
rejectedFiles: n,
|
|
@@ -61,11 +66,11 @@ function G(e, r) {
|
|
|
61
66
|
}
|
|
62
67
|
};
|
|
63
68
|
if (s.length > 0) {
|
|
64
|
-
const i = s.some((
|
|
69
|
+
const i = s.some((p) => !_(p, a)), u = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, m = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${o})`;
|
|
65
70
|
return {
|
|
66
71
|
acceptedFiles: n,
|
|
67
72
|
rejectedFiles: s,
|
|
68
|
-
rejectionReason: { code:
|
|
73
|
+
rejectionReason: { code: u, message: m }
|
|
69
74
|
};
|
|
70
75
|
}
|
|
71
76
|
return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
|
|
@@ -81,53 +86,53 @@ function D(e) {
|
|
|
81
86
|
disabled: e.disabled || !1
|
|
82
87
|
};
|
|
83
88
|
}
|
|
84
|
-
const
|
|
89
|
+
const Se = {
|
|
85
90
|
/**
|
|
86
91
|
* 挂载指令
|
|
87
92
|
* @param el 元素
|
|
88
93
|
* @param binding 绑定
|
|
89
94
|
*/
|
|
90
95
|
mounted(e, r) {
|
|
91
|
-
let
|
|
92
|
-
const { disabled:
|
|
96
|
+
let o = 0;
|
|
97
|
+
const { disabled: t, onDraggingChange: a } = r.value;
|
|
93
98
|
e.__vDropzoneOptions__ = D(r.value);
|
|
94
99
|
const l = {
|
|
95
100
|
/**
|
|
96
101
|
* 拖拽进入
|
|
97
102
|
*/
|
|
98
103
|
handleDragEnter: () => {
|
|
99
|
-
|
|
104
|
+
t || (o++, o === 1 && a(!0, e));
|
|
100
105
|
},
|
|
101
106
|
/**
|
|
102
107
|
* 拖拽覆盖
|
|
103
108
|
* @param e 事件
|
|
104
109
|
*/
|
|
105
110
|
handleDragOver: (n) => {
|
|
106
|
-
|
|
111
|
+
t || n.preventDefault();
|
|
107
112
|
},
|
|
108
113
|
/**
|
|
109
114
|
* 拖拽离开
|
|
110
115
|
*/
|
|
111
116
|
handleDragLeave: () => {
|
|
112
|
-
|
|
117
|
+
t || (o--, o === 0 && a(!1, null));
|
|
113
118
|
},
|
|
114
119
|
/**
|
|
115
120
|
* 拖拽放下
|
|
116
121
|
* @param e 事件
|
|
117
122
|
*/
|
|
118
123
|
handleDrop: (n) => {
|
|
119
|
-
var
|
|
120
|
-
if (
|
|
121
|
-
n.preventDefault(),
|
|
122
|
-
const s = (
|
|
124
|
+
var c;
|
|
125
|
+
if (t) return;
|
|
126
|
+
n.preventDefault(), o = 0, a(!1, null);
|
|
127
|
+
const s = (c = n.dataTransfer) == null ? void 0 : c.files, { onDrop: i, onError: u, accept: m, multiple: p, maxSize: T, maxFiles: g } = e.__vDropzoneOptions__;
|
|
123
128
|
if (s && s.length > 0) {
|
|
124
|
-
const
|
|
129
|
+
const h = Array.from(s), { acceptedFiles: f, rejectedFiles: S, rejectionReason: v } = Z(h, {
|
|
125
130
|
accept: m,
|
|
126
|
-
multiple:
|
|
127
|
-
maxSize:
|
|
128
|
-
maxFiles:
|
|
131
|
+
multiple: p,
|
|
132
|
+
maxSize: T,
|
|
133
|
+
maxFiles: g
|
|
129
134
|
});
|
|
130
|
-
|
|
135
|
+
v && u({ files: S, ...v }), f.length > 0 && i(f);
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
};
|
|
@@ -143,83 +148,110 @@ const pe = {
|
|
|
143
148
|
unmounted(e) {
|
|
144
149
|
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
150
|
}
|
|
146
|
-
},
|
|
147
|
-
|
|
151
|
+
}, ee = [
|
|
152
|
+
F,
|
|
153
|
+
B,
|
|
148
154
|
x,
|
|
155
|
+
z,
|
|
156
|
+
C,
|
|
149
157
|
E,
|
|
150
|
-
S,
|
|
151
|
-
P,
|
|
152
158
|
b,
|
|
159
|
+
P,
|
|
153
160
|
L,
|
|
154
|
-
|
|
155
|
-
B,
|
|
161
|
+
A,
|
|
156
162
|
y,
|
|
157
|
-
O,
|
|
158
163
|
H,
|
|
164
|
+
O,
|
|
165
|
+
W,
|
|
159
166
|
j,
|
|
160
|
-
A,
|
|
161
167
|
M,
|
|
162
168
|
w,
|
|
163
169
|
R,
|
|
164
|
-
k,
|
|
165
|
-
W,
|
|
166
170
|
$,
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
k,
|
|
172
|
+
V,
|
|
173
|
+
I,
|
|
174
|
+
N,
|
|
175
|
+
U,
|
|
176
|
+
q,
|
|
177
|
+
K,
|
|
178
|
+
Q,
|
|
179
|
+
G,
|
|
180
|
+
J
|
|
181
|
+
], Fe = {
|
|
169
182
|
install(e) {
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
e.component(`Tr${
|
|
183
|
+
ee.forEach((r) => {
|
|
184
|
+
const o = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
185
|
+
e.component(`Tr${o}`, r);
|
|
173
186
|
});
|
|
174
187
|
}
|
|
175
188
|
};
|
|
176
189
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
N as ActionButton,
|
|
191
|
+
F as Attachments,
|
|
192
|
+
B as Bubble,
|
|
193
|
+
ze as BubbleContentClassRenderer,
|
|
194
|
+
x as BubbleList,
|
|
195
|
+
Ce as BubbleMarkdownContentRenderer,
|
|
196
|
+
z as BubbleProvider,
|
|
197
|
+
q as ClearButton,
|
|
198
|
+
C as Container,
|
|
199
|
+
E as Conversations,
|
|
200
|
+
J as DefaultActionButtons,
|
|
201
|
+
b as DragOverlay,
|
|
202
|
+
P as DropdownMenu,
|
|
203
|
+
L as Feedback,
|
|
204
|
+
A as History,
|
|
205
|
+
y as IconButton,
|
|
190
206
|
I as McpAddForm,
|
|
191
|
-
|
|
207
|
+
V as McpServerPicker,
|
|
192
208
|
H as Prompt,
|
|
193
|
-
|
|
194
|
-
|
|
209
|
+
O as Prompts,
|
|
210
|
+
W as Sender,
|
|
211
|
+
j as SenderCompat,
|
|
212
|
+
U as SubmitButton,
|
|
195
213
|
w as SuggestionPillButton,
|
|
196
214
|
M as SuggestionPills,
|
|
197
215
|
R as SuggestionPopover,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
216
|
+
$ as ThemeProvider,
|
|
217
|
+
N as TrActionButton,
|
|
218
|
+
F as TrAttachments,
|
|
219
|
+
B as TrBubble,
|
|
220
|
+
x as TrBubbleList,
|
|
221
|
+
z as TrBubbleProvider,
|
|
222
|
+
q as TrClearButton,
|
|
223
|
+
C as TrContainer,
|
|
224
|
+
E as TrConversations,
|
|
225
|
+
J as TrDefaultActionButtons,
|
|
226
|
+
b as TrDragOverlay,
|
|
227
|
+
P as TrDropdownMenu,
|
|
228
|
+
L as TrFeedback,
|
|
229
|
+
A as TrHistory,
|
|
230
|
+
y as TrIconButton,
|
|
210
231
|
I as TrMcpAddForm,
|
|
211
|
-
|
|
232
|
+
V as TrMcpServerPicker,
|
|
212
233
|
H as TrPrompt,
|
|
213
|
-
|
|
214
|
-
|
|
234
|
+
O as TrPrompts,
|
|
235
|
+
W as TrSender,
|
|
236
|
+
j as TrSenderCompat,
|
|
237
|
+
U as TrSubmitButton,
|
|
215
238
|
w as TrSuggestionPillButton,
|
|
216
239
|
M as TrSuggestionPills,
|
|
217
240
|
R as TrSuggestionPopover,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
241
|
+
$ as TrThemeProvider,
|
|
242
|
+
K as TrUploadButton,
|
|
243
|
+
Q as TrVoiceButton,
|
|
244
|
+
k as TrWelcome,
|
|
245
|
+
G as TrWordCounter,
|
|
246
|
+
K as UploadButton,
|
|
247
|
+
Q as VoiceButton,
|
|
248
|
+
Oe as WebSpeechHandler,
|
|
249
|
+
k as Welcome,
|
|
250
|
+
G as WordCounter,
|
|
251
|
+
Fe as default,
|
|
252
|
+
ye as useSenderContext,
|
|
253
|
+
We as useSpeechHandler,
|
|
254
|
+
Le as useTheme,
|
|
255
|
+
be as useTouchDevice,
|
|
256
|
+
Se as vDropzone
|
|
225
257
|
};
|