@editora/core 1.0.8 → 1.0.10

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 (58) hide show
  1. package/README.md +6 -1
  2. package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +136 -133
  3. package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
  4. package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +90 -87
  5. package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
  6. package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
  7. package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
  8. package/dist/{CitationsPlugin.native-BnU0qCwR.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +132 -129
  9. package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
  10. package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
  11. package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +105 -102
  12. package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +49 -46
  13. package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
  14. package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +55 -52
  15. package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-BF_-LjTq.mjs} +287 -115
  16. package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
  17. package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-D2wl32jV.mjs} +88 -103
  18. package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
  19. package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
  20. package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +204 -202
  21. package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
  22. package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +158 -155
  23. package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +2 -2
  24. package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +127 -124
  25. package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +100 -76
  26. package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -26
  27. package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
  28. package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +104 -101
  29. package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
  30. package/dist/editora.min.js +1 -1
  31. package/dist/editora.umd.js +1 -1
  32. package/dist/index-CPMGUZfB.js +10 -0
  33. package/dist/{index-DqC57IEH.mjs → index-DBoj6QfW.mjs} +17 -15
  34. package/dist/index.cjs.js +1 -1
  35. package/dist/index.esm.js +2 -2
  36. package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
  37. package/dist/plugin-loader.js +37 -37
  38. package/dist/webcomponent-core.js +18 -16
  39. package/dist/webcomponent-core.min.css +1 -1
  40. package/dist/webcomponent-core.min.js +139 -62
  41. package/dist/webcomponent.cjs.js +1 -1
  42. package/dist/webcomponent.esm.js +1 -1
  43. package/dist/webcomponent.js +50 -48
  44. package/dist/webcomponent.min.css +1 -1
  45. package/dist/webcomponent.min.js +1174 -1071
  46. package/package.json +11 -5
  47. package/LICENSE +0 -21
  48. package/dist/BlockquotePlugin.native-JFmOLsxN.mjs +0 -48
  49. package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs +0 -79
  50. package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +0 -309
  51. package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +0 -140
  52. package/dist/CodePlugin.native-DlpTPdkd.mjs +0 -2691
  53. package/dist/DirectionPlugin.native-CDnbdNyl.mjs +0 -130
  54. package/dist/HeadingPlugin.native-DrLYwQnQ.mjs +0 -64
  55. package/dist/MathPlugin.native-f_mDp8VL.mjs +0 -292
  56. package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +0 -559
  57. package/dist/TemplatePlugin.native-CrpfKRJ8.mjs +0 -602
  58. package/dist/index-D1LOqg5C.js +0 -10
@@ -1,4 +1,4 @@
1
- const m = {
1
+ const x = {
2
2
  all: {
3
3
  name: "All",
4
4
  characters: [
@@ -389,7 +389,7 @@ const m = {
389
389
  name: "Arrows",
390
390
  characters: ["←", "↑", "→", "↓", "↔", "↕", "↖", "↗", "↘", "↙", "↚", "↛", "↜", "↝", "↞", "↟", "↠", "↡", "↢", "↣", "↤", "↥", "↦", "↧", "↨", "↩", "↪", "↫", "↬", "↭", "↮", "↯", "↰", "↱", "↲", "↳", "↴", "↵", "↶", "↷", "↸", "↹", "↺", "↻", "↼", "↽", "↾", "↿", "⇀", "⇁", "⇂", "⇃", "⇄", "⇅", "⇆", "⇇", "⇈", "⇉", "⇊", "⇋", "⇌", "⇍", "⇎", "⇏", "⇐", "⇑", "⇒", "⇓", "⇔", "⇕", "⇖", "⇗", "⇘", "⇙", "⇚", "⇛", "⇜", "⇝", "⇞", "⇟", "⇠", "⇡", "⇢", "⇣", "⇤", "⇥", "⇦", "⇧", "⇨", "⇩", "⇪", "⇫", "⇬", "⇭", "⇮", "⇯", "⇰", "⇱", "⇲", "⇳", "⇴", "⇵", "⇶", "⇷", "⇸", "⇹", "⇺", "⇻", "⇼", "⇽", "⇾", "⇿"]
391
391
  }
392
- }, k = {
392
+ }, E = {
393
393
  "€": "euro",
394
394
  "£": "pound",
395
395
  "¥": "yen",
@@ -438,21 +438,41 @@ const m = {
438
438
  "↓": "down arrow",
439
439
  "↔": "left right arrow"
440
440
  };
441
- let v = !1;
442
- const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
443
- const a = window.getSelection();
444
- if (!a || a.rangeCount === 0) return null;
445
- const e = a.anchorNode, t = e instanceof HTMLElement ? e : e == null ? void 0 : e.parentElement;
446
- return (t == null ? void 0 : t.closest(".rte-content, .editora-content")) || null;
447
- }, z = (a) => {
448
- const e = a || w();
449
- return e ? !!e.closest(E) : !1;
450
- }, C = () => {
441
+ let w = !1;
442
+ const z = '[data-theme="dark"], .dark, .editora-theme-dark', S = (r) => r ? r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement : null, m = () => {
443
+ const r = window.getSelection();
444
+ if (!r || r.rangeCount === 0) return null;
445
+ const e = S(r.getRangeAt(0).startContainer);
446
+ return (e == null ? void 0 : e.closest('.rte-content, .editora-content, [contenteditable="true"]')) || null;
447
+ }, A = (r) => {
448
+ const e = window.getSelection();
449
+ if (!e || e.rangeCount === 0) return null;
450
+ const a = e.getRangeAt(0);
451
+ return !r.contains(a.startContainer) || !r.contains(a.endContainer) ? null : a.cloneRange();
452
+ }, L = (r) => {
453
+ const e = document.createRange();
454
+ return e.selectNodeContents(r), e.collapse(!1), e;
455
+ }, T = (r, e, a) => {
456
+ if (e !== a) {
457
+ if (typeof window.execEditorCommand == "function") {
458
+ window.execEditorCommand("recordDomTransaction", r, e, a);
459
+ return;
460
+ }
461
+ if (typeof window.executeEditorCommand == "function")
462
+ try {
463
+ window.executeEditorCommand("recordDomTransaction", { editor: r, beforeHTML: e, afterHTML: a });
464
+ } catch (c) {
465
+ }
466
+ }
467
+ }, q = (r) => {
468
+ const e = r || m();
469
+ return e ? !!e.closest(z) : !1;
470
+ }, N = () => {
451
471
  if (typeof document == "undefined") return;
452
- const a = "special-characters-plugin-styles";
453
- if (document.getElementById(a)) return;
472
+ const r = "special-characters-plugin-styles";
473
+ if (document.getElementById(r)) return;
454
474
  const e = document.createElement("style");
455
- e.id = a, e.textContent = `
475
+ e.id = r, e.textContent = `
456
476
  .special-characters-overlay {
457
477
  --rte-sc-overlay-bg: rgba(15, 23, 36, 0.56);
458
478
  --rte-sc-dialog-bg: #ffffff;
@@ -719,31 +739,35 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
719
739
  }
720
740
  }
721
741
  `, document.head.appendChild(e);
722
- }, L = (a) => {
723
- const e = window.getSelection();
724
- if (e && e.rangeCount > 0) {
725
- const t = e.getRangeAt(0);
726
- t.deleteContents();
727
- const c = document.createTextNode(a);
728
- t.insertNode(c), t.setStartAfter(c), t.setEndAfter(c), e.removeAllRanges(), e.addRange(t);
729
- }
730
- }, S = (a) => {
731
- if (typeof window == "undefined" || v) return;
732
- v = !0, C();
733
- let e = "all", t = "", c = null;
742
+ }, D = (r, e, a) => {
743
+ const c = e || m();
744
+ if (!c) return;
745
+ const l = a && c.contains(a.commonAncestorContainer) ? a : L(c), d = c.innerHTML;
746
+ l.deleteContents();
747
+ const i = document.createTextNode(r);
748
+ l.insertNode(i), l.setStartAfter(i), l.setEndAfter(i);
749
+ const o = window.getSelection();
750
+ o && (o.removeAllRanges(), o.addRange(l));
751
+ const p = c.innerHTML;
752
+ T(c, d, p), c.dispatchEvent(new window.Event("input", { bubbles: !0 })), c.focus();
753
+ }, R = (r) => {
754
+ if (typeof window == "undefined" || w) return;
755
+ w = !0, N();
756
+ const e = r || m(), a = e ? A(e) : null;
757
+ let c = "all", l = "", d = null;
734
758
  const i = document.createElement("div");
735
- i.className = "special-characters-overlay", z(a) && i.classList.add("rte-ui-theme-dark");
736
- const s = document.createElement("div");
737
- s.className = "special-characters-dialog", s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "true"), s.innerHTML = `
759
+ i.className = "special-characters-overlay", q(r) && i.classList.add("rte-ui-theme-dark");
760
+ const o = document.createElement("div");
761
+ o.className = "special-characters-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.innerHTML = `
738
762
  <div class="special-characters-header">
739
763
  <h2>Insert Special Characters</h2>
740
764
  <button class="special-characters-close">×</button>
741
765
  </div>
742
766
  <div class="special-characters-content">
743
767
  <div class="special-characters-tabs">
744
- ${Object.keys(m).map((r) => `
745
- <button class="special-characters-tab ${e === r ? "active" : ""}" data-category="${r}">
746
- ${m[r].name}
768
+ ${Object.keys(x).map((t) => `
769
+ <button class="special-characters-tab ${c === t ? "active" : ""}" data-category="${t}">
770
+ ${x[t].name}
747
771
  </button>
748
772
  `).join("")}
749
773
  </div>
@@ -759,49 +783,49 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
759
783
  </div>
760
784
  </div>
761
785
  `;
762
- const l = s.querySelector(".special-characters-tabs"), n = s.querySelector(".special-characters-grid"), d = s.querySelector(".special-characters-search-input"), u = s.querySelector(".special-characters-close"), y = () => m[e].characters.filter((r) => {
763
- if (!t.trim()) return !0;
764
- const o = t.toLowerCase();
765
- return r.toLowerCase().includes(o) || (k[r] || "").toLowerCase().includes(o);
766
- }), f = () => {
767
- l == null || l.querySelectorAll(".special-characters-tab").forEach((r) => {
768
- r.classList.toggle("active", r.getAttribute("data-category") === e);
786
+ const p = o.querySelector(".special-characters-tabs"), u = o.querySelector(".special-characters-grid"), h = o.querySelector(".special-characters-search-input"), f = o.querySelector(".special-characters-close"), C = () => x[c].characters.filter((t) => {
787
+ if (!l.trim()) return !0;
788
+ const s = l.toLowerCase();
789
+ return t.toLowerCase().includes(s) || (E[t] || "").toLowerCase().includes(s);
790
+ }), k = () => {
791
+ p == null || p.querySelectorAll(".special-characters-tab").forEach((t) => {
792
+ t.classList.toggle("active", t.getAttribute("data-category") === c);
769
793
  });
770
- }, b = () => {
771
- if (!n) return;
772
- const r = y();
773
- if (r.length === 0) {
774
- n.innerHTML = `<div class="special-characters-no-results">No characters found for "${t}"</div>`;
794
+ }, v = () => {
795
+ if (!u) return;
796
+ const t = C();
797
+ if (u.textContent = "", t.length === 0) {
798
+ const s = document.createElement("div");
799
+ s.className = "special-characters-no-results", s.textContent = `No characters found for "${l}"`, u.appendChild(s);
775
800
  return;
776
801
  }
777
- n.innerHTML = r.map((o) => `
778
- <button class="special-characters-item" data-char="${o}" title="${k[o] || o}">
779
- ${o}
780
- </button>
781
- `).join("");
782
- }, g = () => {
783
- c !== null && (window.clearTimeout(c), c = null), i.parentNode && i.parentNode.removeChild(i), v = !1, document.removeEventListener("keydown", x, !0);
784
- }, x = (r) => {
785
- r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), g());
802
+ t.forEach((s) => {
803
+ const n = document.createElement("button");
804
+ n.type = "button", n.className = "special-characters-item", n.dataset.char = s, n.title = E[s] || s, n.textContent = s, u.appendChild(n);
805
+ });
806
+ }, b = () => {
807
+ d !== null && (window.clearTimeout(d), d = null), i.parentNode && i.parentNode.removeChild(i), w = !1, document.removeEventListener("keydown", y, !0);
808
+ }, y = (t) => {
809
+ t.key === "Escape" && (t.preventDefault(), t.stopPropagation(), b());
786
810
  };
787
- u == null || u.addEventListener("click", g), l == null || l.addEventListener("click", (r) => {
788
- const h = r.target.closest(".special-characters-tab");
789
- if (!h) return;
790
- const p = h.getAttribute("data-category");
791
- !p || e === p || (e = p, f(), b());
792
- }), d == null || d.addEventListener("input", (r) => {
793
- t = r.target.value, c !== null && window.clearTimeout(c), c = window.setTimeout(() => {
794
- c = null, b();
811
+ f == null || f.addEventListener("click", b), p == null || p.addEventListener("click", (t) => {
812
+ const n = t.target.closest(".special-characters-tab");
813
+ if (!n) return;
814
+ const g = n.getAttribute("data-category");
815
+ !g || c === g || (c = g, k(), v());
816
+ }), h == null || h.addEventListener("input", (t) => {
817
+ l = t.target.value, d !== null && window.clearTimeout(d), d = window.setTimeout(() => {
818
+ d = null, v();
795
819
  }, 90);
796
- }), n == null || n.addEventListener("click", (r) => {
797
- const h = r.target.closest(".special-characters-item");
798
- if (!h) return;
799
- const p = h.getAttribute("data-char");
800
- p && (L(p), g());
801
- }), i.addEventListener("click", (r) => {
802
- r.target === i && g();
803
- }), document.addEventListener("keydown", x, !0), f(), b(), i.appendChild(s), document.body.appendChild(i), requestAnimationFrame(() => d == null ? void 0 : d.focus());
804
- }, q = () => ({
820
+ }), u == null || u.addEventListener("click", (t) => {
821
+ const n = t.target.closest(".special-characters-item");
822
+ if (!n) return;
823
+ const g = n.dataset.char;
824
+ g && (D(g, e, a), b());
825
+ }), i.addEventListener("click", (t) => {
826
+ t.target === i && b();
827
+ }), document.addEventListener("keydown", y, !0), k(), v(), i.appendChild(o), document.body.appendChild(i), requestAnimationFrame(() => h == null ? void 0 : h.focus());
828
+ }, j = () => ({
805
829
  name: "specialCharacters",
806
830
  toolbar: [{
807
831
  label: "Special Characters",
@@ -809,14 +833,14 @@ const E = '[data-theme="dark"], .dark, .editora-theme-dark', w = () => {
809
833
  icon: '<svg width="24" height="24" focusable="false"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"></path></svg>'
810
834
  }],
811
835
  commands: {
812
- insertSpecialCharacter: (a, e) => {
813
- const t = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : w();
814
- return S(t), !0;
836
+ insertSpecialCharacter: (r, e) => {
837
+ const a = (e == null ? void 0 : e.contentElement) instanceof HTMLElement ? e.contentElement : m();
838
+ return R(a), !0;
815
839
  }
816
840
  },
817
841
  keymap: {}
818
842
  });
819
843
  export {
820
- q as SpecialCharactersPlugin
844
+ j as SpecialCharactersPlugin
821
845
  };
822
- //# sourceMappingURL=SpecialCharactersPlugin.native-CZDato89.mjs.map
846
+ //# sourceMappingURL=SpecialCharactersPlugin.native-DaG4b19I.mjs.map
@@ -1,4 +1,5 @@
1
- const a = () => ({
1
+ import { a as h } from "./inlineFormatting-DJ0-NZtx.mjs";
2
+ const s = () => ({
2
3
  name: "strikethrough",
3
4
  // Schema definition for strikethrough mark
4
5
  marks: {
@@ -29,17 +30,11 @@ const a = () => ({
29
30
  /**
30
31
  * Toggle strikethrough formatting on current selection
31
32
  */
32
- toggleStrikethrough: () => {
33
- const t = c();
34
- if (!t) return !1;
35
- const n = window.getSelection();
36
- if (!n || n.rangeCount === 0) return !1;
37
- const e = n.getRangeAt(0);
38
- if (!t.contains(e.commonAncestorContainer)) return !1;
39
- t.focus({ preventScroll: !0 });
40
- const o = document.execCommand("strikeThrough", !1);
41
- return s(t), t.dispatchEvent(new Event("input", { bubbles: !0 })), o !== !1;
42
- }
33
+ toggleStrikethrough: (t, r) => h({
34
+ command: "strikeThrough",
35
+ context: r,
36
+ normalize: l
37
+ })
43
38
  },
44
39
  // Keyboard shortcuts
45
40
  keymap: {
@@ -47,27 +42,18 @@ const a = () => ({
47
42
  "Mod-Shift-X": "toggleStrikethrough"
48
43
  }
49
44
  });
50
- function c() {
51
- const t = window.getSelection();
52
- if (t && t.rangeCount > 0) {
53
- const e = t.getRangeAt(0).startContainer, o = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement, r = o == null ? void 0 : o.closest('[contenteditable="true"], .rte-content, .editora-content');
54
- if (r) return r;
55
- }
56
- const n = document.activeElement;
57
- return n ? n.getAttribute("contenteditable") === "true" ? n : n.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
58
- }
59
- function s(t) {
45
+ function l(t) {
60
46
  t.querySelectorAll("strike, del").forEach((e) => {
61
- var r;
47
+ var a;
62
48
  const o = document.createElement("s");
63
49
  for (const i of Array.from(e.attributes))
64
50
  i.name !== "style" && o.setAttribute(i.name, i.value);
65
51
  for (; e.firstChild; )
66
52
  o.appendChild(e.firstChild);
67
- (r = e.parentNode) == null || r.replaceChild(o, e);
53
+ (a = e.parentNode) == null || a.replaceChild(o, e);
68
54
  });
69
55
  }
70
56
  export {
71
- a as StrikethroughPlugin
57
+ s as StrikethroughPlugin
72
58
  };
73
- //# sourceMappingURL=StrikethroughPlugin.native-0Be7j49s.mjs.map
59
+ //# sourceMappingURL=StrikethroughPlugin.native-V0TL4F48.mjs.map