md-editor-v3 4.12.0-beta.1 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
1
  var Ot = Object.defineProperty;
2
2
  var Pt = (e, o, l) => o in e ? Ot(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
- var z = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as P, createVNode as t, inject as I, ref as O, onMounted as Y, reactive as _, computed as Ce, watch as H, nextTick as de, Fragment as Mt, cloneVNode as gt, toRef as Q, shallowRef as Wt, onBeforeUnmount as Et } from "vue";
5
- import { p as a, e as X, l as zt, b as Ut, M as se, d as _t } from "./chunks/config.mjs";
3
+ var _ = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
+ import { defineComponent as z, createVNode as t, inject as H, ref as P, onMounted as Y, reactive as q, computed as Ce, watch as B, nextTick as de, Fragment as It, cloneVNode as gt, toRef as ee, shallowRef as Wt, onBeforeUnmount as Mt } from "vue";
5
+ import { p as a, e as X, l as zt, b as _t, M as ce, d as Ut } from "./chunks/config.mjs";
6
6
  import { draggingScroll as qt, linkTo as Gt, debounce as Kt, createSmoothScroll as jt, throttle as Zt } from "@vavt/util";
7
- import { a as ae, D as Xt } from "./chunks/index2.mjs";
8
- import { b as v, i as Yt, E as ee, U as $e, k as Jt, l as ke, h as L, c as Qt, O as Ht, m as Dt, n as Nt } from "./chunks/index4.mjs";
9
- import { a as el } from "./chunks/dom.mjs";
10
- import { M as Bt, I as x } from "./chunks/index3.mjs";
11
- import { EditorView as ce } from "codemirror";
12
- import { EditorView as pe, placeholder as tl, keymap as ll } from "@codemirror/view";
13
- import { languages as ol } from "@codemirror/language-data";
14
- import { markdown as al } from "@codemirror/lang-markdown";
15
- import { EditorSelection as U, EditorState as fe, Compartment as ne, StateEffect as nl } from "@codemirror/state";
16
- import { deleteLine as il, defaultKeymap as rl, historyKeymap as sl, indentWithTab as cl, history as ft, undo as ul, redo as dl } from "@codemirror/commands";
17
- import { HighlightStyle as Vt, syntaxHighlighting as Ft, indentUnit as ml } from "@codemirror/language";
7
+ import { a as ne, D as Xt } from "./chunks/index2.mjs";
8
+ import { b as v, i as Yt, E as te, U as pe, l as Jt, m as ke, h as A, c as Qt, O as Ht, n as Dt, o as Nt, j as el } from "./chunks/index4.mjs";
9
+ import { a as tl } from "./chunks/dom.mjs";
10
+ import { M as Bt, I as w } from "./chunks/index3.mjs";
11
+ import { EditorView as ie } from "codemirror";
12
+ import { EditorView as $e, placeholder as ll, keymap as ol } from "@codemirror/view";
13
+ import { languages as al } from "@codemirror/language-data";
14
+ import { markdown as nl } from "@codemirror/lang-markdown";
15
+ import { EditorSelection as U, EditorState as fe, Compartment as Q, StateEffect as il } from "@codemirror/state";
16
+ import { deleteLine as rl, defaultKeymap as sl, historyKeymap as cl, indentWithTab as ul, history as ft, undo as dl, redo as ml } from "@codemirror/commands";
17
+ import { HighlightStyle as Vt, syntaxHighlighting as Ft, indentUnit as gl } from "@codemirror/language";
18
18
  import { tags as c } from "@lezer/highlight";
19
- import { autocompletion as gl } from "@codemirror/autocomplete";
20
- import { c as fl, C as hl, e as bl, a as vl, u as kl, b as Cl, d as $l, f as pl, g as yl, h as Tl, i as wl, M as xl } from "./chunks/index.mjs";
19
+ import { autocompletion as fl } from "@codemirror/autocomplete";
20
+ import { c as hl, C as bl, e as vl, a as kl, u as Cl, b as pl, d as $l, f as yl, g as Tl, h as wl, i as xl, M as Sl } from "./chunks/index.mjs";
21
21
  import Rt from "./MdCatalog.mjs";
22
22
  import { g as ht } from "./chunks/vue-tsx.mjs";
23
- import Sl from "./NormalToolbar.mjs";
23
+ import Ll from "./NormalToolbar.mjs";
24
24
  import Al from "./ModalToolbar.mjs";
25
- const Ll = /* @__PURE__ */ P({
25
+ const El = /* @__PURE__ */ z({
26
26
  setup() {
27
27
  return () => t("div", {
28
28
  class: `${a}-divider`
@@ -78,18 +78,18 @@ const Ll = /* @__PURE__ */ P({
78
78
  type: Boolean
79
79
  }
80
80
  }, Ml = (e) => {
81
- var d, s, g, w;
82
- const o = I("editorId");
83
- let l = (s = (d = X.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : s.instance;
84
- const n = (w = (g = X.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : w.js, r = O(!1), i = ($) => {
81
+ var m, s, g, $;
82
+ const o = H("editorId");
83
+ let l = (s = (m = X.editorExtensions) == null ? void 0 : m.screenfull) == null ? void 0 : s.instance;
84
+ const n = ($ = (g = X.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : $.js, r = P(!1), i = (p) => {
85
85
  if (!l) {
86
- v.emit(o, ee, {
86
+ v.emit(o, te, {
87
87
  name: "fullscreen",
88
88
  message: "fullscreen is undefined"
89
89
  });
90
90
  return;
91
91
  }
92
- l.isEnabled ? (r.value = !0, ($ === void 0 ? !l.isFullscreen : $) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
92
+ l.isEnabled ? (r.value = !0, (p === void 0 ? !l.isFullscreen : p) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
93
93
  }, h = () => {
94
94
  l && l.isEnabled && l.on("change", () => {
95
95
  (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
@@ -99,8 +99,8 @@ const Ll = /* @__PURE__ */ P({
99
99
  };
100
100
  return Y(() => {
101
101
  if (h(), !l) {
102
- const $ = document.createElement("script");
103
- $.src = n || zt, $.onload = f, $.id = `${a}-screenfull`, el($, "screenfull");
102
+ const p = document.createElement("script");
103
+ p.src = n || zt, p.onload = f, p.id = `${a}-screenfull`, tl(p, "screenfull");
104
104
  }
105
105
  }), Y(() => {
106
106
  v.on(o, {
@@ -108,7 +108,7 @@ const Ll = /* @__PURE__ */ P({
108
108
  callback: i
109
109
  });
110
110
  }), { fullscreenHandler: i };
111
- }, El = {
111
+ }, Hl = {
112
112
  tableShape: {
113
113
  type: Array,
114
114
  default: () => [6, 4]
@@ -118,11 +118,11 @@ const Ll = /* @__PURE__ */ P({
118
118
  default: () => {
119
119
  }
120
120
  }
121
- }, Hl = /* @__PURE__ */ P({
121
+ }, Dl = /* @__PURE__ */ z({
122
122
  name: "TableShape",
123
- props: El,
123
+ props: Hl,
124
124
  setup(e) {
125
- const o = _({
125
+ const o = q({
126
126
  x: -1,
127
127
  y: -1
128
128
  });
@@ -147,7 +147,7 @@ const Ll = /* @__PURE__ */ P({
147
147
  class: [`${a}-table-shape-col-default`, n <= o.x && i <= o.y && `${a}-table-shape-col-include`]
148
148
  }, null)]))]))]);
149
149
  }
150
- }), Dl = Hl, Nl = {
150
+ }), Nl = Dl, Bl = {
151
151
  type: {
152
152
  type: String,
153
153
  default: "link"
@@ -166,10 +166,10 @@ const Ll = /* @__PURE__ */ P({
166
166
  default: () => {
167
167
  }
168
168
  }
169
- }, Bl = /* @__PURE__ */ P({
170
- props: Nl,
169
+ }, Vl = /* @__PURE__ */ z({
170
+ props: Bl,
171
171
  setup(e) {
172
- const o = I("usedLanguageText"), l = I("editorId"), n = Ce(() => {
172
+ const o = H("usedLanguageText"), l = H("editorId"), n = Ce(() => {
173
173
  var i, h;
174
174
  switch (e.type) {
175
175
  case "link":
@@ -179,11 +179,11 @@ const Ll = /* @__PURE__ */ P({
179
179
  default:
180
180
  return "";
181
181
  }
182
- }), r = _({
182
+ }), r = q({
183
183
  desc: "",
184
184
  url: ""
185
185
  });
186
- return H(() => e.visible, (i) => {
186
+ return B(() => e.visible, (i) => {
187
187
  i || setTimeout(() => {
188
188
  r.desc = "", r.url = "";
189
189
  }, 200);
@@ -193,7 +193,7 @@ const Ll = /* @__PURE__ */ P({
193
193
  onClose: e.onCancel
194
194
  }, {
195
195
  default: () => {
196
- var i, h, f, d, s;
196
+ var i, h, f, m, s;
197
197
  return [t("div", {
198
198
  class: `${a}-form-item`
199
199
  }, [t("label", {
@@ -215,7 +215,7 @@ const Ll = /* @__PURE__ */ P({
215
215
  class: `${a}-label`,
216
216
  for: `link-url-${l}`
217
217
  }, [(f = o.value.linkModalTips) == null ? void 0 : f.urlLabel]), t("input", {
218
- placeholder: (d = o.value.linkModalTips) == null ? void 0 : d.urlLabelPlaceHolder,
218
+ placeholder: (m = o.value.linkModalTips) == null ? void 0 : m.urlLabelPlaceHolder,
219
219
  class: `${a}-input`,
220
220
  id: `link-url-${l}`,
221
221
  type: "text",
@@ -236,7 +236,7 @@ const Ll = /* @__PURE__ */ P({
236
236
  }
237
237
  });
238
238
  }
239
- }), Vl = {
239
+ }), Fl = {
240
240
  visible: {
241
241
  type: Boolean,
242
242
  default: !1
@@ -251,48 +251,48 @@ const Ll = /* @__PURE__ */ P({
251
251
  default: () => {
252
252
  }
253
253
  }
254
- }, Fl = /* @__PURE__ */ P({
255
- props: Vl,
254
+ }, Rl = /* @__PURE__ */ z({
255
+ props: Fl,
256
256
  setup(e) {
257
- var g, w, $;
258
- const o = I("usedLanguageText"), l = I("editorId");
259
- let n = ($ = (w = (g = X) == null ? void 0 : g.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : $.instance;
260
- const r = O(), i = O(), h = O(), f = _({
257
+ var g, $, p;
258
+ const o = H("usedLanguageText"), l = H("editorId");
259
+ let n = (p = ($ = (g = X) == null ? void 0 : g.editorExtensions) == null ? void 0 : $.cropper) == null ? void 0 : p.instance;
260
+ const r = P(), i = P(), h = P(), f = q({
261
261
  cropperInited: !1,
262
262
  imgSelected: !1,
263
263
  imgSrc: "",
264
264
  // 是否全屏
265
265
  isFullscreen: !1
266
266
  });
267
- let d = null;
268
- H(() => e.visible, () => {
267
+ let m = null;
268
+ B(() => e.visible, () => {
269
269
  e.visible && !f.cropperInited && (n = n || window.Cropper, r.value.onchange = () => {
270
270
  if (!n) {
271
- v.emit(l, ee, {
271
+ v.emit(l, te, {
272
272
  name: "Cropper",
273
273
  message: "Cropper is undefined"
274
274
  });
275
275
  return;
276
276
  }
277
- const S = r.value.files || [];
278
- if (f.imgSelected = !0, (S == null ? void 0 : S.length) > 0) {
279
- const m = new FileReader();
280
- m.onload = (C) => {
281
- f.imgSrc = C.target.result, de(() => {
282
- d = new n(i.value, {
277
+ const x = r.value.files || [];
278
+ if (f.imgSelected = !0, (x == null ? void 0 : x.length) > 0) {
279
+ const S = new FileReader();
280
+ S.onload = (L) => {
281
+ f.imgSrc = L.target.result, de(() => {
282
+ m = new n(i.value, {
283
283
  viewMode: 2,
284
284
  preview: `.${a}-clip-preview-target`
285
285
  // aspectRatio: 16 / 9,
286
286
  });
287
287
  });
288
- }, m.readAsDataURL(S[0]);
288
+ }, S.readAsDataURL(x[0]);
289
289
  }
290
290
  });
291
- }), H(() => [f.imgSelected], () => {
291
+ }), B(() => [f.imgSelected], () => {
292
292
  h.value.style = "";
293
- }), H(() => f.isFullscreen, () => {
293
+ }), B(() => f.isFullscreen, () => {
294
294
  de(() => {
295
- d == null || d.destroy(), h.value.style = "", i.value && (d = new n(i.value, {
295
+ m == null || m.destroy(), h.value.style = "", i.value && (m = new n(i.value, {
296
296
  viewMode: 2,
297
297
  preview: `.${a}-clip-preview-target`
298
298
  // aspectRatio: 16 / 9,
@@ -300,25 +300,25 @@ const Ll = /* @__PURE__ */ P({
300
300
  });
301
301
  });
302
302
  const s = () => {
303
- d.clear(), d.destroy(), d = null, r.value.value = "", f.imgSelected = !1;
303
+ m.clear(), m.destroy(), m = null, r.value.value = "", f.imgSelected = !1;
304
304
  };
305
305
  return () => {
306
- var S;
306
+ var x;
307
307
  return t(Bt, {
308
308
  class: `${a}-modal-clip`,
309
- title: (S = o.value.clipModalTips) == null ? void 0 : S.title,
309
+ title: (x = o.value.clipModalTips) == null ? void 0 : x.title,
310
310
  visible: e.visible,
311
311
  onClose: e.onCancel,
312
312
  showAdjust: !0,
313
313
  isFullscreen: f.isFullscreen,
314
- onAdjust: (m) => {
315
- f.isFullscreen = m;
314
+ onAdjust: (S) => {
315
+ f.isFullscreen = S;
316
316
  },
317
317
  width: "668px",
318
318
  height: "421px"
319
319
  }, {
320
320
  default: () => {
321
- var m, C;
321
+ var S, L;
322
322
  return [t("div", {
323
323
  class: `${a}-form-item ${a}-clip`
324
324
  }, [t("div", {
@@ -335,14 +335,14 @@ const Ll = /* @__PURE__ */ P({
335
335
  }, null), t("div", {
336
336
  class: `${a}-clip-delete`,
337
337
  onClick: s
338
- }, [t(x, {
338
+ }, [t(w, {
339
339
  name: "delete"
340
340
  }, null)])]) : t("div", {
341
341
  class: `${a}-clip-upload`,
342
342
  onClick: () => {
343
343
  r.value.click();
344
344
  }
345
- }, [t(x, {
345
+ }, [t(w, {
346
346
  name: "upload"
347
347
  }, null)])]), t("div", {
348
348
  class: `${a}-clip-preview`
@@ -355,12 +355,12 @@ const Ll = /* @__PURE__ */ P({
355
355
  class: `${a}-btn`,
356
356
  type: "button",
357
357
  onClick: () => {
358
- if (d) {
359
- const u = d.getCroppedCanvas();
360
- v.emit(l, $e, [Jt(u.toDataURL("image/png"))], e.onOk), s();
358
+ if (m) {
359
+ const u = m.getCroppedCanvas();
360
+ v.emit(l, pe, [Jt(u.toDataURL("image/png"))], e.onOk), s();
361
361
  }
362
362
  }
363
- }, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((C = o.value.linkModalTips) == null ? void 0 : C.buttonOK)])]), t("input", {
363
+ }, [((S = o.value.clipModalTips) == null ? void 0 : S.buttonUpload) || ((L = o.value.linkModalTips) == null ? void 0 : L.buttonOK)])]), t("input", {
364
364
  ref: r,
365
365
  accept: "image/*",
366
366
  type: "file",
@@ -373,7 +373,7 @@ const Ll = /* @__PURE__ */ P({
373
373
  });
374
374
  };
375
375
  }
376
- }), Rl = {
376
+ }), Ol = {
377
377
  type: {
378
378
  type: String,
379
379
  default: "link"
@@ -396,27 +396,27 @@ const Ll = /* @__PURE__ */ P({
396
396
  default: () => {
397
397
  }
398
398
  }
399
- }, Ol = /* @__PURE__ */ P({
400
- props: Rl,
399
+ }, Pl = /* @__PURE__ */ z({
400
+ props: Ol,
401
401
  setup(e) {
402
- return () => t(Mt, null, [t(Bl, {
402
+ return () => t(It, null, [t(Vl, {
403
403
  type: e.type,
404
404
  visible: e.linkVisible,
405
405
  onOk: e.onOk,
406
406
  onCancel: e.onCancel
407
- }, null), t(Fl, {
407
+ }, null), t(Rl, {
408
408
  visible: e.clipVisible,
409
409
  onOk: e.onOk,
410
410
  onCancel: e.onCancel
411
411
  }, null)]);
412
412
  }
413
- }), Pl = /* @__PURE__ */ P({
413
+ }), Wl = /* @__PURE__ */ z({
414
414
  name: "MDEditorToolbar",
415
415
  props: Il,
416
416
  setup(e) {
417
- const o = I("editorId"), l = I("usedLanguageText"), n = I("theme"), r = I("language"), {
417
+ const o = H("editorId"), l = H("usedLanguageText"), n = H("theme"), r = H("language"), {
418
418
  fullscreenHandler: i
419
- } = Ml(e), h = `${o}-toolbar-wrapper`, f = O(), d = _({
419
+ } = Ml(e), h = `${o}-toolbar-wrapper`, f = P(), m = q({
420
420
  title: !1,
421
421
  catalog: !1,
422
422
  // 图片上传下拉
@@ -426,13 +426,13 @@ const Ll = /* @__PURE__ */ P({
426
426
  // mermaid
427
427
  mermaid: !1,
428
428
  katex: !1
429
- }), s = (u, b) => {
430
- v.emit(o, L, u, b);
431
- }, g = _({
429
+ }), s = (u, d) => {
430
+ v.emit(o, A, u, d);
431
+ }, g = q({
432
432
  type: "link",
433
433
  linkVisible: !1,
434
434
  clipVisible: !1
435
- }), w = O();
435
+ }), $ = P();
436
436
  Y(() => {
437
437
  v.on(o, {
438
438
  name: ke,
@@ -441,41 +441,41 @@ const Ll = /* @__PURE__ */ P({
441
441
  }
442
442
  });
443
443
  });
444
- const $ = Ce(() => {
445
- const u = e.toolbars.filter((k) => !e.toolbarsExclude.includes(k)), b = u.indexOf("="), p = b === -1 ? u : u.slice(0, b + 1), y = b === -1 ? [] : u.slice(b, Number.MAX_SAFE_INTEGER);
446
- return [p, y];
447
- }), S = O(), m = () => {
448
- v.emit(o, $e, Array.from(S.value.files || [])), S.value.value = "";
444
+ const p = Ce(() => {
445
+ const u = e.toolbars.filter((k) => !e.toolbarsExclude.includes(k)), d = u.indexOf("="), b = d === -1 ? u : u.slice(0, d + 1), C = d === -1 ? [] : u.slice(d, Number.MAX_SAFE_INTEGER);
446
+ return [b, C];
447
+ }), x = P(), S = () => {
448
+ v.emit(o, pe, Array.from(x.value.files || [])), x.value.value = "";
449
449
  };
450
450
  Y(() => {
451
- S.value.addEventListener("change", m);
451
+ x.value.addEventListener("change", S);
452
452
  });
453
- const C = (u) => {
454
- var b, p, y, k, A, F, D, W, q, R, N, B, Z, G, K, te, le, oe, j, V, M, me, ye, Te, we, xe, Se, Ae, Le, Ie, Me, Ee, He, De, Ne, Be, Ve, Fe, Re, Oe, Pe, We, ze, Ue, _e, qe, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
455
- if (Ut.includes(u))
453
+ const L = (u) => {
454
+ var d, b, C, k, T, I, E, M, W, V, F, R, Z, G, K, le, oe, ae, j, O, D, me, ye, Te, we, xe, Se, Le, Ae, Ee, Ie, Me, He, De, Ne, Be, Ve, Fe, Re, Oe, Pe, We, ze, _e, Ue, qe, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
455
+ if (_t.includes(u))
456
456
  switch (u) {
457
457
  case "-":
458
- return t(Ll, null, null);
458
+ return t(El, null, null);
459
459
  case "bold":
460
460
  return t("div", {
461
461
  class: `${a}-toolbar-item`,
462
- title: (b = l.value.toolbarTips) == null ? void 0 : b.bold,
462
+ title: (d = l.value.toolbarTips) == null ? void 0 : d.bold,
463
463
  onClick: () => {
464
464
  s("bold");
465
465
  }
466
- }, [t(x, {
466
+ }, [t(w, {
467
467
  name: "bold"
468
468
  }, null), e.showToolbarName && t("div", {
469
469
  class: `${a}-toolbar-item-name`
470
- }, [(p = l.value.toolbarTips) == null ? void 0 : p.bold])]);
470
+ }, [(b = l.value.toolbarTips) == null ? void 0 : b.bold])]);
471
471
  case "underline":
472
472
  return t("div", {
473
473
  class: `${a}-toolbar-item`,
474
- title: (y = l.value.toolbarTips) == null ? void 0 : y.underline,
474
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.underline,
475
475
  onClick: () => {
476
476
  s("underline");
477
477
  }
478
- }, [t(x, {
478
+ }, [t(w, {
479
479
  name: "underline"
480
480
  }, null), e.showToolbarName && t("div", {
481
481
  class: `${a}-toolbar-item-name`
@@ -483,60 +483,60 @@ const Ll = /* @__PURE__ */ P({
483
483
  case "italic":
484
484
  return t("div", {
485
485
  class: `${a}-toolbar-item`,
486
- title: (A = l.value.toolbarTips) == null ? void 0 : A.italic,
486
+ title: (T = l.value.toolbarTips) == null ? void 0 : T.italic,
487
487
  onClick: () => {
488
488
  s("italic");
489
489
  }
490
- }, [t(x, {
490
+ }, [t(w, {
491
491
  name: "italic"
492
492
  }, null), e.showToolbarName && t("div", {
493
493
  class: `${a}-toolbar-item-name`
494
- }, [(F = l.value.toolbarTips) == null ? void 0 : F.italic])]);
494
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.italic])]);
495
495
  case "strikeThrough":
496
496
  return t("div", {
497
497
  class: `${a}-toolbar-item`,
498
- title: (D = l.value.toolbarTips) == null ? void 0 : D.strikeThrough,
498
+ title: (E = l.value.toolbarTips) == null ? void 0 : E.strikeThrough,
499
499
  onClick: () => {
500
500
  s("strikeThrough");
501
501
  }
502
- }, [t(x, {
502
+ }, [t(w, {
503
503
  name: "strike-through"
504
504
  }, null), e.showToolbarName && t("div", {
505
505
  class: `${a}-toolbar-item-name`
506
- }, [(W = l.value.toolbarTips) == null ? void 0 : W.strikeThrough])]);
506
+ }, [(M = l.value.toolbarTips) == null ? void 0 : M.strikeThrough])]);
507
507
  case "title":
508
- return t(ae, {
508
+ return t(ne, {
509
509
  relative: `#${h}`,
510
- visible: d.title,
511
- onChange: (T) => {
512
- d.title = T;
510
+ visible: m.title,
511
+ onChange: (y) => {
512
+ m.title = y;
513
513
  },
514
514
  overlay: t("ul", {
515
515
  class: `${a}-menu`,
516
516
  onClick: () => {
517
- d.title = !1;
517
+ m.title = !1;
518
518
  }
519
519
  }, [t("li", {
520
520
  class: `${a}-menu-item ${a}-menu-item-title`,
521
521
  onClick: () => {
522
522
  s("h1");
523
523
  }
524
- }, [(q = l.value.titleItem) == null ? void 0 : q.h1]), t("li", {
524
+ }, [(W = l.value.titleItem) == null ? void 0 : W.h1]), t("li", {
525
525
  class: `${a}-menu-item ${a}-menu-item-title`,
526
526
  onClick: () => {
527
527
  s("h2");
528
528
  }
529
- }, [(R = l.value.titleItem) == null ? void 0 : R.h2]), t("li", {
529
+ }, [(V = l.value.titleItem) == null ? void 0 : V.h2]), t("li", {
530
530
  class: `${a}-menu-item ${a}-menu-item-title`,
531
531
  onClick: () => {
532
532
  s("h3");
533
533
  }
534
- }, [(N = l.value.titleItem) == null ? void 0 : N.h3]), t("li", {
534
+ }, [(F = l.value.titleItem) == null ? void 0 : F.h3]), t("li", {
535
535
  class: `${a}-menu-item ${a}-menu-item-title`,
536
536
  onClick: () => {
537
537
  s("h4");
538
538
  }
539
- }, [(B = l.value.titleItem) == null ? void 0 : B.h4]), t("li", {
539
+ }, [(R = l.value.titleItem) == null ? void 0 : R.h4]), t("li", {
540
540
  class: `${a}-menu-item ${a}-menu-item-title`,
541
541
  onClick: () => {
542
542
  s("h5");
@@ -549,15 +549,15 @@ const Ll = /* @__PURE__ */ P({
549
549
  }, [(G = l.value.titleItem) == null ? void 0 : G.h6])])
550
550
  }, {
551
551
  default: () => {
552
- var T, E;
552
+ var y, N;
553
553
  return [t("div", {
554
554
  class: `${a}-toolbar-item`,
555
- title: (T = l.value.toolbarTips) == null ? void 0 : T.title
556
- }, [t(x, {
555
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.title
556
+ }, [t(w, {
557
557
  name: "title"
558
558
  }, null), e.showToolbarName && t("div", {
559
559
  class: `${a}-toolbar-item-name`
560
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.title])])];
560
+ }, [(N = l.value.toolbarTips) == null ? void 0 : N.title])])];
561
561
  }
562
562
  });
563
563
  case "sub":
@@ -567,23 +567,23 @@ const Ll = /* @__PURE__ */ P({
567
567
  onClick: () => {
568
568
  s("sub");
569
569
  }
570
- }, [t(x, {
570
+ }, [t(w, {
571
571
  name: "sub"
572
572
  }, null), e.showToolbarName && t("div", {
573
573
  class: `${a}-toolbar-item-name`
574
- }, [(te = l.value.toolbarTips) == null ? void 0 : te.sub])]);
574
+ }, [(le = l.value.toolbarTips) == null ? void 0 : le.sub])]);
575
575
  case "sup":
576
576
  return t("div", {
577
577
  class: `${a}-toolbar-item`,
578
- title: (le = l.value.toolbarTips) == null ? void 0 : le.sup,
578
+ title: (oe = l.value.toolbarTips) == null ? void 0 : oe.sup,
579
579
  onClick: () => {
580
580
  s("sup");
581
581
  }
582
- }, [t(x, {
582
+ }, [t(w, {
583
583
  name: "sup"
584
584
  }, null), e.showToolbarName && t("div", {
585
585
  class: `${a}-toolbar-item-name`
586
- }, [(oe = l.value.toolbarTips) == null ? void 0 : oe.sup])]);
586
+ }, [(ae = l.value.toolbarTips) == null ? void 0 : ae.sup])]);
587
587
  case "quote":
588
588
  return t("div", {
589
589
  class: `${a}-toolbar-item`,
@@ -591,19 +591,19 @@ const Ll = /* @__PURE__ */ P({
591
591
  onClick: () => {
592
592
  s("quote");
593
593
  }
594
- }, [t(x, {
594
+ }, [t(w, {
595
595
  name: "quote"
596
596
  }, null), e.showToolbarName && t("div", {
597
597
  class: `${a}-toolbar-item-name`
598
- }, [(V = l.value.toolbarTips) == null ? void 0 : V.quote])]);
598
+ }, [(O = l.value.toolbarTips) == null ? void 0 : O.quote])]);
599
599
  case "unorderedList":
600
600
  return t("div", {
601
601
  class: `${a}-toolbar-item`,
602
- title: (M = l.value.toolbarTips) == null ? void 0 : M.unorderedList,
602
+ title: (D = l.value.toolbarTips) == null ? void 0 : D.unorderedList,
603
603
  onClick: () => {
604
604
  s("unorderedList");
605
605
  }
606
- }, [t(x, {
606
+ }, [t(w, {
607
607
  name: "unordered-list"
608
608
  }, null), e.showToolbarName && t("div", {
609
609
  class: `${a}-toolbar-item-name`
@@ -615,7 +615,7 @@ const Ll = /* @__PURE__ */ P({
615
615
  onClick: () => {
616
616
  s("orderedList");
617
617
  }
618
- }, [t(x, {
618
+ }, [t(w, {
619
619
  name: "ordered-list"
620
620
  }, null), e.showToolbarName && t("div", {
621
621
  class: `${a}-toolbar-item-name`
@@ -627,7 +627,7 @@ const Ll = /* @__PURE__ */ P({
627
627
  onClick: () => {
628
628
  s("task");
629
629
  }
630
- }, [t(x, {
630
+ }, [t(w, {
631
631
  name: "task"
632
632
  }, null), e.showToolbarName && t("div", {
633
633
  class: `${a}-toolbar-item-name`
@@ -639,35 +639,35 @@ const Ll = /* @__PURE__ */ P({
639
639
  onClick: () => {
640
640
  s("codeRow");
641
641
  }
642
- }, [t(x, {
642
+ }, [t(w, {
643
643
  name: "code-row"
644
644
  }, null), e.showToolbarName && t("div", {
645
645
  class: `${a}-toolbar-item-name`
646
- }, [(Ae = l.value.toolbarTips) == null ? void 0 : Ae.codeRow])]);
646
+ }, [(Le = l.value.toolbarTips) == null ? void 0 : Le.codeRow])]);
647
647
  case "code":
648
648
  return t("div", {
649
649
  class: `${a}-toolbar-item`,
650
- title: (Le = l.value.toolbarTips) == null ? void 0 : Le.code,
650
+ title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
651
651
  onClick: () => {
652
652
  s("code");
653
653
  }
654
- }, [t(x, {
654
+ }, [t(w, {
655
655
  name: "code"
656
656
  }, null), e.showToolbarName && t("div", {
657
657
  class: `${a}-toolbar-item-name`
658
- }, [(Ie = l.value.toolbarTips) == null ? void 0 : Ie.code])]);
658
+ }, [(Ee = l.value.toolbarTips) == null ? void 0 : Ee.code])]);
659
659
  case "link":
660
660
  return t("div", {
661
661
  class: `${a}-toolbar-item`,
662
- title: (Me = l.value.toolbarTips) == null ? void 0 : Me.link,
662
+ title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.link,
663
663
  onClick: () => {
664
664
  g.type = "link", g.linkVisible = !0;
665
665
  }
666
- }, [t(x, {
666
+ }, [t(w, {
667
667
  name: "link"
668
668
  }, null), e.showToolbarName && t("div", {
669
669
  class: `${a}-toolbar-item-name`
670
- }, [(Ee = l.value.toolbarTips) == null ? void 0 : Ee.link])]);
670
+ }, [(Me = l.value.toolbarTips) == null ? void 0 : Me.link])]);
671
671
  case "image":
672
672
  return e.noUploadImg ? t("div", {
673
673
  class: `${a}-toolbar-item`,
@@ -675,20 +675,20 @@ const Ll = /* @__PURE__ */ P({
675
675
  onClick: () => {
676
676
  g.type = "image", g.linkVisible = !0;
677
677
  }
678
- }, [t(x, {
678
+ }, [t(w, {
679
679
  name: "image"
680
680
  }, null), e.showToolbarName && t("div", {
681
681
  class: `${a}-toolbar-item-name`
682
- }, [(De = l.value.toolbarTips) == null ? void 0 : De.image])]) : t(ae, {
682
+ }, [(De = l.value.toolbarTips) == null ? void 0 : De.image])]) : t(ne, {
683
683
  relative: `#${h}`,
684
- visible: d.image,
685
- onChange: (T) => {
686
- d.image = T;
684
+ visible: m.image,
685
+ onChange: (y) => {
686
+ m.image = y;
687
687
  },
688
688
  overlay: t("ul", {
689
689
  class: `${a}-menu`,
690
690
  onClick: () => {
691
- d.title = !1;
691
+ m.title = !1;
692
692
  }
693
693
  }, [t("li", {
694
694
  class: `${a}-menu-item ${a}-menu-item-image`,
@@ -698,7 +698,7 @@ const Ll = /* @__PURE__ */ P({
698
698
  }, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.link]), t("li", {
699
699
  class: `${a}-menu-item ${a}-menu-item-image`,
700
700
  onClick: () => {
701
- S.value.click();
701
+ x.value.click();
702
702
  }
703
703
  }, [(Be = l.value.imgTitleItem) == null ? void 0 : Be.upload]), t("li", {
704
704
  class: `${a}-menu-item ${a}-menu-item-image`,
@@ -708,44 +708,44 @@ const Ll = /* @__PURE__ */ P({
708
708
  }, [(Ve = l.value.imgTitleItem) == null ? void 0 : Ve.clip2upload])])
709
709
  }, {
710
710
  default: () => {
711
- var T, E;
711
+ var y, N;
712
712
  return [t("div", {
713
713
  class: `${a}-toolbar-item`,
714
- title: (T = l.value.toolbarTips) == null ? void 0 : T.image
715
- }, [t(x, {
714
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.image
715
+ }, [t(w, {
716
716
  name: "image"
717
717
  }, null), e.showToolbarName && t("div", {
718
718
  class: `${a}-toolbar-item-name`
719
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.image])])];
719
+ }, [(N = l.value.toolbarTips) == null ? void 0 : N.image])])];
720
720
  }
721
721
  });
722
722
  case "table":
723
- return t(ae, {
723
+ return t(ne, {
724
724
  relative: `#${h}`,
725
- visible: d.table,
726
- onChange: (T) => {
727
- d.table = T;
725
+ visible: m.table,
726
+ onChange: (y) => {
727
+ m.table = y;
728
728
  },
729
729
  key: "bar-table",
730
- overlay: t(Dl, {
730
+ overlay: t(Nl, {
731
731
  tableShape: e.tableShape,
732
- onSelected: (T) => {
732
+ onSelected: (y) => {
733
733
  s("table", {
734
- selectedShape: T
734
+ selectedShape: y
735
735
  });
736
736
  }
737
737
  }, null)
738
738
  }, {
739
739
  default: () => {
740
- var T, E;
740
+ var y, N;
741
741
  return [t("div", {
742
742
  class: `${a}-toolbar-item`,
743
- title: (T = l.value.toolbarTips) == null ? void 0 : T.table
744
- }, [t(x, {
743
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.table
744
+ }, [t(w, {
745
745
  name: "table"
746
746
  }, null), e.showToolbarName && t("div", {
747
747
  class: `${a}-toolbar-item-name`
748
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.table])])];
748
+ }, [(N = l.value.toolbarTips) == null ? void 0 : N.table])])];
749
749
  }
750
750
  });
751
751
  case "revoke":
@@ -755,7 +755,7 @@ const Ll = /* @__PURE__ */ P({
755
755
  onClick: () => {
756
756
  v.emit(o, Nt);
757
757
  }
758
- }, [t(x, {
758
+ }, [t(w, {
759
759
  name: "revoke"
760
760
  }, null), e.showToolbarName && t("div", {
761
761
  class: `${a}-toolbar-item-name`
@@ -767,7 +767,7 @@ const Ll = /* @__PURE__ */ P({
767
767
  onClick: () => {
768
768
  v.emit(o, Dt);
769
769
  }
770
- }, [t(x, {
770
+ }, [t(w, {
771
771
  name: "next"
772
772
  }, null), e.showToolbarName && t("div", {
773
773
  class: `${a}-toolbar-item-name`
@@ -779,7 +779,7 @@ const Ll = /* @__PURE__ */ P({
779
779
  onClick: () => {
780
780
  v.emit(o, Ht);
781
781
  }
782
- }, [t(x, {
782
+ }, [t(w, {
783
783
  name: "baocun"
784
784
  }, null), e.showToolbarName && t("div", {
785
785
  class: `${a}-toolbar-item-name`
@@ -787,15 +787,15 @@ const Ll = /* @__PURE__ */ P({
787
787
  case "prettier":
788
788
  return e.noPrettier ? "" : t("div", {
789
789
  class: `${a}-toolbar-item`,
790
- title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier,
790
+ title: (_e = l.value.toolbarTips) == null ? void 0 : _e.prettier,
791
791
  onClick: () => {
792
792
  s("prettier");
793
793
  }
794
- }, [t(x, {
794
+ }, [t(w, {
795
795
  name: "prettier"
796
796
  }, null), e.showToolbarName && t("div", {
797
797
  class: `${a}-toolbar-item-name`
798
- }, [(_e = l.value.toolbarTips) == null ? void 0 : _e.prettier])]);
798
+ }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier])]);
799
799
  case "pageFullscreen":
800
800
  return !e.setting.fullscreen && t("div", {
801
801
  class: `${a}-toolbar-item`,
@@ -803,7 +803,7 @@ const Ll = /* @__PURE__ */ P({
803
803
  onClick: () => {
804
804
  e.updateSetting("pageFullscreen");
805
805
  }
806
- }, [t(x, {
806
+ }, [t(w, {
807
807
  name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
808
808
  }, null), e.showToolbarName && t("div", {
809
809
  class: `${a}-toolbar-item-name`
@@ -815,7 +815,7 @@ const Ll = /* @__PURE__ */ P({
815
815
  onClick: () => {
816
816
  i();
817
817
  }
818
- }, [t(x, {
818
+ }, [t(w, {
819
819
  name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
820
820
  }, null), e.showToolbarName && t("div", {
821
821
  class: `${a}-toolbar-item-name`
@@ -827,7 +827,7 @@ const Ll = /* @__PURE__ */ P({
827
827
  onClick: () => {
828
828
  e.updateSetting("preview");
829
829
  }
830
- }, [t(x, {
830
+ }, [t(w, {
831
831
  name: "preview"
832
832
  }, null), e.showToolbarName && t("div", {
833
833
  class: `${a}-toolbar-item-name`
@@ -839,7 +839,7 @@ const Ll = /* @__PURE__ */ P({
839
839
  onClick: () => {
840
840
  e.updateSetting("htmlPreview");
841
841
  }
842
- }, [t(x, {
842
+ }, [t(w, {
843
843
  name: "coding"
844
844
  }, null), e.showToolbarName && t("div", {
845
845
  class: `${a}-toolbar-item-name`
@@ -852,7 +852,7 @@ const Ll = /* @__PURE__ */ P({
852
852
  v.emit(o, Qt);
853
853
  },
854
854
  key: "bar-catalog"
855
- }, [t(x, {
855
+ }, [t(w, {
856
856
  name: "catalog"
857
857
  }, null), e.showToolbarName && t("div", {
858
858
  class: `${a}-toolbar-item-name`
@@ -862,22 +862,22 @@ const Ll = /* @__PURE__ */ P({
862
862
  class: `${a}-toolbar-item`,
863
863
  title: (tt = l.value.toolbarTips) == null ? void 0 : tt.github,
864
864
  onClick: () => Gt("https://github.com/imzbf/md-editor-v3")
865
- }, [t(x, {
865
+ }, [t(w, {
866
866
  name: "github"
867
867
  }, null), e.showToolbarName && t("div", {
868
868
  class: `${a}-toolbar-item-name`
869
869
  }, [(lt = l.value.toolbarTips) == null ? void 0 : lt.github])]);
870
870
  case "mermaid":
871
- return t(ae, {
871
+ return t(ne, {
872
872
  relative: `#${h}`,
873
- visible: d.mermaid,
874
- onChange: (T) => {
875
- d.mermaid = T;
873
+ visible: m.mermaid,
874
+ onChange: (y) => {
875
+ m.mermaid = y;
876
876
  },
877
877
  overlay: t("ul", {
878
878
  class: `${a}-menu`,
879
879
  onClick: () => {
880
- d.mermaid = !1;
880
+ m.mermaid = !1;
881
881
  }
882
882
  }, [t("li", {
883
883
  class: `${a}-menu-item ${a}-menu-item-mermaid`,
@@ -923,28 +923,28 @@ const Ll = /* @__PURE__ */ P({
923
923
  key: "bar-mermaid"
924
924
  }, {
925
925
  default: () => {
926
- var T, E;
926
+ var y, N;
927
927
  return [t("div", {
928
928
  class: `${a}-toolbar-item`,
929
- title: (T = l.value.toolbarTips) == null ? void 0 : T.mermaid
930
- }, [t(x, {
929
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.mermaid
930
+ }, [t(w, {
931
931
  name: "mermaid"
932
932
  }, null), e.showToolbarName && t("div", {
933
933
  class: `${a}-toolbar-item-name`
934
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.mermaid])])];
934
+ }, [(N = l.value.toolbarTips) == null ? void 0 : N.mermaid])])];
935
935
  }
936
936
  });
937
937
  case "katex":
938
- return t(ae, {
938
+ return t(ne, {
939
939
  relative: `#${h}`,
940
- visible: d.katex,
941
- onChange: (T) => {
942
- d.katex = T;
940
+ visible: m.katex,
941
+ onChange: (y) => {
942
+ m.katex = y;
943
943
  },
944
944
  overlay: t("ul", {
945
945
  class: `${a}-menu`,
946
946
  onClick: () => {
947
- d.katex = !1;
947
+ m.katex = !1;
948
948
  }
949
949
  }, [t("li", {
950
950
  class: `${a}-menu-item ${a}-menu-item-katex`,
@@ -960,36 +960,36 @@ const Ll = /* @__PURE__ */ P({
960
960
  key: "bar-katex"
961
961
  }, {
962
962
  default: () => {
963
- var T, E;
963
+ var y, N;
964
964
  return [t("div", {
965
965
  class: `${a}-toolbar-item`,
966
- title: (T = l.value.toolbarTips) == null ? void 0 : T.katex
967
- }, [t(x, {
966
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.katex
967
+ }, [t(w, {
968
968
  name: "formula"
969
969
  }, null), e.showToolbarName && t("div", {
970
970
  class: `${a}-toolbar-item-name`
971
- }, [(E = l.value.toolbarTips) == null ? void 0 : E.katex])])];
971
+ }, [(N = l.value.toolbarTips) == null ? void 0 : N.katex])])];
972
972
  }
973
973
  });
974
974
  }
975
975
  else if (e.defToolbars instanceof Array) {
976
- const T = e.defToolbars[u];
977
- return T ? gt(T, {
976
+ const y = e.defToolbars[u];
977
+ return y ? gt(y, {
978
978
  theme: n.value,
979
979
  language: r.value,
980
980
  insert(ge) {
981
- v.emit(o, L, "universal", {
981
+ v.emit(o, A, "universal", {
982
982
  generate: ge
983
983
  });
984
984
  }
985
985
  }) : "";
986
986
  } else if (e.defToolbars && e.defToolbars.children instanceof Array) {
987
- const T = e.defToolbars.children[u];
988
- return T ? gt(T, {
987
+ const y = e.defToolbars.children[u];
988
+ return y ? gt(y, {
989
989
  theme: n.value,
990
990
  language: r.value,
991
991
  insert(ge) {
992
- v.emit(o, L, "universal", {
992
+ v.emit(o, A, "universal", {
993
993
  generate: ge
994
994
  });
995
995
  }
@@ -997,15 +997,15 @@ const Ll = /* @__PURE__ */ P({
997
997
  } else
998
998
  return "";
999
999
  };
1000
- return H(() => e.toolbars, () => {
1000
+ return B(() => e.toolbars, () => {
1001
1001
  de(() => {
1002
1002
  f.value && qt(f.value);
1003
1003
  });
1004
1004
  }, {
1005
1005
  immediate: !0
1006
1006
  }), () => {
1007
- const u = $.value[0].map((p) => C(p)), b = $.value[1].map((p) => C(p));
1008
- return t(Mt, null, [e.toolbars.length > 0 && t("div", {
1007
+ const u = p.value[0].map((b) => L(b)), d = p.value[1].map((b) => L(b));
1008
+ return t(It, null, [e.toolbars.length > 0 && t("div", {
1009
1009
  class: `${a}-toolbar-wrapper`,
1010
1010
  ref: f,
1011
1011
  id: h
@@ -1013,38 +1013,38 @@ const Ll = /* @__PURE__ */ P({
1013
1013
  class: [`${a}-toolbar`, e.showToolbarName && `${a}-stn`]
1014
1014
  }, [t("div", {
1015
1015
  class: `${a}-toolbar-left`,
1016
- ref: w
1016
+ ref: $
1017
1017
  }, [u]), t("div", {
1018
1018
  class: `${a}-toolbar-right`
1019
- }, [b])])]), t("input", {
1020
- ref: S,
1019
+ }, [d])])]), t("input", {
1020
+ ref: x,
1021
1021
  accept: "image/*",
1022
1022
  type: "file",
1023
1023
  multiple: !0,
1024
1024
  style: {
1025
1025
  display: "none"
1026
1026
  }
1027
- }, null), t(Ol, {
1027
+ }, null), t(Pl, {
1028
1028
  linkVisible: g.linkVisible,
1029
1029
  clipVisible: g.clipVisible,
1030
1030
  type: g.type,
1031
1031
  onCancel: () => {
1032
1032
  g.linkVisible = !1, g.clipVisible = !1;
1033
1033
  },
1034
- onOk: (p) => {
1035
- p && s(g.type, {
1036
- desc: p.desc,
1037
- url: p.url
1034
+ onOk: (b) => {
1035
+ b && s(g.type, {
1036
+ desc: b.desc,
1037
+ url: b.url
1038
1038
  }), g.linkVisible = !1, g.clipVisible = !1;
1039
1039
  }
1040
1040
  }, null)]);
1041
1041
  };
1042
1042
  }
1043
- }), Wl = `.${a}-preview > [data-line]`, zl = (e, o) => {
1043
+ }), zl = `.${a}-preview > [data-line]`, _l = (e, o) => {
1044
1044
  const l = Kt(() => {
1045
1045
  e.removeEventListener("scroll", n), e.addEventListener("scroll", n), o.removeEventListener("scroll", n), o.addEventListener("scroll", n);
1046
1046
  }, 50), n = (r) => {
1047
- const i = e.clientHeight, h = o.clientHeight, f = e.scrollHeight, d = o.scrollHeight, s = (f - i) / (d - h);
1047
+ const i = e.clientHeight, h = o.clientHeight, f = e.scrollHeight, m = o.scrollHeight, s = (f - i) / (m - h);
1048
1048
  r.target === e ? (o.removeEventListener("scroll", n), o.scrollTo({
1049
1049
  top: e.scrollTop / s
1050
1050
  // behavior: 'smooth'
@@ -1065,111 +1065,111 @@ const Ll = /* @__PURE__ */ P({
1065
1065
  ];
1066
1066
  }, Ul = (e, o, l) => {
1067
1067
  const { view: n } = l, r = jt(), i = (u) => n.lineBlockAt(n.state.doc.line(u).from).top, h = (u) => n.lineBlockAt(n.state.doc.line(u).from).height;
1068
- let f = [], d = [], s = [];
1068
+ let f = [], m = [], s = [];
1069
1069
  const g = () => {
1070
- f = [], d = [], s = [], d = d.concat(
1071
- Array.from(o.querySelectorAll(Wl))
1070
+ f = [], m = [], s = [], m = m.concat(
1071
+ Array.from(o.querySelectorAll(zl))
1072
1072
  );
1073
- const u = d.map((k) => Number(k.dataset.line) + 1);
1073
+ const u = m.map((k) => Number(k.dataset.line) + 1);
1074
1074
  s = s.concat(u);
1075
- const { lines: b } = n.state.doc;
1076
- let p = 1, y = u.shift() ?? b;
1077
- for (let k = 1; k <= b; k++)
1078
- k === y && (p = k, y = u.shift() || b + 1), f.push({
1079
- start: p,
1080
- end: y - 1
1075
+ const { lines: d } = n.state.doc;
1076
+ let b = 1, C = u.shift() ?? d;
1077
+ for (let k = 1; k <= d; k++)
1078
+ k === C && (b = k, C = u.shift() || d + 1), f.push({
1079
+ start: b,
1080
+ end: C - 1
1081
1081
  });
1082
1082
  };
1083
- let w = 0, $ = 0;
1084
- const S = () => {
1083
+ let $ = 0, p = 0;
1084
+ const x = () => {
1085
1085
  var G, K;
1086
- if ($ !== 0)
1086
+ if (p !== 0)
1087
1087
  return !1;
1088
- w++;
1089
- const { scrollDOM: u, contentHeight: b } = n;
1090
- let p = +getComputedStyle(o).paddingTop.replace("px", "");
1091
- const y = n.lineBlockAtHeight(u.scrollTop), { number: k } = n.state.doc.lineAt(y.from), A = f[k - 1];
1092
- if (!A)
1088
+ $++;
1089
+ const { scrollDOM: u, contentHeight: d } = n;
1090
+ let b = +getComputedStyle(o).paddingTop.replace("px", "");
1091
+ const C = n.lineBlockAtHeight(u.scrollTop), { number: k } = n.state.doc.lineAt(C.from), T = f[k - 1];
1092
+ if (!T)
1093
1093
  return !1;
1094
- let F = i(A.end) + h(A.end), D = 0;
1095
- const W = i(A.start), q = o.querySelector(`[data-line="${A.start - 1}"]`) || ((G = o.firstElementChild) == null ? void 0 : G.firstElementChild), R = o.querySelector(`[data-line="${A.end}"]`) || ((K = o.lastElementChild) == null ? void 0 : K.lastElementChild);
1096
- let N = 0, B = 0;
1097
- W === 0 ? (D = u.scrollTop / F, q === R ? (p = 0, F = b - u.offsetHeight, N = R.offsetTop + R.offsetHeight - o.clientHeight) : N = R.offsetTop) : (D = (u.scrollTop - W) / (F - W), B = q.offsetTop, N = R.offsetTop - B), F > u.scrollHeight - u.clientHeight && (D = (u.scrollTop - W) / (u.scrollHeight - u.clientHeight - W), B = q.offsetTop, N = o.scrollHeight - o.clientHeight - B + 10);
1098
- const Z = B - p + N * D;
1094
+ let I = i(T.end) + h(T.end), E = 0;
1095
+ const M = i(T.start), W = o.querySelector(`[data-line="${T.start - 1}"]`) || ((G = o.firstElementChild) == null ? void 0 : G.firstElementChild), V = o.querySelector(`[data-line="${T.end}"]`) || ((K = o.lastElementChild) == null ? void 0 : K.lastElementChild);
1096
+ let F = 0, R = 0;
1097
+ M === 0 ? (E = u.scrollTop / I, W === V ? (b = 0, I = d - u.offsetHeight, F = V.offsetTop + V.offsetHeight - o.clientHeight) : F = V.offsetTop) : (E = (u.scrollTop - M) / (I - M), R = W.offsetTop, F = V.offsetTop - R), I > u.scrollHeight - u.clientHeight && (E = (u.scrollTop - M) / (u.scrollHeight - u.clientHeight - M), R = W.offsetTop, F = o.scrollHeight - o.clientHeight - R + 10);
1098
+ const Z = R - b + F * E;
1099
1099
  r(o, Z, () => {
1100
- w--;
1100
+ $--;
1101
1101
  });
1102
- }, m = () => {
1103
- var Z, G, K, te, le, oe;
1104
- if (w !== 0)
1102
+ }, S = () => {
1103
+ var Z, G, K, le, oe, ae;
1104
+ if ($ !== 0)
1105
1105
  return;
1106
- $++;
1107
- const { scrollDOM: u } = n, b = o.scrollTop, p = o.scrollHeight;
1108
- let y = (Z = o.firstElementChild) == null ? void 0 : Z.firstElementChild, k = (G = o.firstElementChild) == null ? void 0 : G.lastElementChild;
1106
+ p++;
1107
+ const { scrollDOM: u } = n, d = o.scrollTop, b = o.scrollHeight;
1108
+ let C = (Z = o.firstElementChild) == null ? void 0 : Z.firstElementChild, k = (G = o.firstElementChild) == null ? void 0 : G.lastElementChild;
1109
1109
  if (s.length > 0) {
1110
1110
  let j = Math.ceil(
1111
- Number(s[s.length - 1]) * (b / p)
1112
- ), V = s.findLastIndex((M) => M <= j);
1113
- V = V === -1 ? 0 : V, j = s[V];
1114
- for (let M = V; M >= 0 && M < s.length; )
1115
- if (d[M].offsetTop > b) {
1116
- if (M - 1 >= 0) {
1117
- M--;
1111
+ Number(s[s.length - 1]) * (d / b)
1112
+ ), O = s.findLastIndex((D) => D <= j);
1113
+ O = O === -1 ? 0 : O, j = s[O];
1114
+ for (let D = O; D >= 0 && D < s.length; )
1115
+ if (m[D].offsetTop > d) {
1116
+ if (D - 1 >= 0) {
1117
+ D--;
1118
1118
  continue;
1119
1119
  }
1120
- j = -1, V = M;
1120
+ j = -1, O = D;
1121
1121
  break;
1122
1122
  } else {
1123
- if (M + 1 <= s.length && d[M + 1].offsetTop < b) {
1124
- M++;
1123
+ if (D + 1 <= s.length && m[D + 1].offsetTop < d) {
1124
+ D++;
1125
1125
  continue;
1126
1126
  }
1127
- j = s[M], V = M;
1127
+ j = s[D], O = D;
1128
1128
  break;
1129
1129
  }
1130
1130
  switch (j) {
1131
1131
  case -1: {
1132
- y = (K = o.firstElementChild) == null ? void 0 : K.firstElementChild, k = d[V];
1132
+ C = (K = o.firstElementChild) == null ? void 0 : K.firstElementChild, k = m[O];
1133
1133
  break;
1134
1134
  }
1135
1135
  case s.length - 1: {
1136
- y = d[V], k = (te = o.firstElementChild) == null ? void 0 : te.lastElementChild;
1136
+ C = m[O], k = (le = o.firstElementChild) == null ? void 0 : le.lastElementChild;
1137
1137
  break;
1138
1138
  }
1139
1139
  default:
1140
- y = d[V], k = d[V + 1];
1140
+ C = m[O], k = m[O + 1];
1141
1141
  }
1142
1142
  }
1143
- const A = y === ((le = o.firstElementChild) == null ? void 0 : le.firstElementChild) ? 0 : y.offsetTop;
1144
- let F = k.offsetTop, D = 0;
1145
- const { start: W, end: q } = f[Number(y.dataset.line || 0)], R = i(W);
1146
- let N = i(q + 1), B = 0;
1147
- N > u.scrollHeight - u.clientHeight || k.scrollTop > o.scrollHeight - o.clientHeight ? (D = Math.max(
1148
- (b - A) / (o.scrollHeight - A - o.clientHeight),
1143
+ const T = C === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? 0 : C.offsetTop;
1144
+ let I = k.offsetTop, E = 0;
1145
+ const { start: M, end: W } = f[Number(C.dataset.line || 0)], V = i(M);
1146
+ let F = i(W + 1), R = 0;
1147
+ F > u.scrollHeight - u.clientHeight || k.scrollTop > o.scrollHeight - o.clientHeight ? (E = Math.max(
1148
+ (d - T) / (o.scrollHeight - T - o.clientHeight),
1149
1149
  0
1150
- ), N = i(n.state.doc.lines) + h(n.state.doc.lines), B = 8 + N - R - e.clientHeight) : y === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (y === k && (F = k.offsetTop + k.offsetHeight + +getComputedStyle(k).marginBottom.replace("px", "")), B = N, D = Math.max(b / F, 0)) : (D = Math.max(
1151
- (b - A) / (F - A),
1150
+ ), F = i(n.state.doc.lines) + h(n.state.doc.lines), R = 8 + F - V - e.clientHeight) : C === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (C === k && (I = k.offsetTop + k.offsetHeight + +getComputedStyle(k).marginBottom.replace("px", "")), R = F, E = Math.max(d / I, 0)) : (E = Math.max(
1151
+ (d - T) / (I - T),
1152
1152
  0
1153
- ), B = N - R), r(e, R + B * D, () => {
1154
- $--;
1153
+ ), R = F - V), r(e, V + R * E, () => {
1154
+ p--;
1155
1155
  });
1156
- }, C = Zt((u) => {
1156
+ }, L = Zt((u) => {
1157
1157
  var k;
1158
- const { scrollDOM: b, contentHeight: p } = n, y = b.clientHeight;
1159
- if (p <= y || o.firstElementChild.clientHeight <= o.clientHeight || n.state.doc.lines < ((k = f[f.length - 1]) == null ? void 0 : k.end))
1158
+ const { scrollDOM: d, contentHeight: b } = n, C = d.clientHeight;
1159
+ if (b <= C || o.firstElementChild.clientHeight <= o.clientHeight || n.state.doc.lines < ((k = f[f.length - 1]) == null ? void 0 : k.end))
1160
1160
  return !1;
1161
- u.target === e ? S() : m();
1161
+ u.target === e ? x() : S();
1162
1162
  }, 8);
1163
1163
  return [
1164
1164
  () => {
1165
- g(), e.addEventListener("scroll", C), o.addEventListener("scroll", C), e.dispatchEvent(new Event("scroll"));
1165
+ g(), e.addEventListener("scroll", L), o.addEventListener("scroll", L), e.dispatchEvent(new Event("scroll"));
1166
1166
  },
1167
1167
  () => {
1168
- e.removeEventListener("scroll", C), o.removeEventListener("scroll", C);
1168
+ e.removeEventListener("scroll", L), o.removeEventListener("scroll", L);
1169
1169
  }
1170
1170
  ];
1171
- }, _l = (e, o, l) => {
1172
- const n = I("editorId");
1171
+ }, ql = (e, o, l) => {
1172
+ const n = H("editorId");
1173
1173
  let r = () => {
1174
1174
  }, i = () => {
1175
1175
  };
@@ -1177,140 +1177,140 @@ const Ll = /* @__PURE__ */ P({
1177
1177
  r();
1178
1178
  const f = document.querySelector(
1179
1179
  `#${n} .cm-scroller`
1180
- ), d = document.querySelector(
1180
+ ), m = document.querySelector(
1181
1181
  `[id="${n}-preview-wrapper"]`
1182
1182
  ), s = document.querySelector(
1183
1183
  `[id="${n}-html-wrapper"]`
1184
1184
  );
1185
- (d || s) && ([i, r] = (d ? Ul : zl)(
1185
+ (m || s) && ([i, r] = (m ? Ul : _l)(
1186
1186
  f,
1187
- d || s,
1187
+ m || s,
1188
1188
  l.value
1189
1189
  )), e.scrollAuto && i();
1190
1190
  };
1191
- H(
1191
+ B(
1192
1192
  [
1193
1193
  o,
1194
- Q(e.setting, "preview"),
1195
- Q(e.setting, "htmlPreview"),
1196
- Q(e.setting, "fullscreen"),
1197
- Q(e.setting, "pageFullscreen")
1194
+ ee(e.setting, "preview"),
1195
+ ee(e.setting, "htmlPreview"),
1196
+ ee(e.setting, "fullscreen"),
1197
+ ee(e.setting, "pageFullscreen")
1198
1198
  ],
1199
1199
  () => {
1200
1200
  de(h);
1201
1201
  }
1202
- ), H(
1202
+ ), B(
1203
1203
  () => e.scrollAuto,
1204
1204
  (f) => {
1205
1205
  f ? i() : r();
1206
1206
  }
1207
1207
  ), Y(h);
1208
- }, ql = (e, o, l) => {
1209
- var g, w, $, S, m, C;
1208
+ }, Gl = (e, o, l) => {
1209
+ var g, $, p, x, S, L;
1210
1210
  let n = "", r = 0, i = 0, h = !0, f = !1;
1211
- const d = o.getSelectedText(), s = (g = X.editorConfig) == null ? void 0 : g.mermaidTemplate;
1211
+ const m = o.getSelectedText(), s = (g = X.editorConfig) == null ? void 0 : g.mermaidTemplate;
1212
1212
  if (/^h[1-6]{1}$/.test(e)) {
1213
- const u = e.replace(/^h(\d)/, (b, p) => new Array(Number(p)).fill("#", 0, p).join(""));
1214
- n = `${u} ${d}`, r = u.length + 1;
1213
+ const u = e.replace(/^h(\d)/, (d, b) => new Array(Number(b)).fill("#", 0, b).join(""));
1214
+ n = `${u} ${m}`, r = u.length + 1;
1215
1215
  } else if (e === "prettier") {
1216
- const u = window.prettier || (($ = (w = X.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : $.prettierInstance), b = [
1217
- ((S = window.prettierPlugins) == null ? void 0 : S.markdown) || ((C = (m = X.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : C.parserMarkdownInstance)
1216
+ const u = window.prettier || ((p = ($ = X.editorExtensions) == null ? void 0 : $.prettier) == null ? void 0 : p.prettierInstance), d = [
1217
+ ((x = window.prettierPlugins) == null ? void 0 : x.markdown) || ((L = (S = X.editorExtensions) == null ? void 0 : S.prettier) == null ? void 0 : L.parserMarkdownInstance)
1218
1218
  ];
1219
- !u || b[0] === void 0 ? (v.emit(l.editorId, ee, {
1219
+ !u || d[0] === void 0 ? (v.emit(l.editorId, te, {
1220
1220
  name: "prettier",
1221
1221
  message: "prettier is undefined"
1222
1222
  }), n = o.getValue()) : n = u.format(o.getValue(), {
1223
1223
  parser: "markdown",
1224
- plugins: b
1224
+ plugins: d
1225
1225
  }), h = !1, f = !0;
1226
1226
  } else
1227
1227
  switch (e) {
1228
1228
  case "bold": {
1229
- n = `**${d}**`, r = 2, i = -2;
1229
+ n = `**${m}**`, r = 2, i = -2;
1230
1230
  break;
1231
1231
  }
1232
1232
  case "underline": {
1233
- n = `<u>${d}</u>`, r = 3, i = -4;
1233
+ n = `<u>${m}</u>`, r = 3, i = -4;
1234
1234
  break;
1235
1235
  }
1236
1236
  case "italic": {
1237
- n = `*${d}*`, r = 1, i = -1;
1237
+ n = `*${m}*`, r = 1, i = -1;
1238
1238
  break;
1239
1239
  }
1240
1240
  case "strikeThrough": {
1241
- n = `~~${d}~~`, r = 2, i = -2;
1241
+ n = `~~${m}~~`, r = 2, i = -2;
1242
1242
  break;
1243
1243
  }
1244
1244
  case "sub": {
1245
- n = `<sub>${d}</sub>`, r = 5, i = -6;
1245
+ n = `<sub>${m}</sub>`, r = 5, i = -6;
1246
1246
  break;
1247
1247
  }
1248
1248
  case "sup": {
1249
- n = `<sup>${d}</sup>`, r = 5, i = -6;
1249
+ n = `<sup>${m}</sup>`, r = 5, i = -6;
1250
1250
  break;
1251
1251
  }
1252
1252
  case "codeRow": {
1253
- n = "`" + d + "`", r = 1, i = -1;
1253
+ n = "`" + m + "`", r = 1, i = -1;
1254
1254
  break;
1255
1255
  }
1256
1256
  case "quote": {
1257
- n = `> ${d}`, r = 2;
1257
+ n = `> ${m}`, r = 2;
1258
1258
  break;
1259
1259
  }
1260
1260
  case "orderedList": {
1261
- n = `1. ${d}`, r = 3;
1261
+ n = `1. ${m}`, r = 3;
1262
1262
  break;
1263
1263
  }
1264
1264
  case "unorderedList": {
1265
- n = `- ${d}`, r = 2;
1265
+ n = `- ${m}`, r = 2;
1266
1266
  break;
1267
1267
  }
1268
1268
  case "task": {
1269
- n = `- [ ] ${d}`, r = 6;
1269
+ n = `- [ ] ${m}`, r = 6;
1270
1270
  break;
1271
1271
  }
1272
1272
  case "code": {
1273
- const u = l.text || d || "", b = l.mode || "language";
1274
- n = `\`\`\`${b}
1273
+ const u = l.text || m || "", d = l.mode || "language";
1274
+ n = `\`\`\`${d}
1275
1275
  ${u}
1276
1276
  \`\`\`
1277
- `, r = 3, i = 3 + b.length - n.length;
1277
+ `, r = 3, i = 3 + d.length - n.length;
1278
1278
  break;
1279
1279
  }
1280
1280
  case "table": {
1281
1281
  n = "|";
1282
- const { selectedShape: u = { x: 1, y: 1 } } = l, { x: b, y: p } = u;
1283
- for (let y = 0; y <= p; y++)
1282
+ const { selectedShape: u = { x: 1, y: 1 } } = l, { x: d, y: b } = u;
1283
+ for (let C = 0; C <= b; C++)
1284
1284
  n += " col |";
1285
1285
  n += `
1286
1286
  |`;
1287
- for (let y = 0; y <= p; y++)
1287
+ for (let C = 0; C <= b; C++)
1288
1288
  n += " - |";
1289
- for (let y = 0; y <= b; y++) {
1289
+ for (let C = 0; C <= d; C++) {
1290
1290
  n += `
1291
1291
  |`;
1292
- for (let k = 0; k <= p; k++)
1292
+ for (let k = 0; k <= b; k++)
1293
1293
  n += " content |";
1294
1294
  }
1295
1295
  r = 2, i = 5 - n.length;
1296
1296
  break;
1297
1297
  }
1298
1298
  case "link": {
1299
- const { desc: u, url: b } = l;
1300
- n = `[${u}](${b})`, h = !1;
1299
+ const { desc: u, url: d } = l;
1300
+ n = `[${u}](${d})`, h = !1;
1301
1301
  break;
1302
1302
  }
1303
1303
  case "image": {
1304
- const { desc: u, url: b, urls: p } = l;
1305
- p instanceof Array ? n = p.reduce((y, k) => {
1304
+ const { desc: u, url: d, urls: b } = l;
1305
+ b instanceof Array ? n = b.reduce((C, k) => {
1306
1306
  const {
1307
- url: A = "",
1308
- alt: F = "",
1309
- title: D = ""
1307
+ url: T = "",
1308
+ alt: I = "",
1309
+ title: E = ""
1310
1310
  } = typeof k == "object" ? k : { url: k };
1311
- return y + `![${F}](${A}${D ? " '" + D + "'" : ""})
1311
+ return C + `![${I}](${T}${E ? " '" + E + "'" : ""})
1312
1312
  `;
1313
- }, "") : n = `![${u}](${b})
1313
+ }, "") : n = `![${u}](${d})
1314
1314
  `, h = !1;
1315
1315
  break;
1316
1316
  }
@@ -1407,8 +1407,8 @@ $$
1407
1407
  break;
1408
1408
  }
1409
1409
  case "universal": {
1410
- const { generate: u } = l, b = u(d);
1411
- n = b.targetValue, h = b.select ?? !0, r = b.deviationStart || 0, i = b.deviationEnd || 0;
1410
+ const { generate: u } = l, d = u(m);
1411
+ n = d.targetValue, h = d.select ?? !0, r = d.deviationStart || 0, i = d.deviationEnd || 0;
1412
1412
  }
1413
1413
  }
1414
1414
  return {
@@ -1424,18 +1424,18 @@ $$
1424
1424
  replaceAll: f
1425
1425
  }
1426
1426
  };
1427
- }, Gl = "#e5c07b", bt = "var(--md-color)", Kl = "#56b6c2", jl = "#ffffff", ie = "var(--md-color)", vt = "#e5c07b", Zl = "#e5c07b", Xl = "var(--md-color)", kt = "#d19a66", Yl = "#c678dd", Jl = "#21252b", Ql = "#2c313a", Ct = "var(--md-bk-color)", he = "var(--md-bk-color)", eo = "#ceedfa33", $t = "#528bff", to = pe.theme(
1427
+ }, Kl = "#e5c07b", bt = "var(--md-color)", jl = "#56b6c2", Zl = "#ffffff", re = "var(--md-color)", vt = "#e5c07b", Xl = "#e5c07b", Yl = "var(--md-color)", kt = "#d19a66", Jl = "#c678dd", Ql = "#21252b", eo = "#2c313a", Ct = "var(--md-bk-color)", he = "var(--md-bk-color)", to = "#ceedfa33", pt = "#528bff", lo = $e.theme(
1428
1428
  {
1429
1429
  "&": {
1430
- color: ie,
1430
+ color: re,
1431
1431
  backgroundColor: Ct
1432
1432
  },
1433
1433
  ".cm-content": {
1434
- caretColor: $t
1434
+ caretColor: pt
1435
1435
  },
1436
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: $t },
1437
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: eo },
1438
- ".cm-panels": { backgroundColor: Jl, color: ie },
1436
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: pt },
1437
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: to },
1438
+ ".cm-panels": { backgroundColor: Ql, color: re },
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,12 +1452,12 @@ $$
1452
1452
  },
1453
1453
  ".cm-gutters": {
1454
1454
  backgroundColor: Ct,
1455
- color: ie,
1455
+ color: re,
1456
1456
  borderRight: "1px solid",
1457
1457
  borderColor: "var(--md-border-color)"
1458
1458
  },
1459
1459
  ".cm-activeLineGutter": {
1460
- backgroundColor: Ql
1460
+ backgroundColor: eo
1461
1461
  },
1462
1462
  ".cm-foldPlaceholder": {
1463
1463
  backgroundColor: "transparent",
@@ -1478,17 +1478,17 @@ $$
1478
1478
  },
1479
1479
  ".cm-tooltip-autocomplete": {
1480
1480
  "& > ul > li[aria-selected]": {
1481
- color: ie
1481
+ color: re
1482
1482
  }
1483
1483
  }
1484
1484
  },
1485
1485
  { dark: !0 }
1486
- ), lo = Vt.define([
1487
- { tag: c.keyword, color: Yl },
1486
+ ), oo = Vt.define([
1487
+ { tag: c.keyword, color: Jl },
1488
1488
  { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: bt },
1489
- { tag: [c.function(c.variableName), c.labelName], color: Zl },
1489
+ { tag: [c.function(c.variableName), c.labelName], color: Xl },
1490
1490
  { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: kt },
1491
- { tag: [c.definition(c.name), c.separator], color: ie },
1491
+ { tag: [c.definition(c.name), c.separator], color: re },
1492
1492
  {
1493
1493
  tag: [
1494
1494
  c.typeName,
@@ -1500,7 +1500,7 @@ $$
1500
1500
  c.self,
1501
1501
  c.namespace
1502
1502
  ],
1503
- color: Gl
1503
+ color: Kl
1504
1504
  },
1505
1505
  {
1506
1506
  tag: [
@@ -1512,7 +1512,7 @@ $$
1512
1512
  c.link,
1513
1513
  c.special(c.string)
1514
1514
  ],
1515
- color: Kl
1515
+ color: jl
1516
1516
  },
1517
1517
  { tag: [c.meta, c.comment], color: vt },
1518
1518
  { tag: c.strong, fontWeight: "bold" },
@@ -1521,23 +1521,23 @@ $$
1521
1521
  { tag: c.link, color: vt, textDecoration: "underline" },
1522
1522
  { tag: c.heading, fontWeight: "bold", color: bt },
1523
1523
  { tag: [c.atom, c.bool, c.special(c.variableName)], color: kt },
1524
- { tag: [c.processingInstruction, c.string, c.inserted], color: Xl },
1525
- { tag: c.invalid, color: jl }
1526
- ]), pt = [
1527
- to,
1528
- Ft(lo)
1529
- ], oo = "#e5c07b", yt = "#3f4a54", ao = "#56b6c2", no = "#fff", re = "#3f4a54", Tt = "#2d8cf0", io = "#2d8cf0", ro = "#3f4a54", wt = "#d19a66", so = "#c678dd", co = "#21252b", uo = "#ceedfa33", xt = "var(--md-bk-color)", be = "var(--md-bk-color)", mo = "#bad5fa", St = "#3f4a54", go = pe.theme(
1524
+ { tag: [c.processingInstruction, c.string, c.inserted], color: Yl },
1525
+ { tag: c.invalid, color: Zl }
1526
+ ]), $t = [
1527
+ lo,
1528
+ Ft(oo)
1529
+ ], ao = "#e5c07b", yt = "#3f4a54", no = "#56b6c2", io = "#fff", se = "#3f4a54", Tt = "#2d8cf0", ro = "#2d8cf0", so = "#3f4a54", wt = "#d19a66", co = "#c678dd", uo = "#21252b", mo = "#ceedfa33", xt = "var(--md-bk-color)", be = "var(--md-bk-color)", go = "#bad5fa", St = "#3f4a54", fo = $e.theme(
1530
1530
  {
1531
1531
  "&": {
1532
- color: re,
1532
+ color: se,
1533
1533
  backgroundColor: xt
1534
1534
  },
1535
1535
  ".cm-content": {
1536
1536
  caretColor: St
1537
1537
  },
1538
1538
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: St },
1539
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: mo },
1540
- ".cm-panels": { backgroundColor: co, color: re },
1539
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: go },
1540
+ ".cm-panels": { backgroundColor: uo, color: se },
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,12 +1554,12 @@ $$
1554
1554
  },
1555
1555
  ".cm-gutters": {
1556
1556
  backgroundColor: xt,
1557
- color: re,
1557
+ color: se,
1558
1558
  borderRight: "1px solid",
1559
1559
  borderColor: "var(--md-border-color)"
1560
1560
  },
1561
1561
  ".cm-activeLineGutter": {
1562
- backgroundColor: uo
1562
+ backgroundColor: mo
1563
1563
  },
1564
1564
  ".cm-foldPlaceholder": {
1565
1565
  backgroundColor: "transparent",
@@ -1580,17 +1580,17 @@ $$
1580
1580
  },
1581
1581
  ".cm-tooltip-autocomplete": {
1582
1582
  "& > ul > li[aria-selected]": {
1583
- color: re
1583
+ color: se
1584
1584
  }
1585
1585
  }
1586
1586
  }
1587
1587
  // { dark: true }
1588
- ), fo = Vt.define([
1589
- { tag: c.keyword, color: so },
1588
+ ), ho = Vt.define([
1589
+ { tag: c.keyword, color: co },
1590
1590
  { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: yt },
1591
- { tag: [c.function(c.variableName), c.labelName], color: io },
1591
+ { tag: [c.function(c.variableName), c.labelName], color: ro },
1592
1592
  { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: wt },
1593
- { tag: [c.definition(c.name), c.separator], color: re },
1593
+ { tag: [c.definition(c.name), c.separator], color: se },
1594
1594
  {
1595
1595
  tag: [
1596
1596
  c.typeName,
@@ -1602,7 +1602,7 @@ $$
1602
1602
  c.self,
1603
1603
  c.namespace
1604
1604
  ],
1605
- color: oo
1605
+ color: ao
1606
1606
  },
1607
1607
  {
1608
1608
  tag: [
@@ -1614,7 +1614,7 @@ $$
1614
1614
  c.link,
1615
1615
  c.special(c.string)
1616
1616
  ],
1617
- color: ao
1617
+ color: no
1618
1618
  },
1619
1619
  { tag: [c.meta, c.comment], color: Tt },
1620
1620
  { tag: c.strong, fontWeight: "bold" },
@@ -1623,13 +1623,13 @@ $$
1623
1623
  { tag: c.link, color: Tt, textDecoration: "underline" },
1624
1624
  { tag: c.heading, fontWeight: "bold", color: yt },
1625
1625
  { tag: [c.atom, c.bool, c.special(c.variableName)], color: wt },
1626
- { tag: [c.processingInstruction, c.string, c.inserted], color: ro },
1627
- { tag: c.invalid, color: no }
1628
- ]), At = [
1629
- go,
1630
- Ft(fo)
1631
- ], ue = (e, o, l, n, r) => (i, h, f, d) => {
1632
- const s = `${e}${o}`.slice(d - f);
1626
+ { tag: [c.processingInstruction, c.string, c.inserted], color: so },
1627
+ { tag: c.invalid, color: io }
1628
+ ]), Lt = [
1629
+ fo,
1630
+ Ft(ho)
1631
+ ], ue = (e, o, l, n, r) => (i, h, f, m) => {
1632
+ const s = `${e}${o}`.slice(m - f);
1633
1633
  i.dispatch(i.state.replaceSelection(`${s}${l}${n}`));
1634
1634
  const g = f + h.label.length + (r === "title" ? l.length : 0);
1635
1635
  i.dispatch({
@@ -1644,10 +1644,10 @@ $$
1644
1644
  1
1645
1645
  )
1646
1646
  }), i.focus();
1647
- }, Lt = (e) => (o, l, n, r) => {
1647
+ }, At = (e) => (o, l, n, r) => {
1648
1648
  const i = e.slice(r - n);
1649
1649
  o.dispatch(o.state.replaceSelection(`${i} `));
1650
- }, It = (e) => {
1650
+ }, Et = (e) => {
1651
1651
  const o = (l) => {
1652
1652
  const n = l.matchBefore(
1653
1653
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
@@ -1661,7 +1661,7 @@ $$
1661
1661
  return {
1662
1662
  label: h,
1663
1663
  type: "text",
1664
- apply: Lt(h)
1664
+ apply: At(h)
1665
1665
  };
1666
1666
  }),
1667
1667
  // 任务列表
@@ -1670,7 +1670,7 @@ $$
1670
1670
  return {
1671
1671
  label: i,
1672
1672
  type: "text",
1673
- apply: Lt(i)
1673
+ apply: At(i)
1674
1674
  };
1675
1675
  }),
1676
1676
  // 代码
@@ -1743,29 +1743,29 @@ $$`, "title")
1743
1743
  ]
1744
1744
  };
1745
1745
  };
1746
- return gl({
1746
+ return fl({
1747
1747
  override: e ? [o, ...e] : [o]
1748
1748
  });
1749
1749
  }, J = (e) => {
1750
- const o = new ne();
1750
+ const o = new Q();
1751
1751
  return (n) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(n) }) : e.dispatch({
1752
- effects: nl.appendConfig.of(o.of(n))
1752
+ effects: il.appendConfig.of(o.of(n))
1753
1753
  }), !0);
1754
1754
  };
1755
- class ho {
1755
+ class bo {
1756
1756
  constructor(o) {
1757
- z(this, "view");
1758
- z(this, "maxLength", Number.MAX_SAFE_INTEGER);
1757
+ _(this, "view");
1758
+ _(this, "maxLength", Number.MAX_SAFE_INTEGER);
1759
1759
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
1760
- z(this, "toggleTabSize");
1761
- z(this, "togglePlaceholder");
1760
+ _(this, "toggleTabSize");
1761
+ _(this, "togglePlaceholder");
1762
1762
  /**
1763
1763
  * 设置全部的扩展
1764
1764
  */
1765
- z(this, "setExtensions");
1766
- z(this, "toggleDisabled");
1767
- z(this, "toggleReadOnly");
1768
- z(this, "toggleMaxlength");
1765
+ _(this, "setExtensions");
1766
+ _(this, "toggleDisabled");
1767
+ _(this, "toggleReadOnly");
1768
+ _(this, "toggleMaxlength");
1769
1769
  this.view = o, this.toggleTabSize = J(this.view), this.togglePlaceholder = J(this.view), this.setExtensions = J(this.view), this.toggleDisabled = J(this.view), this.toggleReadOnly = J(this.view), this.toggleMaxlength = J(this.view);
1770
1770
  }
1771
1771
  getValue() {
@@ -1834,7 +1834,7 @@ class ho {
1834
1834
  this.view.focus();
1835
1835
  } catch (r) {
1836
1836
  if (r.message === "The input text is too long")
1837
- v.emit(n, ee, {
1837
+ v.emit(n, te, {
1838
1838
  name: "overlength",
1839
1839
  message: r.message,
1840
1840
  data: o
@@ -1851,7 +1851,7 @@ class ho {
1851
1851
  setTabSize(o) {
1852
1852
  this.toggleTabSize([
1853
1853
  fe.tabSize.of(o),
1854
- ml.of(" ".repeat(o))
1854
+ gl.of(" ".repeat(o))
1855
1855
  ]);
1856
1856
  }
1857
1857
  /**
@@ -1860,7 +1860,7 @@ class ho {
1860
1860
  * @param t 目标内容
1861
1861
  */
1862
1862
  setPlaceholder(o) {
1863
- this.togglePlaceholder(tl(o));
1863
+ this.togglePlaceholder(ll(o));
1864
1864
  }
1865
1865
  focus(o) {
1866
1866
  if (this.view.focus(), !o)
@@ -1885,7 +1885,7 @@ class ho {
1885
1885
  });
1886
1886
  }
1887
1887
  setDisabled(o) {
1888
- this.toggleDisabled([pe.editable.of(!o)]);
1888
+ this.toggleDisabled([$e.editable.of(!o)]);
1889
1889
  }
1890
1890
  setReadOnly(o) {
1891
1891
  this.toggleReadOnly([fe.readOnly.of(o)]);
@@ -1896,8 +1896,8 @@ class ho {
1896
1896
  ]);
1897
1897
  }
1898
1898
  }
1899
- const bo = (e) => {
1900
- const o = I("editorId");
1899
+ const vo = (e) => {
1900
+ const o = H("editorId");
1901
1901
  return (n) => {
1902
1902
  if (!n.clipboardData)
1903
1903
  return;
@@ -1905,107 +1905,107 @@ const bo = (e) => {
1905
1905
  const { files: i } = n.clipboardData;
1906
1906
  v.emit(
1907
1907
  o,
1908
- $e,
1908
+ pe,
1909
1909
  Array.from(i).filter((h) => /image\/.*/.test(h.type))
1910
1910
  ), n.preventDefault();
1911
1911
  return;
1912
1912
  }
1913
1913
  if (e.autoDetectCode && n.clipboardData.types.includes("vscode-editor-data")) {
1914
1914
  const i = JSON.parse(n.clipboardData.getData("vscode-editor-data"));
1915
- v.emit(o, L, "code", {
1915
+ v.emit(o, A, "code", {
1916
1916
  mode: i.mode,
1917
1917
  text: n.clipboardData.getData("text/plain")
1918
1918
  }), n.preventDefault();
1919
1919
  return;
1920
1920
  }
1921
1921
  const r = n.clipboardData.getData("text/plain");
1922
- e.maxlength && r.length + e.modelValue.length > e.maxlength && v.emit(o, ee, {
1922
+ e.maxlength && r.length + e.modelValue.length > e.maxlength && v.emit(o, te, {
1923
1923
  name: "overlength",
1924
1924
  message: "The input text is too long",
1925
1925
  data: r
1926
1926
  });
1927
1927
  };
1928
- }, vo = (e, o) => [
1928
+ }, ko = (e, o) => [
1929
1929
  {
1930
1930
  key: "Ctrl-b",
1931
1931
  mac: "Cmd-b",
1932
- run: () => (v.emit(e, L, "bold"), !0)
1932
+ run: () => (v.emit(e, A, "bold"), !0)
1933
1933
  },
1934
1934
  {
1935
1935
  key: "Ctrl-d",
1936
1936
  mac: "Cmd-d",
1937
- run: il,
1937
+ run: rl,
1938
1938
  preventDefault: !0
1939
1939
  },
1940
1940
  {
1941
1941
  key: "Ctrl-s",
1942
1942
  mac: "Cmd-s",
1943
1943
  run: (k) => (v.emit(e, Ht, k.state.doc.toString()), !0),
1944
- shift: () => (v.emit(e, L, "strikeThrough"), !0)
1944
+ shift: () => (v.emit(e, A, "strikeThrough"), !0)
1945
1945
  },
1946
1946
  {
1947
1947
  key: "Ctrl-u",
1948
1948
  mac: "Cmd-u",
1949
- run: () => (v.emit(e, L, "underline"), !0),
1950
- shift: () => (v.emit(e, L, "unorderedList"), !0)
1949
+ run: () => (v.emit(e, A, "underline"), !0),
1950
+ shift: () => (v.emit(e, A, "unorderedList"), !0)
1951
1951
  },
1952
1952
  {
1953
1953
  key: "Ctrl-i",
1954
1954
  mac: "Cmd-i",
1955
- run: () => (v.emit(e, L, "italic"), !0),
1955
+ run: () => (v.emit(e, A, "italic"), !0),
1956
1956
  shift: () => (v.emit(e, ke, "image"), !0)
1957
1957
  },
1958
1958
  {
1959
1959
  key: "Ctrl-1",
1960
1960
  mac: "Cmd-1",
1961
- run: () => (v.emit(e, L, "h1"), !0)
1961
+ run: () => (v.emit(e, A, "h1"), !0)
1962
1962
  },
1963
1963
  {
1964
1964
  key: "Ctrl-2",
1965
1965
  mac: "Cmd-2",
1966
- run: () => (v.emit(e, L, "h2"), !0)
1966
+ run: () => (v.emit(e, A, "h2"), !0)
1967
1967
  },
1968
1968
  {
1969
1969
  key: "Ctrl-3",
1970
1970
  mac: "Cmd-3",
1971
- run: () => (v.emit(e, L, "h3"), !0)
1971
+ run: () => (v.emit(e, A, "h3"), !0)
1972
1972
  },
1973
1973
  {
1974
1974
  key: "Ctrl-4",
1975
1975
  mac: "Cmd-4",
1976
- run: () => (v.emit(e, L, "h4"), !0)
1976
+ run: () => (v.emit(e, A, "h4"), !0)
1977
1977
  },
1978
1978
  {
1979
1979
  key: "Ctrl-5",
1980
1980
  mac: "Cmd-5",
1981
- run: () => (v.emit(e, L, "h5"), !0)
1981
+ run: () => (v.emit(e, A, "h5"), !0)
1982
1982
  },
1983
1983
  {
1984
1984
  key: "Ctrl-6",
1985
1985
  mac: "Cmd-6",
1986
- run: () => (v.emit(e, L, "h6"), !0)
1986
+ run: () => (v.emit(e, A, "h6"), !0)
1987
1987
  },
1988
1988
  {
1989
1989
  key: "Ctrl-ArrowUp",
1990
1990
  mac: "Cmd-ArrowUp",
1991
- run: () => (v.emit(e, L, "sup"), !0)
1991
+ run: () => (v.emit(e, A, "sup"), !0)
1992
1992
  },
1993
1993
  {
1994
1994
  key: "Ctrl-ArrowDown",
1995
1995
  mac: "Cmd-ArrowDown",
1996
- run: () => (v.emit(e, L, "sub"), !0)
1996
+ run: () => (v.emit(e, A, "sub"), !0)
1997
1997
  },
1998
1998
  {
1999
1999
  key: "Ctrl-o",
2000
2000
  mac: "Cmd-o",
2001
- run: () => (v.emit(e, L, "orderedList"), !0)
2001
+ run: () => (v.emit(e, A, "orderedList"), !0)
2002
2002
  },
2003
2003
  {
2004
2004
  key: "Ctrl-c",
2005
2005
  mac: "Cmd-c",
2006
- shift: () => (v.emit(e, L, "code"), !0),
2007
- any(k, A) {
2008
- return (A.ctrlKey || A.metaKey) && A.altKey && A.code === "KeyC" ? (v.emit(e, L, "codeRow"), !0) : !1;
2006
+ shift: () => (v.emit(e, A, "code"), !0),
2007
+ any(k, T) {
2008
+ return (T.ctrlKey || T.metaKey) && T.altKey && T.code === "KeyC" ? (v.emit(e, A, "codeRow"), !0) : !1;
2009
2009
  }
2010
2010
  },
2011
2011
  {
@@ -2016,169 +2016,194 @@ const bo = (e) => {
2016
2016
  {
2017
2017
  key: "Ctrl-f",
2018
2018
  mac: "Cmd-f",
2019
- shift: () => o.noPrettier ? !1 : (v.emit(e, L, "prettier"), !0)
2019
+ shift: () => o.noPrettier ? !1 : (v.emit(e, A, "prettier"), !0)
2020
2020
  },
2021
2021
  {
2022
- any: (k, A) => (A.ctrlKey || A.metaKey) && A.altKey && A.shiftKey && A.code === "KeyT" ? (v.emit(e, L, "table"), !0) : !1
2022
+ any: (k, T) => (T.ctrlKey || T.metaKey) && T.altKey && T.shiftKey && T.code === "KeyT" ? (v.emit(e, A, "table"), !0) : !1
2023
2023
  }
2024
- ], ko = (e) => {
2025
- const o = I("tabWidth"), l = I("editorId"), n = I("theme"), r = O(), i = Wt(), h = new ne(), f = new ne(), d = new ne(), s = new ne(), g = vo(l, e), w = bo(e), $ = [
2026
- ll.of([...rl, ...sl, ...g, cl]),
2024
+ ], Co = (e) => {
2025
+ const o = H("tabWidth"), l = H("editorId"), n = H("theme"), r = P(), i = Wt(), h = new Q(), f = new Q(), m = new Q(), s = new Q(), g = new Q(), $ = ko(l, e), p = P(!1), S = {
2026
+ paste: vo(e),
2027
+ blur: e.onBlur,
2028
+ focus: e.onFocus,
2029
+ drop: e.onDrop,
2030
+ compositionstart: () => {
2031
+ console.log("compositionstart"), p.value = !0;
2032
+ },
2033
+ compositionend: (d, b) => {
2034
+ console.log("compositionend"), p.value = !1, e.updateModelValue(b.state.doc.toString());
2035
+ },
2036
+ input: (d) => {
2037
+ e.onInput && e.onInput(d);
2038
+ const { data: b } = d;
2039
+ e.maxlength && e.modelValue.length + b.length > e.maxlength && v.emit(l, te, {
2040
+ name: "overlength",
2041
+ message: "The input text is too long",
2042
+ data: b
2043
+ });
2044
+ }
2045
+ }, L = [
2046
+ ol.of([...sl, ...cl, ...$, ul]),
2027
2047
  s.of(ft()),
2028
- h.of(al({ codeLanguages: ol })),
2048
+ h.of(nl({ codeLanguages: al })),
2029
2049
  // 横向换行
2030
- ce.lineWrapping,
2031
- ce.updateListener.of((m) => {
2032
- m.docChanged && e.onChange(m.state.doc.toString());
2050
+ ie.lineWrapping,
2051
+ ie.updateListener.of((d) => {
2052
+ d.docChanged && (e.onChange(d.state.doc.toString()), p.value || e.updateModelValue(d.state.doc.toString()));
2033
2053
  }),
2034
- ce.domEventHandlers({
2035
- paste: w,
2036
- blur: e.onBlur,
2037
- focus: e.onFocus,
2038
- drop: e.onDrop,
2039
- input: (m) => {
2040
- e.onInput && e.onInput(m);
2041
- const { data: C } = m;
2042
- e.maxlength && e.modelValue.length + C.length > e.maxlength && v.emit(l, ee, {
2043
- name: "overlength",
2044
- message: "The input text is too long",
2045
- data: C
2046
- });
2047
- }
2048
- })
2049
- ], S = () => {
2050
- const m = [
2051
- ...$,
2052
- f.of(n.value === "light" ? At : pt),
2053
- d.of(It(e.completions))
2054
+ g.of(ie.domEventHandlers(S))
2055
+ ], u = () => {
2056
+ const d = [
2057
+ ...L,
2058
+ f.of(n.value === "light" ? Lt : $t),
2059
+ m.of(Et(e.completions))
2054
2060
  ];
2055
- return X.codeMirrorExtensions(n.value, m, [
2056
- ...g
2061
+ return X.codeMirrorExtensions(n.value, d, [
2062
+ ...$
2057
2063
  ]);
2058
2064
  };
2059
2065
  return Y(() => {
2060
- const m = new ce({
2066
+ const d = new ie({
2061
2067
  doc: e.modelValue,
2062
2068
  parent: r.value,
2063
- extensions: [S()]
2064
- }), C = new ho(m);
2065
- i.value = C, setTimeout(() => {
2066
- C.setTabSize(o), C.setDisabled(e.disabled), C.setReadOnly(e.readonly), e.placeholder && C.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && C.setMaxLength(e.maxlength), e.autofocus && m.focus();
2069
+ extensions: [u()]
2070
+ }), b = new bo(d);
2071
+ i.value = b, setTimeout(() => {
2072
+ b.setTabSize(o), b.setDisabled(e.disabled), b.setReadOnly(e.readonly), e.placeholder && b.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && b.setMaxLength(e.maxlength), e.autofocus && d.focus();
2067
2073
  }, 0), v.on(l, {
2068
2074
  name: Nt,
2069
2075
  callback() {
2070
- ul(m);
2076
+ dl(d);
2071
2077
  }
2072
2078
  }), v.on(l, {
2073
2079
  name: Dt,
2074
2080
  callback() {
2075
- dl(m);
2081
+ ml(d);
2076
2082
  }
2077
2083
  }), v.on(l, {
2078
- name: L,
2079
- callback(u, b = {}) {
2080
- var k;
2081
- const { text: p, options: y } = ql(u, i.value, b);
2082
- (k = i.value) == null || k.replaceSelectedText(p, y, l);
2084
+ name: A,
2085
+ callback(C, k = {}) {
2086
+ var E;
2087
+ const { text: T, options: I } = Gl(C, i.value, k);
2088
+ (E = i.value) == null || E.replaceSelectedText(T, I, l);
2089
+ }
2090
+ }), v.on(l, {
2091
+ name: el,
2092
+ callback(C) {
2093
+ var I;
2094
+ const k = {
2095
+ ...S
2096
+ }, T = Object.keys(S);
2097
+ for (const E in C) {
2098
+ const M = E;
2099
+ T.includes(M) ? k[M] = (W, V) => {
2100
+ C[M](W, V), W.defaultPrevented || S[M](W, V);
2101
+ } : k[M] = C[M];
2102
+ }
2103
+ (I = i.value) == null || I.view.dispatch({
2104
+ effects: g.reconfigure(
2105
+ ie.domEventHandlers(k)
2106
+ )
2107
+ });
2083
2108
  }
2084
2109
  });
2085
- }), H(
2110
+ }), B(
2086
2111
  n,
2087
2112
  () => {
2088
- var m;
2089
- (m = i.value) == null || m.view.dispatch({
2090
- effects: f.reconfigure(n.value === "light" ? At : pt)
2113
+ var d;
2114
+ (d = i.value) == null || d.view.dispatch({
2115
+ effects: f.reconfigure(n.value === "light" ? Lt : $t)
2091
2116
  });
2092
2117
  },
2093
2118
  {
2094
2119
  deep: !0
2095
2120
  }
2096
- ), H(
2121
+ ), B(
2097
2122
  () => e.completions,
2098
2123
  () => {
2099
- var m;
2100
- (m = i.value) == null || m.view.dispatch({
2101
- effects: d.reconfigure(It(e.completions))
2124
+ var d;
2125
+ (d = i.value) == null || d.view.dispatch({
2126
+ effects: m.reconfigure(Et(e.completions))
2102
2127
  });
2103
2128
  },
2104
2129
  {
2105
2130
  deep: !0
2106
2131
  }
2107
- ), H(
2132
+ ), B(
2108
2133
  () => e.modelValue,
2109
2134
  () => {
2110
- var m, C;
2111
- ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((C = i.value) == null || C.setValue(e.modelValue));
2135
+ var d, b;
2136
+ ((d = i.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((b = i.value) == null || b.setValue(e.modelValue));
2112
2137
  }
2113
- ), H(
2138
+ ), B(
2114
2139
  () => e.placeholder,
2115
2140
  () => {
2116
- var m;
2117
- (m = i.value) == null || m.setPlaceholder(e.placeholder);
2141
+ var d;
2142
+ (d = i.value) == null || d.setPlaceholder(e.placeholder);
2118
2143
  }
2119
- ), H(
2144
+ ), B(
2120
2145
  () => e.disabled,
2121
2146
  () => {
2122
- var m;
2123
- (m = i.value) == null || m.setDisabled(e.disabled);
2147
+ var d;
2148
+ (d = i.value) == null || d.setDisabled(e.disabled);
2124
2149
  }
2125
- ), H(
2150
+ ), B(
2126
2151
  () => e.readonly,
2127
2152
  () => {
2128
- var m;
2129
- (m = i.value) == null || m.setDisabled(e.readonly);
2153
+ var d;
2154
+ (d = i.value) == null || d.setDisabled(e.readonly);
2130
2155
  }
2131
- ), H(
2156
+ ), B(
2132
2157
  () => e.maxlength,
2133
2158
  () => {
2134
- var m;
2135
- e.maxlength && ((m = i.value) == null || m.setMaxLength(e.maxlength));
2159
+ var d;
2160
+ e.maxlength && ((d = i.value) == null || d.setMaxLength(e.maxlength));
2136
2161
  }
2137
2162
  ), {
2138
2163
  inputWrapperRef: r,
2139
2164
  codeMirrorUt: i,
2140
2165
  resetHistory() {
2141
- var m, C;
2142
- (m = i.value) == null || m.view.dispatch({
2166
+ var d, b;
2167
+ (d = i.value) == null || d.view.dispatch({
2143
2168
  effects: s.reconfigure([])
2144
- }), (C = i.value) == null || C.view.dispatch({
2169
+ }), (b = i.value) == null || b.view.dispatch({
2145
2170
  effects: s.reconfigure(ft())
2146
2171
  });
2147
2172
  }
2148
2173
  };
2149
- }, Co = (e, o, l) => {
2150
- const n = _({
2174
+ }, po = (e, o, l) => {
2175
+ const n = q({
2151
2176
  resizedWidth: e.inputBoxWitdh
2152
- }), r = _({
2177
+ }), r = q({
2153
2178
  width: e.inputBoxWitdh
2154
- }), i = _({
2179
+ }), i = q({
2155
2180
  left: e.inputBoxWitdh,
2156
2181
  display: "initial"
2157
2182
  }), h = (s) => {
2158
- var m, C, u;
2159
- const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, w = ((C = o.value) == null ? void 0 : C.getBoundingClientRect().x) || 0;
2160
- let $ = s.x - w;
2161
- $ < se ? $ = se : $ > g - se && ($ = g - se);
2162
- const S = `${$}px`;
2163
- r.width = S, i.left = S, n.resizedWidth = S, (u = e.onInputBoxWitdhChange) == null || u.call(e, S);
2183
+ var S, L, u;
2184
+ const g = ((S = o.value) == null ? void 0 : S.offsetWidth) || 0, $ = ((L = o.value) == null ? void 0 : L.getBoundingClientRect().x) || 0;
2185
+ let p = s.x - $;
2186
+ p < ce ? p = ce : p > g - ce && (p = g - ce);
2187
+ const x = `${p}px`;
2188
+ r.width = x, i.left = x, n.resizedWidth = x, (u = e.onInputBoxWitdhChange) == null || u.call(e, x);
2164
2189
  }, f = () => {
2165
2190
  document.addEventListener("mousemove", h);
2166
- }, d = () => {
2191
+ }, m = () => {
2167
2192
  document.removeEventListener("mousemove", h);
2168
2193
  };
2169
2194
  return Y(() => {
2170
2195
  var s;
2171
- (s = l.value) == null || s.addEventListener("mousedown", f), document.addEventListener("mouseup", d);
2172
- }), Et(() => {
2196
+ (s = l.value) == null || s.addEventListener("mousedown", f), document.addEventListener("mouseup", m);
2197
+ }), Mt(() => {
2173
2198
  var s, g;
2174
- (s = l.value) == null || s.removeEventListener("mousedown", f), (g = l.value) == null || g.removeEventListener("mouseup", d);
2175
- }), H(
2199
+ (s = l.value) == null || s.removeEventListener("mousedown", f), (g = l.value) == null || g.removeEventListener("mouseup", m);
2200
+ }), B(
2176
2201
  () => e.inputBoxWitdh,
2177
2202
  (s) => {
2178
2203
  s && (r.width = s, i.left = s);
2179
2204
  }
2180
- ), H(
2181
- [Q(e.setting, "htmlPreview"), Q(e.setting, "preview")],
2205
+ ), B(
2206
+ [ee(e.setting, "htmlPreview"), ee(e.setting, "preview")],
2182
2207
  () => {
2183
2208
  !e.setting.htmlPreview && !e.setting.preview ? (r.width = "100%", i.display = "none") : (r.width = n.resizedWidth, i.display = "initial");
2184
2209
  },
@@ -2186,28 +2211,28 @@ const bo = (e) => {
2186
2211
  immediate: !0
2187
2212
  }
2188
2213
  ), { inputWrapperStyle: r, resizeOperateStyle: i };
2189
- }, $o = /* @__PURE__ */ P({
2214
+ }, $o = /* @__PURE__ */ z({
2190
2215
  name: "MDEditorContent",
2191
- props: fl,
2216
+ props: hl,
2192
2217
  setup(e, o) {
2193
- const l = I("editorId"), n = O(""), r = O(), i = O(), {
2218
+ const l = H("editorId"), n = P(""), r = P(), i = P(), {
2194
2219
  inputWrapperRef: h,
2195
2220
  codeMirrorUt: f,
2196
- resetHistory: d
2197
- } = ko(e), {
2221
+ resetHistory: m
2222
+ } = Co(e), {
2198
2223
  inputWrapperStyle: s,
2199
2224
  resizeOperateStyle: g
2200
- } = Co(e, r, i);
2201
- return _l(e, n, f), o.expose({
2225
+ } = po(e, r, i);
2226
+ return ql(e, n, f), o.expose({
2202
2227
  getSelectedText() {
2203
- var w;
2204
- return (w = f.value) == null ? void 0 : w.getSelectedText();
2205
- },
2206
- focus(w) {
2207
2228
  var $;
2208
- ($ = f.value) == null || $.focus(w);
2229
+ return ($ = f.value) == null ? void 0 : $.getSelectedText();
2209
2230
  },
2210
- resetHistory: d
2231
+ focus($) {
2232
+ var p;
2233
+ (p = f.value) == null || p.focus($);
2234
+ },
2235
+ resetHistory: m
2211
2236
  }), () => t("div", {
2212
2237
  class: `${a}-content${e.setting.htmlPreview || e.setting.preview ? " has-preview" : ""}`,
2213
2238
  ref: r
@@ -2219,11 +2244,11 @@ const bo = (e) => {
2219
2244
  class: `${a}-resize-operate`,
2220
2245
  style: g,
2221
2246
  ref: i
2222
- }, null), t(hl, {
2247
+ }, null), t(bl, {
2223
2248
  modelValue: e.modelValue,
2224
2249
  setting: e.setting,
2225
- onHtmlChanged: (w) => {
2226
- n.value = w, e.onHtmlChanged(w);
2250
+ onHtmlChanged: ($) => {
2251
+ n.value = $, e.onHtmlChanged($);
2227
2252
  },
2228
2253
  onGetCatalog: e.onGetCatalog,
2229
2254
  mdHeadingId: e.mdHeadingId,
@@ -2242,7 +2267,7 @@ const bo = (e) => {
2242
2267
  key: "internal-catalog"
2243
2268
  }, null)]);
2244
2269
  }
2245
- }), po = /* @__PURE__ */ P({
2270
+ }), yo = /* @__PURE__ */ z({
2246
2271
  props: {
2247
2272
  modelValue: {
2248
2273
  type: String,
@@ -2250,7 +2275,7 @@ const bo = (e) => {
2250
2275
  }
2251
2276
  },
2252
2277
  setup(e) {
2253
- const o = I("usedLanguageText");
2278
+ const o = H("usedLanguageText");
2254
2279
  return () => {
2255
2280
  var l, n;
2256
2281
  return t("div", {
@@ -2260,7 +2285,7 @@ const bo = (e) => {
2260
2285
  }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((n = e.modelValue) == null ? void 0 : n.length) || 0])]);
2261
2286
  };
2262
2287
  }
2263
- }), yo = {
2288
+ }), To = {
2264
2289
  checked: {
2265
2290
  type: Boolean,
2266
2291
  default: !1
@@ -2270,8 +2295,8 @@ const bo = (e) => {
2270
2295
  default: () => {
2271
2296
  }
2272
2297
  }
2273
- }, To = /* @__PURE__ */ P({
2274
- props: yo,
2298
+ }, wo = /* @__PURE__ */ z({
2299
+ props: To,
2275
2300
  setup(e) {
2276
2301
  return () => t("div", {
2277
2302
  class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`],
@@ -2280,7 +2305,7 @@ const bo = (e) => {
2280
2305
  }
2281
2306
  }, null);
2282
2307
  }
2283
- }), wo = {
2308
+ }), xo = {
2284
2309
  scrollAuto: {
2285
2310
  type: Boolean
2286
2311
  },
@@ -2289,10 +2314,10 @@ const bo = (e) => {
2289
2314
  default: () => {
2290
2315
  }
2291
2316
  }
2292
- }, xo = /* @__PURE__ */ P({
2293
- props: wo,
2317
+ }, So = /* @__PURE__ */ z({
2318
+ props: xo,
2294
2319
  setup(e) {
2295
- const o = I("usedLanguageText");
2320
+ const o = H("usedLanguageText");
2296
2321
  return () => {
2297
2322
  var l;
2298
2323
  return t("div", {
@@ -2302,13 +2327,13 @@ const bo = (e) => {
2302
2327
  onClick: () => {
2303
2328
  e.onScrollAutoChange(!e.scrollAuto);
2304
2329
  }
2305
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(To, {
2330
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(wo, {
2306
2331
  checked: e.scrollAuto,
2307
2332
  onChange: e.onScrollAutoChange
2308
2333
  }, null)]);
2309
2334
  };
2310
2335
  }
2311
- }), So = {
2336
+ }), Lo = {
2312
2337
  modelValue: {
2313
2338
  type: String,
2314
2339
  default: ""
@@ -2328,22 +2353,22 @@ const bo = (e) => {
2328
2353
  defFooters: {
2329
2354
  type: Object
2330
2355
  }
2331
- }, Ao = /* @__PURE__ */ P({
2356
+ }, Ao = /* @__PURE__ */ z({
2332
2357
  name: "MDEditorFooter",
2333
- props: So,
2358
+ props: Lo,
2334
2359
  setup(e) {
2335
2360
  const o = Ce(() => {
2336
2361
  const n = e.footers.indexOf("="), r = n === -1 ? e.footers : e.footers.slice(0, n), i = n === -1 ? [] : e.footers.slice(n, Number.MAX_SAFE_INTEGER);
2337
2362
  return [r, i];
2338
2363
  }), l = (n) => {
2339
- if (_t.includes(n))
2364
+ if (Ut.includes(n))
2340
2365
  switch (n) {
2341
2366
  case "markdownTotal":
2342
- return t(po, {
2367
+ return t(yo, {
2343
2368
  modelValue: e.modelValue
2344
2369
  }, null);
2345
2370
  case "scrollSwitch":
2346
- return t(xo, {
2371
+ return t(So, {
2347
2372
  scrollAuto: e.scrollAuto,
2348
2373
  onScrollAutoChange: e.onScrollAutoChange
2349
2374
  }, null);
@@ -2362,10 +2387,10 @@ const bo = (e) => {
2362
2387
  }, [r])]);
2363
2388
  };
2364
2389
  }
2365
- }), ve = /* @__PURE__ */ P({
2390
+ }), ve = /* @__PURE__ */ z({
2366
2391
  name: "MdEditorV3",
2367
- props: bl,
2368
- emits: vl,
2392
+ props: vl,
2393
+ emits: kl,
2369
2394
  setup(e, o) {
2370
2395
  const {
2371
2396
  editorId: l,
@@ -2374,19 +2399,19 @@ const bo = (e) => {
2374
2399
  noPrettier: i,
2375
2400
  noUploadImg: h,
2376
2401
  noHighlight: f
2377
- } = e, d = _({
2402
+ } = e, m = q({
2378
2403
  scrollAuto: e.scrollAuto
2379
- }), s = O();
2380
- kl(e, o), Cl(e), $l(e), pl(e, o);
2381
- const [g, w] = yl(e, o), $ = Tl(e);
2382
- return Et(() => {
2404
+ }), s = P();
2405
+ Cl(e, o), pl(e), $l(e), yl(e, o);
2406
+ const [g, $] = Tl(e, o), p = wl(e);
2407
+ return Mt(() => {
2383
2408
  v.clear(l);
2384
- }), wl(e, o, $, g, w, s), () => {
2385
- var C;
2386
- const S = ht({
2409
+ }), xl(e, o, p, g, $, s), () => {
2410
+ var L;
2411
+ const x = ht({
2387
2412
  props: e,
2388
2413
  ctx: o
2389
- }, "defToolbars"), m = ht({
2414
+ }, "defToolbars"), S = ht({
2390
2415
  props: e,
2391
2416
  ctx: o
2392
2417
  }, "defFooters");
@@ -2394,14 +2419,14 @@ const bo = (e) => {
2394
2419
  id: l,
2395
2420
  class: [a, e.class, e.theme === "dark" && `${a}-dark`, g.fullscreen || g.pageFullscreen ? `${a}-fullscreen` : ""],
2396
2421
  style: e.style
2397
- }, [t(Pl, {
2422
+ }, [t(Wl, {
2398
2423
  noPrettier: i,
2399
2424
  toolbars: e.toolbars,
2400
2425
  toolbarsExclude: e.toolbarsExclude,
2401
2426
  setting: g,
2402
- updateSetting: w,
2427
+ updateSetting: $,
2403
2428
  tableShape: e.tableShape,
2404
- defToolbars: S,
2429
+ defToolbars: x,
2405
2430
  noUploadImg: h,
2406
2431
  showToolbarName: e.showToolbarName
2407
2432
  }, null), t($o, {
@@ -2414,7 +2439,7 @@ const bo = (e) => {
2414
2439
  sanitize: e.sanitize,
2415
2440
  placeholder: e.placeholder,
2416
2441
  noKatex: n,
2417
- scrollAuto: d.scrollAuto,
2442
+ scrollAuto: m.scrollAuto,
2418
2443
  formatCopiedText: e.formatCopiedText,
2419
2444
  autofocus: e.autoFocus,
2420
2445
  disabled: e.disabled,
@@ -2422,8 +2447,11 @@ const bo = (e) => {
2422
2447
  maxlength: e.maxLength,
2423
2448
  autoDetectCode: e.autoDetectCode,
2424
2449
  noHighlight: f,
2450
+ updateModelValue: (u) => {
2451
+ o.emit("update:modelValue", u);
2452
+ },
2425
2453
  onChange: (u) => {
2426
- e.onChange && e.onChange(u), o.emit("update:modelValue", u), o.emit("onChange", u);
2454
+ e.onChange && e.onChange(u), o.emit("onChange", u);
2427
2455
  },
2428
2456
  onHtmlChanged: (u) => {
2429
2457
  e.onHtmlChanged && e.onHtmlChanged(u), o.emit("onHtmlChanged", u);
@@ -2441,7 +2469,7 @@ const bo = (e) => {
2441
2469
  e.onInput && e.onInput(u), o.emit("onInput", u);
2442
2470
  },
2443
2471
  completions: e.completions,
2444
- catalogVisible: $.value,
2472
+ catalogVisible: p.value,
2445
2473
  theme: e.theme,
2446
2474
  noImgZoomIn: e.noImgZoomIn,
2447
2475
  onDrop: (u) => {
@@ -2452,17 +2480,17 @@ const bo = (e) => {
2452
2480
  e.onInputBoxWitdhChange && e.onInputBoxWitdhChange(u), o.emit("onInputBoxWitdhChange", u);
2453
2481
  },
2454
2482
  sanitizeMermaid: e.sanitizeMermaid
2455
- }, null), ((C = e.footers) == null ? void 0 : C.length) > 0 && t(Ao, {
2483
+ }, null), ((L = e.footers) == null ? void 0 : L.length) > 0 && t(Ao, {
2456
2484
  modelValue: e.modelValue,
2457
2485
  footers: e.footers,
2458
- defFooters: m,
2459
- scrollAuto: d.scrollAuto,
2460
- onScrollAutoChange: (u) => d.scrollAuto = u
2486
+ defFooters: S,
2487
+ scrollAuto: m.scrollAuto,
2488
+ onScrollAutoChange: (u) => m.scrollAuto = u
2461
2489
  }, null)]);
2462
2490
  };
2463
2491
  }
2464
2492
  });
2465
- ve.install = (e) => (e.component(ve.name, ve), e.use(Sl).use(Xt).use(Al).use(Rt).use(xl), e);
2493
+ ve.install = (e) => (e.component(ve.name, ve), e.use(Ll).use(Xt).use(Al).use(Rt).use(Sl), e);
2466
2494
  export {
2467
2495
  ve as default
2468
2496
  };