@opentiny/tiny-robot 0.4.0-alpha.0 → 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 -810
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +2 -2
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/history/index.js +1 -1
- package/dist/index.d.ts +371 -311
- package/dist/index.js +83 -80
- package/dist/index2.js +819 -279
- package/dist/index3.js +291 -377
- package/dist/index4.js +358 -681
- package/dist/index5.js +697 -148
- 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 +1 -1
- 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 +1 -1
- package/dist/utils.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import z from "./attachments/index.js";
|
|
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
4
|
import E from "./container/index.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import P from "./conversations/index.js";
|
|
6
|
+
import B from "./drag-overlay/index.js";
|
|
7
7
|
import L from "./dropdown-menu/index.js";
|
|
8
8
|
import y from "./feedback/index.js";
|
|
9
|
-
import { H as C } from "./
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import { Prompt as
|
|
13
|
-
import
|
|
14
|
-
import j, { SuggestionPillButton as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { useTheme as
|
|
9
|
+
import { H as C } from "./index3.js";
|
|
10
|
+
import { u as ze } from "./index3.js";
|
|
11
|
+
import O from "./icon-button/index.js";
|
|
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
|
+
import k from "./theme-provider/index.js";
|
|
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:
|
|
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
126
|
multiple: m,
|
|
127
|
-
maxSize:
|
|
128
|
-
maxFiles:
|
|
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
|
* 卸载指令
|
|
@@ -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
|
-
x,
|
|
148
|
-
b,
|
|
149
147
|
z,
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
b,
|
|
149
|
+
x,
|
|
152
150
|
S,
|
|
151
|
+
E,
|
|
153
152
|
P,
|
|
153
|
+
B,
|
|
154
154
|
L,
|
|
155
155
|
y,
|
|
156
156
|
C,
|
|
157
|
-
M,
|
|
158
157
|
O,
|
|
159
|
-
|
|
158
|
+
A,
|
|
160
159
|
H,
|
|
160
|
+
M,
|
|
161
161
|
j,
|
|
162
|
-
A,
|
|
163
|
-
k,
|
|
164
162
|
R,
|
|
163
|
+
w,
|
|
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/, "");
|
|
@@ -174,54 +174,57 @@ const pe = {
|
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
export {
|
|
177
|
-
|
|
177
|
+
z as Attachments,
|
|
178
178
|
b as Bubble,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
x as BubbleList,
|
|
180
|
+
S as BubbleProvider,
|
|
181
|
+
ve as BubbleRendererMatchPriority,
|
|
182
|
+
fe as BubbleRenderers,
|
|
183
183
|
E as Container,
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
P as Conversations,
|
|
185
|
+
B as DragOverlay,
|
|
186
186
|
L as DropdownMenu,
|
|
187
187
|
y as Feedback,
|
|
188
188
|
C as History,
|
|
189
|
-
|
|
189
|
+
O as IconButton,
|
|
190
190
|
I as McpAddForm,
|
|
191
191
|
$ as McpServerPicker,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
A as Prompt,
|
|
193
|
+
H as Prompts,
|
|
194
|
+
M as Sender,
|
|
195
|
+
R as SuggestionPillButton,
|
|
196
196
|
j as SuggestionPills,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
w as SuggestionPopover,
|
|
198
|
+
k as ThemeProvider,
|
|
199
|
+
z as TrAttachments,
|
|
200
200
|
b as TrBubble,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
De as TrBubbleMarkdownRenderer,
|
|
204
|
-
B as TrBubbleProvider,
|
|
201
|
+
x as TrBubbleList,
|
|
202
|
+
S as TrBubbleProvider,
|
|
205
203
|
E as TrContainer,
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
P as TrConversations,
|
|
205
|
+
B as TrDragOverlay,
|
|
208
206
|
L as TrDropdownMenu,
|
|
209
207
|
y as TrFeedback,
|
|
210
208
|
C as TrHistory,
|
|
211
|
-
|
|
209
|
+
O as TrIconButton,
|
|
212
210
|
I as TrMcpAddForm,
|
|
213
211
|
$ as TrMcpServerPicker,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
A as TrPrompt,
|
|
213
|
+
H as TrPrompts,
|
|
214
|
+
M as TrSender,
|
|
215
|
+
R as TrSuggestionPillButton,
|
|
218
216
|
j as TrSuggestionPills,
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
w as TrSuggestionPopover,
|
|
218
|
+
k as TrThemeProvider,
|
|
221
219
|
W as TrWelcome,
|
|
222
220
|
W as Welcome,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
|
227
230
|
};
|