@editora/core 1.0.9 → 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 (99) hide show
  1. package/README.md +1 -1
  2. package/dist/{A11yCheckerPlugin.native-58d12bed.mjs → A11yCheckerPlugin.native-BRdGYMju.mjs} +12 -23
  3. package/dist/{AnchorPlugin.native-289a112a.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +102 -112
  4. package/dist/{ApprovalWorkflowPlugin.native-449ce66c.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +173 -209
  5. package/dist/{BackgroundColorPlugin.native-8aceb5cc.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +9 -16
  6. package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
  7. package/dist/{BlocksLibraryPlugin.native-1cc51e63.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +149 -205
  8. package/dist/{BoldPlugin.native-f9d7f8e4.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
  9. package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
  10. package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
  11. package/dist/{CitationsPlugin.native-169fb1e8.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +196 -261
  12. package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
  13. package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
  14. package/dist/{CodeSamplePlugin.native-6cc0148e.mjs → CodeSamplePlugin.native-CgGoH-X4.mjs} +10 -19
  15. package/dist/{CommentsPlugin.native-03659874.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +28 -55
  16. package/dist/{ConditionalContentPlugin.native-4983143a.mjs → ConditionalContentPlugin.native-CfhY46rU.mjs} +51 -108
  17. package/dist/{ContentRulesPlugin.native-63ed405b.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +153 -200
  18. package/dist/{DataBindingPlugin.native-427e9d75.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +88 -124
  19. package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
  20. package/dist/{DocSchemaPlugin.native-8e41eda0.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +112 -166
  21. package/dist/{DocumentManagerPlugin.native-e69895ad.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +4 -4
  22. package/dist/EmbedIframePlugin.native-BF_-LjTq.mjs +740 -0
  23. package/dist/{EmojisPlugin.native-65c5ac47.mjs → EmojisPlugin.native-CitxxlWX.mjs} +6 -11
  24. package/dist/{FontFamilyPlugin.native-f9bc255a.mjs → FontFamilyPlugin.native-j8hMTbg4.mjs} +4 -7
  25. package/dist/{FontSizePlugin.native-f5647872.mjs → FontSizePlugin.native-B_jCh7dY.mjs} +10 -19
  26. package/dist/{FootnotePlugin.native-494657b3.mjs → FootnotePlugin.native-D730OGRm.mjs} +39 -77
  27. package/dist/{FullscreenPlugin.native-87ce92e9.mjs → FullscreenPlugin.native-ChXyxeNw.mjs} +1 -1
  28. package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
  29. package/dist/{HistoryPlugin.native-92ed4be4.mjs → HistoryPlugin.native-D2wl32jV.mjs} +107 -143
  30. package/dist/{IndentPlugin.native-e4ee902b.mjs → IndentPlugin.native-BHixp8sP.mjs} +12 -23
  31. package/dist/{ItalicPlugin.native-7c95cfbc.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
  32. package/dist/{LineHeightPlugin.native-5668f78c.mjs → LineHeightPlugin.native-CM7iXdQj.mjs} +10 -19
  33. package/dist/{LinkPlugin.native-6df29111.mjs → LinkPlugin.native-DYCIcdTm.mjs} +5 -9
  34. package/dist/{ListPlugin.native-fe2e115a.mjs → ListPlugin.native-V7EZC1lM.mjs} +5 -9
  35. package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
  36. package/dist/{MediaManagerPlugin.native-3cf48a00.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +11 -21
  37. package/dist/{MentionPlugin.native-3b1e8c05.mjs → MentionPlugin.native-BMDlOqur.mjs} +45 -89
  38. package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
  39. package/dist/{PIIRedactionPlugin.native-7ab10b9f.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +210 -260
  40. package/dist/{PageBreakPlugin.native-1794c5fb.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +16 -31
  41. package/dist/{PreviewPlugin.native-f7b67cc0.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +6 -11
  42. package/dist/{PrintPlugin.native-f6a168c2.mjs → PrintPlugin.native-7qt5v7L5.mjs} +3 -5
  43. package/dist/{SlashCommandsPlugin.native-8d45e511.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +36 -71
  44. package/dist/{SmartPastePlugin.native-a6c5efec.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +173 -219
  45. package/dist/{SpecialCharactersPlugin.native-7f06d4ba.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +101 -85
  46. package/dist/{SpellCheckPlugin.native-04e20834.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +21 -41
  47. package/dist/{StrikethroughPlugin.native-905e9501.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -30
  48. package/dist/{TablePlugin.native-7d5458c1.mjs → TablePlugin.native-DrHX-efe.mjs} +30 -58
  49. package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
  50. package/dist/{TextAlignmentPlugin.native-9357b3ed.mjs → TextAlignmentPlugin.native-sM_1s00t.mjs} +6 -11
  51. package/dist/{TextColorPlugin.native-d53ed459.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +14 -26
  52. package/dist/{TrackChangesPlugin.native-e96da509.mjs → TrackChangesPlugin.native-Bghu2q4a.mjs} +58 -115
  53. package/dist/{TranslationWorkflowPlugin.native-4e711b1e.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +191 -257
  54. package/dist/{UnderlinePlugin.native-8080c998.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
  55. package/dist/{VersionDiffPlugin.native-5bbeff85.mjs → VersionDiffPlugin.native-Bvxgy--t.mjs} +26 -51
  56. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  57. package/dist/{anchoredPopover-5cca53ba.mjs → anchoredPopover-Bxds0VoB.mjs} +1 -1
  58. package/dist/core.css +1 -0
  59. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  60. package/dist/{editorContainerHelpers-69585c07.mjs → editorContainerHelpers-C7kdWnS0.mjs} +2 -3
  61. package/dist/editora.min.js +13 -14
  62. package/dist/editora.umd.js +13 -14
  63. package/dist/{html2canvas.esm-c51cb3b9.mjs → html2canvas.esm-AYkPY5LS.mjs} +894 -978
  64. package/dist/index-BslAFzmv.mjs +16544 -0
  65. package/dist/index-CPMGUZfB.js +10 -0
  66. package/dist/{index-7da30697.mjs → index-DBoj6QfW.mjs} +127 -164
  67. package/dist/index.cjs.js +1 -1
  68. package/dist/index.es-BYD2KEo6.mjs +6666 -0
  69. package/dist/index.esm.js +7 -12
  70. package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
  71. package/dist/{jspdf.es.min-780c82db.mjs → jspdf.es.min-BJGtOnRT.mjs} +3784 -4808
  72. package/dist/plugin-loader.js +67 -67
  73. package/dist/{purify.es-3bdbcfc5.mjs → purify.es-CKpwg8Tk.mjs} +10 -20
  74. package/dist/webcomponent-core.js +131 -168
  75. package/dist/webcomponent-core.min.css +1 -1
  76. package/dist/webcomponent-core.min.js +139 -63
  77. package/dist/webcomponent.cjs.js +1 -1
  78. package/dist/webcomponent.esm.js +1 -1
  79. package/dist/webcomponent.js +191 -228
  80. package/dist/webcomponent.min.css +1 -1
  81. package/dist/webcomponent.min.js +1240 -1344
  82. package/package.json +1 -1
  83. package/dist/BlockquotePlugin.native-3541c714.mjs +0 -49
  84. package/dist/CapitalizationPlugin.native-42c135dc.mjs +0 -80
  85. package/dist/ChecklistPlugin.native-3b397ee9.mjs +0 -330
  86. package/dist/ClearFormattingPlugin.native-77baa514.mjs +0 -145
  87. package/dist/CodePlugin.native-989cf0aa.mjs +0 -2740
  88. package/dist/DirectionPlugin.native-4e742f42.mjs +0 -139
  89. package/dist/EmbedIframePlugin.native-55209c87.mjs +0 -568
  90. package/dist/HeadingPlugin.native-e38c4a16.mjs +0 -64
  91. package/dist/MathPlugin.native-735bbac2.mjs +0 -296
  92. package/dist/MergeTagPlugin.native-31cf7d48.mjs +0 -584
  93. package/dist/TemplatePlugin.native-580f0f63.mjs +0 -617
  94. package/dist/_commonjsHelpers-69d58be2.mjs +0 -31
  95. package/dist/documentManager-8327fb6e.mjs +0 -9166
  96. package/dist/index-072ef022.js +0 -11
  97. package/dist/index-49d31221.mjs +0 -16860
  98. package/dist/index.es-b47a189f.mjs +0 -5782
  99. package/dist/style.css +0 -1
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { P as g, E as y, a as b, T as f, R as v } from "./index-7da30697.mjs";
2
- import { C as G, h as O, F as V, K, i as B, S as W, b as X, e as _, d as Y, g as J, f as Q, c as Z } from "./index-7da30697.mjs";
1
+ import { P as g, E as y, a as b, T as f, R as v } from "./index-DBoj6QfW.mjs";
2
+ import { C as G, h as O, F as V, K, i as B, S as W, b as X, e as _, d as Y, g as J, f as Q, c as Z } from "./index-DBoj6QfW.mjs";
3
3
  class L {
4
4
  constructor(e) {
5
5
  if (this.listeners = [], e instanceof g)
@@ -715,8 +715,7 @@ class j {
715
715
  }
716
716
  attachPreviewListeners() {
717
717
  const e = document.querySelector(".table-dialog-form");
718
- if (!e)
719
- return;
718
+ if (!e) return;
720
719
  const t = e.querySelector("#table-rows"), i = e.querySelector("#table-cols"), n = e.querySelector("#table-header"), o = e.querySelector("#table-preview-content"), s = () => {
721
720
  const a = parseInt((t == null ? void 0 : t.value) || "3", 10), r = parseInt((i == null ? void 0 : i.value) || "3", 10), d = n == null ? void 0 : n.checked;
722
721
  o && (o.textContent = `${a} rows × ${r} columns${d ? " with header" : ""}`);
@@ -835,8 +834,7 @@ class $ {
835
834
  }
836
835
  attachImagePreview() {
837
836
  const e = document.querySelector(".image-dialog-form");
838
- if (!e)
839
- return;
837
+ if (!e) return;
840
838
  const t = e.querySelector("#image-src"), i = e.querySelector("#image-preview"), n = e.querySelector("#preview-img");
841
839
  t == null || t.addEventListener("input", () => {
842
840
  const o = t.value.trim();
@@ -846,17 +844,14 @@ class $ {
846
844
  });
847
845
  }
848
846
  attachFileUpload() {
849
- if (!this.config.allowUpload)
850
- return;
847
+ if (!this.config.allowUpload) return;
851
848
  const e = document.querySelector(".image-dialog-form");
852
- if (!e)
853
- return;
849
+ if (!e) return;
854
850
  const t = e.querySelector("#image-upload"), i = e.querySelector("#image-src");
855
851
  t == null || t.addEventListener("change", async (n) => {
856
852
  var a;
857
853
  const o = (a = n.target.files) == null ? void 0 : a[0];
858
- if (!o)
859
- return;
854
+ if (!o) return;
860
855
  const s = new FileReader();
861
856
  s.onload = (r) => {
862
857
  var h;
@@ -0,0 +1,97 @@
1
+ const f = "data-editora-selection-marker";
2
+ function w(e) {
3
+ return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
4
+ }
5
+ function m(e) {
6
+ return e ? e.getAttribute("contenteditable") === "true" ? e : e.querySelector('[contenteditable="true"]') : null;
7
+ }
8
+ function y(e) {
9
+ var r;
10
+ if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
11
+ const t = m((r = e == null ? void 0 : e.editorElement) != null ? r : null);
12
+ if (t) return t;
13
+ const n = typeof window != "undefined" ? window.__editoraCommandEditorRoot : null, o = n instanceof HTMLElement ? m(n) : null;
14
+ if (o) return o;
15
+ const l = window.getSelection();
16
+ if (l && l.rangeCount > 0) {
17
+ const a = w(l.getRangeAt(0).startContainer), i = a == null ? void 0 : a.closest('.rte-content, .editora-content, [contenteditable="true"]');
18
+ if (i instanceof HTMLElement) return i;
19
+ }
20
+ const c = document.activeElement;
21
+ if (c instanceof HTMLElement) {
22
+ const a = c.closest('.rte-content, .editora-content, [contenteditable="true"]');
23
+ if (a instanceof HTMLElement) return a;
24
+ }
25
+ return document.querySelector('.rte-content, .editora-content, [contenteditable="true"]');
26
+ }
27
+ function R(e) {
28
+ const t = window.getSelection();
29
+ if (!t || t.rangeCount === 0) return !1;
30
+ const n = t.getRangeAt(0);
31
+ return e.contains(n.startContainer) && e.contains(n.endContainer);
32
+ }
33
+ function E(e) {
34
+ const t = document.createElement("span");
35
+ return t.setAttribute(f, e), t.style.display = "inline-block", t.style.width = "0", t.style.height = "0", t.style.overflow = "hidden", t.style.lineHeight = "0", t.appendChild(document.createTextNode("\uFEFF")), t;
36
+ }
37
+ function b(e) {
38
+ const t = window.getSelection();
39
+ if (!t || t.rangeCount === 0) return null;
40
+ const n = t.getRangeAt(0);
41
+ if (!e.contains(n.startContainer) || !e.contains(n.endContainer))
42
+ return null;
43
+ const o = n.collapsed, l = E("start"), c = o ? null : E("end"), r = n.cloneRange();
44
+ if (c) {
45
+ const i = r.cloneRange();
46
+ i.collapse(!1), i.insertNode(c);
47
+ }
48
+ const a = r.cloneRange();
49
+ return a.collapse(!0), a.insertNode(l), () => {
50
+ const i = window.getSelection(), s = document.createRange(), d = e.querySelector(
51
+ `[${f}="start"]`
52
+ ), u = e.querySelector(
53
+ `[${f}="end"]`
54
+ );
55
+ if (!i || !d) {
56
+ e.querySelectorAll(`[${f}]`).forEach((g) => g.remove());
57
+ return;
58
+ }
59
+ o || !u ? (s.setStartBefore(d), s.collapse(!0)) : (s.setStartAfter(d), s.setEndBefore(u)), i.removeAllRanges(), i.addRange(s), d.remove(), u == null || u.remove();
60
+ };
61
+ }
62
+ function p(e, t, n) {
63
+ if (t !== n) {
64
+ if (typeof window.execEditorCommand == "function") {
65
+ window.execEditorCommand("recordDomTransaction", e, t, n);
66
+ return;
67
+ }
68
+ if (typeof window.executeEditorCommand == "function")
69
+ try {
70
+ window.executeEditorCommand("recordDomTransaction", { editor: e, beforeHTML: t, afterHTML: n });
71
+ } catch (o) {
72
+ }
73
+ }
74
+ }
75
+ function S(e) {
76
+ const t = y(e.context);
77
+ if (!t) return !1;
78
+ const n = t.innerHTML;
79
+ R(t) && t.focus({ preventScroll: !0 });
80
+ let o = !1;
81
+ try {
82
+ o = document.execCommand(e.command, !1);
83
+ } catch (r) {
84
+ o = !1;
85
+ }
86
+ const l = t.innerHTML;
87
+ if (e.normalize && l !== n) {
88
+ const r = b(t);
89
+ e.normalize(t), r == null || r();
90
+ }
91
+ const c = t.innerHTML;
92
+ return n !== c && (p(t, n, c), t.dispatchEvent(new Event("input", { bubbles: !0 }))), o !== !1 || n !== c;
93
+ }
94
+ export {
95
+ S as a
96
+ };
97
+ //# sourceMappingURL=inlineFormatting-DJ0-NZtx.mjs.map