md-editor-v3 6.1.0-0 → 6.1.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.
@@ -3,15 +3,15 @@ import { s as lt, a as at, M as Oe } from "./chunks/index4.mjs";
3
3
  import { C as nt, c as rt, a as st, e as it, b as ct, u as ut, d as dt, f as mt, g as bt, h as vt, i as gt, j as ht, k as ft, M as pt } from "./chunks/index3.mjs";
4
4
  import Tt from "./ModalToolbar.mjs";
5
5
  import wt from "./NormalToolbar.mjs";
6
- import { inject as r, watch as I, nextTick as ne, onMounted as W, ref as x, defineComponent as w, createVNode as l, reactive as U, toRef as ye, Fragment as Ve, computed as K, cloneVNode as ae, createApp as yt, shallowRef as Ct, onBeforeUnmount as ve } from "vue";
6
+ import { inject as r, watch as I, nextTick as ne, onMounted as W, ref as x, defineComponent as y, createVNode as l, reactive as q, toRef as ye, Fragment as Ve, computed as K, cloneVNode as ae, createApp as yt, shallowRef as Ct, onBeforeUnmount as ve } from "vue";
7
7
  import { g as G, p as a, a as kt, M as oe, d as $t, b as xt } from "./chunks/config.mjs";
8
8
  import { linkTo as St, throttle as It, createSmoothScroll as We, draggingScroll as Lt } from "@vavt/util";
9
9
  import { deleteLine as Et, history as Ce, defaultKeymap as Nt, historyKeymap as At, indentWithTab as Dt, undo as Mt, redo as Rt } from "@codemirror/commands";
10
10
  import { markdown as Ft } from "@codemirror/lang-markdown";
11
11
  import { languages as Bt } from "@codemirror/language-data";
12
- import { EditorState as se, EditorSelection as q, Compartment as z, StateEffect as _e, StateField as ze, RangeSetBuilder as Ht } from "@codemirror/state";
12
+ import { EditorState as se, EditorSelection as U, Compartment as z, StateEffect as _e, StateField as ze, RangeSetBuilder as Ht } from "@codemirror/state";
13
13
  import { placeholder as Pt, EditorView as R, showTooltip as Ot, Decoration as Vt, WidgetType as Wt, keymap as _t, drawSelection as zt } from "@codemirror/view";
14
- import { b, E as j, R as f, C as Ut, U as ge, a as Ue, c as qe, O as Ke, d as qt, e as Kt, T as Gt, S as jt, G as ke } from "./chunks/event-bus.mjs";
14
+ import { b, E as j, R as p, C as qt, U as ge, a as qe, c as Ue, O as Ke, d as Ut, e as Kt, T as Gt, S as jt, G as ke } from "./chunks/event-bus.mjs";
15
15
  import { indentUnit as Yt, syntaxHighlighting as Ge, HighlightStyle as je } from "@codemirror/language";
16
16
  import { autocompletion as Zt } from "@codemirror/autocomplete";
17
17
  import { a as Xt } from "./chunks/dom.mjs";
@@ -31,12 +31,12 @@ const to = (e, t, o) => {
31
31
  `#${n} .cm-scroller`
32
32
  ), v = m?.querySelector(
33
33
  `[id="${n}-preview-wrapper"]`
34
- ), p = m?.querySelector(
34
+ ), h = m?.querySelector(
35
35
  `[id="${n}-html-wrapper"]`
36
36
  );
37
- (v || p) && ([c, s] = (v ? lt : at)(
37
+ (v || h) && ([c, s] = (v ? lt : at)(
38
38
  g,
39
- v || p,
39
+ v || h,
40
40
  o.value
41
41
  ), e.scrollAuto && c());
42
42
  };
@@ -79,18 +79,18 @@ const to = (e, t, o) => {
79
79
  case "table":
80
80
  return mo(o);
81
81
  case "link": {
82
- const { desc: n = "", url: i = "" } = o, s = `[${n}](${i})`;
82
+ const n = t.getSelectedText(), { desc: i = n, url: s = "" } = o, c = `[${i}](${s})`;
83
83
  return {
84
- text: s,
84
+ text: c,
85
85
  options: {
86
- select: i === "",
87
- deviationStart: s.length - i.length - 1,
86
+ select: s === "",
87
+ deviationStart: c.length - s.length - 1,
88
88
  deviationEnd: -1
89
89
  }
90
90
  };
91
91
  }
92
92
  case "image":
93
- return uo(o);
93
+ return uo(o, t);
94
94
  case "flow":
95
95
  case "sequence":
96
96
  case "gantt":
@@ -163,7 +163,7 @@ $$
163
163
  const [o, n, i] = he(t, {
164
164
  wholeLine: !0
165
165
  }), s = o.split(`
166
- `), c = ro[e], u = e === "orderedList" ? s.map((v, p) => `${c + p}. ${v}`) : s.map((v) => `${c}${v}`), m = e === "orderedList" ? "1. " : c.toString(), g = s.length === 1 ? m.length : 0;
166
+ `), c = ro[e], u = e === "orderedList" ? s.map((v, h) => `${c + h}. ${v}`) : s.map((v) => `${c}${v}`), m = e === "orderedList" ? "1. " : c.toString(), g = s.length === 1 ? m.length : 0;
167
167
  return {
168
168
  text: u.join(`
169
169
  `),
@@ -213,25 +213,25 @@ dateFormat YYYY-MM-DD`,
213
213
  \`\`\`
214
214
  `,
215
215
  options: { deviationStart: 12, deviationEnd: -5 }
216
- }), uo = (e) => {
217
- const { desc: t = "", url: o = "", urls: n } = e;
218
- let i = "";
219
- const s = o === "" && (!n || n instanceof Array && n.length === 0);
220
- return n instanceof Array ? i = n.reduce((c, u) => {
216
+ }), uo = (e, t) => {
217
+ const o = t.getSelectedText(), { desc: n = o, url: i = "", urls: s } = e;
218
+ let c = "";
219
+ const u = i === "" && (!s || s instanceof Array && s.length === 0);
220
+ return s instanceof Array ? c = s.reduce((m, g) => {
221
221
  const {
222
- url: m = "",
223
- alt: g = "",
224
- title: v = ""
225
- } = typeof u == "object" ? u : { url: u };
226
- return c + `![${g}](${m}${v ? " '" + v + "'" : ""})
222
+ url: v = "",
223
+ alt: h = "",
224
+ title: w = ""
225
+ } = typeof g == "object" ? g : { url: g };
226
+ return m + `![${h}](${v}${w ? " '" + w + "'" : ""})
227
227
  `;
228
- }, "") : i = `![${t}](${o})
228
+ }, "") : c = `![${n}](${i})
229
229
  `, {
230
- text: i,
230
+ text: c,
231
231
  options: {
232
- select: o === "",
233
- deviationStart: s ? i.length - o.length - 2 : i.length,
234
- deviationEnd: s ? -2 : 0
232
+ select: i === "",
233
+ deviationStart: u ? c.length - i.length - 2 : c.length,
234
+ deviationEnd: u ? -2 : 0
235
235
  }
236
236
  };
237
237
  }, mo = (e) => {
@@ -417,8 +417,8 @@ class vo {
417
417
  }
418
418
  this.view.dispatch({
419
419
  scrollIntoView: !0,
420
- selection: q.create(
421
- [q.range(o, n), q.cursor(i)],
420
+ selection: U.create(
421
+ [U.range(o, n), U.cursor(i)],
422
422
  1
423
423
  )
424
424
  });
@@ -450,13 +450,13 @@ const go = (e, t) => {
450
450
  const g = `${e}${t}${o}${n}`, v = u + c.label.length + (i === "title" ? o.length : 0);
451
451
  s.dispatch({
452
452
  changes: { from: u, to: m, insert: g },
453
- selection: q.create(
453
+ selection: U.create(
454
454
  [
455
- q.range(
455
+ U.range(
456
456
  u + c.label.length + (i === "title" ? 1 : -t.length),
457
457
  v
458
458
  ),
459
- q.cursor(v)
459
+ U.cursor(v)
460
460
  ],
461
461
  1
462
462
  )
@@ -564,14 +564,14 @@ $$`, "title")
564
564
  return Zt({
565
565
  override: e ? [t, ...e] : [t]
566
566
  });
567
- }, fo = /* @__PURE__ */ w({
567
+ }, fo = /* @__PURE__ */ y({
568
568
  name: `${a}-divider`,
569
569
  setup() {
570
570
  return () => l("div", {
571
571
  class: `${a}-divider`
572
572
  }, null);
573
573
  }
574
- }), po = /* @__PURE__ */ w({
574
+ }), po = /* @__PURE__ */ y({
575
575
  name: "ToolbarBold",
576
576
  setup() {
577
577
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -580,7 +580,7 @@ $$`, "title")
580
580
  title: t.value.toolbarTips?.bold,
581
581
  disabled: o?.value,
582
582
  onClick: () => {
583
- b.emit(e, f, "bold");
583
+ b.emit(e, p, "bold");
584
584
  },
585
585
  type: "button"
586
586
  }, [l($, {
@@ -589,7 +589,7 @@ $$`, "title")
589
589
  class: `${a}-toolbar-item-name`
590
590
  }, [t.value.toolbarTips?.bold])]);
591
591
  }
592
- }), To = /* @__PURE__ */ w({
592
+ }), To = /* @__PURE__ */ y({
593
593
  name: "ToolbarCatalog",
594
594
  setup() {
595
595
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("catalogVisible");
@@ -598,7 +598,7 @@ $$`, "title")
598
598
  title: t.value.toolbarTips?.catalog,
599
599
  disabled: o?.value,
600
600
  onClick: () => {
601
- b.emit(e, Ut);
601
+ b.emit(e, qt);
602
602
  },
603
603
  key: "bar-catalog",
604
604
  type: "button"
@@ -608,7 +608,7 @@ $$`, "title")
608
608
  class: `${a}-toolbar-item-name`
609
609
  }, [t.value.toolbarTips?.catalog])]);
610
610
  }
611
- }), wo = /* @__PURE__ */ w({
611
+ }), wo = /* @__PURE__ */ y({
612
612
  name: "ToolbarCode",
613
613
  setup() {
614
614
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -617,7 +617,7 @@ $$`, "title")
617
617
  title: t.value.toolbarTips?.code,
618
618
  disabled: o?.value,
619
619
  onClick: () => {
620
- b.emit(e, f, "code");
620
+ b.emit(e, p, "code");
621
621
  },
622
622
  type: "button"
623
623
  }, [l($, {
@@ -626,7 +626,7 @@ $$`, "title")
626
626
  class: `${a}-toolbar-item-name`
627
627
  }, [t.value.toolbarTips?.code])]);
628
628
  }
629
- }), yo = /* @__PURE__ */ w({
629
+ }), yo = /* @__PURE__ */ y({
630
630
  name: "ToolbarCodeRow",
631
631
  setup() {
632
632
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -635,7 +635,7 @@ $$`, "title")
635
635
  title: t.value.toolbarTips?.codeRow,
636
636
  disabled: o?.value,
637
637
  onClick: () => {
638
- b.emit(e, f, "codeRow");
638
+ b.emit(e, p, "codeRow");
639
639
  },
640
640
  type: "button"
641
641
  }, [l($, {
@@ -644,7 +644,7 @@ $$`, "title")
644
644
  class: `${a}-toolbar-item-name`
645
645
  }, [t.value.toolbarTips?.codeRow])]);
646
646
  }
647
- }), Co = /* @__PURE__ */ w({
647
+ }), Co = /* @__PURE__ */ y({
648
648
  name: "ToolbarFullscreen",
649
649
  setup() {
650
650
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), {
@@ -664,7 +664,7 @@ $$`, "title")
664
664
  class: `${a}-toolbar-item-name`
665
665
  }, [e.value.toolbarTips?.fullscreen])]);
666
666
  }
667
- }), ko = /* @__PURE__ */ w({
667
+ }), ko = /* @__PURE__ */ y({
668
668
  name: "ToolbarGithub",
669
669
  setup() {
670
670
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName");
@@ -682,7 +682,7 @@ $$`, "title")
682
682
  class: `${a}-toolbar-item-name`
683
683
  }, [e.value.toolbarTips?.github])]);
684
684
  }
685
- }), $o = /* @__PURE__ */ w({
685
+ }), $o = /* @__PURE__ */ y({
686
686
  name: "ToolbarHtmlPreview",
687
687
  setup() {
688
688
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -700,7 +700,7 @@ $$`, "title")
700
700
  class: `${a}-toolbar-item-name`
701
701
  }, [e.value.toolbarTips?.htmlPreview])]);
702
702
  }
703
- }), xo = /* @__PURE__ */ w({
703
+ }), xo = /* @__PURE__ */ y({
704
704
  name: "ToolbarImage",
705
705
  setup() {
706
706
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -709,7 +709,7 @@ $$`, "title")
709
709
  title: t.value.toolbarTips?.image,
710
710
  disabled: o?.value,
711
711
  onClick: () => {
712
- b.emit(e, f, "image");
712
+ b.emit(e, p, "image");
713
713
  },
714
714
  type: "button"
715
715
  }, [l($, {
@@ -733,13 +733,13 @@ $$`, "title")
733
733
  default: () => {
734
734
  }
735
735
  }
736
- }, Io = /* @__PURE__ */ w({
736
+ }, Io = /* @__PURE__ */ y({
737
737
  name: `${a}-modal-clip`,
738
738
  props: So,
739
739
  setup(e) {
740
740
  const t = r("usedLanguageText"), o = r("editorId"), n = r("rootRef");
741
741
  let i = G.editorExtensions.cropper.instance;
742
- const s = x(), c = x(), u = x(), m = U({
742
+ const s = x(), c = x(), u = x(), m = q({
743
743
  cropperInited: !1,
744
744
  imgSelected: !1,
745
745
  imgSrc: "",
@@ -756,12 +756,12 @@ $$`, "title")
756
756
  });
757
757
  return;
758
758
  }
759
- const p = s.value.files || [];
760
- if (m.imgSelected = !0, p?.length > 0) {
761
- const y = new FileReader();
762
- y.onload = (C) => {
759
+ const h = s.value.files || [];
760
+ if (m.imgSelected = !0, h?.length > 0) {
761
+ const w = new FileReader();
762
+ w.onload = (C) => {
763
763
  m.imgSrc = C.target.result;
764
- }, y.readAsDataURL(p[0]);
764
+ }, w.readAsDataURL(h[0]);
765
765
  }
766
766
  });
767
767
  }), I(() => [m.imgSelected], () => {
@@ -785,8 +785,8 @@ $$`, "title")
785
785
  onClose: e.onCancel,
786
786
  showAdjust: !0,
787
787
  isFullscreen: m.isFullscreen,
788
- onAdjust: (p) => {
789
- m.isFullscreen = p;
788
+ onAdjust: (h) => {
789
+ m.isFullscreen = h;
790
790
  },
791
791
  width: "668px",
792
792
  height: "421px"
@@ -831,8 +831,8 @@ $$`, "title")
831
831
  type: "button",
832
832
  onClick: () => {
833
833
  if (g) {
834
- const p = g.getCroppedCanvas();
835
- b.emit(o, ge, [Qt(p.toDataURL("image/png"))], e.onOk), v();
834
+ const h = g.getCroppedCanvas();
835
+ b.emit(o, ge, [Qt(h.toDataURL("image/png"))], e.onOk), v();
836
836
  }
837
837
  }
838
838
  }, [t.value.clipModalTips?.buttonUpload || t.value.linkModalTips?.buttonOK])]), l("input", {
@@ -862,7 +862,7 @@ $$`, "title")
862
862
  default: () => {
863
863
  }
864
864
  }
865
- }, Eo = /* @__PURE__ */ w({
865
+ }, Eo = /* @__PURE__ */ y({
866
866
  name: `${a}-modals`,
867
867
  props: Lo,
868
868
  setup(e) {
@@ -872,13 +872,13 @@ $$`, "title")
872
872
  onCancel: e.onCancel
873
873
  }, null);
874
874
  }
875
- }), No = /* @__PURE__ */ w({
875
+ }), No = /* @__PURE__ */ y({
876
876
  name: "ToolbarImageDropdown",
877
877
  setup() {
878
878
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = x(!1), u = x(), m = () => {
879
879
  b.emit(e, ge, Array.from(u.value.files || [])), u.value.value = "";
880
- }, g = (v, p) => {
881
- o?.value || b.emit(e, f, v, p);
880
+ }, g = (v, h) => {
881
+ o?.value || b.emit(e, p, v, h);
882
882
  };
883
883
  return W(() => {
884
884
  u.value.addEventListener("change", m);
@@ -957,7 +957,7 @@ $$`, "title")
957
957
  }
958
958
  }, null)]);
959
959
  }
960
- }), Ao = /* @__PURE__ */ w({
960
+ }), Ao = /* @__PURE__ */ y({
961
961
  name: "ToolbarItalic",
962
962
  setup() {
963
963
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -966,7 +966,7 @@ $$`, "title")
966
966
  title: t.value.toolbarTips?.italic,
967
967
  disabled: o?.value,
968
968
  onClick: () => {
969
- b.emit(e, f, "italic");
969
+ b.emit(e, p, "italic");
970
970
  },
971
971
  type: "button"
972
972
  }, [l($, {
@@ -975,11 +975,11 @@ $$`, "title")
975
975
  class: `${a}-toolbar-item-name`
976
976
  }, [t.value.toolbarTips?.italic])]);
977
977
  }
978
- }), Do = /* @__PURE__ */ w({
978
+ }), Do = /* @__PURE__ */ y({
979
979
  name: "ToolbarKatex",
980
980
  setup() {
981
981
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = (u) => {
982
- o?.value || b.emit(e, f, u);
982
+ o?.value || b.emit(e, p, u);
983
983
  };
984
984
  return () => l(J, {
985
985
  relative: `#${i}`,
@@ -1023,7 +1023,7 @@ $$`, "title")
1023
1023
  }, [t.value.toolbarTips?.katex])])]
1024
1024
  });
1025
1025
  }
1026
- }), Mo = /* @__PURE__ */ w({
1026
+ }), Mo = /* @__PURE__ */ y({
1027
1027
  name: "ToolbarLink",
1028
1028
  setup() {
1029
1029
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1032,7 +1032,7 @@ $$`, "title")
1032
1032
  title: t.value.toolbarTips?.link,
1033
1033
  disabled: o?.value,
1034
1034
  onClick: () => {
1035
- b.emit(e, f, "link");
1035
+ b.emit(e, p, "link");
1036
1036
  },
1037
1037
  type: "button"
1038
1038
  }, [l($, {
@@ -1041,11 +1041,11 @@ $$`, "title")
1041
1041
  class: `${a}-toolbar-item-name`
1042
1042
  }, [t.value.toolbarTips?.link])]);
1043
1043
  }
1044
- }), Ro = /* @__PURE__ */ w({
1044
+ }), Ro = /* @__PURE__ */ y({
1045
1045
  name: "ToolbarMermaid",
1046
1046
  setup() {
1047
1047
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = (u) => {
1048
- o?.value || b.emit(e, f, u);
1048
+ o?.value || b.emit(e, p, u);
1049
1049
  };
1050
1050
  return () => l(J, {
1051
1051
  relative: `#${i}`,
@@ -1131,7 +1131,7 @@ $$`, "title")
1131
1131
  }, [t.value.toolbarTips?.mermaid])])]
1132
1132
  });
1133
1133
  }
1134
- }), Fo = /* @__PURE__ */ w({
1134
+ }), Fo = /* @__PURE__ */ y({
1135
1135
  name: "ToolbarNext",
1136
1136
  setup() {
1137
1137
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1140,7 +1140,7 @@ $$`, "title")
1140
1140
  title: t.value.toolbarTips?.next,
1141
1141
  disabled: o?.value,
1142
1142
  onClick: () => {
1143
- b.emit(e, Ue);
1143
+ b.emit(e, qe);
1144
1144
  },
1145
1145
  type: "button"
1146
1146
  }, [l($, {
@@ -1149,7 +1149,7 @@ $$`, "title")
1149
1149
  class: `${a}-toolbar-item-name`
1150
1150
  }, [t.value.toolbarTips?.next])]);
1151
1151
  }
1152
- }), Bo = /* @__PURE__ */ w({
1152
+ }), Bo = /* @__PURE__ */ y({
1153
1153
  name: "ToolbarOrderedList",
1154
1154
  setup() {
1155
1155
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1158,7 +1158,7 @@ $$`, "title")
1158
1158
  title: t.value.toolbarTips?.orderedList,
1159
1159
  disabled: o?.value,
1160
1160
  onClick: () => {
1161
- b.emit(e, f, "orderedList");
1161
+ b.emit(e, p, "orderedList");
1162
1162
  },
1163
1163
  type: "button"
1164
1164
  }, [l($, {
@@ -1167,7 +1167,7 @@ $$`, "title")
1167
1167
  class: `${a}-toolbar-item-name`
1168
1168
  }, [t.value.toolbarTips?.orderedList])]);
1169
1169
  }
1170
- }), Ho = /* @__PURE__ */ w({
1170
+ }), Ho = /* @__PURE__ */ y({
1171
1171
  name: "ToolbarPageFullscreen",
1172
1172
  setup() {
1173
1173
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1185,7 +1185,7 @@ $$`, "title")
1185
1185
  class: `${a}-toolbar-item-name`
1186
1186
  }, [e.value.toolbarTips?.pageFullscreen])]);
1187
1187
  }
1188
- }), Po = /* @__PURE__ */ w({
1188
+ }), Po = /* @__PURE__ */ y({
1189
1189
  name: "ToolbarPrettier",
1190
1190
  setup() {
1191
1191
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1194,7 +1194,7 @@ $$`, "title")
1194
1194
  title: t.value.toolbarTips?.prettier,
1195
1195
  disabled: o?.value,
1196
1196
  onClick: () => {
1197
- b.emit(e, f, "prettier");
1197
+ b.emit(e, p, "prettier");
1198
1198
  },
1199
1199
  type: "button"
1200
1200
  }, [l($, {
@@ -1203,7 +1203,7 @@ $$`, "title")
1203
1203
  class: `${a}-toolbar-item-name`
1204
1204
  }, [t.value.toolbarTips?.prettier])]);
1205
1205
  }
1206
- }), Oo = /* @__PURE__ */ w({
1206
+ }), Oo = /* @__PURE__ */ y({
1207
1207
  name: "ToolbarPreview",
1208
1208
  setup() {
1209
1209
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1221,7 +1221,7 @@ $$`, "title")
1221
1221
  class: `${a}-toolbar-item-name`
1222
1222
  }, [e.value.toolbarTips?.preview])]);
1223
1223
  }
1224
- }), Vo = /* @__PURE__ */ w({
1224
+ }), Vo = /* @__PURE__ */ y({
1225
1225
  name: "ToolbarPreviewOnly",
1226
1226
  setup() {
1227
1227
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1239,7 +1239,7 @@ $$`, "title")
1239
1239
  class: `${a}-toolbar-item-name`
1240
1240
  }, [e.value.toolbarTips?.previewOnly])]);
1241
1241
  }
1242
- }), Wo = /* @__PURE__ */ w({
1242
+ }), Wo = /* @__PURE__ */ y({
1243
1243
  name: "ToolbarQuote",
1244
1244
  setup() {
1245
1245
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1248,7 +1248,7 @@ $$`, "title")
1248
1248
  title: t.value.toolbarTips?.quote,
1249
1249
  disabled: o?.value,
1250
1250
  onClick: () => {
1251
- b.emit(e, f, "quote");
1251
+ b.emit(e, p, "quote");
1252
1252
  },
1253
1253
  type: "button"
1254
1254
  }, [l($, {
@@ -1257,7 +1257,7 @@ $$`, "title")
1257
1257
  class: `${a}-toolbar-item-name`
1258
1258
  }, [t.value.toolbarTips?.quote])]);
1259
1259
  }
1260
- }), _o = /* @__PURE__ */ w({
1260
+ }), _o = /* @__PURE__ */ y({
1261
1261
  name: "ToolbarRevoke",
1262
1262
  setup() {
1263
1263
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1266,7 +1266,7 @@ $$`, "title")
1266
1266
  title: t.value.toolbarTips?.revoke,
1267
1267
  disabled: o?.value,
1268
1268
  onClick: () => {
1269
- b.emit(e, qe);
1269
+ b.emit(e, Ue);
1270
1270
  },
1271
1271
  type: "button"
1272
1272
  }, [l($, {
@@ -1275,7 +1275,7 @@ $$`, "title")
1275
1275
  class: `${a}-toolbar-item-name`
1276
1276
  }, [t.value.toolbarTips?.revoke])]);
1277
1277
  }
1278
- }), zo = /* @__PURE__ */ w({
1278
+ }), zo = /* @__PURE__ */ y({
1279
1279
  name: "ToolbarSave",
1280
1280
  setup() {
1281
1281
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1293,7 +1293,7 @@ $$`, "title")
1293
1293
  class: `${a}-toolbar-item-name`
1294
1294
  }, [t.value.toolbarTips?.save])]);
1295
1295
  }
1296
- }), Uo = /* @__PURE__ */ w({
1296
+ }), qo = /* @__PURE__ */ y({
1297
1297
  name: "ToolbarStrikeThrough",
1298
1298
  setup() {
1299
1299
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1302,7 +1302,7 @@ $$`, "title")
1302
1302
  title: t.value.toolbarTips?.strikeThrough,
1303
1303
  disabled: o?.value,
1304
1304
  onClick: () => {
1305
- b.emit(e, f, "strikeThrough");
1305
+ b.emit(e, p, "strikeThrough");
1306
1306
  },
1307
1307
  type: "button"
1308
1308
  }, [l($, {
@@ -1311,7 +1311,7 @@ $$`, "title")
1311
1311
  class: `${a}-toolbar-item-name`
1312
1312
  }, [t.value.toolbarTips?.strikeThrough])]);
1313
1313
  }
1314
- }), qo = /* @__PURE__ */ w({
1314
+ }), Uo = /* @__PURE__ */ y({
1315
1315
  name: "ToolbarSub",
1316
1316
  setup() {
1317
1317
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1320,7 +1320,7 @@ $$`, "title")
1320
1320
  title: t.value.toolbarTips?.sub,
1321
1321
  disabled: o?.value,
1322
1322
  onClick: () => {
1323
- b.emit(e, f, "sub");
1323
+ b.emit(e, p, "sub");
1324
1324
  },
1325
1325
  type: "button"
1326
1326
  }, [l($, {
@@ -1329,7 +1329,7 @@ $$`, "title")
1329
1329
  class: `${a}-toolbar-item-name`
1330
1330
  }, [t.value.toolbarTips?.sub])]);
1331
1331
  }
1332
- }), Ko = /* @__PURE__ */ w({
1332
+ }), Ko = /* @__PURE__ */ y({
1333
1333
  name: "ToolbarSup",
1334
1334
  setup() {
1335
1335
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1338,7 +1338,7 @@ $$`, "title")
1338
1338
  title: t.value.toolbarTips?.sup,
1339
1339
  disabled: o?.value,
1340
1340
  onClick: () => {
1341
- b.emit(e, f, "sup");
1341
+ b.emit(e, p, "sup");
1342
1342
  },
1343
1343
  type: "button"
1344
1344
  }, [l($, {
@@ -1357,11 +1357,11 @@ $$`, "title")
1357
1357
  default: () => {
1358
1358
  }
1359
1359
  }
1360
- }, jo = /* @__PURE__ */ w({
1360
+ }, jo = /* @__PURE__ */ y({
1361
1361
  name: "TableShape",
1362
1362
  props: Go,
1363
1363
  setup(e) {
1364
- const t = U({
1364
+ const t = q({
1365
1365
  x: -1,
1366
1366
  y: -1
1367
1367
  }), o = K(() => JSON.stringify(e.tableShape)), n = () => {
@@ -1391,7 +1391,7 @@ $$`, "title")
1391
1391
  class: [`${a}-table-shape-col-default`, c <= t.x && m <= t.y && `${a}-table-shape-col-include`]
1392
1392
  }, null)]))]))]);
1393
1393
  }
1394
- }), Yo = /* @__PURE__ */ w({
1394
+ }), Yo = /* @__PURE__ */ y({
1395
1395
  name: "ToolbarTable",
1396
1396
  setup() {
1397
1397
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c = x(!1);
@@ -1406,7 +1406,7 @@ $$`, "title")
1406
1406
  overlay: l(jo, {
1407
1407
  tableShape: i.value,
1408
1408
  onSelected: (u) => {
1409
- o?.value || b.emit(e, f, "table", {
1409
+ o?.value || b.emit(e, p, "table", {
1410
1410
  selectedShape: u
1411
1411
  });
1412
1412
  }
@@ -1424,7 +1424,7 @@ $$`, "title")
1424
1424
  }, [t.value.toolbarTips?.table])])]
1425
1425
  });
1426
1426
  }
1427
- }), Zo = /* @__PURE__ */ w({
1427
+ }), Zo = /* @__PURE__ */ y({
1428
1428
  name: "ToolbarTask",
1429
1429
  setup() {
1430
1430
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1433,7 +1433,7 @@ $$`, "title")
1433
1433
  title: t.value.toolbarTips?.task,
1434
1434
  disabled: o?.value,
1435
1435
  onClick: () => {
1436
- b.emit(e, f, "task");
1436
+ b.emit(e, p, "task");
1437
1437
  },
1438
1438
  type: "button"
1439
1439
  }, [l($, {
@@ -1442,11 +1442,11 @@ $$`, "title")
1442
1442
  class: `${a}-toolbar-item-name`
1443
1443
  }, [t.value.toolbarTips?.task])]);
1444
1444
  }
1445
- }), Xo = /* @__PURE__ */ w({
1445
+ }), Xo = /* @__PURE__ */ y({
1446
1446
  name: "ToolbarTitle",
1447
1447
  setup() {
1448
1448
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = (u) => {
1449
- o?.value || b.emit(e, f, u);
1449
+ o?.value || b.emit(e, p, u);
1450
1450
  };
1451
1451
  return () => l(J, {
1452
1452
  relative: `#${i}`,
@@ -1517,7 +1517,7 @@ $$`, "title")
1517
1517
  }, [t.value.toolbarTips?.title])])]
1518
1518
  });
1519
1519
  }
1520
- }), Jo = /* @__PURE__ */ w({
1520
+ }), Jo = /* @__PURE__ */ y({
1521
1521
  name: "ToolbarUnderline",
1522
1522
  setup() {
1523
1523
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1526,7 +1526,7 @@ $$`, "title")
1526
1526
  title: t.value.toolbarTips?.underline,
1527
1527
  disabled: o?.value,
1528
1528
  onClick: () => {
1529
- b.emit(e, f, "underline");
1529
+ b.emit(e, p, "underline");
1530
1530
  },
1531
1531
  type: "button"
1532
1532
  }, [l($, {
@@ -1535,7 +1535,7 @@ $$`, "title")
1535
1535
  class: `${a}-toolbar-item-name`
1536
1536
  }, [t.value.toolbarTips?.underline])]);
1537
1537
  }
1538
- }), Qo = /* @__PURE__ */ w({
1538
+ }), Qo = /* @__PURE__ */ y({
1539
1539
  name: "ToolbarUnorderedList",
1540
1540
  setup() {
1541
1541
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1544,7 +1544,7 @@ $$`, "title")
1544
1544
  title: t.value.toolbarTips?.unorderedList,
1545
1545
  disabled: o?.value,
1546
1546
  onClick: () => {
1547
- b.emit(e, f, "unorderedList");
1547
+ b.emit(e, p, "unorderedList");
1548
1548
  },
1549
1549
  type: "button"
1550
1550
  }, [l($, {
@@ -1584,7 +1584,7 @@ $$`, "title")
1584
1584
  }, "screenfull");
1585
1585
  }), W(() => {
1586
1586
  b.on(e, {
1587
- name: qt,
1587
+ name: Ut,
1588
1588
  callback: u
1589
1589
  });
1590
1590
  }), {
@@ -1595,9 +1595,9 @@ let tl = 0;
1595
1595
  const Ye = () => {
1596
1596
  const e = r("editorId"), t = r("theme"), o = r("previewTheme"), n = r("language"), i = r("disabled"), s = r("noUploadImg"), c = r("noPrettier"), u = r("codeTheme"), m = r("showToolbarName"), g = r("setting"), v = r("defToolbars");
1597
1597
  return {
1598
- barRender: (y) => {
1599
- if (kt.includes(y))
1600
- switch (y) {
1598
+ barRender: (w) => {
1599
+ if (kt.includes(w))
1600
+ switch (w) {
1601
1601
  case "-":
1602
1602
  return l(fo, {
1603
1603
  key: `bar-${tl++}`
@@ -1615,7 +1615,7 @@ const Ye = () => {
1615
1615
  key: "bar-italic"
1616
1616
  }, null);
1617
1617
  case "strikeThrough":
1618
- return l(Uo, {
1618
+ return l(qo, {
1619
1619
  key: "bar-strikeThrough"
1620
1620
  }, null);
1621
1621
  case "title":
@@ -1623,7 +1623,7 @@ const Ye = () => {
1623
1623
  key: "bar-title"
1624
1624
  }, null);
1625
1625
  case "sub":
1626
- return l(qo, {
1626
+ return l(Uo, {
1627
1627
  key: "bar-sub"
1628
1628
  }, null);
1629
1629
  case "sup":
@@ -1722,7 +1722,7 @@ const Ye = () => {
1722
1722
  }, null);
1723
1723
  }
1724
1724
  else if (v.value instanceof Array) {
1725
- const C = v.value[y];
1725
+ const C = v.value[w];
1726
1726
  return C ? ae(C, {
1727
1727
  theme: C.props?.theme || t.value,
1728
1728
  previewTheme: C.props?.theme || o.value,
@@ -1731,13 +1731,13 @@ const Ye = () => {
1731
1731
  disabled: C.props?.disabled || i.value,
1732
1732
  showToolbarName: C.props?.showToolbarName || m.value,
1733
1733
  insert(L) {
1734
- b.emit(e, f, "universal", {
1734
+ b.emit(e, p, "universal", {
1735
1735
  generate: L
1736
1736
  });
1737
1737
  }
1738
1738
  }) : "";
1739
1739
  } else if (v.value?.children instanceof Array) {
1740
- const C = v.value.children[y];
1740
+ const C = v.value.children[w];
1741
1741
  return C ? ae(C, {
1742
1742
  theme: C.props?.theme || t.value,
1743
1743
  previewTheme: C.props?.theme || o.value,
@@ -1746,7 +1746,7 @@ const Ye = () => {
1746
1746
  disabled: C.props?.disabled || i.value,
1747
1747
  showToolbarName: C.props?.showToolbarName || m.value,
1748
1748
  insert(L) {
1749
- b.emit(e, f, "universal", {
1749
+ b.emit(e, p, "universal", {
1750
1750
  generate: L
1751
1751
  });
1752
1752
  }
@@ -1755,7 +1755,7 @@ const Ye = () => {
1755
1755
  return "";
1756
1756
  }
1757
1757
  };
1758
- }, ol = /* @__PURE__ */ w({
1758
+ }, ol = /* @__PURE__ */ y({
1759
1759
  name: "FloatingToolbar",
1760
1760
  setup() {
1761
1761
  const e = r("floatingToolbars"), {
@@ -2010,7 +2010,7 @@ const Ye = () => {
2010
2010
  ], Il = (e, t) => {
2011
2011
  const o = r("editorId"), n = (s) => {
2012
2012
  s instanceof Promise ? s.then((c) => {
2013
- b.emit(o, f, "universal", {
2013
+ b.emit(o, p, "universal", {
2014
2014
  generate() {
2015
2015
  return {
2016
2016
  targetValue: c
@@ -2019,7 +2019,7 @@ const Ye = () => {
2019
2019
  });
2020
2020
  }).catch((c) => {
2021
2021
  console.error(c);
2022
- }) : b.emit(o, f, "universal", {
2022
+ }) : b.emit(o, p, "universal", {
2023
2023
  generate() {
2024
2024
  return {
2025
2025
  targetValue: s
@@ -2031,26 +2031,26 @@ const Ye = () => {
2031
2031
  if (!s.clipboardData)
2032
2032
  return;
2033
2033
  if (s.clipboardData.files.length > 0) {
2034
- const { files: y } = s.clipboardData;
2034
+ const { files: w } = s.clipboardData;
2035
2035
  b.emit(
2036
2036
  o,
2037
2037
  ge,
2038
- Array.from(y).filter((C) => /image\/.*/.test(C.type))
2038
+ Array.from(w).filter((C) => /image\/.*/.test(C.type))
2039
2039
  ), s.preventDefault();
2040
2040
  return;
2041
2041
  }
2042
- const c = s.clipboardData.getData("text/plain"), u = t.value?.view.state.selection.main.to || 0, m = t.value?.view.state.doc.lineAt(u).from || 0, g = t.value?.view.state.doc.sliceString(m, u) || "", v = /!\[.*\]\(\s*$/.test(g), p = /!\[.*\]\((.*)\s?.*\)/.test(c);
2042
+ const c = s.clipboardData.getData("text/plain"), u = t.value?.view.state.selection.main.to || 0, m = t.value?.view.state.doc.lineAt(u).from || 0, g = t.value?.view.state.doc.sliceString(m, u) || "", v = /!\[.*\]\(\s*$/.test(g), h = /!\[.*\]\((.*)\s?.*\)/.test(c);
2043
2043
  if (v) {
2044
- const y = e.transformImgUrl(c);
2045
- n(y), s.preventDefault();
2044
+ const w = e.transformImgUrl(c);
2045
+ n(w), s.preventDefault();
2046
2046
  return;
2047
- } else if (p) {
2048
- const y = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
2049
- y ? Promise.all(
2050
- y.map((C) => e.transformImgUrl(C))
2047
+ } else if (h) {
2048
+ const w = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
2049
+ w ? Promise.all(
2050
+ w.map((C) => e.transformImgUrl(C))
2051
2051
  ).then((C) => {
2052
2052
  n(
2053
- C.reduce((T, L, O) => T.replace(y[O], L), c)
2053
+ C.reduce((T, L, O) => T.replace(w[O], L), c)
2054
2054
  );
2055
2055
  }).catch((C) => {
2056
2056
  console.error(C);
@@ -2058,9 +2058,9 @@ const Ye = () => {
2058
2058
  return;
2059
2059
  }
2060
2060
  if (e.autoDetectCode && s.clipboardData.types.includes("vscode-editor-data")) {
2061
- const y = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
2062
- b.emit(o, f, "code", {
2063
- mode: y.mode,
2061
+ const w = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
2062
+ b.emit(o, p, "code", {
2063
+ mode: w.mode,
2064
2064
  text: s.clipboardData.getData("text/plain")
2065
2065
  }), s.preventDefault();
2066
2066
  return;
@@ -2075,7 +2075,7 @@ const Ye = () => {
2075
2075
  {
2076
2076
  key: "Ctrl-b",
2077
2077
  mac: "Cmd-b",
2078
- run: () => (b.emit(e, f, "bold"), !0)
2078
+ run: () => (b.emit(e, p, "bold"), !0)
2079
2079
  },
2080
2080
  {
2081
2081
  key: "Ctrl-d",
@@ -2087,87 +2087,87 @@ const Ye = () => {
2087
2087
  key: "Ctrl-s",
2088
2088
  mac: "Cmd-s",
2089
2089
  run: (D) => (b.emit(e, Ke, D.state.doc.toString()), !0),
2090
- shift: () => (b.emit(e, f, "strikeThrough"), !0)
2090
+ shift: () => (b.emit(e, p, "strikeThrough"), !0)
2091
2091
  },
2092
2092
  {
2093
2093
  key: "Ctrl-u",
2094
2094
  mac: "Cmd-u",
2095
2095
  preventDefault: !0,
2096
- run: () => (b.emit(e, f, "underline"), !0),
2097
- shift: () => (b.emit(e, f, "unorderedList"), !0)
2096
+ run: () => (b.emit(e, p, "underline"), !0),
2097
+ shift: () => (b.emit(e, p, "unorderedList"), !0)
2098
2098
  },
2099
2099
  {
2100
2100
  key: "Ctrl-i",
2101
2101
  mac: "Cmd-i",
2102
2102
  preventDefault: !0,
2103
- run: () => (b.emit(e, f, "italic"), !0),
2104
- shift: () => (b.emit(e, f, "image"), !0)
2103
+ run: () => (b.emit(e, p, "italic"), !0),
2104
+ shift: () => (b.emit(e, p, "image"), !0)
2105
2105
  },
2106
2106
  {
2107
2107
  key: "Ctrl-1",
2108
2108
  mac: "Cmd-1",
2109
- run: () => (b.emit(e, f, "h1"), !0)
2109
+ run: () => (b.emit(e, p, "h1"), !0)
2110
2110
  },
2111
2111
  {
2112
2112
  key: "Ctrl-2",
2113
2113
  mac: "Cmd-2",
2114
- run: () => (b.emit(e, f, "h2"), !0)
2114
+ run: () => (b.emit(e, p, "h2"), !0)
2115
2115
  },
2116
2116
  {
2117
2117
  key: "Ctrl-3",
2118
2118
  mac: "Cmd-3",
2119
- run: () => (b.emit(e, f, "h3"), !0)
2119
+ run: () => (b.emit(e, p, "h3"), !0)
2120
2120
  },
2121
2121
  {
2122
2122
  key: "Ctrl-4",
2123
2123
  mac: "Cmd-4",
2124
- run: () => (b.emit(e, f, "h4"), !0)
2124
+ run: () => (b.emit(e, p, "h4"), !0)
2125
2125
  },
2126
2126
  {
2127
2127
  key: "Ctrl-5",
2128
2128
  mac: "Cmd-5",
2129
- run: () => (b.emit(e, f, "h5"), !0)
2129
+ run: () => (b.emit(e, p, "h5"), !0)
2130
2130
  },
2131
2131
  {
2132
2132
  key: "Ctrl-6",
2133
2133
  mac: "Cmd-6",
2134
- run: () => (b.emit(e, f, "h6"), !0)
2134
+ run: () => (b.emit(e, p, "h6"), !0)
2135
2135
  },
2136
2136
  {
2137
2137
  key: "Ctrl-ArrowUp",
2138
2138
  mac: "Cmd-ArrowUp",
2139
- run: () => (b.emit(e, f, "sup"), !0)
2139
+ run: () => (b.emit(e, p, "sup"), !0)
2140
2140
  },
2141
2141
  {
2142
2142
  key: "Ctrl-ArrowDown",
2143
2143
  mac: "Cmd-ArrowDown",
2144
- run: () => (b.emit(e, f, "sub"), !0)
2144
+ run: () => (b.emit(e, p, "sub"), !0)
2145
2145
  },
2146
2146
  {
2147
2147
  key: "Ctrl-o",
2148
2148
  mac: "Cmd-o",
2149
- run: () => (b.emit(e, f, "orderedList"), !0)
2149
+ run: () => (b.emit(e, p, "orderedList"), !0)
2150
2150
  },
2151
2151
  {
2152
2152
  key: "Ctrl-c",
2153
2153
  mac: "Cmd-c",
2154
- shift: () => (b.emit(e, f, "code"), !0),
2154
+ shift: () => (b.emit(e, p, "code"), !0),
2155
2155
  any(D, k) {
2156
- return (k.ctrlKey || k.metaKey) && k.altKey && k.code === "KeyC" ? (b.emit(e, f, "codeRow"), !0) : !1;
2156
+ return (k.ctrlKey || k.metaKey) && k.altKey && k.code === "KeyC" ? (b.emit(e, p, "codeRow"), !0) : !1;
2157
2157
  }
2158
2158
  },
2159
2159
  {
2160
2160
  key: "Ctrl-l",
2161
2161
  mac: "Cmd-l",
2162
- run: () => (b.emit(e, f, "link"), !0)
2162
+ run: () => (b.emit(e, p, "link"), !0)
2163
2163
  },
2164
2164
  {
2165
2165
  key: "Ctrl-f",
2166
2166
  mac: "Cmd-f",
2167
- shift: () => t.noPrettier ? !1 : (b.emit(e, f, "prettier"), !0)
2167
+ shift: () => t.noPrettier ? !1 : (b.emit(e, p, "prettier"), !0)
2168
2168
  },
2169
2169
  {
2170
- any: (D, k) => (k.ctrlKey || k.metaKey) && k.altKey && k.shiftKey && k.code === "KeyT" ? (b.emit(e, f, "table"), !0) : !1
2170
+ any: (D, k) => (k.ctrlKey || k.metaKey) && k.altKey && k.shiftKey && k.code === "KeyT" ? (b.emit(e, p, "table"), !0) : !1
2171
2171
  },
2172
2172
  ...eo
2173
2173
  ], El = /[a-z][a-z0-9.+-]*:\/\/[^\s<>"'`()]+(?:\([^\s<>"'`]*\)[^\s<>"'`]*)*/i, Nl = /\/\/[^\s<>"'`()]+/i, Al = /data:[a-z]+\/[a-z0-9.+-]+(?:;base64)?,[a-z0-9+/=%]+/i, Dl = /\/(?!\/)[^\s<>"'`()]+/i, Ml = new RegExp(
@@ -2226,8 +2226,8 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2226
2226
  }, Bl = (e) => {
2227
2227
  const t = r("tabWidth"), o = r("editorId"), n = r("theme"), i = r("previewTheme"), s = r("language"), c = r(
2228
2228
  "usedLanguageText"
2229
- ), u = r("disabled"), m = r("showToolbarName"), g = r("customIcon"), v = r("noUploadImg"), p = r("tableShape"), y = r("noPrettier"), C = r("codeTheme"), T = r("setting"), L = r("updateSetting"), O = r("catalogVisible"), N = r("defToolbars"), S = r("floatingToolbars"), A = r("rootRef"), D = x(), k = Ct(), V = x(!1), Q = new z(), ee = new z(), re = new z(), fe = new z(), Xe = new z(), Je = Ll(o, {
2230
- noPrettier: y
2229
+ ), u = r("disabled"), m = r("showToolbarName"), g = r("customIcon"), v = r("noUploadImg"), h = r("tableShape"), w = r("noPrettier"), C = r("codeTheme"), T = r("setting"), L = r("updateSetting"), O = r("catalogVisible"), N = r("defToolbars"), S = r("floatingToolbars"), A = r("rootRef"), D = x(), k = Ct(), V = x(!1), Q = new z(), ee = new z(), re = new z(), fe = new z(), Xe = new z(), Je = Ll(o, {
2230
+ noPrettier: w
2231
2231
  }), pe = () => [
2232
2232
  ...Je,
2233
2233
  ...Nt,
@@ -2241,12 +2241,12 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2241
2241
  compositionstart: () => {
2242
2242
  V.value = !0;
2243
2243
  },
2244
- compositionend: (h, E) => {
2244
+ compositionend: (f, E) => {
2245
2245
  V.value = !1, e.updateModelValue(E.state.doc.toString());
2246
2246
  },
2247
- input: (h) => {
2248
- e.onInput && e.onInput(h);
2249
- const { data: E } = h;
2247
+ input: (f) => {
2248
+ e.onInput && e.onInput(f);
2249
+ const { data: E } = f;
2250
2250
  e.maxlength && e.modelValue.length + E.length > e.maxlength && b.emit(o, j, {
2251
2251
  name: "overlength",
2252
2252
  message: "The input text is too long",
@@ -2254,13 +2254,13 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2254
2254
  });
2255
2255
  }
2256
2256
  }, Qe = al({
2257
- privide(h) {
2258
- h.provide("editorId", o), h.provide("theme", n), h.provide("previewTheme", i), h.provide("language", s), h.provide("disabled", u), h.provide("noUploadImg", v), h.provide("tableShape", p), h.provide("noPrettier", y), h.provide("codeTheme", C), h.provide("showToolbarName", m), h.provide("setting", T), h.provide("updateSetting", L), h.provide("usedLanguageText", c), h.provide("catalogVisible", O), h.provide("defToolbars", N), h.provide("tabWidth", t), h.provide("customIcon", g), h.provide("floatingToolbars", S), h.provide("rootRef", A);
2257
+ privide(f) {
2258
+ f.provide("editorId", o), f.provide("theme", n), f.provide("previewTheme", i), f.provide("language", s), f.provide("disabled", u), f.provide("noUploadImg", v), f.provide("tableShape", h), f.provide("noPrettier", w), f.provide("codeTheme", C), f.provide("showToolbarName", m), f.provide("setting", T), f.provide("updateSetting", L), f.provide("usedLanguageText", c), f.provide("catalogVisible", O), f.provide("defToolbars", N), f.provide("tabWidth", t), f.provide("customIcon", g), f.provide("floatingToolbars", S), f.provide("rootRef", A);
2259
2259
  }
2260
2260
  }), et = [
2261
2261
  {
2262
2262
  type: "theme",
2263
- extension: (h) => h.value === "light" ? De : Pe,
2263
+ extension: ({ theme: f }) => f.value === "light" ? De : Pe,
2264
2264
  compartment: Q,
2265
2265
  options: {
2266
2266
  theme: n
@@ -2268,8 +2268,8 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2268
2268
  },
2269
2269
  {
2270
2270
  type: "updateListener",
2271
- extension: R.updateListener.of((h) => {
2272
- h.docChanged && (e.onChange(h.state.doc.toString()), V.value || e.updateModelValue(h.state.doc.toString()));
2271
+ extension: R.updateListener.of((f) => {
2272
+ f.docChanged && (e.onChange(f.state.doc.toString()), V.value || e.updateModelValue(f.state.doc.toString()));
2273
2273
  })
2274
2274
  },
2275
2275
  {
@@ -2309,7 +2309,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2309
2309
  },
2310
2310
  {
2311
2311
  type: "linkShortener",
2312
- extension: (h) => Rl(h),
2312
+ extension: (f) => Rl(f),
2313
2313
  options: {
2314
2314
  maxLength: 30
2315
2315
  }
@@ -2327,25 +2327,25 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2327
2327
  }
2328
2328
  ), tt = () => [...et, ...Te].map(Fl);
2329
2329
  return W(() => {
2330
- const h = new R({
2330
+ const f = new R({
2331
2331
  doc: e.modelValue,
2332
2332
  parent: D.value,
2333
2333
  extensions: tt()
2334
- }), E = new vo(h);
2334
+ }), E = new vo(f);
2335
2335
  k.value = E, setTimeout(() => {
2336
- E.setTabSize(t), E.setDisabled(u.value), E.setReadOnly(e.readonly), e.placeholder && E.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && E.setMaxLength(e.maxlength), e.autofocus && h.focus();
2336
+ E.setTabSize(t), E.setDisabled(u.value), E.setReadOnly(e.readonly), e.placeholder && E.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && E.setMaxLength(e.maxlength), e.autofocus && f.focus();
2337
2337
  }, 0), b.on(o, {
2338
- name: qe,
2338
+ name: Ue,
2339
2339
  callback() {
2340
- Mt(h);
2340
+ Mt(f);
2341
2341
  }
2342
2342
  }), b.on(o, {
2343
- name: Ue,
2343
+ name: qe,
2344
2344
  callback() {
2345
- Rt(h);
2345
+ Rt(f);
2346
2346
  }
2347
2347
  }), b.on(o, {
2348
- name: f,
2348
+ name: p,
2349
2349
  async callback(F, M = {}) {
2350
2350
  if (F === "image" && M.transform) {
2351
2351
  const B = e.transformImgUrl(M.url);
@@ -2395,17 +2395,17 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2395
2395
  }), b.on(o, {
2396
2396
  name: Gt,
2397
2397
  callback: (F, M) => {
2398
- const B = h.state.doc.line(F);
2399
- h.dispatch(
2400
- h.state.update({ changes: { from: B.from, to: B.to, insert: M } })
2398
+ const B = f.state.doc.line(F);
2399
+ f.dispatch(
2400
+ f.state.update({ changes: { from: B.from, to: B.to, insert: M } })
2401
2401
  );
2402
2402
  }
2403
2403
  }), b.on(o, {
2404
2404
  name: jt,
2405
2405
  callback() {
2406
- b.emit(o, ke, h);
2406
+ b.emit(o, ke, f);
2407
2407
  }
2408
- }), b.emit(o, ke, h);
2408
+ }), b.emit(o, ke, f);
2409
2409
  }), I(
2410
2410
  n,
2411
2411
  () => {
@@ -2445,15 +2445,15 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2445
2445
  e.maxlength && k.value?.setMaxLength(e.maxlength);
2446
2446
  }
2447
2447
  ), ho(() => {
2448
- const h = Te.find(
2448
+ const f = Te.find(
2449
2449
  (E) => E.type === "floatingToolbar"
2450
2450
  );
2451
- h?.compartment && (S.value.length > 0 ? k.value?.view.dispatch({
2452
- effects: h.compartment.reconfigure(
2453
- Ze(h)
2451
+ f?.compartment && (S.value.length > 0 ? k.value?.view.dispatch({
2452
+ effects: f.compartment.reconfigure(
2453
+ Ze(f)
2454
2454
  )
2455
2455
  }) : k.value?.view.dispatch({
2456
- effects: h.compartment.reconfigure([])
2456
+ effects: f.compartment.reconfigure([])
2457
2457
  }));
2458
2458
  }, S), {
2459
2459
  inputWrapperRef: D,
@@ -2463,21 +2463,21 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2463
2463
  }
2464
2464
  };
2465
2465
  }, Hl = (e, t, o) => {
2466
- const n = r("setting"), i = K(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = U({
2466
+ const n = r("setting"), i = K(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = q({
2467
2467
  resizedWidth: i.value
2468
- }), c = U({
2468
+ }), c = q({
2469
2469
  width: i.value
2470
- }), u = U({
2470
+ }), u = q({
2471
2471
  left: i.value,
2472
2472
  display: "initial"
2473
- }), m = (p) => {
2474
- const y = t.value?.offsetWidth || 0, C = t.value?.getBoundingClientRect().x || 0;
2475
- let T = p.x - C;
2476
- T / y < oe ? T = y * oe : T > y - y * oe && (T = y - y * oe);
2477
- const L = `${T / y * 100}%`;
2473
+ }), m = (h) => {
2474
+ const w = t.value?.offsetWidth || 0, C = t.value?.getBoundingClientRect().x || 0;
2475
+ let T = h.x - C;
2476
+ T / w < oe ? T = w * oe : T > w - w * oe && (T = w - w * oe);
2477
+ const L = `${T / w * 100}%`;
2478
2478
  c.width = L, u.left = L, s.resizedWidth = L, e.oninputBoxWidthChange?.(L);
2479
- }, g = (p) => {
2480
- p.target === o.value && document.addEventListener("mousemove", m);
2479
+ }, g = (h) => {
2480
+ h.target === o.value && document.addEventListener("mousemove", m);
2481
2481
  }, v = () => {
2482
2482
  document.removeEventListener("mousemove", m);
2483
2483
  };
@@ -2487,8 +2487,8 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2487
2487
  document.addEventListener("mousedown", g), document.addEventListener("mouseup", v);
2488
2488
  }), ve(() => {
2489
2489
  document.removeEventListener("mousedown", g), document.removeEventListener("mouseup", v);
2490
- }), I([i], ([p]) => {
2491
- s.resizedWidth = p, c.width = p, u.left = p;
2490
+ }), I([i], ([h]) => {
2491
+ s.resizedWidth = h, c.width = h, u.left = h;
2492
2492
  }), I(
2493
2493
  [
2494
2494
  () => n.value.htmlPreview,
@@ -2520,7 +2520,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2520
2520
  onMouseenter: () => t.value = !1,
2521
2521
  onMouseleave: () => t.value = !0
2522
2522
  };
2523
- }, de = /* @__PURE__ */ w({
2523
+ }, de = /* @__PURE__ */ y({
2524
2524
  name: `${$t}CustomScrollbar`,
2525
2525
  props: {
2526
2526
  id: {
@@ -2561,7 +2561,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2561
2561
  }) {
2562
2562
  const o = x(null), n = x(null), i = x(null), s = x(null);
2563
2563
  let c = null, u = null, m = !1, g = 0, v = 0;
2564
- const p = () => {
2564
+ const h = () => {
2565
2565
  if (!n.value || !o.value || !i.value || !s.value) return;
2566
2566
  const S = o.value.clientHeight, A = n.value.scrollHeight, D = n.value.scrollTop;
2567
2567
  if (A <= S) {
@@ -2571,7 +2571,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2571
2571
  i.value.style.display = "block", s.value.style.display = "block";
2572
2572
  const k = S / A, V = Math.max(S * k, 20), Q = S - V, ee = Math.min(D * k, Q);
2573
2573
  i.value.style.height = `${V}px`, i.value.style.top = `${ee}px`;
2574
- }, y = () => p(), C = (S) => {
2574
+ }, w = () => h(), C = (S) => {
2575
2575
  m = !0, g = S.clientY, v = n.value.scrollTop, document.body.style.userSelect = "none";
2576
2576
  }, T = (S) => {
2577
2577
  if (!m || !n.value || !o.value) return;
@@ -2580,7 +2580,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2580
2580
  }, L = () => {
2581
2581
  m = !1, document.body.style.userSelect = "";
2582
2582
  }, O = (S) => {
2583
- n.value && n.value.removeEventListener("scroll", y), n.value = S, n.value ? (n.value.addEventListener("scroll", y), p()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2583
+ n.value && n.value.removeEventListener("scroll", w), n.value = S, n.value ? (n.value.addEventListener("scroll", w), h()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2584
2584
  }, N = () => {
2585
2585
  if (!o.value) return;
2586
2586
  const S = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
@@ -2594,9 +2594,9 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2594
2594
  }), c.observe(o.value, {
2595
2595
  childList: !0,
2596
2596
  subtree: !0
2597
- }), window.addEventListener("resize", p), i.value?.addEventListener("mousedown", C), document.addEventListener("mousemove", T), document.addEventListener("mouseup", L);
2597
+ }), window.addEventListener("resize", h), i.value?.addEventListener("mousedown", C), document.addEventListener("mousemove", T), document.addEventListener("mouseup", L);
2598
2598
  }), ve(() => {
2599
- c?.disconnect(), n.value && n.value.removeEventListener("scroll", y), window.removeEventListener("resize", p), i.value?.removeEventListener("mousedown", C), document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", L);
2599
+ c?.disconnect(), n.value && n.value.removeEventListener("scroll", w), window.removeEventListener("resize", h), i.value?.removeEventListener("mousedown", C), document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", L);
2600
2600
  }), () => l("div", {
2601
2601
  id: e.id,
2602
2602
  class: [`${a}-custom-scrollbar`, e.class],
@@ -2611,16 +2611,16 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2611
2611
  ref: i
2612
2612
  }, null)])]);
2613
2613
  }
2614
- }), Ol = We(), Vl = /* @__PURE__ */ w({
2614
+ }), Ol = We(), Vl = /* @__PURE__ */ y({
2615
2615
  name: "MDEditorContent",
2616
2616
  props: rt,
2617
2617
  setup(e, t) {
2618
2618
  const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = x(""), u = x(), m = x(), {
2619
2619
  inputWrapperRef: g,
2620
2620
  codeMirrorUt: v,
2621
- resetHistory: p
2621
+ resetHistory: h
2622
2622
  } = Bl(e), {
2623
- inputWrapperStyle: y,
2623
+ inputWrapperStyle: w,
2624
2624
  resizeOperateStyle: C
2625
2625
  } = Hl(e, u, m);
2626
2626
  to(e, c, v);
@@ -2636,7 +2636,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2636
2636
  focus(N) {
2637
2637
  v.value?.focus(N);
2638
2638
  },
2639
- resetHistory: p,
2639
+ resetHistory: h,
2640
2640
  getEditorView() {
2641
2641
  return v.value?.view;
2642
2642
  }
@@ -2648,7 +2648,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2648
2648
  }, [l(de, {
2649
2649
  alwaysShowTrack: !0,
2650
2650
  scrollTarget: `#${o} .cm-scroller`,
2651
- style: y
2651
+ style: w
2652
2652
  }, {
2653
2653
  default: () => [l("div", {
2654
2654
  class: `${a}-input-wrapper`,
@@ -2710,7 +2710,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2710
2710
  }, null)]
2711
2711
  })]);
2712
2712
  }
2713
- }), Wl = /* @__PURE__ */ w({
2713
+ }), Wl = /* @__PURE__ */ y({
2714
2714
  props: {
2715
2715
  modelValue: {
2716
2716
  type: String,
@@ -2739,7 +2739,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2739
2739
  type: Boolean,
2740
2740
  default: void 0
2741
2741
  }
2742
- }, zl = /* @__PURE__ */ w({
2742
+ }, zl = /* @__PURE__ */ y({
2743
2743
  name: `${a}-checkbox`,
2744
2744
  props: _l,
2745
2745
  setup(e) {
@@ -2750,7 +2750,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2750
2750
  }
2751
2751
  }, null);
2752
2752
  }
2753
- }), Ul = {
2753
+ }), ql = {
2754
2754
  scrollAuto: {
2755
2755
  type: Boolean
2756
2756
  },
@@ -2759,8 +2759,8 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2759
2759
  default: () => {
2760
2760
  }
2761
2761
  }
2762
- }, ql = /* @__PURE__ */ w({
2763
- props: Ul,
2762
+ }, Ul = /* @__PURE__ */ y({
2763
+ props: ql,
2764
2764
  setup(e) {
2765
2765
  const t = r("usedLanguageText"), o = r("disabled");
2766
2766
  return () => l("div", {
@@ -2799,7 +2799,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2799
2799
  defFooters: {
2800
2800
  type: Object
2801
2801
  }
2802
- }, Gl = /* @__PURE__ */ w({
2802
+ }, Gl = /* @__PURE__ */ y({
2803
2803
  name: "MDEditorFooter",
2804
2804
  props: Kl,
2805
2805
  setup(e) {
@@ -2814,7 +2814,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2814
2814
  modelValue: e.modelValue
2815
2815
  }, null);
2816
2816
  case "scrollSwitch":
2817
- return !e.noScrollAuto && l(ql, {
2817
+ return !e.noScrollAuto && l(Ul, {
2818
2818
  scrollAuto: e.scrollAuto,
2819
2819
  onScrollAutoChange: e.onScrollAutoChange
2820
2820
  }, null);
@@ -2858,15 +2858,15 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2858
2858
  type: Array,
2859
2859
  default: () => []
2860
2860
  }
2861
- }, Yl = /* @__PURE__ */ w({
2861
+ }, Yl = /* @__PURE__ */ y({
2862
2862
  name: "MDEditorToolbar",
2863
2863
  props: jl,
2864
2864
  setup(e) {
2865
2865
  const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = x(), s = x(), {
2866
2866
  barRender: c
2867
2867
  } = Ye(), u = K(() => {
2868
- const m = e.toolbars.filter((y) => !e.toolbarsExclude.includes(y)), g = m.indexOf("="), v = g === -1 ? m : m.slice(0, g + 1), p = g === -1 ? [] : m.slice(g, Number.MAX_SAFE_INTEGER);
2869
- return [v, p];
2868
+ const m = e.toolbars.filter((w) => !e.toolbarsExclude.includes(w)), g = m.indexOf("="), v = g === -1 ? m : m.slice(0, g + 1), h = g === -1 ? [] : m.slice(g, Number.MAX_SAFE_INTEGER);
2869
+ return [v, h];
2870
2870
  });
2871
2871
  return I(() => e.toolbars, () => {
2872
2872
  ne(() => {
@@ -2890,7 +2890,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2890
2890
  }, [g])])])]);
2891
2891
  };
2892
2892
  }
2893
- }), me = /* @__PURE__ */ w({
2893
+ }), me = /* @__PURE__ */ y({
2894
2894
  name: "MdEditorV3",
2895
2895
  props: ct,
2896
2896
  emits: it,
@@ -2899,7 +2899,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2899
2899
  noKatex: o,
2900
2900
  noMermaid: n,
2901
2901
  noHighlight: i
2902
- } = e, s = U({
2902
+ } = e, s = q({
2903
2903
  scrollAuto: e.scrollAuto
2904
2904
  }), c = x(), u = x(), m = K(() => $e({
2905
2905
  props: e,
@@ -2907,7 +2907,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2907
2907
  }, "defToolbars")), g = K(() => $e({
2908
2908
  props: e,
2909
2909
  ctx: t
2910
- }, "defFooters")), v = ut(e), [p, y] = dt(e, t, {
2910
+ }, "defFooters")), v = ut(e), [h, w] = dt(e, t, {
2911
2911
  editorId: v
2912
2912
  }), C = mt(e, {
2913
2913
  editorId: v
@@ -2919,21 +2919,21 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2919
2919
  }), ht(e, t, {
2920
2920
  editorId: v,
2921
2921
  catalogVisible: C,
2922
- setting: p,
2923
- updateSetting: y,
2922
+ setting: h,
2923
+ updateSetting: w,
2924
2924
  codeRef: u
2925
2925
  }), ft(e, {
2926
2926
  rootRef: c,
2927
2927
  editorId: v,
2928
- setting: p,
2929
- updateSetting: y,
2928
+ setting: h,
2929
+ updateSetting: w,
2930
2930
  catalogVisible: C,
2931
2931
  defToolbars: m
2932
2932
  }), ve(() => {
2933
2933
  b.clear(v);
2934
2934
  }), () => l("div", {
2935
2935
  id: v,
2936
- class: [a, e.class, e.theme === "dark" && `${a}-dark`, p.fullscreen || p.pageFullscreen ? `${a}-fullscreen` : ""],
2936
+ class: [a, e.class, e.theme === "dark" && `${a}-dark`, h.fullscreen || h.pageFullscreen ? `${a}-fullscreen` : ""],
2937
2937
  style: e.style,
2938
2938
  ref: c
2939
2939
  }, [e.toolbars.length > 0 && l(Yl, {
@@ -2998,7 +2998,7 @@ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2998
2998
  modelValue: e.modelValue,
2999
2999
  footers: e.footers,
3000
3000
  defFooters: g.value,
3001
- noScrollAuto: !p.preview && !p.htmlPreview || p.previewOnly,
3001
+ noScrollAuto: !h.preview && !h.htmlPreview || h.previewOnly,
3002
3002
  scrollAuto: s.scrollAuto,
3003
3003
  onScrollAutoChange: (T) => s.scrollAuto = T
3004
3004
  }, null)]);