@opentiny/tiny-robot 0.3.1-alpha.4 → 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
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";
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
+ import E from "./container/index.js";
5
+ import P from "./conversations/index.js";
6
+ import B from "./drag-overlay/index.js";
7
+ import L from "./dropdown-menu/index.js";
8
+ import y from "./feedback/index.js";
9
+ import { H as C } from "./index3.js";
10
+ import { u as ze } from "./index3.js";
11
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";
14
- import M, { SuggestionPillButton as w } from "./suggestion-pills/index.js";
15
- import R from "./suggestion-popover/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
16
  import k from "./theme-provider/index.js";
17
- import { useTheme as he } 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((c) => !_(c, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, m = 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: m }
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: m, multiple: c, 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: m,
126
- multiple: c,
127
- maxSize: g,
128
- maxFiles: h
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
+ multiple: m,
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
  * 卸载指令
@@ -145,27 +145,27 @@ const pe = {
145
145
  }
146
146
  }, J = [
147
147
  z,
148
+ b,
148
149
  x,
149
- E,
150
150
  S,
151
+ E,
151
152
  P,
152
- b,
153
- L,
154
- C,
155
153
  B,
154
+ L,
156
155
  y,
156
+ C,
157
157
  O,
158
- H,
159
- j,
160
158
  A,
159
+ H,
161
160
  M,
162
- w,
161
+ j,
163
162
  R,
163
+ w,
164
164
  k,
165
165
  W,
166
166
  $,
167
167
  I
168
- ], me = {
168
+ ], pe = {
169
169
  install(e) {
170
170
  J.forEach((r) => {
171
171
  const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
@@ -175,51 +175,56 @@ const pe = {
175
175
  };
176
176
  export {
177
177
  z as Attachments,
178
- x as Bubble,
179
- ve as BubbleContentClassRenderer,
180
- E as BubbleList,
181
- fe as BubbleMarkdownContentRenderer,
178
+ b as Bubble,
179
+ x as BubbleList,
182
180
  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,
181
+ ve as BubbleRendererMatchPriority,
182
+ fe as BubbleRenderers,
183
+ E as Container,
184
+ P as Conversations,
185
+ B as DragOverlay,
186
+ L as DropdownMenu,
187
+ y as Feedback,
188
+ C as History,
189
189
  O as IconButton,
190
190
  I as McpAddForm,
191
191
  $ as McpServerPicker,
192
- H as Prompt,
193
- j as Prompts,
194
- A as Sender,
195
- w as SuggestionPillButton,
196
- M as SuggestionPills,
197
- R as SuggestionPopover,
192
+ A as Prompt,
193
+ H as Prompts,
194
+ M as Sender,
195
+ R as SuggestionPillButton,
196
+ j as SuggestionPills,
197
+ w as SuggestionPopover,
198
198
  k as ThemeProvider,
199
199
  z as TrAttachments,
200
- x as TrBubble,
201
- E as TrBubbleList,
200
+ b as TrBubble,
201
+ x as TrBubbleList,
202
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,
203
+ E as TrContainer,
204
+ P as TrConversations,
205
+ B as TrDragOverlay,
206
+ L as TrDropdownMenu,
207
+ y as TrFeedback,
208
+ C as TrHistory,
209
209
  O as TrIconButton,
210
210
  I as TrMcpAddForm,
211
211
  $ as TrMcpServerPicker,
212
- H as TrPrompt,
213
- j as TrPrompts,
214
- A as TrSender,
215
- w as TrSuggestionPillButton,
216
- M as TrSuggestionPills,
217
- R as TrSuggestionPopover,
212
+ A as TrPrompt,
213
+ H as TrPrompts,
214
+ M as TrSender,
215
+ R as TrSuggestionPillButton,
216
+ j as TrSuggestionPills,
217
+ w as TrSuggestionPopover,
218
218
  k as TrThemeProvider,
219
219
  W as TrWelcome,
220
220
  W as Welcome,
221
- me as default,
222
- he as useTheme,
223
- De as useTouchDevice,
224
- 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
225
230
  };