@editora/core 1.0.23 → 1.0.25

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 (67) 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-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  8. package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-CRpX2G93.mjs} +167 -113
  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-CaBqCH-p.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-0YFHZfsb.mjs +4823 -0
  24. package/dist/MediaManagerPlugin.native-mXWWARRX.mjs +4908 -0
  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-CNqPHT5x.mjs +92 -0
  40. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  41. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-DHLCoWzw.mjs} +1963 -1969
  42. package/dist/editora.min.js +21 -21
  43. package/dist/editora.umd.js +10 -10
  44. package/dist/index-DHPPVQwx.js +12 -0
  45. package/dist/{index-DGMYWPLx.mjs → index-gI4djib2.mjs} +407 -327
  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/shared-config-DuA34Iii.mjs +26 -0
  53. package/dist/webcomponent-core.js +315 -235
  54. package/dist/webcomponent-core.min.css +1 -1
  55. package/dist/webcomponent-core.min.js +153 -80
  56. package/dist/webcomponent.cjs.js +1 -1
  57. package/dist/webcomponent.esm.js +1 -1
  58. package/dist/webcomponent.js +672 -592
  59. package/dist/webcomponent.min.css +1 -1
  60. package/dist/webcomponent.min.js +3099 -1532
  61. package/package.json +1 -1
  62. package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
  63. package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
  64. package/dist/MediaManagerPlugin.native-BT1NZIJS.mjs +0 -998
  65. package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
  66. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
  67. package/dist/index-C1sO7DAC.js +0 -12
@@ -1,5 +1,5 @@
1
1
  import { e as C } from "./escapeHtml-CX8RelZ1.mjs";
2
- import { i as H } from "./dialogHelpers-DBf7WqYH.mjs";
2
+ import { i as H } from "./dialogHelpers-Dzn8DHoF.mjs";
3
3
  const A = /* @__PURE__ */ new Set(), w = [], b = (t) => {
4
4
  w.push(t);
5
5
  }, v = '[data-theme="dark"], .dark, .editora-theme-dark';
@@ -311,13 +311,14 @@ const k = () => {
311
311
  border: "#3b4657",
312
312
  text: "#e2e8f0",
313
313
  muted: "#9fb0c6",
314
+ success: "#4ade80",
314
315
  closeHover: "#334155",
315
316
  summaryBg: "#111827",
316
317
  issueBg: "#1f2937",
317
318
  issueHoverBg: "#273244",
318
319
  issueBorder: "#4b5563",
319
320
  issueHoverBorder: "#58a6ff",
320
- fixBtn: "#3b82f6",
321
+ fixBtn: "#2563eb",
321
322
  fixBtnHover: "#2563eb"
322
323
  } : {
323
324
  overlay: "rgba(0, 0, 0, 0.5)",
@@ -326,6 +327,7 @@ const k = () => {
326
327
  border: "#e0e0e0",
327
328
  text: "#1f2937",
328
329
  muted: "#666666",
330
+ success: "#2e7d32",
329
331
  closeHover: "#f0f0f0",
330
332
  summaryBg: "#f5f5f5",
331
333
  issueBg: "#ffffff",
@@ -377,7 +379,7 @@ const k = () => {
377
379
  font-weight: bold;
378
380
  padding: 8px 16px;
379
381
  border-radius: 4px;
380
- background: ${n >= 80 ? "#4caf50" : n >= 60 ? "#ff9800" : "#f44336"};
382
+ background: ${n >= 80 ? "#2e7d32" : n >= 60 ? "#b45309" : "#c62828"};
381
383
  color: white;
382
384
  `, h.textContent = `${n}/100`;
383
385
  const u = document.createElement("button");
@@ -413,7 +415,7 @@ const k = () => {
413
415
  m.innerHTML = `
414
416
  <div style="text-align: center; padding: 40px 20px;">
415
417
  <div style="font-size: 48px; margin-bottom: 16px;">✅</div>
416
- <h3 style="margin: 0 0 8px 0; color: #4caf50;">No issues found!</h3>
418
+ <h3 style="margin: 0 0 8px 0; color: ${r.success};">No issues found!</h3>
417
419
  <p style="margin: 0; color: ${r.muted};">Your content meets WCAG 2.1 AA standards.</p>
418
420
  </div>
419
421
  `;
@@ -527,4 +529,4 @@ export {
527
529
  R as suppressRule,
528
530
  F as unsuppressRule
529
531
  };
530
- //# sourceMappingURL=A11yCheckerPlugin.native-qW_njhLY.mjs.map
532
+ //# sourceMappingURL=A11yCheckerPlugin.native-BBCsR5Ur.mjs.map
@@ -1,7 +1,8 @@
1
- import { i as z } from "./dialogHelpers-DBf7WqYH.mjs";
1
+ import { i as z } from "./dialogHelpers-Dzn8DHoF.mjs";
2
+ import { n as M } from "./notify-DCQGpmq-.mjs";
2
3
  import { f as D, g as S } from "./editorContainerHelpers-C7kdWnS0.mjs";
3
4
  const b = /* @__PURE__ */ new Set(), y = '[data-theme="dark"], .dark, .editora-theme-dark';
4
- function M(t, l) {
5
+ function H(t, l) {
5
6
  if (l === t.innerHTML) return;
6
7
  const i = window.execEditorCommand || window.executeEditorCommand;
7
8
  if (typeof i == "function")
@@ -10,7 +11,7 @@ function M(t, l) {
10
11
  } catch (r) {
11
12
  }
12
13
  }
13
- function H() {
14
+ function R() {
14
15
  if (typeof window == "undefined" || window.__anchorObserverInitialized) return;
15
16
  window.__anchorObserverInitialized = !0, new MutationObserver((l) => {
16
17
  l.forEach((i) => {
@@ -38,7 +39,7 @@ function H() {
38
39
  function A(t) {
39
40
  return !t || t.trim().length === 0 ? { valid: !1, error: "Anchor ID cannot be empty" } : t.length > 256 ? { valid: !1, error: "Anchor ID must be less than 256 characters" } : /^[A-Za-z_]/.test(t) ? /^[A-Za-z0-9\-_]+$/.test(t) ? { valid: !0, error: "" } : { valid: !1, error: "Anchor ID can only contain letters, numbers, hyphens, and underscores" } : { valid: !1, error: "Anchor ID must start with a letter or underscore" };
40
41
  }
41
- function R() {
42
+ function I() {
42
43
  const t = D();
43
44
  if (!t) return;
44
45
  const l = S(t);
@@ -49,7 +50,7 @@ function R() {
49
50
  e && r.add(e);
50
51
  }), b.clear(), r.forEach((a) => b.add(a));
51
52
  }
52
- function I(t) {
53
+ function _(t) {
53
54
  if (t) {
54
55
  const r = t.startContainer, a = r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement;
55
56
  if (a != null && a.closest(y)) return !0;
@@ -62,9 +63,9 @@ function I(t) {
62
63
  const i = document.activeElement;
63
64
  return i != null && i.closest(y) ? !0 : document.body.matches(y) || document.documentElement.matches(y);
64
65
  }
65
- function _(t, l, i, r) {
66
- document.querySelectorAll(".rte-anchor-dialog-overlay").forEach((s) => s.remove()), R();
67
- const a = I(r), e = a ? {
66
+ function L(t, l, i, r) {
67
+ document.querySelectorAll(".rte-anchor-dialog-overlay").forEach((s) => s.remove()), I();
68
+ const a = _(r), e = a ? {
68
69
  overlay: "rgba(0, 0, 0, 0.62)",
69
70
  dialogBg: "#1f2937",
70
71
  panelBg: "#222d3a",
@@ -81,7 +82,7 @@ function _(t, l, i, r) {
81
82
  cancelBg: "#334155",
82
83
  cancelHover: "#475569",
83
84
  cancelText: "#e2e8f0",
84
- saveBg: "#3b82f6",
85
+ saveBg: "#2563eb",
85
86
  saveHover: "#2563eb",
86
87
  saveDisabledBg: "#374151",
87
88
  saveDisabledText: "#7f8ca1",
@@ -94,7 +95,7 @@ function _(t, l, i, r) {
94
95
  panelBg: "#f9f9f9",
95
96
  border: "#e0e0e0",
96
97
  text: "#333333",
97
- muted: "#999999",
98
+ muted: "#6b6b6b",
98
99
  closeHoverBg: "#e0e0e0",
99
100
  fieldBg: "#ffffff",
100
101
  fieldFocusBg: "#f9f9ff",
@@ -109,7 +110,7 @@ function _(t, l, i, r) {
109
110
  saveHover: "#0052a3",
110
111
  saveDisabledBg: "#d0d0d0",
111
112
  saveDisabledText: "#999999",
112
- help: "#999999",
113
+ help: "#6b6b6b",
113
114
  focusRing: "rgba(0, 102, 204, 0.1)",
114
115
  errorRing: "rgba(211, 47, 47, 0.1)"
115
116
  }, n = document.createElement("div");
@@ -272,7 +273,7 @@ function _(t, l, i, r) {
272
273
  s.target === n && w();
273
274
  }, f.appendChild(u), f.appendChild(C), f.appendChild(E), n.appendChild(f), document.body.appendChild(n), setTimeout(() => o.focus(), 100);
274
275
  }
275
- function L(t, l) {
276
+ function O(t, l) {
276
277
  var c;
277
278
  let i;
278
279
  if (l)
@@ -301,7 +302,7 @@ function L(t, l) {
301
302
  `, i.insertNode(n), b.add(t), i.setStart(n.nextSibling || n.parentNode, 0), i.collapse(!0);
302
303
  const f = window.getSelection();
303
304
  if (f && (f.removeAllRanges(), f.addRange(i)), r)
304
- M(r, e), r.dispatchEvent(new Event("input", { bubbles: !0 }));
305
+ H(r, e), r.dispatchEvent(new Event("input", { bubbles: !0 }));
305
306
  else {
306
307
  const u = D();
307
308
  if (u) {
@@ -394,7 +395,7 @@ function N() {
394
395
  }
395
396
  `, document.head.appendChild(t);
396
397
  }
397
- const j = () => (typeof window != "undefined" && (H(), N()), {
398
+ const P = () => (typeof window != "undefined" && (R(), N()), {
398
399
  name: "anchor",
399
400
  toolbar: [
400
401
  {
@@ -409,10 +410,10 @@ const j = () => (typeof window != "undefined" && (H(), N()), {
409
410
  try {
410
411
  const t = window.getSelection();
411
412
  if (!t || t.rangeCount === 0)
412
- return alert("Please place your cursor where you want to insert the anchor."), !1;
413
+ return M("Please place your cursor where you want to insert the anchor."), !1;
413
414
  const l = t.getRangeAt(0).cloneRange();
414
- return _("add", "", (i) => {
415
- L(i, l);
415
+ return L("add", "", (i) => {
416
+ O(i, l);
416
417
  }, l), !0;
417
418
  } catch (t) {
418
419
  return console.error("Failed to insert anchor:", t), !1;
@@ -424,6 +425,6 @@ const j = () => (typeof window != "undefined" && (H(), N()), {
424
425
  }
425
426
  });
426
427
  export {
427
- j as AnchorPlugin
428
+ P as AnchorPlugin
428
429
  };
429
- //# sourceMappingURL=AnchorPlugin.native-Drmxhy98.mjs.map
430
+ //# sourceMappingURL=AnchorPlugin.native-Dk9R26cF.mjs.map
@@ -1,4 +1,5 @@
1
- const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", et = "__editoraCommandEditorRoot", ot = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", k = "approvalWorkflow", v = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ft = {
1
+ import { f as ft } from "./dialogHelpers-Dzn8DHoF.mjs";
2
+ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", et = "__editoraCommandEditorRoot", ot = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", k = "approvalWorkflow", v = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', mt = {
2
3
  panelTitle: "Approval Workflow",
3
4
  panelAriaLabel: "Approval workflow panel",
4
5
  statusLabel: "Status",
@@ -22,16 +23,16 @@ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-edi
22
23
  lockedSuffix: "Locked",
23
24
  shortcutText: "Shortcuts: Ctrl/Cmd+Alt+Shift+A/R/P/D",
24
25
  approveCommentRequiredText: "Approval comment is required."
25
- }, mt = {
26
+ }, bt = {
26
27
  draft: "statusDraftText",
27
28
  review: "statusReviewText",
28
29
  approved: "statusApprovedText"
29
30
  }, p = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new Set();
30
- let _ = 0, bt = 0, rt = 0, at = 0, R = null, g = null, T = null, L = null, S = null;
31
+ let _ = 0, vt = 0, rt = 0, at = 0, R = null, g = null, T = null, L = null, S = null;
31
32
  function c(t) {
32
33
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
33
34
  }
34
- function vt(t) {
35
+ function gt(t) {
35
36
  return t.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
36
37
  }
37
38
  function lt(t) {
@@ -46,10 +47,10 @@ function z(t = {}) {
46
47
  requireCommentOnApprove: !!t.requireCommentOnApprove,
47
48
  defaultActor: (t.defaultActor || "system").trim() || "system",
48
49
  labels: {
49
- ...ft,
50
+ ...mt,
50
51
  ...t.labels || {}
51
52
  },
52
- normalizeText: t.normalizeText || vt
53
+ normalizeText: t.normalizeText || gt
53
54
  };
54
55
  }
55
56
  function Y(t) {
@@ -61,7 +62,7 @@ function K(t) {
61
62
  const e = t.querySelector(w);
62
63
  return e instanceof HTMLElement ? e : null;
63
64
  }
64
- function gt() {
65
+ function ht() {
65
66
  if (typeof window == "undefined") return null;
66
67
  const t = window[et];
67
68
  if (!(t instanceof HTMLElement)) return null;
@@ -75,7 +76,7 @@ function gt() {
75
76
  }
76
77
  return null;
77
78
  }
78
- function ht(t) {
79
+ function xt(t) {
79
80
  const e = t.closest("[data-editora-editor]");
80
81
  if (e && K(e) === t)
81
82
  return e;
@@ -90,14 +91,14 @@ function ht(t) {
90
91
  function W(t) {
91
92
  return t ? (t.getAttribute("data-theme") || t.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : t.classList.contains("dark") || t.classList.contains("editora-theme-dark") || t.classList.contains("rte-theme-dark") : !1;
92
93
  }
93
- function xt(t) {
94
+ function wt(t) {
94
95
  const e = Y(t);
95
96
  if (W(e)) return !0;
96
97
  const o = e.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
97
98
  return W(o) ? !0 : W(document.documentElement) || W(document.body);
98
99
  }
99
100
  function B(t, e) {
100
- t.classList.remove("rte-approval-theme-dark"), xt(e) && t.classList.add("rte-approval-theme-dark");
101
+ t.classList.remove("rte-approval-theme-dark"), wt(e) && t.classList.add("rte-approval-theme-dark");
101
102
  }
102
103
  function it(t) {
103
104
  return t ? t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement : null;
@@ -110,7 +111,7 @@ function x(t, e = !0) {
110
111
  const l = n.querySelector(w);
111
112
  if (l instanceof HTMLElement) return l;
112
113
  }
113
- const o = gt();
114
+ const o = ht();
114
115
  if (o) return o;
115
116
  const a = window.getSelection();
116
117
  if (a && a.rangeCount > 0) {
@@ -131,17 +132,17 @@ function D() {
131
132
  e.isConnected || ((o = y.get(e)) == null || o.remove(), y.delete(e), O.delete(e), p.delete(e), I.delete(e), H.delete(e), g === e && (g = null));
132
133
  });
133
134
  }
134
- function wt(t) {
135
+ function yt(t) {
135
136
  return t ? !!(t.closest(`.${d}`) || t.closest(w) || t.closest(F)) : !1;
136
137
  }
137
- function yt() {
138
+ function kt() {
138
139
  const t = window.getSelection();
139
140
  if (!t || t.rangeCount === 0) return !1;
140
141
  const e = t.getRangeAt(0).startContainer, o = it(e);
141
142
  return !!(o != null && o.closest(w));
142
143
  }
143
144
  function C(t, e, o) {
144
- const a = ht(t);
145
+ const a = xt(t);
145
146
  Array.from(
146
147
  a.querySelectorAll(
147
148
  `.rte-toolbar-button[data-command="${e}"], .editora-toolbar-button[data-command="${e}"]`
@@ -168,7 +169,7 @@ function J(t, e) {
168
169
  function Q() {
169
170
  return rt += 1, `approval-comment-${Date.now().toString(36)}-${rt.toString(36)}`;
170
171
  }
171
- function kt() {
172
+ function At() {
172
173
  return at += 1, `approval-signoff-${Date.now().toString(36)}-${at.toString(36)}`;
173
174
  }
174
175
  function pt(t) {
@@ -180,8 +181,8 @@ function pt(t) {
180
181
  updatedAt: t.updatedAt
181
182
  };
182
183
  }
183
- function At(t, e) {
184
- const o = mt[t];
184
+ function St(t, e) {
185
+ const o = bt[t];
185
186
  return e.labels[o] || t;
186
187
  }
187
188
  function ct(t, e, o) {
@@ -218,7 +219,7 @@ function M(t, e) {
218
219
  const o = t.querySelector(".rte-approval-live");
219
220
  o && (o.textContent = e);
220
221
  }
221
- function St(t, e) {
222
+ function Et(t, e) {
222
223
  const o = pt(e);
223
224
  t.__approvalWorkflowState = o, t.dispatchEvent(
224
225
  new CustomEvent("editora:approval-state-changed", {
@@ -229,14 +230,14 @@ function St(t, e) {
229
230
  })
230
231
  );
231
232
  }
232
- function q(t) {
233
+ function P(t) {
233
234
  const e = y.get(t);
234
235
  if (!e) return;
235
236
  const o = p.get(t) || R;
236
237
  if (!o) return;
237
238
  const a = f(t, o), r = e.querySelector(".rte-approval-summary"), n = e.querySelector('[data-action="request-review"]'), l = e.querySelector('[data-action="approve"]'), s = e.querySelector('[data-action="reopen-draft"]'), u = e.querySelector(".rte-approval-comments-list"), m = e.querySelector(".rte-approval-signoffs-list");
238
239
  if (r) {
239
- const i = At(a.status, o);
240
+ const i = St(a.status, o);
240
241
  r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${a.comments.length} | Sign-offs: ${a.signoffs.length}${a.locked ? ` | ${o.labels.lockedSuffix}` : ""}`;
241
242
  }
242
243
  n && (n.disabled = a.status !== "draft"), l && (l.disabled = a.status === "approved"), s && (s.disabled = a.status === "draft"), u && (a.comments.length === 0 ? u.innerHTML = `<li class="rte-approval-empty">${c(o.labels.noCommentsText)}</li>` : u.innerHTML = a.comments.slice().reverse().map(
@@ -266,7 +267,7 @@ function q(t) {
266
267
  ).join(""));
267
268
  }
268
269
  function G(t, e, o) {
269
- e.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), ct(t, e, o), q(t), St(t, e);
270
+ e.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), ct(t, e, o), P(t), Et(t, e);
270
271
  }
271
272
  function nt(t, e, o, a) {
272
273
  t.comments.push({
@@ -300,7 +301,7 @@ function Z(t, e, o, a) {
300
301
  if (e.requireCommentOnApprove && !n) return !1;
301
302
  const l = f(t, e), s = t.innerHTML;
302
303
  return l.status = "approved", l.signoffs.push({
303
- id: kt(),
304
+ id: At(),
304
305
  author: r,
305
306
  comment: n || void 0,
306
307
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -315,7 +316,7 @@ function Z(t, e, o, a) {
315
316
  function N(t, e) {
316
317
  return t.querySelector(`[data-field="${e}"]`);
317
318
  }
318
- function Et(t) {
319
+ function $t(t) {
319
320
  var a, r;
320
321
  const e = ((a = N(t, "actor")) == null ? void 0 : a.value) || "", o = ((r = N(t, "comment")) == null ? void 0 : r.value) || "";
321
322
  return { actor: e, comment: o };
@@ -325,10 +326,10 @@ function U(t, e) {
325
326
  const a = Y(t).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 420), n = Math.max(10, window.innerWidth - r - 10), l = Math.min(Math.max(10, a.right - r), n), s = Math.max(10, Math.min(window.innerHeight - 10 - 280, a.top + 12));
326
327
  e.style.width = `${r}px`, e.style.left = `${l}px`, e.style.top = `${s}px`, e.style.maxHeight = `${Math.max(280, window.innerHeight - 24)}px`;
327
328
  }
328
- function $t(t) {
329
+ function Ct(t) {
329
330
  const e = y.get(t);
330
331
  if (e) return e;
331
- const o = p.get(t) || R || z(), a = `rte-approval-panel-${bt++}`, r = document.createElement("section");
332
+ const o = p.get(t) || R || z(), a = `rte-approval-panel-${vt++}`, r = document.createElement("section");
332
333
  return r.className = d, r.id = a, r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "false"), r.setAttribute("aria-label", o.labels.panelAriaLabel), r.setAttribute("tabindex", "-1"), r.innerHTML = `
333
334
  <header class="rte-approval-header">
334
335
  <h2 class="rte-approval-title">${c(o.labels.panelTitle)}</h2>
@@ -389,10 +390,10 @@ function $t(t) {
389
390
  if (!s) return;
390
391
  const u = s.getAttribute("data-action") || "", m = p.get(t) || R || o;
391
392
  if (p.set(t, m), f(t, m), u === "close") {
392
- P(t, !0);
393
+ q(t, !0);
393
394
  return;
394
395
  }
395
- const i = Et(r);
396
+ const i = $t(r);
396
397
  if (u === "request-review") {
397
398
  $(t, "review", m, i.actor || m.defaultActor) && M(r, "Status changed to review.");
398
399
  return;
@@ -420,47 +421,47 @@ function $t(t) {
420
421
  return;
421
422
  }
422
423
  }), r.addEventListener("keydown", (n) => {
423
- n.key === "Escape" && (n.preventDefault(), P(t, !0));
424
- }), B(r, t), document.body.appendChild(r), y.set(t, r), O.set(t, !1), q(t), r;
424
+ n.key === "Escape" && (n.preventDefault(), q(t, !0));
425
+ }), B(r, t), document.body.appendChild(r), y.set(t, r), O.set(t, !1), P(t), r;
425
426
  }
426
427
  function tt(t) {
427
428
  return O.get(t) === !0;
428
429
  }
429
430
  function A(t) {
430
431
  D();
431
- const e = $t(t);
432
+ const e = Ct(t);
432
433
  y.forEach((o, a) => {
433
- a !== t && P(a, !1);
434
- }), e.classList.add("show"), O.set(t, !0), C(t, "toggleApprovalWorkflowPanel", !0), B(e, t), U(t, e), q(t);
434
+ a !== t && q(a, !1);
435
+ }), e.classList.add("show"), O.set(t, !0), C(t, "toggleApprovalWorkflowPanel", !0), B(e, t), U(t, e), P(t), ft(e);
435
436
  }
436
- function P(t, e = !1) {
437
+ function q(t, e = !1) {
437
438
  const o = y.get(t);
438
439
  o && (o.classList.remove("show"), O.set(t, !1), C(t, "toggleApprovalWorkflowPanel", !1), e && t.focus({ preventScroll: !0 }));
439
440
  }
440
441
  function ut(t, e) {
441
442
  const o = tt(t);
442
- return (typeof e == "boolean" ? e : !o) ? A(t) : P(t), !0;
443
+ return (typeof e == "boolean" ? e : !o) ? A(t) : q(t), !0;
443
444
  }
444
445
  function V(t) {
445
446
  return typeof t.key == "string" ? t.key.toLowerCase() : "";
446
447
  }
447
- function Ct(t) {
448
+ function Tt(t) {
448
449
  const e = V(t);
449
450
  return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "a";
450
451
  }
451
- function Tt(t) {
452
+ function Lt(t) {
452
453
  const e = V(t);
453
454
  return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "r";
454
455
  }
455
- function Lt(t) {
456
+ function Rt(t) {
456
457
  const e = V(t);
457
458
  return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "p";
458
459
  }
459
- function Rt(t) {
460
+ function Mt(t) {
460
461
  const e = V(t);
461
462
  return (t.metaKey || t.ctrlKey) && t.altKey && t.shiftKey && e === "d";
462
463
  }
463
- function Mt(t) {
464
+ function Dt(t) {
464
465
  R = t, T || (T = (e) => {
465
466
  D();
466
467
  const o = e.target, a = o == null ? void 0 : o.closest(w);
@@ -472,12 +473,12 @@ function Mt(t) {
472
473
  n && (B(n, a), U(a, n));
473
474
  }, document.addEventListener("focusin", T, !0)), L || (L = (e) => {
474
475
  if (e.defaultPrevented) return;
475
- const o = Ct(e), a = Tt(e), r = Lt(e), n = Rt(e), l = e.key === "Escape";
476
+ const o = Tt(e), a = Lt(e), r = Rt(e), n = Mt(e), l = e.key === "Escape";
476
477
  if (!l && !o && !a && !r && !n)
477
478
  return;
478
479
  D();
479
480
  const s = e.target, u = !!(s != null && s.closest(`.${d} input, .${d} textarea, .${d} select`));
480
- if (!wt(s) && !yt())
481
+ if (!yt(s) && !kt())
481
482
  return;
482
483
  const i = x(void 0, !1);
483
484
  if (!i) return;
@@ -485,7 +486,7 @@ function Mt(t) {
485
486
  p.set(i, b);
486
487
  const E = f(i, b);
487
488
  if (g = i, l && tt(i)) {
488
- e.preventDefault(), P(i, !0);
489
+ e.preventDefault(), q(i, !0);
489
490
  return;
490
491
  }
491
492
  if (!u) {
@@ -509,7 +510,7 @@ function Mt(t) {
509
510
  });
510
511
  }, window.addEventListener("scroll", S, !0), window.addEventListener("resize", S));
511
512
  }
512
- function Dt(t) {
513
+ function Ht(t) {
513
514
  var o, a;
514
515
  const e = I.get(t);
515
516
  e && (t.classList.remove("rte-approval-locked-editor"), t.removeAttribute("data-approval-status"), t.removeAttribute("data-approval-locked"), st(
@@ -518,8 +519,8 @@ function Dt(t) {
518
519
  (a = e.preApprovalReadonly) != null ? a : e.originalReadonly
519
520
  ));
520
521
  }
521
- function Ht() {
522
- T && (document.removeEventListener("focusin", T, !0), T = null), L && (document.removeEventListener("keydown", L, !0), L = null), S && (window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S), S = null), y.forEach((t) => t.remove()), y.clear(), H.forEach((t) => Dt(t)), H.clear(), R = null, g = null;
522
+ function Pt() {
523
+ T && (document.removeEventListener("focusin", T, !0), T = null), L && (document.removeEventListener("keydown", L, !0), L = null), S && (window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S), S = null), y.forEach((t) => t.remove()), y.clear(), H.forEach((t) => Ht(t)), H.clear(), R = null, g = null;
523
524
  }
524
525
  function qt() {
525
526
  if (typeof document == "undefined" || document.getElementById(ot)) return;
@@ -858,7 +859,7 @@ function qt() {
858
859
 
859
860
  .rte-approval-item-time {
860
861
  font-size: 11px;
861
- color: #64748b;
862
+ color: #475569;
862
863
  }
863
864
 
864
865
  .${d}.rte-approval-theme-dark .rte-approval-item-time {
@@ -877,7 +878,7 @@ function qt() {
877
878
  border-radius: 8px;
878
879
  padding: 8px;
879
880
  font-size: 12px;
880
- color: #64748b;
881
+ color: #475569;
881
882
  }
882
883
 
883
884
  .${d}.rte-approval-theme-dark .rte-approval-empty {
@@ -888,7 +889,7 @@ function qt() {
888
889
  .rte-approval-shortcut {
889
890
  margin: 0;
890
891
  font-size: 11px;
891
- color: #64748b;
892
+ color: #475569;
892
893
  }
893
894
 
894
895
  .${d}.rte-approval-theme-dark .rte-approval-shortcut {
@@ -917,7 +918,7 @@ function qt() {
917
918
  }
918
919
  `, document.head.appendChild(t);
919
920
  }
920
- const Pt = (t = {}) => {
921
+ const _t = (t = {}) => {
921
922
  const e = z(t);
922
923
  return qt(), {
923
924
  name: "approvalWorkflow",
@@ -964,7 +965,7 @@ const Pt = (t = {}) => {
964
965
  const r = x(a);
965
966
  if (!r) return !1;
966
967
  const n = p.get(r) || e;
967
- return p.set(r, n), f(r, n), g = r, A(r), q(r), !0;
968
+ return p.set(r, n), f(r, n), g = r, A(r), P(r), !0;
968
969
  },
969
970
  toggleApprovalWorkflowPanel: (o, a) => {
970
971
  const r = x(a);
@@ -1062,19 +1063,19 @@ const Pt = (t = {}) => {
1062
1063
  init: function(a) {
1063
1064
  _ += 1;
1064
1065
  const r = this && typeof this.__pluginConfig == "object" ? z({ ...e, ...this.__pluginConfig }) : e;
1065
- Mt(r);
1066
+ Dt(r);
1066
1067
  const n = x(
1067
1068
  a != null && a.editorElement ? { editorElement: a.editorElement } : void 0,
1068
1069
  !1
1069
1070
  );
1070
- n && (p.set(n, r), f(n, r), g = n, q(n));
1071
+ n && (p.set(n, r), f(n, r), g = n, P(n));
1071
1072
  },
1072
1073
  destroy: () => {
1073
- _ = Math.max(0, _ - 1), !(_ > 0) && Ht();
1074
+ _ = Math.max(0, _ - 1), !(_ > 0) && Pt();
1074
1075
  }
1075
1076
  };
1076
1077
  };
1077
1078
  export {
1078
- Pt as ApprovalWorkflowPlugin
1079
+ _t as ApprovalWorkflowPlugin
1079
1080
  };
1080
- //# sourceMappingURL=ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs.map
1081
+ //# sourceMappingURL=ApprovalWorkflowPlugin.native-AeJsehXM.mjs.map