@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/index.js CHANGED
@@ -1,46 +1,51 @@
1
- import z from "./attachments/index.js";
2
- import { Bubble as x, BubbleList as E, BubbleProvider as S } from "./bubble/index.js";
3
- import { BubbleContentClassRenderer as ve, BubbleMarkdownContentRenderer as fe } 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 { H as y } from "./index2.js";
10
- import { u as De } from "./index2.js";
11
- import O from "./icon-button/index.js";
12
- import { Prompt as H, Prompts as j } from "./prompts/index.js";
13
- import A from "./sender/index.js";
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 k from "./theme-provider/index.js";
17
- import { useTheme as he } from "./theme-provider/index.js";
18
- import W from "./welcome/index.js";
19
- import $ from "./mcp-server-picker/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";
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 N(e, r) {
27
+ function X(e, r) {
23
28
  if (!r) return !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];
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 === o;
37
+ return e.type === t;
33
38
  });
34
39
  }
35
40
  function _(e, r) {
36
41
  return e.size <= r;
37
42
  }
38
- function q(e, r) {
43
+ function Y(e, r) {
39
44
  return e.length <= r;
40
45
  }
41
- function G(e, r) {
42
- const { accept: t, multiple: o, maxSize: a, maxFiles: l } = r, n = [], s = [];
43
- if (!q(e, l))
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
- N(i, t) && _(i, a) ? n.push(i) : s.push(i);
54
- }), !o && n.length > 1)
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((c) => !_(c, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, m = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
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: p, message: m }
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 pe = {
89
+ const Se = {
85
90
  /**
86
91
  * 挂载指令
87
92
  * @param el 元素
88
93
  * @param binding 绑定
89
94
  */
90
95
  mounted(e, r) {
91
- let t = 0;
92
- const { disabled: o, onDraggingChange: a } = r.value;
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
- o || (t++, t === 1 && a(!0, e));
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
- o || n.preventDefault();
111
+ t || n.preventDefault();
107
112
  },
108
113
  /**
109
114
  * 拖拽离开
110
115
  */
111
116
  handleDragLeave: () => {
112
- o || (t--, t === 0 && a(!1, null));
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 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__;
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 T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
129
+ const h = Array.from(s), { acceptedFiles: f, rejectedFiles: S, rejectionReason: v } = Z(h, {
125
130
  accept: m,
126
- multiple: c,
127
- maxSize: g,
128
- maxFiles: h
131
+ multiple: p,
132
+ maxSize: T,
133
+ maxFiles: g
129
134
  });
130
- f && p({ files: F, ...f }), v.length > 0 && i(v);
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
- }, J = [
147
- z,
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
- C,
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
- I
168
- ], me = {
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
- J.forEach((r) => {
171
- const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
172
- e.component(`Tr${t}`, r);
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
- 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
- C as DropdownMenu,
187
- B as Feedback,
188
- y as History,
189
- O as IconButton,
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
- $ as McpServerPicker,
207
+ V as McpServerPicker,
192
208
  H as Prompt,
193
- j as Prompts,
194
- A as Sender,
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
- 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
- C as TrDropdownMenu,
207
- B as TrFeedback,
208
- y as TrHistory,
209
- O as TrIconButton,
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
- $ as TrMcpServerPicker,
232
+ V as TrMcpServerPicker,
212
233
  H as TrPrompt,
213
- j as TrPrompts,
214
- A as TrSender,
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
- k as TrThemeProvider,
219
- W as TrWelcome,
220
- W as Welcome,
221
- me as default,
222
- he as useTheme,
223
- De as useTouchDevice,
224
- pe as vDropzone
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
  };