@ahzoo/sus 1.3.1 → 1.3.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/index.js +491 -518
- package/index.umd.cjs +66 -66
- package/package.json +1 -1
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var yi = Object.defineProperty;
|
|
2
|
-
var bi = (ce,
|
|
3
|
-
var ze = (ce,
|
|
4
|
-
import { defineComponent as wt, ref as
|
|
2
|
+
var bi = (ce, me, fe) => me in ce ? yi(ce, me, { enumerable: !0, configurable: !0, writable: !0, value: fe }) : ce[me] = fe;
|
|
3
|
+
var ze = (ce, me, fe) => (bi(ce, typeof me != "symbol" ? me + "" : me, fe), fe);
|
|
4
|
+
import { defineComponent as wt, ref as Ve, reactive as wi, onMounted as Un, openBlock as xe, createElementBlock as Oe, createCommentVNode as Ue, withDirectives as pt, createElementVNode as oe, vShow as Xt, vModelText as Qt, createStaticVNode as Wn, pushScopeId as zn, popScopeId as Kn, toDisplayString as Xe, normalizeClass as Ei, unref as ki, createTextVNode as Si, createVNode as _i, createBlock as Yt, Fragment as Li, renderList as Mi } from "vue";
|
|
5
5
|
var Ti = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
6
|
function Ci(ce) {
|
|
7
7
|
return ce && ce.__esModule && Object.prototype.hasOwnProperty.call(ce, "default") ? ce.default : ce;
|
|
8
8
|
}
|
|
9
9
|
var Gn = { exports: {} };
|
|
10
|
-
(function(ce,
|
|
11
|
-
(function(
|
|
12
|
-
ce.exports =
|
|
10
|
+
(function(ce, me) {
|
|
11
|
+
(function(fe, ye) {
|
|
12
|
+
ce.exports = ye();
|
|
13
13
|
})(Ti, () => (() => {
|
|
14
|
-
var
|
|
14
|
+
var fe = { 471: ($) => {
|
|
15
15
|
var _ = function() {
|
|
16
16
|
this.Diff_Timeout = 1, this.Diff_EditCost = 4, this.Match_Threshold = 0.5, this.Match_Distance = 1e3, this.Patch_DeleteThreshold = 0.5, this.Patch_Margin = 4, this.Match_MaxBits = 32;
|
|
17
17
|
}, b = -1;
|
|
@@ -78,27 +78,27 @@ var Gn = { exports: {} };
|
|
|
78
78
|
L[T] = -1, S[T] = -1;
|
|
79
79
|
L[f + 1] = 0, S[f + 1] = 0;
|
|
80
80
|
for (var E = y - s, k = E % 2 != 0, p = 0, x = 0, I = 0, W = 0, N = 0; N < u && !((/* @__PURE__ */ new Date()).getTime() > l); N++) {
|
|
81
|
-
for (var
|
|
82
|
-
for (var ne = f +
|
|
83
|
-
|
|
84
|
-
if (L[ne] =
|
|
81
|
+
for (var Z = -N + p; Z <= N - x; Z += 2) {
|
|
82
|
+
for (var ne = f + Z, ge = (Te = Z == -N || Z != N && L[ne - 1] < L[ne + 1] ? L[ne + 1] : L[ne - 1] + 1) - Z; Te < y && ge < s && c.charAt(Te) == m.charAt(ge); )
|
|
83
|
+
Te++, ge++;
|
|
84
|
+
if (L[ne] = Te, Te > y)
|
|
85
85
|
x += 2;
|
|
86
86
|
else if (ge > s)
|
|
87
87
|
p += 2;
|
|
88
|
-
else if (k && (be = f + E -
|
|
89
|
-
return this.diff_bisectSplit_(c, m,
|
|
88
|
+
else if (k && (be = f + E - Z) >= 0 && be < w && S[be] != -1 && Te >= (de = y - S[be]))
|
|
89
|
+
return this.diff_bisectSplit_(c, m, Te, ge, l);
|
|
90
90
|
}
|
|
91
|
-
for (var
|
|
92
|
-
for (var de, be = f +
|
|
91
|
+
for (var ue = -N + I; ue <= N - W; ue += 2) {
|
|
92
|
+
for (var de, be = f + ue, He = (de = ue == -N || ue != N && S[be - 1] < S[be + 1] ? S[be + 1] : S[be - 1] + 1) - ue; de < y && He < s && c.charAt(y - de - 1) == m.charAt(s - He - 1); )
|
|
93
93
|
de++, He++;
|
|
94
94
|
if (S[be] = de, de > y)
|
|
95
95
|
W += 2;
|
|
96
96
|
else if (He > s)
|
|
97
97
|
I += 2;
|
|
98
|
-
else if (!k && (ne = f + E -
|
|
99
|
-
var
|
|
100
|
-
if (ge = f + (
|
|
101
|
-
return this.diff_bisectSplit_(c, m,
|
|
98
|
+
else if (!k && (ne = f + E - ue) >= 0 && ne < w && L[ne] != -1) {
|
|
99
|
+
var Te;
|
|
100
|
+
if (ge = f + (Te = L[ne]) - ne, Te >= (de = y - de))
|
|
101
|
+
return this.diff_bisectSplit_(c, m, Te, ge, l);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -160,11 +160,11 @@ var Gn = { exports: {} };
|
|
|
160
160
|
return null;
|
|
161
161
|
var s = this;
|
|
162
162
|
function u(p, x, I) {
|
|
163
|
-
for (var W, N,
|
|
164
|
-
var be = s.diff_commonPrefix(p.substring(I), x.substring(
|
|
165
|
-
de.length < He + be && (de = x.substring(
|
|
163
|
+
for (var W, N, Z, ne, ge = p.substring(I, I + Math.floor(p.length / 4)), ue = -1, de = ""; (ue = x.indexOf(ge, ue + 1)) != -1; ) {
|
|
164
|
+
var be = s.diff_commonPrefix(p.substring(I), x.substring(ue)), He = s.diff_commonSuffix(p.substring(0, I), x.substring(0, ue));
|
|
165
|
+
de.length < He + be && (de = x.substring(ue - He, ue) + x.substring(ue, ue + be), W = p.substring(0, I - He), N = p.substring(I + be), Z = x.substring(0, ue - He), ne = x.substring(ue + be));
|
|
166
166
|
}
|
|
167
|
-
return 2 * de.length >= p.length ? [W, N,
|
|
167
|
+
return 2 * de.length >= p.length ? [W, N, Z, ne, de] : null;
|
|
168
168
|
}
|
|
169
169
|
var f, w, L, S, T, E = u(l, y, Math.ceil(l.length / 4)), k = u(l, y, Math.ceil(l.length / 2));
|
|
170
170
|
return E || k ? (f = k ? E && E[4].length > k[4].length ? E : k : E, c.length > m.length ? (w = f[0], L = f[1], S = f[2], T = f[3]) : (S = f[0], T = f[1], w = f[2], L = f[3]), [w, L, S, T, f[4]]) : null;
|
|
@@ -182,8 +182,8 @@ var Gn = { exports: {} };
|
|
|
182
182
|
function m(p, x) {
|
|
183
183
|
if (!p || !x)
|
|
184
184
|
return 6;
|
|
185
|
-
var I = p.charAt(p.length - 1), W = x.charAt(0), N = I.match(_.nonAlphaNumericRegex_),
|
|
186
|
-
return be || He ? 5 :
|
|
185
|
+
var I = p.charAt(p.length - 1), W = x.charAt(0), N = I.match(_.nonAlphaNumericRegex_), Z = W.match(_.nonAlphaNumericRegex_), ne = N && I.match(_.whitespaceRegex_), ge = Z && W.match(_.whitespaceRegex_), ue = ne && I.match(_.linebreakRegex_), de = ge && W.match(_.linebreakRegex_), be = ue && p.match(_.blanklineEndRegex_), He = de && x.match(_.blanklineStartRegex_);
|
|
186
|
+
return be || He ? 5 : ue || de ? 4 : N && !ne && ge ? 3 : ne || ge ? 2 : N || Z ? 1 : 0;
|
|
187
187
|
}
|
|
188
188
|
for (var l = 1; l < c.length - 1; ) {
|
|
189
189
|
if (c[l - 1][0] == 0 && c[l + 1][0] == 0) {
|
|
@@ -314,8 +314,8 @@ var Gn = { exports: {} };
|
|
|
314
314
|
if (m.length > this.Match_MaxBits)
|
|
315
315
|
throw new Error("Pattern too long for this browser.");
|
|
316
316
|
var y = this.match_alphabet_(m), s = this;
|
|
317
|
-
function u(ge,
|
|
318
|
-
var de = ge / m.length, be = Math.abs(l -
|
|
317
|
+
function u(ge, ue) {
|
|
318
|
+
var de = ge / m.length, be = Math.abs(l - ue);
|
|
319
319
|
return s.Match_Distance ? de + be / s.Match_Distance : be ? 1 : de;
|
|
320
320
|
}
|
|
321
321
|
var f = this.Match_Threshold, w = c.indexOf(m, l);
|
|
@@ -329,8 +329,8 @@ var Gn = { exports: {} };
|
|
|
329
329
|
var x = Math.max(1, l - S + 1), I = Math.min(l + S, c.length) + m.length, W = Array(I + 2);
|
|
330
330
|
W[I + 1] = (1 << p) - 1;
|
|
331
331
|
for (var N = I; N >= x; N--) {
|
|
332
|
-
var
|
|
333
|
-
if (W[N] = p === 0 ? (W[N + 1] << 1 | 1) &
|
|
332
|
+
var Z = y[c.charAt(N - 1)];
|
|
333
|
+
if (W[N] = p === 0 ? (W[N + 1] << 1 | 1) & Z : (W[N + 1] << 1 | 1) & Z | (E[N + 1] | E[N]) << 1 | 1 | E[N + 1], W[N] & T) {
|
|
334
334
|
var ne = u(p, N - 1);
|
|
335
335
|
if (ne <= f) {
|
|
336
336
|
if (f = ne, !((w = N - 1) > l))
|
|
@@ -536,80 +536,80 @@ var Gn = { exports: {} };
|
|
|
536
536
|
}), K.querySelectorAll("img").forEach(function(V) {
|
|
537
537
|
window.vditorImageIntersectionObserver.observe(V);
|
|
538
538
|
}));
|
|
539
|
-
}, L = b(466), S = b(554), T = b(40), E = b(563), k = b(749), p = b(818), x = b(408), I = b(54), W = b(227), N = b(526),
|
|
539
|
+
}, L = b(466), S = b(554), T = b(40), E = b(563), k = b(749), p = b(818), x = b(408), I = b(54), W = b(227), N = b(526), Z = b(827), ne = b(640), ge = b(895), ue = b(393), de = function(K, we) {
|
|
540
540
|
if (we === void 0 && (we = "zh_CN"), typeof speechSynthesis < "u" && typeof SpeechSynthesisUtterance < "u") {
|
|
541
541
|
var V = function() {
|
|
542
|
-
var ve,
|
|
542
|
+
var ve, pe;
|
|
543
543
|
return speechSynthesis.getVoices().forEach(function(Q) {
|
|
544
|
-
Q.lang === we.replace("_", "-") && (ve = Q), Q.default && (
|
|
545
|
-
}), ve || (ve =
|
|
546
|
-
}, j = '<svg><use xlink:href="#vditor-icon-play"></use></svg>',
|
|
547
|
-
document.getElementById("vditorIconScript") || (j = '<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',
|
|
544
|
+
Q.lang === we.replace("_", "-") && (ve = Q), Q.default && (pe = Q);
|
|
545
|
+
}), ve || (ve = pe), ve;
|
|
546
|
+
}, j = '<svg><use xlink:href="#vditor-icon-play"></use></svg>', ie = '<svg><use xlink:href="#vditor-icon-pause"></use></svg>';
|
|
547
|
+
document.getElementById("vditorIconScript") || (j = '<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>', ie = '<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');
|
|
548
548
|
var le = document.querySelector(".vditor-speech");
|
|
549
549
|
le || ((le = document.createElement("button")).className = "vditor-speech", K.insertAdjacentElement("beforeend", le), speechSynthesis.onvoiceschanged !== void 0 && (speechSynthesis.onvoiceschanged = V));
|
|
550
550
|
var ae = V(), De = new SpeechSynthesisUtterance();
|
|
551
551
|
De.voice = ae, De.onend = De.onerror = function() {
|
|
552
552
|
le.style.display = "none", speechSynthesis.cancel(), le.classList.remove("vditor-speech--current"), le.innerHTML = j;
|
|
553
553
|
}, K.addEventListener(window.ontouchstart !== void 0 ? "touchend" : "click", function(ve) {
|
|
554
|
-
var
|
|
555
|
-
if (
|
|
556
|
-
return le.classList.contains("vditor-speech--current") ? speechSynthesis.speaking && (speechSynthesis.paused ? (speechSynthesis.resume(), le.innerHTML =
|
|
554
|
+
var pe = ve.target;
|
|
555
|
+
if (pe.classList.contains("vditor-speech") || pe.parentElement.classList.contains("vditor-speech"))
|
|
556
|
+
return le.classList.contains("vditor-speech--current") ? speechSynthesis.speaking && (speechSynthesis.paused ? (speechSynthesis.resume(), le.innerHTML = ie) : (speechSynthesis.pause(), le.innerHTML = j)) : (De.text = le.getAttribute("data-text"), speechSynthesis.speak(De), le.classList.add("vditor-speech--current"), le.innerHTML = ie), (0, ue.Hc)(window.vditorSpeechRange), void K.focus();
|
|
557
557
|
if (le.style.display = "none", speechSynthesis.cancel(), le.classList.remove("vditor-speech--current"), le.innerHTML = j, getSelection().rangeCount !== 0) {
|
|
558
558
|
var Q = getSelection().getRangeAt(0), Fe = Q.toString().trim();
|
|
559
559
|
if (Fe) {
|
|
560
560
|
window.vditorSpeechRange = Q.cloneRange();
|
|
561
|
-
var
|
|
562
|
-
le.innerHTML = j, le.style.display = "block", le.style.top =
|
|
561
|
+
var et = Q.getBoundingClientRect();
|
|
562
|
+
le.innerHTML = j, le.style.display = "block", le.style.top = et.top + et.height + document.querySelector("html").scrollTop - 20 + "px", window.ontouchstart !== void 0 ? le.style.left = ve.changedTouches[ve.changedTouches.length - 1].pageX + 2 + "px" : le.style.left = ve.clientX + 2 + "px", le.setAttribute("data-text", Fe);
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
});
|
|
566
566
|
}
|
|
567
567
|
}, be = function(K, we, V, j) {
|
|
568
|
-
return new (V || (V = Promise))(function(
|
|
569
|
-
function ae(
|
|
568
|
+
return new (V || (V = Promise))(function(ie, le) {
|
|
569
|
+
function ae(pe) {
|
|
570
570
|
try {
|
|
571
|
-
ve(j.next(
|
|
571
|
+
ve(j.next(pe));
|
|
572
572
|
} catch (Q) {
|
|
573
573
|
le(Q);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
function De(
|
|
576
|
+
function De(pe) {
|
|
577
577
|
try {
|
|
578
|
-
ve(j.throw(
|
|
578
|
+
ve(j.throw(pe));
|
|
579
579
|
} catch (Q) {
|
|
580
580
|
le(Q);
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
|
-
function ve(
|
|
583
|
+
function ve(pe) {
|
|
584
584
|
var Q;
|
|
585
|
-
|
|
585
|
+
pe.done ? ie(pe.value) : (Q = pe.value, Q instanceof V ? Q : new V(function(Fe) {
|
|
586
586
|
Fe(Q);
|
|
587
587
|
})).then(ae, De);
|
|
588
588
|
}
|
|
589
589
|
ve((j = j.apply(K, [])).next());
|
|
590
590
|
});
|
|
591
591
|
}, He = function(K, we) {
|
|
592
|
-
var V, j,
|
|
593
|
-
if (1 &
|
|
594
|
-
throw
|
|
595
|
-
return
|
|
592
|
+
var V, j, ie, le, ae = { label: 0, sent: function() {
|
|
593
|
+
if (1 & ie[0])
|
|
594
|
+
throw ie[1];
|
|
595
|
+
return ie[1];
|
|
596
596
|
}, trys: [], ops: [] };
|
|
597
597
|
return le = { next: De(0), throw: De(1), return: De(2) }, typeof Symbol == "function" && (le[Symbol.iterator] = function() {
|
|
598
598
|
return this;
|
|
599
599
|
}), le;
|
|
600
600
|
function De(ve) {
|
|
601
|
-
return function(
|
|
601
|
+
return function(pe) {
|
|
602
602
|
return function(Q) {
|
|
603
603
|
if (V)
|
|
604
604
|
throw new TypeError("Generator is already executing.");
|
|
605
605
|
for (; ae; )
|
|
606
606
|
try {
|
|
607
|
-
if (V = 1, j && (
|
|
608
|
-
return
|
|
609
|
-
switch (j = 0,
|
|
607
|
+
if (V = 1, j && (ie = 2 & Q[0] ? j.return : Q[0] ? j.throw || ((ie = j.return) && ie.call(j), 0) : j.next) && !(ie = ie.call(j, Q[1])).done)
|
|
608
|
+
return ie;
|
|
609
|
+
switch (j = 0, ie && (Q = [2 & Q[0], ie.value]), Q[0]) {
|
|
610
610
|
case 0:
|
|
611
611
|
case 1:
|
|
612
|
-
|
|
612
|
+
ie = Q;
|
|
613
613
|
break;
|
|
614
614
|
case 4:
|
|
615
615
|
return ae.label++, { value: Q[1], done: !1 };
|
|
@@ -620,55 +620,55 @@ var Gn = { exports: {} };
|
|
|
620
620
|
Q = ae.ops.pop(), ae.trys.pop();
|
|
621
621
|
continue;
|
|
622
622
|
default:
|
|
623
|
-
if (
|
|
623
|
+
if (ie = ae.trys, !((ie = ie.length > 0 && ie[ie.length - 1]) || Q[0] !== 6 && Q[0] !== 2)) {
|
|
624
624
|
ae = 0;
|
|
625
625
|
continue;
|
|
626
626
|
}
|
|
627
|
-
if (Q[0] === 3 && (!
|
|
627
|
+
if (Q[0] === 3 && (!ie || Q[1] > ie[0] && Q[1] < ie[3])) {
|
|
628
628
|
ae.label = Q[1];
|
|
629
629
|
break;
|
|
630
630
|
}
|
|
631
|
-
if (Q[0] === 6 && ae.label <
|
|
632
|
-
ae.label =
|
|
631
|
+
if (Q[0] === 6 && ae.label < ie[1]) {
|
|
632
|
+
ae.label = ie[1], ie = Q;
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
635
|
-
if (
|
|
636
|
-
ae.label =
|
|
635
|
+
if (ie && ae.label < ie[2]) {
|
|
636
|
+
ae.label = ie[2], ae.ops.push(Q);
|
|
637
637
|
break;
|
|
638
638
|
}
|
|
639
|
-
|
|
639
|
+
ie[2] && ae.ops.pop(), ae.trys.pop();
|
|
640
640
|
continue;
|
|
641
641
|
}
|
|
642
642
|
Q = we.call(K, ae);
|
|
643
643
|
} catch (Fe) {
|
|
644
644
|
Q = [6, Fe], j = 0;
|
|
645
645
|
} finally {
|
|
646
|
-
V =
|
|
646
|
+
V = ie = 0;
|
|
647
647
|
}
|
|
648
648
|
if (5 & Q[0])
|
|
649
649
|
throw Q[1];
|
|
650
650
|
return { value: Q[0] ? Q[1] : void 0, done: !0 };
|
|
651
|
-
}([ve,
|
|
651
|
+
}([ve, pe]);
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
},
|
|
654
|
+
}, Te = function(K) {
|
|
655
655
|
var we, V = { anchor: 0, cdn: I.g.CDN, customEmoji: {}, emojiPath: I.g.CDN + "/dist/images/emoji", hljs: I.g.HLJS_OPTIONS, icon: "ant", lang: "zh_CN", markdown: I.g.MARKDOWN_OPTIONS, math: I.g.MATH_OPTIONS, mode: "light", speech: { enable: !1 }, render: { media: { enable: !0 } }, theme: I.g.THEME_OPTIONS };
|
|
656
656
|
return K.cdn && (!((we = K.theme) === null || we === void 0) && we.path || (V.theme.path = K.cdn + "/dist/css/content-theme"), K.emojiPath || (V.emojiPath = K.cdn + "/dist/images/emoji")), (0, ne.T)(V, K);
|
|
657
657
|
}, Qe = function(K, we) {
|
|
658
|
-
var V =
|
|
658
|
+
var V = Te(we);
|
|
659
659
|
return (0, N.G)(V.cdn + "/dist/js/lute/lute.min.js", "vditorLuteScript").then(function() {
|
|
660
660
|
var j = (0, ge.X)({ autoSpace: V.markdown.autoSpace, gfmAutoLink: V.markdown.gfmAutoLink, codeBlockPreview: V.markdown.codeBlockPreview, emojiSite: V.emojiPath, emojis: V.customEmoji, fixTermTypo: V.markdown.fixTermTypo, footnotes: V.markdown.footnotes, headingAnchor: V.anchor !== 0, inlineMathDigit: V.math.inlineDigit, lazyLoadImage: V.lazyLoadImage, linkBase: V.markdown.linkBase, linkPrefix: V.markdown.linkPrefix, listStyle: V.markdown.listStyle, mark: V.markdown.mark, mathBlockPreview: V.markdown.mathBlockPreview, paragraphBeginningSpace: V.markdown.paragraphBeginningSpace, sanitize: V.markdown.sanitize, toc: V.markdown.toc });
|
|
661
661
|
return we != null && we.renderers && j.SetJSRenderers({ renderers: { Md2HTML: we.renderers } }), j.SetHeadingID(!0), j.Md2HTML(K);
|
|
662
662
|
});
|
|
663
663
|
}, Me = function(K, we, V) {
|
|
664
664
|
return be(void 0, void 0, void 0, function() {
|
|
665
|
-
var j,
|
|
665
|
+
var j, ie, le;
|
|
666
666
|
return He(this, function(ae) {
|
|
667
667
|
switch (ae.label) {
|
|
668
668
|
case 0:
|
|
669
|
-
return j =
|
|
669
|
+
return j = Te(V), [4, Qe(we, j)];
|
|
670
670
|
case 1:
|
|
671
|
-
if (
|
|
671
|
+
if (ie = ae.sent(), j.transform && (ie = j.transform(ie)), K.innerHTML = ie, K.classList.add("vditor-reset"), j.i18n)
|
|
672
672
|
return [3, 5];
|
|
673
673
|
if (["en_US", "fr_FR", "pt_BR", "ja_JP", "ko_KR", "ru_RU", "sv_SE", "zh_CN", "zh_TW"].includes(j.lang))
|
|
674
674
|
return [3, 2];
|
|
@@ -690,16 +690,16 @@ var Gn = { exports: {} };
|
|
|
690
690
|
case 8:
|
|
691
691
|
return (0, W.Z)(j.theme.current, j.theme.path), j.anchor === 1 && K.classList.add("vditor-reset--anchor"), (0, y.O)(K, j.hljs), (0, f.s)(j.hljs, K, j.cdn), (0, L.H)(K, { cdn: j.cdn, math: j.math }), (0, T.i)(K, j.cdn, j.mode), (0, E.K)(K, j.cdn, j.mode), (0, s.P)(K, j.cdn), (0, u.v)(K, j.cdn), (0, l.p)(K, j.cdn, j.mode), (0, k.P)(K, j.cdn, j.mode), (0, x.B)(K, j.cdn), (0, c.Q)(K, j.cdn), j.render.media.enable && (0, S.Y)(K), j.speech.enable && de(K), j.anchor !== 0 && (De = j.anchor, document.querySelectorAll(".vditor-anchor").forEach(function(ve) {
|
|
692
692
|
De === 1 && ve.classList.add("vditor-anchor--left"), ve.onclick = function() {
|
|
693
|
-
var
|
|
693
|
+
var pe = ve.getAttribute("href").substr(1), Q = document.getElementById("vditorAnchor-" + pe).offsetTop;
|
|
694
694
|
document.querySelector("html").scrollTop = Q;
|
|
695
695
|
};
|
|
696
696
|
}), window.onhashchange = function() {
|
|
697
697
|
var ve = document.getElementById("vditorAnchor-" + decodeURIComponent(window.location.hash.substr(1)));
|
|
698
698
|
ve && (document.querySelector("html").scrollTop = ve.offsetTop);
|
|
699
699
|
}), j.after && j.after(), j.lazyLoadImage && w(K), K.addEventListener("click", function(ve) {
|
|
700
|
-
var
|
|
701
|
-
if (
|
|
702
|
-
var Q = K.querySelector("#" +
|
|
700
|
+
var pe = (0, Z.lG)(ve.target, "SPAN");
|
|
701
|
+
if (pe && (0, Z.fb)(pe, "vditor-toc")) {
|
|
702
|
+
var Q = K.querySelector("#" + pe.getAttribute("data-target-id"));
|
|
703
703
|
Q && window.scrollTo(window.scrollX, Q.offsetTop);
|
|
704
704
|
}
|
|
705
705
|
}), [2];
|
|
@@ -891,16 +891,16 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
891
891
|
var L = window.markmap, S = L.Transformer, T = L.Markmap, E = L.deriveOptions, k = (L.globalCSS, new S());
|
|
892
892
|
f.innerHTML = '<svg style="width:100%"></svg>';
|
|
893
893
|
var p = f.firstChild, x = T.create(p, null), I = function(ne, ge) {
|
|
894
|
-
var
|
|
894
|
+
var ue = ne.transform(ge), de = Object.keys(ue.features).filter(function(Me) {
|
|
895
895
|
return !y[Me];
|
|
896
896
|
});
|
|
897
897
|
de.forEach(function(Me) {
|
|
898
898
|
y[Me] = !0;
|
|
899
899
|
});
|
|
900
|
-
var be = ne.getAssets(de), He = be.styles,
|
|
901
|
-
return He && Qe.loadCSS(He),
|
|
902
|
-
}(k, w), W = I.root, N = I.frontmatter,
|
|
903
|
-
x.setData(W,
|
|
900
|
+
var be = ne.getAssets(de), He = be.styles, Te = be.scripts, Qe = window.markmap;
|
|
901
|
+
return He && Qe.loadCSS(He), Te && Qe.loadJS(Te), ue;
|
|
902
|
+
}(k, w), W = I.root, N = I.frontmatter, Z = E(N == null ? void 0 : N.markmap);
|
|
903
|
+
x.setData(W, Z), x.fit();
|
|
904
904
|
}, u = function(f, w, L) {
|
|
905
905
|
w === void 0 && (w = c.g.CDN);
|
|
906
906
|
var S = l.markmapRenderAdapter.getElements(f);
|
|
@@ -962,8 +962,8 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
962
962
|
(function(x) {
|
|
963
963
|
if (x.length !== 0) {
|
|
964
964
|
var I = 0, W = x[x.length - 1], N = function() {
|
|
965
|
-
var
|
|
966
|
-
|
|
965
|
+
var Z = x[I++];
|
|
966
|
+
Z === W ? Z() : Z(N);
|
|
967
967
|
};
|
|
968
968
|
N();
|
|
969
969
|
}
|
|
@@ -1000,16 +1000,16 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1000
1000
|
src="https://www.dailymotion.com/embed/video/` + k[2] + '"></iframe>'), u.remove();
|
|
1001
1001
|
else if (f.indexOf("bilibili.com") > -1 && (f.indexOf("bvid=") > -1 || p && p[1])) {
|
|
1002
1002
|
var I = { bvid: (0, c.o)("bvid", f) || p && p[1], page: "1", high_quality: "1", as_wide: "1", allowfullscreen: "true", autoplay: "0" };
|
|
1003
|
-
new URL(f.startsWith("http") ? f : "https:" + f).search.split("&").forEach(function(
|
|
1004
|
-
if (
|
|
1005
|
-
ne === 0 && (
|
|
1006
|
-
var ge =
|
|
1003
|
+
new URL(f.startsWith("http") ? f : "https:" + f).search.split("&").forEach(function(Z, ne) {
|
|
1004
|
+
if (Z) {
|
|
1005
|
+
ne === 0 && (Z = Z.substr(1));
|
|
1006
|
+
var ge = Z.split("=");
|
|
1007
1007
|
I[ge[0]] = ge[1];
|
|
1008
1008
|
}
|
|
1009
1009
|
});
|
|
1010
1010
|
var W = "https://player.bilibili.com/player.html?", N = Object.keys(I);
|
|
1011
|
-
N.forEach(function(
|
|
1012
|
-
W +=
|
|
1011
|
+
N.forEach(function(Z, ne) {
|
|
1012
|
+
W += Z + "=" + I[Z], ne < N.length - 1 && (W += "&");
|
|
1013
1013
|
}), u.insertAdjacentHTML("afterend", '<iframe class="iframe__video" src="' + W + '"></iframe>'), u.remove();
|
|
1014
1014
|
} else
|
|
1015
1015
|
x && x[1] && (u.insertAdjacentHTML("afterend", '<iframe class="iframe__video" src="//embed.ted.com/talks/' + x[1] + '"></iframe>'), u.remove());
|
|
@@ -1036,8 +1036,8 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1036
1036
|
}
|
|
1037
1037
|
function I(W) {
|
|
1038
1038
|
var N;
|
|
1039
|
-
W.done ? E(W.value) : (N = W.value, N instanceof S ? N : new S(function(
|
|
1040
|
-
|
|
1039
|
+
W.done ? E(W.value) : (N = W.value, N instanceof S ? N : new S(function(Z) {
|
|
1040
|
+
Z(N);
|
|
1041
1041
|
})).then(p, x);
|
|
1042
1042
|
}
|
|
1043
1043
|
I((T = T.apply(w, [])).next());
|
|
@@ -1094,8 +1094,8 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1094
1094
|
continue;
|
|
1095
1095
|
}
|
|
1096
1096
|
N = L.call(w, p);
|
|
1097
|
-
} catch (
|
|
1098
|
-
N = [6,
|
|
1097
|
+
} catch (Z) {
|
|
1098
|
+
N = [6, Z], T = 0;
|
|
1099
1099
|
} finally {
|
|
1100
1100
|
S = E = 0;
|
|
1101
1101
|
}
|
|
@@ -1113,18 +1113,18 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1113
1113
|
S === "dark" && (E.theme = "dark"), mermaid.initialize(E), T.forEach(function(k) {
|
|
1114
1114
|
return s(void 0, void 0, void 0, function() {
|
|
1115
1115
|
var p, x, I, W, N;
|
|
1116
|
-
return u(this, function(
|
|
1117
|
-
switch (
|
|
1116
|
+
return u(this, function(Z) {
|
|
1117
|
+
switch (Z.label) {
|
|
1118
1118
|
case 0:
|
|
1119
1119
|
if (p = l.mermaidRenderAdapter.getCode(k), k.getAttribute("data-processed") === "true" || p.trim() === "")
|
|
1120
1120
|
return [2];
|
|
1121
|
-
x = "mermaid" + (0, y.W)(),
|
|
1121
|
+
x = "mermaid" + (0, y.W)(), Z.label = 1;
|
|
1122
1122
|
case 1:
|
|
1123
|
-
return
|
|
1123
|
+
return Z.trys.push([1, 3, , 4]), [4, mermaid.render(x, k.textContent)];
|
|
1124
1124
|
case 2:
|
|
1125
|
-
return I =
|
|
1125
|
+
return I = Z.sent(), k.innerHTML = I.svg, [3, 4];
|
|
1126
1126
|
case 3:
|
|
1127
|
-
return W =
|
|
1127
|
+
return W = Z.sent(), N = document.querySelector("#" + x), k.innerHTML = N.outerHTML + `<br>
|
|
1128
1128
|
<div style="text-align: left"><small>` + W.message.replace(/\n/, "<br>") + "</small></div>", N.parentElement.remove(), [3, 4];
|
|
1129
1129
|
case 4:
|
|
1130
1130
|
return k.setAttribute("data-processed", "true"), [2];
|
|
@@ -1454,9 +1454,9 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1454
1454
|
} else
|
|
1455
1455
|
p = k.startContainer.getClientRects()[0];
|
|
1456
1456
|
if (!p) {
|
|
1457
|
-
for (var
|
|
1458
|
-
|
|
1459
|
-
p =
|
|
1457
|
+
for (var Z = k.startContainer.childNodes[k.startOffset]; !Z.getClientRects || Z.getClientRects && Z.getClientRects().length === 0; )
|
|
1458
|
+
Z = Z.parentElement;
|
|
1459
|
+
p = Z.getClientRects()[0];
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
else
|
|
@@ -1486,18 +1486,18 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1486
1486
|
}
|
|
1487
1487
|
return x;
|
|
1488
1488
|
}, L = function(E, k, p) {
|
|
1489
|
-
var x = 0, I = 0, W = p.childNodes[I], N = !1,
|
|
1489
|
+
var x = 0, I = 0, W = p.childNodes[I], N = !1, Z = !1;
|
|
1490
1490
|
E = Math.max(0, E), k = Math.max(0, k);
|
|
1491
1491
|
var ne = p.ownerDocument.createRange();
|
|
1492
|
-
for (ne.setStart(W || p, 0), ne.collapse(!0); !
|
|
1492
|
+
for (ne.setStart(W || p, 0), ne.collapse(!0); !Z && W; ) {
|
|
1493
1493
|
var ge = x + W.textContent.length;
|
|
1494
1494
|
if (!N && E >= x && E <= ge && (E === 0 ? ne.setStart(W, 0) : W.childNodes[0].nodeType === 3 ? ne.setStart(W.childNodes[0], E - x) : W.nextSibling ? ne.setStartBefore(W.nextSibling) : ne.setStartAfter(W), N = !0, E === k)) {
|
|
1495
|
-
|
|
1495
|
+
Z = !0;
|
|
1496
1496
|
break;
|
|
1497
1497
|
}
|
|
1498
|
-
N && k >= x && k <= ge && (k === 0 ? ne.setEnd(W, 0) : W.childNodes[0].nodeType === 3 ? ne.setEnd(W.childNodes[0], k - x) : W.nextSibling ? ne.setEndBefore(W.nextSibling) : ne.setEndAfter(W),
|
|
1498
|
+
N && k >= x && k <= ge && (k === 0 ? ne.setEnd(W, 0) : W.childNodes[0].nodeType === 3 ? ne.setEnd(W.childNodes[0], k - x) : W.nextSibling ? ne.setEndBefore(W.nextSibling) : ne.setEndAfter(W), Z = !0), x = ge, W = p.childNodes[++I];
|
|
1499
1499
|
}
|
|
1500
|
-
return !
|
|
1500
|
+
return !Z && p.childNodes[I - 1] && ne.setStartBefore(p.childNodes[I - 1]), f(ne), ne;
|
|
1501
1501
|
}, S = function(E, k) {
|
|
1502
1502
|
var p = E.querySelector("wbr");
|
|
1503
1503
|
if (p) {
|
|
@@ -1525,32 +1525,32 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1525
1525
|
var N = (0, l.F9)(W.startContainer);
|
|
1526
1526
|
N ? N.insertAdjacentHTML("afterend", I.innerHTML) : k[k.currentMode].element.insertAdjacentHTML("beforeend", I.innerHTML), S(k[k.currentMode].element, W);
|
|
1527
1527
|
} else {
|
|
1528
|
-
var
|
|
1529
|
-
|
|
1528
|
+
var Z = document.createElement("template");
|
|
1529
|
+
Z.innerHTML = E, W.insertNode(Z.content.cloneNode(!0)), W.collapse(!1), f(W);
|
|
1530
1530
|
}
|
|
1531
1531
|
};
|
|
1532
|
-
} },
|
|
1533
|
-
function
|
|
1534
|
-
var _ =
|
|
1532
|
+
} }, ye = {};
|
|
1533
|
+
function X($) {
|
|
1534
|
+
var _ = ye[$];
|
|
1535
1535
|
if (_ !== void 0)
|
|
1536
1536
|
return _.exports;
|
|
1537
|
-
var b =
|
|
1538
|
-
return
|
|
1537
|
+
var b = ye[$] = { exports: {} };
|
|
1538
|
+
return fe[$](b, b.exports, X), b.exports;
|
|
1539
1539
|
}
|
|
1540
|
-
|
|
1540
|
+
X.d = ($, _) => {
|
|
1541
1541
|
for (var b in _)
|
|
1542
|
-
|
|
1543
|
-
},
|
|
1542
|
+
X.o(_, b) && !X.o($, b) && Object.defineProperty($, b, { enumerable: !0, get: _[b] });
|
|
1543
|
+
}, X.o = ($, _) => Object.prototype.hasOwnProperty.call($, _), X.r = ($) => {
|
|
1544
1544
|
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty($, Symbol.toStringTag, { value: "Module" }), Object.defineProperty($, "__esModule", { value: !0 });
|
|
1545
1545
|
};
|
|
1546
|
-
var
|
|
1546
|
+
var he = {};
|
|
1547
1547
|
return (() => {
|
|
1548
|
-
|
|
1549
|
-
var $, _ =
|
|
1548
|
+
X.d(he, { default: () => gi });
|
|
1549
|
+
var $, _ = X(872), b = X(54), c = X(51), m = function(e) {
|
|
1550
1550
|
return e.currentMode === "sv" ? (0, c.X)((e.sv.element.textContent + `
|
|
1551
1551
|
`).replace(/\n\n$/, `
|
|
1552
1552
|
`)) : e.currentMode === "wysiwyg" ? e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML) : e.currentMode === "ir" ? e.lute.VditorIRDOM2Md(e.ir.element.innerHTML) : "";
|
|
1553
|
-
}, l =
|
|
1553
|
+
}, l = X(526), y = function() {
|
|
1554
1554
|
function e() {
|
|
1555
1555
|
this.element = document.createElement("div"), this.element.className = "vditor-devtools", this.element.innerHTML = '<div class="vditor-reset--error"></div><div style="height: 100%;"></div>';
|
|
1556
1556
|
}
|
|
@@ -1565,7 +1565,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1565
1565
|
}
|
|
1566
1566
|
});
|
|
1567
1567
|
}, e;
|
|
1568
|
-
}(), s =
|
|
1568
|
+
}(), s = X(794), u = function(e, t) {
|
|
1569
1569
|
t.forEach(function(n) {
|
|
1570
1570
|
if (e[n]) {
|
|
1571
1571
|
var i = e[n].children[0];
|
|
@@ -1611,19 +1611,19 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1611
1611
|
o.classList.remove("vditor-hint--current");
|
|
1612
1612
|
}), t.style.display === "block" ? t.style.display = "none" : (E(e, ["subToolbar", "hint", "popover"], n.parentElement.parentElement), n.classList.contains("vditor-tooltipped") || n.classList.add("vditor-hint--current"), t.style.display = "block", e.toolbar.element.getBoundingClientRect().right - n.getBoundingClientRect().right < 250 ? t.classList.add("vditor-panel--left") : t.classList.remove("vditor-panel--left")));
|
|
1613
1613
|
});
|
|
1614
|
-
}, p =
|
|
1614
|
+
}, p = X(827), x = X(64), I = function(e, t, n, i) {
|
|
1615
1615
|
i && console.log(e + " - " + n + ": " + t);
|
|
1616
|
-
}, W =
|
|
1616
|
+
}, W = X(478), N = X(314), Z = X(730), ne = X(66), ge = X(218), ue = X(702), de = X(466), be = X(40), He = X(563), Te = X(749), Qe = X(408), Me = function(e, t) {
|
|
1617
1617
|
if (e)
|
|
1618
1618
|
if (e.parentElement.getAttribute("data-type") !== "html-block") {
|
|
1619
1619
|
var n = e.firstElementChild.className.replace("language-", "");
|
|
1620
|
-
n === "abc" ? (0, W.Q)(e, t.options.cdn) : n === "mermaid" ? (0, be.i)(e, t.options.cdn, t.options.theme) : n === "markmap" ? (0, He.K)(e, t.options.cdn, t.options.theme) : n === "flowchart" ? (0, ne.P)(e, t.options.cdn) : n === "echarts" ? (0, N.p)(e, t.options.cdn, t.options.theme) : n === "mindmap" ? (0,
|
|
1620
|
+
n === "abc" ? (0, W.Q)(e, t.options.cdn) : n === "mermaid" ? (0, be.i)(e, t.options.cdn, t.options.theme) : n === "markmap" ? (0, He.K)(e, t.options.cdn, t.options.theme) : n === "flowchart" ? (0, ne.P)(e, t.options.cdn) : n === "echarts" ? (0, N.p)(e, t.options.cdn, t.options.theme) : n === "mindmap" ? (0, Te.P)(e, t.options.cdn, t.options.theme) : n === "plantuml" ? (0, Qe.B)(e, t.options.cdn) : n === "graphviz" ? (0, ge.v)(e, t.options.cdn) : n === "math" ? (0, de.H)(e, { cdn: t.options.cdn, math: t.options.preview.math }) : t.options.customRenders.find(function(i) {
|
|
1621
1621
|
if (i.language === n)
|
|
1622
1622
|
return i.render(e, t), !0;
|
|
1623
|
-
}) || ((0,
|
|
1623
|
+
}) || ((0, ue.s)(Object.assign({}, t.options.preview.hljs), e, t.options.cdn), (0, Z.O)(e, t.options.preview.hljs)), e.setAttribute("data-render", "1");
|
|
1624
1624
|
} else
|
|
1625
1625
|
e.setAttribute("data-render", "1");
|
|
1626
|
-
}, C =
|
|
1626
|
+
}, C = X(393), Ke = function(e) {
|
|
1627
1627
|
if (e.currentMode !== "sv") {
|
|
1628
1628
|
var t = e[e.currentMode].element, n = e.outline.render(e);
|
|
1629
1629
|
n === "" && (n = "[ToC]"), t.querySelectorAll('[data-type="toc-block"]').forEach(function(i) {
|
|
@@ -1645,7 +1645,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1645
1645
|
if (e.previousElementSibling && e.previousElementSibling.classList.contains("vditor-toc")) {
|
|
1646
1646
|
if (n.key === "Backspace" && (0, C.im)(e, t[t.currentMode].element, i).start === 0)
|
|
1647
1647
|
return e.previousElementSibling.remove(), se(t), !0;
|
|
1648
|
-
if (
|
|
1648
|
+
if (st(t, n, i, e, e.previousElementSibling))
|
|
1649
1649
|
return !0;
|
|
1650
1650
|
}
|
|
1651
1651
|
if (e.nextElementSibling && e.nextElementSibling.classList.contains("vditor-toc")) {
|
|
@@ -1663,7 +1663,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1663
1663
|
n === void 0 && (n = !1);
|
|
1664
1664
|
var r = (0, p.F9)(t.startContainer);
|
|
1665
1665
|
if (r && !n && r.getAttribute("data-type") !== "code-block") {
|
|
1666
|
-
if (
|
|
1666
|
+
if (Kt(r.innerHTML) && r.previousElementSibling || Gt(r.innerHTML))
|
|
1667
1667
|
return;
|
|
1668
1668
|
for (var o = (0, C.im)(r, e.ir.element, t).start, a = !0, d = o - 1; d > r.textContent.substr(0, o).lastIndexOf(`
|
|
1669
1669
|
`); d--)
|
|
@@ -1720,13 +1720,13 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1720
1720
|
te && te.setAttribute("aria-label", H.substr(F.length + 3).trim().substr(0, 24));
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
|
-
var
|
|
1723
|
+
var J, ee = e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");
|
|
1724
1724
|
ee.forEach(function(G, re) {
|
|
1725
1725
|
re === 0 ? A = G : (A.insertAdjacentHTML("beforeend", G.innerHTML), G.remove());
|
|
1726
1726
|
}), ee.length > 0 && e.ir.element.insertAdjacentElement("beforeend", ee[0]);
|
|
1727
1727
|
var Y = e.ir.element.querySelectorAll("[data-type='footnotes-block']");
|
|
1728
1728
|
Y.forEach(function(G, re) {
|
|
1729
|
-
re === 0 ?
|
|
1729
|
+
re === 0 ? J = G : (J.insertAdjacentHTML("beforeend", G.innerHTML), G.remove());
|
|
1730
1730
|
}), Y.length > 0 && e.ir.element.insertAdjacentElement("beforeend", Y[0]), (0, C.ib)(e.ir.element, t), e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(G) {
|
|
1731
1731
|
Me(G, e);
|
|
1732
1732
|
}), Ke(e), $e(e, { enableAddUndoStack: !0, enableHint: !0, enableInput: !0 });
|
|
@@ -1777,7 +1777,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1777
1777
|
}(e);
|
|
1778
1778
|
return o ? (o.classList.add("vditor-ir__node--expand"), void o.classList.remove("vditor-ir__node--hidden")) : void 0;
|
|
1779
1779
|
}
|
|
1780
|
-
},
|
|
1780
|
+
}, ie = X(863), le = function(e, t) {
|
|
1781
1781
|
e.querySelectorAll("[data-type=footnotes-link]").forEach(function(n) {
|
|
1782
1782
|
for (var i = n.parentElement, r = i.nextSibling; r && r.textContent.startsWith(" "); ) {
|
|
1783
1783
|
var o = r;
|
|
@@ -1851,11 +1851,11 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1851
1851
|
e.sv.element.insertAdjacentElement("beforeend", D.parentElement);
|
|
1852
1852
|
}), le(e.sv.element, function(D) {
|
|
1853
1853
|
e.sv.element.insertAdjacentElement("beforeend", D);
|
|
1854
|
-
}), (0, C.ib)(e.sv.element, i),
|
|
1854
|
+
}), (0, C.ib)(e.sv.element, i), Ce(e), Ne(e, { enableAddUndoStack: !0, enableHint: !0, enableInput: !0 });
|
|
1855
1855
|
}
|
|
1856
|
-
}, De =
|
|
1856
|
+
}, De = X(227), ve = function(e) {
|
|
1857
1857
|
e.options.theme === "dark" ? e.element.classList.add("vditor--dark") : e.element.classList.remove("vditor--dark");
|
|
1858
|
-
},
|
|
1858
|
+
}, pe = function(e) {
|
|
1859
1859
|
var t = window.innerWidth <= b.g.MOBILE_WIDTH ? 10 : 35;
|
|
1860
1860
|
if (e.wysiwyg.element.parentElement.style.display !== "none") {
|
|
1861
1861
|
var n = (e.wysiwyg.element.parentElement.clientWidth - e.options.preview.maxWidth) / 2;
|
|
@@ -1871,9 +1871,9 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1871
1871
|
function Fe() {
|
|
1872
1872
|
window.removeEventListener("resize", $);
|
|
1873
1873
|
}
|
|
1874
|
-
var
|
|
1874
|
+
var et, en, Fn = function(e) {
|
|
1875
1875
|
Q(e), Fe(), window.addEventListener("resize", $ = function() {
|
|
1876
|
-
|
|
1876
|
+
pe(e), Q(e);
|
|
1877
1877
|
});
|
|
1878
1878
|
var t = (0, s.pK)() && localStorage.getItem(e.options.cache.id);
|
|
1879
1879
|
return e.options.cache.enable && t || (e.options.value ? t = e.options.value : e.originalInnerHTML ? t = e.lute.HTML2Md(e.originalInnerHTML) : e.options.cache.enable || (t = "")), t || "";
|
|
@@ -1916,19 +1916,19 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1916
1916
|
}, St = function(e, t) {
|
|
1917
1917
|
var n = (0, C.zh)(e), i = (0, p.F9)(n.startContainer);
|
|
1918
1918
|
i || (i = n.startContainer.childNodes[n.startOffset]), i || e.wysiwyg.element.children.length !== 0 || (i = e.wysiwyg.element), i && !i.classList.contains("vditor-wysiwyg__block") && (n.insertNode(document.createElement("wbr")), i.innerHTML.trim() === "<wbr>" && (i.innerHTML = "<wbr><br>"), i.tagName === "BLOCKQUOTE" || i.classList.contains("vditor-reset") ? i.innerHTML = "<" + t + ' data-block="0">' + i.innerHTML.trim() + "</" + t + ">" : i.outerHTML = "<" + t + ' data-block="0">' + i.innerHTML.trim() + "</" + t + ">", (0, C.ib)(e.wysiwyg.element, n), Ke(e));
|
|
1919
|
-
},
|
|
1919
|
+
}, Ot = function(e) {
|
|
1920
1920
|
var t = getSelection().getRangeAt(0), n = (0, p.F9)(t.startContainer);
|
|
1921
1921
|
n || (n = t.startContainer.childNodes[t.startOffset]), n && (t.insertNode(document.createElement("wbr")), n.outerHTML = '<p data-block="0">' + n.innerHTML + "</p>", (0, C.ib)(e.wysiwyg.element, t)), e.wysiwyg.popover.style.display = "none";
|
|
1922
1922
|
}, ft = function(e, t, n) {
|
|
1923
1923
|
n === void 0 && (n = !0);
|
|
1924
1924
|
var i = e.previousElementSibling, r = i.ownerDocument.createRange();
|
|
1925
|
-
i.tagName === "CODE" ? (i.style.display = "inline-block", n ? r.setStart(i.firstChild, 1) : r.selectNodeContents(i)) : (i.style.display = "block", i.firstChild.firstChild || i.firstChild.appendChild(document.createTextNode("")), r.selectNodeContents(i.firstChild)), n ? r.collapse(!0) : r.collapse(!1), (0, C.Hc)(r), e.firstElementChild.classList.contains("language-mindmap") ||
|
|
1925
|
+
i.tagName === "CODE" ? (i.style.display = "inline-block", n ? r.setStart(i.firstChild, 1) : r.selectNodeContents(i)) : (i.style.display = "block", i.firstChild.firstChild || i.firstChild.appendChild(document.createTextNode("")), r.selectNodeContents(i.firstChild)), n ? r.collapse(!0) : r.collapse(!1), (0, C.Hc)(r), e.firstElementChild.classList.contains("language-mindmap") || Ce(t);
|
|
1926
1926
|
}, Ie = function(e, t) {
|
|
1927
1927
|
if (V("⇧⌘X", t)) {
|
|
1928
1928
|
var n = e.wysiwyg.popover.querySelector('[data-type="remove"]');
|
|
1929
1929
|
return n && n.click(), t.preventDefault(), !0;
|
|
1930
1930
|
}
|
|
1931
|
-
},
|
|
1931
|
+
}, tt = function(e) {
|
|
1932
1932
|
clearTimeout(e.wysiwyg.hlToolbarTimeoutId), e.wysiwyg.hlToolbarTimeoutId = window.setTimeout(function() {
|
|
1933
1933
|
if (e.wysiwyg.element.getAttribute("contenteditable") !== "false" && (0, C.Gb)(e.wysiwyg.element)) {
|
|
1934
1934
|
u(e.toolbar.elements, b.g.EDIT_TOOLBARS), w(e.toolbar.elements, b.g.EDIT_TOOLBARS);
|
|
@@ -1936,7 +1936,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1936
1936
|
n = t.startContainer.nodeType === 3 ? t.startContainer.parentElement : n.childNodes[t.startOffset >= n.childNodes.length ? n.childNodes.length - 1 : t.startOffset];
|
|
1937
1937
|
var i = (0, p.a1)(n, "data-type", "footnotes-block");
|
|
1938
1938
|
if (i)
|
|
1939
|
-
return e.wysiwyg.popover.innerHTML = "",
|
|
1939
|
+
return e.wysiwyg.popover.innerHTML = "", qe(i, e), void Pe(e, i);
|
|
1940
1940
|
var r = (0, p.lG)(n, "LI");
|
|
1941
1941
|
r ? (r.classList.contains("vditor-task") ? f(e.toolbar.elements, ["check"]) : r.parentElement.tagName === "OL" ? f(e.toolbar.elements, ["ordered-list"]) : r.parentElement.tagName === "UL" && f(e.toolbar.elements, ["list"]), w(e.toolbar.elements, ["outdent", "indent"])) : L(e.toolbar.elements, ["outdent", "indent"]), (0, p.lG)(n, "BLOCKQUOTE") && f(e.toolbar.elements, ["quote"]), ((0, p.lG)(n, "B") || (0, p.lG)(n, "STRONG")) && f(e.toolbar.elements, ["bold"]), ((0, p.lG)(n, "I") || (0, p.lG)(n, "EM")) && f(e.toolbar.elements, ["italic"]), ((0, p.lG)(n, "STRIKE") || (0, p.lG)(n, "S")) && f(e.toolbar.elements, ["strike"]), e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(z) {
|
|
1942
1942
|
z.classList.remove("vditor-comment--focus");
|
|
@@ -1961,31 +1961,31 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
1961
1961
|
(0, p.lG)(n, "CODE") ? (0, p.lG)(n, "PRE") ? (L(e.toolbar.elements, ["headings", "bold", "italic", "strike", "line", "quote", "list", "ordered-list", "check", "code", "inline-code", "upload", "link", "table", "record"]), f(e.toolbar.elements, ["code"])) : (L(e.toolbar.elements, ["headings", "bold", "italic", "strike", "line", "quote", "list", "ordered-list", "check", "code", "upload", "link", "table", "record"]), f(e.toolbar.elements, ["inline-code"])) : h ? (L(e.toolbar.elements, ["bold"]), f(e.toolbar.elements, ["headings"])) : g && L(e.toolbar.elements, ["table"]);
|
|
1962
1962
|
var A = (0, p.fb)(n, "vditor-toc");
|
|
1963
1963
|
if (A)
|
|
1964
|
-
return e.wysiwyg.popover.innerHTML = "",
|
|
1964
|
+
return e.wysiwyg.popover.innerHTML = "", qe(A, e), void Pe(e, A);
|
|
1965
1965
|
var O = (0, x.S)(n, "BLOCKQUOTE");
|
|
1966
|
-
if (O && (e.wysiwyg.popover.innerHTML = "",
|
|
1966
|
+
if (O && (e.wysiwyg.popover.innerHTML = "", it(t, O, e), ot(t, O, e), qe(O, e), Pe(e, O)), r && (e.wysiwyg.popover.innerHTML = "", it(t, r, e), ot(t, r, e), qe(r, e), Pe(e, r)), g) {
|
|
1967
1967
|
e.options.lang, e.options, e.wysiwyg.popover.innerHTML = "";
|
|
1968
1968
|
var U = function() {
|
|
1969
|
-
var z = g.rows.length, Se = g.rows[0].cells.length,
|
|
1970
|
-
if (
|
|
1969
|
+
var z = g.rows.length, Se = g.rows[0].cells.length, rt = parseInt(re.value, 10) || z, Je = parseInt(Le.value, 10) || Se;
|
|
1970
|
+
if (rt !== z || Se !== Je) {
|
|
1971
1971
|
if (Se !== Je)
|
|
1972
|
-
for (var Pn = Je - Se,
|
|
1972
|
+
for (var Pn = Je - Se, dt = 0; dt < g.rows.length; dt++)
|
|
1973
1973
|
if (Pn > 0)
|
|
1974
1974
|
for (var qn = 0; qn < Pn; qn++)
|
|
1975
|
-
|
|
1975
|
+
dt === 0 ? g.rows[dt].lastElementChild.insertAdjacentHTML("afterend", "<th> </th>") : g.rows[dt].lastElementChild.insertAdjacentHTML("afterend", "<td> </td>");
|
|
1976
1976
|
else
|
|
1977
|
-
for (var
|
|
1978
|
-
g.rows[
|
|
1979
|
-
if (z !==
|
|
1980
|
-
var Bn =
|
|
1977
|
+
for (var Zt = Se - 1; Zt >= Je; Zt--)
|
|
1978
|
+
g.rows[dt].cells[Zt].remove();
|
|
1979
|
+
if (z !== rt) {
|
|
1980
|
+
var Bn = rt - z;
|
|
1981
1981
|
if (Bn > 0) {
|
|
1982
|
-
for (var
|
|
1983
|
-
|
|
1982
|
+
for (var Jt = "<tr>", ut = 0; ut < Je; ut++)
|
|
1983
|
+
Jt += "<td> </td>";
|
|
1984
1984
|
for (var Vn = 0; Vn < Bn; Vn++)
|
|
1985
|
-
g.querySelector("tbody") ? g.querySelector("tbody").insertAdjacentHTML("beforeend",
|
|
1985
|
+
g.querySelector("tbody") ? g.querySelector("tbody").insertAdjacentHTML("beforeend", Jt) : g.querySelector("thead").insertAdjacentHTML("afterend", Jt + "</tr>");
|
|
1986
1986
|
} else
|
|
1987
|
-
for (
|
|
1988
|
-
g.rows[
|
|
1987
|
+
for (ut = z - 1; ut >= rt; ut--)
|
|
1988
|
+
g.rows[ut].remove(), g.rows.length === 1 && g.querySelector("tbody").remove();
|
|
1989
1989
|
}
|
|
1990
1990
|
typeof e.options.input == "function" && e.options.input(m(e));
|
|
1991
1991
|
}
|
|
@@ -2015,8 +2015,8 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2015
2015
|
var z = getSelection().getRangeAt(0).startContainer, Se = (0, p.lG)(z, "TD") || (0, p.lG)(z, "TH");
|
|
2016
2016
|
Se && En(e, t, Se);
|
|
2017
2017
|
};
|
|
2018
|
-
var
|
|
2019
|
-
|
|
2018
|
+
var J = document.createElement("button");
|
|
2019
|
+
J.setAttribute("type", "button"), J.setAttribute("aria-label", window.VditorI18n.insertColumnRight + "<" + (0, s.ns)("⇧⌘=") + ">"), J.setAttribute("data-type", "insertColumn"), J.innerHTML = '<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>', J.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", J.onclick = function() {
|
|
2020
2020
|
var z = getSelection().getRangeAt(0).startContainer, Se = (0, p.lG)(z, "TD") || (0, p.lG)(z, "TH");
|
|
2021
2021
|
Se && At(e, g, Se);
|
|
2022
2022
|
};
|
|
@@ -2034,9 +2034,9 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2034
2034
|
G.setAttribute("type", "button"), G.setAttribute("aria-label", window.VditorI18n["delete-column"] + "<" + (0, s.ns)("⇧⌘-") + ">"), G.setAttribute("data-type", "deleteColumn"), G.innerHTML = '<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>', G.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", G.onclick = function() {
|
|
2035
2035
|
var z = getSelection().getRangeAt(0).startContainer, Se = (0, p.lG)(z, "TD") || (0, p.lG)(z, "TH");
|
|
2036
2036
|
Se && Sn(e, t, g, Se);
|
|
2037
|
-
}, (
|
|
2037
|
+
}, (Be = document.createElement("span")).setAttribute("aria-label", window.VditorI18n.row), Be.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
2038
2038
|
var re = document.createElement("input");
|
|
2039
|
-
|
|
2039
|
+
Be.appendChild(re), re.type = "number", re.min = "1", re.className = "vditor-input", re.style.width = "42px", re.style.textAlign = "center", re.setAttribute("placeholder", window.VditorI18n.row), re.value = g.rows.length.toString(), re.oninput = function() {
|
|
2040
2040
|
U();
|
|
2041
2041
|
}, re.onkeydown = function(z) {
|
|
2042
2042
|
if (!z.isComposing)
|
|
@@ -2050,32 +2050,32 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2050
2050
|
}, Le.onkeydown = function(z) {
|
|
2051
2051
|
if (!z.isComposing)
|
|
2052
2052
|
return z.key === "Tab" ? (re.focus(), re.select(), void z.preventDefault()) : void (Ie(e, z) || Ge(z, t));
|
|
2053
|
-
},
|
|
2053
|
+
}, it(t, g, e), ot(t, g, e), qe(g, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", B), e.wysiwyg.popover.insertAdjacentElement("beforeend", P), e.wysiwyg.popover.insertAdjacentElement("beforeend", H), e.wysiwyg.popover.insertAdjacentElement("beforeend", te), e.wysiwyg.popover.insertAdjacentElement("beforeend", F), e.wysiwyg.popover.insertAdjacentElement("beforeend", ee), e.wysiwyg.popover.insertAdjacentElement("beforeend", J), e.wysiwyg.popover.insertAdjacentElement("beforeend", Y), e.wysiwyg.popover.insertAdjacentElement("beforeend", G), e.wysiwyg.popover.insertAdjacentElement("beforeend", Be), e.wysiwyg.popover.insertAdjacentHTML("beforeend", " x "), e.wysiwyg.popover.insertAdjacentElement("beforeend", Ee), Pe(e, g);
|
|
2054
2054
|
}
|
|
2055
2055
|
var Ze = (0, p.a1)(n, "data-type", "link-ref");
|
|
2056
2056
|
Ze && on(e, Ze, t);
|
|
2057
2057
|
var je = (0, p.a1)(n, "data-type", "footnotes-ref");
|
|
2058
2058
|
if (je) {
|
|
2059
|
-
e.options.lang, e.options, e.wysiwyg.popover.innerHTML = "", (
|
|
2059
|
+
e.options.lang, e.options, e.wysiwyg.popover.innerHTML = "", (Be = document.createElement("span")).setAttribute("aria-label", window.VditorI18n.footnoteRef + "<" + (0, s.ns)("⌥Enter") + ">"), Be.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
2060
2060
|
var Re = document.createElement("input");
|
|
2061
|
-
|
|
2061
|
+
Be.appendChild(Re), Re.className = "vditor-input", Re.setAttribute("placeholder", window.VditorI18n.footnoteRef + "<" + (0, s.ns)("⌥Enter") + ">"), Re.style.width = "120px", Re.value = je.getAttribute("data-footnotes-label"), Re.oninput = function() {
|
|
2062
2062
|
Re.value.trim() !== "" && je.setAttribute("data-footnotes-label", Re.value), typeof e.options.input == "function" && e.options.input(m(e));
|
|
2063
2063
|
}, Re.onkeydown = function(z) {
|
|
2064
2064
|
z.isComposing || Ie(e, z) || Ge(z, t);
|
|
2065
|
-
},
|
|
2065
|
+
}, qe(je, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", Be), Pe(e, je);
|
|
2066
2066
|
}
|
|
2067
|
-
var
|
|
2067
|
+
var Ae = (0, p.fb)(n, "vditor-wysiwyg__block"), lt = !!Ae && Ae.getAttribute("data-type").indexOf("block") > -1;
|
|
2068
2068
|
if (e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(z) {
|
|
2069
|
-
(!
|
|
2070
|
-
}),
|
|
2071
|
-
if (e.wysiwyg.popover.innerHTML = "",
|
|
2069
|
+
(!Ae || Ae && lt && !Ae.contains(z)) && (z.previousElementSibling.style.display = "none");
|
|
2070
|
+
}), Ae && lt) {
|
|
2071
|
+
if (e.wysiwyg.popover.innerHTML = "", it(t, Ae, e), ot(t, Ae, e), qe(Ae, e), Ae.getAttribute("data-type") === "code-block") {
|
|
2072
2072
|
var Nt = document.createElement("span");
|
|
2073
2073
|
Nt.setAttribute("aria-label", window.VditorI18n.language + "<" + (0, s.ns)("⌥Enter") + ">"), Nt.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
2074
2074
|
var We = document.createElement("input");
|
|
2075
2075
|
Nt.appendChild(We);
|
|
2076
|
-
var bt =
|
|
2076
|
+
var bt = Ae.firstElementChild.firstElementChild;
|
|
2077
2077
|
We.className = "vditor-input", We.setAttribute("placeholder", window.VditorI18n.language + "<" + (0, s.ns)("⌥Enter") + ">"), We.value = bt.className.indexOf("language-") > -1 ? bt.className.split("-")[1].split(" ")[0] : "", We.oninput = function(z) {
|
|
2078
|
-
We.value.trim() !== "" ? bt.className = "language-" + We.value : (bt.className = "", e.hint.recentLanguage = ""),
|
|
2078
|
+
We.value.trim() !== "" ? bt.className = "language-" + We.value : (bt.className = "", e.hint.recentLanguage = ""), Ae.lastElementChild.classList.contains("vditor-wysiwyg__preview") && (Ae.lastElementChild.innerHTML = Ae.firstElementChild.innerHTML, Me(Ae.lastElementChild, e)), ke(e), z.detail === 1 && (t.setStart(bt.firstChild, 0), t.collapse(!0), (0, C.Hc)(t));
|
|
2079
2079
|
}, We.onkeydown = function(z) {
|
|
2080
2080
|
if (!z.isComposing && !Ie(e, z)) {
|
|
2081
2081
|
if (z.key === "Escape" && e.hint.element.style.display === "block")
|
|
@@ -2084,29 +2084,29 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2084
2084
|
}
|
|
2085
2085
|
}, We.onkeyup = function(z) {
|
|
2086
2086
|
if (!z.isComposing && z.key !== "Enter" && z.key !== "ArrowUp" && z.key !== "Escape" && z.key !== "ArrowDown") {
|
|
2087
|
-
var Se = [],
|
|
2087
|
+
var Se = [], rt = We.value.substring(0, We.selectionStart);
|
|
2088
2088
|
(e.options.preview.hljs.langs || b.g.CODE_LANGUAGES).forEach(function(Je) {
|
|
2089
|
-
Je.indexOf(
|
|
2090
|
-
}), e.hint.genHTML(Se,
|
|
2089
|
+
Je.indexOf(rt.toLowerCase()) > -1 && Se.push({ html: Je, value: Je });
|
|
2090
|
+
}), e.hint.genHTML(Se, rt, e), z.preventDefault();
|
|
2091
2091
|
}
|
|
2092
2092
|
}, e.wysiwyg.popover.insertAdjacentElement("beforeend", Nt);
|
|
2093
2093
|
}
|
|
2094
|
-
|
|
2094
|
+
Pe(e, Ae);
|
|
2095
2095
|
} else
|
|
2096
|
-
|
|
2096
|
+
Ae = void 0;
|
|
2097
2097
|
if (h) {
|
|
2098
|
-
var
|
|
2099
|
-
e.wysiwyg.popover.innerHTML = "", (
|
|
2098
|
+
var Be;
|
|
2099
|
+
e.wysiwyg.popover.innerHTML = "", (Be = document.createElement("span")).setAttribute("aria-label", "ID<" + (0, s.ns)("⌥Enter") + ">"), Be.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
2100
2100
|
var Ye = document.createElement("input");
|
|
2101
|
-
|
|
2101
|
+
Be.appendChild(Ye), Ye.className = "vditor-input", Ye.setAttribute("placeholder", "ID<" + (0, s.ns)("⌥Enter") + ">"), Ye.style.width = "120px", Ye.value = h.getAttribute("data-id") || "", Ye.oninput = function() {
|
|
2102
2102
|
h.setAttribute("data-id", Ye.value), typeof e.options.input == "function" && e.options.input(m(e));
|
|
2103
2103
|
}, Ye.onkeydown = function(z) {
|
|
2104
2104
|
z.isComposing || Ie(e, z) || Ge(z, t);
|
|
2105
|
-
},
|
|
2105
|
+
}, it(t, h, e), ot(t, h, e), qe(h, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", Be), Pe(e, h);
|
|
2106
2106
|
}
|
|
2107
|
-
if (v &&
|
|
2108
|
-
var
|
|
2109
|
-
|
|
2107
|
+
if (v && It(e, v, t), !(O || r || g || Ae || v || Ze || je || h || A)) {
|
|
2108
|
+
var ct = (0, p.a1)(n, "data-block", "0");
|
|
2109
|
+
ct && ct.parentElement.isEqualNode(e.wysiwyg.element) ? (e.wysiwyg.popover.innerHTML = "", it(t, ct, e), ot(t, ct, e), qe(ct, e), Pe(e, ct)) : e.wysiwyg.popover.style.display = "none";
|
|
2110
2110
|
}
|
|
2111
2111
|
e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(z) {
|
|
2112
2112
|
z.style.display = "none";
|
|
@@ -2115,7 +2115,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2115
2115
|
Rn && (Rn.querySelector("span").style.display = "inline");
|
|
2116
2116
|
}
|
|
2117
2117
|
}, 200);
|
|
2118
|
-
},
|
|
2118
|
+
}, Pe = function(e, t) {
|
|
2119
2119
|
var n = t, i = (0, p.lG)(t, "TABLE");
|
|
2120
2120
|
i && (n = i), e.wysiwyg.popover.style.left = "0", e.wysiwyg.popover.style.display = "block", e.wysiwyg.popover.style.top = Math.max(-8, n.offsetTop - 21 - e.wysiwyg.element.scrollTop) + "px", e.wysiwyg.popover.style.left = Math.min(n.offsetLeft, e.wysiwyg.element.clientWidth - e.wysiwyg.popover.clientWidth) + "px", e.wysiwyg.popover.setAttribute("data-top", (n.offsetTop - 21).toString());
|
|
2121
2121
|
}, on = function(e, t, n) {
|
|
@@ -2137,28 +2137,28 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2137
2137
|
i();
|
|
2138
2138
|
}, d.onkeydown = function(v) {
|
|
2139
2139
|
Ie(e, v) || Ge(v, n) || ht(e, t, v, o);
|
|
2140
|
-
},
|
|
2141
|
-
},
|
|
2140
|
+
}, qe(t, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", r), e.wysiwyg.popover.insertAdjacentElement("beforeend", a), Pe(e, t);
|
|
2141
|
+
}, it = function(e, t, n) {
|
|
2142
2142
|
var i = t.previousElementSibling;
|
|
2143
2143
|
if (i && (t.parentElement.isEqualNode(n.wysiwyg.element) || t.tagName === "LI")) {
|
|
2144
2144
|
var r = document.createElement("button");
|
|
2145
2145
|
r.setAttribute("type", "button"), r.setAttribute("data-type", "up"), r.setAttribute("aria-label", window.VditorI18n.up + "<" + (0, s.ns)("⇧⌘U") + ">"), r.innerHTML = '<svg><use xlink:href="#vditor-icon-up"></use></svg>', r.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", r.onclick = function() {
|
|
2146
|
-
e.insertNode(document.createElement("wbr")), i.insertAdjacentElement("beforebegin", t), (0, C.ib)(n.wysiwyg.element, e), ke(n),
|
|
2146
|
+
e.insertNode(document.createElement("wbr")), i.insertAdjacentElement("beforebegin", t), (0, C.ib)(n.wysiwyg.element, e), ke(n), tt(n), Ce(n);
|
|
2147
2147
|
}, n.wysiwyg.popover.insertAdjacentElement("beforeend", r);
|
|
2148
2148
|
}
|
|
2149
|
-
},
|
|
2149
|
+
}, ot = function(e, t, n) {
|
|
2150
2150
|
var i = t.nextElementSibling;
|
|
2151
2151
|
if (i && (t.parentElement.isEqualNode(n.wysiwyg.element) || t.tagName === "LI")) {
|
|
2152
2152
|
var r = document.createElement("button");
|
|
2153
2153
|
r.setAttribute("type", "button"), r.setAttribute("data-type", "down"), r.setAttribute("aria-label", window.VditorI18n.down + "<" + (0, s.ns)("⇧⌘D") + ">"), r.innerHTML = '<svg><use xlink:href="#vditor-icon-down"></use></svg>', r.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", r.onclick = function() {
|
|
2154
|
-
e.insertNode(document.createElement("wbr")), i.insertAdjacentElement("afterend", t), (0, C.ib)(n.wysiwyg.element, e), ke(n),
|
|
2154
|
+
e.insertNode(document.createElement("wbr")), i.insertAdjacentElement("afterend", t), (0, C.ib)(n.wysiwyg.element, e), ke(n), tt(n), Ce(n);
|
|
2155
2155
|
}, n.wysiwyg.popover.insertAdjacentElement("beforeend", r);
|
|
2156
2156
|
}
|
|
2157
|
-
},
|
|
2157
|
+
}, qe = function(e, t) {
|
|
2158
2158
|
var n = document.createElement("button");
|
|
2159
2159
|
n.setAttribute("type", "button"), n.setAttribute("data-type", "remove"), n.setAttribute("aria-label", window.VditorI18n.remove + "<" + (0, s.ns)("⇧⌘X") + ">"), n.innerHTML = '<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>', n.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", n.onclick = function() {
|
|
2160
2160
|
var i = (0, C.zh)(t);
|
|
2161
|
-
i.setStartAfter(e), (0, C.Hc)(i), e.remove(), ke(t),
|
|
2161
|
+
i.setStartAfter(e), (0, C.Hc)(i), e.remove(), ke(t), tt(t), ["H1", "H2", "H3", "H4", "H5", "H6"].includes(e.tagName) && Ke(t);
|
|
2162
2162
|
}, t.wysiwyg.popover.insertAdjacentElement("beforeend", n);
|
|
2163
2163
|
}, ht = function(e, t, n, i) {
|
|
2164
2164
|
if (!n.isComposing) {
|
|
@@ -2169,7 +2169,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2169
2169
|
t.insertAdjacentHTML("afterend", b.g.ZWSP), r.setStartAfter(t.nextSibling), r.collapse(!0), (0, C.Hc)(r), n.preventDefault();
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
2172
|
-
},
|
|
2172
|
+
}, It = function(e, t, n) {
|
|
2173
2173
|
e.wysiwyg.popover.innerHTML = "";
|
|
2174
2174
|
var i = function() {
|
|
2175
2175
|
o.value.trim() !== "" && (t.innerHTML = o.value), t.setAttribute("href", d.value), t.setAttribute("title", g.value), ke(e);
|
|
@@ -2200,12 +2200,12 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2200
2200
|
i();
|
|
2201
2201
|
}, g.onkeydown = function(h) {
|
|
2202
2202
|
Ie(e, h) || Ge(h, n) || ht(e, t, h, o);
|
|
2203
|
-
},
|
|
2203
|
+
}, qe(t, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", r), e.wysiwyg.popover.insertAdjacentElement("beforeend", a), e.wysiwyg.popover.insertAdjacentElement("beforeend", v), Pe(e, t);
|
|
2204
2204
|
}, Ge = function(e, t) {
|
|
2205
2205
|
if (!(0, s.yl)(e) && !e.shiftKey && e.key === "Enter" || e.key === "Escape")
|
|
2206
2206
|
return t && (0, C.Hc)(t), e.preventDefault(), e.stopPropagation(), !0;
|
|
2207
|
-
},
|
|
2208
|
-
e.currentMode === "wysiwyg" ?
|
|
2207
|
+
}, at = function(e) {
|
|
2208
|
+
e.currentMode === "wysiwyg" ? tt(e) : e.currentMode === "ir" && mt(e);
|
|
2209
2209
|
}, an = function(e, t, n) {
|
|
2210
2210
|
n === void 0 && (n = { enableAddUndoStack: !0, enableHint: !1, enableInput: !0 });
|
|
2211
2211
|
var i = e.wysiwyg.element;
|
|
@@ -2280,13 +2280,13 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2280
2280
|
else if (R === "link") {
|
|
2281
2281
|
if (M.toString() === "") {
|
|
2282
2282
|
var F = document.createElement("a");
|
|
2283
|
-
F.innerText = b.g.ZWSP, M.insertNode(F), M.setStart(F.firstChild, 1), M.collapse(!0),
|
|
2283
|
+
F.innerText = b.g.ZWSP, M.insertNode(F), M.setStart(F.firstChild, 1), M.collapse(!0), It(g, F, M);
|
|
2284
2284
|
var te = g.wysiwyg.popover.querySelector("input");
|
|
2285
2285
|
te.value = "", te.focus(), U = !1;
|
|
2286
2286
|
} else {
|
|
2287
|
-
(H = document.createElement("a")).setAttribute("href", ""), H.innerHTML = M.toString(), M.surroundContents(H), M.insertNode(H), (0, C.Hc)(M),
|
|
2288
|
-
var
|
|
2289
|
-
|
|
2287
|
+
(H = document.createElement("a")).setAttribute("href", ""), H.innerHTML = M.toString(), M.surroundContents(H), M.insertNode(H), (0, C.Hc)(M), It(g, H, M);
|
|
2288
|
+
var J = g.wysiwyg.popover.querySelectorAll("input");
|
|
2289
|
+
J[0].value = H.innerText, J[1].focus();
|
|
2290
2290
|
}
|
|
2291
2291
|
O = !1, h.classList.add("vditor-menu--current");
|
|
2292
2292
|
} else if (R === "table") {
|
|
@@ -2319,41 +2319,41 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2319
2319
|
R === "italic" ? Ee = "em" : R === "strikeThrough" && (Ee = "s"), (H = document.createElement(Ee)).textContent = b.g.ZWSP, M.insertNode(H), H.previousSibling && H.previousSibling.textContent === b.g.ZWSP && (H.previousSibling.textContent = ""), M.setStart(H.firstChild, 1), M.collapse(!0), (0, C.Hc)(M);
|
|
2320
2320
|
}
|
|
2321
2321
|
}
|
|
2322
|
-
O &&
|
|
2322
|
+
O && tt(g), U && ke(g);
|
|
2323
2323
|
}
|
|
2324
2324
|
}(e, i.element.children[0], v) : e.currentMode === "ir" ? sr(e, i.element.children[0], t.prefix || "", t.suffix || "") : Qn(e, i.element.children[0], t.prefix || "", t.suffix || ""));
|
|
2325
2325
|
});
|
|
2326
|
-
}, Zn = (
|
|
2327
|
-
return
|
|
2326
|
+
}, Zn = (et = function(e, t) {
|
|
2327
|
+
return et = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
|
|
2328
2328
|
n.__proto__ = i;
|
|
2329
2329
|
} || function(n, i) {
|
|
2330
2330
|
for (var r in i)
|
|
2331
2331
|
i.hasOwnProperty(r) && (n[r] = i[r]);
|
|
2332
|
-
},
|
|
2332
|
+
}, et(e, t);
|
|
2333
2333
|
}, function(e, t) {
|
|
2334
2334
|
function n() {
|
|
2335
2335
|
this.constructor = e;
|
|
2336
2336
|
}
|
|
2337
|
-
|
|
2338
|
-
}),
|
|
2337
|
+
et(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
2338
|
+
}), nt = function(e, t, n) {
|
|
2339
2339
|
var i;
|
|
2340
2340
|
if (typeof n != "string" ? (E(e, ["subToolbar", "hint"]), n.preventDefault(), i = m(e)) : i = n, e.currentMode !== t || typeof n == "string") {
|
|
2341
2341
|
if (e.devtools && e.devtools.renderEchart(e), e.options.preview.mode === "both" && t === "sv" ? e.preview.element.style.display = "block" : e.preview.element.style.display = "none", w(e.toolbar.elements, b.g.EDIT_TOOLBARS), u(e.toolbar.elements, b.g.EDIT_TOOLBARS), L(e.toolbar.elements, ["outdent", "indent"]), t === "ir")
|
|
2342
|
-
S(e.toolbar.elements, ["both"]), T(e.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]), e.sv.element.style.display = "none", e.wysiwyg.element.parentElement.style.display = "none", e.ir.element.parentElement.style.display = "block", e.lute.SetVditorIR(!0), e.lute.SetVditorWYSIWYG(!1), e.lute.SetVditorSV(!1), e.currentMode = "ir", e.ir.element.innerHTML = e.lute.Md2VditorIRDOM(i), $e(e, { enableAddUndoStack: !0, enableHint: !1, enableInput: !1 }),
|
|
2342
|
+
S(e.toolbar.elements, ["both"]), T(e.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]), e.sv.element.style.display = "none", e.wysiwyg.element.parentElement.style.display = "none", e.ir.element.parentElement.style.display = "block", e.lute.SetVditorIR(!0), e.lute.SetVditorWYSIWYG(!1), e.lute.SetVditorSV(!1), e.currentMode = "ir", e.ir.element.innerHTML = e.lute.Md2VditorIRDOM(i), $e(e, { enableAddUndoStack: !0, enableHint: !1, enableInput: !1 }), pe(e), e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o) {
|
|
2343
2343
|
Me(o, e);
|
|
2344
2344
|
}), e.ir.element.querySelectorAll(".vditor-toc").forEach(function(o) {
|
|
2345
2345
|
(0, de.H)(o, { cdn: e.options.cdn, math: e.options.preview.math });
|
|
2346
2346
|
});
|
|
2347
2347
|
else if (t === "wysiwyg")
|
|
2348
|
-
S(e.toolbar.elements, ["both"]), T(e.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]), e.sv.element.style.display = "none", e.wysiwyg.element.parentElement.style.display = "block", e.ir.element.parentElement.style.display = "none", e.lute.SetVditorIR(!1), e.lute.SetVditorWYSIWYG(!0), e.lute.SetVditorSV(!1), e.currentMode = "wysiwyg",
|
|
2348
|
+
S(e.toolbar.elements, ["both"]), T(e.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]), e.sv.element.style.display = "none", e.wysiwyg.element.parentElement.style.display = "block", e.ir.element.parentElement.style.display = "none", e.lute.SetVditorIR(!1), e.lute.SetVditorWYSIWYG(!0), e.lute.SetVditorSV(!1), e.currentMode = "wysiwyg", pe(e), an(e, i, { enableAddUndoStack: !0, enableHint: !1, enableInput: !1 }), e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(o) {
|
|
2349
2349
|
(0, de.H)(o, { cdn: e.options.cdn, math: e.options.preview.math });
|
|
2350
2350
|
}), e.wysiwyg.popover.style.display = "none";
|
|
2351
2351
|
else if (t === "sv") {
|
|
2352
2352
|
T(e.toolbar.elements, ["both"]), S(e.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]), e.wysiwyg.element.parentElement.style.display = "none", e.ir.element.parentElement.style.display = "none", (e.options.preview.mode === "both" || e.options.preview.mode === "editor") && (e.sv.element.style.display = "block"), e.lute.SetVditorIR(!1), e.lute.SetVditorWYSIWYG(!1), e.lute.SetVditorSV(!0), e.currentMode = "sv";
|
|
2353
2353
|
var r = cn(i, e);
|
|
2354
|
-
r === "<div data-block='0'></div>" && (r = ""), e.sv.element.innerHTML = r, le(e.sv.element), Ne(e, { enableAddUndoStack: !0, enableHint: !1, enableInput: !1 }),
|
|
2354
|
+
r === "<div data-block='0'></div>" && (r = ""), e.sv.element.innerHTML = r, le(e.sv.element), Ne(e, { enableAddUndoStack: !0, enableHint: !1, enableInput: !1 }), pe(e);
|
|
2355
2355
|
}
|
|
2356
|
-
e.undo.resetIcon(e), typeof n != "string" && (e[e.currentMode].element.focus(),
|
|
2356
|
+
e.undo.resetIcon(e), typeof n != "string" && (e[e.currentMode].element.focus(), at(e)), Ke(e), Q(e), e.toolbar.elements["edit-mode"] && (e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(o) {
|
|
2357
2357
|
o.classList.remove("vditor-menu--current");
|
|
2358
2358
|
}), e.toolbar.elements["edit-mode"].querySelector('button[data-mode="' + e.currentMode + '"]').classList.add("vditor-menu--current")), e.outline.toggle(e, e.currentMode !== "sv" && e.options.outline.enable, typeof n != "string");
|
|
2359
2359
|
}
|
|
@@ -2367,24 +2367,24 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2367
2367
|
return Zn(t, e), t.prototype._bindEvent = function(n, i, r) {
|
|
2368
2368
|
var o = this.element.children[0];
|
|
2369
2369
|
k(n, i, o, r.level), i.children.item(0).addEventListener((0, s.Le)(), function(a) {
|
|
2370
|
-
|
|
2370
|
+
nt(n, "wysiwyg", a), a.preventDefault(), a.stopPropagation();
|
|
2371
2371
|
}), i.children.item(1).addEventListener((0, s.Le)(), function(a) {
|
|
2372
|
-
|
|
2372
|
+
nt(n, "ir", a), a.preventDefault(), a.stopPropagation();
|
|
2373
2373
|
}), i.children.item(2).addEventListener((0, s.Le)(), function(a) {
|
|
2374
|
-
|
|
2374
|
+
nt(n, "sv", a), a.preventDefault(), a.stopPropagation();
|
|
2375
2375
|
});
|
|
2376
2376
|
}, t;
|
|
2377
2377
|
}(_e), vt = function(e, t) {
|
|
2378
2378
|
return (0, C.Gb)(e, t) ? getSelection().toString() : "";
|
|
2379
|
-
},
|
|
2379
|
+
}, jt = function(e, t) {
|
|
2380
2380
|
t.addEventListener("focus", function() {
|
|
2381
2381
|
e.options.focus && e.options.focus(m(e)), E(e, ["subToolbar", "hint"]);
|
|
2382
2382
|
});
|
|
2383
2383
|
}, sn = function(e, t) {
|
|
2384
2384
|
t.addEventListener("dblclick", function(n) {
|
|
2385
|
-
n.target.tagName === "IMG" && (e.options.image.preview ? e.options.image.preview(n.target) : e.options.image.isPreview && (0,
|
|
2385
|
+
n.target.tagName === "IMG" && (e.options.image.preview ? e.options.image.preview(n.target) : e.options.image.isPreview && (0, ie.E)(n.target, e.options.lang, e.options.theme));
|
|
2386
2386
|
});
|
|
2387
|
-
},
|
|
2387
|
+
}, Rt = function(e, t) {
|
|
2388
2388
|
t.addEventListener("blur", function(n) {
|
|
2389
2389
|
if (e.currentMode === "ir") {
|
|
2390
2390
|
var i = e.ir.element.querySelector(".vditor-ir__node--expand");
|
|
@@ -2393,7 +2393,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2393
2393
|
e.currentMode !== "wysiwyg" || e.wysiwyg.selectPopover.contains(n.relatedTarget) || e.wysiwyg.hideComment();
|
|
2394
2394
|
e[e.currentMode].range = (0, C.zh)(e), e.options.blur && e.options.blur(m(e));
|
|
2395
2395
|
});
|
|
2396
|
-
},
|
|
2396
|
+
}, Pt = function(e, t) {
|
|
2397
2397
|
t.addEventListener("dragstart", function(n) {
|
|
2398
2398
|
n.dataTransfer.setData(b.g.DROP_EDITOR, b.g.DROP_EDITOR);
|
|
2399
2399
|
}), t.addEventListener("drop", function(n) {
|
|
@@ -2401,20 +2401,20 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2401
2401
|
document.execCommand("insertHTML", !1, i);
|
|
2402
2402
|
} });
|
|
2403
2403
|
});
|
|
2404
|
-
},
|
|
2404
|
+
}, qt = function(e, t, n) {
|
|
2405
2405
|
t.addEventListener("copy", function(i) {
|
|
2406
2406
|
return n(i, e);
|
|
2407
2407
|
});
|
|
2408
|
-
},
|
|
2408
|
+
}, Bt = function(e, t, n) {
|
|
2409
2409
|
t.addEventListener("cut", function(i) {
|
|
2410
2410
|
n(i, e), e.options.comment.enable && e.currentMode === "wysiwyg" && e.wysiwyg.getComments(e), document.execCommand("delete");
|
|
2411
2411
|
});
|
|
2412
|
-
},
|
|
2412
|
+
}, Ce = function(e) {
|
|
2413
2413
|
if (e.currentMode === "wysiwyg" && e.options.comment.enable && e.options.comment.adjustTop(e.wysiwyg.getComments(e, !0)), e.options.typewriterMode) {
|
|
2414
2414
|
var t = e[e.currentMode].element, n = (0, C.Ny)(t).top;
|
|
2415
2415
|
e.options.height !== "auto" || e.element.classList.contains("vditor--fullscreen") || window.scrollTo(window.scrollX, n + e.element.offsetTop + e.toolbar.element.offsetHeight - window.innerHeight / 2 + 10), (e.options.height !== "auto" || e.element.classList.contains("vditor--fullscreen")) && (t.scrollTop = n + t.scrollTop - t.clientHeight / 2 + 10);
|
|
2416
2416
|
}
|
|
2417
|
-
},
|
|
2417
|
+
}, Vt = function(e, t) {
|
|
2418
2418
|
t.addEventListener("keydown", function(n) {
|
|
2419
2419
|
if (!n.isComposing && e.options.keydown && e.options.keydown(n), !(e.options.hint.extend.length > 1 || e.toolbar.elements.emoji) || !e.hint.select(n, e)) {
|
|
2420
2420
|
if (e.options.comment.enable && e.currentMode === "wysiwyg" && (n.key === "Backspace" || V("⌘X", n)) && e.wysiwyg.getComments(e), e.currentMode === "sv") {
|
|
@@ -2437,12 +2437,12 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2437
2437
|
return H.insertAdjacentHTML("beforebegin", '<span data-type="padding">' + H.textContent.replace(/\S/g, " ") + "</span>"), /^\d/.test(H.textContent) && (H.textContent = H.textContent.replace(/^\d{1,}/, "1"), A.selectNodeContents(D.firstChild), A.collapse(!1)), ae(r), o.preventDefault(), !0;
|
|
2438
2438
|
}
|
|
2439
2439
|
}
|
|
2440
|
-
if (
|
|
2440
|
+
if (Ft(r, A, o))
|
|
2441
2441
|
return !0;
|
|
2442
2442
|
var F = (0, p.a1)(O, "data-block", "0"), te = (0, x.S)(O, "SPAN");
|
|
2443
2443
|
if (o.key === "Enter" && !(0, s.yl)(o) && !o.altKey && !o.shiftKey && F) {
|
|
2444
|
-
var
|
|
2445
|
-
(0, C.im)(F, r.sv.element).start <= (ee ? ee[0].length : 0) && (
|
|
2444
|
+
var J = !1, ee = F.textContent.match(/^\n+/);
|
|
2445
|
+
(0, C.im)(F, r.sv.element).start <= (ee ? ee[0].length : 0) && (J = !0);
|
|
2446
2446
|
var Y = `
|
|
2447
2447
|
`;
|
|
2448
2448
|
if (te) {
|
|
@@ -2450,7 +2450,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2450
2450
|
return te.previousElementSibling.remove(), Ne(r), o.preventDefault(), !0;
|
|
2451
2451
|
Y += Xn(te);
|
|
2452
2452
|
}
|
|
2453
|
-
return A.insertNode(document.createTextNode(Y)), A.collapse(!1), F && F.textContent.trim() !== "" && !
|
|
2453
|
+
return A.insertNode(document.createTextNode(Y)), A.collapse(!1), F && F.textContent.trim() !== "" && !J ? ae(r) : Ne(r), o.preventDefault(), !0;
|
|
2454
2454
|
}
|
|
2455
2455
|
if (o.key === "Backspace" && !(0, s.yl)(o) && !o.altKey && !o.shiftKey) {
|
|
2456
2456
|
if (te && ((g = te.previousElementSibling) === null || g === void 0 ? void 0 : g.getAttribute("data-type")) === "newline" && (0, C.im)(te, r.sv.element, A).start === 1 && te.getAttribute("data-type").indexOf("code-block-") === -1)
|
|
@@ -2483,7 +2483,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2483
2483
|
var A = r.wysiwyg.popover.querySelector(".vditor-input");
|
|
2484
2484
|
return A.focus(), A.select(), o.preventDefault(), !0;
|
|
2485
2485
|
}
|
|
2486
|
-
if (h.getAttribute("data-block") === "0" && (Ln(r, o, h.firstElementChild, a) || gt(r, o, a, h.firstElementChild, h) || h.getAttribute("data-type") !== "yaml-front-matter" &&
|
|
2486
|
+
if (h.getAttribute("data-block") === "0" && (Ln(r, o, h.firstElementChild, a) || gt(r, o, a, h.firstElementChild, h) || h.getAttribute("data-type") !== "yaml-front-matter" && st(r, o, a, h.firstElementChild, h)))
|
|
2487
2487
|
return !0;
|
|
2488
2488
|
}
|
|
2489
2489
|
if (Mn(r, a, o, g))
|
|
@@ -2493,21 +2493,21 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2493
2493
|
(0, s.yl)(o) ? a.setStartBefore(O) : a.setStartAfter(O), (0, C.Hc)(a);
|
|
2494
2494
|
var U = document.createElement("p");
|
|
2495
2495
|
return U.setAttribute("data-block", "0"), U.innerHTML = `
|
|
2496
|
-
`, a.insertNode(U), a.collapse(!0), (0, C.Hc)(a), ke(r),
|
|
2496
|
+
`, a.insertNode(U), a.collapse(!0), (0, C.Hc)(a), ke(r), Ce(r), o.preventDefault(), !0;
|
|
2497
2497
|
}
|
|
2498
2498
|
var M, R = (0, x.W)(d);
|
|
2499
2499
|
if (R) {
|
|
2500
2500
|
if (R.tagName === "H6" && d.textContent.length === a.startOffset && !(0, s.yl)(o) && !o.shiftKey && !o.altKey && o.key === "Enter") {
|
|
2501
2501
|
var q = document.createElement("p");
|
|
2502
2502
|
return q.textContent = `
|
|
2503
|
-
`, q.setAttribute("data-block", "0"), d.parentElement.insertAdjacentElement("afterend", q), a.setStart(q, 0), (0, C.Hc)(a), ke(r),
|
|
2503
|
+
`, q.setAttribute("data-block", "0"), d.parentElement.insertAdjacentElement("afterend", q), a.setStart(q, 0), (0, C.Hc)(a), ke(r), Ce(r), o.preventDefault(), !0;
|
|
2504
2504
|
}
|
|
2505
2505
|
var D;
|
|
2506
2506
|
if (V("⌘=", o))
|
|
2507
2507
|
return (D = parseInt(R.tagName.substr(1), 10) - 1) > 0 && (St(r, "h" + D), ke(r)), o.preventDefault(), !0;
|
|
2508
2508
|
if (V("⌘-", o))
|
|
2509
2509
|
return (D = parseInt(R.tagName.substr(1), 10) + 1) < 7 && (St(r, "h" + D), ke(r)), o.preventDefault(), !0;
|
|
2510
|
-
o.key !== "Backspace" || (0, s.yl)(o) || o.shiftKey || o.altKey || R.textContent.length !== 1 ||
|
|
2510
|
+
o.key !== "Backspace" || (0, s.yl)(o) || o.shiftKey || o.altKey || R.textContent.length !== 1 || Ot(r);
|
|
2511
2511
|
}
|
|
2512
2512
|
if (Tn(r, a, o))
|
|
2513
2513
|
return !0;
|
|
@@ -2522,12 +2522,12 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2522
2522
|
return !0;
|
|
2523
2523
|
if (V("⇧⌘U", o) && (M = r.wysiwyg.popover.querySelector('[data-type="up"]')) || V("⇧⌘D", o) && (M = r.wysiwyg.popover.querySelector('[data-type="down"]')))
|
|
2524
2524
|
return M.click(), o.preventDefault(), !0;
|
|
2525
|
-
if (
|
|
2525
|
+
if (Ft(r, a, o))
|
|
2526
2526
|
return !0;
|
|
2527
2527
|
if (!(0, s.yl)(o) && o.shiftKey && !o.altKey && o.key === "Enter" && d.parentElement.tagName !== "LI" && d.parentElement.tagName !== "P")
|
|
2528
2528
|
return ["STRONG", "STRIKE", "S", "I", "EM", "B"].includes(d.parentElement.tagName) ? a.insertNode(document.createTextNode(`
|
|
2529
2529
|
` + b.g.ZWSP)) : a.insertNode(document.createTextNode(`
|
|
2530
|
-
`)), a.collapse(!1), (0, C.Hc)(a), ke(r),
|
|
2530
|
+
`)), a.collapse(!1), (0, C.Hc)(a), ke(r), Ce(r), o.preventDefault(), !0;
|
|
2531
2531
|
if (o.key === "Backspace" && !(0, s.yl)(o) && !o.shiftKey && !o.altKey && a.toString() === "") {
|
|
2532
2532
|
if (Cn(r, a, o, g))
|
|
2533
2533
|
return !0;
|
|
@@ -2537,10 +2537,10 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2537
2537
|
if (te === 0 && a.startOffset === 0 || te === 1 && v.innerText.startsWith(b.g.ZWSP))
|
|
2538
2538
|
return ft(v.previousElementSibling.lastElementChild, r, !1), v.innerHTML.trim().replace(b.g.ZWSP, "") === "" && (v.remove(), ke(r)), o.preventDefault(), !0;
|
|
2539
2539
|
}
|
|
2540
|
-
var
|
|
2541
|
-
if (a.toString() === "" && d.nodeType === 3 && d.textContent.charAt(
|
|
2542
|
-
` && d.textContent.charAt(
|
|
2543
|
-
return d.textContent = d.textContent.substring(0,
|
|
2540
|
+
var J = a.startOffset;
|
|
2541
|
+
if (a.toString() === "" && d.nodeType === 3 && d.textContent.charAt(J - 2) === `
|
|
2542
|
+
` && d.textContent.charAt(J - 1) !== b.g.ZWSP && ["STRONG", "STRIKE", "S", "I", "EM", "B"].includes(d.parentElement.tagName))
|
|
2543
|
+
return d.textContent = d.textContent.substring(0, J - 1) + b.g.ZWSP, a.setStart(d, J), a.collapse(!0), ke(r), o.preventDefault(), !0;
|
|
2544
2544
|
d.textContent === b.g.ZWSP && a.startOffset === 1 && !d.previousSibling && function(Y) {
|
|
2545
2545
|
for (var G = Y.startContainer.nextSibling; G && G.textContent === ""; )
|
|
2546
2546
|
G = G.nextSibling;
|
|
@@ -2583,7 +2583,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2583
2583
|
var O = (0, p.fb)(d, "vditor-ir__marker--pre");
|
|
2584
2584
|
if (O && O.tagName === "PRE") {
|
|
2585
2585
|
var U = O.firstChild;
|
|
2586
|
-
if (Ln(r, o, O, a) || (U.getAttribute("data-type") === "math-block" || U.getAttribute("data-type") === "html-block") &&
|
|
2586
|
+
if (Ln(r, o, O, a) || (U.getAttribute("data-type") === "math-block" || U.getAttribute("data-type") === "html-block") && st(r, o, a, U, O.parentElement) || gt(r, o, a, U, O.parentElement))
|
|
2587
2587
|
return !0;
|
|
2588
2588
|
}
|
|
2589
2589
|
var M = (0, p.a1)(d, "data-type", "code-block-info");
|
|
@@ -2594,19 +2594,19 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2594
2594
|
var R = (0, C.im)(M, r.ir.element).start;
|
|
2595
2595
|
R === 1 && a.setStart(d, 0), R === 2 && (r.hint.recentLanguage = "");
|
|
2596
2596
|
}
|
|
2597
|
-
if (
|
|
2597
|
+
if (st(r, o, a, M, M.parentElement))
|
|
2598
2598
|
return E(r, ["hint"]), !0;
|
|
2599
2599
|
}
|
|
2600
2600
|
var q = (0, p.lG)(d, "TD") || (0, p.lG)(d, "TH");
|
|
2601
2601
|
if (o.key.indexOf("Arrow") > -1 && q) {
|
|
2602
2602
|
var D = or(q);
|
|
2603
|
-
if (D &&
|
|
2603
|
+
if (D && st(r, o, a, q, D))
|
|
2604
2604
|
return !0;
|
|
2605
2605
|
var B = ar(q);
|
|
2606
2606
|
if (B && gt(r, o, a, q, B))
|
|
2607
2607
|
return !0;
|
|
2608
2608
|
}
|
|
2609
|
-
if (_n(r, o, a) || Tn(r, a, o) ||
|
|
2609
|
+
if (_n(r, o, a) || Tn(r, a, o) || Ft(r, a, o))
|
|
2610
2610
|
return !0;
|
|
2611
2611
|
var P = (0, x.W)(d);
|
|
2612
2612
|
if (P) {
|
|
@@ -2626,8 +2626,8 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2626
2626
|
return a.selectNodeContents(F.previousElementSibling.querySelector(".vditor-ir__marker--pre code")), a.collapse(!1), j(a, r), F.textContent.trim().replace(b.g.ZWSP, "") === "" && (F.remove(), $e(r)), o.preventDefault(), !0;
|
|
2627
2627
|
}
|
|
2628
2628
|
if (P) {
|
|
2629
|
-
var
|
|
2630
|
-
(0, C.im)(P, r.ir.element).start ===
|
|
2629
|
+
var J = P.firstElementChild.textContent.length;
|
|
2630
|
+
(0, C.im)(P, r.ir.element).start === J && (a.setStart(P.firstElementChild.firstChild, J - 1), a.collapse(!0), (0, C.Hc)(a));
|
|
2631
2631
|
}
|
|
2632
2632
|
}
|
|
2633
2633
|
return !((o.key !== "ArrowUp" && o.key !== "ArrowDown" || !F || (F.querySelectorAll(".vditor-ir__node").forEach(function(ee) {
|
|
@@ -2646,13 +2646,13 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2646
2646
|
if ((0, s.yl)(n) && n.altKey && !n.shiftKey && /^Digit[1-6]$/.test(n.code)) {
|
|
2647
2647
|
if (e.currentMode === "wysiwyg") {
|
|
2648
2648
|
var i = n.code.replace("Digit", "H");
|
|
2649
|
-
(0, p.lG)(getSelection().getRangeAt(0).startContainer, i) ?
|
|
2649
|
+
(0, p.lG)(getSelection().getRangeAt(0).startContainer, i) ? Ot(e) : St(e, i), ke(e);
|
|
2650
2650
|
} else
|
|
2651
2651
|
e.currentMode === "sv" ? dn(e, "#".repeat(parseInt(n.code.replace("Digit", ""), 10)) + " ") : e.currentMode === "ir" && yt(e, "#".repeat(parseInt(n.code.replace("Digit", ""), 10)) + " ");
|
|
2652
2652
|
return n.preventDefault(), !0;
|
|
2653
2653
|
}
|
|
2654
2654
|
if ((0, s.yl)(n) && n.altKey && !n.shiftKey && /^Digit[7-9]$/.test(n.code))
|
|
2655
|
-
return n.code === "Digit7" ?
|
|
2655
|
+
return n.code === "Digit7" ? nt(e, "wysiwyg", n) : n.code === "Digit8" ? nt(e, "ir", n) : n.code === "Digit9" && nt(e, "sv", n), !0;
|
|
2656
2656
|
e.options.toolbar.find(function(r) {
|
|
2657
2657
|
return !r.hotkey || r.toolbar ? !!r.toolbar && !!r.toolbar.find(function(o) {
|
|
2658
2658
|
return !!o.hotkey && (V(o.hotkey, n) ? (e.toolbar.elements[o.name].children[0].dispatchEvent(new CustomEvent((0, s.Le)())), n.preventDefault(), !0) : void 0);
|
|
@@ -2660,7 +2660,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2660
2660
|
});
|
|
2661
2661
|
}
|
|
2662
2662
|
});
|
|
2663
|
-
},
|
|
2663
|
+
}, Ut = function(e, t) {
|
|
2664
2664
|
t.addEventListener("selectstart", function(n) {
|
|
2665
2665
|
t.onmouseup = function() {
|
|
2666
2666
|
setTimeout(function() {
|
|
@@ -2677,7 +2677,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2677
2677
|
var r = e.lute.SpinVditorSVDOM(i.textContent);
|
|
2678
2678
|
r = "<div data-block='0'>" + r.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g, `<span data-type="newline"><br /><span style="display: none">
|
|
2679
2679
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|
2680
|
-
</span></span></div><div data-block="0"><`) + "</div>", i.isEqualNode(e.sv.element) ? i.innerHTML = r : i.outerHTML = r, le(e.sv.element), (0, C.ib)(e.sv.element, n),
|
|
2680
|
+
</span></span></div><div data-block="0"><`) + "</div>", i.isEqualNode(e.sv.element) ? i.innerHTML = r : i.outerHTML = r, le(e.sv.element), (0, C.ib)(e.sv.element, n), Ce(e);
|
|
2681
2681
|
}, _t = function(e, t, n) {
|
|
2682
2682
|
n === void 0 && (n = !0);
|
|
2683
2683
|
var i = e;
|
|
@@ -2847,7 +2847,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2847
2847
|
}
|
|
2848
2848
|
}, tr = function() {
|
|
2849
2849
|
this.isUploading = !1, this.element = document.createElement("div"), this.element.className = "vditor-upload";
|
|
2850
|
-
},
|
|
2850
|
+
}, Wt = function(e, t, n) {
|
|
2851
2851
|
return Yn(void 0, void 0, void 0, function() {
|
|
2852
2852
|
var i, r, o, a, d, v, g, h, A, O, U, M, R, q;
|
|
2853
2853
|
return er(this, function(D) {
|
|
@@ -2867,21 +2867,21 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2867
2867
|
return e.tip.show(a), [2];
|
|
2868
2868
|
if (d = un(e), e.upload.range = (0, C.zh)(e), v = function(B, P) {
|
|
2869
2869
|
B.tip.hide();
|
|
2870
|
-
for (var H = [], F = "", te = "",
|
|
2870
|
+
for (var H = [], F = "", te = "", J = (B.options.lang, B.options, function(G, re) {
|
|
2871
2871
|
var Ee = P[re], Le = !0;
|
|
2872
2872
|
Ee.name || (F += "<li>" + window.VditorI18n.nameEmpty + "</li>", Le = !1), Ee.size > B.options.upload.max && (F += "<li>" + Ee.name + " " + window.VditorI18n.over + " " + B.options.upload.max / 1024 / 1024 + "M</li>", Le = !1);
|
|
2873
2873
|
var Ze = Ee.name.lastIndexOf("."), je = Ee.name.substr(Ze), Re = B.options.upload.filename(Ee.name.substr(0, Ze)) + je;
|
|
2874
|
-
B.options.upload.accept && (B.options.upload.accept.split(",").some(function(
|
|
2875
|
-
var
|
|
2876
|
-
if (
|
|
2877
|
-
if (je.toLowerCase() ===
|
|
2874
|
+
B.options.upload.accept && (B.options.upload.accept.split(",").some(function(Ae) {
|
|
2875
|
+
var lt = Ae.trim();
|
|
2876
|
+
if (lt.indexOf(".") === 0) {
|
|
2877
|
+
if (je.toLowerCase() === lt.toLowerCase())
|
|
2878
2878
|
return !0;
|
|
2879
|
-
} else if (Ee.type.split("/")[0] ===
|
|
2879
|
+
} else if (Ee.type.split("/")[0] === lt.split("/")[0])
|
|
2880
2880
|
return !0;
|
|
2881
2881
|
return !1;
|
|
2882
2882
|
}) || (F += "<li>" + Ee.name + " " + window.VditorI18n.fileTypeError + "</li>", Le = !1)), Le && (H.push(Ee), te += "<li>" + Re + " " + window.VditorI18n.uploading + "</li>");
|
|
2883
2883
|
}), ee = P.length, Y = 0; Y < ee; Y++)
|
|
2884
|
-
|
|
2884
|
+
J(0, Y);
|
|
2885
2885
|
return B.tip.show("<ul>" + F + te + "</ul>"), H;
|
|
2886
2886
|
}(e, i), v.length === 0)
|
|
2887
2887
|
return n && (n.value = ""), [2];
|
|
@@ -2903,19 +2903,19 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
2903
2903
|
var Y = ee.lastIndexOf("."), G = H.options.upload.filename(ee.substr(0, Y)) + ee.substr(Y);
|
|
2904
2904
|
te += "<li>" + G + " " + window.VditorI18n.uploadError + "</li>";
|
|
2905
2905
|
}), te += "</ul>"), te ? H.tip.show(te) : H.tip.hide();
|
|
2906
|
-
var
|
|
2906
|
+
var J = "";
|
|
2907
2907
|
Object.keys(F.data.succMap).forEach(function(ee) {
|
|
2908
2908
|
var Y = F.data.succMap[ee], G = ee.lastIndexOf("."), re = ee.substr(G), Ee = H.options.upload.filename(ee.substr(0, G)) + re;
|
|
2909
|
-
(re = re.toLowerCase()).indexOf(".wav") === 0 || re.indexOf(".mp3") === 0 || re.indexOf(".ogg") === 0 ? H.currentMode === "wysiwyg" ?
|
|
2909
|
+
(re = re.toLowerCase()).indexOf(".wav") === 0 || re.indexOf(".mp3") === 0 || re.indexOf(".ogg") === 0 ? H.currentMode === "wysiwyg" ? J += `<div class="vditor-wysiwyg__block" data-type="html-block"
|
|
2910
2910
|
data-block="0"><pre><code><audio controls="controls" src="` + Y + '"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="' + Y + `"></audio></pre></div>
|
|
2911
|
-
` : H.currentMode === "ir" ?
|
|
2912
|
-
` :
|
|
2913
|
-
` : re.indexOf(".apng") === 0 || re.indexOf(".bmp") === 0 || re.indexOf(".gif") === 0 || re.indexOf(".ico") === 0 || re.indexOf(".cur") === 0 || re.indexOf(".jpg") === 0 || re.indexOf(".jpeg") === 0 || re.indexOf(".jfif") === 0 || re.indexOf(".pjp") === 0 || re.indexOf(".pjpeg") === 0 || re.indexOf(".png") === 0 || re.indexOf(".svg") === 0 || re.indexOf(".webp") === 0 ? H.currentMode === "wysiwyg" ?
|
|
2914
|
-
` :
|
|
2915
|
-
` : H.currentMode === "wysiwyg" ?
|
|
2916
|
-
` :
|
|
2911
|
+
` : H.currentMode === "ir" ? J += '<audio controls="controls" src="' + Y + `"></audio>
|
|
2912
|
+
` : J += "[" + Ee + "](" + Y + `)
|
|
2913
|
+
` : re.indexOf(".apng") === 0 || re.indexOf(".bmp") === 0 || re.indexOf(".gif") === 0 || re.indexOf(".ico") === 0 || re.indexOf(".cur") === 0 || re.indexOf(".jpg") === 0 || re.indexOf(".jpeg") === 0 || re.indexOf(".jfif") === 0 || re.indexOf(".pjp") === 0 || re.indexOf(".pjpeg") === 0 || re.indexOf(".png") === 0 || re.indexOf(".svg") === 0 || re.indexOf(".webp") === 0 ? H.currentMode === "wysiwyg" ? J += '<img alt="' + Ee + '" src="' + Y + `">
|
|
2914
|
+
` : J += "
|
|
2915
|
+
` : H.currentMode === "wysiwyg" ? J += '<a href="' + Y + '">' + Ee + `</a>
|
|
2916
|
+
` : J += "[" + Ee + "](" + Y + `)
|
|
2917
2917
|
`;
|
|
2918
|
-
}), (0, C.Hc)(H.upload.range), document.execCommand("insertHTML", !1,
|
|
2918
|
+
}), (0, C.Hc)(H.upload.range), document.execCommand("insertHTML", !1, J), H.upload.range = getSelection().getRangeAt(0).cloneRange();
|
|
2919
2919
|
}(B, e);
|
|
2920
2920
|
}
|
|
2921
2921
|
else
|
|
@@ -3106,7 +3106,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3106
3106
|
}, Mt = function(e, t) {
|
|
3107
3107
|
var n = (0, C.zh)(e), i = (0, p.F9)(n.startContainer);
|
|
3108
3108
|
i && (i.insertAdjacentHTML(t, '<p data-block="0">' + b.g.ZWSP + `<wbr>
|
|
3109
|
-
</p>`), (0, C.ib)(e[e.currentMode].element, n),
|
|
3109
|
+
</p>`), (0, C.ib)(e[e.currentMode].element, n), at(e), se(e));
|
|
3110
3110
|
}, or = function(e) {
|
|
3111
3111
|
var t = (0, p.lG)(e, "TABLE");
|
|
3112
3112
|
return !(!t || !t.rows[0].cells[0].isSameNode(e)) && t;
|
|
@@ -3125,7 +3125,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3125
3125
|
return !a || a && (a.tagName === "TABLE" || a.getAttribute("data-type")) ? (r.insertAdjacentHTML("afterend", '<p data-block="0">' + b.g.ZWSP + "<wbr></p>"), (0, C.ib)(e[e.currentMode].element, n)) : (n.selectNodeContents(a), n.collapse(!0), (0, C.Hc)(n)), t.preventDefault(), !0;
|
|
3126
3126
|
}
|
|
3127
3127
|
return !1;
|
|
3128
|
-
},
|
|
3128
|
+
}, st = function(e, t, n, i, r) {
|
|
3129
3129
|
var o = (0, C.im)(i, e[e.currentMode].element, n);
|
|
3130
3130
|
if (t.key === "ArrowUp" && i.textContent.substr(0, o.start).indexOf(`
|
|
3131
3131
|
`) === -1 || (t.key === "ArrowLeft" || t.key === "Backspace" && n.toString() === "") && o.start === 0) {
|
|
@@ -3177,10 +3177,10 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3177
3177
|
var d = (0, p.O9)(n.startContainer);
|
|
3178
3178
|
d && d.querySelectorAll(".vditor-" + e.currentMode + "__preview[data-render='2']").forEach(function(v) {
|
|
3179
3179
|
Me(v, e), e.currentMode === "wysiwyg" && v.previousElementSibling.setAttribute("style", "display:none");
|
|
3180
|
-
}), se(e),
|
|
3180
|
+
}), se(e), at(e);
|
|
3181
3181
|
} else
|
|
3182
3182
|
e[e.currentMode].element.focus();
|
|
3183
|
-
},
|
|
3183
|
+
}, zt = function(e, t, n, i) {
|
|
3184
3184
|
var r = (0, p.lG)(t.parentElement, "LI");
|
|
3185
3185
|
if (r) {
|
|
3186
3186
|
e[e.currentMode].element.querySelectorAll("wbr").forEach(function(A) {
|
|
@@ -3199,7 +3199,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3199
3199
|
var h = (0, p.O9)(n.startContainer);
|
|
3200
3200
|
h && h.querySelectorAll(".vditor-" + e.currentMode + "__preview[data-render='2']").forEach(function(A) {
|
|
3201
3201
|
Me(A, e), e.currentMode === "wysiwyg" && A.previousElementSibling.setAttribute("style", "display:none");
|
|
3202
|
-
}), se(e),
|
|
3202
|
+
}), se(e), at(e);
|
|
3203
3203
|
} else
|
|
3204
3204
|
e[e.currentMode].element.focus();
|
|
3205
3205
|
}, Ct = function(e, t) {
|
|
@@ -3211,12 +3211,12 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3211
3211
|
}
|
|
3212
3212
|
for (var v = 0; v < r; v++)
|
|
3213
3213
|
e.rows[v].cells[o].setAttribute("align", t);
|
|
3214
|
-
},
|
|
3214
|
+
}, Kt = function(e) {
|
|
3215
3215
|
var t = e.trimRight().split(`
|
|
3216
3216
|
`).pop();
|
|
3217
3217
|
return t !== "" && (t.replace(/ |-/g, "") === "" || t.replace(/ |_/g, "") === "" || t.replace(/ |\*/g, "") === "") && t.replace(/ /g, "").length > 2 && !(t.indexOf("-") > -1 && t.trimLeft().indexOf(" ") === -1 && e.trimRight().split(`
|
|
3218
3218
|
`).length > 1) && t.indexOf(" ") !== 0 && t.indexOf(" ") !== 0;
|
|
3219
|
-
},
|
|
3219
|
+
}, Gt = function(e) {
|
|
3220
3220
|
var t = e.trimRight().split(`
|
|
3221
3221
|
`);
|
|
3222
3222
|
return (e = t.pop()).indexOf(" ") !== 0 && e.indexOf(" ") !== 0 && (e = e.trimLeft()) !== "" && t.length !== 0 && (e.replace(/-/g, "") === "" || e.replace(/=/g, "") === "");
|
|
@@ -3240,11 +3240,11 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3240
3240
|
if (!(0, s.yl)(i) && !i.altKey && i.key === "Tab") {
|
|
3241
3241
|
var d = !1;
|
|
3242
3242
|
if ((e.startOffset === 0 && (o.nodeType === 3 && !o.previousSibling || o.nodeType !== 3 && o.nodeName === "LI") || a.classList.contains("vditor-task") && e.startOffset === 1 && o.previousSibling.nodeType !== 3 && o.previousSibling.tagName === "INPUT") && (d = !0), d || e.toString() !== "")
|
|
3243
|
-
return i.shiftKey ?
|
|
3243
|
+
return i.shiftKey ? zt(t, a, e, a.parentElement) : gn(t, a, e), i.preventDefault(), !0;
|
|
3244
3244
|
}
|
|
3245
3245
|
}
|
|
3246
3246
|
return !1;
|
|
3247
|
-
},
|
|
3247
|
+
}, Ft = function(e, t, n) {
|
|
3248
3248
|
if (e.options.tab && n.key === "Tab")
|
|
3249
3249
|
return n.shiftKey || (t.toString() === "" ? (t.insertNode(document.createTextNode(e.options.tab)), t.collapse(!1)) : (t.extractContents(), t.insertNode(document.createTextNode(e.options.tab)), t.collapse(!1))), (0, C.Hc)(t), se(e), n.preventDefault(), !0;
|
|
3250
3250
|
}, bn = function(e, t, n, i) {
|
|
@@ -3257,19 +3257,19 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3257
3257
|
}).join("|");
|
|
3258
3258
|
return a = n.textContent + `
|
|
3259
3259
|
` + a.substring(3, a.length - 3) + `
|
|
3260
|
-
|<wbr>`, n.outerHTML = t.lute.SpinVditorDOM(a), (0, C.ib)(t[t.currentMode].element, i), se(t),
|
|
3260
|
+
|<wbr>`, n.outerHTML = t.lute.SpinVditorDOM(a), (0, C.ib)(t[t.currentMode].element, i), se(t), Ce(t), e.preventDefault(), !0;
|
|
3261
3261
|
}
|
|
3262
|
-
if (
|
|
3262
|
+
if (Kt(n.innerHTML) && n.previousElementSibling) {
|
|
3263
3263
|
var d = "", v = n.innerHTML.trimRight().split(`
|
|
3264
3264
|
`);
|
|
3265
3265
|
return v.length > 1 && (v.pop(), d = '<p data-block="0">' + v.join(`
|
|
3266
3266
|
`) + "</p>"), n.insertAdjacentHTML("afterend", d + `<hr data-block="0"><p data-block="0"><wbr>
|
|
3267
|
-
</p>`), n.remove(), (0, C.ib)(t[t.currentMode].element, i), se(t),
|
|
3267
|
+
</p>`), n.remove(), (0, C.ib)(t[t.currentMode].element, i), se(t), Ce(t), e.preventDefault(), !0;
|
|
3268
3268
|
}
|
|
3269
|
-
if (
|
|
3269
|
+
if (Gt(n.innerHTML))
|
|
3270
3270
|
return t.currentMode === "wysiwyg" ? n.outerHTML = t.lute.SpinVditorDOM(n.innerHTML + `<p data-block="0"><wbr>
|
|
3271
3271
|
</p>`) : n.outerHTML = t.lute.SpinVditorIRDOM(n.innerHTML + `<p data-block="0"><wbr>
|
|
3272
|
-
</p>`), (0, C.ib)(t[t.currentMode].element, i), se(t),
|
|
3272
|
+
</p>`), (0, C.ib)(t[t.currentMode].element, i), se(t), Ce(t), e.preventDefault(), !0;
|
|
3273
3273
|
}
|
|
3274
3274
|
if (i.collapsed && n.previousElementSibling && e.key === "Backspace" && !(0, s.yl)(e) && !e.altKey && !e.shiftKey && n.textContent.trimRight().split(`
|
|
3275
3275
|
`).length > 1 && (0, C.im)(n, t[t.currentMode].element, i).start === 0) {
|
|
@@ -3313,7 +3313,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3313
3313
|
for (var a = 0; a < n.rows.length; a++) {
|
|
3314
3314
|
var d = n.rows[a].cells;
|
|
3315
3315
|
if (d.length === 1) {
|
|
3316
|
-
n.remove(),
|
|
3316
|
+
n.remove(), at(e);
|
|
3317
3317
|
break;
|
|
3318
3318
|
}
|
|
3319
3319
|
d[r].remove();
|
|
@@ -3325,7 +3325,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3325
3325
|
if (!(0, s.yl)(t) && !t.altKey && t.key === "Enter") {
|
|
3326
3326
|
r.lastElementChild && (!r.lastElementChild || r.lastElementChild.isSameNode(r.lastChild) && r.lastElementChild.tagName === "BR") || r.insertAdjacentHTML("beforeend", "<br>");
|
|
3327
3327
|
var o = document.createElement("br");
|
|
3328
|
-
return n.insertNode(o), n.setStartAfter(o), se(e),
|
|
3328
|
+
return n.insertNode(o), n.setStartAfter(o), se(e), Ce(e), t.preventDefault(), !0;
|
|
3329
3329
|
}
|
|
3330
3330
|
if (t.key === "Tab")
|
|
3331
3331
|
return t.shiftKey ? (vn(r, n), t.preventDefault(), !0) : ((h = r.nextElementSibling) || (h = r.parentElement.nextElementSibling ? r.parentElement.nextElementSibling.firstElementChild : r.parentElement.parentElement.tagName === "THEAD" && r.parentElement.parentElement.nextElementSibling ? r.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild : null), h && (n.selectNodeContents(h), (0, C.Hc)(n)), t.preventDefault(), !0);
|
|
@@ -3400,7 +3400,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3400
3400
|
return !(0, s.yl)(t) && !t.altKey && t.key === "Enter" && (n.firstElementChild.textContent.endsWith(`
|
|
3401
3401
|
`) || n.firstElementChild.insertAdjacentText("beforeend", `
|
|
3402
3402
|
`), i.extractContents(), i.insertNode(document.createTextNode(`
|
|
3403
|
-
`)), i.collapse(!1), (0, C.Hc)(i), (0, s.vU)() || (e.currentMode === "wysiwyg" ? Lt(e, i) : we(e, i)),
|
|
3403
|
+
`)), i.collapse(!1), (0, C.Hc)(i), (0, s.vU)() || (e.currentMode === "wysiwyg" ? Lt(e, i) : we(e, i)), Ce(e), t.preventDefault(), !0);
|
|
3404
3404
|
}, Mn = function(e, t, n, i) {
|
|
3405
3405
|
var r = t.startContainer, o = (0, p.lG)(r, "BLOCKQUOTE");
|
|
3406
3406
|
if (o && t.toString() === "") {
|
|
@@ -3418,7 +3418,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3418
3418
|
var d = (0, p.F9)(r);
|
|
3419
3419
|
if (e.currentMode === "wysiwyg" && d && V("⇧⌘;", n))
|
|
3420
3420
|
return t.insertNode(document.createElement("wbr")), d.outerHTML = '<blockquote data-block="0">' + d.outerHTML + "</blockquote>", (0, C.ib)(e.wysiwyg.element, t), ke(e), n.preventDefault(), !0;
|
|
3421
|
-
if (gt(e, n, t, o, o) ||
|
|
3421
|
+
if (gt(e, n, t, o, o) || st(e, n, t, o, o))
|
|
3422
3422
|
return !0;
|
|
3423
3423
|
}
|
|
3424
3424
|
return !1;
|
|
@@ -3438,7 +3438,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3438
3438
|
if (r.textContent.trim() === "")
|
|
3439
3439
|
if ((0, p.fb)(r.parentElement, "vditor-task")) {
|
|
3440
3440
|
var d = (0, p.O9)(i);
|
|
3441
|
-
d &&
|
|
3441
|
+
d && zt(e, r, t, d);
|
|
3442
3442
|
} else if (r.nextElementSibling) {
|
|
3443
3443
|
var v = "", g = "", h = !1;
|
|
3444
3444
|
Array.from(r.parentElement.children).forEach(function(M) {
|
|
@@ -3453,7 +3453,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3453
3453
|
</p>`), r.parentElement.querySelectorAll("li").length === 1 ? r.parentElement.remove() : r.remove();
|
|
3454
3454
|
else
|
|
3455
3455
|
i.nodeType !== 3 && t.startOffset === 0 && i.firstChild.tagName === "INPUT" ? t.setStart(i.childNodes[1], 1) : (t.setEndAfter(r.lastChild), r.insertAdjacentHTML("afterend", '<li class="vditor-task" data-marker="' + r.getAttribute("data-marker") + '"><input type="checkbox"> <wbr></li>'), document.querySelector("wbr").after(t.extractContents()));
|
|
3456
|
-
return (0, C.ib)(e[e.currentMode].element, t), se(e),
|
|
3456
|
+
return (0, C.ib)(e[e.currentMode].element, t), se(e), Ce(e), n.preventDefault(), !0;
|
|
3457
3457
|
}
|
|
3458
3458
|
}
|
|
3459
3459
|
return !1;
|
|
@@ -3497,12 +3497,12 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3497
3497
|
return ["", Lute.WalkContinue];
|
|
3498
3498
|
var te = H.TokensStr();
|
|
3499
3499
|
if (H.__internal_object__.Parent.Type === 34 && te && te.indexOf("file://") === -1 && e.options.upload.linkToImgUrl) {
|
|
3500
|
-
var
|
|
3501
|
-
|
|
3502
|
-
if (
|
|
3503
|
-
if (
|
|
3504
|
-
var ee =
|
|
3505
|
-
e.options.upload.linkToImgFormat && (ee = e.options.upload.linkToImgFormat(
|
|
3500
|
+
var J = new XMLHttpRequest();
|
|
3501
|
+
J.open("POST", e.options.upload.linkToImgUrl), e.options.upload.token && J.setRequestHeader("X-Upload-Token", e.options.upload.token), e.options.upload.withCredentials && (J.withCredentials = !0), pn(e, J), J.setRequestHeader("Content-Type", "application/json; charset=utf-8"), J.onreadystatechange = function() {
|
|
3502
|
+
if (J.readyState === XMLHttpRequest.DONE) {
|
|
3503
|
+
if (J.status === 200) {
|
|
3504
|
+
var ee = J.responseText;
|
|
3505
|
+
e.options.upload.linkToImgFormat && (ee = e.options.upload.linkToImgFormat(J.responseText));
|
|
3506
3506
|
var Y = JSON.parse(ee);
|
|
3507
3507
|
if (Y.code !== 0)
|
|
3508
3508
|
return void e.tip.show(Y.msg);
|
|
@@ -3517,21 +3517,21 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3517
3517
|
}
|
|
3518
3518
|
se(e);
|
|
3519
3519
|
} else
|
|
3520
|
-
e.tip.show(
|
|
3521
|
-
e.options.upload.linkToImgCallback && e.options.upload.linkToImgCallback(
|
|
3520
|
+
e.tip.show(J.responseText);
|
|
3521
|
+
e.options.upload.linkToImgCallback && e.options.upload.linkToImgCallback(J.responseText);
|
|
3522
3522
|
}
|
|
3523
|
-
},
|
|
3523
|
+
}, J.send(JSON.stringify({ url: te }));
|
|
3524
3524
|
}
|
|
3525
3525
|
return e.currentMode === "ir" ? ['<span class="vditor-ir__marker vditor-ir__marker--link">' + Lute.EscapeHTMLStr(te) + "</span>", Lute.WalkContinue] : e.currentMode === "wysiwyg" ? ["", Lute.WalkContinue] : ['<span class="vditor-sv__marker--link">' + Lute.EscapeHTMLStr(te) + "</span>", Lute.WalkContinue];
|
|
3526
3526
|
}, i.replace(/&/g, "&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi, "").trim() !== '<a href="' + r + '">' + r + "</a>" && i.replace(/&/g, "&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi, "").trim() !== '<!--StartFragment--><a href="' + r + '">' + r + "</a><!--EndFragment-->" || (i = ""), (v = new DOMParser().parseFromString(i, "text/html")).body && (i = v.body.innerHTML), i = Lute.Sanitize(i), e.wysiwyg.getComments(e), g = e[e.currentMode].element.scrollHeight, h = function(H, F, te) {
|
|
3527
3527
|
te === void 0 && (te = "sv");
|
|
3528
|
-
var
|
|
3529
|
-
|
|
3528
|
+
var J = document.createElement("div");
|
|
3529
|
+
J.innerHTML = H;
|
|
3530
3530
|
var ee = !1;
|
|
3531
|
-
|
|
3532
|
-
var Y =
|
|
3533
|
-
if (
|
|
3534
|
-
<p class="p1">`) === 0 && (ee = !0),
|
|
3531
|
+
J.childElementCount === 1 && J.lastElementChild.style.fontFamily.indexOf("monospace") > -1 && (ee = !0);
|
|
3532
|
+
var Y = J.querySelectorAll("pre");
|
|
3533
|
+
if (J.childElementCount === 1 && Y.length === 1 && Y[0].className !== "vditor-wysiwyg" && Y[0].className !== "vditor-sv" && (ee = !0), H.indexOf(`
|
|
3534
|
+
<p class="p1">`) === 0 && (ee = !0), J.childElementCount === 1 && J.firstElementChild.tagName === "TABLE" && J.querySelector(".line-number") && J.querySelector(".line-content") && (ee = !0), ee) {
|
|
3535
3535
|
var G = F || H;
|
|
3536
3536
|
return /\n/.test(G) || Y.length === 1 ? te === "wysiwyg" ? '<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>' + G.replace(/&/g, "&").replace(/</g, "<") + "<wbr></code></pre></div>" : "\n```\n" + G.replace(/&/g, "&").replace(/</g, "<") + "\n```" : te === "wysiwyg" ? "<code>" + G.replace(/&/g, "&").replace(/</g, "<") + "</code><wbr>" : "`" + G + "`";
|
|
3537
3537
|
}
|
|
@@ -3546,7 +3546,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3546
3546
|
H.remove();
|
|
3547
3547
|
}), e.currentMode === "ir" ? (a.HTML2VditorIRDOM = { renderLinkDest: d }, e.lute.SetJSRenderers({ renderers: a }), (0, C.oC)(e.lute.HTML2VditorIRDOM(U.innerHTML), e)) : e.currentMode === "wysiwyg" ? (a.HTML2VditorDOM = { renderLinkDest: d }, e.lute.SetJSRenderers({ renderers: a }), (0, C.oC)(e.lute.HTML2VditorDOM(U.innerHTML), e)) : (a.Md2VditorSVDOM = { renderLinkDest: d }, e.lute.SetJSRenderers({ renderers: a }), ln(e, e.lute.HTML2Md(U.innerHTML).trimRight())), e.outline.render(e), [3, 8]);
|
|
3548
3548
|
case 3:
|
|
3549
|
-
return o.length > 0 ? e.options.upload.url || e.options.upload.handler ? [4,
|
|
3549
|
+
return o.length > 0 ? e.options.upload.url || e.options.upload.handler ? [4, Wt(e, o)] : [3, 5] : [3, 7];
|
|
3550
3550
|
case 4:
|
|
3551
3551
|
return P.sent(), [3, 6];
|
|
3552
3552
|
case 5:
|
|
@@ -3565,7 +3565,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3565
3565
|
H.remove();
|
|
3566
3566
|
}), D.insertNode(document.createElement("wbr")), e.currentMode === "wysiwyg" ? q.outerHTML = e.lute.SpinVditorDOM(q.outerHTML) : q.outerHTML = e.lute.SpinVditorIRDOM(q.outerHTML), (0, C.ib)(e[e.currentMode].element, D)), e[e.currentMode].element.querySelectorAll(".vditor-" + e.currentMode + "__preview[data-render='2']").forEach(function(H) {
|
|
3567
3567
|
Me(H, e);
|
|
3568
|
-
})), e.wysiwyg.triggerRemoveComment(e), se(e), e[e.currentMode].element.scrollHeight - g > Math.min(e[e.currentMode].element.clientHeight, window.innerHeight) / 2 &&
|
|
3568
|
+
})), e.wysiwyg.triggerRemoveComment(e), se(e), e[e.currentMode].element.scrollHeight - g > Math.min(e[e.currentMode].element.clientHeight, window.innerHeight) / 2 && Ce(e), [2];
|
|
3569
3569
|
}
|
|
3570
3570
|
});
|
|
3571
3571
|
});
|
|
@@ -3848,7 +3848,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3848
3848
|
this.composingLock = !1;
|
|
3849
3849
|
var n = document.createElement("div");
|
|
3850
3850
|
n.className = "vditor-ir", n.innerHTML = '<pre class="vditor-reset" placeholder="' + t.options.placeholder + `"
|
|
3851
|
-
contenteditable="true" spellcheck="false"></pre>`, this.element = n.firstElementChild, this.bindEvent(t),
|
|
3851
|
+
contenteditable="true" spellcheck="false"></pre>`, this.element = n.firstElementChild, this.bindEvent(t), jt(t, this.element), sn(t, this.element), Rt(t, this.element), Vt(t, this.element), Ut(t, this.element), Pt(t, this.element), qt(t, this.element, this.copy), Bt(t, this.element, this.copy);
|
|
3852
3852
|
}
|
|
3853
3853
|
return e.prototype.copy = function(t, n) {
|
|
3854
3854
|
var i = getSelection().getRangeAt(0);
|
|
@@ -3876,7 +3876,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3876
3876
|
if (i.target.tagName === "INPUT")
|
|
3877
3877
|
return i.target.checked ? i.target.setAttribute("checked", "checked") : i.target.removeAttribute("checked"), n.preventInput = !0, void $e(t);
|
|
3878
3878
|
var r = (0, C.zh)(t), o = (0, p.fb)(i.target, "vditor-ir__preview");
|
|
3879
|
-
if (o || (o = (0, p.fb)(r.startContainer, "vditor-ir__preview")), o && (o.previousElementSibling.firstElementChild ? r.selectNodeContents(o.previousElementSibling.firstElementChild) : r.selectNodeContents(o.previousElementSibling), r.collapse(!0), (0, C.Hc)(r),
|
|
3879
|
+
if (o || (o = (0, p.fb)(r.startContainer, "vditor-ir__preview")), o && (o.previousElementSibling.firstElementChild ? r.selectNodeContents(o.previousElementSibling.firstElementChild) : r.selectNodeContents(o.previousElementSibling), r.collapse(!0), (0, C.Hc)(r), Ce(t)), i.target.tagName === "IMG") {
|
|
3880
3880
|
var a = i.target.parentElement.querySelector(".vditor-ir__marker--link");
|
|
3881
3881
|
a && (r.selectNode(a), (0, C.Hc)(r));
|
|
3882
3882
|
}
|
|
@@ -3893,7 +3893,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3893
3893
|
t.options.link.click ? t.options.link.click(d.querySelector(":scope > .vditor-ir__marker--link")) : t.options.link.isOpen && window.open(d.querySelector(":scope > .vditor-ir__marker--link").textContent);
|
|
3894
3894
|
}), this.element.addEventListener("keyup", function(i) {
|
|
3895
3895
|
if (!i.isComposing && !(0, s.yl)(i))
|
|
3896
|
-
if (i.key === "Enter" &&
|
|
3896
|
+
if (i.key === "Enter" && Ce(t), mt(t), i.key !== "Backspace" && i.key !== "Delete" || t.ir.element.innerHTML === "" || t.ir.element.childNodes.length !== 1 || !t.ir.element.firstElementChild || t.ir.element.firstElementChild.tagName !== "P" || t.ir.element.firstElementChild.childElementCount !== 0 || t.ir.element.textContent !== "" && t.ir.element.textContent !== `
|
|
3897
3897
|
`) {
|
|
3898
3898
|
var r = (0, C.zh)(t);
|
|
3899
3899
|
i.key === "Backspace" ? ((0, s.vU)() && r.startContainer.textContent === `
|
|
@@ -3914,7 +3914,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3914
3914
|
}, e;
|
|
3915
3915
|
}(), Nn = function(e) {
|
|
3916
3916
|
return e.currentMode === "sv" ? e.lute.Md2HTML(m(e)) : e.currentMode === "wysiwyg" ? e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML) : e.currentMode === "ir" ? e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML) : void 0;
|
|
3917
|
-
}, pr =
|
|
3917
|
+
}, pr = X(895), Dn = X(818), mr = function() {
|
|
3918
3918
|
function e(t) {
|
|
3919
3919
|
this.element = document.createElement("div"), this.element.className = "vditor-outline", this.element.innerHTML = '<div class="vditor-outline__title">' + t + `</div>
|
|
3920
3920
|
<div class="vditor-outline__content"></div>`;
|
|
@@ -3929,9 +3929,9 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3929
3929
|
var a = getSelection().getRangeAt(0);
|
|
3930
3930
|
t[t.currentMode].element.contains(a.startContainer) && (0, C.Hc)(a);
|
|
3931
3931
|
}
|
|
3932
|
-
|
|
3932
|
+
pe(t);
|
|
3933
3933
|
}, e;
|
|
3934
|
-
}(), fr =
|
|
3934
|
+
}(), fr = X(554), hr = function() {
|
|
3935
3935
|
function e(t) {
|
|
3936
3936
|
var n = this;
|
|
3937
3937
|
this.element = document.createElement("div"), this.element.className = "vditor-preview", this.previewElement = document.createElement("div"), this.previewElement.className = "vditor-reset", t.options.classes.preview && this.previewElement.classList.add(t.options.classes.preview), this.previewElement.style.maxWidth = t.options.preview.maxWidth + "px", this.previewElement.addEventListener("copy", function(v) {
|
|
@@ -3947,7 +3947,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
3947
3947
|
} else {
|
|
3948
3948
|
if (v.target.tagName === "A")
|
|
3949
3949
|
return t.options.link.click ? t.options.link.click(v.target) : t.options.link.isOpen && window.open(v.target.getAttribute("href")), void v.preventDefault();
|
|
3950
|
-
v.target.tagName === "IMG" && (t.options.image.preview ? t.options.image.preview(v.target) : t.options.image.isPreview && (0,
|
|
3950
|
+
v.target.tagName === "IMG" && (t.options.image.preview ? t.options.image.preview(v.target) : t.options.image.isPreview && (0, ie.E)(v.target, t.options.lang, t.options.theme));
|
|
3951
3951
|
}
|
|
3952
3952
|
}), this.element.appendChild(this.previewElement);
|
|
3953
3953
|
var i = t.options.preview.actions;
|
|
@@ -4025,7 +4025,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
4025
4025
|
var i = (/* @__PURE__ */ new Date()).getTime() - n;
|
|
4026
4026
|
(/* @__PURE__ */ new Date()).getTime() - n > 2600 ? (t.tip.show(window.VditorI18n.performanceTip.replace("${x}", i.toString())), t.preview.element.setAttribute("data-type", "renderPerformance")) : t.preview.element.getAttribute("data-type") === "renderPerformance" && (t.tip.hide(), t.preview.element.removeAttribute("data-type"));
|
|
4027
4027
|
var r = t.preview.element.querySelector(".vditor-comment--focus");
|
|
4028
|
-
r && r.classList.remove("vditor-comment--focus"), (0,
|
|
4028
|
+
r && r.classList.remove("vditor-comment--focus"), (0, Z.O)(t.preview.previewElement, t.options.preview.hljs), (0, ue.s)(t.options.preview.hljs, t.preview.previewElement, t.options.cdn), (0, be.i)(t.preview.previewElement, t.options.cdn, t.options.theme), (0, He.K)(t.preview.previewElement, t.options.cdn, t.options.theme), (0, ne.P)(t.preview.previewElement, t.options.cdn), (0, ge.v)(t.preview.previewElement, t.options.cdn), (0, N.p)(t.preview.previewElement, t.options.cdn, t.options.theme), (0, Te.P)(t.preview.previewElement, t.options.cdn, t.options.theme), (0, Qe.B)(t.preview.previewElement, t.options.cdn), (0, W.Q)(t.preview.previewElement, t.options.cdn), t.options.preview.render.media.enable && (0, fr.Y)(t.preview.previewElement), t.options.customRenders.forEach(function(d) {
|
|
4029
4029
|
d.render(t.preview.previewElement, t);
|
|
4030
4030
|
});
|
|
4031
4031
|
var o = t.preview.element, a = t.outline.render(t);
|
|
@@ -4062,7 +4062,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
4062
4062
|
}, e;
|
|
4063
4063
|
}(), gr = function() {
|
|
4064
4064
|
function e(t) {
|
|
4065
|
-
this.composingLock = !1, this.element = document.createElement("pre"), this.element.className = "vditor-sv vditor-reset", this.element.setAttribute("placeholder", t.options.placeholder), this.element.setAttribute("contenteditable", "true"), this.element.setAttribute("spellcheck", "false"), this.bindEvent(t),
|
|
4065
|
+
this.composingLock = !1, this.element = document.createElement("pre"), this.element.className = "vditor-sv vditor-reset", this.element.setAttribute("placeholder", t.options.placeholder), this.element.setAttribute("contenteditable", "true"), this.element.setAttribute("spellcheck", "false"), this.bindEvent(t), jt(t, this.element), Rt(t, this.element), Vt(t, this.element), Ut(t, this.element), Pt(t, this.element), qt(t, this.element, this.copy), Bt(t, this.element, this.copy);
|
|
4066
4066
|
}
|
|
4067
4067
|
return e.prototype.copy = function(t, n) {
|
|
4068
4068
|
t.stopPropagation(), t.preventDefault(), t.clipboardData.setData("text/plain", vt(n[n.currentMode].element));
|
|
@@ -4086,7 +4086,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
4086
4086
|
return n.preventInput ? (n.preventInput = !1, void Ne(t, { enableAddUndoStack: !0, enableHint: !0, enableInput: !0 })) : void ae(t, i);
|
|
4087
4087
|
}), this.element.addEventListener("keyup", function(i) {
|
|
4088
4088
|
i.isComposing || (0, s.yl)(i) || (i.key !== "Backspace" && i.key !== "Delete" || t.sv.element.innerHTML === "" || t.sv.element.childNodes.length !== 1 || !t.sv.element.firstElementChild || t.sv.element.firstElementChild.tagName !== "DIV" || t.sv.element.firstElementChild.childElementCount !== 2 || t.sv.element.firstElementChild.textContent !== "" && t.sv.element.textContent !== `
|
|
4089
|
-
` ? i.key === "Enter" &&
|
|
4089
|
+
` ? i.key === "Enter" && Ce(t) : t.sv.element.innerHTML = "");
|
|
4090
4090
|
});
|
|
4091
4091
|
}, e;
|
|
4092
4092
|
}(), On = function() {
|
|
@@ -4106,7 +4106,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
4106
4106
|
}, e.prototype.hide = function() {
|
|
4107
4107
|
this.element.className = "vditor-messageElementtip", this.element.innerHTML = "";
|
|
4108
4108
|
}, e;
|
|
4109
|
-
}(),
|
|
4109
|
+
}(), $t = function(e, t) {
|
|
4110
4110
|
if (t.options.preview.mode !== e) {
|
|
4111
4111
|
switch (t.options.preview.mode = e, e) {
|
|
4112
4112
|
case "both":
|
|
@@ -4136,13 +4136,13 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
4136
4136
|
function t(n, i) {
|
|
4137
4137
|
var r = e.call(this, n, i) || this;
|
|
4138
4138
|
return n.options.preview.mode === "both" && r.element.children[0].classList.add("vditor-menu--current"), r.element.children[0].addEventListener((0, s.Le)(), function(o) {
|
|
4139
|
-
r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED) || (o.preventDefault(), n.currentMode === "sv" && (n.options.preview.mode === "both" ?
|
|
4139
|
+
r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED) || (o.preventDefault(), n.currentMode === "sv" && (n.options.preview.mode === "both" ? $t("editor", n) : $t("both", n)));
|
|
4140
4140
|
}), r;
|
|
4141
4141
|
}
|
|
4142
4142
|
return yr(t, e), t;
|
|
4143
4143
|
}(_e), wr = function() {
|
|
4144
4144
|
this.element = document.createElement("div"), this.element.className = "vditor-toolbar__br";
|
|
4145
|
-
}, In =
|
|
4145
|
+
}, In = X(312), Er = /* @__PURE__ */ function() {
|
|
4146
4146
|
var e = function(t, n) {
|
|
4147
4147
|
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, r) {
|
|
4148
4148
|
i.__proto__ = r;
|
|
@@ -4254,7 +4254,7 @@ onclick="this.previousElementSibling.select();document.execCommand('copy');this.
|
|
|
4254
4254
|
var r = e.call(this, n, i) || this;
|
|
4255
4255
|
return r.element.firstElementChild.addEventListener((0, s.Le)(), function(o) {
|
|
4256
4256
|
var a = r.element.firstElementChild;
|
|
4257
|
-
a.classList.contains(b.g.CLASS_MENU_DISABLED) || (o.preventDefault(), a.classList.contains("vditor-menu--current") ? (a.classList.remove("vditor-menu--current"), n.devtools.element.style.display = "none",
|
|
4257
|
+
a.classList.contains(b.g.CLASS_MENU_DISABLED) || (o.preventDefault(), a.classList.contains("vditor-menu--current") ? (a.classList.remove("vditor-menu--current"), n.devtools.element.style.display = "none", pe(n)) : (a.classList.add("vditor-menu--current"), n.devtools.element.style.display = "block", pe(n), n.devtools.renderEchart(n)));
|
|
4258
4258
|
}), r;
|
|
4259
4259
|
}
|
|
4260
4260
|
return Cr(t, e), t;
|
|
@@ -4435,7 +4435,7 @@ window.addEventListener("message", (e) => {
|
|
|
4435
4435
|
}), n.counter && (n.counter.element.className = n.counter.element.className.replace("__s", "__n"))) : (i.level || (this.innerHTML = '<svg><use xlink:href="#vditor-icon-contract"></use></svg>'), n.element.style.zIndex = n.options.fullscreen.index.toString(), document.body.style.overflow = "hidden", n.element.classList.add("vditor--fullscreen"), Object.keys(n.toolbar.elements).forEach(function(o) {
|
|
4436
4436
|
var a = n.toolbar.elements[o].firstChild;
|
|
4437
4437
|
a && (a.className = a.className.replace("__n", "__s"));
|
|
4438
|
-
}), n.counter && (n.counter.element.className = n.counter.element.className.replace("__n", "__s"))), n.devtools && n.devtools.renderEchart(n), i.click && i.click(r, n),
|
|
4438
|
+
}), n.counter && (n.counter.element.className = n.counter.element.className.replace("__n", "__s"))), n.devtools && n.devtools.renderEchart(n), i.click && i.click(r, n), pe(n), Q(n);
|
|
4439
4439
|
});
|
|
4440
4440
|
}, t;
|
|
4441
4441
|
}(_e), Rr = /* @__PURE__ */ function() {
|
|
@@ -4466,7 +4466,7 @@ window.addEventListener("message", (e) => {
|
|
|
4466
4466
|
return Rr(t, e), t.prototype._bindEvent = function(n, i) {
|
|
4467
4467
|
var r = this.element.children[0];
|
|
4468
4468
|
r.addEventListener((0, s.Le)(), function(a) {
|
|
4469
|
-
a.preventDefault(), clearTimeout(n.wysiwyg.afterRenderTimeoutId), clearTimeout(n.ir.processTimeoutId), clearTimeout(n.sv.processTimeoutId), r.classList.contains(b.g.CLASS_MENU_DISABLED) || (r.blur(), r.classList.contains("vditor-menu--current") ? (n.currentMode === "wysiwyg" ? (
|
|
4469
|
+
a.preventDefault(), clearTimeout(n.wysiwyg.afterRenderTimeoutId), clearTimeout(n.ir.processTimeoutId), clearTimeout(n.sv.processTimeoutId), r.classList.contains(b.g.CLASS_MENU_DISABLED) || (r.blur(), r.classList.contains("vditor-menu--current") ? (n.currentMode === "wysiwyg" ? (Ot(n), ke(n)) : n.currentMode === "ir" && yt(n, ""), r.classList.remove("vditor-menu--current")) : (E(n, ["subToolbar"]), i.style.display = "block"));
|
|
4470
4470
|
});
|
|
4471
4471
|
for (var o = 0; o < 6; o++)
|
|
4472
4472
|
i.children.item(o).addEventListener((0, s.Le)(), function(a) {
|
|
@@ -4660,7 +4660,7 @@ window.addEventListener("message", (e) => {
|
|
|
4660
4660
|
return r.element.children[0].addEventListener((0, s.Le)(), function(o) {
|
|
4661
4661
|
if (o.preventDefault(), !r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED) && n.currentMode !== "sv") {
|
|
4662
4662
|
var a = (0, C.zh)(n), d = (0, p.lG)(a.startContainer, "LI");
|
|
4663
|
-
d &&
|
|
4663
|
+
d && zt(n, d, a, d.parentElement);
|
|
4664
4664
|
}
|
|
4665
4665
|
}), r;
|
|
4666
4666
|
}
|
|
@@ -4717,7 +4717,7 @@ window.addEventListener("message", (e) => {
|
|
|
4717
4717
|
var a = b.g.EDIT_TOOLBARS.concat(["both", "edit-mode", "devtools"]);
|
|
4718
4718
|
o.classList.contains("vditor-menu--current") ? (o.classList.remove("vditor-menu--current"), n.currentMode === "sv" ? (n.sv.element.style.display = "block", n.options.preview.mode === "both" ? n.preview.element.style.display = "block" : n.preview.element.style.display = "none") : (n[n.currentMode].element.parentElement.style.display = "block", n.preview.element.style.display = "none"), w(n.toolbar.elements, a), n.outline.render(n)) : (L(n.toolbar.elements, a), n.preview.element.style.display = "block", n.currentMode === "sv" ? n.sv.element.style.display = "none" : n[n.currentMode].element.parentElement.style.display = "none", n.preview.render(n), o.classList.add("vditor-menu--current"), E(n, ["subToolbar", "hint", "popover"]), setTimeout(function() {
|
|
4719
4719
|
n.outline.render(n);
|
|
4720
|
-
}, n.options.preview.delay + 10)),
|
|
4720
|
+
}, n.options.preview.delay + 10)), pe(n);
|
|
4721
4721
|
}
|
|
4722
4722
|
});
|
|
4723
4723
|
}, t;
|
|
@@ -4800,7 +4800,7 @@ window.addEventListener("message", (e) => {
|
|
|
4800
4800
|
if (i.isRecording) {
|
|
4801
4801
|
i.stopRecording(), n.tip.hide();
|
|
4802
4802
|
var d = new File([i.buildWavFileBlob()], "record" + (/* @__PURE__ */ new Date()).getTime() + ".wav", { type: "video/webm" });
|
|
4803
|
-
|
|
4803
|
+
Wt(n, [d]), r.element.children[0].classList.remove("vditor-menu--current");
|
|
4804
4804
|
} else
|
|
4805
4805
|
n.tip.show(window.VditorI18n.recording), a.setAttribute("contenteditable", "false"), i.startRecordingNewWavFile(), r.element.children[0].classList.add("vditor-menu--current");
|
|
4806
4806
|
else
|
|
@@ -4891,7 +4891,7 @@ window.addEventListener("message", (e) => {
|
|
|
4891
4891
|
}), this.element.querySelector("input").addEventListener("change", function(r) {
|
|
4892
4892
|
if (i.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED))
|
|
4893
4893
|
return r.stopPropagation(), void r.preventDefault();
|
|
4894
|
-
r.target.files.length !== 0 &&
|
|
4894
|
+
r.target.files.length !== 0 && Wt(n, r.target.files, r.target);
|
|
4895
4895
|
});
|
|
4896
4896
|
}, t;
|
|
4897
4897
|
}(_e), di = function() {
|
|
@@ -5004,7 +5004,7 @@ window.addEventListener("message", (e) => {
|
|
|
5004
5004
|
return o !== "br" && o !== "|" || (o += i), this.elements[o] = r.element, r.element;
|
|
5005
5005
|
}
|
|
5006
5006
|
}, e;
|
|
5007
|
-
}(), ui =
|
|
5007
|
+
}(), ui = X(471), pi = function() {
|
|
5008
5008
|
function e() {
|
|
5009
5009
|
this.stackSize = 50, this.resetStack(), this.dmp = new ui();
|
|
5010
5010
|
}
|
|
@@ -5044,12 +5044,12 @@ window.addEventListener("message", (e) => {
|
|
|
5044
5044
|
if (this[n.currentMode].lastText = r, n[n.currentMode].element.innerHTML = r, n.currentMode !== "sv" && n[n.currentMode].element.querySelectorAll(".vditor-" + n.currentMode + "__preview[data-render='2']").forEach(function(d) {
|
|
5045
5045
|
Me(d, n);
|
|
5046
5046
|
}), n[n.currentMode].element.querySelector("wbr"))
|
|
5047
|
-
(0, C.ib)(n[n.currentMode].element, n[n.currentMode].element.ownerDocument.createRange()),
|
|
5047
|
+
(0, C.ib)(n[n.currentMode].element, n[n.currentMode].element.ownerDocument.createRange()), Ce(n);
|
|
5048
5048
|
else {
|
|
5049
5049
|
var a = getSelection().getRangeAt(0);
|
|
5050
5050
|
a.setEndBefore(n[n.currentMode].element), a.collapse(!1);
|
|
5051
5051
|
}
|
|
5052
|
-
Ke(n), se(n, { enableAddUndoStack: !1, enableHint: !1, enableInput: !0 }),
|
|
5052
|
+
Ke(n), se(n, { enableAddUndoStack: !1, enableHint: !1, enableInput: !0 }), at(n), n[n.currentMode].element.querySelectorAll(".vditor-" + n.currentMode + "__preview[data-render='2']").forEach(function(d) {
|
|
5053
5053
|
Me(d, n);
|
|
5054
5054
|
}), this[n.currentMode].undoStack.length > 1 ? w(n.toolbar.elements, ["undo"]) : L(n.toolbar.elements, ["undo"]), this[n.currentMode].redoStack.length !== 0 ? w(n.toolbar.elements, ["redo"]) : L(n.toolbar.elements, ["redo"]);
|
|
5055
5055
|
}, e.prototype.resetStack = function() {
|
|
@@ -5072,7 +5072,7 @@ window.addEventListener("message", (e) => {
|
|
|
5072
5072
|
d.remove();
|
|
5073
5073
|
}), n && i && (0, C.Hc)(i), a.replace('<span class="vditor-wbr"></span>', "<wbr>");
|
|
5074
5074
|
}, e;
|
|
5075
|
-
}(), mi =
|
|
5075
|
+
}(), mi = X(640), fi = function() {
|
|
5076
5076
|
function e(t) {
|
|
5077
5077
|
this.defaultOptions = { rtl: !1, after: void 0, cache: { enable: !0 }, cdn: b.g.CDN, classes: { preview: "" }, comment: { enable: !1 }, counter: { enable: !1, type: "markdown" }, customRenders: [], debugger: !1, fullscreen: { index: 90 }, height: "auto", hint: { delay: 200, emoji: { "+1": "👍", "-1": "👎", confused: "😕", eyes: "👀️", heart: "❤️", rocket: "🚀️", smile: "😄", tada: "🎉️" }, emojiPath: b.g.CDN + "/dist/images/emoji", extend: [], parse: !0 }, icon: "ant", lang: "zh_CN", mode: "ir", outline: { enable: !1, position: "left" }, placeholder: "", preview: { actions: ["desktop", "tablet", "mobile", "mp-wechat", "zhihu"], delay: 1e3, hljs: b.g.HLJS_OPTIONS, markdown: b.g.MARKDOWN_OPTIONS, math: b.g.MATH_OPTIONS, maxWidth: 800, mode: "both", theme: b.g.THEME_OPTIONS, render: { media: { enable: !0 } } }, link: { isOpen: !0 }, image: { isPreview: !0 }, resize: { enable: !1, position: "bottom" }, theme: "classic", toolbar: ["emoji", "headings", "bold", "italic", "strike", "link", "|", "list", "ordered-list", "check", "outdent", "indent", "|", "quote", "line", "code", "inline-code", "insert-before", "insert-after", "|", "upload", "record", "table", "|", "undo", "redo", "|", "fullscreen", "edit-mode", { name: "more", toolbar: ["both", "code-theme", "content-theme", "export", "outline", "preview", "devtools", "info", "help"] }], toolbarConfig: { hide: !1, pin: !1 }, typewriterMode: !1, undoDelay: 800, upload: { extraData: {}, fieldName: "file[]", filename: function(n) {
|
|
5078
5078
|
return n.replace(/\W/g, "");
|
|
@@ -5109,7 +5109,7 @@ window.addEventListener("message", (e) => {
|
|
|
5109
5109
|
<button type="button" aria-label="` + window.VditorI18n.comment + `" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
|
|
5110
5110
|
<svg><use xlink:href="#vditor-icon-comment"></use></svg>
|
|
5111
5111
|
</button>
|
|
5112
|
-
</div>`, this.element = i.firstElementChild, this.popover = i.firstElementChild.nextElementSibling, this.selectPopover = i.lastElementChild, this.bindEvent(t),
|
|
5112
|
+
</div>`, this.element = i.firstElementChild, this.popover = i.firstElementChild.nextElementSibling, this.selectPopover = i.lastElementChild, this.bindEvent(t), jt(t, this.element), sn(t, this.element), Rt(t, this.element), Vt(t, this.element), Ut(t, this.element), Pt(t, this.element), qt(t, this.element, this.copy), Bt(t, this.element, this.copy), t.options.comment.enable && (this.selectPopover.querySelector("button").onclick = function() {
|
|
5113
5113
|
var r, o, a = Lute.NewNodeID(), d = getSelection().getRangeAt(0), v = d.cloneRange(), g = d.extractContents(), h = !1, A = !1;
|
|
5114
5114
|
g.childNodes.forEach(function(M, R) {
|
|
5115
5115
|
var q = !1;
|
|
@@ -5234,7 +5234,7 @@ window.addEventListener("message", (e) => {
|
|
|
5234
5234
|
break;
|
|
5235
5235
|
}
|
|
5236
5236
|
var h = (0, x.W)(getSelection().getRangeAt(0).startContainer);
|
|
5237
|
-
h && h.textContent === "" && (Ke(t), h.remove()), d && o.getAttribute("data-type") !== "code-block" || g ||
|
|
5237
|
+
h && h.textContent === "" && (Ke(t), h.remove()), d && o.getAttribute("data-type") !== "code-block" || g || Gt(o.innerHTML) || Kt(o.innerHTML) && o.previousElementSibling ? typeof t.options.input == "function" && t.options.input(m(t)) : (i.inputType === "insertParagraph" && n.element.innerHTML === "<p><br></p><p><br></p>" && o.previousElementSibling.remove(), Lt(t, r, i));
|
|
5238
5238
|
}
|
|
5239
5239
|
}
|
|
5240
5240
|
}
|
|
@@ -5252,7 +5252,7 @@ window.addEventListener("message", (e) => {
|
|
|
5252
5252
|
var d = n.element.lastElementChild.getBoundingClientRect();
|
|
5253
5253
|
i.y > d.top + d.height && (n.element.lastElementChild.tagName === "P" && n.element.lastElementChild.textContent.trim().replace(b.g.ZWSP, "") === "" ? (a.selectNodeContents(n.element.lastElementChild), a.collapse(!1)) : (n.element.insertAdjacentHTML("beforeend", '<p data-block="0">' + b.g.ZWSP + "<wbr></p>"), (0, C.ib)(n.element, a)));
|
|
5254
5254
|
}
|
|
5255
|
-
|
|
5255
|
+
tt(t);
|
|
5256
5256
|
var v = (0, p.fb)(i.target, "vditor-wysiwyg__preview");
|
|
5257
5257
|
v || (v = (0, p.fb)((0, C.zh)(t).startContainer, "vditor-wysiwyg__preview")), v && ft(v, t), kt(i, t);
|
|
5258
5258
|
} else
|
|
@@ -5284,15 +5284,15 @@ window.addEventListener("message", (e) => {
|
|
|
5284
5284
|
O();
|
|
5285
5285
|
}, B.onkeydown = function(P) {
|
|
5286
5286
|
Ie(h, P);
|
|
5287
|
-
},
|
|
5287
|
+
}, qe(A, h), h.wysiwyg.popover.insertAdjacentElement("beforeend", U), h.wysiwyg.popover.insertAdjacentElement("beforeend", R), h.wysiwyg.popover.insertAdjacentElement("beforeend", D), Pe(h, A);
|
|
5288
5288
|
}(i, t);
|
|
5289
5289
|
}), this.element.addEventListener("keyup", function(i) {
|
|
5290
5290
|
if (!i.isComposing && !(0, s.yl)(i)) {
|
|
5291
|
-
i.key === "Enter" &&
|
|
5291
|
+
i.key === "Enter" && Ce(t), i.key !== "Backspace" && i.key !== "Delete" || t.wysiwyg.element.innerHTML === "" || t.wysiwyg.element.childNodes.length !== 1 || !t.wysiwyg.element.firstElementChild || t.wysiwyg.element.firstElementChild.tagName !== "P" || t.wysiwyg.element.firstElementChild.childElementCount !== 0 || t.wysiwyg.element.textContent !== "" && t.wysiwyg.element.textContent !== `
|
|
5292
5292
|
` || (t.wysiwyg.element.innerHTML = "");
|
|
5293
5293
|
var r = (0, C.zh)(t);
|
|
5294
5294
|
if (i.key === "Backspace" && (0, s.vU)() && r.startContainer.textContent === `
|
|
5295
|
-
` && r.startOffset === 1 && (r.startContainer.textContent = ""), rn(t, r),
|
|
5295
|
+
` && r.startOffset === 1 && (r.startContainer.textContent = ""), rn(t, r), tt(t), i.key === "ArrowDown" || i.key === "ArrowRight" || i.key === "Backspace" || i.key === "ArrowLeft" || i.key === "ArrowUp") {
|
|
5296
5296
|
i.key !== "ArrowLeft" && i.key !== "ArrowRight" || t.hint.render(t);
|
|
5297
5297
|
var o = (0, p.fb)(r.startContainer, "vditor-wysiwyg__preview");
|
|
5298
5298
|
if (!o && r.startContainer.nodeType !== 3 && r.startOffset > 0 && (d = r.startContainer).classList.contains("vditor-wysiwyg__block") && (o = d.lastElementChild), o)
|
|
@@ -5406,7 +5406,7 @@ window.addEventListener("message", (e) => {
|
|
|
5406
5406
|
}, t.prototype.tip = function(n, i) {
|
|
5407
5407
|
this.vditor.tip.show(n, i);
|
|
5408
5408
|
}, t.prototype.setPreviewMode = function(n) {
|
|
5409
|
-
|
|
5409
|
+
$t(n, this.vditor);
|
|
5410
5410
|
}, t.prototype.deleteValue = function() {
|
|
5411
5411
|
window.getSelection().isCollapsed || document.execCommand("delete", !1);
|
|
5412
5412
|
}, t.prototype.updateValue = function(n) {
|
|
@@ -5482,7 +5482,7 @@ window.addEventListener("message", (e) => {
|
|
|
5482
5482
|
var a = document.createElement("div");
|
|
5483
5483
|
if (a.className = "vditor-content", o.options.outline.position === "left" && a.appendChild(o.outline.element), a.appendChild(o.wysiwyg.element.parentElement), a.appendChild(o.sv.element), a.appendChild(o.ir.element.parentElement), a.appendChild(o.preview.element), o.toolbar.elements.devtools && a.appendChild(o.devtools.element), o.options.outline.position === "right" && (o.outline.element.classList.add("vditor-outline--right"), a.appendChild(o.outline.element)), o.upload && a.appendChild(o.upload.element), o.options.resize.enable && a.appendChild(o.resize.element), a.appendChild(o.hint.element), a.appendChild(o.tip.element), o.element.appendChild(a), a.addEventListener("click", function() {
|
|
5484
5484
|
E(o, ["subToolbar"]);
|
|
5485
|
-
}), o.toolbar.elements.export && o.element.insertAdjacentHTML("beforeend", '<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),
|
|
5485
|
+
}), o.toolbar.elements.export && o.element.insertAdjacentHTML("beforeend", '<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'), nt(o, o.options.mode, Fn(o)), document.execCommand("DefaultParagraphSeparator", !1, "p"), navigator.userAgent.indexOf("iPhone") > -1 && window.visualViewport !== void 0) {
|
|
5486
5486
|
var d = !1, v = function(g) {
|
|
5487
5487
|
d || (d = !0, requestAnimationFrame(function() {
|
|
5488
5488
|
d = !1;
|
|
@@ -5496,14 +5496,14 @@ window.addEventListener("message", (e) => {
|
|
|
5496
5496
|
});
|
|
5497
5497
|
}, t;
|
|
5498
5498
|
}(_.default);
|
|
5499
|
-
})(),
|
|
5499
|
+
})(), he = he.default;
|
|
5500
5500
|
})());
|
|
5501
5501
|
})(Gn);
|
|
5502
5502
|
var Ai = Gn.exports;
|
|
5503
|
-
const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-
|
|
5503
|
+
const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-18ce47db"), ce = ce(), Kn(), ce), Ni = { class: "sus-comment relative flex flex-row w-full" }, Di = {
|
|
5504
5504
|
key: 0,
|
|
5505
|
-
class: "absolute flex space-x-2 w-full
|
|
5506
|
-
}, Oi = /* @__PURE__ */ Wn('<div class="animate-pulse bg-gray-300 h-12 w-12 rounded-full" data-v-
|
|
5505
|
+
class: "sus-comment__main absolute top-1 left-1 flex space-x-2 w-full"
|
|
5506
|
+
}, Oi = /* @__PURE__ */ Wn('<div class="animate-pulse bg-gray-300 h-12 w-12 rounded-full" data-v-18ce47db></div><div class="space-y-2 w-4/5 mt-3" data-v-18ce47db><div class="animate-pulse rounded-md bg-gray-300 h-4 w-full" data-v-18ce47db></div><div class="animate-pulse rounded-md bg-gray-300 h-4 w-full" data-v-18ce47db></div><div class="animate-pulse rounded-md bg-gray-300 h-4 w-10/12" data-v-18ce47db></div><div class="animate-pulse rounded-md bg-gray-300 h-4 w-10/12" data-v-18ce47db></div><div class="animate-pulse rounded-md bg-gray-300 h-4 w-8/12" data-v-18ce47db></div></div>', 2), Ii = [
|
|
5507
5507
|
Oi
|
|
5508
5508
|
], ji = {
|
|
5509
5509
|
class: "sus-comment-avatar vditor-tooltipped vditor-tooltipped__ne",
|
|
@@ -5511,37 +5511,33 @@ const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-4f2bd237"), ce = ce(
|
|
|
5511
5511
|
}, Ri = ["src"], Pi = { class: "sus-comment__main" }, qi = { class: "sus-comment__info my-1" }, Bi = { class: "sus-comment__info-input" }, Vi = { class: "sus-comment__info-input" }, Ui = {
|
|
5512
5512
|
class: "sus-comment__info-input vditor-tooltipped vditor-tooltipped__n",
|
|
5513
5513
|
"aria-label": "输入QQ邮箱自动获取头像"
|
|
5514
|
-
}, Wi = {
|
|
5515
|
-
key: 0,
|
|
5516
|
-
class: "sus-comment__editor w-full"
|
|
5517
|
-
}, zi = ["id"], Ki = { class: "sus-comment__footer flex justify-between" }, Gi = { class: "flex items-center" }, Fi = ["aria-label"], $i = {
|
|
5514
|
+
}, Wi = ["id"], zi = { class: "sus-comment__footer flex justify-between" }, Ki = { class: "flex items-center" }, Gi = ["aria-label"], Fi = {
|
|
5518
5515
|
key: 0,
|
|
5519
5516
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5520
5517
|
viewBox: "0 0 24 24"
|
|
5521
|
-
},
|
|
5522
|
-
|
|
5523
|
-
],
|
|
5518
|
+
}, $i = /* @__PURE__ */ Wn('<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2" data-v-18ce47db><g data-v-18ce47db><path stroke-dasharray="4" stroke-dashoffset="4" d="M12 3V5" data-v-18ce47db><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.2s" values="4;0" data-v-18ce47db></animate></path><path stroke-dasharray="28" stroke-dashoffset="28" d="M12 5C8.68629 5 6 7.68629 6 11L6 17C5 17 4 18 4 19H12M12 5C15.3137 5 18 7.68629 18 11L18 17C19 17 20 18 20 19H12" data-v-18ce47db><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.2s" dur="0.4s" values="28;0" data-v-18ce47db></animate></path><animateTransform attributeName="transform" begin="0.8s" dur="6s" keyTimes="0;0.05;0.15;0.2;1" repeatCount="indefinite" type="rotate" values="0 12 3;3 12 3;-3 12 3;0 12 3;0 12 3" data-v-18ce47db></animateTransform></g><path stroke-dasharray="8" stroke-dashoffset="8" d="M10 20C10 21.1046 10.8954 22 12 22C13.1046 22 14 21.1046 14 20" data-v-18ce47db><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="8;0" data-v-18ce47db></animate><animateTransform attributeName="transform" begin="1s" dur="6s" keyTimes="0;0.05;0.15;0.2;1" repeatCount="indefinite" type="rotate" values="0 12 8;6 12 8;-6 12 8;0 12 8;0 12 8" data-v-18ce47db></animateTransform></path></g>', 1), Zi = [
|
|
5519
|
+
$i
|
|
5520
|
+
], Ji = {
|
|
5524
5521
|
key: 1,
|
|
5525
5522
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5526
5523
|
viewBox: "0 0 24 24"
|
|
5527
|
-
},
|
|
5524
|
+
}, Xi = /* @__PURE__ */ Hi(() => /* @__PURE__ */ oe("path", {
|
|
5528
5525
|
fill: "currentColor",
|
|
5529
5526
|
d: "M17.5 13a4.5 4.5 0 0 0-4.5 4.5a4.5 4.5 0 0 0 4.5 4.5a4.5 4.5 0 0 0 4.5-4.5a4.5 4.5 0 0 0-4.5-4.5m0 1.5a3 3 0 0 1 3 3a3 3 0 0 1-.42 1.5L16 14.92a3 3 0 0 1 1.5-.42M14.92 16L19 20.08a3 3 0 0 1-1.5.42a3 3 0 0 1-3-3a3 3 0 0 1 .42-1.5M12 2c-1.1 0-2 .9-2 2v.29C7.12 5.14 5 7.82 5 11v6l-2 2v1h8.5a6.5 6.5 0 0 1-.47-2H7v-7a5 5 0 0 1 5-5a5 5 0 0 1 5 5a7 7 0 0 1 .5 0a6.5 6.5 0 0 1 1.5.18V11c0-3.18-2.12-5.86-5-6.71V4a2 2 0 0 0-2-2m-2 19a2 2 0 0 0 2 2c.5 0 .97-.19 1.33-.5a6.5 6.5 0 0 1-1.3-1.5Z"
|
|
5530
|
-
}, null, -1)),
|
|
5531
|
-
|
|
5532
|
-
],
|
|
5527
|
+
}, null, -1)), Qi = [
|
|
5528
|
+
Xi
|
|
5529
|
+
], Yi = { class: "sus-comment__footer-send flex justify-end my-2" }, eo = /* @__PURE__ */ wt({
|
|
5533
5530
|
__name: "index",
|
|
5534
5531
|
props: {
|
|
5535
5532
|
vId: { default: "sus-vditor" },
|
|
5536
5533
|
cache: { type: Boolean, default: !1 },
|
|
5537
5534
|
reply: {},
|
|
5538
5535
|
emoji: { default: "" },
|
|
5539
|
-
showInput: { type: Boolean, default: !1 },
|
|
5540
5536
|
cdn: { default: "https://unpkg.com/vditor@3.10.4" }
|
|
5541
5537
|
},
|
|
5542
5538
|
emits: ["on-save", "on-cancel"],
|
|
5543
|
-
setup(ce, { emit:
|
|
5544
|
-
class
|
|
5539
|
+
setup(ce, { emit: me }) {
|
|
5540
|
+
class fe {
|
|
5545
5541
|
constructor() {
|
|
5546
5542
|
ze(this, "articleId", "");
|
|
5547
5543
|
ze(this, "userName", "");
|
|
@@ -5555,38 +5551,38 @@ const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-4f2bd237"), ce = ce(
|
|
|
5555
5551
|
ze(this, "notify", 0);
|
|
5556
5552
|
}
|
|
5557
5553
|
}
|
|
5558
|
-
const
|
|
5554
|
+
const ye = ce, X = me, he = ye.reply.userName, $ = Ve("在此处留下你的足迹吧!(支持markdown语法)"), _ = wi(new fe()), b = Ve(null), c = Ve(""), m = Ve(""), l = Ve(""), y = Ve(""), s = Ve("收到回复后通知"), u = Ve(!0);
|
|
5559
5555
|
async function f() {
|
|
5560
5556
|
var k, p;
|
|
5561
5557
|
if (!b.value) {
|
|
5562
|
-
|
|
5558
|
+
X("on-save", _);
|
|
5563
5559
|
return;
|
|
5564
5560
|
}
|
|
5565
|
-
if (
|
|
5566
|
-
const x =
|
|
5567
|
-
_.parentId = x === "0" ?
|
|
5561
|
+
if (c.value = (k = b.value) == null ? void 0 : k.getHTML(), m.value = (p = b.value) == null ? void 0 : p.getValue(), _.userWebsite && (_.userWebsite.concat("http://") || _.userWebsite.concat("https://") || (_.userWebsite = "https://" + _.userWebsite)), localStorage.setItem("user", JSON.stringify(_)), ye.reply.id != "0") {
|
|
5562
|
+
const x = ye.reply.parentId;
|
|
5563
|
+
_.parentId = x === "0" ? ye.reply.id : x, _.replyName = ye.reply.userName, $.value = "@" + he + ":";
|
|
5568
5564
|
}
|
|
5569
|
-
_.content = c.value, _.contentMD = m.value,
|
|
5565
|
+
_.content = c.value, _.contentMD = m.value, X("on-save", _), l.value = "", b.value.setValue("");
|
|
5570
5566
|
}
|
|
5571
5567
|
function w() {
|
|
5572
|
-
|
|
5568
|
+
X("on-cancel");
|
|
5573
5569
|
}
|
|
5574
5570
|
function L() {
|
|
5575
|
-
b.value = new xi(
|
|
5571
|
+
b.value = new xi(ye.vId, {
|
|
5576
5572
|
after: () => {
|
|
5577
5573
|
},
|
|
5578
5574
|
placeholder: $.value,
|
|
5579
5575
|
theme: "classic",
|
|
5580
5576
|
// 使用localStorage缓存
|
|
5581
5577
|
cache: {
|
|
5582
|
-
enable:
|
|
5578
|
+
enable: ye.cache
|
|
5583
5579
|
},
|
|
5584
5580
|
icon: "material",
|
|
5585
|
-
cdn:
|
|
5581
|
+
cdn: ye.cdn,
|
|
5586
5582
|
// 工具栏
|
|
5587
5583
|
toolbar: ["emoji", "link", "code", "inline-code"],
|
|
5588
5584
|
hint: {
|
|
5589
|
-
emoji:
|
|
5585
|
+
emoji: ye.emoji
|
|
5590
5586
|
},
|
|
5591
5587
|
preview: {
|
|
5592
5588
|
hljs: {
|
|
@@ -5605,10 +5601,6 @@ const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-4f2bd237"), ce = ce(
|
|
|
5605
5601
|
_.notify == 1 ? (_.notify = 0, s.value = "收到回复后不通知") : (_.notify = 1, s.value = "收到回复后通知");
|
|
5606
5602
|
}
|
|
5607
5603
|
function E() {
|
|
5608
|
-
if (ue.showInput) {
|
|
5609
|
-
u.value = !1;
|
|
5610
|
-
return;
|
|
5611
|
-
}
|
|
5612
5604
|
const k = setInterval(function() {
|
|
5613
5605
|
document.querySelector(".vditor-content") && (clearInterval(k), u.value = !1);
|
|
5614
5606
|
}, 100);
|
|
@@ -5621,10 +5613,10 @@ const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-4f2bd237"), ce = ce(
|
|
|
5621
5613
|
_.userName = p.userName, _.userEmail = p.userEmail, _.userWebsite = p.userWebsite, S();
|
|
5622
5614
|
}
|
|
5623
5615
|
_.notify = 1;
|
|
5624
|
-
}), (k, p) => (
|
|
5625
|
-
u.value ? (
|
|
5626
|
-
|
|
5627
|
-
|
|
5616
|
+
}), (k, p) => (xe(), Oe("div", Ni, [
|
|
5617
|
+
u.value ? (xe(), Oe("div", Di, Ii)) : Ue("", !0),
|
|
5618
|
+
pt(oe("div", ji, [
|
|
5619
|
+
oe("img", {
|
|
5628
5620
|
alt: "输入QQ邮箱后自动获取",
|
|
5629
5621
|
src: y.value,
|
|
5630
5622
|
class: "sus-avatar",
|
|
@@ -5632,125 +5624,114 @@ const xi = /* @__PURE__ */ Ci(Ai), Hi = (ce) => (zn("data-v-4f2bd237"), ce = ce(
|
|
|
5632
5624
|
''`
|
|
5633
5625
|
}, null, 8, Ri)
|
|
5634
5626
|
], 512), [
|
|
5635
|
-
[
|
|
5627
|
+
[Xt, !u.value]
|
|
5636
5628
|
]),
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5629
|
+
oe("div", Pi, [
|
|
5630
|
+
pt(oe("div", qi, [
|
|
5631
|
+
oe("div", Bi, [
|
|
5632
|
+
pt(oe("input", {
|
|
5641
5633
|
class: "sus-input sus-username",
|
|
5642
5634
|
placeholder: "昵称(必填)",
|
|
5643
5635
|
"onUpdate:modelValue": p[0] || (p[0] = (x) => _.userName = x),
|
|
5644
5636
|
maxlength: "23"
|
|
5645
5637
|
}, null, 512), [
|
|
5646
|
-
[
|
|
5638
|
+
[Qt, _.userName]
|
|
5647
5639
|
])
|
|
5648
5640
|
]),
|
|
5649
|
-
|
|
5650
|
-
|
|
5641
|
+
oe("div", Vi, [
|
|
5642
|
+
pt(oe("input", {
|
|
5651
5643
|
class: "sus-input sus-web",
|
|
5652
5644
|
title: "点击昵称时可跳转",
|
|
5653
5645
|
placeholder: "网址(https://)",
|
|
5654
5646
|
"onUpdate:modelValue": p[1] || (p[1] = (x) => _.userWebsite = x),
|
|
5655
5647
|
maxlength: "35"
|
|
5656
5648
|
}, null, 512), [
|
|
5657
|
-
[
|
|
5649
|
+
[Qt, _.userWebsite]
|
|
5658
5650
|
])
|
|
5659
5651
|
]),
|
|
5660
|
-
|
|
5661
|
-
|
|
5652
|
+
oe("div", Ui, [
|
|
5653
|
+
pt(oe("input", {
|
|
5662
5654
|
onBlur: S,
|
|
5663
5655
|
class: "sus-input sus-email",
|
|
5664
5656
|
placeholder: "邮箱(不会公开,仅用于通知回复)",
|
|
5665
5657
|
"onUpdate:modelValue": p[2] || (p[2] = (x) => _.userEmail = x),
|
|
5666
5658
|
maxlength: "35"
|
|
5667
5659
|
}, null, 544), [
|
|
5668
|
-
[
|
|
5660
|
+
[Qt, _.userEmail]
|
|
5669
5661
|
])
|
|
5670
5662
|
])
|
|
5671
5663
|
], 512), [
|
|
5672
|
-
[
|
|
5664
|
+
[Xt, !u.value]
|
|
5673
5665
|
]),
|
|
5674
|
-
|
|
5675
|
-
et(ie("textarea", {
|
|
5676
|
-
"onUpdate:modelValue": p[3] || (p[3] = (x) => l.value = x),
|
|
5677
|
-
class: "sus-textarea",
|
|
5678
|
-
placeholder: "在此留下你的足迹吧!"
|
|
5679
|
-
}, null, 512), [
|
|
5680
|
-
[Ot, l.value]
|
|
5681
|
-
])
|
|
5682
|
-
])) : Pe("", !0),
|
|
5683
|
-
et(ie("div", {
|
|
5666
|
+
oe("div", {
|
|
5684
5667
|
id: k.vId,
|
|
5685
5668
|
class: "sus-comment__editor h-full w-full"
|
|
5686
|
-
}, null, 8,
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
ie("div", Gi, [
|
|
5691
|
-
ie("div", {
|
|
5669
|
+
}, null, 8, Wi),
|
|
5670
|
+
oe("div", zi, [
|
|
5671
|
+
oe("div", Ki, [
|
|
5672
|
+
oe("div", {
|
|
5692
5673
|
onClick: T,
|
|
5693
5674
|
class: "sus-comment__footer-notify vditor-tooltipped vditor-tooltipped__ne p-1 opacity-70",
|
|
5694
5675
|
"aria-label": s.value
|
|
5695
5676
|
}, [
|
|
5696
|
-
_.notify == 1 ? (
|
|
5697
|
-
], 8,
|
|
5677
|
+
_.notify == 1 ? (xe(), Oe("svg", Fi, Zi)) : (xe(), Oe("svg", Ji, Qi))
|
|
5678
|
+
], 8, Gi)
|
|
5698
5679
|
]),
|
|
5699
|
-
|
|
5700
|
-
|
|
5680
|
+
pt(oe("div", Yi, [
|
|
5681
|
+
oe("button", {
|
|
5701
5682
|
class: "sus-button cancel mx-2",
|
|
5702
5683
|
onClick: w
|
|
5703
5684
|
}, "取消"),
|
|
5704
|
-
|
|
5685
|
+
oe("button", {
|
|
5705
5686
|
class: "sus-button ok",
|
|
5706
5687
|
onClick: f
|
|
5707
5688
|
}, "发送")
|
|
5708
5689
|
], 512), [
|
|
5709
|
-
[
|
|
5690
|
+
[Xt, !u.value]
|
|
5710
5691
|
])
|
|
5711
5692
|
])
|
|
5712
5693
|
])
|
|
5713
5694
|
]));
|
|
5714
5695
|
}
|
|
5715
|
-
}), Et = (ce,
|
|
5716
|
-
const
|
|
5717
|
-
for (const [
|
|
5718
|
-
|
|
5719
|
-
return
|
|
5720
|
-
},
|
|
5721
|
-
function
|
|
5722
|
-
const
|
|
5723
|
-
if ($ ===
|
|
5724
|
-
const c = b -
|
|
5696
|
+
}), Et = (ce, me) => {
|
|
5697
|
+
const fe = ce.__vccOpts || ce;
|
|
5698
|
+
for (const [ye, X] of me)
|
|
5699
|
+
fe[ye] = X;
|
|
5700
|
+
return fe;
|
|
5701
|
+
}, to = /* @__PURE__ */ Et(eo, [["__scopeId", "data-v-18ce47db"]]);
|
|
5702
|
+
function no(ce) {
|
|
5703
|
+
const me = new Date(ce), fe = me.getFullYear(), ye = me.getMonth() + 1, X = me.getDate(), he = /* @__PURE__ */ new Date(), $ = he.getFullYear(), _ = he.getMonth() + 1, b = he.getDate();
|
|
5704
|
+
if ($ === fe && _ == ye) {
|
|
5705
|
+
const c = b - X;
|
|
5725
5706
|
if (c === 0)
|
|
5726
5707
|
return "今天";
|
|
5727
5708
|
if (c < 7)
|
|
5728
5709
|
return c + "天前";
|
|
5729
5710
|
}
|
|
5730
|
-
return $ ===
|
|
5711
|
+
return $ === fe ? `${ye}月${X}日` : `${fe}年${ye}月${X}日`;
|
|
5731
5712
|
}
|
|
5732
|
-
const
|
|
5713
|
+
const ro = (ce) => (zn("data-v-c5abc1a8"), ce = ce(), Kn(), ce), io = { class: "sus-item__container relative flex flex-row" }, oo = { class: "sus-comment-aside" }, ao = { class: "sus-comment-avatar" }, so = ["src"], lo = { class: "sus-item-floor mt-2" }, co = { class: "sus-item__main w-full" }, uo = { class: "sus-item__user leading-loose" }, po = ["rel", "href"], mo = {
|
|
5733
5714
|
key: 0,
|
|
5734
5715
|
class: "sus-item-tag mx-1",
|
|
5735
5716
|
title: "博主"
|
|
5736
|
-
},
|
|
5717
|
+
}, fo = {
|
|
5737
5718
|
key: 1,
|
|
5738
5719
|
class: "sus-item__content-name mx-1.5"
|
|
5739
|
-
},
|
|
5720
|
+
}, ho = { class: "sus-item__user-date ml-3" }, vo = { class: "sus-item__content" }, go = ["innerHTML"], yo = {
|
|
5740
5721
|
key: 0,
|
|
5741
5722
|
class: "sus-item__info flex justify-end mx-1 -mt-1"
|
|
5742
|
-
},
|
|
5723
|
+
}, bo = { class: "sus-item__info-ip flex items-center" }, wo = /* @__PURE__ */ ro(() => /* @__PURE__ */ oe("svg", {
|
|
5743
5724
|
class: "sus-svg",
|
|
5744
5725
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5745
5726
|
width: "32",
|
|
5746
5727
|
height: "32",
|
|
5747
5728
|
viewBox: "0 0 28 28"
|
|
5748
5729
|
}, [
|
|
5749
|
-
/* @__PURE__ */
|
|
5730
|
+
/* @__PURE__ */ oe("path", {
|
|
5750
5731
|
fill: "currentColor",
|
|
5751
5732
|
d: "M14 2.25A9.75 9.75 0 0 1 23.75 12c0 4.12-2.895 8.61-8.61 13.518a1.75 1.75 0 0 1-2.283-.002l-.378-.328C7.017 20.408 4.25 16.028 4.25 12A9.75 9.75 0 0 1 14 2.25m0 1.5A8.25 8.25 0 0 0 5.75 12c0 3.502 2.548 7.537 7.714 12.057l.373.323a.25.25 0 0 0 .326 0c5.416-4.652 8.087-8.795 8.087-12.38A8.25 8.25 0 0 0 14 3.75m0 4.5a3.75 3.75 0 1 1 0 7.5a3.75 3.75 0 0 1 0-7.5m0 1.5a2.25 2.25 0 1 0 0 4.5a2.25 2.25 0 0 0 0-4.5"
|
|
5752
5733
|
})
|
|
5753
|
-
], -1)),
|
|
5734
|
+
], -1)), Eo = /* @__PURE__ */ wt({
|
|
5754
5735
|
__name: "item",
|
|
5755
5736
|
props: {
|
|
5756
5737
|
comment: {},
|
|
@@ -5759,139 +5740,139 @@ const io = (ce) => (zn("data-v-ff7b0a89"), ce = ce(), Kn(), ce), oo = { class: "
|
|
|
5759
5740
|
num: { default: 1 }
|
|
5760
5741
|
},
|
|
5761
5742
|
emits: ["on-reply"],
|
|
5762
|
-
setup(ce, { emit:
|
|
5763
|
-
const
|
|
5743
|
+
setup(ce, { emit: me }) {
|
|
5744
|
+
const fe = ce, ye = Ve(), X = Ve(), he = Ve(!1), $ = me;
|
|
5764
5745
|
function _() {
|
|
5765
|
-
|
|
5746
|
+
ye.value.style.display = "block", he.value = !1;
|
|
5766
5747
|
}
|
|
5767
5748
|
function b() {
|
|
5768
|
-
const y =
|
|
5769
|
-
y >= s && (
|
|
5749
|
+
const y = ye.value.clientHeight, s = fe.lineHeight * 5;
|
|
5750
|
+
y >= s && (he.value = !0);
|
|
5770
5751
|
}
|
|
5771
5752
|
function c() {
|
|
5772
|
-
$("on-reply",
|
|
5753
|
+
$("on-reply", fe.comment);
|
|
5773
5754
|
}
|
|
5774
5755
|
function m() {
|
|
5775
|
-
|
|
5756
|
+
fe.comment.userAvatar || (fe.comment.userAvatar = "/error.webp");
|
|
5776
5757
|
}
|
|
5777
5758
|
function l() {
|
|
5778
5759
|
var f;
|
|
5779
|
-
const y = new Date((f =
|
|
5760
|
+
const y = new Date((f = fe.comment) == null ? void 0 : f.createdDate), s = /* @__PURE__ */ new Date(), u = new Date(s.getFullYear() - 1, s.getMonth(), s.getDate());
|
|
5780
5761
|
return y > u ? "ugc noopener nofollow" : "ugc noopener noreferrer nofollow";
|
|
5781
5762
|
}
|
|
5782
5763
|
return Un(() => {
|
|
5783
5764
|
m(), b();
|
|
5784
|
-
}), (y, s) => (
|
|
5785
|
-
|
|
5765
|
+
}), (y, s) => (xe(), Oe("div", io, [
|
|
5766
|
+
oe("span", {
|
|
5786
5767
|
onClick: c,
|
|
5787
5768
|
class: "sus-item__info-reply absolute cursor-pointer"
|
|
5788
5769
|
}, " 回复 "),
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5770
|
+
oe("div", oo, [
|
|
5771
|
+
oe("div", ao, [
|
|
5772
|
+
oe("img", {
|
|
5792
5773
|
alt: "",
|
|
5793
5774
|
class: "sus-avatar",
|
|
5794
5775
|
src: y.comment.userAvatar,
|
|
5795
5776
|
onerror: "this.onerror=null,this.src='/error.webp'"
|
|
5796
|
-
}, null, 8,
|
|
5777
|
+
}, null, 8, so)
|
|
5797
5778
|
]),
|
|
5798
|
-
|
|
5779
|
+
oe("p", lo, Xe(y.num), 1)
|
|
5799
5780
|
]),
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5781
|
+
oe("div", co, [
|
|
5782
|
+
oe("div", uo, [
|
|
5783
|
+
oe("a", {
|
|
5803
5784
|
target: "_blank",
|
|
5804
5785
|
rel: l(),
|
|
5805
5786
|
href: y.comment.userWebsite,
|
|
5806
5787
|
class: Ei([y.comment.tagName, "sus-item__user-name font-semibold ml-1 cursor-pointer"])
|
|
5807
|
-
}, Xe(y.comment.userName), 11,
|
|
5808
|
-
y.comment.tagName === "owner" ? (
|
|
5809
|
-
y.comment.replyName ? (
|
|
5810
|
-
|
|
5788
|
+
}, Xe(y.comment.userName), 11, po),
|
|
5789
|
+
y.comment.tagName === "owner" ? (xe(), Oe("span", mo, " 博主 ")) : Ue("", !0),
|
|
5790
|
+
y.comment.replyName ? (xe(), Oe("span", fo, "@" + Xe(y.comment.replyName), 1)) : Ue("", !0),
|
|
5791
|
+
oe("span", ho, Xe(ki(no)(y.comment.createdDate)), 1)
|
|
5811
5792
|
]),
|
|
5812
|
-
|
|
5813
|
-
|
|
5793
|
+
oe("div", vo, [
|
|
5794
|
+
oe("span", {
|
|
5814
5795
|
ref_key: "contentDom",
|
|
5815
|
-
ref:
|
|
5796
|
+
ref: ye,
|
|
5816
5797
|
class: "sus-item__content-text",
|
|
5817
5798
|
innerHTML: y.comment.content
|
|
5818
|
-
}, null, 8,
|
|
5819
|
-
|
|
5799
|
+
}, null, 8, go),
|
|
5800
|
+
he.value ? (xe(), Oe("a", {
|
|
5820
5801
|
key: 0,
|
|
5821
5802
|
ref_key: "showMoreDom",
|
|
5822
|
-
ref:
|
|
5803
|
+
ref: X,
|
|
5823
5804
|
class: "sus-show-detail my-1.5 cursor-pointer",
|
|
5824
5805
|
onClick: _
|
|
5825
|
-
}, "显示更多>", 512)) :
|
|
5806
|
+
}, "显示更多>", 512)) : Ue("", !0)
|
|
5826
5807
|
]),
|
|
5827
|
-
y.showIp && y.comment.area ? (
|
|
5828
|
-
|
|
5829
|
-
|
|
5808
|
+
y.showIp && y.comment.area ? (xe(), Oe("div", yo, [
|
|
5809
|
+
oe("span", bo, [
|
|
5810
|
+
wo,
|
|
5830
5811
|
Si(" " + Xe(y.comment.area), 1)
|
|
5831
5812
|
])
|
|
5832
|
-
])) :
|
|
5813
|
+
])) : Ue("", !0)
|
|
5833
5814
|
])
|
|
5834
5815
|
]));
|
|
5835
5816
|
}
|
|
5836
|
-
}),
|
|
5817
|
+
}), Dt = /* @__PURE__ */ Et(Eo, [["__scopeId", "data-v-c5abc1a8"]]), ko = { class: "sus-comment__item" }, So = { class: "sus-comment__item-child" }, _o = { key: 2 }, Lo = {
|
|
5837
5818
|
key: 0,
|
|
5838
5819
|
class: "sus-comment__item-footer flex justify-center w-full cursor-pointer"
|
|
5839
|
-
},
|
|
5820
|
+
}, Mo = /* @__PURE__ */ wt({
|
|
5840
5821
|
__name: "index",
|
|
5841
5822
|
props: {
|
|
5842
5823
|
comment: {}
|
|
5843
5824
|
},
|
|
5844
5825
|
emits: ["on-reply"],
|
|
5845
|
-
setup(ce, { emit:
|
|
5846
|
-
const
|
|
5847
|
-
function
|
|
5848
|
-
|
|
5826
|
+
setup(ce, { emit: me }) {
|
|
5827
|
+
const fe = Ve(!1), ye = me;
|
|
5828
|
+
function X(he) {
|
|
5829
|
+
ye("on-reply", he);
|
|
5849
5830
|
}
|
|
5850
|
-
return (
|
|
5831
|
+
return (he, $) => {
|
|
5851
5832
|
var _, b, c, m, l;
|
|
5852
|
-
return
|
|
5853
|
-
_i(
|
|
5854
|
-
comment:
|
|
5855
|
-
onOnReply: $[0] || ($[0] = (y) =>
|
|
5833
|
+
return xe(), Oe("div", ko, [
|
|
5834
|
+
_i(Dt, {
|
|
5835
|
+
comment: he.comment,
|
|
5836
|
+
onOnReply: $[0] || ($[0] = (y) => X(he.comment))
|
|
5856
5837
|
}, null, 8, ["comment"]),
|
|
5857
|
-
|
|
5858
|
-
((_ =
|
|
5838
|
+
oe("div", So, [
|
|
5839
|
+
((_ = he.comment.child) == null ? void 0 : _.length) > 0 ? (xe(), Yt(Dt, {
|
|
5859
5840
|
key: 0,
|
|
5860
|
-
onOnReply: $[1] || ($[1] = (y) =>
|
|
5861
|
-
comment:
|
|
5862
|
-
num: ((b =
|
|
5841
|
+
onOnReply: $[1] || ($[1] = (y) => X(he.comment.child[0])),
|
|
5842
|
+
comment: he.comment.child[0],
|
|
5843
|
+
num: ((b = he.comment.child) == null ? void 0 : b.length) + 1,
|
|
5863
5844
|
class: "sus-comment__item-child__item"
|
|
5864
|
-
}, null, 8, ["comment", "num"])) :
|
|
5865
|
-
((c =
|
|
5845
|
+
}, null, 8, ["comment", "num"])) : Ue("", !0),
|
|
5846
|
+
((c = he.comment.child) == null ? void 0 : c.length) > 1 ? (xe(), Yt(Dt, {
|
|
5866
5847
|
key: 1,
|
|
5867
|
-
onOnReply: $[2] || ($[2] = (y) =>
|
|
5868
|
-
comment:
|
|
5869
|
-
num: (m =
|
|
5848
|
+
onOnReply: $[2] || ($[2] = (y) => X(he.comment.child[1])),
|
|
5849
|
+
comment: he.comment.child[1],
|
|
5850
|
+
num: (m = he.comment.child) == null ? void 0 : m.length,
|
|
5870
5851
|
class: "sus-comment__item-child__item"
|
|
5871
|
-
}, null, 8, ["comment", "num"])) :
|
|
5872
|
-
((l =
|
|
5873
|
-
|
|
5874
|
-
|
|
5852
|
+
}, null, 8, ["comment", "num"])) : Ue("", !0),
|
|
5853
|
+
((l = he.comment.child) == null ? void 0 : l.length) > 2 ? (xe(), Oe("div", _o, [
|
|
5854
|
+
fe.value ? Ue("", !0) : (xe(), Oe("div", Lo, [
|
|
5855
|
+
oe("p", {
|
|
5875
5856
|
class: "sus-load-more",
|
|
5876
|
-
onClick: $[3] || ($[3] = (y) =>
|
|
5857
|
+
onClick: $[3] || ($[3] = (y) => fe.value = !0)
|
|
5877
5858
|
}, " 查看更多回复 > ")
|
|
5878
5859
|
])),
|
|
5879
|
-
|
|
5860
|
+
fe.value ? (xe(!0), Oe(Li, { key: 1 }, Mi(he.comment.child.slice(2), (y, s) => {
|
|
5880
5861
|
var u;
|
|
5881
|
-
return
|
|
5882
|
-
onOnReply: (f) =>
|
|
5862
|
+
return xe(), Yt(Dt, {
|
|
5863
|
+
onOnReply: (f) => X(y),
|
|
5883
5864
|
key: s,
|
|
5884
5865
|
comment: y,
|
|
5885
|
-
num: ((u =
|
|
5866
|
+
num: ((u = he.comment.child) == null ? void 0 : u.length) - 1 - s,
|
|
5886
5867
|
class: "sus-comment__item-child__item"
|
|
5887
5868
|
}, null, 8, ["onOnReply", "comment", "num"]);
|
|
5888
|
-
}), 128)) :
|
|
5889
|
-
])) :
|
|
5869
|
+
}), 128)) : Ue("", !0)
|
|
5870
|
+
])) : Ue("", !0)
|
|
5890
5871
|
])
|
|
5891
5872
|
]);
|
|
5892
5873
|
};
|
|
5893
5874
|
}
|
|
5894
|
-
}),
|
|
5875
|
+
}), To = /* @__PURE__ */ Et(Mo, [["__scopeId", "data-v-f5f2cebf"]]), Co = { class: "sus-top-item flex items-start p-1.5 overflow-hidden" }, Ao = { class: "sus-top-item__info flex flex-col mr-1" }, xo = { class: "sus-top-item__user whitespace-nowrap" }, Ho = {
|
|
5895
5876
|
key: 0,
|
|
5896
5877
|
class: "sus-top-item__reply whitespace-nowrap"
|
|
5897
5878
|
}, No = ["innerHTML"], Do = /* @__PURE__ */ wt({
|
|
@@ -5899,27 +5880,19 @@ const io = (ce) => (zn("data-v-ff7b0a89"), ce = ce(), Kn(), ce), oo = { class: "
|
|
|
5899
5880
|
props: {
|
|
5900
5881
|
comment: {}
|
|
5901
5882
|
},
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
}
|
|
5908
|
-
return (Z, me) => (Te(), Oe("div", {
|
|
5909
|
-
class: "sus-top-item flex items-start p-1.5 overflow-hidden cursor-pointer",
|
|
5910
|
-
onClick: ue
|
|
5911
|
-
}, [
|
|
5912
|
-
ie("div", Ao, [
|
|
5913
|
-
ie("span", xo, Xe(Z.comment.userName) + ": ", 1),
|
|
5914
|
-
Z.comment.replyName ? (Te(), Oe("span", Ho, Xe("@" + Z.comment.replyName), 1)) : Pe("", !0)
|
|
5883
|
+
setup(ce) {
|
|
5884
|
+
return (me, fe) => (xe(), Oe("div", Co, [
|
|
5885
|
+
oe("div", Ao, [
|
|
5886
|
+
oe("span", xo, Xe(me.comment.userName) + ": ", 1),
|
|
5887
|
+
me.comment.replyName ? (xe(), Oe("span", Ho, Xe("@" + me.comment.replyName), 1)) : Ue("", !0)
|
|
5915
5888
|
]),
|
|
5916
|
-
|
|
5889
|
+
oe("span", {
|
|
5917
5890
|
class: "sus-top-item__content w-full",
|
|
5918
|
-
innerHTML:
|
|
5891
|
+
innerHTML: me.comment.content
|
|
5919
5892
|
}, null, 8, No)
|
|
5920
5893
|
]));
|
|
5921
5894
|
}
|
|
5922
|
-
}), Oo = /* @__PURE__ */ Et(Do, [["__scopeId", "data-v-
|
|
5895
|
+
}), Oo = /* @__PURE__ */ Et(Do, [["__scopeId", "data-v-e2816c65"]]), Io = { class: "sus-top-item__user flex items-center" }, jo = {
|
|
5923
5896
|
key: 0,
|
|
5924
5897
|
class: "sus-top-item__user-avatar ml-1 mr-2"
|
|
5925
5898
|
}, Ro = ["src"], Po = { class: "sus-top-item__user-owner" }, qo = { class: "sus-top-item__user-reply ml-3 opacity-70" }, Bo = ["innerHTML"], Vo = /* @__PURE__ */ wt({
|
|
@@ -5928,45 +5901,45 @@ const io = (ce) => (zn("data-v-ff7b0a89"), ce = ce(), Kn(), ce), oo = { class: "
|
|
|
5928
5901
|
comment: {}
|
|
5929
5902
|
},
|
|
5930
5903
|
emits: ["go-local"],
|
|
5931
|
-
setup(ce, { emit:
|
|
5932
|
-
const
|
|
5933
|
-
function
|
|
5934
|
-
|
|
5904
|
+
setup(ce, { emit: me }) {
|
|
5905
|
+
const fe = me;
|
|
5906
|
+
function ye() {
|
|
5907
|
+
fe("go-local");
|
|
5935
5908
|
}
|
|
5936
|
-
return (
|
|
5909
|
+
return (X, he) => (xe(), Oe("div", {
|
|
5937
5910
|
class: "sus-top-item p-1.5 cursor-pointer",
|
|
5938
|
-
onClick:
|
|
5911
|
+
onClick: ye
|
|
5939
5912
|
}, [
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5913
|
+
oe("div", Io, [
|
|
5914
|
+
X.comment.userAvatar ? (xe(), Oe("div", jo, [
|
|
5915
|
+
oe("img", {
|
|
5943
5916
|
alt: "",
|
|
5944
5917
|
class: "sus-avatar",
|
|
5945
5918
|
loading: "lazy",
|
|
5946
5919
|
decoding: "async",
|
|
5947
|
-
src:
|
|
5920
|
+
src: X.comment.userAvatar,
|
|
5948
5921
|
onerror: "this.onerror=null,this.src='/error.webp'"
|
|
5949
5922
|
}, null, 8, Ro)
|
|
5950
|
-
])) :
|
|
5951
|
-
|
|
5952
|
-
|
|
5923
|
+
])) : Ue("", !0),
|
|
5924
|
+
oe("div", Po, Xe(X.comment.userName), 1),
|
|
5925
|
+
oe("div", qo, Xe(X.comment.replyName ? "@" + X.comment.replyName : ""), 1)
|
|
5953
5926
|
]),
|
|
5954
|
-
|
|
5927
|
+
oe("div", {
|
|
5955
5928
|
class: "sus-top-item__content p-1",
|
|
5956
|
-
innerHTML:
|
|
5929
|
+
innerHTML: X.comment.content
|
|
5957
5930
|
}, null, 8, Bo)
|
|
5958
5931
|
]));
|
|
5959
5932
|
}
|
|
5960
|
-
}), Uo = /* @__PURE__ */ Et(Vo, [["__scopeId", "data-v-fee77634"]]), Wo = [
|
|
5933
|
+
}), Uo = /* @__PURE__ */ Et(Vo, [["__scopeId", "data-v-fee77634"]]), Wo = [to, To, Uo, Oo], Go = {
|
|
5961
5934
|
install(ce) {
|
|
5962
|
-
Wo.forEach((
|
|
5963
|
-
ce.component(
|
|
5935
|
+
Wo.forEach((me) => {
|
|
5936
|
+
ce.component(me.name, me);
|
|
5964
5937
|
});
|
|
5965
5938
|
}
|
|
5966
5939
|
};
|
|
5967
5940
|
export {
|
|
5968
|
-
|
|
5969
|
-
|
|
5941
|
+
to as SuSComment,
|
|
5942
|
+
To as SuSList,
|
|
5970
5943
|
Oo as SuSSimpleTop,
|
|
5971
5944
|
Uo as SuSTop,
|
|
5972
5945
|
Go as default
|