@opentiny/tiny-robot 0.3.1-alpha.4 → 0.4.0-alpha.1
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 +10 -4014
- 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 +420 -193
- package/dist/index.js +87 -82
- package/dist/index2.js +819 -279
- package/dist/index3.js +282 -691
- package/dist/index4.js +382 -156
- package/dist/index5.js +710 -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 +540 -548
- 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
1
|
import z from "./attachments/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { H as
|
|
10
|
-
import { u as
|
|
2
|
+
import { B as b, a as x, b as S } from "./index2.js";
|
|
3
|
+
import { c as ve, d as fe, h as _e, u as ge, e as he, f as De, g as Te } from "./index2.js";
|
|
4
|
+
import E from "./container/index.js";
|
|
5
|
+
import P from "./conversations/index.js";
|
|
6
|
+
import B 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 "./index3.js";
|
|
10
|
+
import { u as ze } from "./index3.js";
|
|
11
11
|
import O from "./icon-button/index.js";
|
|
12
|
-
import { Prompt as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
12
|
+
import { Prompt as A, Prompts as H } from "./prompts/index.js";
|
|
13
|
+
import M from "./sender/index.js";
|
|
14
|
+
import j, { SuggestionPillButton as R } from "./suggestion-pills/index.js";
|
|
15
|
+
import w from "./suggestion-popover/index.js";
|
|
16
16
|
import k from "./theme-provider/index.js";
|
|
17
|
-
import { useTheme as
|
|
17
|
+
import { useTheme as xe } 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";
|
|
@@ -26,8 +26,8 @@ function N(e, r) {
|
|
|
26
26
|
if (o.startsWith("."))
|
|
27
27
|
return e.name.toLowerCase().endsWith(o.toLowerCase());
|
|
28
28
|
if (o.includes("/*")) {
|
|
29
|
-
const
|
|
30
|
-
return e.type.startsWith(
|
|
29
|
+
const s = o.split("/")[0];
|
|
30
|
+
return e.type.startsWith(s + "/");
|
|
31
31
|
} else
|
|
32
32
|
return e.type === o;
|
|
33
33
|
});
|
|
@@ -39,7 +39,7 @@ function q(e, r) {
|
|
|
39
39
|
return e.length <= r;
|
|
40
40
|
}
|
|
41
41
|
function G(e, r) {
|
|
42
|
-
const { accept: t, multiple: o, maxSize:
|
|
42
|
+
const { accept: t, multiple: o, maxSize: s, maxFiles: l } = r, n = [], a = [];
|
|
43
43
|
if (!q(e, l))
|
|
44
44
|
return {
|
|
45
45
|
acceptedFiles: n,
|
|
@@ -50,7 +50,7 @@ function G(e, r) {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
if (e.forEach((i) => {
|
|
53
|
-
N(i, t) && _(i,
|
|
53
|
+
N(i, t) && _(i, s) ? n.push(i) : a.push(i);
|
|
54
54
|
}), !o && n.length > 1)
|
|
55
55
|
return {
|
|
56
56
|
acceptedFiles: [],
|
|
@@ -60,17 +60,17 @@ function G(e, r) {
|
|
|
60
60
|
message: "只允许上传一个文件"
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
if (
|
|
64
|
-
const i =
|
|
63
|
+
if (a.length > 0) {
|
|
64
|
+
const i = a.some((m) => !_(m, s)), u = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, p = i ? `文件大小不能超过 ${s / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
|
|
65
65
|
return {
|
|
66
66
|
acceptedFiles: n,
|
|
67
|
-
rejectedFiles:
|
|
68
|
-
rejectionReason: { code:
|
|
67
|
+
rejectedFiles: a,
|
|
68
|
+
rejectionReason: { code: u, message: p }
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
return { acceptedFiles: n, rejectedFiles:
|
|
71
|
+
return { acceptedFiles: n, rejectedFiles: a, rejectionReason: null };
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function g(e) {
|
|
74
74
|
return {
|
|
75
75
|
accept: e.accept || "*",
|
|
76
76
|
multiple: e.multiple ?? !0,
|
|
@@ -81,7 +81,7 @@ function D(e) {
|
|
|
81
81
|
disabled: e.disabled || !1
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const ue = {
|
|
85
85
|
/**
|
|
86
86
|
* 挂载指令
|
|
87
87
|
* @param el 元素
|
|
@@ -89,14 +89,14 @@ const pe = {
|
|
|
89
89
|
*/
|
|
90
90
|
mounted(e, r) {
|
|
91
91
|
let t = 0;
|
|
92
|
-
const { disabled: o, onDraggingChange:
|
|
93
|
-
e.__vDropzoneOptions__ =
|
|
92
|
+
const { disabled: o, onDraggingChange: s } = r.value;
|
|
93
|
+
e.__vDropzoneOptions__ = g(r.value);
|
|
94
94
|
const l = {
|
|
95
95
|
/**
|
|
96
96
|
* 拖拽进入
|
|
97
97
|
*/
|
|
98
98
|
handleDragEnter: () => {
|
|
99
|
-
o || (t++, t === 1 &&
|
|
99
|
+
o || (t++, t === 1 && s(!0, e));
|
|
100
100
|
},
|
|
101
101
|
/**
|
|
102
102
|
* 拖拽覆盖
|
|
@@ -109,32 +109,32 @@ const pe = {
|
|
|
109
109
|
* 拖拽离开
|
|
110
110
|
*/
|
|
111
111
|
handleDragLeave: () => {
|
|
112
|
-
o || (t--, t === 0 &&
|
|
112
|
+
o || (t--, t === 0 && s(!1, null));
|
|
113
113
|
},
|
|
114
114
|
/**
|
|
115
115
|
* 拖拽放下
|
|
116
116
|
* @param e 事件
|
|
117
117
|
*/
|
|
118
118
|
handleDrop: (n) => {
|
|
119
|
-
var
|
|
119
|
+
var c;
|
|
120
120
|
if (o) return;
|
|
121
|
-
n.preventDefault(), t = 0,
|
|
122
|
-
const
|
|
123
|
-
if (
|
|
124
|
-
const T = Array.from(
|
|
125
|
-
accept:
|
|
126
|
-
multiple:
|
|
127
|
-
maxSize:
|
|
128
|
-
maxFiles:
|
|
121
|
+
n.preventDefault(), t = 0, s(!1, null);
|
|
122
|
+
const a = (c = n.dataTransfer) == null ? void 0 : c.files, { onDrop: i, onError: u, accept: p, multiple: m, maxSize: h, maxFiles: D } = e.__vDropzoneOptions__;
|
|
123
|
+
if (a && a.length > 0) {
|
|
124
|
+
const T = Array.from(a), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
|
|
125
|
+
accept: p,
|
|
126
|
+
multiple: m,
|
|
127
|
+
maxSize: h,
|
|
128
|
+
maxFiles: D
|
|
129
129
|
});
|
|
130
|
-
f &&
|
|
130
|
+
f && u({ files: F, ...f }), v.length > 0 && i(v);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
e.__vDropzoneHandlers__ = l, e.addEventListener("dragenter", l.handleDragEnter), e.addEventListener("dragover", l.handleDragOver), e.addEventListener("dragleave", l.handleDragLeave), e.addEventListener("drop", l.handleDrop);
|
|
135
135
|
},
|
|
136
136
|
updated(e, r) {
|
|
137
|
-
e.__vDropzoneOptions__ && (e.__vDropzoneOptions__ =
|
|
137
|
+
e.__vDropzoneOptions__ && (e.__vDropzoneOptions__ = g(r.value));
|
|
138
138
|
},
|
|
139
139
|
/**
|
|
140
140
|
* 卸载指令
|
|
@@ -145,27 +145,27 @@ const pe = {
|
|
|
145
145
|
}
|
|
146
146
|
}, J = [
|
|
147
147
|
z,
|
|
148
|
+
b,
|
|
148
149
|
x,
|
|
149
|
-
E,
|
|
150
150
|
S,
|
|
151
|
+
E,
|
|
151
152
|
P,
|
|
152
|
-
b,
|
|
153
|
-
L,
|
|
154
|
-
C,
|
|
155
153
|
B,
|
|
154
|
+
L,
|
|
156
155
|
y,
|
|
156
|
+
C,
|
|
157
157
|
O,
|
|
158
|
-
H,
|
|
159
|
-
j,
|
|
160
158
|
A,
|
|
159
|
+
H,
|
|
161
160
|
M,
|
|
162
|
-
|
|
161
|
+
j,
|
|
163
162
|
R,
|
|
163
|
+
w,
|
|
164
164
|
k,
|
|
165
165
|
W,
|
|
166
166
|
$,
|
|
167
167
|
I
|
|
168
|
-
],
|
|
168
|
+
], pe = {
|
|
169
169
|
install(e) {
|
|
170
170
|
J.forEach((r) => {
|
|
171
171
|
const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
|
|
@@ -175,51 +175,56 @@ const pe = {
|
|
|
175
175
|
};
|
|
176
176
|
export {
|
|
177
177
|
z as Attachments,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
E as BubbleList,
|
|
181
|
-
fe as BubbleMarkdownContentRenderer,
|
|
178
|
+
b as Bubble,
|
|
179
|
+
x as BubbleList,
|
|
182
180
|
S as BubbleProvider,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
B as
|
|
188
|
-
|
|
181
|
+
ve as BubbleRendererMatchPriority,
|
|
182
|
+
fe as BubbleRenderers,
|
|
183
|
+
E as Container,
|
|
184
|
+
P as Conversations,
|
|
185
|
+
B as DragOverlay,
|
|
186
|
+
L as DropdownMenu,
|
|
187
|
+
y as Feedback,
|
|
188
|
+
C as History,
|
|
189
189
|
O as IconButton,
|
|
190
190
|
I as McpAddForm,
|
|
191
191
|
$ as McpServerPicker,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
A as Prompt,
|
|
193
|
+
H as Prompts,
|
|
194
|
+
M as Sender,
|
|
195
|
+
R as SuggestionPillButton,
|
|
196
|
+
j as SuggestionPills,
|
|
197
|
+
w as SuggestionPopover,
|
|
198
198
|
k as ThemeProvider,
|
|
199
199
|
z as TrAttachments,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
b as TrBubble,
|
|
201
|
+
x as TrBubbleList,
|
|
202
202
|
S as TrBubbleProvider,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
203
|
+
E as TrContainer,
|
|
204
|
+
P as TrConversations,
|
|
205
|
+
B as TrDragOverlay,
|
|
206
|
+
L as TrDropdownMenu,
|
|
207
|
+
y as TrFeedback,
|
|
208
|
+
C as TrHistory,
|
|
209
209
|
O as TrIconButton,
|
|
210
210
|
I as TrMcpAddForm,
|
|
211
211
|
$ as TrMcpServerPicker,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
A as TrPrompt,
|
|
213
|
+
H as TrPrompts,
|
|
214
|
+
M as TrSender,
|
|
215
|
+
R as TrSuggestionPillButton,
|
|
216
|
+
j as TrSuggestionPills,
|
|
217
|
+
w as TrSuggestionPopover,
|
|
218
218
|
k as TrThemeProvider,
|
|
219
219
|
W as TrWelcome,
|
|
220
220
|
W as Welcome,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
pe as default,
|
|
222
|
+
_e as useAutoScroll,
|
|
223
|
+
ge as useBubbleBoxRenderer,
|
|
224
|
+
he as useBubbleContentRenderer,
|
|
225
|
+
De as useBubbleStateChangeFn,
|
|
226
|
+
Te as useOmitMessageFields,
|
|
227
|
+
xe as useTheme,
|
|
228
|
+
ze as useTouchDevice,
|
|
229
|
+
ue as vDropzone
|
|
225
230
|
};
|