@opentiny/tiny-robot 0.3.1-alpha.5 → 0.3.1-alpha.7

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