@opentiny/tiny-robot 0.3.0-alpha.18 → 0.3.0-alpha.19

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,9 +1,8 @@
1
- import { ref as M, watch as oe, reactive as ot, computed as L, defineComponent as Ce, createElementBlock as I, openBlock as m, createCommentVNode as N, normalizeStyle as Ve, createBlock as ee, unref as S, withCtx as ye, createElementVNode as U, createVNode as Q, normalizeClass as se, toDisplayString as ce, useAttrs as st, resolveComponent as at, mergeProps as we, Fragment as ve, renderList as Se, mergeModels as lt, useModel as rt, onMounted as it, onUnmounted as ut, nextTick as ne, Transition as We, withModifiers as ct, useSlots as dt, renderSlot as ue, isRef as ft, createTextVNode as je } from "vue";
2
- import { I as pt } from "../index6.js";
3
- import { d as ht } from "../index3.js";
4
- import { T as Fe } from "../index2.js";
5
- import { p as yt, u as vt, I as gt, x as mt, i as bt, l as _t, z as wt } from "../tiny-robot-svgs.js";
6
- import { _ as Be } from "../_plugin-vue_export-helper.js";
1
+ import { ref as M, watch as oe, reactive as ot, computed as B, defineComponent as Ce, createElementBlock as I, openBlock as m, createCommentVNode as N, normalizeStyle as Ve, createBlock as ee, unref as S, withCtx as ye, createElementVNode as U, createVNode as Q, normalizeClass as se, toDisplayString as ce, useAttrs as st, resolveComponent as at, mergeProps as we, Fragment as ve, renderList as Se, mergeModels as lt, useModel as rt, onMounted as it, onUnmounted as ut, nextTick as ne, Transition as We, withModifiers as ct, useSlots as dt, renderSlot as ue, isRef as ft, createTextVNode as je } from "vue";
2
+ import { TinyTooltip as Fe, TinyInput as pt } from "@opentiny/vue";
3
+ import { d as ht } from "../index2.js";
4
+ import { IconUpload as yt, IconVoice as vt, IconLoadingSpeech as gt, IconClose as mt, IconSend as bt, IconStop as _t, IconAssociate as wt } from "@opentiny/tiny-robot-svgs";
5
+ import { _ as Le } from "../_plugin-vue_export-helper.js";
7
6
  import { t as St } from "../utils.js";
8
7
  function Ct(l, c) {
9
8
  const s = M(l.modelValue || l.defaultValue || ""), i = M(null);
@@ -60,10 +59,10 @@ function xt(l, c, s, i, v, w, a, d, C, h, b, y, K, W, F, P) {
60
59
  if (i.value) return;
61
60
  if (p.key === "Enter" && p.shiftKey && (K == null ? void 0 : K.value) === "single" && W) {
62
61
  p.preventDefault(), W();
63
- const B = p.target, q = B.selectionStart, te = s.value;
62
+ const L = p.target, q = L.selectionStart, te = s.value;
64
63
  s.value = te.substring(0, q) + `
65
64
  ` + te.substring(q), setTimeout(() => {
66
- B.selectionStart = B.selectionEnd = q + 1;
65
+ L.selectionStart = L.selectionEnd = q + 1;
67
66
  }, 0);
68
67
  return;
69
68
  }
@@ -158,7 +157,7 @@ function kt(l) {
158
157
  };
159
158
  }
160
159
  function It(l, c, s, i, v, w) {
161
- const a = M(!1), d = M(-1), C = M(-1), h = M(null), b = M(""), y = M(!1), K = L(() => {
160
+ const a = M(!1), d = M(-1), C = M(-1), h = M(null), b = M(""), y = M(!1), K = B(() => {
162
161
  var j, J;
163
162
  if (!((j = l.value) != null && j.length)) return "";
164
163
  const x = h.value === "mouse" ? C.value : d.value;
@@ -181,12 +180,12 @@ function It(l, c, s, i, v, w) {
181
180
  a.value = !0, P();
182
181
  }, O = () => {
183
182
  a.value = !1, T(), F();
184
- }, p = L(() => {
183
+ }, p = B(() => {
185
184
  var x;
186
185
  return s.value ? !0 : !!(c.value && ((x = l.value) == null ? void 0 : x.length) > 0 && !i.value);
187
186
  }), Y = (x) => {
188
187
  O(), c.value = x, v(x), w(x);
189
- }, B = () => {
188
+ }, L = () => {
190
189
  K.value && Y(K.value);
191
190
  }, q = (x) => {
192
191
  !a.value || !l.value || (h.value = "keyboard", d.value === -1 ? d.value = x === "down" ? 0 : l.value.length - 1 : x === "down" ? d.value = (d.value + 1) % l.value.length : d.value = (d.value - 1 + l.value.length) % l.value.length, P());
@@ -216,7 +215,7 @@ function It(l, c, s, i, v, w) {
216
215
  handleMouseLeave: H,
217
216
  // 业务操作
218
217
  applySuggestion: Y,
219
- confirmSelection: B
218
+ confirmSelection: L
220
219
  };
221
220
  }
222
221
  const Tt = { class: "action-buttons" }, Rt = { class: "action-buttons__submit-content" }, Ot = {
@@ -243,24 +242,24 @@ const Tt = { class: "action-buttons" }, Rt = { class: "action-buttons__submit-co
243
242
  },
244
243
  emits: ["clear", "toggle-speech", "submit", "cancel", "trigger-select"],
245
244
  setup(l, { emit: c }) {
246
- const s = l, i = c, v = L(() => {
245
+ const s = l, i = c, v = B(() => {
247
246
  var O, p;
248
247
  const g = (p = (O = s.buttonGroup) == null ? void 0 : O.file) == null ? void 0 : p.tooltips;
249
248
  if (typeof g == "string" && g)
250
249
  return () => g;
251
250
  if (typeof g == "function")
252
251
  return g;
253
- }), w = L(() => {
252
+ }), w = B(() => {
254
253
  var O, p;
255
254
  const g = (p = (O = s.buttonGroup) == null ? void 0 : O.submit) == null ? void 0 : p.tooltips;
256
255
  if (typeof g == "string" && g)
257
256
  return () => g;
258
257
  if (typeof g == "function")
259
258
  return g;
260
- }), a = L(() => s.allowSpeech), d = L(() => s.speechStatus.isRecording), C = L(() => s.disabled), h = L(() => {
259
+ }), a = B(() => s.allowSpeech), d = B(() => s.speechStatus.isRecording), C = B(() => s.disabled), h = B(() => {
261
260
  var g, O;
262
261
  return C.value || s.isOverLimit || ((O = (g = s.buttonGroup) == null ? void 0 : g.submit) == null ? void 0 : O.disabled);
263
- }), b = L(() => s.allowFiles || s.allowSpeech || s.showClear), y = () => {
262
+ }), b = B(() => s.allowFiles || s.allowSpeech || s.showClear), y = () => {
264
263
  C.value || i("clear");
265
264
  }, K = () => {
266
265
  if (!C.value) {
@@ -271,7 +270,7 @@ const Tt = { class: "action-buttons" }, Rt = { class: "action-buttons__submit-co
271
270
  h.value || i("submit");
272
271
  }, F = () => {
273
272
  C.value || i("cancel");
274
- }, P = L(() => {
273
+ }, P = B(() => {
275
274
  var g, O;
276
275
  return C.value || ((O = (g = s.buttonGroup) == null ? void 0 : g.file) == null ? void 0 : O.disabled);
277
276
  }), T = () => {
@@ -368,7 +367,7 @@ const Tt = { class: "action-buttons" }, Rt = { class: "action-buttons__submit-co
368
367
  ])) : N("", !0)
369
368
  ]));
370
369
  }
371
- }), Je = /* @__PURE__ */ Be(Et, [["__scopeId", "data-v-a9e0fa92"]]);
370
+ }), Je = /* @__PURE__ */ Le(Et, [["__scopeId", "data-v-ee42294d"]]);
372
371
  function $t(l, c = {}) {
373
372
  let s = [], i = [], v = l;
374
373
  return { commit: (b) => {
@@ -379,7 +378,7 @@ function $t(l, c = {}) {
379
378
  s.length && ((b = c.onRemoveHistory) == null || b.call(c, s)), i.length && ((y = c.onRemoveHistory) == null || y.call(c, i)), s = [], i = [];
380
379
  }, get: () => v };
381
380
  }
382
- const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__PURE__ */ Ce({
381
+ const Lt = ["data-id", "data-type"], Bt = ["data-id", "data-type"], Dt = /* @__PURE__ */ Ce({
383
382
  inheritAttrs: !1,
384
383
  __name: "Block",
385
384
  props: {
@@ -397,7 +396,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
397
396
  key: 0,
398
397
  "data-id": c.id,
399
398
  "data-type": c.type
400
- }, S(s)), ce(c.content), 17, Bt)) : (m(), I(ve, { key: 1 }, [
399
+ }, S(s)), ce(c.content), 17, Lt)) : (m(), I(ve, { key: 1 }, [
401
400
  c.asChild ? (m(!0), I(ve, { key: 0 }, Se(c.content, (a) => (m(), ee(w, we({
402
401
  key: `${a.id}-${a.type}`
403
402
  }, { ref_for: !0 }, a), null, 16))), 128)) : (m(), I("span", we({
@@ -408,11 +407,11 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
408
407
  (m(!0), I(ve, null, Se(c.content, (a) => (m(), ee(w, we({
409
408
  key: `${a.id}-${a.type}`
410
409
  }, { ref_for: !0 }, a), null, 16))), 128))
411
- ], 16, Lt))
410
+ ], 16, Bt))
412
411
  ], 64));
413
412
  };
414
413
  }
415
- }), At = /* @__PURE__ */ Be(Dt, [["__scopeId", "data-v-13862606"]]), Kt = { class: "editor-container" }, Pe = "​", Mt = /* @__PURE__ */ Ce({
414
+ }), At = /* @__PURE__ */ Le(Dt, [["__scopeId", "data-v-13862606"]]), Kt = { class: "editor-container" }, Pe = "​", Mt = /* @__PURE__ */ Ce({
416
415
  __name: "TemplateEditor",
417
416
  props: {
418
417
  modelValue: { default: () => [] },
@@ -430,7 +429,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
430
429
  ...t.type === "template" ? { ...t, prefix: h, suffix: b } : t
431
430
  })), P = (e) => e.map((t) => ({ id: t.id, type: t.type, content: t.content })), T = M(F(y.value || [])), g = (e) => {
432
431
  T.value = e;
433
- }, O = L(() => {
432
+ }, O = B(() => {
434
433
  const e = [], t = [], n = T.value;
435
434
  if (n.length >= 2) {
436
435
  const r = n[0], f = n[1];
@@ -441,11 +440,11 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
441
440
  n.length > 0 && n[0].type === "template" && e.push({ type: "text", content: C, id: d() }), n.length > 0 && n[n.length - 1].type === "template" && t.push({ type: "text", content: C, id: d() });
442
441
  const u = new RegExp(C, "g");
443
442
  return n.length > 0 && (n[0].content !== C && (n[0].content = n[0].content.replace(u, "")), n[n.length - 1].content !== C && (n[n.length - 1].content = n[n.length - 1].content.replace(u, ""))), e.concat(n).concat(t);
444
- }), p = L(() => T.value.map((e) => e.type === "template" ? [
443
+ }), p = B(() => T.value.map((e) => e.type === "template" ? [
445
444
  { id: e.id, type: "prefix", content: e.prefix },
446
445
  { id: e.id, type: "template", content: e.content },
447
446
  { id: e.id, type: "suffix", content: e.suffix }
448
- ] : [e]).flat()), Y = L(() => O.value.map((e) => e.type === "text" ? e : a ? {
447
+ ] : [e]).flat()), Y = B(() => O.value.map((e) => e.type === "text" ? e : a ? {
449
448
  id: e.id,
450
449
  type: "block",
451
450
  asChild: !0,
@@ -475,7 +474,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
475
474
  },
476
475
  { id: e.id, type: "suffix", content: e.suffix }
477
476
  ]
478
- })), B = M(null), q = (e) => {
477
+ })), L = M(null), q = (e) => {
479
478
  const t = Date.now(), n = JSON.stringify(e);
480
479
  return `${t}:${n}`;
481
480
  }, te = (e) => {
@@ -495,8 +494,8 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
495
494
  (e) => {
496
495
  const t = F(e || []);
497
496
  if (JSON.stringify(t) !== JSON.stringify(T.value)) {
498
- if (B.value) {
499
- const u = re(B.value);
497
+ if (L.value) {
498
+ const u = re(L.value);
500
499
  u && H.set(x.get(), X(u));
501
500
  }
502
501
  g(t), x.commit(q(T.value));
@@ -504,7 +503,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
504
503
  },
505
504
  { deep: !0 }
506
505
  );
507
- const j = (e, t = document.body) => t.contains(e) ? e instanceof HTMLElement && e.dataset.id ? e : e.parentElement ? j(e.parentElement, t) : null : null, J = (e) => e === B.value, re = (e) => {
506
+ const j = (e, t = document.body) => t.contains(e) ? e instanceof HTMLElement && e.dataset.id ? e : e.parentElement ? j(e.parentElement, t) : null : null, J = (e) => e === L.value, re = (e) => {
508
507
  const t = window.getSelection();
509
508
  if (!t)
510
509
  return null;
@@ -548,7 +547,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
548
547
  g([u].concat(T.value)), x.commit(q(T.value));
549
548
  ne(() => {
550
549
  var f;
551
- const r = (f = B.value) == null ? void 0 : f.querySelector(`[data-id="${n}"][data-type="text"]`);
550
+ const r = (f = L.value) == null ? void 0 : f.querySelector(`[data-id="${n}"][data-type="text"]`);
552
551
  r && z(r, e.length);
553
552
  }), y.value = P(T.value);
554
553
  }, ae = M({
@@ -574,7 +573,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
574
573
  "deleteSoftLineBackward",
575
574
  "deleteSoftLineForward",
576
575
  "deleteByCut"
577
- ], _ = re(B.value);
576
+ ], _ = re(L.value);
578
577
  if (f.includes(n)) {
579
578
  if (u && J(r.startContainer) && J(r.endContainer)) {
580
579
  _ && H.set(x.get(), X(_)), ge(u);
@@ -584,7 +583,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
584
583
  G.startId && G.endId ? (_ && H.set(x.get(), X(_)), de(G, n, u)) : console.warn("range is not valid, range:", G);
585
584
  } else n === "insertCompositionText" && ae.value.hasStarted && (ae.value = { hasStarted: !1, range: X(r) });
586
585
  }, X = (e) => {
587
- const t = j(e.startContainer, B.value), n = j(e.endContainer, B.value);
586
+ const t = j(e.startContainer, L.value), n = j(e.endContainer, L.value);
588
587
  return {
589
588
  collapsed: e.collapsed,
590
589
  endContainer: e.endContainer,
@@ -599,7 +598,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
599
598
  startType: t == null ? void 0 : t.dataset.type
600
599
  };
601
600
  }, ke = (e, t, n, u) => e.slice(0, n) + t + e.slice(u), de = (e, t, n) => {
602
- const u = Le(e);
601
+ const u = Be(e);
603
602
  if (!Array.isArray(u) || u.length === 0)
604
603
  return;
605
604
  const r = De(u, e, t, n);
@@ -638,12 +637,12 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
638
637
  const n = e[0], u = `[data-id="${n.id}"][data-type="${n.type}"]`, r = e.slice(1).map((f) => `[data-id="${f.id}"][data-type="${f.type}"]`);
639
638
  ne(() => {
640
639
  var _, E;
641
- const f = (_ = B.value) == null ? void 0 : _.querySelector(u);
640
+ const f = (_ = L.value) == null ? void 0 : _.querySelector(u);
642
641
  if (f)
643
642
  z(f, n.startOffset + t.length);
644
643
  else if (t.length === 0)
645
644
  for (const G of r) {
646
- const R = (E = B.value) == null ? void 0 : E.querySelector(G);
645
+ const R = (E = L.value) == null ? void 0 : E.querySelector(G);
647
646
  if (R) {
648
647
  z(R, 0);
649
648
  break;
@@ -652,7 +651,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
652
651
  else
653
652
  console.warn(`can not find el with selector: ${u}`);
654
653
  });
655
- }, Le = (e) => {
654
+ }, Be = (e) => {
656
655
  const t = p.value.findIndex((_) => _.id === e.startId && _.type === e.startType), n = p.value.findIndex((_) => _.id === e.endId && _.type === e.endType);
657
656
  if (t === -1 || n === -1 || t > n)
658
657
  return console.warn("startIndex or endIndex is -1, or startIndex > endIndex. ", { range: e }), null;
@@ -769,7 +768,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
769
768
  !pe && e.ctrlKey && (e.key.toLowerCase() === "y" || e.shiftKey && e.key.toLowerCase() === "z"), u = e.key.toLowerCase() === "enter";
770
769
  if (t) {
771
770
  e.preventDefault();
772
- const r = re(B.value);
771
+ const r = re(L.value);
773
772
  r && H.set(x.get(), X(r));
774
773
  const f = x.undo();
775
774
  f && Te(f);
@@ -785,17 +784,17 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
785
784
  if (g(t), H.has(e)) {
786
785
  const n = H.get(e);
787
786
  ne(() => {
788
- const u = B.value.querySelector(`[data-id="${n.startId}"][data-type="${n.startType}"]`), r = B.value.querySelector(`[data-id="${n.endId}"][data-type="${n.endType}"]`);
787
+ const u = L.value.querySelector(`[data-id="${n.startId}"][data-type="${n.startType}"]`), r = L.value.querySelector(`[data-id="${n.endId}"][data-type="${n.endType}"]`);
789
788
  u && z(u, n.startOffset, r, n.endOffset);
790
789
  });
791
790
  }
792
791
  y.value = P(T.value);
793
792
  }, Ae = () => {
794
- B.value && ne(() => {
793
+ L.value && ne(() => {
795
794
  var t, n;
796
795
  const e = T.value.find((u) => u.type === "template");
797
796
  if (e) {
798
- const u = (t = B.value) == null ? void 0 : t.querySelector(`[data-id="${e.id}"][data-type="template"]`);
797
+ const u = (t = L.value) == null ? void 0 : t.querySelector(`[data-id="${e.id}"][data-type="template"]`);
799
798
  if (u) {
800
799
  const r = ((n = u.textContent) == null ? void 0 : n.length) || 0;
801
800
  z(u, r);
@@ -805,9 +804,9 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
805
804
  }, Ke = () => {
806
805
  x.clear(), H.clear();
807
806
  }, Re = () => {
808
- if (!B.value || ae.value.range)
807
+ if (!L.value || ae.value.range)
809
808
  return;
810
- const e = re(B.value);
809
+ const e = re(L.value);
811
810
  if (e != null && e.collapsed && O.value.length > 0) {
812
811
  const t = X(e), n = O.value[0];
813
812
  if (t.startEl && t.startId === n.id && t.startOffset === 0 && n.content === C && n.type === "text") {
@@ -832,7 +831,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
832
831
  (m(), I("div", {
833
832
  contenteditable: "true",
834
833
  ref_key: "editorRef",
835
- ref: B,
834
+ ref: L,
836
835
  key: W.value,
837
836
  class: "editor",
838
837
  onBeforeinput: xe,
@@ -846,7 +845,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
846
845
  ], 32))
847
846
  ]));
848
847
  }
849
- }), Ft = /* @__PURE__ */ Be(Mt, [["__scopeId", "data-v-e84f9c21"]]), Xe = (l, c) => {
848
+ }), Ft = /* @__PURE__ */ Le(Mt, [["__scopeId", "data-v-e84f9c21"]]), Xe = (l, c) => {
850
849
  if (!c.length)
851
850
  return [{ text: l, isMatch: !1 }];
852
851
  const s = [];
@@ -950,7 +949,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
950
949
  _: 1
951
950
  }));
952
951
  }
953
- }), Ut = /* @__PURE__ */ Be(Ht, [["__scopeId", "data-v-e0ec9fe3"]]), qt = ["data-theme"], zt = { class: "tiny-sender__container" }, Gt = {
952
+ }), Ut = /* @__PURE__ */ Le(Ht, [["__scopeId", "data-v-e0ec9fe3"]]), qt = ["data-theme"], zt = { class: "tiny-sender__container" }, Gt = {
954
953
  key: 0,
955
954
  class: "tiny-sender__header-slot"
956
955
  }, jt = {
@@ -1005,7 +1004,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1005
1004
  emits: ["update:modelValue", "update:templateData", "submit", "clear", "speech-start", "speech-end", "speech-interim", "speech-error", "suggestion-select", "focus", "blur", "escape-press", "cancel", "reset-template", "files-selected"],
1006
1005
  setup(l, { expose: c, emit: s }) {
1007
1006
  var Z;
1008
- const i = l, v = s, w = M(null), a = M(null), d = M(null), C = M(null), h = M(null), b = L(() => i.templateData && i.templateData.length > 0), { inputValue: y, isComposing: K, clearInput: W } = Ct(i, v), F = L(() => !!y.value.trim()), P = L(() => {
1007
+ const i = l, v = s, w = M(null), a = M(null), d = M(null), C = M(null), h = M(null), b = B(() => i.templateData && i.templateData.length > 0), { inputValue: y, isComposing: K, clearInput: W } = Ct(i, v), F = B(() => !!y.value.trim()), P = B(() => {
1009
1008
  var o, k;
1010
1009
  return !(i.disabled || i.loading || !F.value || _e.value || (k = (o = i.buttonGroup) == null ? void 0 : o.submit) != null && k.disabled);
1011
1010
  }), {
@@ -1014,7 +1013,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1014
1013
  activeKeyboardIndex: O,
1015
1014
  activeMouseIndex: p,
1016
1015
  autoCompleteText: Y,
1017
- showTabIndicator: B,
1016
+ showTabIndicator: L,
1018
1017
  syncAutoComplete: q,
1019
1018
  closePopup: te,
1020
1019
  applySuggestion: H,
@@ -1023,7 +1022,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1023
1022
  handleMouseEnter: J,
1024
1023
  handleMouseLeave: re
1025
1024
  } = It(
1026
- L(() => i.suggestions),
1025
+ B(() => i.suggestions),
1027
1026
  y,
1028
1027
  K,
1029
1028
  b,
@@ -1101,7 +1100,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1101
1100
  W(), b.value ? de() : (o = a.value) == null || o.focus(), ne(() => {
1102
1101
  y.value === "" && (V.value = i.mode || "single");
1103
1102
  });
1104
- }, Le = (o) => {
1103
+ }, Be = (o) => {
1105
1104
  const k = (ie) => ie.type === "text" && ie.content === "​";
1106
1105
  if (o.length === 0 || o.every(k)) {
1107
1106
  de();
@@ -1116,7 +1115,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1116
1115
  },
1117
1116
  { deep: !0 }
1118
1117
  );
1119
- const De = L(() => {
1118
+ const De = B(() => {
1120
1119
  const o = typeof i.speech == "object" ? i.speech : {};
1121
1120
  return {
1122
1121
  ...o,
@@ -1138,7 +1137,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1138
1137
  };
1139
1138
  }), { speechState: le, start: fe, stop: Ie } = kt(De.value), be = () => {
1140
1139
  le.isRecording ? Ie() : fe();
1141
- }, _e = L(() => i.maxLength !== 1 / 0 && y.value.length > i.maxLength), { handleKeyPress: pe, triggerSubmit: he } = xt(
1140
+ }, _e = B(() => i.maxLength !== 1 / 0 && y.value.length > i.maxLength), { handleKeyPress: pe, triggerSubmit: he } = xt(
1142
1141
  i,
1143
1142
  v,
1144
1143
  y,
@@ -1159,17 +1158,17 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1159
1158
  v("focus", o), y.value && !b.value && (T.value = !0);
1160
1159
  }, Ae = (o) => {
1161
1160
  v("blur", o), te();
1162
- }, Ke = L(() => V.value === "multiple" ? "textarea" : "text"), Re = L(
1161
+ }, Ke = B(() => V.value === "multiple" ? "textarea" : "text"), Re = B(
1163
1162
  () => ({
1164
1163
  display: "flex",
1165
1164
  justifyContent: i.showWordLimit && i.maxLength !== 1 / 0 ? "space-between" : "flex-end",
1166
1165
  alignItems: "center"
1167
1166
  })
1168
- ), e = dt(), t = L(() => !!e.decorativeContent), n = L(() => i.disabled || t.value), u = L(() => i.loading), r = L(() => ({
1167
+ ), e = dt(), t = B(() => !!e.decorativeContent), n = B(() => i.disabled || t.value), u = B(() => i.loading), r = B(() => ({
1169
1168
  "is-disabled": n.value,
1170
1169
  "is-loading": u.value,
1171
1170
  "is-auto-switching": z.value
1172
- })), f = L(() => ({
1171
+ })), f = B(() => ({
1173
1172
  width: St(i.suggestionPopupWidth),
1174
1173
  maxWidth: "100%"
1175
1174
  // 确保不超出父容器宽度
@@ -1232,7 +1231,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1232
1231
  ref_key: "templateEditorRef",
1233
1232
  ref: d,
1234
1233
  "model-value": i.templateData,
1235
- "onUpdate:modelValue": Le,
1234
+ "onUpdate:modelValue": Be,
1236
1235
  onSubmit: S(he)
1237
1236
  }, null, 8, ["model-value", "onSubmit"])) : (m(), I("div", Zt, [
1238
1237
  Q(S(pt), {
@@ -1255,7 +1254,7 @@ const Bt = ["data-id", "data-type"], Lt = ["data-id", "data-type"], Dt = /* @__P
1255
1254
  S(Y) && !S(K) ? (m(), I("div", Qt, [
1256
1255
  U("span", Yt, ce(S(y)), 1),
1257
1256
  je(ce(S(Y)) + " ", 1),
1258
- S(B) ? (m(), I("div", en, "TAB")) : N("", !0)
1257
+ S(L) ? (m(), I("div", en, "TAB")) : N("", !0)
1259
1258
  ])) : N("", !0)
1260
1259
  ]))
1261
1260
  ]),