@editora/plugins 1.0.10 → 1.0.11
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/_commonjsHelpers-BH3jXuIh.js +1 -0
- package/dist/_commonjsHelpers-ByX85dGu.mjs +33 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +80 -98
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +115 -128
- package/dist/anchoredPopover-BzqGPOAE.js +1 -0
- package/dist/anchoredPopover-Dts0IrgU.mjs +106 -0
- package/dist/approval-workflow.cjs.js +40 -40
- package/dist/approval-workflow.esm.js +208 -249
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +55 -68
- package/dist/blockquote.esm.js +1 -2
- package/dist/blocks-library.cjs.js +45 -45
- package/dist/blocks-library.esm.js +178 -245
- package/dist/capitalization.esm.js +1 -2
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +58 -82
- package/dist/citations.cjs.js +37 -37
- package/dist/citations.esm.js +439 -512
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +27 -33
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +82 -93
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +501 -506
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +116 -158
- package/dist/conditional-content.cjs.js +90 -90
- package/dist/conditional-content.esm.js +371 -432
- package/dist/content-rules.cjs.js +7 -7
- package/dist/content-rules.esm.js +105 -159
- package/dist/data-binding.cjs.js +46 -46
- package/dist/data-binding.esm.js +328 -368
- package/dist/direction.esm.js +9 -18
- package/dist/doc-schema.cjs.js +29 -29
- package/dist/doc-schema.esm.js +240 -308
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +4 -5
- package/dist/documentManager-CTqRftU8.mjs +8369 -0
- package/dist/documentManager-Jf0RbSks.js +17 -0
- package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +1 -2
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +73 -81
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +65 -77
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +54 -56
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +39 -47
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +37 -53
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +76 -117
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +70 -92
- package/dist/html2canvas.esm-B5qzocYs.js +5 -0
- package/dist/{html2canvas.esm-1a1724a1.mjs → html2canvas.esm-BWVIUcAF.mjs} +141 -225
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +12 -24
- package/dist/{index-f04538f2.mjs → index-BFsKNTTj.mjs} +70 -71
- package/dist/index-CvJk4DKa.js +221 -0
- package/dist/index-D3CycEFU.mjs +16543 -0
- package/dist/index-tqLTHcO6.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-CE_A4QSm.js +5 -0
- package/dist/index.es-DQ78mYYo.mjs +6665 -0
- package/dist/index.esm.js +125 -128
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +8 -9
- package/dist/jspdf.es.min-BoS80556.js +77 -0
- package/dist/{jspdf.es.min-c36a4fd8.mjs → jspdf.es.min-DQCoX5yh.mjs} +3658 -4682
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +11 -24
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +24 -30
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +20 -25
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +59 -61
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +139 -146
- package/dist/media-manager.cjs.js +31 -31
- package/dist/media-manager.esm.js +285 -300
- package/dist/mentions.cjs.js +9 -9
- package/dist/mentions.esm.js +238 -286
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +177 -216
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +33 -49
- package/dist/pii-redaction.cjs.js +19 -19
- package/dist/pii-redaction.esm.js +393 -463
- package/dist/plugins.css +1 -0
- package/dist/preview.esm.js +5 -10
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +17 -20
- package/dist/{purify.es-35a15df8.mjs → purify.es-DHhaBdbu.mjs} +9 -19
- package/dist/{purify.es-a8d731c6.js → purify.es-T2a3nLiC.js} +1 -1
- package/dist/slash-commands.cjs.js +2 -2
- package/dist/slash-commands.esm.js +39 -75
- package/dist/smart-paste.cjs.js +27 -27
- package/dist/smart-paste.esm.js +280 -336
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +61 -69
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +97 -123
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +14 -19
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +191 -225
- package/dist/template.cjs.js +21 -20
- package/dist/template.esm.js +715 -196
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +21 -27
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +70 -87
- package/dist/track-changes.cjs.js +2 -2
- package/dist/track-changes.esm.js +100 -162
- package/dist/translation-workflow.cjs.js +74 -74
- package/dist/translation-workflow.esm.js +602 -678
- package/dist/version-diff.cjs.js +14 -14
- package/dist/version-diff.esm.js +128 -157
- package/package.json +1 -1
- package/dist/_commonjsHelpers-6763f629.js +0 -1
- package/dist/_commonjsHelpers-c5d32002.mjs +0 -30
- package/dist/anchoredPopover-33f1358d.mjs +0 -109
- package/dist/anchoredPopover-8151d535.js +0 -1
- package/dist/documentManager-25b6203c.mjs +0 -9122
- package/dist/documentManager-b69e7054.js +0 -17
- package/dist/html2canvas.esm-09133e29.js +0 -22
- package/dist/index-656d224b.js +0 -231
- package/dist/index-6a8c48bb.js +0 -1
- package/dist/index-d027b7e2.mjs +0 -16859
- package/dist/index.es-730f2d98.mjs +0 -5775
- package/dist/index.es-dd40173b.js +0 -18
- package/dist/jspdf.es.min-90db2c97.js +0 -243
- package/dist/style.css +0 -1
- /package/dist/{editorContainerHelpers-36b8ddf3.js → editorContainerHelpers-CFbfiOJI.js} +0 -0
package/dist/emojis.esm.js
CHANGED
|
@@ -540,7 +540,7 @@ const p = {
|
|
|
540
540
|
"🇳🇿"
|
|
541
541
|
]
|
|
542
542
|
}
|
|
543
|
-
},
|
|
543
|
+
}, x = {
|
|
544
544
|
"💙": "blue heart",
|
|
545
545
|
"💚": "green heart",
|
|
546
546
|
"💛": "yellow heart",
|
|
@@ -689,7 +689,7 @@ const p = {
|
|
|
689
689
|
"🧸": "teddy bear"
|
|
690
690
|
};
|
|
691
691
|
let g = null, s = "all", u = "", n = null, l = null, d = null;
|
|
692
|
-
const
|
|
692
|
+
const k = '[data-theme="dark"], .dark, .editora-theme-dark', A = () => ({
|
|
693
693
|
name: "emojis",
|
|
694
694
|
toolbar: [
|
|
695
695
|
{
|
|
@@ -701,18 +701,16 @@ const y = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => ({
|
|
|
701
701
|
}
|
|
702
702
|
],
|
|
703
703
|
commands: {
|
|
704
|
-
openEmojiDialog: (
|
|
705
|
-
const e =
|
|
706
|
-
return e ? (
|
|
704
|
+
openEmojiDialog: (t, r) => {
|
|
705
|
+
const e = r?.contentElement || b();
|
|
706
|
+
return e ? (w(e), !0) : !1;
|
|
707
707
|
},
|
|
708
|
-
insertEmoji: (
|
|
709
|
-
if (!
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (!e)
|
|
713
|
-
return !1;
|
|
708
|
+
insertEmoji: (t, r) => {
|
|
709
|
+
if (!t) return !1;
|
|
710
|
+
const e = r?.contentElement || b();
|
|
711
|
+
if (!e) return !1;
|
|
714
712
|
try {
|
|
715
|
-
return
|
|
713
|
+
return v(t, e), !0;
|
|
716
714
|
} catch {
|
|
717
715
|
return !1;
|
|
718
716
|
}
|
|
@@ -722,15 +720,15 @@ const y = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => ({
|
|
|
722
720
|
"Mod-Shift-j": "openEmojiDialog"
|
|
723
721
|
}
|
|
724
722
|
});
|
|
725
|
-
function
|
|
723
|
+
function w(t) {
|
|
726
724
|
m(), s = "all", u = "";
|
|
727
|
-
const
|
|
728
|
-
l = null,
|
|
725
|
+
const r = window.getSelection();
|
|
726
|
+
l = null, r && r.rangeCount > 0 && t.contains(r.anchorNode) && (l = r.getRangeAt(0).cloneRange());
|
|
729
727
|
const e = document.createElement("div");
|
|
730
|
-
e.className = "emojis-overlay",
|
|
728
|
+
e.className = "emojis-overlay", z(t) && e.classList.add("rte-ui-theme-dark"), e.onclick = m;
|
|
731
729
|
const o = document.createElement("div");
|
|
732
|
-
o.className = "emojis-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.onclick = (
|
|
733
|
-
const
|
|
730
|
+
o.className = "emojis-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.onclick = (a) => a.stopPropagation();
|
|
731
|
+
const i = Object.keys(p);
|
|
734
732
|
o.innerHTML = `
|
|
735
733
|
<div class="rte-dialog-header emojis-header">
|
|
736
734
|
<h3>Insert Emojis</h3>
|
|
@@ -738,9 +736,9 @@ function E(r) {
|
|
|
738
736
|
</div>
|
|
739
737
|
<div class="rte-dialog-body emojis-content">
|
|
740
738
|
<div class="emojis-tabs">
|
|
741
|
-
${
|
|
742
|
-
<button class="emojis-tab ${
|
|
743
|
-
${p[
|
|
739
|
+
${i.map((a) => `
|
|
740
|
+
<button class="emojis-tab ${a === s ? "active" : ""}" data-category="${a}">
|
|
741
|
+
${p[a].name}
|
|
744
742
|
</button>
|
|
745
743
|
`).join("")}
|
|
746
744
|
</div>
|
|
@@ -758,53 +756,45 @@ function E(r) {
|
|
|
758
756
|
/>
|
|
759
757
|
</div>
|
|
760
758
|
<div class="emojis-grid" id="emojis-grid">
|
|
761
|
-
${
|
|
759
|
+
${j(s, u)}
|
|
762
760
|
</div>
|
|
763
761
|
</div>
|
|
764
762
|
</div>
|
|
765
|
-
`, e.appendChild(o), document.body.appendChild(e), g = e, d = (
|
|
766
|
-
|
|
767
|
-
}, document.addEventListener("keydown", d, !0),
|
|
768
|
-
|
|
769
|
-
(i = o.querySelector("#emoji-search-input")) == null || i.focus();
|
|
763
|
+
`, e.appendChild(o), document.body.appendChild(e), g = e, d = (a) => {
|
|
764
|
+
a.key === "Escape" && (a.preventDefault(), a.stopPropagation(), m());
|
|
765
|
+
}, document.addEventListener("keydown", d, !0), y(o, t), S(), requestAnimationFrame(() => {
|
|
766
|
+
o.querySelector("#emoji-search-input")?.focus();
|
|
770
767
|
});
|
|
771
768
|
}
|
|
772
|
-
function
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
c && S(r, c);
|
|
769
|
+
function y(t, r) {
|
|
770
|
+
t.querySelector(".emojis-close")?.addEventListener("click", m), t.querySelectorAll(".emojis-tab").forEach((i) => {
|
|
771
|
+
i.addEventListener("click", (a) => {
|
|
772
|
+
const c = a.target.getAttribute("data-category");
|
|
773
|
+
c && E(t, c);
|
|
778
774
|
});
|
|
779
|
-
})
|
|
780
|
-
const e = r.querySelector("#emoji-search-input");
|
|
781
|
-
e == null || e.addEventListener("input", (i) => {
|
|
775
|
+
}), t.querySelector("#emoji-search-input")?.addEventListener("input", (i) => {
|
|
782
776
|
u = i.target.value, n !== null && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
783
|
-
n = null,
|
|
777
|
+
n = null, h(t);
|
|
784
778
|
}, 90);
|
|
785
|
-
})
|
|
786
|
-
const o = r.querySelector("#emojis-grid");
|
|
787
|
-
o == null || o.addEventListener("click", (i) => {
|
|
788
|
-
var j;
|
|
779
|
+
}), t.querySelector("#emojis-grid")?.addEventListener("click", (i) => {
|
|
789
780
|
const c = i.target.closest(".emojis-item");
|
|
790
|
-
if (!c)
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
h && (k(h, t), m());
|
|
781
|
+
if (!c) return;
|
|
782
|
+
const f = c.getAttribute("data-emoji") || c.textContent?.trim() || "";
|
|
783
|
+
f && (v(f, r), m());
|
|
794
784
|
});
|
|
795
785
|
}
|
|
796
|
-
function
|
|
797
|
-
s =
|
|
798
|
-
e.classList.toggle("active", e.getAttribute("data-category") ===
|
|
799
|
-
}),
|
|
786
|
+
function E(t, r) {
|
|
787
|
+
s = r, t.querySelectorAll(".emojis-tab").forEach((e) => {
|
|
788
|
+
e.classList.toggle("active", e.getAttribute("data-category") === r);
|
|
789
|
+
}), h(t);
|
|
800
790
|
}
|
|
801
|
-
function
|
|
802
|
-
const
|
|
803
|
-
|
|
791
|
+
function h(t) {
|
|
792
|
+
const r = t.querySelector("#emojis-grid");
|
|
793
|
+
r && (r.innerHTML = j(s, u));
|
|
804
794
|
}
|
|
805
|
-
function
|
|
806
|
-
let e = p[
|
|
807
|
-
return
|
|
795
|
+
function j(t, r) {
|
|
796
|
+
let e = p[t].emojis;
|
|
797
|
+
return r.trim() && (e = e.filter((o) => o.toLowerCase().includes(r.toLowerCase()) ? !0 : (x[o] || "").toLowerCase().includes(r.toLowerCase()))), e.length === 0 && r.trim() ? `<div class="emojis-no-results">No emojis found for "${r}"</div>` : e.map((o, i) => `
|
|
808
798
|
<button
|
|
809
799
|
class="emojis-item"
|
|
810
800
|
title="Insert ${o}"
|
|
@@ -817,35 +807,33 @@ function x(r, t) {
|
|
|
817
807
|
function m() {
|
|
818
808
|
d && (document.removeEventListener("keydown", d, !0), d = null), n !== null && (window.clearTimeout(n), n = null), g && (g.remove(), g = null);
|
|
819
809
|
}
|
|
820
|
-
function
|
|
821
|
-
|
|
810
|
+
function v(t, r) {
|
|
811
|
+
r.focus();
|
|
822
812
|
let e = window.getSelection();
|
|
823
|
-
if (l && (e
|
|
813
|
+
if (l && (e?.removeAllRanges(), e?.addRange(l), l = null), e = window.getSelection(), e && e.rangeCount > 0) {
|
|
824
814
|
const o = e.getRangeAt(0);
|
|
825
815
|
o.deleteContents();
|
|
826
|
-
const
|
|
827
|
-
o.insertNode(
|
|
816
|
+
const i = document.createTextNode(t);
|
|
817
|
+
o.insertNode(i), o.setStartAfter(i), o.setEndAfter(i), e.removeAllRanges(), e.addRange(o);
|
|
828
818
|
}
|
|
829
819
|
}
|
|
830
820
|
function b() {
|
|
831
|
-
const
|
|
832
|
-
if (
|
|
833
|
-
const e =
|
|
834
|
-
if (
|
|
835
|
-
return a;
|
|
821
|
+
const t = window.getSelection();
|
|
822
|
+
if (t && t.rangeCount > 0) {
|
|
823
|
+
const e = t.anchorNode, i = (e instanceof HTMLElement ? e : e?.parentElement)?.closest(".editora-content, .rte-content");
|
|
824
|
+
if (i) return i;
|
|
836
825
|
}
|
|
837
|
-
const
|
|
838
|
-
return
|
|
826
|
+
const r = document.activeElement;
|
|
827
|
+
return r && (r.classList.contains("editora-content") || r.classList.contains("rte-content")) ? r : document.querySelector(".editora-content, .rte-content");
|
|
839
828
|
}
|
|
840
|
-
function
|
|
841
|
-
const
|
|
842
|
-
return
|
|
829
|
+
function z(t) {
|
|
830
|
+
const r = t || b();
|
|
831
|
+
return r ? !!r.closest(k) : !1;
|
|
843
832
|
}
|
|
844
|
-
function
|
|
845
|
-
if (document.getElementById("emojis-dialog-styles"))
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
r.id = "emojis-dialog-styles", r.textContent = `
|
|
833
|
+
function S() {
|
|
834
|
+
if (document.getElementById("emojis-dialog-styles")) return;
|
|
835
|
+
const t = document.createElement("style");
|
|
836
|
+
t.id = "emojis-dialog-styles", t.textContent = `
|
|
849
837
|
.emojis-overlay {
|
|
850
838
|
--rte-emoji-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
851
839
|
--rte-emoji-dialog-bg: #ffffff;
|
|
@@ -1114,8 +1102,8 @@ function L() {
|
|
|
1114
1102
|
font-size: 16px;
|
|
1115
1103
|
}
|
|
1116
1104
|
}
|
|
1117
|
-
`, document.head.appendChild(
|
|
1105
|
+
`, document.head.appendChild(t);
|
|
1118
1106
|
}
|
|
1119
1107
|
export {
|
|
1120
|
-
|
|
1108
|
+
A as EmojisPlugin
|
|
1121
1109
|
};
|
package/dist/enterprise.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),t=require("./track-changes.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./mentions.cjs.js"),t=require("./track-changes.cjs.js"),o=require("./version-diff.cjs.js"),l=require("./conditional-content.cjs.js"),r=require("./data-binding.cjs.js"),g=require("./content-rules.cjs.js"),u=require("./citations.cjs.js"),s=require("./approval-workflow.cjs.js"),c=require("./pii-redaction.cjs.js"),P=require("./smart-paste.cjs.js"),m=require("./blocks-library.cjs.js"),C=require("./doc-schema.cjs.js"),d=require("./translation-workflow.cjs.js"),p=require("./slash-commands.cjs.js"),M=require("./spell-check.cjs.js"),T=require("./a11y-checker.cjs.js"),f=require("./comments.cjs.js"),q=require("./merge-tag.cjs.js"),e=require("./template.cjs.js"),n=require("./media-manager.cjs.js"),i=require("./index-tqLTHcO6.js");exports.MentionPlugin=a.MentionPlugin;exports.TrackChangesPlugin=t.TrackChangesPlugin;exports.VersionDiffPlugin=o.VersionDiffPlugin;exports.ConditionalContentPlugin=l.ConditionalContentPlugin;exports.DataBindingPlugin=r.DataBindingPlugin;exports.ContentRulesPlugin=g.ContentRulesPlugin;exports.CitationsPlugin=u.CitationsPlugin;exports.ApprovalWorkflowPlugin=s.ApprovalWorkflowPlugin;exports.PIIRedactionPlugin=c.PIIRedactionPlugin;exports.SmartPastePlugin=P.SmartPastePlugin;exports.BlocksLibraryPlugin=m.BlocksLibraryPlugin;exports.DocSchemaPlugin=C.DocSchemaPlugin;exports.TranslationWorkflowPlugin=d.TranslationWorkflowPlugin;exports.SlashCommandsPlugin=p.SlashCommandsPlugin;exports.SpellCheckPlugin=M.SpellCheckPlugin;exports.A11yCheckerPlugin=T.A11yCheckerPlugin;exports.CommentsPlugin=f.CommentsPlugin;exports.MergeTagPlugin=q.MergeTagPlugin;exports.PREDEFINED_TEMPLATES=e.PREDEFINED_TEMPLATES;exports.TemplatePlugin=e.TemplatePlugin;exports.addCustomTemplate=e.addCustomTemplate;exports.getAllTemplates=e.getAllTemplates;exports.getTemplateCategories=e.getTemplateCategories;exports.getTemplatesByCategory=e.getTemplatesByCategory;exports.sanitizeTemplate=e.sanitizeTemplate;exports.searchTemplates=e.searchTemplates;exports.validateTemplate=e.validateTemplate;exports.MediaManagerPlugin=n.MediaManagerPlugin;exports.getMediaManagerConfig=n.getMediaManagerConfig;exports.setMediaManagerConfig=n.setMediaManagerConfig;exports.DocumentManagerPlugin=i.DocumentManagerPlugin;exports.getDocumentManagerConfig=i.getDocumentManagerConfig;exports.setDocumentManagerConfig=i.setDocumentManagerConfig;
|
package/dist/enterprise.esm.js
CHANGED
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
import { MentionPlugin as
|
|
2
|
-
import { TrackChangesPlugin as
|
|
3
|
-
import { VersionDiffPlugin as
|
|
4
|
-
import { ConditionalContentPlugin as
|
|
5
|
-
import { DataBindingPlugin as
|
|
6
|
-
import { ContentRulesPlugin as
|
|
7
|
-
import { CitationsPlugin as
|
|
8
|
-
import { ApprovalWorkflowPlugin as
|
|
9
|
-
import { PIIRedactionPlugin as
|
|
10
|
-
import { SmartPastePlugin as
|
|
11
|
-
import { BlocksLibraryPlugin as
|
|
12
|
-
import { DocSchemaPlugin as
|
|
13
|
-
import { TranslationWorkflowPlugin as
|
|
14
|
-
import { SlashCommandsPlugin as
|
|
15
|
-
import { SpellCheckPlugin as
|
|
16
|
-
import { A11yCheckerPlugin as
|
|
17
|
-
import { CommentsPlugin as
|
|
18
|
-
import { MergeTagPlugin as
|
|
19
|
-
import { PREDEFINED_TEMPLATES as
|
|
20
|
-
import { MediaManagerPlugin as
|
|
21
|
-
import { D as
|
|
22
|
-
import "./purify.es-35a15df8.mjs";
|
|
23
|
-
import "./shared-config.esm.js";
|
|
1
|
+
import { MentionPlugin as r } from "./mentions.esm.js";
|
|
2
|
+
import { TrackChangesPlugin as n } from "./track-changes.esm.js";
|
|
3
|
+
import { VersionDiffPlugin as i } from "./version-diff.esm.js";
|
|
4
|
+
import { ConditionalContentPlugin as l } from "./conditional-content.esm.js";
|
|
5
|
+
import { DataBindingPlugin as p } from "./data-binding.esm.js";
|
|
6
|
+
import { ContentRulesPlugin as u } from "./content-rules.esm.js";
|
|
7
|
+
import { CitationsPlugin as s } from "./citations.esm.js";
|
|
8
|
+
import { ApprovalWorkflowPlugin as C } from "./approval-workflow.esm.js";
|
|
9
|
+
import { PIIRedactionPlugin as M } from "./pii-redaction.esm.js";
|
|
10
|
+
import { SmartPastePlugin as d } from "./smart-paste.esm.js";
|
|
11
|
+
import { BlocksLibraryPlugin as h } from "./blocks-library.esm.js";
|
|
12
|
+
import { DocSchemaPlugin as E } from "./doc-schema.esm.js";
|
|
13
|
+
import { TranslationWorkflowPlugin as y } from "./translation-workflow.esm.js";
|
|
14
|
+
import { SlashCommandsPlugin as B } from "./slash-commands.esm.js";
|
|
15
|
+
import { SpellCheckPlugin as R } from "./spell-check.esm.js";
|
|
16
|
+
import { A11yCheckerPlugin as w } from "./a11y-checker.esm.js";
|
|
17
|
+
import { CommentsPlugin as W } from "./comments.esm.js";
|
|
18
|
+
import { MergeTagPlugin as z } from "./merge-tag.esm.js";
|
|
19
|
+
import { PREDEFINED_TEMPLATES as N, TemplatePlugin as V, addCustomTemplate as _, getAllTemplates as j, getTemplateCategories as q, getTemplatesByCategory as G, sanitizeTemplate as H, searchTemplates as J, validateTemplate as K } from "./template.esm.js";
|
|
20
|
+
import { MediaManagerPlugin as Q, getMediaManagerConfig as U, setMediaManagerConfig as X } from "./media-manager.esm.js";
|
|
21
|
+
import { D as Z, g as $, s as ee } from "./index-BFsKNTTj.mjs";
|
|
24
22
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
23
|
+
w as A11yCheckerPlugin,
|
|
24
|
+
C as ApprovalWorkflowPlugin,
|
|
25
|
+
h as BlocksLibraryPlugin,
|
|
26
|
+
s as CitationsPlugin,
|
|
27
|
+
W as CommentsPlugin,
|
|
28
|
+
l as ConditionalContentPlugin,
|
|
29
|
+
u as ContentRulesPlugin,
|
|
30
|
+
p as DataBindingPlugin,
|
|
31
|
+
E as DocSchemaPlugin,
|
|
32
|
+
Z as DocumentManagerPlugin,
|
|
33
|
+
Q as MediaManagerPlugin,
|
|
34
|
+
r as MentionPlugin,
|
|
35
|
+
z as MergeTagPlugin,
|
|
36
|
+
M as PIIRedactionPlugin,
|
|
37
|
+
N as PREDEFINED_TEMPLATES,
|
|
38
|
+
B as SlashCommandsPlugin,
|
|
39
|
+
d as SmartPastePlugin,
|
|
40
|
+
R as SpellCheckPlugin,
|
|
41
|
+
V as TemplatePlugin,
|
|
42
|
+
n as TrackChangesPlugin,
|
|
43
|
+
y as TranslationWorkflowPlugin,
|
|
44
|
+
i as VersionDiffPlugin,
|
|
45
|
+
_ as addCustomTemplate,
|
|
46
|
+
j as getAllTemplates,
|
|
47
|
+
$ as getDocumentManagerConfig,
|
|
48
|
+
U as getMediaManagerConfig,
|
|
49
|
+
q as getTemplateCategories,
|
|
50
|
+
G as getTemplatesByCategory,
|
|
51
|
+
H as sanitizeTemplate,
|
|
52
|
+
J as searchTemplates,
|
|
53
|
+
ee as setDocumentManagerConfig,
|
|
54
|
+
X as setMediaManagerConfig,
|
|
55
|
+
K as validateTemplate
|
|
58
56
|
};
|
package/dist/font-family.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=()=>({name:"fontFamily",marks:{fontFamily:{attrs:{family:{default:null}},parseDOM:[{tag:'span[style*="font-family"]',getAttrs:e=>{const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=()=>({name:"fontFamily",marks:{fontFamily:{attrs:{family:{default:null}},parseDOM:[{tag:'span[style*="font-family"]',getAttrs:e=>{const t=e.style.fontFamily;return t?{family:t}:!1}},{tag:"font[face]",getAttrs:e=>{const t=e.getAttribute("face");return t?{family:t}:!1}}],toDOM:e=>["span",{style:`font-family: ${e.attrs?.family}`},0]}},toolbar:[{label:"Font Family",command:"setFontFamily",type:"inline-menu",options:[{label:"Arial",value:"Arial, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Impact",value:"Impact, sans-serif"}],icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M15 4h7v2h-7zm1 4h6v2h-6zm2 4h4v2h-4zM9.307 4l-6 16h2.137l1.875-5h6.363l1.875 5h2.137l-6-16H9.307zm-1.239 9L10.5 6.515 12.932 13H8.068z"></path></g></svg>'}],commands:{setFontFamily:e=>{if(!e)return!1;try{return b(e),!0}catch(n){return console.error("Failed to set font family:",n),!1}}},keymap:{"Mod-Shift-f":"setFontFamily"}}),p="p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";function h(e){return!!e.cloneContents().querySelector(p)}function g(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')}function f(e){e&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function S(e,n){const t=document.createElement("span");for(const a of Array.from(e.attributes))a.name==="face"||a.name==="style"||t.setAttribute(a.name,a.value);const o=e.getAttribute("style");for(o&&t.setAttribute("style",o),t.style.fontFamily=n,t.classList.add("rte-font-family");e.firstChild;)t.appendChild(e.firstChild);e.parentNode?.replaceChild(t,e)}function A(e){e.querySelectorAll("span").forEach(t=>{t.childElementCount>0||(t.textContent||"").trim().length>0||t.remove()})}function C(e,n,t){if(h(e))return!1;const o=document.createElement("span");o.style.fontFamily=t,o.className="rte-font-family";try{e.surroundContents(o)}catch{const l=e.extractContents();o.appendChild(l),e.insertNode(o)}const a=document.createRange();return a.selectNodeContents(o),n.removeAllRanges(),n.addRange(a),!0}function b(e){const n=window.getSelection();if(!n||n.rangeCount===0)return;const t=n.getRangeAt(0),o=t.cloneRange(),a=g(t.commonAncestorContainer);if(t.collapsed)return;const l=t.commonAncestorContainer,i=F(l);if(i&&v(t,i)){i.style.fontFamily=e,i.classList.add("rte-font-family");const r=document.createRange();r.selectNodeContents(i),n.removeAllRanges(),n.addRange(r),f(a);return}if(!a)return;const u=new Set(Array.from(a.querySelectorAll("font[face]"))),m=new Set(Array.from(a.querySelectorAll("span[style*='font-family']")));a.focus({preventScroll:!0});try{document.execCommand("styleWithCSS",!1,"true")}catch{}const d=e.split(",").map(r=>r.trim().replace(/^['"]|['"]$/g,"")).filter(Boolean)[0]||"Arial";let s=document.execCommand("fontName",!1,d),c=!1;Array.from(a.querySelectorAll("font[face]")).forEach(r=>{u.has(r)||(S(r,e),c=!0)}),Array.from(a.querySelectorAll("span[style*='font-family']")).forEach(r=>{m.has(r)||(r.style.fontFamily=e,r.classList.add("rte-font-family"),c=!0)}),s||(s=C(o,n,e)),(s||c)&&(A(a),f(a))}function F(e){let n=e;for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.tagName==="SPAN"&&t.style.fontFamily)return t}n=n.parentNode}return null}function v(e,n){const t=e.startContainer,o=e.endContainer,a=n.contains(t)||t.nodeType===Node.TEXT_NODE&&t.parentElement===n,l=n.contains(o)||o.nodeType===Node.TEXT_NODE&&o.parentElement===n;return a&&l}exports.FontFamilyPlugin=y;
|
package/dist/font-family.esm.js
CHANGED
|
@@ -9,22 +9,19 @@ const E = () => ({
|
|
|
9
9
|
{
|
|
10
10
|
tag: 'span[style*="font-family"]',
|
|
11
11
|
getAttrs: (e) => {
|
|
12
|
-
const
|
|
13
|
-
return
|
|
12
|
+
const t = e.style.fontFamily;
|
|
13
|
+
return t ? { family: t } : !1;
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
tag: "font[face]",
|
|
18
18
|
getAttrs: (e) => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
19
|
+
const t = e.getAttribute("face");
|
|
20
|
+
return t ? { family: t } : !1;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
toDOM: (e) => {
|
|
25
|
-
var t;
|
|
26
|
-
return ["span", { style: `font-family: ${(t = e.attrs) == null ? void 0 : t.family}` }, 0];
|
|
27
|
-
}
|
|
24
|
+
toDOM: (e) => ["span", { style: `font-family: ${e.attrs?.family}` }, 0]
|
|
28
25
|
}
|
|
29
26
|
},
|
|
30
27
|
toolbar: [
|
|
@@ -47,12 +44,11 @@ const E = () => ({
|
|
|
47
44
|
],
|
|
48
45
|
commands: {
|
|
49
46
|
setFontFamily: (e) => {
|
|
50
|
-
if (!e)
|
|
51
|
-
return !1;
|
|
47
|
+
if (!e) return !1;
|
|
52
48
|
try {
|
|
53
49
|
return C(e), !0;
|
|
54
|
-
} catch (
|
|
55
|
-
return console.error("Failed to set font family:",
|
|
50
|
+
} catch (n) {
|
|
51
|
+
return console.error("Failed to set font family:", n), !1;
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
},
|
|
@@ -64,32 +60,30 @@ function p(e) {
|
|
|
64
60
|
return !!e.cloneContents().querySelector(y);
|
|
65
61
|
}
|
|
66
62
|
function h(e) {
|
|
67
|
-
|
|
68
|
-
return (t == null ? void 0 : t.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
|
|
63
|
+
return (e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement)?.closest('[contenteditable="true"]') || document.querySelector('[contenteditable="true"]');
|
|
69
64
|
}
|
|
70
65
|
function f(e) {
|
|
71
66
|
e && e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
72
67
|
}
|
|
73
|
-
function g(e,
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
l.name === "face" || l.name === "style" || n.setAttribute(l.name, l.value);
|
|
68
|
+
function g(e, n) {
|
|
69
|
+
const t = document.createElement("span");
|
|
70
|
+
for (const a of Array.from(e.attributes))
|
|
71
|
+
a.name === "face" || a.name === "style" || t.setAttribute(a.name, a.value);
|
|
78
72
|
const r = e.getAttribute("style");
|
|
79
|
-
for (r &&
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
for (r && t.setAttribute("style", r), t.style.fontFamily = n, t.classList.add("rte-font-family"); e.firstChild; )
|
|
74
|
+
t.appendChild(e.firstChild);
|
|
75
|
+
e.parentNode?.replaceChild(t, e);
|
|
82
76
|
}
|
|
83
77
|
function S(e) {
|
|
84
|
-
e.querySelectorAll("span").forEach((
|
|
85
|
-
|
|
78
|
+
e.querySelectorAll("span").forEach((t) => {
|
|
79
|
+
t.childElementCount > 0 || (t.textContent || "").trim().length > 0 || t.remove();
|
|
86
80
|
});
|
|
87
81
|
}
|
|
88
|
-
function A(e,
|
|
82
|
+
function A(e, n, t) {
|
|
89
83
|
if (p(e))
|
|
90
84
|
return !1;
|
|
91
85
|
const r = document.createElement("span");
|
|
92
|
-
r.style.fontFamily =
|
|
86
|
+
r.style.fontFamily = t, r.className = "rte-font-family";
|
|
93
87
|
try {
|
|
94
88
|
e.surroundContents(r);
|
|
95
89
|
} catch {
|
|
@@ -97,24 +91,22 @@ function A(e, t, n) {
|
|
|
97
91
|
r.appendChild(l), e.insertNode(r);
|
|
98
92
|
}
|
|
99
93
|
const a = document.createRange();
|
|
100
|
-
return a.selectNodeContents(r),
|
|
94
|
+
return a.selectNodeContents(r), n.removeAllRanges(), n.addRange(a), !0;
|
|
101
95
|
}
|
|
102
96
|
function C(e) {
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (n.collapsed)
|
|
97
|
+
const n = window.getSelection();
|
|
98
|
+
if (!n || n.rangeCount === 0) return;
|
|
99
|
+
const t = n.getRangeAt(0), r = t.cloneRange(), a = h(t.commonAncestorContainer);
|
|
100
|
+
if (t.collapsed)
|
|
108
101
|
return;
|
|
109
|
-
const l =
|
|
110
|
-
if (s && F(
|
|
102
|
+
const l = t.commonAncestorContainer, s = b(l);
|
|
103
|
+
if (s && F(t, s)) {
|
|
111
104
|
s.style.fontFamily = e, s.classList.add("rte-font-family");
|
|
112
105
|
const o = document.createRange();
|
|
113
|
-
o.selectNodeContents(s),
|
|
106
|
+
o.selectNodeContents(s), n.removeAllRanges(), n.addRange(o), f(a);
|
|
114
107
|
return;
|
|
115
108
|
}
|
|
116
|
-
if (!a)
|
|
117
|
-
return;
|
|
109
|
+
if (!a) return;
|
|
118
110
|
const m = new Set(
|
|
119
111
|
Array.from(a.querySelectorAll("font[face]"))
|
|
120
112
|
), u = new Set(
|
|
@@ -137,22 +129,22 @@ function C(e) {
|
|
|
137
129
|
a.querySelectorAll("span[style*='font-family']")
|
|
138
130
|
).forEach((o) => {
|
|
139
131
|
u.has(o) || (o.style.fontFamily = e, o.classList.add("rte-font-family"), c = !0);
|
|
140
|
-
}), i || (i = A(r,
|
|
132
|
+
}), i || (i = A(r, n, e)), (i || c) && (S(a), f(a));
|
|
141
133
|
}
|
|
142
134
|
function b(e) {
|
|
143
|
-
let
|
|
144
|
-
for (;
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
if (
|
|
148
|
-
return
|
|
135
|
+
let n = e;
|
|
136
|
+
for (; n; ) {
|
|
137
|
+
if (n.nodeType === Node.ELEMENT_NODE) {
|
|
138
|
+
const t = n;
|
|
139
|
+
if (t.tagName === "SPAN" && t.style.fontFamily)
|
|
140
|
+
return t;
|
|
149
141
|
}
|
|
150
|
-
|
|
142
|
+
n = n.parentNode;
|
|
151
143
|
}
|
|
152
144
|
return null;
|
|
153
145
|
}
|
|
154
|
-
function F(e,
|
|
155
|
-
const
|
|
146
|
+
function F(e, n) {
|
|
147
|
+
const t = e.startContainer, r = e.endContainer, a = n.contains(t) || t.nodeType === Node.TEXT_NODE && t.parentElement === n, l = n.contains(r) || r.nodeType === Node.TEXT_NODE && r.parentElement === n;
|
|
156
148
|
return a && l;
|
|
157
149
|
}
|
|
158
150
|
export {
|
package/dist/font-size.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=()=>({name:"fontSize",marks:{fontSize:{attrs:{size:{default:null}},parseDOM:[{tag:'span[style*="font-size"]',getAttrs:e=>{const t=e.style.fontSize;return t?{size:t}:!1}},{tag:"font[size]",getAttrs:e=>{const t=e.getAttribute("size");return t?{size:t}:!1}}],toDOM:e=>
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=()=>({name:"fontSize",marks:{fontSize:{attrs:{size:{default:null}},parseDOM:[{tag:'span[style*="font-size"]',getAttrs:e=>{const t=e.style.fontSize;return t?{size:t}:!1}},{tag:"font[size]",getAttrs:e=>{const t=e.getAttribute("size");return t?{size:t}:!1}}],toDOM:e=>["span",{style:`font-size: ${e.attrs?.size}`},0]}},toolbar:[{label:"Font Size",command:"fontSize",type:"group",items:[{label:"Decrease Font Size",command:"decreaseFontSize",icon:"−",type:"button"},{label:"Font Size",command:"setFontSize",type:"input",placeholder:"14"},{label:"Increase Font Size",command:"increaseFontSize",icon:"+",type:"button"}]}],commands:{decreaseFontSize:()=>{try{return g(-2),y(),!0}catch(e){return console.error("Failed to decrease font size:",e),!1}},increaseFontSize:()=>{try{return g(2),y(),!0}catch(e){return console.error("Failed to increase font size:",e),!1}},setFontSize:e=>{if(!e)return!1;try{const t=e.trim().match(/^(\d+(?:\.\d+)?)(px|em|rem)?$/i);if(!t)return!1;const n=parseFloat(t[1]),i=t[2]?.toLowerCase()||"px";return i==="px"&&(n<8||n>72)||(i==="em"||i==="rem")&&(n<.5||n>5)?!1:(C(n,i),!0)}catch(o){return console.error("Failed to set font size:",o),!1}}},keymap:{}}),A="p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre",z={"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32,"xxx-large":48,smaller:13,larger:18};function p(e){const o=e.trim().toLowerCase(),t=o.match(/^(\d+(?:\.\d+)?)(px|em|rem)$/i);if(t)return{value:parseFloat(t[1]),unit:t[2].toLowerCase()};const n=z[o];return n?{value:n,unit:"px"}:null}function N(e){return e.trim().toLowerCase()in z}function x(e){return!!e.cloneContents().querySelector(A)}function w(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')}function m(e){e&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function E(e,o){const t=document.createElement("span");for(const i of Array.from(e.attributes))i.name==="size"||i.name==="style"||t.setAttribute(i.name,i.value);const n=e.getAttribute("style");for(n&&t.setAttribute("style",n),t.style.fontSize=o;e.firstChild;)t.appendChild(e.firstChild);e.parentNode?.replaceChild(t,e)}function T(e,o,t,n){const i=Array.from(e.querySelectorAll("font[size], [style*='font-size']")),r=s=>{if(!n||!s.isConnected)return!1;try{if(typeof n.intersectsNode=="function")return n.intersectsNode(s)}catch{}const a=document.createRange();return a.selectNodeContents(s),n.compareBoundaryPoints(Range.END_TO_START,a)>0&&n.compareBoundaryPoints(Range.START_TO_END,a)<0};let c=!1;return i.forEach(s=>{const a=!o.has(s),u=s.tagName==="FONT",l=N(s.style.fontSize||""),f=r(s);if(!(!a&&!f)&&!(!a&&!u&&!l)){if(c=!0,s.tagName==="FONT"){E(s,t);return}s.style.fontSize=t}}),c}function S(e){e.querySelectorAll("span").forEach(t=>{t.childElementCount>0||(t.textContent||"").trim().length>0||t.remove()})}function R(e,o,t){if(x(e))return!1;const n=document.createElement("span");n.style.fontSize=t;try{e.surroundContents(n)}catch{const r=e.extractContents();n.appendChild(r),e.insertNode(n)}const i=document.createRange();return i.selectNodeContents(n),o.removeAllRanges(),o.addRange(i),!0}function g(e){const o=window.getSelection();if(!o||o.rangeCount===0)return;const{value:t,unit:n}=h();let i=e;(n==="em"||n==="rem")&&(i=e*.125);let r;n==="px"?r=e<0?Math.max(8,t+e):Math.min(72,t+e):r=e<0?Math.max(.5,t+i):Math.min(5,t+i),C(r,n)}function h(){const e=window.getSelection();if(!e||e.rangeCount===0)return{value:14,unit:"px"};const t=e.getRangeAt(0).startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(n){const i=n.style?.fontSize;if(i){const a=p(i);if(a)return a}const c=window.getComputedStyle(n).fontSize,s=p(c);if(s)return s}return{value:14,unit:"px"}}function C(e,o="px"){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),i=n.cloneRange(),r=w(n.commonAncestorContainer);if(n.collapsed)return;const c=`${e}${o}`,s=n.commonAncestorContainer,a=v(s);if(a&&O(n,a)){a.style.fontSize=c,m(r);const d=document.createRange();d.selectNodeContents(a),t.removeAllRanges(),t.addRange(d);return}if(!r)return;const u=new Set(Array.from(r.querySelectorAll("font[size], [style*='font-size']")));r.focus({preventScroll:!0});try{document.execCommand("styleWithCSS",!1,"true")}catch{}let l=document.execCommand("fontSize",!1,"7");const f=t.rangeCount>0?t.getRangeAt(0).cloneRange():i,F=T(r,u,c,f);if(l&&F){S(r),m(r);return}l=R(i,t,c),l&&(S(r),m(r))}function v(e){let o=e;for(;o&&o!==document.body;){if(o.nodeType===Node.ELEMENT_NODE){const t=o;if(t.tagName==="SPAN"&&t.style.fontSize)return t}o=o.parentNode}return null}function O(e,o){const t=e.startContainer,n=e.endContainer;return o.contains(t)&&o.contains(n)}function y(){setTimeout(()=>{const{value:e,unit:o}=h(),t=window.getSelection();if(!t||t.rangeCount===0)return;let n=null,r=t.getRangeAt(0).startContainer;for(;r;){if(r instanceof HTMLElement&&(r.classList.contains("rte-editor")||r.classList.contains("editora-editor")||r.hasAttribute("data-editora-editor"))){n=r;break}r=r.parentNode}if(!n)return;const c=n.querySelector(".rte-toolbar-wrapper, .editora-toolbar-container")||n,s=Array.from(c.querySelectorAll('input[data-command="setFontSize"], input.editora-toolbar-input.font-size, input.rte-toolbar-input.font-size, input[title="Font Size"]'));if(s.length===0)return;const u=`${e%1===0?e.toString():e.toFixed(2).replace(/\.?0+$/,"")}${o}`;s.forEach(l=>{l.value=u})},10)}exports.FontSizePlugin=b;
|