@editora/core 1.0.23 → 1.0.24

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 (64) hide show
  1. package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
  2. package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
  3. package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
  4. package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
  5. package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
  6. package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
  7. package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-BRBEIqY7.mjs} +167 -113
  8. package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  9. package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
  10. package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
  11. package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
  12. package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
  13. package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
  14. package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-tZqIa9o5.mjs} +21 -20
  15. package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
  16. package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
  17. package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
  18. package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
  19. package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
  20. package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
  21. package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
  22. package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
  23. package/dist/MediaManagerPlugin.native-BjrEarV6.mjs +1161 -0
  24. package/dist/{MediaManagerPlugin.native-BT1NZIJS.mjs → MediaManagerPlugin.native-CRi24Mrb.mjs} +340 -281
  25. package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
  26. package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
  27. package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
  28. package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
  29. package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
  30. package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
  31. package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
  32. package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
  33. package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
  34. package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
  35. package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
  36. package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
  37. package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
  38. package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
  39. package/dist/confirmDialog-BP8hZPpX.mjs +112 -0
  40. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  41. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-8gnG-uG_.mjs} +1728 -1715
  42. package/dist/editora.min.js +21 -21
  43. package/dist/editora.umd.js +10 -10
  44. package/dist/{index-C1sO7DAC.js → index--wO0CZVN.js} +6 -6
  45. package/dist/{index-DGMYWPLx.mjs → index-BICrB5kg.mjs} +397 -326
  46. package/dist/index.cjs.js +1 -1
  47. package/dist/index.esm.js +2 -2
  48. package/dist/katex-DLIObQUm.mjs +11683 -0
  49. package/dist/katex.min--Ws3c9be.mjs +6 -0
  50. package/dist/notify-DCQGpmq-.mjs +60 -0
  51. package/dist/plugin-loader.js +54 -54
  52. package/dist/webcomponent-core.js +305 -234
  53. package/dist/webcomponent-core.min.css +1 -1
  54. package/dist/webcomponent-core.min.js +153 -80
  55. package/dist/webcomponent.cjs.js +1 -1
  56. package/dist/webcomponent.esm.js +1 -1
  57. package/dist/webcomponent.js +631 -560
  58. package/dist/webcomponent.min.css +1 -1
  59. package/dist/webcomponent.min.js +1677 -1328
  60. package/package.json +1 -1
  61. package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
  62. package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
  63. package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
  64. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
@@ -1,4 +1,4 @@
1
- const R = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", se = "__editoraCommandEditorRoot", le = "rte-content-rules-styles", f = "rte-content-rules-panel", q = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', pe = {
1
+ const R = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", se = "__editoraCommandEditorRoot", le = "rte-content-rules-styles", f = "rte-content-rules-panel", q = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', xe = {
2
2
  panelTitle: "Content Rules",
3
3
  panelAriaLabel: "Content rules panel",
4
4
  runAuditText: "Run Audit",
@@ -12,18 +12,18 @@ const R = ".rte-content, .editora-content", ee = "[data-editora-editor], .rte-ed
12
12
  requiredHeadingMessage: "Missing required heading",
13
13
  sentenceLengthMessage: "Sentence is too long",
14
14
  readabilityMessage: "Readability score is below threshold"
15
- }, d = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new Set();
16
- let N = 0, xe = 0, E = null, m = null, L = null, I = null, H = null, S = null;
15
+ }, d = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), ge = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new Set();
16
+ let N = 0, ye = 0, E = null, m = null, L = null, I = null, H = null, S = null;
17
17
  function k(e) {
18
18
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
19
19
  }
20
- function ye(e) {
20
+ function we(e) {
21
21
  return {
22
- ...pe,
22
+ ...xe,
23
23
  ...e || {}
24
24
  };
25
25
  }
26
- function we(e) {
26
+ function ke(e) {
27
27
  return e.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
28
28
  }
29
29
  function ie(e) {
@@ -44,8 +44,8 @@ function j(e = {}) {
44
44
  maxIssues: Math.max(1, Number((o = e.maxIssues) != null ? o : 100)),
45
45
  debounceMs: Math.max(50, Number((r = e.debounceMs) != null ? r : 220)),
46
46
  enableRealtime: e.enableRealtime !== !1,
47
- labels: ye(e.labels),
48
- normalizeText: e.normalizeText || we,
47
+ labels: we(e.labels),
48
+ normalizeText: e.normalizeText || ke,
49
49
  customRules: Array.isArray(e.customRules) ? e.customRules : []
50
50
  };
51
51
  }
@@ -58,7 +58,7 @@ function F(e) {
58
58
  const t = e.querySelector(R);
59
59
  return t instanceof HTMLElement ? t : null;
60
60
  }
61
- function ke() {
61
+ function Re() {
62
62
  if (typeof window == "undefined") return null;
63
63
  const e = window[se];
64
64
  if (!(e instanceof HTMLElement)) return null;
@@ -72,7 +72,7 @@ function ke() {
72
72
  }
73
73
  return null;
74
74
  }
75
- function Re(e) {
75
+ function Ee(e) {
76
76
  const t = e.closest("[data-editora-editor]");
77
77
  if (t && F(t) === e)
78
78
  return t;
@@ -87,16 +87,16 @@ function Re(e) {
87
87
  function K(e) {
88
88
  return e ? (e.getAttribute("data-theme") || e.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark") : !1;
89
89
  }
90
- function Ee(e) {
90
+ function ve(e) {
91
91
  const t = X(e);
92
92
  if (K(t)) return !0;
93
93
  const n = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
94
94
  return K(n) ? !0 : K(document.documentElement) || K(document.body);
95
95
  }
96
96
  function G(e, t) {
97
- e.classList.remove("rte-content-rules-theme-dark"), Ee(t) && e.classList.add("rte-content-rules-theme-dark");
97
+ e.classList.remove("rte-content-rules-theme-dark"), ve(t) && e.classList.add("rte-content-rules-theme-dark");
98
98
  }
99
- function ve(e) {
99
+ function Ce(e) {
100
100
  return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
101
101
  }
102
102
  function M(e, t = !0) {
@@ -107,11 +107,11 @@ function M(e, t = !0) {
107
107
  const a = s.querySelector(R);
108
108
  if (a instanceof HTMLElement) return a;
109
109
  }
110
- const n = ke();
110
+ const n = Re();
111
111
  if (n) return n;
112
112
  const o = window.getSelection();
113
113
  if (o && o.rangeCount > 0) {
114
- const s = o.getRangeAt(0).startContainer, a = ve(s), l = a == null ? void 0 : a.closest(R);
114
+ const s = o.getRangeAt(0).startContainer, a = Ce(s), l = a == null ? void 0 : a.closest(R);
115
115
  if (l) return l;
116
116
  }
117
117
  const r = document.activeElement;
@@ -125,11 +125,11 @@ function M(e, t = !0) {
125
125
  function Z(e) {
126
126
  return e.getAttribute("contenteditable") === "false" || e.getAttribute("data-readonly") === "true";
127
127
  }
128
- function Ce(e, t) {
128
+ function $e(e, t) {
129
129
  const n = e.innerText || e.textContent || "";
130
130
  return t(n);
131
131
  }
132
- function $e(e) {
132
+ function Me(e) {
133
133
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
134
134
  }
135
135
  function ce(e) {
@@ -142,11 +142,11 @@ function ue(e) {
142
142
  const t = e.match(/\b[\w'-]+\b/g);
143
143
  return t ? t.length : 0;
144
144
  }
145
- function ge(e) {
145
+ function me(e) {
146
146
  const t = e.match(/[^.!?]+[.!?]*/g);
147
147
  return t ? t.map((n) => n.trim()).filter(Boolean).length : 0;
148
148
  }
149
- function Me(e) {
149
+ function Se(e) {
150
150
  const t = e.toLowerCase().replace(/[^a-z]/g, "");
151
151
  if (!t) return 0;
152
152
  if (t.length <= 3) return 1;
@@ -154,10 +154,10 @@ function Me(e) {
154
154
  let o = n ? n.length : 1;
155
155
  return t.endsWith("e") && (o -= 1), Math.max(1, o);
156
156
  }
157
- function Se(e) {
157
+ function Te(e) {
158
158
  const t = e.match(/\b[\w'-]+\b/g) || [], n = t.length;
159
159
  if (n === 0) return 100;
160
- const o = Math.max(1, ge(e)), r = t.reduce((a, l) => a + Me(l), 0), s = 206.835 - 1.015 * (n / o) - 84.6 * (r / Math.max(1, n));
160
+ const o = Math.max(1, me(e)), r = t.reduce((a, l) => a + Se(l), 0), s = 206.835 - 1.015 * (n / o) - 84.6 * (r / Math.max(1, n));
161
161
  return Number.isFinite(s) ? Math.max(0, Math.min(120, s)) : 0;
162
162
  }
163
163
  function z(e, t) {
@@ -169,43 +169,43 @@ function x(e, t) {
169
169
  function P(e, t, n) {
170
170
  x(e, n) || e.push(t);
171
171
  }
172
- function me(e, t = 140) {
172
+ function be(e, t = 140) {
173
173
  return e.length <= t ? e : `${e.slice(0, t - 1).trimEnd()}...`;
174
174
  }
175
- function Te(e, t, n, o) {
175
+ function Ae(e, t, n, o) {
176
176
  return {
177
177
  id: e.id || z(t, o),
178
178
  ruleId: e.ruleId || t,
179
179
  severity: e.severity || n,
180
180
  message: e.message || t,
181
- excerpt: e.excerpt ? me(e.excerpt, 220) : void 0,
181
+ excerpt: e.excerpt ? be(e.excerpt, 220) : void 0,
182
182
  suggestion: e.suggestion,
183
183
  locateText: e.locateText,
184
184
  selector: e.selector
185
185
  };
186
186
  }
187
- function Ae(e, t) {
187
+ function Le(e, t) {
188
188
  const n = Array.from(e.querySelectorAll("h1, h2, h3, h4, h5, h6")), o = /* @__PURE__ */ new Set();
189
189
  return n.forEach((r) => {
190
190
  const s = t(r.textContent || "").toLowerCase();
191
191
  s && o.add(s);
192
192
  }), o;
193
193
  }
194
- function Le(e) {
194
+ function Ie(e) {
195
195
  const t = e.match(/[^.!?\n]+[.!?]?/g);
196
196
  return t ? t.map((n) => n.trim()).filter(Boolean) : [];
197
197
  }
198
198
  async function v(e, t, n = !1) {
199
- const o = Ce(e, t.normalizeText), r = e.innerHTML, s = `${o.length}:${ce(o)}:${r.length}:${ce(r)}`;
199
+ const o = $e(e, t.normalizeText), r = e.innerHTML, s = `${o.length}:${ce(o)}:${r.length}:${ce(r)}`;
200
200
  if (!n && ae.get(e) === s)
201
201
  return C.get(e) || [];
202
202
  const a = (Y.get(e) || 0) + 1;
203
203
  Y.set(e, a);
204
- const l = ue(o), c = ge(o), u = Se(o), i = [], y = t.labels;
204
+ const l = ue(o), c = me(o), u = Te(o), i = [], y = t.labels;
205
205
  if (t.bannedWords.length > 0) {
206
206
  let w = 0;
207
207
  for (const p of t.bannedWords) {
208
- const g = new RegExp(`\\b${$e(p)}\\b`, "gi");
208
+ const g = new RegExp(`\\b${Me(p)}\\b`, "gi");
209
209
  let b = g.exec(o);
210
210
  for (; b && !x(i, t.maxIssues); ) {
211
211
  const oe = b[0];
@@ -226,7 +226,7 @@ async function v(e, t, n = !1) {
226
226
  }
227
227
  }
228
228
  if (!x(i, t.maxIssues) && t.requiredHeadings.length > 0) {
229
- const w = Ae(e, t.normalizeText);
229
+ const w = Le(e, t.normalizeText);
230
230
  let p = 0;
231
231
  t.requiredHeadings.forEach((g) => {
232
232
  if (x(i, t.maxIssues)) return;
@@ -245,7 +245,7 @@ async function v(e, t, n = !1) {
245
245
  });
246
246
  }
247
247
  if (!x(i, t.maxIssues)) {
248
- const w = Le(o);
248
+ const w = Ie(o);
249
249
  let p = 0;
250
250
  for (const g of w) {
251
251
  if (x(i, t.maxIssues)) break;
@@ -257,7 +257,7 @@ async function v(e, t, n = !1) {
257
257
  ruleId: "sentence-length",
258
258
  severity: "warning",
259
259
  message: `${y.sentenceLengthMessage} (${b}/${t.maxSentenceWords} words)`,
260
- excerpt: me(g, 200),
260
+ excerpt: be(g, 200),
261
261
  locateText: g.slice(0, 64),
262
262
  suggestion: "Split into shorter sentences for readability."
263
263
  },
@@ -293,7 +293,7 @@ async function v(e, t, n = !1) {
293
293
  for (let b = 0; b < g.length && !x(i, t.maxIssues); b += 1)
294
294
  P(
295
295
  i,
296
- Te(g[b], p.id, p.severity || "warning", b),
296
+ Ae(g[b], p.id, p.severity || "warning", b),
297
297
  t.maxIssues
298
298
  );
299
299
  } catch (g) {
@@ -307,7 +307,7 @@ async function v(e, t, n = !1) {
307
307
  wordCount: l,
308
308
  sentenceCount: c
309
309
  };
310
- return ae.set(e, s), C.set(e, i), fe.set(e, D), te(e), e.dispatchEvent(
310
+ return ae.set(e, s), C.set(e, i), ge.set(e, D), te(e), e.dispatchEvent(
311
311
  new CustomEvent("editora:content-rules-audit", {
312
312
  bubbles: !0,
313
313
  detail: {
@@ -317,17 +317,17 @@ async function v(e, t, n = !1) {
317
317
  })
318
318
  ), i;
319
319
  }
320
- function Ie(e) {
320
+ function He(e) {
321
321
  return e.reduce(
322
322
  (t, n) => (t[n.severity] += 1, t),
323
323
  { error: 0, warning: 0, info: 0 }
324
324
  );
325
325
  }
326
- function He(e) {
326
+ function de(e) {
327
327
  return e === "error" ? "Error" : e === "warning" ? "Warning" : "Info";
328
328
  }
329
329
  function $(e, t, n) {
330
- const o = Re(e);
330
+ const o = Ee(e);
331
331
  Array.from(
332
332
  o.querySelectorAll(
333
333
  `.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
@@ -346,7 +346,7 @@ function J(e, t) {
346
346
  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));
347
347
  t.style.left = `${l}px`, t.style.top = `${c}px`;
348
348
  }
349
- function de(e, t) {
349
+ function fe(e, t) {
350
350
  const n = t.trim().toLowerCase();
351
351
  if (!n) return !1;
352
352
  const o = window.getSelection();
@@ -371,7 +371,7 @@ function We(e, t) {
371
371
  if (n)
372
372
  return n.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }), n.focus({ preventScroll: !0 }), !0;
373
373
  }
374
- return !!(t.locateText && de(e, t.locateText) || t.excerpt && de(e, t.excerpt.slice(0, 64)));
374
+ return !!(t.locateText && fe(e, t.locateText) || t.excerpt && fe(e, t.excerpt.slice(0, 64)));
375
375
  }
376
376
  function Oe(e, t) {
377
377
  return (C.get(e) || []).find((o) => o.id === t);
@@ -391,17 +391,17 @@ function te(e) {
391
391
  if (!t) return;
392
392
  const n = d.get(e) || E;
393
393
  if (!n) return;
394
- const o = C.get(e) || [], r = fe.get(e) || {
394
+ const o = C.get(e) || [], r = ge.get(e) || {
395
395
  readabilityScore: 100
396
396
  }, 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
397
  if (!s || !a || !l || !c) return;
398
- const u = Ie(o);
398
+ const u = He(o);
399
399
  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
400
  l.innerHTML = `<li class="rte-content-rules-empty">${k(n.labels.noIssuesText)}</li>`;
401
401
  return;
402
402
  }
403
403
  l.innerHTML = o.map((i) => {
404
- const y = i.excerpt ? `<p class="rte-content-rules-excerpt">${k(i.excerpt)}</p>` : "", D = i.suggestion ? `<p class="rte-content-rules-suggestion">${k(i.suggestion)}</p>` : "", w = `${n.labels.locateText}: ${i.message}`;
404
+ const y = i.excerpt ? `<p class="rte-content-rules-excerpt">${k(i.excerpt)}</p>` : "", D = i.suggestion ? `<p class="rte-content-rules-suggestion">${k(i.suggestion)}</p>` : "", w = `${de(i.severity)} ${i.message}. ${n.labels.locateText}`;
405
405
  return `
406
406
  <li class="rte-content-rules-item rte-content-rules-item-${i.severity}">
407
407
  <button
@@ -412,7 +412,7 @@ function te(e) {
412
412
  data-role="issue-button"
413
413
  aria-label="${k(w)}"
414
414
  >
415
- <span class="rte-content-rules-badge">${k(He(i.severity))}</span>
415
+ <span class="rte-content-rules-badge">${k(de(i.severity))}</span>
416
416
  <span class="rte-content-rules-message">${k(i.message)}</span>
417
417
  </button>
418
418
  ${y}
@@ -433,7 +433,7 @@ function qe(e) {
433
433
  function Pe(e) {
434
434
  const t = h.get(e);
435
435
  if (t) return t;
436
- const n = d.get(e) || E || j(), o = `rte-content-rules-panel-${xe++}`, r = document.createElement("section");
436
+ const n = d.get(e) || E || j(), o = `rte-content-rules-panel-${ye++}`, r = document.createElement("section");
437
437
  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
438
  <header class="rte-content-rules-header">
439
439
  <h2 class="rte-content-rules-title">${k(n.labels.panelTitle)}</h2>
@@ -505,14 +505,14 @@ function Q(e, t) {
505
505
  const n = U(e);
506
506
  return (typeof t == "boolean" ? t : !n) ? ne(e) : W(e, !1), !0;
507
507
  }
508
- function be(e) {
508
+ function he(e) {
509
509
  const t = V.get(e);
510
510
  typeof t == "number" && (window.clearTimeout(t), _.delete(t), V.delete(e));
511
511
  }
512
- function he(e) {
512
+ function pe(e) {
513
513
  const t = d.get(e) || E;
514
514
  if (!t || !A(e, t)) return;
515
- be(e);
515
+ he(e);
516
516
  const n = window.setTimeout(() => {
517
517
  _.delete(n), V.delete(e), v(e, t, !1);
518
518
  }, t.debounceMs);
@@ -740,7 +740,7 @@ function De() {
740
740
  .rte-content-rules-btn-primary:hover,
741
741
  .rte-content-rules-btn-primary:focus-visible {
742
742
  border-color: #0369a1;
743
- background: #0284c7;
743
+ background: #0369a1;
744
744
  color: #ffffff;
745
745
  }
746
746
 
@@ -920,7 +920,7 @@ function Ne(e) {
920
920
  r && (G(r, o), J(o, r), O(o, r, d.get(o) || e)), $(o, "toggleContentRulesPanel", U(o)), $(o, "toggleContentRulesRealtime", A(o, e));
921
921
  }, document.addEventListener("focusin", L, !0)), I || (I = (t) => {
922
922
  const n = t.target, o = n == null ? void 0 : n.closest(R);
923
- o && (m = o, he(o));
923
+ o && (m = o, pe(o));
924
924
  }, document.addEventListener("input", I, !0)), H || (H = (t) => {
925
925
  if (t.defaultPrevented) return;
926
926
  const n = t.target;
@@ -953,7 +953,7 @@ function Ne(e) {
953
953
  }, document.addEventListener("keydown", H, !0)), S || (S = () => {
954
954
  h.forEach((t, n) => {
955
955
  if (!n.isConnected || !t.isConnected) {
956
- be(n), t.remove(), h.delete(n), B.delete(n);
956
+ he(n), t.remove(), h.delete(n), B.delete(n);
957
957
  return;
958
958
  }
959
959
  G(t, n), J(n, t);
@@ -1087,7 +1087,7 @@ const je = (e = {}) => {
1087
1087
  o && o.editorElement ? { editorElement: o.editorElement } : void 0,
1088
1088
  !1
1089
1089
  );
1090
- s && (m = s, d.set(s, r), T.set(s, r.enableRealtime), C.set(s, []), $(s, "toggleContentRulesPanel", !1), $(s, "toggleContentRulesRealtime", r.enableRealtime), r.enableRealtime && he(s));
1090
+ s && (m = s, d.set(s, r), T.set(s, r.enableRealtime), C.set(s, []), $(s, "toggleContentRulesPanel", !1), $(s, "toggleContentRulesRealtime", r.enableRealtime), r.enableRealtime && pe(s));
1091
1091
  },
1092
1092
  destroy: () => {
1093
1093
  N = Math.max(0, N - 1), !(N > 0) && (_.forEach((n) => {
@@ -1099,4 +1099,4 @@ const je = (e = {}) => {
1099
1099
  export {
1100
1100
  je as ContentRulesPlugin
1101
1101
  };
1102
- //# sourceMappingURL=ContentRulesPlugin.native-vPx5nC73.mjs.map
1102
+ //# sourceMappingURL=ContentRulesPlugin.native-BISqhQKJ.mjs.map
@@ -1,4 +1,4 @@
1
- import { i as yt } from "./dialogHelpers-DBf7WqYH.mjs";
1
+ import { i as yt } from "./dialogHelpers-Dzn8DHoF.mjs";
2
2
  const S = ".rte-content, .editora-content", P = '.rte-data-binding[data-binding="true"]', ot = "rte-data-binding-styles", p = "rte-data-binding-dialog-overlay", b = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ht = {
3
3
  dialogTitleInsert: "Insert Data Binding",
4
4
  dialogTitleEdit: "Edit Data Binding",
@@ -523,7 +523,7 @@ function At(t, a, e) {
523
523
  d && Object.entries(d).forEach(([m, f]) => {
524
524
  f != null && u.searchParams.set(m, String(f));
525
525
  });
526
- const s = {
526
+ const c = {
527
527
  method: o,
528
528
  headers: { ...l },
529
529
  credentials: r.credentials,
@@ -535,13 +535,13 @@ function At(t, a, e) {
535
535
  const m = typeof r.body == "function" ? r.body(i) : r.body;
536
536
  if (m != null)
537
537
  if (w(m)) {
538
- s.body = JSON.stringify(m);
539
- const f = s.headers;
538
+ c.body = JSON.stringify(m);
539
+ const f = c.headers;
540
540
  !f["Content-Type"] && !f["content-type"] && (f["Content-Type"] = "application/json");
541
541
  } else
542
- s.body = m;
542
+ c.body = m;
543
543
  }
544
- return { url: u.toString(), init: s };
544
+ return { url: u.toString(), init: c };
545
545
  }
546
546
  async function St(t, a) {
547
547
  var d, u;
@@ -551,7 +551,7 @@ async function St(t, a) {
551
551
  let l = null;
552
552
  o > 0 && (l = window.setTimeout(() => r.abort(), o));
553
553
  try {
554
- const { url: s, init: m } = At(t, a, r.signal), f = await fetch(s, { ...m, signal: r.signal });
554
+ const { url: c, init: m } = At(t, a, r.signal), f = await fetch(c, { ...m, signal: r.signal });
555
555
  if (!f.ok)
556
556
  throw new Error(`Data binding API request failed: ${f.status}`);
557
557
  const $ = (e.responseType || "json") === "text" ? await f.text() : await f.json();
@@ -561,8 +561,8 @@ async function St(t, a) {
561
561
  }
562
562
  const x = Dt($, e.responsePath);
563
563
  return w(x) ? x : w($) ? $ : { value: x };
564
- } catch (s) {
565
- return (s == null ? void 0 : s.name) !== "AbortError" && ((u = e.onError) == null || u.call(e, s, i)), {};
564
+ } catch (c) {
565
+ return (c == null ? void 0 : c.name) !== "AbortError" && ((u = e.onError) == null || u.call(e, c, i)), {};
566
566
  } finally {
567
567
  l !== null && window.clearTimeout(l);
568
568
  }
@@ -674,38 +674,38 @@ function L(t, a, e, r, n) {
674
674
  <button type="button" class="rte-data-binding-btn rte-data-binding-btn-primary" data-action="save">${h(o.saveText)}</button>
675
675
  </footer>
676
676
  `, d.appendChild(u), document.body.appendChild(d);
677
- const s = u.querySelector(".rte-data-binding-key"), m = u.querySelector(".rte-data-binding-fallback"), f = u.querySelector(".rte-data-binding-format"), T = u.querySelector(".rte-data-binding-currency"), $ = () => {
678
- const c = (f == null ? void 0 : f.value) === "currency", y = T == null ? void 0 : T.closest(".rte-data-binding-field");
679
- y && (y.style.display = c ? "grid" : "none");
677
+ const c = u.querySelector(".rte-data-binding-key"), m = u.querySelector(".rte-data-binding-fallback"), f = u.querySelector(".rte-data-binding-format"), T = u.querySelector(".rte-data-binding-currency"), $ = () => {
678
+ const s = (f == null ? void 0 : f.value) === "currency", y = T == null ? void 0 : T.closest(".rte-data-binding-field");
679
+ y && (y.style.display = s ? "grid" : "none");
680
680
  };
681
681
  $(), f == null || f.addEventListener("change", $);
682
682
  const x = () => {
683
683
  d.removeEventListener("click", nt), d.removeEventListener("keydown", rt, !0), document.removeEventListener("keydown", F, !0), d.parentNode && d.parentNode.removeChild(d), R = null, t.focus({ preventScroll: !0 });
684
- }, F = (c) => {
685
- c.key === "Escape" && (c.preventDefault(), c.stopPropagation(), x());
686
- }, nt = (c) => {
687
- c.target === d && x();
688
- }, pt = (c) => {
689
- if (c.key !== "Tab") return;
684
+ }, F = (s) => {
685
+ s.key === "Escape" && (s.preventDefault(), s.stopPropagation(), x());
686
+ }, nt = (s) => {
687
+ s.target === d && x();
688
+ }, pt = (s) => {
689
+ if (s.key !== "Tab" || s.defaultPrevented) return;
690
690
  const y = Array.from(
691
691
  u.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')
692
692
  );
693
693
  if (y.length === 0) return;
694
694
  const E = y[0], D = y[y.length - 1], K = document.activeElement;
695
- if (c.shiftKey && K === E) {
696
- c.preventDefault(), D.focus();
695
+ if (s.shiftKey && K === E) {
696
+ s.preventDefault(), D.focus();
697
697
  return;
698
698
  }
699
- !c.shiftKey && K === D && (c.preventDefault(), E.focus());
699
+ !s.shiftKey && K === D && (s.preventDefault(), E.focus());
700
700
  }, at = async () => {
701
- const c = ((s == null ? void 0 : s.value) || "").trim();
702
- if (!c) {
703
- s == null || s.focus();
701
+ const s = ((c == null ? void 0 : c.value) || "").trim();
702
+ if (!s) {
703
+ c == null || c.focus();
704
704
  return;
705
705
  }
706
706
  const y = j(
707
707
  {
708
- key: c,
708
+ key: s,
709
709
  fallback: ((m == null ? void 0 : m.value) || "").trim(),
710
710
  format: (f == null ? void 0 : f.value) || a.defaultFormat,
711
711
  currency: ((T == null ? void 0 : T.value) || "USD").trim().toUpperCase()
@@ -729,15 +729,15 @@ function L(t, a, e, r, n) {
729
729
  }
730
730
  }
731
731
  Y(t), Q(t, E), x();
732
- }, rt = (c) => {
733
- if (c.key === "Escape") {
734
- c.preventDefault(), x();
732
+ }, rt = (s) => {
733
+ if (s.key === "Escape") {
734
+ s.preventDefault(), x();
735
735
  return;
736
736
  }
737
- pt(c), c.key === "Enter" && !c.shiftKey && c.target instanceof HTMLInputElement && (c.preventDefault(), at());
737
+ pt(s), s.key === "Enter" && !s.shiftKey && s.target instanceof HTMLInputElement && (s.preventDefault(), at());
738
738
  };
739
- u.addEventListener("click", (c) => {
740
- const y = c.target, E = y == null ? void 0 : y.getAttribute("data-action");
739
+ u.addEventListener("click", (s) => {
740
+ const y = s.target, E = y == null ? void 0 : y.getAttribute("data-action");
741
741
  if (E) {
742
742
  if (E === "cancel") {
743
743
  x();
@@ -745,7 +745,7 @@ function L(t, a, e, r, n) {
745
745
  }
746
746
  E === "save" && at();
747
747
  }
748
- }), d.addEventListener("click", nt), d.addEventListener("keydown", rt, !0), document.addEventListener("keydown", F, !0), R = { cleanup: x }, s == null || s.focus();
748
+ }), d.addEventListener("click", nt), d.addEventListener("keydown", rt, !0), document.addEventListener("keydown", F, !0), R = { cleanup: x }, c == null || c.focus();
749
749
  }
750
750
  function Lt(t) {
751
751
  V = t, M || (M = (a) => {
@@ -840,8 +840,8 @@ const Ot = (t = {}) => {
840
840
  if (!o.key) return !1;
841
841
  const l = n.innerHTML, d = ft(o, i.labels);
842
842
  if (gt(n, d), v.get(n) === !0) {
843
- const s = await U(n, i);
844
- C(d, i, !0, s);
843
+ const c = await U(n, i);
844
+ C(d, i, !0, c);
845
845
  }
846
846
  return Y(n), Q(n, l), !0;
847
847
  },
@@ -857,8 +857,8 @@ const Ot = (t = {}) => {
857
857
  if (!d.key) return !1;
858
858
  const u = n.innerHTML;
859
859
  tt(o, d, i.labels);
860
- const s = v.get(n) === !0, m = s ? await U(n, i) : void 0;
861
- return C(o, i, s, m), Y(n), Q(n, u), !0;
860
+ const c = v.get(n) === !0, m = c ? await U(n, i) : void 0;
861
+ return C(o, i, c, m), Y(n), Q(n, u), !0;
862
862
  },
863
863
  toggleDataBindingPreview: async (e, r) => {
864
864
  const n = A(r);
@@ -918,4 +918,4 @@ const Ot = (t = {}) => {
918
918
  export {
919
919
  Ot as DataBindingPlugin
920
920
  };
921
- //# sourceMappingURL=DataBindingPlugin.native-B7lpI_0c.mjs.map
921
+ //# sourceMappingURL=DataBindingPlugin.native-DbaDeXNp.mjs.map
@@ -1,5 +1,6 @@
1
- import { s as u } from "./sanitizeHtml-DA0ajC6k.mjs";
2
- const d = "rte-document-manager-styles", s = `
1
+ import { n as d } from "./notify-DCQGpmq-.mjs";
2
+ import { s } from "./sanitizeHtml-DA0ajC6k.mjs";
3
+ const l = "rte-document-manager-styles", p = `
3
4
  .rte-toolbar-button[data-busy="true"],
4
5
  .rte-docmgr-toolbar-button[data-busy="true"] {
5
6
  position: relative;
@@ -29,13 +30,13 @@ const d = "rte-document-manager-styles", s = `
29
30
  to { transform: rotate(360deg); }
30
31
  }
31
32
  `;
32
- function p() {
33
- if (typeof document == "undefined" || document.getElementById(d)) return;
33
+ function h() {
34
+ if (typeof document == "undefined" || document.getElementById(l)) return;
34
35
  const a = document.createElement("style");
35
- a.id = d, a.textContent = s, document.head.appendChild(a);
36
+ a.id = l, a.textContent = p, document.head.appendChild(a);
36
37
  }
37
- async function l(a) {
38
- p();
38
+ async function c(a) {
39
+ h();
39
40
  const t = typeof window != "undefined" ? window.__editoraLastCommandButton : null;
40
41
  t && (t.disabled = !0, t.setAttribute("data-busy", "true"), t.setAttribute("aria-busy", "true"));
41
42
  try {
@@ -44,7 +45,7 @@ async function l(a) {
44
45
  t && (t.disabled = !1, t.removeAttribute("data-busy"), t.removeAttribute("aria-busy"));
45
46
  }
46
47
  }
47
- const m = () => ({
48
+ const f = () => ({
48
49
  name: "document-manager",
49
50
  toolbar: [
50
51
  {
@@ -94,11 +95,11 @@ const m = () => ({
94
95
  try {
95
96
  const n = a();
96
97
  if (n) {
97
- const { importFromWord: i } = await import("./documentManager-BWK_-KJp.mjs"), c = await i(r);
98
- n.innerHTML = u(c), n.dispatchEvent(new Event("input", { bubbles: !0 }));
98
+ const { importFromWord: i } = await import("./documentManager-8gnG-uG_.mjs"), u = await i(r);
99
+ n.innerHTML = s(u), n.dispatchEvent(new Event("input", { bubbles: !0 }));
99
100
  }
100
101
  } catch (n) {
101
- console.error("Import failed:", n), alert("Failed to import Word document. Please check the console for details.");
102
+ console.error("Import failed:", n), d("Failed to import Word document. Please check the console for details.", "error");
102
103
  }
103
104
  }, t.click(), !0;
104
105
  },
@@ -116,16 +117,16 @@ const m = () => ({
116
117
  const e = document.activeElement;
117
118
  return (e == null ? void 0 : e.getAttribute("contenteditable")) === "true" ? e : (e == null ? void 0 : e.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
118
119
  };
119
- return l(async () => {
120
+ return c(async () => {
120
121
  try {
121
122
  const t = a();
122
123
  if (t) {
123
- const e = t.innerHTML, { exportToWord: r } = await import("./documentManager-BWK_-KJp.mjs");
124
+ const e = t.innerHTML, { exportToWord: r } = await import("./documentManager-8gnG-uG_.mjs");
124
125
  await r(e, "document.docx");
125
126
  }
126
127
  return !0;
127
128
  } catch (t) {
128
- return console.error("Export failed:", t), alert("Failed to export to Word. Please check the console for details."), !1;
129
+ return console.error("Export failed:", t), d("Failed to export to Word. Please check the console for details.", "error"), !1;
129
130
  }
130
131
  });
131
132
  },
@@ -143,17 +144,17 @@ const m = () => ({
143
144
  const e = document.activeElement;
144
145
  return (e == null ? void 0 : e.getAttribute("contenteditable")) === "true" ? e : (e == null ? void 0 : e.closest('[contenteditable="true"]')) || document.querySelector('[contenteditable="true"]');
145
146
  };
146
- return l(async () => {
147
+ return c(async () => {
147
148
  try {
148
149
  const t = a();
149
150
  if (t) {
150
- const e = t.innerHTML, { exportToPdf: r } = await import("./documentManager-BWK_-KJp.mjs");
151
+ const e = t.innerHTML, { exportToPdf: r } = await import("./documentManager-8gnG-uG_.mjs");
151
152
  await r(e, "document.pdf", t);
152
153
  } else
153
- console.error("PDF Export: No editor element found"), alert("No active editor found. Please click in the editor area first.");
154
+ console.error("PDF Export: No editor element found"), d("No active editor found. Please click in the editor area first.");
154
155
  return !0;
155
156
  } catch (t) {
156
- return console.error("PDF Export: Export failed:", t), alert("Failed to export to PDF. Please check the console for details."), !1;
157
+ return console.error("PDF Export: Export failed:", t), d("Failed to export to PDF. Please check the console for details.", "error"), !1;
157
158
  }
158
159
  });
159
160
  }
@@ -161,6 +162,6 @@ const m = () => ({
161
162
  keymap: {}
162
163
  });
163
164
  export {
164
- m as DocumentManagerPlugin
165
+ f as DocumentManagerPlugin
165
166
  };
166
- //# sourceMappingURL=DocumentManagerPlugin.native-B8K-Oqom.mjs.map
167
+ //# sourceMappingURL=DocumentManagerPlugin.native-tZqIa9o5.mjs.map