@editora/core 1.0.6 → 1.0.8
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/LICENSE +21 -0
- package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
- package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
- package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
- package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
- package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
- package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
- package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
- package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
- package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
- package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
- package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
- package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
- package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
- package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
- package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
- package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
- package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
- package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
- package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
- package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
- package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +86 -77
- package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
- package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
- package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
- package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
- package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
- package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
- package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
- package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
- package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
- package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
- package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
- package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
- package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
- package/dist/editora.min.js +13 -13
- package/dist/editora.umd.js +13 -13
- package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
- package/dist/index-BslAFzmv.mjs +16544 -0
- package/dist/index-D1LOqg5C.js +10 -0
- package/dist/{index-OwnkG39N.mjs → index-DqC57IEH.mjs} +438 -328
- package/dist/index.cjs.js +1 -1
- package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
- package/dist/index.esm.js +2 -2
- package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
- package/dist/plugin-loader.js +77 -40
- package/dist/webcomponent-core.js +456 -346
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +87 -107
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +503 -356
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +6003 -658
- package/package.json +2 -2
- package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
- package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
- package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
- package/dist/documentManager-irzj9n3V.mjs +0 -37627
- package/dist/index-CqWQFb3D.js +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p = {
|
|
2
2
|
all: {
|
|
3
3
|
name: "All",
|
|
4
4
|
emojis: [
|
|
@@ -540,7 +540,7 @@ const d = {
|
|
|
540
540
|
"🇳🇿"
|
|
541
541
|
]
|
|
542
542
|
}
|
|
543
|
-
},
|
|
543
|
+
}, w = {
|
|
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 g = null, s = "all", u = "", n = null, l = null, d = null;
|
|
692
|
+
const y = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => ({
|
|
693
693
|
name: "emojis",
|
|
694
694
|
toolbar: [
|
|
695
695
|
{
|
|
@@ -701,17 +701,17 @@ const h = '[data-theme="dark"], .dark, .editora-theme-dark', E = () => ({
|
|
|
701
701
|
}
|
|
702
702
|
],
|
|
703
703
|
commands: {
|
|
704
|
-
openEmojiDialog: (r,
|
|
705
|
-
const e = (
|
|
706
|
-
return e ? (
|
|
704
|
+
openEmojiDialog: (r, t) => {
|
|
705
|
+
const e = (t == null ? void 0 : t.contentElement) || b();
|
|
706
|
+
return e ? (E(e), !0) : !1;
|
|
707
707
|
},
|
|
708
|
-
insertEmoji: (r,
|
|
708
|
+
insertEmoji: (r, t) => {
|
|
709
709
|
if (!r) return !1;
|
|
710
|
-
const e = (
|
|
710
|
+
const e = (t == null ? void 0 : t.contentElement) || b();
|
|
711
711
|
if (!e) return !1;
|
|
712
712
|
try {
|
|
713
|
-
return
|
|
714
|
-
} catch (
|
|
713
|
+
return k(r, e), !0;
|
|
714
|
+
} catch (o) {
|
|
715
715
|
return !1;
|
|
716
716
|
}
|
|
717
717
|
}
|
|
@@ -720,25 +720,25 @@ const h = '[data-theme="dark"], .dark, .editora-theme-dark', E = () => ({
|
|
|
720
720
|
"Mod-Shift-j": "openEmojiDialog"
|
|
721
721
|
}
|
|
722
722
|
});
|
|
723
|
-
function
|
|
724
|
-
|
|
725
|
-
const
|
|
726
|
-
|
|
723
|
+
function E(r) {
|
|
724
|
+
m(), s = "all", u = "";
|
|
725
|
+
const t = window.getSelection();
|
|
726
|
+
l = null, t && t.rangeCount > 0 && r.contains(t.anchorNode) && (l = t.getRangeAt(0).cloneRange());
|
|
727
727
|
const e = document.createElement("div");
|
|
728
|
-
e.className = "emojis-overlay",
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
|
|
728
|
+
e.className = "emojis-overlay", A(r) && e.classList.add("rte-ui-theme-dark"), e.onclick = m;
|
|
729
|
+
const o = document.createElement("div");
|
|
730
|
+
o.className = "emojis-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.onclick = (i) => i.stopPropagation();
|
|
731
|
+
const a = Object.keys(p);
|
|
732
|
+
o.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
|
-
${
|
|
740
|
-
<button class="emojis-tab ${
|
|
741
|
-
${
|
|
739
|
+
${a.map((i) => `
|
|
740
|
+
<button class="emojis-tab ${i === s ? "active" : ""}" data-category="${i}">
|
|
741
|
+
${p[i].name}
|
|
742
742
|
</button>
|
|
743
743
|
`).join("")}
|
|
744
744
|
</div>
|
|
@@ -756,82 +756,88 @@ function v(r) {
|
|
|
756
756
|
/>
|
|
757
757
|
</div>
|
|
758
758
|
<div class="emojis-grid" id="emojis-grid">
|
|
759
|
-
${
|
|
759
|
+
${x(s, u)}
|
|
760
760
|
</div>
|
|
761
761
|
</div>
|
|
762
762
|
</div>
|
|
763
|
-
`, e.appendChild(
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
763
|
+
`, e.appendChild(o), document.body.appendChild(e), g = e, d = (i) => {
|
|
764
|
+
i.key === "Escape" && (i.preventDefault(), i.stopPropagation(), m());
|
|
765
|
+
}, document.addEventListener("keydown", d, !0), z(o, r), L(), requestAnimationFrame(() => {
|
|
766
|
+
var i;
|
|
767
|
+
(i = o.querySelector("#emoji-search-input")) == null || i.focus();
|
|
768
|
+
});
|
|
767
769
|
}
|
|
768
|
-
function
|
|
769
|
-
var
|
|
770
|
-
(
|
|
771
|
-
i.addEventListener("click", (
|
|
772
|
-
const
|
|
773
|
-
|
|
770
|
+
function z(r, t) {
|
|
771
|
+
var a;
|
|
772
|
+
(a = r.querySelector(".emojis-close")) == null || a.addEventListener("click", m), r.querySelectorAll(".emojis-tab").forEach((i) => {
|
|
773
|
+
i.addEventListener("click", (f) => {
|
|
774
|
+
const c = f.target.getAttribute("data-category");
|
|
775
|
+
c && S(r, c);
|
|
774
776
|
});
|
|
775
777
|
});
|
|
776
778
|
const e = r.querySelector("#emoji-search-input");
|
|
777
779
|
e == null || e.addEventListener("input", (i) => {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
+
u = i.target.value, n !== null && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
781
|
+
n = null, v(r);
|
|
782
|
+
}, 90);
|
|
783
|
+
});
|
|
784
|
+
const o = r.querySelector("#emojis-grid");
|
|
785
|
+
o == null || o.addEventListener("click", (i) => {
|
|
786
|
+
var j;
|
|
787
|
+
const c = i.target.closest(".emojis-item");
|
|
788
|
+
if (!c) return;
|
|
789
|
+
const h = c.getAttribute("data-emoji") || ((j = c.textContent) == null ? void 0 : j.trim()) || "";
|
|
790
|
+
h && (k(h, t), m());
|
|
791
|
+
});
|
|
780
792
|
}
|
|
781
|
-
function
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}),
|
|
793
|
+
function S(r, t) {
|
|
794
|
+
s = t, r.querySelectorAll(".emojis-tab").forEach((e) => {
|
|
795
|
+
e.classList.toggle("active", e.getAttribute("data-category") === t);
|
|
796
|
+
}), v(r);
|
|
785
797
|
}
|
|
786
|
-
function
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
t.addEventListener("click", () => {
|
|
790
|
-
var a;
|
|
791
|
-
const i = ((a = t.textContent) == null ? void 0 : a.trim()) || "";
|
|
792
|
-
i && (p(i, o), g());
|
|
793
|
-
});
|
|
794
|
-
}));
|
|
798
|
+
function v(r) {
|
|
799
|
+
const t = r.querySelector("#emojis-grid");
|
|
800
|
+
t && (t.innerHTML = x(s, u));
|
|
795
801
|
}
|
|
796
|
-
function
|
|
797
|
-
let e =
|
|
798
|
-
return
|
|
802
|
+
function x(r, t) {
|
|
803
|
+
let e = p[r].emojis;
|
|
804
|
+
return t.trim() && (e = e.filter((o) => o.toLowerCase().includes(t.toLowerCase()) ? !0 : (w[o] || "").toLowerCase().includes(t.toLowerCase()))), e.length === 0 && t.trim() ? `<div class="emojis-no-results">No emojis found for "${t}"</div>` : e.map((o, a) => `
|
|
799
805
|
<button
|
|
800
806
|
class="emojis-item"
|
|
801
|
-
title="Insert ${
|
|
802
|
-
data-emoji="${
|
|
807
|
+
title="Insert ${o}"
|
|
808
|
+
data-emoji="${o}"
|
|
803
809
|
>
|
|
804
|
-
${
|
|
810
|
+
${o}
|
|
805
811
|
</button>
|
|
806
812
|
`).join("");
|
|
807
813
|
}
|
|
808
|
-
function
|
|
809
|
-
|
|
814
|
+
function m() {
|
|
815
|
+
d && (document.removeEventListener("keydown", d, !0), d = null), n !== null && (window.clearTimeout(n), n = null), g && (g.remove(), g = null);
|
|
810
816
|
}
|
|
811
|
-
function
|
|
812
|
-
|
|
817
|
+
function k(r, t) {
|
|
818
|
+
t.focus();
|
|
813
819
|
let e = window.getSelection();
|
|
814
|
-
if (
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
|
|
820
|
+
if (l && (e == null || e.removeAllRanges(), e == null || e.addRange(l), l = null), e = window.getSelection(), e && e.rangeCount > 0) {
|
|
821
|
+
const o = e.getRangeAt(0);
|
|
822
|
+
o.deleteContents();
|
|
823
|
+
const a = document.createTextNode(r);
|
|
824
|
+
o.insertNode(a), o.setStartAfter(a), o.setEndAfter(a), e.removeAllRanges(), e.addRange(o);
|
|
819
825
|
}
|
|
820
826
|
}
|
|
821
|
-
function
|
|
827
|
+
function b() {
|
|
822
828
|
const r = window.getSelection();
|
|
823
829
|
if (r && r.rangeCount > 0) {
|
|
824
|
-
const e = r.anchorNode,
|
|
825
|
-
if (
|
|
830
|
+
const e = r.anchorNode, o = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement, a = o == null ? void 0 : o.closest(".editora-content, .rte-content");
|
|
831
|
+
if (a) return a;
|
|
826
832
|
}
|
|
827
|
-
const
|
|
828
|
-
return
|
|
833
|
+
const t = document.activeElement;
|
|
834
|
+
return t && (t.classList.contains("editora-content") || t.classList.contains("rte-content")) ? t : document.querySelector(".editora-content, .rte-content");
|
|
829
835
|
}
|
|
830
|
-
function
|
|
831
|
-
const
|
|
832
|
-
return
|
|
836
|
+
function A(r) {
|
|
837
|
+
const t = r || b();
|
|
838
|
+
return t ? !!t.closest(y) : !1;
|
|
833
839
|
}
|
|
834
|
-
function
|
|
840
|
+
function L() {
|
|
835
841
|
if (document.getElementById("emojis-dialog-styles")) return;
|
|
836
842
|
const r = document.createElement("style");
|
|
837
843
|
r.id = "emojis-dialog-styles", r.textContent = `
|
|
@@ -846,6 +852,26 @@ function k() {
|
|
|
846
852
|
--rte-emoji-accent: #1f75fe;
|
|
847
853
|
--rte-emoji-accent-strong: #165fd6;
|
|
848
854
|
--rte-emoji-ring: rgba(31, 117, 254, 0.18);
|
|
855
|
+
--rte-picker-dialog-width: min(640px, 96vw);
|
|
856
|
+
--rte-picker-dialog-max-height: min(560px, 86vh);
|
|
857
|
+
--rte-picker-dialog-radius: 12px;
|
|
858
|
+
--rte-picker-search-wrap-padding: 12px;
|
|
859
|
+
--rte-picker-search-height: 38px;
|
|
860
|
+
--rte-picker-search-font-size: 13px;
|
|
861
|
+
--rte-picker-search-radius: 8px;
|
|
862
|
+
--rte-picker-tabs-width: 156px;
|
|
863
|
+
--rte-picker-tab-padding-y: 10px;
|
|
864
|
+
--rte-picker-tab-padding-x: 12px;
|
|
865
|
+
--rte-picker-tab-font-size: 13px;
|
|
866
|
+
--rte-picker-grid-padding: 12px;
|
|
867
|
+
--rte-picker-grid-gap: 6px;
|
|
868
|
+
--rte-picker-cell-size: 34px;
|
|
869
|
+
--rte-picker-cell-font-size: 17px;
|
|
870
|
+
--rte-picker-cell-radius: 7px;
|
|
871
|
+
--rte-picker-mobile-tab-min-width: 82px;
|
|
872
|
+
--rte-picker-mobile-cell-size: 32px;
|
|
873
|
+
--rte-picker-mobile-grid-gap: 5px;
|
|
874
|
+
--rte-picker-mobile-dialog-max-height: 88vh;
|
|
849
875
|
position: fixed;
|
|
850
876
|
top: 0;
|
|
851
877
|
left: 0;
|
|
@@ -856,7 +882,7 @@ function k() {
|
|
|
856
882
|
display: flex;
|
|
857
883
|
align-items: center;
|
|
858
884
|
justify-content: center;
|
|
859
|
-
z-index:
|
|
885
|
+
z-index: 10000;
|
|
860
886
|
padding: 16px;
|
|
861
887
|
box-sizing: border-box;
|
|
862
888
|
}
|
|
@@ -878,11 +904,10 @@ function k() {
|
|
|
878
904
|
background: var(--rte-emoji-dialog-bg);
|
|
879
905
|
color: var(--rte-emoji-dialog-text);
|
|
880
906
|
border: 1px solid var(--rte-emoji-border);
|
|
881
|
-
border-radius:
|
|
907
|
+
border-radius: var(--rte-picker-dialog-radius);
|
|
882
908
|
box-shadow: 0 24px 48px rgba(10, 15, 24, 0.28);
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
max-height: 80vh;
|
|
909
|
+
width: var(--rte-picker-dialog-width);
|
|
910
|
+
max-height: var(--rte-picker-dialog-max-height);
|
|
886
911
|
display: flex;
|
|
887
912
|
flex-direction: column;
|
|
888
913
|
overflow: hidden;
|
|
@@ -920,31 +945,34 @@ function k() {
|
|
|
920
945
|
display: flex;
|
|
921
946
|
flex-direction: column;
|
|
922
947
|
overflow: hidden;
|
|
948
|
+
min-width: 0;
|
|
923
949
|
}
|
|
924
950
|
|
|
925
951
|
.emojis-search {
|
|
926
|
-
padding:
|
|
952
|
+
padding: var(--rte-picker-search-wrap-padding) var(--rte-picker-search-wrap-padding) 0 var(--rte-picker-search-wrap-padding);
|
|
927
953
|
position: relative;
|
|
928
954
|
}
|
|
929
955
|
|
|
930
956
|
.emojis-search-icon {
|
|
931
957
|
position: absolute;
|
|
932
|
-
left:
|
|
933
|
-
top:
|
|
958
|
+
left: 24px;
|
|
959
|
+
top: 22px;
|
|
934
960
|
color: var(--rte-emoji-muted-text);
|
|
935
961
|
pointer-events: none;
|
|
936
962
|
z-index: 1;
|
|
937
963
|
}
|
|
938
964
|
|
|
939
965
|
.emojis-search-input {
|
|
940
|
-
width:
|
|
941
|
-
|
|
966
|
+
width: 100%;
|
|
967
|
+
height: var(--rte-picker-search-height);
|
|
968
|
+
padding: 8px 12px 8px 36px;
|
|
942
969
|
border: 1px solid var(--rte-emoji-border);
|
|
943
|
-
border-radius:
|
|
944
|
-
font-size:
|
|
970
|
+
border-radius: var(--rte-picker-search-radius);
|
|
971
|
+
font-size: var(--rte-picker-search-font-size);
|
|
945
972
|
color: var(--rte-emoji-dialog-text);
|
|
946
973
|
background-color: var(--rte-emoji-subtle-bg);
|
|
947
974
|
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
|
975
|
+
box-sizing: border-box;
|
|
948
976
|
}
|
|
949
977
|
|
|
950
978
|
.emojis-search-input:focus {
|
|
@@ -964,21 +992,23 @@ function k() {
|
|
|
964
992
|
.emojis-tabs {
|
|
965
993
|
display: flex;
|
|
966
994
|
flex-direction: column;
|
|
967
|
-
width:
|
|
995
|
+
width: var(--rte-picker-tabs-width);
|
|
968
996
|
border-right: 1px solid var(--rte-emoji-border);
|
|
969
997
|
background-color: var(--rte-emoji-subtle-bg);
|
|
998
|
+
overflow-y: auto;
|
|
970
999
|
}
|
|
971
1000
|
|
|
972
1001
|
.emojis-tab {
|
|
973
|
-
padding:
|
|
1002
|
+
padding: var(--rte-picker-tab-padding-y) var(--rte-picker-tab-padding-x);
|
|
974
1003
|
border: none;
|
|
975
1004
|
background: none;
|
|
976
1005
|
text-align: left;
|
|
977
1006
|
cursor: pointer;
|
|
978
|
-
font-size:
|
|
1007
|
+
font-size: var(--rte-picker-tab-font-size);
|
|
979
1008
|
color: var(--rte-emoji-muted-text);
|
|
980
1009
|
border-bottom: 1px solid var(--rte-emoji-border);
|
|
981
1010
|
transition: all 0.2s ease;
|
|
1011
|
+
line-height: 1.25;
|
|
982
1012
|
}
|
|
983
1013
|
|
|
984
1014
|
.emojis-tab:hover {
|
|
@@ -997,24 +1027,25 @@ function k() {
|
|
|
997
1027
|
}
|
|
998
1028
|
|
|
999
1029
|
.emojis-grid {
|
|
1000
|
-
padding:
|
|
1030
|
+
padding: var(--rte-picker-grid-padding);
|
|
1001
1031
|
overflow-y: auto;
|
|
1002
1032
|
display: grid;
|
|
1003
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
1004
|
-
gap:
|
|
1033
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-cell-size), 1fr));
|
|
1034
|
+
gap: var(--rte-picker-grid-gap);
|
|
1035
|
+
contain: content;
|
|
1005
1036
|
}
|
|
1006
1037
|
|
|
1007
1038
|
.emojis-item {
|
|
1008
|
-
width:
|
|
1009
|
-
height:
|
|
1039
|
+
width: var(--rte-picker-cell-size);
|
|
1040
|
+
height: var(--rte-picker-cell-size);
|
|
1010
1041
|
display: flex;
|
|
1011
1042
|
align-items: center;
|
|
1012
1043
|
justify-content: center;
|
|
1013
1044
|
border: 1px solid var(--rte-emoji-border);
|
|
1014
1045
|
background: var(--rte-emoji-subtle-bg);
|
|
1015
|
-
border-radius:
|
|
1046
|
+
border-radius: var(--rte-picker-cell-radius);
|
|
1016
1047
|
cursor: pointer;
|
|
1017
|
-
font-size:
|
|
1048
|
+
font-size: var(--rte-picker-cell-font-size);
|
|
1018
1049
|
transition: all 0.2s ease;
|
|
1019
1050
|
color: var(--rte-emoji-dialog-text);
|
|
1020
1051
|
}
|
|
@@ -1044,8 +1075,8 @@ function k() {
|
|
|
1044
1075
|
/* Responsive design */
|
|
1045
1076
|
@media (max-width: 768px) {
|
|
1046
1077
|
.emojis-dialog {
|
|
1047
|
-
width:
|
|
1048
|
-
max-height:
|
|
1078
|
+
width: 96%;
|
|
1079
|
+
max-height: var(--rte-picker-mobile-dialog-max-height);
|
|
1049
1080
|
}
|
|
1050
1081
|
|
|
1051
1082
|
.emojis-content {
|
|
@@ -1064,23 +1095,23 @@ function k() {
|
|
|
1064
1095
|
border-bottom: none;
|
|
1065
1096
|
border-right: 1px solid var(--rte-emoji-border);
|
|
1066
1097
|
white-space: nowrap;
|
|
1067
|
-
min-width:
|
|
1098
|
+
min-width: var(--rte-picker-mobile-tab-min-width);
|
|
1068
1099
|
}
|
|
1069
1100
|
|
|
1070
1101
|
.emojis-grid {
|
|
1071
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
1072
|
-
gap:
|
|
1102
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--rte-picker-mobile-cell-size), 1fr));
|
|
1103
|
+
gap: var(--rte-picker-mobile-grid-gap);
|
|
1073
1104
|
}
|
|
1074
1105
|
|
|
1075
1106
|
.emojis-item {
|
|
1076
|
-
width:
|
|
1077
|
-
height:
|
|
1107
|
+
width: var(--rte-picker-mobile-cell-size);
|
|
1108
|
+
height: var(--rte-picker-mobile-cell-size);
|
|
1078
1109
|
font-size: 16px;
|
|
1079
1110
|
}
|
|
1080
1111
|
}
|
|
1081
1112
|
`, document.head.appendChild(r);
|
|
1082
1113
|
}
|
|
1083
1114
|
export {
|
|
1084
|
-
|
|
1115
|
+
C as EmojisPlugin
|
|
1085
1116
|
};
|
|
1086
|
-
//# sourceMappingURL=EmojisPlugin.native-
|
|
1117
|
+
//# sourceMappingURL=EmojisPlugin.native-CitxxlWX.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
let a = null,
|
|
2
|
-
const
|
|
1
|
+
let a = null, u = !1, l = null;
|
|
2
|
+
const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
|
|
3
3
|
if (!e) return null;
|
|
4
4
|
let t = e;
|
|
5
5
|
for (; t; ) {
|
|
@@ -8,14 +8,14 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
8
8
|
t = t.parentElement;
|
|
9
9
|
}
|
|
10
10
|
return null;
|
|
11
|
-
},
|
|
11
|
+
}, C = (e) => {
|
|
12
12
|
if (e) {
|
|
13
13
|
const o = e.startContainer, n = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement;
|
|
14
|
-
if (n != null && n.closest(
|
|
14
|
+
if (n != null && n.closest(p)) return !0;
|
|
15
15
|
}
|
|
16
16
|
const t = document.activeElement;
|
|
17
|
-
return t != null && t.closest(
|
|
18
|
-
},
|
|
17
|
+
return t != null && t.closest(p) ? !0 : document.body.matches(p) || document.documentElement.matches(p);
|
|
18
|
+
}, T = () => {
|
|
19
19
|
if (document.getElementById("rte-link-dialog-theme-styles")) return;
|
|
20
20
|
const e = document.createElement("style");
|
|
21
21
|
e.id = "rte-link-dialog-theme-styles", e.textContent = `
|
|
@@ -82,29 +82,29 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
82
82
|
background: #2563eb !important;
|
|
83
83
|
}
|
|
84
84
|
`, document.head.appendChild(e);
|
|
85
|
-
},
|
|
85
|
+
}, A = (e) => {
|
|
86
86
|
if (!a) {
|
|
87
87
|
console.warn("No selection range stored");
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
const t = a.startContainer, o = t.nodeType === Node.TEXT_NODE ? t.parentElement : t, n =
|
|
90
|
+
const t = a.startContainer, o = t.nodeType === Node.TEXT_NODE ? t.parentElement : t, n = w(o);
|
|
91
91
|
if (n) {
|
|
92
|
-
if (
|
|
93
|
-
|
|
92
|
+
if (u && l) {
|
|
93
|
+
l.href = e.url, l.textContent = e.text, l.target = e.target, e.target === "_blank" ? l.setAttribute("rel", "noopener noreferrer") : l.removeAttribute("rel"), e.title ? l.title = e.title : l.removeAttribute("title");
|
|
94
94
|
const r = document.createRange();
|
|
95
|
-
r.selectNodeContents(
|
|
96
|
-
const
|
|
97
|
-
|
|
95
|
+
r.selectNodeContents(l);
|
|
96
|
+
const i = window.getSelection();
|
|
97
|
+
i && (i.removeAllRanges(), i.addRange(r));
|
|
98
98
|
} else {
|
|
99
99
|
const r = document.createElement("a");
|
|
100
100
|
r.href = e.url, r.textContent = e.text, r.target = e.target, e.target === "_blank" && r.setAttribute("rel", "noopener noreferrer"), e.title && (r.title = e.title), a.deleteContents(), a.insertNode(r), a.setStartAfter(r), a.setEndAfter(r);
|
|
101
|
-
const
|
|
102
|
-
|
|
101
|
+
const i = window.getSelection();
|
|
102
|
+
i && (i.removeAllRanges(), i.addRange(a));
|
|
103
103
|
}
|
|
104
|
-
n.focus(), a = null,
|
|
104
|
+
n.focus(), a = null, u = !1, l = null;
|
|
105
105
|
}
|
|
106
|
-
},
|
|
107
|
-
|
|
106
|
+
}, k = (e, t) => {
|
|
107
|
+
T();
|
|
108
108
|
const o = document.createElement("div");
|
|
109
109
|
o.className = "link-dialog-overlay", t && o.classList.add("rte-theme-dark"), o.style.cssText = `
|
|
110
110
|
position: fixed;
|
|
@@ -139,7 +139,7 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
139
139
|
type="text"
|
|
140
140
|
value="${e.text || ""}"
|
|
141
141
|
placeholder="Enter link text"
|
|
142
|
-
style="width: 100%; padding:
|
|
142
|
+
style="width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; line-height: 1.45; box-sizing: border-box;"
|
|
143
143
|
/>
|
|
144
144
|
</div>
|
|
145
145
|
<div class="form-group" style="margin-bottom: 16px;">
|
|
@@ -150,7 +150,7 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
150
150
|
value="${e.url || ""}"
|
|
151
151
|
placeholder="https://example.com"
|
|
152
152
|
required
|
|
153
|
-
style="width: 100%; padding:
|
|
153
|
+
style="width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; line-height: 1.45; box-sizing: border-box;"
|
|
154
154
|
/>
|
|
155
155
|
</div>
|
|
156
156
|
<div class="form-group" style="margin-bottom: 16px;">
|
|
@@ -160,7 +160,7 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
160
160
|
type="text"
|
|
161
161
|
value="${e.title || ""}"
|
|
162
162
|
placeholder="Link tooltip text"
|
|
163
|
-
style="width: 100%; padding:
|
|
163
|
+
style="width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; line-height: 1.45; box-sizing: border-box;"
|
|
164
164
|
/>
|
|
165
165
|
</div>
|
|
166
166
|
<div class="form-group" style="margin-bottom: 0;">
|
|
@@ -183,34 +183,36 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
183
183
|
</div>
|
|
184
184
|
</form>
|
|
185
185
|
`, o.appendChild(n), document.body.appendChild(o);
|
|
186
|
-
const r = n.querySelector("#link-form"),
|
|
187
|
-
|
|
186
|
+
const r = n.querySelector("#link-form"), i = n.querySelector("#link-text"), d = n.querySelector("#link-url"), y = n.querySelector("#link-title"), v = n.querySelector("#link-target"), E = n.querySelector(".link-dialog-close"), L = n.querySelector(".btn-cancel"), b = (s) => {
|
|
187
|
+
s.key === "Escape" && (s.preventDefault(), s.stopPropagation(), c());
|
|
188
|
+
}, c = () => {
|
|
189
|
+
document.removeEventListener("keydown", b, !0), o.remove();
|
|
188
190
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}), r.addEventListener("submit", (
|
|
192
|
-
|
|
191
|
+
E.addEventListener("click", c), L.addEventListener("click", c), o.addEventListener("click", (s) => {
|
|
192
|
+
s.target === o && c();
|
|
193
|
+
}), document.addEventListener("keydown", b, !0), r.addEventListener("submit", (s) => {
|
|
194
|
+
s.preventDefault();
|
|
193
195
|
const g = d.value.trim();
|
|
194
|
-
g && (
|
|
195
|
-
text:
|
|
196
|
+
g && (A({
|
|
197
|
+
text: i.value.trim() || g,
|
|
196
198
|
url: g,
|
|
197
|
-
target:
|
|
198
|
-
title:
|
|
199
|
-
}),
|
|
200
|
-
}), setTimeout(() =>
|
|
201
|
-
},
|
|
199
|
+
target: v.checked ? "_blank" : "_self",
|
|
200
|
+
title: y.value.trim() || void 0
|
|
201
|
+
}), c());
|
|
202
|
+
}), setTimeout(() => i.focus(), 100);
|
|
203
|
+
}, x = () => {
|
|
202
204
|
const e = window.getSelection();
|
|
203
205
|
if (!e || e.rangeCount === 0) return !1;
|
|
204
206
|
const t = e.getRangeAt(0).cloneRange();
|
|
205
207
|
a = t;
|
|
206
|
-
const o =
|
|
207
|
-
return d ? (
|
|
208
|
+
const o = C(t), n = e.toString() || "", r = t.startContainer, i = r.nodeType === Node.TEXT_NODE ? r.parentElement : r, d = i == null ? void 0 : i.closest("a");
|
|
209
|
+
return d ? (u = !0, l = d, k({
|
|
208
210
|
text: d.textContent || "",
|
|
209
211
|
url: d.href,
|
|
210
212
|
target: d.target || "_self",
|
|
211
213
|
title: d.title || "",
|
|
212
214
|
isEditing: !0
|
|
213
|
-
}, o)) : (
|
|
215
|
+
}, o)) : (u = !1, l = null, k({
|
|
214
216
|
text: n,
|
|
215
217
|
url: "",
|
|
216
218
|
target: "_self",
|
|
@@ -219,13 +221,13 @@ const c = '[data-theme="dark"], .dark, .editora-theme-dark', L = (e) => {
|
|
|
219
221
|
}, h = () => (document.execCommand("unlink", !1), !0), m = (e, t) => {
|
|
220
222
|
var o;
|
|
221
223
|
typeof window != "undefined" && ((o = window.registerEditorCommand) == null || o.call(window, e, t));
|
|
222
|
-
},
|
|
223
|
-
m("openLinkDialog",
|
|
224
|
+
}, f = () => {
|
|
225
|
+
m("openLinkDialog", x), m("removeLink", h), m("createLink", (e) => {
|
|
224
226
|
e && document.execCommand("createLink", !1, e);
|
|
225
227
|
});
|
|
226
228
|
};
|
|
227
|
-
typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
228
|
-
const
|
|
229
|
+
typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", f) : f());
|
|
230
|
+
const S = () => ({
|
|
229
231
|
name: "link",
|
|
230
232
|
marks: {
|
|
231
233
|
link: {
|
|
@@ -266,7 +268,7 @@ const A = () => ({
|
|
|
266
268
|
}
|
|
267
269
|
],
|
|
268
270
|
commands: {
|
|
269
|
-
openLinkDialog:
|
|
271
|
+
openLinkDialog: x,
|
|
270
272
|
removeLink: h
|
|
271
273
|
},
|
|
272
274
|
keymap: {
|
|
@@ -274,8 +276,8 @@ const A = () => ({
|
|
|
274
276
|
}
|
|
275
277
|
});
|
|
276
278
|
export {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
+
S as LinkPlugin,
|
|
280
|
+
x as openLinkDialog,
|
|
279
281
|
h as removeLink
|
|
280
282
|
};
|
|
281
|
-
//# sourceMappingURL=LinkPlugin.native-
|
|
283
|
+
//# sourceMappingURL=LinkPlugin.native-DYCIcdTm.mjs.map
|