@dcodegroup-au/dsg-vue 0.1.11 → 0.1.12
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/dist/DsgLabel.vue_vue_type_style_index_0_lang-BXePb1IV.js +28 -0
- package/dist/DsgLabel.vue_vue_type_style_index_0_lang-DAM6oT0f.cjs +1 -0
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-DMBYMPtx.js → DsgTablePerPage.vue_vue_type_style_index_0_lang-ByEZd_XB.js} +4665 -4630
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-B3GtWMET.cjs → DsgTablePerPage.vue_vue_type_style_index_0_lang-OVnCsiAi.cjs} +97 -97
- package/dist/components/Elements/DsgBarcodeScanner.vue.d.ts +3 -3
- package/dist/components/Elements/DsgDropdown.vue.d.ts +4 -8
- package/dist/components/Table/DsgTable.vue.d.ts +28 -20
- package/dist/components/Table/DsgTableComponent.vue.d.ts +12 -4
- package/dist/components/Table/DsgTableSearch.vue.d.ts +1 -0
- package/dist/dsg-vue.cjs +11 -11
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.editor.cjs +16 -16
- package/dist/dsg-vue.editor.esm.js +115 -115
- package/dist/dsg-vue.esm.js +1242 -1221
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +619 -555
- package/dist/table.d.ts +23 -23
- package/package.json +12 -12
- package/dist/DsgLabel.vue_vue_type_style_index_0_lang-BRVMqZ-w.js +0 -28
- package/dist/DsgLabel.vue_vue_type_style_index_0_lang-gCBicmCZ.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Ai, mergeModels as Vn, useModel as xi, ref as Wn, watch as Di, useTemplateRef as Hi, onMounted as Oi, createElementBlock as Tt, openBlock as dt, createElementVNode as Fn, createCommentVNode as qn, createBlock as Ni, Fragment as Ri, renderList as Ii, toDisplayString as Pi } from "vue";
|
|
2
2
|
import { g as ji } from "./_commonjsHelpers-C6fGbg64.js";
|
|
3
|
-
import { _ as Bi } from "./DsgLabel.vue_vue_type_style_index_0_lang-
|
|
3
|
+
import { _ as Bi } from "./DsgLabel.vue_vue_type_style_index_0_lang-BXePb1IV.js";
|
|
4
4
|
var _t = { exports: {} };
|
|
5
5
|
/*!
|
|
6
6
|
* Vditor v3.11.2 - A markdown editor written in TypeScript.
|
|
@@ -30,9 +30,9 @@ var _t = { exports: {} };
|
|
|
30
30
|
*/
|
|
31
31
|
var Ui = _t.exports, Kn;
|
|
32
32
|
function Vi() {
|
|
33
|
-
return Kn || (Kn = 1, (function(
|
|
33
|
+
return Kn || (Kn = 1, (function(Ce, Xt) {
|
|
34
34
|
(function(nt, Y) {
|
|
35
|
-
|
|
35
|
+
Ce.exports = Y();
|
|
36
36
|
})(Ui, function() {
|
|
37
37
|
return (
|
|
38
38
|
/******/
|
|
@@ -130,11 +130,11 @@ function Vi() {
|
|
|
130
130
|
for (var we = -z + P; we <= z - F; we += 2) {
|
|
131
131
|
var fe = v + we, le;
|
|
132
132
|
we == -z || we != z && g[fe - 1] < g[fe + 1] ? le = g[fe + 1] : le = g[fe - 1] + 1;
|
|
133
|
-
for (var
|
|
134
|
-
le++,
|
|
133
|
+
for (var Te = le - we; le < p && Te < m && c.charAt(p - le - 1) == l.charAt(m - Te - 1); )
|
|
134
|
+
le++, Te++;
|
|
135
135
|
if (g[fe] = le, le > p)
|
|
136
136
|
F += 2;
|
|
137
|
-
else if (
|
|
137
|
+
else if (Te > m)
|
|
138
138
|
P += 2;
|
|
139
139
|
else if (!_) {
|
|
140
140
|
var ne = v + C - we;
|
|
@@ -211,8 +211,8 @@ function Vi() {
|
|
|
211
211
|
var m = this;
|
|
212
212
|
function d(M, P, F) {
|
|
213
213
|
for (var z = M.substring(F, F + Math.floor(M.length / 4)), Q = -1, ne = "", oe, me, fe, le; (Q = P.indexOf(z, Q + 1)) != -1; ) {
|
|
214
|
-
var we = m.diff_commonPrefix(M.substring(F), P.substring(Q)),
|
|
215
|
-
ne.length <
|
|
214
|
+
var we = m.diff_commonPrefix(M.substring(F), P.substring(Q)), Te = m.diff_commonSuffix(M.substring(0, F), P.substring(0, Q));
|
|
215
|
+
ne.length < Te + we && (ne = P.substring(Q - Te, Q) + P.substring(Q, Q + we), oe = M.substring(0, F - Te), me = M.substring(F + we), fe = P.substring(0, Q - Te), le = P.substring(Q + we));
|
|
216
216
|
}
|
|
217
217
|
return ne.length * 2 >= M.length ? [oe, me, fe, le, ne] : null;
|
|
218
218
|
}
|
|
@@ -643,9 +643,9 @@ function Vi() {
|
|
|
643
643
|
}, oe = L(214), me = L(810), fe = function(I, re) {
|
|
644
644
|
if (re === void 0 && (re = "zh_CN"), !(typeof speechSynthesis > "u" || typeof SpeechSynthesisUtterance > "u")) {
|
|
645
645
|
var W = function() {
|
|
646
|
-
var
|
|
647
|
-
return
|
|
648
|
-
|
|
646
|
+
var Le = speechSynthesis.getVoices(), X, de;
|
|
647
|
+
return Le.forEach(function(De) {
|
|
648
|
+
De.lang === re.replace("_", "-") && (X = De), De.default && (de = De);
|
|
649
649
|
}), X || (X = de), X;
|
|
650
650
|
}, j = '<svg><use xlink:href="#vditor-icon-play"></use></svg>', pe = '<svg><use xlink:href="#vditor-icon-pause"></use></svg>';
|
|
651
651
|
document.getElementById("vditorIconScript") || (j = '<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>', pe = '<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');
|
|
@@ -654,18 +654,18 @@ function Vi() {
|
|
|
654
654
|
var ge = W(), ie = new SpeechSynthesisUtterance();
|
|
655
655
|
ie.voice = ge, ie.onend = ie.onerror = function() {
|
|
656
656
|
K.style.display = "none", speechSynthesis.cancel(), K.classList.remove("vditor-speech--current"), K.innerHTML = j;
|
|
657
|
-
}, I.addEventListener(window.ontouchstart !== void 0 ? "touchend" : "click", function(
|
|
658
|
-
var X =
|
|
657
|
+
}, I.addEventListener(window.ontouchstart !== void 0 ? "touchend" : "click", function(Le) {
|
|
658
|
+
var X = Le.target;
|
|
659
659
|
if (X.classList.contains("vditor-speech") || X.parentElement.classList.contains("vditor-speech")) {
|
|
660
660
|
K.classList.contains("vditor-speech--current") ? speechSynthesis.speaking && (speechSynthesis.paused ? (speechSynthesis.resume(), K.innerHTML = pe) : (speechSynthesis.pause(), K.innerHTML = j)) : (ie.text = K.getAttribute("data-text"), speechSynthesis.speak(ie), K.classList.add("vditor-speech--current"), K.innerHTML = pe), (0, me.Hc)(window.vditorSpeechRange), I.focus();
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
663
|
if (K.style.display = "none", speechSynthesis.cancel(), K.classList.remove("vditor-speech--current"), K.innerHTML = j, getSelection().rangeCount !== 0) {
|
|
664
|
-
var de = getSelection().getRangeAt(0),
|
|
665
|
-
if (
|
|
664
|
+
var de = getSelection().getRangeAt(0), De = de.toString().trim();
|
|
665
|
+
if (De) {
|
|
666
666
|
window.vditorSpeechRange = de.cloneRange();
|
|
667
667
|
var Ne = de.getBoundingClientRect();
|
|
668
|
-
K.innerHTML = j, K.style.display = "block", K.style.top = Ne.top + Ne.height + document.querySelector("html").scrollTop - 20 + "px", window.ontouchstart !== void 0 ? K.style.left =
|
|
668
|
+
K.innerHTML = j, K.style.display = "block", K.style.top = Ne.top + Ne.height + document.querySelector("html").scrollTop - 20 + "px", window.ontouchstart !== void 0 ? K.style.left = Le.changedTouches[Le.changedTouches.length - 1].pageX + 2 + "px" : K.style.left = Le.clientX + 2 + "px", K.setAttribute("data-text", De);
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
});
|
|
@@ -680,19 +680,19 @@ function Vi() {
|
|
|
680
680
|
function ie(de) {
|
|
681
681
|
try {
|
|
682
682
|
X(j.next(de));
|
|
683
|
-
} catch (
|
|
684
|
-
ge(
|
|
683
|
+
} catch (De) {
|
|
684
|
+
ge(De);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function Le(de) {
|
|
688
688
|
try {
|
|
689
689
|
X(j.throw(de));
|
|
690
|
-
} catch (
|
|
691
|
-
ge(
|
|
690
|
+
} catch (De) {
|
|
691
|
+
ge(De);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
function X(de) {
|
|
695
|
-
de.done ? K(de.value) : pe(de.value).then(ie,
|
|
695
|
+
de.done ? K(de.value) : pe(de.value).then(ie, Le);
|
|
696
696
|
}
|
|
697
697
|
X((j = j.apply(I, re || [])).next());
|
|
698
698
|
});
|
|
@@ -706,10 +706,10 @@ function Vi() {
|
|
|
706
706
|
}), ge;
|
|
707
707
|
function ie(X) {
|
|
708
708
|
return function(de) {
|
|
709
|
-
return
|
|
709
|
+
return Le([X, de]);
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function Le(X) {
|
|
713
713
|
if (j) throw new TypeError("Generator is already executing.");
|
|
714
714
|
for (; ge && (ge = 0, X[0] && (W = 0)), W; ) try {
|
|
715
715
|
if (j = 1, pe && (K = X[0] & 2 ? pe.return : X[0] ? pe.throw || ((K = pe.return) && K.call(pe), 0) : pe.next) && !(K = K.call(pe, X[1])).done) return K;
|
|
@@ -755,7 +755,7 @@ function Vi() {
|
|
|
755
755
|
if (X[0] & 5) throw X[1];
|
|
756
756
|
return { value: X[0] ? X[1] : void 0, done: !0 };
|
|
757
757
|
}
|
|
758
|
-
},
|
|
758
|
+
}, Te = function(I) {
|
|
759
759
|
var re, W = {
|
|
760
760
|
anchor: 0,
|
|
761
761
|
cdn: M.g.CDN,
|
|
@@ -779,7 +779,7 @@ function Vi() {
|
|
|
779
779
|
};
|
|
780
780
|
return I.cdn && (!((re = I.theme) === null || re === void 0) && re.path || (W.theme.path = "".concat(I.cdn, "/dist/css/content-theme")), I.emojiPath || (W.emojiPath = "".concat(I.cdn, "/dist/images/emoji"))), (0, Q.T)(W, I);
|
|
781
781
|
}, ve = function(I, re) {
|
|
782
|
-
var W =
|
|
782
|
+
var W = Te(re);
|
|
783
783
|
return (0, F.G)("".concat(W.cdn, "/dist/js/lute/lute.min.js"), "vditorLuteScript").then(function() {
|
|
784
784
|
var j = (0, oe.X)({
|
|
785
785
|
autoSpace: W.markdown.autoSpace,
|
|
@@ -813,14 +813,14 @@ function Vi() {
|
|
|
813
813
|
return we(this, function(ie) {
|
|
814
814
|
switch (ie.label) {
|
|
815
815
|
case 0:
|
|
816
|
-
return j =
|
|
816
|
+
return j = Te(W), [4, ve(re, j)];
|
|
817
817
|
case 1:
|
|
818
818
|
if (pe = ie.sent(), j.transform && (pe = j.transform(pe)), I.innerHTML = pe, I.classList.add("vditor-reset"), j.i18n) return [3, 5];
|
|
819
819
|
if (["de_DE", "en_US", "es_ES", "fr_FR", "ja_JP", "ko_KR", "pt_BR", "ru_RU", "sv_SE", "vi_VN", "zh_CN", "zh_TW"].includes(j.lang)) return [3, 2];
|
|
820
820
|
throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");
|
|
821
821
|
case 2:
|
|
822
|
-
return K = "vditorI18nScript", ge = K + j.lang, document.querySelectorAll('head script[id^="'.concat(K, '"]')).forEach(function(
|
|
823
|
-
|
|
822
|
+
return K = "vditorI18nScript", ge = K + j.lang, document.querySelectorAll('head script[id^="'.concat(K, '"]')).forEach(function(Le) {
|
|
823
|
+
Le.id !== ge && document.head.removeChild(Le);
|
|
824
824
|
}), [4, (0, F.G)("".concat(j.cdn, "/dist/js/i18n/").concat(j.lang, ".js"), ge)];
|
|
825
825
|
case 3:
|
|
826
826
|
ie.sent(), ie.label = 4;
|
|
@@ -836,8 +836,8 @@ function Vi() {
|
|
|
836
836
|
return (0, P.Z)(j.theme.current, j.theme.path), j.anchor === 1 && I.classList.add("vditor-reset--anchor"), (0, l.O)(I, j.hljs), (0, m.s)(j.hljs, I, j.cdn), (0, v.H)(I, {
|
|
837
837
|
cdn: j.cdn,
|
|
838
838
|
math: j.math
|
|
839
|
-
}), (0, b.i)(I, j.cdn, j.mode), (0, g.J)(I, j.cdn, j.mode), (0, s.K)(I, j.cdn), (0, y.P)(I, j.cdn), (0, p.v)(I, j.cdn), (0, c.p)(I, j.cdn, j.mode), (0, C.P)(I, j.cdn, j.mode), (0, D.B)(I, j.cdn), (0, x.Q)(I, j.cdn), j.render.media.enable && (0, w.Y)(I), j.speech.enable && fe(I), j.anchor !== 0 && ne(j.anchor), j.after && j.after(), j.lazyLoadImage && d(I), I.addEventListener("click", function(
|
|
840
|
-
var X = (0, z.lG)(
|
|
839
|
+
}), (0, b.i)(I, j.cdn, j.mode), (0, g.J)(I, j.cdn, j.mode), (0, s.K)(I, j.cdn), (0, y.P)(I, j.cdn), (0, p.v)(I, j.cdn), (0, c.p)(I, j.cdn, j.mode), (0, C.P)(I, j.cdn, j.mode), (0, D.B)(I, j.cdn), (0, x.Q)(I, j.cdn), j.render.media.enable && (0, w.Y)(I), j.speech.enable && fe(I), j.anchor !== 0 && ne(j.anchor), j.after && j.after(), j.lazyLoadImage && d(I), I.addEventListener("click", function(Le) {
|
|
840
|
+
var X = (0, z.lG)(Le.target, "SPAN");
|
|
841
841
|
if (X && (0, z.fb)(X, "vditor-toc")) {
|
|
842
842
|
var de = I.querySelector("#" + X.getAttribute("data-target-id"));
|
|
843
843
|
de && window.scrollTo(window.scrollX, de.offsetTop);
|
|
@@ -2820,9 +2820,9 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
2820
2820
|
}, Y.o = (Z, E) => Object.prototype.hasOwnProperty.call(Z, E), Y.r = (Z) => {
|
|
2821
2821
|
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(Z, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(Z, "__esModule", { value: !0 });
|
|
2822
2822
|
};
|
|
2823
|
-
var
|
|
2823
|
+
var ke = {};
|
|
2824
2824
|
return (() => {
|
|
2825
|
-
Y.d(
|
|
2825
|
+
Y.d(ke, {
|
|
2826
2826
|
default: () => (
|
|
2827
2827
|
/* binding */
|
|
2828
2828
|
_i
|
|
@@ -2943,7 +2943,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
2943
2943
|
});
|
|
2944
2944
|
}, s = Y(106), C = Y(771), _ = function(e, t, n, r) {
|
|
2945
2945
|
r && console.log("".concat(e, " - ").concat(n, ": ").concat(t));
|
|
2946
|
-
}, D = Y(135), M = Y(775), P = Y(428), F = Y(325), z = Y(483), Q = Y(999), ne = Y(472), oe = Y(637), me = Y(11), fe = Y(194), le = Y(229), we = Y(825),
|
|
2946
|
+
}, D = Y(135), M = Y(775), P = Y(428), F = Y(325), z = Y(483), Q = Y(999), ne = Y(472), oe = Y(637), me = Y(11), fe = Y(194), le = Y(229), we = Y(825), Te = function(e, t, n) {
|
|
2947
2947
|
n === void 0 && (n = "sv");
|
|
2948
2948
|
var r = document.createElement("div");
|
|
2949
2949
|
r.innerHTML = e;
|
|
@@ -3103,14 +3103,14 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3103
3103
|
ae && ae.setAttribute("aria-label", J.substr(se.length + 3).trim().substr(0, 24));
|
|
3104
3104
|
}
|
|
3105
3105
|
}
|
|
3106
|
-
var ue,
|
|
3107
|
-
_e.forEach(function($, be) {
|
|
3108
|
-
be === 0 ? ue = $ : (ue.insertAdjacentHTML("beforeend", $.innerHTML), $.remove());
|
|
3109
|
-
}), _e.length > 0 && e.ir.element.insertAdjacentElement("beforeend", _e[0]);
|
|
3110
|
-
var Le, Ae = e.ir.element.querySelectorAll("[data-type='footnotes-block']");
|
|
3106
|
+
var ue, Ae = e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");
|
|
3111
3107
|
Ae.forEach(function($, be) {
|
|
3112
|
-
be === 0 ?
|
|
3113
|
-
}), Ae.length > 0 && e.ir.element.insertAdjacentElement("beforeend", Ae[0])
|
|
3108
|
+
be === 0 ? ue = $ : (ue.insertAdjacentHTML("beforeend", $.innerHTML), $.remove());
|
|
3109
|
+
}), Ae.length > 0 && e.ir.element.insertAdjacentElement("beforeend", Ae[0]);
|
|
3110
|
+
var Me, xe = e.ir.element.querySelectorAll("[data-type='footnotes-block']");
|
|
3111
|
+
xe.forEach(function($, be) {
|
|
3112
|
+
be === 0 ? Me = $ : (Me.insertAdjacentHTML("beforeend", $.innerHTML), $.remove());
|
|
3113
|
+
}), xe.length > 0 && e.ir.element.insertAdjacentElement("beforeend", xe[0]), (0, k.ib)(e.ir.element, t), e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function($) {
|
|
3114
3114
|
ve($, e);
|
|
3115
3115
|
}), je(e), Ve(e, {
|
|
3116
3116
|
enableAddUndoStack: !0,
|
|
@@ -3350,7 +3350,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3350
3350
|
enableHint: !0,
|
|
3351
3351
|
enableInput: !0
|
|
3352
3352
|
});
|
|
3353
|
-
},
|
|
3353
|
+
}, Le = function(e, t) {
|
|
3354
3354
|
var n, r, i, a, o;
|
|
3355
3355
|
if (e.sv.composingLock = t.isComposing, t.isComposing || (t.key.indexOf("Arrow") === -1 && t.key !== "Meta" && t.key !== "Control" && t.key !== "Alt" && t.key !== "Shift" && t.key !== "CapsLock" && t.key !== "Escape" && !/^F\d{1,2}$/.test(t.key) && e.undo.recordFirstPosition(e, t), t.key !== "Enter" && t.key !== "Tab" && t.key !== "Backspace" && t.key.indexOf("Arrow") === -1 && !(0, l.yl)(t) && t.key !== "Escape"))
|
|
3356
3356
|
return !1;
|
|
@@ -3397,7 +3397,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3397
3397
|
return !1;
|
|
3398
3398
|
}, X = Y(538), de = function(e) {
|
|
3399
3399
|
e.options.theme === "dark" ? e.element.classList.add("vditor--dark") : e.element.classList.remove("vditor--dark");
|
|
3400
|
-
},
|
|
3400
|
+
}, De = function(e) {
|
|
3401
3401
|
e.element.innerHTML = "", e.element.classList.add("vditor"), e.options.rtl && e.element.setAttribute("dir", "rtl"), de(e), (0, X.Z)(e.options.preview.theme.current, e.options.preview.theme.path), typeof e.options.height == "number" ? e.element.style.height = e.options.height + "px" : e.element.style.height = e.options.height, typeof e.options.minHeight == "number" && (e.element.style.minHeight = e.options.minHeight + "px"), typeof e.options.width == "number" ? e.element.style.width = e.options.width + "px" : e.element.style.width = e.options.width, e.element.appendChild(e.toolbar.element);
|
|
3402
3402
|
var t = document.createElement("div");
|
|
3403
3403
|
if (t.className = "vditor-content", e.options.outline.position === "left" && t.appendChild(e.outline.element), t.appendChild(e.wysiwyg.element.parentElement), t.appendChild(e.sv.element), t.appendChild(e.ir.element.parentElement), t.appendChild(e.preview.element), e.toolbar.elements.devtools && t.appendChild(e.devtools.element), e.options.outline.position === "right" && (e.outline.element.classList.add("vditor-outline--right"), t.appendChild(e.outline.element)), e.upload && t.appendChild(e.upload.element), e.options.resize.enable && t.appendChild(e.resize.element), t.appendChild(e.hint.element), t.appendChild(e.tip.element), e.element.appendChild(t), t.addEventListener("click", function() {
|
|
@@ -3622,7 +3622,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3622
3622
|
B.focus(), B.select();
|
|
3623
3623
|
}
|
|
3624
3624
|
}
|
|
3625
|
-
if (
|
|
3625
|
+
if (_e(e, t))
|
|
3626
3626
|
return !0;
|
|
3627
3627
|
if (I("⇧⌘U", t)) {
|
|
3628
3628
|
var O = e.wysiwyg.popover.querySelector('[data-type="up"]');
|
|
@@ -3670,7 +3670,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3670
3670
|
J && J.nodeType !== 3 && J.getAttribute("data-type") === "math-inline" && n.setStartAfter(J);
|
|
3671
3671
|
}
|
|
3672
3672
|
return i && mt(i, e, t, n) ? (t.preventDefault(), !0) : !1;
|
|
3673
|
-
},
|
|
3673
|
+
}, _e = function(e, t) {
|
|
3674
3674
|
if (I("⇧⌘X", t)) {
|
|
3675
3675
|
var n = e.wysiwyg.popover.querySelector('[data-type="remove"]');
|
|
3676
3676
|
return n && n.click(), t.preventDefault(), !0;
|
|
@@ -3683,7 +3683,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3683
3683
|
t.startContainer.nodeType === 3 ? n = t.startContainer.parentElement : n = n.childNodes[t.startOffset >= n.childNodes.length ? n.childNodes.length - 1 : t.startOffset];
|
|
3684
3684
|
var r = (0, s.a1)(n, "data-type", "footnotes-block");
|
|
3685
3685
|
if (r) {
|
|
3686
|
-
e.wysiwyg.popover.innerHTML = "", Ie(r, e),
|
|
3686
|
+
e.wysiwyg.popover.innerHTML = "", Ie(r, e), He(e, "footnotes-block"), Re(e, r);
|
|
3687
3687
|
return;
|
|
3688
3688
|
}
|
|
3689
3689
|
var i = (0, s.lG)(n, "LI");
|
|
@@ -3741,14 +3741,14 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3741
3741
|
]), p(e.toolbar.elements, ["inline-code"])) : S ? (d(e.toolbar.elements, ["bold"]), p(e.toolbar.elements, ["headings"])) : f && d(e.toolbar.elements, ["table"]);
|
|
3742
3742
|
var T = (0, s.fb)(n, "vditor-toc");
|
|
3743
3743
|
if (T) {
|
|
3744
|
-
e.wysiwyg.popover.innerHTML = "", Ie(T, e),
|
|
3744
|
+
e.wysiwyg.popover.innerHTML = "", Ie(T, e), He(e, "vditor-toc"), Re(e, T);
|
|
3745
3745
|
return;
|
|
3746
3746
|
}
|
|
3747
3747
|
var N = (0, C.S)(n, "BLOCKQUOTE");
|
|
3748
|
-
if (N && (e.wysiwyg.popover.innerHTML = "", Je(t, N, e), Xe(t, N, e), Ie(N, e),
|
|
3748
|
+
if (N && (e.wysiwyg.popover.innerHTML = "", Je(t, N, e), Xe(t, N, e), Ie(N, e), He(e, "blockquote"), Re(e, N)), i && (e.wysiwyg.popover.innerHTML = "", Je(t, i, e), Xe(t, i, e), Ie(i, e), He(e, "li"), Re(e, i)), f) {
|
|
3749
3749
|
e.options.lang, e.options, e.wysiwyg.popover.innerHTML = "";
|
|
3750
3750
|
var R = function() {
|
|
3751
|
-
var q = f.rows.length, te = f.rows[0].cells.length, Ke = parseInt(be.value, 10) || q, ze = parseInt(
|
|
3751
|
+
var q = f.rows.length, te = f.rows[0].cells.length, Ke = parseInt(be.value, 10) || q, ze = parseInt(Oe.value, 10) || te;
|
|
3752
3752
|
if (!(Ke === q && te === ze)) {
|
|
3753
3753
|
if (te !== ze)
|
|
3754
3754
|
for (var ft = ze - te, Ue = 0; Ue < f.rows.length; Ue++)
|
|
@@ -3802,18 +3802,18 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3802
3802
|
var q = getSelection().getRangeAt(0).startContainer, te = (0, s.lG)(q, "TD") || (0, s.lG)(q, "TH");
|
|
3803
3803
|
te && St(e, f, te);
|
|
3804
3804
|
};
|
|
3805
|
-
var
|
|
3806
|
-
|
|
3805
|
+
var Ae = document.createElement("button");
|
|
3806
|
+
Ae.setAttribute("type", "button"), Ae.setAttribute("aria-label", window.VditorI18n.insertColumnLeft + "<" + (0, l.ns)("⇧⌘G") + ">"), Ae.setAttribute("data-type", "insertColumn"), Ae.innerHTML = '<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>', Ae.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", Ae.onclick = function() {
|
|
3807
3807
|
var q = getSelection().getRangeAt(0).startContainer, te = (0, s.lG)(q, "TD") || (0, s.lG)(q, "TH");
|
|
3808
3808
|
te && St(e, f, te, "beforebegin");
|
|
3809
3809
|
};
|
|
3810
|
-
var
|
|
3811
|
-
|
|
3810
|
+
var Me = document.createElement("button");
|
|
3811
|
+
Me.setAttribute("type", "button"), Me.setAttribute("aria-label", window.VditorI18n["delete-row"] + "<" + (0, l.ns)("⌘-") + ">"), Me.setAttribute("data-type", "deleteRow"), Me.innerHTML = '<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>', Me.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", Me.onclick = function() {
|
|
3812
3812
|
var q = getSelection().getRangeAt(0).startContainer, te = (0, s.lG)(q, "TD") || (0, s.lG)(q, "TH");
|
|
3813
3813
|
te && vn(e, t, te);
|
|
3814
3814
|
};
|
|
3815
|
-
var
|
|
3816
|
-
|
|
3815
|
+
var xe = document.createElement("button");
|
|
3816
|
+
xe.setAttribute("type", "button"), xe.setAttribute("aria-label", window.VditorI18n["delete-column"] + "<" + (0, l.ns)("⇧⌘-") + ">"), xe.setAttribute("data-type", "deleteColumn"), xe.innerHTML = '<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>', xe.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n", xe.onclick = function() {
|
|
3817
3817
|
var q = getSelection().getRangeAt(0).startContainer, te = (0, s.lG)(q, "TD") || (0, s.lG)(q, "TH");
|
|
3818
3818
|
te && En(e, t, f, te);
|
|
3819
3819
|
};
|
|
@@ -3825,26 +3825,26 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3825
3825
|
}, be.onkeydown = function(q) {
|
|
3826
3826
|
if (!q.isComposing) {
|
|
3827
3827
|
if (q.key === "Tab") {
|
|
3828
|
-
|
|
3828
|
+
Oe.focus(), Oe.select(), q.preventDefault();
|
|
3829
3829
|
return;
|
|
3830
3830
|
}
|
|
3831
|
-
|
|
3831
|
+
_e(e, q) || Be(q, t);
|
|
3832
3832
|
}
|
|
3833
3833
|
};
|
|
3834
3834
|
var Mt = document.createElement("span");
|
|
3835
3835
|
Mt.setAttribute("aria-label", window.VditorI18n.column), Mt.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
3836
|
-
var
|
|
3837
|
-
Mt.appendChild(
|
|
3836
|
+
var Oe = document.createElement("input");
|
|
3837
|
+
Mt.appendChild(Oe), Oe.type = "number", Oe.min = "1", Oe.className = "vditor-input", Oe.style.width = "42px", Oe.style.textAlign = "center", Oe.setAttribute("placeholder", window.VditorI18n.column), Oe.value = f.rows[0].cells.length.toString(), Oe.oninput = function() {
|
|
3838
3838
|
R();
|
|
3839
|
-
},
|
|
3839
|
+
}, Oe.onkeydown = function(q) {
|
|
3840
3840
|
if (!q.isComposing) {
|
|
3841
3841
|
if (q.key === "Tab") {
|
|
3842
3842
|
be.focus(), be.select(), q.preventDefault();
|
|
3843
3843
|
return;
|
|
3844
3844
|
}
|
|
3845
|
-
|
|
3845
|
+
_e(e, q) || Be(q, t);
|
|
3846
3846
|
}
|
|
3847
|
-
}, Je(t, f, e), Xe(t, f, e), Ie(f, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", G), e.wysiwyg.popover.insertAdjacentElement("beforeend", V), e.wysiwyg.popover.insertAdjacentElement("beforeend", J), e.wysiwyg.popover.insertAdjacentElement("beforeend", ae), e.wysiwyg.popover.insertAdjacentElement("beforeend", se), e.wysiwyg.popover.insertAdjacentElement("beforeend",
|
|
3847
|
+
}, Je(t, f, e), Xe(t, f, e), Ie(f, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", G), e.wysiwyg.popover.insertAdjacentElement("beforeend", V), e.wysiwyg.popover.insertAdjacentElement("beforeend", J), e.wysiwyg.popover.insertAdjacentElement("beforeend", ae), e.wysiwyg.popover.insertAdjacentElement("beforeend", se), e.wysiwyg.popover.insertAdjacentElement("beforeend", Ae), e.wysiwyg.popover.insertAdjacentElement("beforeend", ue), e.wysiwyg.popover.insertAdjacentElement("beforeend", Me), e.wysiwyg.popover.insertAdjacentElement("beforeend", xe), e.wysiwyg.popover.insertAdjacentElement("beforeend", $), e.wysiwyg.popover.insertAdjacentHTML("beforeend", " x "), e.wysiwyg.popover.insertAdjacentElement("beforeend", Mt), He(e, "table"), Re(e, f);
|
|
3848
3848
|
}
|
|
3849
3849
|
var Gt = (0, s.a1)(n, "data-type", "link-ref");
|
|
3850
3850
|
Gt && tn(e, Gt, t);
|
|
@@ -3857,8 +3857,8 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3857
3857
|
$.appendChild(We), We.className = "vditor-input", We.setAttribute("placeholder", window.VditorI18n.footnoteRef + "<" + (0, l.ns)("⌥Enter") + ">"), We.style.width = "120px", We.value = Qe.getAttribute("data-footnotes-label"), We.oninput = function() {
|
|
3858
3858
|
We.value.trim() !== "" && Qe.setAttribute("data-footnotes-label", We.value), typeof e.options.input == "function" && e.options.input(x(e));
|
|
3859
3859
|
}, We.onkeydown = function(te) {
|
|
3860
|
-
te.isComposing ||
|
|
3861
|
-
}, Ie(Qe, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", $),
|
|
3860
|
+
te.isComposing || _e(e, te) || Be(te, t);
|
|
3861
|
+
}, Ie(Qe, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", $), He(e, "footnotes-ref"), Re(e, Qe);
|
|
3862
3862
|
}
|
|
3863
3863
|
var Se = (0, s.fb)(n, "vditor-wysiwyg__block"), In = Se ? Se.getAttribute("data-type").indexOf("block") > -1 : !1;
|
|
3864
3864
|
if (e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(q) {
|
|
@@ -3876,7 +3876,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3876
3876
|
Pe.className = "vditor-input", Pe.setAttribute("placeholder", window.VditorI18n.language + "<" + (0, l.ns)("⌥Enter") + ">"), Pe.value = ut.className.indexOf("language-") > -1 ? ut.className.split("-")[1].split(" ")[0] : "", Pe.oninput = function(q) {
|
|
3877
3877
|
Pe.value.trim() !== "" ? ut.className = "language-".concat(Pe.value) : (ut.className = "", e.hint.recentLanguage = ""), Se.lastElementChild.classList.contains("vditor-wysiwyg__preview") && (Se.lastElementChild.innerHTML = Se.firstElementChild.innerHTML, ve(Se.lastElementChild, e)), ce(e), q.detail === 1 && (t.setStart(ut.firstChild, 0), t.collapse(!0), (0, k.Hc)(t));
|
|
3878
3878
|
}, Pe.onkeydown = function(q) {
|
|
3879
|
-
if (!q.isComposing && !
|
|
3879
|
+
if (!q.isComposing && !_e(e, q)) {
|
|
3880
3880
|
if (q.key === "Escape" && e.hint.element.style.display === "block") {
|
|
3881
3881
|
e.hint.element.style.display = "none", q.preventDefault();
|
|
3882
3882
|
return;
|
|
@@ -3894,9 +3894,9 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3894
3894
|
});
|
|
3895
3895
|
}), e.hint.genHTML(ze, ft, e), q.preventDefault();
|
|
3896
3896
|
}
|
|
3897
|
-
}, e.wysiwyg.popover.insertAdjacentElement("beforeend", kt),
|
|
3897
|
+
}, e.wysiwyg.popover.insertAdjacentElement("beforeend", kt), He(e, "code-block");
|
|
3898
3898
|
} else
|
|
3899
|
-
|
|
3899
|
+
He(e, "block");
|
|
3900
3900
|
Re(e, Se);
|
|
3901
3901
|
} else
|
|
3902
3902
|
Se = void 0;
|
|
@@ -3908,12 +3908,12 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3908
3908
|
$.appendChild(qe), qe.className = "vditor-input", qe.setAttribute("placeholder", "ID<" + (0, l.ns)("⌥Enter") + ">"), qe.style.width = "120px", qe.value = S.getAttribute("data-id") || "", qe.oninput = function() {
|
|
3909
3909
|
S.setAttribute("data-id", qe.value), typeof e.options.input == "function" && e.options.input(x(e));
|
|
3910
3910
|
}, qe.onkeydown = function(te) {
|
|
3911
|
-
te.isComposing ||
|
|
3912
|
-
}, Je(t, S, e), Xe(t, S, e), Ie(S, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", $),
|
|
3911
|
+
te.isComposing || _e(e, te) || Be(te, t);
|
|
3912
|
+
}, Je(t, S, e), Xe(t, S, e), Ie(S, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", $), He(e, "heading"), Re(e, S);
|
|
3913
3913
|
}
|
|
3914
3914
|
if (h && Dt(e, h, t), !N && !i && !f && !Se && !h && !Gt && !Qe && !S && !T) {
|
|
3915
3915
|
var et = (0, s.a1)(n, "data-block", "0");
|
|
3916
|
-
et && et.parentElement.isEqualNode(e.wysiwyg.element) ? (e.wysiwyg.popover.innerHTML = "", Je(t, et, e), Xe(t, et, e), Ie(et, e),
|
|
3916
|
+
et && et.parentElement.isEqualNode(e.wysiwyg.element) ? (e.wysiwyg.popover.innerHTML = "", Je(t, et, e), Xe(t, et, e), Ie(et, e), He(e, "block"), Re(e, et)) : e.wysiwyg.popover.style.display = "none";
|
|
3917
3917
|
}
|
|
3918
3918
|
e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(q) {
|
|
3919
3919
|
q.style.display = "none";
|
|
@@ -3935,7 +3935,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3935
3935
|
i.appendChild(a), a.className = "vditor-input", a.setAttribute("placeholder", window.VditorI18n.textIsNotEmpty), a.style.width = "120px", a.value = t.getAttribute("alt") || t.textContent, a.oninput = function() {
|
|
3936
3936
|
r();
|
|
3937
3937
|
}, a.onkeydown = function(h) {
|
|
3938
|
-
|
|
3938
|
+
_e(e, h) || Be(h, n) || at(e, t, h, u);
|
|
3939
3939
|
};
|
|
3940
3940
|
var o = document.createElement("span");
|
|
3941
3941
|
o.setAttribute("aria-label", window.VditorI18n.linkRef), o.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
@@ -3943,8 +3943,8 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3943
3943
|
o.appendChild(u), u.className = "vditor-input", u.setAttribute("placeholder", window.VditorI18n.linkRef), u.value = t.getAttribute("data-link-label"), u.oninput = function() {
|
|
3944
3944
|
r();
|
|
3945
3945
|
}, u.onkeydown = function(h) {
|
|
3946
|
-
|
|
3947
|
-
}, Ie(t, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", i), e.wysiwyg.popover.insertAdjacentElement("beforeend", o),
|
|
3946
|
+
_e(e, h) || Be(h, n) || at(e, t, h, a);
|
|
3947
|
+
}, Ie(t, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", i), e.wysiwyg.popover.insertAdjacentElement("beforeend", o), He(e, "link-ref"), Re(e, t);
|
|
3948
3948
|
}, Je = function(e, t, n) {
|
|
3949
3949
|
var r = t.previousElementSibling;
|
|
3950
3950
|
if (!(!r || !t.parentElement.isEqualNode(n.wysiwyg.element) && t.tagName !== "LI")) {
|
|
@@ -3992,7 +3992,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
3992
3992
|
i.appendChild(a), a.className = "vditor-input", a.setAttribute("placeholder", window.VditorI18n.textIsNotEmpty), a.style.width = "120px", a.value = t.innerHTML || "", a.oninput = function() {
|
|
3993
3993
|
r();
|
|
3994
3994
|
}, a.onkeydown = function(S) {
|
|
3995
|
-
|
|
3995
|
+
_e(e, S) || Be(S, n) || at(e, t, S, u);
|
|
3996
3996
|
};
|
|
3997
3997
|
var o = document.createElement("span");
|
|
3998
3998
|
o.setAttribute("aria-label", window.VditorI18n.link), o.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
@@ -4000,7 +4000,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
4000
4000
|
o.appendChild(u), u.className = "vditor-input", u.setAttribute("placeholder", window.VditorI18n.link), u.value = t.getAttribute("href") || "", u.oninput = function() {
|
|
4001
4001
|
r();
|
|
4002
4002
|
}, u.onkeydown = function(S) {
|
|
4003
|
-
|
|
4003
|
+
_e(e, S) || Be(S, n) || at(e, t, S, f);
|
|
4004
4004
|
};
|
|
4005
4005
|
var h = document.createElement("span");
|
|
4006
4006
|
h.setAttribute("aria-label", window.VditorI18n.tooltipText), h.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
@@ -4008,8 +4008,8 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
4008
4008
|
h.appendChild(f), f.className = "vditor-input", f.setAttribute("placeholder", window.VditorI18n.tooltipText), f.style.width = "60px", f.value = t.getAttribute("title") || "", f.oninput = function() {
|
|
4009
4009
|
r();
|
|
4010
4010
|
}, f.onkeydown = function(S) {
|
|
4011
|
-
|
|
4012
|
-
}, Ie(t, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", i), e.wysiwyg.popover.insertAdjacentElement("beforeend", o), e.wysiwyg.popover.insertAdjacentElement("beforeend", h),
|
|
4011
|
+
_e(e, S) || Be(S, n) || at(e, t, S, a);
|
|
4012
|
+
}, Ie(t, e), e.wysiwyg.popover.insertAdjacentElement("beforeend", i), e.wysiwyg.popover.insertAdjacentElement("beforeend", o), e.wysiwyg.popover.insertAdjacentElement("beforeend", h), He(e, "a"), Re(e, t);
|
|
4013
4013
|
}, $n = function(e, t) {
|
|
4014
4014
|
var n = e.target;
|
|
4015
4015
|
t.wysiwyg.popover.innerHTML = "";
|
|
@@ -4021,7 +4021,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
4021
4021
|
i.appendChild(a), a.className = "vditor-input", a.setAttribute("placeholder", window.VditorI18n.imageURL), a.value = n.getAttribute("src") || "", a.oninput = function() {
|
|
4022
4022
|
r();
|
|
4023
4023
|
}, a.onkeydown = function(S) {
|
|
4024
|
-
|
|
4024
|
+
_e(t, S);
|
|
4025
4025
|
};
|
|
4026
4026
|
var o = document.createElement("span");
|
|
4027
4027
|
o.setAttribute("aria-label", window.VditorI18n.alternateText), o.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
@@ -4029,7 +4029,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
4029
4029
|
o.appendChild(u), u.className = "vditor-input", u.setAttribute("placeholder", window.VditorI18n.alternateText), u.style.width = "52px", u.value = n.getAttribute("alt") || "", u.oninput = function() {
|
|
4030
4030
|
r();
|
|
4031
4031
|
}, u.onkeydown = function(S) {
|
|
4032
|
-
|
|
4032
|
+
_e(t, S);
|
|
4033
4033
|
};
|
|
4034
4034
|
var h = document.createElement("span");
|
|
4035
4035
|
h.setAttribute("aria-label", window.VditorI18n.title), h.className = "vditor-tooltipped vditor-tooltipped__n";
|
|
@@ -4037,12 +4037,12 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
4037
4037
|
h.appendChild(f), f.className = "vditor-input", f.setAttribute("placeholder", window.VditorI18n.title), f.value = n.getAttribute("title") || "", f.oninput = function() {
|
|
4038
4038
|
r();
|
|
4039
4039
|
}, f.onkeydown = function(S) {
|
|
4040
|
-
|
|
4041
|
-
}, Ie(n, t), t.wysiwyg.popover.insertAdjacentElement("beforeend", i), t.wysiwyg.popover.insertAdjacentElement("beforeend", o), t.wysiwyg.popover.insertAdjacentElement("beforeend", h),
|
|
4040
|
+
_e(t, S);
|
|
4041
|
+
}, Ie(n, t), t.wysiwyg.popover.insertAdjacentElement("beforeend", i), t.wysiwyg.popover.insertAdjacentElement("beforeend", o), t.wysiwyg.popover.insertAdjacentElement("beforeend", h), He(t, "image"), Re(t, n);
|
|
4042
4042
|
}, Be = function(e, t) {
|
|
4043
4043
|
if (!(0, l.yl)(e) && !e.shiftKey && e.key === "Enter" || e.key === "Escape")
|
|
4044
4044
|
return t && (0, k.Hc)(t), e.preventDefault(), e.stopPropagation(), !0;
|
|
4045
|
-
},
|
|
4045
|
+
}, He = function(e, t) {
|
|
4046
4046
|
e.options.customWysiwygToolbar(t, e.wysiwyg.popover);
|
|
4047
4047
|
}, Ye = function(e) {
|
|
4048
4048
|
e.currentMode === "wysiwyg" ? Ge(e) : e.currentMode === "ir" && rt(e);
|
|
@@ -4296,7 +4296,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
4296
4296
|
t.addEventListener("keydown", function(n) {
|
|
4297
4297
|
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))) {
|
|
4298
4298
|
if (e.options.comment.enable && e.currentMode === "wysiwyg" && (n.key === "Backspace" || I("⌘X", n)) && e.wysiwyg.getComments(e), e.currentMode === "sv") {
|
|
4299
|
-
if (
|
|
4299
|
+
if (Le(e, n))
|
|
4300
4300
|
return;
|
|
4301
4301
|
} else if (e.currentMode === "wysiwyg") {
|
|
4302
4302
|
if (Yn(e, n))
|
|
@@ -5250,21 +5250,21 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
5250
5250
|
ue.open("POST", e.options.upload.linkToImgUrl), e.options.upload.token && ue.setRequestHeader("X-Upload-Token", e.options.upload.token), e.options.upload.withCredentials && (ue.withCredentials = !0), ln(e, ue), ue.setRequestHeader("Content-Type", "application/json; charset=utf-8"), ue.onreadystatechange = function() {
|
|
5251
5251
|
if (ue.readyState === XMLHttpRequest.DONE) {
|
|
5252
5252
|
if (ue.status === 200) {
|
|
5253
|
-
var
|
|
5254
|
-
e.options.upload.linkToImgFormat && (
|
|
5255
|
-
var
|
|
5256
|
-
if (
|
|
5257
|
-
e.tip.show(
|
|
5253
|
+
var Ae = ue.responseText;
|
|
5254
|
+
e.options.upload.linkToImgFormat && (Ae = e.options.upload.linkToImgFormat(ue.responseText));
|
|
5255
|
+
var Me = JSON.parse(Ae);
|
|
5256
|
+
if (Me.code !== 0) {
|
|
5257
|
+
e.tip.show(Me.msg);
|
|
5258
5258
|
return;
|
|
5259
5259
|
}
|
|
5260
|
-
var
|
|
5260
|
+
var xe = Me.data.originalURL;
|
|
5261
5261
|
if (e.currentMode === "sv")
|
|
5262
5262
|
e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(be) {
|
|
5263
|
-
be.textContent ===
|
|
5263
|
+
be.textContent === xe && (be.textContent = Me.data.url);
|
|
5264
5264
|
});
|
|
5265
5265
|
else {
|
|
5266
|
-
var $ = e[e.currentMode].element.querySelector('img[src="'.concat(
|
|
5267
|
-
$.src =
|
|
5266
|
+
var $ = e[e.currentMode].element.querySelector('img[src="'.concat(xe, '"]'));
|
|
5267
|
+
$.src = Me.data.url, e.currentMode === "ir" && ($.previousElementSibling.previousElementSibling.innerHTML = Me.data.url);
|
|
5268
5268
|
}
|
|
5269
5269
|
ee(e);
|
|
5270
5270
|
} else
|
|
@@ -5274,7 +5274,7 @@ onclick="event.stopPropagation();this.previousElementSibling.select();document.e
|
|
|
5274
5274
|
}, ue.send(JSON.stringify({ url: ae }));
|
|
5275
5275
|
}
|
|
5276
5276
|
return e.currentMode === "ir" ? ['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(ae), "</span>"), Lute.WalkContinue] : e.currentMode === "wysiwyg" ? ["", Lute.WalkContinue] : ['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(ae), "</span>"), Lute.WalkContinue];
|
|
5277
|
-
}, (r.replace(/&/g, "&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig, "").trim() === '<a href="'.concat(i, '">').concat(i, "</a>") || r.replace(/&/g, "&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig, "").trim() === '<!--StartFragment--><a href="'.concat(i, '">').concat(i, "</a><!--EndFragment-->")) && (r = ""), h = new DOMParser().parseFromString(r, "text/html"), h.body && (r = h.body.innerHTML), r = Lute.Sanitize(r), e.wysiwyg.getComments(e), f = e[e.currentMode].element.scrollHeight, S =
|
|
5277
|
+
}, (r.replace(/&/g, "&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig, "").trim() === '<a href="'.concat(i, '">').concat(i, "</a>") || r.replace(/&/g, "&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig, "").trim() === '<!--StartFragment--><a href="'.concat(i, '">').concat(i, "</a><!--EndFragment-->")) && (r = ""), h = new DOMParser().parseFromString(r, "text/html"), h.body && (r = h.body.innerHTML), r = Lute.Sanitize(r), e.wysiwyg.getComments(e), f = e[e.currentMode].element.scrollHeight, S = Te(r, i, e.currentMode), T = e.currentMode === "sv" ? (0, s.a1)(t.target, "data-type", "code-block") : (0, s.lG)(t.target, "CODE"), T ? (e.currentMode === "sv" ? document.execCommand("insertHTML", !1, i.replace(/&/g, "&").replace(/</g, "<")) : (N = (0, k.im)(t.target, e[e.currentMode].element), T.parentElement.tagName !== "PRE" && (i += E.g.ZWSP), T.textContent = T.textContent.substring(0, N.start) + i + T.textContent.substring(N.end), (0, k.$j)(N.start + i.length, N.start + i.length, T.parentElement), !((G = T.parentElement) === null || G === void 0) && G.nextElementSibling.classList.contains("vditor-".concat(e.currentMode, "__preview")) && (T.parentElement.nextElementSibling.innerHTML = T.outerHTML, ve(T.parentElement.nextElementSibling, e))), [3, 10]) : [3, 1]);
|
|
5278
5278
|
case 1:
|
|
5279
5279
|
return S ? (n.pasteCode(S), [3, 10]) : [3, 2];
|
|
5280
5280
|
case 2:
|
|
@@ -8015,13 +8015,13 @@ window.addEventListener("message", (e) => {
|
|
|
8015
8015
|
paragraphBeginningSpace: i.vditor.options.preview.markdown.paragraphBeginningSpace,
|
|
8016
8016
|
sanitize: i.vditor.options.preview.markdown.sanitize,
|
|
8017
8017
|
toc: i.vditor.options.preview.markdown.toc
|
|
8018
|
-
}), i.vditor.preview = new Sr(i.vditor),
|
|
8018
|
+
}), i.vditor.preview = new Sr(i.vditor), De(i.vditor), r.after && r.after(), r.icon && (0, A.J)("".concat(r.cdn, "/dist/js/icons/").concat(r.icon, ".js"), "vditorIconScript");
|
|
8019
8019
|
}));
|
|
8020
8020
|
}, t;
|
|
8021
8021
|
})(Z.default)
|
|
8022
8022
|
);
|
|
8023
8023
|
const _i = Ti;
|
|
8024
|
-
})(),
|
|
8024
|
+
})(), ke = ke.default, ke;
|
|
8025
8025
|
})()
|
|
8026
8026
|
);
|
|
8027
8027
|
});
|
|
@@ -8050,17 +8050,17 @@ const Fi = /* @__PURE__ */ ji(Wi), qi = { class: "dsg-editor" }, Ki = {
|
|
|
8050
8050
|
modelModifiers: {}
|
|
8051
8051
|
}),
|
|
8052
8052
|
emits: /* @__PURE__ */ Vn(["on-before-input", "on-after-input", "update:modelValue"], ["update:modelValue"]),
|
|
8053
|
-
setup(
|
|
8054
|
-
let nt = xi(
|
|
8053
|
+
setup(Ce, { expose: Xt, emit: pt }) {
|
|
8054
|
+
let nt = xi(Ce, "modelValue"), Y = Wn(nt);
|
|
8055
8055
|
Di(
|
|
8056
8056
|
() => Y.value,
|
|
8057
8057
|
(w, b) => {
|
|
8058
8058
|
m("update:modelValue", w);
|
|
8059
8059
|
}
|
|
8060
8060
|
);
|
|
8061
|
-
const
|
|
8062
|
-
modelId:
|
|
8063
|
-
modelClass:
|
|
8061
|
+
const ke = Wn(), Z = Hi("vditor"), E = () => ({
|
|
8062
|
+
modelId: Ce.targetModel ? Ce.targetModel.id : "",
|
|
8063
|
+
modelClass: Ce.targetModelClass ? Ce.targetModelClass : ""
|
|
8064
8064
|
}), L = (w, b) => {
|
|
8065
8065
|
if (!w)
|
|
8066
8066
|
return !1;
|
|
@@ -8074,7 +8074,7 @@ const Fi = /* @__PURE__ */ ji(Wi), qi = { class: "dsg-editor" }, Ki = {
|
|
|
8074
8074
|
const g = w[w.currentMode].element;
|
|
8075
8075
|
return getSelection().rangeCount > 0 && (b = getSelection().getRangeAt(0), g.isEqualNode(b.startContainer) || g.contains(b.startContainer)) ? b : w[w.currentMode].range ? w[w.currentMode].range : (g.focus(), b = g.ownerDocument.createRange(), b.setStart(g, 0), b.collapse(!0), b);
|
|
8076
8076
|
}, A = (w) => {
|
|
8077
|
-
let b = x(
|
|
8077
|
+
let b = x(ke.value.vditor);
|
|
8078
8078
|
const g = L(b.startContainer, "LI");
|
|
8079
8079
|
if (!g || g.nextElementSibling || g.previousElementSibling)
|
|
8080
8080
|
return !1;
|
|
@@ -8084,7 +8084,7 @@ const Fi = /* @__PURE__ */ ji(Wi), qi = { class: "dsg-editor" }, Ki = {
|
|
|
8084
8084
|
let _ = document.createElement("input");
|
|
8085
8085
|
_.setAttribute("type", "checkbox"), g.insertBefore(_, g.firstChild), C && C.parentNode && C.parentNode.removeChild(C), b.setStartAfter(g), b.collapse(!0);
|
|
8086
8086
|
}
|
|
8087
|
-
}, c = () =>
|
|
8087
|
+
}, c = () => Ce.csrf ? Ce.csrf : window.csrf, l = (w) => new Promise((b) => {
|
|
8088
8088
|
new MutationObserver((s, C) => {
|
|
8089
8089
|
const _ = document.querySelector(w);
|
|
8090
8090
|
_ && (C.disconnect(), b(_));
|
|
@@ -8104,7 +8104,7 @@ const Fi = /* @__PURE__ */ ji(Wi), qi = { class: "dsg-editor" }, Ki = {
|
|
|
8104
8104
|
const _ = new FileReader();
|
|
8105
8105
|
_.readAsDataURL(g.getAsFile()), _.onload = () => {
|
|
8106
8106
|
const D = _.result;
|
|
8107
|
-
|
|
8107
|
+
ke.value?.insertMD(`🐰 
|
|
8108
8108
|
`);
|
|
8109
8109
|
};
|
|
8110
8110
|
}
|
|
@@ -8135,7 +8135,7 @@ const Fi = /* @__PURE__ */ ji(Wi), qi = { class: "dsg-editor" }, Ki = {
|
|
|
8135
8135
|
"insert-after",
|
|
8136
8136
|
"|"
|
|
8137
8137
|
];
|
|
8138
|
-
|
|
8138
|
+
Ce.mediaUploadEndpoint && c() !== "" && w.push("upload");
|
|
8139
8139
|
let b = [
|
|
8140
8140
|
"table",
|
|
8141
8141
|
"|",
|
|
@@ -8171,46 +8171,46 @@ const Fi = /* @__PURE__ */ ji(Wi), qi = { class: "dsg-editor" }, Ki = {
|
|
|
8171
8171
|
after: () => {
|
|
8172
8172
|
Z.value.getElementsByClassName("vditor-wysiwyg")[0].addEventListener("keyup", (g) => {
|
|
8173
8173
|
g.key === "Enter" && A() && g.preventDefault();
|
|
8174
|
-
}), Y.value &&
|
|
8174
|
+
}), Y.value && ke.value?.setValue(Y.value);
|
|
8175
8175
|
},
|
|
8176
8176
|
input: (b) => {
|
|
8177
8177
|
m("on-before-input", Y.value, b), Y.value = b, m("on-after-input", b);
|
|
8178
8178
|
},
|
|
8179
8179
|
upload: {}
|
|
8180
8180
|
};
|
|
8181
|
-
|
|
8181
|
+
Ce.mediaUploadEndpoint && c() !== "" && (w.upload = {
|
|
8182
8182
|
accept: "image/*",
|
|
8183
|
-
url:
|
|
8183
|
+
url: Ce.mediaUploadEndpoint,
|
|
8184
8184
|
headers: { "X-CSRF-TOKEN": c() },
|
|
8185
8185
|
extraData: E(),
|
|
8186
8186
|
multiple: !1,
|
|
8187
8187
|
error: (b) => {
|
|
8188
|
-
|
|
8188
|
+
ke.value?.vditor.tip.show("The file upload failed", 5e3);
|
|
8189
8189
|
},
|
|
8190
8190
|
success: (b, g) => {
|
|
8191
8191
|
const s = JSON.parse(g);
|
|
8192
8192
|
document.execCommand("insertHTML", !1, `
|
|
8193
|
-
`), Y.value =
|
|
8193
|
+
`), Y.value = ke.value.getValue(), ke.value?.setValue(ke.value.getValue()), m("update:modelValue", Y.value), ke.value?.vditor.tip.hide();
|
|
8194
8194
|
}
|
|
8195
|
-
}), Z.value && (
|
|
8195
|
+
}), Z.value && (ke.value = new Fi(Z.value, w), l("pre.vditor-reset").then((b) => {
|
|
8196
8196
|
y(b);
|
|
8197
8197
|
}));
|
|
8198
8198
|
});
|
|
8199
8199
|
const m = pt;
|
|
8200
8200
|
return Xt({
|
|
8201
|
-
getEditor: () =>
|
|
8201
|
+
getEditor: () => ke.value,
|
|
8202
8202
|
getEditorValue: () => Y.value
|
|
8203
8203
|
}), (w, b) => (dt(), Tt("div", qi, [
|
|
8204
8204
|
Fn("div", null, [
|
|
8205
|
-
|
|
8205
|
+
Ce.label ? (dt(), Ni(Bi, {
|
|
8206
8206
|
key: 0,
|
|
8207
8207
|
classes: "dsg-editor__label",
|
|
8208
|
-
label:
|
|
8208
|
+
label: Ce.label
|
|
8209
8209
|
}, null, 8, ["label"])) : qn("", !0),
|
|
8210
8210
|
Fn("div", Ki, null, 512)
|
|
8211
8211
|
]),
|
|
8212
|
-
|
|
8213
|
-
(dt(!0), Tt(Ri, null, Ii(
|
|
8212
|
+
Ce.errors && Ce.errors.length ? (dt(), Tt("div", zi, [
|
|
8213
|
+
(dt(!0), Tt(Ri, null, Ii(Ce.errors, (g, s) => (dt(), Tt("div", {
|
|
8214
8214
|
class: "dsg-editor--error",
|
|
8215
8215
|
key: s
|
|
8216
8216
|
}, Pi(g), 1))), 128))
|