md-editor-v3 4.0.4 → 4.1.0-beta.0

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