md-editor-v3 4.1.0 → 4.1.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.
@@ -75,10 +75,10 @@ const Vt = /* @__PURE__ */ O({
75
75
  type: Boolean
76
76
  }
77
77
  }, Nt = (e) => {
78
- var f, u, d, p;
78
+ var f, u, d, v;
79
79
  const o = A("editorId");
80
80
  let a = (u = (f = _.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : u.instance;
81
- const l = (p = (d = _.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : p.js, i = U(!1), r = ($) => {
81
+ const l = (v = (d = _.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : v.js, i = U(!1), r = (y) => {
82
82
  if (!a) {
83
83
  h.emit(o, "errorCatcher", {
84
84
  name: "fullscreen",
@@ -86,7 +86,7 @@ const Vt = /* @__PURE__ */ O({
86
86
  });
87
87
  return;
88
88
  }
89
- a.isEnabled ? (i.value = !0, ($ === void 0 ? !a.isFullscreen : $) ? a.request() : a.exit()) : console.error("browser does not support screenfull!");
89
+ a.isEnabled ? (i.value = !0, (y === void 0 ? !a.isFullscreen : y) ? a.request() : a.exit()) : console.error("browser does not support screenfull!");
90
90
  }, c = () => {
91
91
  a && a.isEnabled && a.on("change", () => {
92
92
  (i.value || e.setting.fullscreen) && (i.value = !1, e.updateSetting("fullscreen"));
@@ -96,8 +96,8 @@ const Vt = /* @__PURE__ */ O({
96
96
  };
97
97
  return W(() => {
98
98
  if (c(), !a) {
99
- const $ = document.createElement("script");
100
- $.src = l || et, $.onload = m, $.id = `${n}-screenfull`, $t($, "screenfull");
99
+ const y = document.createElement("script");
100
+ y.src = l || et, y.onload = m, y.id = `${n}-screenfull`, $t(y, "screenfull");
101
101
  }
102
102
  }), W(() => {
103
103
  h.on(o, {
@@ -251,9 +251,9 @@ const Vt = /* @__PURE__ */ O({
251
251
  }, _t = /* @__PURE__ */ O({
252
252
  props: jt,
253
253
  setup(e) {
254
- var d, p, $;
254
+ var d, v, y;
255
255
  const o = A("usedLanguageText"), a = A("editorId");
256
- let l = ($ = (p = (d = _) == null ? void 0 : d.editorExtensions) == null ? void 0 : p.cropper) == null ? void 0 : $.instance;
256
+ let l = (y = (v = (d = _) == null ? void 0 : d.editorExtensions) == null ? void 0 : v.cropper) == null ? void 0 : y.instance;
257
257
  const i = U(), r = U(), c = U(), m = Z({
258
258
  cropperInited: !1,
259
259
  imgSelected: !1,
@@ -273,8 +273,8 @@ const Vt = /* @__PURE__ */ O({
273
273
  }
274
274
  const b = i.value.files || [];
275
275
  if (m.imgSelected = !0, (b == null ? void 0 : b.length) > 0) {
276
- const v = new FileReader();
277
- v.onload = (g) => {
276
+ const p = new FileReader();
277
+ p.onload = (g) => {
278
278
  m.imgSrc = g.target.result, me(() => {
279
279
  f = new l(r.value, {
280
280
  viewMode: 2,
@@ -282,7 +282,7 @@ const Vt = /* @__PURE__ */ O({
282
282
  // aspectRatio: 16 / 9,
283
283
  });
284
284
  });
285
- }, v.readAsDataURL(b[0]);
285
+ }, p.readAsDataURL(b[0]);
286
286
  }
287
287
  });
288
288
  }), I(() => [m.imgSelected], () => {
@@ -308,14 +308,14 @@ const Vt = /* @__PURE__ */ O({
308
308
  onClose: e.onCancel,
309
309
  showAdjust: !0,
310
310
  isFullscreen: m.isFullscreen,
311
- onAdjust: (v) => {
312
- m.isFullscreen = v;
311
+ onAdjust: (p) => {
312
+ m.isFullscreen = p;
313
313
  },
314
314
  width: "668px",
315
315
  height: "421px"
316
316
  }, {
317
317
  default: () => {
318
- var v, g;
318
+ var p, g;
319
319
  return [t("div", {
320
320
  class: `${n}-form-item ${n}-clip`
321
321
  }, [t("div", {
@@ -359,11 +359,11 @@ const Vt = /* @__PURE__ */ O({
359
359
  type: "button",
360
360
  onClick: () => {
361
361
  if (f) {
362
- const y = f.getCroppedCanvas();
363
- h.emit(a, "uploadImage", [at(y.toDataURL("image/png"))], e.onOk), u();
362
+ const k = f.getCroppedCanvas();
363
+ h.emit(a, "uploadImage", [at(k.toDataURL("image/png"))], e.onOk), u();
364
364
  }
365
365
  }
366
- }, [((v = o.value.clipModalTips) == null ? void 0 : v.buttonUpload) || ((g = o.value.linkModalTips) == null ? void 0 : g.buttonOK)])]), t("input", {
366
+ }, [((p = o.value.clipModalTips) == null ? void 0 : p.buttonUpload) || ((g = o.value.linkModalTips) == null ? void 0 : g.buttonOK)])]), t("input", {
367
367
  ref: i,
368
368
  accept: "image/*",
369
369
  type: "file",
@@ -429,8 +429,8 @@ const Vt = /* @__PURE__ */ O({
429
429
  // mermaid
430
430
  mermaid: !1,
431
431
  katex: !1
432
- }), c = (b, v) => {
433
- h.emit(o, "replace", b, v);
432
+ }), c = (b, p) => {
433
+ h.emit(o, "replace", b, p);
434
434
  }, m = Z({
435
435
  type: "link",
436
436
  linkVisible: !1,
@@ -445,16 +445,16 @@ const Vt = /* @__PURE__ */ O({
445
445
  });
446
446
  });
447
447
  const u = fe(() => {
448
- const b = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), v = b.indexOf("="), g = v === -1 ? b : b.slice(0, v + 1), y = v === -1 ? [] : b.slice(v, Number.MAX_SAFE_INTEGER);
449
- return [g, y];
450
- }), d = U(), p = () => {
448
+ const b = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), p = b.indexOf("="), g = p === -1 ? b : b.slice(0, p + 1), k = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
449
+ return [g, k];
450
+ }), d = U(), v = () => {
451
451
  h.emit(o, "uploadImage", Array.from(d.value.files || [])), d.value.value = "";
452
452
  };
453
453
  W(() => {
454
- d.value.addEventListener("change", p);
454
+ d.value.addEventListener("change", v);
455
455
  });
456
- const $ = (b) => {
457
- var v, g, y, x, T, w, M, k, S, R, L, D, V, B, E, G, N, ae, J, K, P, X, j, H, F, Q, ne, he, be, ve, pe, ke, Ce, $e, ye, xe, we, Te, Se, Ae, Me, Le, De;
456
+ const y = (b) => {
457
+ var p, g, k, x, T, w, M, C, S, R, L, D, V, B, E, G, N, ae, J, K, P, X, j, H, F, Q, ne, he, be, ve, pe, ke, Ce, $e, ye, xe, we, Te, Se, Ae, Me, Le, De;
458
458
  if (tt.includes(b))
459
459
  switch (b) {
460
460
  case "-":
@@ -462,7 +462,7 @@ const Vt = /* @__PURE__ */ O({
462
462
  case "bold":
463
463
  return t("div", {
464
464
  class: `${n}-toolbar-item`,
465
- title: (v = a.value.toolbarTips) == null ? void 0 : v.bold,
465
+ title: (p = a.value.toolbarTips) == null ? void 0 : p.bold,
466
466
  onClick: () => {
467
467
  c("bold");
468
468
  }
@@ -488,7 +488,7 @@ const Vt = /* @__PURE__ */ O({
488
488
  case "italic":
489
489
  return t("div", {
490
490
  class: `${n}-toolbar-item`,
491
- title: (y = a.value.toolbarTips) == null ? void 0 : y.italic,
491
+ title: (k = a.value.toolbarTips) == null ? void 0 : k.italic,
492
492
  onClick: () => {
493
493
  c("italic");
494
494
  }
@@ -515,8 +515,8 @@ const Vt = /* @__PURE__ */ O({
515
515
  return t(ee, {
516
516
  relative: `#${i}`,
517
517
  visible: r.title,
518
- onChange: (C) => {
519
- r.title = C;
518
+ onChange: ($) => {
519
+ r.title = $;
520
520
  },
521
521
  overlay: t("ul", {
522
522
  class: `${n}-menu`,
@@ -543,7 +543,7 @@ const Vt = /* @__PURE__ */ O({
543
543
  onClick: () => {
544
544
  c("h4");
545
545
  }
546
- }, [(k = a.value.titleItem) == null ? void 0 : k.h4]), t("li", {
546
+ }, [(C = a.value.titleItem) == null ? void 0 : C.h4]), t("li", {
547
547
  class: `${n}-menu-item`,
548
548
  onClick: () => {
549
549
  c("h5");
@@ -556,10 +556,10 @@ const Vt = /* @__PURE__ */ O({
556
556
  }, [(R = a.value.titleItem) == null ? void 0 : R.h6])])
557
557
  }, {
558
558
  default: () => {
559
- var C;
559
+ var $;
560
560
  return [t("div", {
561
561
  class: `${n}-toolbar-item`,
562
- title: (C = a.value.toolbarTips) == null ? void 0 : C.title
562
+ title: ($ = a.value.toolbarTips) == null ? void 0 : $.title
563
563
  }, [t("svg", {
564
564
  class: `${n}-icon`,
565
565
  "aria-hidden": "true"
@@ -700,8 +700,8 @@ const Vt = /* @__PURE__ */ O({
700
700
  }, null)])]) : t(ee, {
701
701
  relative: `#${i}`,
702
702
  visible: r.image,
703
- onChange: (C) => {
704
- r.image = C;
703
+ onChange: ($) => {
704
+ r.image = $;
705
705
  },
706
706
  overlay: t("ul", {
707
707
  class: `${n}-menu`,
@@ -726,10 +726,10 @@ const Vt = /* @__PURE__ */ O({
726
726
  }, [(j = a.value.imgTitleItem) == null ? void 0 : j.clip2upload])])
727
727
  }, {
728
728
  default: () => {
729
- var C;
729
+ var $;
730
730
  return [t("div", {
731
731
  class: `${n}-toolbar-item`,
732
- title: (C = a.value.toolbarTips) == null ? void 0 : C.image
732
+ title: ($ = a.value.toolbarTips) == null ? void 0 : $.image
733
733
  }, [t("svg", {
734
734
  class: `${n}-icon`,
735
735
  "aria-hidden": "true"
@@ -742,24 +742,24 @@ const Vt = /* @__PURE__ */ O({
742
742
  return t(ee, {
743
743
  relative: `#${i}`,
744
744
  visible: r.table,
745
- onChange: (C) => {
746
- r.table = C;
745
+ onChange: ($) => {
746
+ r.table = $;
747
747
  },
748
748
  key: "bar-table",
749
749
  overlay: t(Ut, {
750
750
  tableShape: e.tableShape,
751
- onSelected: (C) => {
751
+ onSelected: ($) => {
752
752
  c("table", {
753
- selectedShape: C
753
+ selectedShape: $
754
754
  });
755
755
  }
756
756
  }, null)
757
757
  }, {
758
758
  default: () => {
759
- var C;
759
+ var $;
760
760
  return [t("div", {
761
761
  class: `${n}-toolbar-item`,
762
- title: (C = a.value.toolbarTips) == null ? void 0 : C.table
762
+ title: ($ = a.value.toolbarTips) == null ? void 0 : $.table
763
763
  }, [t("svg", {
764
764
  class: `${n}-icon`,
765
765
  "aria-hidden": "true"
@@ -901,8 +901,8 @@ const Vt = /* @__PURE__ */ O({
901
901
  return t(ee, {
902
902
  relative: `#${i}`,
903
903
  visible: r.mermaid,
904
- onChange: (C) => {
905
- r.mermaid = C;
904
+ onChange: ($) => {
905
+ r.mermaid = $;
906
906
  },
907
907
  overlay: t("ul", {
908
908
  class: `${n}-menu`,
@@ -953,10 +953,10 @@ const Vt = /* @__PURE__ */ O({
953
953
  key: "bar-mermaid"
954
954
  }, {
955
955
  default: () => {
956
- var C;
956
+ var $;
957
957
  return [t("div", {
958
958
  class: `${n}-toolbar-item`,
959
- title: (C = a.value.toolbarTips) == null ? void 0 : C.mermaid
959
+ title: ($ = a.value.toolbarTips) == null ? void 0 : $.mermaid
960
960
  }, [t("svg", {
961
961
  class: `${n}-icon`,
962
962
  "aria-hidden": "true"
@@ -969,8 +969,8 @@ const Vt = /* @__PURE__ */ O({
969
969
  return t(ee, {
970
970
  relative: `#${i}`,
971
971
  visible: r.katex,
972
- onChange: (C) => {
973
- r.katex = C;
972
+ onChange: ($) => {
973
+ r.katex = $;
974
974
  },
975
975
  overlay: t("ul", {
976
976
  class: `${n}-menu`,
@@ -991,10 +991,10 @@ const Vt = /* @__PURE__ */ O({
991
991
  key: "bar-katex"
992
992
  }, {
993
993
  default: () => {
994
- var C;
994
+ var $;
995
995
  return [t("div", {
996
996
  class: `${n}-toolbar-item`,
997
- title: (C = a.value.toolbarTips) == null ? void 0 : C.katex
997
+ title: ($ = a.value.toolbarTips) == null ? void 0 : $.katex
998
998
  }, [t("svg", {
999
999
  class: `${n}-icon`,
1000
1000
  "aria-hidden": "true"
@@ -1008,7 +1008,7 @@ const Vt = /* @__PURE__ */ O({
1008
1008
  return e.defToolbars instanceof Array ? e.defToolbars[b] || "" : e.defToolbars && e.defToolbars.children instanceof Array && e.defToolbars.children[b] || "";
1009
1009
  };
1010
1010
  return () => {
1011
- const b = u.value[0].map((g) => $(g)), v = u.value[1].map((g) => $(g));
1011
+ const b = u.value[0].map((g) => y(g)), p = u.value[1].map((g) => y(g));
1012
1012
  return t(Ke, null, [e.toolbars.length > 0 && t("div", {
1013
1013
  class: `${n}-toolbar-wrapper`,
1014
1014
  id: i
@@ -1019,7 +1019,7 @@ const Vt = /* @__PURE__ */ O({
1019
1019
  ref: f
1020
1020
  }, [b]), t("div", {
1021
1021
  class: `${n}-toolbar-right`
1022
- }, [v])])]), t("input", {
1022
+ }, [p])])]), t("input", {
1023
1023
  ref: d,
1024
1024
  accept: "image/*",
1025
1025
  type: "file",
@@ -1067,34 +1067,34 @@ const Vt = /* @__PURE__ */ O({
1067
1067
  }
1068
1068
  ];
1069
1069
  }, Jt = (e, o, a) => {
1070
- const { view: l } = a, i = (p) => l.lineBlockAt(l.state.doc.line(p).from).top, r = (p) => l.lineBlockAt(l.state.doc.line(p).from).height;
1070
+ const { view: l } = a, i = (v) => l.lineBlockAt(l.state.doc.line(v).from).top, r = (v) => l.lineBlockAt(l.state.doc.line(v).from).height;
1071
1071
  let c = [];
1072
1072
  const m = () => {
1073
1073
  c = [];
1074
- const p = Array.from(o.querySelectorAll("[data-line]")).map(
1074
+ const v = Array.from(o.querySelectorAll("[data-line]")).map(
1075
1075
  (g) => Number(g.dataset.line) + 1
1076
- ), { lines: $ } = l.state.doc;
1077
- let b = 1, v = p.shift() ?? $;
1078
- for (let g = 1; g <= $; g++)
1079
- g === v && (b = g, v = p.shift() || $ + 1), c.push({
1076
+ ), { lines: y } = l.state.doc;
1077
+ let b = 1, p = v.shift() ?? y;
1078
+ for (let g = 1; g <= y; g++)
1079
+ g === p && (b = g, p = v.shift() || y + 1), c.push({
1080
1080
  start: b,
1081
- end: v - 1
1081
+ end: p - 1
1082
1082
  });
1083
1083
  };
1084
1084
  let f = 0, u = 0;
1085
- const d = it((p) => {
1086
- var v, g, y, x, T, w, M;
1087
- if (!((v = o.firstElementChild) != null && v.firstElementChild))
1085
+ const d = it((v) => {
1086
+ var p, g, k, x, T, w, M;
1087
+ if (!((p = o.firstElementChild) != null && p.firstElementChild))
1088
1088
  return;
1089
- const $ = l.lineBlockAtHeight(l.scrollDOM.scrollTop), { number: b } = l.state.doc.lineAt($.from);
1089
+ const y = l.lineBlockAtHeight(l.scrollDOM.scrollTop), { number: b } = l.state.doc.lineAt(y.from);
1090
1090
  if (!(b > c.length) && !(l.state.doc.lines < c[c.length - 1].end))
1091
- if (p.target === e) {
1091
+ if (v.target === e) {
1092
1092
  if (u !== 0)
1093
1093
  return;
1094
1094
  f++;
1095
- const k = c[b - 1], S = i(k.end) + r(k.end);
1095
+ const C = c[b - 1], S = i(C.end) + r(C.end);
1096
1096
  let R = 0;
1097
- const L = i(k.start), D = o.querySelector(`[data-line="${k.start - 1}"]`) || ((g = o.firstElementChild) == null ? void 0 : g.firstElementChild), V = o.querySelector(`[data-line="${k.end}"]`) || ((y = o.lastElementChild) == null ? void 0 : y.lastElementChild);
1097
+ const L = i(C.start), D = o.querySelector(`[data-line="${C.start - 1}"]`) || ((g = o.firstElementChild) == null ? void 0 : g.firstElementChild), V = o.querySelector(`[data-line="${C.end}"]`) || ((k = o.lastElementChild) == null ? void 0 : k.lastElementChild);
1098
1098
  let B = 0, E = 0;
1099
1099
  L === 0 ? (R = (l.scrollDOM.scrollTop - L) / (S - L), B = V.offsetTop) : S > l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight ? (R = (l.scrollDOM.scrollTop - L) / (l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight - L), E = D.offsetTop, B = o.scrollHeight - o.clientHeight - E + 10) : (R = (l.scrollDOM.scrollTop - L) / (S - L), E = D.offsetTop, B = V.offsetTop - E);
1100
1100
  const G = E - 10 + B * R;
@@ -1105,11 +1105,11 @@ const Vt = /* @__PURE__ */ O({
1105
1105
  if (f !== 0)
1106
1106
  return;
1107
1107
  u++;
1108
- const k = Array.from(
1108
+ const C = Array.from(
1109
1109
  o.querySelectorAll("[data-line]")
1110
1110
  ), S = o.scrollTop, R = o.scrollHeight;
1111
- let L = k.length === 0 ? 1 : Math.ceil(
1112
- Number(k[k.length - 1].dataset.line) * (S / R)
1111
+ let L = C.length === 0 ? 1 : Math.ceil(
1112
+ Number(C[C.length - 1].dataset.line) * (S / R)
1113
1113
  ), D = (x = o.firstElementChild) == null ? void 0 : x.firstElementChild;
1114
1114
  for (let H = L; H >= 0; H--) {
1115
1115
  const F = o.querySelector(`[data-line="${H}"]`);
@@ -1119,11 +1119,11 @@ const Vt = /* @__PURE__ */ O({
1119
1119
  }
1120
1120
  }
1121
1121
  let V = (T = o.firstElementChild) == null ? void 0 : T.firstElementChild, B = (w = o.firstElementChild) == null ? void 0 : w.lastElementChild;
1122
- for (; k.length > 0; ) {
1123
- const H = k.indexOf(D);
1124
- if (H + 1 >= k.length)
1122
+ for (; C.length > 0; ) {
1123
+ const H = C.indexOf(D);
1124
+ if (H + 1 >= C.length)
1125
1125
  break;
1126
- const F = k[H + 1];
1126
+ const F = C[H + 1];
1127
1127
  if (H === -1) {
1128
1128
  B = F;
1129
1129
  break;
@@ -1134,7 +1134,7 @@ const Vt = /* @__PURE__ */ O({
1134
1134
  V = D, B = F;
1135
1135
  break;
1136
1136
  }
1137
- D = k[H - 1];
1137
+ D = C[H - 1];
1138
1138
  continue;
1139
1139
  }
1140
1140
  const ne = F.offsetTop;
@@ -1205,20 +1205,20 @@ const Vt = /* @__PURE__ */ O({
1205
1205
  }
1206
1206
  ), W(c);
1207
1207
  }, Qt = Xt, el = (e, o, a) => {
1208
- var d, p, $, b, v, g;
1208
+ var d, v, y, b, p, g;
1209
1209
  let l = "", i = 0, r = 0, c = !0, m = !1;
1210
1210
  const f = o.getSelectedText(), u = (d = _.editorConfig) == null ? void 0 : d.mermaidTemplate;
1211
1211
  if (/^h[1-6]{1}$/.test(e)) {
1212
- const y = e.replace(/^h(\d)/, (x, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1213
- l = `${y} ${f}`, i = y.length + 1;
1212
+ const k = e.replace(/^h(\d)/, (x, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1213
+ l = `${k} ${f}`, i = k.length + 1;
1214
1214
  } else if (e === "prettier") {
1215
- const y = window.prettier || (($ = (p = _.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : $.prettierInstance), x = [
1216
- ((b = window.prettierPlugins) == null ? void 0 : b.markdown) || ((g = (v = _.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : g.parserMarkdownInstance)
1215
+ const k = window.prettier || ((y = (v = _.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : y.prettierInstance), x = [
1216
+ ((b = window.prettierPlugins) == null ? void 0 : b.markdown) || ((g = (p = _.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : g.parserMarkdownInstance)
1217
1217
  ];
1218
- !y || x[0] === void 0 ? (h.emit(a.editorId, "errorCatcher", {
1218
+ !k || x[0] === void 0 ? (h.emit(a.editorId, "errorCatcher", {
1219
1219
  name: "prettier",
1220
1220
  message: "prettier is undefined"
1221
- }), l = o.getValue()) : l = y.format(o.getValue(), {
1221
+ }), l = o.getValue()) : l = k.format(o.getValue(), {
1222
1222
  parser: "markdown",
1223
1223
  plugins: x
1224
1224
  }), c = !1, m = !0;
@@ -1269,16 +1269,16 @@ const Vt = /* @__PURE__ */ O({
1269
1269
  break;
1270
1270
  }
1271
1271
  case "code": {
1272
- const y = a.text || f || "", x = a.mode || "language";
1272
+ const k = a.text || f || "", x = a.mode || "language";
1273
1273
  l = `\`\`\`${x}
1274
- ${y}
1274
+ ${k}
1275
1275
  \`\`\`
1276
1276
  `, i = 3, r = 3 + x.length - l.length;
1277
1277
  break;
1278
1278
  }
1279
1279
  case "table": {
1280
1280
  l = "|";
1281
- const { selectedShape: y = { x: 1, y: 1 } } = a, { x, y: T } = y;
1281
+ const { selectedShape: k = { x: 1, y: 1 } } = a, { x, y: T } = k;
1282
1282
  for (let w = 0; w <= T; w++)
1283
1283
  l += " col |";
1284
1284
  l += `
@@ -1295,14 +1295,14 @@ ${y}
1295
1295
  break;
1296
1296
  }
1297
1297
  case "link": {
1298
- const { desc: y, url: x } = a;
1299
- l = `[${y}](${x})`, c = !1;
1298
+ const { desc: k, url: x } = a;
1299
+ l = `[${k}](${x})`, c = !1;
1300
1300
  break;
1301
1301
  }
1302
1302
  case "image": {
1303
- const { desc: y, url: x, urls: T } = a;
1304
- T instanceof Array ? l = T.reduce((w, M) => w + `![${y}](${M})
1305
- `, "") : l = `![${y}](${x})
1303
+ const { desc: k, url: x, urls: T } = a;
1304
+ T instanceof Array ? l = T.reduce((w, M) => w + `![${k}](${M})
1305
+ `, "") : l = `![${k}](${x})
1306
1306
  `, c = !1;
1307
1307
  break;
1308
1308
  }
@@ -1399,7 +1399,7 @@ $$
1399
1399
  break;
1400
1400
  }
1401
1401
  case "universal": {
1402
- const { generate: y } = a, x = y(f);
1402
+ const { generate: k } = a, x = k(f);
1403
1403
  l = x.targetValue, c = x.select, i = x.deviationStart, r = x.deviationEnd;
1404
1404
  }
1405
1405
  }
@@ -1964,8 +1964,8 @@ const Ml = (e) => {
1964
1964
  key: "Ctrl-c",
1965
1965
  mac: "Cmd-c",
1966
1966
  shift: () => (h.emit(e, "replace", "code"), !0),
1967
- any(M, k) {
1968
- return (k.ctrlKey || k.metaKey) && k.altKey && k.code === "KeyC" ? (h.emit(e, "replace", "codeRow"), !0) : !1;
1967
+ any(M, C) {
1968
+ return (C.ctrlKey || C.metaKey) && C.altKey && C.code === "KeyC" ? (h.emit(e, "replace", "codeRow"), !0) : !1;
1969
1969
  }
1970
1970
  },
1971
1971
  {
@@ -1979,7 +1979,7 @@ const Ml = (e) => {
1979
1979
  shift: () => o.noPrettier ? !1 : (h.emit(e, "replace", "prettier"), !0)
1980
1980
  },
1981
1981
  {
1982
- any: (M, k) => (k.ctrlKey || k.metaKey) && k.altKey && k.shiftKey && k.code === "KeyT" ? (h.emit(e, "replace", "table"), !0) : !1
1982
+ any: (M, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (h.emit(e, "replace", "table"), !0) : !1
1983
1983
  }
1984
1984
  ], Bl = Hl, Fl = (e) => {
1985
1985
  const o = A("tabWidth"), a = A("editorId"), l = A("theme"), i = U(), r = Xe(), c = Bl(a, e), m = Ll(e), f = [
@@ -2010,8 +2010,10 @@ const Ml = (e) => {
2010
2010
  const d = new re({
2011
2011
  doc: e.value,
2012
2012
  parent: i.value
2013
- });
2014
- r.value = new Al(d), r.value.setTabSize(o), r.value.setExtensions(u()), r.value.setDisabled(e.disabled), r.value.setReadOnly(e.readonly), e.placeholder && r.value.setPlaceholder(e.placeholder), e.autofocus && d.focus(), e.maxlength && r.value.setMaxLength(e.maxlength), h.on(a, {
2013
+ }), v = new Al(d);
2014
+ r.value = v, setTimeout(() => {
2015
+ v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), v.setExtensions(u()), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && d.focus();
2016
+ }, 0), h.on(a, {
2015
2017
  name: "ctrlZ",
2016
2018
  callback() {
2017
2019
  Dt(d);
@@ -2023,10 +2025,10 @@ const Ml = (e) => {
2023
2025
  }
2024
2026
  }), h.on(a, {
2025
2027
  name: "replace",
2026
- callback(p, $ = {}) {
2027
- var g;
2028
- const { text: b, options: v } = el(p, r.value, $);
2029
- (g = r.value) == null || g.replaceSelectedText(b, v);
2028
+ callback(y, b = {}) {
2029
+ var k;
2030
+ const { text: p, options: g } = el(y, r.value, b);
2031
+ (k = r.value) == null || k.replaceSelectedText(p, g);
2030
2032
  }
2031
2033
  });
2032
2034
  }), I(
@@ -2041,8 +2043,8 @@ const Ml = (e) => {
2041
2043
  ), I(
2042
2044
  () => e.value,
2043
2045
  () => {
2044
- var d, p;
2045
- ((d = r.value) == null ? void 0 : d.getValue()) !== e.value && ((p = r.value) == null || p.setValue(e.value));
2046
+ var d, v;
2047
+ ((d = r.value) == null ? void 0 : d.getValue()) !== e.value && ((v = r.value) == null || v.setValue(e.value));
2046
2048
  }
2047
2049
  ), I(
2048
2050
  () => e.placeholder,
@@ -2329,12 +2331,12 @@ const Ml = (e) => {
2329
2331
  scrollAuto: e.scrollAuto
2330
2332
  });
2331
2333
  gt(e, o), ht(e), bt(e);
2332
- const [u, d] = vt(e, o), p = pt(e);
2334
+ const [u, d] = vt(e, o), v = pt(e);
2333
2335
  return Qe(() => {
2334
2336
  h.clear(a);
2335
- }), kt(e, o, p, u, d), () => {
2336
- var v;
2337
- const $ = He({
2337
+ }), kt(e, o, v, u, d), () => {
2338
+ var p;
2339
+ const y = He({
2338
2340
  props: e,
2339
2341
  ctx: o
2340
2342
  }, "defToolbars"), b = He({
@@ -2352,7 +2354,7 @@ const Ml = (e) => {
2352
2354
  setting: u,
2353
2355
  updateSetting: d,
2354
2356
  tableShape: e.tableShape,
2355
- defToolbars: $,
2357
+ defToolbars: y,
2356
2358
  noUploadImg: c
2357
2359
  }, null), t(Vl, {
2358
2360
  value: e.modelValue,
@@ -2387,13 +2389,13 @@ const Ml = (e) => {
2387
2389
  e.onFocus ? e.onFocus(g) : o.emit("onFocus", g);
2388
2390
  },
2389
2391
  completions: e.completions
2390
- }, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(Kl, {
2392
+ }, null), ((p = e.footers) == null ? void 0 : p.length) > 0 && t(Kl, {
2391
2393
  modelValue: e.modelValue,
2392
2394
  footers: e.footers,
2393
2395
  defFooters: b,
2394
2396
  scrollAuto: f.scrollAuto,
2395
2397
  onScrollAutoChange: (g) => f.scrollAuto = g
2396
- }, null), p.value && t(Ye, {
2398
+ }, null), v.value && t(Ye, {
2397
2399
  theme: e.theme,
2398
2400
  class: `${n}-catalog-editor`,
2399
2401
  editorId: a,