@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
@@ -1,110 +1,94 @@
1
- const A = ".rte-content, .editora-content";
2
- const y = "__editoraCommandEditorRoot", s = /* @__PURE__ */ new Map(), E = {};
1
+ const S = ".rte-content, .editora-content";
2
+ const y = "__editoraCommandEditorRoot", d = /* @__PURE__ */ new Map(), l = {};
3
3
  let T = !1, c = null;
4
- function N(t) {
5
- if (!t)
6
- return null;
4
+ function R(t) {
5
+ if (!t) return null;
7
6
  const e = t.querySelector('[contenteditable="true"]');
8
7
  return e instanceof HTMLElement ? e : null;
9
8
  }
10
- function z() {
11
- if (typeof window == "undefined")
12
- return null;
9
+ function I() {
10
+ if (typeof window == "undefined") return null;
13
11
  const t = window[y];
14
- if (!(t instanceof HTMLElement))
15
- return null;
12
+ if (!(t instanceof HTMLElement)) return null;
16
13
  window[y] = null;
17
14
  const e = t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? t : null);
18
15
  if (e) {
19
- const o = N(e);
20
- if (o)
21
- return o;
22
- if (e.getAttribute("contenteditable") === "true")
23
- return e;
16
+ const o = R(e);
17
+ if (o) return o;
18
+ if (e.getAttribute("contenteditable") === "true") return e;
24
19
  }
25
20
  if (t.getAttribute("contenteditable") === "true")
26
21
  return t;
27
22
  const n = t.closest('[contenteditable="true"]');
28
23
  return n instanceof HTMLElement ? n : null;
29
24
  }
30
- function F(t) {
25
+ function N(t) {
31
26
  return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
32
27
  }
33
- function f(t) {
34
- const e = F(t);
35
- if (!e)
36
- return null;
37
- const n = e.closest(A);
38
- if (n)
39
- return n;
28
+ function s(t) {
29
+ const e = N(t);
30
+ if (!e) return null;
31
+ const n = e.closest(S);
32
+ if (n) return n;
40
33
  const o = e.closest('[contenteditable="true"]');
41
- if (!o)
42
- return null;
34
+ if (!o) return null;
43
35
  let r = o, i = r.parentElement;
44
36
  for (; i; )
45
37
  i.getAttribute("contenteditable") === "true" && (r = i), i = i.parentElement;
46
38
  return r;
47
39
  }
48
- function l() {
49
- const t = z();
40
+ function E() {
41
+ const t = I();
50
42
  if (t && document.contains(t))
51
43
  return t;
52
44
  const e = window.getSelection();
53
45
  if (e && e.rangeCount > 0) {
54
- const i = f(e.getRangeAt(0).startContainer);
55
- if (i)
56
- return i;
46
+ const i = s(e.getRangeAt(0).startContainer);
47
+ if (i) return i;
57
48
  }
58
49
  const n = document.activeElement;
59
50
  if (n) {
60
- const i = f(n);
61
- if (i)
62
- return i;
51
+ const i = s(n);
52
+ if (i) return i;
63
53
  }
64
- if (c != null && c.isConnected)
65
- return c;
66
- const o = Array.from(s.keys()).find((i) => i.isConnected);
67
- if (o)
68
- return o;
69
- const r = document.querySelector(A);
54
+ if (c != null && c.isConnected) return c;
55
+ const o = Array.from(d.keys()).find((i) => i.isConnected);
56
+ if (o) return o;
57
+ const r = document.querySelector(S);
70
58
  return r || document.querySelector('[contenteditable="true"]');
71
59
  }
72
- function L() {
73
- for (const t of s.keys())
74
- t.isConnected || (s.delete(t), c === t && (c = null));
60
+ function A() {
61
+ for (const t of d.keys())
62
+ t.isConnected || (d.delete(t), c === t && (c = null));
75
63
  }
76
- function M(t) {
77
- L();
78
- let e = s.get(t);
79
- return e || (e = { undoStack: [], redoStack: [] }, s.set(t, e)), e;
64
+ function C(t) {
65
+ A();
66
+ let e = d.get(t);
67
+ return e || (e = { undoStack: [], redoStack: [] }, d.set(t, e)), e;
80
68
  }
81
- function d(t) {
69
+ function a(t) {
82
70
  t && t.dispatchEvent(new Event("input", { bubbles: !0 }));
83
71
  }
84
- function h(t) {
85
- return t ? t.innerHTML : "";
86
- }
87
- function m(t, e) {
88
- if (!t)
89
- return;
90
- const n = M(t);
72
+ function f(t, e) {
73
+ if (!t) return;
74
+ const n = C(t);
91
75
  n.undoStack.push(e), n.redoStack.length = 0, n.undoStack.length > 100 && n.undoStack.splice(0, n.undoStack.length - 100), c = t;
92
76
  }
93
- function v(t, e = "undo") {
94
- if (L(), t != null && t.isConnected)
77
+ function h(t, e = "undo") {
78
+ if (A(), t != null && t.isConnected)
95
79
  return t;
96
- const n = l();
80
+ const n = E();
97
81
  if (n != null && n.isConnected)
98
82
  return n;
99
83
  if (c != null && c.isConnected)
100
84
  return c;
101
85
  const o = (r) => e === "undo" ? r.undoStack.length > 0 : r.redoStack.length > 0;
102
- for (const [r, i] of s.entries())
86
+ for (const [r, i] of d.entries())
103
87
  if (r.isConnected && o(i))
104
88
  return r;
105
89
  return null;
106
90
  }
107
- function H(t) {
91
+ function g(t) {
108
92
  const e = {};
109
93
  for (const r of t.getAttributeNames()) {
110
94
  const i = t.getAttribute(r);
@@ -125,87 +109,69 @@ function w(t, e) {
125
109
  }), t.innerHTML !== e.innerHTML && (t.innerHTML = e.innerHTML), e.value !== null && (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) && (t.value = e.value), e.checked !== null && t instanceof HTMLInputElement && (t.checked = e.checked);
126
110
  }
127
111
  function u(t, e) {
128
- if (E[t] = e, typeof window == "undefined")
129
- return;
112
+ if (l[t] = e, typeof window == "undefined") return;
130
113
  const n = window.registerEditorCommand;
131
114
  typeof n == "function" ? n(t, e) : (window.registerEditorCommand = (o, r) => {
132
- E[o] = r;
115
+ l[o] = r;
133
116
  }, window.registerEditorCommand(t, e));
134
117
  }
135
- const S = (t, ...e) => {
136
- const n = E[t];
118
+ const H = (t, ...e) => {
119
+ const n = l[t];
137
120
  return n ? n(...e) : !1;
138
121
  };
139
- function C() {
140
- T || typeof window == "undefined" || (T = !0, window.execEditorCommand || (window.execEditorCommand = S), window.executeEditorCommand || (window.executeEditorCommand = S), u("undo", k), u("redo", O), u("setAttribute", D), u("setText", _), u("autoFixA11y", R), u("recordDomTransaction", I), u("undoDom", b), u("redoDom", p));
141
- }
142
- function x(t, e) {
143
- const n = e || l(), o = h(n);
144
- n == null || n.focus({ preventScroll: !0 });
145
- let r = !1;
146
- try {
147
- r = !!document.execCommand(t, !1);
148
- } catch (g) {
149
- r = !1;
150
- }
151
- const i = h(n), a = o !== i;
152
- return a && d(n), { executed: r, changed: a };
153
- }
154
- const k = () => {
155
- const t = l();
156
- return x("undo", t).changed ? !0 : b(t != null ? t : void 0);
157
- }, O = () => {
158
- const t = l();
159
- return x("redo", t).changed ? !0 : p(t != null ? t : void 0);
160
- }, D = (t, e, n) => {
161
- if (!(t instanceof HTMLElement))
162
- return;
163
- const o = f(t), r = t.hasAttribute(e), i = t.getAttribute(e);
164
- t.setAttribute(e, n), m(o, {
122
+ function m() {
123
+ T || typeof window == "undefined" || (T = !0, window.execEditorCommand || (window.execEditorCommand = H), window.executeEditorCommand || (window.executeEditorCommand = H), u("undo", L), u("redo", x), u("setAttribute", k), u("setText", v), u("autoFixA11y", O), u("recordDomTransaction", D), u("undoDom", M), u("redoDom", b));
124
+ }
125
+ const L = () => {
126
+ const t = E();
127
+ return M(t != null ? t : void 0);
128
+ }, x = () => {
129
+ const t = E();
130
+ return b(t != null ? t : void 0);
131
+ }, k = (t, e, n) => {
132
+ if (!(t instanceof HTMLElement)) return;
133
+ const o = s(t), r = t.hasAttribute(e), i = t.getAttribute(e);
134
+ t.setAttribute(e, n), f(o, {
165
135
  undo: () => {
166
136
  t.isConnected && (r && i !== null ? t.setAttribute(e, i) : t.removeAttribute(e));
167
137
  },
168
138
  redo: () => {
169
139
  t.isConnected && t.setAttribute(e, n);
170
140
  }
171
- }), d(o);
172
- }, _ = (t, e) => {
141
+ }), a(o);
142
+ }, v = (t, e) => {
173
143
  var r;
174
- if (!(t instanceof HTMLElement))
175
- return;
176
- const n = f(t), o = (r = t.textContent) != null ? r : "";
177
- t.textContent = e, m(n, {
144
+ if (!(t instanceof HTMLElement)) return;
145
+ const n = s(t), o = (r = t.textContent) != null ? r : "";
146
+ t.textContent = e, f(n, {
178
147
  undo: () => {
179
148
  t.isConnected && (t.textContent = o);
180
149
  },
181
150
  redo: () => {
182
151
  t.isConnected && (t.textContent = e);
183
152
  }
184
- }), d(n);
185
- }, R = (t) => {
186
- var a;
153
+ }), a(n);
154
+ }, O = (t) => {
155
+ var p;
187
156
  const e = t == null ? void 0 : t.element;
188
- if (!(e instanceof HTMLElement))
189
- return;
190
- const n = f(e), o = (a = window.a11yRuleRegistry) == null ? void 0 : a.find((g) => g.id === t.rule);
191
- if (!o || typeof o.fix != "function")
192
- return;
193
- const r = H(e);
157
+ if (!(e instanceof HTMLElement)) return;
158
+ const n = s(e), o = (p = window.a11yRuleRegistry) == null ? void 0 : p.find((_) => _.id === t.rule);
159
+ if (!o || typeof o.fix != "function") return;
160
+ const r = g(e);
194
161
  o.fix(t);
195
- const i = H(e);
196
- m(n, {
162
+ const i = g(e);
163
+ f(n, {
197
164
  undo: () => {
198
165
  e.isConnected && w(e, r);
199
166
  },
200
167
  redo: () => {
201
168
  e.isConnected && w(e, i);
202
169
  }
203
- }), d(n);
204
- }, I = (t, e, n) => {
205
- if (!(t instanceof HTMLElement))
206
- return !1;
170
+ }), a(n);
171
+ }, D = (t, e, n) => {
172
+ if (!(t instanceof HTMLElement)) return !1;
207
173
  const o = typeof n == "string" ? n : t.innerHTML;
208
- return e === o ? !1 : (m(t, {
174
+ return e === o ? !1 : (f(t, {
209
175
  undo: () => {
210
176
  t.isConnected && (t.innerHTML = e);
211
177
  },
@@ -213,21 +179,19 @@ const k = () => {
213
179
  t.isConnected && (t.innerHTML = o);
214
180
  }
215
181
  }), !0);
182
+ }, M = (t) => {
183
+ const e = h(t, "undo");
184
+ if (!e) return !1;
185
+ const n = C(e), o = n.undoStack.pop();
186
+ return o ? (o.undo(), n.redoStack.push(o), c = e, a(e), !0) : !1;
216
187
  }, b = (t) => {
217
- const e = v(t, "undo");
218
- if (!e)
219
- return !1;
220
- const n = M(e), o = n.undoStack.pop();
221
- return o ? (o.undo(), n.redoStack.push(o), c = e, d(e), !0) : !1;
222
- }, p = (t) => {
223
- const e = v(t, "redo");
224
- if (!e)
225
- return !1;
226
- const n = M(e), o = n.redoStack.pop();
227
- return o ? (o.redo(), n.undoStack.push(o), c = e, d(e), !0) : !1;
188
+ const e = h(t, "redo");
189
+ if (!e) return !1;
190
+ const n = C(e), o = n.redoStack.pop();
191
+ return o ? (o.redo(), n.undoStack.push(o), c = e, a(e), !0) : !1;
228
192
  };
229
- typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", C, { once: !0 }) : C());
230
- const Y = () => (C(), {
193
+ typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", m, { once: !0 }) : m());
194
+ const z = () => (m(), {
231
195
  name: "history",
232
196
  toolbar: [
233
197
  {
@@ -246,14 +210,14 @@ const Y = () => (C(), {
246
210
  }
247
211
  ],
248
212
  commands: {
249
- undo: k,
250
- redo: O,
251
- setAttribute: D,
252
- setText: _,
253
- autoFixA11y: R,
254
- recordDomTransaction: I,
255
- undoDom: b,
256
- redoDom: p
213
+ undo: L,
214
+ redo: x,
215
+ setAttribute: k,
216
+ setText: v,
217
+ autoFixA11y: O,
218
+ recordDomTransaction: D,
219
+ undoDom: M,
220
+ redoDom: b
257
221
  },
258
222
  keymap: {
259
223
  "Mod-z": "undo",
@@ -265,14 +229,14 @@ const Y = () => (C(), {
265
229
  }
266
230
  });
267
231
  export {
268
- Y as HistoryPlugin,
269
- R as autoFixA11y,
270
- I as recordDomTransaction,
271
- O as redo,
272
- p as redoDom,
273
- D as setAttribute,
274
- _ as setText,
275
- k as undo,
276
- b as undoDom
232
+ z as HistoryPlugin,
233
+ O as autoFixA11y,
234
+ D as recordDomTransaction,
235
+ x as redo,
236
+ b as redoDom,
237
+ k as setAttribute,
238
+ v as setText,
239
+ L as undo,
240
+ M as undoDom
277
241
  };
278
- //# sourceMappingURL=HistoryPlugin.native-92ed4be4.mjs.map
242
+ //# sourceMappingURL=HistoryPlugin.native-D2wl32jV.mjs.map
@@ -16,8 +16,7 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
16
16
  if (n.getAttribute("contenteditable") === "true")
17
17
  return n;
18
18
  const t = n.closest('[contenteditable="true"]');
19
- if (t)
20
- return t;
19
+ if (t) return t;
21
20
  }
22
21
  return document.querySelector('[contenteditable="true"]');
23
22
  }, l = (e) => {
@@ -50,8 +49,7 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
50
49
  {
51
50
  acceptNode: (r) => {
52
51
  const a = r;
53
- if (!s(a))
54
- return NodeFilter.FILTER_SKIP;
52
+ if (!s(a)) return NodeFilter.FILTER_SKIP;
55
53
  if (typeof e.intersectsNode == "function")
56
54
  return e.intersectsNode(a) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
57
55
  const u = document.createRange();
@@ -73,8 +71,7 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
73
71
  }
74
72
  return 0;
75
73
  }, p = (e, n) => {
76
- if (n === e.innerHTML)
77
- return;
74
+ if (n === e.innerHTML) return;
78
75
  const t = window.execEditorCommand || window.executeEditorCommand;
79
76
  if (typeof t == "function")
80
77
  try {
@@ -83,17 +80,13 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
83
80
  }
84
81
  }, h = () => {
85
82
  const e = m();
86
- if (!e)
87
- return !1;
83
+ if (!e) return !1;
88
84
  const n = window.getSelection();
89
- if (!n || n.rangeCount === 0)
90
- return !1;
85
+ if (!n || n.rangeCount === 0) return !1;
91
86
  const t = n.getRangeAt(0);
92
- if (!e.contains(t.commonAncestorContainer))
93
- return !1;
87
+ if (!e.contains(t.commonAncestorContainer)) return !1;
94
88
  const o = E(t, e);
95
- if (o.length === 0)
96
- return !1;
89
+ if (o.length === 0) return !1;
97
90
  const c = e.innerHTML;
98
91
  return o.forEach((i) => {
99
92
  const r = T(i) + 40;
@@ -101,17 +94,13 @@ const s = (e) => ["P", "DIV", "H1", "H2", "H3", "H4", "H5", "H6", "LI", "BLOCKQU
101
94
  }), p(e, c), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
102
95
  }, N = () => {
103
96
  const e = m();
104
- if (!e)
105
- return !1;
97
+ if (!e) return !1;
106
98
  const n = window.getSelection();
107
- if (!n || n.rangeCount === 0)
108
- return !1;
99
+ if (!n || n.rangeCount === 0) return !1;
109
100
  const t = n.getRangeAt(0);
110
- if (!e.contains(t.commonAncestorContainer))
111
- return !1;
101
+ if (!e.contains(t.commonAncestorContainer)) return !1;
112
102
  const o = E(t, e);
113
- if (o.length === 0)
114
- return !1;
103
+ if (o.length === 0) return !1;
115
104
  const c = e.innerHTML;
116
105
  return o.forEach((i) => {
117
106
  const d = T(i), r = Math.max(0, d - 40);
@@ -158,4 +147,4 @@ export {
158
147
  N as decreaseIndent,
159
148
  h as increaseIndent
160
149
  };
161
- //# sourceMappingURL=IndentPlugin.native-e4ee902b.mjs.map
150
+ //# sourceMappingURL=IndentPlugin.native-BHixp8sP.mjs.map
@@ -1,11 +1,15 @@
1
- const i = () => (document.execCommand("italic", !1), !0), a = (o, l) => {
2
- var t;
3
- typeof window != "undefined" && ((t = window.registerEditorCommand) == null || t.call(window, o, l));
4
- }, e = () => {
5
- a("toggleItalic", i);
1
+ import { a as l } from "./inlineFormatting-DJ0-NZtx.mjs";
2
+ const a = (e, t) => l({
3
+ command: "italic",
4
+ context: t
5
+ }), n = (e, t) => {
6
+ var i;
7
+ typeof window != "undefined" && ((i = window.registerEditorCommand) == null || i.call(window, e, t));
8
+ }, o = () => {
9
+ n("toggleItalic", a);
6
10
  };
7
- typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e());
8
- const n = () => ({
11
+ typeof window != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", o) : o());
12
+ const c = () => ({
9
13
  name: "italic",
10
14
  marks: {
11
15
  italic: {
@@ -29,7 +33,7 @@ const n = () => ({
29
33
  }
30
34
  ],
31
35
  commands: {
32
- toggleItalic: i
36
+ toggleItalic: a
33
37
  },
34
38
  keymap: {
35
39
  "Mod-i": "toggleItalic",
@@ -37,7 +41,7 @@ const n = () => ({
37
41
  }
38
42
  });
39
43
  export {
40
- n as ItalicPlugin,
41
- i as toggleItalic
44
+ c as ItalicPlugin,
45
+ a as toggleItalic
42
46
  };
43
- //# sourceMappingURL=ItalicPlugin.native-7c95cfbc.mjs.map
47
+ //# sourceMappingURL=ItalicPlugin.native-CmnlwFHB.mjs.map
@@ -35,8 +35,7 @@ const g = [
35
35
  if (t.getAttribute("contenteditable") === "true")
36
36
  return t;
37
37
  const n = t.closest('[contenteditable="true"]');
38
- if (n)
39
- return n;
38
+ if (n) return n;
40
39
  }
41
40
  return document.querySelector('[contenteditable="true"]');
42
41
  }, u = (e) => {
@@ -46,8 +45,7 @@ const g = [
46
45
  const n = t;
47
46
  if (d(n))
48
47
  return n;
49
- if (n.getAttribute("contenteditable") === "true")
50
- break;
48
+ if (n.getAttribute("contenteditable") === "true") break;
51
49
  }
52
50
  t = t.parentNode;
53
51
  }
@@ -64,8 +62,7 @@ const g = [
64
62
  {
65
63
  acceptNode: (i) => {
66
64
  const c = i;
67
- if (!d(c))
68
- return NodeFilter.FILTER_SKIP;
65
+ if (!d(c)) return NodeFilter.FILTER_SKIP;
69
66
  if (typeof e.intersectsNode == "function")
70
67
  return e.intersectsNode(c) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
71
68
  const l = document.createRange();
@@ -80,8 +77,7 @@ const g = [
80
77
  }, L = (e) => {
81
78
  e.dispatchEvent(new Event("input", { bubbles: !0 }));
82
79
  }, b = (e, t) => {
83
- if (t === e.innerHTML)
84
- return;
80
+ if (t === e.innerHTML) return;
85
81
  const n = window.execEditorCommand || window.executeEditorCommand;
86
82
  if (typeof n == "function")
87
83
  try {
@@ -89,21 +85,16 @@ const g = [
89
85
  } catch (o) {
90
86
  }
91
87
  }, h = (e) => {
92
- if (!e)
93
- return !1;
88
+ if (!e) return !1;
94
89
  try {
95
90
  const t = E();
96
- if (!t)
97
- return !1;
91
+ if (!t) return !1;
98
92
  const n = window.getSelection();
99
- if (!n || n.rangeCount === 0)
100
- return !1;
93
+ if (!n || n.rangeCount === 0) return !1;
101
94
  const o = n.getRangeAt(0);
102
- if (!t.contains(o.commonAncestorContainer))
103
- return !1;
95
+ if (!t.contains(o.commonAncestorContainer)) return !1;
104
96
  const r = H(o, t);
105
- if (r.length === 0)
106
- return !1;
97
+ if (r.length === 0) return !1;
107
98
  const s = t.innerHTML;
108
99
  return r.forEach((a) => {
109
100
  a.style.lineHeight = e;
@@ -157,4 +148,4 @@ export {
157
148
  N as LineHeightPlugin,
158
149
  h as setLineHeight
159
150
  };
160
- //# sourceMappingURL=LineHeightPlugin.native-5668f78c.mjs.map
151
+ //# sourceMappingURL=LineHeightPlugin.native-CM7iXdQj.mjs.map
@@ -1,7 +1,6 @@
1
1
  let a = null, u = !1, l = null;
2
2
  const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
3
- if (!e)
4
- return null;
3
+ if (!e) return null;
5
4
  let t = e;
6
5
  for (; t; ) {
7
6
  if (t.hasAttribute("contenteditable") && t.getAttribute("contenteditable") === "true" || t.hasAttribute("data-editora-content"))
@@ -12,14 +11,12 @@ const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
12
11
  }, C = (e) => {
13
12
  if (e) {
14
13
  const o = e.startContainer, n = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement;
15
- if (n != null && n.closest(p))
16
- return !0;
14
+ if (n != null && n.closest(p)) return !0;
17
15
  }
18
16
  const t = document.activeElement;
19
17
  return t != null && t.closest(p) ? !0 : document.body.matches(p) || document.documentElement.matches(p);
20
18
  }, T = () => {
21
- if (document.getElementById("rte-link-dialog-theme-styles"))
22
- return;
19
+ if (document.getElementById("rte-link-dialog-theme-styles")) return;
23
20
  const e = document.createElement("style");
24
21
  e.id = "rte-link-dialog-theme-styles", e.textContent = `
25
22
  .link-dialog-overlay.rte-theme-dark .link-dialog {
@@ -205,8 +202,7 @@ const p = '[data-theme="dark"], .dark, .editora-theme-dark', w = (e) => {
205
202
  }), setTimeout(() => i.focus(), 100);
206
203
  }, x = () => {
207
204
  const e = window.getSelection();
208
- if (!e || e.rangeCount === 0)
209
- return !1;
205
+ if (!e || e.rangeCount === 0) return !1;
210
206
  const t = e.getRangeAt(0).cloneRange();
211
207
  a = t;
212
208
  const o = C(t), n = e.toString() || "", r = t.startContainer, i = r.nodeType === Node.TEXT_NODE ? r.parentElement : r, d = i == null ? void 0 : i.closest("a");
@@ -284,4 +280,4 @@ export {
284
280
  x as openLinkDialog,
285
281
  h as removeLink
286
282
  };
287
- //# sourceMappingURL=LinkPlugin.native-6df29111.mjs.map
283
+ //# sourceMappingURL=LinkPlugin.native-DYCIcdTm.mjs.map
@@ -3,8 +3,7 @@ function g() {
3
3
  const o = window.getSelection();
4
4
  if (o && o.rangeCount > 0) {
5
5
  const t = o.getRangeAt(0).startContainer, r = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement, e = r == null ? void 0 : r.closest('[contenteditable="true"], .rte-content, .editora-content');
6
- if (e)
7
- return e;
6
+ if (e) return e;
8
7
  }
9
8
  const n = document.activeElement;
10
9
  return n ? n.getAttribute("contenteditable") === "true" ? n : n.closest('[contenteditable="true"], .rte-content, .editora-content') : null;
@@ -37,14 +36,11 @@ function f(o) {
37
36
  }
38
37
  function m(o) {
39
38
  const n = g();
40
- if (!n)
41
- return !1;
39
+ if (!n) return !1;
42
40
  const t = window.getSelection();
43
- if (!t || t.rangeCount === 0)
44
- return !1;
41
+ if (!t || t.rangeCount === 0) return !1;
45
42
  const r = t.getRangeAt(0);
46
- if (!n.contains(r.commonAncestorContainer))
47
- return !1;
43
+ if (!n.contains(r.commonAncestorContainer)) return !1;
48
44
  n.focus({ preventScroll: !0 });
49
45
  const e = document.execCommand(o, !1);
50
46
  return f(n), n.dispatchEvent(new Event("input", { bubbles: !0 })), e !== !1;
@@ -107,4 +103,4 @@ export {
107
103
  d as toggleBulletList,
108
104
  u as toggleOrderedList
109
105
  };
110
- //# sourceMappingURL=ListPlugin.native-fe2e115a.mjs.map
106
+ //# sourceMappingURL=ListPlugin.native-V7EZC1lM.mjs.map