@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
@@ -27,7 +27,8 @@ function ye(e) {
27
27
  return e.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
28
28
  }
29
29
  function ae(e) {
30
- if (!e) return [];
30
+ if (!e)
31
+ return [];
31
32
  const t = /* @__PURE__ */ new Set();
32
33
  return e.forEach((n) => {
33
34
  const o = n.trim();
@@ -53,22 +54,28 @@ function X(e) {
53
54
  return e.closest(ee) || e;
54
55
  }
55
56
  function F(e) {
56
- if (!e) return null;
57
- if (e.matches(R)) return e;
57
+ if (!e)
58
+ return null;
59
+ if (e.matches(R))
60
+ return e;
58
61
  const t = e.querySelector(R);
59
62
  return t instanceof HTMLElement ? t : null;
60
63
  }
61
64
  function we() {
62
- if (typeof window == "undefined") return null;
65
+ if (typeof window == "undefined")
66
+ return null;
63
67
  const e = window[oe];
64
- if (!(e instanceof HTMLElement)) return null;
68
+ if (!(e instanceof HTMLElement))
69
+ return null;
65
70
  window[oe] = null;
66
71
  const t = F(e);
67
- if (t) return t;
72
+ if (t)
73
+ return t;
68
74
  const n = e.closest(ee);
69
75
  if (n) {
70
76
  const o = F(n);
71
- if (o) return o;
77
+ if (o)
78
+ return o;
72
79
  }
73
80
  return null;
74
81
  }
@@ -89,7 +96,8 @@ function K(e) {
89
96
  }
90
97
  function Re(e) {
91
98
  const t = X(e);
92
- if (K(t)) return !0;
99
+ if (K(t))
100
+ return !0;
93
101
  const n = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
94
102
  return K(n) ? !0 : K(document.documentElement) || K(document.body);
95
103
  }
@@ -100,25 +108,32 @@ function Ee(e) {
100
108
  return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
101
109
  }
102
110
  function M(e, t = !0) {
103
- if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
111
+ if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement)
112
+ return e.contentElement;
104
113
  if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
105
114
  const s = e.editorElement;
106
- if (s.matches(R)) return s;
115
+ if (s.matches(R))
116
+ return s;
107
117
  const a = s.querySelector(R);
108
- if (a instanceof HTMLElement) return a;
118
+ if (a instanceof HTMLElement)
119
+ return a;
109
120
  }
110
121
  const n = we();
111
- if (n) return n;
122
+ if (n)
123
+ return n;
112
124
  const o = window.getSelection();
113
125
  if (o && o.rangeCount > 0) {
114
126
  const s = o.getRangeAt(0).startContainer, a = Ee(s), l = a == null ? void 0 : a.closest(R);
115
- if (l) return l;
127
+ if (l)
128
+ return l;
116
129
  }
117
130
  const r = document.activeElement;
118
131
  if (r) {
119
- if (r.matches(R)) return r;
132
+ if (r.matches(R))
133
+ return r;
120
134
  const s = r.closest(R);
121
- if (s) return s;
135
+ if (s)
136
+ return s;
122
137
  }
123
138
  return m && m.isConnected ? m : (m && !m.isConnected && (m = null), t ? document.querySelector(R) : null);
124
139
  }
@@ -148,15 +163,18 @@ function fe(e) {
148
163
  }
149
164
  function $e(e) {
150
165
  const t = e.toLowerCase().replace(/[^a-z]/g, "");
151
- if (!t) return 0;
152
- if (t.length <= 3) return 1;
166
+ if (!t)
167
+ return 0;
168
+ if (t.length <= 3)
169
+ return 1;
153
170
  const n = t.match(/[aeiouy]+/g);
154
171
  let o = n ? n.length : 1;
155
172
  return t.endsWith("e") && (o -= 1), Math.max(1, o);
156
173
  }
157
174
  function Me(e) {
158
175
  const t = e.match(/\b[\w'-]+\b/g) || [], n = t.length;
159
- if (n === 0) return 100;
176
+ if (n === 0)
177
+ return 100;
160
178
  const o = Math.max(1, fe(e)), r = t.reduce((a, l) => a + $e(l), 0), s = 206.835 - 1.015 * (n / o) - 84.6 * (r / Math.max(1, n));
161
179
  return Number.isFinite(s) ? Math.max(0, Math.min(120, s)) : 0;
162
180
  }
@@ -222,14 +240,16 @@ async function C(e, t, n = !1) {
222
240
  t.maxIssues
223
241
  ), w += 1, b = g.exec(o);
224
242
  }
225
- if (x(i, t.maxIssues)) break;
243
+ if (x(i, t.maxIssues))
244
+ break;
226
245
  }
227
246
  }
228
247
  if (!x(i, t.maxIssues) && t.requiredHeadings.length > 0) {
229
248
  const w = Te(e, t.normalizeText);
230
249
  let p = 0;
231
250
  t.requiredHeadings.forEach((g) => {
232
- if (x(i, t.maxIssues)) return;
251
+ if (x(i, t.maxIssues))
252
+ return;
233
253
  const b = t.normalizeText(g).toLowerCase();
234
254
  !b || w.has(b) || (P(
235
255
  i,
@@ -248,7 +268,8 @@ async function C(e, t, n = !1) {
248
268
  const w = Ae(o);
249
269
  let p = 0;
250
270
  for (const g of w) {
251
- if (x(i, t.maxIssues)) break;
271
+ if (x(i, t.maxIssues))
272
+ break;
252
273
  const b = ce(g);
253
274
  b <= t.maxSentenceWords || (P(
254
275
  i,
@@ -286,10 +307,12 @@ async function C(e, t, n = !1) {
286
307
  readabilityScore: u
287
308
  };
288
309
  for (const p of t.customRules) {
289
- if (x(i, t.maxIssues)) break;
310
+ if (x(i, t.maxIssues))
311
+ break;
290
312
  try {
291
313
  const g = await p.evaluate(w);
292
- if (!Array.isArray(g)) continue;
314
+ if (!Array.isArray(g))
315
+ continue;
293
316
  for (let b = 0; b < g.length && !x(i, t.maxIssues); b += 1)
294
317
  P(
295
318
  i,
@@ -340,7 +363,8 @@ function U(e) {
340
363
  return B.get(e) === !0;
341
364
  }
342
365
  function J(e, t) {
343
- if (!t.classList.contains("show")) return;
366
+ if (!t.classList.contains("show"))
367
+ return;
344
368
  const o = X(e).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 360);
345
369
  t.style.width = `${r}px`, t.style.maxHeight = `${Math.max(220, window.innerHeight - 24)}px`;
346
370
  const s = Math.max(10, o.right - r), a = Math.max(10, window.innerWidth - r - 10), l = Math.min(s, a), c = Math.max(10, Math.min(window.innerHeight - 10 - 240, o.top + 10));
@@ -348,9 +372,11 @@ function J(e, t) {
348
372
  }
349
373
  function ue(e, t) {
350
374
  const n = t.trim().toLowerCase();
351
- if (!n) return !1;
375
+ if (!n)
376
+ return !1;
352
377
  const o = window.getSelection();
353
- if (!o) return !1;
378
+ if (!o)
379
+ return !1;
354
380
  const r = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, null);
355
381
  let s = r.nextNode();
356
382
  for (; s; ) {
@@ -382,19 +408,25 @@ function A(e, t) {
382
408
  }
383
409
  function O(e, t, n) {
384
410
  const o = t.querySelector('[data-action="toggle-realtime"]');
385
- if (!o) return;
411
+ if (!o)
412
+ return;
386
413
  const r = A(e, n);
387
414
  o.textContent = r ? n.labels.realtimeOnText : n.labels.realtimeOffText, o.setAttribute("aria-pressed", r ? "true" : "false"), $(e, "toggleContentRulesRealtime", r);
388
415
  }
389
416
  function te(e) {
390
417
  const t = h.get(e);
391
- if (!t) return;
418
+ if (!t)
419
+ return;
392
420
  const n = d.get(e) || E;
393
- if (!n) return;
421
+ if (!n)
422
+ return;
394
423
  const o = v.get(e) || [], r = de.get(e) || {
395
- readabilityScore: 100
424
+ readabilityScore: 100,
425
+ wordCount: 0,
426
+ sentenceCount: 0
396
427
  }, s = t.querySelector(".rte-content-rules-count"), a = t.querySelector(".rte-content-rules-summary"), l = t.querySelector(".rte-content-rules-list"), c = t.querySelector(".rte-content-rules-live");
397
- if (!s || !a || !l || !c) return;
428
+ if (!s || !a || !l || !c)
429
+ return;
398
430
  const u = Le(o);
399
431
  if (s.textContent = String(o.length), a.textContent = `${n.labels.summaryPrefix}: ${o.length} | Error ${u.error} | Warning ${u.warning} | Info ${u.info} | Readability ${r.readabilityScore.toFixed(1)}`, c.textContent = `${o.length} issues. ${u.error} errors, ${u.warning} warnings, ${u.info} info.`, o.length === 0) {
400
432
  l.innerHTML = `<li class="rte-content-rules-empty">${k(n.labels.noIssuesText)}</li>`;
@@ -432,7 +464,8 @@ function Oe(e) {
432
464
  }
433
465
  function qe(e) {
434
466
  const t = h.get(e);
435
- if (t) return t;
467
+ if (t)
468
+ return t;
436
469
  const n = d.get(e) || E || j(), o = `rte-content-rules-panel-${pe++}`, r = document.createElement("section");
437
470
  return r.className = f, r.id = o, r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "false"), r.setAttribute("aria-label", n.labels.panelAriaLabel), r.innerHTML = `
438
471
  <header class="rte-content-rules-header">
@@ -454,7 +487,8 @@ function qe(e) {
454
487
  </div>
455
488
  `, r.addEventListener("click", (s) => {
456
489
  const a = s.target, l = a == null ? void 0 : a.closest("[data-action]");
457
- if (!l) return;
490
+ if (!l)
491
+ return;
458
492
  const c = l.getAttribute("data-action");
459
493
  if (c) {
460
494
  if (c === "close") {
@@ -476,7 +510,8 @@ function qe(e) {
476
510
  }
477
511
  if (c === "focus-issue") {
478
512
  const u = l.getAttribute("data-issue-id") || "", i = We(e, u);
479
- if (!i) return;
513
+ if (!i)
514
+ return;
480
515
  He(e, i), W(e, !1);
481
516
  }
482
517
  }
@@ -485,11 +520,14 @@ function qe(e) {
485
520
  s.preventDefault(), W(e, !0);
486
521
  return;
487
522
  }
488
- if (s.key !== "ArrowDown" && s.key !== "ArrowUp") return;
523
+ if (s.key !== "ArrowDown" && s.key !== "ArrowUp")
524
+ return;
489
525
  const a = Array.from(r.querySelectorAll('[data-role="issue-button"]'));
490
- if (a.length === 0) return;
526
+ if (a.length === 0)
527
+ return;
491
528
  const l = document.activeElement, c = a.findIndex((y) => y === l);
492
- if (c === -1) return;
529
+ if (c === -1)
530
+ return;
493
531
  s.preventDefault();
494
532
  const u = s.key === "ArrowDown" ? 1 : -1, i = (c + u + a.length) % a.length;
495
533
  a[i].focus();
@@ -511,7 +549,8 @@ function me(e) {
511
549
  }
512
550
  function be(e) {
513
551
  const t = d.get(e) || E;
514
- if (!t || !A(e, t)) return;
552
+ if (!t || !A(e, t))
553
+ return;
515
554
  me(e);
516
555
  const n = window.setTimeout(() => {
517
556
  _.delete(n), V.delete(e), C(e, t, !1);
@@ -531,7 +570,8 @@ function _e(e) {
531
570
  return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "t";
532
571
  }
533
572
  function Be() {
534
- if (typeof document == "undefined" || document.getElementById(se)) return;
573
+ if (typeof document == "undefined" || document.getElementById(se))
574
+ return;
535
575
  const e = document.createElement("style");
536
576
  e.id = se, e.textContent = `
537
577
  .rte-toolbar-group-items.content-rules,
@@ -911,7 +951,8 @@ function Be() {
911
951
  function De(e) {
912
952
  E = e, L || (L = (t) => {
913
953
  const n = t.target, o = n == null ? void 0 : n.closest(R);
914
- if (!o) return;
954
+ if (!o)
955
+ return;
915
956
  m = o, d.has(o) || d.set(o, e), v.has(o) || v.set(o, []), T.has(o) || T.set(o, e.enableRealtime);
916
957
  const r = h.get(o);
917
958
  r && (G(r, o), J(o, r), O(o, r, d.get(o) || e)), $(o, "toggleContentRulesPanel", U(o)), $(o, "toggleContentRulesRealtime", A(o, e));
@@ -919,14 +960,17 @@ function De(e) {
919
960
  const n = t.target, o = n == null ? void 0 : n.closest(R);
920
961
  o && (m = o, be(o));
921
962
  }, document.addEventListener("input", I, !0)), H || (H = (t) => {
922
- if (t.defaultPrevented) return;
963
+ if (t.defaultPrevented)
964
+ return;
923
965
  const n = t.target;
924
- if (n != null && n.closest("input, textarea, select")) return;
966
+ if (n != null && n.closest("input, textarea, select"))
967
+ return;
925
968
  const o = t.key === "Escape", r = Pe(t), s = ze(t), a = _e(t);
926
969
  if (!o && !r && !s && !a)
927
970
  return;
928
971
  const l = M(void 0, !1);
929
- if (!l || Z(l)) return;
972
+ if (!l || Z(l))
973
+ return;
930
974
  const c = d.get(l) || E || e;
931
975
  if (d.set(l, c), m = l, o && U(l)) {
932
976
  t.preventDefault(), W(l, !0);
@@ -1000,13 +1044,15 @@ const Ke = (e = {}) => {
1000
1044
  commands: {
1001
1045
  contentRules: (n, o) => {
1002
1046
  const r = M(o);
1003
- if (!r || Z(r)) return !1;
1047
+ if (!r || Z(r))
1048
+ return !1;
1004
1049
  const s = d.get(r) || t;
1005
1050
  return d.set(r, s), m = r, Q(r, !0), C(r, s, !1), !0;
1006
1051
  },
1007
1052
  toggleContentRulesPanel: (n, o) => {
1008
1053
  const r = M(o);
1009
- if (!r || Z(r)) return !1;
1054
+ if (!r || Z(r))
1055
+ return !1;
1010
1056
  m = r;
1011
1057
  const s = d.get(r) || t;
1012
1058
  d.set(r, s);
@@ -1015,14 +1061,16 @@ const Ke = (e = {}) => {
1015
1061
  },
1016
1062
  runContentRulesAudit: async (n, o) => {
1017
1063
  const r = M(o);
1018
- if (!r) return !1;
1064
+ if (!r)
1065
+ return !1;
1019
1066
  m = r;
1020
1067
  const s = d.get(r) || t;
1021
1068
  return d.set(r, s), await C(r, s, !0), ne(r), !0;
1022
1069
  },
1023
1070
  toggleContentRulesRealtime: (n, o) => {
1024
1071
  const r = M(o);
1025
- if (!r) return !1;
1072
+ if (!r)
1073
+ return !1;
1026
1074
  m = r;
1027
1075
  const s = d.get(r) || t;
1028
1076
  d.set(r, s);
@@ -1033,7 +1081,8 @@ const Ke = (e = {}) => {
1033
1081
  },
1034
1082
  getContentRulesIssues: (n, o) => {
1035
1083
  const r = M(o);
1036
- if (!r) return !1;
1084
+ if (!r)
1085
+ return !1;
1037
1086
  const s = v.get(r) || [];
1038
1087
  if (typeof n == "function")
1039
1088
  try {
@@ -1049,7 +1098,8 @@ const Ke = (e = {}) => {
1049
1098
  },
1050
1099
  setContentRulesOptions: (n, o) => {
1051
1100
  const r = M(o);
1052
- if (!r || !n || typeof n != "object") return !1;
1101
+ if (!r || !n || typeof n != "object")
1102
+ return !1;
1053
1103
  const s = d.get(r) || t, a = j({
1054
1104
  ...s,
1055
1105
  ...n,
@@ -1096,4 +1146,4 @@ const Ke = (e = {}) => {
1096
1146
  export {
1097
1147
  Ke as ContentRulesPlugin
1098
1148
  };
1099
- //# sourceMappingURL=ContentRulesPlugin.native-nBLQ8QFZ.mjs.map
1149
+ //# sourceMappingURL=ContentRulesPlugin.native-63ed405b.mjs.map
@@ -51,28 +51,35 @@ function _(t) {
51
51
  }
52
52
  function ht(t) {
53
53
  const a = q(t);
54
- if (_(a)) return !0;
54
+ if (_(a))
55
+ return !0;
55
56
  const e = a.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
56
57
  return _(e) ? !0 : _(document.documentElement) || _(document.body);
57
58
  }
58
59
  function A(t, a = !0) {
59
- if ((t == null ? void 0 : t.contentElement) instanceof HTMLElement) return t.contentElement;
60
+ if ((t == null ? void 0 : t.contentElement) instanceof HTMLElement)
61
+ return t.contentElement;
60
62
  if ((t == null ? void 0 : t.editorElement) instanceof HTMLElement) {
61
63
  const n = t.editorElement;
62
- if (n.matches(S)) return n;
64
+ if (n.matches(S))
65
+ return n;
63
66
  const i = n.querySelector(S);
64
- if (i instanceof HTMLElement) return i;
67
+ if (i instanceof HTMLElement)
68
+ return i;
65
69
  }
66
70
  const e = window.getSelection();
67
71
  if (e && e.rangeCount > 0) {
68
72
  const n = e.getRangeAt(0).startContainer, i = lt(n), o = i == null ? void 0 : i.closest(S);
69
- if (o) return o;
73
+ if (o)
74
+ return o;
70
75
  }
71
76
  const r = document.activeElement;
72
77
  if (r) {
73
- if (r.matches(S)) return r;
78
+ if (r.matches(S))
79
+ return r;
74
80
  const n = r.closest(S);
75
- if (n) return n;
81
+ if (n)
82
+ return n;
76
83
  }
77
84
  return k && k.isConnected ? k : a ? document.querySelector(S) : null;
78
85
  }
@@ -81,7 +88,8 @@ function H(t) {
81
88
  }
82
89
  function st(t) {
83
90
  const a = window.getSelection();
84
- if (!a || a.rangeCount === 0) return null;
91
+ if (!a || a.rangeCount === 0)
92
+ return null;
85
93
  const e = a.getRangeAt(0);
86
94
  return t.contains(e.commonAncestorContainer) ? e.cloneRange() : null;
87
95
  }
@@ -98,7 +106,8 @@ function kt(t, a) {
98
106
  }, t);
99
107
  }
100
108
  function vt() {
101
- if (typeof document == "undefined" || document.getElementById(ot)) return;
109
+ if (typeof document == "undefined" || document.getElementById(ot))
110
+ return;
102
111
  const t = document.createElement("style");
103
112
  t.id = ot, t.textContent = `
104
113
  .rte-data-binding {
@@ -392,7 +401,8 @@ function Y(t) {
392
401
  t.dispatchEvent(new Event("input", { bubbles: !0 }));
393
402
  }
394
403
  function Q(t, a) {
395
- if (a === t.innerHTML) return;
404
+ if (a === t.innerHTML)
405
+ return;
396
406
  const e = window.execEditorCommand || window.executeEditorCommand;
397
407
  if (typeof e == "function")
398
408
  try {
@@ -441,7 +451,8 @@ function X(t) {
441
451
  const a = window.getSelection();
442
452
  if (a && a.rangeCount > 0) {
443
453
  const n = a.getRangeAt(0).startContainer, i = lt(n), o = i == null ? void 0 : i.closest(P);
444
- if (o && t.contains(o)) return o;
454
+ if (o && t.contains(o))
455
+ return o;
445
456
  }
446
457
  const e = document.activeElement, r = e == null ? void 0 : e.closest(P);
447
458
  return r && t.contains(r) ? r : null;
@@ -460,9 +471,11 @@ function et(t, a, e) {
460
471
  }
461
472
  function xt(t, a, e) {
462
473
  const r = a.format || "text";
463
- if (t == null) return a.fallback || "";
474
+ if (t == null)
475
+ return a.fallback || "";
464
476
  if (r === "json") {
465
- if (typeof t == "string") return t;
477
+ if (typeof t == "string")
478
+ return t;
466
479
  try {
467
480
  return JSON.stringify(t);
468
481
  } catch (n) {
@@ -471,7 +484,8 @@ function xt(t, a, e) {
471
484
  }
472
485
  if (r === "date") {
473
486
  const n = t instanceof Date ? t : new Date(String(t));
474
- if (Number.isNaN(n.getTime())) return String(t);
487
+ if (Number.isNaN(n.getTime()))
488
+ return String(t);
475
489
  try {
476
490
  return new Intl.DateTimeFormat(e.locale, e.dateFormatOptions).format(n);
477
491
  } catch (i) {
@@ -480,7 +494,8 @@ function xt(t, a, e) {
480
494
  }
481
495
  if (r === "number" || r === "currency") {
482
496
  const n = typeof t == "number" ? t : Number(t);
483
- if (!Number.isFinite(n)) return String(t);
497
+ if (!Number.isFinite(n))
498
+ return String(t);
484
499
  const i = { ...e.numberFormatOptions };
485
500
  if (r === "currency") {
486
501
  const o = (a.currency || "USD").toUpperCase();
@@ -545,7 +560,8 @@ function Et(t, a, e) {
545
560
  async function Dt(t, a) {
546
561
  var d, u;
547
562
  const e = a.api;
548
- if (!e) return {};
563
+ if (!e)
564
+ return {};
549
565
  const r = new AbortController(), n = q(t), i = { editor: t, editorRoot: n, signal: r.signal }, o = Math.max(0, Number((d = e.timeoutMs) != null ? d : 1e4));
550
566
  let l = null;
551
567
  o > 0 && (l = window.setTimeout(() => r.abort(), o));
@@ -568,25 +584,30 @@ async function Dt(t, a) {
568
584
  }
569
585
  async function U(t, a) {
570
586
  const e = J.get(t);
571
- if (e) return e;
587
+ if (e)
588
+ return e;
572
589
  const r = R.get(t), n = Date.now();
573
590
  if (r && n - r.timestamp <= a.cacheTtlMs)
574
591
  return r.data;
575
592
  const i = I.get(t);
576
- if (i) return i;
593
+ if (i)
594
+ return i;
577
595
  const o = (async () => {
578
596
  try {
579
597
  if (typeof a.getData == "function") {
580
598
  const d = await Promise.resolve(a.getData({ editor: t, editorRoot: q(t) }));
581
- if (w(d)) return d;
599
+ if (w(d))
600
+ return d;
582
601
  }
583
602
  if (a.api) {
584
603
  const d = await Dt(t, a);
585
- if (w(d)) return d;
604
+ if (w(d))
605
+ return d;
586
606
  }
587
607
  if (typeof a.data == "function") {
588
608
  const d = await Promise.resolve(a.data());
589
- if (w(d)) return d;
609
+ if (w(d))
610
+ return d;
590
611
  }
591
612
  return w(a.data) ? a.data : {};
592
613
  } finally {
@@ -682,11 +703,13 @@ function L(t, a, e, r, n) {
682
703
  }, nt = (c) => {
683
704
  c.target === d && x();
684
705
  }, mt = (c) => {
685
- if (c.key !== "Tab") return;
706
+ if (c.key !== "Tab")
707
+ return;
686
708
  const y = Array.from(
687
709
  u.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')
688
710
  );
689
- if (y.length === 0) return;
711
+ if (y.length === 0)
712
+ return;
690
713
  const E = y[0], D = y[y.length - 1], N = document.activeElement;
691
714
  if (c.shiftKey && N === E) {
692
715
  c.preventDefault(), D.focus();
@@ -746,18 +769,22 @@ function L(t, a, e, r, n) {
746
769
  function Tt(t) {
747
770
  V = t, M || (M = (a) => {
748
771
  const e = a.target, r = e == null ? void 0 : e.closest(S);
749
- if (!r) return;
772
+ if (!r)
773
+ return;
750
774
  k = r, g.has(r) || g.set(r, t);
751
775
  const n = g.get(r) || t;
752
776
  G(r, n);
753
777
  const i = v.get(r) === !0;
754
778
  et(r, i, n), i || Array.from(r.querySelectorAll(P)).forEach((l) => C(l, n, !1));
755
779
  }, document.addEventListener("focusin", M, !0)), O || (O = (a) => {
756
- if (document.querySelector(`.${p}`)) return;
780
+ if (document.querySelector(`.${p}`))
781
+ return;
757
782
  const e = a.target;
758
- if (e != null && e.closest("input, textarea, select")) return;
783
+ if (e != null && e.closest("input, textarea, select"))
784
+ return;
759
785
  const r = A(void 0, !1);
760
- if (!r || H(r)) return;
786
+ if (!r || H(r))
787
+ return;
761
788
  const n = g.get(r) || V || t, i = e == null ? void 0 : e.closest(P);
762
789
  if (i && (a.key === "Enter" || a.key === " ")) {
763
790
  a.preventDefault(), a.stopPropagation(), k = r, L(r, n, "edit", void 0, i);
@@ -775,11 +802,14 @@ function Tt(t) {
775
802
  Z(r, n, o);
776
803
  }
777
804
  }, document.addEventListener("keydown", O, !0)), B || (B = (a) => {
778
- if (document.querySelector(`.${p}`) || a.defaultPrevented || a.button !== 0 || a.metaKey || a.ctrlKey || a.altKey || a.shiftKey) return;
805
+ if (document.querySelector(`.${p}`) || a.defaultPrevented || a.button !== 0 || a.metaKey || a.ctrlKey || a.altKey || a.shiftKey)
806
+ return;
779
807
  const e = a.target, r = e == null ? void 0 : e.closest(P);
780
- if (!r) return;
808
+ if (!r)
809
+ return;
781
810
  const n = r.closest(S);
782
- if (!n || H(n)) return;
811
+ if (!n || H(n))
812
+ return;
783
813
  const i = g.get(n) || V || t;
784
814
  g.set(n, i), k = n, a.preventDefault(), a.stopPropagation(), r.focus({ preventScroll: !0 }), L(n, i, "edit", void 0, r);
785
815
  }, document.addEventListener("click", B, !0));
@@ -816,7 +846,8 @@ const Lt = (t = {}) => {
816
846
  commands: {
817
847
  openDataBindingDialog: (e, r) => {
818
848
  const n = A(r);
819
- if (!n || H(n)) return !1;
849
+ if (!n || H(n))
850
+ return !1;
820
851
  k = n;
821
852
  const i = g.get(n) || a;
822
853
  g.set(n, i), G(n, i);
@@ -828,12 +859,14 @@ const Lt = (t = {}) => {
828
859
  },
829
860
  insertDataBindingToken: async (e, r) => {
830
861
  const n = A(r);
831
- if (!n || H(n)) return !1;
862
+ if (!n || H(n))
863
+ return !1;
832
864
  k = n;
833
865
  const i = g.get(n) || a;
834
866
  g.set(n, i);
835
867
  const o = j(e || {}, i);
836
- if (!o.key) return !1;
868
+ if (!o.key)
869
+ return !1;
837
870
  const l = n.innerHTML, d = ft(o, i.labels);
838
871
  if (gt(n, d), v.get(n) === !0) {
839
872
  const s = await U(n, i);
@@ -843,14 +876,17 @@ const Lt = (t = {}) => {
843
876
  },
844
877
  editDataBindingToken: async (e, r) => {
845
878
  const n = A(r);
846
- if (!n || H(n)) return !1;
879
+ if (!n || H(n))
880
+ return !1;
847
881
  k = n;
848
882
  const i = g.get(n) || a;
849
883
  g.set(n, i);
850
884
  const o = X(n);
851
- if (!o) return !1;
885
+ if (!o)
886
+ return !1;
852
887
  const l = W(o, i), d = j({ ...l, ...e || {} }, i);
853
- if (!d.key) return !1;
888
+ if (!d.key)
889
+ return !1;
854
890
  const u = n.innerHTML;
855
891
  tt(o, d, i.labels);
856
892
  const s = v.get(n) === !0, m = s ? await U(n, i) : void 0;
@@ -858,7 +894,8 @@ const Lt = (t = {}) => {
858
894
  },
859
895
  toggleDataBindingPreview: async (e, r) => {
860
896
  const n = A(r);
861
- if (!n) return !1;
897
+ if (!n)
898
+ return !1;
862
899
  k = n;
863
900
  const i = g.get(n) || a;
864
901
  g.set(n, i);
@@ -867,7 +904,8 @@ const Lt = (t = {}) => {
867
904
  },
868
905
  setDataBindingData: async (e, r) => {
869
906
  const n = A(r);
870
- if (!n) return !1;
907
+ if (!n)
908
+ return !1;
871
909
  if (k = n, e && typeof e == "object" ? (J.set(n, e), R.set(n, { timestamp: Date.now(), data: e })) : (J.delete(n), R.delete(n)), v.get(n) === !0) {
872
910
  const i = g.get(n) || a;
873
911
  await Z(n, i, !0);
@@ -876,7 +914,8 @@ const Lt = (t = {}) => {
876
914
  },
877
915
  refreshDataBindings: async (e, r) => {
878
916
  const n = A(r);
879
- if (!n) return !1;
917
+ if (!n)
918
+ return !1;
880
919
  k = n, R.delete(n);
881
920
  const i = g.get(n) || a;
882
921
  g.set(n, i);
@@ -914,4 +953,4 @@ const Lt = (t = {}) => {
914
953
  export {
915
954
  Lt as DataBindingPlugin
916
955
  };
917
- //# sourceMappingURL=DataBindingPlugin.native-jQ1JPRTp.mjs.map
956
+ //# sourceMappingURL=DataBindingPlugin.native-427e9d75.mjs.map