md-editor-v3 6.1.1 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,59 +1,59 @@
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 ie, onMounted as K, ref as I, defineComponent as C, createVNode as l, reactive as Y, toRef as ke, computed as P, Fragment as _e, cloneVNode as ne, createApp as Ct, shallowRef as kt, onBeforeUnmount as he } 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
- 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";
9
+ import { deleteLine as Nt, history as $e, defaultKeymap as At, historyKeymap as Dt, indentWithTab as Rt, undo as Mt, 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 ce, 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 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 xe } 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
- import { g as xe } from "./chunks/vue-tsx.mjs";
22
+ import { g as Se } from "./chunks/vue-tsx.mjs";
23
23
  const oo = (e, t, o) => {
24
24
  const n = r("editorId"), i = r("setting");
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
+ ie(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);
56
- }, ce = async (e, t, o) => {
55
+ ), K(d);
56
+ }, ue = async (e, t, o) => {
57
57
  if (/^h[1-6]$/.test(e))
58
58
  return lo(e, t);
59
59
  if (e === "prettier")
@@ -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] = pe(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] = pe(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] = pe(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
+ }, pe = (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
@@ -389,7 +389,7 @@ class go {
389
389
  */
390
390
  setTabSize(t) {
391
391
  this.toggleTabSize([
392
- ie.tabSize.of(t),
392
+ ce.tabSize.of(t),
393
393
  Zt.of(" ".repeat(t))
394
394
  ]);
395
395
  }
@@ -417,54 +417,54 @@ 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
- this.toggleReadOnly([ie.readOnly.of(t)]);
430
+ this.toggleReadOnly([ce.readOnly.of(t)]);
431
431
  }
432
432
  setMaxLength(t) {
433
433
  this.maxLength = t, this.toggleMaxlength([
434
- ie.changeFilter.of((o) => o.newDoc.length <= t)
434
+ ce.changeFilter.of((o) => o.newDoc.length <= t)
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 = I(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
  )
463
463
  }), s.focus();
464
- }, Se = (e) => (t, o, n, i) => {
464
+ }, Ie = (e) => (t, o, n, i) => {
465
465
  const s = e.slice(i - n);
466
466
  t.dispatch(t.state.replaceSelection(`${s} `));
467
- }, Ie = (e) => {
467
+ }, Ee = (e) => {
468
468
  const t = (o) => {
469
469
  const n = o.matchBefore(
470
470
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/
@@ -478,7 +478,7 @@ const fo = (e, t) => {
478
478
  return {
479
479
  label: c,
480
480
  type: "text",
481
- apply: Se(c)
481
+ apply: Ie(c)
482
482
  };
483
483
  }),
484
484
  // 任务列表
@@ -487,7 +487,7 @@ const fo = (e, t) => {
487
487
  return {
488
488
  label: s,
489
489
  type: "text",
490
- apply: Se(s)
490
+ apply: Ie(s)
491
491
  };
492
492
  }),
493
493
  // 代码
@@ -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
  }))
@@ -580,10 +580,10 @@ $$`, "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, y, "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`
@@ -598,11 +598,11 @@ $$`, "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`
@@ -617,10 +617,10 @@ $$`, "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, y, "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`
@@ -635,10 +635,10 @@ $$`, "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, y, "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`
@@ -658,7 +658,7 @@ $$`, "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`
@@ -676,7 +676,7 @@ $$`, "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`
@@ -694,7 +694,7 @@ $$`, "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`
@@ -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, y, "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`
@@ -738,8 +738,8 @@ $$`, "title")
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 = I(), c = I(), d = I(), 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([ke(() => u.isFullscreen), ke(() => u.imgSrc)], () => {
770
+ u.imgSrc && ie(() => {
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, fe, [eo(g.toDataURL("image/png"))], e.onOk), m();
836
836
  }
837
837
  }
838
838
  }, [t.value.clipModalTips?.buttonUpload || t.value.linkModalTips?.buttonOK])]), l("input", {
@@ -875,14 +875,53 @@ $$`, "title")
875
875
  }), Ao = /* @__PURE__ */ C({
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 = I(!1), c = I(!1), d = I(), u = () => {
879
+ h.emit(e, fe, Array.from(d.value.files || [])), d.value.value = "";
880
+ }, v = (k, E) => {
881
+ o?.value || h.emit(e, y, k, E);
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,71 +929,34 @@ $$`, "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
962
  }), Do = /* @__PURE__ */ C({
@@ -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, y, "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
+ }), Ro = /* @__PURE__ */ C({
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 = I(!1), c = (v) => {
984
+ o?.value || h.emit(e, y, 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
+ }), Mo = /* @__PURE__ */ C({
1027
1029
  name: "ToolbarLink",
1028
1030
  setup() {
1029
1031
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1032,10 +1034,10 @@ $$`, "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, y, "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`
@@ -1044,79 +1046,79 @@ $$`, "title")
1044
1046
  }), Fo = /* @__PURE__ */ C({
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 = I(!1), c = (v) => {
1050
+ o?.value || h.emit(e, y, 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,7 +1126,7 @@ $$`, "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`
@@ -1140,10 +1142,10 @@ $$`, "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`
@@ -1158,10 +1160,10 @@ $$`, "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, y, "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`
@@ -1179,7 +1181,7 @@ $$`, "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`
@@ -1194,10 +1196,10 @@ $$`, "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, y, "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`
@@ -1215,7 +1217,7 @@ $$`, "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`
@@ -1233,7 +1235,7 @@ $$`, "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`
@@ -1248,10 +1250,10 @@ $$`, "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, y, "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`
@@ -1266,10 +1268,10 @@ $$`, "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`
@@ -1284,10 +1286,10 @@ $$`, "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`
@@ -1302,10 +1304,10 @@ $$`, "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, y, "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`
@@ -1320,10 +1322,10 @@ $$`, "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, y, "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`
@@ -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, y, "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`
@@ -1361,14 +1363,14 @@ $$`, "title")
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 = I(n());
1373
+ return N([o], () => {
1372
1374
  i.value = n();
1373
1375
  }), () => l("div", {
1374
1376
  class: `${a}-table-shape`,
@@ -1378,46 +1380,46 @@ $$`, "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
1396
  }), Zo = /* @__PURE__ */ C({
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 = I(!1), d = (m) => {
1400
+ c.value = m;
1401
+ }, u = (m) => {
1402
+ o?.value || h.emit(e, y, "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`
@@ -1433,10 +1435,10 @@ $$`, "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, y, "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`
@@ -1445,72 +1447,72 @@ $$`, "title")
1445
1447
  }), Jo = /* @__PURE__ */ C({
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 = I(!1), c = (v) => {
1451
+ o?.value || h.emit(e, y, 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`
@@ -1526,10 +1528,10 @@ $$`, "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, y, "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`
@@ -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, y, "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 = I(!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++}`
@@ -1655,7 +1657,7 @@ const Ze = () => {
1655
1657
  key: "bar-code"
1656
1658
  }, null);
1657
1659
  case "link":
1658
- return l(Ro, {
1660
+ return l(Mo, {
1659
1661
  key: "bar-link"
1660
1662
  }, null);
1661
1663
  case "image":
@@ -1717,37 +1719,37 @@ const Ze = () => {
1717
1719
  key: "bar-mermaid"
1718
1720
  }, null);
1719
1721
  case "katex":
1720
- return l(Mo, {
1722
+ return l(Ro, {
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(E) {
1736
+ h.emit(e, y, "universal", {
1737
+ generate: E
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(E) {
1751
+ h.emit(e, y, "universal", {
1752
+ generate: E
1751
1753
  });
1752
1754
  }
1753
1755
  }) : "";
@@ -1765,54 +1767,61 @@ 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
+ }), ge = re.define(), al = qe.define({
1769
1771
  create() {
1770
1772
  return null;
1771
1773
  },
1772
1774
  update(e, t) {
1773
- for (const o of t.effects) o.is(ve) && (e = o.value);
1775
+ for (const o of t.effects) o.is(ge) && (e = o.value);
1774
1776
  return e;
1775
1777
  },
1776
1778
  provide: (e) => Vt.from(e)
1777
1779
  }), nl = (e) => {
1778
- const t = (n, i) => {
1779
- n.dispatch({
1780
- effects: ve.of({
1781
- pos: i,
1780
+ let t = null;
1781
+ const o = (s, c) => {
1782
+ t && t.kind === c.kind && t.pos === c.pos || (t = c, s.dispatch({
1783
+ effects: ge.of({
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: ge.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", Le = "var(--md-color)", sl = "#56b6c2", il = "#fff", Q = "#3f4a54", Ne = "#2d8cf0", cl = "#2d8cf0", ul = "#3f4a54", Ae = "#d19a66", dl = "#c678dd", ml = "#f6f6f6", bl = "#ceedfa33", De = "var(--md-bk-color)", de = "var(--md-bk-color)", vl = "#bad5fa", Re = "#3f4a54", gl = B.theme(
1805
1814
  {
1806
1815
  "&": {
1807
- color: Z,
1808
- backgroundColor: Ae
1816
+ color: Q,
1817
+ backgroundColor: De
1809
1818
  },
1810
1819
  ".cm-content": {
1811
- caretColor: De
1820
+ caretColor: Re
1812
1821
  },
1813
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: De },
1822
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: Re },
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": {
@@ -1828,8 +1837,8 @@ const Ze = () => {
1828
1837
  backgroundColor: "#bad0f847"
1829
1838
  },
1830
1839
  ".cm-gutters": {
1831
- backgroundColor: Ae,
1832
- color: Z,
1840
+ backgroundColor: De,
1841
+ color: Q,
1833
1842
  borderRight: "1px solid",
1834
1843
  borderColor: "var(--md-border-color)"
1835
1844
  },
@@ -1843,7 +1852,7 @@ const Ze = () => {
1843
1852
  },
1844
1853
  ".cm-tooltip": {
1845
1854
  border: "1px solid var(--md-border-color)",
1846
- backgroundColor: ue
1855
+ backgroundColor: de
1847
1856
  },
1848
1857
  ".cm-tooltip .cm-tooltip-arrow:before": {
1849
1858
  borderTopColor: "var(--md-border-color)",
@@ -1851,71 +1860,71 @@ const Ze = () => {
1851
1860
  borderBottomColor: "var(--md-border-color)"
1852
1861
  },
1853
1862
  ".cm-tooltip .cm-tooltip-arrow:after": {
1854
- borderTopColor: ue,
1855
- borderBottomColor: ue
1863
+ borderTopColor: de,
1864
+ borderBottomColor: de
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: Le },
1876
+ { tag: [b.function(b.variableName), b.labelName], color: cl },
1877
+ { tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Ae },
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: Ne },
1905
+ { tag: b.strong, fontWeight: "bold" },
1906
+ { tag: b.emphasis, fontStyle: "italic" },
1907
+ { tag: b.strikethrough, textDecoration: "line-through" },
1908
+ { tag: b.link, color: Ne, textDecoration: "underline" },
1909
+ { tag: b.heading, fontWeight: "bold", color: Le },
1910
+ { tag: [b.atom, b.bool, b.special(b.variableName)], color: Ae },
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", Fe = "var(--md-color)", pl = "#56b6c2", Tl = "#ffffff", ee = "var(--md-color)", Be = "#e5c07b", wl = "#e5c07b", yl = "var(--md-color)", Pe = "#d19a66", Cl = "#c678dd", kl = "#21252b", $l = "#2c313a", He = "var(--md-bk-color)", me = "var(--md-bk-color)", xl = "#ceedfa33", Oe = "#528bff", Sl = B.theme(
1908
1917
  {
1909
1918
  "&": {
1910
- color: X,
1911
- backgroundColor: Pe
1919
+ color: ee,
1920
+ backgroundColor: He
1912
1921
  },
1913
1922
  ".cm-content": {
1914
- caretColor: He
1923
+ caretColor: Oe
1915
1924
  },
1916
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: He },
1925
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: Oe },
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": {
@@ -1931,8 +1940,8 @@ const Ze = () => {
1931
1940
  backgroundColor: "#bad0f847"
1932
1941
  },
1933
1942
  ".cm-gutters": {
1934
- backgroundColor: Pe,
1935
- color: X,
1943
+ backgroundColor: He,
1944
+ color: ee,
1936
1945
  borderRight: "1px solid",
1937
1946
  borderColor: "var(--md-border-color)"
1938
1947
  },
@@ -1946,7 +1955,7 @@ const Ze = () => {
1946
1955
  },
1947
1956
  ".cm-tooltip": {
1948
1957
  border: "1px solid var(--md-border-color)",
1949
- backgroundColor: de
1958
+ backgroundColor: me
1950
1959
  },
1951
1960
  ".cm-tooltip .cm-tooltip-arrow:before": {
1952
1961
  borderTopColor: "var(--md-border-color)",
@@ -1954,63 +1963,63 @@ const Ze = () => {
1954
1963
  borderBottomColor: "var(--md-border-color)"
1955
1964
  },
1956
1965
  ".cm-tooltip .cm-tooltip-arrow:after": {
1957
- borderTopColor: de,
1958
- borderBottomColor: de
1966
+ borderTopColor: me,
1967
+ borderBottomColor: me
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: Fe },
1979
+ { tag: [b.function(b.variableName), b.labelName], color: wl },
1980
+ { tag: [b.color, b.constant(b.name), b.standard(b.name)], color: Pe },
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
- ]), Oe = [
2007
+ { tag: [b.meta, b.comment], color: Be },
2008
+ { tag: b.strong, fontWeight: "bold" },
2009
+ { tag: b.emphasis, fontStyle: "italic" },
2010
+ { tag: b.strikethrough, textDecoration: "line-through" },
2011
+ { tag: b.link, color: Be, textDecoration: "underline" },
2012
+ { tag: b.heading, fontWeight: "bold", color: Fe },
2013
+ { tag: [b.atom, b.bool, b.special(b.variableName)], color: Pe },
2014
+ { tag: [b.processingInstruction, b.string, b.inserted], color: yl },
2015
+ { tag: b.invalid, color: Tl }
2016
+ ]), Ve = [
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, y, "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, y, "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
2046
  fe,
2038
- Array.from(f).filter((p) => /image\/.*/.test(p.type))
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, E, M) => k.replace(g[M], E), 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, y, "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, y, "bold"), !0)
2079
2088
  },
2080
2089
  {
2081
2090
  key: "Ctrl-d",
@@ -2086,137 +2095,160 @@ 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, y, "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, y, "underline"), !0),
2106
+ shift: () => (h.emit(e, y, "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, y, "italic"), !0),
2113
+ shift: () => (h.emit(e, y, "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, y, "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, y, "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, y, "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, y, "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, y, "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, y, "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, y, "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, y, "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, y, "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, y, "code"), !0),
2164
+ any(L, T) {
2165
+ return (T.ctrlKey || T.metaKey) && T.altKey && T.code === "KeyC" ? (h.emit(e, y, "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, y, "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, y, "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, T) => (T.ctrlKey || T.metaKey) && T.altKey && T.shiftKey && T.code === "KeyT" ? (h.emit(e, y, "table"), !0) : !1
2171
2180
  },
2172
2181
  ...to
2173
- ], 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
- `(?<![a-z0-9.+-])(${Nl.source}|${Al.source}|${Dl.source}|${Ml.source})`,
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, Rl = /\/(?!\/)[^\s<>"'`()]+/i, se = new RegExp(
2183
+ `(${Nl.source}|${Al.source}|${Dl.source}|${Rl.source})`,
2175
2184
  "gi"
2176
- ), 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;
2181
- Ve.lastIndex = 0;
2182
- let I;
2183
- for (; I = Ve.exec(T); ) {
2184
- if (!I[0]) continue;
2185
- const A = I[0];
2186
- 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 });
2185
+ ), Ml = /[a-z0-9.+-]/i, Fl = (e) => {
2186
+ const t = [];
2187
+ se.lastIndex = 0;
2188
+ let o;
2189
+ for (; o = se.exec(e); ) {
2190
+ const n = o.index ?? 0, i = n > 0 ? e[n - 1] : "";
2191
+ if (i && Ml.test(i) || i === "<" && e[n] === "/")
2192
+ continue;
2193
+ const c = n + o[0].length;
2194
+ t.push([n, c]);
2195
+ }
2196
+ return t;
2197
+ }, Bl = (e, t, o) => e.some((n) => n.from === t && n.to === o), Pl = (e) => {
2198
+ const t = e.shortenText || (() => "..."), o = re.define(), n = re.define(), i = (u, v) => {
2199
+ const m = new Ht(), f = [];
2200
+ for (let g = 1; g <= u.doc.lines; g++) {
2201
+ const p = u.doc.line(g), k = p.text;
2202
+ se.lastIndex = 0;
2203
+ const E = e.findTexts?.({
2204
+ state: u,
2205
+ lineText: k,
2206
+ lineNumber: p.number,
2207
+ lineFrom: p.from,
2208
+ lineTo: p.to,
2209
+ defaultTextRegex: se
2210
+ }) ?? Fl(k);
2211
+ for (const M of E) {
2212
+ if (!M) continue;
2213
+ const [A, S] = M;
2214
+ if (typeof A != "number" || typeof S != "number" || A < 0 || S <= A || A >= k.length || S > k.length)
2215
+ continue;
2216
+ const D = k.slice(A, S);
2217
+ if (!D || D.length <= e.maxLength)
2218
+ continue;
2219
+ const L = p.from + A, T = p.from + S;
2220
+ if (Bl(v, L, T)) {
2221
+ f.push({ from: L, to: T });
2190
2222
  continue;
2191
2223
  }
2192
- const N = t(A);
2193
- b.add(
2224
+ const R = t(D);
2225
+ m.add(
2194
2226
  L,
2195
- S,
2196
- Wt.replace({ widget: new s(N, A, L, S) })
2227
+ T,
2228
+ Wt.replace({ widget: new s(R, D, L, T) })
2197
2229
  );
2198
2230
  }
2199
2231
  }
2200
- return { deco: b.finish(), expanded: h };
2232
+ return { deco: m.finish(), expanded: f };
2201
2233
  };
2202
2234
  class s extends _t {
2203
- constructor(v, b, h, f) {
2204
- super(), this.short = v, this.raw = b, this.from = h, this.to = f;
2235
+ constructor(v, m, f, g) {
2236
+ super(), this.short = v, this.raw = m, this.from = f, this.to = g;
2205
2237
  }
2206
2238
  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),
2239
+ const m = document.createElement("span");
2240
+ 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) => {
2241
+ f.preventDefault(), f.stopPropagation(), v.dispatch({
2242
+ selection: U.cursor(this.from),
2211
2243
  effects: o.of({
2212
2244
  from: this.from,
2213
2245
  to: this.to,
2214
2246
  expand: !0
2215
2247
  })
2216
2248
  }), v.focus();
2217
- }), b.addEventListener("click", (h) => {
2218
- h.preventDefault();
2219
- }), b;
2249
+ }), m.addEventListener("click", (f) => {
2250
+ f.preventDefault();
2251
+ }), m;
2220
2252
  }
2221
2253
  ignoreEvent() {
2222
2254
  return !1;
@@ -2226,119 +2258,119 @@ const Ze = () => {
2226
2258
  }
2227
2259
  }
2228
2260
  const c = qe.define({
2229
- create(m) {
2230
- return i(m, []);
2261
+ create(u) {
2262
+ return i(u, []);
2231
2263
  },
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),
2264
+ update(u, v) {
2265
+ let m = u.expanded;
2266
+ v.docChanged && m.length && (m = m.map(({ from: g, to: p }) => ({
2267
+ from: v.changes.mapPos(g, 1),
2236
2268
  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;
2269
+ })).filter(({ from: g, to: p }) => g < p));
2270
+ let f = m !== u.expanded;
2271
+ for (const g of v.effects)
2272
+ g.is(o) ? g.value.expand ? m = [{ from: g.value.from, to: g.value.to }] : m = m.filter(
2273
+ ({ from: p, to: k }) => p !== g.value.from || k !== g.value.to
2274
+ ) : g.is(n) && m.length > 0 && (m = []);
2275
+ return !f && m !== u.expanded && (f = !0), v.docChanged || f ? i(v.state, m) : u;
2244
2276
  },
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)
2277
+ provide: (u) => B.decorations.compute([u], (v) => v.field(u).deco)
2278
+ }), d = B.domEventHandlers({
2279
+ mousedown(u, v) {
2280
+ const m = v.state.field(c, !1);
2281
+ if (!m || m.expanded.length === 0)
2250
2282
  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
2283
+ const f = u.target;
2284
+ if (f && v.dom.contains(f)) {
2285
+ const g = v.posAtDOM(f, 0);
2286
+ if (g != null && g !== -1 && m.expanded.some(
2287
+ ({ from: k, to: E }) => g >= k && g <= E
2256
2288
  ))
2257
2289
  return !1;
2258
2290
  }
2259
2291
  return v.dispatch({ effects: n.of(void 0) }), !1;
2260
2292
  }
2261
2293
  });
2262
- return [c, u];
2294
+ return [c, d];
2263
2295
  };
2264
- R.EDIT_CONTEXT = !1;
2265
- const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension, Bl = (e) => {
2296
+ B.EDIT_CONTEXT = !1;
2297
+ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension, Hl = (e) => {
2266
2298
  const t = Xe(e);
2267
2299
  return e.compartment ? e.compartment.of(t) : t;
2268
- }, Pl = (e) => {
2300
+ }, Ol = (e) => {
2269
2301
  const t = r("tabWidth"), o = r("editorId"), n = r("theme"), i = r("previewTheme"), s = r("language"), c = r(
2270
2302
  "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
2273
- }), Te = () => [
2303
+ ), d = r("disabled"), u = r("showToolbarName"), v = r("customIcon"), m = r("noUploadImg"), f = r("tableShape"), g = r("noPrettier"), p = r("codeTheme"), k = r("setting"), E = r("updateSetting"), M = r("catalogVisible"), A = r("defToolbars"), S = r("floatingToolbars"), D = r("rootRef"), L = I(), T = kt(), R = I(!1), z = new j(), q = new j(), $ = new j(), Te = new j(), Je = new j(), Qe = Ll(o, {
2304
+ noPrettier: g
2305
+ }), we = () => [
2274
2306
  ...Qe,
2275
2307
  ...At,
2276
2308
  ...Dt,
2277
- Mt
2278
- ], te = {
2279
- paste: El(e, k),
2309
+ Rt
2310
+ ], oe = {
2311
+ paste: El(e, T),
2280
2312
  blur: e.onBlur,
2281
2313
  focus: e.onFocus,
2282
2314
  drop: e.onDrop,
2283
2315
  compositionstart: () => {
2284
- V.value = !0;
2316
+ R.value = !0;
2285
2317
  },
2286
- compositionend: (w, D) => {
2287
- V.value = !1, e.updateModelValue(D.state.doc.toString());
2318
+ compositionend: (w, F) => {
2319
+ R.value = !1, e.updateModelValue(F.state.doc.toString());
2288
2320
  },
2289
2321
  input: (w) => {
2290
2322
  e.onInput && e.onInput(w);
2291
- const { data: D } = w;
2292
- e.maxlength && e.modelValue.length + D.length > e.maxlength && g.emit(o, j, {
2323
+ const { data: F } = w;
2324
+ e.maxlength && e.modelValue.length + F.length > e.maxlength && h.emit(o, X, {
2293
2325
  name: "overlength",
2294
2326
  message: "The input text is too long",
2295
- data: D
2327
+ data: F
2296
2328
  });
2297
2329
  }
2298
2330
  }, et = nl({
2299
2331
  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);
2332
+ w.provide("editorId", o), w.provide("theme", n), w.provide("previewTheme", i), w.provide("language", s), w.provide("disabled", d), w.provide("noUploadImg", m), w.provide("tableShape", f), w.provide("noPrettier", g), w.provide("codeTheme", p), w.provide("showToolbarName", u), w.provide("setting", k), w.provide("updateSetting", E), w.provide("usedLanguageText", c), w.provide("catalogVisible", M), w.provide("defToolbars", A), w.provide("tabWidth", t), w.provide("customIcon", v), w.provide("floatingToolbars", S), w.provide("rootRef", D);
2301
2333
  }
2302
2334
  }), tt = [
2303
2335
  {
2304
2336
  type: "theme",
2305
- extension: ({ theme: w }) => w.value === "light" ? Me : Oe,
2306
- compartment: Q,
2337
+ extension: ({ theme: w }) => w.value === "light" ? Me : Ve,
2338
+ compartment: z,
2307
2339
  options: {
2308
2340
  theme: n
2309
2341
  }
2310
2342
  },
2311
2343
  {
2312
2344
  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()));
2345
+ extension: B.updateListener.of((w) => {
2346
+ w.docChanged && (e.onChange(w.state.doc.toString()), R.value || e.updateModelValue(w.state.doc.toString()));
2315
2347
  })
2316
2348
  },
2317
2349
  {
2318
2350
  type: "domEventHandlers",
2319
- extension: R.domEventHandlers(te),
2320
- compartment: pe
2351
+ extension: B.domEventHandlers(oe),
2352
+ compartment: Te
2321
2353
  },
2322
2354
  {
2323
2355
  type: "completions",
2324
- extension: Ie(e.completions),
2325
- compartment: ee
2356
+ extension: Ee(e.completions),
2357
+ compartment: q
2326
2358
  },
2327
2359
  {
2328
2360
  type: "history",
2329
- extension: ke(),
2330
- compartment: se
2361
+ extension: $e(),
2362
+ compartment: $
2331
2363
  }
2332
- ], we = G.codeMirrorExtensions(
2364
+ ], ye = Z.codeMirrorExtensions(
2333
2365
  [
2334
2366
  // 横向换行
2335
2367
  {
2336
2368
  type: "lineWrapping",
2337
- extension: R.lineWrapping
2369
+ extension: B.lineWrapping
2338
2370
  },
2339
2371
  {
2340
2372
  type: "keymap",
2341
- extension: zt.of(Te())
2373
+ extension: zt.of(we())
2342
2374
  },
2343
2375
  // 解决多行placeholder时,光标异常的情况
2344
2376
  {
@@ -2351,7 +2383,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2351
2383
  },
2352
2384
  {
2353
2385
  type: "linkShortener",
2354
- extension: (w) => Fl(w),
2386
+ extension: (w) => Pl(w),
2355
2387
  options: {
2356
2388
  maxLength: 30
2357
2389
  }
@@ -2365,204 +2397,204 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2365
2397
  {
2366
2398
  editorId: o,
2367
2399
  theme: n.value,
2368
- keyBindings: Te()
2400
+ keyBindings: we()
2369
2401
  }
2370
- ), ot = () => [...tt, ...we].map(Bl);
2371
- return _(() => {
2372
- const w = new R({
2402
+ ), ot = () => [...tt, ...ye].map(Hl);
2403
+ return K(() => {
2404
+ const w = new B({
2373
2405
  doc: e.modelValue,
2374
- parent: M.value,
2406
+ parent: L.value,
2375
2407
  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, {
2408
+ }), F = new go(w);
2409
+ T.value = F, setTimeout(() => {
2410
+ 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 && w.focus();
2411
+ }, 0), h.on(o, {
2380
2412
  name: Ke,
2381
2413
  callback() {
2382
- Rt(w);
2414
+ Mt(w);
2383
2415
  }
2384
- }), g.on(o, {
2416
+ }), h.on(o, {
2385
2417
  name: Ue,
2386
2418
  callback() {
2387
2419
  Ft(w);
2388
2420
  }
2389
- }), g.on(o, {
2421
+ }), h.on(o, {
2390
2422
  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 }
2423
+ async callback(O, H = {}) {
2424
+ if (O === "image" && H.transform) {
2425
+ const V = e.transformImgUrl(H.url);
2426
+ if (V instanceof Promise)
2427
+ V.then(async (_) => {
2428
+ const { text: W, options: J } = await ue(
2429
+ O,
2430
+ T.value,
2431
+ { ...H, url: _ }
2400
2432
  );
2401
- k.value?.replaceSelectedText(H, Y, o);
2402
- }).catch((O) => {
2403
- console.error(O);
2433
+ T.value?.replaceSelectedText(W, J, o);
2434
+ }).catch((_) => {
2435
+ console.error(_);
2404
2436
  });
2405
2437
  else {
2406
- const { text: O, options: H } = await ce(B, k.value, {
2407
- ...F,
2408
- url: P
2438
+ const { text: _, options: W } = await ue(O, T.value, {
2439
+ ...H,
2440
+ url: V
2409
2441
  });
2410
- k.value?.replaceSelectedText(O, H, o);
2442
+ T.value?.replaceSelectedText(_, W, o);
2411
2443
  }
2412
2444
  } else {
2413
- const { text: P, options: O } = await ce(
2414
- B,
2415
- k.value,
2416
- F
2445
+ const { text: V, options: _ } = await ue(
2446
+ O,
2447
+ T.value,
2448
+ H
2417
2449
  );
2418
- k.value?.replaceSelectedText(P, O, o);
2450
+ T.value?.replaceSelectedText(V, _, o);
2419
2451
  }
2420
2452
  }
2421
- }), g.on(o, {
2453
+ }), h.on(o, {
2422
2454
  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];
2455
+ callback: Et((O) => {
2456
+ const H = { ...oe }, V = Object.keys(oe);
2457
+ for (const _ in O) {
2458
+ const W = _;
2459
+ V.includes(W) ? H[W] = (J, Ce) => {
2460
+ O[W](J, Ce), J.defaultPrevented || oe[W](J, Ce);
2461
+ } : H[W] = O[W];
2430
2462
  }
2431
- k.value?.view.dispatch({
2432
- effects: pe.reconfigure(
2433
- R.domEventHandlers(F)
2463
+ T.value?.view.dispatch({
2464
+ effects: Te.reconfigure(
2465
+ B.domEventHandlers(H)
2434
2466
  )
2435
2467
  });
2436
2468
  })
2437
- }), g.on(o, {
2469
+ }), h.on(o, {
2438
2470
  name: jt,
2439
- callback: (B, F) => {
2440
- const P = w.state.doc.line(B);
2471
+ callback: (O, H) => {
2472
+ const V = w.state.doc.line(O);
2441
2473
  w.dispatch(
2442
- w.state.update({ changes: { from: P.from, to: P.to, insert: F } })
2474
+ w.state.update({ changes: { from: V.from, to: V.to, insert: H } })
2443
2475
  );
2444
2476
  }
2445
- }), g.on(o, {
2477
+ }), h.on(o, {
2446
2478
  name: Yt,
2447
2479
  callback() {
2448
- g.emit(o, $e, w);
2480
+ h.emit(o, xe, w);
2449
2481
  }
2450
- }), g.emit(o, $e, w);
2451
- }), E(
2482
+ }), h.emit(o, xe, w);
2483
+ }), N(
2452
2484
  n,
2453
2485
  () => {
2454
- k.value?.view.dispatch({
2455
- effects: Q.reconfigure(n.value === "light" ? Me : Oe)
2486
+ T.value?.view.dispatch({
2487
+ effects: z.reconfigure(n.value === "light" ? Me : Ve)
2456
2488
  });
2457
2489
  },
2458
2490
  { deep: !0 }
2459
- ), E(
2491
+ ), N(
2460
2492
  () => e.completions,
2461
2493
  () => {
2462
- k.value?.view.dispatch({
2463
- effects: ee.reconfigure(Ie(e.completions))
2494
+ T.value?.view.dispatch({
2495
+ effects: q.reconfigure(Ee(e.completions))
2464
2496
  });
2465
2497
  },
2466
2498
  { deep: !0 }
2467
- ), E(
2499
+ ), N(
2468
2500
  () => e.modelValue,
2469
2501
  () => {
2470
- k.value?.getValue() !== e.modelValue && k.value?.setValue(e.modelValue);
2502
+ T.value?.getValue() !== e.modelValue && T.value?.setValue(e.modelValue);
2471
2503
  }
2472
- ), E(
2504
+ ), N(
2473
2505
  () => e.placeholder,
2474
2506
  () => {
2475
- k.value?.setPlaceholder(e.placeholder);
2507
+ T.value?.setPlaceholder(e.placeholder);
2476
2508
  }
2477
- ), E([u], () => {
2478
- k.value?.setDisabled(u.value);
2479
- }), E(
2509
+ ), N([d], () => {
2510
+ T.value?.setDisabled(d.value);
2511
+ }), N(
2480
2512
  () => e.readonly,
2481
2513
  () => {
2482
- k.value?.setDisabled(e.readonly);
2514
+ T.value?.setDisabled(e.readonly);
2483
2515
  }
2484
- ), E(
2516
+ ), N(
2485
2517
  () => e.maxlength,
2486
2518
  () => {
2487
- e.maxlength && k.value?.setMaxLength(e.maxlength);
2519
+ e.maxlength && T.value?.setMaxLength(e.maxlength);
2488
2520
  }
2489
- ), ho(() => {
2490
- const w = we.find(
2491
- (D) => D.type === "floatingToolbar"
2521
+ ), fo(() => {
2522
+ const w = ye.find(
2523
+ (F) => F.type === "floatingToolbar"
2492
2524
  );
2493
- w?.compartment && (S.value.length > 0 ? k.value?.view.dispatch({
2525
+ w?.compartment && (S.value.length > 0 ? T.value?.view.dispatch({
2494
2526
  effects: w.compartment.reconfigure(
2495
2527
  Xe(w)
2496
2528
  )
2497
- }) : k.value?.view.dispatch({
2529
+ }) : T.value?.view.dispatch({
2498
2530
  effects: w.compartment.reconfigure([])
2499
2531
  }));
2500
2532
  }, S), {
2501
- inputWrapperRef: M,
2502
- codeMirrorUt: k,
2533
+ inputWrapperRef: L,
2534
+ codeMirrorUt: T,
2503
2535
  resetHistory() {
2504
- k.value?.view.dispatch({ effects: se.reconfigure([]) }), k.value?.view.dispatch({ effects: se.reconfigure(ke()) });
2536
+ T.value?.view.dispatch({ effects: $.reconfigure([]) }), T.value?.view.dispatch({ effects: $.reconfigure($e()) });
2505
2537
  }
2506
2538
  };
2507
- }, Hl = (e, t, o) => {
2508
- const n = r("setting"), i = K(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = U({
2539
+ }, Vl = (e, t, o) => {
2540
+ const n = r("setting"), i = P(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), s = Y({
2509
2541
  resizedWidth: i.value
2510
- }), c = U({
2542
+ }), c = Y({
2511
2543
  width: i.value
2512
- }), u = U({
2544
+ }), d = Y({
2513
2545
  left: i.value,
2514
2546
  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);
2547
+ }), u = (f) => {
2548
+ const g = t.value?.offsetWidth || 0, p = t.value?.getBoundingClientRect().x || 0;
2549
+ let k = f.x - p;
2550
+ k / g < le ? k = g * le : k > g - g * le && (k = g - g * le);
2551
+ const E = `${k / g * 100}%`;
2552
+ c.width = E, d.left = E, s.resizedWidth = E, e.oninputBoxWidthChange?.(E);
2553
+ }, v = (f) => {
2554
+ f.target === o.value && document.addEventListener("mousemove", u);
2555
+ }, m = () => {
2556
+ document.removeEventListener("mousemove", u);
2525
2557
  };
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);
2530
- }), 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(
2558
+ return N([o], () => {
2559
+ document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m), document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
2560
+ }), K(() => {
2561
+ document.addEventListener("mousedown", v), document.addEventListener("mouseup", m);
2562
+ }), he(() => {
2563
+ document.removeEventListener("mousedown", v), document.removeEventListener("mouseup", m);
2564
+ }), N([i], ([f]) => {
2565
+ s.resizedWidth = f, c.width = f, d.left = f;
2566
+ }), N(
2535
2567
  [
2536
2568
  () => n.value.htmlPreview,
2537
2569
  () => n.value.preview,
2538
2570
  () => n.value.previewOnly
2539
2571
  ],
2540
2572
  () => {
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");
2573
+ 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
2574
  },
2543
2575
  {
2544
2576
  immediate: !0
2545
2577
  }
2546
2578
  ), {
2547
2579
  inputWrapperStyle: c,
2548
- resizeOperateStyle: u
2580
+ resizeOperateStyle: d
2549
2581
  };
2550
- }, Ol = () => {
2551
- const e = r("editorId"), t = x(!0), o = ze();
2582
+ }, Wl = () => {
2583
+ const e = r("editorId"), t = I(!0), o = ze();
2552
2584
  return {
2553
- onCatalogActive: (c, u) => {
2554
- const m = document.querySelector(
2585
+ onCatalogActive: (c, d) => {
2586
+ const u = document.querySelector(
2555
2587
  `#${e} .${a}-catalog-editor`
2556
2588
  );
2557
- if (!u || !t.value || !m)
2589
+ if (!d || !t.value || !u)
2558
2590
  return;
2559
- const v = u.offsetTop - m.scrollTop;
2560
- (v > 100 || v < 100) && o(m, u.offsetTop - 100);
2591
+ const v = d.offsetTop - u.scrollTop;
2592
+ (v > 100 || v < 100) && o(u, d.offsetTop - 100);
2561
2593
  },
2562
2594
  onMouseenter: () => t.value = !1,
2563
2595
  onMouseleave: () => t.value = !0
2564
2596
  };
2565
- }, me = /* @__PURE__ */ C({
2597
+ }, be = /* @__PURE__ */ C({
2566
2598
  name: `${xt}CustomScrollbar`,
2567
2599
  props: {
2568
2600
  id: {
@@ -2601,44 +2633,44 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2601
2633
  setup(e, {
2602
2634
  slots: t
2603
2635
  }) {
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 = () => {
2636
+ const o = I(null), n = I(null), i = I(null), s = I(null);
2637
+ let c = null, d = null, u = !1, v = 0, m = 0;
2638
+ const f = () => {
2607
2639
  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) {
2640
+ const S = o.value.clientHeight, D = n.value.scrollHeight, L = n.value.scrollTop;
2641
+ if (D <= S) {
2610
2642
  i.value.style.display = "none", e.alwaysShowTrack || (s.value.style.display = "none");
2611
2643
  return;
2612
2644
  } else
2613
2645
  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 = () => {
2646
+ const T = S / D, R = Math.max(S * T, 20), z = S - R, q = Math.min(L * T, z);
2647
+ i.value.style.height = `${R}px`, i.value.style.top = `${q}px`;
2648
+ }, g = () => f(), p = (S) => {
2649
+ u = !0, v = S.clientY, m = n.value.scrollTop, document.body.style.userSelect = "none";
2650
+ }, k = (S) => {
2651
+ if (!u || !n.value || !o.value) return;
2652
+ const D = S.clientY - v, L = n.value.scrollHeight / o.value.clientHeight;
2653
+ n.value.scrollTop = m + D * L;
2654
+ }, E = () => {
2655
+ u = !1, document.body.style.userSelect = "";
2656
+ }, M = (S) => {
2657
+ n.value && n.value.removeEventListener("scroll", g), n.value = S, n.value ? (n.value.addEventListener("scroll", g), f()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2658
+ }, A = () => {
2627
2659
  if (!o.value) return;
2628
2660
  const S = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
2629
- A(S);
2661
+ M(S);
2630
2662
  };
2631
- return _(async () => {
2632
- await re(), L(), c = new MutationObserver(() => {
2633
- u && cancelAnimationFrame(u), u = requestAnimationFrame(() => {
2634
- L();
2663
+ return K(async () => {
2664
+ await ie(), A(), c = new MutationObserver(() => {
2665
+ d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
2666
+ A();
2635
2667
  });
2636
2668
  }), c.observe(o.value, {
2637
2669
  childList: !0,
2638
2670
  subtree: !0
2639
- }), window.addEventListener("resize", h), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", T), document.addEventListener("mouseup", I);
2640
- }), 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);
2671
+ }), window.addEventListener("resize", f), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", k), document.addEventListener("mouseup", E);
2672
+ }), he(() => {
2673
+ 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", E);
2642
2674
  }), () => l("div", {
2643
2675
  id: e.id,
2644
2676
  class: [`${a}-custom-scrollbar`, e.class],
@@ -2653,44 +2685,57 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2653
2685
  ref: i
2654
2686
  }, null)])]);
2655
2687
  }
2656
- }), Vl = ze(), Wl = /* @__PURE__ */ C({
2688
+ }), _l = ze(), zl = {
2689
+ flex: 1
2690
+ }, ql = /* @__PURE__ */ C({
2657
2691
  name: "MDEditorContent",
2658
2692
  props: st,
2659
2693
  setup(e, t) {
2660
- const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = x(""), u = x(), m = x(), {
2694
+ const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = r("setting"), c = I(""), d = I(), u = I(), {
2661
2695
  inputWrapperRef: v,
2662
- codeMirrorUt: b,
2663
- resetHistory: h
2664
- } = Pl(e), {
2665
- inputWrapperStyle: f,
2696
+ codeMirrorUt: m,
2697
+ resetHistory: f
2698
+ } = Ol(e), {
2699
+ inputWrapperStyle: g,
2666
2700
  resizeOperateStyle: p
2667
- } = Hl(e, u, m);
2668
- oo(e, c, b);
2701
+ } = Vl(e, d, u);
2702
+ oo(e, c, m);
2669
2703
  const {
2670
- onCatalogActive: T,
2671
- onMouseenter: I,
2672
- onMouseleave: A
2673
- } = Ol();
2704
+ onCatalogActive: k,
2705
+ onMouseenter: E,
2706
+ onMouseleave: M
2707
+ } = Wl(), A = (L, T) => {
2708
+ if (!s.value.preview && T.line !== void 0) {
2709
+ L.preventDefault();
2710
+ const R = m.value?.view;
2711
+ if (R) {
2712
+ const z = R.state.doc.line(T.line + 1), q = R.lineBlockAt(z.from)?.top, $ = R.scrollDOM;
2713
+ _l($, q);
2714
+ }
2715
+ }
2716
+ }, S = P(() => s.value.preview ? "preview" : "editor"), D = (L) => {
2717
+ c.value = L, e.onHtmlChanged(L);
2718
+ };
2674
2719
  return t.expose({
2675
2720
  getSelectedText() {
2676
- return b.value?.getSelectedText();
2721
+ return m.value?.getSelectedText();
2677
2722
  },
2678
2723
  focus(L) {
2679
- b.value?.focus(L);
2724
+ m.value?.focus(L);
2680
2725
  },
2681
- resetHistory: h,
2726
+ resetHistory: f,
2682
2727
  getEditorView() {
2683
- return b.value?.view;
2728
+ return m.value?.view;
2684
2729
  }
2685
2730
  }), () => l("div", {
2686
2731
  class: `${a}-content`
2687
2732
  }, [l("div", {
2688
2733
  class: `${a}-content-wrapper`,
2689
- ref: u
2690
- }, [l(me, {
2734
+ ref: d
2735
+ }, [l(be, {
2691
2736
  alwaysShowTrack: !0,
2692
2737
  scrollTarget: `#${o} .cm-scroller`,
2693
- style: f
2738
+ style: g
2694
2739
  }, {
2695
2740
  default: () => [l("div", {
2696
2741
  class: `${a}-input-wrapper`,
@@ -2699,18 +2744,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2699
2744
  }), (s.value.htmlPreview || s.value.preview) && l("div", {
2700
2745
  class: `${a}-resize-operate`,
2701
2746
  style: p,
2702
- ref: m
2703
- }, null), l(me, {
2704
- style: {
2705
- flex: 1
2706
- }
2747
+ ref: u
2748
+ }, null), l(be, {
2749
+ style: zl
2707
2750
  }, {
2708
2751
  default: () => [l(it, {
2709
2752
  modelValue: e.modelValue,
2710
2753
  onChange: e.onChange,
2711
- onHtmlChanged: (L) => {
2712
- c.value = L, e.onHtmlChanged(L);
2713
- },
2754
+ onHtmlChanged: D,
2714
2755
  onGetCatalog: e.onGetCatalog,
2715
2756
  mdHeadingId: e.mdHeadingId,
2716
2757
  noMermaid: e.noMermaid,
@@ -2722,12 +2763,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2722
2763
  sanitizeMermaid: e.sanitizeMermaid,
2723
2764
  codeFoldable: e.codeFoldable,
2724
2765
  autoFoldThreshold: e.autoFoldThreshold,
2725
- onRemount: e.onRemount
2766
+ onRemount: e.onRemount,
2767
+ previewComponent: e.previewComponent,
2768
+ noEcharts: e.noEcharts
2726
2769
  }, null)]
2727
- })]), n.value && l(me, {
2770
+ })]), n.value && l(be, {
2728
2771
  class: `${a}-catalog-${e.catalogLayout}`,
2729
- onMouseenter: I,
2730
- onMouseleave: A
2772
+ onMouseenter: E,
2773
+ onMouseleave: M
2731
2774
  }, {
2732
2775
  default: () => [l(We, {
2733
2776
  theme: i.value,
@@ -2736,23 +2779,14 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2736
2779
  mdHeadingId: e.mdHeadingId,
2737
2780
  key: "internal-catalog",
2738
2781
  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
- },
2782
+ syncWith: S.value,
2783
+ onClick: A,
2750
2784
  catalogMaxDepth: e.catalogMaxDepth,
2751
- onActive: T
2785
+ onActive: k
2752
2786
  }, null)]
2753
2787
  })]);
2754
2788
  }
2755
- }), _l = /* @__PURE__ */ C({
2789
+ }), Ul = /* @__PURE__ */ C({
2756
2790
  props: {
2757
2791
  modelValue: {
2758
2792
  type: String,
@@ -2767,7 +2801,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2767
2801
  class: `${a}-footer-label`
2768
2802
  }, [`${t.value.footer?.markdownTotal}:`]), l("span", null, [e.modelValue?.length || 0])]);
2769
2803
  }
2770
- }), zl = {
2804
+ }), Kl = {
2771
2805
  checked: {
2772
2806
  type: Boolean,
2773
2807
  default: !1
@@ -2781,9 +2815,9 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2781
2815
  type: Boolean,
2782
2816
  default: void 0
2783
2817
  }
2784
- }, ql = /* @__PURE__ */ C({
2818
+ }, Gl = /* @__PURE__ */ C({
2785
2819
  name: `${a}-checkbox`,
2786
- props: zl,
2820
+ props: Kl,
2787
2821
  setup(e) {
2788
2822
  return () => l("div", {
2789
2823
  class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`, e.disabled && `${a}-disabled`],
@@ -2792,7 +2826,7 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2792
2826
  }
2793
2827
  }, null);
2794
2828
  }
2795
- }), Ul = {
2829
+ }), jl = {
2796
2830
  scrollAuto: {
2797
2831
  type: Boolean
2798
2832
  },
@@ -2801,8 +2835,8 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2801
2835
  default: () => {
2802
2836
  }
2803
2837
  }
2804
- }, Kl = /* @__PURE__ */ C({
2805
- props: Ul,
2838
+ }, Yl = /* @__PURE__ */ C({
2839
+ props: jl,
2806
2840
  setup(e) {
2807
2841
  const t = r("usedLanguageText"), o = r("disabled");
2808
2842
  return () => l("div", {
@@ -2812,13 +2846,13 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2812
2846
  onClick: () => {
2813
2847
  o?.value || e.onScrollAutoChange(!e.scrollAuto);
2814
2848
  }
2815
- }, [t?.value.footer?.scrollAuto]), l(ql, {
2849
+ }, [t?.value.footer?.scrollAuto]), l(Gl, {
2816
2850
  checked: e.scrollAuto,
2817
2851
  onChange: e.onScrollAutoChange,
2818
2852
  disabled: o?.value
2819
2853
  }, null)]);
2820
2854
  }
2821
- }), Gl = {
2855
+ }), Zl = {
2822
2856
  modelValue: {
2823
2857
  type: String,
2824
2858
  default: ""
@@ -2841,55 +2875,55 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2841
2875
  defFooters: {
2842
2876
  type: Object
2843
2877
  }
2844
- }, jl = /* @__PURE__ */ C({
2878
+ }, Xl = /* @__PURE__ */ C({
2845
2879
  name: "MDEditorFooter",
2846
- props: Gl,
2880
+ props: Zl,
2847
2881
  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];
2882
+ const t = r("theme"), o = r("language"), n = r("disabled"), i = P(() => {
2883
+ 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);
2884
+ return [d, u];
2851
2885
  }), s = (c) => {
2852
2886
  if (St.includes(c))
2853
2887
  switch (c) {
2854
2888
  case "markdownTotal":
2855
- return l(_l, {
2889
+ return l(Ul, {
2856
2890
  modelValue: e.modelValue
2857
2891
  }, null);
2858
2892
  case "scrollSwitch":
2859
- return !e.noScrollAuto && l(Kl, {
2893
+ return !e.noScrollAuto && l(Yl, {
2860
2894
  scrollAuto: e.scrollAuto,
2861
2895
  onScrollAutoChange: e.onScrollAutoChange
2862
2896
  }, null);
2863
2897
  }
2864
2898
  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
2899
+ const d = e.defFooters[c];
2900
+ return d ? ne(d, {
2901
+ theme: d.props?.theme || t.value,
2902
+ language: d.props?.language || o.value,
2903
+ disabled: d.props?.disabled || n?.value
2870
2904
  }) : "";
2871
2905
  } 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
2906
+ const d = e.defFooters.children[c];
2907
+ return d ? ne(d, {
2908
+ theme: d.props?.theme || t.value,
2909
+ language: d.props?.language || o.value,
2910
+ disabled: d.props?.disabled || n?.value
2877
2911
  }) : "";
2878
2912
  } else
2879
2913
  return "";
2880
2914
  };
2881
2915
  return () => {
2882
- const c = i.value[0].map((m) => s(m)), u = i.value[1].map((m) => s(m));
2916
+ const c = i.value[0].map((u) => s(u)), d = i.value[1].map((u) => s(u));
2883
2917
  return l("div", {
2884
2918
  class: `${a}-footer`
2885
2919
  }, [l("div", {
2886
2920
  class: `${a}-footer-left`
2887
2921
  }, [c]), l("div", {
2888
2922
  class: `${a}-footer-right`
2889
- }, [u])]);
2923
+ }, [d])]);
2890
2924
  };
2891
2925
  }
2892
- }), Yl = {
2926
+ }), Jl = {
2893
2927
  // 工具栏选择显示
2894
2928
  toolbars: {
2895
2929
  type: Array,
@@ -2900,24 +2934,24 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2900
2934
  type: Array,
2901
2935
  default: () => []
2902
2936
  }
2903
- }, Zl = /* @__PURE__ */ C({
2937
+ }, Ql = /* @__PURE__ */ C({
2904
2938
  name: "MDEditorToolbar",
2905
- props: Yl,
2939
+ props: Jl,
2906
2940
  setup(e) {
2907
- const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = x(), s = x(), {
2941
+ const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = I(), s = I(), {
2908
2942
  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];
2943
+ } = Ze(), d = P(() => {
2944
+ 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);
2945
+ return [m, f];
2912
2946
  });
2913
- return E(() => e.toolbars, () => {
2914
- re(() => {
2947
+ return N(() => e.toolbars, () => {
2948
+ ie(() => {
2915
2949
  i.value && Lt(i.value);
2916
2950
  });
2917
2951
  }, {
2918
2952
  immediate: !0
2919
2953
  }), () => {
2920
- const m = u.value[0].map((b) => c(b)), v = u.value[1].map((b) => c(b));
2954
+ const u = d.value[0].map((m) => c(m)), v = d.value[1].map((m) => c(m));
2921
2955
  return l(_e, null, [e.toolbars.length > 0 && l("div", {
2922
2956
  class: `${a}-toolbar-wrapper`,
2923
2957
  ref: i,
@@ -2927,12 +2961,12 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2927
2961
  }, [l("div", {
2928
2962
  class: `${a}-toolbar-left`,
2929
2963
  ref: s
2930
- }, [m]), l("div", {
2964
+ }, [u]), l("div", {
2931
2965
  class: `${a}-toolbar-right`
2932
2966
  }, [v])])])]);
2933
2967
  };
2934
2968
  }
2935
- }), be = /* @__PURE__ */ C({
2969
+ }), ve = /* @__PURE__ */ C({
2936
2970
  name: "MdEditorV3",
2937
2971
  props: ut,
2938
2972
  emits: ct,
@@ -2941,48 +2975,72 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2941
2975
  noKatex: o,
2942
2976
  noMermaid: n,
2943
2977
  noHighlight: i
2944
- } = e, s = U({
2978
+ } = e, s = Y({
2945
2979
  scrollAuto: e.scrollAuto
2946
- }), c = x(), u = x(), m = K(() => xe({
2980
+ }), c = I(), d = I(), u = P(() => Se({
2947
2981
  props: e,
2948
2982
  ctx: t
2949
- }, "defToolbars")), v = K(() => xe({
2983
+ }, "defToolbars")), v = P(() => Se({
2950
2984
  props: e,
2951
2985
  ctx: t
2952
- }, "defFooters")), b = dt(e), [h, f] = mt(e, t, {
2953
- editorId: b
2986
+ }, "defFooters")), m = dt(e), [f, g] = mt(e, t, {
2987
+ editorId: m
2954
2988
  }), p = bt(e, {
2955
- editorId: b
2989
+ editorId: m
2956
2990
  });
2957
- return vt(e, t, {
2958
- editorId: b
2959
- }), gt(e), ft(e, t, {
2960
- editorId: b
2961
- }), ht(e, t, {
2962
- editorId: b,
2991
+ vt(e, t, {
2992
+ editorId: m
2993
+ }), gt(e), ht(e, t, {
2994
+ editorId: m
2995
+ }), ft(e, t, {
2996
+ editorId: m,
2963
2997
  catalogVisible: p,
2964
- setting: h,
2965
- updateSetting: f,
2966
- codeRef: u
2998
+ setting: f,
2999
+ updateSetting: g,
3000
+ codeRef: d
2967
3001
  }), pt(e, {
2968
3002
  rootRef: c,
2969
- editorId: b,
2970
- setting: h,
2971
- updateSetting: f,
3003
+ editorId: m,
3004
+ setting: f,
3005
+ updateSetting: g,
2972
3006
  catalogVisible: p,
2973
- defToolbars: m
2974
- }), 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` : ""],
3007
+ defToolbars: u
3008
+ }), he(() => {
3009
+ h.clear(m);
3010
+ });
3011
+ const k = ($) => {
3012
+ t.emit("update:modelValue", $);
3013
+ }, E = ($) => {
3014
+ e.onChange?.($), t.emit("onChange", $);
3015
+ }, M = ($) => {
3016
+ e.onHtmlChanged?.($), t.emit("onHtmlChanged", $);
3017
+ }, A = ($) => {
3018
+ e.onGetCatalog?.($), t.emit("onGetCatalog", $);
3019
+ }, S = ($) => {
3020
+ e.onBlur?.($), t.emit("onBlur", $);
3021
+ }, D = ($) => {
3022
+ e.onFocus?.($), t.emit("onFocus", $);
3023
+ }, L = ($) => {
3024
+ e.onInput?.($), t.emit("onInput", $);
3025
+ }, T = ($) => {
3026
+ e.onDrop?.($), t.emit("onDrop", $);
3027
+ }, R = ($) => {
3028
+ e.oninputBoxWidthChange?.($), t.emit("oninputBoxWidthChange", $);
3029
+ }, z = () => {
3030
+ e.onRemount?.(), t.emit("onRemount");
3031
+ }, q = ($) => {
3032
+ s.scrollAuto = $;
3033
+ };
3034
+ return () => l("div", {
3035
+ id: m,
3036
+ class: [a, e.class, e.theme === "dark" && `${a}-dark`, f.fullscreen || f.pageFullscreen ? `${a}-fullscreen` : ""],
2979
3037
  style: e.style,
2980
3038
  ref: c
2981
- }, [e.toolbars.length > 0 && l(Zl, {
3039
+ }, [e.toolbars.length > 0 && l(Ql, {
2982
3040
  toolbars: e.toolbars,
2983
3041
  toolbarsExclude: e.toolbarsExclude
2984
- }, null), l(Wl, {
2985
- ref: u,
3042
+ }, null), l(ql, {
3043
+ ref: d,
2986
3044
  modelValue: e.modelValue,
2987
3045
  mdHeadingId: e.mdHeadingId,
2988
3046
  noMermaid: n,
@@ -2996,57 +3054,38 @@ const Xe = (e) => e.extension instanceof Function ? e.extension(e.options) : e.e
2996
3054
  maxlength: e.maxLength,
2997
3055
  autoDetectCode: e.autoDetectCode,
2998
3056
  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
- },
3057
+ updateModelValue: k,
3058
+ onChange: E,
3059
+ onHtmlChanged: M,
3060
+ onGetCatalog: A,
3061
+ onBlur: S,
3062
+ onFocus: D,
3063
+ onInput: L,
3020
3064
  completions: e.completions,
3021
3065
  noImgZoomIn: e.noImgZoomIn,
3022
- onDrop: (T) => {
3023
- e.onDrop?.(T), t.emit("onDrop", T);
3024
- },
3066
+ onDrop: T,
3025
3067
  inputBoxWidth: e.inputBoxWidth,
3026
- oninputBoxWidthChange: (T) => {
3027
- e.oninputBoxWidthChange?.(T), t.emit("oninputBoxWidthChange", T);
3028
- },
3068
+ oninputBoxWidthChange: R,
3029
3069
  sanitizeMermaid: e.sanitizeMermaid,
3030
3070
  transformImgUrl: e.transformImgUrl,
3031
3071
  codeFoldable: e.codeFoldable,
3032
3072
  autoFoldThreshold: e.autoFoldThreshold,
3033
- onRemount: () => {
3034
- e.onRemount?.(), t.emit("onRemount");
3035
- },
3073
+ onRemount: z,
3036
3074
  catalogLayout: e.catalogLayout,
3037
3075
  catalogMaxDepth: e.catalogMaxDepth,
3038
- noEcharts: e.noEcharts
3039
- }, null), e.footers.length > 0 && l(jl, {
3076
+ noEcharts: e.noEcharts,
3077
+ previewComponent: e.previewComponent
3078
+ }, null), e.footers.length > 0 && l(Xl, {
3040
3079
  modelValue: e.modelValue,
3041
3080
  footers: e.footers,
3042
3081
  defFooters: v.value,
3043
- noScrollAuto: !h.preview && !h.htmlPreview || h.previewOnly,
3082
+ noScrollAuto: !f.preview && !f.htmlPreview || f.previewOnly,
3044
3083
  scrollAuto: s.scrollAuto,
3045
- onScrollAutoChange: (T) => s.scrollAuto = T
3084
+ onScrollAutoChange: q
3046
3085
  }, null)]);
3047
3086
  }
3048
3087
  });
3049
- be.install = (e) => (e.component(be.name, be), e.use(yt).use(lt).use(wt).use(We).use(Tt), e);
3088
+ ve.install = (e) => (e.component(ve.name, ve), e.use(yt).use(lt).use(wt).use(We).use(Tt), e);
3050
3089
  export {
3051
- be as default
3090
+ ve as default
3052
3091
  };