md-editor-v3 7.1.0 → 7.1.2
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.
- package/README.md +5 -2
- package/lib/cjs/MdEditor.cjs +1 -1
- package/lib/cjs/chunks/dom.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +1 -1
- package/lib/cjs/chunks/index2.cjs +1 -1
- package/lib/cjs/chunks/index4.cjs +36 -36
- package/lib/es/MdEditor.mjs +2 -3
- package/lib/es/chunks/dom.mjs +120 -110
- package/lib/es/chunks/index.mjs +180 -86
- package/lib/es/chunks/index2.mjs +182 -145
- package/lib/es/chunks/index4.mjs +88 -86
- package/lib/style.css +13 -2
- package/lib/types/index.d.ts +66 -66
- package/package.json +1 -1
package/lib/es/chunks/index4.mjs
CHANGED
|
@@ -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
|
|
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
|
-
|
|
159
|
+
G("link", {
|
|
160
160
|
...r,
|
|
161
161
|
rel: "stylesheet",
|
|
162
162
|
href: o.cropper.css,
|
|
163
163
|
id: B.croppercss
|
|
164
|
-
}),
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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],
|
|
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?.(),
|
|
464
|
+
x?.dispose?.(), R?.disconnect?.();
|
|
465
465
|
return;
|
|
466
466
|
}
|
|
467
|
-
v.push(b), x && $.push(x),
|
|
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
|
-
},
|
|
485
|
-
c(
|
|
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 || (
|
|
507
|
+
e.noHighlight || a.value || (G("link", {
|
|
508
508
|
...t.value.css,
|
|
509
509
|
rel: "stylesheet",
|
|
510
510
|
id: B.hlcss
|
|
511
|
-
}),
|
|
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
|
-
|
|
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
|
-
),
|
|
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($) ? (
|
|
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
|
-
})) :
|
|
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
|
|
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
|
|
718
|
-
|
|
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,
|
|
720
|
+
return await y.render(he(), D, F);
|
|
721
721
|
} finally {
|
|
722
|
-
|
|
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
|
|
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,
|
|
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),
|
|
791
|
-
if (r(
|
|
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,
|
|
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 =
|
|
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,
|
|
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:
|
|
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
|
-
<${
|
|
835
|
-
<${
|
|
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
|
-
${
|
|
841
|
+
${F === "details" ? R : ""}
|
|
842
842
|
</div>
|
|
843
|
-
</${
|
|
843
|
+
</${z}>
|
|
844
844
|
${Ve}
|
|
845
|
-
</${
|
|
845
|
+
</${F}>
|
|
846
846
|
`;
|
|
847
847
|
}
|
|
848
|
-
let
|
|
849
|
-
const { open: V, tagContainer: L, tagHeader: P } = i(m[h]),
|
|
850
|
-
V &&
|
|
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],
|
|
852
|
+
attrs: ke(m[h], A)
|
|
853
853
|
};
|
|
854
|
-
for (let k = h; k < m.length && (
|
|
855
|
-
|
|
856
|
-
const
|
|
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="${
|
|
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('.${
|
|
868
|
+
onclick="this.getRootNode().querySelectorAll('.${F}').forEach(e => e.click())"
|
|
869
869
|
>
|
|
870
|
-
${e.utils.escapeHtml(D || 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="${
|
|
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="${
|
|
885
|
+
class="${F}"
|
|
886
886
|
${N}
|
|
887
887
|
role="presentation">
|
|
888
|
-
<span class=${f}-code-lang role="note">${e.utils.escapeHtml(r(
|
|
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" ?
|
|
903
|
+
${L === "details" ? R : ""}
|
|
904
904
|
</div>
|
|
905
905
|
</${P}>
|
|
906
906
|
${W}
|
|
@@ -929,7 +929,7 @@ const Ae = /* @__PURE__ */ new WeakMap(), $t = (e, t) => {
|
|
|
929
929
|
};
|
|
930
930
|
}, kt = (e, t) => {
|
|
931
931
|
e.renderer.rules.heading_open = (a, o) => {
|
|
932
|
-
const n = a[o], s = a[o + 1].children?.reduce((u, d) => u + (["text", "code_inline", "math_inline"].includes(d.type) && d.content || ""), "") || "", c = n.
|
|
932
|
+
const n = a[o], s = a[o + 1].children?.reduce((u, d) => u + (["text", "code_inline", "math_inline"].includes(d.type) && d.content || ""), "") || "", c = Number(n.tag.slice(1));
|
|
933
933
|
return t.headsRef.value.push({
|
|
934
934
|
text: s,
|
|
935
935
|
level: c,
|
|
@@ -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],
|
|
1011
|
-
if (x <
|
|
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,
|
|
1014
|
-
const
|
|
1015
|
-
y = t.src.slice(x,
|
|
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:
|
|
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
|
|
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 ||
|
|
1166
|
+
e.noKatex || M.push({
|
|
1167
1167
|
type: "katex",
|
|
1168
1168
|
plugin: Rt,
|
|
1169
1169
|
options: { katexRef: v }
|
|
1170
|
-
}), e.noMermaid ||
|
|
1170
|
+
}), e.noMermaid || M.push({
|
|
1171
1171
|
type: "mermaid",
|
|
1172
1172
|
plugin: Mt,
|
|
1173
1173
|
options: { themeRef: i, revision: $, getCached: C }
|
|
1174
|
-
}), e.noEcharts ||
|
|
1174
|
+
}), e.noEcharts || M.push({
|
|
1175
1175
|
type: "echarts",
|
|
1176
1176
|
plugin: It,
|
|
1177
1177
|
options: { themeRef: i }
|
|
1178
|
-
}), n(
|
|
1178
|
+
}), n(M, {
|
|
1179
1179
|
editorId: c
|
|
1180
|
-
}).forEach((
|
|
1181
|
-
T.use(
|
|
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: (
|
|
1186
|
-
const K = le(O, q), { attrs: ee, language: k, lineHighlightRanges:
|
|
1187
|
-
let
|
|
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(
|
|
1189
|
+
const ne = J(A, k, ee);
|
|
1190
1190
|
if (ne) {
|
|
1191
|
-
const oe = mt(ne,
|
|
1192
|
-
lineHighlightRanges:
|
|
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
|
-
|
|
1197
|
+
z = oe.html;
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
|
-
|
|
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 :
|
|
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">${
|
|
1206
|
-
return (r ||
|
|
1207
|
-
lineHighlightRanges:
|
|
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
|
|
1224
|
+
const A = m.value?.querySelectorAll(
|
|
1225
1225
|
`#${c} p.${f}-mermaid:not([data-closed=false])`
|
|
1226
1226
|
);
|
|
1227
|
-
W(), W = rt(
|
|
1227
|
+
W(), W = rt(A, {
|
|
1228
1228
|
customIcon: l.value
|
|
1229
|
-
}), s.mermaid?.enableZoom && (U(), U = st(
|
|
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),
|
|
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
|
-
(
|
|
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),
|
|
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:
|
|
1304
|
-
value: "
|
|
1303
|
+
regexp: /\[[xX]\]/,
|
|
1304
|
+
value: "[ ]"
|
|
1305
1305
|
},
|
|
1306
1306
|
unChecked: {
|
|
1307
|
-
regexp:
|
|
1308
|
-
value: "
|
|
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(
|
|
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:
|
|
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 {
|