@editora/core 1.0.8 → 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 +6 -1
- package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +136 -133
- package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
- package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +90 -87
- package/dist/{BoldPlugin.native-BAzzoqU5.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-BnU0qCwR.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +132 -129
- package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
- package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
- package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +105 -102
- package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +49 -46
- package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
- package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +55 -52
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-BF_-LjTq.mjs} +287 -115
- package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-D2wl32jV.mjs} +88 -103
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
- package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +204 -202
- package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
- package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +158 -155
- package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +2 -2
- package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +127 -124
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +100 -76
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -26
- package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
- package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +104 -101
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
- package/dist/editora.min.js +1 -1
- package/dist/editora.umd.js +1 -1
- package/dist/index-CPMGUZfB.js +10 -0
- package/dist/{index-DqC57IEH.mjs → index-DBoj6QfW.mjs} +17 -15
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
- package/dist/plugin-loader.js +37 -37
- package/dist/webcomponent-core.js +18 -16
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +139 -62
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +50 -48
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1174 -1071
- package/package.json +11 -5
- package/LICENSE +0 -21
- package/dist/BlockquotePlugin.native-JFmOLsxN.mjs +0 -48
- package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs +0 -79
- package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +0 -309
- package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +0 -140
- package/dist/CodePlugin.native-DlpTPdkd.mjs +0 -2691
- package/dist/DirectionPlugin.native-CDnbdNyl.mjs +0 -130
- package/dist/HeadingPlugin.native-DrLYwQnQ.mjs +0 -64
- package/dist/MathPlugin.native-f_mDp8VL.mjs +0 -292
- package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +0 -559
- package/dist/TemplatePlugin.native-CrpfKRJ8.mjs +0 -602
- package/dist/index-D1LOqg5C.js +0 -10
|
@@ -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,21 +438,41 @@ const m = {
|
|
|
438
438
|
"↓": "down arrow",
|
|
439
439
|
"↔": "left right arrow"
|
|
440
440
|
};
|
|
441
|
-
let
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
445
|
-
const e =
|
|
446
|
-
return (
|
|
447
|
-
},
|
|
448
|
-
const e =
|
|
449
|
-
|
|
450
|
-
|
|
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 = () => {
|
|
451
471
|
if (typeof document == "undefined") return;
|
|
452
|
-
const
|
|
453
|
-
if (document.getElementById(
|
|
472
|
+
const r = "special-characters-plugin-styles";
|
|
473
|
+
if (document.getElementById(r)) return;
|
|
454
474
|
const e = document.createElement("style");
|
|
455
|
-
e.id =
|
|
475
|
+
e.id = r, e.textContent = `
|
|
456
476
|
.special-characters-overlay {
|
|
457
477
|
--rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
458
478
|
--rte-sc-dialog-bg: #ffffff;
|
|
@@ -719,31 +739,35 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
719
739
|
}
|
|
720
740
|
}
|
|
721
741
|
`, document.head.appendChild(e);
|
|
722
|
-
},
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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;
|
|
734
758
|
const i = document.createElement("div");
|
|
735
|
-
i.className = "special-characters-overlay",
|
|
736
|
-
const
|
|
737
|
-
|
|
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 = `
|
|
738
762
|
<div class="special-characters-header">
|
|
739
763
|
<h2>Insert Special Characters</h2>
|
|
740
764
|
<button class="special-characters-close">×</button>
|
|
741
765
|
</div>
|
|
742
766
|
<div class="special-characters-content">
|
|
743
767
|
<div class="special-characters-tabs">
|
|
744
|
-
${Object.keys(
|
|
745
|
-
<button class="special-characters-tab ${
|
|
746
|
-
${
|
|
768
|
+
${Object.keys(x).map((t) => `
|
|
769
|
+
<button class="special-characters-tab ${c === t ? "active" : ""}" data-category="${t}">
|
|
770
|
+
${x[t].name}
|
|
747
771
|
</button>
|
|
748
772
|
`).join("")}
|
|
749
773
|
</div>
|
|
@@ -759,49 +783,49 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
759
783
|
</div>
|
|
760
784
|
</div>
|
|
761
785
|
`;
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
764
|
-
const
|
|
765
|
-
return
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
|
|
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);
|
|
769
793
|
});
|
|
770
|
-
},
|
|
771
|
-
if (!
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
|
|
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);
|
|
775
800
|
return;
|
|
776
801
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
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());
|
|
786
810
|
};
|
|
787
|
-
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
const
|
|
791
|
-
!
|
|
792
|
-
}),
|
|
793
|
-
|
|
794
|
-
|
|
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();
|
|
795
819
|
}, 90);
|
|
796
|
-
}),
|
|
797
|
-
const
|
|
798
|
-
if (!
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
}), i.addEventListener("click", (
|
|
802
|
-
|
|
803
|
-
}), document.addEventListener("keydown",
|
|
804
|
-
},
|
|
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 = () => ({
|
|
805
829
|
name: "specialCharacters",
|
|
806
830
|
toolbar: [{
|
|
807
831
|
label: "Special Characters",
|
|
@@ -809,14 +833,14 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
|
|
|
809
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>'
|
|
810
834
|
}],
|
|
811
835
|
commands: {
|
|
812
|
-
insertSpecialCharacter: (
|
|
813
|
-
const
|
|
814
|
-
return
|
|
836
|
+
insertSpecialCharacter: (r, e) => {
|
|
837
|
+
const a = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : m();
|
|
838
|
+
return R(a), !0;
|
|
815
839
|
}
|
|
816
840
|
},
|
|
817
841
|
keymap: {}
|
|
818
842
|
});
|
|
819
843
|
export {
|
|
820
|
-
|
|
844
|
+
j as SpecialCharactersPlugin
|
|
821
845
|
};
|
|
822
|
-
//# sourceMappingURL=SpecialCharactersPlugin.native-
|
|
846
|
+
//# sourceMappingURL=SpecialCharactersPlugin.native-DaG4b19I.mjs.map
|
package/dist/{StrikethroughPlugin.native-0Be7j49s.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,17 +30,11 @@ const a = () => ({
|
|
|
29
30
|
/**
|
|
30
31
|
* Toggle strikethrough formatting on current selection
|
|
31
32
|
*/
|
|
32
|
-
toggleStrikethrough: () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const e = n.getRangeAt(0);
|
|
38
|
-
if (!t.contains(e.commonAncestorContainer)) return !1;
|
|
39
|
-
t.focus({ preventScroll: !0 });
|
|
40
|
-
const o = document.execCommand("strikeThrough", !1);
|
|
41
|
-
return s(t), t.dispatchEvent(new Event("input", { bubbles: !0 })), o !== !1;
|
|
42
|
-
}
|
|
33
|
+
toggleStrikethrough: (t, r) => h({
|
|
34
|
+
command: "strikeThrough",
|
|
35
|
+
context: r,
|
|
36
|
+
normalize: l
|
|
37
|
+
})
|
|
43
38
|
},
|
|
44
39
|
// Keyboard shortcuts
|
|
45
40
|
keymap: {
|
|
@@ -47,27 +42,18 @@ const a = () => ({
|
|
|
47
42
|
"Mod-Shift-X": "toggleStrikethrough"
|
|
48
43
|
}
|
|
49
44
|
});
|
|
50
|
-
function
|
|
51
|
-
const t = window.getSelection();
|
|
52
|
-
if (t && t.rangeCount > 0) {
|
|
53
|
-
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');
|
|
54
|
-
if (r) return r;
|
|
55
|
-
}
|
|
56
|
-
const n = document.activeElement;
|
|
57
|
-
return n ? n.getAttribute("contenteditable") === "true" ? n : n.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
|
|
58
|
-
}
|
|
59
|
-
function s(t) {
|
|
45
|
+
function l(t) {
|
|
60
46
|
t.querySelectorAll("strike, del").forEach((e) => {
|
|
61
|
-
var
|
|
47
|
+
var a;
|
|
62
48
|
const o = document.createElement("s");
|
|
63
49
|
for (const i of Array.from(e.attributes))
|
|
64
50
|
i.name !== "style" && o.setAttribute(i.name, i.value);
|
|
65
51
|
for (; e.firstChild; )
|
|
66
52
|
o.appendChild(e.firstChild);
|
|
67
|
-
(
|
|
53
|
+
(a = e.parentNode) == null || a.replaceChild(o, e);
|
|
68
54
|
});
|
|
69
55
|
}
|
|
70
56
|
export {
|
|
71
|
-
|
|
57
|
+
s as StrikethroughPlugin
|
|
72
58
|
};
|
|
73
|
-
//# sourceMappingURL=StrikethroughPlugin.native-
|
|
59
|
+
//# sourceMappingURL=StrikethroughPlugin.native-V0TL4F48.mjs.map
|