md-editor-v3 4.5.0 → 4.6.0-beta.0

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