md-editor-v3 4.11.2 → 4.12.0-beta.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.
Files changed (51) hide show
  1. package/README.md +11 -1
  2. package/lib/cjs/DropdownToolbar.cjs +1 -1
  3. package/lib/cjs/MdCatalog.cjs +1 -1
  4. package/lib/cjs/MdEditor.cjs +7 -7
  5. package/lib/cjs/MdModal.cjs +1 -1
  6. package/lib/cjs/MdPreview.cjs +1 -1
  7. package/lib/cjs/ModalToolbar.cjs +1 -1
  8. package/lib/cjs/chunks/config.cjs +1 -1
  9. package/lib/cjs/chunks/index.cjs +7 -7
  10. package/lib/cjs/chunks/index4.cjs +2 -2
  11. package/lib/cjs/index.cjs +1 -1
  12. package/lib/es/DropdownToolbar.mjs +2 -5
  13. package/lib/es/MdCatalog.mjs +18 -18
  14. package/lib/es/MdEditor.mjs +173 -172
  15. package/lib/es/MdModal.mjs +2 -7
  16. package/lib/es/MdPreview.mjs +2 -13
  17. package/lib/es/ModalToolbar.mjs +8 -10
  18. package/lib/es/chunks/config.mjs +23 -24
  19. package/lib/es/chunks/index.mjs +178 -147
  20. package/lib/es/chunks/index4.mjs +22 -18
  21. package/lib/es/index.mjs +23 -43
  22. package/lib/preview.css +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/types/DropdownToolbar/index.d.ts +8 -8
  25. package/lib/types/MdCatalog/CatalogLink.d.ts +1 -1
  26. package/lib/types/MdCatalog/MdCatalog.d.ts +1 -1
  27. package/lib/types/MdCatalog/index.d.ts +5 -5
  28. package/lib/types/MdEditor/Editor.d.ts +15 -15
  29. package/lib/types/MdEditor/components/Dropdown/index.d.ts +1 -1
  30. package/lib/types/MdEditor/components/Modal/Modal.d.ts +2 -2
  31. package/lib/types/MdEditor/components/Modal/index.d.ts +8 -8
  32. package/lib/types/MdEditor/components/Popper/index.d.ts +15 -0
  33. package/lib/types/MdEditor/config.d.ts +3 -3
  34. package/lib/types/MdEditor/index.d.ts +68 -68
  35. package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +8 -4
  36. package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +9 -0
  37. package/lib/types/MdEditor/layouts/Content/index.d.ts +12 -8
  38. package/lib/types/MdEditor/layouts/Content/props.d.ts +6 -2
  39. package/lib/types/MdEditor/layouts/Modals/Link.d.ts +1 -1
  40. package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +1 -1
  41. package/lib/types/MdEditor/props.d.ts +2 -2
  42. package/lib/types/MdEditor/static/env.d.ts +1 -0
  43. package/lib/types/MdEditor/type.d.ts +7 -1
  44. package/lib/types/MdEditor/utils/index.d.ts +4 -0
  45. package/lib/types/MdPreview/MdPreview.d.ts +13 -13
  46. package/lib/types/MdPreview/index.d.ts +45 -45
  47. package/lib/types/ModalToolbar/ModalToolbar.d.ts +3 -3
  48. package/lib/types/ModalToolbar/index.d.ts +16 -16
  49. package/lib/types/NormalToolbar/index.d.ts +5 -5
  50. package/lib/umd/index.js +46 -46
  51. package/package.json +32 -31
@@ -1,18 +1,18 @@
1
1
  var Ot = Object.defineProperty;
2
2
  var Pt = (e, o, l) => o in e ? Ot(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
3
  var z = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as O, createVNode as t, inject as I, ref as R, onMounted as Y, reactive as U, computed as Ce, watch as H, nextTick as de, Fragment as Mt, cloneVNode as gt, toRef as Q, shallowRef as Wt, onBeforeUnmount as Et } from "vue";
5
- import { p as a, e as X, n as zt, b as _t, M as se, d as Ut } from "./chunks/config.mjs";
4
+ import { defineComponent as P, createVNode as t, inject as I, ref as O, onMounted as Y, reactive as _, computed as Ce, watch as H, nextTick as de, Fragment as Mt, cloneVNode as gt, toRef as Q, shallowRef as Wt, onBeforeUnmount as Et } from "vue";
5
+ import { p as a, e as X, l as zt, b as Ut, M as se, d as _t } from "./chunks/config.mjs";
6
6
  import { draggingScroll as qt, linkTo as Gt, debounce as Kt, createSmoothScroll as jt, throttle as Zt } from "@vavt/util";
7
7
  import { a as ae, D as Xt } from "./chunks/index2.mjs";
8
- import { b as v, i as Yt, E as ee, U as $e, j as Jt, k as ke, h as L, c as Qt, O as Ht, l as Dt, m as Nt } from "./chunks/index4.mjs";
8
+ import { b as v, i as Yt, E as ee, U as $e, k as Jt, l as ke, h as L, c as Qt, O as Ht, m as Dt, n as Nt } from "./chunks/index4.mjs";
9
9
  import { a as el } from "./chunks/dom.mjs";
10
10
  import { M as Bt, I as x } from "./chunks/index3.mjs";
11
11
  import { EditorView as ce } from "codemirror";
12
12
  import { EditorView as pe, placeholder as tl, keymap as ll } from "@codemirror/view";
13
13
  import { languages as ol } from "@codemirror/language-data";
14
14
  import { markdown as al } from "@codemirror/lang-markdown";
15
- import { EditorSelection as _, EditorState as fe, Compartment as ne, StateEffect as nl } from "@codemirror/state";
15
+ import { EditorSelection as U, EditorState as fe, Compartment as ne, StateEffect as nl } from "@codemirror/state";
16
16
  import { deleteLine as il, defaultKeymap as rl, historyKeymap as sl, indentWithTab as cl, history as ft, undo as ul, redo as dl } from "@codemirror/commands";
17
17
  import { HighlightStyle as Vt, syntaxHighlighting as Ft, indentUnit as ml } from "@codemirror/language";
18
18
  import { tags as c } from "@lezer/highlight";
@@ -22,13 +22,7 @@ import Rt from "./MdCatalog.mjs";
22
22
  import { g as ht } from "./chunks/vue-tsx.mjs";
23
23
  import Sl from "./NormalToolbar.mjs";
24
24
  import Al from "./ModalToolbar.mjs";
25
- import "medium-zoom";
26
- import "copy-to-clipboard";
27
- import "markdown-it";
28
- import "markdown-it-image-figures";
29
- import "markdown-it-task-lists";
30
- import "lru-cache";
31
- const Ll = /* @__PURE__ */ O({
25
+ const Ll = /* @__PURE__ */ P({
32
26
  setup() {
33
27
  return () => t("div", {
34
28
  class: `${a}-divider`
@@ -87,7 +81,7 @@ const Ll = /* @__PURE__ */ O({
87
81
  var d, s, g, w;
88
82
  const o = I("editorId");
89
83
  let l = (s = (d = X.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : s.instance;
90
- const n = (w = (g = X.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : w.js, r = R(!1), i = ($) => {
84
+ const n = (w = (g = X.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : w.js, r = O(!1), i = ($) => {
91
85
  if (!l) {
92
86
  v.emit(o, ee, {
93
87
  name: "fullscreen",
@@ -124,11 +118,11 @@ const Ll = /* @__PURE__ */ O({
124
118
  default: () => {
125
119
  }
126
120
  }
127
- }, Hl = /* @__PURE__ */ O({
121
+ }, Hl = /* @__PURE__ */ P({
128
122
  name: "TableShape",
129
123
  props: El,
130
124
  setup(e) {
131
- const o = U({
125
+ const o = _({
132
126
  x: -1,
133
127
  y: -1
134
128
  });
@@ -172,7 +166,7 @@ const Ll = /* @__PURE__ */ O({
172
166
  default: () => {
173
167
  }
174
168
  }
175
- }, Bl = /* @__PURE__ */ O({
169
+ }, Bl = /* @__PURE__ */ P({
176
170
  props: Nl,
177
171
  setup(e) {
178
172
  const o = I("usedLanguageText"), l = I("editorId"), n = Ce(() => {
@@ -185,7 +179,7 @@ const Ll = /* @__PURE__ */ O({
185
179
  default:
186
180
  return "";
187
181
  }
188
- }), r = U({
182
+ }), r = _({
189
183
  desc: "",
190
184
  url: ""
191
185
  });
@@ -257,13 +251,13 @@ const Ll = /* @__PURE__ */ O({
257
251
  default: () => {
258
252
  }
259
253
  }
260
- }, Fl = /* @__PURE__ */ O({
254
+ }, Fl = /* @__PURE__ */ P({
261
255
  props: Vl,
262
256
  setup(e) {
263
257
  var g, w, $;
264
258
  const o = I("usedLanguageText"), l = I("editorId");
265
259
  let n = ($ = (w = (g = X) == null ? void 0 : g.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : $.instance;
266
- const r = R(), i = R(), h = R(), f = U({
260
+ const r = O(), i = O(), h = O(), f = _({
267
261
  cropperInited: !1,
268
262
  imgSelected: !1,
269
263
  imgSrc: "",
@@ -283,8 +277,8 @@ const Ll = /* @__PURE__ */ O({
283
277
  const S = r.value.files || [];
284
278
  if (f.imgSelected = !0, (S == null ? void 0 : S.length) > 0) {
285
279
  const m = new FileReader();
286
- m.onload = (k) => {
287
- f.imgSrc = k.target.result, de(() => {
280
+ m.onload = (C) => {
281
+ f.imgSrc = C.target.result, de(() => {
288
282
  d = new n(i.value, {
289
283
  viewMode: 2,
290
284
  preview: `.${a}-clip-preview-target`
@@ -324,7 +318,7 @@ const Ll = /* @__PURE__ */ O({
324
318
  height: "421px"
325
319
  }, {
326
320
  default: () => {
327
- var m, k;
321
+ var m, C;
328
322
  return [t("div", {
329
323
  class: `${a}-form-item ${a}-clip`
330
324
  }, [t("div", {
@@ -366,7 +360,7 @@ const Ll = /* @__PURE__ */ O({
366
360
  v.emit(l, $e, [Jt(u.toDataURL("image/png"))], e.onOk), s();
367
361
  }
368
362
  }
369
- }, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((k = o.value.linkModalTips) == null ? void 0 : k.buttonOK)])]), t("input", {
363
+ }, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((C = o.value.linkModalTips) == null ? void 0 : C.buttonOK)])]), t("input", {
370
364
  ref: r,
371
365
  accept: "image/*",
372
366
  type: "file",
@@ -402,7 +396,7 @@ const Ll = /* @__PURE__ */ O({
402
396
  default: () => {
403
397
  }
404
398
  }
405
- }, Ol = /* @__PURE__ */ O({
399
+ }, Ol = /* @__PURE__ */ P({
406
400
  props: Rl,
407
401
  setup(e) {
408
402
  return () => t(Mt, null, [t(Bl, {
@@ -416,13 +410,13 @@ const Ll = /* @__PURE__ */ O({
416
410
  onCancel: e.onCancel
417
411
  }, null)]);
418
412
  }
419
- }), Pl = /* @__PURE__ */ O({
413
+ }), Pl = /* @__PURE__ */ P({
420
414
  name: "MDEditorToolbar",
421
415
  props: Il,
422
416
  setup(e) {
423
417
  const o = I("editorId"), l = I("usedLanguageText"), n = I("theme"), r = I("language"), {
424
418
  fullscreenHandler: i
425
- } = Ml(e), h = `${o}-toolbar-wrapper`, f = R(), d = U({
419
+ } = Ml(e), h = `${o}-toolbar-wrapper`, f = O(), d = _({
426
420
  title: !1,
427
421
  catalog: !1,
428
422
  // 图片上传下拉
@@ -434,11 +428,11 @@ const Ll = /* @__PURE__ */ O({
434
428
  katex: !1
435
429
  }), s = (u, b) => {
436
430
  v.emit(o, L, u, b);
437
- }, g = U({
431
+ }, g = _({
438
432
  type: "link",
439
433
  linkVisible: !1,
440
434
  clipVisible: !1
441
- }), w = R();
435
+ }), w = O();
442
436
  Y(() => {
443
437
  v.on(o, {
444
438
  name: ke,
@@ -448,17 +442,17 @@ const Ll = /* @__PURE__ */ O({
448
442
  });
449
443
  });
450
444
  const $ = Ce(() => {
451
- const u = e.toolbars.filter((C) => !e.toolbarsExclude.includes(C)), b = u.indexOf("="), p = b === -1 ? u : u.slice(0, b + 1), y = b === -1 ? [] : u.slice(b, Number.MAX_SAFE_INTEGER);
445
+ const u = e.toolbars.filter((k) => !e.toolbarsExclude.includes(k)), b = u.indexOf("="), p = b === -1 ? u : u.slice(0, b + 1), y = b === -1 ? [] : u.slice(b, Number.MAX_SAFE_INTEGER);
452
446
  return [p, y];
453
- }), S = R(), m = () => {
447
+ }), S = O(), m = () => {
454
448
  v.emit(o, $e, Array.from(S.value.files || [])), S.value.value = "";
455
449
  };
456
450
  Y(() => {
457
451
  S.value.addEventListener("change", m);
458
452
  });
459
- const k = (u) => {
460
- var b, p, y, C, A, P, V, W, q, F, D, N, Z, G, K, te, le, oe, j, B, M, me, ye, Te, we, xe, Se, Ae, Le, Ie, Me, Ee, He, De, Ne, Be, Ve, Fe, Re, Oe, Pe, We, ze, _e, Ue, qe, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
461
- if (_t.includes(u))
453
+ const C = (u) => {
454
+ var b, p, y, k, A, F, D, W, q, R, N, B, Z, G, K, te, le, oe, j, V, M, me, ye, Te, we, xe, Se, Ae, Le, Ie, Me, Ee, He, De, Ne, Be, Ve, Fe, Re, Oe, Pe, We, ze, Ue, _e, qe, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
455
+ if (Ut.includes(u))
462
456
  switch (u) {
463
457
  case "-":
464
458
  return t(Ll, null, null);
@@ -485,7 +479,7 @@ const Ll = /* @__PURE__ */ O({
485
479
  name: "underline"
486
480
  }, null), e.showToolbarName && t("div", {
487
481
  class: `${a}-toolbar-item-name`
488
- }, [(C = l.value.toolbarTips) == null ? void 0 : C.underline])]);
482
+ }, [(k = l.value.toolbarTips) == null ? void 0 : k.underline])]);
489
483
  case "italic":
490
484
  return t("div", {
491
485
  class: `${a}-toolbar-item`,
@@ -497,11 +491,11 @@ const Ll = /* @__PURE__ */ O({
497
491
  name: "italic"
498
492
  }, null), e.showToolbarName && t("div", {
499
493
  class: `${a}-toolbar-item-name`
500
- }, [(P = l.value.toolbarTips) == null ? void 0 : P.italic])]);
494
+ }, [(F = l.value.toolbarTips) == null ? void 0 : F.italic])]);
501
495
  case "strikeThrough":
502
496
  return t("div", {
503
497
  class: `${a}-toolbar-item`,
504
- title: (V = l.value.toolbarTips) == null ? void 0 : V.strikeThrough,
498
+ title: (D = l.value.toolbarTips) == null ? void 0 : D.strikeThrough,
505
499
  onClick: () => {
506
500
  s("strikeThrough");
507
501
  }
@@ -532,17 +526,17 @@ const Ll = /* @__PURE__ */ O({
532
526
  onClick: () => {
533
527
  s("h2");
534
528
  }
535
- }, [(F = l.value.titleItem) == null ? void 0 : F.h2]), t("li", {
529
+ }, [(R = l.value.titleItem) == null ? void 0 : R.h2]), t("li", {
536
530
  class: `${a}-menu-item ${a}-menu-item-title`,
537
531
  onClick: () => {
538
532
  s("h3");
539
533
  }
540
- }, [(D = l.value.titleItem) == null ? void 0 : D.h3]), t("li", {
534
+ }, [(N = l.value.titleItem) == null ? void 0 : N.h3]), t("li", {
541
535
  class: `${a}-menu-item ${a}-menu-item-title`,
542
536
  onClick: () => {
543
537
  s("h4");
544
538
  }
545
- }, [(N = l.value.titleItem) == null ? void 0 : N.h4]), t("li", {
539
+ }, [(B = l.value.titleItem) == null ? void 0 : B.h4]), t("li", {
546
540
  class: `${a}-menu-item ${a}-menu-item-title`,
547
541
  onClick: () => {
548
542
  s("h5");
@@ -601,7 +595,7 @@ const Ll = /* @__PURE__ */ O({
601
595
  name: "quote"
602
596
  }, null), e.showToolbarName && t("div", {
603
597
  class: `${a}-toolbar-item-name`
604
- }, [(B = l.value.toolbarTips) == null ? void 0 : B.quote])]);
598
+ }, [(V = l.value.toolbarTips) == null ? void 0 : V.quote])]);
605
599
  case "unorderedList":
606
600
  return t("div", {
607
601
  class: `${a}-toolbar-item`,
@@ -793,7 +787,7 @@ const Ll = /* @__PURE__ */ O({
793
787
  case "prettier":
794
788
  return e.noPrettier ? "" : t("div", {
795
789
  class: `${a}-toolbar-item`,
796
- title: (_e = l.value.toolbarTips) == null ? void 0 : _e.prettier,
790
+ title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier,
797
791
  onClick: () => {
798
792
  s("prettier");
799
793
  }
@@ -801,7 +795,7 @@ const Ll = /* @__PURE__ */ O({
801
795
  name: "prettier"
802
796
  }, null), e.showToolbarName && t("div", {
803
797
  class: `${a}-toolbar-item-name`
804
- }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier])]);
798
+ }, [(_e = l.value.toolbarTips) == null ? void 0 : _e.prettier])]);
805
799
  case "pageFullscreen":
806
800
  return !e.setting.fullscreen && t("div", {
807
801
  class: `${a}-toolbar-item`,
@@ -1010,7 +1004,7 @@ const Ll = /* @__PURE__ */ O({
1010
1004
  }, {
1011
1005
  immediate: !0
1012
1006
  }), () => {
1013
- const u = $.value[0].map((p) => k(p)), b = $.value[1].map((p) => k(p));
1007
+ const u = $.value[0].map((p) => C(p)), b = $.value[1].map((p) => C(p));
1014
1008
  return t(Mt, null, [e.toolbars.length > 0 && t("div", {
1015
1009
  class: `${a}-toolbar-wrapper`,
1016
1010
  ref: f,
@@ -1069,19 +1063,19 @@ const Ll = /* @__PURE__ */ O({
1069
1063
  e.removeEventListener("scroll", n), o.removeEventListener("scroll", n);
1070
1064
  }
1071
1065
  ];
1072
- }, _l = (e, o, l) => {
1066
+ }, Ul = (e, o, l) => {
1073
1067
  const { view: n } = l, r = jt(), i = (u) => n.lineBlockAt(n.state.doc.line(u).from).top, h = (u) => n.lineBlockAt(n.state.doc.line(u).from).height;
1074
1068
  let f = [], d = [], s = [];
1075
1069
  const g = () => {
1076
1070
  f = [], d = [], s = [], d = d.concat(
1077
1071
  Array.from(o.querySelectorAll(Wl))
1078
1072
  );
1079
- const u = d.map((C) => Number(C.dataset.line) + 1);
1073
+ const u = d.map((k) => Number(k.dataset.line) + 1);
1080
1074
  s = s.concat(u);
1081
1075
  const { lines: b } = n.state.doc;
1082
1076
  let p = 1, y = u.shift() ?? b;
1083
- for (let C = 1; C <= b; C++)
1084
- C === y && (p = C, y = u.shift() || b + 1), f.push({
1077
+ for (let k = 1; k <= b; k++)
1078
+ k === y && (p = k, y = u.shift() || b + 1), f.push({
1085
1079
  start: p,
1086
1080
  end: y - 1
1087
1081
  });
@@ -1094,14 +1088,14 @@ const Ll = /* @__PURE__ */ O({
1094
1088
  w++;
1095
1089
  const { scrollDOM: u, contentHeight: b } = n;
1096
1090
  let p = +getComputedStyle(o).paddingTop.replace("px", "");
1097
- const y = n.lineBlockAtHeight(u.scrollTop), { number: C } = n.state.doc.lineAt(y.from), A = f[C - 1];
1091
+ const y = n.lineBlockAtHeight(u.scrollTop), { number: k } = n.state.doc.lineAt(y.from), A = f[k - 1];
1098
1092
  if (!A)
1099
1093
  return !1;
1100
- let P = i(A.end) + h(A.end), V = 0;
1101
- const W = i(A.start), q = o.querySelector(`[data-line="${A.start - 1}"]`) || ((G = o.firstElementChild) == null ? void 0 : G.firstElementChild), F = o.querySelector(`[data-line="${A.end}"]`) || ((K = o.lastElementChild) == null ? void 0 : K.lastElementChild);
1102
- let D = 0, N = 0;
1103
- W === 0 ? (V = u.scrollTop / P, q === F ? (p = 0, P = b - u.offsetHeight, D = F.offsetTop + F.offsetHeight - o.clientHeight) : D = F.offsetTop) : (V = (u.scrollTop - W) / (P - W), N = q.offsetTop, D = F.offsetTop - N), P > u.scrollHeight - u.clientHeight && (V = (u.scrollTop - W) / (u.scrollHeight - u.clientHeight - W), N = q.offsetTop, D = o.scrollHeight - o.clientHeight - N + 10);
1104
- const Z = N - p + D * V;
1094
+ let F = i(A.end) + h(A.end), D = 0;
1095
+ const W = i(A.start), q = o.querySelector(`[data-line="${A.start - 1}"]`) || ((G = o.firstElementChild) == null ? void 0 : G.firstElementChild), R = o.querySelector(`[data-line="${A.end}"]`) || ((K = o.lastElementChild) == null ? void 0 : K.lastElementChild);
1096
+ let N = 0, B = 0;
1097
+ W === 0 ? (D = u.scrollTop / F, q === R ? (p = 0, F = b - u.offsetHeight, N = R.offsetTop + R.offsetHeight - o.clientHeight) : N = R.offsetTop) : (D = (u.scrollTop - W) / (F - W), B = q.offsetTop, N = R.offsetTop - B), F > u.scrollHeight - u.clientHeight && (D = (u.scrollTop - W) / (u.scrollHeight - u.clientHeight - W), B = q.offsetTop, N = o.scrollHeight - o.clientHeight - B + 10);
1098
+ const Z = B - p + N * D;
1105
1099
  r(o, Z, () => {
1106
1100
  w--;
1107
1101
  });
@@ -1111,70 +1105,70 @@ const Ll = /* @__PURE__ */ O({
1111
1105
  return;
1112
1106
  $++;
1113
1107
  const { scrollDOM: u } = n, b = o.scrollTop, p = o.scrollHeight;
1114
- let y = (Z = o.firstElementChild) == null ? void 0 : Z.firstElementChild, C = (G = o.firstElementChild) == null ? void 0 : G.lastElementChild;
1108
+ let y = (Z = o.firstElementChild) == null ? void 0 : Z.firstElementChild, k = (G = o.firstElementChild) == null ? void 0 : G.lastElementChild;
1115
1109
  if (s.length > 0) {
1116
1110
  let j = Math.ceil(
1117
1111
  Number(s[s.length - 1]) * (b / p)
1118
- ), B = s.findLastIndex((M) => M <= j);
1119
- B = B === -1 ? 0 : B, j = s[B];
1120
- for (let M = B; M >= 0 && M < s.length; )
1112
+ ), V = s.findLastIndex((M) => M <= j);
1113
+ V = V === -1 ? 0 : V, j = s[V];
1114
+ for (let M = V; M >= 0 && M < s.length; )
1121
1115
  if (d[M].offsetTop > b) {
1122
1116
  if (M - 1 >= 0) {
1123
1117
  M--;
1124
1118
  continue;
1125
1119
  }
1126
- j = -1, B = M;
1120
+ j = -1, V = M;
1127
1121
  break;
1128
1122
  } else {
1129
1123
  if (M + 1 <= s.length && d[M + 1].offsetTop < b) {
1130
1124
  M++;
1131
1125
  continue;
1132
1126
  }
1133
- j = s[M], B = M;
1127
+ j = s[M], V = M;
1134
1128
  break;
1135
1129
  }
1136
1130
  switch (j) {
1137
1131
  case -1: {
1138
- y = (K = o.firstElementChild) == null ? void 0 : K.firstElementChild, C = d[B];
1132
+ y = (K = o.firstElementChild) == null ? void 0 : K.firstElementChild, k = d[V];
1139
1133
  break;
1140
1134
  }
1141
1135
  case s.length - 1: {
1142
- y = d[B], C = (te = o.firstElementChild) == null ? void 0 : te.lastElementChild;
1136
+ y = d[V], k = (te = o.firstElementChild) == null ? void 0 : te.lastElementChild;
1143
1137
  break;
1144
1138
  }
1145
1139
  default:
1146
- y = d[B], C = d[B + 1];
1140
+ y = d[V], k = d[V + 1];
1147
1141
  }
1148
1142
  }
1149
1143
  const A = y === ((le = o.firstElementChild) == null ? void 0 : le.firstElementChild) ? 0 : y.offsetTop;
1150
- let P = C.offsetTop, V = 0;
1151
- const { start: W, end: q } = f[Number(y.dataset.line || 0)], F = i(W);
1152
- let D = i(q + 1), N = 0;
1153
- D > u.scrollHeight - u.clientHeight || C.scrollTop > o.scrollHeight - o.clientHeight ? (V = Math.max(
1144
+ let F = k.offsetTop, D = 0;
1145
+ const { start: W, end: q } = f[Number(y.dataset.line || 0)], R = i(W);
1146
+ let N = i(q + 1), B = 0;
1147
+ N > u.scrollHeight - u.clientHeight || k.scrollTop > o.scrollHeight - o.clientHeight ? (D = Math.max(
1154
1148
  (b - A) / (o.scrollHeight - A - o.clientHeight),
1155
1149
  0
1156
- ), D = i(n.state.doc.lines) + h(n.state.doc.lines), N = 8 + D - F - e.clientHeight) : y === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (y === C && (P = C.offsetTop + C.offsetHeight + +getComputedStyle(C).marginBottom.replace("px", "")), N = D, V = Math.max(b / P, 0)) : (V = Math.max(
1157
- (b - A) / (P - A),
1150
+ ), N = i(n.state.doc.lines) + h(n.state.doc.lines), B = 8 + N - R - e.clientHeight) : y === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (y === k && (F = k.offsetTop + k.offsetHeight + +getComputedStyle(k).marginBottom.replace("px", "")), B = N, D = Math.max(b / F, 0)) : (D = Math.max(
1151
+ (b - A) / (F - A),
1158
1152
  0
1159
- ), N = D - F), r(e, F + N * V, () => {
1153
+ ), B = N - R), r(e, R + B * D, () => {
1160
1154
  $--;
1161
1155
  });
1162
- }, k = Zt((u) => {
1163
- var C;
1156
+ }, C = Zt((u) => {
1157
+ var k;
1164
1158
  const { scrollDOM: b, contentHeight: p } = n, y = b.clientHeight;
1165
- if (p <= y || o.firstElementChild.clientHeight <= o.clientHeight || n.state.doc.lines < ((C = f[f.length - 1]) == null ? void 0 : C.end))
1159
+ if (p <= y || o.firstElementChild.clientHeight <= o.clientHeight || n.state.doc.lines < ((k = f[f.length - 1]) == null ? void 0 : k.end))
1166
1160
  return !1;
1167
1161
  u.target === e ? S() : m();
1168
1162
  }, 8);
1169
1163
  return [
1170
1164
  () => {
1171
- g(), e.addEventListener("scroll", k), o.addEventListener("scroll", k), e.dispatchEvent(new Event("scroll"));
1165
+ g(), e.addEventListener("scroll", C), o.addEventListener("scroll", C), e.dispatchEvent(new Event("scroll"));
1172
1166
  },
1173
1167
  () => {
1174
- e.removeEventListener("scroll", k), o.removeEventListener("scroll", k);
1168
+ e.removeEventListener("scroll", C), o.removeEventListener("scroll", C);
1175
1169
  }
1176
1170
  ];
1177
- }, Ul = (e, o, l) => {
1171
+ }, _l = (e, o, l) => {
1178
1172
  const n = I("editorId");
1179
1173
  let r = () => {
1180
1174
  }, i = () => {
@@ -1184,11 +1178,11 @@ const Ll = /* @__PURE__ */ O({
1184
1178
  const f = document.querySelector(
1185
1179
  `#${n} .cm-scroller`
1186
1180
  ), d = document.querySelector(
1187
- `[id="${n}-preview-wrapper"][data-show="true"]`
1181
+ `[id="${n}-preview-wrapper"]`
1188
1182
  ), s = document.querySelector(
1189
- `[id="${n}-html-wrapper"][data-show="true"]`
1183
+ `[id="${n}-html-wrapper"]`
1190
1184
  );
1191
- (d || s) && ([i, r] = (d ? _l : zl)(
1185
+ (d || s) && ([i, r] = (d ? Ul : zl)(
1192
1186
  f,
1193
1187
  d || s,
1194
1188
  l.value
@@ -1211,8 +1205,8 @@ const Ll = /* @__PURE__ */ O({
1211
1205
  f ? i() : r();
1212
1206
  }
1213
1207
  ), Y(h);
1214
- }, ql = Ul, Gl = (e, o, l) => {
1215
- var g, w, $, S, m, k;
1208
+ }, ql = (e, o, l) => {
1209
+ var g, w, $, S, m, C;
1216
1210
  let n = "", r = 0, i = 0, h = !0, f = !1;
1217
1211
  const d = o.getSelectedText(), s = (g = X.editorConfig) == null ? void 0 : g.mermaidTemplate;
1218
1212
  if (/^h[1-6]{1}$/.test(e)) {
@@ -1220,7 +1214,7 @@ const Ll = /* @__PURE__ */ O({
1220
1214
  n = `${u} ${d}`, r = u.length + 1;
1221
1215
  } else if (e === "prettier") {
1222
1216
  const u = window.prettier || (($ = (w = X.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : $.prettierInstance), b = [
1223
- ((S = window.prettierPlugins) == null ? void 0 : S.markdown) || ((k = (m = X.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : k.parserMarkdownInstance)
1217
+ ((S = window.prettierPlugins) == null ? void 0 : S.markdown) || ((C = (m = X.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : C.parserMarkdownInstance)
1224
1218
  ];
1225
1219
  !u || b[0] === void 0 ? (v.emit(l.editorId, ee, {
1226
1220
  name: "prettier",
@@ -1295,7 +1289,7 @@ ${u}
1295
1289
  for (let y = 0; y <= b; y++) {
1296
1290
  n += `
1297
1291
  |`;
1298
- for (let C = 0; C <= p; C++)
1292
+ for (let k = 0; k <= p; k++)
1299
1293
  n += " content |";
1300
1294
  }
1301
1295
  r = 2, i = 5 - n.length;
@@ -1308,8 +1302,15 @@ ${u}
1308
1302
  }
1309
1303
  case "image": {
1310
1304
  const { desc: u, url: b, urls: p } = l;
1311
- p instanceof Array ? n = p.reduce((y, C) => y + `![${u}](${C})
1312
- `, "") : n = `![${u}](${b})
1305
+ p instanceof Array ? n = p.reduce((y, k) => {
1306
+ const {
1307
+ url: A = "",
1308
+ alt: F = "",
1309
+ title: D = ""
1310
+ } = typeof k == "object" ? k : { url: k };
1311
+ return y + `![${F}](${A}${D ? " '" + D + "'" : ""})
1312
+ `;
1313
+ }, "") : n = `![${u}](${b})
1313
1314
  `, h = !1;
1314
1315
  break;
1315
1316
  }
@@ -1423,7 +1424,7 @@ $$
1423
1424
  replaceAll: f
1424
1425
  }
1425
1426
  };
1426
- }, Kl = "#e5c07b", bt = "var(--md-color)", jl = "#56b6c2", Zl = "#ffffff", ie = "var(--md-color)", vt = "#e5c07b", Xl = "#e5c07b", Yl = "var(--md-color)", kt = "#d19a66", Jl = "#c678dd", Ql = "#21252b", eo = "#2c313a", Ct = "var(--md-bk-color)", he = "var(--md-bk-color)", to = "#ceedfa33", $t = "#528bff", lo = pe.theme(
1427
+ }, Gl = "#e5c07b", bt = "var(--md-color)", Kl = "#56b6c2", jl = "#ffffff", ie = "var(--md-color)", vt = "#e5c07b", Zl = "#e5c07b", Xl = "var(--md-color)", kt = "#d19a66", Yl = "#c678dd", Jl = "#21252b", Ql = "#2c313a", Ct = "var(--md-bk-color)", he = "var(--md-bk-color)", eo = "#ceedfa33", $t = "#528bff", to = pe.theme(
1427
1428
  {
1428
1429
  "&": {
1429
1430
  color: ie,
@@ -1433,8 +1434,8 @@ $$
1433
1434
  caretColor: $t
1434
1435
  },
1435
1436
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: $t },
1436
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: to },
1437
- ".cm-panels": { backgroundColor: Ql, color: ie },
1437
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: eo },
1438
+ ".cm-panels": { backgroundColor: Jl, color: ie },
1438
1439
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1439
1440
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1440
1441
  ".cm-searchMatch": {
@@ -1456,7 +1457,7 @@ $$
1456
1457
  borderColor: "var(--md-border-color)"
1457
1458
  },
1458
1459
  ".cm-activeLineGutter": {
1459
- backgroundColor: eo
1460
+ backgroundColor: Ql
1460
1461
  },
1461
1462
  ".cm-foldPlaceholder": {
1462
1463
  backgroundColor: "transparent",
@@ -1482,10 +1483,10 @@ $$
1482
1483
  }
1483
1484
  },
1484
1485
  { dark: !0 }
1485
- ), oo = Vt.define([
1486
- { tag: c.keyword, color: Jl },
1486
+ ), lo = Vt.define([
1487
+ { tag: c.keyword, color: Yl },
1487
1488
  { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: bt },
1488
- { tag: [c.function(c.variableName), c.labelName], color: Xl },
1489
+ { tag: [c.function(c.variableName), c.labelName], color: Zl },
1489
1490
  { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: kt },
1490
1491
  { tag: [c.definition(c.name), c.separator], color: ie },
1491
1492
  {
@@ -1499,7 +1500,7 @@ $$
1499
1500
  c.self,
1500
1501
  c.namespace
1501
1502
  ],
1502
- color: Kl
1503
+ color: Gl
1503
1504
  },
1504
1505
  {
1505
1506
  tag: [
@@ -1511,7 +1512,7 @@ $$
1511
1512
  c.link,
1512
1513
  c.special(c.string)
1513
1514
  ],
1514
- color: jl
1515
+ color: Kl
1515
1516
  },
1516
1517
  { tag: [c.meta, c.comment], color: vt },
1517
1518
  { tag: c.strong, fontWeight: "bold" },
@@ -1520,12 +1521,12 @@ $$
1520
1521
  { tag: c.link, color: vt, textDecoration: "underline" },
1521
1522
  { tag: c.heading, fontWeight: "bold", color: bt },
1522
1523
  { tag: [c.atom, c.bool, c.special(c.variableName)], color: kt },
1523
- { tag: [c.processingInstruction, c.string, c.inserted], color: Yl },
1524
- { tag: c.invalid, color: Zl }
1524
+ { tag: [c.processingInstruction, c.string, c.inserted], color: Xl },
1525
+ { tag: c.invalid, color: jl }
1525
1526
  ]), pt = [
1526
- lo,
1527
- Ft(oo)
1528
- ], ao = "#e5c07b", yt = "#3f4a54", no = "#56b6c2", io = "#fff", re = "#3f4a54", Tt = "#2d8cf0", ro = "#2d8cf0", so = "#3f4a54", wt = "#d19a66", co = "#c678dd", uo = "#21252b", mo = "#ceedfa33", xt = "var(--md-bk-color)", be = "var(--md-bk-color)", go = "#bad5fa", St = "#3f4a54", fo = pe.theme(
1527
+ to,
1528
+ Ft(lo)
1529
+ ], oo = "#e5c07b", yt = "#3f4a54", ao = "#56b6c2", no = "#fff", re = "#3f4a54", Tt = "#2d8cf0", io = "#2d8cf0", ro = "#3f4a54", wt = "#d19a66", so = "#c678dd", co = "#21252b", uo = "#ceedfa33", xt = "var(--md-bk-color)", be = "var(--md-bk-color)", mo = "#bad5fa", St = "#3f4a54", go = pe.theme(
1529
1530
  {
1530
1531
  "&": {
1531
1532
  color: re,
@@ -1535,8 +1536,8 @@ $$
1535
1536
  caretColor: St
1536
1537
  },
1537
1538
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: St },
1538
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: go },
1539
- ".cm-panels": { backgroundColor: uo, color: re },
1539
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: mo },
1540
+ ".cm-panels": { backgroundColor: co, color: re },
1540
1541
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1541
1542
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1542
1543
  ".cm-searchMatch": {
@@ -1558,7 +1559,7 @@ $$
1558
1559
  borderColor: "var(--md-border-color)"
1559
1560
  },
1560
1561
  ".cm-activeLineGutter": {
1561
- backgroundColor: mo
1562
+ backgroundColor: uo
1562
1563
  },
1563
1564
  ".cm-foldPlaceholder": {
1564
1565
  backgroundColor: "transparent",
@@ -1584,10 +1585,10 @@ $$
1584
1585
  }
1585
1586
  }
1586
1587
  // { dark: true }
1587
- ), ho = Vt.define([
1588
- { tag: c.keyword, color: co },
1588
+ ), fo = Vt.define([
1589
+ { tag: c.keyword, color: so },
1589
1590
  { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: yt },
1590
- { tag: [c.function(c.variableName), c.labelName], color: ro },
1591
+ { tag: [c.function(c.variableName), c.labelName], color: io },
1591
1592
  { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: wt },
1592
1593
  { tag: [c.definition(c.name), c.separator], color: re },
1593
1594
  {
@@ -1601,7 +1602,7 @@ $$
1601
1602
  c.self,
1602
1603
  c.namespace
1603
1604
  ],
1604
- color: ao
1605
+ color: oo
1605
1606
  },
1606
1607
  {
1607
1608
  tag: [
@@ -1613,7 +1614,7 @@ $$
1613
1614
  c.link,
1614
1615
  c.special(c.string)
1615
1616
  ],
1616
- color: no
1617
+ color: ao
1617
1618
  },
1618
1619
  { tag: [c.meta, c.comment], color: Tt },
1619
1620
  { tag: c.strong, fontWeight: "bold" },
@@ -1622,23 +1623,23 @@ $$
1622
1623
  { tag: c.link, color: Tt, textDecoration: "underline" },
1623
1624
  { tag: c.heading, fontWeight: "bold", color: yt },
1624
1625
  { tag: [c.atom, c.bool, c.special(c.variableName)], color: wt },
1625
- { tag: [c.processingInstruction, c.string, c.inserted], color: so },
1626
- { tag: c.invalid, color: io }
1626
+ { tag: [c.processingInstruction, c.string, c.inserted], color: ro },
1627
+ { tag: c.invalid, color: no }
1627
1628
  ]), At = [
1628
- fo,
1629
- Ft(ho)
1629
+ go,
1630
+ Ft(fo)
1630
1631
  ], ue = (e, o, l, n, r) => (i, h, f, d) => {
1631
1632
  const s = `${e}${o}`.slice(d - f);
1632
1633
  i.dispatch(i.state.replaceSelection(`${s}${l}${n}`));
1633
1634
  const g = f + h.label.length + (r === "title" ? l.length : 0);
1634
1635
  i.dispatch({
1635
- selection: _.create(
1636
+ selection: U.create(
1636
1637
  [
1637
- _.range(
1638
+ U.range(
1638
1639
  f + h.label.length + (r === "title" ? 1 : -o.length),
1639
1640
  g
1640
1641
  ),
1641
- _.cursor(g)
1642
+ U.cursor(g)
1642
1643
  ],
1643
1644
  1
1644
1645
  )
@@ -1646,7 +1647,7 @@ $$
1646
1647
  }, Lt = (e) => (o, l, n, r) => {
1647
1648
  const i = e.slice(r - n);
1648
1649
  o.dispatch(o.state.replaceSelection(`${i} `));
1649
- }, bo = (e) => {
1650
+ }, It = (e) => {
1650
1651
  const o = (l) => {
1651
1652
  const n = l.matchBefore(
1652
1653
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
@@ -1745,13 +1746,13 @@ $$`, "title")
1745
1746
  return gl({
1746
1747
  override: e ? [o, ...e] : [o]
1747
1748
  });
1748
- }, It = bo, J = (e) => {
1749
+ }, J = (e) => {
1749
1750
  const o = new ne();
1750
1751
  return (n) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(n) }) : e.dispatch({
1751
1752
  effects: nl.appendConfig.of(o.of(n))
1752
1753
  }), !0);
1753
1754
  };
1754
- class vo {
1755
+ class ho {
1755
1756
  constructor(o) {
1756
1757
  z(this, "view");
1757
1758
  z(this, "maxLength", Number.MAX_SAFE_INTEGER);
@@ -1821,10 +1822,10 @@ class vo {
1821
1822
  if (this.view.dispatch(this.view.state.replaceSelection(o)), l.select) {
1822
1823
  const i = r + o.length + l.deviationEnd;
1823
1824
  this.view.dispatch({
1824
- selection: _.create(
1825
+ selection: U.create(
1825
1826
  [
1826
- _.range(r + l.deviationStart, i),
1827
- _.cursor(i)
1827
+ U.range(r + l.deviationStart, i),
1828
+ U.cursor(i)
1828
1829
  ],
1829
1830
  1
1830
1831
  )
@@ -1877,8 +1878,8 @@ class vo {
1877
1878
  }
1878
1879
  this.view.dispatch({
1879
1880
  scrollIntoView: !0,
1880
- selection: _.create(
1881
- [_.range(l, n), _.cursor(r)],
1881
+ selection: U.create(
1882
+ [U.range(l, n), U.cursor(r)],
1882
1883
  1
1883
1884
  )
1884
1885
  });
@@ -1895,7 +1896,7 @@ class vo {
1895
1896
  ]);
1896
1897
  }
1897
1898
  }
1898
- const ko = (e) => {
1899
+ const bo = (e) => {
1899
1900
  const o = I("editorId");
1900
1901
  return (n) => {
1901
1902
  if (!n.clipboardData)
@@ -1924,7 +1925,7 @@ const ko = (e) => {
1924
1925
  data: r
1925
1926
  });
1926
1927
  };
1927
- }, Co = ko, $o = (e, o) => [
1928
+ }, vo = (e, o) => [
1928
1929
  {
1929
1930
  key: "Ctrl-b",
1930
1931
  mac: "Cmd-b",
@@ -1939,7 +1940,7 @@ const ko = (e) => {
1939
1940
  {
1940
1941
  key: "Ctrl-s",
1941
1942
  mac: "Cmd-s",
1942
- run: (C) => (v.emit(e, Ht, C.state.doc.toString()), !0),
1943
+ run: (k) => (v.emit(e, Ht, k.state.doc.toString()), !0),
1943
1944
  shift: () => (v.emit(e, L, "strikeThrough"), !0)
1944
1945
  },
1945
1946
  {
@@ -2003,7 +2004,7 @@ const ko = (e) => {
2003
2004
  key: "Ctrl-c",
2004
2005
  mac: "Cmd-c",
2005
2006
  shift: () => (v.emit(e, L, "code"), !0),
2006
- any(C, A) {
2007
+ any(k, A) {
2007
2008
  return (A.ctrlKey || A.metaKey) && A.altKey && A.code === "KeyC" ? (v.emit(e, L, "codeRow"), !0) : !1;
2008
2009
  }
2009
2010
  },
@@ -2018,10 +2019,10 @@ const ko = (e) => {
2018
2019
  shift: () => o.noPrettier ? !1 : (v.emit(e, L, "prettier"), !0)
2019
2020
  },
2020
2021
  {
2021
- any: (C, A) => (A.ctrlKey || A.metaKey) && A.altKey && A.shiftKey && A.code === "KeyT" ? (v.emit(e, L, "table"), !0) : !1
2022
+ any: (k, A) => (A.ctrlKey || A.metaKey) && A.altKey && A.shiftKey && A.code === "KeyT" ? (v.emit(e, L, "table"), !0) : !1
2022
2023
  }
2023
- ], po = $o, yo = (e) => {
2024
- const o = I("tabWidth"), l = I("editorId"), n = I("theme"), r = R(), i = Wt(), h = new ne(), f = new ne(), d = new ne(), s = new ne(), g = po(l, e), w = Co(e), $ = [
2024
+ ], ko = (e) => {
2025
+ const o = I("tabWidth"), l = I("editorId"), n = I("theme"), r = O(), i = Wt(), h = new ne(), f = new ne(), d = new ne(), s = new ne(), g = vo(l, e), w = bo(e), $ = [
2025
2026
  ll.of([...rl, ...sl, ...g, cl]),
2026
2027
  s.of(ft()),
2027
2028
  h.of(al({ codeLanguages: ol })),
@@ -2037,11 +2038,11 @@ const ko = (e) => {
2037
2038
  drop: e.onDrop,
2038
2039
  input: (m) => {
2039
2040
  e.onInput && e.onInput(m);
2040
- const { data: k } = m;
2041
- e.maxlength && e.modelValue.length + k.length > e.maxlength && v.emit(l, ee, {
2041
+ const { data: C } = m;
2042
+ e.maxlength && e.modelValue.length + C.length > e.maxlength && v.emit(l, ee, {
2042
2043
  name: "overlength",
2043
2044
  message: "The input text is too long",
2044
- data: k
2045
+ data: C
2045
2046
  });
2046
2047
  }
2047
2048
  })
@@ -2060,9 +2061,9 @@ const ko = (e) => {
2060
2061
  doc: e.modelValue,
2061
2062
  parent: r.value,
2062
2063
  extensions: [S()]
2063
- }), k = new vo(m);
2064
- i.value = k, setTimeout(() => {
2065
- k.setTabSize(o), k.setDisabled(e.disabled), k.setReadOnly(e.readonly), e.placeholder && k.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && k.setMaxLength(e.maxlength), e.autofocus && m.focus();
2064
+ }), C = new ho(m);
2065
+ i.value = C, setTimeout(() => {
2066
+ C.setTabSize(o), C.setDisabled(e.disabled), C.setReadOnly(e.readonly), e.placeholder && C.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && C.setMaxLength(e.maxlength), e.autofocus && m.focus();
2066
2067
  }, 0), v.on(l, {
2067
2068
  name: Nt,
2068
2069
  callback() {
@@ -2076,9 +2077,9 @@ const ko = (e) => {
2076
2077
  }), v.on(l, {
2077
2078
  name: L,
2078
2079
  callback(u, b = {}) {
2079
- var C;
2080
- const { text: p, options: y } = Gl(u, i.value, b);
2081
- (C = i.value) == null || C.replaceSelectedText(p, y, l);
2080
+ var k;
2081
+ const { text: p, options: y } = ql(u, i.value, b);
2082
+ (k = i.value) == null || k.replaceSelectedText(p, y, l);
2082
2083
  }
2083
2084
  });
2084
2085
  }), H(
@@ -2106,8 +2107,8 @@ const ko = (e) => {
2106
2107
  ), H(
2107
2108
  () => e.modelValue,
2108
2109
  () => {
2109
- var m, k;
2110
- ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((k = i.value) == null || k.setValue(e.modelValue));
2110
+ var m, C;
2111
+ ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((C = i.value) == null || C.setValue(e.modelValue));
2111
2112
  }
2112
2113
  ), H(
2113
2114
  () => e.placeholder,
@@ -2137,25 +2138,25 @@ const ko = (e) => {
2137
2138
  inputWrapperRef: r,
2138
2139
  codeMirrorUt: i,
2139
2140
  resetHistory() {
2140
- var m, k;
2141
+ var m, C;
2141
2142
  (m = i.value) == null || m.view.dispatch({
2142
2143
  effects: s.reconfigure([])
2143
- }), (k = i.value) == null || k.view.dispatch({
2144
+ }), (C = i.value) == null || C.view.dispatch({
2144
2145
  effects: s.reconfigure(ft())
2145
2146
  });
2146
2147
  }
2147
2148
  };
2148
- }, To = yo, wo = (e, o, l) => {
2149
- const n = U({
2149
+ }, Co = (e, o, l) => {
2150
+ const n = _({
2150
2151
  resizedWidth: e.inputBoxWitdh
2151
- }), r = U({
2152
+ }), r = _({
2152
2153
  width: e.inputBoxWitdh
2153
- }), i = U({
2154
+ }), i = _({
2154
2155
  left: e.inputBoxWitdh,
2155
2156
  display: "initial"
2156
2157
  }), h = (s) => {
2157
- var m, k, u;
2158
- const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, w = ((k = o.value) == null ? void 0 : k.getBoundingClientRect().x) || 0;
2158
+ var m, C, u;
2159
+ const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, w = ((C = o.value) == null ? void 0 : C.getBoundingClientRect().x) || 0;
2159
2160
  let $ = s.x - w;
2160
2161
  $ < se ? $ = se : $ > g - se && ($ = g - se);
2161
2162
  const S = `${$}px`;
@@ -2185,19 +2186,19 @@ const ko = (e) => {
2185
2186
  immediate: !0
2186
2187
  }
2187
2188
  ), { inputWrapperStyle: r, resizeOperateStyle: i };
2188
- }, xo = wo, So = /* @__PURE__ */ O({
2189
+ }, $o = /* @__PURE__ */ P({
2189
2190
  name: "MDEditorContent",
2190
2191
  props: fl,
2191
2192
  setup(e, o) {
2192
- const l = I("editorId"), n = R(""), r = R(), i = R(), {
2193
+ const l = I("editorId"), n = O(""), r = O(), i = O(), {
2193
2194
  inputWrapperRef: h,
2194
2195
  codeMirrorUt: f,
2195
2196
  resetHistory: d
2196
- } = To(e), {
2197
+ } = ko(e), {
2197
2198
  inputWrapperStyle: s,
2198
2199
  resizeOperateStyle: g
2199
- } = xo(e, r, i);
2200
- return ql(e, n, f), o.expose({
2200
+ } = Co(e, r, i);
2201
+ return _l(e, n, f), o.expose({
2201
2202
  getSelectedText() {
2202
2203
  var w;
2203
2204
  return (w = f.value) == null ? void 0 : w.getSelectedText();
@@ -2241,7 +2242,7 @@ const ko = (e) => {
2241
2242
  key: "internal-catalog"
2242
2243
  }, null)]);
2243
2244
  }
2244
- }), Ao = /* @__PURE__ */ O({
2245
+ }), po = /* @__PURE__ */ P({
2245
2246
  props: {
2246
2247
  modelValue: {
2247
2248
  type: String,
@@ -2259,7 +2260,7 @@ const ko = (e) => {
2259
2260
  }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((n = e.modelValue) == null ? void 0 : n.length) || 0])]);
2260
2261
  };
2261
2262
  }
2262
- }), Lo = {
2263
+ }), yo = {
2263
2264
  checked: {
2264
2265
  type: Boolean,
2265
2266
  default: !1
@@ -2269,8 +2270,8 @@ const ko = (e) => {
2269
2270
  default: () => {
2270
2271
  }
2271
2272
  }
2272
- }, Io = /* @__PURE__ */ O({
2273
- props: Lo,
2273
+ }, To = /* @__PURE__ */ P({
2274
+ props: yo,
2274
2275
  setup(e) {
2275
2276
  return () => t("div", {
2276
2277
  class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`],
@@ -2279,7 +2280,7 @@ const ko = (e) => {
2279
2280
  }
2280
2281
  }, null);
2281
2282
  }
2282
- }), Mo = {
2283
+ }), wo = {
2283
2284
  scrollAuto: {
2284
2285
  type: Boolean
2285
2286
  },
@@ -2288,8 +2289,8 @@ const ko = (e) => {
2288
2289
  default: () => {
2289
2290
  }
2290
2291
  }
2291
- }, Eo = /* @__PURE__ */ O({
2292
- props: Mo,
2292
+ }, xo = /* @__PURE__ */ P({
2293
+ props: wo,
2293
2294
  setup(e) {
2294
2295
  const o = I("usedLanguageText");
2295
2296
  return () => {
@@ -2301,13 +2302,13 @@ const ko = (e) => {
2301
2302
  onClick: () => {
2302
2303
  e.onScrollAutoChange(!e.scrollAuto);
2303
2304
  }
2304
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Io, {
2305
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(To, {
2305
2306
  checked: e.scrollAuto,
2306
2307
  onChange: e.onScrollAutoChange
2307
2308
  }, null)]);
2308
2309
  };
2309
2310
  }
2310
- }), Ho = {
2311
+ }), So = {
2311
2312
  modelValue: {
2312
2313
  type: String,
2313
2314
  default: ""
@@ -2327,22 +2328,22 @@ const ko = (e) => {
2327
2328
  defFooters: {
2328
2329
  type: Object
2329
2330
  }
2330
- }, Do = /* @__PURE__ */ O({
2331
+ }, Ao = /* @__PURE__ */ P({
2331
2332
  name: "MDEditorFooter",
2332
- props: Ho,
2333
+ props: So,
2333
2334
  setup(e) {
2334
2335
  const o = Ce(() => {
2335
2336
  const n = e.footers.indexOf("="), r = n === -1 ? e.footers : e.footers.slice(0, n), i = n === -1 ? [] : e.footers.slice(n, Number.MAX_SAFE_INTEGER);
2336
2337
  return [r, i];
2337
2338
  }), l = (n) => {
2338
- if (Ut.includes(n))
2339
+ if (_t.includes(n))
2339
2340
  switch (n) {
2340
2341
  case "markdownTotal":
2341
- return t(Ao, {
2342
+ return t(po, {
2342
2343
  modelValue: e.modelValue
2343
2344
  }, null);
2344
2345
  case "scrollSwitch":
2345
- return t(Eo, {
2346
+ return t(xo, {
2346
2347
  scrollAuto: e.scrollAuto,
2347
2348
  onScrollAutoChange: e.onScrollAutoChange
2348
2349
  }, null);
@@ -2361,7 +2362,7 @@ const ko = (e) => {
2361
2362
  }, [r])]);
2362
2363
  };
2363
2364
  }
2364
- }), No = /* @__PURE__ */ O({
2365
+ }), ve = /* @__PURE__ */ P({
2365
2366
  name: "MdEditorV3",
2366
2367
  props: bl,
2367
2368
  emits: vl,
@@ -2373,15 +2374,15 @@ const ko = (e) => {
2373
2374
  noPrettier: i,
2374
2375
  noUploadImg: h,
2375
2376
  noHighlight: f
2376
- } = e, d = U({
2377
+ } = e, d = _({
2377
2378
  scrollAuto: e.scrollAuto
2378
- }), s = R();
2379
+ }), s = O();
2379
2380
  kl(e, o), Cl(e), $l(e), pl(e, o);
2380
2381
  const [g, w] = yl(e, o), $ = Tl(e);
2381
2382
  return Et(() => {
2382
2383
  v.clear(l);
2383
2384
  }), wl(e, o, $, g, w, s), () => {
2384
- var k;
2385
+ var C;
2385
2386
  const S = ht({
2386
2387
  props: e,
2387
2388
  ctx: o
@@ -2403,7 +2404,7 @@ const ko = (e) => {
2403
2404
  defToolbars: S,
2404
2405
  noUploadImg: h,
2405
2406
  showToolbarName: e.showToolbarName
2406
- }, null), t(So, {
2407
+ }, null), t($o, {
2407
2408
  ref: s,
2408
2409
  modelValue: e.modelValue,
2409
2410
  setting: g,
@@ -2451,7 +2452,7 @@ const ko = (e) => {
2451
2452
  e.onInputBoxWitdhChange && e.onInputBoxWitdhChange(u), o.emit("onInputBoxWitdhChange", u);
2452
2453
  },
2453
2454
  sanitizeMermaid: e.sanitizeMermaid
2454
- }, null), ((k = e.footers) == null ? void 0 : k.length) > 0 && t(Do, {
2455
+ }, null), ((C = e.footers) == null ? void 0 : C.length) > 0 && t(Ao, {
2455
2456
  modelValue: e.modelValue,
2456
2457
  footers: e.footers,
2457
2458
  defFooters: m,
@@ -2460,7 +2461,7 @@ const ko = (e) => {
2460
2461
  }, null)]);
2461
2462
  };
2462
2463
  }
2463
- }), ve = No;
2464
+ });
2464
2465
  ve.install = (e) => (e.component(ve.name, ve), e.use(Sl).use(Xt).use(Al).use(Rt).use(xl), e);
2465
2466
  export {
2466
2467
  ve as default