@editora/core 1.0.3 → 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.
Files changed (131) hide show
  1. package/README.md +34 -0
  2. package/dist/{A11yCheckerPlugin.native-CZKpi3uF.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +225 -173
  3. package/dist/AnchorPlugin.native-C1Rw5m04.mjs +404 -0
  4. package/dist/BackgroundColorPlugin.native-BE-p9DRd.mjs +489 -0
  5. package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +309 -0
  6. package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +140 -0
  7. package/dist/{CodePlugin.native-CK9d8rmt.mjs → CodePlugin.native-0Zari_zp.mjs} +329 -310
  8. package/dist/CodeSamplePlugin.native-B-KS1pOl.mjs +384 -0
  9. package/dist/CommentsPlugin.native-tMnWn8a2.mjs +723 -0
  10. package/dist/DirectionPlugin.native-CDnbdNyl.mjs +130 -0
  11. package/dist/{EmbedIframePlugin.native-ifr9KLdN.mjs → EmbedIframePlugin.native-CSWIB1jm.mjs} +154 -50
  12. package/dist/{EmojisPlugin.native-D6mJSnSR.mjs → EmojisPlugin.native-DxTm_DL-.mjs} +156 -103
  13. package/dist/FontFamilyPlugin.native-j8hMTbg4.mjs +158 -0
  14. package/dist/FontSizePlugin.native-B_jCh7dY.mjs +286 -0
  15. package/dist/FootnotePlugin.native-D730OGRm.mjs +425 -0
  16. package/dist/HistoryPlugin.native-DCrPdeSW.mjs +257 -0
  17. package/dist/IndentPlugin.native-BHixp8sP.mjs +150 -0
  18. package/dist/LineHeightPlugin.native-CM7iXdQj.mjs +151 -0
  19. package/dist/{LinkPlugin.native-BdAOV-iu.mjs → LinkPlugin.native-CS2g-G18.mjs} +128 -53
  20. package/dist/{ListPlugin.native-CLFU5AUQ.mjs → ListPlugin.native-V7EZC1lM.mjs} +59 -12
  21. package/dist/MathPlugin.native-KUxz0o8C.mjs +251 -0
  22. package/dist/MediaManagerPlugin.native-CgP5iInD.mjs +970 -0
  23. package/dist/MergeTagPlugin.native-CU9LtsfD.mjs +416 -0
  24. package/dist/PageBreakPlugin.native-CGiQxXqR.mjs +297 -0
  25. package/dist/{PrintPlugin.native-BUpm52VJ.mjs → PrintPlugin.native-7qt5v7L5.mjs} +10 -10
  26. package/dist/{SpecialCharactersPlugin.native-x7a2SWXc.mjs → SpecialCharactersPlugin.native-DANrbExJ.mjs} +143 -97
  27. package/dist/SpellCheckPlugin.native-C8bPvRHy.mjs +1019 -0
  28. package/dist/StrikethroughPlugin.native-0Be7j49s.mjs +73 -0
  29. package/dist/{TablePlugin.native-EEWXn1-s.mjs → TablePlugin.native-DrHX-efe.mjs} +149 -145
  30. package/dist/TemplatePlugin.native-4lKEm-WY.mjs +578 -0
  31. package/dist/TextAlignmentPlugin.native-sM_1s00t.mjs +108 -0
  32. package/dist/{TextColorPlugin.native-D6SmTglm.mjs → TextColorPlugin.native-Clgtb50j.mjs} +173 -92
  33. package/dist/colorSelectionApply-CK1My9N2.mjs +67 -0
  34. package/dist/core.css +1 -1
  35. package/dist/editora.min.js +31 -29
  36. package/dist/editora.umd.js +31 -29
  37. package/dist/index-CqWQFb3D.js +10 -0
  38. package/dist/index-OwnkG39N.mjs +2227 -0
  39. package/dist/index.cjs.js +14 -18
  40. package/dist/index.esm.js +204 -521
  41. package/dist/plugin-loader.js +26 -26
  42. package/dist/webcomponent-core.js +1286 -295
  43. package/dist/webcomponent-core.min.css +1 -1
  44. package/dist/webcomponent-core.min.js +100 -75
  45. package/dist/webcomponent.cjs.js +1 -1
  46. package/dist/webcomponent.esm.js +1 -1
  47. package/dist/webcomponent.js +1252 -261
  48. package/dist/webcomponent.min.css +1 -1
  49. package/dist/webcomponent.min.js +3616 -2109
  50. package/index.d.ts +355 -0
  51. package/package.json +19 -17
  52. package/dist/A11yCheckerPlugin.native-CZKpi3uF.mjs.map +0 -1
  53. package/dist/AnchorPlugin.native-7es9PVZ9.mjs +0 -340
  54. package/dist/AnchorPlugin.native-7es9PVZ9.mjs.map +0 -1
  55. package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs +0 -449
  56. package/dist/BackgroundColorPlugin.native-Dip5uqTg.mjs.map +0 -1
  57. package/dist/BlockquotePlugin.native-JFmOLsxN.mjs.map +0 -1
  58. package/dist/BoldPlugin.native-BAzzoqU5.mjs.map +0 -1
  59. package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs.map +0 -1
  60. package/dist/ChecklistPlugin.native-Dccs3nLe.mjs +0 -153
  61. package/dist/ChecklistPlugin.native-Dccs3nLe.mjs.map +0 -1
  62. package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs +0 -27
  63. package/dist/ClearFormattingPlugin.native-BZPDHswo.mjs.map +0 -1
  64. package/dist/CodePlugin.native-CK9d8rmt.mjs.map +0 -1
  65. package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs +0 -326
  66. package/dist/CodeSamplePlugin.native-DMbEdO9j.mjs.map +0 -1
  67. package/dist/CommentsPlugin.native-2zQV8Ia4.mjs +0 -473
  68. package/dist/CommentsPlugin.native-2zQV8Ia4.mjs.map +0 -1
  69. package/dist/DirectionPlugin.native-Be7wCzkI.mjs +0 -59
  70. package/dist/DirectionPlugin.native-Be7wCzkI.mjs.map +0 -1
  71. package/dist/DocumentManagerPlugin.native-BvZL5CSG.mjs.map +0 -1
  72. package/dist/EmbedIframePlugin.native-ifr9KLdN.mjs.map +0 -1
  73. package/dist/EmojisPlugin.native-D6mJSnSR.mjs.map +0 -1
  74. package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs +0 -106
  75. package/dist/FontFamilyPlugin.native-BzS_9qbM.mjs.map +0 -1
  76. package/dist/FontSizePlugin.native-DkLMLPue.mjs +0 -186
  77. package/dist/FontSizePlugin.native-DkLMLPue.mjs.map +0 -1
  78. package/dist/FootnotePlugin.native-BciVc9W6.mjs +0 -128
  79. package/dist/FootnotePlugin.native-BciVc9W6.mjs.map +0 -1
  80. package/dist/FullscreenPlugin.native-ChXyxeNw.mjs.map +0 -1
  81. package/dist/HeadingPlugin.native-DrLYwQnQ.mjs.map +0 -1
  82. package/dist/HistoryPlugin.native-DoDRifCf.mjs +0 -89
  83. package/dist/HistoryPlugin.native-DoDRifCf.mjs.map +0 -1
  84. package/dist/IndentPlugin.native-CbFugPoi.mjs +0 -133
  85. package/dist/IndentPlugin.native-CbFugPoi.mjs.map +0 -1
  86. package/dist/ItalicPlugin.native-CQjjDyUL.mjs.map +0 -1
  87. package/dist/LineHeightPlugin.native-CWQT2FIa.mjs +0 -73
  88. package/dist/LineHeightPlugin.native-CWQT2FIa.mjs.map +0 -1
  89. package/dist/LinkPlugin.native-BdAOV-iu.mjs.map +0 -1
  90. package/dist/ListPlugin.native-CLFU5AUQ.mjs.map +0 -1
  91. package/dist/MathPlugin.native-DE_ii-LA.mjs +0 -182
  92. package/dist/MathPlugin.native-DE_ii-LA.mjs.map +0 -1
  93. package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs +0 -533
  94. package/dist/MediaManagerPlugin.native-DaYFDzNM.mjs.map +0 -1
  95. package/dist/MergeTagPlugin.native-CrxyThyn.mjs +0 -178
  96. package/dist/MergeTagPlugin.native-CrxyThyn.mjs.map +0 -1
  97. package/dist/PageBreakPlugin.native-DDjcDyRW.mjs +0 -172
  98. package/dist/PageBreakPlugin.native-DDjcDyRW.mjs.map +0 -1
  99. package/dist/PreviewPlugin.native-DBvfpmIv.mjs.map +0 -1
  100. package/dist/PrintPlugin.native-BUpm52VJ.mjs.map +0 -1
  101. package/dist/SpecialCharactersPlugin.native-x7a2SWXc.mjs.map +0 -1
  102. package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs +0 -465
  103. package/dist/SpellCheckPlugin.native-B7yTh0iE.mjs.map +0 -1
  104. package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs +0 -43
  105. package/dist/StrikethroughPlugin.native-ChaZLaXw.mjs.map +0 -1
  106. package/dist/TablePlugin.native-EEWXn1-s.mjs.map +0 -1
  107. package/dist/TemplatePlugin.native-BlSn1c9h.mjs +0 -564
  108. package/dist/TemplatePlugin.native-BlSn1c9h.mjs.map +0 -1
  109. package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs +0 -97
  110. package/dist/TextAlignmentPlugin.native-CQIs1m7R.mjs.map +0 -1
  111. package/dist/TextColorPlugin.native-D6SmTglm.mjs.map +0 -1
  112. package/dist/UnderlinePlugin.native-QpIcK4L2.mjs.map +0 -1
  113. package/dist/documentManager-irzj9n3V.mjs.map +0 -1
  114. package/dist/editorContainerHelpers-C7kdWnS0.mjs.map +0 -1
  115. package/dist/editora.min.js.map +0 -1
  116. package/dist/editora.umd.js.map +0 -1
  117. package/dist/index-BF5RBhL9.js +0 -4
  118. package/dist/index-BF5RBhL9.js.map +0 -1
  119. package/dist/index-BPsf460l.mjs +0 -1243
  120. package/dist/index-BPsf460l.mjs.map +0 -1
  121. package/dist/index.cjs.js.map +0 -1
  122. package/dist/index.es-CuicffkQ.mjs.map +0 -1
  123. package/dist/index.esm.js.map +0 -1
  124. package/dist/plugin-loader.js.map +0 -1
  125. package/dist/purify.es-CKpwg8Tk.mjs.map +0 -1
  126. package/dist/webcomponent-core.js.map +0 -1
  127. package/dist/webcomponent-core.min.js.map +0 -1
  128. package/dist/webcomponent.cjs.js.map +0 -1
  129. package/dist/webcomponent.esm.js.map +0 -1
  130. package/dist/webcomponent.js.map +0 -1
  131. package/dist/webcomponent.min.js.map +0 -1
@@ -540,7 +540,7 @@ const d = {
540
540
  "🇳🇿"
541
541
  ]
542
542
  }
543
- }, b = {
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 c = null, n = "all", l = "", s = null;
692
- const y = () => ({
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: (o, t) => {
705
- const e = (t == null ? void 0 : t.contentElement) || g();
706
- return e ? (j(e), !0) : !1;
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: (o, t) => {
709
- if (!o) return !1;
710
- const e = (t == null ? void 0 : t.contentElement) || g();
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 h(o, e), !0;
714
- } catch (i) {
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 j(o) {
724
- n = "all", l = "";
725
- const t = window.getSelection();
726
- s = null, t && t.rangeCount > 0 && o.contains(t.anchorNode) && (s = t.getRangeAt(0).cloneRange());
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 = u;
729
- const i = document.createElement("div");
730
- i.className = "emojis-dialog", i.onclick = (a) => a.stopPropagation();
731
- const r = Object.keys(d);
732
- i.innerHTML = `
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
- ${r.map((a) => `
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, l)}
759
+ ${f(n, c)}
760
760
  </div>
761
761
  </div>
762
762
  </div>
763
- `, e.appendChild(i), document.body.appendChild(e), c = e, x(i, o), v(), setTimeout(() => {
763
+ `, e.appendChild(t), document.body.appendChild(e), l = e, x(t, r), k(), setTimeout(() => {
764
764
  var a;
765
- (a = i.querySelector("#emoji-search-input")) == null || a.focus();
765
+ (a = t.querySelector("#emoji-search-input")) == null || a.focus();
766
766
  }, 100);
767
767
  }
768
- function x(o, t) {
769
- var i;
770
- (i = o.querySelector(".emojis-close")) == null || i.addEventListener("click", u), o.querySelectorAll(".emojis-tab").forEach((r) => {
771
- r.addEventListener("click", (a) => {
772
- const p = a.target.getAttribute("data-category");
773
- p && w(o, p, t);
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 = o.querySelector("#emoji-search-input");
777
- e == null || e.addEventListener("input", (r) => {
778
- l = r.target.value, m(o, t);
779
- }), m(o, t);
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(o, t, e) {
782
- n = t, o.querySelectorAll(".emojis-tab").forEach((i) => {
783
- i.classList.toggle("active", i.getAttribute("data-category") === t);
784
- }), m(o, e);
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(o, t) {
787
- const e = o.querySelector("#emojis-grid");
788
- e && (e.innerHTML = f(n, l), e.querySelectorAll(".emojis-item").forEach((i) => {
789
- i.addEventListener("click", () => {
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 r = ((a = i.textContent) == null ? void 0 : a.trim()) || "";
792
- r && (h(r, t), u());
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(o, t) {
797
- let e = d[o].emojis;
798
- return t.trim() && (e = e.filter((i) => i.toLowerCase().includes(t.toLowerCase()) ? !0 : (b[i] || "").toLowerCase().includes(t.toLowerCase()))), e.length === 0 && t.trim() ? `<div class="emojis-no-results">No emojis found for "${t}"</div>` : e.map((i, r) => `
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 ${i}"
802
- data-emoji="${i}"
801
+ title="Insert ${t}"
802
+ data-emoji="${t}"
803
803
  >
804
- ${i}
804
+ ${t}
805
805
  </button>
806
806
  `).join("");
807
807
  }
808
- function u() {
809
- c && (document.body.removeChild(c), c = null);
808
+ function g() {
809
+ l && (document.body.removeChild(l), l = null);
810
810
  }
811
- function h(o, t) {
812
- t.focus();
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 i = e.getRangeAt(0);
816
- i.deleteContents();
817
- const r = document.createTextNode(o);
818
- i.insertNode(r), i.setStartAfter(r), i.setEndAfter(r), e.removeAllRanges(), e.addRange(i);
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 g() {
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 v() {
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 o = document.createElement("style");
828
- o.id = "emojis-dialog-styles", o.textContent = `
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: rgba(0, 0, 0, 0.5);
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: white;
845
- border-radius: 8px;
846
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
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: #1a202c;
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: #a0aec0;
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 #e1e5e9;
890
- border-radius: 6px;
942
+ border: 1px solid var(--rte-emoji-border);
943
+ border-radius: 8px;
891
944
  font-size: 14px;
892
- color: #2d3748;
893
- background-color: #ffffff;
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: #4299e1;
900
- box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
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-input:focus + .emojis-search-icon {
904
- color: #4299e1;
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: #a0aec0;
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 #e1e5e9;
916
- background-color: #f8fafc;
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: #4a5568;
927
- border-bottom: 1px solid #e1e5e9;
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: #edf2f7;
933
- color: #2d3748;
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: #4299e1;
938
- color: white;
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: #3182ce;
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 #e1e5e9;
961
- background: white;
962
- border-radius: 4px;
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: #2d3748;
1019
+ color: var(--rte-emoji-dialog-text);
967
1020
  }
968
1021
 
969
1022
  .emojis-item:hover {
970
- background-color: #4299e1;
971
- border-color: #4299e1;
972
- color: white;
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: #718096;
1036
+ color: var(--rte-emoji-muted-text);
984
1037
  font-size: 14px;
985
1038
  padding: 40px 20px;
986
- background-color: #f8fafc;
987
- border-radius: 6px;
988
- border: 1px solid #e1e5e9;
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 #e1e5e9;
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 #e1e5e9;
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(o);
1081
+ `, document.head.appendChild(r);
1029
1082
  }
1030
1083
  export {
1031
- y as EmojisPlugin
1084
+ E as EmojisPlugin
1032
1085
  };
1033
- //# sourceMappingURL=EmojisPlugin.native-D6mJSnSR.mjs.map
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