@editora/core 1.0.15 → 1.0.17
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/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
- package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
- package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
- package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
- package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
- package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
- package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
- package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
- package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
- package/dist/{CodePlugin.native-knhM8NNo.mjs → CodePlugin.native-BH-K4xmW.mjs} +474 -342
- package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
- package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
- package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
- package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
- package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
- package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
- package/dist/{DocumentManagerPlugin.native-D1YHQ2NN.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
- package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
- package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
- package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
- package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
- package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
- package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
- package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
- package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
- package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
- package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
- package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
- package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
- package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
- package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
- package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
- package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
- package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
- package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
- package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
- package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
- package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
- package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
- package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
- package/dist/core.css +1 -1
- package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
- package/dist/editora.min.js +26 -24
- package/dist/editora.umd.js +26 -24
- package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
- package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
- package/dist/index-XsYC_KdJ.mjs +3923 -0
- package/dist/index-_eKRBZPq.js +12 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +17 -14
- package/dist/plugin-loader.js +53 -52
- package/dist/webcomponent-core.js +2055 -476
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +96 -66
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +2223 -643
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1564 -1198
- package/index.d.ts +32 -0
- package/package.json +10 -3
- package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
- package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
- package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
- package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
- package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
- package/dist/index-BLm1MtzH.js +0 -10
- package/dist/index-Cd9jEuZP.mjs +0 -2341
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { e as y } from "./escapeHtml-CX8RelZ1.mjs";
|
|
2
|
+
import { i as E } from "./dialogHelpers-DBf7WqYH.mjs";
|
|
3
|
+
import { r as z } from "./historyHelpers-B0-4mq1E.mjs";
|
|
1
4
|
const p = {
|
|
2
5
|
all: {
|
|
3
6
|
name: "All",
|
|
@@ -540,7 +543,7 @@ const p = {
|
|
|
540
543
|
"🇳🇿"
|
|
541
544
|
]
|
|
542
545
|
}
|
|
543
|
-
},
|
|
546
|
+
}, A = {
|
|
544
547
|
"💙": "blue heart",
|
|
545
548
|
"💚": "green heart",
|
|
546
549
|
"💛": "yellow heart",
|
|
@@ -581,7 +584,7 @@ const p = {
|
|
|
581
584
|
"😜": "winking face with tongue",
|
|
582
585
|
"😝": "squinting face with tongue",
|
|
583
586
|
"🤪": "zany face",
|
|
584
|
-
"😢": "crying face",
|
|
587
|
+
"😢": "crying face sad",
|
|
585
588
|
"😥": "sad but relieved face",
|
|
586
589
|
"😓": "downcast face with sweat",
|
|
587
590
|
"😱": "face screaming in fear",
|
|
@@ -686,10 +689,210 @@ const p = {
|
|
|
686
689
|
"🪜": "ladder",
|
|
687
690
|
"🪞": "mirror",
|
|
688
691
|
"🧹": "broom",
|
|
689
|
-
"🧸": "teddy bear"
|
|
692
|
+
"🧸": "teddy bear",
|
|
693
|
+
/* Symbols */
|
|
694
|
+
"❤️": "red heart love",
|
|
695
|
+
"💔": "broken heart",
|
|
696
|
+
"✔️": "check mark",
|
|
697
|
+
"❌": "cross mark",
|
|
698
|
+
"❗": "exclamation mark",
|
|
699
|
+
"❓": "question mark",
|
|
700
|
+
"⚠️": "warning",
|
|
701
|
+
"💯": "hundred points",
|
|
702
|
+
"➕": "plus sign",
|
|
703
|
+
"➖": "minus sign",
|
|
704
|
+
"✖️": "multiplication sign",
|
|
705
|
+
"➗": "division sign",
|
|
706
|
+
"♻️": "recycling symbol",
|
|
707
|
+
"⚡": "high voltage",
|
|
708
|
+
"🔥": "fire",
|
|
709
|
+
"✨": "sparkles",
|
|
710
|
+
"⭐": "star",
|
|
711
|
+
/* Faces */
|
|
712
|
+
"😀": "grinning face",
|
|
713
|
+
"😃": "grinning face with big eyes",
|
|
714
|
+
"😄": "grinning face with smiling eyes",
|
|
715
|
+
"😁": "beaming face with smiling eyes",
|
|
716
|
+
"😆": "grinning squinting face",
|
|
717
|
+
"😅": "grinning face with sweat",
|
|
718
|
+
"😂": "face with tears of joy lol",
|
|
719
|
+
"🤣": "rolling on the floor laughing lol",
|
|
720
|
+
"😊": "smiling face with smiling eyes smile happy",
|
|
721
|
+
"😇": "smiling face with halo",
|
|
722
|
+
"🙂": "slightly smiling face smile happy",
|
|
723
|
+
"🙃": "upside-down face",
|
|
724
|
+
"😉": "winking face",
|
|
725
|
+
"😍": "smiling face with heart-eyes love",
|
|
726
|
+
"😘": "face blowing a kiss",
|
|
727
|
+
"😎": "smiling face with sunglasses cool",
|
|
728
|
+
"🤓": "nerd face",
|
|
729
|
+
"🥳": "partying face",
|
|
730
|
+
"🤔": "thinking face",
|
|
731
|
+
"😴": "sleeping face",
|
|
732
|
+
"😭": "loudly crying face",
|
|
733
|
+
"😡": "pouting face angry",
|
|
734
|
+
"🤯": "exploding head",
|
|
735
|
+
"👍": "thumbs up",
|
|
736
|
+
"👎": "thumbs down",
|
|
737
|
+
"🙏": "folded hands",
|
|
738
|
+
"👏": "clapping hands",
|
|
739
|
+
/* Animals */
|
|
740
|
+
"🐶": "dog face",
|
|
741
|
+
"🐱": "cat face",
|
|
742
|
+
"🐭": "mouse face",
|
|
743
|
+
"🐹": "hamster",
|
|
744
|
+
"🐰": "rabbit face",
|
|
745
|
+
"🦊": "fox",
|
|
746
|
+
"🐻": "bear",
|
|
747
|
+
"🐼": "panda",
|
|
748
|
+
"🐨": "koala",
|
|
749
|
+
"🐯": "tiger face",
|
|
750
|
+
"🦁": "lion",
|
|
751
|
+
"🐮": "cow face",
|
|
752
|
+
"🐷": "pig face",
|
|
753
|
+
"🐸": "frog",
|
|
754
|
+
"🐵": "monkey face",
|
|
755
|
+
/* Nature */
|
|
756
|
+
"🌲": "evergreen tree",
|
|
757
|
+
"🌳": "deciduous tree",
|
|
758
|
+
"🌴": "palm tree",
|
|
759
|
+
"🌵": "cactus",
|
|
760
|
+
"🌸": "cherry blossom",
|
|
761
|
+
"🌼": "blossom",
|
|
762
|
+
"🌻": "sunflower",
|
|
763
|
+
"☀️": "sun",
|
|
764
|
+
"🌙": "crescent moon",
|
|
765
|
+
"🌈": "rainbow",
|
|
766
|
+
"🌧️": "cloud with rain",
|
|
767
|
+
/* Food & Drink */
|
|
768
|
+
"🍎": "red apple",
|
|
769
|
+
"🍌": "banana",
|
|
770
|
+
"🍉": "watermelon",
|
|
771
|
+
"🍇": "grapes",
|
|
772
|
+
"🍓": "strawberry",
|
|
773
|
+
"🍒": "cherries",
|
|
774
|
+
"🍍": "pineapple",
|
|
775
|
+
"🥭": "mango",
|
|
776
|
+
"🍔": "hamburger",
|
|
777
|
+
"🍟": "french fries",
|
|
778
|
+
"🍕": "pizza",
|
|
779
|
+
"🌭": "hot dog",
|
|
780
|
+
"🥪": "sandwich",
|
|
781
|
+
"🌮": "taco",
|
|
782
|
+
"🌯": "burrito",
|
|
783
|
+
"🍣": "sushi",
|
|
784
|
+
"🍜": "steaming bowl",
|
|
785
|
+
"🍰": "shortcake",
|
|
786
|
+
"🧁": "cupcake",
|
|
787
|
+
"🍩": "doughnut",
|
|
788
|
+
"🍪": "cookie",
|
|
789
|
+
"☕": "hot beverage",
|
|
790
|
+
"🍵": "teacup without handle",
|
|
791
|
+
"🥤": "cup with straw",
|
|
792
|
+
"🍺": "beer mug",
|
|
793
|
+
"🍷": "wine glass",
|
|
794
|
+
"🍸": "cocktail glass",
|
|
795
|
+
/* Activity */
|
|
796
|
+
"⚽": "soccer ball",
|
|
797
|
+
"🏀": "basketball",
|
|
798
|
+
"🏈": "american football",
|
|
799
|
+
"⚾": "baseball",
|
|
800
|
+
"🎾": "tennis",
|
|
801
|
+
"🏐": "volleyball",
|
|
802
|
+
"🏉": "rugby football",
|
|
803
|
+
"🎮": "video game",
|
|
804
|
+
"🎯": "direct hit",
|
|
805
|
+
"🎳": "bowling",
|
|
806
|
+
"🎲": "game die",
|
|
807
|
+
"♟️": "chess pawn",
|
|
808
|
+
"🏃": "person running",
|
|
809
|
+
"🚴": "person biking",
|
|
810
|
+
"🏊": "person swimming",
|
|
811
|
+
"🏋️": "person lifting weights",
|
|
812
|
+
"🧘": "person in lotus position",
|
|
813
|
+
"🎸": "guitar",
|
|
814
|
+
"🎹": "musical keyboard",
|
|
815
|
+
"🥁": "drum",
|
|
816
|
+
"🎺": "trumpet",
|
|
817
|
+
"🏆": "trophy",
|
|
818
|
+
"🥇": "gold medal",
|
|
819
|
+
"🥈": "silver medal",
|
|
820
|
+
"🥉": "bronze medal",
|
|
821
|
+
/* Travel & Places */
|
|
822
|
+
"🚗": "automobile",
|
|
823
|
+
"🚕": "taxi",
|
|
824
|
+
"🚌": "bus",
|
|
825
|
+
"🚎": "trolleybus",
|
|
826
|
+
"🚓": "police car",
|
|
827
|
+
"🚑": "ambulance",
|
|
828
|
+
"🚒": "fire engine",
|
|
829
|
+
"✈️": "airplane",
|
|
830
|
+
"🚀": "rocket",
|
|
831
|
+
"🚁": "helicopter",
|
|
832
|
+
"🚤": "speedboat",
|
|
833
|
+
"🛳️": "passenger ship",
|
|
834
|
+
"🚢": "ship",
|
|
835
|
+
"🏠": "house",
|
|
836
|
+
"🏢": "office building",
|
|
837
|
+
"🏬": "department store",
|
|
838
|
+
"🏫": "school",
|
|
839
|
+
"🏥": "hospital",
|
|
840
|
+
"🏰": "castle",
|
|
841
|
+
"🗼": "tokyo tower",
|
|
842
|
+
"🗽": "statue of liberty",
|
|
843
|
+
"⛩️": "shinto shrine",
|
|
844
|
+
"🕌": "mosque",
|
|
845
|
+
"🌍": "globe showing europe-africa",
|
|
846
|
+
"🌎": "globe showing americas",
|
|
847
|
+
"🌏": "globe showing asia-australia",
|
|
848
|
+
"🏖️": "beach with umbrella",
|
|
849
|
+
"🏝️": "desert island",
|
|
850
|
+
/* Objects */
|
|
851
|
+
"📱": "mobile phone",
|
|
852
|
+
"💻": "laptop",
|
|
853
|
+
"🖥️": "desktop computer",
|
|
854
|
+
"⌨️": "keyboard",
|
|
855
|
+
"🖱️": "computer mouse",
|
|
856
|
+
"📷": "camera",
|
|
857
|
+
"📸": "camera with flash",
|
|
858
|
+
"🎥": "movie camera",
|
|
859
|
+
"📹": "video camera",
|
|
860
|
+
"📚": "books",
|
|
861
|
+
"📖": "open book",
|
|
862
|
+
"📝": "memo",
|
|
863
|
+
"📄": "page facing up",
|
|
864
|
+
"📂": "open file folder",
|
|
865
|
+
"🔒": "locked",
|
|
866
|
+
"🔑": "key",
|
|
867
|
+
"🗝️": "old key",
|
|
868
|
+
"💡": "light bulb",
|
|
869
|
+
"🔦": "flashlight",
|
|
870
|
+
"🕯️": "candle",
|
|
871
|
+
"🧰": "toolbox",
|
|
872
|
+
"🛠️": "hammer and wrench",
|
|
873
|
+
"🔧": "wrench",
|
|
874
|
+
"⚙️": "gear",
|
|
875
|
+
/* Flags */
|
|
876
|
+
"🇮🇳": "flag: india",
|
|
877
|
+
"🇺🇸": "flag: united states",
|
|
878
|
+
"🇬🇧": "flag: united kingdom",
|
|
879
|
+
"🇨🇦": "flag: canada",
|
|
880
|
+
"🇦🇺": "flag: australia",
|
|
881
|
+
"🇩🇪": "flag: germany",
|
|
882
|
+
"🇫🇷": "flag: france",
|
|
883
|
+
"🇪🇸": "flag: spain",
|
|
884
|
+
"🇮🇹": "flag: italy",
|
|
885
|
+
"🇯🇵": "flag: japan",
|
|
886
|
+
"🇰🇷": "flag: south korea",
|
|
887
|
+
"🇨🇳": "flag: china",
|
|
888
|
+
"🇧🇷": "flag: brazil",
|
|
889
|
+
"🇲🇽": "flag: mexico",
|
|
890
|
+
"🇷🇺": "flag: russia",
|
|
891
|
+
"🇿🇦": "flag: south africa",
|
|
892
|
+
"🇳🇿": "flag: new zealand"
|
|
690
893
|
};
|
|
691
|
-
let g = null,
|
|
692
|
-
const
|
|
894
|
+
let g = null, l = "all", u = "", n = null, c = null, d = null;
|
|
895
|
+
const S = '[data-theme="dark"], .dark, .editora-theme-dark', N = () => ({
|
|
693
896
|
name: "emojis",
|
|
694
897
|
toolbar: [
|
|
695
898
|
{
|
|
@@ -701,17 +904,17 @@ const y = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => ({
|
|
|
701
904
|
}
|
|
702
905
|
],
|
|
703
906
|
commands: {
|
|
704
|
-
openEmojiDialog: (r,
|
|
705
|
-
const
|
|
706
|
-
return
|
|
907
|
+
openEmojiDialog: (r, e) => {
|
|
908
|
+
const t = (e == null ? void 0 : e.contentElement) || b();
|
|
909
|
+
return t && !f(t) ? (L(t), !0) : !1;
|
|
707
910
|
},
|
|
708
|
-
insertEmoji: (r,
|
|
911
|
+
insertEmoji: (r, e) => {
|
|
709
912
|
if (!r) return !1;
|
|
710
|
-
const
|
|
711
|
-
if (!
|
|
913
|
+
const t = (e == null ? void 0 : e.contentElement) || b();
|
|
914
|
+
if (!t || f(t)) return !1;
|
|
712
915
|
try {
|
|
713
|
-
return
|
|
714
|
-
} catch (
|
|
916
|
+
return x(r, t), !0;
|
|
917
|
+
} catch (i) {
|
|
715
918
|
return !1;
|
|
716
919
|
}
|
|
717
920
|
}
|
|
@@ -720,25 +923,25 @@ const y = '[data-theme="dark"], .dark, .editora-theme-dark', C = () => ({
|
|
|
720
923
|
"Mod-Shift-j": "openEmojiDialog"
|
|
721
924
|
}
|
|
722
925
|
});
|
|
723
|
-
function
|
|
724
|
-
m(),
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
|
|
926
|
+
function L(r) {
|
|
927
|
+
m(), l = "all", u = "";
|
|
928
|
+
const e = window.getSelection();
|
|
929
|
+
c = null, e && e.rangeCount > 0 && r.contains(e.anchorNode) && (c = e.getRangeAt(0).cloneRange());
|
|
930
|
+
const t = document.createElement("div");
|
|
931
|
+
E(t), t.className = "emojis-overlay", q(r) && t.classList.add("rte-ui-theme-dark"), t.onclick = m;
|
|
932
|
+
const i = document.createElement("div");
|
|
933
|
+
i.className = "emojis-dialog", i.setAttribute("role", "dialog"), i.setAttribute("aria-modal", "true"), i.onclick = (o) => o.stopPropagation();
|
|
731
934
|
const a = Object.keys(p);
|
|
732
|
-
|
|
935
|
+
i.innerHTML = `
|
|
733
936
|
<div class="rte-dialog-header emojis-header">
|
|
734
937
|
<h3>Insert Emojis</h3>
|
|
735
938
|
<button class="rte-dialog-close emojis-close">×</button>
|
|
736
939
|
</div>
|
|
737
940
|
<div class="rte-dialog-body emojis-content">
|
|
738
941
|
<div class="emojis-tabs">
|
|
739
|
-
${a.map((
|
|
740
|
-
<button class="emojis-tab ${
|
|
741
|
-
${p[
|
|
942
|
+
${a.map((o) => `
|
|
943
|
+
<button class="emojis-tab ${o === l ? "active" : ""}" data-category="${o}">
|
|
944
|
+
${p[o].name}
|
|
742
945
|
</button>
|
|
743
946
|
`).join("")}
|
|
744
947
|
</div>
|
|
@@ -756,88 +959,94 @@ function E(r) {
|
|
|
756
959
|
/>
|
|
757
960
|
</div>
|
|
758
961
|
<div class="emojis-grid" id="emojis-grid">
|
|
759
|
-
${
|
|
962
|
+
${k(l, u)}
|
|
760
963
|
</div>
|
|
761
964
|
</div>
|
|
762
965
|
</div>
|
|
763
|
-
`,
|
|
764
|
-
|
|
765
|
-
}, document.addEventListener("keydown", d, !0),
|
|
766
|
-
var
|
|
767
|
-
(
|
|
966
|
+
`, t.appendChild(i), document.body.appendChild(t), g = t, d = (o) => {
|
|
967
|
+
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), m());
|
|
968
|
+
}, document.addEventListener("keydown", d, !0), T(i, r), C(), requestAnimationFrame(() => {
|
|
969
|
+
var o;
|
|
970
|
+
(o = i.querySelector("#emoji-search-input")) == null || o.focus();
|
|
768
971
|
});
|
|
769
972
|
}
|
|
770
|
-
function
|
|
973
|
+
function T(r, e) {
|
|
771
974
|
var a;
|
|
772
|
-
(a = r.querySelector(".emojis-close")) == null || a.addEventListener("click", m), r.querySelectorAll(".emojis-tab").forEach((
|
|
773
|
-
|
|
774
|
-
const
|
|
775
|
-
|
|
975
|
+
(a = r.querySelector(".emojis-close")) == null || a.addEventListener("click", m), r.querySelectorAll(".emojis-tab").forEach((o) => {
|
|
976
|
+
o.addEventListener("click", (h) => {
|
|
977
|
+
const s = h.target.getAttribute("data-category");
|
|
978
|
+
s && D(r, s);
|
|
776
979
|
});
|
|
777
980
|
});
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
u =
|
|
781
|
-
n = null,
|
|
981
|
+
const t = r.querySelector("#emoji-search-input");
|
|
982
|
+
t == null || t.addEventListener("input", (o) => {
|
|
983
|
+
u = o.target.value, n !== null && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
984
|
+
n = null, w(r);
|
|
782
985
|
}, 90);
|
|
783
986
|
});
|
|
784
|
-
const
|
|
785
|
-
|
|
987
|
+
const i = r.querySelector("#emojis-grid");
|
|
988
|
+
i == null || i.addEventListener("click", (o) => {
|
|
786
989
|
var j;
|
|
787
|
-
const
|
|
788
|
-
if (!
|
|
789
|
-
const
|
|
790
|
-
|
|
990
|
+
const s = o.target.closest(".emojis-item");
|
|
991
|
+
if (!s) return;
|
|
992
|
+
const v = s.getAttribute("data-emoji") || ((j = s.textContent) == null ? void 0 : j.trim()) || "";
|
|
993
|
+
v && (x(v, e), m());
|
|
791
994
|
});
|
|
792
995
|
}
|
|
793
|
-
function
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}),
|
|
996
|
+
function D(r, e) {
|
|
997
|
+
l = e, r.querySelectorAll(".emojis-tab").forEach((t) => {
|
|
998
|
+
t.classList.toggle("active", t.getAttribute("data-category") === e);
|
|
999
|
+
}), w(r);
|
|
797
1000
|
}
|
|
798
|
-
function
|
|
799
|
-
const
|
|
800
|
-
|
|
1001
|
+
function w(r) {
|
|
1002
|
+
const e = r.querySelector("#emojis-grid");
|
|
1003
|
+
e && (e.innerHTML = k(l, u));
|
|
801
1004
|
}
|
|
802
|
-
function
|
|
803
|
-
let
|
|
804
|
-
return
|
|
1005
|
+
function k(r, e) {
|
|
1006
|
+
let t = p[r].emojis;
|
|
1007
|
+
return e.trim() && (t = t.filter((i) => i.toLowerCase().includes(e.toLowerCase()) ? !0 : (A[i] || "").toLowerCase().includes(e.toLowerCase()))), t.length === 0 && e.trim() ? `<div class="emojis-no-results">No emojis found for "${y(e)}"</div>` : t.map((i) => `
|
|
805
1008
|
<button
|
|
806
1009
|
class="emojis-item"
|
|
807
|
-
title="Insert ${
|
|
808
|
-
data-emoji="${
|
|
1010
|
+
title="Insert ${i}"
|
|
1011
|
+
data-emoji="${i}"
|
|
809
1012
|
>
|
|
810
|
-
${
|
|
1013
|
+
${i}
|
|
811
1014
|
</button>
|
|
812
1015
|
`).join("");
|
|
813
1016
|
}
|
|
814
1017
|
function m() {
|
|
815
1018
|
d && (document.removeEventListener("keydown", d, !0), d = null), n !== null && (window.clearTimeout(n), n = null), g && (g.remove(), g = null);
|
|
816
1019
|
}
|
|
817
|
-
function
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1020
|
+
function f(r) {
|
|
1021
|
+
return r.getAttribute("contenteditable") === "false" || r.getAttribute("data-readonly") === "true";
|
|
1022
|
+
}
|
|
1023
|
+
function x(r, e) {
|
|
1024
|
+
if (f(e)) return;
|
|
1025
|
+
const t = e.innerHTML;
|
|
1026
|
+
e.focus();
|
|
1027
|
+
let i = window.getSelection();
|
|
1028
|
+
if (c && (i == null || i.removeAllRanges(), i == null || i.addRange(c), c = null), i = window.getSelection(), i && i.rangeCount > 0) {
|
|
1029
|
+
const a = i.getRangeAt(0);
|
|
1030
|
+
a.deleteContents();
|
|
1031
|
+
const o = document.createTextNode(r);
|
|
1032
|
+
a.insertNode(o), a.setStartAfter(o), a.setEndAfter(o), i.removeAllRanges(), i.addRange(a);
|
|
825
1033
|
}
|
|
1034
|
+
z(e, t), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
826
1035
|
}
|
|
827
1036
|
function b() {
|
|
828
1037
|
const r = window.getSelection();
|
|
829
1038
|
if (r && r.rangeCount > 0) {
|
|
830
|
-
const
|
|
1039
|
+
const t = r.anchorNode, i = t instanceof HTMLElement ? t : t == null ? void 0 : t.parentElement, a = i == null ? void 0 : i.closest(".editora-content, .rte-content");
|
|
831
1040
|
if (a) return a;
|
|
832
1041
|
}
|
|
833
|
-
const
|
|
834
|
-
return
|
|
1042
|
+
const e = document.activeElement;
|
|
1043
|
+
return e && (e.classList.contains("editora-content") || e.classList.contains("rte-content")) ? e : document.querySelector(".editora-content, .rte-content");
|
|
835
1044
|
}
|
|
836
|
-
function
|
|
837
|
-
const
|
|
838
|
-
return
|
|
1045
|
+
function q(r) {
|
|
1046
|
+
const e = r || b();
|
|
1047
|
+
return e ? !!e.closest(S) : !1;
|
|
839
1048
|
}
|
|
840
|
-
function
|
|
1049
|
+
function C() {
|
|
841
1050
|
if (document.getElementById("emojis-dialog-styles")) return;
|
|
842
1051
|
const r = document.createElement("style");
|
|
843
1052
|
r.id = "emojis-dialog-styles", r.textContent = `
|
|
@@ -1089,6 +1298,9 @@ function L() {
|
|
|
1089
1298
|
border-bottom: 1px solid var(--rte-emoji-border);
|
|
1090
1299
|
flex-direction: row;
|
|
1091
1300
|
overflow-x: auto;
|
|
1301
|
+
/* As a column-flex child with overflow set it would shrink below its
|
|
1302
|
+
content height when the dialog is short, clipping the tab labels. */
|
|
1303
|
+
flex-shrink: 0;
|
|
1092
1304
|
}
|
|
1093
1305
|
|
|
1094
1306
|
.emojis-tab {
|
|
@@ -1112,6 +1324,6 @@ function L() {
|
|
|
1112
1324
|
`, document.head.appendChild(r);
|
|
1113
1325
|
}
|
|
1114
1326
|
export {
|
|
1115
|
-
|
|
1327
|
+
N as EmojisPlugin
|
|
1116
1328
|
};
|
|
1117
|
-
//# sourceMappingURL=EmojisPlugin.native-
|
|
1329
|
+
//# sourceMappingURL=EmojisPlugin.native-D92aaOKi.mjs.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { r as p } from "./historyHelpers-B0-4mq1E.mjs";
|
|
2
|
+
const R = () => ({
|
|
2
3
|
name: "fontFamily",
|
|
3
4
|
marks: {
|
|
4
5
|
fontFamily: {
|
|
@@ -49,7 +50,7 @@ const E = () => ({
|
|
|
49
50
|
setFontFamily: (e) => {
|
|
50
51
|
if (!e) return !1;
|
|
51
52
|
try {
|
|
52
|
-
return
|
|
53
|
+
return F(e), !0;
|
|
53
54
|
} catch (t) {
|
|
54
55
|
return console.error("Failed to set font family:", t), !1;
|
|
55
56
|
}
|
|
@@ -58,85 +59,91 @@ const E = () => ({
|
|
|
58
59
|
keymap: {
|
|
59
60
|
"Mod-Shift-f": "setFontFamily"
|
|
60
61
|
}
|
|
61
|
-
}),
|
|
62
|
-
function
|
|
63
|
-
return !!e.cloneContents().querySelector(
|
|
62
|
+
}), h = "p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";
|
|
63
|
+
function g(e) {
|
|
64
|
+
return !!e.cloneContents().querySelector(h);
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function m(e) {
|
|
66
67
|
const t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
67
68
|
return (t == null ? void 0 : t.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
|
|
68
69
|
}
|
|
69
70
|
function f(e) {
|
|
70
71
|
e && e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
var
|
|
73
|
+
function S(e, t) {
|
|
74
|
+
var r;
|
|
74
75
|
const n = document.createElement("span");
|
|
75
76
|
for (const l of Array.from(e.attributes))
|
|
76
77
|
l.name === "face" || l.name === "style" || n.setAttribute(l.name, l.value);
|
|
77
|
-
const
|
|
78
|
-
for (
|
|
78
|
+
const o = e.getAttribute("style");
|
|
79
|
+
for (o && n.setAttribute("style", o), n.style.fontFamily = t, n.classList.add("rte-font-family"); e.firstChild; )
|
|
79
80
|
n.appendChild(e.firstChild);
|
|
80
|
-
(
|
|
81
|
+
(r = e.parentNode) == null || r.replaceChild(n, e);
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function A(e) {
|
|
83
84
|
e.querySelectorAll("span").forEach((n) => {
|
|
84
85
|
n.childElementCount > 0 || (n.textContent || "").trim().length > 0 || n.remove();
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
-
if (
|
|
88
|
+
function C(e, t, n) {
|
|
89
|
+
if (g(e))
|
|
89
90
|
return !1;
|
|
90
|
-
const
|
|
91
|
-
|
|
91
|
+
const o = document.createElement("span");
|
|
92
|
+
o.style.fontFamily = n, o.className = "rte-font-family";
|
|
92
93
|
try {
|
|
93
|
-
e.surroundContents(
|
|
94
|
+
e.surroundContents(o);
|
|
94
95
|
} catch (l) {
|
|
95
|
-
const
|
|
96
|
-
|
|
96
|
+
const i = e.extractContents();
|
|
97
|
+
o.appendChild(i), e.insertNode(o);
|
|
97
98
|
}
|
|
98
|
-
const
|
|
99
|
-
return
|
|
99
|
+
const r = document.createRange();
|
|
100
|
+
return r.selectNodeContents(o), t.removeAllRanges(), t.addRange(r), !0;
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function F(e) {
|
|
102
103
|
const t = window.getSelection();
|
|
103
104
|
if (!t || t.rangeCount === 0) return;
|
|
104
|
-
const n = t.getRangeAt(0),
|
|
105
|
+
const n = m(t.getRangeAt(0).commonAncestorContainer), o = n ? n.innerHTML : null;
|
|
106
|
+
b(e), n && o !== null && p(n, o);
|
|
107
|
+
}
|
|
108
|
+
function b(e) {
|
|
109
|
+
const t = window.getSelection();
|
|
110
|
+
if (!t || t.rangeCount === 0) return;
|
|
111
|
+
const n = t.getRangeAt(0), o = n.cloneRange(), r = m(n.commonAncestorContainer);
|
|
105
112
|
if (n.collapsed)
|
|
106
113
|
return;
|
|
107
|
-
const l = n.commonAncestorContainer,
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
114
|
+
const l = n.commonAncestorContainer, i = v(l);
|
|
115
|
+
if (i && N(n, i)) {
|
|
116
|
+
i.style.fontFamily = e, i.classList.add("rte-font-family");
|
|
117
|
+
const a = document.createRange();
|
|
118
|
+
a.selectNodeContents(i), t.removeAllRanges(), t.addRange(a), f(r);
|
|
112
119
|
return;
|
|
113
120
|
}
|
|
114
|
-
if (!
|
|
115
|
-
const
|
|
116
|
-
Array.from(
|
|
117
|
-
),
|
|
121
|
+
if (!r) return;
|
|
122
|
+
const u = new Set(
|
|
123
|
+
Array.from(r.querySelectorAll("font[face]"))
|
|
124
|
+
), d = new Set(
|
|
118
125
|
Array.from(
|
|
119
|
-
|
|
126
|
+
r.querySelectorAll("span[style*='font-family']")
|
|
120
127
|
)
|
|
121
128
|
);
|
|
122
|
-
|
|
129
|
+
r.focus({ preventScroll: !0 });
|
|
123
130
|
try {
|
|
124
131
|
document.execCommand("styleWithCSS", !1, "true");
|
|
125
|
-
} catch (
|
|
132
|
+
} catch (a) {
|
|
126
133
|
}
|
|
127
|
-
const
|
|
128
|
-
let
|
|
134
|
+
const y = e.split(",").map((a) => a.trim().replace(/^['"]|['"]$/g, "")).filter(Boolean)[0] || "Arial";
|
|
135
|
+
let s = document.execCommand("fontName", !1, y), c = !1;
|
|
129
136
|
Array.from(
|
|
130
|
-
|
|
131
|
-
).forEach((
|
|
132
|
-
|
|
137
|
+
r.querySelectorAll("font[face]")
|
|
138
|
+
).forEach((a) => {
|
|
139
|
+
u.has(a) || (S(a, e), c = !0);
|
|
133
140
|
}), Array.from(
|
|
134
|
-
|
|
135
|
-
).forEach((
|
|
136
|
-
|
|
137
|
-
}),
|
|
141
|
+
r.querySelectorAll("span[style*='font-family']")
|
|
142
|
+
).forEach((a) => {
|
|
143
|
+
d.has(a) || (a.style.fontFamily = e, a.classList.add("rte-font-family"), c = !0);
|
|
144
|
+
}), s || (s = C(o, t, e)), (s || c) && (A(r), f(r));
|
|
138
145
|
}
|
|
139
|
-
function
|
|
146
|
+
function v(e) {
|
|
140
147
|
let t = e;
|
|
141
148
|
for (; t; ) {
|
|
142
149
|
if (t.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -148,11 +155,11 @@ function b(e) {
|
|
|
148
155
|
}
|
|
149
156
|
return null;
|
|
150
157
|
}
|
|
151
|
-
function
|
|
152
|
-
const n = e.startContainer,
|
|
153
|
-
return
|
|
158
|
+
function N(e, t) {
|
|
159
|
+
const n = e.startContainer, o = e.endContainer, r = t.contains(n) || n.nodeType === Node.TEXT_NODE && n.parentElement === t, l = t.contains(o) || o.nodeType === Node.TEXT_NODE && o.parentElement === t;
|
|
160
|
+
return r && l;
|
|
154
161
|
}
|
|
155
162
|
export {
|
|
156
|
-
|
|
163
|
+
R as FontFamilyPlugin
|
|
157
164
|
};
|
|
158
|
-
//# sourceMappingURL=FontFamilyPlugin.native-
|
|
165
|
+
//# sourceMappingURL=FontFamilyPlugin.native-M3cNQ0KA.mjs.map
|