@editora/plugins 1.0.10 → 1.0.12

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