md-editor-v3 6.1.1 → 6.2.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.
@@ -1,23 +1,23 @@
1
- import { a as J, D as lt } from "./chunks/index.mjs";
1
+ import { a as te, D as lt } from "./chunks/index.mjs";
2
2
  import { s as at, a as nt, M as We } from "./chunks/index4.mjs";
3
- import { C as rt, c as st, a as it, e as ct, b as ut, u as dt, d as mt, f as bt, g as vt, h as gt, i as ft, j as ht, k as pt, M as Tt } from "./chunks/index3.mjs";
3
+ import { C as rt, c as st, a as it, e as ct, b as ut, u as dt, d as mt, f as bt, g as vt, h as gt, i as ht, j as ft, k as pt, M as Tt } from "./chunks/index3.mjs";
4
4
  import wt from "./ModalToolbar.mjs";
5
5
  import yt from "./NormalToolbar.mjs";
6
- import { inject as r, watch as E, nextTick as re, onMounted as _, ref as x, defineComponent as C, createVNode as l, reactive as U, toRef as Ce, Fragment as _e, computed as K, cloneVNode as ae, createApp as Ct, shallowRef as kt, onBeforeUnmount as ge } from "vue";
7
- import { g as G, p as a, a as $t, M as oe, d as xt, b as St } from "./chunks/config.mjs";
6
+ import { inject as r, watch as N, nextTick as se, onMounted as K, ref as E, defineComponent as y, createVNode as l, reactive as Y, toRef as Ce, computed as P, Fragment as _e, cloneVNode as ne, createApp as Ct, shallowRef as kt, onBeforeUnmount as ge } from "vue";
7
+ import { g as Z, p as a, a as $t, M as le, d as xt, b as St } from "./chunks/config.mjs";
8
8
  import { linkTo as It, throttle as Et, createSmoothScroll as ze, draggingScroll as Lt } from "@vavt/util";
9
9
  import { deleteLine as Nt, history as ke, defaultKeymap as At, historyKeymap as Dt, indentWithTab as Mt, undo as Rt, redo as Ft } from "@codemirror/commands";
10
10
  import { markdown as Bt } from "@codemirror/lang-markdown";
11
11
  import { languages as Pt } from "@codemirror/language-data";
12
- import { EditorState as ie, EditorSelection as W, Compartment as q, StateEffect as ne, StateField as qe, RangeSetBuilder as Ht } from "@codemirror/state";
13
- import { placeholder as Ot, EditorView as R, showTooltip as Vt, Decoration as Wt, WidgetType as _t, keymap as zt, drawSelection as qt } from "@codemirror/view";
14
- import { b as g, E as j, R as y, C as Ut, U as fe, a as Ue, c as Ke, O as Ge, d as Kt, e as Gt, T as jt, S as Yt, G as $e } from "./chunks/event-bus.mjs";
12
+ import { EditorState as ie, EditorSelection as U, Compartment as j, StateEffect as re, StateField as qe, RangeSetBuilder as Ht } from "@codemirror/state";
13
+ import { placeholder as Ot, EditorView as B, showTooltip as Vt, Decoration as Wt, WidgetType as _t, keymap as zt, drawSelection as qt } from "@codemirror/view";
14
+ import { b as h, E as X, R as w, C as Ut, U as he, a as Ue, c as Ke, O as Ge, d as Kt, e as Gt, T as jt, S as Yt, G as $e } from "./chunks/event-bus.mjs";
15
15
  import { indentUnit as Zt, syntaxHighlighting as je, HighlightStyle as Ye } from "@codemirror/language";
16
16
  import { autocompletion as Xt } from "@codemirror/autocomplete";
17
17
  import { a as Jt } from "./chunks/dom.mjs";
18
- import { I as $, M as Qt } from "./chunks/index2.mjs";
18
+ import { I as x, M as Qt } from "./chunks/index2.mjs";
19
19
  import { b as eo } from "./chunks/index5.mjs";
20
- import { tags as d } from "@lezer/highlight";
20
+ import { tags as b } from "@lezer/highlight";
21
21
  import { searchKeymap as to } from "@codemirror/search";
22
22
  import { g as xe } from "./chunks/vue-tsx.mjs";
23
23
  const oo = (e, t, o) => {
@@ -25,34 +25,34 @@ const oo = (e, t, o) => {
25
25
  let s = () => {
26
26
  }, c = () => {
27
27
  };
28
- const u = () => {
28
+ const d = () => {
29
29
  s();
30
- const m = o.value?.view.contentDOM.getRootNode(), v = m?.querySelector(
30
+ const u = o.value?.view.contentDOM.getRootNode(), v = u?.querySelector(
31
31
  `#${n} .cm-scroller`
32
- ), b = m?.querySelector(
32
+ ), m = u?.querySelector(
33
33
  `[id="${n}-preview-wrapper"]`
34
- ), h = m?.querySelector(
34
+ ), f = u?.querySelector(
35
35
  `[id="${n}-html-wrapper"]`
36
36
  );
37
- (b || h) && ([c, s] = (b ? at : nt)(
37
+ (m || f) && ([c, s] = (m ? at : nt)(
38
38
  v,
39
- b || h,
39
+ m || f,
40
40
  o.value
41
41
  ), e.scrollAuto && c());
42
42
  };
43
- E([t, i], () => {
44
- re(u);
45
- }), E(
43
+ N([t, i], () => {
44
+ se(d);
45
+ }), N(
46
46
  () => e.scrollAuto,
47
- (m) => {
48
- m ? c() : s();
47
+ (u) => {
48
+ u ? c() : s();
49
49
  }
50
- ), E(
50
+ ), N(
51
51
  () => i.value.previewOnly,
52
- (m) => {
53
- m ? s() : c();
52
+ (u) => {
53
+ u ? s() : c();
54
54
  }
55
- ), _(u);
55
+ ), K(d);
56
56
  }, ce = async (e, t, o) => {
57
57
  if (/^h[1-6]$/.test(e))
58
58
  return lo(e, t);
@@ -106,7 +106,7 @@ const oo = (e, t, o) => {
106
106
  return { text: "", options: {} };
107
107
  }
108
108
  }, lo = (e, t) => {
109
- const o = e.slice(1), n = "#".repeat(Number(o)), [i, s, c] = he(t, {
109
+ const o = e.slice(1), n = "#".repeat(Number(o)), [i, s, c] = fe(t, {
110
110
  wholeLine: !0
111
111
  });
112
112
  return {
@@ -114,10 +114,10 @@ const oo = (e, t, o) => {
114
114
  options: { deviationStart: n.length + 1, replaceStart: s, replaceEnd: c }
115
115
  };
116
116
  }, ao = async (e, t) => {
117
- const o = window.prettier || G.editorExtensions.prettier?.prettierInstance, n = [
118
- window.prettierPlugins?.markdown || G.editorExtensions.prettier?.parserMarkdownInstance
117
+ const o = window.prettier || Z.editorExtensions.prettier?.prettierInstance, n = [
118
+ window.prettierPlugins?.markdown || Z.editorExtensions.prettier?.parserMarkdownInstance
119
119
  ];
120
- return !o || !n[0] ? (g.emit(t.editorId, j, {
120
+ return !o || !n[0] ? (h.emit(t.editorId, X, {
121
121
  name: "prettier",
122
122
  message: "prettier is undefined"
123
123
  }), {
@@ -160,17 +160,17 @@ $$
160
160
  orderedList: 1,
161
161
  task: "- [ ] "
162
162
  }, io = (e, t) => {
163
- const [o, n, i] = he(t, {
163
+ const [o, n, i] = fe(t, {
164
164
  wholeLine: !0
165
165
  }), s = o.split(`
166
- `), c = so[e], u = e === "orderedList" ? s.map((b, h) => `${c + h}. ${b}`) : s.map((b) => `${c}${b}`), m = e === "orderedList" ? "1. " : c.toString(), v = s.length === 1 ? m.length : 0;
166
+ `), c = so[e], d = e === "orderedList" ? s.map((m, f) => `${c + f}. ${m}`) : s.map((m) => `${c}${m}`), u = e === "orderedList" ? "1. " : c.toString(), v = s.length === 1 ? u.length : 0;
167
167
  return {
168
- text: u.join(`
168
+ text: d.join(`
169
169
  `),
170
170
  options: { deviationStart: v, replaceStart: n, replaceEnd: i }
171
171
  };
172
172
  }, co = (e, t) => {
173
- const [o, n, i] = he(t), s = e.mode || "language", c = `
173
+ const [o, n, i] = fe(t), s = e.mode || "language", c = `
174
174
  \`\`\`${s}
175
175
  ${e.text || o || ""}
176
176
  \`\`\`
@@ -208,7 +208,7 @@ dateFormat YYYY-MM-DD`,
208
208
  CAR ||--o{ NAMED-DRIVER : allows`,
209
209
  journey: `journey
210
210
  title My Journey`,
211
- ...G.editorConfig.mermaidTemplate
211
+ ...Z.editorConfig.mermaidTemplate
212
212
  }[e]}
213
213
  \`\`\`
214
214
  `,
@@ -216,22 +216,22 @@ dateFormat YYYY-MM-DD`,
216
216
  }), mo = (e, t) => {
217
217
  const o = t.getSelectedText(), { desc: n = o, url: i = "", urls: s } = e;
218
218
  let c = "";
219
- const u = i === "" && (!s || s instanceof Array && s.length === 0);
220
- return s instanceof Array ? c = s.reduce((m, v) => {
219
+ const d = i === "" && (!s || s instanceof Array && s.length === 0);
220
+ return s instanceof Array ? c = s.reduce((u, v) => {
221
221
  const {
222
- url: b = "",
223
- alt: h = "",
224
- title: f = ""
222
+ url: m = "",
223
+ alt: f = "",
224
+ title: g = ""
225
225
  } = typeof v == "object" ? v : { url: v };
226
- return m + `![${h}](${b}${f ? " '" + f + "'" : ""})
226
+ return u + `![${f}](${m}${g ? " '" + g + "'" : ""})
227
227
  `;
228
228
  }, "") : c = `![${n}](${i})
229
229
  `, {
230
230
  text: c,
231
231
  options: {
232
232
  select: i === "",
233
- deviationStart: u ? c.length - i.length - 2 : c.length,
234
- deviationEnd: u ? -2 : 0
233
+ deviationStart: d ? c.length - i.length - 2 : c.length,
234
+ deviationEnd: d ? -2 : 0
235
235
  }
236
236
  };
237
237
  }, bo = (e) => {
@@ -262,7 +262,7 @@ dateFormat YYYY-MM-DD`,
262
262
  deviationEnd: n.deviationEnd || 0
263
263
  }
264
264
  };
265
- }, he = (e, t = { wholeLine: !1 }) => {
265
+ }, fe = (e, t = { wholeLine: !1 }) => {
266
266
  const o = e.view.state, n = o.selection.main;
267
267
  if (n.empty) {
268
268
  const i = o.doc.lineAt(n.from);
@@ -280,10 +280,10 @@ dateFormat YYYY-MM-DD`,
280
280
  n.from,
281
281
  n.to
282
282
  ];
283
- }, z = (e) => {
284
- const t = new q();
283
+ }, G = (e) => {
284
+ const t = new j();
285
285
  return (n) => (t.get(e.state) ? e.dispatch({ effects: t.reconfigure(n) }) : e.dispatch({
286
- effects: ne.appendConfig.of(t.of(n))
286
+ effects: re.appendConfig.of(t.of(n))
287
287
  }), !0);
288
288
  };
289
289
  class go {
@@ -370,7 +370,7 @@ class go {
370
370
  }), this.view.focus();
371
371
  } catch (s) {
372
372
  if (s.message === "The input text is too long")
373
- g.emit(n, j, {
373
+ h.emit(n, X, {
374
374
  name: "overlength",
375
375
  message: s.message,
376
376
  data: t
@@ -380,7 +380,7 @@ class go {
380
380
  }
381
381
  }
382
382
  constructor(t) {
383
- this.view = t, this.toggleTabSize = z(this.view), this.togglePlaceholder = z(this.view), this.setExtensions = z(this.view), this.toggleDisabled = z(this.view), this.toggleReadOnly = z(this.view), this.toggleMaxlength = z(this.view);
383
+ this.view = t, this.toggleTabSize = G(this.view), this.togglePlaceholder = G(this.view), this.setExtensions = G(this.view), this.toggleDisabled = G(this.view), this.toggleReadOnly = G(this.view), this.toggleMaxlength = G(this.view);
384
384
  }
385
385
  /**
386
386
  * 设置tabSize
@@ -417,14 +417,14 @@ class go {
417
417
  }
418
418
  this.view.dispatch({
419
419
  scrollIntoView: !0,
420
- selection: W.create(
421
- [W.range(o, n), W.cursor(i)],
420
+ selection: U.create(
421
+ [U.range(o, n), U.cursor(i)],
422
422
  1
423
423
  )
424
424
  });
425
425
  }
426
426
  setDisabled(t) {
427
- this.toggleDisabled([R.editable.of(!t)]);
427
+ this.toggleDisabled([B.editable.of(!t)]);
428
428
  }
429
429
  setReadOnly(t) {
430
430
  this.toggleReadOnly([ie.readOnly.of(t)]);
@@ -435,28 +435,28 @@ class go {
435
435
  ]);
436
436
  }
437
437
  }
438
- const fo = (e, t) => {
438
+ const ho = (e, t) => {
439
439
  if (e === t) return !0;
440
440
  if (e.length !== t.length) return !1;
441
441
  for (let o = 0; o < e.length; o++)
442
442
  if (e[o] !== t[o]) return !1;
443
443
  return !0;
444
- }, ho = (e, t) => {
445
- const o = x(t.value);
446
- E([t], () => {
447
- (!o.value || !fo(o.value, t.value)) && (o.value = t.value, e());
444
+ }, fo = (e, t) => {
445
+ const o = E(t.value);
446
+ N([t], () => {
447
+ (!o.value || !ho(o.value, t.value)) && (o.value = t.value, e());
448
448
  });
449
- }, le = (e, t, o, n, i) => (s, c, u, m) => {
450
- const v = `${e}${t}${o}${n}`, b = u + c.label.length + (i === "title" ? o.length : 0);
449
+ }, ae = (e, t, o, n, i) => (s, c, d, u) => {
450
+ const v = `${e}${t}${o}${n}`, m = d + c.label.length + (i === "title" ? o.length : 0);
451
451
  s.dispatch({
452
- changes: { from: u, to: m, insert: v },
453
- selection: W.create(
452
+ changes: { from: d, to: u, insert: v },
453
+ selection: U.create(
454
454
  [
455
- W.range(
456
- u + c.label.length + (i === "title" ? 1 : -t.length),
457
- b
455
+ U.range(
456
+ d + c.label.length + (i === "title" ? 1 : -t.length),
457
+ m
458
458
  ),
459
- W.cursor(b)
459
+ U.cursor(m)
460
460
  ],
461
461
  1
462
462
  )
@@ -499,7 +499,7 @@ const fo = (e, t) => {
499
499
  ].map((i) => ({
500
500
  label: `${i[0]}${i[1]}`,
501
501
  type: "text",
502
- apply: le(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
502
+ apply: ae(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
503
503
  })),
504
504
  // 链接
505
505
  {
@@ -524,12 +524,12 @@ const fo = (e, t) => {
524
524
  {
525
525
  label: "$",
526
526
  type: "text",
527
- apply: le("$", "", "", "$", "type")
527
+ apply: ae("$", "", "", "$", "type")
528
528
  },
529
529
  {
530
530
  label: "$$",
531
531
  type: "text",
532
- apply: le("$$", "", `
532
+ apply: ae("$$", "", `
533
533
  `, `
534
534
  $$`, "title")
535
535
  },
@@ -554,7 +554,7 @@ $$`, "title")
554
554
  ].map((i) => ({
555
555
  label: `!!! ${i}`,
556
556
  type: "text",
557
- apply: le("!!!", ` ${i}`, " Title", `
557
+ apply: ae("!!!", ` ${i}`, " Title", `
558
558
 
559
559
  !!!`, "title")
560
560
  }))
@@ -564,14 +564,14 @@ $$`, "title")
564
564
  return Xt({
565
565
  override: e ? [t, ...e] : [t]
566
566
  });
567
- }, po = /* @__PURE__ */ C({
567
+ }, po = /* @__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
- }), To = /* @__PURE__ */ C({
574
+ }), To = /* @__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,16 +580,16 @@ $$`, "title")
580
580
  title: t.value.toolbarTips?.bold,
581
581
  disabled: o?.value,
582
582
  onClick: () => {
583
- g.emit(e, y, "bold");
583
+ h.emit(e, w, "bold");
584
584
  },
585
585
  type: "button"
586
- }, [l($, {
586
+ }, [l(x, {
587
587
  name: "bold"
588
588
  }, null), n?.value && l("div", {
589
589
  class: `${a}-toolbar-item-name`
590
590
  }, [t.value.toolbarTips?.bold])]);
591
591
  }
592
- }), wo = /* @__PURE__ */ C({
592
+ }), wo = /* @__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,17 +598,17 @@ $$`, "title")
598
598
  title: t.value.toolbarTips?.catalog,
599
599
  disabled: o?.value,
600
600
  onClick: () => {
601
- g.emit(e, Ut);
601
+ h.emit(e, Ut);
602
602
  },
603
603
  key: "bar-catalog",
604
604
  type: "button"
605
- }, [l($, {
605
+ }, [l(x, {
606
606
  name: "catalog"
607
607
  }, null), n?.value && l("div", {
608
608
  class: `${a}-toolbar-item-name`
609
609
  }, [t.value.toolbarTips?.catalog])]);
610
610
  }
611
- }), yo = /* @__PURE__ */ C({
611
+ }), yo = /* @__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,16 +617,16 @@ $$`, "title")
617
617
  title: t.value.toolbarTips?.code,
618
618
  disabled: o?.value,
619
619
  onClick: () => {
620
- g.emit(e, y, "code");
620
+ h.emit(e, w, "code");
621
621
  },
622
622
  type: "button"
623
- }, [l($, {
623
+ }, [l(x, {
624
624
  name: "code"
625
625
  }, null), n?.value && l("div", {
626
626
  class: `${a}-toolbar-item-name`
627
627
  }, [t.value.toolbarTips?.code])]);
628
628
  }
629
- }), Co = /* @__PURE__ */ C({
629
+ }), Co = /* @__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,16 +635,16 @@ $$`, "title")
635
635
  title: t.value.toolbarTips?.codeRow,
636
636
  disabled: o?.value,
637
637
  onClick: () => {
638
- g.emit(e, y, "codeRow");
638
+ h.emit(e, w, "codeRow");
639
639
  },
640
640
  type: "button"
641
- }, [l($, {
641
+ }, [l(x, {
642
642
  name: "code-row"
643
643
  }, null), n?.value && l("div", {
644
644
  class: `${a}-toolbar-item-name`
645
645
  }, [t.value.toolbarTips?.codeRow])]);
646
646
  }
647
- }), ko = /* @__PURE__ */ C({
647
+ }), ko = /* @__PURE__ */ y({
648
648
  name: "ToolbarFullscreen",
649
649
  setup() {
650
650
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), {
@@ -658,13 +658,13 @@ $$`, "title")
658
658
  i();
659
659
  },
660
660
  type: "button"
661
- }, [l($, {
661
+ }, [l(x, {
662
662
  name: n.value.fullscreen ? "fullscreen-exit" : "fullscreen"
663
663
  }, null), o?.value && l("div", {
664
664
  class: `${a}-toolbar-item-name`
665
665
  }, [e.value.toolbarTips?.fullscreen])]);
666
666
  }
667
- }), $o = /* @__PURE__ */ C({
667
+ }), $o = /* @__PURE__ */ y({
668
668
  name: "ToolbarGithub",
669
669
  setup() {
670
670
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName");
@@ -676,13 +676,13 @@ $$`, "title")
676
676
  It("https://github.com/imzbf/md-editor-v3");
677
677
  },
678
678
  type: "button"
679
- }, [l($, {
679
+ }, [l(x, {
680
680
  name: "github"
681
681
  }, null), o?.value && l("div", {
682
682
  class: `${a}-toolbar-item-name`
683
683
  }, [e.value.toolbarTips?.github])]);
684
684
  }
685
- }), xo = /* @__PURE__ */ C({
685
+ }), xo = /* @__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");
@@ -694,13 +694,13 @@ $$`, "title")
694
694
  i("htmlPreview");
695
695
  },
696
696
  type: "button"
697
- }, [l($, {
697
+ }, [l(x, {
698
698
  name: "preview-html"
699
699
  }, null), o?.value && l("div", {
700
700
  class: `${a}-toolbar-item-name`
701
701
  }, [e.value.toolbarTips?.htmlPreview])]);
702
702
  }
703
- }), So = /* @__PURE__ */ C({
703
+ }), So = /* @__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,10 +709,10 @@ $$`, "title")
709
709
  title: t.value.toolbarTips?.image,
710
710
  disabled: o?.value,
711
711
  onClick: () => {
712
- g.emit(e, y, "image");
712
+ h.emit(e, w, "image");
713
713
  },
714
714
  type: "button"
715
- }, [l($, {
715
+ }, [l(x, {
716
716
  name: "image"
717
717
  }, null), n?.value && l("div", {
718
718
  class: `${a}-toolbar-item-name`
@@ -733,13 +733,13 @@ $$`, "title")
733
733
  default: () => {
734
734
  }
735
735
  }
736
- }, Eo = /* @__PURE__ */ C({
736
+ }, Eo = /* @__PURE__ */ y({
737
737
  name: `${a}-modal-clip`,
738
738
  props: Io,
739
739
  setup(e) {
740
740
  const t = r("usedLanguageText"), o = r("editorId"), n = r("rootRef");
741
- let i = G.editorExtensions.cropper.instance;
742
- const s = x(), c = x(), u = x(), m = U({
741
+ let i = Z.editorExtensions.cropper.instance;
742
+ const s = E(), c = E(), d = E(), u = Y({
743
743
  cropperInited: !1,
744
744
  imgSelected: !1,
745
745
  imgSrc: "",
@@ -747,36 +747,38 @@ $$`, "title")
747
747
  isFullscreen: !1
748
748
  });
749
749
  let v = null;
750
- E(() => e.visible, () => {
751
- e.visible && !m.cropperInited && (i = i || window.Cropper, s.value.onchange = () => {
750
+ N(() => e.visible, () => {
751
+ e.visible && !u.cropperInited && (i = i || window.Cropper, s.value.onchange = () => {
752
752
  if (!i) {
753
- g.emit(o, j, {
753
+ h.emit(o, X, {
754
754
  name: "Cropper",
755
755
  message: "Cropper is undefined"
756
756
  });
757
757
  return;
758
758
  }
759
- const h = s.value.files || [];
760
- if (m.imgSelected = !0, h?.length > 0) {
761
- const f = new FileReader();
762
- f.onload = (p) => {
763
- m.imgSrc = p.target.result;
764
- }, f.readAsDataURL(h[0]);
759
+ const g = s.value.files || [];
760
+ if (u.imgSelected = !0, g?.length > 0) {
761
+ const p = new FileReader();
762
+ p.onload = (k) => {
763
+ u.imgSrc = k.target.result;
764
+ }, p.readAsDataURL(g[0]);
765
765
  }
766
766
  });
767
- }), E(() => [m.imgSelected], () => {
768
- u.value.style = "";
769
- }), E([Ce(() => m.isFullscreen), Ce(() => m.imgSrc)], () => {
770
- m.imgSrc && re(() => {
771
- v?.destroy(), u.value.style = "", c.value && (v = new i(c.value, {
767
+ }), N(() => [u.imgSelected], () => {
768
+ d.value.style = "";
769
+ }), N([Ce(() => u.isFullscreen), Ce(() => u.imgSrc)], () => {
770
+ u.imgSrc && se(() => {
771
+ v?.destroy(), d.value.style = "", c.value && (v = new i(c.value, {
772
772
  viewMode: 2,
773
773
  preview: n.value.getRootNode().querySelector(`.${a}-clip-preview-target`)
774
774
  // aspectRatio: 16 / 9,
775
775
  }));
776
776
  });
777
777
  });
778
- const b = () => {
779
- v.clear(), v.destroy(), v = null, s.value.value = "", m.imgSelected = !1, m.imgSrc = "";
778
+ const m = () => {
779
+ v.clear(), v.destroy(), v = null, s.value.value = "", u.imgSelected = !1, u.imgSrc = "";
780
+ }, f = (g) => {
781
+ u.isFullscreen = g;
780
782
  };
781
783
  return () => l(Qt, {
782
784
  class: `${a}-modal-clip`,
@@ -784,10 +786,8 @@ $$`, "title")
784
786
  visible: e.visible,
785
787
  onClose: e.onCancel,
786
788
  showAdjust: !0,
787
- isFullscreen: m.isFullscreen,
788
- onAdjust: (h) => {
789
- m.isFullscreen = h;
790
- },
789
+ isFullscreen: u.isFullscreen,
790
+ onAdjust: f,
791
791
  width: "668px",
792
792
  height: "421px"
793
793
  }, {
@@ -795,10 +795,10 @@ $$`, "title")
795
795
  class: `${a}-form-item ${a}-clip`
796
796
  }, [l("div", {
797
797
  class: `${a}-clip-main`
798
- }, [m.imgSelected ? l("div", {
798
+ }, [u.imgSelected ? l("div", {
799
799
  class: `${a}-clip-cropper`
800
800
  }, [l("img", {
801
- src: m.imgSrc,
801
+ src: u.imgSrc,
802
802
  ref: c,
803
803
  style: {
804
804
  display: "none"
@@ -806,8 +806,8 @@ $$`, "title")
806
806
  alt: ""
807
807
  }, null), l("div", {
808
808
  class: `${a}-clip-delete`,
809
- onClick: b
810
- }, [l($, {
809
+ onClick: m
810
+ }, [l(x, {
811
811
  name: "delete"
812
812
  }, null)])]) : l("div", {
813
813
  class: `${a}-clip-upload`,
@@ -817,13 +817,13 @@ $$`, "title")
817
817
  role: "button",
818
818
  tabindex: "0",
819
819
  "aria-label": t.value.imgTitleItem?.upload
820
- }, [l($, {
820
+ }, [l(x, {
821
821
  name: "upload"
822
822
  }, null)])]), l("div", {
823
823
  class: `${a}-clip-preview`
824
824
  }, [l("div", {
825
825
  class: `${a}-clip-preview-target`,
826
- ref: u
826
+ ref: d
827
827
  }, null)])]), l("div", {
828
828
  class: `${a}-form-item`
829
829
  }, [l("button", {
@@ -831,8 +831,8 @@ $$`, "title")
831
831
  type: "button",
832
832
  onClick: () => {
833
833
  if (v) {
834
- const h = v.getCroppedCanvas();
835
- g.emit(o, fe, [eo(h.toDataURL("image/png"))], e.onOk), b();
834
+ const g = v.getCroppedCanvas();
835
+ h.emit(o, he, [eo(g.toDataURL("image/png"))], e.onOk), m();
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
- }, No = /* @__PURE__ */ C({
865
+ }, No = /* @__PURE__ */ y({
866
866
  name: `${a}-modals`,
867
867
  props: Lo,
868
868
  setup(e) {
@@ -872,17 +872,56 @@ $$`, "title")
872
872
  onCancel: e.onCancel
873
873
  }, null);
874
874
  }
875
- }), Ao = /* @__PURE__ */ C({
875
+ }), Ao = /* @__PURE__ */ y({
876
876
  name: "ToolbarImageDropdown",
877
877
  setup() {
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
- g.emit(e, fe, Array.from(u.value.files || [])), u.value.value = "";
880
- }, v = (b, h) => {
881
- o?.value || g.emit(e, y, b, h);
878
+ const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = E(!1), d = E(), u = () => {
879
+ h.emit(e, he, Array.from(d.value.files || [])), d.value.value = "";
880
+ }, v = (k, S) => {
881
+ o?.value || h.emit(e, w, k, S);
882
882
  };
883
- return _(() => {
884
- u.value.addEventListener("change", m);
885
- }), () => l(_e, null, [l("label", {
883
+ K(() => {
884
+ d.value.addEventListener("change", u);
885
+ });
886
+ const m = (k) => {
887
+ s.value = k;
888
+ }, f = () => {
889
+ c.value = !1;
890
+ }, g = (k) => {
891
+ k && v("image", {
892
+ desc: k.desc,
893
+ url: k.url,
894
+ transform: !0
895
+ }), c.value = !1;
896
+ }, p = P(() => l("ul", {
897
+ class: `${a}-menu`,
898
+ onClick: () => {
899
+ s.value = !1;
900
+ },
901
+ role: "menu"
902
+ }, [l("li", {
903
+ class: `${a}-menu-item ${a}-menu-item-image`,
904
+ onClick: () => {
905
+ v("image");
906
+ },
907
+ role: "menuitem",
908
+ tabindex: "0"
909
+ }, [t.value.imgTitleItem?.link]), l("li", {
910
+ class: `${a}-menu-item ${a}-menu-item-image`,
911
+ onClick: () => {
912
+ d.value.click();
913
+ },
914
+ role: "menuitem",
915
+ tabindex: "0"
916
+ }, [t.value.imgTitleItem?.upload]), l("li", {
917
+ class: `${a}-menu-item ${a}-menu-item-image`,
918
+ onClick: () => {
919
+ c.value = !0;
920
+ },
921
+ role: "menuitem",
922
+ tabindex: "0"
923
+ }, [t.value.imgTitleItem?.clip2upload])]));
924
+ return () => l(_e, null, [l("label", {
886
925
  for: `${i}_label`,
887
926
  style: {
888
927
  display: "none"
@@ -890,74 +929,37 @@ $$`, "title")
890
929
  "aria-label": t.value.imgTitleItem?.upload
891
930
  }, null), l("input", {
892
931
  id: `${i}_label`,
893
- ref: u,
932
+ ref: d,
894
933
  accept: "image/*",
895
934
  type: "file",
896
935
  multiple: !0,
897
936
  style: {
898
937
  display: "none"
899
938
  }
900
- }, null), l(J, {
939
+ }, null), l(te, {
901
940
  relative: `#${i}`,
902
941
  visible: s.value,
903
- onChange: (b) => {
904
- s.value = b;
905
- },
942
+ onChange: m,
906
943
  disabled: o?.value,
907
- overlay: l("ul", {
908
- class: `${a}-menu`,
909
- onClick: () => {
910
- s.value = !1;
911
- },
912
- role: "menu"
913
- }, [l("li", {
914
- class: `${a}-menu-item ${a}-menu-item-image`,
915
- onClick: () => {
916
- v("image");
917
- },
918
- role: "menuitem",
919
- tabindex: "0"
920
- }, [t.value.imgTitleItem?.link]), l("li", {
921
- class: `${a}-menu-item ${a}-menu-item-image`,
922
- onClick: () => {
923
- u.value.click();
924
- },
925
- role: "menuitem",
926
- tabindex: "0"
927
- }, [t.value.imgTitleItem?.upload]), l("li", {
928
- class: `${a}-menu-item ${a}-menu-item-image`,
929
- onClick: () => {
930
- c.value = !0;
931
- },
932
- role: "menuitem",
933
- tabindex: "0"
934
- }, [t.value.imgTitleItem?.clip2upload])])
944
+ overlay: p.value
935
945
  }, {
936
946
  default: () => [l("button", {
937
947
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
938
948
  title: t.value.toolbarTips?.image,
939
949
  disabled: o?.value,
940
950
  type: "button"
941
- }, [l($, {
951
+ }, [l(x, {
942
952
  name: "image"
943
953
  }, null), n?.value && l("div", {
944
954
  class: `${a}-toolbar-item-name`
945
955
  }, [t.value.toolbarTips?.image])])]
946
956
  }), l(No, {
947
957
  clipVisible: c.value,
948
- onCancel: () => {
949
- c.value = !1;
950
- },
951
- onOk: (b) => {
952
- b && v("image", {
953
- desc: b.desc,
954
- url: b.url,
955
- transform: !0
956
- }), c.value = !1;
957
- }
958
+ onCancel: f,
959
+ onOk: g
958
960
  }, null)]);
959
961
  }
960
- }), Do = /* @__PURE__ */ C({
962
+ }), Do = /* @__PURE__ */ y({
961
963
  name: "ToolbarItalic",
962
964
  setup() {
963
965
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -966,49 +968,49 @@ $$`, "title")
966
968
  title: t.value.toolbarTips?.italic,
967
969
  disabled: o?.value,
968
970
  onClick: () => {
969
- g.emit(e, y, "italic");
971
+ h.emit(e, w, "italic");
970
972
  },
971
973
  type: "button"
972
- }, [l($, {
974
+ }, [l(x, {
973
975
  name: "italic"
974
976
  }, null), n?.value && l("div", {
975
977
  class: `${a}-toolbar-item-name`
976
978
  }, [t.value.toolbarTips?.italic])]);
977
979
  }
978
- }), Mo = /* @__PURE__ */ C({
980
+ }), Mo = /* @__PURE__ */ y({
979
981
  name: "ToolbarKatex",
980
982
  setup() {
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 || g.emit(e, y, u);
983
- };
984
- return () => l(J, {
983
+ const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = (v) => {
984
+ o?.value || h.emit(e, w, v);
985
+ }, d = (v) => {
986
+ s.value = v;
987
+ }, u = P(() => l("ul", {
988
+ class: `${a}-menu`,
989
+ onClick: () => {
990
+ s.value = !1;
991
+ },
992
+ role: "menu"
993
+ }, [l("li", {
994
+ class: `${a}-menu-item ${a}-menu-item-katex`,
995
+ onClick: () => {
996
+ c("katexInline");
997
+ },
998
+ role: "menuitem",
999
+ tabindex: "0"
1000
+ }, [t.value.katex?.inline]), l("li", {
1001
+ class: `${a}-menu-item ${a}-menu-item-katex`,
1002
+ onClick: () => {
1003
+ c("katexBlock");
1004
+ },
1005
+ role: "menuitem",
1006
+ tabindex: "0"
1007
+ }, [t.value.katex?.block])]));
1008
+ return () => l(te, {
985
1009
  relative: `#${i}`,
986
1010
  visible: s.value,
987
- onChange: (u) => {
988
- s.value = u;
989
- },
1011
+ onChange: d,
990
1012
  disabled: o?.value,
991
- overlay: l("ul", {
992
- class: `${a}-menu`,
993
- onClick: () => {
994
- s.value = !1;
995
- },
996
- role: "menu"
997
- }, [l("li", {
998
- class: `${a}-menu-item ${a}-menu-item-katex`,
999
- onClick: () => {
1000
- c("katexInline");
1001
- },
1002
- role: "menuitem",
1003
- tabindex: "0"
1004
- }, [t.value.katex?.inline]), l("li", {
1005
- class: `${a}-menu-item ${a}-menu-item-katex`,
1006
- onClick: () => {
1007
- c("katexBlock");
1008
- },
1009
- role: "menuitem",
1010
- tabindex: "0"
1011
- }, [t.value.katex?.block])]),
1013
+ overlay: u.value,
1012
1014
  key: "bar-katex"
1013
1015
  }, {
1014
1016
  default: () => [l("button", {
@@ -1016,14 +1018,14 @@ $$`, "title")
1016
1018
  title: t.value.toolbarTips?.katex,
1017
1019
  disabled: o?.value,
1018
1020
  type: "button"
1019
- }, [l($, {
1021
+ }, [l(x, {
1020
1022
  name: "formula"
1021
1023
  }, null), n?.value && l("div", {
1022
1024
  class: `${a}-toolbar-item-name`
1023
1025
  }, [t.value.toolbarTips?.katex])])]
1024
1026
  });
1025
1027
  }
1026
- }), Ro = /* @__PURE__ */ C({
1028
+ }), Ro = /* @__PURE__ */ y({
1027
1029
  name: "ToolbarLink",
1028
1030
  setup() {
1029
1031
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1032,91 +1034,91 @@ $$`, "title")
1032
1034
  title: t.value.toolbarTips?.link,
1033
1035
  disabled: o?.value,
1034
1036
  onClick: () => {
1035
- g.emit(e, y, "link");
1037
+ h.emit(e, w, "link");
1036
1038
  },
1037
1039
  type: "button"
1038
- }, [l($, {
1040
+ }, [l(x, {
1039
1041
  name: "link"
1040
1042
  }, null), n?.value && l("div", {
1041
1043
  class: `${a}-toolbar-item-name`
1042
1044
  }, [t.value.toolbarTips?.link])]);
1043
1045
  }
1044
- }), Fo = /* @__PURE__ */ C({
1046
+ }), Fo = /* @__PURE__ */ y({
1045
1047
  name: "ToolbarMermaid",
1046
1048
  setup() {
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 || g.emit(e, y, u);
1049
- };
1050
- return () => l(J, {
1049
+ const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = (v) => {
1050
+ o?.value || h.emit(e, w, v);
1051
+ }, d = (v) => {
1052
+ s.value = v;
1053
+ }, u = P(() => l("ul", {
1054
+ class: `${a}-menu`,
1055
+ onClick: () => {
1056
+ s.value = !1;
1057
+ },
1058
+ role: "menu"
1059
+ }, [l("li", {
1060
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1061
+ onClick: () => {
1062
+ c("flow");
1063
+ },
1064
+ role: "menuitem",
1065
+ tabindex: "0"
1066
+ }, [t.value.mermaid?.flow]), l("li", {
1067
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1068
+ onClick: () => {
1069
+ c("sequence");
1070
+ },
1071
+ role: "menuitem",
1072
+ tabindex: "0"
1073
+ }, [t.value.mermaid?.sequence]), l("li", {
1074
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1075
+ onClick: () => {
1076
+ c("gantt");
1077
+ },
1078
+ role: "menuitem",
1079
+ tabindex: "0"
1080
+ }, [t.value.mermaid?.gantt]), l("li", {
1081
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1082
+ onClick: () => {
1083
+ c("class");
1084
+ },
1085
+ role: "menuitem",
1086
+ tabindex: "0"
1087
+ }, [t.value.mermaid?.class]), l("li", {
1088
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1089
+ onClick: () => {
1090
+ c("state");
1091
+ },
1092
+ role: "menuitem",
1093
+ tabindex: "0"
1094
+ }, [t.value.mermaid?.state]), l("li", {
1095
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1096
+ onClick: () => {
1097
+ c("pie");
1098
+ },
1099
+ role: "menuitem",
1100
+ tabindex: "0"
1101
+ }, [t.value.mermaid?.pie]), l("li", {
1102
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1103
+ onClick: () => {
1104
+ c("relationship");
1105
+ },
1106
+ role: "menuitem",
1107
+ tabindex: "0"
1108
+ }, [t.value.mermaid?.relationship]), l("li", {
1109
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
1110
+ onClick: () => {
1111
+ c("journey");
1112
+ },
1113
+ role: "menuitem",
1114
+ tabindex: "0"
1115
+ }, [t.value.mermaid?.journey])]));
1116
+ return () => l(te, {
1051
1117
  relative: `#${i}`,
1052
1118
  visible: s.value,
1053
- onChange: (u) => {
1054
- s.value = u;
1055
- },
1119
+ onChange: d,
1056
1120
  disabled: o?.value,
1057
- overlay: l("ul", {
1058
- class: `${a}-menu`,
1059
- onClick: () => {
1060
- s.value = !1;
1061
- },
1062
- role: "menu"
1063
- }, [l("li", {
1064
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1065
- onClick: () => {
1066
- c("flow");
1067
- },
1068
- role: "menuitem",
1069
- tabindex: "0"
1070
- }, [t.value.mermaid?.flow]), l("li", {
1071
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1072
- onClick: () => {
1073
- c("sequence");
1074
- },
1075
- role: "menuitem",
1076
- tabindex: "0"
1077
- }, [t.value.mermaid?.sequence]), l("li", {
1078
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1079
- onClick: () => {
1080
- c("gantt");
1081
- },
1082
- role: "menuitem",
1083
- tabindex: "0"
1084
- }, [t.value.mermaid?.gantt]), l("li", {
1085
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1086
- onClick: () => {
1087
- c("class");
1088
- },
1089
- role: "menuitem",
1090
- tabindex: "0"
1091
- }, [t.value.mermaid?.class]), l("li", {
1092
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1093
- onClick: () => {
1094
- c("state");
1095
- },
1096
- role: "menuitem",
1097
- tabindex: "0"
1098
- }, [t.value.mermaid?.state]), l("li", {
1099
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1100
- onClick: () => {
1101
- c("pie");
1102
- },
1103
- role: "menuitem",
1104
- tabindex: "0"
1105
- }, [t.value.mermaid?.pie]), l("li", {
1106
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1107
- onClick: () => {
1108
- c("relationship");
1109
- },
1110
- role: "menuitem",
1111
- tabindex: "0"
1112
- }, [t.value.mermaid?.relationship]), l("li", {
1113
- class: `${a}-menu-item ${a}-menu-item-mermaid`,
1114
- onClick: () => {
1115
- c("journey");
1116
- },
1117
- role: "menuitem",
1118
- tabindex: "0"
1119
- }, [t.value.mermaid?.journey])]),
1121
+ overlay: u.value,
1120
1122
  key: "bar-mermaid"
1121
1123
  }, {
1122
1124
  default: () => [l("button", {
@@ -1124,14 +1126,14 @@ $$`, "title")
1124
1126
  title: t.value.toolbarTips?.mermaid,
1125
1127
  disabled: o?.value,
1126
1128
  type: "button"
1127
- }, [l($, {
1129
+ }, [l(x, {
1128
1130
  name: "mermaid"
1129
1131
  }, null), n?.value && l("div", {
1130
1132
  class: `${a}-toolbar-item-name`
1131
1133
  }, [t.value.toolbarTips?.mermaid])])]
1132
1134
  });
1133
1135
  }
1134
- }), Bo = /* @__PURE__ */ C({
1136
+ }), Bo = /* @__PURE__ */ y({
1135
1137
  name: "ToolbarNext",
1136
1138
  setup() {
1137
1139
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1140,16 +1142,16 @@ $$`, "title")
1140
1142
  title: t.value.toolbarTips?.next,
1141
1143
  disabled: o?.value,
1142
1144
  onClick: () => {
1143
- g.emit(e, Ue);
1145
+ h.emit(e, Ue);
1144
1146
  },
1145
1147
  type: "button"
1146
- }, [l($, {
1148
+ }, [l(x, {
1147
1149
  name: "next"
1148
1150
  }, null), n?.value && l("div", {
1149
1151
  class: `${a}-toolbar-item-name`
1150
1152
  }, [t.value.toolbarTips?.next])]);
1151
1153
  }
1152
- }), Po = /* @__PURE__ */ C({
1154
+ }), Po = /* @__PURE__ */ y({
1153
1155
  name: "ToolbarOrderedList",
1154
1156
  setup() {
1155
1157
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1158,16 +1160,16 @@ $$`, "title")
1158
1160
  title: t.value.toolbarTips?.orderedList,
1159
1161
  disabled: o?.value,
1160
1162
  onClick: () => {
1161
- g.emit(e, y, "orderedList");
1163
+ h.emit(e, w, "orderedList");
1162
1164
  },
1163
1165
  type: "button"
1164
- }, [l($, {
1166
+ }, [l(x, {
1165
1167
  name: "ordered-list"
1166
1168
  }, null), n?.value && l("div", {
1167
1169
  class: `${a}-toolbar-item-name`
1168
1170
  }, [t.value.toolbarTips?.orderedList])]);
1169
1171
  }
1170
- }), Ho = /* @__PURE__ */ C({
1172
+ }), Ho = /* @__PURE__ */ y({
1171
1173
  name: "ToolbarPageFullscreen",
1172
1174
  setup() {
1173
1175
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1179,13 +1181,13 @@ $$`, "title")
1179
1181
  i("pageFullscreen");
1180
1182
  },
1181
1183
  type: "button"
1182
- }, [l($, {
1184
+ }, [l(x, {
1183
1185
  name: n.value.pageFullscreen ? "minimize" : "maximize"
1184
1186
  }, null), o?.value && l("div", {
1185
1187
  class: `${a}-toolbar-item-name`
1186
1188
  }, [e.value.toolbarTips?.pageFullscreen])]);
1187
1189
  }
1188
- }), Oo = /* @__PURE__ */ C({
1190
+ }), Oo = /* @__PURE__ */ y({
1189
1191
  name: "ToolbarPrettier",
1190
1192
  setup() {
1191
1193
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1194,16 +1196,16 @@ $$`, "title")
1194
1196
  title: t.value.toolbarTips?.prettier,
1195
1197
  disabled: o?.value,
1196
1198
  onClick: () => {
1197
- g.emit(e, y, "prettier");
1199
+ h.emit(e, w, "prettier");
1198
1200
  },
1199
1201
  type: "button"
1200
- }, [l($, {
1202
+ }, [l(x, {
1201
1203
  name: "prettier"
1202
1204
  }, null), n?.value && l("div", {
1203
1205
  class: `${a}-toolbar-item-name`
1204
1206
  }, [t.value.toolbarTips?.prettier])]);
1205
1207
  }
1206
- }), Vo = /* @__PURE__ */ C({
1208
+ }), Vo = /* @__PURE__ */ y({
1207
1209
  name: "ToolbarPreview",
1208
1210
  setup() {
1209
1211
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1215,13 +1217,13 @@ $$`, "title")
1215
1217
  i("preview");
1216
1218
  },
1217
1219
  type: "button"
1218
- }, [l($, {
1220
+ }, [l(x, {
1219
1221
  name: "preview"
1220
1222
  }, null), o?.value && l("div", {
1221
1223
  class: `${a}-toolbar-item-name`
1222
1224
  }, [e.value.toolbarTips?.preview])]);
1223
1225
  }
1224
- }), Wo = /* @__PURE__ */ C({
1226
+ }), Wo = /* @__PURE__ */ y({
1225
1227
  name: "ToolbarPreviewOnly",
1226
1228
  setup() {
1227
1229
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1233,13 +1235,13 @@ $$`, "title")
1233
1235
  i("previewOnly");
1234
1236
  },
1235
1237
  type: "button"
1236
- }, [l($, {
1238
+ }, [l(x, {
1237
1239
  name: "preview-only"
1238
1240
  }, null), o?.value && l("div", {
1239
1241
  class: `${a}-toolbar-item-name`
1240
1242
  }, [e.value.toolbarTips?.previewOnly])]);
1241
1243
  }
1242
- }), _o = /* @__PURE__ */ C({
1244
+ }), _o = /* @__PURE__ */ y({
1243
1245
  name: "ToolbarQuote",
1244
1246
  setup() {
1245
1247
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1248,16 +1250,16 @@ $$`, "title")
1248
1250
  title: t.value.toolbarTips?.quote,
1249
1251
  disabled: o?.value,
1250
1252
  onClick: () => {
1251
- g.emit(e, y, "quote");
1253
+ h.emit(e, w, "quote");
1252
1254
  },
1253
1255
  type: "button"
1254
- }, [l($, {
1256
+ }, [l(x, {
1255
1257
  name: "quote"
1256
1258
  }, null), n?.value && l("div", {
1257
1259
  class: `${a}-toolbar-item-name`
1258
1260
  }, [t.value.toolbarTips?.quote])]);
1259
1261
  }
1260
- }), zo = /* @__PURE__ */ C({
1262
+ }), zo = /* @__PURE__ */ y({
1261
1263
  name: "ToolbarRevoke",
1262
1264
  setup() {
1263
1265
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1266,16 +1268,16 @@ $$`, "title")
1266
1268
  title: t.value.toolbarTips?.revoke,
1267
1269
  disabled: o?.value,
1268
1270
  onClick: () => {
1269
- g.emit(e, Ke);
1271
+ h.emit(e, Ke);
1270
1272
  },
1271
1273
  type: "button"
1272
- }, [l($, {
1274
+ }, [l(x, {
1273
1275
  name: "revoke"
1274
1276
  }, null), n?.value && l("div", {
1275
1277
  class: `${a}-toolbar-item-name`
1276
1278
  }, [t.value.toolbarTips?.revoke])]);
1277
1279
  }
1278
- }), qo = /* @__PURE__ */ C({
1280
+ }), qo = /* @__PURE__ */ y({
1279
1281
  name: "ToolbarSave",
1280
1282
  setup() {
1281
1283
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1284,16 +1286,16 @@ $$`, "title")
1284
1286
  title: t.value.toolbarTips?.save,
1285
1287
  disabled: o?.value,
1286
1288
  onClick: () => {
1287
- g.emit(e, Ge);
1289
+ h.emit(e, Ge);
1288
1290
  },
1289
1291
  type: "button"
1290
- }, [l($, {
1292
+ }, [l(x, {
1291
1293
  name: "save"
1292
1294
  }, null), n?.value && l("div", {
1293
1295
  class: `${a}-toolbar-item-name`
1294
1296
  }, [t.value.toolbarTips?.save])]);
1295
1297
  }
1296
- }), Uo = /* @__PURE__ */ C({
1298
+ }), Uo = /* @__PURE__ */ y({
1297
1299
  name: "ToolbarStrikeThrough",
1298
1300
  setup() {
1299
1301
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1302,16 +1304,16 @@ $$`, "title")
1302
1304
  title: t.value.toolbarTips?.strikeThrough,
1303
1305
  disabled: o?.value,
1304
1306
  onClick: () => {
1305
- g.emit(e, y, "strikeThrough");
1307
+ h.emit(e, w, "strikeThrough");
1306
1308
  },
1307
1309
  type: "button"
1308
- }, [l($, {
1310
+ }, [l(x, {
1309
1311
  name: "strike-through"
1310
1312
  }, null), n?.value && l("div", {
1311
1313
  class: `${a}-toolbar-item-name`
1312
1314
  }, [t.value.toolbarTips?.strikeThrough])]);
1313
1315
  }
1314
- }), Ko = /* @__PURE__ */ C({
1316
+ }), Ko = /* @__PURE__ */ y({
1315
1317
  name: "ToolbarSub",
1316
1318
  setup() {
1317
1319
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1320,16 +1322,16 @@ $$`, "title")
1320
1322
  title: t.value.toolbarTips?.sub,
1321
1323
  disabled: o?.value,
1322
1324
  onClick: () => {
1323
- g.emit(e, y, "sub");
1325
+ h.emit(e, w, "sub");
1324
1326
  },
1325
1327
  type: "button"
1326
- }, [l($, {
1328
+ }, [l(x, {
1327
1329
  name: "sub"
1328
1330
  }, null), n?.value && l("div", {
1329
1331
  class: `${a}-toolbar-item-name`
1330
1332
  }, [t.value.toolbarTips?.sub])]);
1331
1333
  }
1332
- }), Go = /* @__PURE__ */ C({
1334
+ }), Go = /* @__PURE__ */ y({
1333
1335
  name: "ToolbarSup",
1334
1336
  setup() {
1335
1337
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1338,10 +1340,10 @@ $$`, "title")
1338
1340
  title: t.value.toolbarTips?.sup,
1339
1341
  disabled: o?.value,
1340
1342
  onClick: () => {
1341
- g.emit(e, y, "sup");
1343
+ h.emit(e, w, "sup");
1342
1344
  },
1343
1345
  type: "button"
1344
- }, [l($, {
1346
+ }, [l(x, {
1345
1347
  name: "sup"
1346
1348
  }, null), n?.value && l("div", {
1347
1349
  class: `${a}-toolbar-item-name`
@@ -1357,18 +1359,18 @@ $$`, "title")
1357
1359
  default: () => {
1358
1360
  }
1359
1361
  }
1360
- }, Yo = /* @__PURE__ */ C({
1362
+ }, Yo = /* @__PURE__ */ y({
1361
1363
  name: "TableShape",
1362
1364
  props: jo,
1363
1365
  setup(e) {
1364
- const t = U({
1366
+ const t = Y({
1365
1367
  x: -1,
1366
1368
  y: -1
1367
- }), o = K(() => JSON.stringify(e.tableShape)), n = () => {
1369
+ }), o = P(() => JSON.stringify(e.tableShape)), n = () => {
1368
1370
  const s = [...JSON.parse(o.value)];
1369
1371
  return (!s[2] || s[2] < s[0]) && (s[2] = s[0]), (!s[3] || s[3] < s[3]) && (s[3] = s[1]), s;
1370
- }, i = x(n());
1371
- return E([o], () => {
1372
+ }, i = E(n());
1373
+ return N([o], () => {
1372
1374
  i.value = n();
1373
1375
  }), () => l("div", {
1374
1376
  class: `${a}-table-shape`,
@@ -1378,53 +1380,53 @@ $$`, "title")
1378
1380
  }, [new Array(i.value[1]).fill("").map((s, c) => l("div", {
1379
1381
  class: `${a}-table-shape-row`,
1380
1382
  key: `table-shape-row-${c}`
1381
- }, [new Array(i.value[0]).fill("").map((u, m) => l("div", {
1383
+ }, [new Array(i.value[0]).fill("").map((d, u) => l("div", {
1382
1384
  class: `${a}-table-shape-col`,
1383
- key: `table-shape-col-${m}`,
1385
+ key: `table-shape-col-${u}`,
1384
1386
  onMouseenter: () => {
1385
- t.x = c, t.y = m, m + 1 === i.value[0] && m + 1 < i.value[2] ? i.value[0]++ : m + 2 < i.value[0] && i.value[0] > e.tableShape[0] && i.value[0]--, c + 1 === i.value[1] && c + 1 < i.value[3] ? i.value[1]++ : c + 2 < i.value[1] && i.value[1] > e.tableShape[1] && i.value[1]--;
1387
+ t.x = c, t.y = u, u + 1 === i.value[0] && u + 1 < i.value[2] ? i.value[0]++ : u + 2 < i.value[0] && i.value[0] > e.tableShape[0] && i.value[0]--, c + 1 === i.value[1] && c + 1 < i.value[3] ? i.value[1]++ : c + 2 < i.value[1] && i.value[1] > e.tableShape[1] && i.value[1]--;
1386
1388
  },
1387
1389
  onClick: () => {
1388
1390
  e.onSelected(t);
1389
1391
  }
1390
1392
  }, [l("div", {
1391
- class: [`${a}-table-shape-col-default`, c <= t.x && m <= t.y && `${a}-table-shape-col-include`]
1393
+ class: [`${a}-table-shape-col-default`, c <= t.x && u <= t.y && `${a}-table-shape-col-include`]
1392
1394
  }, null)]))]))]);
1393
1395
  }
1394
- }), Zo = /* @__PURE__ */ C({
1396
+ }), Zo = /* @__PURE__ */ y({
1395
1397
  name: "ToolbarTable",
1396
1398
  setup() {
1397
- const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c = x(!1);
1398
- return () => l(J, {
1399
+ const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c = E(!1), d = (m) => {
1400
+ c.value = m;
1401
+ }, u = (m) => {
1402
+ o?.value || h.emit(e, w, "table", {
1403
+ selectedShape: m
1404
+ });
1405
+ }, v = P(() => l(Yo, {
1406
+ tableShape: i.value,
1407
+ onSelected: u
1408
+ }, null));
1409
+ return () => l(te, {
1399
1410
  relative: `#${s}`,
1400
1411
  visible: c.value,
1401
- onChange: (u) => {
1402
- c.value = u;
1403
- },
1412
+ onChange: d,
1404
1413
  disabled: o?.value,
1405
1414
  key: "bar-table",
1406
- overlay: l(Yo, {
1407
- tableShape: i.value,
1408
- onSelected: (u) => {
1409
- o?.value || g.emit(e, y, "table", {
1410
- selectedShape: u
1411
- });
1412
- }
1413
- }, null)
1415
+ overlay: v.value
1414
1416
  }, {
1415
1417
  default: () => [l("button", {
1416
1418
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
1417
1419
  title: t.value.toolbarTips?.table,
1418
1420
  disabled: o?.value,
1419
1421
  type: "button"
1420
- }, [l($, {
1422
+ }, [l(x, {
1421
1423
  name: "table"
1422
1424
  }, null), n?.value && l("div", {
1423
1425
  class: `${a}-toolbar-item-name`
1424
1426
  }, [t.value.toolbarTips?.table])])]
1425
1427
  });
1426
1428
  }
1427
- }), Xo = /* @__PURE__ */ C({
1429
+ }), Xo = /* @__PURE__ */ y({
1428
1430
  name: "ToolbarTask",
1429
1431
  setup() {
1430
1432
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1433,91 +1435,91 @@ $$`, "title")
1433
1435
  title: t.value.toolbarTips?.task,
1434
1436
  disabled: o?.value,
1435
1437
  onClick: () => {
1436
- g.emit(e, y, "task");
1438
+ h.emit(e, w, "task");
1437
1439
  },
1438
1440
  type: "button"
1439
- }, [l($, {
1441
+ }, [l(x, {
1440
1442
  name: "task"
1441
1443
  }, null), n?.value && l("div", {
1442
1444
  class: `${a}-toolbar-item-name`
1443
1445
  }, [t.value.toolbarTips?.task])]);
1444
1446
  }
1445
- }), Jo = /* @__PURE__ */ C({
1447
+ }), Jo = /* @__PURE__ */ y({
1446
1448
  name: "ToolbarTitle",
1447
1449
  setup() {
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 || g.emit(e, y, u);
1450
- };
1451
- return () => l(J, {
1450
+ const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = E(!1), c = (v) => {
1451
+ o?.value || h.emit(e, w, v);
1452
+ }, d = (v) => {
1453
+ s.value = v;
1454
+ }, u = P(() => l("ul", {
1455
+ class: `${a}-menu`,
1456
+ onClick: () => {
1457
+ s.value = !1;
1458
+ },
1459
+ role: "menu"
1460
+ }, [l("li", {
1461
+ class: `${a}-menu-item ${a}-menu-item-title`,
1462
+ onClick: () => {
1463
+ c("h1");
1464
+ },
1465
+ role: "menuitem",
1466
+ tabindex: "0"
1467
+ }, [t.value.titleItem?.h1]), l("li", {
1468
+ class: `${a}-menu-item ${a}-menu-item-title`,
1469
+ onClick: () => {
1470
+ c("h2");
1471
+ },
1472
+ role: "menuitem",
1473
+ tabindex: "0"
1474
+ }, [t.value.titleItem?.h2]), l("li", {
1475
+ class: `${a}-menu-item ${a}-menu-item-title`,
1476
+ onClick: () => {
1477
+ c("h3");
1478
+ },
1479
+ role: "menuitem",
1480
+ tabindex: "0"
1481
+ }, [t.value.titleItem?.h3]), l("li", {
1482
+ class: `${a}-menu-item ${a}-menu-item-title`,
1483
+ onClick: () => {
1484
+ c("h4");
1485
+ },
1486
+ role: "menuitem",
1487
+ tabindex: "0"
1488
+ }, [t.value.titleItem?.h4]), l("li", {
1489
+ class: `${a}-menu-item ${a}-menu-item-title`,
1490
+ onClick: () => {
1491
+ c("h5");
1492
+ },
1493
+ role: "menuitem",
1494
+ tabindex: "0"
1495
+ }, [t.value.titleItem?.h5]), l("li", {
1496
+ class: `${a}-menu-item ${a}-menu-item-title`,
1497
+ onClick: () => {
1498
+ c("h6");
1499
+ },
1500
+ role: "menuitem",
1501
+ tabindex: "0"
1502
+ }, [t.value.titleItem?.h6])]));
1503
+ return () => l(te, {
1452
1504
  relative: `#${i}`,
1453
1505
  visible: s.value,
1454
- onChange: (u) => {
1455
- s.value = u;
1456
- },
1506
+ onChange: d,
1457
1507
  disabled: o?.value,
1458
- overlay: l("ul", {
1459
- class: `${a}-menu`,
1460
- onClick: () => {
1461
- s.value = !1;
1462
- },
1463
- role: "menu"
1464
- }, [l("li", {
1465
- class: `${a}-menu-item ${a}-menu-item-title`,
1466
- onClick: () => {
1467
- c("h1");
1468
- },
1469
- role: "menuitem",
1470
- tabindex: "0"
1471
- }, [t.value.titleItem?.h1]), l("li", {
1472
- class: `${a}-menu-item ${a}-menu-item-title`,
1473
- onClick: () => {
1474
- c("h2");
1475
- },
1476
- role: "menuitem",
1477
- tabindex: "0"
1478
- }, [t.value.titleItem?.h2]), l("li", {
1479
- class: `${a}-menu-item ${a}-menu-item-title`,
1480
- onClick: () => {
1481
- c("h3");
1482
- },
1483
- role: "menuitem",
1484
- tabindex: "0"
1485
- }, [t.value.titleItem?.h3]), l("li", {
1486
- class: `${a}-menu-item ${a}-menu-item-title`,
1487
- onClick: () => {
1488
- c("h4");
1489
- },
1490
- role: "menuitem",
1491
- tabindex: "0"
1492
- }, [t.value.titleItem?.h4]), l("li", {
1493
- class: `${a}-menu-item ${a}-menu-item-title`,
1494
- onClick: () => {
1495
- c("h5");
1496
- },
1497
- role: "menuitem",
1498
- tabindex: "0"
1499
- }, [t.value.titleItem?.h5]), l("li", {
1500
- class: `${a}-menu-item ${a}-menu-item-title`,
1501
- onClick: () => {
1502
- c("h6");
1503
- },
1504
- role: "menuitem",
1505
- tabindex: "0"
1506
- }, [t.value.titleItem?.h6])])
1508
+ overlay: u.value
1507
1509
  }, {
1508
1510
  default: () => [l("button", {
1509
1511
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
1510
1512
  disabled: o?.value,
1511
1513
  title: t.value.toolbarTips?.title,
1512
1514
  type: "button"
1513
- }, [l($, {
1515
+ }, [l(x, {
1514
1516
  name: "title"
1515
1517
  }, null), n?.value && l("div", {
1516
1518
  class: `${a}-toolbar-item-name`
1517
1519
  }, [t.value.toolbarTips?.title])])]
1518
1520
  });
1519
1521
  }
1520
- }), Qo = /* @__PURE__ */ C({
1522
+ }), Qo = /* @__PURE__ */ y({
1521
1523
  name: "ToolbarUnderline",
1522
1524
  setup() {
1523
1525
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1526,16 +1528,16 @@ $$`, "title")
1526
1528
  title: t.value.toolbarTips?.underline,
1527
1529
  disabled: o?.value,
1528
1530
  onClick: () => {
1529
- g.emit(e, y, "underline");
1531
+ h.emit(e, w, "underline");
1530
1532
  },
1531
1533
  type: "button"
1532
- }, [l($, {
1534
+ }, [l(x, {
1533
1535
  name: "underline"
1534
1536
  }, null), n?.value && l("div", {
1535
1537
  class: `${a}-toolbar-item-name`
1536
1538
  }, [t.value.toolbarTips?.underline])]);
1537
1539
  }
1538
- }), el = /* @__PURE__ */ C({
1540
+ }), el = /* @__PURE__ */ y({
1539
1541
  name: "ToolbarUnorderedList",
1540
1542
  setup() {
1541
1543
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1544,10 +1546,10 @@ $$`, "title")
1544
1546
  title: t.value.toolbarTips?.unorderedList,
1545
1547
  disabled: o?.value,
1546
1548
  onClick: () => {
1547
- g.emit(e, y, "unorderedList");
1549
+ h.emit(e, w, "unorderedList");
1548
1550
  },
1549
1551
  type: "button"
1550
- }, [l($, {
1552
+ }, [l(x, {
1551
1553
  name: "unordered-list"
1552
1554
  }, null), n?.value && l("div", {
1553
1555
  class: `${a}-toolbar-item-name`
@@ -1557,47 +1559,47 @@ $$`, "title")
1557
1559
  const e = r("editorId"), t = r("setting"), o = r("updateSetting"), {
1558
1560
  editorExtensions: n,
1559
1561
  editorExtensionsAttrs: i
1560
- } = G;
1562
+ } = Z;
1561
1563
  let s = n.screenfull.instance;
1562
- const c = x(!1), u = (b) => {
1564
+ const c = E(!1), d = (m) => {
1563
1565
  if (!s) {
1564
- g.emit(e, j, {
1566
+ h.emit(e, X, {
1565
1567
  name: "fullscreen",
1566
1568
  message: "fullscreen is undefined"
1567
1569
  });
1568
1570
  return;
1569
1571
  }
1570
- s.isEnabled ? (c.value = !0, (b === void 0 ? !s.isFullscreen : b) ? s.request() : s.exit()) : console.error("browser does not support screenfull!");
1571
- }, m = () => {
1572
+ s.isEnabled ? (c.value = !0, (m === void 0 ? !s.isFullscreen : m) ? s.request() : s.exit()) : console.error("browser does not support screenfull!");
1573
+ }, u = () => {
1572
1574
  s && s.isEnabled && s.on("change", () => {
1573
1575
  (c.value || t.value.fullscreen) && (c.value = !1, o("fullscreen"));
1574
1576
  });
1575
1577
  }, v = () => {
1576
- s = window.screenfull, m();
1578
+ s = window.screenfull, u();
1577
1579
  };
1578
- return _(() => {
1579
- m(), s || Jt("script", {
1580
+ return K(() => {
1581
+ u(), s || Jt("script", {
1580
1582
  ...i.screenfull?.js,
1581
1583
  src: n.screenfull.js,
1582
1584
  id: rt.screenfull,
1583
1585
  onload: v
1584
1586
  }, "screenfull");
1585
- }), _(() => {
1586
- g.on(e, {
1587
+ }), K(() => {
1588
+ h.on(e, {
1587
1589
  name: Kt,
1588
- callback: u
1590
+ callback: d
1589
1591
  });
1590
1592
  }), {
1591
- fullscreenHandler: u
1593
+ fullscreenHandler: d
1592
1594
  };
1593
1595
  };
1594
1596
  let ol = 0;
1595
1597
  const Ze = () => {
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"), v = r("setting"), b = r("defToolbars");
1598
+ const e = r("editorId"), t = r("theme"), o = r("previewTheme"), n = r("language"), i = r("disabled"), s = r("noUploadImg"), c = r("noPrettier"), d = r("codeTheme"), u = r("showToolbarName"), v = r("setting"), m = r("defToolbars");
1597
1599
  return {
1598
- barRender: (f) => {
1599
- if ($t.includes(f))
1600
- switch (f) {
1600
+ barRender: (g) => {
1601
+ if ($t.includes(g))
1602
+ switch (g) {
1601
1603
  case "-":
1602
1604
  return l(po, {
1603
1605
  key: `bar-${ol++}`
@@ -1721,33 +1723,33 @@ const Ze = () => {
1721
1723
  key: "bar-katex"
1722
1724
  }, null);
1723
1725
  }
1724
- else if (b.value instanceof Array) {
1725
- const p = b.value[f];
1726
- return p ? ae(p, {
1726
+ else if (m.value instanceof Array) {
1727
+ const p = m.value[g];
1728
+ return p ? ne(p, {
1727
1729
  theme: p.props?.theme || t.value,
1728
1730
  previewTheme: p.props?.theme || o.value,
1729
1731
  language: p.props?.theme || n.value,
1730
- codeTheme: p.props?.codeTheme || u.value,
1732
+ codeTheme: p.props?.codeTheme || d.value,
1731
1733
  disabled: p.props?.disabled || i.value,
1732
- showToolbarName: p.props?.showToolbarName || m.value,
1733
- insert(I) {
1734
- g.emit(e, y, "universal", {
1735
- generate: I
1734
+ showToolbarName: p.props?.showToolbarName || u.value,
1735
+ insert(S) {
1736
+ h.emit(e, w, "universal", {
1737
+ generate: S
1736
1738
  });
1737
1739
  }
1738
1740
  }) : "";
1739
- } else if (b.value?.children instanceof Array) {
1740
- const p = b.value.children[f];
1741
- return p ? ae(p, {
1741
+ } else if (m.value?.children instanceof Array) {
1742
+ const p = m.value.children[g];
1743
+ return p ? ne(p, {
1742
1744
  theme: p.props?.theme || t.value,
1743
1745
  previewTheme: p.props?.theme || o.value,
1744
1746
  language: p.props?.theme || n.value,
1745
- codeTheme: p.props?.codeTheme || u.value,
1747
+ codeTheme: p.props?.codeTheme || d.value,
1746
1748
  disabled: p.props?.disabled || i.value,
1747
- showToolbarName: p.props?.showToolbarName || m.value,
1748
- insert(I) {
1749
- g.emit(e, y, "universal", {
1750
- generate: I
1749
+ showToolbarName: p.props?.showToolbarName || u.value,
1750
+ insert(S) {
1751
+ h.emit(e, w, "universal", {
1752
+ generate: S
1751
1753
  });
1752
1754
  }
1753
1755
  }) : "";
@@ -1755,7 +1757,7 @@ const Ze = () => {
1755
1757
  return "";
1756
1758
  }
1757
1759
  };
1758
- }, ll = /* @__PURE__ */ C({
1760
+ }, ll = /* @__PURE__ */ y({
1759
1761
  name: "FloatingToolbar",
1760
1762
  setup() {
1761
1763
  const e = r("floatingToolbars"), {
@@ -1765,7 +1767,7 @@ const Ze = () => {
1765
1767
  class: `${a}-floating-toolbar`
1766
1768
  }, [e.value.map((o) => t(o))]);
1767
1769
  }
1768
- }), ve = ne.define(), al = qe.define({
1770
+ }), ve = re.define(), al = qe.define({
1769
1771
  create() {
1770
1772
  return null;
1771
1773
  },
@@ -1775,36 +1777,43 @@ const Ze = () => {
1775
1777
  },
1776
1778
  provide: (e) => Vt.from(e)
1777
1779
  }), nl = (e) => {
1778
- const t = (n, i) => {
1779
- n.dispatch({
1780
+ let t = null;
1781
+ const o = (s, c) => {
1782
+ t && t.kind === c.kind && t.pos === c.pos || (t = c, s.dispatch({
1780
1783
  effects: ve.of({
1781
- pos: i,
1784
+ pos: c.pos,
1782
1785
  above: !0,
1783
1786
  arrow: !0,
1784
1787
  create: () => {
1785
- const s = document.createElement("div"), c = document.createElement("div");
1786
- s.appendChild(c);
1787
- const u = Ct(ll);
1788
- return e.privide(u), u.mount(s), { dom: s, destroy: () => u.unmount() };
1788
+ const d = document.createElement("div"), u = `${a}-floating-toolbar-container`;
1789
+ d.classList.add(u), d.dataset.state = "hidden", requestAnimationFrame(() => {
1790
+ d.dataset.state = "visible";
1791
+ });
1792
+ const v = document.createElement("div");
1793
+ d.appendChild(v);
1794
+ const m = Ct(ll);
1795
+ return e.privide(m), m.mount(d), { dom: d, destroy: () => m.unmount() };
1789
1796
  }
1790
1797
  })
1791
- });
1792
- }, o = R.updateListener.of((n) => {
1793
- if (n.selectionSet || n.docChanged) {
1794
- const i = n.state, s = i.selection.main;
1795
- if (!s.empty)
1796
- t(n.view, s.from);
1798
+ }));
1799
+ }, n = (s) => {
1800
+ t && (t = null, s.dispatch({ effects: ve.of(null) }));
1801
+ }, i = B.updateListener.of((s) => {
1802
+ if (s.selectionSet || s.docChanged) {
1803
+ const c = s.state, d = c.selection.main;
1804
+ if (!d.empty)
1805
+ o(s.view, { kind: "selection", pos: d.anchor });
1797
1806
  else {
1798
- const c = s.head, u = i.doc.lineAt(c);
1799
- /^\s*$/.test(u.text) ? t(n.view, c) : n.view.dispatch({ effects: ve.of(null) });
1807
+ const u = d.head, v = c.doc.lineAt(u);
1808
+ /^\s*$/.test(v.text) ? o(s.view, { kind: "emptyLine", pos: u }) : n(s.view);
1800
1809
  }
1801
1810
  }
1802
1811
  });
1803
- return [al, o];
1804
- }, rl = "#e5c07b", Ee = "var(--md-color)", sl = "#56b6c2", il = "#fff", Z = "#3f4a54", Le = "#2d8cf0", cl = "#2d8cf0", ul = "#3f4a54", Ne = "#d19a66", dl = "#c678dd", ml = "#f6f6f6", bl = "#ceedfa33", Ae = "var(--md-bk-color)", ue = "var(--md-bk-color)", vl = "#bad5fa", De = "#3f4a54", gl = R.theme(
1812
+ return [al, i];
1813
+ }, rl = "#e5c07b", Ee = "var(--md-color)", sl = "#56b6c2", il = "#fff", Q = "#3f4a54", Le = "#2d8cf0", cl = "#2d8cf0", ul = "#3f4a54", Ne = "#d19a66", dl = "#c678dd", ml = "#f6f6f6", bl = "#ceedfa33", Ae = "var(--md-bk-color)", ue = "var(--md-bk-color)", vl = "#bad5fa", De = "#3f4a54", gl = B.theme(
1805
1814
  {
1806
1815
  "&": {
1807
- color: Z,
1816
+ color: Q,
1808
1817
  backgroundColor: Ae
1809
1818
  },
1810
1819
  ".cm-content": {
@@ -1812,7 +1821,7 @@ const Ze = () => {
1812
1821
  },
1813
1822
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: De },
1814
1823
  "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: vl },
1815
- ".cm-panels": { backgroundColor: ml, color: Z },
1824
+ ".cm-panels": { backgroundColor: ml, color: Q },
1816
1825
  ".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
1817
1826
  ".cm-panels.cm-panels-bottom": { borderTop: "1px solid var(--md-border-color)" },
1818
1827
  ".cm-searchMatch": {
@@ -1829,7 +1838,7 @@ const Ze = () => {
1829
1838
  },
1830
1839
  ".cm-gutters": {
1831
1840
  backgroundColor: Ae,
1832
- color: Z,
1841
+ color: Q,
1833
1842
  borderRight: "1px solid",
1834
1843
  borderColor: "var(--md-border-color)"
1835
1844
  },
@@ -1856,58 +1865,58 @@ const Ze = () => {
1856
1865
  },
1857
1866
  ".cm-tooltip-autocomplete": {
1858
1867
  "& > ul > li[aria-selected]": {
1859
- color: Z
1868
+ color: Q
1860
1869
  }
1861
1870
  }
1862
1871
  }
1863
1872
  // { dark: true }
1864
- ), fl = Ye.define([
1865
- { tag: d.keyword, color: dl },
1866
- { tag: [d.name, d.deleted, d.character, d.propertyName, d.macroName], color: Ee },
1867
- { tag: [d.function(d.variableName), d.labelName], color: cl },
1868
- { tag: [d.color, d.constant(d.name), d.standard(d.name)], color: Ne },
1869
- { tag: [d.definition(d.name), d.separator], color: Z },
1873
+ ), hl = Ye.define([
1874
+ { tag: b.keyword, color: dl },
1875
+ { tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color: Ee },
1876
+ { tag: [b.function(b.variableName), b.labelName], color: cl },
1877
+ { tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Ne },
1878
+ { tag: [b.definition(b.name), b.separator], color: Q },
1870
1879
  {
1871
1880
  tag: [
1872
- d.typeName,
1873
- d.className,
1874
- d.number,
1875
- d.changed,
1876
- d.annotation,
1877
- d.modifier,
1878
- d.self,
1879
- d.namespace
1881
+ b.typeName,
1882
+ b.className,
1883
+ b.number,
1884
+ b.changed,
1885
+ b.annotation,
1886
+ b.modifier,
1887
+ b.self,
1888
+ b.namespace
1880
1889
  ],
1881
1890
  color: rl
1882
1891
  },
1883
1892
  {
1884
1893
  tag: [
1885
- d.operator,
1886
- d.operatorKeyword,
1887
- d.url,
1888
- d.escape,
1889
- d.regexp,
1890
- d.link,
1891
- d.special(d.string)
1894
+ b.operator,
1895
+ b.operatorKeyword,
1896
+ b.url,
1897
+ b.escape,
1898
+ b.regexp,
1899
+ b.link,
1900
+ b.special(b.string)
1892
1901
  ],
1893
1902
  color: sl
1894
1903
  },
1895
- { tag: [d.meta, d.comment], color: Le },
1896
- { tag: d.strong, fontWeight: "bold" },
1897
- { tag: d.emphasis, fontStyle: "italic" },
1898
- { tag: d.strikethrough, textDecoration: "line-through" },
1899
- { tag: d.link, color: Le, textDecoration: "underline" },
1900
- { tag: d.heading, fontWeight: "bold", color: Ee },
1901
- { tag: [d.atom, d.bool, d.special(d.variableName)], color: Ne },
1902
- { tag: [d.processingInstruction, d.string, d.inserted], color: ul },
1903
- { tag: d.invalid, color: il }
1904
+ { tag: [b.meta, b.comment], color: Le },
1905
+ { tag: b.strong, fontWeight: "bold" },
1906
+ { tag: b.emphasis, fontStyle: "italic" },
1907
+ { tag: b.strikethrough, textDecoration: "line-through" },
1908
+ { tag: b.link, color: Le, textDecoration: "underline" },
1909
+ { tag: b.heading, fontWeight: "bold", color: Ee },
1910
+ { tag: [b.atom, b.bool, b.special(b.variableName)], color: Ne },
1911
+ { tag: [b.processingInstruction, b.string, b.inserted], color: ul },
1912
+ { tag: b.invalid, color: il }
1904
1913
  ]), Me = [
1905
1914
  gl,
1906
- je(fl)
1907
- ], hl = "#e5c07b", Re = "var(--md-color)", pl = "#56b6c2", Tl = "#ffffff", X = "var(--md-color)", Fe = "#e5c07b", wl = "#e5c07b", yl = "var(--md-color)", Be = "#d19a66", Cl = "#c678dd", kl = "#21252b", $l = "#2c313a", Pe = "var(--md-bk-color)", de = "var(--md-bk-color)", xl = "#ceedfa33", He = "#528bff", Sl = R.theme(
1915
+ je(hl)
1916
+ ], fl = "#e5c07b", Re = "var(--md-color)", pl = "#56b6c2", Tl = "#ffffff", ee = "var(--md-color)", Fe = "#e5c07b", wl = "#e5c07b", yl = "var(--md-color)", Be = "#d19a66", Cl = "#c678dd", kl = "#21252b", $l = "#2c313a", Pe = "var(--md-bk-color)", de = "var(--md-bk-color)", xl = "#ceedfa33", He = "#528bff", Sl = B.theme(
1908
1917
  {
1909
1918
  "&": {
1910
- color: X,
1919
+ color: ee,
1911
1920
  backgroundColor: Pe
1912
1921
  },
1913
1922
  ".cm-content": {
@@ -1915,7 +1924,7 @@ const Ze = () => {
1915
1924
  },
1916
1925
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: He },
1917
1926
  "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: xl },
1918
- ".cm-panels": { backgroundColor: kl, color: X },
1927
+ ".cm-panels": { backgroundColor: kl, color: ee },
1919
1928
  ".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
1920
1929
  ".cm-panels.cm-panels-bottom": { borderTop: "1px solid var(--md-border-color)" },
1921
1930
  ".cm-searchMatch": {
@@ -1932,7 +1941,7 @@ const Ze = () => {
1932
1941
  },
1933
1942
  ".cm-gutters": {
1934
1943
  backgroundColor: Pe,
1935
- color: X,
1944
+ color: ee,
1936
1945
  borderRight: "1px solid",
1937
1946
  borderColor: "var(--md-border-color)"
1938
1947
  },
@@ -1959,58 +1968,58 @@ const Ze = () => {
1959
1968
  },
1960
1969
  ".cm-tooltip-autocomplete": {
1961
1970
  "& > ul > li[aria-selected]": {
1962
- color: X
1971
+ color: ee
1963
1972
  }
1964
1973
  }
1965
1974
  },
1966
1975
  { dark: !0 }
1967
1976
  ), Il = Ye.define([
1968
- { tag: d.keyword, color: Cl },
1969
- { tag: [d.name, d.deleted, d.character, d.propertyName, d.macroName], color: Re },
1970
- { tag: [d.function(d.variableName), d.labelName], color: wl },
1971
- { tag: [d.color, d.constant(d.name), d.standard(d.name)], color: Be },
1972
- { tag: [d.definition(d.name), d.separator], color: X },
1977
+ { tag: b.keyword, color: Cl },
1978
+ { tag: [b.name, b.deleted, b.character, b.propertyName, b.macroName], color: Re },
1979
+ { tag: [b.function(b.variableName), b.labelName], color: wl },
1980
+ { tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Be },
1981
+ { tag: [b.definition(b.name), b.separator], color: ee },
1973
1982
  {
1974
1983
  tag: [
1975
- d.typeName,
1976
- d.className,
1977
- d.number,
1978
- d.changed,
1979
- d.annotation,
1980
- d.modifier,
1981
- d.self,
1982
- d.namespace
1984
+ b.typeName,
1985
+ b.className,
1986
+ b.number,
1987
+ b.changed,
1988
+ b.annotation,
1989
+ b.modifier,
1990
+ b.self,
1991
+ b.namespace
1983
1992
  ],
1984
- color: hl
1993
+ color: fl
1985
1994
  },
1986
1995
  {
1987
1996
  tag: [
1988
- d.operator,
1989
- d.operatorKeyword,
1990
- d.url,
1991
- d.escape,
1992
- d.regexp,
1993
- d.link,
1994
- d.special(d.string)
1997
+ b.operator,
1998
+ b.operatorKeyword,
1999
+ b.url,
2000
+ b.escape,
2001
+ b.regexp,
2002
+ b.link,
2003
+ b.special(b.string)
1995
2004
  ],
1996
2005
  color: pl
1997
2006
  },
1998
- { tag: [d.meta, d.comment], color: Fe },
1999
- { tag: d.strong, fontWeight: "bold" },
2000
- { tag: d.emphasis, fontStyle: "italic" },
2001
- { tag: d.strikethrough, textDecoration: "line-through" },
2002
- { tag: d.link, color: Fe, textDecoration: "underline" },
2003
- { tag: d.heading, fontWeight: "bold", color: Re },
2004
- { tag: [d.atom, d.bool, d.special(d.variableName)], color: Be },
2005
- { tag: [d.processingInstruction, d.string, d.inserted], color: yl },
2006
- { tag: d.invalid, color: Tl }
2007
+ { tag: [b.meta, b.comment], color: Fe },
2008
+ { tag: b.strong, fontWeight: "bold" },
2009
+ { tag: b.emphasis, fontStyle: "italic" },
2010
+ { tag: b.strikethrough, textDecoration: "line-through" },
2011
+ { tag: b.link, color: Fe, textDecoration: "underline" },
2012
+ { tag: b.heading, fontWeight: "bold", color: Re },
2013
+ { tag: [b.atom, b.bool, b.special(b.variableName)], color: Be },
2014
+ { tag: [b.processingInstruction, b.string, b.inserted], color: yl },
2015
+ { tag: b.invalid, color: Tl }
2007
2016
  ]), Oe = [
2008
2017
  Sl,
2009
2018
  je(Il)
2010
2019
  ], El = (e, t) => {
2011
2020
  const o = r("editorId"), n = (s) => {
2012
2021
  s instanceof Promise ? s.then((c) => {
2013
- g.emit(o, y, "universal", {
2022
+ h.emit(o, w, "universal", {
2014
2023
  generate() {
2015
2024
  return {
2016
2025
  targetValue: c
@@ -2019,7 +2028,7 @@ const Ze = () => {
2019
2028
  });
2020
2029
  }).catch((c) => {
2021
2030
  console.error(c);
2022
- }) : g.emit(o, y, "universal", {
2031
+ }) : h.emit(o, w, "universal", {
2023
2032
  generate() {
2024
2033
  return {
2025
2034
  targetValue: s
@@ -2031,26 +2040,26 @@ const Ze = () => {
2031
2040
  if (!s.clipboardData)
2032
2041
  return;
2033
2042
  if (s.clipboardData.files.length > 0) {
2034
- const { files: f } = s.clipboardData;
2035
- g.emit(
2043
+ const { files: g } = s.clipboardData;
2044
+ h.emit(
2036
2045
  o,
2037
- fe,
2038
- Array.from(f).filter((p) => /image\/.*/.test(p.type))
2046
+ he,
2047
+ Array.from(g).filter((p) => /image\/.*/.test(p.type))
2039
2048
  ), s.preventDefault();
2040
2049
  return;
2041
2050
  }
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, v = t.value?.view.state.doc.sliceString(m, u) || "", b = /!\[.*\]\(\s*$/.test(v), h = /!\[.*\]\((.*)\s?.*\)/.test(c);
2043
- if (b) {
2044
- const f = e.transformImgUrl(c);
2045
- n(f), s.preventDefault();
2051
+ const c = s.clipboardData.getData("text/plain"), d = t.value?.view.state.selection.main.to || 0, u = t.value?.view.state.doc.lineAt(d).from || 0, v = t.value?.view.state.doc.sliceString(u, d) || "", m = /!\[.*\]\(\s*$/.test(v), f = /!\[.*\]\((.*)\s?.*\)/.test(c);
2052
+ if (m) {
2053
+ const g = e.transformImgUrl(c);
2054
+ n(g), s.preventDefault();
2046
2055
  return;
2047
- } else if (h) {
2048
- const f = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
2049
- f ? Promise.all(
2050
- f.map((p) => e.transformImgUrl(p))
2056
+ } else if (f) {
2057
+ const g = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
2058
+ g ? Promise.all(
2059
+ g.map((p) => e.transformImgUrl(p))
2051
2060
  ).then((p) => {
2052
2061
  n(
2053
- p.reduce((T, I, A) => T.replace(f[A], I), c)
2062
+ p.reduce((k, S, A) => k.replace(g[A], S), c)
2054
2063
  );
2055
2064
  }).catch((p) => {
2056
2065
  console.error(p);
@@ -2058,14 +2067,14 @@ const Ze = () => {
2058
2067
  return;
2059
2068
  }
2060
2069
  if (e.autoDetectCode && s.clipboardData.types.includes("vscode-editor-data")) {
2061
- const f = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
2062
- g.emit(o, y, "code", {
2063
- mode: f.mode,
2070
+ const g = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
2071
+ h.emit(o, w, "code", {
2072
+ mode: g.mode,
2064
2073
  text: s.clipboardData.getData("text/plain")
2065
2074
  }), s.preventDefault();
2066
2075
  return;
2067
2076
  }
2068
- e.maxlength && c.length + e.modelValue.length > e.maxlength && g.emit(o, j, {
2077
+ e.maxlength && c.length + e.modelValue.length > e.maxlength && h.emit(o, X, {
2069
2078
  name: "overlength",
2070
2079
  message: "The input text is too long",
2071
2080
  data: c
@@ -2075,7 +2084,7 @@ const Ze = () => {
2075
2084
  {
2076
2085
  key: "Ctrl-b",
2077
2086
  mac: "Cmd-b",
2078
- run: () => (g.emit(e, y, "bold"), !0)
2087
+ run: () => (h.emit(e, w, "bold"), !0)
2079
2088
  },
2080
2089
  {
2081
2090
  key: "Ctrl-d",
@@ -2086,137 +2095,137 @@ const Ze = () => {
2086
2095
  {
2087
2096
  key: "Ctrl-s",
2088
2097
  mac: "Cmd-s",
2089
- run: (M) => (g.emit(e, Ge, M.state.doc.toString()), !0),
2090
- shift: () => (g.emit(e, y, "strikeThrough"), !0)
2098
+ run: (L) => (h.emit(e, Ge, L.state.doc.toString()), !0),
2099
+ shift: () => (h.emit(e, w, "strikeThrough"), !0)
2091
2100
  },
2092
2101
  {
2093
2102
  key: "Ctrl-u",
2094
2103
  mac: "Cmd-u",
2095
2104
  preventDefault: !0,
2096
- run: () => (g.emit(e, y, "underline"), !0),
2097
- shift: () => (g.emit(e, y, "unorderedList"), !0)
2105
+ run: () => (h.emit(e, w, "underline"), !0),
2106
+ shift: () => (h.emit(e, w, "unorderedList"), !0)
2098
2107
  },
2099
2108
  {
2100
2109
  key: "Ctrl-i",
2101
2110
  mac: "Cmd-i",
2102
2111
  preventDefault: !0,
2103
- run: () => (g.emit(e, y, "italic"), !0),
2104
- shift: () => (g.emit(e, y, "image"), !0)
2112
+ run: () => (h.emit(e, w, "italic"), !0),
2113
+ shift: () => (h.emit(e, w, "image"), !0)
2105
2114
  },
2106
2115
  {
2107
2116
  key: "Ctrl-1",
2108
2117
  mac: "Cmd-1",
2109
- run: () => (g.emit(e, y, "h1"), !0)
2118
+ run: () => (h.emit(e, w, "h1"), !0)
2110
2119
  },
2111
2120
  {
2112
2121
  key: "Ctrl-2",
2113
2122
  mac: "Cmd-2",
2114
- run: () => (g.emit(e, y, "h2"), !0)
2123
+ run: () => (h.emit(e, w, "h2"), !0)
2115
2124
  },
2116
2125
  {
2117
2126
  key: "Ctrl-3",
2118
2127
  mac: "Cmd-3",
2119
- run: () => (g.emit(e, y, "h3"), !0)
2128
+ run: () => (h.emit(e, w, "h3"), !0)
2120
2129
  },
2121
2130
  {
2122
2131
  key: "Ctrl-4",
2123
2132
  mac: "Cmd-4",
2124
- run: () => (g.emit(e, y, "h4"), !0)
2133
+ run: () => (h.emit(e, w, "h4"), !0)
2125
2134
  },
2126
2135
  {
2127
2136
  key: "Ctrl-5",
2128
2137
  mac: "Cmd-5",
2129
- run: () => (g.emit(e, y, "h5"), !0)
2138
+ run: () => (h.emit(e, w, "h5"), !0)
2130
2139
  },
2131
2140
  {
2132
2141
  key: "Ctrl-6",
2133
2142
  mac: "Cmd-6",
2134
- run: () => (g.emit(e, y, "h6"), !0)
2143
+ run: () => (h.emit(e, w, "h6"), !0)
2135
2144
  },
2136
2145
  {
2137
2146
  key: "Ctrl-ArrowUp",
2138
2147
  mac: "Cmd-ArrowUp",
2139
- run: () => (g.emit(e, y, "sup"), !0)
2148
+ run: () => (h.emit(e, w, "sup"), !0)
2140
2149
  },
2141
2150
  {
2142
2151
  key: "Ctrl-ArrowDown",
2143
2152
  mac: "Cmd-ArrowDown",
2144
- run: () => (g.emit(e, y, "sub"), !0)
2153
+ run: () => (h.emit(e, w, "sub"), !0)
2145
2154
  },
2146
2155
  {
2147
2156
  key: "Ctrl-o",
2148
2157
  mac: "Cmd-o",
2149
- run: () => (g.emit(e, y, "orderedList"), !0)
2158
+ run: () => (h.emit(e, w, "orderedList"), !0)
2150
2159
  },
2151
2160
  {
2152
2161
  key: "Ctrl-c",
2153
2162
  mac: "Cmd-c",
2154
- shift: () => (g.emit(e, y, "code"), !0),
2155
- any(M, k) {
2156
- return (k.ctrlKey || k.metaKey) && k.altKey && k.code === "KeyC" ? (g.emit(e, y, "codeRow"), !0) : !1;
2163
+ shift: () => (h.emit(e, w, "code"), !0),
2164
+ any(L, C) {
2165
+ return (C.ctrlKey || C.metaKey) && C.altKey && C.code === "KeyC" ? (h.emit(e, w, "codeRow"), !0) : !1;
2157
2166
  }
2158
2167
  },
2159
2168
  {
2160
2169
  key: "Ctrl-l",
2161
2170
  mac: "Cmd-l",
2162
- run: () => (g.emit(e, y, "link"), !0)
2171
+ run: () => (h.emit(e, w, "link"), !0)
2163
2172
  },
2164
2173
  {
2165
2174
  key: "Ctrl-f",
2166
2175
  mac: "Cmd-f",
2167
- shift: () => t.noPrettier ? !1 : (g.emit(e, y, "prettier"), !0)
2176
+ shift: () => t.noPrettier ? !1 : (h.emit(e, w, "prettier"), !0)
2168
2177
  },
2169
2178
  {
2170
- any: (M, k) => (k.ctrlKey || k.metaKey) && k.altKey && k.shiftKey && k.code === "KeyT" ? (g.emit(e, y, "table"), !0) : !1
2179
+ any: (L, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (h.emit(e, w, "table"), !0) : !1
2171
2180
  },
2172
2181
  ...to
2173
2182
  ], Nl = /[a-z][a-z0-9.+-]*:\/\/[^\s<>"'`()]+(?:\([^\s<>"'`]*\)[^\s<>"'`]*)*/i, Al = /\/\/[^\s<>"'`()]+/i, Dl = /data:[a-z]+\/[a-z0-9.+-]+(?:;base64)?,[a-z0-9+/=%]+/i, Ml = /\/(?!\/)[^\s<>"'`()]+/i, Ve = new RegExp(
2174
2183
  `(?<![a-z0-9.+-])(${Nl.source}|${Al.source}|${Dl.source}|${Ml.source})`,
2175
2184
  "gi"
2176
2185
  ), Rl = (e, t, o) => e.some((n) => n.from === t && n.to === o), Fl = (e) => {
2177
- const t = e.shortenText || (() => "..."), o = ne.define(), n = ne.define(), i = (m, v) => {
2178
- const b = new Ht(), h = [];
2179
- for (let f = 1; f <= m.doc.lines; f++) {
2180
- const p = m.doc.line(f), T = p.text;
2186
+ const t = e.shortenText || (() => "..."), o = re.define(), n = re.define(), i = (u, v) => {
2187
+ const m = new Ht(), f = [];
2188
+ for (let g = 1; g <= u.doc.lines; g++) {
2189
+ const p = u.doc.line(g), k = p.text;
2181
2190
  Ve.lastIndex = 0;
2182
- let I;
2183
- for (; I = Ve.exec(T); ) {
2184
- if (!I[0]) continue;
2185
- const A = I[0];
2191
+ let S;
2192
+ for (; S = Ve.exec(k); ) {
2193
+ if (!S[0]) continue;
2194
+ const A = S[0];
2186
2195
  if (A.length <= e.maxLength) continue;
2187
- const L = p.from + I.index, S = L + A.length;
2188
- if (Rl(v, L, S)) {
2189
- h.push({ from: L, to: S });
2196
+ const D = p.from + S.index, I = D + A.length;
2197
+ if (Rl(v, D, I)) {
2198
+ f.push({ from: D, to: I });
2190
2199
  continue;
2191
2200
  }
2192
- const N = t(A);
2193
- b.add(
2194
- L,
2195
- S,
2196
- Wt.replace({ widget: new s(N, A, L, S) })
2201
+ const M = t(A);
2202
+ m.add(
2203
+ D,
2204
+ I,
2205
+ Wt.replace({ widget: new s(M, A, D, I) })
2197
2206
  );
2198
2207
  }
2199
2208
  }
2200
- return { deco: b.finish(), expanded: h };
2209
+ return { deco: m.finish(), expanded: f };
2201
2210
  };
2202
2211
  class s extends _t {
2203
- constructor(v, b, h, f) {
2204
- super(), this.short = v, this.raw = b, this.from = h, this.to = f;
2212
+ constructor(v, m, f, g) {
2213
+ super(), this.short = v, this.raw = m, this.from = f, this.to = g;
2205
2214
  }
2206
2215
  toDOM(v) {
2207
- const b = document.createElement("span");
2208
- return b.textContent = this.short, b.className = "cm-short-text", b.title = this.raw, b.style.display = "inline", b.style.textDecoration = "underline", b.addEventListener("mousedown", (h) => {
2209
- h.preventDefault(), h.stopPropagation(), v.dispatch({
2210
- selection: W.cursor(this.from),
2216
+ const m = document.createElement("span");
2217
+ return m.textContent = this.short, m.className = "cm-short-text", m.title = this.raw, m.style.display = "inline", m.style.textDecoration = "underline", m.addEventListener("mousedown", (f) => {
2218
+ f.preventDefault(), f.stopPropagation(), v.dispatch({
2219
+ selection: U.cursor(this.from),
2211
2220
  effects: o.of({
2212
2221
  from: this.from,
2213
2222
  to: this.to,
2214
2223
  expand: !0
2215
2224
  })
2216
2225
  }), v.focus();
2217
- }), b.addEventListener("click", (h) => {
2218
- h.preventDefault();
2219
- }), b;
2226
+ }), m.addEventListener("click", (f) => {
2227
+ f.preventDefault();
2228
+ }), m;
2220
2229
  }
2221
2230
  ignoreEvent() {
2222
2231
  return !1;
@@ -2226,115 +2235,115 @@ const Ze = () => {
2226
2235
  }
2227
2236
  }
2228
2237
  const c = qe.define({
2229
- create(m) {
2230
- return i(m, []);
2238
+ create(u) {
2239
+ return i(u, []);
2231
2240
  },
2232
- update(m, v) {
2233
- let b = m.expanded;
2234
- v.docChanged && b.length && (b = b.map(({ from: f, to: p }) => ({
2235
- from: v.changes.mapPos(f, 1),
2241
+ update(u, v) {
2242
+ let m = u.expanded;
2243
+ v.docChanged && m.length && (m = m.map(({ from: g, to: p }) => ({
2244
+ from: v.changes.mapPos(g, 1),
2236
2245
  to: v.changes.mapPos(p, -1)
2237
- })).filter(({ from: f, to: p }) => f < p));
2238
- let h = b !== m.expanded;
2239
- for (const f of v.effects)
2240
- f.is(o) ? f.value.expand ? b = [{ from: f.value.from, to: f.value.to }] : b = b.filter(
2241
- ({ from: p, to: T }) => p !== f.value.from || T !== f.value.to
2242
- ) : f.is(n) && b.length > 0 && (b = []);
2243
- return !h && b !== m.expanded && (h = !0), v.docChanged || h ? i(v.state, b) : m;
2246
+ })).filter(({ from: g, to: p }) => g < p));
2247
+ let f = m !== u.expanded;
2248
+ for (const g of v.effects)
2249
+ g.is(o) ? g.value.expand ? m = [{ from: g.value.from, to: g.value.to }] : m = m.filter(
2250
+ ({ from: p, to: k }) => p !== g.value.from || k !== g.value.to
2251
+ ) : g.is(n) && m.length > 0 && (m = []);
2252
+ return !f && m !== u.expanded && (f = !0), v.docChanged || f ? i(v.state, m) : u;
2244
2253
  },
2245
- provide: (m) => R.decorations.compute([m], (v) => v.field(m).deco)
2246
- }), u = R.domEventHandlers({
2247
- mousedown(m, v) {
2248
- const b = v.state.field(c, !1);
2249
- if (!b || b.expanded.length === 0)
2254
+ provide: (u) => B.decorations.compute([u], (v) => v.field(u).deco)
2255
+ }), d = B.domEventHandlers({
2256
+ mousedown(u, v) {
2257
+ const m = v.state.field(c, !1);
2258
+ if (!m || m.expanded.length === 0)
2250
2259
  return !1;
2251
- const h = m.target;
2252
- if (h && v.dom.contains(h)) {
2253
- const f = v.posAtDOM(h, 0);
2254
- if (f != null && f !== -1 && b.expanded.some(
2255
- ({ from: T, to: I }) => f >= T && f <= I
2260
+ const f = u.target;
2261
+ if (f && v.dom.contains(f)) {
2262
+ const g = v.posAtDOM(f, 0);
2263
+ if (g != null && g !== -1 && m.expanded.some(
2264
+ ({ from: k, to: S }) => g >= k && g <= S
2256
2265
  ))
2257
2266
  return !1;
2258
2267
  }
2259
2268
  return v.dispatch({ effects: n.of(void 0) }), !1;
2260
2269
  }
2261
2270
  });
2262
- return [c, u];
2271
+ return [c, d];
2263
2272
  };
2264
- R.EDIT_CONTEXT = !1;
2273
+ B.EDIT_CONTEXT = !1;
2265
2274
  const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension, Bl = (e) => {
2266
2275
  const t = Xe(e);
2267
2276
  return e.compartment ? e.compartment.of(t) : t;
2268
2277
  }, Pl = (e) => {
2269
2278
  const t = r("tabWidth"), o = r("editorId"), n = r("theme"), i = r("previewTheme"), s = r("language"), c = r(
2270
2279
  "usedLanguageText"
2271
- ), u = r("disabled"), m = r("showToolbarName"), v = r("customIcon"), b = r("noUploadImg"), h = r("tableShape"), f = r("noPrettier"), p = r("codeTheme"), T = r("setting"), I = r("updateSetting"), A = r("catalogVisible"), L = r("defToolbars"), S = r("floatingToolbars"), N = r("rootRef"), M = x(), k = kt(), V = x(!1), Q = new q(), ee = new q(), se = new q(), pe = new q(), Je = new q(), Qe = Ll(o, {
2272
- noPrettier: f
2280
+ ), d = r("disabled"), u = r("showToolbarName"), v = r("customIcon"), m = r("noUploadImg"), f = r("tableShape"), g = r("noPrettier"), p = r("codeTheme"), k = r("setting"), S = r("updateSetting"), A = r("catalogVisible"), D = r("defToolbars"), I = r("floatingToolbars"), M = r("rootRef"), L = E(), C = kt(), R = E(!1), z = new j(), q = new j(), $ = new j(), pe = new j(), Je = new j(), Qe = Ll(o, {
2281
+ noPrettier: g
2273
2282
  }), Te = () => [
2274
2283
  ...Qe,
2275
2284
  ...At,
2276
2285
  ...Dt,
2277
2286
  Mt
2278
- ], te = {
2279
- paste: El(e, k),
2287
+ ], oe = {
2288
+ paste: El(e, C),
2280
2289
  blur: e.onBlur,
2281
2290
  focus: e.onFocus,
2282
2291
  drop: e.onDrop,
2283
2292
  compositionstart: () => {
2284
- V.value = !0;
2293
+ R.value = !0;
2285
2294
  },
2286
- compositionend: (w, D) => {
2287
- V.value = !1, e.updateModelValue(D.state.doc.toString());
2295
+ compositionend: (T, F) => {
2296
+ R.value = !1, e.updateModelValue(F.state.doc.toString());
2288
2297
  },
2289
- input: (w) => {
2290
- e.onInput && e.onInput(w);
2291
- const { data: D } = w;
2292
- e.maxlength && e.modelValue.length + D.length > e.maxlength && g.emit(o, j, {
2298
+ input: (T) => {
2299
+ e.onInput && e.onInput(T);
2300
+ const { data: F } = T;
2301
+ e.maxlength && e.modelValue.length + F.length > e.maxlength && h.emit(o, X, {
2293
2302
  name: "overlength",
2294
2303
  message: "The input text is too long",
2295
- data: D
2304
+ data: F
2296
2305
  });
2297
2306
  }
2298
2307
  }, et = nl({
2299
- privide(w) {
2300
- w.provide("editorId", o), w.provide("theme", n), w.provide("previewTheme", i), w.provide("language", s), w.provide("disabled", u), w.provide("noUploadImg", b), w.provide("tableShape", h), w.provide("noPrettier", f), w.provide("codeTheme", p), w.provide("showToolbarName", m), w.provide("setting", T), w.provide("updateSetting", I), w.provide("usedLanguageText", c), w.provide("catalogVisible", A), w.provide("defToolbars", L), w.provide("tabWidth", t), w.provide("customIcon", v), w.provide("floatingToolbars", S), w.provide("rootRef", N);
2308
+ privide(T) {
2309
+ T.provide("editorId", o), T.provide("theme", n), T.provide("previewTheme", i), T.provide("language", s), T.provide("disabled", d), T.provide("noUploadImg", m), T.provide("tableShape", f), T.provide("noPrettier", g), T.provide("codeTheme", p), T.provide("showToolbarName", u), T.provide("setting", k), T.provide("updateSetting", S), T.provide("usedLanguageText", c), T.provide("catalogVisible", A), T.provide("defToolbars", D), T.provide("tabWidth", t), T.provide("customIcon", v), T.provide("floatingToolbars", I), T.provide("rootRef", M);
2301
2310
  }
2302
2311
  }), tt = [
2303
2312
  {
2304
2313
  type: "theme",
2305
- extension: ({ theme: w }) => w.value === "light" ? Me : Oe,
2306
- compartment: Q,
2314
+ extension: ({ theme: T }) => T.value === "light" ? Me : Oe,
2315
+ compartment: z,
2307
2316
  options: {
2308
2317
  theme: n
2309
2318
  }
2310
2319
  },
2311
2320
  {
2312
2321
  type: "updateListener",
2313
- extension: R.updateListener.of((w) => {
2314
- w.docChanged && (e.onChange(w.state.doc.toString()), V.value || e.updateModelValue(w.state.doc.toString()));
2322
+ extension: B.updateListener.of((T) => {
2323
+ T.docChanged && (e.onChange(T.state.doc.toString()), R.value || e.updateModelValue(T.state.doc.toString()));
2315
2324
  })
2316
2325
  },
2317
2326
  {
2318
2327
  type: "domEventHandlers",
2319
- extension: R.domEventHandlers(te),
2328
+ extension: B.domEventHandlers(oe),
2320
2329
  compartment: pe
2321
2330
  },
2322
2331
  {
2323
2332
  type: "completions",
2324
2333
  extension: Ie(e.completions),
2325
- compartment: ee
2334
+ compartment: q
2326
2335
  },
2327
2336
  {
2328
2337
  type: "history",
2329
2338
  extension: ke(),
2330
- compartment: se
2339
+ compartment: $
2331
2340
  }
2332
- ], we = G.codeMirrorExtensions(
2341
+ ], we = Z.codeMirrorExtensions(
2333
2342
  [
2334
2343
  // 横向换行
2335
2344
  {
2336
2345
  type: "lineWrapping",
2337
- extension: R.lineWrapping
2346
+ extension: B.lineWrapping
2338
2347
  },
2339
2348
  {
2340
2349
  type: "keymap",
@@ -2351,14 +2360,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2351
2360
  },
2352
2361
  {
2353
2362
  type: "linkShortener",
2354
- extension: (w) => Fl(w),
2363
+ extension: (T) => Fl(T),
2355
2364
  options: {
2356
2365
  maxLength: 30
2357
2366
  }
2358
2367
  },
2359
2368
  {
2360
2369
  type: "floatingToolbar",
2361
- extension: S.value.length > 0 ? et : [],
2370
+ extension: I.value.length > 0 ? et : [],
2362
2371
  compartment: Je
2363
2372
  }
2364
2373
  ],
@@ -2368,201 +2377,201 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2368
2377
  keyBindings: Te()
2369
2378
  }
2370
2379
  ), ot = () => [...tt, ...we].map(Bl);
2371
- return _(() => {
2372
- const w = new R({
2380
+ return K(() => {
2381
+ const T = new B({
2373
2382
  doc: e.modelValue,
2374
- parent: M.value,
2383
+ parent: L.value,
2375
2384
  extensions: ot()
2376
- }), D = new go(w);
2377
- k.value = D, setTimeout(() => {
2378
- D.setTabSize(t), D.setDisabled(u.value), D.setReadOnly(e.readonly), e.placeholder && D.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && D.setMaxLength(e.maxlength), e.autofocus && w.focus();
2379
- }, 0), g.on(o, {
2385
+ }), F = new go(T);
2386
+ C.value = F, setTimeout(() => {
2387
+ F.setTabSize(t), F.setDisabled(d.value), F.setReadOnly(e.readonly), e.placeholder && F.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && F.setMaxLength(e.maxlength), e.autofocus && T.focus();
2388
+ }, 0), h.on(o, {
2380
2389
  name: Ke,
2381
2390
  callback() {
2382
- Rt(w);
2391
+ Rt(T);
2383
2392
  }
2384
- }), g.on(o, {
2393
+ }), h.on(o, {
2385
2394
  name: Ue,
2386
2395
  callback() {
2387
- Ft(w);
2396
+ Ft(T);
2388
2397
  }
2389
- }), g.on(o, {
2390
- name: y,
2391
- async callback(B, F = {}) {
2392
- if (B === "image" && F.transform) {
2393
- const P = e.transformImgUrl(F.url);
2394
- if (P instanceof Promise)
2395
- P.then(async (O) => {
2396
- const { text: H, options: Y } = await ce(
2397
- B,
2398
- k.value,
2399
- { ...F, url: O }
2398
+ }), h.on(o, {
2399
+ name: w,
2400
+ async callback(O, H = {}) {
2401
+ if (O === "image" && H.transform) {
2402
+ const V = e.transformImgUrl(H.url);
2403
+ if (V instanceof Promise)
2404
+ V.then(async (_) => {
2405
+ const { text: W, options: J } = await ce(
2406
+ O,
2407
+ C.value,
2408
+ { ...H, url: _ }
2400
2409
  );
2401
- k.value?.replaceSelectedText(H, Y, o);
2402
- }).catch((O) => {
2403
- console.error(O);
2410
+ C.value?.replaceSelectedText(W, J, o);
2411
+ }).catch((_) => {
2412
+ console.error(_);
2404
2413
  });
2405
2414
  else {
2406
- const { text: O, options: H } = await ce(B, k.value, {
2407
- ...F,
2408
- url: P
2415
+ const { text: _, options: W } = await ce(O, C.value, {
2416
+ ...H,
2417
+ url: V
2409
2418
  });
2410
- k.value?.replaceSelectedText(O, H, o);
2419
+ C.value?.replaceSelectedText(_, W, o);
2411
2420
  }
2412
2421
  } else {
2413
- const { text: P, options: O } = await ce(
2414
- B,
2415
- k.value,
2416
- F
2422
+ const { text: V, options: _ } = await ce(
2423
+ O,
2424
+ C.value,
2425
+ H
2417
2426
  );
2418
- k.value?.replaceSelectedText(P, O, o);
2427
+ C.value?.replaceSelectedText(V, _, o);
2419
2428
  }
2420
2429
  }
2421
- }), g.on(o, {
2430
+ }), h.on(o, {
2422
2431
  name: Gt,
2423
- callback: Et((B) => {
2424
- const F = { ...te }, P = Object.keys(te);
2425
- for (const O in B) {
2426
- const H = O;
2427
- P.includes(H) ? F[H] = (Y, ye) => {
2428
- B[H](Y, ye), Y.defaultPrevented || te[H](Y, ye);
2429
- } : F[H] = B[H];
2432
+ callback: Et((O) => {
2433
+ const H = { ...oe }, V = Object.keys(oe);
2434
+ for (const _ in O) {
2435
+ const W = _;
2436
+ V.includes(W) ? H[W] = (J, ye) => {
2437
+ O[W](J, ye), J.defaultPrevented || oe[W](J, ye);
2438
+ } : H[W] = O[W];
2430
2439
  }
2431
- k.value?.view.dispatch({
2440
+ C.value?.view.dispatch({
2432
2441
  effects: pe.reconfigure(
2433
- R.domEventHandlers(F)
2442
+ B.domEventHandlers(H)
2434
2443
  )
2435
2444
  });
2436
2445
  })
2437
- }), g.on(o, {
2446
+ }), h.on(o, {
2438
2447
  name: jt,
2439
- callback: (B, F) => {
2440
- const P = w.state.doc.line(B);
2441
- w.dispatch(
2442
- w.state.update({ changes: { from: P.from, to: P.to, insert: F } })
2448
+ callback: (O, H) => {
2449
+ const V = T.state.doc.line(O);
2450
+ T.dispatch(
2451
+ T.state.update({ changes: { from: V.from, to: V.to, insert: H } })
2443
2452
  );
2444
2453
  }
2445
- }), g.on(o, {
2454
+ }), h.on(o, {
2446
2455
  name: Yt,
2447
2456
  callback() {
2448
- g.emit(o, $e, w);
2457
+ h.emit(o, $e, T);
2449
2458
  }
2450
- }), g.emit(o, $e, w);
2451
- }), E(
2459
+ }), h.emit(o, $e, T);
2460
+ }), N(
2452
2461
  n,
2453
2462
  () => {
2454
- k.value?.view.dispatch({
2455
- effects: Q.reconfigure(n.value === "light" ? Me : Oe)
2463
+ C.value?.view.dispatch({
2464
+ effects: z.reconfigure(n.value === "light" ? Me : Oe)
2456
2465
  });
2457
2466
  },
2458
2467
  { deep: !0 }
2459
- ), E(
2468
+ ), N(
2460
2469
  () => e.completions,
2461
2470
  () => {
2462
- k.value?.view.dispatch({
2463
- effects: ee.reconfigure(Ie(e.completions))
2471
+ C.value?.view.dispatch({
2472
+ effects: q.reconfigure(Ie(e.completions))
2464
2473
  });
2465
2474
  },
2466
2475
  { deep: !0 }
2467
- ), E(
2476
+ ), N(
2468
2477
  () => e.modelValue,
2469
2478
  () => {
2470
- k.value?.getValue() !== e.modelValue && k.value?.setValue(e.modelValue);
2479
+ C.value?.getValue() !== e.modelValue && C.value?.setValue(e.modelValue);
2471
2480
  }
2472
- ), E(
2481
+ ), N(
2473
2482
  () => e.placeholder,
2474
2483
  () => {
2475
- k.value?.setPlaceholder(e.placeholder);
2484
+ C.value?.setPlaceholder(e.placeholder);
2476
2485
  }
2477
- ), E([u], () => {
2478
- k.value?.setDisabled(u.value);
2479
- }), E(
2486
+ ), N([d], () => {
2487
+ C.value?.setDisabled(d.value);
2488
+ }), N(
2480
2489
  () => e.readonly,
2481
2490
  () => {
2482
- k.value?.setDisabled(e.readonly);
2491
+ C.value?.setDisabled(e.readonly);
2483
2492
  }
2484
- ), E(
2493
+ ), N(
2485
2494
  () => e.maxlength,
2486
2495
  () => {
2487
- e.maxlength && k.value?.setMaxLength(e.maxlength);
2496
+ e.maxlength && C.value?.setMaxLength(e.maxlength);
2488
2497
  }
2489
- ), ho(() => {
2490
- const w = we.find(
2491
- (D) => D.type === "floatingToolbar"
2498
+ ), fo(() => {
2499
+ const T = we.find(
2500
+ (F) => F.type === "floatingToolbar"
2492
2501
  );
2493
- w?.compartment && (S.value.length > 0 ? k.value?.view.dispatch({
2494
- effects: w.compartment.reconfigure(
2495
- Xe(w)
2502
+ T?.compartment && (I.value.length > 0 ? C.value?.view.dispatch({
2503
+ effects: T.compartment.reconfigure(
2504
+ Xe(T)
2496
2505
  )
2497
- }) : k.value?.view.dispatch({
2498
- effects: w.compartment.reconfigure([])
2506
+ }) : C.value?.view.dispatch({
2507
+ effects: T.compartment.reconfigure([])
2499
2508
  }));
2500
- }, S), {
2501
- inputWrapperRef: M,
2502
- codeMirrorUt: k,
2509
+ }, I), {
2510
+ inputWrapperRef: L,
2511
+ codeMirrorUt: C,
2503
2512
  resetHistory() {
2504
- k.value?.view.dispatch({ effects: se.reconfigure([]) }), k.value?.view.dispatch({ effects: se.reconfigure(ke()) });
2513
+ C.value?.view.dispatch({ effects: $.reconfigure([]) }), C.value?.view.dispatch({ effects: $.reconfigure(ke()) });
2505
2514
  }
2506
2515
  };
2507
2516
  }, Hl = (e, t, o) => {
2508
- const n = r("setting"), i = K(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = U({
2517
+ const n = r("setting"), i = P(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = Y({
2509
2518
  resizedWidth: i.value
2510
- }), c = U({
2519
+ }), c = Y({
2511
2520
  width: i.value
2512
- }), u = U({
2521
+ }), d = Y({
2513
2522
  left: i.value,
2514
2523
  display: "initial"
2515
- }), m = (h) => {
2516
- const f = t.value?.offsetWidth || 0, p = t.value?.getBoundingClientRect().x || 0;
2517
- let T = h.x - p;
2518
- T / f < oe ? T = f * oe : T > f - f * oe && (T = f - f * oe);
2519
- const I = `${T / f * 100}%`;
2520
- c.width = I, u.left = I, s.resizedWidth = I, e.oninputBoxWidthChange?.(I);
2521
- }, v = (h) => {
2522
- h.target === o.value && document.addEventListener("mousemove", m);
2523
- }, b = () => {
2524
- document.removeEventListener("mousemove", m);
2524
+ }), u = (f) => {
2525
+ const g = t.value?.offsetWidth || 0, p = t.value?.getBoundingClientRect().x || 0;
2526
+ let k = f.x - p;
2527
+ k / g < le ? k = g * le : k > g - g * le && (k = g - g * le);
2528
+ const S = `${k / g * 100}%`;
2529
+ c.width = S, d.left = S, s.resizedWidth = S, e.oninputBoxWidthChange?.(S);
2530
+ }, v = (f) => {
2531
+ f.target === o.value && document.addEventListener("mousemove", u);
2532
+ }, m = () => {
2533
+ document.removeEventListener("mousemove", u);
2525
2534
  };
2526
- return E([o], () => {
2527
- document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", b), document.addEventListener("mousedown", v), document.addEventListener("mouseup", b);
2528
- }), _(() => {
2529
- document.addEventListener("mousedown", v), document.addEventListener("mouseup", b);
2535
+ return N([o], () => {
2536
+ document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m), document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
2537
+ }), K(() => {
2538
+ document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
2530
2539
  }), ge(() => {
2531
- document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", b);
2532
- }), E([i], ([h]) => {
2533
- s.resizedWidth = h, c.width = h, u.left = h;
2534
- }), E(
2540
+ document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m);
2541
+ }), N([i], ([f]) => {
2542
+ s.resizedWidth = f, c.width = f, d.left = f;
2543
+ }), N(
2535
2544
  [
2536
2545
  () => n.value.htmlPreview,
2537
2546
  () => n.value.preview,
2538
2547
  () => n.value.previewOnly
2539
2548
  ],
2540
2549
  () => {
2541
- n.value.previewOnly ? (c.width = "0%", u.display = "none") : !n.value.htmlPreview && !n.value.preview ? (c.width = "100%", u.display = "none") : (c.width = s.resizedWidth, u.display = "initial");
2550
+ n.value.previewOnly ? (c.width = "0%", d.display = "none") : !n.value.htmlPreview && !n.value.preview ? (c.width = "100%", d.display = "none") : (c.width = s.resizedWidth, d.display = "initial");
2542
2551
  },
2543
2552
  {
2544
2553
  immediate: !0
2545
2554
  }
2546
2555
  ), {
2547
2556
  inputWrapperStyle: c,
2548
- resizeOperateStyle: u
2557
+ resizeOperateStyle: d
2549
2558
  };
2550
2559
  }, Ol = () => {
2551
- const e = r("editorId"), t = x(!0), o = ze();
2560
+ const e = r("editorId"), t = E(!0), o = ze();
2552
2561
  return {
2553
- onCatalogActive: (c, u) => {
2554
- const m = document.querySelector(
2562
+ onCatalogActive: (c, d) => {
2563
+ const u = document.querySelector(
2555
2564
  `#${e} .${a}-catalog-editor`
2556
2565
  );
2557
- if (!u || !t.value || !m)
2566
+ if (!d || !t.value || !u)
2558
2567
  return;
2559
- const v = u.offsetTop - m.scrollTop;
2560
- (v > 100 || v < 100) && o(m, u.offsetTop - 100);
2568
+ const v = d.offsetTop - u.scrollTop;
2569
+ (v > 100 || v < 100) && o(u, d.offsetTop - 100);
2561
2570
  },
2562
2571
  onMouseenter: () => t.value = !1,
2563
2572
  onMouseleave: () => t.value = !0
2564
2573
  };
2565
- }, me = /* @__PURE__ */ C({
2574
+ }, me = /* @__PURE__ */ y({
2566
2575
  name: `${xt}CustomScrollbar`,
2567
2576
  props: {
2568
2577
  id: {
@@ -2601,44 +2610,44 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2601
2610
  setup(e, {
2602
2611
  slots: t
2603
2612
  }) {
2604
- const o = x(null), n = x(null), i = x(null), s = x(null);
2605
- let c = null, u = null, m = !1, v = 0, b = 0;
2606
- const h = () => {
2613
+ const o = E(null), n = E(null), i = E(null), s = E(null);
2614
+ let c = null, d = null, u = !1, v = 0, m = 0;
2615
+ const f = () => {
2607
2616
  if (!n.value || !o.value || !i.value || !s.value) return;
2608
- const S = o.value.clientHeight, N = n.value.scrollHeight, M = n.value.scrollTop;
2609
- if (N <= S) {
2617
+ const I = o.value.clientHeight, M = n.value.scrollHeight, L = n.value.scrollTop;
2618
+ if (M <= I) {
2610
2619
  i.value.style.display = "none", e.alwaysShowTrack || (s.value.style.display = "none");
2611
2620
  return;
2612
2621
  } else
2613
2622
  i.value.style.display = "block", s.value.style.display = "block";
2614
- const k = S / N, V = Math.max(S * k, 20), Q = S - V, ee = Math.min(M * k, Q);
2615
- i.value.style.height = `${V}px`, i.value.style.top = `${ee}px`;
2616
- }, f = () => h(), p = (S) => {
2617
- m = !0, v = S.clientY, b = n.value.scrollTop, document.body.style.userSelect = "none";
2618
- }, T = (S) => {
2619
- if (!m || !n.value || !o.value) return;
2620
- const N = S.clientY - v, M = n.value.scrollHeight / o.value.clientHeight;
2621
- n.value.scrollTop = b + N * M;
2622
- }, I = () => {
2623
- m = !1, document.body.style.userSelect = "";
2624
- }, A = (S) => {
2625
- n.value && n.value.removeEventListener("scroll", f), n.value = S, n.value ? (n.value.addEventListener("scroll", f), h()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2626
- }, L = () => {
2623
+ const C = I / M, R = Math.max(I * C, 20), z = I - R, q = Math.min(L * C, z);
2624
+ i.value.style.height = `${R}px`, i.value.style.top = `${q}px`;
2625
+ }, g = () => f(), p = (I) => {
2626
+ u = !0, v = I.clientY, m = n.value.scrollTop, document.body.style.userSelect = "none";
2627
+ }, k = (I) => {
2628
+ if (!u || !n.value || !o.value) return;
2629
+ const M = I.clientY - v, L = n.value.scrollHeight / o.value.clientHeight;
2630
+ n.value.scrollTop = m + M * L;
2631
+ }, S = () => {
2632
+ u = !1, document.body.style.userSelect = "";
2633
+ }, A = (I) => {
2634
+ n.value && n.value.removeEventListener("scroll", g), n.value = I, n.value ? (n.value.addEventListener("scroll", g), f()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2635
+ }, D = () => {
2627
2636
  if (!o.value) return;
2628
- const S = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
2629
- A(S);
2637
+ const I = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
2638
+ A(I);
2630
2639
  };
2631
- return _(async () => {
2632
- await re(), L(), c = new MutationObserver(() => {
2633
- u && cancelAnimationFrame(u), u = requestAnimationFrame(() => {
2634
- L();
2640
+ return K(async () => {
2641
+ await se(), D(), c = new MutationObserver(() => {
2642
+ d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
2643
+ D();
2635
2644
  });
2636
2645
  }), c.observe(o.value, {
2637
2646
  childList: !0,
2638
2647
  subtree: !0
2639
- }), window.addEventListener("resize", h), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", T), document.addEventListener("mouseup", I);
2648
+ }), window.addEventListener("resize", f), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", k), document.addEventListener("mouseup", S);
2640
2649
  }), ge(() => {
2641
- c?.disconnect(), n.value && n.value.removeEventListener("scroll", f), window.removeEventListener("resize", h), i.value?.removeEventListener("mousedown", p), document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", I);
2650
+ c?.disconnect(), n.value && n.value.removeEventListener("scroll", g), window.removeEventListener("resize", f), i.value?.removeEventListener("mousedown", p), document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", S);
2642
2651
  }), () => l("div", {
2643
2652
  id: e.id,
2644
2653
  class: [`${a}-custom-scrollbar`, e.class],
@@ -2653,44 +2662,57 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2653
2662
  ref: i
2654
2663
  }, null)])]);
2655
2664
  }
2656
- }), Vl = ze(), Wl = /* @__PURE__ */ C({
2665
+ }), Vl = ze(), Wl = {
2666
+ flex: 1
2667
+ }, _l = /* @__PURE__ */ y({
2657
2668
  name: "MDEditorContent",
2658
2669
  props: st,
2659
2670
  setup(e, t) {
2660
- const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = x(""), u = x(), m = x(), {
2671
+ const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = E(""), d = E(), u = E(), {
2661
2672
  inputWrapperRef: v,
2662
- codeMirrorUt: b,
2663
- resetHistory: h
2673
+ codeMirrorUt: m,
2674
+ resetHistory: f
2664
2675
  } = Pl(e), {
2665
- inputWrapperStyle: f,
2676
+ inputWrapperStyle: g,
2666
2677
  resizeOperateStyle: p
2667
- } = Hl(e, u, m);
2668
- oo(e, c, b);
2678
+ } = Hl(e, d, u);
2679
+ oo(e, c, m);
2669
2680
  const {
2670
- onCatalogActive: T,
2671
- onMouseenter: I,
2681
+ onCatalogActive: k,
2682
+ onMouseenter: S,
2672
2683
  onMouseleave: A
2673
- } = Ol();
2684
+ } = Ol(), D = (L, C) => {
2685
+ if (!s.value.preview && C.line !== void 0) {
2686
+ L.preventDefault();
2687
+ const R = m.value?.view;
2688
+ if (R) {
2689
+ const z = R.state.doc.line(C.line + 1), q = R.lineBlockAt(z.from)?.top, $ = R.scrollDOM;
2690
+ Vl($, q);
2691
+ }
2692
+ }
2693
+ }, I = P(() => s.value.preview ? "preview" : "editor"), M = (L) => {
2694
+ c.value = L, e.onHtmlChanged(L);
2695
+ };
2674
2696
  return t.expose({
2675
2697
  getSelectedText() {
2676
- return b.value?.getSelectedText();
2698
+ return m.value?.getSelectedText();
2677
2699
  },
2678
2700
  focus(L) {
2679
- b.value?.focus(L);
2701
+ m.value?.focus(L);
2680
2702
  },
2681
- resetHistory: h,
2703
+ resetHistory: f,
2682
2704
  getEditorView() {
2683
- return b.value?.view;
2705
+ return m.value?.view;
2684
2706
  }
2685
2707
  }), () => l("div", {
2686
2708
  class: `${a}-content`
2687
2709
  }, [l("div", {
2688
2710
  class: `${a}-content-wrapper`,
2689
- ref: u
2711
+ ref: d
2690
2712
  }, [l(me, {
2691
2713
  alwaysShowTrack: !0,
2692
2714
  scrollTarget: `#${o} .cm-scroller`,
2693
- style: f
2715
+ style: g
2694
2716
  }, {
2695
2717
  default: () => [l("div", {
2696
2718
  class: `${a}-input-wrapper`,
@@ -2699,18 +2721,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2699
2721
  }), (s.value.htmlPreview || s.value.preview) && l("div", {
2700
2722
  class: `${a}-resize-operate`,
2701
2723
  style: p,
2702
- ref: m
2724
+ ref: u
2703
2725
  }, null), l(me, {
2704
- style: {
2705
- flex: 1
2706
- }
2726
+ style: Wl
2707
2727
  }, {
2708
2728
  default: () => [l(it, {
2709
2729
  modelValue: e.modelValue,
2710
2730
  onChange: e.onChange,
2711
- onHtmlChanged: (L) => {
2712
- c.value = L, e.onHtmlChanged(L);
2713
- },
2731
+ onHtmlChanged: M,
2714
2732
  onGetCatalog: e.onGetCatalog,
2715
2733
  mdHeadingId: e.mdHeadingId,
2716
2734
  noMermaid: e.noMermaid,
@@ -2722,11 +2740,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2722
2740
  sanitizeMermaid: e.sanitizeMermaid,
2723
2741
  codeFoldable: e.codeFoldable,
2724
2742
  autoFoldThreshold: e.autoFoldThreshold,
2725
- onRemount: e.onRemount
2743
+ onRemount: e.onRemount,
2744
+ previewComponent: e.previewComponent,
2745
+ noEcharts: e.noEcharts
2726
2746
  }, null)]
2727
2747
  })]), n.value && l(me, {
2728
2748
  class: `${a}-catalog-${e.catalogLayout}`,
2729
- onMouseenter: I,
2749
+ onMouseenter: S,
2730
2750
  onMouseleave: A
2731
2751
  }, {
2732
2752
  default: () => [l(We, {
@@ -2736,23 +2756,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2736
2756
  mdHeadingId: e.mdHeadingId,
2737
2757
  key: "internal-catalog",
2738
2758
  scrollElementOffsetTop: 2,
2739
- syncWith: s.value.preview ? "preview" : "editor",
2740
- onClick: (L, S) => {
2741
- if (!s.value.preview && S.line !== void 0) {
2742
- L.preventDefault();
2743
- const N = b.value?.view;
2744
- if (N) {
2745
- const M = N.state.doc.line(S.line + 1), k = N.lineBlockAt(M.from)?.top, V = N.scrollDOM;
2746
- Vl(V, k);
2747
- }
2748
- }
2749
- },
2759
+ syncWith: I.value,
2760
+ onClick: D,
2750
2761
  catalogMaxDepth: e.catalogMaxDepth,
2751
- onActive: T
2762
+ onActive: k
2752
2763
  }, null)]
2753
2764
  })]);
2754
2765
  }
2755
- }), _l = /* @__PURE__ */ C({
2766
+ }), zl = /* @__PURE__ */ y({
2756
2767
  props: {
2757
2768
  modelValue: {
2758
2769
  type: String,
@@ -2767,7 +2778,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2767
2778
  class: `${a}-footer-label`
2768
2779
  }, [`${t.value.footer?.markdownTotal}:`]), l("span", null, [e.modelValue?.length || 0])]);
2769
2780
  }
2770
- }), zl = {
2781
+ }), ql = {
2771
2782
  checked: {
2772
2783
  type: Boolean,
2773
2784
  default: !1
@@ -2781,9 +2792,9 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2781
2792
  type: Boolean,
2782
2793
  default: void 0
2783
2794
  }
2784
- }, ql = /* @__PURE__ */ C({
2795
+ }, Ul = /* @__PURE__ */ y({
2785
2796
  name: `${a}-checkbox`,
2786
- props: zl,
2797
+ props: ql,
2787
2798
  setup(e) {
2788
2799
  return () => l("div", {
2789
2800
  class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`, e.disabled && `${a}-disabled`],
@@ -2792,7 +2803,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2792
2803
  }
2793
2804
  }, null);
2794
2805
  }
2795
- }), Ul = {
2806
+ }), Kl = {
2796
2807
  scrollAuto: {
2797
2808
  type: Boolean
2798
2809
  },
@@ -2801,8 +2812,8 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2801
2812
  default: () => {
2802
2813
  }
2803
2814
  }
2804
- }, Kl = /* @__PURE__ */ C({
2805
- props: Ul,
2815
+ }, Gl = /* @__PURE__ */ y({
2816
+ props: Kl,
2806
2817
  setup(e) {
2807
2818
  const t = r("usedLanguageText"), o = r("disabled");
2808
2819
  return () => l("div", {
@@ -2812,13 +2823,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2812
2823
  onClick: () => {
2813
2824
  o?.value || e.onScrollAutoChange(!e.scrollAuto);
2814
2825
  }
2815
- }, [t?.value.footer?.scrollAuto]), l(ql, {
2826
+ }, [t?.value.footer?.scrollAuto]), l(Ul, {
2816
2827
  checked: e.scrollAuto,
2817
2828
  onChange: e.onScrollAutoChange,
2818
2829
  disabled: o?.value
2819
2830
  }, null)]);
2820
2831
  }
2821
- }), Gl = {
2832
+ }), jl = {
2822
2833
  modelValue: {
2823
2834
  type: String,
2824
2835
  default: ""
@@ -2841,55 +2852,55 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2841
2852
  defFooters: {
2842
2853
  type: Object
2843
2854
  }
2844
- }, jl = /* @__PURE__ */ C({
2855
+ }, Yl = /* @__PURE__ */ y({
2845
2856
  name: "MDEditorFooter",
2846
- props: Gl,
2857
+ props: jl,
2847
2858
  setup(e) {
2848
- const t = r("theme"), o = r("language"), n = r("disabled"), i = K(() => {
2849
- const c = e.footers.indexOf("="), u = c === -1 ? e.footers : e.footers.slice(0, c), m = c === -1 ? [] : e.footers.slice(c, Number.MAX_SAFE_INTEGER);
2850
- return [u, m];
2859
+ const t = r("theme"), o = r("language"), n = r("disabled"), i = P(() => {
2860
+ const c = e.footers.indexOf("="), d = c === -1 ? e.footers : e.footers.slice(0, c), u = c === -1 ? [] : e.footers.slice(c, Number.MAX_SAFE_INTEGER);
2861
+ return [d, u];
2851
2862
  }), s = (c) => {
2852
2863
  if (St.includes(c))
2853
2864
  switch (c) {
2854
2865
  case "markdownTotal":
2855
- return l(_l, {
2866
+ return l(zl, {
2856
2867
  modelValue: e.modelValue
2857
2868
  }, null);
2858
2869
  case "scrollSwitch":
2859
- return !e.noScrollAuto && l(Kl, {
2870
+ return !e.noScrollAuto && l(Gl, {
2860
2871
  scrollAuto: e.scrollAuto,
2861
2872
  onScrollAutoChange: e.onScrollAutoChange
2862
2873
  }, null);
2863
2874
  }
2864
2875
  else if (e.defFooters instanceof Array) {
2865
- const u = e.defFooters[c];
2866
- return u ? ae(u, {
2867
- theme: u.props?.theme || t.value,
2868
- language: u.props?.language || o.value,
2869
- disabled: u.props?.disabled || n?.value
2876
+ const d = e.defFooters[c];
2877
+ return d ? ne(d, {
2878
+ theme: d.props?.theme || t.value,
2879
+ language: d.props?.language || o.value,
2880
+ disabled: d.props?.disabled || n?.value
2870
2881
  }) : "";
2871
2882
  } else if (e.defFooters && e.defFooters.children instanceof Array) {
2872
- const u = e.defFooters.children[c];
2873
- return u ? ae(u, {
2874
- theme: u.props?.theme || t.value,
2875
- language: u.props?.language || o.value,
2876
- disabled: u.props?.disabled || n?.value
2883
+ const d = e.defFooters.children[c];
2884
+ return d ? ne(d, {
2885
+ theme: d.props?.theme || t.value,
2886
+ language: d.props?.language || o.value,
2887
+ disabled: d.props?.disabled || n?.value
2877
2888
  }) : "";
2878
2889
  } else
2879
2890
  return "";
2880
2891
  };
2881
2892
  return () => {
2882
- const c = i.value[0].map((m) => s(m)), u = i.value[1].map((m) => s(m));
2893
+ const c = i.value[0].map((u) => s(u)), d = i.value[1].map((u) => s(u));
2883
2894
  return l("div", {
2884
2895
  class: `${a}-footer`
2885
2896
  }, [l("div", {
2886
2897
  class: `${a}-footer-left`
2887
2898
  }, [c]), l("div", {
2888
2899
  class: `${a}-footer-right`
2889
- }, [u])]);
2900
+ }, [d])]);
2890
2901
  };
2891
2902
  }
2892
- }), Yl = {
2903
+ }), Zl = {
2893
2904
  // 工具栏选择显示
2894
2905
  toolbars: {
2895
2906
  type: Array,
@@ -2900,24 +2911,24 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2900
2911
  type: Array,
2901
2912
  default: () => []
2902
2913
  }
2903
- }, Zl = /* @__PURE__ */ C({
2914
+ }, Xl = /* @__PURE__ */ y({
2904
2915
  name: "MDEditorToolbar",
2905
- props: Yl,
2916
+ props: Zl,
2906
2917
  setup(e) {
2907
- const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = x(), s = x(), {
2918
+ const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = E(), s = E(), {
2908
2919
  barRender: c
2909
- } = Ze(), u = K(() => {
2910
- const m = e.toolbars.filter((f) => !e.toolbarsExclude.includes(f)), v = m.indexOf("="), b = v === -1 ? m : m.slice(0, v + 1), h = v === -1 ? [] : m.slice(v, Number.MAX_SAFE_INTEGER);
2911
- return [b, h];
2920
+ } = Ze(), d = P(() => {
2921
+ const u = e.toolbars.filter((g) => !e.toolbarsExclude.includes(g)), v = u.indexOf("="), m = v === -1 ? u : u.slice(0, v + 1), f = v === -1 ? [] : u.slice(v, Number.MAX_SAFE_INTEGER);
2922
+ return [m, f];
2912
2923
  });
2913
- return E(() => e.toolbars, () => {
2914
- re(() => {
2924
+ return N(() => e.toolbars, () => {
2925
+ se(() => {
2915
2926
  i.value && Lt(i.value);
2916
2927
  });
2917
2928
  }, {
2918
2929
  immediate: !0
2919
2930
  }), () => {
2920
- const m = u.value[0].map((b) => c(b)), v = u.value[1].map((b) => c(b));
2931
+ const u = d.value[0].map((m) => c(m)), v = d.value[1].map((m) => c(m));
2921
2932
  return l(_e, null, [e.toolbars.length > 0 && l("div", {
2922
2933
  class: `${a}-toolbar-wrapper`,
2923
2934
  ref: i,
@@ -2927,12 +2938,12 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2927
2938
  }, [l("div", {
2928
2939
  class: `${a}-toolbar-left`,
2929
2940
  ref: s
2930
- }, [m]), l("div", {
2941
+ }, [u]), l("div", {
2931
2942
  class: `${a}-toolbar-right`
2932
2943
  }, [v])])])]);
2933
2944
  };
2934
2945
  }
2935
- }), be = /* @__PURE__ */ C({
2946
+ }), be = /* @__PURE__ */ y({
2936
2947
  name: "MdEditorV3",
2937
2948
  props: ut,
2938
2949
  emits: ct,
@@ -2941,48 +2952,72 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2941
2952
  noKatex: o,
2942
2953
  noMermaid: n,
2943
2954
  noHighlight: i
2944
- } = e, s = U({
2955
+ } = e, s = Y({
2945
2956
  scrollAuto: e.scrollAuto
2946
- }), c = x(), u = x(), m = K(() => xe({
2957
+ }), c = E(), d = E(), u = P(() => xe({
2947
2958
  props: e,
2948
2959
  ctx: t
2949
- }, "defToolbars")), v = K(() => xe({
2960
+ }, "defToolbars")), v = P(() => xe({
2950
2961
  props: e,
2951
2962
  ctx: t
2952
- }, "defFooters")), b = dt(e), [h, f] = mt(e, t, {
2953
- editorId: b
2963
+ }, "defFooters")), m = dt(e), [f, g] = mt(e, t, {
2964
+ editorId: m
2954
2965
  }), p = bt(e, {
2955
- editorId: b
2966
+ editorId: m
2956
2967
  });
2957
- return vt(e, t, {
2958
- editorId: b
2959
- }), gt(e), ft(e, t, {
2960
- editorId: b
2961
- }), ht(e, t, {
2962
- editorId: b,
2968
+ vt(e, t, {
2969
+ editorId: m
2970
+ }), gt(e), ht(e, t, {
2971
+ editorId: m
2972
+ }), ft(e, t, {
2973
+ editorId: m,
2963
2974
  catalogVisible: p,
2964
- setting: h,
2965
- updateSetting: f,
2966
- codeRef: u
2975
+ setting: f,
2976
+ updateSetting: g,
2977
+ codeRef: d
2967
2978
  }), pt(e, {
2968
2979
  rootRef: c,
2969
- editorId: b,
2970
- setting: h,
2971
- updateSetting: f,
2980
+ editorId: m,
2981
+ setting: f,
2982
+ updateSetting: g,
2972
2983
  catalogVisible: p,
2973
- defToolbars: m
2984
+ defToolbars: u
2974
2985
  }), ge(() => {
2975
- g.clear(b);
2976
- }), () => l("div", {
2977
- id: b,
2978
- class: [a, e.class, e.theme === "dark" && `${a}-dark`, h.fullscreen || h.pageFullscreen ? `${a}-fullscreen` : ""],
2986
+ h.clear(m);
2987
+ });
2988
+ const k = ($) => {
2989
+ t.emit("update:modelValue", $);
2990
+ }, S = ($) => {
2991
+ e.onChange?.($), t.emit("onChange", $);
2992
+ }, A = ($) => {
2993
+ e.onHtmlChanged?.($), t.emit("onHtmlChanged", $);
2994
+ }, D = ($) => {
2995
+ e.onGetCatalog?.($), t.emit("onGetCatalog", $);
2996
+ }, I = ($) => {
2997
+ e.onBlur?.($), t.emit("onBlur", $);
2998
+ }, M = ($) => {
2999
+ e.onFocus?.($), t.emit("onFocus", $);
3000
+ }, L = ($) => {
3001
+ e.onInput?.($), t.emit("onInput", $);
3002
+ }, C = ($) => {
3003
+ e.onDrop?.($), t.emit("onDrop", $);
3004
+ }, R = ($) => {
3005
+ e.oninputBoxWidthChange?.($), t.emit("oninputBoxWidthChange", $);
3006
+ }, z = () => {
3007
+ e.onRemount?.(), t.emit("onRemount");
3008
+ }, q = ($) => {
3009
+ s.scrollAuto = $;
3010
+ };
3011
+ return () => l("div", {
3012
+ id: m,
3013
+ class: [a, e.class, e.theme === "dark" && `${a}-dark`, f.fullscreen || f.pageFullscreen ? `${a}-fullscreen` : ""],
2979
3014
  style: e.style,
2980
3015
  ref: c
2981
- }, [e.toolbars.length > 0 && l(Zl, {
3016
+ }, [e.toolbars.length > 0 && l(Xl, {
2982
3017
  toolbars: e.toolbars,
2983
3018
  toolbarsExclude: e.toolbarsExclude
2984
- }, null), l(Wl, {
2985
- ref: u,
3019
+ }, null), l(_l, {
3020
+ ref: d,
2986
3021
  modelValue: e.modelValue,
2987
3022
  mdHeadingId: e.mdHeadingId,
2988
3023
  noMermaid: n,
@@ -2996,53 +3031,34 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2996
3031
  maxlength: e.maxLength,
2997
3032
  autoDetectCode: e.autoDetectCode,
2998
3033
  noHighlight: i,
2999
- updateModelValue: (T) => {
3000
- t.emit("update:modelValue", T);
3001
- },
3002
- onChange: (T) => {
3003
- e.onChange?.(T), t.emit("onChange", T);
3004
- },
3005
- onHtmlChanged: (T) => {
3006
- e.onHtmlChanged?.(T), t.emit("onHtmlChanged", T);
3007
- },
3008
- onGetCatalog: (T) => {
3009
- e.onGetCatalog?.(T), t.emit("onGetCatalog", T);
3010
- },
3011
- onBlur: (T) => {
3012
- e.onBlur?.(T), t.emit("onBlur", T);
3013
- },
3014
- onFocus: (T) => {
3015
- e.onFocus?.(T), t.emit("onFocus", T);
3016
- },
3017
- onInput: (T) => {
3018
- e.onInput?.(T), t.emit("onInput", T);
3019
- },
3034
+ updateModelValue: k,
3035
+ onChange: S,
3036
+ onHtmlChanged: A,
3037
+ onGetCatalog: D,
3038
+ onBlur: I,
3039
+ onFocus: M,
3040
+ onInput: L,
3020
3041
  completions: e.completions,
3021
3042
  noImgZoomIn: e.noImgZoomIn,
3022
- onDrop: (T) => {
3023
- e.onDrop?.(T), t.emit("onDrop", T);
3024
- },
3043
+ onDrop: C,
3025
3044
  inputBoxWidth: e.inputBoxWidth,
3026
- oninputBoxWidthChange: (T) => {
3027
- e.oninputBoxWidthChange?.(T), t.emit("oninputBoxWidthChange", T);
3028
- },
3045
+ oninputBoxWidthChange: R,
3029
3046
  sanitizeMermaid: e.sanitizeMermaid,
3030
3047
  transformImgUrl: e.transformImgUrl,
3031
3048
  codeFoldable: e.codeFoldable,
3032
3049
  autoFoldThreshold: e.autoFoldThreshold,
3033
- onRemount: () => {
3034
- e.onRemount?.(), t.emit("onRemount");
3035
- },
3050
+ onRemount: z,
3036
3051
  catalogLayout: e.catalogLayout,
3037
3052
  catalogMaxDepth: e.catalogMaxDepth,
3038
- noEcharts: e.noEcharts
3039
- }, null), e.footers.length > 0 && l(jl, {
3053
+ noEcharts: e.noEcharts,
3054
+ previewComponent: e.previewComponent
3055
+ }, null), e.footers.length > 0 && l(Yl, {
3040
3056
  modelValue: e.modelValue,
3041
3057
  footers: e.footers,
3042
3058
  defFooters: v.value,
3043
- noScrollAuto: !h.preview && !h.htmlPreview || h.previewOnly,
3059
+ noScrollAuto: !f.preview && !f.htmlPreview || f.previewOnly,
3044
3060
  scrollAuto: s.scrollAuto,
3045
- onScrollAutoChange: (T) => s.scrollAuto = T
3061
+ onScrollAutoChange: q
3046
3062
  }, null)]);
3047
3063
  }
3048
3064
  });