@editora/core 1.0.8 → 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 (88) 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-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-449ce66c.mjs} +79 -40
  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-HMWKxWNs.mjs → BlocksLibraryPlugin.native-1cc51e63.mjs} +119 -60
  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-BnU0qCwR.mjs → CitationsPlugin.native-169fb1e8.mjs} +137 -69
  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-CfhY46rU.mjs → ConditionalContentPlugin.native-4983143a.mjs} +108 -51
  17. package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-63ed405b.mjs} +100 -50
  18. package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-427e9d75.mjs} +79 -40
  19. package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
  20. package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-8e41eda0.mjs} +115 -58
  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-BMDlOqur.mjs → MentionPlugin.native-3b1e8c05.mjs} +89 -45
  38. package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
  39. package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-7ab10b9f.mjs} +107 -54
  40. package/dist/{PageBreakPlugin.native-DijGuHJZ.mjs → PageBreakPlugin.native-1794c5fb.mjs} +31 -16
  41. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-f7b67cc0.mjs} +11 -6
  42. package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
  43. package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-8d45e511.mjs} +72 -37
  44. package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-a6c5efec.mjs} +99 -50
  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-Bghu2q4a.mjs → TrackChangesPlugin.native-e96da509.mjs} +115 -58
  53. package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-4e711b1e.mjs} +160 -91
  54. package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
  55. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-5bbeff85.mjs} +51 -26
  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-DqC57IEH.mjs → index-7da30697.mjs} +163 -124
  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 +67 -67
  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 +164 -125
  74. package/dist/webcomponent-core.min.css +1 -1
  75. package/dist/webcomponent-core.min.js +18 -17
  76. package/dist/webcomponent.cjs.js +1 -1
  77. package/dist/webcomponent.esm.js +1 -1
  78. package/dist/webcomponent.js +226 -187
  79. package/dist/webcomponent.min.css +1 -1
  80. package/dist/webcomponent.min.js +1324 -1117
  81. package/package.json +11 -5
  82. package/LICENSE +0 -21
  83. package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
  84. package/dist/core.css +0 -1
  85. package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
  86. package/dist/index-BslAFzmv.mjs +0 -16544
  87. package/dist/index-D1LOqg5C.js +0 -10
  88. package/dist/index.es-BYD2KEo6.mjs +0 -6666
@@ -130,7 +130,7 @@ function D(e) {
130
130
  requireBoundary: e.requireBoundary !== !1,
131
131
  includeDefaultItems: o,
132
132
  items: $(n),
133
- itemRenderer: e.itemRenderer,
133
+ itemRenderer: e.itemRenderer || ((l) => l.label),
134
134
  emptyStateText: e.emptyStateText || "No commands found",
135
135
  panelLabel: e.panelLabel || "Slash commands"
136
136
  };
@@ -138,7 +138,8 @@ function D(e) {
138
138
  const u = '[data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark';
139
139
  let v = !1;
140
140
  function B() {
141
- if (v || typeof document == "undefined") return;
141
+ if (v || typeof document == "undefined")
142
+ return;
142
143
  v = !0;
143
144
  const e = document.createElement("style");
144
145
  e.id = "rte-slash-commands-styles", e.textContent = `
@@ -238,23 +239,29 @@ function I(e) {
238
239
  return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
239
240
  }
240
241
  function F(e) {
241
- if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
242
+ if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
243
+ return e.contentElement;
242
244
  if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
243
245
  const n = e.editorElement;
244
- if (n.matches(s)) return n;
246
+ if (n.matches(s))
247
+ return n;
245
248
  const r = n.querySelector(s);
246
- if (r instanceof HTMLElement) return r;
249
+ if (r instanceof HTMLElement)
250
+ return r;
247
251
  }
248
252
  const t = window.getSelection();
249
253
  if (t && t.rangeCount > 0) {
250
254
  const n = t.getRangeAt(0).startContainer, r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, i = r == null ? void 0 : r.closest(s);
251
- if (i) return i;
255
+ if (i)
256
+ return i;
252
257
  }
253
258
  const o = document.activeElement;
254
259
  if (o) {
255
- if (o.matches(s)) return o;
260
+ if (o.matches(s))
261
+ return o;
256
262
  const n = o.closest(s);
257
- if (n) return n;
263
+ if (n)
264
+ return n;
258
265
  }
259
266
  return document.querySelector(s);
260
267
  }
@@ -266,7 +273,8 @@ function _(e) {
266
273
  }
267
274
  function E(e) {
268
275
  const t = window.getSelection();
269
- if (!t || t.rangeCount === 0) return null;
276
+ if (!t || t.rangeCount === 0)
277
+ return null;
270
278
  const o = t.getRangeAt(0);
271
279
  return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
272
280
  }
@@ -275,7 +283,8 @@ function y(e, t) {
275
283
  o && (o.removeAllRanges(), o.addRange(t), e.focus({ preventScroll: !0 }));
276
284
  }
277
285
  function j(e) {
278
- if (!e.collapsed) return null;
286
+ if (!e.collapsed)
287
+ return null;
279
288
  const t = e.startContainer, o = e.startOffset;
280
289
  if (t.nodeType === Node.TEXT_NODE) {
281
290
  const n = t;
@@ -324,7 +333,8 @@ function Q(e, t) {
324
333
  return r.remove(), e.normalize(), i;
325
334
  }
326
335
  function A(e, t) {
327
- if (!e.panel) return;
336
+ if (!e.panel)
337
+ return;
328
338
  const o = Q(e.editor, t), n = e.panel;
329
339
  n.style.display = "block", n.classList.add("show"), n.style.left = "0px", n.style.top = "0px";
330
340
  const r = n.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight;
@@ -332,14 +342,17 @@ function A(e, t) {
332
342
  d + r.height > a - 8 && (d = Math.max(8, o.top - r.height - 8)), n.style.position = "fixed", n.style.left = `${l}px`, n.style.top = `${d}px`;
333
343
  }
334
344
  function k(e, t) {
335
- if (!t) return m(e);
345
+ if (!t)
346
+ return m(e);
336
347
  const o = e.toLowerCase(), n = t.toLowerCase(), r = o.indexOf(n);
337
- if (r < 0) return m(e);
348
+ if (r < 0)
349
+ return m(e);
338
350
  const i = m(e.slice(0, r)), a = m(e.slice(r, r + t.length)), l = m(e.slice(r + t.length));
339
351
  return `${i}<mark>${a}</mark>${l}`;
340
352
  }
341
353
  function U(e, t) {
342
- if (e.panel && e.list) return;
354
+ if (e.panel && e.list)
355
+ return;
343
356
  const o = document.createElement("div");
344
357
  o.className = "rte-slash-panel", o.style.display = "none", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "false");
345
358
  const n = document.createElement("div");
@@ -347,9 +360,11 @@ function U(e, t) {
347
360
  r.preventDefault();
348
361
  }), o.addEventListener("click", (r) => {
349
362
  const i = r.target;
350
- if (!i) return;
363
+ if (!i)
364
+ return;
351
365
  const a = i.closest(".rte-slash-item");
352
- if (!a) return;
366
+ if (!a)
367
+ return;
353
368
  const l = Number(a.getAttribute("data-index"));
354
369
  Number.isFinite(l) && M(e, l);
355
370
  });
@@ -358,7 +373,8 @@ function c(e) {
358
373
  e.panel && (e.panel.style.display = "none", e.panel.classList.remove("show"), e.isOpen = !1, e.filteredItems = [], e.activeIndex = 0, e.query = "", e.replaceRange = null, e.anchorRange = null);
359
374
  }
360
375
  function W(e, t, o) {
361
- if (!t) return e.slice(0, o);
376
+ if (!t)
377
+ return e.slice(0, o);
362
378
  const n = t.toLowerCase();
363
379
  return e.filter((i) => [
364
380
  i.id,
@@ -369,7 +385,8 @@ function W(e, t, o) {
369
385
  ].join(" ").toLowerCase().includes(n)).slice(0, o);
370
386
  }
371
387
  function Z(e, t) {
372
- if (!e.list) return;
388
+ if (!e.list)
389
+ return;
373
390
  const o = e.list;
374
391
  if (o.innerHTML = "", e.filteredItems.length === 0) {
375
392
  const n = document.createElement("div");
@@ -385,7 +402,8 @@ function Z(e, t) {
385
402
  }), e.filteredItems.length > 0 && o.setAttribute("aria-activedescendant", `rte-slash-item-${e.instanceId}-${e.activeIndex}`);
386
403
  }
387
404
  function G(e, t) {
388
- if (t === e.innerHTML) return;
405
+ if (t === e.innerHTML)
406
+ return;
389
407
  const o = window.execEditorCommand || window.executeEditorCommand;
390
408
  if (typeof o == "function")
391
409
  try {
@@ -404,9 +422,11 @@ function L(e, t) {
404
422
  } catch (l) {
405
423
  }
406
424
  const o = window.getSelection();
407
- if (!o || o.rangeCount === 0) return !1;
425
+ if (!o || o.rangeCount === 0)
426
+ return !1;
408
427
  const n = o.getRangeAt(0);
409
- if (!e.contains(n.commonAncestorContainer)) return !1;
428
+ if (!e.contains(n.commonAncestorContainer))
429
+ return !1;
410
430
  n.deleteContents();
411
431
  const r = document.createElement("template");
412
432
  r.innerHTML = t;
@@ -425,9 +445,11 @@ function X(e, t) {
425
445
  } catch (a) {
426
446
  }
427
447
  const o = window.getSelection();
428
- if (!o || o.rangeCount === 0) return !1;
448
+ if (!o || o.rangeCount === 0)
449
+ return !1;
429
450
  const n = o.getRangeAt(0);
430
- if (!e.contains(n.commonAncestorContainer)) return !1;
451
+ if (!e.contains(n.commonAncestorContainer))
452
+ return !1;
431
453
  n.deleteContents();
432
454
  const r = document.createTextNode(t);
433
455
  n.insertNode(r);
@@ -490,7 +512,8 @@ function S(e, t, o) {
490
512
  const n = I(e);
491
513
  if (n && typeof n.execCommand == "function")
492
514
  try {
493
- if (n.execCommand(t, o) !== !1) return !0;
515
+ if (n.execCommand(t, o) !== !1)
516
+ return !0;
494
517
  } catch (i) {
495
518
  }
496
519
  const r = window.execEditorCommand || window.executeEditorCommand;
@@ -499,7 +522,8 @@ function S(e, t, o) {
499
522
  if (r(t, o, {
500
523
  editorElement: n,
501
524
  contentElement: e
502
- }) !== !1) return !0;
525
+ }) !== !1)
526
+ return !0;
503
527
  } catch (i) {
504
528
  }
505
529
  return J(t, o);
@@ -516,11 +540,14 @@ async function Y(e, t) {
516
540
  return t.action ? await Promise.resolve(t.action(r)) !== !1 : t.insertHTML ? L(o, t.insertHTML) : t.command ? S(o, t.command, t.commandValue) : !1;
517
541
  }
518
542
  async function M(e, t) {
519
- if (t < 0 || t >= e.filteredItems.length || !e.replaceRange) return;
543
+ if (t < 0 || t >= e.filteredItems.length || !e.replaceRange)
544
+ return;
520
545
  const o = e.filteredItems[t], n = e.editor, r = n.innerHTML, i = `${e.trigger}${e.query}`;
521
- if (!window.getSelection()) return;
546
+ if (!window.getSelection())
547
+ return;
522
548
  const l = e.replaceRange.cloneRange();
523
- if (!n.contains(l.commonAncestorContainer)) return;
549
+ if (!n.contains(l.commonAncestorContainer))
550
+ return;
524
551
  l.deleteContents();
525
552
  const d = l.cloneRange();
526
553
  d.collapse(!0), y(n, d);
@@ -533,9 +560,11 @@ async function M(e, t) {
533
560
  c(e), x ? (V(n), G(n, r)) : i && X(n, i), n.focus({ preventScroll: !0 });
534
561
  }
535
562
  function R(e, t) {
536
- if (e.filteredItems.length === 0) return;
563
+ if (e.filteredItems.length === 0)
564
+ return;
537
565
  const o = e.filteredItems.length;
538
- if (e.activeIndex = ((e.activeIndex + t) % o + o) % o, !e.list) return;
566
+ if (e.activeIndex = ((e.activeIndex + t) % o + o) % o, !e.list)
567
+ return;
539
568
  const n = Array.from(e.list.querySelectorAll(".rte-slash-item"));
540
569
  n.forEach((i, a) => {
541
570
  const l = a === e.activeIndex;
@@ -630,7 +659,8 @@ function re(e) {
630
659
  t && ((o = t.panel) != null && o.parentNode && t.panel.parentNode.removeChild(t.panel), g.delete(e));
631
660
  }
632
661
  function C(e, t, o) {
633
- if (p.has(e)) return;
662
+ if (p.has(e))
663
+ return;
634
664
  const n = {
635
665
  input: () => {
636
666
  ee(t, o);
@@ -674,12 +704,14 @@ function C(e, t, o) {
674
704
  }, 0);
675
705
  },
676
706
  mousedown: (r) => {
677
- if (!t.isOpen || !t.panel) return;
707
+ if (!t.isOpen || !t.panel)
708
+ return;
678
709
  const i = r.target;
679
710
  i && !t.panel.contains(i) && !e.contains(i) && c(t);
680
711
  },
681
712
  selectionchange: () => {
682
- if (!t.isOpen) return;
713
+ if (!t.isOpen)
714
+ return;
683
715
  const r = E(e);
684
716
  if (!r || !r.collapsed) {
685
717
  c(t);
@@ -700,9 +732,11 @@ function oe(e) {
700
732
  function ie(e) {
701
733
  b || (b = !0, f = (t) => {
702
734
  const o = t.target;
703
- if (!(o instanceof Node)) return;
735
+ if (!(o instanceof Node))
736
+ return;
704
737
  const n = P(o), r = (n == null ? void 0 : n.closest(s)) || null;
705
- if (!r) return;
738
+ if (!r)
739
+ return;
706
740
  const i = w(r, e);
707
741
  C(r, i, e);
708
742
  }, document.addEventListener("focusin", f, !0));
@@ -726,7 +760,8 @@ const ce = (e = {}) => {
726
760
  commands: {
727
761
  openSlashCommands: (o, n) => {
728
762
  const r = F(n);
729
- if (!r) return !1;
763
+ if (!r)
764
+ return !1;
730
765
  const i = w(r, t);
731
766
  return C(r, i, t), H(i, t);
732
767
  }
@@ -752,4 +787,4 @@ const ce = (e = {}) => {
752
787
  export {
753
788
  ce as SlashCommandsPlugin
754
789
  };
755
- //# sourceMappingURL=SlashCommandsPlugin.native-CmxvMEaE.mjs.map
790
+ //# sourceMappingURL=SlashCommandsPlugin.native-8d45e511.mjs.map
@@ -149,22 +149,28 @@ function te(e) {
149
149
  return e.closest(ee) || e;
150
150
  }
151
151
  function D(e) {
152
- if (!e) return null;
153
- if (e.matches(v)) return e;
152
+ if (!e)
153
+ return null;
154
+ if (e.matches(v))
155
+ return e;
154
156
  const t = e.querySelector(v);
155
157
  return t instanceof HTMLElement ? t : null;
156
158
  }
157
159
  function Oe() {
158
- if (typeof window == "undefined") return null;
160
+ if (typeof window == "undefined")
161
+ return null;
159
162
  const e = window[se];
160
- if (!(e instanceof HTMLElement)) return null;
163
+ if (!(e instanceof HTMLElement))
164
+ return null;
161
165
  window[se] = null;
162
166
  const t = D(e);
163
- if (t) return t;
167
+ if (t)
168
+ return t;
164
169
  const a = e.closest(ee);
165
170
  if (a) {
166
171
  const n = D(a);
167
- if (n) return n;
172
+ if (n)
173
+ return n;
168
174
  }
169
175
  const r = e.closest(v);
170
176
  return r instanceof HTMLElement ? r : null;
@@ -185,26 +191,33 @@ function pe(e) {
185
191
  return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
186
192
  }
187
193
  function T(e, t = !0, a = !0) {
188
- if (j(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
194
+ if (j(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
195
+ return e.contentElement;
189
196
  if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
190
197
  const s = D(e.editorElement);
191
- if (s) return s;
198
+ if (s)
199
+ return s;
192
200
  }
193
201
  const r = Oe();
194
- if (r) return r;
202
+ if (r)
203
+ return r;
195
204
  const n = window.getSelection();
196
205
  if (n && n.rangeCount > 0) {
197
206
  const s = pe(n.getRangeAt(0).startContainer), l = s == null ? void 0 : s.closest(v);
198
- if (l) return l;
207
+ if (l)
208
+ return l;
199
209
  }
200
210
  const o = document.activeElement;
201
211
  if (o) {
202
- if (o.matches(v)) return o;
212
+ if (o.matches(v))
213
+ return o;
203
214
  const s = o.closest(v);
204
- if (s) return s;
215
+ if (s)
216
+ return s;
205
217
  }
206
218
  if (a) {
207
- if (b && b.isConnected) return b;
219
+ if (b && b.isConnected)
220
+ return b;
208
221
  b && !b.isConnected && (b = null);
209
222
  }
210
223
  return t ? document.querySelector(v) : null;
@@ -213,12 +226,14 @@ function ze(e) {
213
226
  const t = e.target;
214
227
  if (t) {
215
228
  const r = t.closest(v);
216
- if (r) return r;
229
+ if (r)
230
+ return r;
217
231
  }
218
232
  const a = window.getSelection();
219
233
  if (a && a.rangeCount > 0) {
220
234
  const r = pe(a.getRangeAt(0).startContainer), n = r == null ? void 0 : r.closest(v);
221
- if (n) return n;
235
+ if (n)
236
+ return n;
222
237
  }
223
238
  return null;
224
239
  }
@@ -227,7 +242,8 @@ function B(e) {
227
242
  }
228
243
  function _e(e) {
229
244
  const t = te(e);
230
- if (B(t)) return !0;
245
+ if (B(t))
246
+ return !0;
231
247
  const a = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
232
248
  return B(a) ? !0 : B(document.documentElement) || B(document.body);
233
249
  }
@@ -276,7 +292,8 @@ function He(e) {
276
292
  if (!(s.type !== "childList" || s.removedNodes.length === 0))
277
293
  for (let l = 0; l < s.removedNodes.length; l += 1) {
278
294
  const c = s.removedNodes[l];
279
- if (c.nodeType !== Node.ELEMENT_NODE) continue;
295
+ if (c.nodeType !== Node.ELEMENT_NODE)
296
+ continue;
280
297
  const i = c;
281
298
  if ((t = i.matches) != null && t.call(i, v) || (a = i.matches) != null && a.call(i, `.${u}`) || (r = i.querySelector) != null && r.call(i, v) || (n = i.querySelector) != null && n.call(i, `.${u}`))
282
299
  return !0;
@@ -312,7 +329,8 @@ function Ie(e) {
312
329
  return e.split(/\s+/).map((a) => a.trim()).filter(Boolean).filter((a) => !/^mso/i.test(a)).filter((a) => !/^docs-/i.test(a)).filter((a) => !/^c\d+$/i.test(a)).join(" ");
313
330
  }
314
331
  function We(e) {
315
- if (!e) return { value: "", changed: !1 };
332
+ if (!e)
333
+ return { value: "", changed: !1 };
316
334
  const t = e.split(";"), a = [];
317
335
  let r = !1;
318
336
  return t.forEach((n) => {
@@ -472,12 +490,14 @@ function Ke(e, t, a, r, n) {
472
490
  }
473
491
  function ge(e) {
474
492
  const t = window.getSelection();
475
- if (!t || t.rangeCount === 0) return null;
493
+ if (!t || t.rangeCount === 0)
494
+ return null;
476
495
  const a = t.getRangeAt(0);
477
496
  return e.contains(a.commonAncestorContainer) ? a : null;
478
497
  }
479
498
  function he(e, t) {
480
- if (!e.isConnected) return;
499
+ if (!e.isConnected)
500
+ return;
481
501
  const a = window.getSelection();
482
502
  a && (a.removeAllRanges(), a.addRange(t));
483
503
  }
@@ -489,7 +509,8 @@ function Ve(e, t) {
489
509
  } catch (s) {
490
510
  }
491
511
  const a = ge(e);
492
- if (!a) return !1;
512
+ if (!a)
513
+ return !1;
493
514
  a.deleteContents();
494
515
  const r = document.createElement("template");
495
516
  r.innerHTML = t;
@@ -508,7 +529,8 @@ function je(e, t) {
508
529
  } catch (o) {
509
530
  }
510
531
  const a = ge(e);
511
- if (!a) return !1;
532
+ if (!a)
533
+ return !1;
512
534
  a.deleteContents();
513
535
  const r = document.createTextNode(t);
514
536
  a.insertNode(r);
@@ -516,7 +538,8 @@ function je(e, t) {
516
538
  return n.setStart(r, r.length), n.collapse(!0), he(e, n), !0;
517
539
  }
518
540
  function Fe(e, t) {
519
- if (t === e.innerHTML) return;
541
+ if (t === e.innerHTML)
542
+ return;
520
543
  const a = window.execEditorCommand || window.executeEditorCommand;
521
544
  if (typeof a == "function")
522
545
  try {
@@ -651,7 +674,8 @@ function Ye(e, t) {
651
674
  }
652
675
  function S(e) {
653
676
  const t = h.get(e), a = d.get(e) || O, r = M.get(e);
654
- if (!t || !a || !r) return;
677
+ if (!t || !a || !r)
678
+ return;
655
679
  Ye(t, a);
656
680
  const n = t.querySelector(".rte-smart-paste-status");
657
681
  n && (n.textContent = r.enabled ? a.labels.enabledText : a.labels.disabledText);
@@ -674,7 +698,8 @@ function S(e) {
674
698
  y && (y.textContent = String(r.lastReport.outputTextLength));
675
699
  }
676
700
  function Q(e, t) {
677
- if (!t.classList.contains("show")) return;
701
+ if (!t.classList.contains("show"))
702
+ return;
678
703
  const a = te(e).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 360), n = Math.max(10, window.innerWidth - r - 10), o = Math.min(Math.max(10, a.right - r), n), s = Math.max(10, Math.min(window.innerHeight - 10, a.top + 12));
679
704
  t.style.width = `${r}px`, t.style.left = `${o}px`, t.style.top = `${s}px`, t.style.maxHeight = `${Math.max(240, window.innerHeight - 20)}px`;
680
705
  }
@@ -684,7 +709,8 @@ function q(e, t = !1) {
684
709
  }
685
710
  function Xe(e) {
686
711
  const t = h.get(e);
687
- if (t) return t;
712
+ if (t)
713
+ return t;
688
714
  const a = d.get(e) || O || V(), r = `rte-smart-paste-panel-${$e++}`, n = document.createElement("section");
689
715
  return n.className = u, n.id = r, n.setAttribute("role", "dialog"), n.setAttribute("aria-modal", "false"), n.setAttribute("aria-label", a.labels.panelAriaLabel), n.innerHTML = `
690
716
  <header class="rte-smart-paste-header">
@@ -720,7 +746,8 @@ function Xe(e) {
720
746
  <div class="rte-smart-paste-live" aria-live="polite" aria-atomic="true"></div>
721
747
  `, n.addEventListener("click", (o) => {
722
748
  const s = o.target, l = s == null ? void 0 : s.closest("[data-action]");
723
- if (!l) return;
749
+ if (!l)
750
+ return;
724
751
  const c = l.getAttribute("data-action");
725
752
  if (c) {
726
753
  if (c === "close") {
@@ -747,13 +774,16 @@ function Xe(e) {
747
774
  o.preventDefault(), q(e, !0);
748
775
  return;
749
776
  }
750
- if (o.key !== "ArrowRight" && o.key !== "ArrowLeft") return;
777
+ if (o.key !== "ArrowRight" && o.key !== "ArrowLeft")
778
+ return;
751
779
  const s = Array.from(
752
780
  n.querySelectorAll('[data-action="set-profile"][data-profile]')
753
781
  );
754
- if (s.length === 0) return;
782
+ if (s.length === 0)
783
+ return;
755
784
  const l = s.findIndex((f) => f === document.activeElement);
756
- if (l < 0) return;
785
+ if (l < 0)
786
+ return;
757
787
  const c = o.key === "ArrowRight" ? 1 : -1, i = (l + c + s.length) % s.length;
758
788
  o.preventDefault(), s[i].focus();
759
789
  }), G(n, e), document.body.appendChild(n), h.set(e, n), I.set(e, !1), S(e), n;
@@ -779,20 +809,25 @@ function ve(e) {
779
809
  }
780
810
  function Ze(e, t) {
781
811
  const a = d.get(e) || O;
782
- if (!a) return !1;
812
+ if (!a)
813
+ return !1;
783
814
  const r = m(e, a);
784
815
  if (!r.enabled || de(e)) {
785
816
  const p = h.get(e);
786
817
  return p && de(e) && R(p, a.labels.readonlyMessage), !1;
787
818
  }
788
819
  const n = t.clipboardData;
789
- if (!n) return !1;
820
+ if (!n)
821
+ return !1;
790
822
  const o = n.getData("text/html") || "", s = n.getData("text/plain") || "";
791
- if (!o && !s) return !1;
823
+ if (!o && !s)
824
+ return !1;
792
825
  const l = Ue(o, s, r.profile, a);
793
- if (!l.value) return !1;
826
+ if (!l.value)
827
+ return !1;
794
828
  const c = e.innerHTML;
795
- if (!(l.mode === "html" ? Ve(e, l.value) : je(e, l.value))) return !1;
829
+ if (!(l.mode === "html" ? Ve(e, l.value) : je(e, l.value)))
830
+ return !1;
796
831
  r.lastReport = { ...l.report }, M.set(e, r), Fe(e, c), Ge(e), e.dispatchEvent(
797
832
  new CustomEvent("editora:smart-paste", {
798
833
  bubbles: !0,
@@ -815,7 +850,8 @@ function Je(e) {
815
850
  };
816
851
  }
817
852
  function Qe(e) {
818
- if (F.has(e)) return;
853
+ if (F.has(e))
854
+ return;
819
855
  const t = Je(e);
820
856
  e.addEventListener("paste", t, !0), F.set(e, t);
821
857
  }
@@ -839,17 +875,21 @@ function at(e) {
839
875
  O = e, L || (L = (t) => {
840
876
  j();
841
877
  const a = t.target, r = a == null ? void 0 : a.closest(v);
842
- if (!r) return;
878
+ if (!r)
879
+ return;
843
880
  const n = d.get(r) || e;
844
881
  m(r, n), d.set(r, n), b = r, z(r);
845
882
  const o = h.get(r);
846
883
  o && (G(o, r), Q(r, o), S(r));
847
884
  }, document.addEventListener("focusin", L, !0)), w || (w = (t) => {
848
- if (t.defaultPrevented) return;
885
+ if (t.defaultPrevented)
886
+ return;
849
887
  const a = t.target;
850
- if (a != null && a.closest(`.${u} input, .${u} textarea, .${u} select`)) return;
888
+ if (a != null && a.closest(`.${u} input, .${u} textarea, .${u} select`))
889
+ return;
851
890
  const r = ze(t);
852
- if (!r) return;
891
+ if (!r)
892
+ return;
853
893
  const n = d.get(r) || O || e;
854
894
  if (m(r, n), d.set(r, n), b = r, t.key === "Escape" && re(r)) {
855
895
  t.preventDefault(), q(r, !0);
@@ -885,7 +925,8 @@ function ot() {
885
925
  L && (document.removeEventListener("focusin", L, !0), L = null), w && (document.removeEventListener("keydown", w, !0), w = null), A && (window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A), A = null), $ && ($.disconnect(), $ = null), h.forEach((e) => e.remove()), h.clear(), _.forEach((e) => me(e)), _.clear(), O = null, b = null;
886
926
  }
887
927
  function nt() {
888
- if (typeof document == "undefined" || document.getElementById(le)) return;
928
+ if (typeof document == "undefined" || document.getElementById(le))
929
+ return;
889
930
  const e = document.createElement("style");
890
931
  e.id = le, e.textContent = `
891
932
  .rte-toolbar-group-items.${x},
@@ -1287,38 +1328,44 @@ const st = (e = {}) => {
1287
1328
  commands: {
1288
1329
  smartPaste: (r, n) => {
1289
1330
  const o = T(n, !1, !1);
1290
- if (!o) return !1;
1331
+ if (!o)
1332
+ return !1;
1291
1333
  const s = d.get(o) || t;
1292
1334
  return m(o, s), d.set(o, s), b = o, ye(o), !0;
1293
1335
  },
1294
1336
  toggleSmartPastePanel: (r, n) => {
1295
1337
  const o = T(n, !1, !1);
1296
- if (!o) return !1;
1338
+ if (!o)
1339
+ return !1;
1297
1340
  const s = d.get(o) || t;
1298
1341
  return m(o, s), d.set(o, s), b = o, xe(o, typeof r == "boolean" ? r : void 0);
1299
1342
  },
1300
1343
  cycleSmartPasteProfile: (r, n) => {
1301
1344
  const o = T(n, !1, !1);
1302
- if (!o) return !1;
1345
+ if (!o)
1346
+ return !1;
1303
1347
  const s = d.get(o) || t, l = m(o, s);
1304
1348
  return d.set(o, s), l.profile = ae(l.profile), S(o), !0;
1305
1349
  },
1306
1350
  setSmartPasteProfile: (r, n) => {
1307
1351
  const o = T(n, !1, !1);
1308
- if (!o) return !1;
1352
+ if (!o)
1353
+ return !1;
1309
1354
  const s = d.get(o) || t, l = m(o, s);
1310
1355
  return d.set(o, s), l.profile = H(r), S(o), !0;
1311
1356
  },
1312
1357
  toggleSmartPasteEnabled: (r, n) => {
1313
1358
  const o = T(n, !1, !1);
1314
- if (!o) return !1;
1359
+ if (!o)
1360
+ return !1;
1315
1361
  const s = d.get(o) || t, l = m(o, s);
1316
1362
  return d.set(o, s), l.enabled = typeof r == "boolean" ? r : !l.enabled, z(o), S(o), !0;
1317
1363
  },
1318
1364
  setSmartPasteOptions: (r, n) => {
1319
1365
  var f, p, y, g, P, C;
1320
1366
  const o = T(n, !1, !1);
1321
- if (!o || !r || typeof r != "object") return !1;
1367
+ if (!o || !r || typeof r != "object")
1368
+ return !1;
1322
1369
  const s = d.get(o) || t, l = ce(s), c = V({
1323
1370
  ...l,
1324
1371
  ...r,
@@ -1350,7 +1397,8 @@ const st = (e = {}) => {
1350
1397
  },
1351
1398
  getSmartPasteState: (r, n) => {
1352
1399
  const o = T(n, !1, !1);
1353
- if (!o) return !1;
1400
+ if (!o)
1401
+ return !1;
1354
1402
  const s = d.get(o) || t, l = m(o, s), c = ve(l);
1355
1403
  if (typeof r == "function")
1356
1404
  try {
@@ -1382,7 +1430,8 @@ const st = (e = {}) => {
1382
1430
  !1,
1383
1431
  !1
1384
1432
  );
1385
- if (!s) return;
1433
+ if (!s)
1434
+ return;
1386
1435
  b = s, a.add(s);
1387
1436
  const l = m(s, o);
1388
1437
  l.enabled = o.enabled, l.profile = o.defaultProfile, d.set(s, o), z(s);
@@ -1395,4 +1444,4 @@ const st = (e = {}) => {
1395
1444
  export {
1396
1445
  st as SmartPastePlugin
1397
1446
  };
1398
- //# sourceMappingURL=SmartPastePlugin.native-BOKKtF07.mjs.map
1447
+ //# sourceMappingURL=SmartPastePlugin.native-a6c5efec.mjs.map