@editora/core 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
- package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
- package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
- package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
- package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
- package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
- package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
- package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
- package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
- package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
- package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
- package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
- package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
- package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
- package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
- package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
- package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
- package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
- package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
- package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
- package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
- package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
- package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
- package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
- package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
- package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
- package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
- package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
- package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
- package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
- package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
- package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
- package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
- package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
- package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
- package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
- package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
- package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
- package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
- package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
- package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
- package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
- package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
- package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
- package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
- package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
- package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
- package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
- package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
- package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
- package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
- package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
- package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
- package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
- package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
- package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
- package/dist/core.css +1 -0
- package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
- package/dist/editora.min.js +13 -14
- package/dist/editora.umd.js +13 -14
- package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
- package/dist/index-BslAFzmv.mjs +16544 -0
- package/dist/index-CPMGUZfB.js +10 -0
- package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-BYD2KEo6.mjs +6666 -0
- package/dist/index.esm.js +7 -12
- package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
- package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
- package/dist/plugin-loader.js +67 -67
- package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
- package/dist/webcomponent-core.js +131 -168
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +139 -63
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +191 -228
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1240 -1344
- package/package.json +1 -1
- package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
- package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
- package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
- package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
- package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
- package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
- package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
- package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
- package/dist/MathPlugin.native-735bbac2.mjs +0 -296
- package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
- package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
- package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
- package/dist/documentManager-8327fb6e.mjs +0 -9166
- package/dist/index-072ef022.js +0 -11
- package/dist/index-49d31221.mjs +0 -16860
- package/dist/index.es-b47a189f.mjs +0 -5782
- package/dist/style.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const x = {
|
|
2
2
|
all: {
|
|
3
3
|
name: "All",
|
|
4
4
|
characters: [
|
|
@@ -389,7 +389,7 @@ const m = {
|
|
|
389
389
|
name: "Arrows",
|
|
390
390
|
characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
|
|
391
391
|
}
|
|
392
|
-
},
|
|
392
|
+
}, E = {
|
|
393
393
|
"€": "euro",
|
|
394
394
|
"£": "pound",
|
|
395
395
|
"¥": "yen",
|
|
@@ -438,24 +438,41 @@ const m = {
|
|
|
438
438
|
"↓": "down arrow",
|
|
439
439
|
"↔": "left right arrow"
|
|
440
440
|
};
|
|
441
|
-
let
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
441
|
+
let w = !1;
|
|
442
|
+
const z = '[data-theme="dark"], .dark, .editora-theme-dark', S = (r) => r ? r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement : null, m = () => {
|
|
443
|
+
const r = window.getSelection();
|
|
444
|
+
if (!r || r.rangeCount === 0) return null;
|
|
445
|
+
const e = S(r.getRangeAt(0).startContainer);
|
|
446
|
+
return (e == null ? void 0 : e.closest('.rte-content, .editora-content, [contenteditable="true"]')) || null;
|
|
447
|
+
}, A = (r) => {
|
|
448
|
+
const e = window.getSelection();
|
|
449
|
+
if (!e || e.rangeCount === 0) return null;
|
|
450
|
+
const a = e.getRangeAt(0);
|
|
451
|
+
return !r.contains(a.startContainer) || !r.contains(a.endContainer) ? null : a.cloneRange();
|
|
452
|
+
}, L = (r) => {
|
|
453
|
+
const e = document.createRange();
|
|
454
|
+
return e.selectNodeContents(r), e.collapse(!1), e;
|
|
455
|
+
}, T = (r, e, a) => {
|
|
456
|
+
if (e !== a) {
|
|
457
|
+
if (typeof window.execEditorCommand == "function") {
|
|
458
|
+
window.execEditorCommand("recordDomTransaction", r, e, a);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
if (typeof window.executeEditorCommand == "function")
|
|
462
|
+
try {
|
|
463
|
+
window.executeEditorCommand("recordDomTransaction", { editor: r, beforeHTML: e, afterHTML: a });
|
|
464
|
+
} catch (c) {
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}, q = (r) => {
|
|
468
|
+
const e = r || m();
|
|
469
|
+
return e ? !!e.closest(z) : !1;
|
|
470
|
+
}, N = () => {
|
|
471
|
+
if (typeof document == "undefined") return;
|
|
472
|
+
const r = "special-characters-plugin-styles";
|
|
473
|
+
if (document.getElementById(r)) return;
|
|
457
474
|
const e = document.createElement("style");
|
|
458
|
-
e.id =
|
|
475
|
+
e.id = r, e.textContent = `
|
|
459
476
|
.special-characters-overlay {
|
|
460
477
|
--rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
461
478
|
--rte-sc-dialog-bg: #ffffff;
|
|
@@ -722,32 +739,35 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
722
739
|
}
|
|
723
740
|
}
|
|
724
741
|
`, document.head.appendChild(e);
|
|
725
|
-
},
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
742
|
+
}, D = (r, e, a) => {
|
|
743
|
+
const c = e || m();
|
|
744
|
+
if (!c) return;
|
|
745
|
+
const l = a && c.contains(a.commonAncestorContainer) ? a : L(c), d = c.innerHTML;
|
|
746
|
+
l.deleteContents();
|
|
747
|
+
const i = document.createTextNode(r);
|
|
748
|
+
l.insertNode(i), l.setStartAfter(i), l.setEndAfter(i);
|
|
749
|
+
const o = window.getSelection();
|
|
750
|
+
o && (o.removeAllRanges(), o.addRange(l));
|
|
751
|
+
const p = c.innerHTML;
|
|
752
|
+
T(c, d, p), c.dispatchEvent(new window.Event("input", { bubbles: !0 })), c.focus();
|
|
753
|
+
}, R = (r) => {
|
|
754
|
+
if (typeof window == "undefined" || w) return;
|
|
755
|
+
w = !0, N();
|
|
756
|
+
const e = r || m(), a = e ? A(e) : null;
|
|
757
|
+
let c = "all", l = "", d = null;
|
|
738
758
|
const i = document.createElement("div");
|
|
739
|
-
i.className = "special-characters-overlay",
|
|
740
|
-
const
|
|
741
|
-
|
|
759
|
+
i.className = "special-characters-overlay", q(r) && i.classList.add("rte-ui-theme-dark");
|
|
760
|
+
const o = document.createElement("div");
|
|
761
|
+
o.className = "special-characters-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.innerHTML = `
|
|
742
762
|
<div class="special-characters-header">
|
|
743
763
|
<h2>Insert Special Characters</h2>
|
|
744
764
|
<button class="special-characters-close">×</button>
|
|
745
765
|
</div>
|
|
746
766
|
<div class="special-characters-content">
|
|
747
767
|
<div class="special-characters-tabs">
|
|
748
|
-
${Object.keys(
|
|
749
|
-
<button class="special-characters-tab ${
|
|
750
|
-
${
|
|
768
|
+
${Object.keys(x).map((t) => `
|
|
769
|
+
<button class="special-characters-tab ${c === t ? "active" : ""}" data-category="${t}">
|
|
770
|
+
${x[t].name}
|
|
751
771
|
</button>
|
|
752
772
|
`).join("")}
|
|
753
773
|
</div>
|
|
@@ -763,53 +783,49 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
763
783
|
</div>
|
|
764
784
|
</div>
|
|
765
785
|
`;
|
|
766
|
-
const
|
|
767
|
-
if (!
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
r.classList.toggle("active", r.getAttribute("data-category") === e);
|
|
786
|
+
const p = o.querySelector(".special-characters-tabs"), u = o.querySelector(".special-characters-grid"), h = o.querySelector(".special-characters-search-input"), f = o.querySelector(".special-characters-close"), C = () => x[c].characters.filter((t) => {
|
|
787
|
+
if (!l.trim()) return !0;
|
|
788
|
+
const s = l.toLowerCase();
|
|
789
|
+
return t.toLowerCase().includes(s) || (E[t] || "").toLowerCase().includes(s);
|
|
790
|
+
}), k = () => {
|
|
791
|
+
p == null || p.querySelectorAll(".special-characters-tab").forEach((t) => {
|
|
792
|
+
t.classList.toggle("active", t.getAttribute("data-category") === c);
|
|
774
793
|
});
|
|
775
|
-
},
|
|
776
|
-
if (!
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
794
|
+
}, v = () => {
|
|
795
|
+
if (!u) return;
|
|
796
|
+
const t = C();
|
|
797
|
+
if (u.textContent = "", t.length === 0) {
|
|
798
|
+
const s = document.createElement("div");
|
|
799
|
+
s.className = "special-characters-no-results", s.textContent = `No characters found for "${l}"`, u.appendChild(s);
|
|
781
800
|
return;
|
|
782
801
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), g());
|
|
802
|
+
t.forEach((s) => {
|
|
803
|
+
const n = document.createElement("button");
|
|
804
|
+
n.type = "button", n.className = "special-characters-item", n.dataset.char = s, n.title = E[s] || s, n.textContent = s, u.appendChild(n);
|
|
805
|
+
});
|
|
806
|
+
}, b = () => {
|
|
807
|
+
d !== null && (window.clearTimeout(d), d = null), i.parentNode && i.parentNode.removeChild(i), w = !1, document.removeEventListener("keydown", y, !0);
|
|
808
|
+
}, y = (t) => {
|
|
809
|
+
t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), b());
|
|
792
810
|
};
|
|
793
|
-
|
|
794
|
-
const
|
|
795
|
-
if (!
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
c = null, b();
|
|
811
|
+
f == null || f.addEventListener("click", b), p == null || p.addEventListener("click", (t) => {
|
|
812
|
+
const n = t.target.closest(".special-characters-tab");
|
|
813
|
+
if (!n) return;
|
|
814
|
+
const g = n.getAttribute("data-category");
|
|
815
|
+
!g || c === g || (c = g, k(), v());
|
|
816
|
+
}), h == null || h.addEventListener("input", (t) => {
|
|
817
|
+
l = t.target.value, d !== null && window.clearTimeout(d), d = window.setTimeout(() => {
|
|
818
|
+
d = null, v();
|
|
802
819
|
}, 90);
|
|
803
|
-
}),
|
|
804
|
-
const
|
|
805
|
-
if (!
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}, q = () => ({
|
|
820
|
+
}), u == null || u.addEventListener("click", (t) => {
|
|
821
|
+
const n = t.target.closest(".special-characters-item");
|
|
822
|
+
if (!n) return;
|
|
823
|
+
const g = n.dataset.char;
|
|
824
|
+
g && (D(g, e, a), b());
|
|
825
|
+
}), i.addEventListener("click", (t) => {
|
|
826
|
+
t.target === i && b();
|
|
827
|
+
}), document.addEventListener("keydown", y, !0), k(), v(), i.appendChild(o), document.body.appendChild(i), requestAnimationFrame(() => h == null ? void 0 : h.focus());
|
|
828
|
+
}, j = () => ({
|
|
813
829
|
name: "specialCharacters",
|
|
814
830
|
toolbar: [{
|
|
815
831
|
label: "Special Characters",
|
|
@@ -817,14 +833,14 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
817
833
|
icon: '<svg width="24" height="24" focusable="false"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"></path></svg>'
|
|
818
834
|
}],
|
|
819
835
|
commands: {
|
|
820
|
-
insertSpecialCharacter: (
|
|
821
|
-
const
|
|
822
|
-
return
|
|
836
|
+
insertSpecialCharacter: (r, e) => {
|
|
837
|
+
const a = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : m();
|
|
838
|
+
return R(a), !0;
|
|
823
839
|
}
|
|
824
840
|
},
|
|
825
841
|
keymap: {}
|
|
826
842
|
});
|
|
827
843
|
export {
|
|
828
|
-
|
|
844
|
+
j as SpecialCharactersPlugin
|
|
829
845
|
};
|
|
830
|
-
//# sourceMappingURL=SpecialCharactersPlugin.native-
|
|
846
|
+
//# sourceMappingURL=SpecialCharactersPlugin.native-DaG4b19I.mjs.map
|
|
@@ -119,8 +119,7 @@ const B = {
|
|
|
119
119
|
function K(e) {
|
|
120
120
|
var l;
|
|
121
121
|
const t = (e == null ? void 0 : e.contentElement) || (e == null ? void 0 : e.editorElement) || null;
|
|
122
|
-
if (!(t instanceof HTMLElement))
|
|
123
|
-
return;
|
|
122
|
+
if (!(t instanceof HTMLElement)) return;
|
|
124
123
|
const r = t.getAttribute("contenteditable") === "true" ? t : (l = t.querySelector) == null ? void 0 : l.call(t, '[contenteditable="true"]');
|
|
125
124
|
if (r instanceof HTMLElement) {
|
|
126
125
|
s = r, h = r;
|
|
@@ -130,19 +129,15 @@ function K(e) {
|
|
|
130
129
|
o && (s = o, h = o);
|
|
131
130
|
}
|
|
132
131
|
function P() {
|
|
133
|
-
if (typeof window == "undefined")
|
|
134
|
-
return null;
|
|
132
|
+
if (typeof window == "undefined") return null;
|
|
135
133
|
const e = window[R];
|
|
136
|
-
if (!(e instanceof HTMLElement))
|
|
137
|
-
return null;
|
|
134
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
138
135
|
window[R] = null;
|
|
139
136
|
const t = e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? e : null);
|
|
140
137
|
if (t) {
|
|
141
138
|
const n = A(t);
|
|
142
|
-
if (n)
|
|
143
|
-
|
|
144
|
-
if (t.getAttribute("contenteditable") === "true")
|
|
145
|
-
return t;
|
|
139
|
+
if (n) return n;
|
|
140
|
+
if (t.getAttribute("contenteditable") === "true") return t;
|
|
146
141
|
}
|
|
147
142
|
if (e.getAttribute("contenteditable") === "true")
|
|
148
143
|
return e;
|
|
@@ -628,29 +623,24 @@ function k() {
|
|
|
628
623
|
return e && (s = e), e;
|
|
629
624
|
}
|
|
630
625
|
function W(e) {
|
|
631
|
-
if (!e)
|
|
632
|
-
return;
|
|
626
|
+
if (!e) return;
|
|
633
627
|
const t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement, r = t == null ? void 0 : t.closest('[contenteditable="true"]');
|
|
634
628
|
r && (s = r);
|
|
635
629
|
}
|
|
636
630
|
function A(e) {
|
|
637
|
-
if (!e)
|
|
638
|
-
return null;
|
|
631
|
+
if (!e) return null;
|
|
639
632
|
const t = e.querySelector('[contenteditable="true"]');
|
|
640
633
|
return t instanceof HTMLElement ? t : null;
|
|
641
634
|
}
|
|
642
635
|
function Q() {
|
|
643
|
-
if (_)
|
|
644
|
-
return;
|
|
636
|
+
if (_) return;
|
|
645
637
|
const e = (t) => {
|
|
646
638
|
const r = t.target;
|
|
647
|
-
if (!r)
|
|
648
|
-
return;
|
|
639
|
+
if (!r) return;
|
|
649
640
|
const n = r.closest(
|
|
650
641
|
'.editora-toolbar-button[data-command="toggleSpellCheck"], .rte-toolbar-button[data-command="toggleSpellCheck"]'
|
|
651
642
|
);
|
|
652
|
-
if (!n)
|
|
653
|
-
return;
|
|
643
|
+
if (!n) return;
|
|
654
644
|
const o = n.closest("[data-editora-editor]"), l = A(o);
|
|
655
645
|
l && (h = l, s = l);
|
|
656
646
|
};
|
|
@@ -670,8 +660,7 @@ function te() {
|
|
|
670
660
|
b += 1, b === 1 && d && d.disconnect();
|
|
671
661
|
}
|
|
672
662
|
function re() {
|
|
673
|
-
if (b === 0 || (b -= 1, b > 0) || !d)
|
|
674
|
-
return;
|
|
663
|
+
if (b === 0 || (b -= 1, b > 0) || !d) return;
|
|
675
664
|
const e = k();
|
|
676
665
|
e && d.observe(e, B);
|
|
677
666
|
}
|
|
@@ -700,10 +689,8 @@ const oe = () => {
|
|
|
700
689
|
};
|
|
701
690
|
function ne(e, t) {
|
|
702
691
|
const r = [];
|
|
703
|
-
for (let n = 0; n <= t.length; n++)
|
|
704
|
-
|
|
705
|
-
for (let n = 0; n <= e.length; n++)
|
|
706
|
-
r[0][n] = n;
|
|
692
|
+
for (let n = 0; n <= t.length; n++) r[n] = [n];
|
|
693
|
+
for (let n = 0; n <= e.length; n++) r[0][n] = n;
|
|
707
694
|
for (let n = 1; n <= t.length; n++)
|
|
708
695
|
for (let o = 1; o <= e.length; o++)
|
|
709
696
|
t.charAt(n - 1) === e.charAt(o - 1) ? r[n][o] = r[n - 1][o - 1] : r[n][o] = Math.min(
|
|
@@ -725,8 +712,7 @@ function ae(e, t = 5) {
|
|
|
725
712
|
return o.sort((l, c) => l.distance - c.distance), o.filter((l) => l.distance <= 3).slice(0, t).map((l) => l.word);
|
|
726
713
|
}
|
|
727
714
|
function se(e) {
|
|
728
|
-
if (e.nodeType !== Node.ELEMENT_NODE)
|
|
729
|
-
return !1;
|
|
715
|
+
if (e.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
730
716
|
const t = e;
|
|
731
717
|
return !!(t.closest('code, pre, [contenteditable="false"], .rte-widget, .rte-template, .rte-comment, .rte-merge-tag') || t.hasAttribute("data-comment-id") || t.hasAttribute("data-template") || t.hasAttribute("data-merge-tag"));
|
|
732
718
|
}
|
|
@@ -768,21 +754,18 @@ const V = () => {
|
|
|
768
754
|
if (r.getAttribute("contenteditable") === "true")
|
|
769
755
|
return r;
|
|
770
756
|
const n = r.closest('[contenteditable="true"]');
|
|
771
|
-
if (n)
|
|
772
|
-
return n;
|
|
757
|
+
if (n) return n;
|
|
773
758
|
const o = r.closest("[data-editora-editor]");
|
|
774
759
|
if (o) {
|
|
775
760
|
const l = o.querySelector('[contenteditable="true"]');
|
|
776
|
-
if (l)
|
|
777
|
-
return l;
|
|
761
|
+
if (l) return l;
|
|
778
762
|
}
|
|
779
763
|
}
|
|
780
764
|
return document.querySelector('[contenteditable="true"]');
|
|
781
765
|
};
|
|
782
766
|
function M() {
|
|
783
767
|
const e = k();
|
|
784
|
-
if (!e)
|
|
785
|
-
return [];
|
|
768
|
+
if (!e) return [];
|
|
786
769
|
const t = [], r = document.createTreeWalker(
|
|
787
770
|
e,
|
|
788
771
|
NodeFilter.SHOW_TEXT,
|
|
@@ -809,8 +792,7 @@ function m(e) {
|
|
|
809
792
|
n.removeChild(r);
|
|
810
793
|
}
|
|
811
794
|
}), e.forEach((r) => {
|
|
812
|
-
if (S.has(r.word.toLowerCase()))
|
|
813
|
-
return;
|
|
795
|
+
if (S.has(r.word.toLowerCase())) return;
|
|
814
796
|
const n = r.node.data.length;
|
|
815
797
|
if (!(r.startOffset < 0 || r.endOffset > n || r.startOffset >= r.endOffset))
|
|
816
798
|
try {
|
|
@@ -852,8 +834,7 @@ function J(e) {
|
|
|
852
834
|
}
|
|
853
835
|
function pe(e) {
|
|
854
836
|
const t = k();
|
|
855
|
-
if (!t)
|
|
856
|
-
return { total: 0, misspelled: 0, accuracy: 100 };
|
|
837
|
+
if (!t) return { total: 0, misspelled: 0, accuracy: 100 };
|
|
857
838
|
e || (e = M());
|
|
858
839
|
const r = e.filter((c) => !S.has(c.word.toLowerCase())).length, l = ((t.textContent || "").match(/[\p{L}\p{M}\p{N}]+/gu) || []).length;
|
|
859
840
|
return {
|
|
@@ -928,8 +909,7 @@ function q() {
|
|
|
928
909
|
return r.className = "rte-spell-check-panel", window.getComputedStyle(t).position === "static" && (t.style.position = "relative"), t.appendChild(r), r;
|
|
929
910
|
}
|
|
930
911
|
function E(e) {
|
|
931
|
-
if (!a)
|
|
932
|
-
return;
|
|
912
|
+
if (!a) return;
|
|
933
913
|
const t = e || M(), r = pe(t);
|
|
934
914
|
a.innerHTML = `
|
|
935
915
|
<div class="rte-spellcheck-header">
|
|
@@ -1056,4 +1036,4 @@ const xe = () => ({
|
|
|
1056
1036
|
export {
|
|
1057
1037
|
xe as SpellCheckPlugin
|
|
1058
1038
|
};
|
|
1059
|
-
//# sourceMappingURL=SpellCheckPlugin.native-
|
|
1039
|
+
//# sourceMappingURL=SpellCheckPlugin.native-BZB9AewP.mjs.map
|
package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as h } from "./inlineFormatting-DJ0-NZtx.mjs";
|
|
2
|
+
const s = () => ({
|
|
2
3
|
name: "strikethrough",
|
|
3
4
|
// Schema definition for strikethrough mark
|
|
4
5
|
marks: {
|
|
@@ -29,20 +30,11 @@ const a = () => ({
|
|
|
29
30
|
/**
|
|
30
31
|
* Toggle strikethrough formatting on current selection
|
|
31
32
|
*/
|
|
32
|
-
toggleStrikethrough: () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!n || n.rangeCount === 0)
|
|
38
|
-
return !1;
|
|
39
|
-
const e = n.getRangeAt(0);
|
|
40
|
-
if (!t.contains(e.commonAncestorContainer))
|
|
41
|
-
return !1;
|
|
42
|
-
t.focus({ preventScroll: !0 });
|
|
43
|
-
const o = document.execCommand("strikeThrough", !1);
|
|
44
|
-
return s(t), t.dispatchEvent(new Event("input", { bubbles: !0 })), o !== !1;
|
|
45
|
-
}
|
|
33
|
+
toggleStrikethrough: (t, r) => h({
|
|
34
|
+
command: "strikeThrough",
|
|
35
|
+
context: r,
|
|
36
|
+
normalize: l
|
|
37
|
+
})
|
|
46
38
|
},
|
|
47
39
|
// Keyboard shortcuts
|
|
48
40
|
keymap: {
|
|
@@ -50,28 +42,18 @@ const a = () => ({
|
|
|
50
42
|
"Mod-Shift-X": "toggleStrikethrough"
|
|
51
43
|
}
|
|
52
44
|
});
|
|
53
|
-
function
|
|
54
|
-
const t = window.getSelection();
|
|
55
|
-
if (t && t.rangeCount > 0) {
|
|
56
|
-
const e = t.getRangeAt(0).startContainer, o = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement, r = o == null ? void 0 : o.closest('[contenteditable="true"], .rte-content, .editora-content');
|
|
57
|
-
if (r)
|
|
58
|
-
return r;
|
|
59
|
-
}
|
|
60
|
-
const n = document.activeElement;
|
|
61
|
-
return n ? n.getAttribute("contenteditable") === "true" ? n : n.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
|
|
62
|
-
}
|
|
63
|
-
function s(t) {
|
|
45
|
+
function l(t) {
|
|
64
46
|
t.querySelectorAll("strike, del").forEach((e) => {
|
|
65
|
-
var
|
|
47
|
+
var a;
|
|
66
48
|
const o = document.createElement("s");
|
|
67
49
|
for (const i of Array.from(e.attributes))
|
|
68
50
|
i.name !== "style" && o.setAttribute(i.name, i.value);
|
|
69
51
|
for (; e.firstChild; )
|
|
70
52
|
o.appendChild(e.firstChild);
|
|
71
|
-
(
|
|
53
|
+
(a = e.parentNode) == null || a.replaceChild(o, e);
|
|
72
54
|
});
|
|
73
55
|
}
|
|
74
56
|
export {
|
|
75
|
-
|
|
57
|
+
s as StrikethroughPlugin
|
|
76
58
|
};
|
|
77
|
-
//# sourceMappingURL=StrikethroughPlugin.native-
|
|
59
|
+
//# sourceMappingURL=StrikethroughPlugin.native-V0TL4F48.mjs.map
|