@editora/core 1.0.7 → 1.0.9

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 (87) hide show
  1. package/README.md +5 -0
  2. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
  3. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
  4. package/dist/ApprovalWorkflowPlugin.native-449ce66c.mjs +1115 -0
  5. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
  6. package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
  7. package/dist/BlocksLibraryPlugin.native-1cc51e63.mjs +1386 -0
  8. package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
  9. package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
  10. package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
  11. package/dist/CitationsPlugin.native-169fb1e8.mjs +1532 -0
  12. package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
  13. package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
  14. package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
  15. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
  16. package/dist/ConditionalContentPlugin.native-4983143a.mjs +1424 -0
  17. package/dist/ContentRulesPlugin.native-63ed405b.mjs +1149 -0
  18. package/dist/DataBindingPlugin.native-427e9d75.mjs +956 -0
  19. package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
  20. package/dist/DocSchemaPlugin.native-8e41eda0.mjs +1382 -0
  21. package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
  22. package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
  23. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
  24. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
  25. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
  26. package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
  27. package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
  28. package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
  29. package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
  30. package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
  31. package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
  32. package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
  33. package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
  34. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
  35. package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
  36. package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
  37. package/dist/MentionPlugin.native-3b1e8c05.mjs +778 -0
  38. package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
  39. package/dist/PIIRedactionPlugin.native-7ab10b9f.mjs +1449 -0
  40. package/dist/{PageBreakPlugin.native-CXdX5fAv.mjs → PageBreakPlugin.native-1794c5fb.mjs} +67 -52
  41. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-f7b67cc0.mjs} +38 -33
  42. package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
  43. package/dist/SlashCommandsPlugin.native-8d45e511.mjs +790 -0
  44. package/dist/SmartPastePlugin.native-a6c5efec.mjs +1447 -0
  45. package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
  46. package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
  47. package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
  48. package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
  49. package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
  50. package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
  51. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
  52. package/dist/TrackChangesPlugin.native-e96da509.mjs +818 -0
  53. package/dist/TranslationWorkflowPlugin.native-4e711b1e.mjs +1797 -0
  54. package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
  55. package/dist/VersionDiffPlugin.native-5bbeff85.mjs +801 -0
  56. package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
  57. package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
  58. package/dist/documentManager-8327fb6e.mjs +9166 -0
  59. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
  60. package/dist/editora.min.js +14 -13
  61. package/dist/editora.umd.js +14 -13
  62. package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
  63. package/dist/index-072ef022.js +11 -0
  64. package/dist/index-49d31221.mjs +16860 -0
  65. package/dist/{index-yzU4NdPT.mjs → index-7da30697.mjs} +490 -358
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-b47a189f.mjs +5782 -0
  68. package/dist/index.esm.js +12 -7
  69. package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
  70. package/dist/plugin-loader.js +77 -40
  71. package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
  72. package/dist/style.css +1 -0
  73. package/dist/webcomponent-core.js +546 -414
  74. package/dist/webcomponent-core.min.css +1 -1
  75. package/dist/webcomponent-core.min.js +40 -39
  76. package/dist/webcomponent.cjs.js +1 -1
  77. package/dist/webcomponent.esm.js +1 -1
  78. package/dist/webcomponent.js +484 -315
  79. package/dist/webcomponent.min.css +1 -1
  80. package/dist/webcomponent.min.js +6035 -558
  81. package/package.json +11 -5
  82. package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
  83. package/dist/core.css +0 -1
  84. package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
  85. package/dist/index-BpE6GFbz.js +0 -10
  86. package/dist/index-BslAFzmv.mjs +0 -16544
  87. package/dist/index.es-BYD2KEo6.mjs +0 -6666
@@ -1,14 +1,15 @@
1
- const u = '.rte-page-break[data-type="page-break"]', g = ".rte-content, .editora-content";
1
+ const u = '.rte-page-break[data-type="page-break"]', f = ".rte-content, .editora-content";
2
2
  let p = null, m = !1;
3
3
  const h = (e, n) => {
4
- if (n === e.innerHTML) return;
4
+ if (n === e.innerHTML)
5
+ return;
5
6
  const t = window.execEditorCommand || window.executeEditorCommand;
6
7
  if (typeof t == "function")
7
8
  try {
8
9
  t("recordDomTransaction", e, n, e.innerHTML);
9
10
  } catch (r) {
10
11
  }
11
- }, v = /* @__PURE__ */ new Set([
12
+ }, x = /* @__PURE__ */ new Set([
12
13
  "DIV",
13
14
  "P",
14
15
  "BLOCKQUOTE",
@@ -22,7 +23,7 @@ const h = (e, n) => {
22
23
  "LI",
23
24
  "TD",
24
25
  "TH"
25
- ]), w = () => {
26
+ ]), N = () => {
26
27
  p || typeof document == "undefined" || (p = document.createElement("style"), p.textContent = `
27
28
  .rte-page-break {
28
29
  display: block;
@@ -95,28 +96,30 @@ const h = (e, n) => {
95
96
  }
96
97
  }
97
98
  `, document.head.appendChild(p));
98
- }, N = () => {
99
+ }, T = () => {
99
100
  const e = window.getSelection();
100
- if (!e || e.rangeCount === 0) return null;
101
+ if (!e || e.rangeCount === 0)
102
+ return null;
101
103
  const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
102
- return (t == null ? void 0 : t.closest(g)) || null;
103
- }, k = () => {
104
- const e = N();
105
- if (e) return e;
106
- const n = document.activeElement, t = n == null ? void 0 : n.closest(g);
107
- return t || document.querySelector(g);
104
+ return (t == null ? void 0 : t.closest(f)) || null;
105
+ }, w = () => {
106
+ const e = T();
107
+ if (e)
108
+ return e;
109
+ const n = document.activeElement, t = n == null ? void 0 : n.closest(f);
110
+ return t || document.querySelector(f);
108
111
  }, E = (e, n) => {
109
112
  let t = e;
110
113
  for (; t && t !== n; ) {
111
114
  if (t.nodeType === Node.ELEMENT_NODE) {
112
115
  const r = t;
113
- if (v.has(r.tagName))
116
+ if (x.has(r.tagName))
114
117
  return r;
115
118
  }
116
119
  t = t.parentNode;
117
120
  }
118
121
  return null;
119
- }, T = () => {
122
+ }, C = () => {
120
123
  const e = document.createElement("div");
121
124
  return e.className = "rte-page-break", e.setAttribute("data-page-break", "true"), e.setAttribute("data-type", "page-break"), e.setAttribute("contenteditable", "false"), e.setAttribute("tabindex", "0"), e.setAttribute("role", "separator"), e.setAttribute("aria-label", "Page break"), e;
122
125
  }, S = (e) => {
@@ -130,7 +133,7 @@ const h = (e, n) => {
130
133
  const r = t;
131
134
  t = t.previousElementSibling, r.remove();
132
135
  }
133
- }, x = (e) => {
136
+ }, v = (e) => {
134
137
  var r;
135
138
  const n = e.nextElementSibling;
136
139
  if (n && !n.matches(u))
@@ -139,12 +142,14 @@ const h = (e, n) => {
139
142
  return t.innerHTML = "<br>", (r = e.parentNode) == null || r.insertBefore(t, e.nextSibling), t;
140
143
  }, d = (e) => {
141
144
  const n = window.getSelection();
142
- if (!n) return;
145
+ if (!n)
146
+ return;
143
147
  const t = document.createRange();
144
148
  e.nodeType, Node.TEXT_NODE, t.setStart(e, 0), t.collapse(!0), n.removeAllRanges(), n.addRange(t);
145
149
  }, b = (e) => {
146
150
  const n = window.getSelection();
147
- if (!n) return;
151
+ if (!n)
152
+ return;
148
153
  const t = document.createRange();
149
154
  if (e.nodeType === Node.TEXT_NODE) {
150
155
  const r = e;
@@ -152,7 +157,7 @@ const h = (e, n) => {
152
157
  } else
153
158
  t.selectNodeContents(e), t.collapse(!1);
154
159
  n.removeAllRanges(), n.addRange(t);
155
- }, f = (e, n) => {
160
+ }, g = (e, n) => {
156
161
  let t = e;
157
162
  for (; t; ) {
158
163
  if (!(t instanceof HTMLElement && t.matches(u)))
@@ -160,19 +165,23 @@ const h = (e, n) => {
160
165
  t = n === "previous" ? t.previousSibling : t.nextSibling;
161
166
  }
162
167
  return null;
163
- }, L = (e) => {
168
+ }, A = (e) => {
164
169
  const n = window.getSelection();
165
- if (!n || !e.parentNode) return;
170
+ if (!n || !e.parentNode)
171
+ return;
166
172
  const t = e.parentNode, r = Array.from(t.childNodes).indexOf(e);
167
- if (r < 0) return;
173
+ if (r < 0)
174
+ return;
168
175
  const o = document.createRange();
169
176
  o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
170
- }, A = (e) => {
171
- if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
177
+ }, y = (e) => {
178
+ if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment))
179
+ return null;
172
180
  const n = e.startContainer.childNodes[e.startOffset];
173
181
  return n instanceof HTMLElement && n.matches(u) ? n : null;
174
- }, R = (e, n, t) => {
175
- if (!e.collapsed) return null;
182
+ }, B = (e, n, t) => {
183
+ if (!e.collapsed)
184
+ return null;
176
185
  const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
177
186
  if (r.nodeType === Node.ELEMENT_NODE) {
178
187
  const l = r;
@@ -187,7 +196,8 @@ const h = (e, n) => {
187
196
  let c = r;
188
197
  for (; c && c !== n; ) {
189
198
  const l = i === "previous" ? c.previousSibling : c.nextSibling;
190
- if (l) return l;
199
+ if (l)
200
+ return l;
191
201
  c = c.parentNode;
192
202
  }
193
203
  return null;
@@ -208,11 +218,11 @@ const h = (e, n) => {
208
218
  }
209
219
  }
210
220
  return a(s(t === "Backspace" ? "previous" : "next"));
211
- }, C = (e, n) => {
221
+ }, k = (e, n) => {
212
222
  var c;
213
- const t = e.closest(g), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
223
+ const t = e.closest(f), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
214
224
  e.remove();
215
- const s = f(o, "previous"), i = f(a, "next");
225
+ const s = g(o, "previous"), i = g(a, "next");
216
226
  if (n === "Backspace") {
217
227
  if (s)
218
228
  b(s);
@@ -231,76 +241,81 @@ const h = (e, n) => {
231
241
  l.innerHTML = "<br>", t.appendChild(l), d(l);
232
242
  }
233
243
  return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
234
- }, y = () => {
235
- const e = k();
236
- if (!e) return !1;
244
+ }, D = () => {
245
+ const e = w();
246
+ if (!e)
247
+ return !1;
237
248
  const n = e.innerHTML, t = window.getSelection();
238
- if (!t) return !1;
249
+ if (!t)
250
+ return !1;
239
251
  let r;
240
252
  t.rangeCount > 0 && e.contains(t.getRangeAt(0).commonAncestorContainer) ? r = t.getRangeAt(0) : (r = document.createRange(), r.selectNodeContents(e), r.collapse(!1), t.removeAllRanges(), t.addRange(r));
241
- const o = E(r.endContainer, e) || E(r.startContainer, e), a = T();
253
+ const o = E(r.endContainer, e) || E(r.startContainer, e), a = C();
242
254
  o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
243
- const s = x(a);
255
+ const s = v(a);
244
256
  return d(s), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
245
- }, B = () => {
257
+ }, R = () => {
246
258
  m || typeof document == "undefined" || (m = !0, document.addEventListener("click", (e) => {
247
259
  const n = e.target, t = n == null ? void 0 : n.closest(u);
248
- t && (e.preventDefault(), e.stopPropagation(), L(t));
260
+ t && (e.preventDefault(), e.stopPropagation(), A(t));
249
261
  }), document.addEventListener("keydown", (e) => {
250
262
  const n = e.key;
251
263
  if (!["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n))
252
264
  return;
253
265
  const t = window.getSelection();
254
- if (!t || t.rangeCount === 0) return;
255
- const r = t.getRangeAt(0), o = k();
256
- if (!o || !o.contains(r.commonAncestorContainer)) return;
257
- const a = A(r);
266
+ if (!t || t.rangeCount === 0)
267
+ return;
268
+ const r = t.getRangeAt(0), o = w();
269
+ if (!o || !o.contains(r.commonAncestorContainer))
270
+ return;
271
+ const a = y(r);
258
272
  if (a) {
259
273
  if (n === "Backspace" || n === "Delete") {
260
- e.preventDefault(), e.stopPropagation(), C(a, n);
274
+ e.preventDefault(), e.stopPropagation(), k(a, n);
261
275
  return;
262
276
  }
263
277
  if (n === "ArrowRight" || n === "ArrowDown") {
264
278
  e.preventDefault();
265
- const s = f(a.nextSibling, "next") || x(a);
279
+ const s = g(a.nextSibling, "next") || v(a);
266
280
  d(s);
267
281
  return;
268
282
  }
269
283
  if (n === "ArrowLeft" || n === "ArrowUp") {
270
284
  e.preventDefault();
271
- const s = f(a.previousSibling, "previous");
285
+ const s = g(a.previousSibling, "previous");
272
286
  s ? b(s) : d(o);
273
287
  return;
274
288
  }
275
289
  }
276
290
  if (n === "Backspace" || n === "Delete") {
277
- const s = R(
291
+ const s = B(
278
292
  r,
279
293
  o,
280
294
  n
281
295
  );
282
- if (!s) return;
283
- e.preventDefault(), e.stopPropagation(), C(s, n);
296
+ if (!s)
297
+ return;
298
+ e.preventDefault(), e.stopPropagation(), k(s, n);
284
299
  }
285
300
  }));
286
- }, D = () => (w(), B(), {
301
+ }, P = () => (N(), R(), {
287
302
  name: "pageBreak",
288
303
  toolbar: [
289
304
  {
290
305
  label: "Page Break",
291
306
  command: "insertPageBreak",
292
- icon: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 14 14" 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="M1,6 L3,6 C3.55228475,6 4,6.44771525 4,7 C4,7.55228475 3.55228475,8 3,8 L1,8 C0.44771525,8 0,7.55228475 0,7 C0,6.44771525 0.44771525,6 1,6 Z M11,6 L13,6 C13.5522847,6 14,6.44771525 14,7 C14,7.55228475 13.5522847,8 13,8 L11,8 C10.4477153,8 10,7.55228475 10,7 C10,6.44771525 10.4477153,6 11,6 Z M6,6 L8,6 C8.55228475,6 9,6.44771525 9,7 C9,7.55228475 8.55228475,8 8,8 L6,8 C5.44771525,8 5,7.55228475 5,7 C5,6.44771525 5.44771525,6 6,6 Z M0,1 C0,0.44771525 0.44771525,-2.26485497e-13 1,-2.26485497e-13 C1.55228475,-2.26485497e-13 2,0.44771525 2,1 L2,3.0142458 L12,3.0142458 L12,1 C12,0.44771525 12.4477153,-2.26485497e-13 13,-2.26485497e-13 C13.5522847,-2.26485497e-13 14,0.44771525 14,1 L14,3.0142458 C14,4.1188153 13.1045695,5.0142458 12,5.0142458 L2,5.0142458 C0.8954305,5.0142458 0,4.1188153 0,3.0142458 L0,1 Z M0,13.0142458 L0,11 C0,9.8954305 0.8954305,9 2,9 L12,9 C13.1045695,9 14,9.8954305 14,11 L14,13.0142458 C14,13.5665305 13.5522847,14.0142458 13,14.0142458 C12.4477153,14.0142458 12,13.5665305 12,13.0142458 L12,11 L2,11 L2,13.0142458 C2,13.5665305 1.55228475,14.0142458 1,14.0142458 C0.44771525,14.0142458 0,13.5665305 0,13.0142458 Z"></path></g></svg>',
307
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path d="M5 5H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M5 9H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/><path d="M5 15H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-dasharray="3.2 3.2"/><path d="M5 19H19" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></svg>',
293
308
  shortcut: "Mod-Enter"
294
309
  }
295
310
  ],
296
311
  commands: {
297
- insertPageBreak: y
312
+ insertPageBreak: D
298
313
  },
299
314
  keymap: {
300
315
  "Mod-Enter": "insertPageBreak"
301
316
  }
302
317
  });
303
318
  export {
304
- D as PageBreakPlugin
319
+ P as PageBreakPlugin
305
320
  };
306
- //# sourceMappingURL=PageBreakPlugin.native-CXdX5fAv.mjs.map
321
+ //# sourceMappingURL=PageBreakPlugin.native-1794c5fb.mjs.map
@@ -1,10 +1,12 @@
1
1
  let c = !1;
2
2
  const g = () => {
3
- if (typeof document == "undefined") return;
4
- const r = "rte-preview-plugin-styles";
5
- if (document.getElementById(r)) return;
3
+ if (typeof document == "undefined")
4
+ return;
5
+ const i = "rte-preview-plugin-styles";
6
+ if (document.getElementById(i))
7
+ return;
6
8
  const t = document.createElement("style");
7
- t.id = r, t.textContent = `
9
+ t.id = i, t.textContent = `
8
10
  /* Preview Editor Dialog Styles */
9
11
  .rte-preview-editor-overlay {
10
12
  position: fixed !important;
@@ -225,14 +227,14 @@ const g = () => {
225
227
  }
226
228
  `, document.head.appendChild(t);
227
229
  }, v = () => {
228
- const r = window.getSelection();
229
- if (r && r.rangeCount > 0) {
230
- let e = r.getRangeAt(0).startContainer;
230
+ const i = window.getSelection();
231
+ if (i && i.rangeCount > 0) {
232
+ let e = i.getRangeAt(0).startContainer;
231
233
  for (; e && e !== document.body; ) {
232
234
  if (e.nodeType === Node.ELEMENT_NODE) {
233
- const o = e;
234
- if (o.getAttribute("contenteditable") === "true")
235
- return o;
235
+ const n = e;
236
+ if (n.getAttribute("contenteditable") === "true")
237
+ return n;
236
238
  }
237
239
  e = e.parentNode;
238
240
  }
@@ -242,40 +244,43 @@ const g = () => {
242
244
  if (t.getAttribute("contenteditable") === "true")
243
245
  return t;
244
246
  const e = t.closest('[contenteditable="true"]');
245
- if (e) return e;
247
+ if (e)
248
+ return e;
246
249
  }
247
250
  return document.querySelector('[contenteditable="true"]');
248
251
  }, h = () => {
249
- const r = v();
250
- if (!r) return "";
251
- const t = r.cloneNode(!0);
252
+ const i = v();
253
+ if (!i)
254
+ return "";
255
+ const t = i.cloneNode(!0);
252
256
  return [
253
257
  ".rte-floating-toolbar",
254
258
  ".rte-selection-marker",
255
259
  ".rte-toolbar",
256
260
  ".rte-resize-handle",
257
261
  "[data-rte-internal]"
258
- ].forEach((o) => {
259
- t.querySelectorAll(o).forEach((i) => i.remove());
262
+ ].forEach((n) => {
263
+ t.querySelectorAll(n).forEach((r) => r.remove());
260
264
  }), t.innerHTML;
261
- }, w = (r) => {
265
+ }, w = (i) => {
262
266
  const t = document.createElement("div");
263
- return t.innerHTML = r, t.querySelectorAll(
267
+ return t.innerHTML = i, t.querySelectorAll(
264
268
  'script, iframe[src^="javascript:"], object, embed, form[action^="javascript:"]'
265
- ).forEach((i) => i.remove()), t.querySelectorAll("*").forEach((i) => {
266
- Array.from(i.attributes).forEach((n) => {
267
- n.name.startsWith("on") && i.removeAttribute(n.name), (n.name === "href" || n.name === "src") && n.value.startsWith("javascript:") && i.removeAttribute(n.name);
268
- });
269
+ ).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
270
+ Array.from(r.attributes).forEach((o) => {
271
+ o.name.startsWith("on") && r.removeAttribute(o.name), (o.name === "href" || o.name === "src") && o.value.startsWith("javascript:") && r.removeAttribute(o.name), o.name.toLowerCase() === "contenteditable" && r.removeAttribute(o.name);
272
+ }), r.setAttribute("contenteditable", "false");
269
273
  }), t.innerHTML;
270
274
  }, u = () => {
271
- if (typeof window == "undefined" || c) return;
275
+ if (typeof window == "undefined" || c)
276
+ return;
272
277
  c = !0, g();
273
- const r = h(), t = w(r), e = document.createElement("div");
278
+ const i = h(), t = w(i), e = document.createElement("div");
274
279
  e.className = "rte-preview-editor-overlay", e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), e.setAttribute("aria-labelledby", "preview-editor-title");
275
- const o = document.createElement("div");
276
- o.className = "rte-preview-editor-modal";
277
- const i = document.createElement("div");
278
- i.className = "rte-preview-editor-header", i.innerHTML = `
280
+ const n = document.createElement("div");
281
+ n.className = "rte-preview-editor-modal";
282
+ const r = document.createElement("div");
283
+ r.className = "rte-preview-editor-header", r.innerHTML = `
279
284
  <h2 id="preview-editor-title">Preview Editor</h2>
280
285
  <div class="rte-preview-editor-header-actions">
281
286
  <button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
@@ -286,17 +291,17 @@ const g = () => {
286
291
  </button>
287
292
  </div>
288
293
  `;
289
- const n = document.createElement("div");
290
- n.className = "rte-preview-editor-body";
294
+ const o = document.createElement("div");
295
+ o.className = "rte-preview-editor-body";
291
296
  const a = document.createElement("div");
292
297
  a.className = "rte-preview-editor-content";
293
298
  const l = document.createElement("div");
294
- l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l), n.appendChild(a), o.appendChild(i), o.appendChild(n), e.appendChild(o);
299
+ l.className = "rte-preview-editor-light-editor", l.innerHTML = t, a.appendChild(l), o.appendChild(a), n.appendChild(r), n.appendChild(o), e.appendChild(n);
295
300
  const p = () => {
296
301
  e.parentNode && e.parentNode.removeChild(e), c = !1, document.removeEventListener("keydown", s);
297
302
  }, s = (d) => {
298
303
  d.key === "Escape" && (d.preventDefault(), d.stopPropagation(), p());
299
- }, m = i.querySelector(".rte-preview-editor-close-btn");
304
+ }, m = r.querySelector(".rte-preview-editor-close-btn");
300
305
  m && m.addEventListener("click", (d) => {
301
306
  d.preventDefault(), d.stopPropagation(), p();
302
307
  }), e.addEventListener("click", (d) => {
@@ -319,4 +324,4 @@ const g = () => {
319
324
  export {
320
325
  f as PreviewPlugin
321
326
  };
322
- //# sourceMappingURL=PreviewPlugin.native-DBvfpmIv.mjs.map
327
+ //# sourceMappingURL=PreviewPlugin.native-f7b67cc0.mjs.map
@@ -240,7 +240,8 @@ const g = () => `
240
240
  }
241
241
  `, p = () => {
242
242
  var d;
243
- if (typeof window == "undefined") return !1;
243
+ if (typeof window == "undefined")
244
+ return !1;
244
245
  const a = (() => {
245
246
  const i = window.getSelection();
246
247
  if (i && i.rangeCount > 0) {
@@ -259,7 +260,8 @@ const g = () => `
259
260
  if (n.getAttribute("contenteditable") === "true")
260
261
  return n;
261
262
  const t = n.closest('[contenteditable="true"]');
262
- if (t) return t;
263
+ if (t)
264
+ return t;
263
265
  }
264
266
  return document.querySelector('[contenteditable="true"]');
265
267
  })();
@@ -308,4 +310,4 @@ const g = () => `
308
310
  export {
309
311
  b as PrintPlugin
310
312
  };
311
- //# sourceMappingURL=PrintPlugin.native-7qt5v7L5.mjs.map
313
+ //# sourceMappingURL=PrintPlugin.native-f6a168c2.mjs.map