@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/index.js CHANGED
@@ -1,20 +1,20 @@
1
- import x from "./attachments/index.js";
2
- import { Bubble as b, BubbleList as z, BubbleProvider as B } from "./bubble/index.js";
3
- import { BubbleBasicBox as ve, BubbleMarkdownRenderer as fe, BubbleBasicBox as _e, BubbleMarkdownRenderer as De } from "./bubble/index.js";
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 S from "./conversations/index.js";
6
- import P from "./drag-overlay/index.js";
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 "./index2.js";
10
- import { u as he } from "./index2.js";
11
- import M from "./icon-button/index.js";
12
- import { Prompt as O, Prompts as w } from "./prompts/index.js";
13
- import H from "./sender/index.js";
14
- import j, { SuggestionPillButton as A } from "./suggestion-pills/index.js";
15
- import k from "./suggestion-popover/index.js";
16
- import R from "./theme-provider/index.js";
17
- import { useTheme as Fe } from "./theme-provider/index.js";
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 a = o.split("/")[0];
30
- return e.type.startsWith(a + "/");
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: a, maxFiles: l } = r, n = [], s = [];
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, a) ? n.push(i) : s.push(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 (s.length > 0) {
64
- const i = s.some((m) => !_(m, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, c = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
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: s,
68
- rejectionReason: { code: p, message: c }
67
+ rejectedFiles: a,
68
+ rejectionReason: { code: u, message: p }
69
69
  };
70
70
  }
71
- return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
71
+ return { acceptedFiles: n, rejectedFiles: a, rejectionReason: null };
72
72
  }
73
- function D(e) {
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 pe = {
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: a } = r.value;
93
- e.__vDropzoneOptions__ = D(r.value);
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 && a(!0, e));
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 && a(!1, null));
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 u;
119
+ var c;
120
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: c, multiple: m, maxSize: g, maxFiles: h } = e.__vDropzoneOptions__;
123
- if (s && s.length > 0) {
124
- const T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
125
- accept: c,
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: g,
128
- maxFiles: h
127
+ maxSize: h,
128
+ maxFiles: D
129
129
  });
130
- f && p({ files: F, ...f }), v.length > 0 && i(v);
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__ = D(r.value));
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
- B,
151
- E,
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
- w,
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
- ], ce = {
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
- x as Attachments,
177
+ z as Attachments,
178
178
  b as Bubble,
179
- ve as BubbleBasicBox,
180
- z as BubbleList,
181
- fe as BubbleMarkdownRenderer,
182
- B as BubbleProvider,
179
+ x as BubbleList,
180
+ S as BubbleProvider,
181
+ ve as BubbleRendererMatchPriority,
182
+ fe as BubbleRenderers,
183
183
  E as Container,
184
- S as Conversations,
185
- P as DragOverlay,
184
+ P as Conversations,
185
+ B as DragOverlay,
186
186
  L as DropdownMenu,
187
187
  y as Feedback,
188
188
  C as History,
189
- M as IconButton,
189
+ O as IconButton,
190
190
  I as McpAddForm,
191
191
  $ as McpServerPicker,
192
- O as Prompt,
193
- w as Prompts,
194
- H as Sender,
195
- A as SuggestionPillButton,
192
+ A as Prompt,
193
+ H as Prompts,
194
+ M as Sender,
195
+ R as SuggestionPillButton,
196
196
  j as SuggestionPills,
197
- k as SuggestionPopover,
198
- R as ThemeProvider,
199
- x as TrAttachments,
197
+ w as SuggestionPopover,
198
+ k as ThemeProvider,
199
+ z as TrAttachments,
200
200
  b as TrBubble,
201
- _e as TrBubbleBasicBox,
202
- z as TrBubbleList,
203
- De as TrBubbleMarkdownRenderer,
204
- B as TrBubbleProvider,
201
+ x as TrBubbleList,
202
+ S as TrBubbleProvider,
205
203
  E as TrContainer,
206
- S as TrConversations,
207
- P as TrDragOverlay,
204
+ P as TrConversations,
205
+ B as TrDragOverlay,
208
206
  L as TrDropdownMenu,
209
207
  y as TrFeedback,
210
208
  C as TrHistory,
211
- M as TrIconButton,
209
+ O as TrIconButton,
212
210
  I as TrMcpAddForm,
213
211
  $ as TrMcpServerPicker,
214
- O as TrPrompt,
215
- w as TrPrompts,
216
- H as TrSender,
217
- A as TrSuggestionPillButton,
212
+ A as TrPrompt,
213
+ H as TrPrompts,
214
+ M as TrSender,
215
+ R as TrSuggestionPillButton,
218
216
  j as TrSuggestionPills,
219
- k as TrSuggestionPopover,
220
- R as TrThemeProvider,
217
+ w as TrSuggestionPopover,
218
+ k as TrThemeProvider,
221
219
  W as TrWelcome,
222
220
  W as Welcome,
223
- ce as default,
224
- Fe as useTheme,
225
- he as useTouchDevice,
226
- pe as vDropzone
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
  };