@opentiny/tiny-robot 0.3.0-alpha.13 → 0.3.0-alpha.15

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,21 @@
1
- import T from "./attachments/index.js";
2
- import { Bubble as E, BubbleList as S } from "./bubble/index.js";
3
- import x from "./container/index.js";
4
- import L from "./conversations/index.js";
5
- import P from "./drag-overlay/index.js";
6
- import y from "./dropdown-menu/index.js";
7
- import C from "./feedback/index.js";
8
- import O from "./history/index.js";
9
- import j from "./icon-button/index.js";
10
- import { Prompt as B, Prompts as H } from "./prompts/index.js";
11
- import b from "./sender/index.js";
12
- import w, { SuggestionPillButton as A } from "./suggestion-pills/index.js";
13
- import M from "./suggestion-popover/index.js";
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";
14
15
  import k from "./welcome/index.js";
15
- import R from "./mcp-server-picker/index.js";
16
+ import W from "./mcp-server-picker/index.js";
16
17
  var d = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(d || {});
17
- function W(e, r) {
18
+ function $(e, r) {
18
19
  if (!r) return !0;
19
20
  const o = r.split(",").map((t) => t.trim());
20
21
  return o.includes("*") ? !0 : o.some((t) => {
@@ -30,12 +31,12 @@ function W(e, r) {
30
31
  function _(e, r) {
31
32
  return e.size <= r;
32
33
  }
33
- function $(e, r) {
34
+ function I(e, r) {
34
35
  return e.length <= r;
35
36
  }
36
- function I(e, r) {
37
+ function N(e, r) {
37
38
  const { accept: o, multiple: t, maxSize: a, maxFiles: l } = r, n = [], s = [];
38
- if (!$(e, l))
39
+ if (!I(e, l))
39
40
  return {
40
41
  acceptedFiles: n,
41
42
  rejectedFiles: Array.from(e),
@@ -45,7 +46,7 @@ function I(e, r) {
45
46
  }
46
47
  };
47
48
  if (e.forEach((i) => {
48
- W(i, o) && _(i, a) ? n.push(i) : s.push(i);
49
+ $(i, o) && _(i, a) ? n.push(i) : s.push(i);
49
50
  }), !t && n.length > 1)
50
51
  return {
51
52
  acceptedFiles: [],
@@ -56,7 +57,7 @@ function I(e, r) {
56
57
  }
57
58
  };
58
59
  if (s.length > 0) {
59
- const i = s.some((m) => !_(m, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, c = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${o})`;
60
+ const i = s.some((u) => !_(u, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, c = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${o})`;
60
61
  return {
61
62
  acceptedFiles: n,
62
63
  rejectedFiles: s,
@@ -76,7 +77,7 @@ function g(e) {
76
77
  disabled: e.disabled || !1
77
78
  };
78
79
  }
79
- const ae = {
80
+ const se = {
80
81
  /**
81
82
  * 挂载指令
82
83
  * @param el 元素
@@ -111,18 +112,18 @@ const ae = {
111
112
  * @param e 事件
112
113
  */
113
114
  handleDrop: (n) => {
114
- var u;
115
+ var m;
115
116
  if (t) return;
116
117
  n.preventDefault(), o = 0, a(!1, null);
117
- const s = (u = n.dataTransfer) == null ? void 0 : u.files, { onDrop: i, onError: p, accept: c, multiple: m, maxSize: D, maxFiles: h } = e.__vDropzoneOptions__;
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__;
118
119
  if (s && s.length > 0) {
119
- const F = Array.from(s), { acceptedFiles: v, rejectedFiles: z, rejectionReason: f } = I(F, {
120
+ const F = Array.from(s), { acceptedFiles: v, rejectedFiles: T, rejectionReason: f } = N(F, {
120
121
  accept: c,
121
- multiple: m,
122
+ multiple: u,
122
123
  maxSize: D,
123
124
  maxFiles: h
124
125
  });
125
- f && p({ files: z, ...f }), v.length > 0 && i(v);
126
+ f && p({ files: T, ...f }), v.length > 0 && i(v);
126
127
  }
127
128
  }
128
129
  };
@@ -138,70 +139,75 @@ const ae = {
138
139
  unmounted(e) {
139
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__;
140
141
  }
141
- }, N = [
142
- T,
142
+ }, q = [
143
+ z,
143
144
  E,
144
- S,
145
145
  x,
146
- L,
146
+ S,
147
147
  P,
148
- y,
148
+ b,
149
+ L,
149
150
  C,
151
+ B,
152
+ y,
150
153
  O,
151
154
  j,
152
- B,
153
155
  H,
154
- b,
155
156
  w,
156
157
  A,
157
158
  M,
159
+ R,
158
160
  k,
159
- R
160
- ], se = {
161
+ W
162
+ ], ie = {
161
163
  install(e) {
162
- N.forEach((r) => {
164
+ q.forEach((r) => {
163
165
  const o = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
164
166
  e.component(`Tr${o}`, r);
165
167
  });
166
168
  }
167
169
  };
168
170
  export {
169
- T as Attachments,
171
+ z as Attachments,
170
172
  E as Bubble,
171
- S as BubbleList,
172
- x as Container,
173
- L as Conversations,
174
- P as DragOverlay,
175
- y as DropdownMenu,
176
- C as Feedback,
177
- O as History,
178
- j as IconButton,
179
- R as McpServerPicker,
180
- B as Prompt,
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
+ W as McpServerPicker,
185
+ j as Prompt,
181
186
  H as Prompts,
182
- b as Sender,
183
- A as SuggestionPillButton,
184
- w as SuggestionPills,
185
- M as SuggestionPopover,
186
- T as TrAttachments,
187
+ w as Sender,
188
+ M as SuggestionPillButton,
189
+ A as SuggestionPills,
190
+ R as SuggestionPopover,
191
+ z as TrAttachments,
187
192
  E as TrBubble,
188
- S as TrBubbleList,
189
- x as TrContainer,
190
- L as TrConversations,
191
- P as TrDragOverlay,
192
- y as TrDropdownMenu,
193
- C as TrFeedback,
194
- O as TrHistory,
195
- j as TrIconButton,
196
- R as TrMcpServerPicker,
197
- B as TrPrompt,
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
+ W as TrMcpServerPicker,
203
+ j as TrPrompt,
198
204
  H as TrPrompts,
199
- b as TrSender,
200
- A as TrSuggestionPillButton,
201
- w as TrSuggestionPills,
202
- M as TrSuggestionPopover,
205
+ w as TrSender,
206
+ M as TrSuggestionPillButton,
207
+ A as TrSuggestionPills,
208
+ R as TrSuggestionPopover,
203
209
  k as TrWelcome,
204
210
  k as Welcome,
205
- se as default,
206
- ae as vDropzone
211
+ ie as default,
212
+ se as vDropzone
207
213
  };