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