md-editor-v3 4.7.0 → 4.8.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 (38) hide show
  1. package/README.md +17 -1
  2. package/lib/cjs/MdCatalog.cjs +1 -1
  3. package/lib/cjs/MdEditor.cjs +27 -27
  4. package/lib/cjs/MdModal.cjs +1 -1
  5. package/lib/cjs/MdPreview.cjs +1 -1
  6. package/lib/cjs/ModalToolbar.cjs +1 -1
  7. package/lib/cjs/chunks/config.cjs +1 -1
  8. package/lib/cjs/chunks/index.cjs +8 -1
  9. package/lib/cjs/chunks/index3.cjs +1 -2
  10. package/lib/cjs/chunks/index4.cjs +2 -8
  11. package/lib/cjs/config.cjs +1 -1
  12. package/lib/cjs/index.cjs +1 -1
  13. package/lib/es/DropdownToolbar.mjs +2 -2
  14. package/lib/es/MdCatalog.mjs +1 -1
  15. package/lib/es/MdEditor.mjs +717 -674
  16. package/lib/es/MdModal.mjs +1 -1
  17. package/lib/es/MdPreview.mjs +2 -2
  18. package/lib/es/ModalToolbar.mjs +1 -1
  19. package/lib/es/chunks/config.mjs +19 -19
  20. package/lib/es/chunks/index.mjs +1248 -138
  21. package/lib/es/chunks/index2.mjs +2 -2
  22. package/lib/es/chunks/index3.mjs +163 -79
  23. package/lib/es/chunks/index4.mjs +77 -1258
  24. package/lib/es/config.mjs +10 -2
  25. package/lib/es/index.mjs +24 -17
  26. package/lib/style.css +1 -1
  27. package/lib/types/MdEditor/Editor.d.ts +9 -0
  28. package/lib/types/MdEditor/config.d.ts +2 -2
  29. package/lib/types/MdEditor/index.d.ts +15 -0
  30. package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +2 -1
  31. package/lib/types/MdEditor/layouts/Content/composition/useResize.d.ts +12 -0
  32. package/lib/types/MdEditor/layouts/Content/index.d.ts +6 -0
  33. package/lib/types/MdEditor/layouts/Content/props.d.ts +3 -0
  34. package/lib/types/MdEditor/props.d.ts +10 -0
  35. package/lib/types/config.d.ts +3 -1
  36. package/lib/types/index.d.ts +1 -1
  37. package/lib/umd/index.js +31 -31
  38. package/package.json +1 -1
@@ -1,24 +1,24 @@
1
- var Vt = Object.defineProperty;
2
- var Ft = (e, o, l) => o in e ? Vt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
1
+ var Bt = Object.defineProperty;
2
+ var Ft = (e, o, l) => o in e ? Bt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
3
  var q = (e, o, l) => (Ft(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as P, createVNode as t, inject as A, ref as j, onMounted as J, reactive as ee, computed as Te, watch as V, nextTick as he, Fragment as Mt, cloneVNode as mt, toRef as me, shallowRef as Bt, onBeforeUnmount as Rt } from "vue";
5
- import { p as n, c as Y, l as Pt, g as Ut, j as _t } from "./chunks/config.mjs";
6
- import { draggingScroll as qt, linkTo as Gt, debounce as jt, createSmoothScroll as Kt, throttle as Wt } from "@vavt/util";
7
- import { D as ie, a as zt } from "./chunks/index2.mjs";
8
- import { b as h, h as Zt, E as te, U as we, i as Xt, j as ye, R as w, c as Yt, O as Lt, k as Dt, l as It, T as Jt } from "./chunks/index3.mjs";
4
+ import { defineComponent as P, createVNode as t, inject as A, ref as U, onMounted as Y, reactive as G, computed as Te, watch as O, nextTick as he, Fragment as Mt, cloneVNode as mt, toRef as te, shallowRef as Rt, onBeforeUnmount as Lt } from "vue";
5
+ import { p as n, e as Q, n as Pt, b as Wt, d as Ut } from "./chunks/config.mjs";
6
+ import { draggingScroll as _t, linkTo as qt, debounce as zt, createSmoothScroll as Gt, throttle as Kt } from "@vavt/util";
7
+ import { a as se, D as jt } from "./chunks/index2.mjs";
8
+ import { b as v, h as Zt, E as le, U as we, i as Xt, j as ye, R as x, c as Yt, O as Dt, k as Et, l as It, T as Jt } from "./chunks/index4.mjs";
9
9
  import { a as Qt } from "./chunks/dom.mjs";
10
- import { M as Et, I as $ } from "./chunks/index.mjs";
10
+ import { M as Ht, I as y } from "./chunks/index3.mjs";
11
11
  import { minimalSetup as el, EditorView as ge } from "codemirror";
12
12
  import { EditorView as xe, 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 G, EditorState as ke, Compartment as be, StateEffect as nl } from "@codemirror/state";
15
+ import { EditorSelection as z, EditorState as ke, Compartment as be, StateEffect as nl } from "@codemirror/state";
16
16
  import { deleteLine as rl, indentWithTab as il, undo as sl, redo as cl } from "@codemirror/commands";
17
- import { HighlightStyle as Ht, syntaxHighlighting as Nt, indentUnit as ul } from "@codemirror/language";
18
- import { tags as s } from "@lezer/highlight";
17
+ import { HighlightStyle as Nt, syntaxHighlighting as Ot, indentUnit as ul } from "@codemirror/language";
18
+ import { tags as c } from "@lezer/highlight";
19
19
  import { autocompletion as dl } from "@codemirror/autocomplete";
20
- import { c as ml, C as gl, e as fl, a as bl, u as hl, b as vl, d as kl, f as Cl, g as pl, h as $l, i as yl, M as Tl } from "./chunks/index4.mjs";
21
- import Ot from "./MdCatalog.mjs";
20
+ import { c as ml, C as gl, e as fl, a as bl, u as hl, b as vl, d as kl, f as Cl, g as pl, h as $l, i as yl, M as Tl } from "./chunks/index.mjs";
21
+ import Vt from "./MdCatalog.mjs";
22
22
  import { g as gt } from "./chunks/vue-tsx.mjs";
23
23
  import wl from "./NormalToolbar.mjs";
24
24
  import xl from "./ModalToolbar.mjs";
@@ -84,36 +84,36 @@ const Sl = /* @__PURE__ */ P({
84
84
  type: Boolean
85
85
  }
86
86
  }, Ml = (e) => {
87
- var u, c, v, x;
87
+ var u, s, f, w;
88
88
  const o = A("editorId");
89
- let l = (c = (u = Y.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : c.instance;
90
- const a = (x = (v = Y.editorExtensions) == null ? void 0 : v.screenfull) == null ? void 0 : x.js, i = j(!1), r = (y) => {
89
+ let l = (s = (u = Q.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : s.instance;
90
+ const a = (w = (f = Q.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : w.js, r = U(!1), i = (k) => {
91
91
  if (!l) {
92
- h.emit(o, te, {
92
+ v.emit(o, le, {
93
93
  name: "fullscreen",
94
94
  message: "fullscreen is undefined"
95
95
  });
96
96
  return;
97
97
  }
98
- l.isEnabled ? (i.value = !0, (y === void 0 ? !l.isFullscreen : y) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
98
+ l.isEnabled ? (r.value = !0, (k === void 0 ? !l.isFullscreen : k) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
99
  }, m = () => {
100
100
  l && l.isEnabled && l.on("change", () => {
101
- (i.value || e.setting.fullscreen) && (i.value = !1, e.updateSetting("fullscreen"));
101
+ (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
102
102
  });
103
103
  }, g = () => {
104
104
  l = window.screenfull, m();
105
105
  };
106
- return J(() => {
106
+ return Y(() => {
107
107
  if (m(), !l) {
108
- const y = document.createElement("script");
109
- y.src = a || Pt, y.onload = g, y.id = `${n}-screenfull`, Qt(y, "screenfull");
108
+ const k = document.createElement("script");
109
+ k.src = a || Pt, k.onload = g, k.id = `${n}-screenfull`, Qt(k, "screenfull");
110
110
  }
111
- }), J(() => {
112
- h.on(o, {
111
+ }), Y(() => {
112
+ v.on(o, {
113
113
  name: Zt,
114
- callback: r
114
+ callback: i
115
115
  });
116
- }), { fullscreenHandler: r };
116
+ }), { fullscreenHandler: i };
117
117
  }, Ll = {
118
118
  tableShape: {
119
119
  type: Array,
@@ -128,7 +128,7 @@ const Sl = /* @__PURE__ */ P({
128
128
  name: "TableShape",
129
129
  props: Ll,
130
130
  setup(e) {
131
- const o = ee({
131
+ const o = G({
132
132
  x: -1,
133
133
  y: -1
134
134
  });
@@ -140,20 +140,20 @@ const Sl = /* @__PURE__ */ P({
140
140
  }, [new Array(e.tableShape[1]).fill("").map((l, a) => t("div", {
141
141
  class: `${n}-table-shape-row`,
142
142
  key: `table-shape-row-${a}`
143
- }, [new Array(e.tableShape[0]).fill("").map((i, r) => t("div", {
143
+ }, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
144
144
  class: `${n}-table-shape-col`,
145
- key: `table-shape-col-${r}`,
145
+ key: `table-shape-col-${i}`,
146
146
  onMouseenter: () => {
147
- o.x = a, o.y = r;
147
+ o.x = a, o.y = i;
148
148
  },
149
149
  onClick: () => {
150
150
  e.onSelected(o);
151
151
  }
152
152
  }, [t("div", {
153
- class: [`${n}-table-shape-col-default`, a <= o.x && r <= o.y && `${n}-table-shape-col-include`]
153
+ class: [`${n}-table-shape-col-default`, a <= o.x && i <= o.y && `${n}-table-shape-col-include`]
154
154
  }, null)]))]))]);
155
155
  }
156
- }), Il = Dl, El = {
156
+ }), El = Dl, Il = {
157
157
  type: {
158
158
  type: String,
159
159
  default: "link"
@@ -173,46 +173,46 @@ const Sl = /* @__PURE__ */ P({
173
173
  }
174
174
  }
175
175
  }, Hl = /* @__PURE__ */ P({
176
- props: El,
176
+ props: Il,
177
177
  setup(e) {
178
178
  const o = A("usedLanguageText"), l = A("editorId"), a = Te(() => {
179
- var r, m;
179
+ var i, m;
180
180
  switch (e.type) {
181
181
  case "link":
182
- return (r = o.value.linkModalTips) == null ? void 0 : r.linkTitle;
182
+ return (i = o.value.linkModalTips) == null ? void 0 : i.linkTitle;
183
183
  case "image":
184
184
  return (m = o.value.linkModalTips) == null ? void 0 : m.imageTitle;
185
185
  default:
186
186
  return "";
187
187
  }
188
- }), i = ee({
188
+ }), r = G({
189
189
  desc: "",
190
190
  url: ""
191
191
  });
192
- return V(() => e.visible, (r) => {
193
- r || setTimeout(() => {
194
- i.desc = "", i.url = "";
192
+ return O(() => e.visible, (i) => {
193
+ i || setTimeout(() => {
194
+ r.desc = "", r.url = "";
195
195
  }, 200);
196
- }), () => t(Et, {
196
+ }), () => t(Ht, {
197
197
  title: a.value,
198
198
  visible: e.visible,
199
199
  onClose: e.onCancel
200
200
  }, {
201
201
  default: () => {
202
- var r, m, g, u, c;
202
+ var i, m, g, u, s;
203
203
  return [t("div", {
204
204
  class: `${n}-form-item`
205
205
  }, [t("label", {
206
206
  class: `${n}-label`,
207
207
  for: `link-desc-${l}`
208
- }, [(r = o.value.linkModalTips) == null ? void 0 : r.descLabel]), t("input", {
208
+ }, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
209
209
  placeholder: (m = o.value.linkModalTips) == null ? void 0 : m.descLabelPlaceHolder,
210
210
  class: `${n}-input`,
211
211
  id: `link-desc-${l}`,
212
212
  type: "text",
213
- value: i.desc,
214
- onChange: (v) => {
215
- i.desc = v.target.value;
213
+ value: r.desc,
214
+ onChange: (f) => {
215
+ r.desc = f.target.value;
216
216
  },
217
217
  autocomplete: "off"
218
218
  }, null)]), t("div", {
@@ -225,9 +225,9 @@ const Sl = /* @__PURE__ */ P({
225
225
  class: `${n}-input`,
226
226
  id: `link-url-${l}`,
227
227
  type: "text",
228
- value: i.url,
229
- onChange: (v) => {
230
- i.url = v.target.value;
228
+ value: r.url,
229
+ onChange: (f) => {
230
+ r.url = f.target.value;
231
231
  },
232
232
  autocomplete: "off"
233
233
  }, null)]), t("div", {
@@ -236,9 +236,9 @@ const Sl = /* @__PURE__ */ P({
236
236
  class: [`${n}-btn`, `${n}-btn-row`],
237
237
  type: "button",
238
238
  onClick: () => {
239
- e.onOk(i), i.desc = "", i.url = "";
239
+ e.onOk(r), r.desc = "", r.url = "";
240
240
  }
241
- }, [(c = o.value.linkModalTips) == null ? void 0 : c.buttonOK])])];
241
+ }, [(s = o.value.linkModalTips) == null ? void 0 : s.buttonOK])])];
242
242
  }
243
243
  });
244
244
  }
@@ -260,10 +260,10 @@ const Sl = /* @__PURE__ */ P({
260
260
  }, Ol = /* @__PURE__ */ P({
261
261
  props: Nl,
262
262
  setup(e) {
263
- var v, x, y;
263
+ var f, w, k;
264
264
  const o = A("usedLanguageText"), l = A("editorId");
265
- let a = (y = (x = (v = Y) == null ? void 0 : v.editorExtensions) == null ? void 0 : x.cropper) == null ? void 0 : y.instance;
266
- const i = j(), r = j(), m = j(), g = ee({
265
+ let a = (k = (w = (f = Q) == null ? void 0 : f.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : k.instance;
266
+ const r = U(), i = U(), m = U(), g = G({
267
267
  cropperInited: !1,
268
268
  imgSelected: !1,
269
269
  imgSrc: "",
@@ -271,60 +271,60 @@ const Sl = /* @__PURE__ */ P({
271
271
  isFullscreen: !1
272
272
  });
273
273
  let u = null;
274
- V(() => e.visible, () => {
275
- e.visible && !g.cropperInited && (a = a || window.Cropper, i.value.onchange = () => {
274
+ O(() => e.visible, () => {
275
+ e.visible && !g.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
276
276
  if (!a) {
277
- h.emit(l, te, {
277
+ v.emit(l, le, {
278
278
  name: "Cropper",
279
279
  message: "Cropper is undefined"
280
280
  });
281
281
  return;
282
282
  }
283
- const d = i.value.files || [];
283
+ const d = r.value.files || [];
284
284
  if (g.imgSelected = !0, (d == null ? void 0 : d.length) > 0) {
285
- const k = new FileReader();
286
- k.onload = (b) => {
287
- g.imgSrc = b.target.result, he(() => {
288
- u = new a(r.value, {
285
+ const C = new FileReader();
286
+ C.onload = (h) => {
287
+ g.imgSrc = h.target.result, he(() => {
288
+ u = new a(i.value, {
289
289
  viewMode: 2,
290
290
  preview: `.${n}-clip-preview-target`
291
291
  // aspectRatio: 16 / 9,
292
292
  });
293
293
  });
294
- }, k.readAsDataURL(d[0]);
294
+ }, C.readAsDataURL(d[0]);
295
295
  }
296
296
  });
297
- }), V(() => [g.imgSelected], () => {
297
+ }), O(() => [g.imgSelected], () => {
298
298
  m.value.style = "";
299
- }), V(() => g.isFullscreen, () => {
299
+ }), O(() => g.isFullscreen, () => {
300
300
  he(() => {
301
- u == null || u.destroy(), m.value.style = "", r.value && (u = new a(r.value, {
301
+ u == null || u.destroy(), m.value.style = "", i.value && (u = new a(i.value, {
302
302
  viewMode: 2,
303
303
  preview: `.${n}-clip-preview-target`
304
304
  // aspectRatio: 16 / 9,
305
305
  }));
306
306
  });
307
307
  });
308
- const c = () => {
309
- u.clear(), u.destroy(), u = null, i.value.value = "", g.imgSelected = !1;
308
+ const s = () => {
309
+ u.clear(), u.destroy(), u = null, r.value.value = "", g.imgSelected = !1;
310
310
  };
311
311
  return () => {
312
312
  var d;
313
- return t(Et, {
313
+ return t(Ht, {
314
314
  class: `${n}-modal-clip`,
315
315
  title: (d = o.value.clipModalTips) == null ? void 0 : d.title,
316
316
  visible: e.visible,
317
317
  onClose: e.onCancel,
318
318
  showAdjust: !0,
319
319
  isFullscreen: g.isFullscreen,
320
- onAdjust: (k) => {
321
- g.isFullscreen = k;
320
+ onAdjust: (C) => {
321
+ g.isFullscreen = C;
322
322
  },
323
323
  width: "668px",
324
324
  height: "421px"
325
325
  }, {
326
326
  default: () => {
327
- var k, b;
327
+ var C, h;
328
328
  return [t("div", {
329
329
  class: `${n}-form-item ${n}-clip`
330
330
  }, [t("div", {
@@ -333,22 +333,22 @@ const Sl = /* @__PURE__ */ P({
333
333
  class: `${n}-clip-cropper`
334
334
  }, [t("img", {
335
335
  src: g.imgSrc,
336
- ref: r,
336
+ ref: i,
337
337
  style: {
338
338
  display: "none"
339
339
  },
340
340
  alt: ""
341
341
  }, null), t("div", {
342
342
  class: `${n}-clip-delete`,
343
- onClick: c
344
- }, [t($, {
343
+ onClick: s
344
+ }, [t(y, {
345
345
  name: "delete"
346
346
  }, null)])]) : t("div", {
347
347
  class: `${n}-clip-upload`,
348
348
  onClick: () => {
349
- i.value.click();
349
+ r.value.click();
350
350
  }
351
- }, [t($, {
351
+ }, [t(y, {
352
352
  name: "upload"
353
353
  }, null)])]), t("div", {
354
354
  class: `${n}-clip-preview`
@@ -362,12 +362,12 @@ const Sl = /* @__PURE__ */ P({
362
362
  type: "button",
363
363
  onClick: () => {
364
364
  if (u) {
365
- const f = u.getCroppedCanvas();
366
- h.emit(l, we, [Xt(f.toDataURL("image/png"))], e.onOk), c();
365
+ const b = u.getCroppedCanvas();
366
+ v.emit(l, we, [Xt(b.toDataURL("image/png"))], e.onOk), s();
367
367
  }
368
368
  }
369
- }, [((k = o.value.clipModalTips) == null ? void 0 : k.buttonUpload) || ((b = o.value.linkModalTips) == null ? void 0 : b.buttonOK)])]), t("input", {
370
- ref: i,
369
+ }, [((C = o.value.clipModalTips) == null ? void 0 : C.buttonUpload) || ((h = o.value.linkModalTips) == null ? void 0 : h.buttonOK)])]), t("input", {
370
+ ref: r,
371
371
  accept: "image/*",
372
372
  type: "file",
373
373
  multiple: !1,
@@ -402,7 +402,7 @@ const Sl = /* @__PURE__ */ P({
402
402
  default: () => {
403
403
  }
404
404
  }
405
- }, Fl = /* @__PURE__ */ P({
405
+ }, Bl = /* @__PURE__ */ P({
406
406
  props: Vl,
407
407
  setup(e) {
408
408
  return () => t(Mt, null, [t(Hl, {
@@ -416,13 +416,13 @@ const Sl = /* @__PURE__ */ P({
416
416
  onCancel: e.onCancel
417
417
  }, null)]);
418
418
  }
419
- }), Bl = /* @__PURE__ */ P({
419
+ }), Fl = /* @__PURE__ */ P({
420
420
  name: "MDEditorToolbar",
421
421
  props: Al,
422
422
  setup(e) {
423
- const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"), i = A("language"), {
424
- fullscreenHandler: r
425
- } = Ml(e), m = `${o}-toolbar-wrapper`, g = j(), u = ee({
423
+ const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"), r = A("language"), {
424
+ fullscreenHandler: i
425
+ } = Ml(e), m = `${o}-toolbar-wrapper`, g = U(), u = G({
426
426
  title: !1,
427
427
  catalog: !1,
428
428
  // 图片上传下拉
@@ -432,44 +432,44 @@ const Sl = /* @__PURE__ */ P({
432
432
  // mermaid
433
433
  mermaid: !1,
434
434
  katex: !1
435
- }), c = (f, C) => {
436
- h.emit(o, w, f, C);
437
- }, v = ee({
435
+ }), s = (b, p) => {
436
+ v.emit(o, x, b, p);
437
+ }, f = G({
438
438
  type: "link",
439
439
  linkVisible: !1,
440
440
  clipVisible: !1
441
- }), x = j();
442
- J(() => {
443
- h.on(o, {
441
+ }), w = U();
442
+ Y(() => {
443
+ v.on(o, {
444
444
  name: ye,
445
- callback(f) {
446
- v.type = f, v.linkVisible = !0;
445
+ callback(b) {
446
+ f.type = b, f.linkVisible = !0;
447
447
  }
448
448
  });
449
449
  });
450
- const y = Te(() => {
451
- const f = e.toolbars.filter((D) => !e.toolbarsExclude.includes(D)), C = f.indexOf("="), T = C === -1 ? f : f.slice(0, C + 1), S = C === -1 ? [] : f.slice(C, Number.MAX_SAFE_INTEGER);
450
+ const k = Te(() => {
451
+ const b = e.toolbars.filter((D) => !e.toolbarsExclude.includes(D)), p = b.indexOf("="), T = p === -1 ? b : b.slice(0, p + 1), S = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
452
452
  return [T, S];
453
- }), d = j(), k = () => {
454
- h.emit(o, we, Array.from(d.value.files || [])), d.value.value = "";
453
+ }), d = U(), C = () => {
454
+ v.emit(o, we, Array.from(d.value.files || [])), d.value.value = "";
455
455
  };
456
- J(() => {
457
- d.value.addEventListener("change", k);
456
+ Y(() => {
457
+ d.value.addEventListener("change", C);
458
458
  });
459
- const b = (f) => {
460
- var C, T, S, D, I, le, oe, M, L, _, U, O, H, N, F, K, W, ue, ae, X, z, ne, Z, B, R, re, de, Se, Ae, Me, Le, De, Ie, Ee, He, Ne, Oe, Ve, Fe, Be, Re, Pe, Ue, _e, qe, Ge, je, Ke, We, ze, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st, ct, ut, dt;
461
- if (Ut.includes(f))
462
- switch (f) {
459
+ const h = (b) => {
460
+ var p, T, S, D, E, oe, ae, M, L, _, W, V, H, N, B, K, j, de, ne, J, Z, re, X, F, R, ie, me, Se, Ae, Me, Le, De, Ee, Ie, He, Ne, Oe, Ve, Be, Fe, Re, Pe, We, Ue, _e, qe, ze, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st, ct, ut, dt;
461
+ if (Wt.includes(b))
462
+ switch (b) {
463
463
  case "-":
464
464
  return t(Sl, null, null);
465
465
  case "bold":
466
466
  return t("div", {
467
467
  class: `${n}-toolbar-item`,
468
- title: (C = l.value.toolbarTips) == null ? void 0 : C.bold,
468
+ title: (p = l.value.toolbarTips) == null ? void 0 : p.bold,
469
469
  onClick: () => {
470
- c("bold");
470
+ s("bold");
471
471
  }
472
- }, [t($, {
472
+ }, [t(y, {
473
473
  name: "bold"
474
474
  }, null), e.showToolbarName && t("div", {
475
475
  class: `${n}-toolbar-item-name`
@@ -479,9 +479,9 @@ const Sl = /* @__PURE__ */ P({
479
479
  class: `${n}-toolbar-item`,
480
480
  title: (S = l.value.toolbarTips) == null ? void 0 : S.underline,
481
481
  onClick: () => {
482
- c("underline");
482
+ s("underline");
483
483
  }
484
- }, [t($, {
484
+ }, [t(y, {
485
485
  name: "underline"
486
486
  }, null), e.showToolbarName && t("div", {
487
487
  class: `${n}-toolbar-item-name`
@@ -489,33 +489,33 @@ const Sl = /* @__PURE__ */ P({
489
489
  case "italic":
490
490
  return t("div", {
491
491
  class: `${n}-toolbar-item`,
492
- title: (I = l.value.toolbarTips) == null ? void 0 : I.italic,
492
+ title: (E = l.value.toolbarTips) == null ? void 0 : E.italic,
493
493
  onClick: () => {
494
- c("italic");
494
+ s("italic");
495
495
  }
496
- }, [t($, {
496
+ }, [t(y, {
497
497
  name: "italic"
498
498
  }, null), e.showToolbarName && t("div", {
499
499
  class: `${n}-toolbar-item-name`
500
- }, [(le = l.value.toolbarTips) == null ? void 0 : le.italic])]);
500
+ }, [(oe = l.value.toolbarTips) == null ? void 0 : oe.italic])]);
501
501
  case "strikeThrough":
502
502
  return t("div", {
503
503
  class: `${n}-toolbar-item`,
504
- title: (oe = l.value.toolbarTips) == null ? void 0 : oe.strikeThrough,
504
+ title: (ae = l.value.toolbarTips) == null ? void 0 : ae.strikeThrough,
505
505
  onClick: () => {
506
- c("strikeThrough");
506
+ s("strikeThrough");
507
507
  }
508
- }, [t($, {
508
+ }, [t(y, {
509
509
  name: "strike-through"
510
510
  }, null), e.showToolbarName && t("div", {
511
511
  class: `${n}-toolbar-item-name`
512
512
  }, [(M = l.value.toolbarTips) == null ? void 0 : M.strikeThrough])]);
513
513
  case "title":
514
- return t(ie, {
514
+ return t(se, {
515
515
  relative: `#${m}`,
516
516
  visible: u.title,
517
- onChange: (p) => {
518
- u.title = p;
517
+ onChange: ($) => {
518
+ u.title = $;
519
519
  },
520
520
  overlay: t("ul", {
521
521
  class: `${n}-menu`,
@@ -523,57 +523,57 @@ const Sl = /* @__PURE__ */ P({
523
523
  u.title = !1;
524
524
  }
525
525
  }, [t("li", {
526
- class: `${n}-menu-item`,
526
+ class: `${n}-menu-item ${n}-menu-item-title`,
527
527
  onClick: () => {
528
- c("h1");
528
+ s("h1");
529
529
  }
530
530
  }, [(L = l.value.titleItem) == null ? void 0 : L.h1]), t("li", {
531
- class: `${n}-menu-item`,
531
+ class: `${n}-menu-item ${n}-menu-item-title`,
532
532
  onClick: () => {
533
- c("h2");
533
+ s("h2");
534
534
  }
535
535
  }, [(_ = l.value.titleItem) == null ? void 0 : _.h2]), t("li", {
536
- class: `${n}-menu-item`,
536
+ class: `${n}-menu-item ${n}-menu-item-title`,
537
537
  onClick: () => {
538
- c("h3");
538
+ s("h3");
539
539
  }
540
- }, [(U = l.value.titleItem) == null ? void 0 : U.h3]), t("li", {
541
- class: `${n}-menu-item`,
540
+ }, [(W = l.value.titleItem) == null ? void 0 : W.h3]), t("li", {
541
+ class: `${n}-menu-item ${n}-menu-item-title`,
542
542
  onClick: () => {
543
- c("h4");
543
+ s("h4");
544
544
  }
545
- }, [(O = l.value.titleItem) == null ? void 0 : O.h4]), t("li", {
546
- class: `${n}-menu-item`,
545
+ }, [(V = l.value.titleItem) == null ? void 0 : V.h4]), t("li", {
546
+ class: `${n}-menu-item ${n}-menu-item-title`,
547
547
  onClick: () => {
548
- c("h5");
548
+ s("h5");
549
549
  }
550
550
  }, [(H = l.value.titleItem) == null ? void 0 : H.h5]), t("li", {
551
- class: `${n}-menu-item`,
551
+ class: `${n}-menu-item ${n}-menu-item-title`,
552
552
  onClick: () => {
553
- c("h6");
553
+ s("h6");
554
554
  }
555
555
  }, [(N = l.value.titleItem) == null ? void 0 : N.h6])])
556
556
  }, {
557
557
  default: () => {
558
- var p, E;
558
+ var $, I;
559
559
  return [t("div", {
560
560
  class: `${n}-toolbar-item`,
561
- title: (p = l.value.toolbarTips) == null ? void 0 : p.title
562
- }, [t($, {
561
+ title: ($ = l.value.toolbarTips) == null ? void 0 : $.title
562
+ }, [t(y, {
563
563
  name: "title"
564
564
  }, null), e.showToolbarName && t("div", {
565
565
  class: `${n}-toolbar-item-name`
566
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.title])])];
566
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.title])])];
567
567
  }
568
568
  });
569
569
  case "sub":
570
570
  return t("div", {
571
571
  class: `${n}-toolbar-item`,
572
- title: (F = l.value.toolbarTips) == null ? void 0 : F.sub,
572
+ title: (B = l.value.toolbarTips) == null ? void 0 : B.sub,
573
573
  onClick: () => {
574
- c("sub");
574
+ s("sub");
575
575
  }
576
- }, [t($, {
576
+ }, [t(y, {
577
577
  name: "sub"
578
578
  }, null), e.showToolbarName && t("div", {
579
579
  class: `${n}-toolbar-item-name`
@@ -581,71 +581,71 @@ const Sl = /* @__PURE__ */ P({
581
581
  case "sup":
582
582
  return t("div", {
583
583
  class: `${n}-toolbar-item`,
584
- title: (W = l.value.toolbarTips) == null ? void 0 : W.sup,
584
+ title: (j = l.value.toolbarTips) == null ? void 0 : j.sup,
585
585
  onClick: () => {
586
- c("sup");
586
+ s("sup");
587
587
  }
588
- }, [t($, {
588
+ }, [t(y, {
589
589
  name: "sup"
590
590
  }, null), e.showToolbarName && t("div", {
591
591
  class: `${n}-toolbar-item-name`
592
- }, [(ue = l.value.toolbarTips) == null ? void 0 : ue.sup])]);
592
+ }, [(de = l.value.toolbarTips) == null ? void 0 : de.sup])]);
593
593
  case "quote":
594
594
  return t("div", {
595
595
  class: `${n}-toolbar-item`,
596
- title: (ae = l.value.toolbarTips) == null ? void 0 : ae.quote,
596
+ title: (ne = l.value.toolbarTips) == null ? void 0 : ne.quote,
597
597
  onClick: () => {
598
- c("quote");
598
+ s("quote");
599
599
  }
600
- }, [t($, {
600
+ }, [t(y, {
601
601
  name: "quote"
602
602
  }, null), e.showToolbarName && t("div", {
603
603
  class: `${n}-toolbar-item-name`
604
- }, [(X = l.value.toolbarTips) == null ? void 0 : X.quote])]);
604
+ }, [(J = l.value.toolbarTips) == null ? void 0 : J.quote])]);
605
605
  case "unorderedList":
606
606
  return t("div", {
607
607
  class: `${n}-toolbar-item`,
608
- title: (z = l.value.toolbarTips) == null ? void 0 : z.unorderedList,
608
+ title: (Z = l.value.toolbarTips) == null ? void 0 : Z.unorderedList,
609
609
  onClick: () => {
610
- c("unorderedList");
610
+ s("unorderedList");
611
611
  }
612
- }, [t($, {
612
+ }, [t(y, {
613
613
  name: "unordered-list"
614
614
  }, null), e.showToolbarName && t("div", {
615
615
  class: `${n}-toolbar-item-name`
616
- }, [(ne = l.value.toolbarTips) == null ? void 0 : ne.unorderedList])]);
616
+ }, [(re = l.value.toolbarTips) == null ? void 0 : re.unorderedList])]);
617
617
  case "orderedList":
618
618
  return t("div", {
619
619
  class: `${n}-toolbar-item`,
620
- title: (Z = l.value.toolbarTips) == null ? void 0 : Z.orderedList,
620
+ title: (X = l.value.toolbarTips) == null ? void 0 : X.orderedList,
621
621
  onClick: () => {
622
- c("orderedList");
622
+ s("orderedList");
623
623
  }
624
- }, [t($, {
624
+ }, [t(y, {
625
625
  name: "ordered-list"
626
626
  }, null), e.showToolbarName && t("div", {
627
627
  class: `${n}-toolbar-item-name`
628
- }, [(B = l.value.toolbarTips) == null ? void 0 : B.orderedList])]);
628
+ }, [(F = l.value.toolbarTips) == null ? void 0 : F.orderedList])]);
629
629
  case "task":
630
630
  return t("div", {
631
631
  class: `${n}-toolbar-item`,
632
632
  title: (R = l.value.toolbarTips) == null ? void 0 : R.task,
633
633
  onClick: () => {
634
- c("task");
634
+ s("task");
635
635
  }
636
- }, [t($, {
636
+ }, [t(y, {
637
637
  name: "task"
638
638
  }, null), e.showToolbarName && t("div", {
639
639
  class: `${n}-toolbar-item-name`
640
- }, [(re = l.value.toolbarTips) == null ? void 0 : re.task])]);
640
+ }, [(ie = l.value.toolbarTips) == null ? void 0 : ie.task])]);
641
641
  case "codeRow":
642
642
  return t("div", {
643
643
  class: `${n}-toolbar-item`,
644
- title: (de = l.value.toolbarTips) == null ? void 0 : de.codeRow,
644
+ title: (me = l.value.toolbarTips) == null ? void 0 : me.codeRow,
645
645
  onClick: () => {
646
- c("codeRow");
646
+ s("codeRow");
647
647
  }
648
- }, [t($, {
648
+ }, [t(y, {
649
649
  name: "code-row"
650
650
  }, null), e.showToolbarName && t("div", {
651
651
  class: `${n}-toolbar-item-name`
@@ -655,9 +655,9 @@ const Sl = /* @__PURE__ */ P({
655
655
  class: `${n}-toolbar-item`,
656
656
  title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
657
657
  onClick: () => {
658
- c("code");
658
+ s("code");
659
659
  }
660
- }, [t($, {
660
+ }, [t(y, {
661
661
  name: "code"
662
662
  }, null), e.showToolbarName && t("div", {
663
663
  class: `${n}-toolbar-item-name`
@@ -667,9 +667,9 @@ const Sl = /* @__PURE__ */ P({
667
667
  class: `${n}-toolbar-item`,
668
668
  title: (Le = l.value.toolbarTips) == null ? void 0 : Le.link,
669
669
  onClick: () => {
670
- v.type = "link", v.linkVisible = !0;
670
+ f.type = "link", f.linkVisible = !0;
671
671
  }
672
- }, [t($, {
672
+ }, [t(y, {
673
673
  name: "link"
674
674
  }, null), e.showToolbarName && t("div", {
675
675
  class: `${n}-toolbar-item-name`
@@ -677,19 +677,19 @@ const Sl = /* @__PURE__ */ P({
677
677
  case "image":
678
678
  return e.noUploadImg ? t("div", {
679
679
  class: `${n}-toolbar-item`,
680
- title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.image,
680
+ title: (Ee = l.value.toolbarTips) == null ? void 0 : Ee.image,
681
681
  onClick: () => {
682
- v.type = "image", v.linkVisible = !0;
682
+ f.type = "image", f.linkVisible = !0;
683
683
  }
684
- }, [t($, {
684
+ }, [t(y, {
685
685
  name: "image"
686
686
  }, null), e.showToolbarName && t("div", {
687
687
  class: `${n}-toolbar-item-name`
688
- }, [(Ee = l.value.toolbarTips) == null ? void 0 : Ee.image])]) : t(ie, {
688
+ }, [(Ie = l.value.toolbarTips) == null ? void 0 : Ie.image])]) : t(se, {
689
689
  relative: `#${m}`,
690
690
  visible: u.image,
691
- onChange: (p) => {
692
- u.image = p;
691
+ onChange: ($) => {
692
+ u.image = $;
693
693
  },
694
694
  overlay: t("ul", {
695
695
  class: `${n}-menu`,
@@ -697,61 +697,61 @@ const Sl = /* @__PURE__ */ P({
697
697
  u.title = !1;
698
698
  }
699
699
  }, [t("li", {
700
- class: `${n}-menu-item`,
700
+ class: `${n}-menu-item ${n}-menu-item-image`,
701
701
  onClick: () => {
702
- v.type = "image", v.linkVisible = !0;
702
+ f.type = "image", f.linkVisible = !0;
703
703
  }
704
704
  }, [(He = l.value.imgTitleItem) == null ? void 0 : He.link]), t("li", {
705
- class: `${n}-menu-item`,
705
+ class: `${n}-menu-item ${n}-menu-item-image`,
706
706
  onClick: () => {
707
707
  d.value.click();
708
708
  }
709
709
  }, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.upload]), t("li", {
710
- class: `${n}-menu-item`,
710
+ class: `${n}-menu-item ${n}-menu-item-image`,
711
711
  onClick: () => {
712
- v.clipVisible = !0;
712
+ f.clipVisible = !0;
713
713
  }
714
714
  }, [(Oe = l.value.imgTitleItem) == null ? void 0 : Oe.clip2upload])])
715
715
  }, {
716
716
  default: () => {
717
- var p, E;
717
+ var $, I;
718
718
  return [t("div", {
719
719
  class: `${n}-toolbar-item`,
720
- title: (p = l.value.toolbarTips) == null ? void 0 : p.image
721
- }, [t($, {
720
+ title: ($ = l.value.toolbarTips) == null ? void 0 : $.image
721
+ }, [t(y, {
722
722
  name: "image"
723
723
  }, null), e.showToolbarName && t("div", {
724
724
  class: `${n}-toolbar-item-name`
725
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.image])])];
725
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.image])])];
726
726
  }
727
727
  });
728
728
  case "table":
729
- return t(ie, {
729
+ return t(se, {
730
730
  relative: `#${m}`,
731
731
  visible: u.table,
732
- onChange: (p) => {
733
- u.table = p;
732
+ onChange: ($) => {
733
+ u.table = $;
734
734
  },
735
735
  key: "bar-table",
736
- overlay: t(Il, {
736
+ overlay: t(El, {
737
737
  tableShape: e.tableShape,
738
- onSelected: (p) => {
739
- c("table", {
740
- selectedShape: p
738
+ onSelected: ($) => {
739
+ s("table", {
740
+ selectedShape: $
741
741
  });
742
742
  }
743
743
  }, null)
744
744
  }, {
745
745
  default: () => {
746
- var p, E;
746
+ var $, I;
747
747
  return [t("div", {
748
748
  class: `${n}-toolbar-item`,
749
- title: (p = l.value.toolbarTips) == null ? void 0 : p.table
750
- }, [t($, {
749
+ title: ($ = l.value.toolbarTips) == null ? void 0 : $.table
750
+ }, [t(y, {
751
751
  name: "table"
752
752
  }, null), e.showToolbarName && t("div", {
753
753
  class: `${n}-toolbar-item-name`
754
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.table])])];
754
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.table])])];
755
755
  }
756
756
  });
757
757
  case "revoke":
@@ -759,21 +759,21 @@ const Sl = /* @__PURE__ */ P({
759
759
  class: `${n}-toolbar-item`,
760
760
  title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.revoke,
761
761
  onClick: () => {
762
- h.emit(o, It);
762
+ v.emit(o, It);
763
763
  }
764
- }, [t($, {
764
+ }, [t(y, {
765
765
  name: "revoke"
766
766
  }, null), e.showToolbarName && t("div", {
767
767
  class: `${n}-toolbar-item-name`
768
- }, [(Fe = l.value.toolbarTips) == null ? void 0 : Fe.revoke])]);
768
+ }, [(Be = l.value.toolbarTips) == null ? void 0 : Be.revoke])]);
769
769
  case "next":
770
770
  return t("div", {
771
771
  class: `${n}-toolbar-item`,
772
- title: (Be = l.value.toolbarTips) == null ? void 0 : Be.next,
772
+ title: (Fe = l.value.toolbarTips) == null ? void 0 : Fe.next,
773
773
  onClick: () => {
774
- h.emit(o, Dt);
774
+ v.emit(o, Et);
775
775
  }
776
- }, [t($, {
776
+ }, [t(y, {
777
777
  name: "next"
778
778
  }, null), e.showToolbarName && t("div", {
779
779
  class: `${n}-toolbar-item-name`
@@ -783,57 +783,57 @@ const Sl = /* @__PURE__ */ P({
783
783
  class: `${n}-toolbar-item`,
784
784
  title: (Pe = l.value.toolbarTips) == null ? void 0 : Pe.save,
785
785
  onClick: () => {
786
- h.emit(o, Lt);
786
+ v.emit(o, Dt);
787
787
  }
788
- }, [t($, {
788
+ }, [t(y, {
789
789
  name: "baocun"
790
790
  }, null), e.showToolbarName && t("div", {
791
791
  class: `${n}-toolbar-item-name`
792
- }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.save])]);
792
+ }, [(We = l.value.toolbarTips) == null ? void 0 : We.save])]);
793
793
  case "prettier":
794
794
  return e.noPrettier ? "" : t("div", {
795
795
  class: `${n}-toolbar-item`,
796
- title: (_e = l.value.toolbarTips) == null ? void 0 : _e.prettier,
796
+ title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier,
797
797
  onClick: () => {
798
- c("prettier");
798
+ s("prettier");
799
799
  }
800
- }, [t($, {
800
+ }, [t(y, {
801
801
  name: "prettier"
802
802
  }, null), e.showToolbarName && t("div", {
803
803
  class: `${n}-toolbar-item-name`
804
- }, [(qe = l.value.toolbarTips) == null ? void 0 : qe.prettier])]);
804
+ }, [(_e = l.value.toolbarTips) == null ? void 0 : _e.prettier])]);
805
805
  case "pageFullscreen":
806
806
  return !e.setting.fullscreen && t("div", {
807
807
  class: `${n}-toolbar-item`,
808
- title: (Ge = l.value.toolbarTips) == null ? void 0 : Ge.pageFullscreen,
808
+ title: (qe = l.value.toolbarTips) == null ? void 0 : qe.pageFullscreen,
809
809
  onClick: () => {
810
810
  e.updateSetting("pageFullscreen");
811
811
  }
812
- }, [t($, {
812
+ }, [t(y, {
813
813
  name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
814
814
  }, null), e.showToolbarName && t("div", {
815
815
  class: `${n}-toolbar-item-name`
816
- }, [(je = l.value.toolbarTips) == null ? void 0 : je.pageFullscreen])]);
816
+ }, [(ze = l.value.toolbarTips) == null ? void 0 : ze.pageFullscreen])]);
817
817
  case "fullscreen":
818
818
  return t("div", {
819
819
  class: `${n}-toolbar-item`,
820
- title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen,
820
+ title: (Ge = l.value.toolbarTips) == null ? void 0 : Ge.fullscreen,
821
821
  onClick: () => {
822
- r();
822
+ i();
823
823
  }
824
- }, [t($, {
824
+ }, [t(y, {
825
825
  name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
826
826
  }, null), e.showToolbarName && t("div", {
827
827
  class: `${n}-toolbar-item-name`
828
- }, [(We = l.value.toolbarTips) == null ? void 0 : We.fullscreen])]);
828
+ }, [(Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen])]);
829
829
  case "preview":
830
830
  return t("div", {
831
831
  class: `${n}-toolbar-item`,
832
- title: (ze = l.value.toolbarTips) == null ? void 0 : ze.preview,
832
+ title: (je = l.value.toolbarTips) == null ? void 0 : je.preview,
833
833
  onClick: () => {
834
834
  e.updateSetting("preview");
835
835
  }
836
- }, [t($, {
836
+ }, [t(y, {
837
837
  name: "preview"
838
838
  }, null), e.showToolbarName && t("div", {
839
839
  class: `${n}-toolbar-item-name`
@@ -845,7 +845,7 @@ const Sl = /* @__PURE__ */ P({
845
845
  onClick: () => {
846
846
  e.updateSetting("htmlPreview");
847
847
  }
848
- }, [t($, {
848
+ }, [t(y, {
849
849
  name: "coding"
850
850
  }, null), e.showToolbarName && t("div", {
851
851
  class: `${n}-toolbar-item-name`
@@ -855,10 +855,10 @@ const Sl = /* @__PURE__ */ P({
855
855
  class: `${n}-toolbar-item`,
856
856
  title: (Je = l.value.toolbarTips) == null ? void 0 : Je.catalog,
857
857
  onClick: () => {
858
- h.emit(o, Yt);
858
+ v.emit(o, Yt);
859
859
  },
860
860
  key: "bar-catalog"
861
- }, [t($, {
861
+ }, [t(y, {
862
862
  name: "catalog"
863
863
  }, null), e.showToolbarName && t("div", {
864
864
  class: `${n}-toolbar-item-name`
@@ -867,18 +867,18 @@ const Sl = /* @__PURE__ */ P({
867
867
  return t("div", {
868
868
  class: `${n}-toolbar-item`,
869
869
  title: (et = l.value.toolbarTips) == null ? void 0 : et.github,
870
- onClick: () => Gt("https://github.com/imzbf/md-editor-v3")
871
- }, [t($, {
870
+ onClick: () => qt("https://github.com/imzbf/md-editor-v3")
871
+ }, [t(y, {
872
872
  name: "github"
873
873
  }, null), e.showToolbarName && t("div", {
874
874
  class: `${n}-toolbar-item-name`
875
875
  }, [(tt = l.value.toolbarTips) == null ? void 0 : tt.github])]);
876
876
  case "mermaid":
877
- return t(ie, {
877
+ return t(se, {
878
878
  relative: `#${m}`,
879
879
  visible: u.mermaid,
880
- onChange: (p) => {
881
- u.mermaid = p;
880
+ onChange: ($) => {
881
+ u.mermaid = $;
882
882
  },
883
883
  overlay: t("ul", {
884
884
  class: `${n}-menu`,
@@ -886,66 +886,66 @@ const Sl = /* @__PURE__ */ P({
886
886
  u.mermaid = !1;
887
887
  }
888
888
  }, [t("li", {
889
- class: `${n}-menu-item`,
889
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
890
890
  onClick: () => {
891
- c("flow");
891
+ s("flow");
892
892
  }
893
893
  }, [(lt = l.value.mermaid) == null ? void 0 : lt.flow]), t("li", {
894
- class: `${n}-menu-item`,
894
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
895
895
  onClick: () => {
896
- c("sequence");
896
+ s("sequence");
897
897
  }
898
898
  }, [(ot = l.value.mermaid) == null ? void 0 : ot.sequence]), t("li", {
899
- class: `${n}-menu-item`,
899
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
900
900
  onClick: () => {
901
- c("gantt");
901
+ s("gantt");
902
902
  }
903
903
  }, [(at = l.value.mermaid) == null ? void 0 : at.gantt]), t("li", {
904
- class: `${n}-menu-item`,
904
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
905
905
  onClick: () => {
906
- c("class");
906
+ s("class");
907
907
  }
908
908
  }, [(nt = l.value.mermaid) == null ? void 0 : nt.class]), t("li", {
909
- class: `${n}-menu-item`,
909
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
910
910
  onClick: () => {
911
- c("state");
911
+ s("state");
912
912
  }
913
913
  }, [(rt = l.value.mermaid) == null ? void 0 : rt.state]), t("li", {
914
- class: `${n}-menu-item`,
914
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
915
915
  onClick: () => {
916
- c("pie");
916
+ s("pie");
917
917
  }
918
918
  }, [(it = l.value.mermaid) == null ? void 0 : it.pie]), t("li", {
919
- class: `${n}-menu-item`,
919
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
920
920
  onClick: () => {
921
- c("relationship");
921
+ s("relationship");
922
922
  }
923
923
  }, [(st = l.value.mermaid) == null ? void 0 : st.relationship]), t("li", {
924
- class: `${n}-menu-item`,
924
+ class: `${n}-menu-item ${n}-menu-item-mermaid`,
925
925
  onClick: () => {
926
- c("journey");
926
+ s("journey");
927
927
  }
928
928
  }, [(ct = l.value.mermaid) == null ? void 0 : ct.journey])]),
929
929
  key: "bar-mermaid"
930
930
  }, {
931
931
  default: () => {
932
- var p, E;
932
+ var $, I;
933
933
  return [t("div", {
934
934
  class: `${n}-toolbar-item`,
935
- title: (p = l.value.toolbarTips) == null ? void 0 : p.mermaid
936
- }, [t($, {
935
+ title: ($ = l.value.toolbarTips) == null ? void 0 : $.mermaid
936
+ }, [t(y, {
937
937
  name: "mermaid"
938
938
  }, null), e.showToolbarName && t("div", {
939
939
  class: `${n}-toolbar-item-name`
940
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.mermaid])])];
940
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.mermaid])])];
941
941
  }
942
942
  });
943
943
  case "katex":
944
- return t(ie, {
944
+ return t(se, {
945
945
  relative: `#${m}`,
946
946
  visible: u.katex,
947
- onChange: (p) => {
948
- u.katex = p;
947
+ onChange: ($) => {
948
+ u.katex = $;
949
949
  },
950
950
  overlay: t("ul", {
951
951
  class: `${n}-menu`,
@@ -953,49 +953,49 @@ const Sl = /* @__PURE__ */ P({
953
953
  u.katex = !1;
954
954
  }
955
955
  }, [t("li", {
956
- class: `${n}-menu-item`,
956
+ class: `${n}-menu-item ${n}-menu-item-katex`,
957
957
  onClick: () => {
958
- c("katexInline");
958
+ s("katexInline");
959
959
  }
960
960
  }, [(ut = l.value.katex) == null ? void 0 : ut.inline]), t("li", {
961
- class: `${n}-menu-item`,
961
+ class: `${n}-menu-item ${n}-menu-item-katex`,
962
962
  onClick: () => {
963
- c("katexBlock");
963
+ s("katexBlock");
964
964
  }
965
965
  }, [(dt = l.value.katex) == null ? void 0 : dt.block])]),
966
966
  key: "bar-katex"
967
967
  }, {
968
968
  default: () => {
969
- var p, E;
969
+ var $, I;
970
970
  return [t("div", {
971
971
  class: `${n}-toolbar-item`,
972
- title: (p = l.value.toolbarTips) == null ? void 0 : p.katex
973
- }, [t($, {
972
+ title: ($ = l.value.toolbarTips) == null ? void 0 : $.katex
973
+ }, [t(y, {
974
974
  name: "formula"
975
975
  }, null), e.showToolbarName && t("div", {
976
976
  class: `${n}-toolbar-item-name`
977
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.katex])])];
977
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.katex])])];
978
978
  }
979
979
  });
980
980
  }
981
981
  else if (e.defToolbars instanceof Array) {
982
- const p = e.defToolbars[f];
983
- return p ? mt(p, {
982
+ const $ = e.defToolbars[b];
983
+ return $ ? mt($, {
984
984
  theme: a.value,
985
- language: i.value,
985
+ language: r.value,
986
986
  insert(ve) {
987
- h.emit(o, w, "universal", {
987
+ v.emit(o, x, "universal", {
988
988
  generate: ve
989
989
  });
990
990
  }
991
991
  }) : "";
992
992
  } else if (e.defToolbars && e.defToolbars.children instanceof Array) {
993
- const p = e.defToolbars.children[f];
994
- return p ? mt(p, {
993
+ const $ = e.defToolbars.children[b];
994
+ return $ ? mt($, {
995
995
  theme: a.value,
996
- language: i.value,
996
+ language: r.value,
997
997
  insert(ve) {
998
- h.emit(o, w, "universal", {
998
+ v.emit(o, x, "universal", {
999
999
  generate: ve
1000
1000
  });
1001
1001
  }
@@ -1003,14 +1003,14 @@ const Sl = /* @__PURE__ */ P({
1003
1003
  } else
1004
1004
  return "";
1005
1005
  };
1006
- return V(() => e.toolbars, () => {
1006
+ return O(() => e.toolbars, () => {
1007
1007
  he(() => {
1008
- g.value && qt(g.value);
1008
+ g.value && _t(g.value);
1009
1009
  });
1010
1010
  }, {
1011
1011
  immediate: !0
1012
1012
  }), () => {
1013
- const f = y.value[0].map((T) => b(T)), C = y.value[1].map((T) => b(T));
1013
+ const b = k.value[0].map((T) => h(T)), p = k.value[1].map((T) => h(T));
1014
1014
  return t(Mt, null, [e.toolbars.length > 0 && t("div", {
1015
1015
  class: `${n}-toolbar-wrapper`,
1016
1016
  ref: g,
@@ -1019,10 +1019,10 @@ const Sl = /* @__PURE__ */ P({
1019
1019
  class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
1020
1020
  }, [t("div", {
1021
1021
  class: `${n}-toolbar-left`,
1022
- ref: x
1023
- }, [f]), t("div", {
1022
+ ref: w
1023
+ }, [b]), t("div", {
1024
1024
  class: `${n}-toolbar-right`
1025
- }, [C])])]), t("input", {
1025
+ }, [p])])]), t("input", {
1026
1026
  ref: d,
1027
1027
  accept: "image/*",
1028
1028
  type: "file",
@@ -1030,32 +1030,32 @@ const Sl = /* @__PURE__ */ P({
1030
1030
  style: {
1031
1031
  display: "none"
1032
1032
  }
1033
- }, null), t(Fl, {
1034
- linkVisible: v.linkVisible,
1035
- clipVisible: v.clipVisible,
1036
- type: v.type,
1033
+ }, null), t(Bl, {
1034
+ linkVisible: f.linkVisible,
1035
+ clipVisible: f.clipVisible,
1036
+ type: f.type,
1037
1037
  onCancel: () => {
1038
- v.linkVisible = !1, v.clipVisible = !1;
1038
+ f.linkVisible = !1, f.clipVisible = !1;
1039
1039
  },
1040
1040
  onOk: (T) => {
1041
- T && c(v.type, {
1041
+ T && s(f.type, {
1042
1042
  desc: T.desc,
1043
1043
  url: T.url
1044
- }), v.linkVisible = !1, v.clipVisible = !1;
1044
+ }), f.linkVisible = !1, f.clipVisible = !1;
1045
1045
  }
1046
1046
  }, null)]);
1047
1047
  };
1048
1048
  }
1049
1049
  }), Rl = (e, o) => {
1050
- const l = jt(() => {
1050
+ const l = zt(() => {
1051
1051
  e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
1052
- }, 50), a = (i) => {
1053
- const r = e.clientHeight, m = o.clientHeight, g = e.scrollHeight, u = o.scrollHeight, c = (g - r) / (u - m);
1054
- i.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1055
- top: e.scrollTop / c
1052
+ }, 50), a = (r) => {
1053
+ const i = e.clientHeight, m = o.clientHeight, g = e.scrollHeight, u = o.scrollHeight, s = (g - i) / (u - m);
1054
+ r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1055
+ top: e.scrollTop / s
1056
1056
  // behavior: 'smooth'
1057
1057
  }), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
1058
- top: o.scrollTop * c
1058
+ top: o.scrollTop * s
1059
1059
  // behavior: 'smooth'
1060
1060
  }), l());
1061
1061
  };
@@ -1070,319 +1070,319 @@ const Sl = /* @__PURE__ */ P({
1070
1070
  }
1071
1071
  ];
1072
1072
  }, Pl = (e, o, l) => {
1073
- const { view: a } = l, i = Kt(), r = (y) => a.lineBlockAt(a.state.doc.line(y).from).top, m = (y) => a.lineBlockAt(a.state.doc.line(y).from).height;
1073
+ const { view: a } = l, r = Gt(), i = (k) => a.lineBlockAt(a.state.doc.line(k).from).top, m = (k) => a.lineBlockAt(a.state.doc.line(k).from).height;
1074
1074
  let g = [];
1075
1075
  const u = () => {
1076
1076
  g = [];
1077
- const y = Array.from(o.querySelectorAll("[data-line]")).map(
1078
- (f) => Number(f.dataset.line) + 1
1077
+ const k = Array.from(o.querySelectorAll("[data-line]")).map(
1078
+ (b) => Number(b.dataset.line) + 1
1079
1079
  ), { lines: d } = a.state.doc;
1080
- let k = 1, b = y.shift() ?? d;
1081
- for (let f = 1; f <= d; f++)
1082
- f === b && (k = f, b = y.shift() || d + 1), g.push({
1083
- start: k,
1084
- end: b - 1
1080
+ let C = 1, h = k.shift() ?? d;
1081
+ for (let b = 1; b <= d; b++)
1082
+ b === h && (C = b, h = k.shift() || d + 1), g.push({
1083
+ start: C,
1084
+ end: h - 1
1085
1085
  });
1086
1086
  };
1087
- let c = 0, v = 0;
1088
- const x = Wt((y) => {
1089
- var C, T, S, D, I, le, oe;
1090
- if (!((C = o.firstElementChild) != null && C.firstElementChild))
1087
+ let s = 0, f = 0;
1088
+ const w = Kt((k) => {
1089
+ var p, T, S, D, E, oe, ae;
1090
+ if (!((p = o.firstElementChild) != null && p.firstElementChild))
1091
1091
  return;
1092
- const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: k } = a.state.doc.lineAt(d.from);
1093
- if (k > g.length || a.state.doc.lines < g[g.length - 1].end)
1092
+ const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: C } = a.state.doc.lineAt(d.from);
1093
+ if (C > g.length || a.state.doc.lines < g[g.length - 1].end)
1094
1094
  return;
1095
- let b = +getComputedStyle(o).paddingTop.replace("px", "");
1096
- const f = +getComputedStyle(o).paddingBottom.replace("px", "");
1097
- if (y.target === e) {
1098
- if (v !== 0)
1095
+ let h = +getComputedStyle(o).paddingTop.replace("px", "");
1096
+ const b = +getComputedStyle(o).paddingBottom.replace("px", "");
1097
+ if (k.target === e) {
1098
+ if (f !== 0)
1099
1099
  return;
1100
- c++;
1101
- const M = g[k - 1];
1102
- let L = r(M.end) + m(M.end), _ = 0;
1103
- const U = r(M.start), O = o.querySelector(`[data-line="${M.start - 1}"]`) || ((T = o.firstElementChild) == null ? void 0 : T.firstElementChild), H = o.querySelector(`[data-line="${M.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1104
- let N = 0, F = 0;
1105
- U === 0 ? O === H ? (b = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / L, N = H.offsetTop + H.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / L, N = H.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - U) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - U), F = O.offsetTop, N = o.scrollHeight - o.clientHeight - F + 10) : (_ = (a.scrollDOM.scrollTop - U) / (L - U), F = O.offsetTop, N = H.offsetTop - F);
1106
- const K = F - b + N * _;
1107
- i(o, K, () => {
1108
- c--;
1100
+ s++;
1101
+ const M = g[C - 1];
1102
+ let L = i(M.end) + m(M.end), _ = 0;
1103
+ const W = i(M.start), V = o.querySelector(`[data-line="${M.start - 1}"]`) || ((T = o.firstElementChild) == null ? void 0 : T.firstElementChild), H = o.querySelector(`[data-line="${M.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1104
+ let N = 0, B = 0;
1105
+ W === 0 ? V === H ? (h = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / L, N = H.offsetTop + H.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / L, N = H.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - W) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - W), B = V.offsetTop, N = o.scrollHeight - o.clientHeight - B + 10) : (_ = (a.scrollDOM.scrollTop - W) / (L - W), B = V.offsetTop, N = H.offsetTop - B);
1106
+ const K = B - h + N * _;
1107
+ r(o, K, () => {
1108
+ s--;
1109
1109
  });
1110
1110
  } else {
1111
- if (c !== 0)
1111
+ if (s !== 0)
1112
1112
  return;
1113
- v++;
1113
+ f++;
1114
1114
  const M = Array.from(
1115
1115
  o.querySelectorAll("[data-line]")
1116
1116
  ), L = o.scrollTop, _ = o.scrollHeight;
1117
- let U = M.length === 0 ? 1 : Math.ceil(
1117
+ let W = M.length === 0 ? 1 : Math.ceil(
1118
1118
  Number(M[M.length - 1].dataset.line) * (L / _)
1119
- ), O = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild;
1120
- for (let B = U; B >= 0; B--) {
1121
- const R = o.querySelector(`[data-line="${B}"]`);
1119
+ ), V = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild;
1120
+ for (let F = W; F >= 0; F--) {
1121
+ const R = o.querySelector(`[data-line="${F}"]`);
1122
1122
  if (R && R.offsetTop <= L) {
1123
- O = R, U = B;
1123
+ V = R, W = F;
1124
1124
  break;
1125
1125
  }
1126
1126
  }
1127
- let H = (I = o.firstElementChild) == null ? void 0 : I.firstElementChild, N = (le = o.firstElementChild) == null ? void 0 : le.lastElementChild;
1127
+ let H = (E = o.firstElementChild) == null ? void 0 : E.firstElementChild, N = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
1128
1128
  for (; M.length > 0; ) {
1129
- const B = M.indexOf(O);
1130
- if (B + 1 >= M.length)
1129
+ const F = M.indexOf(V);
1130
+ if (F + 1 >= M.length)
1131
1131
  break;
1132
- const R = M[B + 1];
1133
- if (B === -1) {
1132
+ const R = M[F + 1];
1133
+ if (F === -1) {
1134
1134
  N = R;
1135
1135
  break;
1136
1136
  }
1137
- const re = O.offsetTop;
1138
- if (re > L) {
1139
- if (B === 0) {
1140
- H = O, N = R;
1137
+ const ie = V.offsetTop;
1138
+ if (ie > L) {
1139
+ if (F === 0) {
1140
+ H = V, N = R;
1141
1141
  break;
1142
1142
  }
1143
- O = M[B - 1];
1143
+ V = M[F - 1];
1144
1144
  continue;
1145
1145
  }
1146
- const de = R.offsetTop;
1147
- if (re <= L && de > L) {
1148
- H = O, N = R;
1146
+ const me = R.offsetTop;
1147
+ if (ie <= L && me > L) {
1148
+ H = V, N = R;
1149
1149
  break;
1150
1150
  }
1151
- O = R;
1151
+ V = R;
1152
1152
  }
1153
- const F = H.offsetTop;
1154
- let K = N.offsetTop, W = 0;
1155
- const { start: ue, end: ae } = g[Number(H.dataset.line || 0)], X = r(ue);
1156
- let z = r(ae);
1157
- const ne = m(ae);
1158
- let Z = 0;
1159
- H === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (H === N ? (K = N.offsetHeight - o.offsetHeight + b + f, Z = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : Z = z + ne - X, W = Math.max(L / K, 0)) : z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (W = Math.max(
1160
- (L - F) / (o.scrollHeight - F - o.clientHeight),
1153
+ const B = H.offsetTop;
1154
+ let K = N.offsetTop, j = 0;
1155
+ const { start: de, end: ne } = g[Number(H.dataset.line || 0)], J = i(de);
1156
+ let Z = i(ne);
1157
+ const re = m(ne);
1158
+ let X = 0;
1159
+ H === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (H === N ? (K = N.offsetHeight - o.offsetHeight + h + b, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + re - J, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
1160
+ (L - B) / (o.scrollHeight - B - o.clientHeight),
1161
1161
  0
1162
- ), z = r(a.state.doc.lines) + m(a.state.doc.lines), Z = 8 + z - X - e.clientHeight) : (W = Math.max(
1163
- (L - F) / (K - F),
1162
+ ), Z = i(a.state.doc.lines) + m(a.state.doc.lines), X = 8 + Z - J - e.clientHeight) : (j = Math.max(
1163
+ (L - B) / (K - B),
1164
1164
  0
1165
- ), Z = z + ne - X), i(e, X + Z * W, () => {
1166
- v--;
1165
+ ), X = Z + re - J), r(e, J + X * j, () => {
1166
+ f--;
1167
1167
  });
1168
1168
  }
1169
1169
  }, 10);
1170
1170
  return [
1171
1171
  () => {
1172
- u(), e.addEventListener("scroll", x), o.addEventListener("scroll", x), e.dispatchEvent(new Event("scroll"));
1172
+ u(), e.addEventListener("scroll", w), o.addEventListener("scroll", w), e.dispatchEvent(new Event("scroll"));
1173
1173
  },
1174
1174
  () => {
1175
- g = [], e.removeEventListener("scroll", x), o.removeEventListener("scroll", x);
1175
+ g = [], e.removeEventListener("scroll", w), o.removeEventListener("scroll", w);
1176
1176
  }
1177
1177
  ];
1178
- }, Ul = (e, o, l) => {
1178
+ }, Wl = (e, o, l) => {
1179
1179
  const a = A("editorId");
1180
- let i = () => {
1181
- }, r = () => {
1180
+ let r = () => {
1181
+ }, i = () => {
1182
1182
  };
1183
1183
  const m = () => {
1184
- i();
1184
+ r();
1185
1185
  const g = document.querySelector(
1186
1186
  `#${a} .cm-scroller`
1187
1187
  ), u = document.querySelector(
1188
1188
  `[id="${a}-preview-wrapper"][data-show="true"]`
1189
- ), c = document.querySelector(
1189
+ ), s = document.querySelector(
1190
1190
  `[id="${a}-html-wrapper"][data-show="true"]`
1191
1191
  );
1192
- (u || c) && ([r, i] = (u ? Pl : Rl)(
1192
+ (u || s) && ([i, r] = (u ? Pl : Rl)(
1193
1193
  g,
1194
- u || c,
1194
+ u || s,
1195
1195
  l.value
1196
- )), e.scrollAuto && r();
1196
+ )), e.scrollAuto && i();
1197
1197
  };
1198
- V(
1198
+ O(
1199
1199
  [
1200
1200
  o,
1201
- me(e.setting, "preview"),
1202
- me(e.setting, "htmlPreview"),
1203
- me(e.setting, "fullscreen"),
1204
- me(e.setting, "pageFullscreen")
1201
+ te(e.setting, "preview"),
1202
+ te(e.setting, "htmlPreview"),
1203
+ te(e.setting, "fullscreen"),
1204
+ te(e.setting, "pageFullscreen")
1205
1205
  ],
1206
1206
  () => {
1207
1207
  he(m);
1208
1208
  }
1209
- ), V(
1209
+ ), O(
1210
1210
  () => e.scrollAuto,
1211
1211
  (g) => {
1212
- g ? r() : i();
1212
+ g ? i() : r();
1213
1213
  }
1214
- ), J(m);
1215
- }, _l = Ul, ql = (e, o, l) => {
1216
- var v, x, y, d, k, b;
1217
- let a = "", i = 0, r = 0, m = !0, g = !1;
1218
- const u = o.getSelectedText(), c = (v = Y.editorConfig) == null ? void 0 : v.mermaidTemplate;
1214
+ ), Y(m);
1215
+ }, Ul = Wl, _l = (e, o, l) => {
1216
+ var f, w, k, d, C, h;
1217
+ let a = "", r = 0, i = 0, m = !0, g = !1;
1218
+ const u = o.getSelectedText(), s = (f = Q.editorConfig) == null ? void 0 : f.mermaidTemplate;
1219
1219
  if (/^h[1-6]{1}$/.test(e)) {
1220
- const f = e.replace(/^h(\d)/, (C, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1221
- a = `${f} ${u}`, i = f.length + 1;
1220
+ const b = e.replace(/^h(\d)/, (p, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1221
+ a = `${b} ${u}`, r = b.length + 1;
1222
1222
  } else if (e === "prettier") {
1223
- const f = window.prettier || ((y = (x = Y.editorExtensions) == null ? void 0 : x.prettier) == null ? void 0 : y.prettierInstance), C = [
1224
- ((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((b = (k = Y.editorExtensions) == null ? void 0 : k.prettier) == null ? void 0 : b.parserMarkdownInstance)
1223
+ const b = window.prettier || ((k = (w = Q.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : k.prettierInstance), p = [
1224
+ ((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((h = (C = Q.editorExtensions) == null ? void 0 : C.prettier) == null ? void 0 : h.parserMarkdownInstance)
1225
1225
  ];
1226
- !f || C[0] === void 0 ? (h.emit(l.editorId, te, {
1226
+ !b || p[0] === void 0 ? (v.emit(l.editorId, le, {
1227
1227
  name: "prettier",
1228
1228
  message: "prettier is undefined"
1229
- }), a = o.getValue()) : a = f.format(o.getValue(), {
1229
+ }), a = o.getValue()) : a = b.format(o.getValue(), {
1230
1230
  parser: "markdown",
1231
- plugins: C
1231
+ plugins: p
1232
1232
  }), m = !1, g = !0;
1233
1233
  } else
1234
1234
  switch (e) {
1235
1235
  case "bold": {
1236
- a = `**${u}**`, i = 2, r = -2;
1236
+ a = `**${u}**`, r = 2, i = -2;
1237
1237
  break;
1238
1238
  }
1239
1239
  case "underline": {
1240
- a = `<u>${u}</u>`, i = 3, r = -4;
1240
+ a = `<u>${u}</u>`, r = 3, i = -4;
1241
1241
  break;
1242
1242
  }
1243
1243
  case "italic": {
1244
- a = `*${u}*`, i = 1, r = -1;
1244
+ a = `*${u}*`, r = 1, i = -1;
1245
1245
  break;
1246
1246
  }
1247
1247
  case "strikeThrough": {
1248
- a = `~~${u}~~`, i = 2, r = -2;
1248
+ a = `~~${u}~~`, r = 2, i = -2;
1249
1249
  break;
1250
1250
  }
1251
1251
  case "sub": {
1252
- a = `<sub>${u}</sub>`, i = 5, r = -6;
1252
+ a = `<sub>${u}</sub>`, r = 5, i = -6;
1253
1253
  break;
1254
1254
  }
1255
1255
  case "sup": {
1256
- a = `<sup>${u}</sup>`, i = 5, r = -6;
1256
+ a = `<sup>${u}</sup>`, r = 5, i = -6;
1257
1257
  break;
1258
1258
  }
1259
1259
  case "codeRow": {
1260
- a = "`" + u + "`", i = 1, r = -1;
1260
+ a = "`" + u + "`", r = 1, i = -1;
1261
1261
  break;
1262
1262
  }
1263
1263
  case "quote": {
1264
- a = `> ${u}`, i = 2;
1264
+ a = `> ${u}`, r = 2;
1265
1265
  break;
1266
1266
  }
1267
1267
  case "orderedList": {
1268
- a = `1. ${u}`, i = 3;
1268
+ a = `1. ${u}`, r = 3;
1269
1269
  break;
1270
1270
  }
1271
1271
  case "unorderedList": {
1272
- a = `- ${u}`, i = 2;
1272
+ a = `- ${u}`, r = 2;
1273
1273
  break;
1274
1274
  }
1275
1275
  case "task": {
1276
- a = `- [ ] ${u}`, i = 6;
1276
+ a = `- [ ] ${u}`, r = 6;
1277
1277
  break;
1278
1278
  }
1279
1279
  case "code": {
1280
- const f = l.text || u || "", C = l.mode || "language";
1281
- a = `\`\`\`${C}
1282
- ${f}
1280
+ const b = l.text || u || "", p = l.mode || "language";
1281
+ a = `\`\`\`${p}
1282
+ ${b}
1283
1283
  \`\`\`
1284
- `, i = 3, r = 3 + C.length - a.length;
1284
+ `, r = 3, i = 3 + p.length - a.length;
1285
1285
  break;
1286
1286
  }
1287
1287
  case "table": {
1288
1288
  a = "|";
1289
- const { selectedShape: f = { x: 1, y: 1 } } = l, { x: C, y: T } = f;
1289
+ const { selectedShape: b = { x: 1, y: 1 } } = l, { x: p, y: T } = b;
1290
1290
  for (let S = 0; S <= T; S++)
1291
1291
  a += " col |";
1292
1292
  a += `
1293
1293
  |`;
1294
1294
  for (let S = 0; S <= T; S++)
1295
1295
  a += " - |";
1296
- for (let S = 0; S <= C; S++) {
1296
+ for (let S = 0; S <= p; S++) {
1297
1297
  a += `
1298
1298
  |`;
1299
1299
  for (let D = 0; D <= T; D++)
1300
1300
  a += " content |";
1301
1301
  }
1302
- i = 2, r = 5 - a.length;
1302
+ r = 2, i = 5 - a.length;
1303
1303
  break;
1304
1304
  }
1305
1305
  case "link": {
1306
- const { desc: f, url: C } = l;
1307
- a = `[${f}](${C})`, m = !1;
1306
+ const { desc: b, url: p } = l;
1307
+ a = `[${b}](${p})`, m = !1;
1308
1308
  break;
1309
1309
  }
1310
1310
  case "image": {
1311
- const { desc: f, url: C, urls: T } = l;
1312
- T instanceof Array ? a = T.reduce((S, D) => S + `![${f}](${D})
1313
- `, "") : a = `![${f}](${C})
1311
+ const { desc: b, url: p, urls: T } = l;
1312
+ T instanceof Array ? a = T.reduce((S, D) => S + `![${b}](${D})
1313
+ `, "") : a = `![${b}](${p})
1314
1314
  `, m = !1;
1315
1315
  break;
1316
1316
  }
1317
1317
  case "flow": {
1318
1318
  a = `\`\`\`mermaid
1319
- ${(c == null ? void 0 : c.flow) || `flowchart TD
1319
+ ${(s == null ? void 0 : s.flow) || `flowchart TD
1320
1320
  Start --> Stop`}
1321
1321
  \`\`\`
1322
- `, i = 3, r = 10 - a.length;
1322
+ `, r = 3, i = 10 - a.length;
1323
1323
  break;
1324
1324
  }
1325
1325
  case "sequence": {
1326
1326
  a = `\`\`\`mermaid
1327
- ${(c == null ? void 0 : c.sequence) || `sequenceDiagram
1327
+ ${(s == null ? void 0 : s.sequence) || `sequenceDiagram
1328
1328
  A->>B: hello!
1329
1329
  B-->>A: hi!
1330
1330
  A-)B: bye!`}
1331
1331
  \`\`\`
1332
- `, i = 3, r = 10 - a.length;
1332
+ `, r = 3, i = 10 - a.length;
1333
1333
  break;
1334
1334
  }
1335
1335
  case "gantt": {
1336
1336
  a = `\`\`\`mermaid
1337
- ${(c == null ? void 0 : c.gantt) || `gantt
1337
+ ${(s == null ? void 0 : s.gantt) || `gantt
1338
1338
  title A Gantt Diagram
1339
1339
  dateFormat YYYY-MM-DD
1340
1340
  section Section
1341
1341
  A task :a1, 2014-01-01, 30d
1342
1342
  Another task :after a1, 20d`}
1343
1343
  \`\`\`
1344
- `, i = 3, r = 10 - a.length;
1344
+ `, r = 3, i = 10 - a.length;
1345
1345
  break;
1346
1346
  }
1347
1347
  case "class": {
1348
1348
  a = `\`\`\`mermaid
1349
- ${(c == null ? void 0 : c.class) || `classDiagram
1349
+ ${(s == null ? void 0 : s.class) || `classDiagram
1350
1350
  class Animal
1351
1351
  Vehicle <|-- Car`}
1352
1352
  \`\`\`
1353
- `, i = 3, r = 10 - a.length;
1353
+ `, r = 3, i = 10 - a.length;
1354
1354
  break;
1355
1355
  }
1356
1356
  case "state": {
1357
1357
  a = `\`\`\`mermaid
1358
- ${(c == null ? void 0 : c.state) || `stateDiagram-v2
1358
+ ${(s == null ? void 0 : s.state) || `stateDiagram-v2
1359
1359
  s1 --> s2`}
1360
1360
  \`\`\`
1361
- `, i = 3, r = 10 - a.length;
1361
+ `, r = 3, i = 10 - a.length;
1362
1362
  break;
1363
1363
  }
1364
1364
  case "pie": {
1365
1365
  a = `\`\`\`mermaid
1366
- ${(c == null ? void 0 : c.pie) || `pie title Pets adopted by volunteers
1366
+ ${(s == null ? void 0 : s.pie) || `pie title Pets adopted by volunteers
1367
1367
  "Dogs" : 386
1368
1368
  "Cats" : 85
1369
1369
  "Rats" : 15`}
1370
1370
  \`\`\`
1371
- `, i = 3, r = 10 - a.length;
1371
+ `, r = 3, i = 10 - a.length;
1372
1372
  break;
1373
1373
  }
1374
1374
  case "relationship": {
1375
1375
  a = `\`\`\`mermaid
1376
- ${(c == null ? void 0 : c.relationship) || `erDiagram
1376
+ ${(s == null ? void 0 : s.relationship) || `erDiagram
1377
1377
  CAR ||--o{ NAMED-DRIVER : allows
1378
1378
  PERSON ||--o{ NAMED-DRIVER : is`}
1379
1379
  \`\`\`
1380
- `, i = 3, r = 10 - a.length;
1380
+ `, r = 3, i = 10 - a.length;
1381
1381
  break;
1382
1382
  }
1383
1383
  case "journey": {
1384
1384
  a = `\`\`\`mermaid
1385
- ${(c == null ? void 0 : c.journey) || `journey
1385
+ ${(s == null ? void 0 : s.journey) || `journey
1386
1386
  title My working day
1387
1387
  section Go to work
1388
1388
  Make tea: 5: Me
@@ -1392,23 +1392,23 @@ ${(c == null ? void 0 : c.journey) || `journey
1392
1392
  Go downstairs: 5: Me
1393
1393
  Sit down: 5: Me`}
1394
1394
  \`\`\`
1395
- `, i = 3, r = 10 - a.length;
1395
+ `, r = 3, i = 10 - a.length;
1396
1396
  break;
1397
1397
  }
1398
1398
  case "katexInline": {
1399
- a = "$$", i = 1, r = -1;
1399
+ a = "$$", r = 1, i = -1;
1400
1400
  break;
1401
1401
  }
1402
1402
  case "katexBlock": {
1403
1403
  a = `$$
1404
1404
 
1405
1405
  $$
1406
- `, i = 3, r = -4;
1406
+ `, r = 3, i = -4;
1407
1407
  break;
1408
1408
  }
1409
1409
  case "universal": {
1410
- const { generate: f } = l, C = f(u);
1411
- a = C.targetValue, m = C.select, i = C.deviationStart, r = C.deviationEnd;
1410
+ const { generate: b } = l, p = b(u);
1411
+ a = p.targetValue, m = p.select, r = p.deviationStart, i = p.deviationEnd;
1412
1412
  }
1413
1413
  }
1414
1414
  return {
@@ -1417,17 +1417,17 @@ $$
1417
1417
  // 是否选中
1418
1418
  select: m,
1419
1419
  // 选中时,开始位置的偏移量
1420
- deviationStart: i,
1420
+ deviationStart: r,
1421
1421
  // 结束的偏移量
1422
- deviationEnd: r,
1422
+ deviationEnd: i,
1423
1423
  // 是否整个替换
1424
1424
  replaceAll: g
1425
1425
  }
1426
1426
  };
1427
- }, Gl = "#e5c07b", ft = "var(--md-color)", jl = "#56b6c2", Kl = "#ffffff", se = "var(--md-color)", bt = "#e5c07b", Wl = "#e5c07b", zl = "var(--md-color)", ht = "#d19a66", Zl = "#c678dd", Xl = "#21252b", Yl = "#2c313a", vt = "var(--md-bk-color)", Ce = "var(--md-bk-color)", Jl = "#ceedfa33", kt = "#528bff", Ql = xe.theme(
1427
+ }, ql = "#e5c07b", ft = "var(--md-color)", zl = "#56b6c2", Gl = "#ffffff", ce = "var(--md-color)", bt = "#e5c07b", Kl = "#e5c07b", jl = "var(--md-color)", ht = "#d19a66", Zl = "#c678dd", Xl = "#21252b", Yl = "#2c313a", vt = "var(--md-bk-color)", Ce = "var(--md-bk-color)", Jl = "#ceedfa33", kt = "#528bff", Ql = xe.theme(
1428
1428
  {
1429
1429
  "&": {
1430
- color: se,
1430
+ color: ce,
1431
1431
  backgroundColor: vt
1432
1432
  },
1433
1433
  ".cm-content": {
@@ -1435,7 +1435,7 @@ $$
1435
1435
  },
1436
1436
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: kt },
1437
1437
  "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Jl },
1438
- ".cm-panels": { backgroundColor: Xl, color: se },
1438
+ ".cm-panels": { backgroundColor: Xl, color: ce },
1439
1439
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1440
1440
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1441
1441
  ".cm-searchMatch": {
@@ -1452,7 +1452,7 @@ $$
1452
1452
  },
1453
1453
  ".cm-gutters": {
1454
1454
  backgroundColor: vt,
1455
- color: se,
1455
+ color: ce,
1456
1456
  borderRight: "1px solid",
1457
1457
  borderColor: "var(--md-border-color)"
1458
1458
  },
@@ -1478,58 +1478,58 @@ $$
1478
1478
  },
1479
1479
  ".cm-tooltip-autocomplete": {
1480
1480
  "& > ul > li[aria-selected]": {
1481
- color: se
1481
+ color: ce
1482
1482
  }
1483
1483
  }
1484
1484
  },
1485
1485
  { dark: !0 }
1486
- ), eo = Ht.define([
1487
- { tag: s.keyword, color: Zl },
1488
- { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: ft },
1489
- { tag: [s.function(s.variableName), s.labelName], color: Wl },
1490
- { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: ht },
1491
- { tag: [s.definition(s.name), s.separator], color: se },
1486
+ ), eo = Nt.define([
1487
+ { tag: c.keyword, color: Zl },
1488
+ { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: ft },
1489
+ { tag: [c.function(c.variableName), c.labelName], color: Kl },
1490
+ { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: ht },
1491
+ { tag: [c.definition(c.name), c.separator], color: ce },
1492
1492
  {
1493
1493
  tag: [
1494
- s.typeName,
1495
- s.className,
1496
- s.number,
1497
- s.changed,
1498
- s.annotation,
1499
- s.modifier,
1500
- s.self,
1501
- s.namespace
1494
+ c.typeName,
1495
+ c.className,
1496
+ c.number,
1497
+ c.changed,
1498
+ c.annotation,
1499
+ c.modifier,
1500
+ c.self,
1501
+ c.namespace
1502
1502
  ],
1503
- color: Gl
1503
+ color: ql
1504
1504
  },
1505
1505
  {
1506
1506
  tag: [
1507
- s.operator,
1508
- s.operatorKeyword,
1509
- s.url,
1510
- s.escape,
1511
- s.regexp,
1512
- s.link,
1513
- s.special(s.string)
1507
+ c.operator,
1508
+ c.operatorKeyword,
1509
+ c.url,
1510
+ c.escape,
1511
+ c.regexp,
1512
+ c.link,
1513
+ c.special(c.string)
1514
1514
  ],
1515
- color: jl
1515
+ color: zl
1516
1516
  },
1517
- { tag: [s.meta, s.comment], color: bt },
1518
- { tag: s.strong, fontWeight: "bold" },
1519
- { tag: s.emphasis, fontStyle: "italic" },
1520
- { tag: s.strikethrough, textDecoration: "line-through" },
1521
- { tag: s.link, color: bt, textDecoration: "underline" },
1522
- { tag: s.heading, fontWeight: "bold", color: ft },
1523
- { tag: [s.atom, s.bool, s.special(s.variableName)], color: ht },
1524
- { tag: [s.processingInstruction, s.string, s.inserted], color: zl },
1525
- { tag: s.invalid, color: Kl }
1517
+ { tag: [c.meta, c.comment], color: bt },
1518
+ { tag: c.strong, fontWeight: "bold" },
1519
+ { tag: c.emphasis, fontStyle: "italic" },
1520
+ { tag: c.strikethrough, textDecoration: "line-through" },
1521
+ { tag: c.link, color: bt, textDecoration: "underline" },
1522
+ { tag: c.heading, fontWeight: "bold", color: ft },
1523
+ { tag: [c.atom, c.bool, c.special(c.variableName)], color: ht },
1524
+ { tag: [c.processingInstruction, c.string, c.inserted], color: jl },
1525
+ { tag: c.invalid, color: Gl }
1526
1526
  ]), Ct = [
1527
1527
  Ql,
1528
- Nt(eo)
1529
- ], to = "#e5c07b", pt = "#3f4a54", lo = "#56b6c2", oo = "#fff", ce = "#3f4a54", $t = "#2d8cf0", ao = "#2d8cf0", no = "#3f4a54", yt = "#d19a66", ro = "#c678dd", io = "#21252b", so = "#ceedfa33", Tt = "var(--md-bk-color)", pe = "var(--md-bk-color)", co = "#bad5fa", wt = "#3f4a54", uo = xe.theme(
1528
+ Ot(eo)
1529
+ ], to = "#e5c07b", pt = "#3f4a54", lo = "#56b6c2", oo = "#fff", ue = "#3f4a54", $t = "#2d8cf0", ao = "#2d8cf0", no = "#3f4a54", yt = "#d19a66", ro = "#c678dd", io = "#21252b", so = "#ceedfa33", Tt = "var(--md-bk-color)", pe = "var(--md-bk-color)", co = "#bad5fa", wt = "#3f4a54", uo = xe.theme(
1530
1530
  {
1531
1531
  "&": {
1532
- color: ce,
1532
+ color: ue,
1533
1533
  backgroundColor: Tt
1534
1534
  },
1535
1535
  ".cm-content": {
@@ -1537,7 +1537,7 @@ $$
1537
1537
  },
1538
1538
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: wt },
1539
1539
  "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: co },
1540
- ".cm-panels": { backgroundColor: io, color: ce },
1540
+ ".cm-panels": { backgroundColor: io, color: ue },
1541
1541
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1542
1542
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1543
1543
  ".cm-searchMatch": {
@@ -1554,7 +1554,7 @@ $$
1554
1554
  },
1555
1555
  ".cm-gutters": {
1556
1556
  backgroundColor: Tt,
1557
- color: ce,
1557
+ color: ue,
1558
1558
  borderRight: "1px solid",
1559
1559
  borderColor: "var(--md-border-color)"
1560
1560
  },
@@ -1580,73 +1580,73 @@ $$
1580
1580
  },
1581
1581
  ".cm-tooltip-autocomplete": {
1582
1582
  "& > ul > li[aria-selected]": {
1583
- color: ce
1583
+ color: ue
1584
1584
  }
1585
1585
  }
1586
1586
  }
1587
1587
  // { dark: true }
1588
- ), mo = Ht.define([
1589
- { tag: s.keyword, color: ro },
1590
- { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: pt },
1591
- { tag: [s.function(s.variableName), s.labelName], color: ao },
1592
- { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: yt },
1593
- { tag: [s.definition(s.name), s.separator], color: ce },
1588
+ ), mo = Nt.define([
1589
+ { tag: c.keyword, color: ro },
1590
+ { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: pt },
1591
+ { tag: [c.function(c.variableName), c.labelName], color: ao },
1592
+ { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: yt },
1593
+ { tag: [c.definition(c.name), c.separator], color: ue },
1594
1594
  {
1595
1595
  tag: [
1596
- s.typeName,
1597
- s.className,
1598
- s.number,
1599
- s.changed,
1600
- s.annotation,
1601
- s.modifier,
1602
- s.self,
1603
- s.namespace
1596
+ c.typeName,
1597
+ c.className,
1598
+ c.number,
1599
+ c.changed,
1600
+ c.annotation,
1601
+ c.modifier,
1602
+ c.self,
1603
+ c.namespace
1604
1604
  ],
1605
1605
  color: to
1606
1606
  },
1607
1607
  {
1608
1608
  tag: [
1609
- s.operator,
1610
- s.operatorKeyword,
1611
- s.url,
1612
- s.escape,
1613
- s.regexp,
1614
- s.link,
1615
- s.special(s.string)
1609
+ c.operator,
1610
+ c.operatorKeyword,
1611
+ c.url,
1612
+ c.escape,
1613
+ c.regexp,
1614
+ c.link,
1615
+ c.special(c.string)
1616
1616
  ],
1617
1617
  color: lo
1618
1618
  },
1619
- { tag: [s.meta, s.comment], color: $t },
1620
- { tag: s.strong, fontWeight: "bold" },
1621
- { tag: s.emphasis, fontStyle: "italic" },
1622
- { tag: s.strikethrough, textDecoration: "line-through" },
1623
- { tag: s.link, color: $t, textDecoration: "underline" },
1624
- { tag: s.heading, fontWeight: "bold", color: pt },
1625
- { tag: [s.atom, s.bool, s.special(s.variableName)], color: yt },
1626
- { tag: [s.processingInstruction, s.string, s.inserted], color: no },
1627
- { tag: s.invalid, color: oo }
1619
+ { tag: [c.meta, c.comment], color: $t },
1620
+ { tag: c.strong, fontWeight: "bold" },
1621
+ { tag: c.emphasis, fontStyle: "italic" },
1622
+ { tag: c.strikethrough, textDecoration: "line-through" },
1623
+ { tag: c.link, color: $t, textDecoration: "underline" },
1624
+ { tag: c.heading, fontWeight: "bold", color: pt },
1625
+ { tag: [c.atom, c.bool, c.special(c.variableName)], color: yt },
1626
+ { tag: [c.processingInstruction, c.string, c.inserted], color: no },
1627
+ { tag: c.invalid, color: oo }
1628
1628
  ]), xt = [
1629
1629
  uo,
1630
- Nt(mo)
1631
- ], fe = (e, o, l, a, i) => (r, m, g, u) => {
1632
- const c = `${e}${o}`.slice(u - g);
1633
- r.dispatch(r.state.replaceSelection(`${c}${l}${a}`));
1634
- const v = g + m.label.length + (i === "title" ? l.length : 0);
1635
- r.dispatch({
1636
- selection: G.create(
1630
+ Ot(mo)
1631
+ ], fe = (e, o, l, a, r) => (i, m, g, u) => {
1632
+ const s = `${e}${o}`.slice(u - g);
1633
+ i.dispatch(i.state.replaceSelection(`${s}${l}${a}`));
1634
+ const f = g + m.label.length + (r === "title" ? l.length : 0);
1635
+ i.dispatch({
1636
+ selection: z.create(
1637
1637
  [
1638
- G.range(
1639
- g + m.label.length + (i === "title" ? 1 : -o.length),
1640
- v
1638
+ z.range(
1639
+ g + m.label.length + (r === "title" ? 1 : -o.length),
1640
+ f
1641
1641
  ),
1642
- G.cursor(v)
1642
+ z.cursor(f)
1643
1643
  ],
1644
1644
  1
1645
1645
  )
1646
- }), r.focus();
1647
- }, St = (e) => (o, l, a, i) => {
1648
- const r = e.slice(i - a);
1649
- o.dispatch(o.state.replaceSelection(`${r} `));
1646
+ }), i.focus();
1647
+ }, St = (e) => (o, l, a, r) => {
1648
+ const i = e.slice(r - a);
1649
+ o.dispatch(o.state.replaceSelection(`${i} `));
1650
1650
  }, go = (e) => {
1651
1651
  const o = (l) => {
1652
1652
  const a = l.matchBefore(
@@ -1656,8 +1656,8 @@ $$
1656
1656
  from: a.from,
1657
1657
  options: [
1658
1658
  // 标题
1659
- ...["h1", "h2", "h3", "h4", "h5", "h6"].map((i, r) => {
1660
- const m = new Array(r + 1).fill("#").join("");
1659
+ ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
1660
+ const m = new Array(i + 1).fill("#").join("");
1661
1661
  return {
1662
1662
  label: m,
1663
1663
  type: "text",
@@ -1665,12 +1665,12 @@ $$
1665
1665
  };
1666
1666
  }),
1667
1667
  // 任务列表
1668
- ...["unchecked", "checked"].map((i) => {
1669
- const r = i === "checked" ? "- [x]" : "- [ ]";
1668
+ ...["unchecked", "checked"].map((r) => {
1669
+ const i = r === "checked" ? "- [x]" : "- [ ]";
1670
1670
  return {
1671
- label: r,
1671
+ label: i,
1672
1672
  type: "text",
1673
- apply: St(r)
1673
+ apply: St(i)
1674
1674
  };
1675
1675
  }),
1676
1676
  // 代码
@@ -1678,10 +1678,10 @@ $$
1678
1678
  ["`", ""],
1679
1679
  ["```", "language"],
1680
1680
  ["```mermaid\n", ""]
1681
- ].map((i) => ({
1682
- label: `${i[0]}${i[1]}`,
1681
+ ].map((r) => ({
1682
+ label: `${r[0]}${r[1]}`,
1683
1683
  type: "text",
1684
- apply: fe(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
1684
+ apply: fe(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1685
1685
  })),
1686
1686
  // 链接
1687
1687
  {
@@ -1733,10 +1733,10 @@ $$`, "title")
1733
1733
  "caution",
1734
1734
  "error",
1735
1735
  "attention"
1736
- ].map((i) => ({
1737
- label: `!!! ${i}`,
1736
+ ].map((r) => ({
1737
+ label: `!!! ${r}`,
1738
1738
  type: "text",
1739
- apply: fe("!!!", ` ${i}`, " Title", `
1739
+ apply: fe("!!!", ` ${r}`, " Title", `
1740
1740
 
1741
1741
  !!!`, "title")
1742
1742
  }))
@@ -1746,7 +1746,7 @@ $$`, "title")
1746
1746
  return dl({
1747
1747
  override: e ? [o, ...e] : [o]
1748
1748
  });
1749
- }, At = go, Q = (e) => {
1749
+ }, At = go, ee = (e) => {
1750
1750
  const o = new be();
1751
1751
  return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
1752
1752
  effects: nl.appendConfig.of(o.of(a))
@@ -1766,7 +1766,7 @@ class fo {
1766
1766
  q(this, "toggleDisabled");
1767
1767
  q(this, "toggleReadOnly");
1768
1768
  q(this, "toggleMaxlength");
1769
- this.view = o, this.toggleTabSize = Q(this.view), this.togglePlaceholder = Q(this.view), this.setExtensions = Q(this.view), this.toggleDisabled = Q(this.view), this.toggleReadOnly = Q(this.view), this.toggleMaxlength = Q(this.view);
1769
+ this.view = o, this.toggleTabSize = ee(this.view), this.togglePlaceholder = ee(this.view), this.setExtensions = ee(this.view), this.toggleDisabled = ee(this.view), this.toggleReadOnly = ee(this.view), this.toggleMaxlength = ee(this.view);
1770
1770
  }
1771
1771
  getValue() {
1772
1772
  return this.view.state.doc.toString();
@@ -1818,29 +1818,29 @@ class fo {
1818
1818
  }
1819
1819
  if (this.view.state.doc.length - this.getSelectedText().length + o.length > this.maxLength)
1820
1820
  throw new Error("The input text is too long");
1821
- const { from: i } = this.view.state.selection.main;
1821
+ const { from: r } = this.view.state.selection.main;
1822
1822
  if (this.view.dispatch(this.view.state.replaceSelection(o)), l.select) {
1823
- const r = i + o.length + l.deviationEnd;
1823
+ const i = r + o.length + l.deviationEnd;
1824
1824
  this.view.dispatch({
1825
- selection: G.create(
1825
+ selection: z.create(
1826
1826
  [
1827
- G.range(i + l.deviationStart, r),
1828
- G.cursor(r)
1827
+ z.range(r + l.deviationStart, i),
1828
+ z.cursor(i)
1829
1829
  ],
1830
1830
  1
1831
1831
  )
1832
1832
  });
1833
1833
  }
1834
1834
  this.view.focus();
1835
- } catch (i) {
1836
- if (i.message === "The input text is too long")
1837
- h.emit(a, te, {
1835
+ } catch (r) {
1836
+ if (r.message === "The input text is too long")
1837
+ v.emit(a, le, {
1838
1838
  name: "overlength",
1839
- message: i.message,
1839
+ message: r.message,
1840
1840
  data: o
1841
1841
  });
1842
1842
  else
1843
- throw i;
1843
+ throw r;
1844
1844
  }
1845
1845
  }
1846
1846
  /**
@@ -1865,21 +1865,21 @@ class fo {
1865
1865
  focus(o) {
1866
1866
  if (this.view.focus(), !o)
1867
1867
  return;
1868
- let l = 0, a = 0, i = 0;
1868
+ let l = 0, a = 0, r = 0;
1869
1869
  switch (o) {
1870
1870
  case "start":
1871
1871
  break;
1872
1872
  case "end": {
1873
- l = a = i = this.getValue().length;
1873
+ l = a = r = this.getValue().length;
1874
1874
  break;
1875
1875
  }
1876
1876
  default:
1877
- l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, i = o.cursorPos;
1877
+ l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, r = o.cursorPos;
1878
1878
  }
1879
1879
  this.view.dispatch({
1880
1880
  scrollIntoView: !0,
1881
- selection: G.create(
1882
- [G.range(l, a), G.cursor(i)],
1881
+ selection: z.create(
1882
+ [z.range(l, a), z.cursor(r)],
1883
1883
  1
1884
1884
  )
1885
1885
  });
@@ -1902,33 +1902,33 @@ const bo = (e) => {
1902
1902
  if (!a.clipboardData)
1903
1903
  return;
1904
1904
  if (a.clipboardData.files.length > 0) {
1905
- const { files: r } = a.clipboardData;
1906
- h.emit(
1905
+ const { files: i } = a.clipboardData;
1906
+ v.emit(
1907
1907
  o,
1908
1908
  we,
1909
- Array.from(r).filter((m) => /image\/.*/.test(m.type))
1909
+ Array.from(i).filter((m) => /image\/.*/.test(m.type))
1910
1910
  ), a.preventDefault();
1911
1911
  return;
1912
1912
  }
1913
1913
  if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
1914
- const r = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1915
- h.emit(o, w, "code", {
1916
- mode: r.mode,
1914
+ const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1915
+ v.emit(o, x, "code", {
1916
+ mode: i.mode,
1917
1917
  text: a.clipboardData.getData("text/plain")
1918
1918
  }), a.preventDefault();
1919
1919
  return;
1920
1920
  }
1921
- const i = a.clipboardData.getData("text/plain");
1922
- e.maxlength && i.length + e.modelValue.length > e.maxlength && h.emit(o, te, {
1921
+ const r = a.clipboardData.getData("text/plain");
1922
+ e.maxlength && r.length + e.modelValue.length > e.maxlength && v.emit(o, le, {
1923
1923
  name: "overlength",
1924
1924
  message: "The input text is too long",
1925
- data: i
1925
+ data: r
1926
1926
  });
1927
1927
  };
1928
1928
  }, ho = bo, vo = (e) => {
1929
1929
  const o = A("editorId");
1930
- J(() => {
1931
- h.on(o, {
1930
+ Y(() => {
1931
+ v.on(o, {
1932
1932
  name: Jt,
1933
1933
  callback(l) {
1934
1934
  var a;
@@ -1940,7 +1940,7 @@ const bo = (e) => {
1940
1940
  {
1941
1941
  key: "Ctrl-b",
1942
1942
  mac: "Cmd-b",
1943
- run: () => (h.emit(e, w, "bold"), !0)
1943
+ run: () => (v.emit(e, x, "bold"), !0)
1944
1944
  },
1945
1945
  {
1946
1946
  key: "Ctrl-d",
@@ -1951,90 +1951,90 @@ const bo = (e) => {
1951
1951
  {
1952
1952
  key: "Ctrl-s",
1953
1953
  mac: "Cmd-s",
1954
- run: (D) => (h.emit(e, Lt, D.state.doc.toString()), !0),
1955
- shift: () => (h.emit(e, w, "strikeThrough"), !0)
1954
+ run: (D) => (v.emit(e, Dt, D.state.doc.toString()), !0),
1955
+ shift: () => (v.emit(e, x, "strikeThrough"), !0)
1956
1956
  },
1957
1957
  {
1958
1958
  key: "Ctrl-u",
1959
1959
  mac: "Cmd-u",
1960
- run: () => (h.emit(e, w, "underline"), !0),
1961
- shift: () => (h.emit(e, w, "unorderedList"), !0)
1960
+ run: () => (v.emit(e, x, "underline"), !0),
1961
+ shift: () => (v.emit(e, x, "unorderedList"), !0)
1962
1962
  },
1963
1963
  {
1964
1964
  key: "Ctrl-i",
1965
1965
  mac: "Cmd-i",
1966
- run: () => (h.emit(e, w, "italic"), !0),
1967
- shift: () => (h.emit(e, ye, "image"), !0)
1966
+ run: () => (v.emit(e, x, "italic"), !0),
1967
+ shift: () => (v.emit(e, ye, "image"), !0)
1968
1968
  },
1969
1969
  {
1970
1970
  key: "Ctrl-1",
1971
1971
  mac: "Cmd-1",
1972
- run: () => (h.emit(e, w, "h1"), !0)
1972
+ run: () => (v.emit(e, x, "h1"), !0)
1973
1973
  },
1974
1974
  {
1975
1975
  key: "Ctrl-2",
1976
1976
  mac: "Cmd-2",
1977
- run: () => (h.emit(e, w, "h2"), !0)
1977
+ run: () => (v.emit(e, x, "h2"), !0)
1978
1978
  },
1979
1979
  {
1980
1980
  key: "Ctrl-3",
1981
1981
  mac: "Cmd-3",
1982
- run: () => (h.emit(e, w, "h3"), !0)
1982
+ run: () => (v.emit(e, x, "h3"), !0)
1983
1983
  },
1984
1984
  {
1985
1985
  key: "Ctrl-4",
1986
1986
  mac: "Cmd-4",
1987
- run: () => (h.emit(e, w, "h4"), !0)
1987
+ run: () => (v.emit(e, x, "h4"), !0)
1988
1988
  },
1989
1989
  {
1990
1990
  key: "Ctrl-5",
1991
1991
  mac: "Cmd-5",
1992
- run: () => (h.emit(e, w, "h5"), !0)
1992
+ run: () => (v.emit(e, x, "h5"), !0)
1993
1993
  },
1994
1994
  {
1995
1995
  key: "Ctrl-6",
1996
1996
  mac: "Cmd-6",
1997
- run: () => (h.emit(e, w, "h6"), !0)
1997
+ run: () => (v.emit(e, x, "h6"), !0)
1998
1998
  },
1999
1999
  {
2000
2000
  key: "Ctrl-ArrowUp",
2001
2001
  mac: "Cmd-ArrowUp",
2002
- run: () => (h.emit(e, w, "sup"), !0)
2002
+ run: () => (v.emit(e, x, "sup"), !0)
2003
2003
  },
2004
2004
  {
2005
2005
  key: "Ctrl-ArrowDown",
2006
2006
  mac: "Cmd-ArrowDown",
2007
- run: () => (h.emit(e, w, "sub"), !0)
2007
+ run: () => (v.emit(e, x, "sub"), !0)
2008
2008
  },
2009
2009
  {
2010
2010
  key: "Ctrl-o",
2011
2011
  mac: "Cmd-o",
2012
- run: () => (h.emit(e, w, "orderedList"), !0)
2012
+ run: () => (v.emit(e, x, "orderedList"), !0)
2013
2013
  },
2014
2014
  {
2015
2015
  key: "Ctrl-c",
2016
2016
  mac: "Cmd-c",
2017
- shift: () => (h.emit(e, w, "code"), !0),
2018
- any(D, I) {
2019
- return (I.ctrlKey || I.metaKey) && I.altKey && I.code === "KeyC" ? (h.emit(e, w, "codeRow"), !0) : !1;
2017
+ shift: () => (v.emit(e, x, "code"), !0),
2018
+ any(D, E) {
2019
+ return (E.ctrlKey || E.metaKey) && E.altKey && E.code === "KeyC" ? (v.emit(e, x, "codeRow"), !0) : !1;
2020
2020
  }
2021
2021
  },
2022
2022
  {
2023
2023
  key: "Ctrl-l",
2024
2024
  mac: "Cmd-l",
2025
- run: () => (h.emit(e, ye, "link"), !0)
2025
+ run: () => (v.emit(e, ye, "link"), !0)
2026
2026
  },
2027
2027
  {
2028
2028
  key: "Ctrl-f",
2029
2029
  mac: "Cmd-f",
2030
- shift: () => o.noPrettier ? !1 : (h.emit(e, w, "prettier"), !0)
2030
+ shift: () => o.noPrettier ? !1 : (v.emit(e, x, "prettier"), !0)
2031
2031
  },
2032
2032
  {
2033
- any: (D, I) => (I.ctrlKey || I.metaKey) && I.altKey && I.shiftKey && I.code === "KeyT" ? (h.emit(e, w, "table"), !0) : !1
2033
+ any: (D, E) => (E.ctrlKey || E.metaKey) && E.altKey && E.shiftKey && E.code === "KeyT" ? (v.emit(e, x, "table"), !0) : !1
2034
2034
  }
2035
2035
  ], po = Co, $o = (e) => {
2036
- const o = A("tabWidth"), l = A("editorId"), a = A("theme"), i = j(), r = Bt(), m = new be(), g = new be(), u = new be(), c = po(l, e), v = ho(e), x = [
2037
- ll.of([...c, il]),
2036
+ const o = A("tabWidth"), l = A("editorId"), a = A("theme"), r = U(), i = Rt(), m = new be(), g = new be(), u = new be(), s = po(l, e), f = ho(e), w = [
2037
+ ll.of([...s, il]),
2038
2038
  el,
2039
2039
  m.of(al({ codeLanguages: ol })),
2040
2040
  // 横向换行
@@ -2043,130 +2043,172 @@ const bo = (e) => {
2043
2043
  d.docChanged && e.onChange(d.state.doc.toString());
2044
2044
  }),
2045
2045
  ge.domEventHandlers({
2046
- paste: v,
2046
+ paste: f,
2047
2047
  blur: e.onBlur,
2048
2048
  focus: e.onFocus,
2049
2049
  drop: e.onDrop,
2050
2050
  input: (d) => {
2051
2051
  e.onInput && e.onInput(d);
2052
- const { data: k } = d;
2053
- e.maxlength && e.modelValue.length + k.length > e.maxlength && h.emit(l, te, {
2052
+ const { data: C } = d;
2053
+ e.maxlength && e.modelValue.length + C.length > e.maxlength && v.emit(l, le, {
2054
2054
  name: "overlength",
2055
2055
  message: "The input text is too long",
2056
- data: k
2056
+ data: C
2057
2057
  });
2058
2058
  }
2059
2059
  })
2060
- ], y = () => {
2060
+ ], k = () => {
2061
2061
  const d = [
2062
- ...x,
2062
+ ...w,
2063
2063
  g.of(a.value === "light" ? xt : Ct),
2064
2064
  u.of(At(e.completions))
2065
2065
  ];
2066
- return Y.codeMirrorExtensions(a.value, d, [
2067
- ...c
2066
+ return Q.codeMirrorExtensions(a.value, d, [
2067
+ ...s
2068
2068
  ]);
2069
2069
  };
2070
- return J(() => {
2070
+ return Y(() => {
2071
2071
  const d = new ge({
2072
2072
  doc: e.modelValue,
2073
- parent: i.value,
2074
- extensions: [y()]
2075
- }), k = new fo(d);
2076
- r.value = k, setTimeout(() => {
2077
- 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 && d.focus();
2078
- }, 0), h.on(l, {
2073
+ parent: r.value,
2074
+ extensions: [k()]
2075
+ }), C = new fo(d);
2076
+ i.value = C, setTimeout(() => {
2077
+ 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 && d.focus();
2078
+ }, 0), v.on(l, {
2079
2079
  name: It,
2080
2080
  callback() {
2081
2081
  sl(d);
2082
2082
  }
2083
- }), h.on(l, {
2084
- name: Dt,
2083
+ }), v.on(l, {
2084
+ name: Et,
2085
2085
  callback() {
2086
2086
  cl(d);
2087
2087
  }
2088
- }), h.on(l, {
2089
- name: w,
2090
- callback(b, f = {}) {
2088
+ }), v.on(l, {
2089
+ name: x,
2090
+ callback(h, b = {}) {
2091
2091
  var S;
2092
- const { text: C, options: T } = ql(b, r.value, f);
2093
- (S = r.value) == null || S.replaceSelectedText(C, T, l);
2092
+ const { text: p, options: T } = _l(h, i.value, b);
2093
+ (S = i.value) == null || S.replaceSelectedText(p, T, l);
2094
2094
  }
2095
2095
  });
2096
- }), V(
2096
+ }), O(
2097
2097
  a,
2098
2098
  () => {
2099
2099
  var d;
2100
- (d = r.value) == null || d.view.dispatch({
2100
+ (d = i.value) == null || d.view.dispatch({
2101
2101
  effects: g.reconfigure(a.value === "light" ? xt : Ct)
2102
2102
  });
2103
2103
  },
2104
2104
  {
2105
2105
  deep: !0
2106
2106
  }
2107
- ), V(
2107
+ ), O(
2108
2108
  () => e.completions,
2109
2109
  () => {
2110
2110
  var d;
2111
- (d = r.value) == null || d.view.dispatch({
2111
+ (d = i.value) == null || d.view.dispatch({
2112
2112
  effects: u.reconfigure(At(e.completions))
2113
2113
  });
2114
2114
  },
2115
2115
  {
2116
2116
  deep: !0
2117
2117
  }
2118
- ), V(
2118
+ ), O(
2119
2119
  () => e.modelValue,
2120
2120
  () => {
2121
- var d, k;
2122
- ((d = r.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((k = r.value) == null || k.setValue(e.modelValue));
2121
+ var d, C;
2122
+ ((d = i.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((C = i.value) == null || C.setValue(e.modelValue));
2123
2123
  }
2124
- ), V(
2124
+ ), O(
2125
2125
  () => e.placeholder,
2126
2126
  () => {
2127
2127
  var d;
2128
- (d = r.value) == null || d.setPlaceholder(e.placeholder);
2128
+ (d = i.value) == null || d.setPlaceholder(e.placeholder);
2129
2129
  }
2130
- ), V(
2130
+ ), O(
2131
2131
  () => e.disabled,
2132
2132
  () => {
2133
2133
  var d;
2134
- (d = r.value) == null || d.setDisabled(e.disabled);
2134
+ (d = i.value) == null || d.setDisabled(e.disabled);
2135
2135
  }
2136
- ), V(
2136
+ ), O(
2137
2137
  () => e.readonly,
2138
2138
  () => {
2139
2139
  var d;
2140
- (d = r.value) == null || d.setDisabled(e.readonly);
2140
+ (d = i.value) == null || d.setDisabled(e.readonly);
2141
2141
  }
2142
- ), V(
2142
+ ), O(
2143
2143
  () => e.maxlength,
2144
2144
  () => {
2145
2145
  var d;
2146
- e.maxlength && ((d = r.value) == null || d.setMaxLength(e.maxlength));
2146
+ e.maxlength && ((d = i.value) == null || d.setMaxLength(e.maxlength));
2147
2147
  }
2148
- ), ko(r), {
2149
- inputWrapperRef: i,
2150
- codeMirrorUt: r
2148
+ ), ko(i), {
2149
+ inputWrapperRef: r,
2150
+ codeMirrorUt: i
2151
+ };
2152
+ }, yo = $o, To = (e, o, l) => {
2153
+ const a = G({
2154
+ resizedWidth: e.inputBoxWitdh
2155
+ }), r = G({
2156
+ width: e.inputBoxWitdh
2157
+ }), i = G({
2158
+ left: e.inputBoxWitdh,
2159
+ display: "initial"
2160
+ }), m = (s) => {
2161
+ var d, C;
2162
+ const f = ((d = o.value) == null ? void 0 : d.offsetWidth) || 0, w = ((C = o.value) == null ? void 0 : C.getBoundingClientRect().x) || 0;
2163
+ let k = s.x - w;
2164
+ k < 100 ? k = 100 : k > f - 100 && (k = f - 100), r.width = `${k}px`, i.left = `${k}px`, a.resizedWidth = `${k}px`;
2165
+ }, g = () => {
2166
+ document.addEventListener("mousemove", m);
2167
+ }, u = () => {
2168
+ document.removeEventListener("mousemove", m);
2151
2169
  };
2152
- }, yo = $o, To = /* @__PURE__ */ P({
2170
+ return Y(() => {
2171
+ var s;
2172
+ (s = l.value) == null || s.addEventListener("mousedown", g), document.addEventListener("mouseup", u);
2173
+ }), Lt(() => {
2174
+ var s, f;
2175
+ (s = l.value) == null || s.removeEventListener("mousedown", g), (f = l.value) == null || f.removeEventListener("mouseup", u);
2176
+ }), O(
2177
+ [te(e.setting, "htmlPreview"), te(e.setting, "preview")],
2178
+ () => {
2179
+ !e.setting.htmlPreview && !e.setting.preview ? (a.resizedWidth = r.width, r.width = "100%", i.display = "none") : (r.width = a.resizedWidth, i.display = "initial");
2180
+ },
2181
+ {
2182
+ immediate: !0
2183
+ }
2184
+ ), { inputWrapperStyle: r, resizeOperateStyle: i };
2185
+ }, wo = To, xo = /* @__PURE__ */ P({
2153
2186
  name: "MDEditorContent",
2154
2187
  props: ml,
2155
2188
  setup(e) {
2156
- const o = A("editorId"), l = j(""), {
2157
- inputWrapperRef: a,
2158
- codeMirrorUt: i
2159
- } = yo(e);
2160
- return _l(e, l, i), () => t("div", {
2161
- class: `${n}-content`
2189
+ const o = A("editorId"), l = U(""), a = U(), r = U(), {
2190
+ inputWrapperRef: i,
2191
+ codeMirrorUt: m
2192
+ } = yo(e), {
2193
+ inputWrapperStyle: g,
2194
+ resizeOperateStyle: u
2195
+ } = wo(e, a, r);
2196
+ return Ul(e, l, m), () => t("div", {
2197
+ class: `${n}-content`,
2198
+ ref: a
2162
2199
  }, [t("div", {
2163
2200
  class: `${n}-input-wrapper`,
2164
- ref: a
2201
+ style: g,
2202
+ ref: i
2203
+ }, null), t("div", {
2204
+ class: `${n}-resize-operate`,
2205
+ style: u,
2206
+ ref: r
2165
2207
  }, null), t(gl, {
2166
2208
  modelValue: e.modelValue,
2167
2209
  setting: e.setting,
2168
- onHtmlChanged: (r) => {
2169
- l.value = r, e.onHtmlChanged(r);
2210
+ onHtmlChanged: (s) => {
2211
+ l.value = s, e.onHtmlChanged(s);
2170
2212
  },
2171
2213
  onGetCatalog: e.onGetCatalog,
2172
2214
  mdHeadingId: e.mdHeadingId,
@@ -2176,7 +2218,7 @@ const bo = (e) => {
2176
2218
  formatCopiedText: e.formatCopiedText,
2177
2219
  noHighlight: e.noHighlight,
2178
2220
  noImgZoomIn: e.noImgZoomIn
2179
- }, null), e.catalogVisible && t(Ot, {
2221
+ }, null), e.catalogVisible && t(Vt, {
2180
2222
  theme: e.theme,
2181
2223
  class: `${n}-catalog-editor`,
2182
2224
  editorId: o,
@@ -2184,7 +2226,7 @@ const bo = (e) => {
2184
2226
  key: "internal-catalog"
2185
2227
  }, null)]);
2186
2228
  }
2187
- }), wo = /* @__PURE__ */ P({
2229
+ }), So = /* @__PURE__ */ P({
2188
2230
  props: {
2189
2231
  modelValue: {
2190
2232
  type: String,
@@ -2202,7 +2244,7 @@ const bo = (e) => {
2202
2244
  }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
2203
2245
  };
2204
2246
  }
2205
- }), xo = {
2247
+ }), Ao = {
2206
2248
  checked: {
2207
2249
  type: Boolean,
2208
2250
  default: !1
@@ -2212,8 +2254,8 @@ const bo = (e) => {
2212
2254
  default: () => {
2213
2255
  }
2214
2256
  }
2215
- }, So = /* @__PURE__ */ P({
2216
- props: xo,
2257
+ }, Mo = /* @__PURE__ */ P({
2258
+ props: Ao,
2217
2259
  setup(e) {
2218
2260
  return () => t("div", {
2219
2261
  class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
@@ -2222,7 +2264,7 @@ const bo = (e) => {
2222
2264
  }
2223
2265
  }, null);
2224
2266
  }
2225
- }), Ao = {
2267
+ }), Lo = {
2226
2268
  scrollAuto: {
2227
2269
  type: Boolean
2228
2270
  },
@@ -2231,8 +2273,8 @@ const bo = (e) => {
2231
2273
  default: () => {
2232
2274
  }
2233
2275
  }
2234
- }, Mo = /* @__PURE__ */ P({
2235
- props: Ao,
2276
+ }, Do = /* @__PURE__ */ P({
2277
+ props: Lo,
2236
2278
  setup(e) {
2237
2279
  const o = A("usedLanguageText");
2238
2280
  return () => {
@@ -2244,13 +2286,13 @@ const bo = (e) => {
2244
2286
  onClick: () => {
2245
2287
  e.onScrollAutoChange(!e.scrollAuto);
2246
2288
  }
2247
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(So, {
2289
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Mo, {
2248
2290
  checked: e.scrollAuto,
2249
2291
  onChange: e.onScrollAutoChange
2250
2292
  }, null)]);
2251
2293
  };
2252
2294
  }
2253
- }), Lo = {
2295
+ }), Eo = {
2254
2296
  modelValue: {
2255
2297
  type: String,
2256
2298
  default: ""
@@ -2270,22 +2312,22 @@ const bo = (e) => {
2270
2312
  defFooters: {
2271
2313
  type: Object
2272
2314
  }
2273
- }, Do = /* @__PURE__ */ P({
2315
+ }, Io = /* @__PURE__ */ P({
2274
2316
  name: "MDEditorFooter",
2275
- props: Lo,
2317
+ props: Eo,
2276
2318
  setup(e) {
2277
2319
  const o = Te(() => {
2278
- const a = e.footers.indexOf("="), i = a === -1 ? e.footers : e.footers.slice(0, a), r = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2279
- return [i, r];
2320
+ const a = e.footers.indexOf("="), r = a === -1 ? e.footers : e.footers.slice(0, a), i = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2321
+ return [r, i];
2280
2322
  }), l = (a) => {
2281
- if (_t.includes(a))
2323
+ if (Ut.includes(a))
2282
2324
  switch (a) {
2283
2325
  case "markdownTotal":
2284
- return t(wo, {
2326
+ return t(So, {
2285
2327
  modelValue: e.modelValue
2286
2328
  }, null);
2287
2329
  case "scrollSwitch":
2288
- return t(Mo, {
2330
+ return t(Do, {
2289
2331
  scrollAuto: e.scrollAuto,
2290
2332
  onScrollAutoChange: e.onScrollAutoChange
2291
2333
  }, null);
@@ -2294,17 +2336,17 @@ const bo = (e) => {
2294
2336
  return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
2295
2337
  };
2296
2338
  return () => {
2297
- const a = o.value[0].map((r) => l(r)), i = o.value[1].map((r) => l(r));
2339
+ const a = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
2298
2340
  return t("div", {
2299
2341
  class: `${n}-footer`
2300
2342
  }, [t("div", {
2301
2343
  class: `${n}-footer-left`
2302
2344
  }, [a]), t("div", {
2303
2345
  class: `${n}-footer-right`
2304
- }, [i])]);
2346
+ }, [r])]);
2305
2347
  };
2306
2348
  }
2307
- }), Io = /* @__PURE__ */ P({
2349
+ }), Ho = /* @__PURE__ */ P({
2308
2350
  name: "MdEditorV3",
2309
2351
  props: fl,
2310
2352
  emits: bl,
@@ -2312,20 +2354,20 @@ const bo = (e) => {
2312
2354
  const {
2313
2355
  editorId: l,
2314
2356
  noKatex: a,
2315
- noMermaid: i,
2316
- noPrettier: r,
2357
+ noMermaid: r,
2358
+ noPrettier: i,
2317
2359
  noUploadImg: m,
2318
2360
  noHighlight: g
2319
- } = e, u = ee({
2361
+ } = e, u = G({
2320
2362
  scrollAuto: e.scrollAuto
2321
2363
  });
2322
2364
  hl(e, o), vl(e), kl(e), Cl(e, o);
2323
- const [c, v] = pl(e, o), x = $l(e);
2324
- return Rt(() => {
2325
- h.clear(l);
2326
- }), yl(e, o, x, c, v), () => {
2327
- var k;
2328
- const y = gt({
2365
+ const [s, f] = pl(e, o), w = $l(e);
2366
+ return Lt(() => {
2367
+ v.clear(l);
2368
+ }), yl(e, o, w, s, f), () => {
2369
+ var C;
2370
+ const k = gt({
2329
2371
  props: e,
2330
2372
  ctx: o
2331
2373
  }, "defToolbars"), d = gt({
@@ -2334,24 +2376,24 @@ const bo = (e) => {
2334
2376
  }, "defFooters");
2335
2377
  return t("div", {
2336
2378
  id: l,
2337
- class: [n, e.class, e.theme === "dark" && `${n}-dark`, c.fullscreen || c.pageFullscreen ? `${n}-fullscreen` : ""],
2379
+ class: [n, e.class, e.theme === "dark" && `${n}-dark`, s.fullscreen || s.pageFullscreen ? `${n}-fullscreen` : ""],
2338
2380
  style: e.style
2339
- }, [t(Bl, {
2340
- noPrettier: r,
2381
+ }, [t(Fl, {
2382
+ noPrettier: i,
2341
2383
  toolbars: e.toolbars,
2342
2384
  toolbarsExclude: e.toolbarsExclude,
2343
- setting: c,
2344
- updateSetting: v,
2385
+ setting: s,
2386
+ updateSetting: f,
2345
2387
  tableShape: e.tableShape,
2346
- defToolbars: y,
2388
+ defToolbars: k,
2347
2389
  noUploadImg: m,
2348
2390
  showToolbarName: e.showToolbarName
2349
- }, null), t(To, {
2391
+ }, null), t(xo, {
2350
2392
  modelValue: e.modelValue,
2351
- setting: c,
2393
+ setting: s,
2352
2394
  mdHeadingId: e.mdHeadingId,
2353
- noMermaid: i,
2354
- noPrettier: r,
2395
+ noMermaid: r,
2396
+ noPrettier: i,
2355
2397
  sanitize: e.sanitize,
2356
2398
  placeholder: e.placeholder,
2357
2399
  noKatex: a,
@@ -2363,42 +2405,43 @@ const bo = (e) => {
2363
2405
  maxlength: e.maxLength,
2364
2406
  autoDetectCode: e.autoDetectCode,
2365
2407
  noHighlight: g,
2366
- onChange: (b) => {
2367
- e.onChange ? e.onChange(b) : (o.emit("update:modelValue", b), o.emit("onChange", b));
2408
+ onChange: (h) => {
2409
+ e.onChange ? e.onChange(h) : (o.emit("update:modelValue", h), o.emit("onChange", h));
2368
2410
  },
2369
- onHtmlChanged: (b) => {
2370
- e.onHtmlChanged ? e.onHtmlChanged(b) : o.emit("onHtmlChanged", b);
2411
+ onHtmlChanged: (h) => {
2412
+ e.onHtmlChanged ? e.onHtmlChanged(h) : o.emit("onHtmlChanged", h);
2371
2413
  },
2372
- onGetCatalog: (b) => {
2373
- e.onGetCatalog ? e.onGetCatalog(b) : o.emit("onGetCatalog", b);
2414
+ onGetCatalog: (h) => {
2415
+ e.onGetCatalog ? e.onGetCatalog(h) : o.emit("onGetCatalog", h);
2374
2416
  },
2375
- onBlur: (b) => {
2376
- e.onBlur ? e.onBlur(b) : o.emit("onBlur", b);
2417
+ onBlur: (h) => {
2418
+ e.onBlur ? e.onBlur(h) : o.emit("onBlur", h);
2377
2419
  },
2378
- onFocus: (b) => {
2379
- e.onFocus ? e.onFocus(b) : o.emit("onFocus", b);
2420
+ onFocus: (h) => {
2421
+ e.onFocus ? e.onFocus(h) : o.emit("onFocus", h);
2380
2422
  },
2381
- onInput: (b) => {
2382
- e.onInput ? e.onInput(b) : o.emit("onInput", b);
2423
+ onInput: (h) => {
2424
+ e.onInput ? e.onInput(h) : o.emit("onInput", h);
2383
2425
  },
2384
2426
  completions: e.completions,
2385
- catalogVisible: x.value,
2427
+ catalogVisible: w.value,
2386
2428
  theme: e.theme,
2387
2429
  noImgZoomIn: e.noImgZoomIn,
2388
- onDrop: (b) => {
2389
- e.onDrop ? e.onDrop(b) : o.emit("onDrop", b);
2390
- }
2391
- }, null), ((k = e.footers) == null ? void 0 : k.length) > 0 && t(Do, {
2430
+ onDrop: (h) => {
2431
+ e.onDrop ? e.onDrop(h) : o.emit("onDrop", h);
2432
+ },
2433
+ inputBoxWitdh: e.inputBoxWitdh
2434
+ }, null), ((C = e.footers) == null ? void 0 : C.length) > 0 && t(Io, {
2392
2435
  modelValue: e.modelValue,
2393
2436
  footers: e.footers,
2394
2437
  defFooters: d,
2395
2438
  scrollAuto: u.scrollAuto,
2396
- onScrollAutoChange: (b) => u.scrollAuto = b
2439
+ onScrollAutoChange: (h) => u.scrollAuto = h
2397
2440
  }, null)]);
2398
2441
  };
2399
2442
  }
2400
- }), $e = Io;
2401
- $e.install = (e) => (e.component($e.name, $e), e.use(wl).use(zt).use(xl).use(Ot).use(Tl), e);
2443
+ }), $e = Ho;
2444
+ $e.install = (e) => (e.component($e.name, $e), e.use(wl).use(jt).use(xl).use(Vt).use(Tl), e);
2402
2445
  export {
2403
2446
  $e as default
2404
2447
  };