md-editor-v3 7.1.0 → 7.1.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.
@@ -2,7 +2,7 @@ import { useId as ze, provide as I, computed as H, reactive as fe, watch as S, o
2
2
  import { b as w, g as ve, R as We, U as qe, C as Oe, B as ie, O as _e, E as ce, h as Ce, F as we, i as $e, j as Ee, H as xe, k as Se, e as Ke, d as Ze, f as ue, P as Je, T as Xe } from "./event-bus.mjs";
3
3
  import { deepMerge as Qe, deepClone as Ye, randomId as he, debounce as et } from "@vavt/util";
4
4
  import { p as f, g as j, f as Te, s as Ie, m as ke, h as le, r as ae, a as tt, b as nt } from "./config.mjs";
5
- import { a as z, u as ot, S as at, c as rt, z as st } from "./dom.mjs";
5
+ import { a as G, u as ot, S as at, c as rt, z as st } from "./dom.mjs";
6
6
  import it from "@vavt/copy2clipboard";
7
7
  import lt from "markdown-it";
8
8
  import ct from "markdown-it-image-figures";
@@ -156,12 +156,12 @@ const pt = (e, t, a) => {
156
156
  _(() => {
157
157
  if (!u) {
158
158
  const { js: d = {}, css: r = {} } = n.cropper || {};
159
- z("link", {
159
+ G("link", {
160
160
  ...r,
161
161
  rel: "stylesheet",
162
162
  href: o.cropper.css,
163
163
  id: B.croppercss
164
- }), z("script", {
164
+ }), G("script", {
165
165
  ...d,
166
166
  src: o.cropper.js,
167
167
  id: B.cropperjs
@@ -169,7 +169,7 @@ const pt = (e, t, a) => {
169
169
  }
170
170
  if (!s) {
171
171
  const { standaloneJs: d = {} } = n.prettier || {};
172
- z("script", {
172
+ G("script", {
173
173
  ...d,
174
174
  src: o.prettier.standaloneJs,
175
175
  id: B.prettier
@@ -177,7 +177,7 @@ const pt = (e, t, a) => {
177
177
  }
178
178
  if (!c) {
179
179
  const { parserMarkdownJs: d = {} } = n.prettier || {};
180
- z("script", {
180
+ G("script", {
181
181
  ...d,
182
182
  src: o.prettier.parserMarkdownJs,
183
183
  id: B.prettierMD
@@ -434,7 +434,7 @@ const pt = (e, t, a) => {
434
434
  if (e.noEcharts || u)
435
435
  return;
436
436
  const p = n.echarts.js;
437
- z(
437
+ G(
438
438
  "script",
439
439
  {
440
440
  ...s.echarts?.js,
@@ -459,12 +459,12 @@ const pt = (e, t, a) => {
459
459
  }
460
460
  const v = [], $ = [], y = [];
461
461
  i.forEach((b, C) => {
462
- const x = l[C], F = m[C];
462
+ const x = l[C], R = m[C];
463
463
  if (p || !b || !b.isConnected || (o?.value ? !o.value.contains(b) : !1)) {
464
- x?.dispose?.(), F?.disconnect?.();
464
+ x?.dispose?.(), R?.disconnect?.();
465
465
  return;
466
466
  }
467
- v.push(b), x && $.push(x), F && y.push(F);
467
+ v.push(b), x && $.push(x), R && y.push(R);
468
468
  }), i = v, l = $, m = y;
469
469
  }, g = () => {
470
470
  if (h(), !e.noEcharts && u) {
@@ -481,8 +481,8 @@ const pt = (e, t, a) => {
481
481
  const x = {
482
482
  editorId: t,
483
483
  element: $
484
- }, F = n.echarts.parseOption(y, x), T = n.echarts.sanitizeOption(
485
- c(F),
484
+ }, R = n.echarts.parseOption(y, x), T = n.echarts.sanitizeOption(
485
+ c(R),
486
486
  x
487
487
  );
488
488
  b = u.init($, a.value), b.setOption(T), C = new ResizeObserver(() => {
@@ -504,11 +504,11 @@ const pt = (e, t, a) => {
504
504
  }, bt = (e) => {
505
505
  const t = E("highlight"), a = de(j.editorExtensions.highlight.instance);
506
506
  return _(() => {
507
- e.noHighlight || a.value || (z("link", {
507
+ e.noHighlight || a.value || (G("link", {
508
508
  ...t.value.css,
509
509
  rel: "stylesheet",
510
510
  id: B.hlcss
511
- }), z(
511
+ }), G(
512
512
  "script",
513
513
  {
514
514
  ...t.value.js,
@@ -535,7 +535,7 @@ const pt = (e, t, a) => {
535
535
  if (e.noKatex || t.value)
536
536
  return;
537
537
  const { editorExtensions: a, editorExtensionsAttrs: o } = j;
538
- z(
538
+ G(
539
539
  "script",
540
540
  {
541
541
  ...o.katex?.js,
@@ -546,7 +546,7 @@ const pt = (e, t, a) => {
546
546
  }
547
547
  },
548
548
  "katex"
549
- ), z("link", {
549
+ ), G("link", {
550
550
  ...o.katex?.css,
551
551
  rel: "stylesheet",
552
552
  href: a.katex.css,
@@ -624,7 +624,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
624
624
  const $ = n.mermaid.js, y = (b) => {
625
625
  h || (u = b, p());
626
626
  };
627
- /\.mjs/.test($) ? (z("link", {
627
+ /\.mjs/.test($) ? (G("link", {
628
628
  ...s.mermaid?.js,
629
629
  rel: "modulepreload",
630
630
  href: $,
@@ -639,7 +639,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
639
639
  message: `Failed to load mermaid module: ${b.message}`,
640
640
  error: b
641
641
  });
642
- })) : z(
642
+ })) : G(
643
643
  "script",
644
644
  {
645
645
  ...s.mermaid?.js,
@@ -663,7 +663,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
663
663
  const x = l.get(C);
664
664
  if (x?.generation === m) return x.promise;
665
665
  const T = (async () => {
666
- const R = m, J = d.value, D = C.dataset.content ?? C.textContent ?? "", N = C.dataset.mermaidBlock, U = JSON.stringify([J, N, D]), W = e.sanitizeMermaid, X = a.value, V = () => !h && m === R && C.isConnected && $.contains(C);
666
+ const M = m, J = d.value, D = C.dataset.content ?? C.textContent ?? "", N = C.dataset.mermaidBlock, U = JSON.stringify([J, N, D]), W = e.sanitizeMermaid, X = a.value, V = () => !h && m === M && C.isConnected && $.contains(C);
667
667
  if (V())
668
668
  try {
669
669
  let L = r.get(U);
@@ -714,12 +714,12 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
714
714
  securityLevel: k?.securityLevel ?? "strict",
715
715
  secure: k?.secure ?? K.secure
716
716
  });
717
- const A = document.createElement("div");
718
- A.style.cssText = "position:fixed;z-index:-10000;top:-10000px;left:-10000px;", A.style.width = Math.max(document.body.offsetWidth, 1366) + "px", A.style.height = Math.max(document.body.offsetHeight, 768) + "px", document.body.appendChild(A);
717
+ const F = document.createElement("div");
718
+ F.style.cssText = "position:fixed;z-index:-10000;top:-10000px;left:-10000px;", F.style.width = Math.max(document.body.offsetWidth, 1366) + "px", F.style.height = Math.max(document.body.offsetHeight, 768) + "px", document.body.appendChild(F);
719
719
  try {
720
- return await y.render(he(), D, A);
720
+ return await y.render(he(), D, F);
721
721
  } finally {
722
- A.remove();
722
+ F.remove();
723
723
  }
724
724
  });
725
725
  if (!O || !V()) return;
@@ -734,14 +734,14 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
734
734
  for (const O of Array.from(C.attributes))
735
735
  P.setAttribute(O.name, O.value);
736
736
  P.setAttribute("data-processed", ""), P.setAttribute("data-content", D), P.innerHTML = L.svg, P.children[0]?.removeAttribute("height");
737
- const M = { ...L, svg: P.innerHTML };
737
+ const A = { ...L, svg: P.innerHTML };
738
738
  C.replaceWith(P);
739
739
  try {
740
740
  L.bindFunctions?.(P), i.add(P);
741
741
  } catch (O) {
742
742
  throw P.replaceWith(C), O;
743
743
  }
744
- r.set(U, M);
744
+ r.set(U, A);
745
745
  } catch (L) {
746
746
  if (!V()) return;
747
747
  C.dataset.processed !== void 0 && (C.textContent = D, C.removeAttribute("data-processed")), w.emit(t, ce, {
@@ -787,8 +787,8 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
787
787
  if (C !== a)
788
788
  return !1;
789
789
  g -= (g - y) % s;
790
- const x = i.src.slice(y, g), F = i.src.slice(g, b);
791
- if (r(F), h)
790
+ const x = i.src.slice(y, g), R = i.src.slice(g, b);
791
+ if (r(R), h)
792
792
  return !0;
793
793
  for (p = l; p++, !(p >= m || (y = i.bMarks[p] + i.tShift[p], b = i.eMarks[p], y < b && i.sCount[p] < i.blkIndent)); )
794
794
  if (n === i.src.charCodeAt(y) && !(i.sCount[p] - i.blkIndent >= 4)) {
@@ -799,8 +799,8 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
799
799
  break;
800
800
  }
801
801
  }
802
- const T = i.parentType, R = i.lineMax;
803
- return i.parentType = "root", i.lineMax = p, v = i.push("admonition_open", "div", 1), v.markup = x, v.block = !0, v.info = c, v.map = [l, p], u && (v = i.push("admonition_title_open", "p", 1), v.markup = x + " " + c, v.map = [l, p], v = i.push("inline", "", 0), v.content = u, v.map = [l, i.line - 1], v.children = [], v = i.push("admonition_title_close", "p", -1), v.markup = x + " " + c), i.md.block.tokenize(i, l + 1, p), v = i.push("admonition_close", "div", -1), v.markup = i.src.slice(y, g), v.block = !0, i.parentType = T, i.lineMax = R, i.line = p + ($ ? 1 : 0), !0;
802
+ const T = i.parentType, M = i.lineMax;
803
+ return i.parentType = "root", i.lineMax = p, v = i.push("admonition_open", "div", 1), v.markup = x, v.block = !0, v.info = c, v.map = [l, p], u && (v = i.push("admonition_title_open", "p", 1), v.markup = x + " " + c, v.map = [l, p], v = i.push("inline", "", 0), v.content = u, v.map = [l, i.line - 1], v.children = [], v = i.push("admonition_title_close", "p", -1), v.markup = x + " " + c), i.md.block.tokenize(i, l + 1, p), v = i.push("admonition_close", "div", -1), v.markup = i.src.slice(y, g), v.block = !0, i.parentType = T, i.lineMax = M, i.line = p + ($ ? 1 : 0), !0;
804
804
  },
805
805
  {
806
806
  alt: ["paragraph", "reference", "blockquote", "list"]
@@ -819,9 +819,9 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
819
819
  }, l = (m, h, g, p, v) => {
820
820
  if (m[h].hidden)
821
821
  return "";
822
- const $ = t.usedLanguageTextRef.value?.copyCode.text || "", y = t.customIconRef.value.copy, b = e.utils.escapeHtml($), C = y || b, x = !!y, F = `<span class="${f}-collapse-tips">${at("collapse-tips", t.customIconRef.value)}</span>`, [T] = d(m[h]);
822
+ const $ = t.usedLanguageTextRef.value?.copyCode.text || "", y = t.customIconRef.value.copy, b = e.utils.escapeHtml($), C = y || b, x = !!y, R = `<span class="${f}-collapse-tips">${at("collapse-tips", t.customIconRef.value)}</span>`, [T] = d(m[h]);
823
823
  if (T === null) {
824
- const { open: k, tagContainer: A, tagHeader: G } = i(m[h]), te = [["class", `${f}-code`]];
824
+ const { open: k, tagContainer: F, tagHeader: z } = i(m[h]), te = [["class", `${f}-code`]];
825
825
  k && te.push(["open", ""]);
826
826
  const se = {
827
827
  attrs: ke(m[h], te)
@@ -831,50 +831,50 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
831
831
  u(m[h])
832
832
  ), ye = [oe, ne].filter(Boolean).join(" "), Ve = a(m, h, g, p, v);
833
833
  return `
834
- <${A} ${v.renderAttrs(se)}>
835
- <${G} class="${f}-code-head">
834
+ <${F} ${v.renderAttrs(se)}>
835
+ <${z} class="${f}-code-head">
836
836
  <div class="${f}-code-flag"><span></span><span></span><span></span></div>
837
837
  <div class="${f}-code-action">
838
838
  <span class="${f}-code-lang">${e.utils.escapeHtml(ye)}</span>
839
839
  <span class="${f}-copy-button" data-tips="${b}"${x ? " data-is-icon=true" : ""}>${C}</span>
840
840
  ${t.extraTools instanceof Function ? t.extraTools({ lang: ye }) : t.extraTools || ""}
841
- ${A === "details" ? F : ""}
841
+ ${F === "details" ? R : ""}
842
842
  </div>
843
- </${G}>
843
+ </${z}>
844
844
  ${Ve}
845
- </${A}>
845
+ </${F}>
846
846
  `;
847
847
  }
848
- let R, J, D, N, U = "", W = "", X = "";
849
- const { open: V, tagContainer: L, tagHeader: P } = i(m[h]), M = [["class", `${f}-code`]];
850
- V && M.push(["open", ""]);
848
+ let M, J, D, N, U = "", W = "", X = "";
849
+ const { open: V, tagContainer: L, tagHeader: P } = i(m[h]), A = [["class", `${f}-code`]];
850
+ V && A.push(["open", ""]);
851
851
  const O = {
852
- attrs: ke(m[h], M)
852
+ attrs: ke(m[h], A)
853
853
  };
854
- for (let k = h; k < m.length && (R = m[k], [J, D] = d(R), J === T); k++) {
855
- R.info = R.info.replace(n, "").replace(s, ""), R.hidden = !0;
856
- const A = `${f}-codetab-${c}-${h}-${k - h}`;
854
+ for (let k = h; k < m.length && (M = m[k], [J, D] = d(M), J === T); k++) {
855
+ M.info = M.info.replace(n, "").replace(s, ""), M.hidden = !0;
856
+ const F = `${f}-codetab-${c}-${h}-${k - h}`;
857
857
  N = k - h > 0 ? "" : "checked", U += `
858
858
  <li>
859
859
  <input
860
860
  type="radio"
861
861
  id="label-${f}-codetab-label-1-${c}-${h}-${k - h}"
862
862
  name="${f}-codetab-label-${c}-${h}"
863
- class="${A}"
863
+ class="${F}"
864
864
  ${N}
865
865
  >
866
866
  <label
867
867
  for="label-${f}-codetab-label-1-${c}-${h}-${k - h}"
868
- onclick="this.getRootNode().querySelectorAll('.${A}').forEach(e => e.click())"
868
+ onclick="this.getRootNode().querySelectorAll('.${F}').forEach(e => e.click())"
869
869
  >
870
- ${e.utils.escapeHtml(D || r(R))}
870
+ ${e.utils.escapeHtml(D || r(M))}
871
871
  </label>
872
872
  </li>`, W += `
873
873
  <div role="tabpanel">
874
874
  <input
875
875
  type="radio"
876
876
  name="${f}-codetab-pre-${c}-${h}"
877
- class="${A}"
877
+ class="${F}"
878
878
  ${N}
879
879
  role="presentation">
880
880
  ${a(m, k, g, p, v)}
@@ -882,10 +882,10 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
882
882
  <input
883
883
  type="radio"
884
884
  name="${f}-codetab-lang-${c}-${h}"
885
- class="${A}"
885
+ class="${F}"
886
886
  ${N}
887
887
  role="presentation">
888
- <span class=${f}-code-lang role="note">${e.utils.escapeHtml(r(R))}</span>`;
888
+ <span class=${f}-code-lang role="note">${e.utils.escapeHtml(r(M))}</span>`;
889
889
  }
890
890
  const { attrs: q, language: K } = le(
891
891
  u(m[h])
@@ -900,7 +900,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
900
900
  <span class="${f}-codetab-lang">${X}</span>
901
901
  <span class="${f}-copy-button" data-tips="${b}"${x ? " data-is-icon=true" : ""}>${C}</span>
902
902
  ${t.extraTools instanceof Function ? t.extraTools({ lang: ee }) : t.extraTools || ""}
903
- ${L === "details" ? F : ""}
903
+ ${L === "details" ? R : ""}
904
904
  </div>
905
905
  </${P}>
906
906
  ${W}
@@ -1007,12 +1007,12 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1007
1007
  }
1008
1008
  let v = a + 1, $ = !1, y = "";
1009
1009
  for (; v < o; v++) {
1010
- const x = t.bMarks[v] + t.tShift[v], F = t.eMarks[v];
1011
- if (x < F && t.tShift[v] < t.blkIndent)
1010
+ const x = t.bMarks[v] + t.tShift[v], R = t.eMarks[v];
1011
+ if (x < R && t.tShift[v] < t.blkIndent)
1012
1012
  break;
1013
- if (t.src.slice(x, F).trim().endsWith(r.close)) {
1014
- const R = t.src.slice(0, F).lastIndexOf(r.close);
1015
- y = t.src.slice(x, R), $ = !0;
1013
+ if (t.src.slice(x, R).trim().endsWith(r.close)) {
1014
+ const M = t.src.slice(0, R).lastIndexOf(r.close);
1015
+ y = t.src.slice(x, M), $ = !0;
1016
1016
  break;
1017
1017
  }
1018
1018
  }
@@ -1110,7 +1110,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1110
1110
  }, zt = (e, t) => {
1111
1111
  const { editorConfig: a, markdownItConfig: o, markdownItPlugins: n, editorExtensions: s } = j, c = E("editorId"), u = E("language"), d = E(
1112
1112
  "usedLanguageText"
1113
- ), r = E("showCodeRowNumber"), i = E("theme"), l = E("customIcon"), m = E("rootRef"), h = E("setting"), g = Q([]), p = bt(e), v = Ct(e), { reRenderRef: $, replaceMermaid: y, invalidateMermaid: b, getCachedMermaid: C } = Et(e), { reRenderEcharts: x, replaceEcharts: F } = yt(e), T = lt({
1113
+ ), r = E("showCodeRowNumber"), i = E("theme"), l = E("customIcon"), m = E("rootRef"), h = E("setting"), g = Q([]), p = bt(e), v = Ct(e), { reRenderRef: $, replaceMermaid: y, invalidateMermaid: b, getCachedMermaid: C } = Et(e), { reRenderEcharts: x, replaceEcharts: R } = yt(e), T = lt({
1114
1114
  // 关闭源文本中的原生 HTML 解析,插件生成的 HTML 不受影响。
1115
1115
  html: !1,
1116
1116
  breaks: !0,
@@ -1119,7 +1119,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1119
1119
  o(T, {
1120
1120
  editorId: c
1121
1121
  });
1122
- const R = [
1122
+ const M = [
1123
1123
  {
1124
1124
  type: "image",
1125
1125
  plugin: ct,
@@ -1163,48 +1163,48 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1163
1163
  options: {}
1164
1164
  }
1165
1165
  ];
1166
- e.noKatex || R.push({
1166
+ e.noKatex || M.push({
1167
1167
  type: "katex",
1168
1168
  plugin: Rt,
1169
1169
  options: { katexRef: v }
1170
- }), e.noMermaid || R.push({
1170
+ }), e.noMermaid || M.push({
1171
1171
  type: "mermaid",
1172
1172
  plugin: Mt,
1173
1173
  options: { themeRef: i, revision: $, getCached: C }
1174
- }), e.noEcharts || R.push({
1174
+ }), e.noEcharts || M.push({
1175
1175
  type: "echarts",
1176
1176
  plugin: It,
1177
1177
  options: { themeRef: i }
1178
- }), n(R, {
1178
+ }), n(M, {
1179
1179
  editorId: c
1180
- }).forEach((M) => {
1181
- T.use(M.plugin, M.options);
1180
+ }).forEach((A) => {
1181
+ T.use(A.plugin, A.options);
1182
1182
  });
1183
1183
  const J = T.options.highlight;
1184
1184
  T.set({
1185
- highlight: (M, O, q) => {
1186
- const K = le(O, q), { attrs: ee, language: k, lineHighlightRanges: A } = K;
1187
- let G = "";
1185
+ highlight: (A, O, q) => {
1186
+ const K = le(O, q), { attrs: ee, language: k, lineHighlightRanges: F } = K;
1187
+ let z = "";
1188
1188
  if (J) {
1189
- const ne = J(M, k, ee);
1189
+ const ne = J(A, k, ee);
1190
1190
  if (ne) {
1191
- const oe = mt(ne, M, {
1192
- lineHighlightRanges: A,
1191
+ const oe = mt(ne, A, {
1192
+ lineHighlightRanges: F,
1193
1193
  showLineNumber: r
1194
1194
  });
1195
1195
  if (oe.shouldReturnDirectly)
1196
1196
  return oe.html;
1197
- G = oe.html;
1197
+ z = oe.html;
1198
1198
  }
1199
1199
  }
1200
- G || (!e.noHighlight && p.value ? p.value.getLanguage(k) ? G = p.value.highlight(M, {
1200
+ z || (!e.noHighlight && p.value ? p.value.getLanguage(k) ? z = p.value.highlight(A, {
1201
1201
  language: k,
1202
1202
  ignoreIllegals: !0
1203
- }).value : G = p.value.highlightAuto(M).value : G = T.utils.escapeHtml(M));
1203
+ }).value : k ? z = T.utils.escapeHtml(A) : z = p.value.highlightAuto(A).value : z = T.utils.escapeHtml(A));
1204
1204
  const te = T.utils.escapeHtml(k);
1205
- let se = `<span class="${f}-code-block">${G.replace(/^\n+|\n+$/g, "")}</span>`;
1206
- return (r || A.length) && (se = ft(G, M, {
1207
- lineHighlightRanges: A,
1205
+ let se = `<span class="${f}-code-block">${z.replace(/^\n+|\n+$/g, "")}</span>`;
1206
+ return (r || F.length) && (se = ft(z, A, {
1207
+ lineHighlightRanges: F,
1208
1208
  showLineNumber: r
1209
1209
  })), `<pre><code class="language-${te}" language="${te}">${se}</code></pre>`;
1210
1210
  }
@@ -1221,17 +1221,17 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1221
1221
  }, W = () => {
1222
1222
  };
1223
1223
  const X = () => {
1224
- const M = m.value?.querySelectorAll(
1224
+ const A = m.value?.querySelectorAll(
1225
1225
  `#${c} p.${f}-mermaid:not([data-closed=false])`
1226
1226
  );
1227
- W(), W = rt(M, {
1227
+ W(), W = rt(A, {
1228
1228
  customIcon: l.value
1229
- }), s.mermaid?.enableZoom && (U(), U = st(M, {
1229
+ }), s.mermaid?.enableZoom && (U(), U = st(A, {
1230
1230
  customIcon: l.value
1231
1231
  }));
1232
1232
  }, V = () => {
1233
1233
  w.emit(c, ie, N.value), e.onHtmlChanged(N.value), e.onGetCatalog(g.value), w.emit(c, ue, g.value), Y(() => {
1234
- y().then(X), F();
1234
+ y().then(X), R();
1235
1235
  });
1236
1236
  }, L = () => {
1237
1237
  g.value = [], N.value = e.sanitize(
@@ -1249,7 +1249,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1249
1249
  $,
1250
1250
  u
1251
1251
  ],
1252
- (M, O, q) => {
1252
+ (A, O, q) => {
1253
1253
  const K = window.setTimeout(
1254
1254
  () => {
1255
1255
  L();
@@ -1264,7 +1264,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1264
1264
  () => h.value.preview,
1265
1265
  () => {
1266
1266
  h.value.preview && Y(() => {
1267
- y().then(X), F(), w.emit(c, ue, g.value);
1267
+ y().then(X), R(), w.emit(c, ue, g.value);
1268
1268
  });
1269
1269
  }
1270
1270
  ), S([N, x, D], () => {
@@ -1300,12 +1300,12 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1300
1300
  });
1301
1301
  }, He = {
1302
1302
  checked: {
1303
- regexp: /- \[x\]/,
1304
- value: "- [ ]"
1303
+ regexp: /\[[xX]\]/,
1304
+ value: "[ ]"
1305
1305
  },
1306
1306
  unChecked: {
1307
- regexp: /- \[\s\]/,
1308
- value: "- [x]"
1307
+ regexp: /\[ \]/,
1308
+ value: "[x]"
1309
1309
  }
1310
1310
  }, Ut = (e, t) => {
1311
1311
  const a = E("editorId"), o = E("rootRef");
@@ -1314,7 +1314,9 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
1314
1314
  const s = () => {
1315
1315
  if (!o.value)
1316
1316
  return !1;
1317
- const c = o.value.querySelectorAll(".task-list-item.enabled"), u = (d) => {
1317
+ const c = o.value.querySelectorAll(
1318
+ ".task-list-item.enabled .task-list-item-checkbox"
1319
+ ), u = (d) => {
1318
1320
  d.preventDefault();
1319
1321
  const r = d.target.checked ? "unChecked" : "checked", i = d.target.parentElement?.dataset.line;
1320
1322
  if (!i)
package/lib/style.css CHANGED
@@ -33,7 +33,7 @@
33
33
  overflow: hidden;
34
34
  box-sizing: border-box;
35
35
  position: absolute;
36
- transition: all 0.3s;
36
+ transition: opacity 0.3s;
37
37
  opacity: 1;
38
38
  z-index: 20000;
39
39
  background-color: var(--md-bk-color);
@@ -97,6 +97,12 @@
97
97
  }
98
98
  .md-editor-modal .md-editor-modal-func .md-editor-modal-adjust,
99
99
  .md-editor-modal .md-editor-modal-func .md-editor-modal-close {
100
+ box-sizing: content-box;
101
+ padding: 0;
102
+ border: none;
103
+ background: transparent;
104
+ color: var(--md-color);
105
+ font: inherit;
100
106
  cursor: pointer;
101
107
  width: 24px;
102
108
  height: 24px;
@@ -304,6 +310,11 @@
304
310
  cursor: pointer;
305
311
  }
306
312
  .md-editor-clip-main .md-editor-clip-upload {
313
+ padding: 0;
314
+ border: none;
315
+ background: transparent;
316
+ color: inherit;
317
+ font: inherit;
307
318
  display: flex;
308
319
  align-items: center;
309
320
  justify-content: center;
@@ -430,7 +441,7 @@
430
441
  .md-editor-menu-item:last-of-type {
431
442
  padding-block-end: 8px;
432
443
  }
433
- .md-editor-menu-item:hover {
444
+ .md-editor-menu-item:hover, .md-editor-menu-item:focus-visible {
434
445
  background-color: var(--md-bk-hover-color);
435
446
  }
436
447
  .md-editor-table-shape {
@@ -2042,11 +2042,11 @@ declare const _default$b: vue.DefineComponent<vue.ExtractPropTypes<{
2042
2042
  language: string;
2043
2043
  previewTheme: string;
2044
2044
  codeTheme: string;
2045
- onClick: (e: MouseEvent) => void;
2046
2045
  trigger: string | VNode<vue.RendererNode, vue.RendererElement, {
2047
2046
  [key: string]: any;
2048
2047
  }>;
2049
2048
  insert: () => void;
2049
+ onClick: (e: MouseEvent) => void;
2050
2050
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2051
2051
 
2052
2052
  declare const _default$a: typeof _default$b & {
@@ -2178,14 +2178,14 @@ declare const _default$9: vue.DefineComponent<vue.ExtractPropTypes<{
2178
2178
  language: string;
2179
2179
  previewTheme: string;
2180
2180
  codeTheme: string;
2181
+ visible: boolean;
2181
2182
  trigger: string | VNode<vue.RendererNode, vue.RendererElement, {
2182
2183
  [key: string]: any;
2183
2184
  }>;
2184
- insert: () => void;
2185
- visible: boolean;
2186
2185
  overlay: string | VNode<vue.RendererNode, vue.RendererElement, {
2187
2186
  [key: string]: any;
2188
2187
  }>;
2188
+ insert: () => void;
2189
2189
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2190
2190
 
2191
2191
  declare const _default$8: typeof _default$9 & {
@@ -2283,7 +2283,7 @@ declare const _default$7: vue.DefineComponent<vue.ExtractPropTypes<{
2283
2283
  type: PropType<boolean>;
2284
2284
  default: undefined;
2285
2285
  };
2286
- }>, () => vue_jsx_runtime.JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("onClick" | "onClose" | "onAdjust")[], "onClick" | "onClose" | "onAdjust", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
2286
+ }>, () => vue_jsx_runtime.JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("onClose" | "onAdjust" | "onClick")[], "onClose" | "onAdjust" | "onClick", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
2287
2287
  title: {
2288
2288
  type: PropType<string>;
2289
2289
  default: string;
@@ -2375,9 +2375,9 @@ declare const _default$7: vue.DefineComponent<vue.ExtractPropTypes<{
2375
2375
  default: undefined;
2376
2376
  };
2377
2377
  }>> & Readonly<{
2378
- onOnClick?: ((...args: any[]) => any) | undefined;
2379
2378
  onOnClose?: ((...args: any[]) => any) | undefined;
2380
2379
  onOnAdjust?: ((...args: any[]) => any) | undefined;
2380
+ onOnClick?: ((...args: any[]) => any) | undefined;
2381
2381
  }>, {
2382
2382
  title: string;
2383
2383
  disabled: boolean;
@@ -2388,22 +2388,22 @@ declare const _default$7: vue.DefineComponent<vue.ExtractPropTypes<{
2388
2388
  previewTheme: string;
2389
2389
  style: string | CSSProperties;
2390
2390
  codeTheme: string;
2391
- onClick: () => void;
2391
+ visible: boolean;
2392
2392
  trigger: string | VNode<vue.RendererNode, vue.RendererElement, {
2393
2393
  [key: string]: any;
2394
2394
  }>;
2395
2395
  insert: () => void;
2396
2396
  onClose: () => void;
2397
- onAdjust: (val: boolean) => void;
2398
- modalTitle: string | VNode<vue.RendererNode, vue.RendererElement, {
2399
- [key: string]: any;
2400
- }>;
2401
- visible: boolean;
2402
2397
  width: string;
2403
2398
  height: string;
2404
2399
  showAdjust: boolean;
2405
2400
  isFullscreen: boolean;
2401
+ onAdjust: (val: boolean) => void;
2406
2402
  showMask: boolean;
2403
+ onClick: () => void;
2404
+ modalTitle: string | VNode<vue.RendererNode, vue.RendererElement, {
2405
+ [key: string]: any;
2406
+ }>;
2407
2407
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2408
2408
 
2409
2409
  declare const _default$6: typeof _default$7 & {
@@ -2508,12 +2508,12 @@ declare const _default$5: vue.DefineComponent<vue.ExtractPropTypes<{
2508
2508
  }>[];
2509
2509
  class: string;
2510
2510
  style: string | CSSProperties;
2511
- onAdjust: (val: boolean) => void;
2512
2511
  visible: boolean;
2513
2512
  width: string;
2514
2513
  height: string;
2515
2514
  showAdjust: boolean;
2516
2515
  isFullscreen: boolean;
2516
+ onAdjust: (val: boolean) => void;
2517
2517
  showMask: boolean;
2518
2518
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2519
2519
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md-editor-v3",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "vue",