@editora/core 1.0.6 → 1.0.8

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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
  3. package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
  4. package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
  5. package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
  6. package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
  7. package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
  8. package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
  9. package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
  10. package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
  11. package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
  12. package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
  13. package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
  14. package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
  15. package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
  16. package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
  17. package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
  18. package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
  19. package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
  20. package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
  21. package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
  22. package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +86 -77
  23. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
  24. package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
  25. package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
  26. package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
  27. package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
  28. package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
  29. package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
  30. package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
  31. package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
  32. package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
  33. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  34. package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
  35. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  36. package/dist/editora.min.js +13 -13
  37. package/dist/editora.umd.js +13 -13
  38. package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
  39. package/dist/index-BslAFzmv.mjs +16544 -0
  40. package/dist/index-D1LOqg5C.js +10 -0
  41. package/dist/{index-OwnkG39N.mjs → index-DqC57IEH.mjs} +438 -328
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
  44. package/dist/index.esm.js +2 -2
  45. package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
  46. package/dist/plugin-loader.js +77 -40
  47. package/dist/webcomponent-core.js +456 -346
  48. package/dist/webcomponent-core.min.css +1 -1
  49. package/dist/webcomponent-core.min.js +87 -107
  50. package/dist/webcomponent.cjs.js +1 -1
  51. package/dist/webcomponent.esm.js +1 -1
  52. package/dist/webcomponent.js +503 -356
  53. package/dist/webcomponent.min.css +1 -1
  54. package/dist/webcomponent.min.js +6003 -658
  55. package/package.json +2 -2
  56. package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
  57. package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
  58. package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
  59. package/dist/documentManager-irzj9n3V.mjs +0 -37627
  60. package/dist/index-CqWQFb3D.js +0 -10
@@ -1,6 +1,14 @@
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
- const v = /* @__PURE__ */ new Set([
3
+ const h = (e, n) => {
4
+ if (n === e.innerHTML) return;
5
+ const t = window.execEditorCommand || window.executeEditorCommand;
6
+ if (typeof t == "function")
7
+ try {
8
+ t("recordDomTransaction", e, n, e.innerHTML);
9
+ } catch (r) {
10
+ }
11
+ }, x = /* @__PURE__ */ new Set([
4
12
  "DIV",
5
13
  "P",
6
14
  "BLOCKQUOTE",
@@ -14,7 +22,7 @@ const v = /* @__PURE__ */ new Set([
14
22
  "LI",
15
23
  "TD",
16
24
  "TH"
17
- ]), x = () => {
25
+ ]), N = () => {
18
26
  p || typeof document == "undefined" || (p = document.createElement("style"), p.textContent = `
19
27
  .rte-page-break {
20
28
  display: block;
@@ -87,28 +95,28 @@ const v = /* @__PURE__ */ new Set([
87
95
  }
88
96
  }
89
97
  `, document.head.appendChild(p));
90
- }, N = () => {
98
+ }, T = () => {
91
99
  const e = window.getSelection();
92
100
  if (!e || e.rangeCount === 0) return null;
93
101
  const n = e.getRangeAt(0), t = n.startContainer.nodeType === Node.ELEMENT_NODE ? n.startContainer : n.startContainer.parentElement;
94
- return (t == null ? void 0 : t.closest(g)) || null;
95
- }, h = () => {
96
- const e = N();
102
+ return (t == null ? void 0 : t.closest(f)) || null;
103
+ }, w = () => {
104
+ const e = T();
97
105
  if (e) return e;
98
- const n = document.activeElement, t = n == null ? void 0 : n.closest(g);
99
- return t || document.querySelector(g);
100
- }, C = (e, n) => {
106
+ const n = document.activeElement, t = n == null ? void 0 : n.closest(f);
107
+ return t || document.querySelector(f);
108
+ }, E = (e, n) => {
101
109
  let t = e;
102
110
  for (; t && t !== n; ) {
103
111
  if (t.nodeType === Node.ELEMENT_NODE) {
104
112
  const r = t;
105
- if (v.has(r.tagName))
113
+ if (x.has(r.tagName))
106
114
  return r;
107
115
  }
108
116
  t = t.parentNode;
109
117
  }
110
118
  return null;
111
- }, w = () => {
119
+ }, C = () => {
112
120
  const e = document.createElement("div");
113
121
  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;
114
122
  }, S = (e) => {
@@ -122,7 +130,7 @@ const v = /* @__PURE__ */ new Set([
122
130
  const r = t;
123
131
  t = t.previousElementSibling, r.remove();
124
132
  }
125
- }, k = (e) => {
133
+ }, v = (e) => {
126
134
  var r;
127
135
  const n = e.nextElementSibling;
128
136
  if (n && !n.matches(u))
@@ -144,7 +152,7 @@ const v = /* @__PURE__ */ new Set([
144
152
  } else
145
153
  t.selectNodeContents(e), t.collapse(!1);
146
154
  n.removeAllRanges(), n.addRange(t);
147
- }, f = (e, n) => {
155
+ }, g = (e, n) => {
148
156
  let t = e;
149
157
  for (; t; ) {
150
158
  if (!(t instanceof HTMLElement && t.matches(u)))
@@ -159,81 +167,82 @@ const v = /* @__PURE__ */ new Set([
159
167
  if (r < 0) return;
160
168
  const o = document.createRange();
161
169
  o.setStart(t, r), o.setEnd(t, r + 1), n.removeAllRanges(), n.addRange(o), e.focus({ preventScroll: !0 });
162
- }, L = (e) => {
170
+ }, y = (e) => {
163
171
  if (e.collapsed || e.startContainer !== e.endContainer || e.endOffset !== e.startOffset + 1 || !(e.startContainer instanceof Element || e.startContainer instanceof DocumentFragment)) return null;
164
172
  const n = e.startContainer.childNodes[e.startOffset];
165
173
  return n instanceof HTMLElement && n.matches(u) ? n : null;
166
- }, T = (e, n, t) => {
174
+ }, B = (e, n, t) => {
167
175
  if (!e.collapsed) return null;
168
- const { startContainer: r, startOffset: o } = e, i = (a) => a instanceof HTMLElement && a.matches(u) ? a : null, s = (a) => {
176
+ const { startContainer: r, startOffset: o } = e, a = (i) => i instanceof HTMLElement && i.matches(u) ? i : null, s = (i) => {
169
177
  if (r.nodeType === Node.ELEMENT_NODE) {
170
- const c = r;
171
- if (a === "previous") {
178
+ const l = r;
179
+ if (i === "previous") {
172
180
  if (o > 0)
173
- return c.childNodes[o - 1] || null;
174
- } else if (o < c.childNodes.length)
175
- return c.childNodes[o] || null;
181
+ return l.childNodes[o - 1] || null;
182
+ } else if (o < l.childNodes.length)
183
+ return l.childNodes[o] || null;
176
184
  }
177
- if (r.nodeType === Node.TEXT_NODE && (a === "previous" && o < r.data.length || a === "next" && o > 0))
185
+ if (r.nodeType === Node.TEXT_NODE && (i === "previous" && o < r.data.length || i === "next" && o > 0))
178
186
  return null;
179
- let l = r;
180
- for (; l && l !== n; ) {
181
- const c = a === "previous" ? l.previousSibling : l.nextSibling;
182
- if (c) return c;
183
- l = l.parentNode;
187
+ let c = r;
188
+ for (; c && c !== n; ) {
189
+ const l = i === "previous" ? c.previousSibling : c.nextSibling;
190
+ if (l) return l;
191
+ c = c.parentNode;
184
192
  }
185
193
  return null;
186
194
  };
187
195
  if (r.nodeType === Node.ELEMENT_NODE) {
188
- const a = r;
189
- return t === "Backspace" && o > 0 ? i(a.childNodes[o - 1] || null) : t === "Delete" ? i(a.childNodes[o] || null) : null;
196
+ const i = r;
197
+ return t === "Backspace" && o > 0 ? a(i.childNodes[o - 1] || null) : t === "Delete" ? a(i.childNodes[o] || null) : null;
190
198
  }
191
199
  if (r.nodeType === Node.TEXT_NODE) {
192
- const a = r;
200
+ const i = r;
193
201
  if (t === "Backspace" && o === 0) {
194
- const l = i(a.previousSibling);
195
- return l || i(s("previous"));
202
+ const c = a(i.previousSibling);
203
+ return c || a(s("previous"));
196
204
  }
197
- if (t === "Delete" && o === a.data.length) {
198
- const l = i(a.nextSibling);
199
- return l || i(s("next"));
205
+ if (t === "Delete" && o === i.data.length) {
206
+ const c = a(i.nextSibling);
207
+ return c || a(s("next"));
200
208
  }
201
209
  }
202
- return i(s(t === "Backspace" ? "previous" : "next"));
203
- }, E = (e, n) => {
204
- const t = e.closest(g), r = e.previousSibling, o = e.nextSibling;
210
+ return a(s(t === "Backspace" ? "previous" : "next"));
211
+ }, k = (e, n) => {
212
+ var c;
213
+ const t = e.closest(f), r = (c = t == null ? void 0 : t.innerHTML) != null ? c : "", o = e.previousSibling, a = e.nextSibling;
205
214
  e.remove();
206
- const i = f(r, "previous"), s = f(o, "next");
215
+ const s = g(o, "previous"), i = g(a, "next");
207
216
  if (n === "Backspace") {
208
- if (i)
209
- b(i);
210
- else if (s)
211
- d(s);
217
+ if (s)
218
+ b(s);
219
+ else if (i)
220
+ d(i);
212
221
  else if (t) {
213
- const a = document.createElement("p");
214
- a.innerHTML = "<br>", t.appendChild(a), d(a);
222
+ const l = document.createElement("p");
223
+ l.innerHTML = "<br>", t.appendChild(l), d(l);
215
224
  }
216
- } else if (s)
217
- d(s);
218
- else if (i)
219
- b(i);
225
+ } else if (i)
226
+ d(i);
227
+ else if (s)
228
+ b(s);
220
229
  else if (t) {
221
- const a = document.createElement("p");
222
- a.innerHTML = "<br>", t.appendChild(a), d(a);
230
+ const l = document.createElement("p");
231
+ l.innerHTML = "<br>", t.appendChild(l), d(l);
223
232
  }
224
- return t && t.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
225
- }, R = () => {
226
- const e = h();
233
+ return t && (h(t, r), t.dispatchEvent(new Event("input", { bubbles: !0 }))), !0;
234
+ }, D = () => {
235
+ const e = w();
227
236
  if (!e) return !1;
228
- const n = window.getSelection();
229
- if (!n) return !1;
230
- let t;
231
- n.rangeCount > 0 && e.contains(n.getRangeAt(0).commonAncestorContainer) ? t = n.getRangeAt(0) : (t = document.createRange(), t.selectNodeContents(e), t.collapse(!1), n.removeAllRanges(), n.addRange(t));
232
- const r = C(t.endContainer, e) || C(t.startContainer, e), o = w();
233
- r && r.parentNode ? r.parentNode.insertBefore(o, r.nextSibling) : e.appendChild(o), S(o);
234
- const i = k(o);
235
- return d(i), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
236
- }, B = () => {
237
+ const n = e.innerHTML, t = window.getSelection();
238
+ if (!t) return !1;
239
+ let r;
240
+ 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 = C();
242
+ o && o.parentNode ? o.parentNode.insertBefore(a, o.nextSibling) : e.appendChild(a), S(a);
243
+ const s = v(a);
244
+ return d(s), h(e, n), e.dispatchEvent(new Event("input", { bubbles: !0 })), !0;
245
+ }, R = () => {
237
246
  m || typeof document == "undefined" || (m = !0, document.addEventListener("click", (e) => {
238
247
  const n = e.target, t = n == null ? void 0 : n.closest(u);
239
248
  t && (e.preventDefault(), e.stopPropagation(), A(t));
@@ -243,55 +252,55 @@ const v = /* @__PURE__ */ new Set([
243
252
  return;
244
253
  const t = window.getSelection();
245
254
  if (!t || t.rangeCount === 0) return;
246
- const r = t.getRangeAt(0), o = h();
255
+ const r = t.getRangeAt(0), o = w();
247
256
  if (!o || !o.contains(r.commonAncestorContainer)) return;
248
- const i = L(r);
249
- if (i) {
257
+ const a = y(r);
258
+ if (a) {
250
259
  if (n === "Backspace" || n === "Delete") {
251
- e.preventDefault(), e.stopPropagation(), E(i, n);
260
+ e.preventDefault(), e.stopPropagation(), k(a, n);
252
261
  return;
253
262
  }
254
263
  if (n === "ArrowRight" || n === "ArrowDown") {
255
264
  e.preventDefault();
256
- const s = f(i.nextSibling, "next") || k(i);
265
+ const s = g(a.nextSibling, "next") || v(a);
257
266
  d(s);
258
267
  return;
259
268
  }
260
269
  if (n === "ArrowLeft" || n === "ArrowUp") {
261
270
  e.preventDefault();
262
- const s = f(i.previousSibling, "previous");
271
+ const s = g(a.previousSibling, "previous");
263
272
  s ? b(s) : d(o);
264
273
  return;
265
274
  }
266
275
  }
267
276
  if (n === "Backspace" || n === "Delete") {
268
- const s = T(
277
+ const s = B(
269
278
  r,
270
279
  o,
271
280
  n
272
281
  );
273
282
  if (!s) return;
274
- e.preventDefault(), e.stopPropagation(), E(s, n);
283
+ e.preventDefault(), e.stopPropagation(), k(s, n);
275
284
  }
276
285
  }));
277
- }, D = () => (x(), B(), {
286
+ }, P = () => (N(), R(), {
278
287
  name: "pageBreak",
279
288
  toolbar: [
280
289
  {
281
290
  label: "Page Break",
282
291
  command: "insertPageBreak",
283
- 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>',
292
+ 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>',
284
293
  shortcut: "Mod-Enter"
285
294
  }
286
295
  ],
287
296
  commands: {
288
- insertPageBreak: R
297
+ insertPageBreak: D
289
298
  },
290
299
  keymap: {
291
300
  "Mod-Enter": "insertPageBreak"
292
301
  }
293
302
  });
294
303
  export {
295
- D as PageBreakPlugin
304
+ P as PageBreakPlugin
296
305
  };
297
- //# sourceMappingURL=PageBreakPlugin.native-CGiQxXqR.mjs.map
306
+ //# sourceMappingURL=PageBreakPlugin.native-DijGuHJZ.mjs.map
@@ -1,10 +1,10 @@
1
1
  let c = !1;
2
2
  const g = () => {
3
3
  if (typeof document == "undefined") return;
4
- const r = "rte-preview-plugin-styles";
5
- if (document.getElementById(r)) return;
4
+ const i = "rte-preview-plugin-styles";
5
+ if (document.getElementById(i)) return;
6
6
  const t = document.createElement("style");
7
- t.id = r, t.textContent = `
7
+ t.id = i, t.textContent = `
8
8
  /* Preview Editor Dialog Styles */
9
9
  .rte-preview-editor-overlay {
10
10
  position: fixed !important;
@@ -225,14 +225,14 @@ const g = () => {
225
225
  }
226
226
  `, document.head.appendChild(t);
227
227
  }, v = () => {
228
- const r = window.getSelection();
229
- if (r && r.rangeCount > 0) {
230
- let e = r.getRangeAt(0).startContainer;
228
+ const i = window.getSelection();
229
+ if (i && i.rangeCount > 0) {
230
+ let e = i.getRangeAt(0).startContainer;
231
231
  for (; e && e !== document.body; ) {
232
232
  if (e.nodeType === Node.ELEMENT_NODE) {
233
- const o = e;
234
- if (o.getAttribute("contenteditable") === "true")
235
- return o;
233
+ const n = e;
234
+ if (n.getAttribute("contenteditable") === "true")
235
+ return n;
236
236
  }
237
237
  e = e.parentNode;
238
238
  }
@@ -246,36 +246,36 @@ const g = () => {
246
246
  }
247
247
  return document.querySelector('[contenteditable="true"]');
248
248
  }, h = () => {
249
- const r = v();
250
- if (!r) return "";
251
- const t = r.cloneNode(!0);
249
+ const i = v();
250
+ if (!i) return "";
251
+ const t = i.cloneNode(!0);
252
252
  return [
253
253
  ".rte-floating-toolbar",
254
254
  ".rte-selection-marker",
255
255
  ".rte-toolbar",
256
256
  ".rte-resize-handle",
257
257
  "[data-rte-internal]"
258
- ].forEach((o) => {
259
- t.querySelectorAll(o).forEach((i) => i.remove());
258
+ ].forEach((n) => {
259
+ t.querySelectorAll(n).forEach((r) => r.remove());
260
260
  }), t.innerHTML;
261
- }, w = (r) => {
261
+ }, w = (i) => {
262
262
  const t = document.createElement("div");
263
- return t.innerHTML = r, t.querySelectorAll(
263
+ return t.innerHTML = i, t.querySelectorAll(
264
264
  '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
- });
265
+ ).forEach((r) => r.remove()), t.querySelectorAll("*").forEach((r) => {
266
+ Array.from(r.attributes).forEach((o) => {
267
+ 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);
268
+ }), r.setAttribute("contenteditable", "false");
269
269
  }), t.innerHTML;
270
270
  }, u = () => {
271
271
  if (typeof window == "undefined" || c) return;
272
272
  c = !0, g();
273
- const r = h(), t = w(r), e = document.createElement("div");
273
+ const i = h(), t = w(i), e = document.createElement("div");
274
274
  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 = `
275
+ const n = document.createElement("div");
276
+ n.className = "rte-preview-editor-modal";
277
+ const r = document.createElement("div");
278
+ r.className = "rte-preview-editor-header", r.innerHTML = `
279
279
  <h2 id="preview-editor-title">Preview Editor</h2>
280
280
  <div class="rte-preview-editor-header-actions">
281
281
  <button class="rte-preview-editor-close-btn" aria-label="Close preview editor">
@@ -286,17 +286,17 @@ const g = () => {
286
286
  </button>
287
287
  </div>
288
288
  `;
289
- const n = document.createElement("div");
290
- n.className = "rte-preview-editor-body";
289
+ const o = document.createElement("div");
290
+ o.className = "rte-preview-editor-body";
291
291
  const a = document.createElement("div");
292
292
  a.className = "rte-preview-editor-content";
293
293
  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);
294
+ 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
295
  const p = () => {
296
296
  e.parentNode && e.parentNode.removeChild(e), c = !1, document.removeEventListener("keydown", s);
297
297
  }, s = (d) => {
298
298
  d.key === "Escape" && (d.preventDefault(), d.stopPropagation(), p());
299
- }, m = i.querySelector(".rte-preview-editor-close-btn");
299
+ }, m = r.querySelector(".rte-preview-editor-close-btn");
300
300
  m && m.addEventListener("click", (d) => {
301
301
  d.preventDefault(), d.stopPropagation(), p();
302
302
  }), e.addEventListener("click", (d) => {
@@ -319,4 +319,4 @@ const g = () => {
319
319
  export {
320
320
  f as PreviewPlugin
321
321
  };
322
- //# sourceMappingURL=PreviewPlugin.native-DBvfpmIv.mjs.map
322
+ //# sourceMappingURL=PreviewPlugin.native-WuIwOAOR.mjs.map