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

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