@opentiny/tiny-robot 0.3.1-alpha.3 → 0.4.0-alpha.0

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 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";
14
- import M, { SuggestionPillButton as w } from "./suggestion-pills/index.js";
15
- 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";
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";
4
+ import E from "./container/index.js";
5
+ import S from "./conversations/index.js";
6
+ import P 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 "./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";
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";
@@ -61,11 +61,11 @@ function G(e, r) {
61
61
  }
62
62
  };
63
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})`;
64
+ const i = s.some((m) => !_(m, a)), p = i ? d.FileSizeExceeded : d.FileTypeNotAllowed, c = i ? `文件大小不能超过 ${a / 1024 / 1024}MB` : `文件类型不匹配 (accept: ${t})`;
65
65
  return {
66
66
  acceptedFiles: n,
67
67
  rejectedFiles: s,
68
- rejectionReason: { code: p, message: m }
68
+ rejectionReason: { code: p, message: c }
69
69
  };
70
70
  }
71
71
  return { acceptedFiles: n, rejectedFiles: s, rejectionReason: null };
@@ -119,11 +119,11 @@ const pe = {
119
119
  var u;
120
120
  if (o) return;
121
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__;
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
123
  if (s && s.length > 0) {
124
124
  const T = Array.from(s), { acceptedFiles: v, rejectedFiles: F, rejectionReason: f } = G(T, {
125
- accept: m,
126
- multiple: c,
125
+ accept: c,
126
+ multiple: m,
127
127
  maxSize: g,
128
128
  maxFiles: h
129
129
  });
@@ -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
- z,
148
147
  x,
148
+ b,
149
+ z,
150
+ B,
149
151
  E,
150
152
  S,
151
153
  P,
152
- b,
153
154
  L,
154
- C,
155
- B,
156
155
  y,
156
+ C,
157
+ M,
157
158
  O,
159
+ w,
158
160
  H,
159
161
  j,
160
162
  A,
161
- M,
162
- w,
163
- R,
164
163
  k,
164
+ R,
165
165
  W,
166
166
  $,
167
167
  I
168
- ], me = {
168
+ ], ce = {
169
169
  install(e) {
170
170
  J.forEach((r) => {
171
171
  const t = r.name.replace(/^Tiny/, "").replace(/^Tr/, "");
@@ -174,52 +174,54 @@ const pe = {
174
174
  }
175
175
  };
176
176
  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,
177
+ x as Attachments,
178
+ b as Bubble,
179
+ ve as BubbleBasicBox,
180
+ z as BubbleList,
181
+ fe as BubbleMarkdownRenderer,
182
+ B as BubbleProvider,
183
+ E as Container,
184
+ S as Conversations,
185
+ P as DragOverlay,
186
+ L as DropdownMenu,
187
+ y as Feedback,
188
+ C as History,
189
+ M 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,
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,
192
+ O as Prompt,
193
+ w as Prompts,
194
+ H as Sender,
195
+ A as SuggestionPillButton,
196
+ j as SuggestionPills,
197
+ k as SuggestionPopover,
198
+ R as ThemeProvider,
199
+ x as TrAttachments,
200
+ b as TrBubble,
201
+ _e as TrBubbleBasicBox,
202
+ z as TrBubbleList,
203
+ De as TrBubbleMarkdownRenderer,
204
+ B as TrBubbleProvider,
205
+ E as TrContainer,
206
+ S as TrConversations,
207
+ P as TrDragOverlay,
208
+ L as TrDropdownMenu,
209
+ y as TrFeedback,
210
+ C as TrHistory,
211
+ M as TrIconButton,
210
212
  I as TrMcpAddForm,
211
213
  $ 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,
218
- k as TrThemeProvider,
214
+ O as TrPrompt,
215
+ w as TrPrompts,
216
+ H as TrSender,
217
+ A as TrSuggestionPillButton,
218
+ j as TrSuggestionPills,
219
+ k as TrSuggestionPopover,
220
+ R as TrThemeProvider,
219
221
  W as TrWelcome,
220
222
  W as Welcome,
221
- me as default,
222
- he as useTheme,
223
- De as useTouchDevice,
223
+ ce as default,
224
+ Fe as useTheme,
225
+ he as useTouchDevice,
224
226
  pe as vDropzone
225
227
  };
package/dist/index2.js CHANGED
@@ -1,10 +1,10 @@
1
- import { ref as _, onMounted as ne, onBeforeUnmount as oe, defineComponent as P, createElementBlock as a, openBlock as r, createElementVNode as w, createVNode as $, unref as n, toDisplayString as B, mergeModels as W, useModel as j, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, nextTick as se, normalizeClass as U, withDirectives as q, createCommentVNode as G, renderSlot as A, withKeys as F, withModifiers as J, isRef as le, vModelText as re, vShow as ae } from "vue";
2
- import { IconEmptySearch as ue, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMenu2 as pe } from "@opentiny/tiny-robot-svgs";
1
+ import { ref as _, onMounted as ne, onBeforeUnmount as oe, defineComponent as P, createElementBlock as u, openBlock as r, createElementVNode as w, createVNode as T, unref as n, toDisplayString as B, mergeModels as W, useModel as j, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, nextTick as se, normalizeClass as U, withDirectives as q, createCommentVNode as G, renderSlot as A, withKeys as F, withModifiers as J, isRef as le, vModelText as re, vShow as ue } from "vue";
2
+ import { IconEmptySearch as ae, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMenu2 as pe } from "@opentiny/tiny-robot-svgs";
3
3
  import { _ as z } from "./_plugin-vue_export-helper.js";
4
- import { o as Z, a as ve, d as ge, c as ye } from "./index3.js";
4
+ import { o as Z, u as ve, c as ge, b as ye } from "./index4.js";
5
5
  import { t as O } from "./utils.js";
6
6
  const D = _(!1);
7
- let T = 0, b;
7
+ let b = 0, $;
8
8
  function _e() {
9
9
  const s = window.matchMedia("(hover: none) and (pointer: coarse)"), m = () => {
10
10
  D.value = s.matches;
@@ -18,15 +18,15 @@ function _e() {
18
18
  };
19
19
  }
20
20
  function he() {
21
- b == null || b(), b = void 0;
21
+ $ == null || $(), $ = void 0;
22
22
  }
23
23
  function Ce() {
24
24
  return typeof window > "u" ? {
25
25
  isTouchDevice: D
26
26
  } : (ne(() => {
27
- T++, T === 1 && (b = _e());
27
+ b++, b === 1 && ($ = _e());
28
28
  }), oe(() => {
29
- T = Math.max(0, T - 1), T === 0 && he();
29
+ b = Math.max(0, b - 1), b === 0 && he();
30
30
  }), {
31
31
  isTouchDevice: D
32
32
  });
@@ -38,9 +38,9 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
38
38
  },
39
39
  setup(s) {
40
40
  const m = s;
41
- return (t, c) => (r(), a("div", ke, [
41
+ return (t, c) => (r(), u("div", ke, [
42
42
  w("span", Le, [
43
- $(n(ue))
43
+ T(n(ae))
44
44
  ]),
45
45
  w("span", Ee, B(m.text), 1)
46
46
  ]));
@@ -76,23 +76,23 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
76
76
  }), v = (L) => {
77
77
  C("item-click", L), t.value = null, c.value = null;
78
78
  };
79
- return (L, g) => (r(), a("ul", {
79
+ return (L, g) => (r(), u("ul", {
80
80
  class: "tr-history__menu-list",
81
81
  ref_key: "menuRef",
82
82
  ref: E,
83
83
  style: ie(o.value)
84
84
  }, [
85
- (r(!0), a(S, null, V(h.items, (u) => (r(), a("li", {
85
+ (r(!0), u(S, null, V(h.items, (a) => (r(), u("li", {
86
86
  class: "tr-history__menu-list__item",
87
- key: u.id,
88
- onClick: (K) => v(u)
87
+ key: a.id,
88
+ onClick: (K) => v(a)
89
89
  }, [
90
- (r(), H(Y(u.icon))),
91
- w("span", null, B(u.text), 1)
90
+ (r(), H(Y(a.icon))),
91
+ w("span", null, B(a.text), 1)
92
92
  ], 8, Ie))), 128))
93
93
  ], 4));
94
94
  }
95
- }), Me = /* @__PURE__ */ z(xe, [["__scopeId", "data-v-89fdb41c"]]), Te = ({
95
+ }), Me = /* @__PURE__ */ z(xe, [["__scopeId", "data-v-89fdb41c"]]), be = ({
96
96
  renameControlOnClickOutside: s,
97
97
  onItemTitleChange: m
98
98
  }) => {
@@ -131,10 +131,10 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
131
131
  handleEditCancel: k,
132
132
  handleEditConfirm: R
133
133
  };
134
- }, X = Symbol("NO_GROUP"), $e = {
134
+ }, X = Symbol("NO_GROUP"), Te = {
135
135
  key: 0,
136
136
  class: "tr-history__group-title"
137
- }, be = { class: "tr-history__group-items" }, Ge = ["onClick"], Oe = ["title"], Se = ["onClick"], Be = /* @__PURE__ */ P({
137
+ }, $e = { class: "tr-history__group-items" }, Ge = ["onClick"], Oe = ["title"], Se = ["onClick"], Be = /* @__PURE__ */ P({
138
138
  __name: "index",
139
139
  props: {
140
140
  data: {},
@@ -165,46 +165,46 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
165
165
  handleEdit: R,
166
166
  handleEditCancel: o,
167
167
  handleEditConfirm: v
168
- } = Te({
168
+ } = be({
169
169
  renameControlOnClickOutside: t.renameControlOnClickOutside,
170
170
  onItemTitleChange: (i, e) => {
171
171
  c("item-title-change", i, e);
172
172
  }
173
- }), { isTouchDevice: L } = Ce(), g = _(null), u = _(null), K = (i, e) => {
173
+ }), { isTouchDevice: L } = Ce(), g = _(null), a = _(null), K = (i, e) => {
174
174
  if (i.currentTarget instanceof HTMLButtonElement) {
175
- if (u.value === e) {
176
- g.value = null, u.value = null;
175
+ if (a.value === e) {
176
+ g.value = null, a.value = null;
177
177
  return;
178
178
  }
179
- g.value = i.currentTarget, u.value = e;
179
+ g.value = i.currentTarget, a.value = e;
180
180
  } else
181
- g.value = null, u.value = null;
181
+ g.value = null, a.value = null;
182
182
  }, ee = (i) => {
183
- const e = u.value;
183
+ const e = a.value;
184
184
  e && (i.id === "rename" && R(e), c("item-action", i, e));
185
185
  };
186
- return (i, e) => (r(), a("div", {
186
+ return (i, e) => (r(), u("div", {
187
187
  class: U(["tr-history", { "touch-device": n(L) }])
188
188
  }, [
189
- E.value ? (r(), H(Re, { key: 1 })) : (r(), a(S, { key: 0 }, [
190
- (r(!0), a(S, null, V(C.value, (f) => (r(), a("div", {
189
+ E.value ? (r(), H(Re, { key: 1 })) : (r(), u(S, { key: 0 }, [
190
+ (r(!0), u(S, null, V(C.value, (f) => (r(), u("div", {
191
191
  class: "tr-history__group",
192
192
  key: f.group
193
193
  }, [
194
- f.group !== n(X) ? (r(), a("div", $e, B(f.group), 1)) : G("", !0),
195
- w("div", be, [
196
- (r(!0), a(S, null, V(f.items, (l, te) => (r(), a("div", {
194
+ f.group !== n(X) ? (r(), u("div", Te, B(f.group), 1)) : G("", !0),
195
+ w("div", $e, [
196
+ (r(!0), u(S, null, V(f.items, (l, te) => (r(), u("div", {
197
197
  class: U(["tr-history__item", {
198
198
  selected: l.id && l.id === t.selected,
199
199
  editing: n(p) === l,
200
- active: u.value === l
200
+ active: a.value === l
201
201
  }]),
202
202
  key: l.id || te,
203
203
  onClick: (d) => c("item-click", l)
204
204
  }, [
205
205
  A(i.$slots, "item-prefix", { item: l }, void 0, !0),
206
206
  l.icon ? (r(), H(Y(l.icon), { key: 0 })) : G("", !0),
207
- n(p) === l ? q((r(), a("input", {
207
+ n(p) === l ? q((r(), u("input", {
208
208
  key: 1,
209
209
  class: "tr-history__item-editor",
210
210
  type: "text",
@@ -242,7 +242,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
242
242
  onClick: e[6] || (e[6] = J(() => {
243
243
  }, ["stop"]))
244
244
  }, [
245
- t.showRenameControls && n(p) === l ? (r(), a("button", {
245
+ t.showRenameControls && n(p) === l ? (r(), u("button", {
246
246
  key: 0,
247
247
  class: "editor-confirm",
248
248
  ref_for: !0,
@@ -251,9 +251,9 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
251
251
  onClick: e[4] || (e[4] = //@ts-ignore
252
252
  (...d) => n(v) && n(v)(...d))
253
253
  }, [
254
- $(n(me))
254
+ T(n(me))
255
255
  ], 512)) : G("", !0),
256
- t.showRenameControls && n(p) === l ? (r(), a("button", {
256
+ t.showRenameControls && n(p) === l ? (r(), u("button", {
257
257
  key: 1,
258
258
  class: "editor-cancel",
259
259
  ref_for: !0,
@@ -262,28 +262,28 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
262
262
  onClick: e[5] || (e[5] = //@ts-ignore
263
263
  (...d) => n(o) && n(o)(...d))
264
264
  }, [
265
- $(n(fe))
265
+ T(n(fe))
266
266
  ], 512)) : G("", !0),
267
267
  w("button", {
268
268
  class: U(["menu", { hidden: n(p) === l }]),
269
269
  onClick: (d) => K(d, l)
270
270
  }, [
271
- $(n(pe))
271
+ T(n(pe))
272
272
  ], 10, Se)
273
273
  ])
274
274
  ], 10, Ge))), 128))
275
275
  ])
276
276
  ]))), 128)),
277
- q($(Me, {
277
+ q(T(Me, {
278
278
  trigger: g.value,
279
279
  "onUpdate:trigger": e[7] || (e[7] = (f) => g.value = f),
280
- data: u.value,
281
- "onUpdate:data": e[8] || (e[8] = (f) => u.value = f),
280
+ data: a.value,
281
+ "onUpdate:data": e[8] || (e[8] = (f) => a.value = f),
282
282
  items: t.menuItems,
283
283
  "menu-list-gap": t.menuListGap,
284
284
  onItemClick: ee
285
285
  }, null, 8, ["trigger", "data", "items", "menu-list-gap"]), [
286
- [ae, g.value]
286
+ [ue, g.value]
287
287
  ])
288
288
  ], 64))
289
289
  ], 2));