md-editor-v3 6.0.0-5 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,26 @@
1
- import { a as Q, D as lt } from "./chunks/index.mjs";
2
- import { s as at, a as nt, M as _e } 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 ht, j as ft, k as pt, M as Tt } from "./chunks/index3.mjs";
4
- import wt from "./ModalToolbar.mjs";
5
- import yt from "./NormalToolbar.mjs";
6
- import { inject as r, watch as I, toRef as H, nextTick as se, onMounted as O, defineComponent as y, createVNode as l, ref as x, reactive as q, Fragment as ze, computed as G, cloneVNode as re, createApp as Ct, shallowRef as $t, onBeforeUnmount as fe } from "vue";
7
- import { g as j, p as a, a as kt, M as ae, d as xt, b as St } from "./chunks/config.mjs";
8
- import { linkTo as It, throttle as Lt, createSmoothScroll as Ue, draggingScroll as Et } 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";
10
- import { markdown as Bt } from "@codemirror/lang-markdown";
11
- import { languages as Pt } from "@codemirror/language-data";
12
- import { EditorState as ue, EditorSelection as K, Compartment as z, StateEffect as qe, StateField as Ke, RangeSetBuilder as Ht } from "@codemirror/state";
13
- import { placeholder as Vt, EditorView as ee, showTooltip as Ot, Decoration as Wt, WidgetType as _t, keymap as zt, drawSelection as Ut } from "@codemirror/view";
14
- import { EditorView as U } from "codemirror";
15
- import { b, E as Y, R as h, C as qt, U as pe, a as Ge, c as je, O as Ye, d as Kt, e as Gt, T as jt, S as Yt, G as xe } from "./chunks/event-bus.mjs";
16
- import { indentUnit as Zt, syntaxHighlighting as Ze, HighlightStyle as Xe } from "@codemirror/language";
17
- import { autocompletion as Xt } from "@codemirror/autocomplete";
18
- import { a as Jt } from "./chunks/dom.mjs";
19
- import { I as k, M as Qt } from "./chunks/index2.mjs";
20
- import { b as eo } from "./chunks/index5.mjs";
1
+ import { a as Q, D as ot } from "./chunks/index.mjs";
2
+ import { s as lt, a as at, M as Oe } from "./chunks/index4.mjs";
3
+ import { C as nt, c as rt, a as st, e as it, b as ct, u as ut, d as dt, f as mt, g as bt, h as vt, i as gt, j as ht, k as ft, M as pt } from "./chunks/index3.mjs";
4
+ import Tt from "./ModalToolbar.mjs";
5
+ import wt from "./NormalToolbar.mjs";
6
+ import { inject as r, watch as I, toRef as O, nextTick as re, onMounted as W, ref as x, defineComponent as y, createVNode as l, reactive as q, Fragment as Ve, computed as G, cloneVNode as ne, createApp as yt, shallowRef as Ct, onBeforeUnmount as ge } from "vue";
7
+ import { g as j, p as a, a as kt, M as le, d as $t, b as xt } from "./chunks/config.mjs";
8
+ import { linkTo as St, throttle as It, createSmoothScroll as We, draggingScroll as Lt } from "@vavt/util";
9
+ import { deleteLine as Et, history as Ce, defaultKeymap as Nt, historyKeymap as At, indentWithTab as Dt, undo as Mt, redo as Rt } from "@codemirror/commands";
10
+ import { markdown as Ft } from "@codemirror/lang-markdown";
11
+ import { languages as Bt } from "@codemirror/language-data";
12
+ import { EditorState as ie, EditorSelection as K, Compartment as U, StateEffect as _e, StateField as ze, RangeSetBuilder as Pt } from "@codemirror/state";
13
+ import { placeholder as Ht, EditorView as M, showTooltip as Ot, Decoration as Vt, WidgetType as Wt, keymap as _t, drawSelection as zt } from "@codemirror/view";
14
+ import { b, E as Y, R as f, C as Ut, U as he, a as Ue, c as qe, O as Ke, d as qt, e as Kt, T as Gt, S as jt, G as ke } from "./chunks/event-bus.mjs";
15
+ import { indentUnit as Yt, syntaxHighlighting as Ge, HighlightStyle as je } from "@codemirror/language";
16
+ import { autocompletion as Zt } from "@codemirror/autocomplete";
17
+ import { a as Xt } from "./chunks/dom.mjs";
18
+ import { I as $, M as Jt } from "./chunks/index2.mjs";
19
+ import { b as Qt } from "./chunks/index5.mjs";
21
20
  import { tags as d } from "@lezer/highlight";
22
- import { searchKeymap as to } from "@codemirror/search";
23
- import { g as Se } from "./chunks/vue-tsx.mjs";
24
- const oo = (e, t, o) => {
21
+ import { searchKeymap as eo } from "@codemirror/search";
22
+ import { g as $e } from "./chunks/vue-tsx.mjs";
23
+ const to = (e, t, o) => {
25
24
  const n = r("editorId");
26
25
  let i = () => {
27
26
  }, s = () => {
@@ -35,7 +34,7 @@ const oo = (e, t, o) => {
35
34
  ), v = u?.querySelector(
36
35
  `[id="${n}-html-wrapper"]`
37
36
  );
38
- (g || v) && ([s, i] = (g ? at : nt)(
37
+ (g || v) && ([s, i] = (g ? lt : at)(
39
38
  m,
40
39
  g || v,
41
40
  o.value
@@ -44,13 +43,13 @@ const oo = (e, t, o) => {
44
43
  I(
45
44
  [
46
45
  t,
47
- H(e.setting, "preview"),
48
- H(e.setting, "htmlPreview"),
49
- H(e.setting, "fullscreen"),
50
- H(e.setting, "pageFullscreen")
46
+ O(e.setting, "preview"),
47
+ O(e.setting, "htmlPreview"),
48
+ O(e.setting, "fullscreen"),
49
+ O(e.setting, "pageFullscreen")
51
50
  ],
52
51
  () => {
53
- se(c);
52
+ re(c);
54
53
  }
55
54
  ), I(
56
55
  () => e.scrollAuto,
@@ -62,12 +61,12 @@ const oo = (e, t, o) => {
62
61
  (u) => {
63
62
  u ? i() : s();
64
63
  }
65
- ), O(c);
66
- }, de = async (e, t, o) => {
64
+ ), W(c);
65
+ }, ce = async (e, t, o) => {
67
66
  if (/^h[1-6]$/.test(e))
68
- return lo(e, t);
67
+ return oo(e, t);
69
68
  if (e === "prettier")
70
- return await ao(t, o);
69
+ return await lo(t, o);
71
70
  switch (e) {
72
71
  case "bold":
73
72
  case "underline":
@@ -78,16 +77,16 @@ const oo = (e, t, o) => {
78
77
  case "codeRow":
79
78
  case "katexInline":
80
79
  case "katexBlock":
81
- return ro(e, t);
80
+ return no(e, t);
82
81
  case "quote":
83
82
  case "orderedList":
84
83
  case "unorderedList":
85
84
  case "task":
86
- return io(e, t);
85
+ return so(e, t);
87
86
  case "code":
88
- return co(o, t);
87
+ return io(o, t);
89
88
  case "table":
90
- return bo(o);
89
+ return mo(o);
91
90
  case "link": {
92
91
  const { desc: n = "", url: i = "" } = o, s = `[${n}](${i})`;
93
92
  return {
@@ -100,7 +99,7 @@ const oo = (e, t, o) => {
100
99
  };
101
100
  }
102
101
  case "image":
103
- return mo(o);
102
+ return uo(o);
104
103
  case "flow":
105
104
  case "sequence":
106
105
  case "gantt":
@@ -109,21 +108,21 @@ const oo = (e, t, o) => {
109
108
  case "pie":
110
109
  case "relationship":
111
110
  case "journey":
112
- return uo(e);
111
+ return co(e);
113
112
  case "universal":
114
- return vo(t.getSelectedText(), o);
113
+ return bo(t.getSelectedText(), o);
115
114
  default:
116
115
  return { text: "", options: {} };
117
116
  }
118
- }, lo = (e, t) => {
119
- const o = e.slice(1), n = "#".repeat(Number(o)), [i, s, c] = Te(t, {
117
+ }, oo = (e, t) => {
118
+ const o = e.slice(1), n = "#".repeat(Number(o)), [i, s, c] = fe(t, {
120
119
  wholeLine: !0
121
120
  });
122
121
  return {
123
122
  text: `${n} ${i}`,
124
123
  options: { deviationStart: n.length + 1, replaceStart: s, replaceEnd: c }
125
124
  };
126
- }, ao = async (e, t) => {
125
+ }, lo = async (e, t) => {
127
126
  const o = window.prettier || j.editorExtensions.prettier?.prettierInstance, n = [
128
127
  window.prettierPlugins?.markdown || j.editorExtensions.prettier?.parserMarkdownInstance
129
128
  ];
@@ -140,7 +139,7 @@ const oo = (e, t, o) => {
140
139
  }),
141
140
  options: { select: !1, replaceAll: !0 }
142
141
  };
143
- }, no = {
142
+ }, ao = {
144
143
  bold: ["**", "**", 2, -2],
145
144
  underline: ["<u>", "</u>", 3, -4],
146
145
  italic: ["*", "*", 1, -1],
@@ -154,8 +153,8 @@ $$
154
153
  `, `
155
154
  $$
156
155
  `, 4, -4]
157
- }, ro = (e, t) => {
158
- const o = t.getSelectedText(), [n, i, s, c] = no[e];
156
+ }, no = (e, t) => {
157
+ const o = t.getSelectedText(), [n, i, s, c] = ao[e];
159
158
  return {
160
159
  text: `${n}${o}${i}`,
161
160
  options: {
@@ -164,23 +163,23 @@ $$
164
163
  // replaceStart, replaceEnd
165
164
  }
166
165
  };
167
- }, so = {
166
+ }, ro = {
168
167
  quote: "> ",
169
168
  unorderedList: "- ",
170
169
  orderedList: 1,
171
170
  task: "- [ ] "
172
- }, io = (e, t) => {
173
- const [o, n, i] = Te(t, {
171
+ }, so = (e, t) => {
172
+ const [o, n, i] = fe(t, {
174
173
  wholeLine: !0
175
174
  }), s = o.split(`
176
- `), c = so[e], u = e === "orderedList" ? s.map((v, w) => `${c + w}. ${v}`) : s.map((v) => `${c}${v}`), m = e === "orderedList" ? "1. " : c.toString(), g = s.length === 1 ? m.length : 0;
175
+ `), c = ro[e], u = e === "orderedList" ? s.map((v, w) => `${c + w}. ${v}`) : s.map((v) => `${c}${v}`), m = e === "orderedList" ? "1. " : c.toString(), g = s.length === 1 ? m.length : 0;
177
176
  return {
178
177
  text: u.join(`
179
178
  `),
180
179
  options: { deviationStart: g, replaceStart: n, replaceEnd: i }
181
180
  };
182
- }, co = (e, t) => {
183
- const [o, n, i] = Te(t), s = e.mode || "language", c = `
181
+ }, io = (e, t) => {
182
+ const [o, n, i] = fe(t), s = e.mode || "language", c = `
184
183
  \`\`\`${s}
185
184
  ${e.text || o || ""}
186
185
  \`\`\`
@@ -194,7 +193,7 @@ ${e.text || o || ""}
194
193
  replaceEnd: i
195
194
  }
196
195
  };
197
- }, uo = (e) => ({
196
+ }, co = (e) => ({
198
197
  text: `
199
198
  \`\`\`mermaid
200
199
  ${{
@@ -223,7 +222,7 @@ dateFormat YYYY-MM-DD`,
223
222
  \`\`\`
224
223
  `,
225
224
  options: { deviationStart: 12, deviationEnd: -5 }
226
- }), mo = (e) => {
225
+ }), uo = (e) => {
227
226
  const { desc: t = "", url: o = "", urls: n } = e;
228
227
  let i = "";
229
228
  const s = o === "" && (!n || n instanceof Array && n.length === 0);
@@ -244,7 +243,7 @@ dateFormat YYYY-MM-DD`,
244
243
  deviationEnd: s ? -2 : 0
245
244
  }
246
245
  };
247
- }, bo = (e) => {
246
+ }, mo = (e) => {
248
247
  const { selectedShape: t = { x: 1, y: 1 } } = e, { x: o, y: n } = t;
249
248
  let i = `
250
249
  | Column`;
@@ -262,7 +261,7 @@ dateFormat YYYY-MM-DD`,
262
261
  }
263
262
  return i += `
264
263
  `, { text: i, options: { deviationStart: 3, deviationEnd: 10 - i.length } };
265
- }, vo = (e, t) => {
264
+ }, bo = (e, t) => {
266
265
  const { generate: o } = t, n = o(e);
267
266
  return {
268
267
  text: n.targetValue,
@@ -272,7 +271,7 @@ dateFormat YYYY-MM-DD`,
272
271
  deviationEnd: n.deviationEnd || 0
273
272
  }
274
273
  };
275
- }, Te = (e, t = { wholeLine: !1 }) => {
274
+ }, fe = (e, t = { wholeLine: !1 }) => {
276
275
  const o = e.view.state, n = o.selection.main;
277
276
  if (n.empty) {
278
277
  const i = o.doc.lineAt(n.from);
@@ -290,13 +289,13 @@ dateFormat YYYY-MM-DD`,
290
289
  n.from,
291
290
  n.to
292
291
  ];
293
- }, _ = (e) => {
294
- const t = new z();
292
+ }, z = (e) => {
293
+ const t = new U();
295
294
  return (n) => (t.get(e.state) ? e.dispatch({ effects: t.reconfigure(n) }) : e.dispatch({
296
- effects: qe.appendConfig.of(t.of(n))
295
+ effects: _e.appendConfig.of(t.of(n))
297
296
  }), !0);
298
297
  };
299
- class go {
298
+ class vo {
300
299
  view;
301
300
  maxLength = Number.MAX_SAFE_INTEGER;
302
301
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
@@ -390,7 +389,7 @@ class go {
390
389
  }
391
390
  }
392
391
  constructor(t) {
393
- this.view = t, this.toggleTabSize = _(this.view), this.togglePlaceholder = _(this.view), this.setExtensions = _(this.view), this.toggleDisabled = _(this.view), this.toggleReadOnly = _(this.view), this.toggleMaxlength = _(this.view);
392
+ 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);
394
393
  }
395
394
  /**
396
395
  * 设置tabSize
@@ -399,8 +398,8 @@ class go {
399
398
  */
400
399
  setTabSize(t) {
401
400
  this.toggleTabSize([
402
- ue.tabSize.of(t),
403
- Zt.of(" ".repeat(t))
401
+ ie.tabSize.of(t),
402
+ Yt.of(" ".repeat(t))
404
403
  ]);
405
404
  }
406
405
  /**
@@ -409,7 +408,7 @@ class go {
409
408
  * @param t 目标内容
410
409
  */
411
410
  setPlaceholder(t) {
412
- this.togglePlaceholder(Vt(t));
411
+ this.togglePlaceholder(Ht(t));
413
412
  }
414
413
  focus(t) {
415
414
  if (this.view.focus(), !t)
@@ -434,18 +433,29 @@ class go {
434
433
  });
435
434
  }
436
435
  setDisabled(t) {
437
- this.toggleDisabled([ee.editable.of(!t)]);
436
+ this.toggleDisabled([M.editable.of(!t)]);
438
437
  }
439
438
  setReadOnly(t) {
440
- this.toggleReadOnly([ue.readOnly.of(t)]);
439
+ this.toggleReadOnly([ie.readOnly.of(t)]);
441
440
  }
442
441
  setMaxLength(t) {
443
442
  this.maxLength = t, this.toggleMaxlength([
444
- ue.changeFilter.of((o) => o.newDoc.length <= t)
443
+ ie.changeFilter.of((o) => o.newDoc.length <= t)
445
444
  ]);
446
445
  }
447
446
  }
448
- const ne = (e, t, o, n, i) => (s, c, u, m) => {
447
+ const go = (e, t) => {
448
+ if (e === t) return !0;
449
+ if (e.length !== t.length) return !1;
450
+ for (let o = 0; o < e.length; o++)
451
+ if (e[o] !== t[o]) return !1;
452
+ return !0;
453
+ }, ho = (e, t) => {
454
+ const o = x(t.value);
455
+ I([t], () => {
456
+ (!o.value || !go(o.value, t.value)) && (o.value = t.value, e());
457
+ });
458
+ }, ae = (e, t, o, n, i) => (s, c, u, m) => {
449
459
  const g = `${e}${t}${o}${n}`, v = u + c.label.length + (i === "title" ? o.length : 0);
450
460
  s.dispatch({
451
461
  changes: { from: u, to: m, insert: g },
@@ -460,10 +470,10 @@ const ne = (e, t, o, n, i) => (s, c, u, m) => {
460
470
  1
461
471
  )
462
472
  }), s.focus();
463
- }, Ie = (e) => (t, o, n, i) => {
473
+ }, xe = (e) => (t, o, n, i) => {
464
474
  const s = e.slice(i - n);
465
475
  t.dispatch(t.state.replaceSelection(`${s} `));
466
- }, Le = (e) => {
476
+ }, Se = (e) => {
467
477
  const t = (o) => {
468
478
  const n = o.matchBefore(
469
479
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/
@@ -477,7 +487,7 @@ const ne = (e, t, o, n, i) => (s, c, u, m) => {
477
487
  return {
478
488
  label: c,
479
489
  type: "text",
480
- apply: Ie(c)
490
+ apply: xe(c)
481
491
  };
482
492
  }),
483
493
  // 任务列表
@@ -486,7 +496,7 @@ const ne = (e, t, o, n, i) => (s, c, u, m) => {
486
496
  return {
487
497
  label: s,
488
498
  type: "text",
489
- apply: Ie(s)
499
+ apply: xe(s)
490
500
  };
491
501
  }),
492
502
  // 代码
@@ -498,7 +508,7 @@ const ne = (e, t, o, n, i) => (s, c, u, m) => {
498
508
  ].map((i) => ({
499
509
  label: `${i[0]}${i[1]}`,
500
510
  type: "text",
501
- apply: ne(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
511
+ apply: ae(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
502
512
  })),
503
513
  // 链接
504
514
  {
@@ -523,12 +533,12 @@ const ne = (e, t, o, n, i) => (s, c, u, m) => {
523
533
  {
524
534
  label: "$",
525
535
  type: "text",
526
- apply: ne("$", "", "", "$", "type")
536
+ apply: ae("$", "", "", "$", "type")
527
537
  },
528
538
  {
529
539
  label: "$$",
530
540
  type: "text",
531
- apply: ne("$$", "", `
541
+ apply: ae("$$", "", `
532
542
  `, `
533
543
  $$`, "title")
534
544
  },
@@ -553,24 +563,24 @@ $$`, "title")
553
563
  ].map((i) => ({
554
564
  label: `!!! ${i}`,
555
565
  type: "text",
556
- apply: ne("!!!", ` ${i}`, " Title", `
566
+ apply: ae("!!!", ` ${i}`, " Title", `
557
567
 
558
568
  !!!`, "title")
559
569
  }))
560
570
  ]
561
571
  };
562
572
  };
563
- return Xt({
573
+ return Zt({
564
574
  override: e ? [t, ...e] : [t]
565
575
  });
566
- }, ho = /* @__PURE__ */ y({
576
+ }, fo = /* @__PURE__ */ y({
567
577
  name: `${a}-divider`,
568
578
  setup() {
569
579
  return () => l("div", {
570
580
  class: `${a}-divider`
571
581
  }, null);
572
582
  }
573
- }), fo = /* @__PURE__ */ y({
583
+ }), po = /* @__PURE__ */ y({
574
584
  name: "ToolbarBold",
575
585
  setup() {
576
586
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -579,15 +589,15 @@ $$`, "title")
579
589
  title: t.value.toolbarTips?.bold,
580
590
  disabled: o?.value,
581
591
  onClick: () => {
582
- b.emit(e, h, "bold");
592
+ b.emit(e, f, "bold");
583
593
  }
584
- }, [l(k, {
594
+ }, [l($, {
585
595
  name: "bold"
586
596
  }, null), n?.value && l("div", {
587
597
  class: `${a}-toolbar-item-name`
588
598
  }, [t.value.toolbarTips?.bold])]);
589
599
  }
590
- }), po = /* @__PURE__ */ y({
600
+ }), To = /* @__PURE__ */ y({
591
601
  name: "ToolbarCatalog",
592
602
  setup() {
593
603
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("catalogVisible");
@@ -596,16 +606,16 @@ $$`, "title")
596
606
  title: t.value.toolbarTips?.catalog,
597
607
  disabled: o?.value,
598
608
  onClick: () => {
599
- b.emit(e, qt);
609
+ b.emit(e, Ut);
600
610
  },
601
611
  key: "bar-catalog"
602
- }, [l(k, {
612
+ }, [l($, {
603
613
  name: "catalog"
604
614
  }, null), n?.value && l("div", {
605
615
  class: `${a}-toolbar-item-name`
606
616
  }, [t.value.toolbarTips?.catalog])]);
607
617
  }
608
- }), To = /* @__PURE__ */ y({
618
+ }), wo = /* @__PURE__ */ y({
609
619
  name: "ToolbarCode",
610
620
  setup() {
611
621
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -614,15 +624,15 @@ $$`, "title")
614
624
  title: t.value.toolbarTips?.code,
615
625
  disabled: o?.value,
616
626
  onClick: () => {
617
- b.emit(e, h, "code");
627
+ b.emit(e, f, "code");
618
628
  }
619
- }, [l(k, {
629
+ }, [l($, {
620
630
  name: "code"
621
631
  }, null), n?.value && l("div", {
622
632
  class: `${a}-toolbar-item-name`
623
633
  }, [t.value.toolbarTips?.code])]);
624
634
  }
625
- }), wo = /* @__PURE__ */ y({
635
+ }), yo = /* @__PURE__ */ y({
626
636
  name: "ToolbarCodeRow",
627
637
  setup() {
628
638
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -631,20 +641,20 @@ $$`, "title")
631
641
  title: t.value.toolbarTips?.codeRow,
632
642
  disabled: o?.value,
633
643
  onClick: () => {
634
- b.emit(e, h, "codeRow");
644
+ b.emit(e, f, "codeRow");
635
645
  }
636
- }, [l(k, {
646
+ }, [l($, {
637
647
  name: "code-row"
638
648
  }, null), n?.value && l("div", {
639
649
  class: `${a}-toolbar-item-name`
640
650
  }, [t.value.toolbarTips?.codeRow])]);
641
651
  }
642
- }), yo = /* @__PURE__ */ y({
652
+ }), Co = /* @__PURE__ */ y({
643
653
  name: "ToolbarFullscreen",
644
654
  setup() {
645
655
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), {
646
656
  fullscreenHandler: i
647
- } = Qo();
657
+ } = el();
648
658
  return () => l("button", {
649
659
  class: [`${a}-toolbar-item`, n.value.fullscreen && `${a}-toolbar-active`, t?.value && `${a}-disabled`],
650
660
  title: e.value.toolbarTips?.fullscreen,
@@ -652,13 +662,13 @@ $$`, "title")
652
662
  onClick: () => {
653
663
  i();
654
664
  }
655
- }, [l(k, {
665
+ }, [l($, {
656
666
  name: n.value.fullscreen ? "fullscreen-exit" : "fullscreen"
657
667
  }, null), o?.value && l("div", {
658
668
  class: `${a}-toolbar-item-name`
659
669
  }, [e.value.toolbarTips?.fullscreen])]);
660
670
  }
661
- }), Co = /* @__PURE__ */ y({
671
+ }), ko = /* @__PURE__ */ y({
662
672
  name: "ToolbarGithub",
663
673
  setup() {
664
674
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName");
@@ -667,9 +677,9 @@ $$`, "title")
667
677
  title: e.value.toolbarTips?.github,
668
678
  disabled: t?.value,
669
679
  onClick: () => {
670
- It("https://github.com/imzbf/md-editor-v3");
680
+ St("https://github.com/imzbf/md-editor-v3");
671
681
  }
672
- }, [l(k, {
682
+ }, [l($, {
673
683
  name: "github"
674
684
  }, null), o?.value && l("div", {
675
685
  class: `${a}-toolbar-item-name`
@@ -686,13 +696,13 @@ $$`, "title")
686
696
  onClick: () => {
687
697
  i("htmlPreview");
688
698
  }
689
- }, [l(k, {
699
+ }, [l($, {
690
700
  name: "preview-html"
691
701
  }, null), o?.value && l("div", {
692
702
  class: `${a}-toolbar-item-name`
693
703
  }, [e.value.toolbarTips?.htmlPreview])]);
694
704
  }
695
- }), ko = /* @__PURE__ */ y({
705
+ }), xo = /* @__PURE__ */ y({
696
706
  name: "ToolbarImage",
697
707
  setup() {
698
708
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -701,15 +711,15 @@ $$`, "title")
701
711
  title: t.value.toolbarTips?.image,
702
712
  disabled: o?.value,
703
713
  onClick: () => {
704
- b.emit(e, h, "image");
714
+ b.emit(e, f, "image");
705
715
  }
706
- }, [l(k, {
716
+ }, [l($, {
707
717
  name: "image"
708
718
  }, null), n?.value && l("div", {
709
719
  class: `${a}-toolbar-item-name`
710
720
  }, [t.value.toolbarTips?.image])]);
711
721
  }
712
- }), xo = {
722
+ }), So = {
713
723
  visible: {
714
724
  type: Boolean,
715
725
  default: !1
@@ -724,9 +734,9 @@ $$`, "title")
724
734
  default: () => {
725
735
  }
726
736
  }
727
- }, So = /* @__PURE__ */ y({
737
+ }, Io = /* @__PURE__ */ y({
728
738
  name: `${a}-modal-clip`,
729
- props: xo,
739
+ props: So,
730
740
  setup(e) {
731
741
  const t = r("usedLanguageText"), o = r("editorId"), n = r("rootRef");
732
742
  let i = j.editorExtensions.cropper.instance;
@@ -749,16 +759,16 @@ $$`, "title")
749
759
  }
750
760
  const w = s.value.files || [];
751
761
  if (m.imgSelected = !0, w?.length > 0) {
752
- const $ = new FileReader();
753
- $.onload = (f) => {
754
- m.imgSrc = f.target.result;
755
- }, $.readAsDataURL(w[0]);
762
+ const k = new FileReader();
763
+ k.onload = (p) => {
764
+ m.imgSrc = p.target.result;
765
+ }, k.readAsDataURL(w[0]);
756
766
  }
757
767
  });
758
768
  }), I(() => [m.imgSelected], () => {
759
769
  u.value.style = "";
760
- }), I([H(() => m.isFullscreen), H(() => m.imgSrc)], () => {
761
- m.imgSrc && se(() => {
770
+ }), I([O(() => m.isFullscreen), O(() => m.imgSrc)], () => {
771
+ m.imgSrc && re(() => {
762
772
  g?.destroy(), u.value.style = "", c.value && (g = new i(c.value, {
763
773
  viewMode: 2,
764
774
  preview: n.value.getRootNode().querySelector(`.${a}-clip-preview-target`)
@@ -767,9 +777,9 @@ $$`, "title")
767
777
  });
768
778
  });
769
779
  const v = () => {
770
- g.clear(), g.destroy(), g = null, s.value.value = "", m.imgSelected = !1;
780
+ g.clear(), g.destroy(), g = null, s.value.value = "", m.imgSelected = !1, m.imgSrc = "";
771
781
  };
772
- return () => l(Qt, {
782
+ return () => l(Jt, {
773
783
  class: `${a}-modal-clip`,
774
784
  title: t.value.clipModalTips?.title,
775
785
  visible: e.visible,
@@ -798,7 +808,7 @@ $$`, "title")
798
808
  }, null), l("div", {
799
809
  class: `${a}-clip-delete`,
800
810
  onClick: v
801
- }, [l(k, {
811
+ }, [l($, {
802
812
  name: "delete"
803
813
  }, null)])]) : l("div", {
804
814
  class: `${a}-clip-upload`,
@@ -808,7 +818,7 @@ $$`, "title")
808
818
  role: "button",
809
819
  tabindex: "0",
810
820
  "aria-label": t.value.imgTitleItem?.upload
811
- }, [l(k, {
821
+ }, [l($, {
812
822
  name: "upload"
813
823
  }, null)])]), l("div", {
814
824
  class: `${a}-clip-preview`
@@ -823,7 +833,7 @@ $$`, "title")
823
833
  onClick: () => {
824
834
  if (g) {
825
835
  const w = g.getCroppedCanvas();
826
- b.emit(o, pe, [eo(w.toDataURL("image/png"))], e.onOk), v();
836
+ b.emit(o, he, [Qt(w.toDataURL("image/png"))], e.onOk), v();
827
837
  }
828
838
  }
829
839
  }, [t.value.clipModalTips?.buttonUpload || t.value.linkModalTips?.buttonOK])]), l("input", {
@@ -838,7 +848,7 @@ $$`, "title")
838
848
  }, null)]
839
849
  });
840
850
  }
841
- }), Io = {
851
+ }), Lo = {
842
852
  clipVisible: {
843
853
  type: Boolean,
844
854
  default: !1
@@ -853,27 +863,27 @@ $$`, "title")
853
863
  default: () => {
854
864
  }
855
865
  }
856
- }, Lo = /* @__PURE__ */ y({
866
+ }, Eo = /* @__PURE__ */ y({
857
867
  name: `${a}-modals`,
858
- props: Io,
868
+ props: Lo,
859
869
  setup(e) {
860
- return () => l(So, {
870
+ return () => l(Io, {
861
871
  visible: e.clipVisible,
862
872
  onOk: e.onOk,
863
873
  onCancel: e.onCancel
864
874
  }, null);
865
875
  }
866
- }), Eo = /* @__PURE__ */ y({
876
+ }), No = /* @__PURE__ */ y({
867
877
  name: "ToolbarImageDropdown",
868
878
  setup() {
869
879
  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 = () => {
870
- b.emit(e, pe, Array.from(u.value.files || [])), u.value.value = "";
880
+ b.emit(e, he, Array.from(u.value.files || [])), u.value.value = "";
871
881
  }, g = (v, w) => {
872
- o?.value || b.emit(e, h, v, w);
882
+ o?.value || b.emit(e, f, v, w);
873
883
  };
874
- return O(() => {
884
+ return W(() => {
875
885
  u.value.addEventListener("change", m);
876
- }), () => l(ze, null, [l("label", {
886
+ }), () => l(Ve, null, [l("label", {
877
887
  for: `${i}_label`,
878
888
  style: {
879
889
  display: "none"
@@ -928,12 +938,12 @@ $$`, "title")
928
938
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
929
939
  title: t.value.toolbarTips?.image,
930
940
  disabled: o?.value
931
- }, [l(k, {
941
+ }, [l($, {
932
942
  name: "image"
933
943
  }, null), n?.value && l("div", {
934
944
  class: `${a}-toolbar-item-name`
935
945
  }, [t.value.toolbarTips?.image])])]
936
- }), l(Lo, {
946
+ }), l(Eo, {
937
947
  clipVisible: c.value,
938
948
  onCancel: () => {
939
949
  c.value = !1;
@@ -947,7 +957,7 @@ $$`, "title")
947
957
  }
948
958
  }, null)]);
949
959
  }
950
- }), No = /* @__PURE__ */ y({
960
+ }), Ao = /* @__PURE__ */ y({
951
961
  name: "ToolbarItalic",
952
962
  setup() {
953
963
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -956,19 +966,19 @@ $$`, "title")
956
966
  title: t.value.toolbarTips?.italic,
957
967
  disabled: o?.value,
958
968
  onClick: () => {
959
- b.emit(e, h, "italic");
969
+ b.emit(e, f, "italic");
960
970
  }
961
- }, [l(k, {
971
+ }, [l($, {
962
972
  name: "italic"
963
973
  }, null), n?.value && l("div", {
964
974
  class: `${a}-toolbar-item-name`
965
975
  }, [t.value.toolbarTips?.italic])]);
966
976
  }
967
- }), Ao = /* @__PURE__ */ y({
977
+ }), Do = /* @__PURE__ */ y({
968
978
  name: "ToolbarKatex",
969
979
  setup() {
970
980
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = (u) => {
971
- o?.value || b.emit(e, h, u);
981
+ o?.value || b.emit(e, f, u);
972
982
  };
973
983
  return () => l(Q, {
974
984
  relative: `#${i}`,
@@ -1004,14 +1014,14 @@ $$`, "title")
1004
1014
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
1005
1015
  title: t.value.toolbarTips?.katex,
1006
1016
  disabled: o?.value
1007
- }, [l(k, {
1017
+ }, [l($, {
1008
1018
  name: "formula"
1009
1019
  }, null), n?.value && l("div", {
1010
1020
  class: `${a}-toolbar-item-name`
1011
1021
  }, [t.value.toolbarTips?.katex])])]
1012
1022
  });
1013
1023
  }
1014
- }), Do = /* @__PURE__ */ y({
1024
+ }), Mo = /* @__PURE__ */ y({
1015
1025
  name: "ToolbarLink",
1016
1026
  setup() {
1017
1027
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1020,19 +1030,19 @@ $$`, "title")
1020
1030
  title: t.value.toolbarTips?.link,
1021
1031
  disabled: o?.value,
1022
1032
  onClick: () => {
1023
- b.emit(e, h, "link");
1033
+ b.emit(e, f, "link");
1024
1034
  }
1025
- }, [l(k, {
1035
+ }, [l($, {
1026
1036
  name: "link"
1027
1037
  }, null), n?.value && l("div", {
1028
1038
  class: `${a}-toolbar-item-name`
1029
1039
  }, [t.value.toolbarTips?.link])]);
1030
1040
  }
1031
- }), Mo = /* @__PURE__ */ y({
1041
+ }), Ro = /* @__PURE__ */ y({
1032
1042
  name: "ToolbarMermaid",
1033
1043
  setup() {
1034
1044
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = (u) => {
1035
- o?.value || b.emit(e, h, u);
1045
+ o?.value || b.emit(e, f, u);
1036
1046
  };
1037
1047
  return () => l(Q, {
1038
1048
  relative: `#${i}`,
@@ -1110,14 +1120,14 @@ $$`, "title")
1110
1120
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
1111
1121
  title: t.value.toolbarTips?.mermaid,
1112
1122
  disabled: o?.value
1113
- }, [l(k, {
1123
+ }, [l($, {
1114
1124
  name: "mermaid"
1115
1125
  }, null), n?.value && l("div", {
1116
1126
  class: `${a}-toolbar-item-name`
1117
1127
  }, [t.value.toolbarTips?.mermaid])])]
1118
1128
  });
1119
1129
  }
1120
- }), Ro = /* @__PURE__ */ y({
1130
+ }), Fo = /* @__PURE__ */ y({
1121
1131
  name: "ToolbarNext",
1122
1132
  setup() {
1123
1133
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1126,15 +1136,15 @@ $$`, "title")
1126
1136
  title: t.value.toolbarTips?.next,
1127
1137
  disabled: o?.value,
1128
1138
  onClick: () => {
1129
- b.emit(e, Ge);
1139
+ b.emit(e, Ue);
1130
1140
  }
1131
- }, [l(k, {
1141
+ }, [l($, {
1132
1142
  name: "next"
1133
1143
  }, null), n?.value && l("div", {
1134
1144
  class: `${a}-toolbar-item-name`
1135
1145
  }, [t.value.toolbarTips?.next])]);
1136
1146
  }
1137
- }), Fo = /* @__PURE__ */ y({
1147
+ }), Bo = /* @__PURE__ */ y({
1138
1148
  name: "ToolbarOrderedList",
1139
1149
  setup() {
1140
1150
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1143,15 +1153,15 @@ $$`, "title")
1143
1153
  title: t.value.toolbarTips?.orderedList,
1144
1154
  disabled: o?.value,
1145
1155
  onClick: () => {
1146
- b.emit(e, h, "orderedList");
1156
+ b.emit(e, f, "orderedList");
1147
1157
  }
1148
- }, [l(k, {
1158
+ }, [l($, {
1149
1159
  name: "ordered-list"
1150
1160
  }, null), n?.value && l("div", {
1151
1161
  class: `${a}-toolbar-item-name`
1152
1162
  }, [t.value.toolbarTips?.orderedList])]);
1153
1163
  }
1154
- }), Bo = /* @__PURE__ */ y({
1164
+ }), Po = /* @__PURE__ */ y({
1155
1165
  name: "ToolbarPageFullscreen",
1156
1166
  setup() {
1157
1167
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1162,13 +1172,13 @@ $$`, "title")
1162
1172
  onClick: () => {
1163
1173
  i("pageFullscreen");
1164
1174
  }
1165
- }, [l(k, {
1175
+ }, [l($, {
1166
1176
  name: n.value.pageFullscreen ? "minimize" : "maximize"
1167
1177
  }, null), o?.value && l("div", {
1168
1178
  class: `${a}-toolbar-item-name`
1169
1179
  }, [e.value.toolbarTips?.pageFullscreen])]);
1170
1180
  }
1171
- }), Po = /* @__PURE__ */ y({
1181
+ }), Ho = /* @__PURE__ */ y({
1172
1182
  name: "ToolbarPrettier",
1173
1183
  setup() {
1174
1184
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1177,15 +1187,15 @@ $$`, "title")
1177
1187
  title: t.value.toolbarTips?.prettier,
1178
1188
  disabled: o?.value,
1179
1189
  onClick: () => {
1180
- b.emit(e, h, "prettier");
1190
+ b.emit(e, f, "prettier");
1181
1191
  }
1182
- }, [l(k, {
1192
+ }, [l($, {
1183
1193
  name: "prettier"
1184
1194
  }, null), n?.value && l("div", {
1185
1195
  class: `${a}-toolbar-item-name`
1186
1196
  }, [t.value.toolbarTips?.prettier])]);
1187
1197
  }
1188
- }), Ho = /* @__PURE__ */ y({
1198
+ }), Oo = /* @__PURE__ */ y({
1189
1199
  name: "ToolbarPreview",
1190
1200
  setup() {
1191
1201
  const e = r("usedLanguageText"), t = r("disabled"), o = r("showToolbarName"), n = r("setting"), i = r("updateSetting");
@@ -1196,7 +1206,7 @@ $$`, "title")
1196
1206
  onClick: () => {
1197
1207
  i("preview");
1198
1208
  }
1199
- }, [l(k, {
1209
+ }, [l($, {
1200
1210
  name: "preview"
1201
1211
  }, null), o?.value && l("div", {
1202
1212
  class: `${a}-toolbar-item-name`
@@ -1213,13 +1223,13 @@ $$`, "title")
1213
1223
  onClick: () => {
1214
1224
  i("previewOnly");
1215
1225
  }
1216
- }, [l(k, {
1226
+ }, [l($, {
1217
1227
  name: "preview-only"
1218
1228
  }, null), o?.value && l("div", {
1219
1229
  class: `${a}-toolbar-item-name`
1220
1230
  }, [e.value.toolbarTips?.previewOnly])]);
1221
1231
  }
1222
- }), Oo = /* @__PURE__ */ y({
1232
+ }), Wo = /* @__PURE__ */ y({
1223
1233
  name: "ToolbarQuote",
1224
1234
  setup() {
1225
1235
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1228,15 +1238,15 @@ $$`, "title")
1228
1238
  title: t.value.toolbarTips?.quote,
1229
1239
  disabled: o?.value,
1230
1240
  onClick: () => {
1231
- b.emit(e, h, "quote");
1241
+ b.emit(e, f, "quote");
1232
1242
  }
1233
- }, [l(k, {
1243
+ }, [l($, {
1234
1244
  name: "quote"
1235
1245
  }, null), n?.value && l("div", {
1236
1246
  class: `${a}-toolbar-item-name`
1237
1247
  }, [t.value.toolbarTips?.quote])]);
1238
1248
  }
1239
- }), Wo = /* @__PURE__ */ y({
1249
+ }), _o = /* @__PURE__ */ y({
1240
1250
  name: "ToolbarRevoke",
1241
1251
  setup() {
1242
1252
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1245,15 +1255,15 @@ $$`, "title")
1245
1255
  title: t.value.toolbarTips?.revoke,
1246
1256
  disabled: o?.value,
1247
1257
  onClick: () => {
1248
- b.emit(e, je);
1258
+ b.emit(e, qe);
1249
1259
  }
1250
- }, [l(k, {
1260
+ }, [l($, {
1251
1261
  name: "revoke"
1252
1262
  }, null), n?.value && l("div", {
1253
1263
  class: `${a}-toolbar-item-name`
1254
1264
  }, [t.value.toolbarTips?.revoke])]);
1255
1265
  }
1256
- }), _o = /* @__PURE__ */ y({
1266
+ }), zo = /* @__PURE__ */ y({
1257
1267
  name: "ToolbarSave",
1258
1268
  setup() {
1259
1269
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1262,15 +1272,15 @@ $$`, "title")
1262
1272
  title: t.value.toolbarTips?.save,
1263
1273
  disabled: o?.value,
1264
1274
  onClick: () => {
1265
- b.emit(e, Ye);
1275
+ b.emit(e, Ke);
1266
1276
  }
1267
- }, [l(k, {
1277
+ }, [l($, {
1268
1278
  name: "save"
1269
1279
  }, null), n?.value && l("div", {
1270
1280
  class: `${a}-toolbar-item-name`
1271
1281
  }, [t.value.toolbarTips?.save])]);
1272
1282
  }
1273
- }), zo = /* @__PURE__ */ y({
1283
+ }), Uo = /* @__PURE__ */ y({
1274
1284
  name: "ToolbarStrikeThrough",
1275
1285
  setup() {
1276
1286
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1279,15 +1289,15 @@ $$`, "title")
1279
1289
  title: t.value.toolbarTips?.strikeThrough,
1280
1290
  disabled: o?.value,
1281
1291
  onClick: () => {
1282
- b.emit(e, h, "strikeThrough");
1292
+ b.emit(e, f, "strikeThrough");
1283
1293
  }
1284
- }, [l(k, {
1294
+ }, [l($, {
1285
1295
  name: "strike-through"
1286
1296
  }, null), n?.value && l("div", {
1287
1297
  class: `${a}-toolbar-item-name`
1288
1298
  }, [t.value.toolbarTips?.strikeThrough])]);
1289
1299
  }
1290
- }), Uo = /* @__PURE__ */ y({
1300
+ }), qo = /* @__PURE__ */ y({
1291
1301
  name: "ToolbarSub",
1292
1302
  setup() {
1293
1303
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1296,15 +1306,15 @@ $$`, "title")
1296
1306
  title: t.value.toolbarTips?.sub,
1297
1307
  disabled: o?.value,
1298
1308
  onClick: () => {
1299
- b.emit(e, h, "sub");
1309
+ b.emit(e, f, "sub");
1300
1310
  }
1301
- }, [l(k, {
1311
+ }, [l($, {
1302
1312
  name: "sub"
1303
1313
  }, null), n?.value && l("div", {
1304
1314
  class: `${a}-toolbar-item-name`
1305
1315
  }, [t.value.toolbarTips?.sub])]);
1306
1316
  }
1307
- }), qo = /* @__PURE__ */ y({
1317
+ }), Ko = /* @__PURE__ */ y({
1308
1318
  name: "ToolbarSup",
1309
1319
  setup() {
1310
1320
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1313,15 +1323,15 @@ $$`, "title")
1313
1323
  title: t.value.toolbarTips?.sup,
1314
1324
  disabled: o?.value,
1315
1325
  onClick: () => {
1316
- b.emit(e, h, "sup");
1326
+ b.emit(e, f, "sup");
1317
1327
  }
1318
- }, [l(k, {
1328
+ }, [l($, {
1319
1329
  name: "sup"
1320
1330
  }, null), n?.value && l("div", {
1321
1331
  class: `${a}-toolbar-item-name`
1322
1332
  }, [t.value.toolbarTips?.sup])]);
1323
1333
  }
1324
- }), Ko = {
1334
+ }), Go = {
1325
1335
  tableShape: {
1326
1336
  type: Array,
1327
1337
  default: () => [6, 4]
@@ -1331,9 +1341,9 @@ $$`, "title")
1331
1341
  default: () => {
1332
1342
  }
1333
1343
  }
1334
- }, Go = /* @__PURE__ */ y({
1344
+ }, jo = /* @__PURE__ */ y({
1335
1345
  name: "TableShape",
1336
- props: Ko,
1346
+ props: Go,
1337
1347
  setup(e) {
1338
1348
  const t = q({
1339
1349
  x: -1,
@@ -1365,7 +1375,7 @@ $$`, "title")
1365
1375
  class: [`${a}-table-shape-col-default`, c <= t.x && m <= t.y && `${a}-table-shape-col-include`]
1366
1376
  }, null)]))]))]);
1367
1377
  }
1368
- }), jo = /* @__PURE__ */ y({
1378
+ }), Yo = /* @__PURE__ */ y({
1369
1379
  name: "ToolbarTable",
1370
1380
  setup() {
1371
1381
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = r("tableShape"), s = `${e}-toolbar-wrapper`, c = x(!1);
@@ -1377,10 +1387,10 @@ $$`, "title")
1377
1387
  },
1378
1388
  disabled: o?.value,
1379
1389
  key: "bar-table",
1380
- overlay: l(Go, {
1390
+ overlay: l(jo, {
1381
1391
  tableShape: i.value,
1382
1392
  onSelected: (u) => {
1383
- o?.value || b.emit(e, h, "table", {
1393
+ o?.value || b.emit(e, f, "table", {
1384
1394
  selectedShape: u
1385
1395
  });
1386
1396
  }
@@ -1390,14 +1400,14 @@ $$`, "title")
1390
1400
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
1391
1401
  title: t.value.toolbarTips?.table,
1392
1402
  disabled: o?.value
1393
- }, [l(k, {
1403
+ }, [l($, {
1394
1404
  name: "table"
1395
1405
  }, null), n?.value && l("div", {
1396
1406
  class: `${a}-toolbar-item-name`
1397
1407
  }, [t.value.toolbarTips?.table])])]
1398
1408
  });
1399
1409
  }
1400
- }), Yo = /* @__PURE__ */ y({
1410
+ }), Zo = /* @__PURE__ */ y({
1401
1411
  name: "ToolbarTask",
1402
1412
  setup() {
1403
1413
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1406,19 +1416,19 @@ $$`, "title")
1406
1416
  title: t.value.toolbarTips?.task,
1407
1417
  disabled: o?.value,
1408
1418
  onClick: () => {
1409
- b.emit(e, h, "task");
1419
+ b.emit(e, f, "task");
1410
1420
  }
1411
- }, [l(k, {
1421
+ }, [l($, {
1412
1422
  name: "task"
1413
1423
  }, null), n?.value && l("div", {
1414
1424
  class: `${a}-toolbar-item-name`
1415
1425
  }, [t.value.toolbarTips?.task])]);
1416
1426
  }
1417
- }), Zo = /* @__PURE__ */ y({
1427
+ }), Xo = /* @__PURE__ */ y({
1418
1428
  name: "ToolbarTitle",
1419
1429
  setup() {
1420
1430
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName"), i = `${e}-toolbar-wrapper`, s = x(!1), c = (u) => {
1421
- o?.value || b.emit(e, h, u);
1431
+ o?.value || b.emit(e, f, u);
1422
1432
  };
1423
1433
  return () => l(Q, {
1424
1434
  relative: `#${i}`,
@@ -1481,14 +1491,14 @@ $$`, "title")
1481
1491
  class: [`${a}-toolbar-item`, o?.value && `${a}-disabled`],
1482
1492
  disabled: o?.value,
1483
1493
  title: t.value.toolbarTips?.title
1484
- }, [l(k, {
1494
+ }, [l($, {
1485
1495
  name: "title"
1486
1496
  }, null), n?.value && l("div", {
1487
1497
  class: `${a}-toolbar-item-name`
1488
1498
  }, [t.value.toolbarTips?.title])])]
1489
1499
  });
1490
1500
  }
1491
- }), Xo = /* @__PURE__ */ y({
1501
+ }), Jo = /* @__PURE__ */ y({
1492
1502
  name: "ToolbarUnderline",
1493
1503
  setup() {
1494
1504
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1497,15 +1507,15 @@ $$`, "title")
1497
1507
  title: t.value.toolbarTips?.underline,
1498
1508
  disabled: o?.value,
1499
1509
  onClick: () => {
1500
- b.emit(e, h, "underline");
1510
+ b.emit(e, f, "underline");
1501
1511
  }
1502
- }, [l(k, {
1512
+ }, [l($, {
1503
1513
  name: "underline"
1504
1514
  }, null), n?.value && l("div", {
1505
1515
  class: `${a}-toolbar-item-name`
1506
1516
  }, [t.value.toolbarTips?.underline])]);
1507
1517
  }
1508
- }), Jo = /* @__PURE__ */ y({
1518
+ }), Qo = /* @__PURE__ */ y({
1509
1519
  name: "ToolbarUnorderedList",
1510
1520
  setup() {
1511
1521
  const e = r("editorId"), t = r("usedLanguageText"), o = r("disabled"), n = r("showToolbarName");
@@ -1514,15 +1524,15 @@ $$`, "title")
1514
1524
  title: t.value.toolbarTips?.unorderedList,
1515
1525
  disabled: o?.value,
1516
1526
  onClick: () => {
1517
- b.emit(e, h, "unorderedList");
1527
+ b.emit(e, f, "unorderedList");
1518
1528
  }
1519
- }, [l(k, {
1529
+ }, [l($, {
1520
1530
  name: "unordered-list"
1521
1531
  }, null), n?.value && l("div", {
1522
1532
  class: `${a}-toolbar-item-name`
1523
1533
  }, [t.value.toolbarTips?.unorderedList])]);
1524
1534
  }
1525
- }), Qo = () => {
1535
+ }), el = () => {
1526
1536
  const e = r("editorId"), t = r("setting"), o = r("updateSetting"), {
1527
1537
  editorExtensions: n,
1528
1538
  editorExtensionsAttrs: i
@@ -1544,129 +1554,129 @@ $$`, "title")
1544
1554
  }, g = () => {
1545
1555
  s = window.screenfull, m();
1546
1556
  };
1547
- return O(() => {
1548
- m(), s || Jt("script", {
1557
+ return W(() => {
1558
+ m(), s || Xt("script", {
1549
1559
  ...i.screenfull?.js,
1550
1560
  src: n.screenfull.js,
1551
- id: rt.screenfull,
1561
+ id: nt.screenfull,
1552
1562
  onload: g
1553
1563
  }, "screenfull");
1554
- }), O(() => {
1564
+ }), W(() => {
1555
1565
  b.on(e, {
1556
- name: Kt,
1566
+ name: qt,
1557
1567
  callback: u
1558
1568
  });
1559
1569
  }), {
1560
1570
  fullscreenHandler: u
1561
1571
  };
1562
1572
  };
1563
- let el = 0;
1564
- const Je = () => {
1573
+ let tl = 0;
1574
+ const Ye = () => {
1565
1575
  const e = r("editorId"), t = r("theme"), o = r("previewTheme"), n = r("language"), i = r("disabled"), s = r("noUploadImg"), c = r("noPrettier"), u = r("codeTheme"), m = r("showToolbarName"), g = r("setting"), v = r("defToolbars");
1566
1576
  return {
1567
- barRender: ($) => {
1568
- if (kt.includes($))
1569
- switch ($) {
1577
+ barRender: (k) => {
1578
+ if (kt.includes(k))
1579
+ switch (k) {
1570
1580
  case "-":
1571
- return l(ho, {
1572
- key: `bar-${el++}`
1581
+ return l(fo, {
1582
+ key: `bar-${tl++}`
1573
1583
  }, null);
1574
1584
  case "bold":
1575
- return l(fo, {
1585
+ return l(po, {
1576
1586
  key: "bar-bold"
1577
1587
  }, null);
1578
1588
  case "underline":
1579
- return l(Xo, {
1589
+ return l(Jo, {
1580
1590
  key: "bar-unorderline"
1581
1591
  }, null);
1582
1592
  case "italic":
1583
- return l(No, {
1593
+ return l(Ao, {
1584
1594
  key: "bar-italic"
1585
1595
  }, null);
1586
1596
  case "strikeThrough":
1587
- return l(zo, {
1597
+ return l(Uo, {
1588
1598
  key: "bar-strikeThrough"
1589
1599
  }, null);
1590
1600
  case "title":
1591
- return l(Zo, {
1601
+ return l(Xo, {
1592
1602
  key: "bar-title"
1593
1603
  }, null);
1594
1604
  case "sub":
1595
- return l(Uo, {
1605
+ return l(qo, {
1596
1606
  key: "bar-sub"
1597
1607
  }, null);
1598
1608
  case "sup":
1599
- return l(qo, {
1609
+ return l(Ko, {
1600
1610
  key: "bar-sup"
1601
1611
  }, null);
1602
1612
  case "quote":
1603
- return l(Oo, {
1613
+ return l(Wo, {
1604
1614
  key: "bar-quote"
1605
1615
  }, null);
1606
1616
  case "unorderedList":
1607
- return l(Jo, {
1617
+ return l(Qo, {
1608
1618
  key: "bar-unorderedList"
1609
1619
  }, null);
1610
1620
  case "orderedList":
1611
- return l(Fo, {
1621
+ return l(Bo, {
1612
1622
  key: "bar-orderedList"
1613
1623
  }, null);
1614
1624
  case "task":
1615
- return l(Yo, {
1625
+ return l(Zo, {
1616
1626
  key: "bar-task"
1617
1627
  }, null);
1618
1628
  case "codeRow":
1619
- return l(wo, {
1629
+ return l(yo, {
1620
1630
  key: "bar-codeRow"
1621
1631
  }, null);
1622
1632
  case "code":
1623
- return l(To, {
1633
+ return l(wo, {
1624
1634
  key: "bar-code"
1625
1635
  }, null);
1626
1636
  case "link":
1627
- return l(Do, {
1637
+ return l(Mo, {
1628
1638
  key: "bar-link"
1629
1639
  }, null);
1630
1640
  case "image":
1631
- return s ? l(ko, {
1641
+ return s ? l(xo, {
1632
1642
  key: "bar-image"
1633
- }, null) : l(Eo, {
1643
+ }, null) : l(No, {
1634
1644
  key: "bar-imageDropdown"
1635
1645
  }, null);
1636
1646
  case "table":
1637
- return l(jo, {
1647
+ return l(Yo, {
1638
1648
  key: "bar-table"
1639
1649
  }, null);
1640
1650
  case "revoke":
1641
- return l(Wo, {
1651
+ return l(_o, {
1642
1652
  key: "bar-revoke"
1643
1653
  }, null);
1644
1654
  case "next":
1645
- return l(Ro, {
1655
+ return l(Fo, {
1646
1656
  key: "bar-next"
1647
1657
  }, null);
1648
1658
  case "save":
1649
- return l(_o, {
1659
+ return l(zo, {
1650
1660
  key: "bar-save"
1651
1661
  }, null);
1652
1662
  case "prettier":
1653
- return c && l(Po, {
1663
+ return c && l(Ho, {
1654
1664
  key: "bar-prettier"
1655
1665
  }, null);
1656
1666
  case "pageFullscreen":
1657
- return !g.value.fullscreen && l(Bo, {
1667
+ return !g.value.fullscreen && l(Po, {
1658
1668
  key: "bar-pageFullscreen"
1659
1669
  }, null);
1660
1670
  case "fullscreen":
1661
- return l(yo, {
1671
+ return l(Co, {
1662
1672
  key: "bar-fullscreen"
1663
1673
  }, null);
1664
1674
  case "catalog":
1665
- return l(po, {
1675
+ return l(To, {
1666
1676
  key: "bar-catalog"
1667
1677
  }, null);
1668
1678
  case "preview":
1669
- return l(Ho, {
1679
+ return l(Oo, {
1670
1680
  key: "bar-preview"
1671
1681
  }, null);
1672
1682
  case "previewOnly":
@@ -1678,44 +1688,44 @@ const Je = () => {
1678
1688
  key: "bar-htmlPreview"
1679
1689
  }, null);
1680
1690
  case "github":
1681
- return l(Co, {
1691
+ return l(ko, {
1682
1692
  key: "bar-github"
1683
1693
  }, null);
1684
1694
  case "mermaid":
1685
- return l(Mo, {
1695
+ return l(Ro, {
1686
1696
  key: "bar-mermaid"
1687
1697
  }, null);
1688
1698
  case "katex":
1689
- return l(Ao, {
1699
+ return l(Do, {
1690
1700
  key: "bar-katex"
1691
1701
  }, null);
1692
1702
  }
1693
1703
  else if (v.value instanceof Array) {
1694
- const f = v.value[$];
1695
- return f ? re(f, {
1696
- theme: f.props?.theme || t.value,
1697
- previewTheme: f.props?.theme || o.value,
1698
- language: f.props?.theme || n.value,
1699
- codeTheme: f.props?.codeTheme || u.value,
1700
- disabled: f.props?.disabled || i.value,
1701
- showToolbarName: f.props?.showToolbarName || m.value,
1704
+ const p = v.value[k];
1705
+ return p ? ne(p, {
1706
+ theme: p.props?.theme || t.value,
1707
+ previewTheme: p.props?.theme || o.value,
1708
+ language: p.props?.theme || n.value,
1709
+ codeTheme: p.props?.codeTheme || u.value,
1710
+ disabled: p.props?.disabled || i.value,
1711
+ showToolbarName: p.props?.showToolbarName || m.value,
1702
1712
  insert(L) {
1703
- b.emit(e, h, "universal", {
1713
+ b.emit(e, f, "universal", {
1704
1714
  generate: L
1705
1715
  });
1706
1716
  }
1707
1717
  }) : "";
1708
1718
  } else if (v.value?.children instanceof Array) {
1709
- const f = v.value.children[$];
1710
- return f ? re(f, {
1711
- theme: f.props?.theme || t.value,
1712
- previewTheme: f.props?.theme || o.value,
1713
- language: f.props?.theme || n.value,
1714
- codeTheme: f.props?.codeTheme || u.value,
1715
- disabled: f.props?.disabled || i.value,
1716
- showToolbarName: f.props?.showToolbarName || m.value,
1719
+ const p = v.value.children[k];
1720
+ return p ? ne(p, {
1721
+ theme: p.props?.theme || t.value,
1722
+ previewTheme: p.props?.theme || o.value,
1723
+ language: p.props?.theme || n.value,
1724
+ codeTheme: p.props?.codeTheme || u.value,
1725
+ disabled: p.props?.disabled || i.value,
1726
+ showToolbarName: p.props?.showToolbarName || m.value,
1717
1727
  insert(L) {
1718
- b.emit(e, h, "universal", {
1728
+ b.emit(e, f, "universal", {
1719
1729
  generate: L
1720
1730
  });
1721
1731
  }
@@ -1724,64 +1734,64 @@ const Je = () => {
1724
1734
  return "";
1725
1735
  }
1726
1736
  };
1727
- }, tl = /* @__PURE__ */ y({
1737
+ }, ol = /* @__PURE__ */ y({
1728
1738
  name: "FloatingToolbar",
1729
1739
  setup() {
1730
1740
  const e = r("floatingToolbars"), {
1731
1741
  barRender: t
1732
- } = Je();
1742
+ } = Ye();
1733
1743
  return () => l("div", {
1734
1744
  class: `${a}-floating-toolbar`
1735
1745
  }, [e.value.map((o) => t(o))]);
1736
1746
  }
1737
- }), he = qe.define(), ol = Ke.define({
1747
+ }), ve = _e.define(), ll = ze.define({
1738
1748
  create() {
1739
1749
  return null;
1740
1750
  },
1741
1751
  update(e, t) {
1742
- for (const o of t.effects) o.is(he) && (e = o.value);
1752
+ for (const o of t.effects) o.is(ve) && (e = o.value);
1743
1753
  return e;
1744
1754
  },
1745
1755
  provide: (e) => Ot.from(e)
1746
- }), ll = (e) => {
1756
+ }), al = (e) => {
1747
1757
  const t = (n, i) => {
1748
1758
  n.dispatch({
1749
- effects: he.of({
1759
+ effects: ve.of({
1750
1760
  pos: i,
1751
1761
  above: !0,
1752
1762
  arrow: !0,
1753
1763
  create: () => {
1754
1764
  const s = document.createElement("div"), c = document.createElement("div");
1755
1765
  s.appendChild(c);
1756
- const u = Ct(tl);
1766
+ const u = yt(ol);
1757
1767
  return e.privide(u), u.mount(s), { dom: s, destroy: () => u.unmount() };
1758
1768
  }
1759
1769
  })
1760
1770
  });
1761
- }, o = ee.updateListener.of((n) => {
1771
+ }, o = M.updateListener.of((n) => {
1762
1772
  if (n.selectionSet || n.docChanged) {
1763
1773
  const i = n.state, s = i.selection.main;
1764
1774
  if (!s.empty)
1765
1775
  t(n.view, s.from);
1766
1776
  else {
1767
1777
  const c = s.head, u = i.doc.lineAt(c);
1768
- /^\s*$/.test(u.text) ? t(n.view, c) : n.view.dispatch({ effects: he.of(null) });
1778
+ /^\s*$/.test(u.text) ? t(n.view, c) : n.view.dispatch({ effects: ve.of(null) });
1769
1779
  }
1770
1780
  }
1771
1781
  });
1772
- return [ol, o];
1773
- }, al = "#e5c07b", Ee = "var(--md-color)", nl = "#56b6c2", rl = "#fff", X = "#3f4a54", Ne = "#2d8cf0", sl = "#2d8cf0", il = "#3f4a54", Ae = "#d19a66", cl = "#c678dd", ul = "#f6f6f6", dl = "#ceedfa33", De = "var(--md-bk-color)", me = "var(--md-bk-color)", ml = "#bad5fa", Me = "#3f4a54", bl = ee.theme(
1782
+ return [ll, o];
1783
+ }, nl = "#e5c07b", Ie = "var(--md-color)", rl = "#56b6c2", sl = "#fff", X = "#3f4a54", Le = "#2d8cf0", il = "#2d8cf0", cl = "#3f4a54", Ee = "#d19a66", ul = "#c678dd", dl = "#f6f6f6", ml = "#ceedfa33", Ne = "var(--md-bk-color)", ue = "var(--md-bk-color)", bl = "#bad5fa", Ae = "#3f4a54", vl = M.theme(
1774
1784
  {
1775
1785
  "&": {
1776
1786
  color: X,
1777
- backgroundColor: De
1787
+ backgroundColor: Ne
1778
1788
  },
1779
1789
  ".cm-content": {
1780
- caretColor: Me
1790
+ caretColor: Ae
1781
1791
  },
1782
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: Me },
1783
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: ml },
1784
- ".cm-panels": { backgroundColor: ul, color: X },
1792
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: Ae },
1793
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: bl },
1794
+ ".cm-panels": { backgroundColor: dl, color: X },
1785
1795
  ".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
1786
1796
  ".cm-panels.cm-panels-bottom": { borderTop: "1px solid var(--md-border-color)" },
1787
1797
  ".cm-searchMatch": {
@@ -1797,13 +1807,13 @@ const Je = () => {
1797
1807
  backgroundColor: "#bad0f847"
1798
1808
  },
1799
1809
  ".cm-gutters": {
1800
- backgroundColor: De,
1810
+ backgroundColor: Ne,
1801
1811
  color: X,
1802
1812
  borderRight: "1px solid",
1803
1813
  borderColor: "var(--md-border-color)"
1804
1814
  },
1805
1815
  ".cm-activeLineGutter": {
1806
- backgroundColor: dl
1816
+ backgroundColor: ml
1807
1817
  },
1808
1818
  ".cm-foldPlaceholder": {
1809
1819
  backgroundColor: "transparent",
@@ -1812,7 +1822,7 @@ const Je = () => {
1812
1822
  },
1813
1823
  ".cm-tooltip": {
1814
1824
  border: "1px solid var(--md-border-color)",
1815
- backgroundColor: me
1825
+ backgroundColor: ue
1816
1826
  },
1817
1827
  ".cm-tooltip .cm-tooltip-arrow:before": {
1818
1828
  borderTopColor: "var(--md-border-color)",
@@ -1820,8 +1830,8 @@ const Je = () => {
1820
1830
  borderBottomColor: "var(--md-border-color)"
1821
1831
  },
1822
1832
  ".cm-tooltip .cm-tooltip-arrow:after": {
1823
- borderTopColor: me,
1824
- borderBottomColor: me
1833
+ borderTopColor: ue,
1834
+ borderBottomColor: ue
1825
1835
  },
1826
1836
  ".cm-tooltip-autocomplete": {
1827
1837
  "& > ul > li[aria-selected]": {
@@ -1830,11 +1840,11 @@ const Je = () => {
1830
1840
  }
1831
1841
  }
1832
1842
  // { dark: true }
1833
- ), vl = Xe.define([
1834
- { tag: d.keyword, color: cl },
1835
- { tag: [d.name, d.deleted, d.character, d.propertyName, d.macroName], color: Ee },
1836
- { tag: [d.function(d.variableName), d.labelName], color: sl },
1837
- { tag: [d.color, d.constant(d.name), d.standard(d.name)], color: Ae },
1843
+ ), gl = je.define([
1844
+ { tag: d.keyword, color: ul },
1845
+ { tag: [d.name, d.deleted, d.character, d.propertyName, d.macroName], color: Ie },
1846
+ { tag: [d.function(d.variableName), d.labelName], color: il },
1847
+ { tag: [d.color, d.constant(d.name), d.standard(d.name)], color: Ee },
1838
1848
  { tag: [d.definition(d.name), d.separator], color: X },
1839
1849
  {
1840
1850
  tag: [
@@ -1847,7 +1857,7 @@ const Je = () => {
1847
1857
  d.self,
1848
1858
  d.namespace
1849
1859
  ],
1850
- color: al
1860
+ color: nl
1851
1861
  },
1852
1862
  {
1853
1863
  tag: [
@@ -1859,32 +1869,32 @@ const Je = () => {
1859
1869
  d.link,
1860
1870
  d.special(d.string)
1861
1871
  ],
1862
- color: nl
1872
+ color: rl
1863
1873
  },
1864
- { tag: [d.meta, d.comment], color: Ne },
1874
+ { tag: [d.meta, d.comment], color: Le },
1865
1875
  { tag: d.strong, fontWeight: "bold" },
1866
1876
  { tag: d.emphasis, fontStyle: "italic" },
1867
1877
  { tag: d.strikethrough, textDecoration: "line-through" },
1868
- { tag: d.link, color: Ne, textDecoration: "underline" },
1869
- { tag: d.heading, fontWeight: "bold", color: Ee },
1870
- { tag: [d.atom, d.bool, d.special(d.variableName)], color: Ae },
1871
- { tag: [d.processingInstruction, d.string, d.inserted], color: il },
1872
- { tag: d.invalid, color: rl }
1873
- ]), Re = [
1874
- bl,
1875
- Ze(vl)
1876
- ], gl = "#e5c07b", Fe = "var(--md-color)", hl = "#56b6c2", fl = "#ffffff", J = "var(--md-color)", Be = "#e5c07b", pl = "#e5c07b", Tl = "var(--md-color)", Pe = "#d19a66", wl = "#c678dd", yl = "#21252b", Cl = "#2c313a", He = "var(--md-bk-color)", be = "var(--md-bk-color)", $l = "#ceedfa33", Ve = "#528bff", kl = ee.theme(
1878
+ { tag: d.link, color: Le, textDecoration: "underline" },
1879
+ { tag: d.heading, fontWeight: "bold", color: Ie },
1880
+ { tag: [d.atom, d.bool, d.special(d.variableName)], color: Ee },
1881
+ { tag: [d.processingInstruction, d.string, d.inserted], color: cl },
1882
+ { tag: d.invalid, color: sl }
1883
+ ]), De = [
1884
+ vl,
1885
+ Ge(gl)
1886
+ ], hl = "#e5c07b", Me = "var(--md-color)", fl = "#56b6c2", pl = "#ffffff", J = "var(--md-color)", Re = "#e5c07b", Tl = "#e5c07b", wl = "var(--md-color)", Fe = "#d19a66", yl = "#c678dd", Cl = "#21252b", kl = "#2c313a", Be = "var(--md-bk-color)", de = "var(--md-bk-color)", $l = "#ceedfa33", Pe = "#528bff", xl = M.theme(
1877
1887
  {
1878
1888
  "&": {
1879
1889
  color: J,
1880
- backgroundColor: He
1890
+ backgroundColor: Be
1881
1891
  },
1882
1892
  ".cm-content": {
1883
- caretColor: Ve
1893
+ caretColor: Pe
1884
1894
  },
1885
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: Ve },
1895
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: Pe },
1886
1896
  "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: $l },
1887
- ".cm-panels": { backgroundColor: yl, color: J },
1897
+ ".cm-panels": { backgroundColor: Cl, color: J },
1888
1898
  ".cm-panels.cm-panels-top": { borderBottom: "1px solid var(--md-border-color)" },
1889
1899
  ".cm-panels.cm-panels-bottom": { borderTop: "1px solid var(--md-border-color)" },
1890
1900
  ".cm-searchMatch": {
@@ -1900,13 +1910,13 @@ const Je = () => {
1900
1910
  backgroundColor: "#bad0f847"
1901
1911
  },
1902
1912
  ".cm-gutters": {
1903
- backgroundColor: He,
1913
+ backgroundColor: Be,
1904
1914
  color: J,
1905
1915
  borderRight: "1px solid",
1906
1916
  borderColor: "var(--md-border-color)"
1907
1917
  },
1908
1918
  ".cm-activeLineGutter": {
1909
- backgroundColor: Cl
1919
+ backgroundColor: kl
1910
1920
  },
1911
1921
  ".cm-foldPlaceholder": {
1912
1922
  backgroundColor: "transparent",
@@ -1915,7 +1925,7 @@ const Je = () => {
1915
1925
  },
1916
1926
  ".cm-tooltip": {
1917
1927
  border: "1px solid var(--md-border-color)",
1918
- backgroundColor: be
1928
+ backgroundColor: de
1919
1929
  },
1920
1930
  ".cm-tooltip .cm-tooltip-arrow:before": {
1921
1931
  borderTopColor: "var(--md-border-color)",
@@ -1923,8 +1933,8 @@ const Je = () => {
1923
1933
  borderBottomColor: "var(--md-border-color)"
1924
1934
  },
1925
1935
  ".cm-tooltip .cm-tooltip-arrow:after": {
1926
- borderTopColor: be,
1927
- borderBottomColor: be
1936
+ borderTopColor: de,
1937
+ borderBottomColor: de
1928
1938
  },
1929
1939
  ".cm-tooltip-autocomplete": {
1930
1940
  "& > ul > li[aria-selected]": {
@@ -1933,11 +1943,11 @@ const Je = () => {
1933
1943
  }
1934
1944
  },
1935
1945
  { dark: !0 }
1936
- ), xl = Xe.define([
1937
- { tag: d.keyword, color: wl },
1938
- { tag: [d.name, d.deleted, d.character, d.propertyName, d.macroName], color: Fe },
1939
- { tag: [d.function(d.variableName), d.labelName], color: pl },
1940
- { tag: [d.color, d.constant(d.name), d.standard(d.name)], color: Pe },
1946
+ ), Sl = je.define([
1947
+ { tag: d.keyword, color: yl },
1948
+ { tag: [d.name, d.deleted, d.character, d.propertyName, d.macroName], color: Me },
1949
+ { tag: [d.function(d.variableName), d.labelName], color: Tl },
1950
+ { tag: [d.color, d.constant(d.name), d.standard(d.name)], color: Fe },
1941
1951
  { tag: [d.definition(d.name), d.separator], color: J },
1942
1952
  {
1943
1953
  tag: [
@@ -1950,7 +1960,7 @@ const Je = () => {
1950
1960
  d.self,
1951
1961
  d.namespace
1952
1962
  ],
1953
- color: gl
1963
+ color: hl
1954
1964
  },
1955
1965
  {
1956
1966
  tag: [
@@ -1962,24 +1972,24 @@ const Je = () => {
1962
1972
  d.link,
1963
1973
  d.special(d.string)
1964
1974
  ],
1965
- color: hl
1975
+ color: fl
1966
1976
  },
1967
- { tag: [d.meta, d.comment], color: Be },
1977
+ { tag: [d.meta, d.comment], color: Re },
1968
1978
  { tag: d.strong, fontWeight: "bold" },
1969
1979
  { tag: d.emphasis, fontStyle: "italic" },
1970
1980
  { tag: d.strikethrough, textDecoration: "line-through" },
1971
- { tag: d.link, color: Be, textDecoration: "underline" },
1972
- { tag: d.heading, fontWeight: "bold", color: Fe },
1973
- { tag: [d.atom, d.bool, d.special(d.variableName)], color: Pe },
1974
- { tag: [d.processingInstruction, d.string, d.inserted], color: Tl },
1975
- { tag: d.invalid, color: fl }
1976
- ]), Oe = [
1977
- kl,
1978
- Ze(xl)
1979
- ], Sl = (e, t) => {
1981
+ { tag: d.link, color: Re, textDecoration: "underline" },
1982
+ { tag: d.heading, fontWeight: "bold", color: Me },
1983
+ { tag: [d.atom, d.bool, d.special(d.variableName)], color: Fe },
1984
+ { tag: [d.processingInstruction, d.string, d.inserted], color: wl },
1985
+ { tag: d.invalid, color: pl }
1986
+ ]), He = [
1987
+ xl,
1988
+ Ge(Sl)
1989
+ ], Il = (e, t) => {
1980
1990
  const o = r("editorId"), n = (s) => {
1981
1991
  s instanceof Promise ? s.then((c) => {
1982
- b.emit(o, h, "universal", {
1992
+ b.emit(o, f, "universal", {
1983
1993
  generate() {
1984
1994
  return {
1985
1995
  targetValue: c
@@ -1988,7 +1998,7 @@ const Je = () => {
1988
1998
  });
1989
1999
  }).catch((c) => {
1990
2000
  console.error(c);
1991
- }) : b.emit(o, h, "universal", {
2001
+ }) : b.emit(o, f, "universal", {
1992
2002
  generate() {
1993
2003
  return {
1994
2004
  targetValue: s
@@ -2000,36 +2010,36 @@ const Je = () => {
2000
2010
  if (!s.clipboardData)
2001
2011
  return;
2002
2012
  if (s.clipboardData.files.length > 0) {
2003
- const { files: $ } = s.clipboardData;
2013
+ const { files: k } = s.clipboardData;
2004
2014
  b.emit(
2005
2015
  o,
2006
- pe,
2007
- Array.from($).filter((f) => /image\/.*/.test(f.type))
2016
+ he,
2017
+ Array.from(k).filter((p) => /image\/.*/.test(p.type))
2008
2018
  ), s.preventDefault();
2009
2019
  return;
2010
2020
  }
2011
2021
  const c = s.clipboardData.getData("text/plain"), u = t.value?.view.state.selection.main.to || 0, m = t.value?.view.state.doc.lineAt(u).from || 0, g = t.value?.view.state.doc.sliceString(m, u) || "", v = /!\[.*\]\(\s*$/.test(g), w = /!\[.*\]\((.*)\s?.*\)/.test(c);
2012
2022
  if (v) {
2013
- const $ = e.transformImgUrl(c);
2014
- n($), s.preventDefault();
2023
+ const k = e.transformImgUrl(c);
2024
+ n(k), s.preventDefault();
2015
2025
  return;
2016
2026
  } else if (w) {
2017
- const $ = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
2018
- $ ? Promise.all(
2019
- $.map((f) => e.transformImgUrl(f))
2020
- ).then((f) => {
2027
+ const k = c.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`, "g"));
2028
+ k ? Promise.all(
2029
+ k.map((p) => e.transformImgUrl(p))
2030
+ ).then((p) => {
2021
2031
  n(
2022
- f.reduce((p, L, E) => p.replace($[E], L), c)
2032
+ p.reduce((T, L, E) => T.replace(k[E], L), c)
2023
2033
  );
2024
- }).catch((f) => {
2025
- console.error(f);
2034
+ }).catch((p) => {
2035
+ console.error(p);
2026
2036
  }) : n(c), s.preventDefault();
2027
2037
  return;
2028
2038
  }
2029
2039
  if (e.autoDetectCode && s.clipboardData.types.includes("vscode-editor-data")) {
2030
- const $ = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
2031
- b.emit(o, h, "code", {
2032
- mode: $.mode,
2040
+ const k = JSON.parse(s.clipboardData.getData("vscode-editor-data"));
2041
+ b.emit(o, f, "code", {
2042
+ mode: k.mode,
2033
2043
  text: s.clipboardData.getData("text/plain")
2034
2044
  }), s.preventDefault();
2035
2045
  return;
@@ -2040,113 +2050,113 @@ const Je = () => {
2040
2050
  data: c
2041
2051
  });
2042
2052
  };
2043
- }, Il = (e, t) => [
2053
+ }, Ll = (e, t) => [
2044
2054
  {
2045
2055
  key: "Ctrl-b",
2046
2056
  mac: "Cmd-b",
2047
- run: () => (b.emit(e, h, "bold"), !0)
2057
+ run: () => (b.emit(e, f, "bold"), !0)
2048
2058
  },
2049
2059
  {
2050
2060
  key: "Ctrl-d",
2051
2061
  mac: "Cmd-d",
2052
- run: Nt,
2062
+ run: Et,
2053
2063
  preventDefault: !0
2054
2064
  },
2055
2065
  {
2056
2066
  key: "Ctrl-s",
2057
2067
  mac: "Cmd-s",
2058
- run: (A) => (b.emit(e, Ye, A.state.doc.toString()), !0),
2059
- shift: () => (b.emit(e, h, "strikeThrough"), !0)
2068
+ run: (A) => (b.emit(e, Ke, A.state.doc.toString()), !0),
2069
+ shift: () => (b.emit(e, f, "strikeThrough"), !0)
2060
2070
  },
2061
2071
  {
2062
2072
  key: "Ctrl-u",
2063
2073
  mac: "Cmd-u",
2064
2074
  preventDefault: !0,
2065
- run: () => (b.emit(e, h, "underline"), !0),
2066
- shift: () => (b.emit(e, h, "unorderedList"), !0)
2075
+ run: () => (b.emit(e, f, "underline"), !0),
2076
+ shift: () => (b.emit(e, f, "unorderedList"), !0)
2067
2077
  },
2068
2078
  {
2069
2079
  key: "Ctrl-i",
2070
2080
  mac: "Cmd-i",
2071
2081
  preventDefault: !0,
2072
- run: () => (b.emit(e, h, "italic"), !0),
2073
- shift: () => (b.emit(e, h, "image"), !0)
2082
+ run: () => (b.emit(e, f, "italic"), !0),
2083
+ shift: () => (b.emit(e, f, "image"), !0)
2074
2084
  },
2075
2085
  {
2076
2086
  key: "Ctrl-1",
2077
2087
  mac: "Cmd-1",
2078
- run: () => (b.emit(e, h, "h1"), !0)
2088
+ run: () => (b.emit(e, f, "h1"), !0)
2079
2089
  },
2080
2090
  {
2081
2091
  key: "Ctrl-2",
2082
2092
  mac: "Cmd-2",
2083
- run: () => (b.emit(e, h, "h2"), !0)
2093
+ run: () => (b.emit(e, f, "h2"), !0)
2084
2094
  },
2085
2095
  {
2086
2096
  key: "Ctrl-3",
2087
2097
  mac: "Cmd-3",
2088
- run: () => (b.emit(e, h, "h3"), !0)
2098
+ run: () => (b.emit(e, f, "h3"), !0)
2089
2099
  },
2090
2100
  {
2091
2101
  key: "Ctrl-4",
2092
2102
  mac: "Cmd-4",
2093
- run: () => (b.emit(e, h, "h4"), !0)
2103
+ run: () => (b.emit(e, f, "h4"), !0)
2094
2104
  },
2095
2105
  {
2096
2106
  key: "Ctrl-5",
2097
2107
  mac: "Cmd-5",
2098
- run: () => (b.emit(e, h, "h5"), !0)
2108
+ run: () => (b.emit(e, f, "h5"), !0)
2099
2109
  },
2100
2110
  {
2101
2111
  key: "Ctrl-6",
2102
2112
  mac: "Cmd-6",
2103
- run: () => (b.emit(e, h, "h6"), !0)
2113
+ run: () => (b.emit(e, f, "h6"), !0)
2104
2114
  },
2105
2115
  {
2106
2116
  key: "Ctrl-ArrowUp",
2107
2117
  mac: "Cmd-ArrowUp",
2108
- run: () => (b.emit(e, h, "sup"), !0)
2118
+ run: () => (b.emit(e, f, "sup"), !0)
2109
2119
  },
2110
2120
  {
2111
2121
  key: "Ctrl-ArrowDown",
2112
2122
  mac: "Cmd-ArrowDown",
2113
- run: () => (b.emit(e, h, "sub"), !0)
2123
+ run: () => (b.emit(e, f, "sub"), !0)
2114
2124
  },
2115
2125
  {
2116
2126
  key: "Ctrl-o",
2117
2127
  mac: "Cmd-o",
2118
- run: () => (b.emit(e, h, "orderedList"), !0)
2128
+ run: () => (b.emit(e, f, "orderedList"), !0)
2119
2129
  },
2120
2130
  {
2121
2131
  key: "Ctrl-c",
2122
2132
  mac: "Cmd-c",
2123
- shift: () => (b.emit(e, h, "code"), !0),
2133
+ shift: () => (b.emit(e, f, "code"), !0),
2124
2134
  any(A, C) {
2125
- return (C.ctrlKey || C.metaKey) && C.altKey && C.code === "KeyC" ? (b.emit(e, h, "codeRow"), !0) : !1;
2135
+ return (C.ctrlKey || C.metaKey) && C.altKey && C.code === "KeyC" ? (b.emit(e, f, "codeRow"), !0) : !1;
2126
2136
  }
2127
2137
  },
2128
2138
  {
2129
2139
  key: "Ctrl-l",
2130
2140
  mac: "Cmd-l",
2131
- run: () => (b.emit(e, h, "link"), !0)
2141
+ run: () => (b.emit(e, f, "link"), !0)
2132
2142
  },
2133
2143
  {
2134
2144
  key: "Ctrl-f",
2135
2145
  mac: "Cmd-f",
2136
- shift: () => t.noPrettier ? !1 : (b.emit(e, h, "prettier"), !0)
2146
+ shift: () => t.noPrettier ? !1 : (b.emit(e, f, "prettier"), !0)
2137
2147
  },
2138
2148
  {
2139
- any: (A, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (b.emit(e, h, "table"), !0) : !1
2149
+ any: (A, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (b.emit(e, f, "table"), !0) : !1
2140
2150
  },
2141
- ...to
2142
- ], Ll = /[a-z][a-z0-9.+-]*:\/\/[^\s<>"'`()]+(?:\([^\s<>"'`]*\)[^\s<>"'`]*)*/i, El = /\/\/[^\s<>"'`()]+/i, Nl = /data:[a-z]+\/[a-z0-9.+-]+(?:;base64)?,[a-z0-9+/=%]+/i, Al = /\/(?!\/)[^\s<>"'`()]+/i, Dl = new RegExp(
2143
- `(?<![a-z0-9.+-])(${Ll.source}|${El.source}|${Nl.source}|${Al.source})`,
2151
+ ...eo
2152
+ ], El = /[a-z][a-z0-9.+-]*:\/\/[^\s<>"'`()]+(?:\([^\s<>"'`]*\)[^\s<>"'`]*)*/i, Nl = /\/\/[^\s<>"'`()]+/i, Al = /data:[a-z]+\/[a-z0-9.+-]+(?:;base64)?,[a-z0-9+/=%]+/i, Dl = /\/(?!\/)[^\s<>"'`()]+/i, Ml = new RegExp(
2153
+ `(?<![a-z0-9.+-])(${El.source}|${Nl.source}|${Al.source}|${Dl.source})`,
2144
2154
  "gi"
2145
- ), Ml = (e) => {
2155
+ ), Rl = (e) => {
2146
2156
  const t = (s) => s.length > 10 ? s.slice(0, 10) + "..." : s, o = (s, c) => {
2147
2157
  const u = s.text;
2148
2158
  let m;
2149
- for (; m = Dl.exec(u); ) {
2159
+ for (; m = Ml.exec(u); ) {
2150
2160
  if (!m[0]) continue;
2151
2161
  const g = m[0];
2152
2162
  if (g.length > e.maxLength) {
@@ -2154,19 +2164,19 @@ const Je = () => {
2154
2164
  c.add(
2155
2165
  s.from + m.index,
2156
2166
  s.from + m.index + g.length,
2157
- Wt.replace({ widget: new i(v) })
2167
+ Vt.replace({ widget: new i(v) })
2158
2168
  );
2159
2169
  }
2160
2170
  }
2161
2171
  }, n = (s) => {
2162
- const c = new Ht();
2172
+ const c = new Pt();
2163
2173
  for (let u = 1; u <= s.doc.lines; u++) {
2164
2174
  const m = s.doc.line(u);
2165
2175
  o(m, c);
2166
2176
  }
2167
2177
  return c.finish();
2168
2178
  };
2169
- class i extends _t {
2179
+ class i extends Wt {
2170
2180
  constructor(c) {
2171
2181
  super(), this.short = c;
2172
2182
  }
@@ -2178,208 +2188,208 @@ const Je = () => {
2178
2188
  return this.short === c.short;
2179
2189
  }
2180
2190
  }
2181
- return Ke.define({
2191
+ return ze.define({
2182
2192
  create(s) {
2183
2193
  return n(s);
2184
2194
  },
2185
2195
  update(s, c) {
2186
2196
  return c.docChanged ? n(c.state) : s;
2187
2197
  },
2188
- provide: (s) => ee.decorations.from(s)
2198
+ provide: (s) => M.decorations.from(s)
2189
2199
  });
2190
2200
  };
2191
- U.EDIT_CONTEXT = !1;
2192
- const We = (e) => {
2193
- const t = e.extension instanceof Function ? e.extension(e.options) : e.extension;
2201
+ M.EDIT_CONTEXT = !1;
2202
+ const Ze = (e) => e.extension instanceof Function ? e.extension(e.options) : e.extension, Fl = (e) => {
2203
+ const t = Ze(e);
2194
2204
  return e.compartment ? e.compartment.of(t) : t;
2195
- }, Rl = (e) => {
2205
+ }, Bl = (e) => {
2196
2206
  const t = r("tabWidth"), o = r("editorId"), n = r("theme"), i = r("previewTheme"), s = r("language"), c = r(
2197
2207
  "usedLanguageText"
2198
- ), u = r("disabled"), m = r("showToolbarName"), g = r("customIcon"), v = r("noUploadImg"), w = r("tableShape"), $ = r("noPrettier"), f = r("codeTheme"), p = r("setting"), L = r("updateSetting"), E = r("catalogVisible"), V = r("defToolbars"), S = r("floatingToolbars"), B = r("rootRef"), A = x(), C = $t(), W = x(!1), te = new z(), oe = new z(), ie = new z(), we = new z(), ce = new z(), Qe = Il(o, {
2199
- noPrettier: $
2200
- }), ye = () => [
2201
- ...Qe,
2208
+ ), u = r("disabled"), m = r("showToolbarName"), g = r("customIcon"), v = r("noUploadImg"), w = r("tableShape"), k = r("noPrettier"), p = r("codeTheme"), T = r("setting"), L = r("updateSetting"), E = r("catalogVisible"), V = r("defToolbars"), S = r("floatingToolbars"), P = r("rootRef"), A = x(), C = Ct(), _ = x(!1), ee = new U(), te = new U(), se = new U(), pe = new U(), Xe = new U(), Je = Ll(o, {
2209
+ noPrettier: k
2210
+ }), Te = () => [
2211
+ ...Je,
2212
+ ...Nt,
2202
2213
  ...At,
2203
- ...Dt,
2204
- Mt
2205
- ], le = {
2206
- paste: Sl(e, C),
2214
+ Dt
2215
+ ], oe = {
2216
+ paste: Il(e, C),
2207
2217
  blur: e.onBlur,
2208
2218
  focus: e.onFocus,
2209
2219
  drop: e.onDrop,
2210
2220
  compositionstart: () => {
2211
- W.value = !0;
2221
+ _.value = !0;
2212
2222
  },
2213
- compositionend: (T, N) => {
2214
- W.value = !1, e.updateModelValue(N.state.doc.toString());
2223
+ compositionend: (h, N) => {
2224
+ _.value = !1, e.updateModelValue(N.state.doc.toString());
2215
2225
  },
2216
- input: (T) => {
2217
- e.onInput && e.onInput(T);
2218
- const { data: N } = T;
2226
+ input: (h) => {
2227
+ e.onInput && e.onInput(h);
2228
+ const { data: N } = h;
2219
2229
  e.maxlength && e.modelValue.length + N.length > e.maxlength && b.emit(o, Y, {
2220
2230
  name: "overlength",
2221
2231
  message: "The input text is too long",
2222
2232
  data: N
2223
2233
  });
2224
2234
  }
2225
- }, et = ll({
2226
- privide(T) {
2227
- T.provide("editorId", o), T.provide("theme", n), T.provide("previewTheme", i), T.provide("language", s), T.provide("disabled", u), T.provide("noUploadImg", v), T.provide("tableShape", w), T.provide("noPrettier", $), T.provide("codeTheme", f), T.provide("showToolbarName", m), T.provide("setting", p), T.provide("updateSetting", L), T.provide("usedLanguageText", c), T.provide("catalogVisible", E), T.provide("defToolbars", V), T.provide("tabWidth", t), T.provide("customIcon", g), T.provide("floatingToolbars", S), T.provide("rootRef", B);
2235
+ }, Qe = al({
2236
+ privide(h) {
2237
+ h.provide("editorId", o), h.provide("theme", n), h.provide("previewTheme", i), h.provide("language", s), h.provide("disabled", u), h.provide("noUploadImg", v), h.provide("tableShape", w), h.provide("noPrettier", k), h.provide("codeTheme", p), h.provide("showToolbarName", m), h.provide("setting", T), h.provide("updateSetting", L), h.provide("usedLanguageText", c), h.provide("catalogVisible", E), h.provide("defToolbars", V), h.provide("tabWidth", t), h.provide("customIcon", g), h.provide("floatingToolbars", S), h.provide("rootRef", P);
2228
2238
  }
2229
- }), tt = [
2239
+ }), et = [
2230
2240
  {
2231
2241
  type: "theme",
2232
- extension: (T) => T.value === "light" ? Re : Oe,
2233
- compartment: te,
2242
+ extension: (h) => h.value === "light" ? De : He,
2243
+ compartment: ee,
2234
2244
  options: {
2235
2245
  theme: n
2236
2246
  }
2237
2247
  },
2238
2248
  {
2239
2249
  type: "updateListener",
2240
- extension: U.updateListener.of((T) => {
2241
- T.docChanged && (e.onChange(T.state.doc.toString()), W.value || e.updateModelValue(T.state.doc.toString()));
2250
+ extension: M.updateListener.of((h) => {
2251
+ h.docChanged && (e.onChange(h.state.doc.toString()), _.value || e.updateModelValue(h.state.doc.toString()));
2242
2252
  })
2243
2253
  },
2244
2254
  {
2245
2255
  type: "domEventHandlers",
2246
- extension: U.domEventHandlers(le),
2247
- compartment: we
2256
+ extension: M.domEventHandlers(oe),
2257
+ compartment: pe
2248
2258
  },
2249
2259
  {
2250
2260
  type: "completions",
2251
- extension: Le(e.completions),
2252
- compartment: oe
2261
+ extension: Se(e.completions),
2262
+ compartment: te
2253
2263
  },
2254
2264
  {
2255
2265
  type: "history",
2256
- extension: ke(),
2257
- compartment: ie
2266
+ extension: Ce(),
2267
+ compartment: se
2258
2268
  }
2259
- ], Ce = j.codeMirrorExtensions(
2269
+ ], we = j.codeMirrorExtensions(
2260
2270
  [
2261
2271
  // 横向换行
2262
2272
  {
2263
2273
  type: "lineWrapping",
2264
- extension: U.lineWrapping
2274
+ extension: M.lineWrapping
2265
2275
  },
2266
2276
  {
2267
2277
  type: "keymap",
2268
- extension: zt.of(ye())
2278
+ extension: _t.of(Te())
2269
2279
  },
2270
2280
  // 解决多行placeholder时,光标异常的情况
2271
2281
  {
2272
2282
  type: "drawSelection",
2273
- extension: Ut()
2283
+ extension: zt()
2274
2284
  },
2275
2285
  {
2276
2286
  type: "markdown",
2277
- extension: Bt({ codeLanguages: Pt })
2287
+ extension: Ft({ codeLanguages: Bt })
2278
2288
  },
2279
2289
  {
2280
2290
  type: "linkShortener",
2281
- extension: (T) => Ml(T),
2291
+ extension: (h) => Rl(h),
2282
2292
  options: {
2283
2293
  maxLength: 30
2284
2294
  }
2285
2295
  },
2286
2296
  {
2287
2297
  type: "floatingToolbar",
2288
- extension: S.value.length > 0 ? et : [],
2289
- compartment: ce
2298
+ extension: S.value.length > 0 ? Qe : [],
2299
+ compartment: Xe
2290
2300
  }
2291
2301
  ],
2292
2302
  {
2293
2303
  editorId: o,
2294
2304
  theme: n.value,
2295
- keyBindings: ye()
2305
+ keyBindings: Te()
2296
2306
  }
2297
- ), ot = () => [...tt, ...Ce].map(We);
2298
- return O(() => {
2299
- const T = new U({
2307
+ ), tt = () => [...et, ...we].map(Fl);
2308
+ return W(() => {
2309
+ const h = new M({
2300
2310
  doc: e.modelValue,
2301
2311
  parent: A.value,
2302
- extensions: ot()
2303
- }), N = new go(T);
2312
+ extensions: tt()
2313
+ }), N = new vo(h);
2304
2314
  C.value = N, setTimeout(() => {
2305
- N.setTabSize(t), N.setDisabled(u.value), N.setReadOnly(e.readonly), e.placeholder && N.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && N.setMaxLength(e.maxlength), e.autofocus && T.focus();
2315
+ N.setTabSize(t), N.setDisabled(u.value), N.setReadOnly(e.readonly), e.placeholder && N.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && N.setMaxLength(e.maxlength), e.autofocus && h.focus();
2306
2316
  }, 0), b.on(o, {
2307
- name: je,
2317
+ name: qe,
2308
2318
  callback() {
2309
- Rt(T);
2319
+ Mt(h);
2310
2320
  }
2311
2321
  }), b.on(o, {
2312
- name: Ge,
2322
+ name: Ue,
2313
2323
  callback() {
2314
- Ft(T);
2324
+ Rt(h);
2315
2325
  }
2316
2326
  }), b.on(o, {
2317
- name: h,
2318
- async callback(M, D = {}) {
2319
- if (M === "image" && D.transform) {
2320
- const R = e.transformImgUrl(D.url);
2321
- if (R instanceof Promise)
2322
- R.then(async (P) => {
2323
- const { text: F, options: Z } = await de(
2324
- M,
2327
+ name: f,
2328
+ async callback(R, D = {}) {
2329
+ if (R === "image" && D.transform) {
2330
+ const F = e.transformImgUrl(D.url);
2331
+ if (F instanceof Promise)
2332
+ F.then(async (H) => {
2333
+ const { text: B, options: Z } = await ce(
2334
+ R,
2325
2335
  C.value,
2326
- { ...D, url: P }
2336
+ { ...D, url: H }
2327
2337
  );
2328
- C.value?.replaceSelectedText(F, Z, o);
2329
- }).catch((P) => {
2330
- console.error(P);
2338
+ C.value?.replaceSelectedText(B, Z, o);
2339
+ }).catch((H) => {
2340
+ console.error(H);
2331
2341
  });
2332
2342
  else {
2333
- const { text: P, options: F } = await de(M, C.value, {
2343
+ const { text: H, options: B } = await ce(R, C.value, {
2334
2344
  ...D,
2335
- url: R
2345
+ url: F
2336
2346
  });
2337
- C.value?.replaceSelectedText(P, F, o);
2347
+ C.value?.replaceSelectedText(H, B, o);
2338
2348
  }
2339
2349
  } else {
2340
- const { text: R, options: P } = await de(
2341
- M,
2350
+ const { text: F, options: H } = await ce(
2351
+ R,
2342
2352
  C.value,
2343
2353
  D
2344
2354
  );
2345
- C.value?.replaceSelectedText(R, P, o);
2355
+ C.value?.replaceSelectedText(F, H, o);
2346
2356
  }
2347
2357
  }
2348
2358
  }), b.on(o, {
2349
- name: Gt,
2350
- callback: Lt((M) => {
2351
- const D = { ...le }, R = Object.keys(le);
2352
- for (const P in M) {
2353
- const F = P;
2354
- R.includes(F) ? D[F] = (Z, $e) => {
2355
- M[F](Z, $e), Z.defaultPrevented || le[F](Z, $e);
2356
- } : D[F] = M[F];
2359
+ name: Kt,
2360
+ callback: It((R) => {
2361
+ const D = { ...oe }, F = Object.keys(oe);
2362
+ for (const H in R) {
2363
+ const B = H;
2364
+ F.includes(B) ? D[B] = (Z, ye) => {
2365
+ R[B](Z, ye), Z.defaultPrevented || oe[B](Z, ye);
2366
+ } : D[B] = R[B];
2357
2367
  }
2358
2368
  C.value?.view.dispatch({
2359
- effects: we.reconfigure(
2360
- U.domEventHandlers(D)
2369
+ effects: pe.reconfigure(
2370
+ M.domEventHandlers(D)
2361
2371
  )
2362
2372
  });
2363
2373
  })
2364
2374
  }), b.on(o, {
2365
- name: jt,
2366
- callback: (M, D) => {
2367
- const R = T.state.doc.line(M);
2368
- T.dispatch(
2369
- T.state.update({ changes: { from: R.from, to: R.to, insert: D } })
2375
+ name: Gt,
2376
+ callback: (R, D) => {
2377
+ const F = h.state.doc.line(R);
2378
+ h.dispatch(
2379
+ h.state.update({ changes: { from: F.from, to: F.to, insert: D } })
2370
2380
  );
2371
2381
  }
2372
2382
  }), b.on(o, {
2373
- name: Yt,
2383
+ name: jt,
2374
2384
  callback() {
2375
- b.emit(o, xe, T);
2385
+ b.emit(o, ke, h);
2376
2386
  }
2377
- }), b.emit(o, xe, T);
2387
+ }), b.emit(o, ke, h);
2378
2388
  }), I(
2379
2389
  n,
2380
2390
  () => {
2381
2391
  C.value?.view.dispatch({
2382
- effects: te.reconfigure(n.value === "light" ? Re : Oe)
2392
+ effects: ee.reconfigure(n.value === "light" ? De : He)
2383
2393
  });
2384
2394
  },
2385
2395
  { deep: !0 }
@@ -2387,7 +2397,7 @@ const We = (e) => {
2387
2397
  () => e.completions,
2388
2398
  () => {
2389
2399
  C.value?.view.dispatch({
2390
- effects: oe.reconfigure(Le(e.completions))
2400
+ effects: te.reconfigure(Se(e.completions))
2391
2401
  });
2392
2402
  },
2393
2403
  { deep: !0 }
@@ -2413,25 +2423,25 @@ const We = (e) => {
2413
2423
  () => {
2414
2424
  e.maxlength && C.value?.setMaxLength(e.maxlength);
2415
2425
  }
2416
- ), I([S], () => {
2417
- const T = Ce.find(
2426
+ ), ho(() => {
2427
+ const h = we.find(
2418
2428
  (N) => N.type === "floatingToolbar"
2419
2429
  );
2420
- S.value.length > 0 && T ? C.value?.view.dispatch({
2421
- effects: ce.reconfigure(
2422
- We(T)
2430
+ h?.compartment && (S.value.length > 0 ? C.value?.view.dispatch({
2431
+ effects: h.compartment.reconfigure(
2432
+ Ze(h)
2423
2433
  )
2424
2434
  }) : C.value?.view.dispatch({
2425
- effects: ce.reconfigure([])
2426
- });
2427
- }), {
2435
+ effects: h.compartment.reconfigure([])
2436
+ }));
2437
+ }, S), {
2428
2438
  inputWrapperRef: A,
2429
2439
  codeMirrorUt: C,
2430
2440
  resetHistory() {
2431
- C.value?.view.dispatch({ effects: ie.reconfigure([]) }), C.value?.view.dispatch({ effects: ie.reconfigure(ke()) });
2441
+ C.value?.view.dispatch({ effects: se.reconfigure([]) }), C.value?.view.dispatch({ effects: se.reconfigure(Ce()) });
2432
2442
  }
2433
2443
  };
2434
- }, Fl = (e, t, o) => {
2444
+ }, Pl = (e, t, o) => {
2435
2445
  const n = G(() => /px$/.test(`${e.inputBoxWidth}`) ? "50%" : e.inputBoxWidth), i = q({
2436
2446
  resizedWidth: n.value
2437
2447
  }), s = q({
@@ -2440,11 +2450,11 @@ const We = (e) => {
2440
2450
  left: n.value,
2441
2451
  display: "initial"
2442
2452
  }), u = (v) => {
2443
- const w = t.value?.offsetWidth || 0, $ = t.value?.getBoundingClientRect().x || 0;
2444
- let f = v.x - $;
2445
- f / w < ae ? f = w * ae : f > w - w * ae && (f = w - w * ae);
2446
- const p = `${f / w * 100}%`;
2447
- s.width = p, c.left = p, i.resizedWidth = p, e.oninputBoxWidthChange?.(p);
2453
+ const w = t.value?.offsetWidth || 0, k = t.value?.getBoundingClientRect().x || 0;
2454
+ let p = v.x - k;
2455
+ p / w < le ? p = w * le : p > w - w * le && (p = w - w * le);
2456
+ const T = `${p / w * 100}%`;
2457
+ s.width = T, c.left = T, i.resizedWidth = T, e.oninputBoxWidthChange?.(T);
2448
2458
  }, m = (v) => {
2449
2459
  v.target === o.value && document.addEventListener("mousemove", u);
2450
2460
  }, g = () => {
@@ -2452,17 +2462,17 @@ const We = (e) => {
2452
2462
  };
2453
2463
  return I([o], () => {
2454
2464
  document.removeEventListener("mousedown", m), document.removeEventListener("mouseup", g), document.addEventListener("mousedown", m), document.addEventListener("mouseup", g);
2455
- }), O(() => {
2465
+ }), W(() => {
2456
2466
  document.addEventListener("mousedown", m), document.addEventListener("mouseup", g);
2457
- }), fe(() => {
2467
+ }), ge(() => {
2458
2468
  document.removeEventListener("mousedown", m), document.removeEventListener("mouseup", g);
2459
2469
  }), I([n], ([v]) => {
2460
2470
  i.resizedWidth = v, s.width = v, c.left = v;
2461
2471
  }), I(
2462
2472
  [
2463
- H(e.setting, "htmlPreview"),
2464
- H(e.setting, "preview"),
2465
- H(e.setting, "previewOnly")
2473
+ O(e.setting, "htmlPreview"),
2474
+ O(e.setting, "preview"),
2475
+ O(e.setting, "previewOnly")
2466
2476
  ],
2467
2477
  () => {
2468
2478
  e.setting.previewOnly ? (s.width = "0%", c.display = "none") : !e.setting.htmlPreview && !e.setting.preview ? (s.width = "100%", c.display = "none") : (s.width = i.resizedWidth, c.display = "initial");
@@ -2474,8 +2484,8 @@ const We = (e) => {
2474
2484
  inputWrapperStyle: s,
2475
2485
  resizeOperateStyle: c
2476
2486
  };
2477
- }, Bl = () => {
2478
- const e = r("editorId"), t = x(!0), o = Ue();
2487
+ }, Hl = () => {
2488
+ const e = r("editorId"), t = x(!0), o = We();
2479
2489
  return {
2480
2490
  onCatalogActive: (c, u) => {
2481
2491
  const m = document.querySelector(
@@ -2489,8 +2499,8 @@ const We = (e) => {
2489
2499
  onMouseenter: () => t.value = !1,
2490
2500
  onMouseleave: () => t.value = !0
2491
2501
  };
2492
- }, ve = /* @__PURE__ */ y({
2493
- name: `${xt}CustomScrollbar`,
2502
+ }, me = /* @__PURE__ */ y({
2503
+ name: `${$t}CustomScrollbar`,
2494
2504
  props: {
2495
2505
  id: {
2496
2506
  type: String,
@@ -2532,40 +2542,40 @@ const We = (e) => {
2532
2542
  let c = null, u = null, m = !1, g = 0, v = 0;
2533
2543
  const w = () => {
2534
2544
  if (!n.value || !o.value || !i.value || !s.value) return;
2535
- const S = o.value.clientHeight, B = n.value.scrollHeight, A = n.value.scrollTop;
2536
- if (B <= S) {
2545
+ const S = o.value.clientHeight, P = n.value.scrollHeight, A = n.value.scrollTop;
2546
+ if (P <= S) {
2537
2547
  i.value.style.display = "none", e.alwaysShowTrack || (s.value.style.display = "none");
2538
2548
  return;
2539
2549
  } else
2540
2550
  i.value.style.display = "block", s.value.style.display = "block";
2541
- const C = S / B, W = Math.max(S * C, 20), te = S - W, oe = Math.min(A * C, te);
2542
- i.value.style.height = `${W}px`, i.value.style.top = `${oe}px`;
2543
- }, $ = () => w(), f = (S) => {
2551
+ const C = S / P, _ = Math.max(S * C, 20), ee = S - _, te = Math.min(A * C, ee);
2552
+ i.value.style.height = `${_}px`, i.value.style.top = `${te}px`;
2553
+ }, k = () => w(), p = (S) => {
2544
2554
  m = !0, g = S.clientY, v = n.value.scrollTop, document.body.style.userSelect = "none";
2545
- }, p = (S) => {
2555
+ }, T = (S) => {
2546
2556
  if (!m || !n.value || !o.value) return;
2547
- const B = S.clientY - g, A = n.value.scrollHeight / o.value.clientHeight;
2548
- n.value.scrollTop = v + B * A;
2557
+ const P = S.clientY - g, A = n.value.scrollHeight / o.value.clientHeight;
2558
+ n.value.scrollTop = v + P * A;
2549
2559
  }, L = () => {
2550
2560
  m = !1, document.body.style.userSelect = "";
2551
2561
  }, E = (S) => {
2552
- n.value && n.value.removeEventListener("scroll", $), n.value = S, n.value ? (n.value.addEventListener("scroll", $), w()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2562
+ n.value && n.value.removeEventListener("scroll", k), n.value = S, n.value ? (n.value.addEventListener("scroll", k), w()) : s.value && !e.alwaysShowTrack && (s.value.style.display = "none");
2553
2563
  }, V = () => {
2554
2564
  if (!o.value) return;
2555
2565
  const S = e.scrollTarget ? o.value.querySelector(e.scrollTarget) : o.value.firstElementChild;
2556
2566
  E(S);
2557
2567
  };
2558
- return O(async () => {
2559
- await se(), V(), c = new MutationObserver(() => {
2568
+ return W(async () => {
2569
+ await re(), V(), c = new MutationObserver(() => {
2560
2570
  u && cancelAnimationFrame(u), u = requestAnimationFrame(() => {
2561
2571
  V();
2562
2572
  });
2563
2573
  }), c.observe(o.value, {
2564
2574
  childList: !0,
2565
2575
  subtree: !0
2566
- }), window.addEventListener("resize", w), i.value?.addEventListener("mousedown", f), document.addEventListener("mousemove", p), document.addEventListener("mouseup", L);
2567
- }), fe(() => {
2568
- c?.disconnect(), n.value && n.value.removeEventListener("scroll", $), window.removeEventListener("resize", w), i.value?.removeEventListener("mousedown", f), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", L);
2576
+ }), window.addEventListener("resize", w), i.value?.addEventListener("mousedown", p), document.addEventListener("mousemove", T), document.addEventListener("mouseup", L);
2577
+ }), ge(() => {
2578
+ c?.disconnect(), n.value && n.value.removeEventListener("scroll", k), window.removeEventListener("resize", w), i.value?.removeEventListener("mousedown", p), document.removeEventListener("mousemove", T), document.removeEventListener("mouseup", L);
2569
2579
  }), () => l("div", {
2570
2580
  id: e.id,
2571
2581
  class: [`${a}-custom-scrollbar`, e.class],
@@ -2580,24 +2590,24 @@ const We = (e) => {
2580
2590
  ref: i
2581
2591
  }, null)])]);
2582
2592
  }
2583
- }), Pl = Ue(), Hl = /* @__PURE__ */ y({
2593
+ }), Ol = We(), Vl = /* @__PURE__ */ y({
2584
2594
  name: "MDEditorContent",
2585
- props: st,
2595
+ props: rt,
2586
2596
  setup(e, t) {
2587
2597
  const o = r("editorId"), n = r("catalogVisible"), i = r("theme"), s = x(""), c = x(), u = x(), {
2588
2598
  inputWrapperRef: m,
2589
2599
  codeMirrorUt: g,
2590
2600
  resetHistory: v
2591
- } = Rl(e), {
2601
+ } = Bl(e), {
2592
2602
  inputWrapperStyle: w,
2593
- resizeOperateStyle: $
2594
- } = Fl(e, c, u);
2595
- oo(e, s, g);
2603
+ resizeOperateStyle: k
2604
+ } = Pl(e, c, u);
2605
+ to(e, s, g);
2596
2606
  const {
2597
- onCatalogActive: f,
2598
- onMouseenter: p,
2607
+ onCatalogActive: p,
2608
+ onMouseenter: T,
2599
2609
  onMouseleave: L
2600
- } = Bl();
2610
+ } = Hl();
2601
2611
  return t.expose({
2602
2612
  getSelectedText() {
2603
2613
  return g.value?.getSelectedText();
@@ -2614,7 +2624,7 @@ const We = (e) => {
2614
2624
  }, [l("div", {
2615
2625
  class: `${a}-content-wrapper`,
2616
2626
  ref: c
2617
- }, [l(ve, {
2627
+ }, [l(me, {
2618
2628
  alwaysShowTrack: !0,
2619
2629
  scrollTarget: `#${o} .cm-scroller`,
2620
2630
  style: w
@@ -2625,14 +2635,14 @@ const We = (e) => {
2625
2635
  }, null)]
2626
2636
  }), (e.setting.htmlPreview || e.setting.preview) && l("div", {
2627
2637
  class: `${a}-resize-operate`,
2628
- style: $,
2638
+ style: k,
2629
2639
  ref: u
2630
- }, null), l(ve, {
2640
+ }, null), l(me, {
2631
2641
  style: {
2632
2642
  flex: 1
2633
2643
  }
2634
2644
  }, {
2635
- default: () => [l(it, {
2645
+ default: () => [l(st, {
2636
2646
  modelValue: e.modelValue,
2637
2647
  onChange: e.onChange,
2638
2648
  setting: e.setting,
@@ -2652,12 +2662,12 @@ const We = (e) => {
2652
2662
  autoFoldThreshold: e.autoFoldThreshold,
2653
2663
  onRemount: e.onRemount
2654
2664
  }, null)]
2655
- })]), n.value && l(ve, {
2665
+ })]), n.value && l(me, {
2656
2666
  class: `${a}-catalog-${e.catalogLayout}`,
2657
- onMouseenter: p,
2667
+ onMouseenter: T,
2658
2668
  onMouseleave: L
2659
2669
  }, {
2660
- default: () => [l(_e, {
2670
+ default: () => [l(Oe, {
2661
2671
  theme: i.value,
2662
2672
  class: `${a}-catalog-editor`,
2663
2673
  editorId: o,
@@ -2670,17 +2680,17 @@ const We = (e) => {
2670
2680
  E.preventDefault();
2671
2681
  const S = g.value?.view;
2672
2682
  if (S) {
2673
- const B = S.state.doc.line(V.line + 1), A = S.lineBlockAt(B.from)?.top, C = S.scrollDOM;
2674
- Pl(C, A);
2683
+ const P = S.state.doc.line(V.line + 1), A = S.lineBlockAt(P.from)?.top, C = S.scrollDOM;
2684
+ Ol(C, A);
2675
2685
  }
2676
2686
  }
2677
2687
  },
2678
2688
  catalogMaxDepth: e.catalogMaxDepth,
2679
- onActive: f
2689
+ onActive: p
2680
2690
  }, null)]
2681
2691
  })]);
2682
2692
  }
2683
- }), Vl = /* @__PURE__ */ y({
2693
+ }), Wl = /* @__PURE__ */ y({
2684
2694
  props: {
2685
2695
  modelValue: {
2686
2696
  type: String,
@@ -2695,7 +2705,7 @@ const We = (e) => {
2695
2705
  class: `${a}-footer-label`
2696
2706
  }, [`${t.value.footer?.markdownTotal}:`]), l("span", null, [e.modelValue?.length || 0])]);
2697
2707
  }
2698
- }), Ol = {
2708
+ }), _l = {
2699
2709
  checked: {
2700
2710
  type: Boolean,
2701
2711
  default: !1
@@ -2709,9 +2719,9 @@ const We = (e) => {
2709
2719
  type: Boolean,
2710
2720
  default: void 0
2711
2721
  }
2712
- }, Wl = /* @__PURE__ */ y({
2722
+ }, zl = /* @__PURE__ */ y({
2713
2723
  name: `${a}-checkbox`,
2714
- props: Ol,
2724
+ props: _l,
2715
2725
  setup(e) {
2716
2726
  return () => l("div", {
2717
2727
  class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`, e.disabled && `${a}-disabled`],
@@ -2720,7 +2730,7 @@ const We = (e) => {
2720
2730
  }
2721
2731
  }, null);
2722
2732
  }
2723
- }), _l = {
2733
+ }), Ul = {
2724
2734
  scrollAuto: {
2725
2735
  type: Boolean
2726
2736
  },
@@ -2729,8 +2739,8 @@ const We = (e) => {
2729
2739
  default: () => {
2730
2740
  }
2731
2741
  }
2732
- }, zl = /* @__PURE__ */ y({
2733
- props: _l,
2742
+ }, ql = /* @__PURE__ */ y({
2743
+ props: Ul,
2734
2744
  setup(e) {
2735
2745
  const t = r("usedLanguageText"), o = r("disabled");
2736
2746
  return () => l("div", {
@@ -2740,13 +2750,13 @@ const We = (e) => {
2740
2750
  onClick: () => {
2741
2751
  o?.value || e.onScrollAutoChange(!e.scrollAuto);
2742
2752
  }
2743
- }, [t?.value.footer?.scrollAuto]), l(Wl, {
2753
+ }, [t?.value.footer?.scrollAuto]), l(zl, {
2744
2754
  checked: e.scrollAuto,
2745
2755
  onChange: e.onScrollAutoChange,
2746
2756
  disabled: o?.value
2747
2757
  }, null)]);
2748
2758
  }
2749
- }), Ul = {
2759
+ }), Kl = {
2750
2760
  modelValue: {
2751
2761
  type: String,
2752
2762
  default: ""
@@ -2769,36 +2779,36 @@ const We = (e) => {
2769
2779
  defFooters: {
2770
2780
  type: Object
2771
2781
  }
2772
- }, ql = /* @__PURE__ */ y({
2782
+ }, Gl = /* @__PURE__ */ y({
2773
2783
  name: "MDEditorFooter",
2774
- props: Ul,
2784
+ props: Kl,
2775
2785
  setup(e) {
2776
2786
  const t = r("theme"), o = r("language"), n = r("disabled"), i = G(() => {
2777
2787
  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);
2778
2788
  return [u, m];
2779
2789
  }), s = (c) => {
2780
- if (St.includes(c))
2790
+ if (xt.includes(c))
2781
2791
  switch (c) {
2782
2792
  case "markdownTotal":
2783
- return l(Vl, {
2793
+ return l(Wl, {
2784
2794
  modelValue: e.modelValue
2785
2795
  }, null);
2786
2796
  case "scrollSwitch":
2787
- return !e.noScrollAuto && l(zl, {
2797
+ return !e.noScrollAuto && l(ql, {
2788
2798
  scrollAuto: e.scrollAuto,
2789
2799
  onScrollAutoChange: e.onScrollAutoChange
2790
2800
  }, null);
2791
2801
  }
2792
2802
  else if (e.defFooters instanceof Array) {
2793
2803
  const u = e.defFooters[c];
2794
- return u ? re(u, {
2804
+ return u ? ne(u, {
2795
2805
  theme: u.props?.theme || t.value,
2796
2806
  language: u.props?.language || o.value,
2797
2807
  disabled: u.props?.disabled || n?.value
2798
2808
  }) : "";
2799
2809
  } else if (e.defFooters && e.defFooters.children instanceof Array) {
2800
2810
  const u = e.defFooters.children[c];
2801
- return u ? re(u, {
2811
+ return u ? ne(u, {
2802
2812
  theme: u.props?.theme || t.value,
2803
2813
  language: u.props?.language || o.value,
2804
2814
  disabled: u.props?.disabled || n?.value
@@ -2817,7 +2827,7 @@ const We = (e) => {
2817
2827
  }, [u])]);
2818
2828
  };
2819
2829
  }
2820
- }), Kl = {
2830
+ }), jl = {
2821
2831
  // 工具栏选择显示
2822
2832
  toolbars: {
2823
2833
  type: Array,
@@ -2828,25 +2838,25 @@ const We = (e) => {
2828
2838
  type: Array,
2829
2839
  default: () => []
2830
2840
  }
2831
- }, Gl = /* @__PURE__ */ y({
2841
+ }, Yl = /* @__PURE__ */ y({
2832
2842
  name: "MDEditorToolbar",
2833
- props: Kl,
2843
+ props: jl,
2834
2844
  setup(e) {
2835
2845
  const t = r("editorId"), o = r("showToolbarName"), n = `${t}-toolbar-wrapper`, i = x(), s = x(), {
2836
2846
  barRender: c
2837
- } = Je(), u = G(() => {
2838
- const m = e.toolbars.filter(($) => !e.toolbarsExclude.includes($)), g = m.indexOf("="), v = g === -1 ? m : m.slice(0, g + 1), w = g === -1 ? [] : m.slice(g, Number.MAX_SAFE_INTEGER);
2847
+ } = Ye(), u = G(() => {
2848
+ const m = e.toolbars.filter((k) => !e.toolbarsExclude.includes(k)), g = m.indexOf("="), v = g === -1 ? m : m.slice(0, g + 1), w = g === -1 ? [] : m.slice(g, Number.MAX_SAFE_INTEGER);
2839
2849
  return [v, w];
2840
2850
  });
2841
2851
  return I(() => e.toolbars, () => {
2842
- se(() => {
2843
- i.value && Et(i.value);
2852
+ re(() => {
2853
+ i.value && Lt(i.value);
2844
2854
  });
2845
2855
  }, {
2846
2856
  immediate: !0
2847
2857
  }), () => {
2848
2858
  const m = u.value[0].map((v) => c(v)), g = u.value[1].map((v) => c(v));
2849
- return l(ze, null, [e.toolbars.length > 0 && l("div", {
2859
+ return l(Ve, null, [e.toolbars.length > 0 && l("div", {
2850
2860
  class: `${a}-toolbar-wrapper`,
2851
2861
  ref: i,
2852
2862
  id: n
@@ -2860,10 +2870,10 @@ const We = (e) => {
2860
2870
  }, [g])])])]);
2861
2871
  };
2862
2872
  }
2863
- }), ge = /* @__PURE__ */ y({
2873
+ }), be = /* @__PURE__ */ y({
2864
2874
  name: "MdEditorV3",
2865
- props: ut,
2866
- emits: ct,
2875
+ props: ct,
2876
+ emits: it,
2867
2877
  setup(e, t) {
2868
2878
  const {
2869
2879
  noKatex: o,
@@ -2871,45 +2881,45 @@ const We = (e) => {
2871
2881
  noHighlight: i
2872
2882
  } = e, s = q({
2873
2883
  scrollAuto: e.scrollAuto
2874
- }), c = x(), u = x(), m = G(() => Se({
2884
+ }), c = x(), u = x(), m = G(() => $e({
2875
2885
  props: e,
2876
2886
  ctx: t
2877
- }, "defToolbars")), g = G(() => Se({
2887
+ }, "defToolbars")), g = G(() => $e({
2878
2888
  props: e,
2879
2889
  ctx: t
2880
- }, "defFooters")), v = dt(e), [w, $] = mt(e, t, {
2890
+ }, "defFooters")), v = ut(e), [w, k] = dt(e, t, {
2881
2891
  editorId: v
2882
- }), f = bt(e, {
2892
+ }), p = mt(e, {
2883
2893
  editorId: v
2884
2894
  });
2885
- return vt(e, t, {
2895
+ return bt(e, t, {
2886
2896
  editorId: v
2887
- }), gt(e), ht(e, t, {
2897
+ }), vt(e), gt(e, t, {
2888
2898
  editorId: v
2889
- }), ft(e, t, {
2899
+ }), ht(e, t, {
2890
2900
  editorId: v,
2891
- catalogVisible: f,
2901
+ catalogVisible: p,
2892
2902
  setting: w,
2893
- updateSetting: $,
2903
+ updateSetting: k,
2894
2904
  codeRef: u
2895
- }), pt(e, {
2905
+ }), ft(e, {
2896
2906
  rootRef: c,
2897
2907
  editorId: v,
2898
2908
  setting: w,
2899
- updateSetting: $,
2900
- catalogVisible: f,
2909
+ updateSetting: k,
2910
+ catalogVisible: p,
2901
2911
  defToolbars: m
2902
- }), fe(() => {
2912
+ }), ge(() => {
2903
2913
  b.clear(v);
2904
2914
  }), () => l("div", {
2905
2915
  id: v,
2906
2916
  class: [a, e.class, e.theme === "dark" && `${a}-dark`, w.fullscreen || w.pageFullscreen ? `${a}-fullscreen` : ""],
2907
2917
  style: e.style,
2908
2918
  ref: c
2909
- }, [e.toolbars.length > 0 && l(Gl, {
2919
+ }, [e.toolbars.length > 0 && l(Yl, {
2910
2920
  toolbars: e.toolbars,
2911
2921
  toolbarsExclude: e.toolbarsExclude
2912
- }, null), l(Hl, {
2922
+ }, null), l(Vl, {
2913
2923
  ref: u,
2914
2924
  modelValue: e.modelValue,
2915
2925
  mdHeadingId: e.mdHeadingId,
@@ -2924,35 +2934,35 @@ const We = (e) => {
2924
2934
  maxlength: e.maxLength,
2925
2935
  autoDetectCode: e.autoDetectCode,
2926
2936
  noHighlight: i,
2927
- updateModelValue: (p) => {
2928
- t.emit("update:modelValue", p);
2937
+ updateModelValue: (T) => {
2938
+ t.emit("update:modelValue", T);
2929
2939
  },
2930
- onChange: (p) => {
2931
- e.onChange?.(p), t.emit("onChange", p);
2940
+ onChange: (T) => {
2941
+ e.onChange?.(T), t.emit("onChange", T);
2932
2942
  },
2933
- onHtmlChanged: (p) => {
2934
- e.onHtmlChanged?.(p), t.emit("onHtmlChanged", p);
2943
+ onHtmlChanged: (T) => {
2944
+ e.onHtmlChanged?.(T), t.emit("onHtmlChanged", T);
2935
2945
  },
2936
- onGetCatalog: (p) => {
2937
- e.onGetCatalog?.(p), t.emit("onGetCatalog", p);
2946
+ onGetCatalog: (T) => {
2947
+ e.onGetCatalog?.(T), t.emit("onGetCatalog", T);
2938
2948
  },
2939
- onBlur: (p) => {
2940
- e.onBlur?.(p), t.emit("onBlur", p);
2949
+ onBlur: (T) => {
2950
+ e.onBlur?.(T), t.emit("onBlur", T);
2941
2951
  },
2942
- onFocus: (p) => {
2943
- e.onFocus?.(p), t.emit("onFocus", p);
2952
+ onFocus: (T) => {
2953
+ e.onFocus?.(T), t.emit("onFocus", T);
2944
2954
  },
2945
- onInput: (p) => {
2946
- e.onInput?.(p), t.emit("onInput", p);
2955
+ onInput: (T) => {
2956
+ e.onInput?.(T), t.emit("onInput", T);
2947
2957
  },
2948
2958
  completions: e.completions,
2949
2959
  noImgZoomIn: e.noImgZoomIn,
2950
- onDrop: (p) => {
2951
- e.onDrop?.(p), t.emit("onDrop", p);
2960
+ onDrop: (T) => {
2961
+ e.onDrop?.(T), t.emit("onDrop", T);
2952
2962
  },
2953
2963
  inputBoxWidth: e.inputBoxWidth,
2954
- oninputBoxWidthChange: (p) => {
2955
- e.oninputBoxWidthChange?.(p), t.emit("oninputBoxWidthChange", p);
2964
+ oninputBoxWidthChange: (T) => {
2965
+ e.oninputBoxWidthChange?.(T), t.emit("oninputBoxWidthChange", T);
2956
2966
  },
2957
2967
  sanitizeMermaid: e.sanitizeMermaid,
2958
2968
  transformImgUrl: e.transformImgUrl,
@@ -2964,17 +2974,17 @@ const We = (e) => {
2964
2974
  catalogLayout: e.catalogLayout,
2965
2975
  catalogMaxDepth: e.catalogMaxDepth,
2966
2976
  noEcharts: e.noEcharts
2967
- }, null), e.footers.length > 0 && l(ql, {
2977
+ }, null), e.footers.length > 0 && l(Gl, {
2968
2978
  modelValue: e.modelValue,
2969
2979
  footers: e.footers,
2970
2980
  defFooters: g.value,
2971
2981
  noScrollAuto: !w.preview && !w.htmlPreview || w.previewOnly,
2972
2982
  scrollAuto: s.scrollAuto,
2973
- onScrollAutoChange: (p) => s.scrollAuto = p
2983
+ onScrollAutoChange: (T) => s.scrollAuto = T
2974
2984
  }, null)]);
2975
2985
  }
2976
2986
  });
2977
- ge.install = (e) => (e.component(ge.name, ge), e.use(yt).use(lt).use(wt).use(_e).use(Tt), e);
2987
+ be.install = (e) => (e.component(be.name, be), e.use(wt).use(ot).use(Tt).use(Oe).use(pt), e);
2978
2988
  export {
2979
- ge as default
2989
+ be as default
2980
2990
  };