@opentiny/tiny-robot 0.4.2-alpha.3 → 0.4.2-alpha.4

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.
@@ -1,24 +1,24 @@
1
- import { computed as k, ref as L, onUnmounted as re, defineComponent as z, useModel as se, openBlock as o, createElementBlock as u, withModifiers as R, createElementVNode as v, createVNode as F, unref as m, Fragment as O, renderList as N, normalizeClass as T, mergeModels as W, h as ie, createCommentVNode as C, toDisplayString as U, createBlock as M, withCtx as oe, resolveDynamicComponent as Y, watch as le } from "vue";
2
- import { IconFileOther as ce, IconFileFolder as Z, IconFilePpt as G, IconFileExcel as J, IconFileWord as Q, IconFilePdf as X, IconFileImage as ee, IconClose as de, IconArrowLeft as ue, IconArrowRight as fe, IconFileRemove as me, IconImageLoading as j, IconImageWarning as q } from "@opentiny/tiny-robot-svgs";
1
+ import { computed as k, ref as L, onUnmounted as ae, defineComponent as z, useModel as se, openBlock as o, createElementBlock as u, withModifiers as R, createElementVNode as v, createVNode as F, unref as m, Fragment as O, renderList as N, normalizeClass as T, mergeModels as j, h as ie, createCommentVNode as C, toDisplayString as U, createBlock as M, withCtx as oe, resolveDynamicComponent as Y, watch as le } from "vue";
2
+ import { IconFileOther as ce, IconFileFolder as Z, IconFilePpt as G, IconFileExcel as J, IconFileWord as Q, IconFilePdf as X, IconFileImage as ee, IconClose as de, IconArrowLeft as ue, IconArrowRight as fe, IconFileRemove as me, IconUploadLoading as W, IconError as q } from "@opentiny/tiny-robot-svgs";
3
3
  import { _ as V } from "../_plugin-vue_export-helper.js";
4
4
  import { TinyTooltip as pe } from "@opentiny/vue";
5
- const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\//, S = (e) => {
5
+ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\//, E = (e) => {
6
6
  try {
7
7
  return decodeURIComponent(e);
8
8
  } catch {
9
9
  return e;
10
10
  }
11
- }, P = (e, a, n = !1) => {
12
- if (!a) return;
13
- const r = (n ? S(a) : a).trim();
14
- r && !e.includes(r) && e.push(r);
11
+ }, P = (e, r, n = !1) => {
12
+ if (!r) return;
13
+ const a = (n ? E(r) : r).trim();
14
+ a && !e.includes(a) && e.push(a);
15
15
  }, ne = (e) => {
16
- const a = e.trim();
17
- if (!a)
16
+ const r = e.trim();
17
+ if (!r)
18
18
  return null;
19
19
  try {
20
- if (ve.test(a) || H.test(a)) {
21
- const s = new URL(H.test(a) ? `https:${a}` : a);
20
+ if (ve.test(r) || H.test(r)) {
21
+ const s = new URL(H.test(r) ? `https:${r}` : r);
22
22
  return {
23
23
  pathname: s.pathname,
24
24
  searchParams: s.searchParams
@@ -27,43 +27,43 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
27
27
  } catch {
28
28
  return null;
29
29
  }
30
- const [n = ""] = a.split("#"), r = n.indexOf("?");
30
+ const [n = ""] = r.split("#"), a = n.indexOf("?");
31
31
  return {
32
- pathname: r === -1 ? n : n.slice(0, r),
33
- searchParams: new URLSearchParams(r === -1 ? "" : n.slice(r + 1))
32
+ pathname: a === -1 ? n : n.slice(0, a),
33
+ searchParams: new URLSearchParams(a === -1 ? "" : n.slice(a + 1))
34
34
  };
35
- }, E = (e) => {
35
+ }, S = (e) => {
36
36
  const n = e.split("/").filter(Boolean).at(-1) || "";
37
- return S(n);
37
+ return E(n);
38
38
  }, _e = (e) => {
39
- const a = [], n = e.trim();
39
+ const r = [], n = e.trim();
40
40
  if (!n)
41
- return a;
42
- P(a, n);
43
- const r = ne(n);
44
- if (r)
41
+ return r;
42
+ P(r, n);
43
+ const a = ne(n);
44
+ if (a)
45
45
  return te.forEach((p) => {
46
- P(a, r.searchParams.get(p), !0);
47
- }), P(a, r.pathname, !0), P(a, E(r.pathname)), a;
46
+ P(r, a.searchParams.get(p), !0);
47
+ }), P(r, a.pathname, !0), P(r, S(a.pathname)), r;
48
48
  const s = n.split("#")[0].split("?")[0];
49
- return P(a, s), P(a, E(s)), a;
49
+ return P(r, s), P(r, S(s)), r;
50
50
  }, he = (e) => {
51
- const a = ne(e);
52
- if (a) {
51
+ const r = ne(e);
52
+ if (r) {
53
53
  for (const p of te) {
54
- const _ = a.searchParams.get(p);
54
+ const _ = r.searchParams.get(p);
55
55
  if (_ != null && _.trim())
56
- return S(_.trim());
56
+ return E(_.trim());
57
57
  }
58
- const r = E(a.pathname);
59
- if (r)
60
- return r;
61
- const s = S(a.pathname).replace(/^\/+/, "").trim();
58
+ const a = S(r.pathname);
59
+ if (a)
60
+ return a;
61
+ const s = E(r.pathname).replace(/^\/+/, "").trim();
62
62
  if (s)
63
63
  return s;
64
64
  }
65
65
  const n = e.trim().split("#")[0].split("?")[0];
66
- return E(n) || n;
66
+ return S(n) || n;
67
67
  }, B = {
68
68
  image: ee,
69
69
  pdf: X,
@@ -76,11 +76,11 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
76
76
  {
77
77
  type: "image",
78
78
  matcher: (e) => {
79
- var n, r;
79
+ var n, a;
80
80
  if (typeof e != "string")
81
81
  return ((n = e.type) == null ? void 0 : n.startsWith("image/")) || !1;
82
- const a = ((r = e.split(".").pop()) == null ? void 0 : r.toLowerCase()) || "";
83
- return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(a);
82
+ const r = ((a = e.split(".").pop()) == null ? void 0 : a.toLowerCase()) || "";
83
+ return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(r);
84
84
  },
85
85
  icon: ee
86
86
  },
@@ -95,8 +95,8 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
95
95
  var n;
96
96
  if (typeof e != "string")
97
97
  return e.type === "application/msword" || e.type === "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
98
- const a = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
99
- return ["doc", "docx"].includes(a);
98
+ const r = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
99
+ return ["doc", "docx"].includes(r);
100
100
  },
101
101
  icon: Q
102
102
  },
@@ -106,8 +106,8 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
106
106
  var n;
107
107
  if (typeof e != "string")
108
108
  return e.type === "application/vnd.ms-excel" || e.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
109
- const a = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
110
- return ["xls", "xlsx"].includes(a);
109
+ const r = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
110
+ return ["xls", "xlsx"].includes(r);
111
111
  },
112
112
  icon: J
113
113
  },
@@ -117,8 +117,8 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
117
117
  var n;
118
118
  if (typeof e != "string")
119
119
  return e.type === "application/vnd.ms-powerpoint" || e.type === "application/vnd.openxmlformats-officedocument.presentationml.presentation";
120
- const a = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
121
- return ["ppt", "pptx"].includes(a);
120
+ const r = ((n = e.split(".").pop()) == null ? void 0 : n.toLowerCase()) || "";
121
+ return ["ppt", "pptx"].includes(r);
122
122
  },
123
123
  icon: G
124
124
  },
@@ -128,17 +128,17 @@ const te = ["filename", "fileName"], ve = /^[a-zA-Z][a-zA-Z\d+.-]*:/, H = /^\/\/
128
128
  icon: Z
129
129
  }
130
130
  ];
131
- function ae(e = {}) {
132
- const { customIcons: a, fileMatchers: n } = e, r = () => {
131
+ function re(e = {}) {
132
+ const { customIcons: r, fileMatchers: n } = e, a = () => {
133
133
  let t = [];
134
134
  return n ? t = n.concat(K) : t = K, t;
135
135
  }, s = (t = "other") => k(() => {
136
- if (a != null && a[t])
137
- return a[t];
138
- const l = r().find((f) => f.type === t);
136
+ if (r != null && r[t])
137
+ return r[t];
138
+ const l = a().find((f) => f.type === t);
139
139
  return l != null && l.icon ? l.icon : B[t] ? B[t] : B.other;
140
140
  }), p = (t) => {
141
- const i = r(), l = typeof t == "string" ? _e(t) : [];
141
+ const i = a(), l = typeof t == "string" ? _e(t) : [];
142
142
  for (const f of i)
143
143
  if (typeof t != "string" && f.matcher(t) || typeof t == "string" && l.some((x) => f.matcher(x)))
144
144
  return f.type;
@@ -176,38 +176,38 @@ function ae(e = {}) {
176
176
  getIconComponent: s
177
177
  };
178
178
  }
179
- const ge = (e, a) => {
179
+ const ge = (e, r) => {
180
180
  if (e.startsWith("blob:") || e.startsWith("data:")) {
181
181
  const n = document.createElement("a");
182
- n.href = e, n.download = a, document.body.appendChild(n), requestAnimationFrame(() => {
182
+ n.href = e, n.download = r, document.body.appendChild(n), requestAnimationFrame(() => {
183
183
  n.click(), document.body.removeChild(n), URL.revokeObjectURL(e);
184
184
  });
185
185
  }
186
186
  };
187
- function ye(e, a) {
188
- const n = L([]), r = k(() => e.file.fileType === "image"), s = (d) => {
187
+ function ye(e, r) {
188
+ const n = L([]), a = k(() => e.file.fileType === "image"), s = (d) => {
189
189
  const g = URL.createObjectURL(d);
190
190
  return n.value.push(g), g;
191
191
  }, p = (d) => {
192
- a("preview", d, e.file);
192
+ r("preview", d, e.file);
193
193
  }, _ = (d) => {
194
- if (a("download", d, e.file), !d.defaultPrevented && e.file.rawFile && !e.file.url) {
194
+ if (r("download", d, e.file), !d.defaultPrevented && e.file.rawFile && !e.file.url) {
195
195
  const g = s(e.file.rawFile);
196
196
  ge(g, e.file.name || e.file.rawFile.name);
197
197
  }
198
198
  }, I = () => {
199
- a("remove", e.file);
199
+ r("remove", e.file);
200
200
  }, b = () => {
201
- a("retry", e.file);
201
+ r("retry", e.file);
202
202
  }, w = (d, g) => {
203
- g.stopPropagation(), d.handler && d.handler(e.file), d.type === "preview" ? p(g) : d.type === "download" ? _(g) : a("action", { action: d, file: e.file });
203
+ g.stopPropagation(), d.handler && d.handler(e.file), d.type === "preview" ? p(g) : d.type === "download" ? _(g) : r("action", { action: d, file: e.file });
204
204
  };
205
- return re(() => {
205
+ return ae(() => {
206
206
  n.value.forEach((d) => {
207
207
  URL.revokeObjectURL(d);
208
208
  }), n.value = [];
209
209
  }), {
210
- isImage: r,
210
+ isImage: a,
211
211
  handlePreview: p,
212
212
  downloadFile: _,
213
213
  handleRemove: I,
@@ -217,15 +217,15 @@ function ye(e, a) {
217
217
  }
218
218
  const we = { class: "tr-image-preview__main" }, Ie = ["disabled"], be = { class: "tr-image-preview__content" }, Ce = ["src", "alt"], ke = ["disabled"], xe = { class: "tr-image-preview__footer" }, Fe = { class: "tr-image-preview__thumbnails" }, Ue = ["onClick"], Pe = ["src", "alt"], Re = /* @__PURE__ */ z({
219
219
  __name: "ImagePreview",
220
- props: /* @__PURE__ */ W({
220
+ props: /* @__PURE__ */ j({
221
221
  images: {}
222
222
  }, {
223
223
  currentIndex: { required: !0 },
224
224
  currentIndexModifiers: {}
225
225
  }),
226
- emits: /* @__PURE__ */ W(["close"], ["update:currentIndex"]),
227
- setup(e, { emit: a }) {
228
- const n = e, r = a, s = se(e, "currentIndex"), p = k(() => n.images[s.value]), _ = () => {
226
+ emits: /* @__PURE__ */ j(["close"], ["update:currentIndex"]),
227
+ setup(e, { emit: r }) {
228
+ const n = e, a = r, s = se(e, "currentIndex"), p = k(() => n.images[s.value]), _ = () => {
229
229
  s.value > 0 && s.value--;
230
230
  }, I = () => {
231
231
  s.value < n.images.length - 1 && s.value++;
@@ -233,7 +233,7 @@ const we = { class: "tr-image-preview__main" }, Ie = ["disabled"], be = { class:
233
233
  s.value = d;
234
234
  };
235
235
  function w() {
236
- r("close");
236
+ a("close");
237
237
  }
238
238
  return (d, g) => {
239
239
  var c, h;
@@ -288,8 +288,8 @@ const we = { class: "tr-image-preview__main" }, Ie = ["disabled"], be = { class:
288
288
  };
289
289
  }
290
290
  }), Le = /* @__PURE__ */ V(Re, [["__scopeId", "data-v-027af77c"]]);
291
- function Te(e, a, n = {}) {
292
- const r = L(!1), s = L([]), p = L(0), _ = (c) => {
291
+ function Te(e, r, n = {}) {
292
+ const a = L(!1), s = L([]), p = L(0), _ = (c) => {
293
293
  p.value = c;
294
294
  }, I = (c) => {
295
295
  const h = e.value.findIndex((t) => t.id === c.id);
@@ -298,20 +298,20 @@ function Te(e, a, n = {}) {
298
298
  (i) => i.fileType === "image" && i.status !== "error" && i.status !== "uploading"
299
299
  );
300
300
  const t = s.value.findIndex((i) => i.id === c.id);
301
- t !== -1 && (p.value = t, r.value = !0);
301
+ t !== -1 && (p.value = t, a.value = !0);
302
302
  }
303
303
  }, b = (c, h) => {
304
- a("preview", c, h), !c.defaultPrevented && I(h);
304
+ r("preview", c, h), !c.defaultPrevented && I(h);
305
305
  }, w = () => {
306
- r.value = !1;
306
+ a.value = !1;
307
307
  }, d = (c, h) => {
308
- n.onDownload ? n.onDownload(c, h) : a("download", c, h);
308
+ n.onDownload ? n.onDownload(c, h) : r("download", c, h);
309
309
  };
310
310
  return {
311
311
  // 显示预览
312
312
  handlePreview: b,
313
313
  // 渲染预览组件
314
- renderPreview: () => r.value ? ie(Le, {
314
+ renderPreview: () => a.value ? ie(Le, {
315
315
  images: s.value,
316
316
  currentIndex: p.value,
317
317
  "onUpdate:currentIndex": _,
@@ -320,12 +320,12 @@ function Te(e, a, n = {}) {
320
320
  }) : null
321
321
  };
322
322
  }
323
- function Me(e, a) {
323
+ function Me(e, r) {
324
324
  return {
325
- actualListType: k(() => a && a !== "auto" ? a : e.value.length === 0 ? "card" : e.value.every((s) => s.fileType === "image") ? "picture" : "card")
325
+ actualListType: k(() => r && r !== "auto" ? r : e.value.length === 0 ? "card" : e.value.every((s) => s.fileType === "image") ? "picture" : "card")
326
326
  };
327
327
  }
328
- const Se = ["data-file-type"], Ee = {
328
+ const Ee = ["data-file-type"], Se = {
329
329
  key: 1,
330
330
  class: "tr-file-card__picture-container"
331
331
  }, Ae = ["src", "alt"], $e = {
@@ -346,10 +346,10 @@ const Se = ["data-file-type"], Ee = {
346
346
  }, Ne = { class: "tr-file-card__icon-wrapper" }, Ve = {
347
347
  key: 0,
348
348
  class: "tr-file-card__status-overlay tr-file-card__status-overlay--icon"
349
- }, We = {
349
+ }, je = {
350
350
  key: 0,
351
351
  class: "tr-file-card__status-icon tr-file-card__status-icon--loading"
352
- }, je = { class: "tr-file-card__content" }, qe = { class: "tr-file-card__info" }, He = ["title"], Ke = {
352
+ }, We = { class: "tr-file-card__content" }, qe = { class: "tr-file-card__info" }, He = ["title"], Ke = {
353
353
  key: 0,
354
354
  class: "tr-file-card__status"
355
355
  }, Ye = {
@@ -367,7 +367,7 @@ const Se = ["data-file-type"], Ee = {
367
367
  }, nt = {
368
368
  key: 2,
369
369
  class: "tr-file-card__status-error"
370
- }, at = /* @__PURE__ */ z({
370
+ }, rt = /* @__PURE__ */ z({
371
371
  __name: "FileCard",
372
372
  props: {
373
373
  file: {},
@@ -379,11 +379,11 @@ const Se = ["data-file-type"], Ee = {
379
379
  fileMatchers: {}
380
380
  },
381
381
  emits: ["remove", "preview", "action", "retry", "download"],
382
- setup(e, { emit: a }) {
383
- const n = e, r = a, { formatFileSize: s, getIconComponent: p } = ae({
382
+ setup(e, { emit: r }) {
383
+ const n = e, a = r, { formatFileSize: s, getIconComponent: p } = re({
384
384
  customIcons: n.fileIcons,
385
385
  fileMatchers: n.fileMatchers
386
- }), { isImage: _, handlePreview: I, handleRemove: b, handleCustomAction: w, handleRetry: d } = ye(n, r), g = k(() => p(n.file.fileType).value), c = k(() => n.file.status === "uploading"), h = k(() => n.file.status === "success"), t = k(() => n.file.status === "error"), i = k(() => [
386
+ }), { isImage: _, handlePreview: I, handleRemove: b, handleCustomAction: w, handleRetry: d } = ye(n, a), g = k(() => p(n.file.fileType).value), c = k(() => n.file.status === "uploading"), h = k(() => n.file.status === "success"), t = k(() => n.file.status === "error"), i = k(() => [
387
387
  n.variant === "picture" ? "tr-file-card--picture" : "tr-file-card",
388
388
  `tr-file-card--${n.file.fileType || "other"}`,
389
389
  {
@@ -411,7 +411,7 @@ const Se = ["data-file-type"], Ee = {
411
411
  }, [
412
412
  F(m(me))
413
413
  ])),
414
- e.variant === "picture" ? (o(), u("div", Ee, [
414
+ e.variant === "picture" ? (o(), u("div", Se, [
415
415
  v("img", {
416
416
  src: e.file.url,
417
417
  alt: e.file.name,
@@ -422,7 +422,7 @@ const Se = ["data-file-type"], Ee = {
422
422
  ])])) : C("", !0),
423
423
  c.value || t.value ? (o(), u("div", De, [
424
424
  c.value ? (o(), u("div", Be, [
425
- F(m(j)),
425
+ F(m(W)),
426
426
  e.file.message ? (o(), u("span", ze, U(e.file.message), 1)) : C("", !0)
427
427
  ])) : t.value ? (o(), M(m(pe), {
428
428
  key: 1,
@@ -444,8 +444,8 @@ const Se = ["data-file-type"], Ee = {
444
444
  v("div", Ne, [
445
445
  (o(), M(Y(g.value), { class: "tr-file-card__file-icon" })),
446
446
  c.value || t.value ? (o(), u("div", Ve, [
447
- c.value ? (o(), u("div", We, [
448
- F(m(j))
447
+ c.value ? (o(), u("div", je, [
448
+ F(m(W))
449
449
  ])) : t.value ? (o(), M(m(q), {
450
450
  key: 1,
451
451
  class: "tr-file-card__status-icon tr-file-card__status-icon--error"
@@ -453,7 +453,7 @@ const Se = ["data-file-type"], Ee = {
453
453
  ])) : C("", !0)
454
454
  ])
455
455
  ], 2),
456
- v("div", je, [
456
+ v("div", We, [
457
457
  v("div", qe, [
458
458
  v("div", {
459
459
  class: "tr-file-card__name",
@@ -497,10 +497,10 @@ const Se = ["data-file-type"], Ee = {
497
497
  ])
498
498
  ])
499
499
  ]))
500
- ], 10, Se);
500
+ ], 10, Ee);
501
501
  };
502
502
  }
503
- }), rt = /* @__PURE__ */ V(at, [["__scopeId", "data-v-a569c028"]]), st = { class: "tr-attachments" }, it = /* @__PURE__ */ z({
503
+ }), at = /* @__PURE__ */ V(rt, [["__scopeId", "data-v-e11420c5"]]), st = { class: "tr-attachments" }, it = /* @__PURE__ */ z({
504
504
  __name: "index",
505
505
  props: {
506
506
  items: {},
@@ -521,23 +521,23 @@ const Se = ["data-file-type"], Ee = {
521
521
  fileMatchers: { default: () => [] }
522
522
  },
523
523
  emits: ["update:items", "remove", "download", "retry", "preview", "action"],
524
- setup(e, { emit: a }) {
525
- const n = e, r = a, s = L(n.items || []), { actualListType: p } = Me(s, n.variant), { handlePreview: _, renderPreview: I } = Te(s, r, { enableDownload: !0 });
524
+ setup(e, { emit: r }) {
525
+ const n = e, a = r, s = L(n.items || []), { actualListType: p } = Me(s, n.variant), { handlePreview: _, renderPreview: I } = Te(s, a, { enableDownload: !0 });
526
526
  function b(t) {
527
527
  if (n.disabled) return;
528
528
  const i = s.value.findIndex((l) => l.id === t.id);
529
- i !== -1 && (s.value.splice(i, 1), r("remove", t), r("update:items", s.value));
529
+ i !== -1 && (s.value.splice(i, 1), a("remove", t), a("update:items", s.value));
530
530
  }
531
531
  function w(t, i) {
532
- r("download", t, i);
532
+ a("download", t, i);
533
533
  }
534
534
  function d(t) {
535
- r("retry", t);
535
+ a("retry", t);
536
536
  }
537
537
  function g(t) {
538
- r("action", t);
538
+ a("action", t);
539
539
  }
540
- const c = k(() => n.wrap ? "wrap" : "no-wrap"), { normalizeAttachments: h } = ae({
540
+ const c = k(() => n.wrap ? "wrap" : "no-wrap"), { normalizeAttachments: h } = re({
541
541
  fileMatchers: n.fileMatchers
542
542
  });
543
543
  return le(
@@ -553,7 +553,7 @@ const Se = ["data-file-type"], Ee = {
553
553
  onClick: i[0] || (i[0] = R(() => {
554
554
  }, ["stop"]))
555
555
  }, [
556
- (o(!0), u(O, null, N(s.value, (l) => (o(), M(rt, {
556
+ (o(!0), u(O, null, N(s.value, (l) => (o(), M(at, {
557
557
  key: l.id,
558
558
  file: l,
559
559
  variant: m(p),
@@ -1,8 +1,8 @@
1
- import { defineComponent as g, useModel as c, computed as w, withDirectives as C, openBlock as B, createElementBlock as S, normalizeClass as y, createElementVNode as e, renderSlot as l, toDisplayString as I, createVNode as u, unref as i, vShow as z, mergeModels as d } from "vue";
2
- import { IconCancelFullScreen as $, IconFullScreen as k, IconClose as M } from "@opentiny/tiny-robot-svgs";
1
+ import { defineComponent as g, useModel as c, computed as w, withDirectives as C, openBlock as B, createElementBlock as y, normalizeClass as I, createElementVNode as e, renderSlot as l, toDisplayString as z, createVNode as u, unref as i, vShow as E, mergeModels as d } from "vue";
2
+ import { IconExitFullScreen as S, IconEnterFullScreen as $, IconClose as k } from "@opentiny/tiny-robot-svgs";
3
3
  import f from "../icon-button/index.js";
4
- import { _ as b } from "../_plugin-vue_export-helper.js";
5
- const E = { class: "tr-container__header" }, F = { class: "tr-container__title" }, N = { class: "tr-container__header-operations" }, T = { class: "tr-container__footer" }, D = /* @__PURE__ */ g({
4
+ import { _ as M } from "../_plugin-vue_export-helper.js";
5
+ const T = { class: "tr-container__header" }, b = { class: "tr-container__title" }, N = { class: "tr-container__header-operations" }, D = { class: "tr-container__footer" }, F = /* @__PURE__ */ g({
6
6
  __name: "index",
7
7
  props: /* @__PURE__ */ d({
8
8
  show: { type: Boolean },
@@ -16,18 +16,18 @@ const E = { class: "tr-container__header" }, F = { class: "tr-container__title"
16
16
  }),
17
17
  emits: /* @__PURE__ */ d(["close"], ["update:show", "update:fullscreen"]),
18
18
  setup(o, { emit: p }) {
19
- const m = o, a = c(o, "show"), t = c(o, "fullscreen"), v = w(() => t.value ? $ : k), _ = p, h = () => {
19
+ const m = o, a = c(o, "show"), t = c(o, "fullscreen"), v = w(() => t.value ? S : $), _ = p, h = () => {
20
20
  a.value = !1, _("close");
21
21
  };
22
- return (n, s) => C((B(), S("div", {
23
- class: y(["tr-container", { fullscreen: t.value }])
22
+ return (n, s) => C((B(), y("div", {
23
+ class: I(["tr-container", { fullscreen: t.value }])
24
24
  }, [
25
25
  s[1] || (s[1] = e("div", { class: "tr-container__dragging-bar-wrapper" }, [
26
26
  e("div", { class: "tr-container__dragging-bar" })
27
27
  ], -1)),
28
- e("div", E, [
28
+ e("div", T, [
29
29
  l(n.$slots, "title", {}, () => [
30
- e("h3", F, I(m.title), 1)
30
+ e("h3", b, z(m.title), 1)
31
31
  ], !0),
32
32
  e("div", N, [
33
33
  l(n.$slots, "operations", {}, void 0, !0),
@@ -40,20 +40,20 @@ const E = { class: "tr-container__header" }, F = { class: "tr-container__title"
40
40
  u(i(f), {
41
41
  size: "28",
42
42
  "svg-size": "20",
43
- icon: i(M),
43
+ icon: i(k),
44
44
  onClick: h
45
45
  }, null, 8, ["icon"])
46
46
  ])
47
47
  ]),
48
48
  l(n.$slots, "default", {}, void 0, !0),
49
- e("div", T, [
49
+ e("div", D, [
50
50
  l(n.$slots, "footer", {}, void 0, !0)
51
51
  ])
52
52
  ], 2)), [
53
- [z, a.value]
53
+ [E, a.value]
54
54
  ]);
55
55
  }
56
- }), r = /* @__PURE__ */ b(D, [["__scopeId", "data-v-1ebfc5e5"]]);
56
+ }), r = /* @__PURE__ */ M(F, [["__scopeId", "data-v-8bd84c90"]]);
57
57
  r.name = "TrContainer";
58
58
  const V = function(o) {
59
59
  o.component(r.name, r);
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, computed as y, openBlock as t, createBlock as u, Transition as F, withCtx as m, createElementBlock as a, normalizeStyle as h, normalizeClass as x, renderSlot as _, createElementVNode as l, toDisplayString as n, Fragment as w, renderList as D, createCommentVNode as B } from "vue";
2
- import { d as M } from "../index4.js";
2
+ import { b as M } from "../index4.js";
3
3
  import { _ as Z } from "../_plugin-vue_export-helper.js";
4
4
  const k = "data:image/svg+xml,%3csvg%20width='80.000000'%20height='80.000000'%20viewBox='0%200%2080%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs/%3e%3crect%20width='80.000000'%20height='80.000000'%20fill='%23FFFFFF'%20fill-opacity='0'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014ZM10%2015L70%2015C71%2015%2071.75%2015.25%2072.25%2015.75C72.75%2016.25%2073%2017%2073%2018L73%2063C73%2064%2072.75%2064.75%2072.25%2065.25C71.75%2065.75%2071%2066%2070%2066L10%2066C9%2066%208.25%2065.75%207.75%2065.25C7.25%2064.75%207%2064%207%2063L7%2018C7%2017%207.25%2016.25%207.75%2015.75C8.25%2015.25%209%2015%2010%2015Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M6%2047.27L24.56%2029.06C25.73%2027.91%2027.6%2027.91%2028.77%2029.06L44.52%2044.51C45.69%2045.66%2047.56%2045.66%2048.72%2044.51L56.64%2036.75C57.8%2035.6%2059.67%2035.6%2060.84%2036.75L74%2049.67L74%2062C74%2064.76%2071.76%2067%2069%2067L11%2067C8.23%2067%206%2064.76%206%2062L6%2047.27Z'%20fill='%23F0F0F0'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d=''%20fill='%23808080'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cellipse%20cx='40.000000'%20cy='40.000000'%20rx='8.000001'%20ry='8.000002'%20fill='%231476FF'%20fill-opacity='1.000000'/%3e%3cpath%20d='M40%2035.5C40.27%2035.5%2040.5%2035.72%2040.5%2036L40.5%2039.49L44%2039.5C44.27%2039.5%2044.5%2039.72%2044.5%2040C44.5%2040.27%2044.27%2040.5%2044%2040.5L40.5%2040.5L40.5%2044C40.5%2044.27%2040.27%2044.5%2040%2044.5C39.72%2044.5%2039.5%2044.27%2039.5%2044L39.5%2040.5L36%2040.5C35.72%2040.5%2035.5%2040.27%2035.5%2040C35.5%2039.72%2035.72%2039.5%2036%2039.5L39.5%2039.5L39.5%2036C39.5%2035.72%2039.72%2035.5%2040%2035.5Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014Z'%20fill='%23FFFFFF'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014ZM10%2015L70%2015C71%2015%2071.75%2015.25%2072.25%2015.75C72.75%2016.25%2073%2017%2073%2018L73%2063C73%2064%2072.75%2064.75%2072.25%2065.25C71.75%2065.75%2071%2066%2070%2066L10%2066C9%2066%208.25%2065.75%207.75%2065.25C7.25%2064.75%207%2064%207%2063L7%2018C7%2017%207.25%2016.25%207.75%2015.75C8.25%2015.25%209%2015%2010%2015Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3ccircle%20cx='58.000000'%20cy='27.000000'%20r='5.000000'%20fill='%23DBDBDB'%20fill-opacity='1.000000'/%3e%3c/svg%3e", T = { class: "tr-drag-overlay__content" }, $ = { class: "tr-drag-overlay__text" }, S = { class: "tr-drag-overlay__title" }, E = { class: "tr-drag-overlay__description" }, z = /* @__PURE__ */ v({
5
5
  __name: "index",
@@ -1,5 +1,5 @@
1
1
  import { ref as k, onUnmounted as T, watch as C, defineComponent as E, useModel as H, computed as p, openBlock as w, createBlock as I, unref as X, withCtx as y, createElementVNode as j, createElementBlock as _, Fragment as D, renderList as L, toDisplayString as Y, renderSlot as O, mergeModels as M } from "vue";
2
- import { w as S, a as b, o as $ } from "../index4.js";
2
+ import { m as S, u as b, o as $ } from "../index4.js";
3
3
  import { B as A } from "../index8.js";
4
4
  import { u as F } from "../utils.js";
5
5
  import { _ as G } from "../_plugin-vue_export-helper.js";
package/dist/index.d.ts CHANGED
@@ -308,6 +308,8 @@ tooltipPlacement: TooltipPlacement;
308
308
  autoInsert: boolean;
309
309
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
310
310
 
311
+ declare const __VLS_component_18: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
312
+
311
313
  declare const __VLS_component_2: DefineComponent<BubbleListProps, {
312
314
  scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
313
315
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
@@ -1059,6 +1061,15 @@ declare function __VLS_template_17(): {
1059
1061
  rootEl: any;
1060
1062
  };
1061
1063
 
1064
+ declare function __VLS_template_18(): {
1065
+ attrs: Partial<{}>;
1066
+ slots: {
1067
+ prepend?(_: {}): any;
1068
+ };
1069
+ refs: {};
1070
+ rootEl: any;
1071
+ };
1072
+
1062
1073
  declare function __VLS_template_2(): {
1063
1074
  attrs: Partial<{}>;
1064
1075
  slots: Readonly<BubbleListSlots> & BubbleListSlots;
@@ -1538,6 +1549,8 @@ declare type __VLS_TemplateResult_16 = ReturnType<typeof __VLS_template_16>;
1538
1549
 
1539
1550
  declare type __VLS_TemplateResult_17 = ReturnType<typeof __VLS_template_17>;
1540
1551
 
1552
+ declare type __VLS_TemplateResult_18 = ReturnType<typeof __VLS_template_18>;
1553
+
1541
1554
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
1542
1555
 
1543
1556
  declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
@@ -1608,6 +1621,12 @@ declare type __VLS_WithTemplateSlots_17<T, S> = T & {
1608
1621
  };
1609
1622
  };
1610
1623
 
1624
+ declare type __VLS_WithTemplateSlots_18<T, S> = T & {
1625
+ new (): {
1626
+ $slots: S;
1627
+ };
1628
+ };
1629
+
1611
1630
  declare type __VLS_WithTemplateSlots_2<T, S> = T & {
1612
1631
  new (): {
1613
1632
  $slots: S;
@@ -2277,7 +2296,7 @@ declare const _default_23: DefineComponent< {}, {}, {}, {}, {}, ComponentOpti
2277
2296
  export { _default_23 as TrWordCounter }
2278
2297
  export { _default_23 as WordCounter }
2279
2298
 
2280
- declare const _default_24: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
2299
+ declare const _default_24: __VLS_WithTemplateSlots_18<typeof __VLS_component_18, __VLS_TemplateResult_18["slots"]>;
2281
2300
  export { _default_24 as DefaultActionButtons }
2282
2301
  export { _default_24 as TrDefaultActionButtons }
2283
2302
 
@@ -4956,23 +4975,15 @@ export { }
4956
4975
  */
4957
4976
  declare module '@tiptap/core' {
4958
4977
  interface Commands<ReturnType> {
4959
- template: {
4960
- /**
4961
- * 设置模板数据(批量)
4962
- */
4963
- setTemplateData: (items: TemplateItem[]) => ReturnType;
4964
- /**
4965
- * 插入模板块
4966
- */
4967
- insertTemplate: (attrs: Partial<TemplateAttrs>) => ReturnType;
4978
+ mention: {
4968
4979
  /**
4969
- * 聚焦到第一个模板块
4980
+ * 插入 mention 节点
4970
4981
  */
4971
- focusFirstTemplate: () => ReturnType;
4982
+ insertMention: (attrs: Partial<MentionAttrs>) => ReturnType;
4972
4983
  /**
4973
- * 插入选择器
4984
+ * 删除 mention 节点
4974
4985
  */
4975
- insertTemplateSelect: (attrs: Partial<TemplateSelectAttrs>) => ReturnType;
4986
+ deleteMention: (id: string) => ReturnType;
4976
4987
  };
4977
4988
  }
4978
4989
  }
@@ -4985,15 +4996,23 @@ declare module '@tiptap/core' {
4985
4996
  */
4986
4997
  declare module '@tiptap/core' {
4987
4998
  interface Commands<ReturnType> {
4988
- mention: {
4999
+ template: {
4989
5000
  /**
4990
- * 插入 mention 节点
5001
+ * 设置模板数据(批量)
4991
5002
  */
4992
- insertMention: (attrs: Partial<MentionAttrs>) => ReturnType;
5003
+ setTemplateData: (items: TemplateItem[]) => ReturnType;
4993
5004
  /**
4994
- * 删除 mention 节点
5005
+ * 插入模板块
4995
5006
  */
4996
- deleteMention: (id: string) => ReturnType;
5007
+ insertTemplate: (attrs: Partial<TemplateAttrs>) => ReturnType;
5008
+ /**
5009
+ * 聚焦到第一个模板块
5010
+ */
5011
+ focusFirstTemplate: () => ReturnType;
5012
+ /**
5013
+ * 插入选择器
5014
+ */
5015
+ insertTemplateSelect: (attrs: Partial<TemplateSelectAttrs>) => ReturnType;
4997
5016
  };
4998
5017
  }
4999
5018
  }
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@ import { useTheme as $e } from "./theme-provider/index.js";
20
20
  import N from "./welcome/index.js";
21
21
  import V from "./mcp-server-picker/index.js";
22
22
  import I from "./mcp-add-form/index.js";
23
- import { A as U, S as K, _ as X, W as Y, D as q } from "./index2.js";
24
- import { a as ke, u as Ne } from "./index2.js";
23
+ import { A as U, a as K, _ as X, W as Y, D as q } from "./index2.js";
24
+ import { S as ke, u as Ne } from "./index2.js";
25
25
  import { _ as G, V as J } from "./index3.js";
26
26
  var u = /* @__PURE__ */ ((e) => (e.FileTypeNotAllowed = "file-type-not-allowed", e.FileSizeExceeded = "file-size-exceeded", e.FileCountExceeded = "file-count-exceeded", e))(u || {});
27
27
  function Q(e, r) {