md-editor-v3 4.4.0 → 4.5.0-beta.1

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