@editora/core 1.0.2 → 1.0.4
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 +42 -4
- package/dist/{A11yCheckerPlugin.native-CZKpi3uF.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +225 -173
- package/dist/AnchorPlugin.native-C1Rw5m04.mjs +404 -0
- package/dist/BackgroundColorPlugin.native-BE-p9DRd.mjs +489 -0
- package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +309 -0
- package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +140 -0
- package/dist/CodePlugin.native-0Zari_zp.mjs +2041 -0
- package/dist/CodeSamplePlugin.native-B-KS1pOl.mjs +384 -0
- package/dist/CommentsPlugin.native-tMnWn8a2.mjs +723 -0
- package/dist/DirectionPlugin.native-CDnbdNyl.mjs +130 -0
- package/dist/{EmbedIframePlugin.native-ifr9KLdN.mjs → EmbedIframePlugin.native-CSWIB1jm.mjs} +154 -50
- package/dist/{EmojisPlugin.native-D6mJSnSR.mjs → EmojisPlugin.native-DxTm_DL-.mjs} +156 -103
- package/dist/FontFamilyPlugin.native-j8hMTbg4.mjs +158 -0
- package/dist/FontSizePlugin.native-B_jCh7dY.mjs +286 -0
- package/dist/FootnotePlugin.native-D730OGRm.mjs +425 -0
- package/dist/HistoryPlugin.native-DCrPdeSW.mjs +257 -0
- package/dist/IndentPlugin.native-BHixp8sP.mjs +150 -0
- package/dist/LineHeightPlugin.native-CM7iXdQj.mjs +151 -0
- package/dist/{LinkPlugin.native-BdAOV-iu.mjs → LinkPlugin.native-CS2g-G18.mjs} +128 -53
- package/dist/{ListPlugin.native-CLFU5AUQ.mjs → ListPlugin.native-V7EZC1lM.mjs} +59 -12
- package/dist/MathPlugin.native-KUxz0o8C.mjs +251 -0
- package/dist/MediaManagerPlugin.native-CgP5iInD.mjs +970 -0
- package/dist/MergeTagPlugin.native-CU9LtsfD.mjs +416 -0
- package/dist/PageBreakPlugin.native-CGiQxXqR.mjs +297 -0
- package/dist/{PrintPlugin.native-BUpm52VJ.mjs → PrintPlugin.native-7qt5v7L5.mjs} +10 -10
- package/dist/{SpecialCharactersPlugin.native-x7a2SWXc.mjs → SpecialCharactersPlugin.native-DANrbExJ.mjs} +143 -97
- package/dist/SpellCheckPlugin.native-C8bPvRHy.mjs +1019 -0
- package/dist/StrikethroughPlugin.native-0Be7j49s.mjs +73 -0
- package/dist/{TablePlugin.native-EEWXn1-s.mjs → TablePlugin.native-DrHX-efe.mjs} +149 -145
- package/dist/TemplatePlugin.native-4lKEm-WY.mjs +578 -0
- package/dist/TextAlignmentPlugin.native-sM_1s00t.mjs +108 -0
- package/dist/{TextColorPlugin.native-D6SmTglm.mjs → TextColorPlugin.native-Clgtb50j.mjs} +173 -92
- package/dist/colorSelectionApply-CK1My9N2.mjs +67 -0
- package/dist/core.css +1 -1
- package/dist/editora.min.js +31 -29
- package/dist/editora.umd.js +31 -29
- package/dist/index-CqWQFb3D.js +10 -0
- package/dist/index-OwnkG39N.mjs +2227 -0
- package/dist/index.cjs.js +14 -18
- package/dist/index.esm.js +204 -521
- package/dist/plugin-loader.js +26 -26
- package/dist/webcomponent-core.js +1286 -295
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +116 -106
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +1252 -261
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +2980 -1488
- package/index.d.ts +355 -0
- package/package.json +21 -19
- package/LICENSE +0 -21
- package/dist/A11yCheckerPlugin.native-CZKpi3uF.mjs.map +0 -1
- package/dist/AnchorPlugin.native-7es9PVZ9.mjs +0 -340
- package/dist/AnchorPlugin.native-7es9PVZ9.mjs.map +0 -1
- package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs +0 -449
- package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs.map +0 -1
- package/dist/BlockquotePlugin.native-JFmOLsxN.mjs.map +0 -1
- package/dist/BoldPlugin.native-BAzzoqU5.mjs.map +0 -1
- package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs.map +0 -1
- package/dist/ChecklistPlugin.native-Dccs3nLe.mjs +0 -153
- package/dist/ChecklistPlugin.native-Dccs3nLe.mjs.map +0 -1
- package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs +0 -27
- package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs.map +0 -1
- package/dist/CodePlugin.native-DD9xFIid.mjs +0 -1679
- package/dist/CodePlugin.native-DD9xFIid.mjs.map +0 -1
- package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs +0 -326
- package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs.map +0 -1
- package/dist/CommentsPlugin.native-2zQV8Ia4.mjs +0 -473
- package/dist/CommentsPlugin.native-2zQV8Ia4.mjs.map +0 -1
- package/dist/DirectionPlugin.native-Be7wCzkI.mjs +0 -59
- package/dist/DirectionPlugin.native-Be7wCzkI.mjs.map +0 -1
- package/dist/DocumentManagerPlugin.native-BvZL5CSG.mjs.map +0 -1
- package/dist/EmbedIframePlugin.native-ifr9KLdN.mjs.map +0 -1
- package/dist/EmojisPlugin.native-D6mJSnSR.mjs.map +0 -1
- package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs +0 -106
- package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs.map +0 -1
- package/dist/FontSizePlugin.native-DkLMLPue.mjs +0 -186
- package/dist/FontSizePlugin.native-DkLMLPue.mjs.map +0 -1
- package/dist/FootnotePlugin.native-BciVc9W6.mjs +0 -128
- package/dist/FootnotePlugin.native-BciVc9W6.mjs.map +0 -1
- package/dist/FullscreenPlugin.native-ChXyxeNw.mjs.map +0 -1
- package/dist/HeadingPlugin.native-DrLYwQnQ.mjs.map +0 -1
- package/dist/HistoryPlugin.native-DoDRifCf.mjs +0 -89
- package/dist/HistoryPlugin.native-DoDRifCf.mjs.map +0 -1
- package/dist/IndentPlugin.native-CbFugPoi.mjs +0 -133
- package/dist/IndentPlugin.native-CbFugPoi.mjs.map +0 -1
- package/dist/ItalicPlugin.native-CQjjDyUL.mjs.map +0 -1
- package/dist/LineHeightPlugin.native-CWQT2FIa.mjs +0 -73
- package/dist/LineHeightPlugin.native-CWQT2FIa.mjs.map +0 -1
- package/dist/LinkPlugin.native-BdAOV-iu.mjs.map +0 -1
- package/dist/ListPlugin.native-CLFU5AUQ.mjs.map +0 -1
- package/dist/MathPlugin.native-DE_ii-LA.mjs +0 -182
- package/dist/MathPlugin.native-DE_ii-LA.mjs.map +0 -1
- package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs +0 -533
- package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs.map +0 -1
- package/dist/MergeTagPlugin.native-CrxyThyn.mjs +0 -178
- package/dist/MergeTagPlugin.native-CrxyThyn.mjs.map +0 -1
- package/dist/PageBreakPlugin.native-DDjcDyRW.mjs +0 -172
- package/dist/PageBreakPlugin.native-DDjcDyRW.mjs.map +0 -1
- package/dist/PreviewPlugin.native-DBvfpmIv.mjs.map +0 -1
- package/dist/PrintPlugin.native-BUpm52VJ.mjs.map +0 -1
- package/dist/SpecialCharactersPlugin.native-x7a2SWXc.mjs.map +0 -1
- package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs +0 -465
- package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs.map +0 -1
- package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs +0 -43
- package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs.map +0 -1
- package/dist/TablePlugin.native-EEWXn1-s.mjs.map +0 -1
- package/dist/TemplatePlugin.native-BlSn1c9h.mjs +0 -564
- package/dist/TemplatePlugin.native-BlSn1c9h.mjs.map +0 -1
- package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs +0 -97
- package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs.map +0 -1
- package/dist/TextColorPlugin.native-D6SmTglm.mjs.map +0 -1
- package/dist/UnderlinePlugin.native-QpIcK4L2.mjs.map +0 -1
- package/dist/documentManager-irzj9n3V.mjs.map +0 -1
- package/dist/editorContainerHelpers-C7kdWnS0.mjs.map +0 -1
- package/dist/editora.min.js.map +0 -1
- package/dist/editora.umd.js.map +0 -1
- package/dist/index-BF5RBhL9.js +0 -4
- package/dist/index-BF5RBhL9.js.map +0 -1
- package/dist/index-BPsf460l.mjs +0 -1243
- package/dist/index-BPsf460l.mjs.map +0 -1
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es-CuicffkQ.mjs.map +0 -1
- package/dist/index.esm.js.map +0 -1
- package/dist/plugin-loader.js.map +0 -1
- package/dist/purify.es-CKpwg8Tk.mjs.map +0 -1
- package/dist/webcomponent-core.js.map +0 -1
- package/dist/webcomponent-core.min.js.map +0 -1
- package/dist/webcomponent.cjs.js.map +0 -1
- package/dist/webcomponent.esm.js.map +0 -1
- package/dist/webcomponent.js.map +0 -1
- package/dist/webcomponent.min.js.map +0 -1
|
@@ -540,7 +540,7 @@ const d = {
|
|
|
540
540
|
"🇳🇿"
|
|
541
541
|
]
|
|
542
542
|
}
|
|
543
|
-
},
|
|
543
|
+
}, j = {
|
|
544
544
|
"💙": "blue heart",
|
|
545
545
|
"💚": "green heart",
|
|
546
546
|
"💛": "yellow heart",
|
|
@@ -688,8 +688,8 @@ const d = {
|
|
|
688
688
|
"🧹": "broom",
|
|
689
689
|
"🧸": "teddy bear"
|
|
690
690
|
};
|
|
691
|
-
let
|
|
692
|
-
const
|
|
691
|
+
let l = null, n = "all", c = "", s = null;
|
|
692
|
+
const h = '[data-theme="dark"], .dark, .editora-theme-dark', E = () => ({
|
|
693
693
|
name: "emojis",
|
|
694
694
|
toolbar: [
|
|
695
695
|
{
|
|
@@ -701,17 +701,17 @@ const y = () => ({
|
|
|
701
701
|
}
|
|
702
702
|
],
|
|
703
703
|
commands: {
|
|
704
|
-
openEmojiDialog: (
|
|
705
|
-
const e = (
|
|
706
|
-
return e ? (
|
|
704
|
+
openEmojiDialog: (r, o) => {
|
|
705
|
+
const e = (o == null ? void 0 : o.contentElement) || u();
|
|
706
|
+
return e ? (v(e), !0) : !1;
|
|
707
707
|
},
|
|
708
|
-
insertEmoji: (
|
|
709
|
-
if (!
|
|
710
|
-
const e = (
|
|
708
|
+
insertEmoji: (r, o) => {
|
|
709
|
+
if (!r) return !1;
|
|
710
|
+
const e = (o == null ? void 0 : o.contentElement) || u();
|
|
711
711
|
if (!e) return !1;
|
|
712
712
|
try {
|
|
713
|
-
return
|
|
714
|
-
} catch (
|
|
713
|
+
return p(r, e), !0;
|
|
714
|
+
} catch (t) {
|
|
715
715
|
return !1;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
@@ -720,23 +720,23 @@ const y = () => ({
|
|
|
720
720
|
"Mod-Shift-j": "openEmojiDialog"
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
|
-
function
|
|
724
|
-
n = "all",
|
|
725
|
-
const
|
|
726
|
-
s = null,
|
|
723
|
+
function v(r) {
|
|
724
|
+
n = "all", c = "";
|
|
725
|
+
const o = window.getSelection();
|
|
726
|
+
s = null, o && o.rangeCount > 0 && r.contains(o.anchorNode) && (s = o.getRangeAt(0).cloneRange());
|
|
727
727
|
const e = document.createElement("div");
|
|
728
|
-
e.className = "emojis-overlay", e.onclick =
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
|
|
728
|
+
e.className = "emojis-overlay", y(r) && e.classList.add("rte-ui-theme-dark"), e.onclick = g;
|
|
729
|
+
const t = document.createElement("div");
|
|
730
|
+
t.className = "emojis-dialog", t.setAttribute("role", "dialog"), t.setAttribute("aria-modal", "true"), t.onclick = (a) => a.stopPropagation();
|
|
731
|
+
const i = Object.keys(d);
|
|
732
|
+
t.innerHTML = `
|
|
733
733
|
<div class="rte-dialog-header emojis-header">
|
|
734
734
|
<h3>Insert Emojis</h3>
|
|
735
735
|
<button class="rte-dialog-close emojis-close">×</button>
|
|
736
736
|
</div>
|
|
737
737
|
<div class="rte-dialog-body emojis-content">
|
|
738
738
|
<div class="emojis-tabs">
|
|
739
|
-
${
|
|
739
|
+
${i.map((a) => `
|
|
740
740
|
<button class="emojis-tab ${a === n ? "active" : ""}" data-category="${a}">
|
|
741
741
|
${d[a].name}
|
|
742
742
|
</button>
|
|
@@ -756,103 +756,156 @@ function j(o) {
|
|
|
756
756
|
/>
|
|
757
757
|
</div>
|
|
758
758
|
<div class="emojis-grid" id="emojis-grid">
|
|
759
|
-
${f(n,
|
|
759
|
+
${f(n, c)}
|
|
760
760
|
</div>
|
|
761
761
|
</div>
|
|
762
762
|
</div>
|
|
763
|
-
`, e.appendChild(
|
|
763
|
+
`, e.appendChild(t), document.body.appendChild(e), l = e, x(t, r), k(), setTimeout(() => {
|
|
764
764
|
var a;
|
|
765
|
-
(a =
|
|
765
|
+
(a = t.querySelector("#emoji-search-input")) == null || a.focus();
|
|
766
766
|
}, 100);
|
|
767
767
|
}
|
|
768
|
-
function x(
|
|
769
|
-
var
|
|
770
|
-
(
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
|
|
768
|
+
function x(r, o) {
|
|
769
|
+
var t;
|
|
770
|
+
(t = r.querySelector(".emojis-close")) == null || t.addEventListener("click", g), r.querySelectorAll(".emojis-tab").forEach((i) => {
|
|
771
|
+
i.addEventListener("click", (a) => {
|
|
772
|
+
const b = a.target.getAttribute("data-category");
|
|
773
|
+
b && w(r, b, o);
|
|
774
774
|
});
|
|
775
775
|
});
|
|
776
|
-
const e =
|
|
777
|
-
e == null || e.addEventListener("input", (
|
|
778
|
-
|
|
779
|
-
}), m(
|
|
776
|
+
const e = r.querySelector("#emoji-search-input");
|
|
777
|
+
e == null || e.addEventListener("input", (i) => {
|
|
778
|
+
c = i.target.value, m(r, o);
|
|
779
|
+
}), m(r, o);
|
|
780
780
|
}
|
|
781
|
-
function w(
|
|
782
|
-
n =
|
|
783
|
-
|
|
784
|
-
}), m(
|
|
781
|
+
function w(r, o, e) {
|
|
782
|
+
n = o, r.querySelectorAll(".emojis-tab").forEach((t) => {
|
|
783
|
+
t.classList.toggle("active", t.getAttribute("data-category") === o);
|
|
784
|
+
}), m(r, e);
|
|
785
785
|
}
|
|
786
|
-
function m(
|
|
787
|
-
const e =
|
|
788
|
-
e && (e.innerHTML = f(n,
|
|
789
|
-
|
|
786
|
+
function m(r, o) {
|
|
787
|
+
const e = r.querySelector("#emojis-grid");
|
|
788
|
+
e && (e.innerHTML = f(n, c), e.querySelectorAll(".emojis-item").forEach((t) => {
|
|
789
|
+
t.addEventListener("click", () => {
|
|
790
790
|
var a;
|
|
791
|
-
const
|
|
792
|
-
|
|
791
|
+
const i = ((a = t.textContent) == null ? void 0 : a.trim()) || "";
|
|
792
|
+
i && (p(i, o), g());
|
|
793
793
|
});
|
|
794
794
|
}));
|
|
795
795
|
}
|
|
796
|
-
function f(
|
|
797
|
-
let e = d[
|
|
798
|
-
return
|
|
796
|
+
function f(r, o) {
|
|
797
|
+
let e = d[r].emojis;
|
|
798
|
+
return o.trim() && (e = e.filter((t) => t.toLowerCase().includes(o.toLowerCase()) ? !0 : (j[t] || "").toLowerCase().includes(o.toLowerCase()))), e.length === 0 && o.trim() ? `<div class="emojis-no-results">No emojis found for "${o}"</div>` : e.map((t, i) => `
|
|
799
799
|
<button
|
|
800
800
|
class="emojis-item"
|
|
801
|
-
title="Insert ${
|
|
802
|
-
data-emoji="${
|
|
801
|
+
title="Insert ${t}"
|
|
802
|
+
data-emoji="${t}"
|
|
803
803
|
>
|
|
804
|
-
${
|
|
804
|
+
${t}
|
|
805
805
|
</button>
|
|
806
806
|
`).join("");
|
|
807
807
|
}
|
|
808
|
-
function
|
|
809
|
-
|
|
808
|
+
function g() {
|
|
809
|
+
l && (document.body.removeChild(l), l = null);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
|
|
811
|
+
function p(r, o) {
|
|
812
|
+
o.focus();
|
|
813
813
|
let e = window.getSelection();
|
|
814
814
|
if (s && (e == null || e.removeAllRanges(), e == null || e.addRange(s), s = null), e = window.getSelection(), e && e.rangeCount > 0) {
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
|
|
815
|
+
const t = e.getRangeAt(0);
|
|
816
|
+
t.deleteContents();
|
|
817
|
+
const i = document.createTextNode(r);
|
|
818
|
+
t.insertNode(i), t.setStartAfter(i), t.setEndAfter(i), e.removeAllRanges(), e.addRange(t);
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function u() {
|
|
822
|
+
const r = window.getSelection();
|
|
823
|
+
if (r && r.rangeCount > 0) {
|
|
824
|
+
const e = r.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement, i = t == null ? void 0 : t.closest(".editora-content, .rte-content");
|
|
825
|
+
if (i) return i;
|
|
826
|
+
}
|
|
822
827
|
const o = document.activeElement;
|
|
823
828
|
return o && (o.classList.contains("editora-content") || o.classList.contains("rte-content")) ? o : document.querySelector(".editora-content, .rte-content");
|
|
824
829
|
}
|
|
825
|
-
function
|
|
830
|
+
function y(r) {
|
|
831
|
+
const o = r || u();
|
|
832
|
+
return o ? !!o.closest(h) : !1;
|
|
833
|
+
}
|
|
834
|
+
function k() {
|
|
826
835
|
if (document.getElementById("emojis-dialog-styles")) return;
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
/* Emojis Dialog Styles */
|
|
836
|
+
const r = document.createElement("style");
|
|
837
|
+
r.id = "emojis-dialog-styles", r.textContent = `
|
|
830
838
|
.emojis-overlay {
|
|
839
|
+
--rte-emoji-overlay-bg: rgba(15, 23, 36, 0.56);
|
|
840
|
+
--rte-emoji-dialog-bg: #ffffff;
|
|
841
|
+
--rte-emoji-dialog-text: #101828;
|
|
842
|
+
--rte-emoji-border: #d6dbe4;
|
|
843
|
+
--rte-emoji-subtle-bg: #f7f9fc;
|
|
844
|
+
--rte-emoji-subtle-hover: #eef2f7;
|
|
845
|
+
--rte-emoji-muted-text: #5f6b7d;
|
|
846
|
+
--rte-emoji-accent: #1f75fe;
|
|
847
|
+
--rte-emoji-accent-strong: #165fd6;
|
|
848
|
+
--rte-emoji-ring: rgba(31, 117, 254, 0.18);
|
|
831
849
|
position: fixed;
|
|
832
850
|
top: 0;
|
|
833
851
|
left: 0;
|
|
834
852
|
right: 0;
|
|
835
853
|
bottom: 0;
|
|
836
|
-
background-color:
|
|
854
|
+
background-color: var(--rte-emoji-overlay-bg);
|
|
855
|
+
backdrop-filter: blur(2px);
|
|
837
856
|
display: flex;
|
|
838
857
|
align-items: center;
|
|
839
858
|
justify-content: center;
|
|
840
859
|
z-index: 1000;
|
|
860
|
+
padding: 16px;
|
|
861
|
+
box-sizing: border-box;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.emojis-overlay.rte-ui-theme-dark {
|
|
865
|
+
--rte-emoji-overlay-bg: rgba(2, 8, 20, 0.72);
|
|
866
|
+
--rte-emoji-dialog-bg: #202938;
|
|
867
|
+
--rte-emoji-dialog-text: #e8effc;
|
|
868
|
+
--rte-emoji-border: #49566c;
|
|
869
|
+
--rte-emoji-subtle-bg: #2a3444;
|
|
870
|
+
--rte-emoji-subtle-hover: #344256;
|
|
871
|
+
--rte-emoji-muted-text: #a5b1c5;
|
|
872
|
+
--rte-emoji-accent: #58a6ff;
|
|
873
|
+
--rte-emoji-accent-strong: #4598f4;
|
|
874
|
+
--rte-emoji-ring: rgba(88, 166, 255, 0.22);
|
|
841
875
|
}
|
|
842
876
|
|
|
843
877
|
.emojis-dialog {
|
|
844
|
-
background:
|
|
845
|
-
|
|
846
|
-
|
|
878
|
+
background: var(--rte-emoji-dialog-bg);
|
|
879
|
+
color: var(--rte-emoji-dialog-text);
|
|
880
|
+
border: 1px solid var(--rte-emoji-border);
|
|
881
|
+
border-radius: 12px;
|
|
882
|
+
box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
|
|
847
883
|
max-width: 800px;
|
|
848
884
|
width: 90%;
|
|
849
885
|
max-height: 80vh;
|
|
850
886
|
display: flex;
|
|
851
887
|
flex-direction: column;
|
|
888
|
+
overflow: hidden;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.emojis-header {
|
|
892
|
+
border-bottom: 1px solid var(--rte-emoji-border);
|
|
893
|
+
background: linear-gradient(180deg, rgba(127, 154, 195, 0.08) 0%, rgba(127, 154, 195, 0) 100%);
|
|
852
894
|
}
|
|
853
895
|
|
|
854
896
|
.emojis-header h3 {
|
|
855
|
-
color:
|
|
897
|
+
color: var(--rte-emoji-dialog-text);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.emojis-close {
|
|
901
|
+
color: var(--rte-emoji-muted-text);
|
|
902
|
+
border-radius: 8px;
|
|
903
|
+
transition: background-color 0.16s ease, color 0.16s ease;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.emojis-close:hover {
|
|
907
|
+
background-color: var(--rte-emoji-subtle-hover);
|
|
908
|
+
color: var(--rte-emoji-dialog-text);
|
|
856
909
|
}
|
|
857
910
|
|
|
858
911
|
.emojis-content {
|
|
@@ -878,7 +931,7 @@ function v() {
|
|
|
878
931
|
position: absolute;
|
|
879
932
|
left: 28px;
|
|
880
933
|
top: 27px;
|
|
881
|
-
color:
|
|
934
|
+
color: var(--rte-emoji-muted-text);
|
|
882
935
|
pointer-events: none;
|
|
883
936
|
z-index: 1;
|
|
884
937
|
}
|
|
@@ -886,34 +939,34 @@ function v() {
|
|
|
886
939
|
.emojis-search-input {
|
|
887
940
|
width: calc(100% - 24px);
|
|
888
941
|
padding: 10px 12px 10px 40px;
|
|
889
|
-
border: 1px solid
|
|
890
|
-
border-radius:
|
|
942
|
+
border: 1px solid var(--rte-emoji-border);
|
|
943
|
+
border-radius: 8px;
|
|
891
944
|
font-size: 14px;
|
|
892
|
-
color:
|
|
893
|
-
background-color:
|
|
945
|
+
color: var(--rte-emoji-dialog-text);
|
|
946
|
+
background-color: var(--rte-emoji-subtle-bg);
|
|
894
947
|
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
895
948
|
}
|
|
896
949
|
|
|
897
950
|
.emojis-search-input:focus {
|
|
898
951
|
outline: none;
|
|
899
|
-
border-color:
|
|
900
|
-
box-shadow: 0 0 0 3px
|
|
952
|
+
border-color: var(--rte-emoji-accent);
|
|
953
|
+
box-shadow: 0 0 0 3px var(--rte-emoji-ring);
|
|
901
954
|
}
|
|
902
955
|
|
|
903
|
-
.emojis-search
|
|
904
|
-
color:
|
|
956
|
+
.emojis-search:focus-within .emojis-search-icon {
|
|
957
|
+
color: var(--rte-emoji-accent);
|
|
905
958
|
}
|
|
906
959
|
|
|
907
960
|
.emojis-search-input::placeholder {
|
|
908
|
-
color:
|
|
961
|
+
color: var(--rte-emoji-muted-text);
|
|
909
962
|
}
|
|
910
963
|
|
|
911
964
|
.emojis-tabs {
|
|
912
965
|
display: flex;
|
|
913
966
|
flex-direction: column;
|
|
914
967
|
width: 180px;
|
|
915
|
-
border-right: 1px solid
|
|
916
|
-
background-color:
|
|
968
|
+
border-right: 1px solid var(--rte-emoji-border);
|
|
969
|
+
background-color: var(--rte-emoji-subtle-bg);
|
|
917
970
|
}
|
|
918
971
|
|
|
919
972
|
.emojis-tab {
|
|
@@ -923,24 +976,24 @@ function v() {
|
|
|
923
976
|
text-align: left;
|
|
924
977
|
cursor: pointer;
|
|
925
978
|
font-size: 14px;
|
|
926
|
-
color:
|
|
927
|
-
border-bottom: 1px solid
|
|
979
|
+
color: var(--rte-emoji-muted-text);
|
|
980
|
+
border-bottom: 1px solid var(--rte-emoji-border);
|
|
928
981
|
transition: all 0.2s ease;
|
|
929
982
|
}
|
|
930
983
|
|
|
931
984
|
.emojis-tab:hover {
|
|
932
|
-
background-color:
|
|
933
|
-
color:
|
|
985
|
+
background-color: var(--rte-emoji-subtle-hover);
|
|
986
|
+
color: var(--rte-emoji-dialog-text);
|
|
934
987
|
}
|
|
935
988
|
|
|
936
989
|
.emojis-tab.active {
|
|
937
|
-
background-color:
|
|
938
|
-
color:
|
|
990
|
+
background-color: var(--rte-emoji-accent);
|
|
991
|
+
color: #fff;
|
|
939
992
|
font-weight: 500;
|
|
940
993
|
}
|
|
941
994
|
|
|
942
995
|
.emojis-tab.active:hover {
|
|
943
|
-
background-color:
|
|
996
|
+
background-color: var(--rte-emoji-accent-strong);
|
|
944
997
|
}
|
|
945
998
|
|
|
946
999
|
.emojis-grid {
|
|
@@ -957,19 +1010,19 @@ function v() {
|
|
|
957
1010
|
display: flex;
|
|
958
1011
|
align-items: center;
|
|
959
1012
|
justify-content: center;
|
|
960
|
-
border: 1px solid
|
|
961
|
-
background:
|
|
962
|
-
border-radius:
|
|
1013
|
+
border: 1px solid var(--rte-emoji-border);
|
|
1014
|
+
background: var(--rte-emoji-subtle-bg);
|
|
1015
|
+
border-radius: 8px;
|
|
963
1016
|
cursor: pointer;
|
|
964
1017
|
font-size: 18px;
|
|
965
1018
|
transition: all 0.2s ease;
|
|
966
|
-
color:
|
|
1019
|
+
color: var(--rte-emoji-dialog-text);
|
|
967
1020
|
}
|
|
968
1021
|
|
|
969
1022
|
.emojis-item:hover {
|
|
970
|
-
background-color:
|
|
971
|
-
border-color:
|
|
972
|
-
color:
|
|
1023
|
+
background-color: var(--rte-emoji-accent);
|
|
1024
|
+
border-color: var(--rte-emoji-accent);
|
|
1025
|
+
color: #fff;
|
|
973
1026
|
transform: scale(1.05);
|
|
974
1027
|
}
|
|
975
1028
|
|
|
@@ -980,12 +1033,12 @@ function v() {
|
|
|
980
1033
|
.emojis-no-results {
|
|
981
1034
|
grid-column: 1 / -1;
|
|
982
1035
|
text-align: center;
|
|
983
|
-
color:
|
|
1036
|
+
color: var(--rte-emoji-muted-text);
|
|
984
1037
|
font-size: 14px;
|
|
985
1038
|
padding: 40px 20px;
|
|
986
|
-
background-color:
|
|
987
|
-
border-radius:
|
|
988
|
-
border: 1px solid
|
|
1039
|
+
background-color: var(--rte-emoji-subtle-bg);
|
|
1040
|
+
border-radius: 8px;
|
|
1041
|
+
border: 1px solid var(--rte-emoji-border);
|
|
989
1042
|
}
|
|
990
1043
|
|
|
991
1044
|
/* Responsive design */
|
|
@@ -1002,14 +1055,14 @@ function v() {
|
|
|
1002
1055
|
.emojis-tabs {
|
|
1003
1056
|
width: 100%;
|
|
1004
1057
|
border-right: none;
|
|
1005
|
-
border-bottom: 1px solid
|
|
1058
|
+
border-bottom: 1px solid var(--rte-emoji-border);
|
|
1006
1059
|
flex-direction: row;
|
|
1007
1060
|
overflow-x: auto;
|
|
1008
1061
|
}
|
|
1009
1062
|
|
|
1010
1063
|
.emojis-tab {
|
|
1011
1064
|
border-bottom: none;
|
|
1012
|
-
border-right: 1px solid
|
|
1065
|
+
border-right: 1px solid var(--rte-emoji-border);
|
|
1013
1066
|
white-space: nowrap;
|
|
1014
1067
|
min-width: 80px;
|
|
1015
1068
|
}
|
|
@@ -1025,9 +1078,9 @@ function v() {
|
|
|
1025
1078
|
font-size: 16px;
|
|
1026
1079
|
}
|
|
1027
1080
|
}
|
|
1028
|
-
`, document.head.appendChild(
|
|
1081
|
+
`, document.head.appendChild(r);
|
|
1029
1082
|
}
|
|
1030
1083
|
export {
|
|
1031
|
-
|
|
1084
|
+
E as EmojisPlugin
|
|
1032
1085
|
};
|
|
1033
|
-
//# sourceMappingURL=EmojisPlugin.native-
|
|
1086
|
+
//# sourceMappingURL=EmojisPlugin.native-DxTm_DL-.mjs.map
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
const E = () => ({
|
|
2
|
+
name: "fontFamily",
|
|
3
|
+
marks: {
|
|
4
|
+
fontFamily: {
|
|
5
|
+
attrs: {
|
|
6
|
+
family: { default: null }
|
|
7
|
+
},
|
|
8
|
+
parseDOM: [
|
|
9
|
+
{
|
|
10
|
+
tag: 'span[style*="font-family"]',
|
|
11
|
+
getAttrs: (e) => {
|
|
12
|
+
const n = e.style.fontFamily;
|
|
13
|
+
return n ? { family: n } : !1;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
tag: "font[face]",
|
|
18
|
+
getAttrs: (e) => {
|
|
19
|
+
const n = e.getAttribute("face");
|
|
20
|
+
return n ? { family: n } : !1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
toDOM: (e) => {
|
|
25
|
+
var t;
|
|
26
|
+
return ["span", { style: `font-family: ${(t = e.attrs) == null ? void 0 : t.family}` }, 0];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
toolbar: [
|
|
31
|
+
{
|
|
32
|
+
label: "Font Family",
|
|
33
|
+
command: "setFontFamily",
|
|
34
|
+
type: "inline-menu",
|
|
35
|
+
options: [
|
|
36
|
+
{ label: "Arial", value: "Arial, sans-serif" },
|
|
37
|
+
{ label: "Times New Roman", value: "Times New Roman, serif" },
|
|
38
|
+
{ label: "Courier New", value: "Courier New, monospace" },
|
|
39
|
+
{ label: "Georgia", value: "Georgia, serif" },
|
|
40
|
+
{ label: "Verdana", value: "Verdana, sans-serif" },
|
|
41
|
+
{ label: "Helvetica", value: "Helvetica, Arial, sans-serif" },
|
|
42
|
+
{ label: "Trebuchet MS", value: "Trebuchet MS, sans-serif" },
|
|
43
|
+
{ label: "Impact", value: "Impact, sans-serif" }
|
|
44
|
+
],
|
|
45
|
+
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>'
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
commands: {
|
|
49
|
+
setFontFamily: (e) => {
|
|
50
|
+
if (!e) return !1;
|
|
51
|
+
try {
|
|
52
|
+
return C(e), !0;
|
|
53
|
+
} catch (t) {
|
|
54
|
+
return console.error("Failed to set font family:", t), !1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
keymap: {
|
|
59
|
+
"Mod-Shift-f": "setFontFamily"
|
|
60
|
+
}
|
|
61
|
+
}), y = "p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";
|
|
62
|
+
function p(e) {
|
|
63
|
+
return !!e.cloneContents().querySelector(y);
|
|
64
|
+
}
|
|
65
|
+
function h(e) {
|
|
66
|
+
const t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
67
|
+
return (t == null ? void 0 : t.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
|
|
68
|
+
}
|
|
69
|
+
function f(e) {
|
|
70
|
+
e && e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
71
|
+
}
|
|
72
|
+
function g(e, t) {
|
|
73
|
+
var a;
|
|
74
|
+
const n = document.createElement("span");
|
|
75
|
+
for (const l of Array.from(e.attributes))
|
|
76
|
+
l.name === "face" || l.name === "style" || n.setAttribute(l.name, l.value);
|
|
77
|
+
const r = e.getAttribute("style");
|
|
78
|
+
for (r && n.setAttribute("style", r), n.style.fontFamily = t, n.classList.add("rte-font-family"); e.firstChild; )
|
|
79
|
+
n.appendChild(e.firstChild);
|
|
80
|
+
(a = e.parentNode) == null || a.replaceChild(n, e);
|
|
81
|
+
}
|
|
82
|
+
function S(e) {
|
|
83
|
+
e.querySelectorAll("span").forEach((n) => {
|
|
84
|
+
n.childElementCount > 0 || (n.textContent || "").trim().length > 0 || n.remove();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function A(e, t, n) {
|
|
88
|
+
if (p(e))
|
|
89
|
+
return !1;
|
|
90
|
+
const r = document.createElement("span");
|
|
91
|
+
r.style.fontFamily = n, r.className = "rte-font-family";
|
|
92
|
+
try {
|
|
93
|
+
e.surroundContents(r);
|
|
94
|
+
} catch (l) {
|
|
95
|
+
const s = e.extractContents();
|
|
96
|
+
r.appendChild(s), e.insertNode(r);
|
|
97
|
+
}
|
|
98
|
+
const a = document.createRange();
|
|
99
|
+
return a.selectNodeContents(r), t.removeAllRanges(), t.addRange(a), !0;
|
|
100
|
+
}
|
|
101
|
+
function C(e) {
|
|
102
|
+
const t = window.getSelection();
|
|
103
|
+
if (!t || t.rangeCount === 0) return;
|
|
104
|
+
const n = t.getRangeAt(0), r = n.cloneRange(), a = h(n.commonAncestorContainer);
|
|
105
|
+
if (n.collapsed)
|
|
106
|
+
return;
|
|
107
|
+
const l = n.commonAncestorContainer, s = b(l);
|
|
108
|
+
if (s && F(n, s)) {
|
|
109
|
+
s.style.fontFamily = e, s.classList.add("rte-font-family");
|
|
110
|
+
const o = document.createRange();
|
|
111
|
+
o.selectNodeContents(s), t.removeAllRanges(), t.addRange(o), f(a);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (!a) return;
|
|
115
|
+
const m = new Set(
|
|
116
|
+
Array.from(a.querySelectorAll("font[face]"))
|
|
117
|
+
), u = new Set(
|
|
118
|
+
Array.from(
|
|
119
|
+
a.querySelectorAll("span[style*='font-family']")
|
|
120
|
+
)
|
|
121
|
+
);
|
|
122
|
+
a.focus({ preventScroll: !0 });
|
|
123
|
+
try {
|
|
124
|
+
document.execCommand("styleWithCSS", !1, "true");
|
|
125
|
+
} catch (o) {
|
|
126
|
+
}
|
|
127
|
+
const d = e.split(",").map((o) => o.trim().replace(/^['"]|['"]$/g, "")).filter(Boolean)[0] || "Arial";
|
|
128
|
+
let i = document.execCommand("fontName", !1, d), c = !1;
|
|
129
|
+
Array.from(
|
|
130
|
+
a.querySelectorAll("font[face]")
|
|
131
|
+
).forEach((o) => {
|
|
132
|
+
m.has(o) || (g(o, e), c = !0);
|
|
133
|
+
}), Array.from(
|
|
134
|
+
a.querySelectorAll("span[style*='font-family']")
|
|
135
|
+
).forEach((o) => {
|
|
136
|
+
u.has(o) || (o.style.fontFamily = e, o.classList.add("rte-font-family"), c = !0);
|
|
137
|
+
}), i || (i = A(r, t, e)), (i || c) && (S(a), f(a));
|
|
138
|
+
}
|
|
139
|
+
function b(e) {
|
|
140
|
+
let t = e;
|
|
141
|
+
for (; t; ) {
|
|
142
|
+
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
143
|
+
const n = t;
|
|
144
|
+
if (n.tagName === "SPAN" && n.style.fontFamily)
|
|
145
|
+
return n;
|
|
146
|
+
}
|
|
147
|
+
t = t.parentNode;
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
function F(e, t) {
|
|
152
|
+
const n = e.startContainer, r = e.endContainer, a = t.contains(n) || n.nodeType === Node.TEXT_NODE && n.parentElement === t, l = t.contains(r) || r.nodeType === Node.TEXT_NODE && r.parentElement === t;
|
|
153
|
+
return a && l;
|
|
154
|
+
}
|
|
155
|
+
export {
|
|
156
|
+
E as FontFamilyPlugin
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=FontFamilyPlugin.native-j8hMTbg4.mjs.map
|