md-editor-v3 4.1.1 → 4.2.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.
@@ -1,8 +1,8 @@
1
1
  var Ze = Object.defineProperty;
2
2
  var Je = (e, o, a) => o in e ? Ze(e, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[o] = a;
3
- var q = (e, o, a) => (Je(e, typeof o != "symbol" ? o + "" : o, a), a);
4
- import { defineComponent as O, createVNode as t, inject as A, ref as U, onMounted as W, reactive as Z, computed as fe, watch as I, nextTick as me, Fragment as Ke, toRef as te, shallowRef as Xe, onBeforeUnmount as Qe } from "vue";
5
- import { p as n, a as _, s as et, b as tt, d as lt } from "./chunks/config.mjs";
3
+ var U = (e, o, a) => (Je(e, typeof o != "symbol" ? o + "" : o, a), a);
4
+ import { defineComponent as O, createVNode as t, inject as A, ref as G, onMounted as z, reactive as Z, computed as fe, watch as F, nextTick as me, Fragment as Ke, toRef as te, shallowRef as Xe, onBeforeUnmount as Qe } from "vue";
5
+ import { p as n, a as W, s as et, b as tt, d as lt } from "./chunks/config.mjs";
6
6
  import { a as ee, D as ot } from "./chunks/index2.mjs";
7
7
  import { b as h, a as at } from "./chunks/index4.mjs";
8
8
  import { linkTo as nt, debounce as rt, throttle as it, smoothScroll as Ee } from "@vavt/util";
@@ -13,27 +13,28 @@ import { minimalSetup as xt, EditorView as re } from "codemirror";
13
13
  import { EditorView as ge, placeholder as wt, keymap as Tt } from "@codemirror/view";
14
14
  import { languages as St } from "@codemirror/language-data";
15
15
  import { markdown as At } from "@codemirror/lang-markdown";
16
- import { deleteLine as Mt, indentWithTab as Lt, undo as Dt, redo as Et } from "@codemirror/commands";
17
- import { HighlightStyle as We, syntaxHighlighting as ze, indentUnit as Ht } from "@codemirror/language";
16
+ import { htmlCompletionSource as Mt, html as Lt } from "@codemirror/lang-html";
17
+ import { deleteLine as Dt, indentWithTab as Et, undo as Ht, redo as It } from "@codemirror/commands";
18
+ import { HighlightStyle as We, syntaxHighlighting as ze, indentUnit as Bt } from "@codemirror/language";
18
19
  import { tags as s } from "@lezer/highlight";
19
- import { EditorSelection as Y, EditorState as se, Compartment as Bt, StateEffect as Ft } from "@codemirror/state";
20
- import { autocompletion as It } from "@codemirror/autocomplete";
20
+ import { EditorSelection as P, EditorState as se, Compartment as Ft, StateEffect as Ot } from "@codemirror/state";
21
+ import { autocompletion as Vt } from "@codemirror/autocomplete";
21
22
  import { g as He } from "./chunks/vue-tsx.mjs";
22
23
  import Ye from "./MdCatalog.mjs";
23
- import Ot from "./NormalToolbar.mjs";
24
+ import Rt from "./NormalToolbar.mjs";
24
25
  import "medium-zoom";
25
26
  import "copy-to-clipboard";
26
27
  import "markdown-it";
27
28
  import "markdown-it-image-figures";
28
29
  import "markdown-it-task-lists";
29
30
  import "lru-cache";
30
- const Vt = /* @__PURE__ */ O({
31
+ const Pt = /* @__PURE__ */ O({
31
32
  setup() {
32
33
  return () => t("div", {
33
34
  class: `${n}-divider`
34
35
  }, null);
35
36
  }
36
- }), Rt = {
37
+ }), Nt = {
37
38
  noPrettier: {
38
39
  type: Boolean
39
40
  },
@@ -74,11 +75,11 @@ const Vt = /* @__PURE__ */ O({
74
75
  noUploadImg: {
75
76
  type: Boolean
76
77
  }
77
- }, Nt = (e) => {
78
+ }, qt = (e) => {
78
79
  var f, u, d, v;
79
80
  const o = A("editorId");
80
- let a = (u = (f = _.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : u.instance;
81
- const l = (v = (d = _.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : v.js, i = U(!1), r = (y) => {
81
+ let a = (u = (f = W.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : u.instance;
82
+ const l = (v = (d = W.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : v.js, r = G(!1), i = (y) => {
82
83
  if (!a) {
83
84
  h.emit(o, "errorCatcher", {
84
85
  name: "fullscreen",
@@ -86,26 +87,26 @@ const Vt = /* @__PURE__ */ O({
86
87
  });
87
88
  return;
88
89
  }
89
- a.isEnabled ? (i.value = !0, (y === void 0 ? !a.isFullscreen : y) ? a.request() : a.exit()) : console.error("browser does not support screenfull!");
90
+ a.isEnabled ? (r.value = !0, (y === void 0 ? !a.isFullscreen : y) ? a.request() : a.exit()) : console.error("browser does not support screenfull!");
90
91
  }, c = () => {
91
92
  a && a.isEnabled && a.on("change", () => {
92
- (i.value || e.setting.fullscreen) && (i.value = !1, e.updateSetting("fullscreen"));
93
+ (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
93
94
  });
94
95
  }, m = () => {
95
96
  a = window.screenfull, c();
96
97
  };
97
- return W(() => {
98
+ return z(() => {
98
99
  if (c(), !a) {
99
100
  const y = document.createElement("script");
100
101
  y.src = l || et, y.onload = m, y.id = `${n}-screenfull`, $t(y, "screenfull");
101
102
  }
102
- }), W(() => {
103
+ }), z(() => {
103
104
  h.on(o, {
104
105
  name: st,
105
- callback: r
106
+ callback: i
106
107
  });
107
- }), { fullscreenHandler: r };
108
- }, Pt = {
108
+ }), { fullscreenHandler: i };
109
+ }, Ut = {
109
110
  tableShape: {
110
111
  type: Array,
111
112
  default: () => [6, 4]
@@ -115,9 +116,9 @@ const Vt = /* @__PURE__ */ O({
115
116
  default: () => {
116
117
  }
117
118
  }
118
- }, qt = /* @__PURE__ */ O({
119
+ }, Gt = /* @__PURE__ */ O({
119
120
  name: "TableShape",
120
- props: Pt,
121
+ props: Ut,
121
122
  setup(e) {
122
123
  const o = Z({
123
124
  x: -1,
@@ -131,20 +132,20 @@ const Vt = /* @__PURE__ */ O({
131
132
  }, [new Array(e.tableShape[1]).fill("").map((a, l) => t("div", {
132
133
  class: `${n}-table-shape-row`,
133
134
  key: `table-shape-row-${l}`
134
- }, [new Array(e.tableShape[0]).fill("").map((i, r) => t("div", {
135
+ }, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
135
136
  class: `${n}-table-shape-col`,
136
- key: `table-shape-col-${r}`,
137
+ key: `table-shape-col-${i}`,
137
138
  onMouseenter: () => {
138
- o.x = l, o.y = r;
139
+ o.x = l, o.y = i;
139
140
  },
140
141
  onClick: () => {
141
142
  e.onSelected(o);
142
143
  }
143
144
  }, [t("div", {
144
- class: [`${n}-table-shape-col-default`, l <= o.x && r <= o.y && `${n}-table-shape-col-include`]
145
+ class: [`${n}-table-shape-col-default`, l <= o.x && i <= o.y && `${n}-table-shape-col-include`]
145
146
  }, null)]))]))]);
146
147
  }
147
- }), Ut = qt, Gt = {
148
+ }), Kt = Gt, jt = {
148
149
  type: {
149
150
  type: String,
150
151
  default: "link"
@@ -163,26 +164,26 @@ const Vt = /* @__PURE__ */ O({
163
164
  default: () => {
164
165
  }
165
166
  }
166
- }, Kt = /* @__PURE__ */ O({
167
- props: Gt,
167
+ }, _t = /* @__PURE__ */ O({
168
+ props: jt,
168
169
  setup(e) {
169
170
  const o = A("usedLanguageText"), a = A("editorId"), l = fe(() => {
170
- var r, c;
171
+ var i, c;
171
172
  switch (e.type) {
172
173
  case "link":
173
- return (r = o.value.linkModalTips) == null ? void 0 : r.linkTitle;
174
+ return (i = o.value.linkModalTips) == null ? void 0 : i.linkTitle;
174
175
  case "image":
175
176
  return (c = o.value.linkModalTips) == null ? void 0 : c.imageTitle;
176
177
  default:
177
178
  return "";
178
179
  }
179
- }), i = Z({
180
+ }), r = Z({
180
181
  desc: "",
181
182
  url: ""
182
183
  });
183
- return I(() => e.visible, (r) => {
184
- r || setTimeout(() => {
185
- i.desc = "", i.url = "";
184
+ return F(() => e.visible, (i) => {
185
+ i || setTimeout(() => {
186
+ r.desc = "", r.url = "";
186
187
  }, 200);
187
188
  }), () => t(_e, {
188
189
  title: l.value,
@@ -190,20 +191,20 @@ const Vt = /* @__PURE__ */ O({
190
191
  onClose: e.onCancel
191
192
  }, {
192
193
  default: () => {
193
- var r, c, m, f, u;
194
+ var i, c, m, f, u;
194
195
  return [t("div", {
195
196
  class: `${n}-form-item`
196
197
  }, [t("label", {
197
198
  class: `${n}-label`,
198
199
  for: `link-desc-${a}`
199
- }, [(r = o.value.linkModalTips) == null ? void 0 : r.descLabel]), t("input", {
200
+ }, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
200
201
  placeholder: (c = o.value.linkModalTips) == null ? void 0 : c.descLabelPlaceHolder,
201
202
  class: `${n}-input`,
202
203
  id: `link-desc-${a}`,
203
204
  type: "text",
204
- value: i.desc,
205
+ value: r.desc,
205
206
  onChange: (d) => {
206
- i.desc = d.target.value;
207
+ r.desc = d.target.value;
207
208
  },
208
209
  autocomplete: "off"
209
210
  }, null)]), t("div", {
@@ -216,9 +217,9 @@ const Vt = /* @__PURE__ */ O({
216
217
  class: `${n}-input`,
217
218
  id: `link-url-${a}`,
218
219
  type: "text",
219
- value: i.url,
220
+ value: r.url,
220
221
  onChange: (d) => {
221
- i.url = d.target.value;
222
+ r.url = d.target.value;
222
223
  },
223
224
  autocomplete: "off"
224
225
  }, null)]), t("div", {
@@ -227,13 +228,13 @@ const Vt = /* @__PURE__ */ O({
227
228
  class: [`${n}-btn`, `${n}-btn-row`],
228
229
  type: "button",
229
230
  onClick: () => {
230
- e.onOk(i), i.desc = "", i.url = "";
231
+ e.onOk(r), r.desc = "", r.url = "";
231
232
  }
232
233
  }, [(u = o.value.linkModalTips) == null ? void 0 : u.buttonOK])])];
233
234
  }
234
235
  });
235
236
  }
236
- }), jt = {
237
+ }), Wt = {
237
238
  visible: {
238
239
  type: Boolean,
239
240
  default: !1
@@ -248,13 +249,13 @@ const Vt = /* @__PURE__ */ O({
248
249
  default: () => {
249
250
  }
250
251
  }
251
- }, _t = /* @__PURE__ */ O({
252
- props: jt,
252
+ }, zt = /* @__PURE__ */ O({
253
+ props: Wt,
253
254
  setup(e) {
254
255
  var d, v, y;
255
256
  const o = A("usedLanguageText"), a = A("editorId");
256
- let l = (y = (v = (d = _) == null ? void 0 : d.editorExtensions) == null ? void 0 : v.cropper) == null ? void 0 : y.instance;
257
- const i = U(), r = U(), c = U(), m = Z({
257
+ let l = (y = (v = (d = W) == null ? void 0 : d.editorExtensions) == null ? void 0 : v.cropper) == null ? void 0 : y.instance;
258
+ const r = G(), i = G(), c = G(), m = Z({
258
259
  cropperInited: !1,
259
260
  imgSelected: !1,
260
261
  imgSrc: "",
@@ -262,8 +263,8 @@ const Vt = /* @__PURE__ */ O({
262
263
  isFullscreen: !1
263
264
  });
264
265
  let f = null;
265
- I(() => e.visible, () => {
266
- e.visible && !m.cropperInited && (l = l || window.Cropper, i.value.onchange = () => {
266
+ F(() => e.visible, () => {
267
+ e.visible && !m.cropperInited && (l = l || window.Cropper, r.value.onchange = () => {
267
268
  if (!l) {
268
269
  h.emit(a, "errorCatcher", {
269
270
  name: "Cropper",
@@ -271,12 +272,12 @@ const Vt = /* @__PURE__ */ O({
271
272
  });
272
273
  return;
273
274
  }
274
- const b = i.value.files || [];
275
+ const b = r.value.files || [];
275
276
  if (m.imgSelected = !0, (b == null ? void 0 : b.length) > 0) {
276
277
  const p = new FileReader();
277
278
  p.onload = (g) => {
278
279
  m.imgSrc = g.target.result, me(() => {
279
- f = new l(r.value, {
280
+ f = new l(i.value, {
280
281
  viewMode: 2,
281
282
  preview: `.${n}-clip-preview-target`
282
283
  // aspectRatio: 16 / 9,
@@ -285,11 +286,11 @@ const Vt = /* @__PURE__ */ O({
285
286
  }, p.readAsDataURL(b[0]);
286
287
  }
287
288
  });
288
- }), I(() => [m.imgSelected], () => {
289
+ }), F(() => [m.imgSelected], () => {
289
290
  c.value.style = "";
290
- }), I(() => m.isFullscreen, () => {
291
+ }), F(() => m.isFullscreen, () => {
291
292
  me(() => {
292
- f == null || f.destroy(), c.value.style = "", r.value && (f = new l(r.value, {
293
+ f == null || f.destroy(), c.value.style = "", i.value && (f = new l(i.value, {
293
294
  viewMode: 2,
294
295
  preview: `.${n}-clip-preview-target`
295
296
  // aspectRatio: 16 / 9,
@@ -297,7 +298,7 @@ const Vt = /* @__PURE__ */ O({
297
298
  });
298
299
  });
299
300
  const u = () => {
300
- f.clear(), f.destroy(), f = null, i.value.value = "", m.imgSelected = !1;
301
+ f.clear(), f.destroy(), f = null, r.value.value = "", m.imgSelected = !1;
301
302
  };
302
303
  return () => {
303
304
  var b;
@@ -324,7 +325,7 @@ const Vt = /* @__PURE__ */ O({
324
325
  class: `${n}-clip-cropper`
325
326
  }, [t("img", {
326
327
  src: m.imgSrc,
327
- ref: r,
328
+ ref: i,
328
329
  style: {
329
330
  display: "none"
330
331
  },
@@ -340,7 +341,7 @@ const Vt = /* @__PURE__ */ O({
340
341
  }, null)])])]) : t("div", {
341
342
  class: `${n}-clip-upload`,
342
343
  onClick: () => {
343
- i.value.click();
344
+ r.value.click();
344
345
  }
345
346
  }, [t("svg", {
346
347
  class: `${n}-icon`,
@@ -364,7 +365,7 @@ const Vt = /* @__PURE__ */ O({
364
365
  }
365
366
  }
366
367
  }, [((p = o.value.clipModalTips) == null ? void 0 : p.buttonUpload) || ((g = o.value.linkModalTips) == null ? void 0 : g.buttonOK)])]), t("input", {
367
- ref: i,
368
+ ref: r,
368
369
  accept: "image/*",
369
370
  type: "file",
370
371
  multiple: !1,
@@ -376,7 +377,7 @@ const Vt = /* @__PURE__ */ O({
376
377
  });
377
378
  };
378
379
  }
379
- }), Wt = {
380
+ }), Yt = {
380
381
  type: {
381
382
  type: String,
382
383
  default: "link"
@@ -399,27 +400,27 @@ const Vt = /* @__PURE__ */ O({
399
400
  default: () => {
400
401
  }
401
402
  }
402
- }, zt = /* @__PURE__ */ O({
403
- props: Wt,
403
+ }, Zt = /* @__PURE__ */ O({
404
+ props: Yt,
404
405
  setup(e) {
405
- return () => t(Ke, null, [t(Kt, {
406
+ return () => t(Ke, null, [t(_t, {
406
407
  type: e.type,
407
408
  visible: e.linkVisible,
408
409
  onOk: e.onOk,
409
410
  onCancel: e.onCancel
410
- }, null), t(_t, {
411
+ }, null), t(zt, {
411
412
  visible: e.clipVisible,
412
413
  onOk: e.onOk,
413
414
  onCancel: e.onCancel
414
415
  }, null)]);
415
416
  }
416
- }), Yt = /* @__PURE__ */ O({
417
+ }), Jt = /* @__PURE__ */ O({
417
418
  name: "MDEditorToolbar",
418
- props: Rt,
419
+ props: Nt,
419
420
  setup(e) {
420
421
  const o = A("editorId"), a = A("usedLanguageText"), {
421
422
  fullscreenHandler: l
422
- } = Nt(e), i = `${o}-toolbar-wrapper`, r = Z({
423
+ } = qt(e), r = `${o}-toolbar-wrapper`, i = Z({
423
424
  title: !1,
424
425
  catalog: !1,
425
426
  // 图片上传下拉
@@ -435,8 +436,8 @@ const Vt = /* @__PURE__ */ O({
435
436
  type: "link",
436
437
  linkVisible: !1,
437
438
  clipVisible: !1
438
- }), f = U();
439
- W(() => {
439
+ }), f = G();
440
+ z(() => {
440
441
  h.on(o, {
441
442
  name: "openModals",
442
443
  callback(b) {
@@ -447,18 +448,18 @@ const Vt = /* @__PURE__ */ O({
447
448
  const u = fe(() => {
448
449
  const b = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), p = b.indexOf("="), g = p === -1 ? b : b.slice(0, p + 1), k = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
449
450
  return [g, k];
450
- }), d = U(), v = () => {
451
+ }), d = G(), v = () => {
451
452
  h.emit(o, "uploadImage", Array.from(d.value.files || [])), d.value.value = "";
452
453
  };
453
- W(() => {
454
+ z(() => {
454
455
  d.value.addEventListener("change", v);
455
456
  });
456
457
  const y = (b) => {
457
- var p, g, k, x, T, w, M, C, S, R, L, D, V, B, E, G, N, ae, J, K, P, X, j, H, F, Q, ne, he, be, ve, pe, ke, Ce, $e, ye, xe, we, Te, Se, Ae, Me, Le, De;
458
+ var p, g, k, x, T, w, M, C, S, R, L, D, V, I, E, K, N, ae, J, j, q, X, _, H, B, Q, ne, he, be, ve, pe, ke, Ce, $e, ye, xe, we, Te, Se, Ae, Me, Le, De;
458
459
  if (tt.includes(b))
459
460
  switch (b) {
460
461
  case "-":
461
- return t(Vt, null, null);
462
+ return t(Pt, null, null);
462
463
  case "bold":
463
464
  return t("div", {
464
465
  class: `${n}-toolbar-item`,
@@ -513,15 +514,15 @@ const Vt = /* @__PURE__ */ O({
513
514
  }, null)])]);
514
515
  case "title":
515
516
  return t(ee, {
516
- relative: `#${i}`,
517
- visible: r.title,
517
+ relative: `#${r}`,
518
+ visible: i.title,
518
519
  onChange: ($) => {
519
- r.title = $;
520
+ i.title = $;
520
521
  },
521
522
  overlay: t("ul", {
522
523
  class: `${n}-menu`,
523
524
  onClick: () => {
524
- r.title = !1;
525
+ i.title = !1;
525
526
  }
526
527
  }, [t("li", {
527
528
  class: `${n}-menu-item`,
@@ -610,7 +611,7 @@ const Vt = /* @__PURE__ */ O({
610
611
  case "unorderedList":
611
612
  return t("div", {
612
613
  class: `${n}-toolbar-item`,
613
- title: (B = a.value.toolbarTips) == null ? void 0 : B.unorderedList,
614
+ title: (I = a.value.toolbarTips) == null ? void 0 : I.unorderedList,
614
615
  onClick: () => {
615
616
  c("unorderedList");
616
617
  }
@@ -636,7 +637,7 @@ const Vt = /* @__PURE__ */ O({
636
637
  case "task":
637
638
  return t("div", {
638
639
  class: `${n}-toolbar-item`,
639
- title: (G = a.value.toolbarTips) == null ? void 0 : G.task,
640
+ title: (K = a.value.toolbarTips) == null ? void 0 : K.task,
640
641
  onClick: () => {
641
642
  c("task");
642
643
  }
@@ -688,7 +689,7 @@ const Vt = /* @__PURE__ */ O({
688
689
  case "image":
689
690
  return e.noUploadImg ? t("div", {
690
691
  class: `${n}-toolbar-item`,
691
- title: (K = a.value.toolbarTips) == null ? void 0 : K.image,
692
+ title: (j = a.value.toolbarTips) == null ? void 0 : j.image,
692
693
  onClick: () => {
693
694
  m.type = "image", m.linkVisible = !0;
694
695
  }
@@ -698,22 +699,22 @@ const Vt = /* @__PURE__ */ O({
698
699
  }, [t("use", {
699
700
  "xlink:href": "#md-editor-icon-image"
700
701
  }, null)])]) : t(ee, {
701
- relative: `#${i}`,
702
- visible: r.image,
702
+ relative: `#${r}`,
703
+ visible: i.image,
703
704
  onChange: ($) => {
704
- r.image = $;
705
+ i.image = $;
705
706
  },
706
707
  overlay: t("ul", {
707
708
  class: `${n}-menu`,
708
709
  onClick: () => {
709
- r.title = !1;
710
+ i.title = !1;
710
711
  }
711
712
  }, [t("li", {
712
713
  class: `${n}-menu-item`,
713
714
  onClick: () => {
714
715
  m.type = "image", m.linkVisible = !0;
715
716
  }
716
- }, [(P = a.value.imgTitleItem) == null ? void 0 : P.link]), t("li", {
717
+ }, [(q = a.value.imgTitleItem) == null ? void 0 : q.link]), t("li", {
717
718
  class: `${n}-menu-item`,
718
719
  onClick: () => {
719
720
  d.value.click();
@@ -723,7 +724,7 @@ const Vt = /* @__PURE__ */ O({
723
724
  onClick: () => {
724
725
  m.clipVisible = !0;
725
726
  }
726
- }, [(j = a.value.imgTitleItem) == null ? void 0 : j.clip2upload])])
727
+ }, [(_ = a.value.imgTitleItem) == null ? void 0 : _.clip2upload])])
727
728
  }, {
728
729
  default: () => {
729
730
  var $;
@@ -740,13 +741,13 @@ const Vt = /* @__PURE__ */ O({
740
741
  });
741
742
  case "table":
742
743
  return t(ee, {
743
- relative: `#${i}`,
744
- visible: r.table,
744
+ relative: `#${r}`,
745
+ visible: i.table,
745
746
  onChange: ($) => {
746
- r.table = $;
747
+ i.table = $;
747
748
  },
748
749
  key: "bar-table",
749
- overlay: t(Ut, {
750
+ overlay: t(Kt, {
750
751
  tableShape: e.tableShape,
751
752
  onSelected: ($) => {
752
753
  c("table", {
@@ -784,7 +785,7 @@ const Vt = /* @__PURE__ */ O({
784
785
  case "next":
785
786
  return t("div", {
786
787
  class: `${n}-toolbar-item`,
787
- title: (F = a.value.toolbarTips) == null ? void 0 : F.next,
788
+ title: (B = a.value.toolbarTips) == null ? void 0 : B.next,
788
789
  onClick: () => {
789
790
  h.emit(o, "ctrlShiftZ");
790
791
  }
@@ -899,15 +900,15 @@ const Vt = /* @__PURE__ */ O({
899
900
  }, null)])]);
900
901
  case "mermaid":
901
902
  return t(ee, {
902
- relative: `#${i}`,
903
- visible: r.mermaid,
903
+ relative: `#${r}`,
904
+ visible: i.mermaid,
904
905
  onChange: ($) => {
905
- r.mermaid = $;
906
+ i.mermaid = $;
906
907
  },
907
908
  overlay: t("ul", {
908
909
  class: `${n}-menu`,
909
910
  onClick: () => {
910
- r.mermaid = !1;
911
+ i.mermaid = !1;
911
912
  }
912
913
  }, [t("li", {
913
914
  class: `${n}-menu-item`,
@@ -967,15 +968,15 @@ const Vt = /* @__PURE__ */ O({
967
968
  });
968
969
  case "katex":
969
970
  return t(ee, {
970
- relative: `#${i}`,
971
- visible: r.katex,
971
+ relative: `#${r}`,
972
+ visible: i.katex,
972
973
  onChange: ($) => {
973
- r.katex = $;
974
+ i.katex = $;
974
975
  },
975
976
  overlay: t("ul", {
976
977
  class: `${n}-menu`,
977
978
  onClick: () => {
978
- r.katex = !1;
979
+ i.katex = !1;
979
980
  }
980
981
  }, [t("li", {
981
982
  class: `${n}-menu-item`,
@@ -1011,7 +1012,7 @@ const Vt = /* @__PURE__ */ O({
1011
1012
  const b = u.value[0].map((g) => y(g)), p = u.value[1].map((g) => y(g));
1012
1013
  return t(Ke, null, [e.toolbars.length > 0 && t("div", {
1013
1014
  class: `${n}-toolbar-wrapper`,
1014
- id: i
1015
+ id: r
1015
1016
  }, [t("div", {
1016
1017
  class: `${n}-toolbar`
1017
1018
  }, [t("div", {
@@ -1027,7 +1028,7 @@ const Vt = /* @__PURE__ */ O({
1027
1028
  style: {
1028
1029
  display: "none"
1029
1030
  }
1030
- }, null), t(zt, {
1031
+ }, null), t(Zt, {
1031
1032
  linkVisible: m.linkVisible,
1032
1033
  clipVisible: m.clipVisible,
1033
1034
  type: m.type,
@@ -1043,12 +1044,12 @@ const Vt = /* @__PURE__ */ O({
1043
1044
  }, null)]);
1044
1045
  };
1045
1046
  }
1046
- }), Zt = (e, o) => {
1047
+ }), Xt = (e, o) => {
1047
1048
  const a = rt(() => {
1048
1049
  e.removeEventListener("scroll", l), e.addEventListener("scroll", l), o.removeEventListener("scroll", l), o.addEventListener("scroll", l);
1049
- }, 50), l = (i) => {
1050
- const r = e.clientHeight, c = o.clientHeight, m = e.scrollHeight, f = o.scrollHeight, u = (m - r) / (f - c);
1051
- i.target === e ? (o.removeEventListener("scroll", l), o.scrollTo({
1050
+ }, 50), l = (r) => {
1051
+ const i = e.clientHeight, c = o.clientHeight, m = e.scrollHeight, f = o.scrollHeight, u = (m - i) / (f - c);
1052
+ r.target === e ? (o.removeEventListener("scroll", l), o.scrollTo({
1052
1053
  top: e.scrollTop / u
1053
1054
  // behavior: 'smooth'
1054
1055
  }), a()) : (e.removeEventListener("scroll", l), e.scrollTo({
@@ -1066,8 +1067,8 @@ const Vt = /* @__PURE__ */ O({
1066
1067
  e.removeEventListener("scroll", l), o.removeEventListener("scroll", l);
1067
1068
  }
1068
1069
  ];
1069
- }, Jt = (e, o, a) => {
1070
- const { view: l } = a, i = (v) => l.lineBlockAt(l.state.doc.line(v).from).top, r = (v) => l.lineBlockAt(l.state.doc.line(v).from).height;
1070
+ }, Qt = (e, o, a) => {
1071
+ const { view: l } = a, r = (v) => l.lineBlockAt(l.state.doc.line(v).from).top, i = (v) => l.lineBlockAt(l.state.doc.line(v).from).height;
1071
1072
  let c = [];
1072
1073
  const m = () => {
1073
1074
  c = [];
@@ -1092,13 +1093,13 @@ const Vt = /* @__PURE__ */ O({
1092
1093
  if (u !== 0)
1093
1094
  return;
1094
1095
  f++;
1095
- const C = c[b - 1], S = i(C.end) + r(C.end);
1096
+ const C = c[b - 1], S = r(C.end) + i(C.end);
1096
1097
  let R = 0;
1097
- const L = i(C.start), D = o.querySelector(`[data-line="${C.start - 1}"]`) || ((g = o.firstElementChild) == null ? void 0 : g.firstElementChild), V = o.querySelector(`[data-line="${C.end}"]`) || ((k = o.lastElementChild) == null ? void 0 : k.lastElementChild);
1098
- let B = 0, E = 0;
1099
- L === 0 ? (R = (l.scrollDOM.scrollTop - L) / (S - L), B = V.offsetTop) : S > l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight ? (R = (l.scrollDOM.scrollTop - L) / (l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight - L), E = D.offsetTop, B = o.scrollHeight - o.clientHeight - E + 10) : (R = (l.scrollDOM.scrollTop - L) / (S - L), E = D.offsetTop, B = V.offsetTop - E);
1100
- const G = E - 10 + B * R;
1101
- Ee(o, G, () => {
1098
+ const L = r(C.start), D = o.querySelector(`[data-line="${C.start - 1}"]`) || ((g = o.firstElementChild) == null ? void 0 : g.firstElementChild), V = o.querySelector(`[data-line="${C.end}"]`) || ((k = o.lastElementChild) == null ? void 0 : k.lastElementChild);
1099
+ let I = 0, E = 0;
1100
+ L === 0 ? (R = (l.scrollDOM.scrollTop - L) / (S - L), I = V.offsetTop) : S > l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight ? (R = (l.scrollDOM.scrollTop - L) / (l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight - L), E = D.offsetTop, I = o.scrollHeight - o.clientHeight - E + 10) : (R = (l.scrollDOM.scrollTop - L) / (S - L), E = D.offsetTop, I = V.offsetTop - E);
1101
+ const K = E - 10 + I * R;
1102
+ Ee(o, K, () => {
1102
1103
  f--;
1103
1104
  });
1104
1105
  } else {
@@ -1112,51 +1113,51 @@ const Vt = /* @__PURE__ */ O({
1112
1113
  Number(C[C.length - 1].dataset.line) * (S / R)
1113
1114
  ), D = (x = o.firstElementChild) == null ? void 0 : x.firstElementChild;
1114
1115
  for (let H = L; H >= 0; H--) {
1115
- const F = o.querySelector(`[data-line="${H}"]`);
1116
- if (F && F.offsetTop <= S) {
1117
- D = F, L = H;
1116
+ const B = o.querySelector(`[data-line="${H}"]`);
1117
+ if (B && B.offsetTop <= S) {
1118
+ D = B, L = H;
1118
1119
  break;
1119
1120
  }
1120
1121
  }
1121
- let V = (T = o.firstElementChild) == null ? void 0 : T.firstElementChild, B = (w = o.firstElementChild) == null ? void 0 : w.lastElementChild;
1122
+ let V = (T = o.firstElementChild) == null ? void 0 : T.firstElementChild, I = (w = o.firstElementChild) == null ? void 0 : w.lastElementChild;
1122
1123
  for (; C.length > 0; ) {
1123
1124
  const H = C.indexOf(D);
1124
1125
  if (H + 1 >= C.length)
1125
1126
  break;
1126
- const F = C[H + 1];
1127
+ const B = C[H + 1];
1127
1128
  if (H === -1) {
1128
- B = F;
1129
+ I = B;
1129
1130
  break;
1130
1131
  }
1131
1132
  const Q = D.offsetTop;
1132
1133
  if (Q > S) {
1133
1134
  if (H === 0) {
1134
- V = D, B = F;
1135
+ V = D, I = B;
1135
1136
  break;
1136
1137
  }
1137
1138
  D = C[H - 1];
1138
1139
  continue;
1139
1140
  }
1140
- const ne = F.offsetTop;
1141
+ const ne = B.offsetTop;
1141
1142
  if (Q <= S && ne > S) {
1142
- V = D, B = F;
1143
+ V = D, I = B;
1143
1144
  break;
1144
1145
  }
1145
- D = F;
1146
+ D = B;
1146
1147
  }
1147
- const E = V.offsetTop, G = B.offsetTop;
1148
+ const E = V.offsetTop, K = I.offsetTop;
1148
1149
  let N = 0;
1149
- const { start: ae, end: J } = c[Number(V.dataset.line || 0)], K = i(ae);
1150
- let P = i(J);
1151
- const X = r(J);
1152
- let j = 0;
1153
- V === ((M = o.firstElementChild) == null ? void 0 : M.firstElementChild) ? (N = Math.max(S / G, 0), j = P + X - K) : P > l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight ? (N = Math.max(
1150
+ const { start: ae, end: J } = c[Number(V.dataset.line || 0)], j = r(ae);
1151
+ let q = r(J);
1152
+ const X = i(J);
1153
+ let _ = 0;
1154
+ V === ((M = o.firstElementChild) == null ? void 0 : M.firstElementChild) ? (N = Math.max(S / K, 0), _ = q + X - j) : q > l.scrollDOM.scrollHeight - l.scrollDOM.clientHeight ? (N = Math.max(
1154
1155
  (S - E) / (o.scrollHeight - E - o.clientHeight),
1155
1156
  0
1156
- ), P = i(l.state.doc.lines) + r(l.state.doc.lines), j = 8 + P - K - e.clientHeight) : (N = Math.max(
1157
- (S - E) / (G - E),
1157
+ ), q = r(l.state.doc.lines) + i(l.state.doc.lines), _ = 8 + q - j - e.clientHeight) : (N = Math.max(
1158
+ (S - E) / (K - E),
1158
1159
  0
1159
- ), j = P + X - K), Ee(e, K + j * N, () => {
1160
+ ), _ = q + X - j), Ee(e, j + _ * N, () => {
1160
1161
  u--;
1161
1162
  });
1162
1163
  }
@@ -1169,25 +1170,25 @@ const Vt = /* @__PURE__ */ O({
1169
1170
  c = [], e.removeEventListener("scroll", d), o.removeEventListener("scroll", d);
1170
1171
  }
1171
1172
  ];
1172
- }, Xt = (e, o, a) => {
1173
+ }, el = (e, o, a) => {
1173
1174
  const l = A("editorId");
1174
- let i = () => {
1175
- }, r = () => {
1175
+ let r = () => {
1176
+ }, i = () => {
1176
1177
  };
1177
1178
  const c = () => {
1178
- i();
1179
+ r();
1179
1180
  const m = document.querySelector(".cm-scroller"), f = document.querySelector(
1180
1181
  `[id="${l}-preview-wrapper"][data-show="true"]`
1181
1182
  ), u = document.querySelector(
1182
1183
  `[id="${l}-html-wrapper"][data-show="true"]`
1183
1184
  );
1184
- (f || u) && ([r, i] = (f ? Jt : Zt)(
1185
+ (f || u) && ([i, r] = (f ? Qt : Xt)(
1185
1186
  m,
1186
1187
  f || u,
1187
1188
  a.value
1188
- )), e.scrollAuto && r();
1189
+ )), e.scrollAuto && i();
1189
1190
  };
1190
- I(
1191
+ F(
1191
1192
  [
1192
1193
  o,
1193
1194
  te(e.setting, "preview"),
@@ -1198,22 +1199,22 @@ const Vt = /* @__PURE__ */ O({
1198
1199
  () => {
1199
1200
  me(c);
1200
1201
  }
1201
- ), I(
1202
+ ), F(
1202
1203
  () => e.scrollAuto,
1203
1204
  (m) => {
1204
- m ? r() : i();
1205
+ m ? i() : r();
1205
1206
  }
1206
- ), W(c);
1207
- }, Qt = Xt, el = (e, o, a) => {
1207
+ ), z(c);
1208
+ }, tl = el, ll = (e, o, a) => {
1208
1209
  var d, v, y, b, p, g;
1209
- let l = "", i = 0, r = 0, c = !0, m = !1;
1210
- const f = o.getSelectedText(), u = (d = _.editorConfig) == null ? void 0 : d.mermaidTemplate;
1210
+ let l = "", r = 0, i = 0, c = !0, m = !1;
1211
+ const f = o.getSelectedText(), u = (d = W.editorConfig) == null ? void 0 : d.mermaidTemplate;
1211
1212
  if (/^h[1-6]{1}$/.test(e)) {
1212
1213
  const k = e.replace(/^h(\d)/, (x, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1213
- l = `${k} ${f}`, i = k.length + 1;
1214
+ l = `${k} ${f}`, r = k.length + 1;
1214
1215
  } else if (e === "prettier") {
1215
- const k = window.prettier || ((y = (v = _.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : y.prettierInstance), x = [
1216
- ((b = window.prettierPlugins) == null ? void 0 : b.markdown) || ((g = (p = _.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : g.parserMarkdownInstance)
1216
+ const k = window.prettier || ((y = (v = W.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : y.prettierInstance), x = [
1217
+ ((b = window.prettierPlugins) == null ? void 0 : b.markdown) || ((g = (p = W.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : g.parserMarkdownInstance)
1217
1218
  ];
1218
1219
  !k || x[0] === void 0 ? (h.emit(a.editorId, "errorCatcher", {
1219
1220
  name: "prettier",
@@ -1225,47 +1226,47 @@ const Vt = /* @__PURE__ */ O({
1225
1226
  } else
1226
1227
  switch (e) {
1227
1228
  case "bold": {
1228
- l = `**${f}**`, i = 2, r = -2;
1229
+ l = `**${f}**`, r = 2, i = -2;
1229
1230
  break;
1230
1231
  }
1231
1232
  case "underline": {
1232
- l = `<u>${f}</u>`, i = 3, r = -4;
1233
+ l = `<u>${f}</u>`, r = 3, i = -4;
1233
1234
  break;
1234
1235
  }
1235
1236
  case "italic": {
1236
- l = `*${f}*`, i = 1, r = -1;
1237
+ l = `*${f}*`, r = 1, i = -1;
1237
1238
  break;
1238
1239
  }
1239
1240
  case "strikeThrough": {
1240
- l = `~~${f}~~`, i = 2, r = -2;
1241
+ l = `~~${f}~~`, r = 2, i = -2;
1241
1242
  break;
1242
1243
  }
1243
1244
  case "sub": {
1244
- l = `<sub>${f}</sub>`, i = 5, r = -6;
1245
+ l = `<sub>${f}</sub>`, r = 5, i = -6;
1245
1246
  break;
1246
1247
  }
1247
1248
  case "sup": {
1248
- l = `<sup>${f}</sup>`, i = 5, r = -6;
1249
+ l = `<sup>${f}</sup>`, r = 5, i = -6;
1249
1250
  break;
1250
1251
  }
1251
1252
  case "codeRow": {
1252
- l = "`" + f + "`", i = 1, r = -1;
1253
+ l = "`" + f + "`", r = 1, i = -1;
1253
1254
  break;
1254
1255
  }
1255
1256
  case "quote": {
1256
- l = `> ${f}`, i = 2;
1257
+ l = `> ${f}`, r = 2;
1257
1258
  break;
1258
1259
  }
1259
1260
  case "orderedList": {
1260
- l = `1. ${f}`, i = 3;
1261
+ l = `1. ${f}`, r = 3;
1261
1262
  break;
1262
1263
  }
1263
1264
  case "unorderedList": {
1264
- l = `- ${f}`, i = 2;
1265
+ l = `- ${f}`, r = 2;
1265
1266
  break;
1266
1267
  }
1267
1268
  case "task": {
1268
- l = `- [ ] ${f}`, i = 6;
1269
+ l = `- [ ] ${f}`, r = 6;
1269
1270
  break;
1270
1271
  }
1271
1272
  case "code": {
@@ -1273,7 +1274,7 @@ const Vt = /* @__PURE__ */ O({
1273
1274
  l = `\`\`\`${x}
1274
1275
  ${k}
1275
1276
  \`\`\`
1276
- `, i = 3, r = 3 + x.length - l.length;
1277
+ `, r = 3, i = 3 + x.length - l.length;
1277
1278
  break;
1278
1279
  }
1279
1280
  case "table": {
@@ -1291,7 +1292,7 @@ ${k}
1291
1292
  for (let M = 0; M <= T; M++)
1292
1293
  l += " content |";
1293
1294
  }
1294
- i = 2, r = 5 - l.length;
1295
+ r = 2, i = 5 - l.length;
1295
1296
  break;
1296
1297
  }
1297
1298
  case "link": {
@@ -1311,7 +1312,7 @@ ${k}
1311
1312
  ${(u == null ? void 0 : u.flow) || `flowchart TD
1312
1313
  Start --> Stop`}
1313
1314
  \`\`\`
1314
- `, i = 3, r = 10 - l.length;
1315
+ `, r = 3, i = 10 - l.length;
1315
1316
  break;
1316
1317
  }
1317
1318
  case "sequence": {
@@ -1321,7 +1322,7 @@ ${(u == null ? void 0 : u.sequence) || `sequenceDiagram
1321
1322
  B-->>A: hi!
1322
1323
  A-)B: bye!`}
1323
1324
  \`\`\`
1324
- `, i = 3, r = 10 - l.length;
1325
+ `, r = 3, i = 10 - l.length;
1325
1326
  break;
1326
1327
  }
1327
1328
  case "gantt": {
@@ -1333,7 +1334,7 @@ section Section
1333
1334
  A task :a1, 2014-01-01, 30d
1334
1335
  Another task :after a1, 20d`}
1335
1336
  \`\`\`
1336
- `, i = 3, r = 10 - l.length;
1337
+ `, r = 3, i = 10 - l.length;
1337
1338
  break;
1338
1339
  }
1339
1340
  case "class": {
@@ -1342,7 +1343,7 @@ ${(u == null ? void 0 : u.class) || `classDiagram
1342
1343
  class Animal
1343
1344
  Vehicle <|-- Car`}
1344
1345
  \`\`\`
1345
- `, i = 3, r = 10 - l.length;
1346
+ `, r = 3, i = 10 - l.length;
1346
1347
  break;
1347
1348
  }
1348
1349
  case "state": {
@@ -1350,7 +1351,7 @@ ${(u == null ? void 0 : u.class) || `classDiagram
1350
1351
  ${(u == null ? void 0 : u.state) || `stateDiagram-v2
1351
1352
  s1 --> s2`}
1352
1353
  \`\`\`
1353
- `, i = 3, r = 10 - l.length;
1354
+ `, r = 3, i = 10 - l.length;
1354
1355
  break;
1355
1356
  }
1356
1357
  case "pie": {
@@ -1360,7 +1361,7 @@ ${(u == null ? void 0 : u.pie) || `pie title Pets adopted by volunteers
1360
1361
  "Cats" : 85
1361
1362
  "Rats" : 15`}
1362
1363
  \`\`\`
1363
- `, i = 3, r = 10 - l.length;
1364
+ `, r = 3, i = 10 - l.length;
1364
1365
  break;
1365
1366
  }
1366
1367
  case "relationship": {
@@ -1369,7 +1370,7 @@ ${(u == null ? void 0 : u.relationship) || `erDiagram
1369
1370
  CAR ||--o{ NAMED-DRIVER : allows
1370
1371
  PERSON ||--o{ NAMED-DRIVER : is`}
1371
1372
  \`\`\`
1372
- `, i = 3, r = 10 - l.length;
1373
+ `, r = 3, i = 10 - l.length;
1373
1374
  break;
1374
1375
  }
1375
1376
  case "journey": {
@@ -1384,23 +1385,23 @@ ${(u == null ? void 0 : u.journey) || `journey
1384
1385
  Go downstairs: 5: Me
1385
1386
  Sit down: 5: Me`}
1386
1387
  \`\`\`
1387
- `, i = 3, r = 10 - l.length;
1388
+ `, r = 3, i = 10 - l.length;
1388
1389
  break;
1389
1390
  }
1390
1391
  case "katexInline": {
1391
- l = "$$", i = 1, r = -1;
1392
+ l = "$$", r = 1, i = -1;
1392
1393
  break;
1393
1394
  }
1394
1395
  case "katexBlock": {
1395
1396
  l = `$$
1396
1397
 
1397
1398
  $$
1398
- `, i = 3, r = -4;
1399
+ `, r = 3, i = -4;
1399
1400
  break;
1400
1401
  }
1401
1402
  case "universal": {
1402
1403
  const { generate: k } = a, x = k(f);
1403
- l = x.targetValue, c = x.select, i = x.deviationStart, r = x.deviationEnd;
1404
+ l = x.targetValue, c = x.select, r = x.deviationStart, i = x.deviationEnd;
1404
1405
  }
1405
1406
  }
1406
1407
  return {
@@ -1409,14 +1410,14 @@ $$
1409
1410
  // 是否选中
1410
1411
  select: c,
1411
1412
  // 选中时,开始位置的偏移量
1412
- deviationStart: i,
1413
+ deviationStart: r,
1413
1414
  // 结束的偏移量
1414
- deviationEnd: r,
1415
+ deviationEnd: i,
1415
1416
  // 是否整个替换
1416
1417
  replaceAll: m
1417
1418
  }
1418
1419
  };
1419
- }, tl = "#e5c07b", Be = "var(--md-color)", ll = "#56b6c2", ol = "#ffffff", le = "var(--md-color)", Fe = "#e5c07b", al = "#e5c07b", nl = "var(--md-color)", Ie = "#d19a66", rl = "#c678dd", il = "#21252b", sl = "#2c313a", Oe = "var(--md-bk-color)", ce = "var(--md-bk-color)", cl = "#ceedfa33", Ve = "#528bff", dl = ge.theme(
1420
+ }, ol = "#e5c07b", Ie = "var(--md-color)", al = "#56b6c2", nl = "#ffffff", le = "var(--md-color)", Be = "#e5c07b", rl = "#e5c07b", il = "var(--md-color)", Fe = "#d19a66", sl = "#c678dd", cl = "#21252b", dl = "#2c313a", Oe = "var(--md-bk-color)", ce = "var(--md-bk-color)", ul = "#ceedfa33", Ve = "#528bff", ml = ge.theme(
1420
1421
  {
1421
1422
  "&": {
1422
1423
  color: le,
@@ -1426,8 +1427,8 @@ $$
1426
1427
  caretColor: Ve
1427
1428
  },
1428
1429
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: Ve },
1429
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: cl },
1430
- ".cm-panels": { backgroundColor: il, color: le },
1430
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: ul },
1431
+ ".cm-panels": { backgroundColor: cl, color: le },
1431
1432
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1432
1433
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1433
1434
  ".cm-searchMatch": {
@@ -1449,7 +1450,7 @@ $$
1449
1450
  borderColor: "var(--md-border-color)"
1450
1451
  },
1451
1452
  ".cm-activeLineGutter": {
1452
- backgroundColor: sl
1453
+ backgroundColor: dl
1453
1454
  },
1454
1455
  ".cm-foldPlaceholder": {
1455
1456
  backgroundColor: "transparent",
@@ -1475,11 +1476,11 @@ $$
1475
1476
  }
1476
1477
  },
1477
1478
  { dark: !0 }
1478
- ), ul = We.define([
1479
- { tag: s.keyword, color: rl },
1480
- { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: Be },
1481
- { tag: [s.function(s.variableName), s.labelName], color: al },
1482
- { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: Ie },
1479
+ ), fl = We.define([
1480
+ { tag: s.keyword, color: sl },
1481
+ { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: Ie },
1482
+ { tag: [s.function(s.variableName), s.labelName], color: rl },
1483
+ { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: Fe },
1483
1484
  { tag: [s.definition(s.name), s.separator], color: le },
1484
1485
  {
1485
1486
  tag: [
@@ -1492,7 +1493,7 @@ $$
1492
1493
  s.self,
1493
1494
  s.namespace
1494
1495
  ],
1495
- color: tl
1496
+ color: ol
1496
1497
  },
1497
1498
  {
1498
1499
  tag: [
@@ -1504,21 +1505,21 @@ $$
1504
1505
  s.link,
1505
1506
  s.special(s.string)
1506
1507
  ],
1507
- color: ll
1508
+ color: al
1508
1509
  },
1509
- { tag: [s.meta, s.comment], color: Fe },
1510
+ { tag: [s.meta, s.comment], color: Be },
1510
1511
  { tag: s.strong, fontWeight: "bold" },
1511
1512
  { tag: s.emphasis, fontStyle: "italic" },
1512
1513
  { tag: s.strikethrough, textDecoration: "line-through" },
1513
- { tag: s.link, color: Fe, textDecoration: "underline" },
1514
- { tag: s.heading, fontWeight: "bold", color: Be },
1515
- { tag: [s.atom, s.bool, s.special(s.variableName)], color: Ie },
1516
- { tag: [s.processingInstruction, s.string, s.inserted], color: nl },
1517
- { tag: s.invalid, color: ol }
1518
- ]), ml = [
1519
- dl,
1520
- ze(ul)
1521
- ], fl = "#e5c07b", Re = "#3f4a54", gl = "#56b6c2", hl = "#fff", oe = "#3f4a54", Ne = "#2d8cf0", bl = "#2d8cf0", vl = "#3f4a54", Pe = "#d19a66", pl = "#c678dd", kl = "#21252b", Cl = "#ceedfa33", qe = "var(--md-bk-color)", de = "var(--md-bk-color)", $l = "#bad5fa", Ue = "#3f4a54", yl = ge.theme(
1514
+ { tag: s.link, color: Be, textDecoration: "underline" },
1515
+ { tag: s.heading, fontWeight: "bold", color: Ie },
1516
+ { tag: [s.atom, s.bool, s.special(s.variableName)], color: Fe },
1517
+ { tag: [s.processingInstruction, s.string, s.inserted], color: il },
1518
+ { tag: s.invalid, color: nl }
1519
+ ]), gl = [
1520
+ ml,
1521
+ ze(fl)
1522
+ ], hl = "#e5c07b", Re = "#3f4a54", bl = "#56b6c2", vl = "#fff", oe = "#3f4a54", Pe = "#2d8cf0", pl = "#2d8cf0", kl = "#3f4a54", Ne = "#d19a66", Cl = "#c678dd", $l = "#21252b", yl = "#ceedfa33", qe = "var(--md-bk-color)", de = "var(--md-bk-color)", xl = "#bad5fa", Ue = "#3f4a54", wl = ge.theme(
1522
1523
  {
1523
1524
  "&": {
1524
1525
  color: oe,
@@ -1528,8 +1529,8 @@ $$
1528
1529
  caretColor: Ue
1529
1530
  },
1530
1531
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: Ue },
1531
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: $l },
1532
- ".cm-panels": { backgroundColor: kl, color: oe },
1532
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: xl },
1533
+ ".cm-panels": { backgroundColor: $l, color: oe },
1533
1534
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1534
1535
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1535
1536
  ".cm-searchMatch": {
@@ -1551,7 +1552,7 @@ $$
1551
1552
  borderColor: "var(--md-border-color)"
1552
1553
  },
1553
1554
  ".cm-activeLineGutter": {
1554
- backgroundColor: Cl
1555
+ backgroundColor: yl
1555
1556
  },
1556
1557
  ".cm-foldPlaceholder": {
1557
1558
  backgroundColor: "transparent",
@@ -1577,11 +1578,11 @@ $$
1577
1578
  }
1578
1579
  }
1579
1580
  // { dark: true }
1580
- ), xl = We.define([
1581
- { tag: s.keyword, color: pl },
1581
+ ), Tl = We.define([
1582
+ { tag: s.keyword, color: Cl },
1582
1583
  { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: Re },
1583
- { tag: [s.function(s.variableName), s.labelName], color: bl },
1584
- { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: Pe },
1584
+ { tag: [s.function(s.variableName), s.labelName], color: pl },
1585
+ { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: Ne },
1585
1586
  { tag: [s.definition(s.name), s.separator], color: oe },
1586
1587
  {
1587
1588
  tag: [
@@ -1594,7 +1595,7 @@ $$
1594
1595
  s.self,
1595
1596
  s.namespace
1596
1597
  ],
1597
- color: fl
1598
+ color: hl
1598
1599
  },
1599
1600
  {
1600
1601
  tag: [
@@ -1606,40 +1607,40 @@ $$
1606
1607
  s.link,
1607
1608
  s.special(s.string)
1608
1609
  ],
1609
- color: gl
1610
+ color: bl
1610
1611
  },
1611
- { tag: [s.meta, s.comment], color: Ne },
1612
+ { tag: [s.meta, s.comment], color: Pe },
1612
1613
  { tag: s.strong, fontWeight: "bold" },
1613
1614
  { tag: s.emphasis, fontStyle: "italic" },
1614
1615
  { tag: s.strikethrough, textDecoration: "line-through" },
1615
- { tag: s.link, color: Ne, textDecoration: "underline" },
1616
+ { tag: s.link, color: Pe, textDecoration: "underline" },
1616
1617
  { tag: s.heading, fontWeight: "bold", color: Re },
1617
- { tag: [s.atom, s.bool, s.special(s.variableName)], color: Pe },
1618
- { tag: [s.processingInstruction, s.string, s.inserted], color: vl },
1619
- { tag: s.invalid, color: hl }
1620
- ]), wl = [
1621
- yl,
1622
- ze(xl)
1623
- ], ie = (e, o, a, l, i) => (r, c, m, f) => {
1618
+ { tag: [s.atom, s.bool, s.special(s.variableName)], color: Ne },
1619
+ { tag: [s.processingInstruction, s.string, s.inserted], color: kl },
1620
+ { tag: s.invalid, color: vl }
1621
+ ]), Sl = [
1622
+ wl,
1623
+ ze(Tl)
1624
+ ], ie = (e, o, a, l, r) => (i, c, m, f) => {
1624
1625
  const u = `${e}${o}`.slice(f - m);
1625
- r.dispatch(r.state.replaceSelection(`${u}${a}${l}`));
1626
- const d = m + c.label.length + (i === "title" ? a.length : 0);
1627
- r.dispatch({
1628
- selection: Y.create(
1626
+ i.dispatch(i.state.replaceSelection(`${u}${a}${l}`));
1627
+ const d = m + c.label.length + (r === "title" ? a.length : 0);
1628
+ i.dispatch({
1629
+ selection: P.create(
1629
1630
  [
1630
- Y.range(
1631
- m + c.label.length + (i === "title" ? 1 : -o.length),
1631
+ P.range(
1632
+ m + c.label.length + (r === "title" ? 1 : -o.length),
1632
1633
  d
1633
1634
  ),
1634
- Y.cursor(d)
1635
+ P.cursor(d)
1635
1636
  ],
1636
1637
  1
1637
1638
  )
1638
- }), r.focus();
1639
- }, Ge = (e) => (o, a, l, i) => {
1640
- const r = e.slice(i - l);
1641
- o.dispatch(o.state.replaceSelection(`${r} `));
1642
- }, Tl = (e) => {
1639
+ }), i.focus();
1640
+ }, Ge = (e) => (o, a, l, r) => {
1641
+ const i = e.slice(r - l);
1642
+ o.dispatch(o.state.replaceSelection(`${i} `));
1643
+ }, Al = (e) => {
1643
1644
  const o = (a) => {
1644
1645
  const l = a.matchBefore(
1645
1646
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
@@ -1648,8 +1649,8 @@ $$
1648
1649
  from: l.from,
1649
1650
  options: [
1650
1651
  // 标题
1651
- ...["h1", "h2", "h3", "h4", "h5", "h6"].map((i, r) => {
1652
- const c = new Array(r + 1).fill("#").join("");
1652
+ ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
1653
+ const c = new Array(i + 1).fill("#").join("");
1653
1654
  return {
1654
1655
  label: c,
1655
1656
  type: "text",
@@ -1657,12 +1658,12 @@ $$
1657
1658
  };
1658
1659
  }),
1659
1660
  // 任务列表
1660
- ...["unchecked", "checked"].map((i) => {
1661
- const r = i === "checked" ? "- [x]" : "- [ ]";
1661
+ ...["unchecked", "checked"].map((r) => {
1662
+ const i = r === "checked" ? "- [x]" : "- [ ]";
1662
1663
  return {
1663
- label: r,
1664
+ label: i,
1664
1665
  type: "text",
1665
- apply: Ge(r)
1666
+ apply: Ge(i)
1666
1667
  };
1667
1668
  }),
1668
1669
  // 代码
@@ -1670,10 +1671,10 @@ $$
1670
1671
  ["`", ""],
1671
1672
  ["```", "language"],
1672
1673
  ["```mermaid\n", ""]
1673
- ].map((i) => ({
1674
- label: `${i[0]}${i[1]}`,
1674
+ ].map((r) => ({
1675
+ label: `${r[0]}${r[1]}`,
1675
1676
  type: "text",
1676
- apply: ie(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
1677
+ apply: ie(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1677
1678
  })),
1678
1679
  // 链接
1679
1680
  {
@@ -1725,39 +1726,39 @@ $$`, "title")
1725
1726
  "caution",
1726
1727
  "error",
1727
1728
  "attention"
1728
- ].map((i) => ({
1729
- label: `!!! ${i}`,
1729
+ ].map((r) => ({
1730
+ label: `!!! ${r}`,
1730
1731
  type: "text",
1731
- apply: ie("!!!", ` ${i}`, " Title", `
1732
+ apply: ie("!!!", ` ${r}`, " Title", `
1732
1733
 
1733
1734
  !!!`, "title")
1734
1735
  }))
1735
1736
  ]
1736
1737
  };
1737
1738
  };
1738
- return It({
1739
- override: e ? [o, ...e] : [o]
1739
+ return Vt({
1740
+ override: e ? [o, Mt, ...e] : [o]
1740
1741
  });
1741
- }, Sl = Tl, z = (e) => {
1742
- const o = new Bt();
1742
+ }, Ml = Al, Y = (e) => {
1743
+ const o = new Ft();
1743
1744
  return (l) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(l) }) : e.dispatch({
1744
- effects: Ft.appendConfig.of(o.of(l))
1745
+ effects: Ot.appendConfig.of(o.of(l))
1745
1746
  }), !0);
1746
1747
  };
1747
- class Al {
1748
+ class Ll {
1748
1749
  constructor(o) {
1749
- q(this, "view");
1750
+ U(this, "view");
1750
1751
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
1751
- q(this, "toggleTabSize");
1752
- q(this, "togglePlaceholder");
1752
+ U(this, "toggleTabSize");
1753
+ U(this, "togglePlaceholder");
1753
1754
  /**
1754
1755
  * 设置全部的扩展
1755
1756
  */
1756
- q(this, "setExtensions");
1757
- q(this, "toggleDisabled");
1758
- q(this, "toggleReadOnly");
1759
- q(this, "toggleMaxlength");
1760
- this.view = o, 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);
1757
+ U(this, "setExtensions");
1758
+ U(this, "toggleDisabled");
1759
+ U(this, "toggleReadOnly");
1760
+ U(this, "toggleMaxlength");
1761
+ this.view = o, this.toggleTabSize = Y(this.view), this.togglePlaceholder = Y(this.view), this.setExtensions = Y(this.view), this.toggleDisabled = Y(this.view), this.toggleReadOnly = Y(this.view), this.toggleMaxlength = Y(this.view);
1761
1762
  }
1762
1763
  getValue() {
1763
1764
  return this.view.state.doc.toString();
@@ -1807,12 +1808,12 @@ class Al {
1807
1808
  }
1808
1809
  const { from: l } = this.view.state.selection.main;
1809
1810
  if (this.view.dispatch(this.view.state.replaceSelection(o)), a.select) {
1810
- const i = l + o.length + a.deviationEnd;
1811
+ const r = l + o.length + a.deviationEnd;
1811
1812
  this.view.dispatch({
1812
- selection: Y.create(
1813
+ selection: P.create(
1813
1814
  [
1814
- Y.range(l + a.deviationStart, i),
1815
- Y.cursor(i)
1815
+ P.range(l + a.deviationStart, r),
1816
+ P.cursor(r)
1816
1817
  ],
1817
1818
  1
1818
1819
  )
@@ -1827,7 +1828,7 @@ class Al {
1827
1828
  setTabSize(o) {
1828
1829
  this.toggleTabSize([
1829
1830
  se.tabSize.of(o),
1830
- Ht.of(" ".repeat(o))
1831
+ Bt.of(" ".repeat(o))
1831
1832
  ]);
1832
1833
  }
1833
1834
  /**
@@ -1838,8 +1839,27 @@ class Al {
1838
1839
  setPlaceholder(o) {
1839
1840
  this.togglePlaceholder(wt(o));
1840
1841
  }
1841
- focus() {
1842
- this.view.focus();
1842
+ focus(o) {
1843
+ if (this.view.focus(), !o)
1844
+ return;
1845
+ let a = 0, l = 0, r = 0;
1846
+ switch (o) {
1847
+ case "start":
1848
+ break;
1849
+ case "end": {
1850
+ a = l = r = this.getValue().length;
1851
+ break;
1852
+ }
1853
+ default:
1854
+ a = o.rangeAnchor || o.cursorPos, l = o.rangeHead || o.cursorPos, r = o.cursorPos;
1855
+ }
1856
+ this.view.dispatch({
1857
+ scrollIntoView: !0,
1858
+ selection: P.create(
1859
+ [P.range(a, l), P.cursor(r)],
1860
+ 1
1861
+ )
1862
+ });
1843
1863
  }
1844
1864
  setDisabled(o) {
1845
1865
  this.toggleDisabled([ge.editable.of(!o)]);
@@ -1853,39 +1873,39 @@ class Al {
1853
1873
  ]);
1854
1874
  }
1855
1875
  }
1856
- const Ml = (e) => {
1876
+ const Dl = (e) => {
1857
1877
  const o = A("editorId");
1858
1878
  return (l) => {
1859
1879
  if (l.clipboardData) {
1860
1880
  if (l.clipboardData.files.length > 0) {
1861
- const { files: i } = l.clipboardData;
1881
+ const { files: r } = l.clipboardData;
1862
1882
  h.emit(
1863
1883
  o,
1864
1884
  "uploadImage",
1865
- Array.from(i).filter((r) => /image\/.*/.test(r.type))
1885
+ Array.from(r).filter((i) => /image\/.*/.test(i.type))
1866
1886
  ), l.preventDefault();
1867
1887
  }
1868
1888
  if (e.autoDetectCode && l.clipboardData.types.includes("vscode-editor-data")) {
1869
- const i = JSON.parse(l.clipboardData.getData("vscode-editor-data"));
1889
+ const r = JSON.parse(l.clipboardData.getData("vscode-editor-data"));
1870
1890
  h.emit(o, "replace", "code", {
1871
- mode: i.mode,
1891
+ mode: r.mode,
1872
1892
  text: l.clipboardData.getData("text/plain")
1873
1893
  }), l.preventDefault();
1874
1894
  }
1875
1895
  }
1876
1896
  };
1877
- }, Ll = Ml, Dl = (e) => {
1897
+ }, El = Dl, Hl = (e) => {
1878
1898
  const o = A("editorId");
1879
- W(() => {
1899
+ z(() => {
1880
1900
  h.on(o, {
1881
1901
  name: dt,
1882
- callback() {
1883
- var a;
1884
- (a = e.value) == null || a.focus();
1902
+ callback(a) {
1903
+ var l;
1904
+ (l = e.value) == null || l.focus(a);
1885
1905
  }
1886
1906
  });
1887
1907
  });
1888
- }, El = Dl, Hl = (e, o) => [
1908
+ }, Il = Hl, Bl = (e, o) => [
1889
1909
  {
1890
1910
  key: "Ctrl-b",
1891
1911
  mac: "Cmd-b",
@@ -1894,7 +1914,7 @@ const Ml = (e) => {
1894
1914
  {
1895
1915
  key: "Ctrl-d",
1896
1916
  mac: "Cmd-d",
1897
- run: Mt,
1917
+ run: Dt,
1898
1918
  preventDefault: !0
1899
1919
  },
1900
1920
  {
@@ -1981,10 +2001,11 @@ const Ml = (e) => {
1981
2001
  {
1982
2002
  any: (M, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (h.emit(e, "replace", "table"), !0) : !1
1983
2003
  }
1984
- ], Bl = Hl, Fl = (e) => {
1985
- const o = A("tabWidth"), a = A("editorId"), l = A("theme"), i = U(), r = Xe(), c = Bl(a, e), m = Ll(e), f = [
1986
- Tt.of([...c, Lt]),
2004
+ ], Fl = Bl, Ol = (e) => {
2005
+ const o = A("tabWidth"), a = A("editorId"), l = A("theme"), r = G(), i = Xe(), c = Fl(a, e), m = El(e), f = [
2006
+ Tt.of([...c, Et]),
1987
2007
  xt,
2008
+ Lt(),
1988
2009
  At({ codeLanguages: St }),
1989
2010
  // 横向换行
1990
2011
  re.lineWrapping,
@@ -1999,82 +2020,82 @@ const Ml = (e) => {
1999
2020
  ], u = () => {
2000
2021
  const d = [
2001
2022
  ...f,
2002
- l.value === "light" ? wl : ml,
2003
- Sl(e.completions)
2023
+ l.value === "light" ? Sl : gl,
2024
+ Ml(e.completions)
2004
2025
  ];
2005
- return _.codeMirrorExtensions(l.value, d, [
2026
+ return W.codeMirrorExtensions(l.value, d, [
2006
2027
  ...c
2007
2028
  ]);
2008
2029
  };
2009
- return W(() => {
2030
+ return z(() => {
2010
2031
  const d = new re({
2011
2032
  doc: e.value,
2012
- parent: i.value
2013
- }), v = new Al(d);
2014
- r.value = v, setTimeout(() => {
2033
+ parent: r.value
2034
+ }), v = new Ll(d);
2035
+ i.value = v, setTimeout(() => {
2015
2036
  v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), v.setExtensions(u()), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && d.focus();
2016
2037
  }, 0), h.on(a, {
2017
2038
  name: "ctrlZ",
2018
2039
  callback() {
2019
- Dt(d);
2040
+ Ht(d);
2020
2041
  }
2021
2042
  }), h.on(a, {
2022
2043
  name: "ctrlShiftZ",
2023
2044
  callback() {
2024
- Et(d);
2045
+ It(d);
2025
2046
  }
2026
2047
  }), h.on(a, {
2027
2048
  name: "replace",
2028
2049
  callback(y, b = {}) {
2029
2050
  var k;
2030
- const { text: p, options: g } = el(y, r.value, b);
2031
- (k = r.value) == null || k.replaceSelectedText(p, g);
2051
+ const { text: p, options: g } = ll(y, i.value, b);
2052
+ (k = i.value) == null || k.replaceSelectedText(p, g);
2032
2053
  }
2033
2054
  });
2034
- }), I(
2055
+ }), F(
2035
2056
  [l, te(e, "completions")],
2036
2057
  () => {
2037
2058
  var d;
2038
- (d = r.value) == null || d.setExtensions(u());
2059
+ (d = i.value) == null || d.setExtensions(u());
2039
2060
  },
2040
2061
  {
2041
2062
  deep: !0
2042
2063
  }
2043
- ), I(
2064
+ ), F(
2044
2065
  () => e.value,
2045
2066
  () => {
2046
2067
  var d, v;
2047
- ((d = r.value) == null ? void 0 : d.getValue()) !== e.value && ((v = r.value) == null || v.setValue(e.value));
2068
+ ((d = i.value) == null ? void 0 : d.getValue()) !== e.value && ((v = i.value) == null || v.setValue(e.value));
2048
2069
  }
2049
- ), I(
2070
+ ), F(
2050
2071
  () => e.placeholder,
2051
2072
  () => {
2052
2073
  var d;
2053
- (d = r.value) == null || d.setPlaceholder(e.placeholder);
2074
+ (d = i.value) == null || d.setPlaceholder(e.placeholder);
2054
2075
  }
2055
- ), I(
2076
+ ), F(
2056
2077
  () => e.disabled,
2057
2078
  () => {
2058
2079
  var d;
2059
- (d = r.value) == null || d.setDisabled(e.disabled);
2080
+ (d = i.value) == null || d.setDisabled(e.disabled);
2060
2081
  }
2061
- ), I(
2082
+ ), F(
2062
2083
  () => e.readonly,
2063
2084
  () => {
2064
2085
  var d;
2065
- (d = r.value) == null || d.setDisabled(e.readonly);
2086
+ (d = i.value) == null || d.setDisabled(e.readonly);
2066
2087
  }
2067
- ), I(
2088
+ ), F(
2068
2089
  () => e.maxlength,
2069
2090
  () => {
2070
2091
  var d;
2071
- e.maxlength && ((d = r.value) == null || d.setMaxLength(e.maxlength));
2092
+ e.maxlength && ((d = i.value) == null || d.setMaxLength(e.maxlength));
2072
2093
  }
2073
- ), El(r), {
2074
- inputWrapperRef: i,
2075
- codeMirrorUt: r
2094
+ ), Il(i), {
2095
+ inputWrapperRef: r,
2096
+ codeMirrorUt: i
2076
2097
  };
2077
- }, Il = Fl, Ol = {
2098
+ }, Vl = Ol, Rl = {
2078
2099
  value: {
2079
2100
  type: String,
2080
2101
  default: ""
@@ -2167,15 +2188,15 @@ const Ml = (e) => {
2167
2188
  completions: {
2168
2189
  type: Array
2169
2190
  }
2170
- }, Vl = /* @__PURE__ */ O({
2191
+ }, Pl = /* @__PURE__ */ O({
2171
2192
  name: "MDEditorContent",
2172
- props: Ol,
2193
+ props: Rl,
2173
2194
  setup(e) {
2174
- const o = U(""), {
2195
+ const o = G(""), {
2175
2196
  inputWrapperRef: a,
2176
2197
  codeMirrorUt: l
2177
- } = Il(e);
2178
- return Qt(e, o, l), () => t("div", {
2198
+ } = Vl(e);
2199
+ return tl(e, o, l), () => t("div", {
2179
2200
  class: `${n}-content`
2180
2201
  }, [t("div", {
2181
2202
  class: `${n}-input-wrapper`,
@@ -2183,8 +2204,8 @@ const Ml = (e) => {
2183
2204
  }, null), t(ut, {
2184
2205
  modelValue: e.value,
2185
2206
  setting: e.setting,
2186
- onHtmlChanged: (i) => {
2187
- o.value = i, e.onHtmlChanged(i);
2207
+ onHtmlChanged: (r) => {
2208
+ o.value = r, e.onHtmlChanged(r);
2188
2209
  },
2189
2210
  onGetCatalog: e.onGetCatalog,
2190
2211
  mdHeadingId: e.mdHeadingId,
@@ -2195,7 +2216,7 @@ const Ml = (e) => {
2195
2216
  noHighlight: e.noHighlight
2196
2217
  }, null)]);
2197
2218
  }
2198
- }), Rl = /* @__PURE__ */ O({
2219
+ }), Nl = /* @__PURE__ */ O({
2199
2220
  props: {
2200
2221
  modelValue: {
2201
2222
  type: String,
@@ -2213,7 +2234,7 @@ const Ml = (e) => {
2213
2234
  }, [`${(a = o.value.footer) == null ? void 0 : a.markdownTotal}:`]), t("span", null, [((l = e.modelValue) == null ? void 0 : l.length) || 0])]);
2214
2235
  };
2215
2236
  }
2216
- }), Nl = {
2237
+ }), ql = {
2217
2238
  checked: {
2218
2239
  type: Boolean,
2219
2240
  default: !1
@@ -2223,8 +2244,8 @@ const Ml = (e) => {
2223
2244
  default: () => {
2224
2245
  }
2225
2246
  }
2226
- }, Pl = /* @__PURE__ */ O({
2227
- props: Nl,
2247
+ }, Ul = /* @__PURE__ */ O({
2248
+ props: ql,
2228
2249
  setup(e) {
2229
2250
  return () => t("div", {
2230
2251
  class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
@@ -2233,7 +2254,7 @@ const Ml = (e) => {
2233
2254
  }
2234
2255
  }, null);
2235
2256
  }
2236
- }), ql = {
2257
+ }), Gl = {
2237
2258
  scrollAuto: {
2238
2259
  type: Boolean
2239
2260
  },
@@ -2242,8 +2263,8 @@ const Ml = (e) => {
2242
2263
  default: () => {
2243
2264
  }
2244
2265
  }
2245
- }, Ul = /* @__PURE__ */ O({
2246
- props: ql,
2266
+ }, Kl = /* @__PURE__ */ O({
2267
+ props: Gl,
2247
2268
  setup(e) {
2248
2269
  const o = A("usedLanguageText");
2249
2270
  return () => {
@@ -2255,13 +2276,13 @@ const Ml = (e) => {
2255
2276
  onClick: () => {
2256
2277
  e.onScrollAutoChange(!e.scrollAuto);
2257
2278
  }
2258
- }, [(a = o.value.footer) == null ? void 0 : a.scrollAuto]), t(Pl, {
2279
+ }, [(a = o.value.footer) == null ? void 0 : a.scrollAuto]), t(Ul, {
2259
2280
  checked: e.scrollAuto,
2260
2281
  onChange: e.onScrollAutoChange
2261
2282
  }, null)]);
2262
2283
  };
2263
2284
  }
2264
- }), Gl = {
2285
+ }), jl = {
2265
2286
  modelValue: {
2266
2287
  type: String,
2267
2288
  default: ""
@@ -2281,22 +2302,22 @@ const Ml = (e) => {
2281
2302
  defFooters: {
2282
2303
  type: Object
2283
2304
  }
2284
- }, Kl = /* @__PURE__ */ O({
2305
+ }, _l = /* @__PURE__ */ O({
2285
2306
  name: "MDEditorFooter",
2286
- props: Gl,
2307
+ props: jl,
2287
2308
  setup(e) {
2288
2309
  const o = fe(() => {
2289
- const l = e.footers.indexOf("="), i = l === -1 ? e.footers : e.footers.slice(0, l), r = l === -1 ? [] : e.footers.slice(l, Number.MAX_SAFE_INTEGER);
2290
- return [i, r];
2310
+ const l = e.footers.indexOf("="), r = l === -1 ? e.footers : e.footers.slice(0, l), i = l === -1 ? [] : e.footers.slice(l, Number.MAX_SAFE_INTEGER);
2311
+ return [r, i];
2291
2312
  }), a = (l) => {
2292
2313
  if (lt.includes(l))
2293
2314
  switch (l) {
2294
2315
  case "markdownTotal":
2295
- return t(Rl, {
2316
+ return t(Nl, {
2296
2317
  modelValue: e.modelValue
2297
2318
  }, null);
2298
2319
  case "scrollSwitch":
2299
- return t(Ul, {
2320
+ return t(Kl, {
2300
2321
  scrollAuto: e.scrollAuto,
2301
2322
  onScrollAutoChange: e.onScrollAutoChange
2302
2323
  }, null);
@@ -2305,17 +2326,17 @@ const Ml = (e) => {
2305
2326
  return e.defFooters instanceof Array ? e.defFooters[l] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[l] || "";
2306
2327
  };
2307
2328
  return () => {
2308
- const l = o.value[0].map((r) => a(r)), i = o.value[1].map((r) => a(r));
2329
+ const l = o.value[0].map((i) => a(i)), r = o.value[1].map((i) => a(i));
2309
2330
  return t("div", {
2310
2331
  class: `${n}-footer`
2311
2332
  }, [t("div", {
2312
2333
  class: `${n}-footer-left`
2313
2334
  }, [l]), t("div", {
2314
2335
  class: `${n}-footer-right`
2315
- }, [i])]);
2336
+ }, [r])]);
2316
2337
  };
2317
2338
  }
2318
- }), jl = /* @__PURE__ */ O({
2339
+ }), Wl = /* @__PURE__ */ O({
2319
2340
  name: "MdEditorV3",
2320
2341
  props: mt,
2321
2342
  emits: ft,
@@ -2323,8 +2344,8 @@ const Ml = (e) => {
2323
2344
  const {
2324
2345
  editorId: a,
2325
2346
  noKatex: l,
2326
- noMermaid: i,
2327
- noPrettier: r,
2347
+ noMermaid: r,
2348
+ noPrettier: i,
2328
2349
  noUploadImg: c,
2329
2350
  noHighlight: m
2330
2351
  } = e, f = Z({
@@ -2347,8 +2368,8 @@ const Ml = (e) => {
2347
2368
  id: a,
2348
2369
  class: [n, e.class, e.theme === "dark" && `${n}-dark`, u.fullscreen || u.pageFullscreen ? `${n}-fullscreen` : ""],
2349
2370
  style: e.style
2350
- }, [t(Yt, {
2351
- noPrettier: r,
2371
+ }, [t(Jt, {
2372
+ noPrettier: i,
2352
2373
  toolbars: e.toolbars,
2353
2374
  toolbarsExclude: e.toolbarsExclude,
2354
2375
  setting: u,
@@ -2356,12 +2377,12 @@ const Ml = (e) => {
2356
2377
  tableShape: e.tableShape,
2357
2378
  defToolbars: y,
2358
2379
  noUploadImg: c
2359
- }, null), t(Vl, {
2380
+ }, null), t(Pl, {
2360
2381
  value: e.modelValue,
2361
2382
  setting: u,
2362
2383
  mdHeadingId: e.mdHeadingId,
2363
- noMermaid: i,
2364
- noPrettier: r,
2384
+ noMermaid: r,
2385
+ noPrettier: i,
2365
2386
  sanitize: e.sanitize,
2366
2387
  placeholder: e.placeholder,
2367
2388
  noKatex: l,
@@ -2389,7 +2410,7 @@ const Ml = (e) => {
2389
2410
  e.onFocus ? e.onFocus(g) : o.emit("onFocus", g);
2390
2411
  },
2391
2412
  completions: e.completions
2392
- }, null), ((p = e.footers) == null ? void 0 : p.length) > 0 && t(Kl, {
2413
+ }, null), ((p = e.footers) == null ? void 0 : p.length) > 0 && t(_l, {
2393
2414
  modelValue: e.modelValue,
2394
2415
  footers: e.footers,
2395
2416
  defFooters: b,
@@ -2404,8 +2425,8 @@ const Ml = (e) => {
2404
2425
  }, null)]);
2405
2426
  };
2406
2427
  }
2407
- }), ue = jl;
2408
- ue.install = (e) => (e.component(ue.name, ue), e.use(Ot).use(ot).use(yt).use(Ye).use(Ct), e);
2428
+ }), ue = Wl;
2429
+ ue.install = (e) => (e.component(ue.name, ue), e.use(Rt).use(ot).use(yt).use(Ye).use(Ct), e);
2409
2430
  export {
2410
2431
  ue as default
2411
2432
  };