@editora/plugins 1.0.9 → 1.0.10

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 (140) hide show
  1. package/README.md +5 -0
  2. package/dist/_commonjsHelpers-6763f629.js +1 -0
  3. package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
  4. package/dist/a11y-checker.cjs.js +12 -12
  5. package/dist/a11y-checker.esm.js +98 -80
  6. package/dist/anchor.cjs.js +12 -12
  7. package/dist/anchor.esm.js +128 -115
  8. package/dist/anchoredPopover-33f1358d.mjs +109 -0
  9. package/dist/anchoredPopover-8151d535.js +1 -0
  10. package/dist/approval-workflow.cjs.js +40 -40
  11. package/dist/approval-workflow.esm.js +249 -208
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +68 -55
  14. package/dist/blockquote.esm.js +2 -1
  15. package/dist/blocks-library.cjs.js +45 -45
  16. package/dist/blocks-library.esm.js +245 -178
  17. package/dist/capitalization.esm.js +2 -1
  18. package/dist/checklist.cjs.js +1 -1
  19. package/dist/checklist.esm.js +82 -58
  20. package/dist/citations.cjs.js +37 -37
  21. package/dist/citations.esm.js +512 -439
  22. package/dist/clear-formatting.cjs.js +1 -1
  23. package/dist/clear-formatting.esm.js +33 -27
  24. package/dist/code-sample.cjs.js +14 -14
  25. package/dist/code-sample.esm.js +93 -82
  26. package/dist/code.cjs.js +32 -32
  27. package/dist/code.esm.js +653 -594
  28. package/dist/comments.cjs.js +6 -6
  29. package/dist/comments.esm.js +158 -116
  30. package/dist/conditional-content.cjs.js +90 -90
  31. package/dist/conditional-content.esm.js +432 -371
  32. package/dist/content-rules.cjs.js +7 -7
  33. package/dist/content-rules.esm.js +159 -105
  34. package/dist/data-binding.cjs.js +46 -46
  35. package/dist/data-binding.esm.js +368 -328
  36. package/dist/direction.esm.js +18 -9
  37. package/dist/doc-schema.cjs.js +29 -29
  38. package/dist/doc-schema.esm.js +308 -240
  39. package/dist/document-manager.cjs.js +1 -1
  40. package/dist/document-manager.esm.js +5 -4
  41. package/dist/documentManager-25b6203c.mjs +9122 -0
  42. package/dist/documentManager-b69e7054.js +17 -0
  43. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
  44. package/dist/embed-iframe.cjs.js +4 -4
  45. package/dist/embed-iframe.esm.js +81 -73
  46. package/dist/emojis.cjs.js +8 -8
  47. package/dist/emojis.esm.js +77 -65
  48. package/dist/enterprise.cjs.js +1 -1
  49. package/dist/enterprise.esm.js +56 -54
  50. package/dist/font-family.cjs.js +1 -1
  51. package/dist/font-family.esm.js +47 -39
  52. package/dist/font-size.cjs.js +1 -1
  53. package/dist/font-size.esm.js +53 -37
  54. package/dist/footnote.cjs.js +2 -2
  55. package/dist/footnote.esm.js +117 -76
  56. package/dist/history.cjs.js +1 -1
  57. package/dist/history.esm.js +92 -70
  58. package/dist/html2canvas.esm-09133e29.js +22 -0
  59. package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
  60. package/dist/indent.cjs.js +1 -1
  61. package/dist/indent.esm.js +24 -12
  62. package/dist/index-656d224b.js +231 -0
  63. package/dist/index-6a8c48bb.js +1 -0
  64. package/dist/index-d027b7e2.mjs +16859 -0
  65. package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-730f2d98.mjs +5775 -0
  68. package/dist/index.es-dd40173b.js +18 -0
  69. package/dist/index.esm.js +128 -125
  70. package/dist/italic.cjs.js +1 -1
  71. package/dist/italic.esm.js +9 -8
  72. package/dist/jspdf.es.min-90db2c97.js +243 -0
  73. package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
  74. package/dist/line-height.cjs.js +1 -1
  75. package/dist/line-height.esm.js +24 -11
  76. package/dist/link.cjs.js +5 -5
  77. package/dist/link.esm.js +30 -24
  78. package/dist/list.cjs.js +1 -1
  79. package/dist/list.esm.js +25 -20
  80. package/dist/lite.cjs.js +1 -1
  81. package/dist/lite.esm.js +61 -59
  82. package/dist/math.cjs.js +21 -21
  83. package/dist/math.esm.js +146 -139
  84. package/dist/media-manager.cjs.js +38 -38
  85. package/dist/media-manager.esm.js +325 -308
  86. package/dist/mentions.cjs.js +9 -9
  87. package/dist/mentions.esm.js +286 -238
  88. package/dist/merge-tag.cjs.js +2 -2
  89. package/dist/merge-tag.esm.js +216 -177
  90. package/dist/page-break.cjs.js +2 -2
  91. package/dist/page-break.esm.js +49 -33
  92. package/dist/pii-redaction.cjs.js +19 -19
  93. package/dist/pii-redaction.esm.js +463 -393
  94. package/dist/preview.esm.js +10 -5
  95. package/dist/print.cjs.js +4 -4
  96. package/dist/print.esm.js +20 -17
  97. package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
  98. package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
  99. package/dist/slash-commands.cjs.js +3 -3
  100. package/dist/slash-commands.esm.js +212 -176
  101. package/dist/smart-paste.cjs.js +27 -27
  102. package/dist/smart-paste.esm.js +336 -280
  103. package/dist/special-characters.cjs.js +7 -7
  104. package/dist/special-characters.esm.js +69 -61
  105. package/dist/spell-check.cjs.js +5 -5
  106. package/dist/spell-check.esm.js +123 -97
  107. package/dist/strikethrough.cjs.js +1 -1
  108. package/dist/strikethrough.esm.js +19 -14
  109. package/dist/style.css +1 -0
  110. package/dist/table.cjs.js +4 -4
  111. package/dist/table.esm.js +225 -191
  112. package/dist/template.cjs.js +11 -11
  113. package/dist/template.esm.js +153 -124
  114. package/dist/text-alignment.cjs.js +1 -1
  115. package/dist/text-alignment.esm.js +27 -21
  116. package/dist/text-color.cjs.js +3 -3
  117. package/dist/text-color.esm.js +87 -70
  118. package/dist/track-changes.cjs.js +2 -2
  119. package/dist/track-changes.esm.js +162 -100
  120. package/dist/translation-workflow.cjs.js +74 -74
  121. package/dist/translation-workflow.esm.js +678 -602
  122. package/dist/version-diff.cjs.js +14 -14
  123. package/dist/version-diff.esm.js +157 -128
  124. package/package.json +13 -7
  125. package/LICENSE +0 -21
  126. package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
  127. package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
  128. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  129. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  130. package/dist/documentManager-CTqRftU8.mjs +0 -8369
  131. package/dist/documentManager-Jf0RbSks.js +0 -17
  132. package/dist/html2canvas.esm-B5qzocYs.js +0 -5
  133. package/dist/index-CvJk4DKa.js +0 -221
  134. package/dist/index-D3CycEFU.mjs +0 -16543
  135. package/dist/index-tqLTHcO6.js +0 -1
  136. package/dist/index.es-CE_A4QSm.js +0 -5
  137. package/dist/index.es-DQ78mYYo.mjs +0 -6665
  138. package/dist/jspdf.es.min-BoS80556.js +0 -77
  139. package/dist/plugins.css +0 -1
  140. /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
@@ -1,4 +1,4 @@
1
- const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ee = "__editoraCommandEditorRoot", te = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", y = "approvalWorkflow", g = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ue = {
1
+ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ee = "__editoraCommandEditorRoot", te = "rte-approval-workflow-styles", d = "rte-approval-panel", h = "approval", y = "approvalWorkflow", v = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', ue = {
2
2
  panelTitle: "Approval Workflow",
3
3
  panelAriaLabel: "Approval workflow panel",
4
4
  statusLabel: "Status",
@@ -26,9 +26,9 @@ const w = ".rte-content, .editora-content", F = "[data-editora-editor], .rte-edi
26
26
  draft: "statusDraftText",
27
27
  review: "statusReviewText",
28
28
  approved: "statusApprovedText"
29
- }, s = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new Set();
30
- let _ = 0, me = 0, oe = 0, re = 0, R = null, v = null, T = null, L = null, S = null;
31
- function p(e) {
29
+ }, p = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new Set();
30
+ let _ = 0, me = 0, oe = 0, re = 0, R = null, g = null, T = null, L = null, S = null;
31
+ function c(e) {
32
32
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
33
33
  }
34
34
  function be(e) {
@@ -55,26 +55,32 @@ function U(e) {
55
55
  return e.closest(F) || e;
56
56
  }
57
57
  function B(e) {
58
- if (!e) return null;
59
- if (e.matches(w)) return e;
58
+ if (!e)
59
+ return null;
60
+ if (e.matches(w))
61
+ return e;
60
62
  const t = e.querySelector(w);
61
63
  return t instanceof HTMLElement ? t : null;
62
64
  }
63
- function ge() {
64
- if (typeof window > "u") return null;
65
+ function ve() {
66
+ if (typeof window > "u")
67
+ return null;
65
68
  const e = window[ee];
66
- if (!(e instanceof HTMLElement)) return null;
69
+ if (!(e instanceof HTMLElement))
70
+ return null;
67
71
  window[ee] = null;
68
72
  const t = B(e);
69
- if (t) return t;
73
+ if (t)
74
+ return t;
70
75
  const o = e.closest(F);
71
76
  if (o) {
72
- const n = B(o);
73
- if (n) return n;
77
+ const a = B(o);
78
+ if (a)
79
+ return a;
74
80
  }
75
81
  return null;
76
82
  }
77
- function ve(e) {
83
+ function ge(e) {
78
84
  const t = e.closest("[data-editora-editor]");
79
85
  if (t && B(t) === e)
80
86
  return t;
@@ -91,7 +97,8 @@ function W(e) {
91
97
  }
92
98
  function he(e) {
93
99
  const t = U(e);
94
- if (W(t)) return !0;
100
+ if (W(t))
101
+ return !0;
95
102
  const o = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
96
103
  return W(o) ? !0 : W(document.documentElement) || W(document.body);
97
104
  }
@@ -102,31 +109,39 @@ function le(e) {
102
109
  return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
103
110
  }
104
111
  function x(e, t = !0) {
105
- if (D(), e?.contentElement instanceof HTMLElement) return e.contentElement;
106
- if (e?.editorElement instanceof HTMLElement) {
107
- const a = e.editorElement;
108
- if (a.matches(w)) return a;
109
- const l = a.querySelector(w);
110
- if (l instanceof HTMLElement) return l;
112
+ if (D(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
113
+ return e.contentElement;
114
+ if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
115
+ const n = e.editorElement;
116
+ if (n.matches(w))
117
+ return n;
118
+ const l = n.querySelector(w);
119
+ if (l instanceof HTMLElement)
120
+ return l;
111
121
  }
112
- const o = ge();
113
- if (o) return o;
114
- const n = window.getSelection();
115
- if (n && n.rangeCount > 0) {
116
- const l = le(n.getRangeAt(0).startContainer)?.closest(w);
117
- if (l) return l;
122
+ const o = ve();
123
+ if (o)
124
+ return o;
125
+ const a = window.getSelection();
126
+ if (a && a.rangeCount > 0) {
127
+ const n = le(a.getRangeAt(0).startContainer), l = n == null ? void 0 : n.closest(w);
128
+ if (l)
129
+ return l;
118
130
  }
119
131
  const r = document.activeElement;
120
132
  if (r) {
121
- if (r.matches(w)) return r;
122
- const a = r.closest(w);
123
- if (a) return a;
133
+ if (r.matches(w))
134
+ return r;
135
+ const n = r.closest(w);
136
+ if (n)
137
+ return n;
124
138
  }
125
- return v && v.isConnected ? v : (v && !v.isConnected && (v = null), t ? document.querySelector(w) : null);
139
+ return g && g.isConnected ? g : (g && !g.isConnected && (g = null), t ? document.querySelector(w) : null);
126
140
  }
127
141
  function D() {
128
142
  Array.from(H).forEach((t) => {
129
- t.isConnected || (k.get(t)?.remove(), k.delete(t), O.delete(t), s.delete(t), I.delete(t), H.delete(t), v === t && (v = null));
143
+ var o;
144
+ t.isConnected || ((o = k.get(t)) == null || o.remove(), k.delete(t), O.delete(t), p.delete(t), I.delete(t), H.delete(t), g === t && (g = null));
130
145
  });
131
146
  }
132
147
  function xe(e) {
@@ -134,18 +149,19 @@ function xe(e) {
134
149
  }
135
150
  function we() {
136
151
  const e = window.getSelection();
137
- if (!e || e.rangeCount === 0) return !1;
138
- const t = e.getRangeAt(0).startContainer;
139
- return !!le(t)?.closest(w);
152
+ if (!e || e.rangeCount === 0)
153
+ return !1;
154
+ const t = e.getRangeAt(0).startContainer, o = le(t);
155
+ return !!(o != null && o.closest(w));
140
156
  }
141
157
  function C(e, t, o) {
142
- const n = ve(e);
158
+ const a = ge(e);
143
159
  Array.from(
144
- n.querySelectorAll(
160
+ a.querySelectorAll(
145
161
  `.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
146
162
  )
147
- ).forEach((a) => {
148
- a.classList.toggle("active", o), a.setAttribute("aria-pressed", o ? "true" : "false"), a.setAttribute("data-active", o ? "true" : "false");
163
+ ).forEach((n) => {
164
+ n.classList.toggle("active", o), n.setAttribute("aria-pressed", o ? "true" : "false"), n.setAttribute("data-active", o ? "true" : "false");
149
165
  });
150
166
  }
151
167
  function ie(e, t, o) {
@@ -155,7 +171,8 @@ function Y(e) {
155
171
  e.dispatchEvent(new Event("input", { bubbles: !0 }));
156
172
  }
157
173
  function X(e, t) {
158
- if (t === e.innerHTML) return;
174
+ if (t === e.innerHTML)
175
+ return;
159
176
  const o = window.execEditorCommand || window.executeEditorCommand;
160
177
  if (typeof o == "function")
161
178
  try {
@@ -182,7 +199,7 @@ function ye(e, t) {
182
199
  const o = fe[e];
183
200
  return t.labels[o] || e;
184
201
  }
185
- function ce(e, t, o) {
202
+ function pe(e, t, o) {
186
203
  if (e.setAttribute("data-approval-status", t.status), e.setAttribute("data-approval-locked", t.locked ? "true" : "false"), e.classList.toggle("rte-approval-locked-editor", t.locked), C(e, "toggleApprovalWorkflowPanel", Z(e)), C(e, "requestApprovalReview", t.status === "review"), C(e, "approveDocument", t.status === "approved"), C(e, "reopenDraft", t.status === "draft"), t.status === "approved" && o.lockOnApproval) {
187
204
  t.locked || (t.preApprovalContentEditable = e.getAttribute("contenteditable"), t.preApprovalReadonly = e.getAttribute("data-readonly")), e.setAttribute("contenteditable", "false"), e.setAttribute("data-readonly", "true"), t.locked = !0;
188
205
  return;
@@ -205,7 +222,7 @@ function f(e, t) {
205
222
  originalReadonly: e.getAttribute("data-readonly"),
206
223
  preApprovalContentEditable: null,
207
224
  preApprovalReadonly: null
208
- }, I.set(e, o), H.add(e), ce(e, o, t), o);
225
+ }, I.set(e, o), H.add(e), pe(e, o, t), o);
209
226
  }
210
227
  function j(e, t) {
211
228
  return e.length <= t ? e : e.slice(e.length - t);
@@ -227,107 +244,115 @@ function Ae(e, t) {
227
244
  }
228
245
  function q(e) {
229
246
  const t = k.get(e);
230
- if (!t) return;
231
- const o = s.get(e) || R;
232
- if (!o) return;
233
- const n = f(e, o), r = t.querySelector(".rte-approval-summary"), a = t.querySelector('[data-action="request-review"]'), l = t.querySelector('[data-action="approve"]'), c = t.querySelector('[data-action="reopen-draft"]'), u = t.querySelector(".rte-approval-comments-list"), m = t.querySelector(".rte-approval-signoffs-list");
247
+ if (!t)
248
+ return;
249
+ const o = p.get(e) || R;
250
+ if (!o)
251
+ return;
252
+ const a = f(e, o), r = t.querySelector(".rte-approval-summary"), n = t.querySelector('[data-action="request-review"]'), l = t.querySelector('[data-action="approve"]'), s = t.querySelector('[data-action="reopen-draft"]'), u = t.querySelector(".rte-approval-comments-list"), m = t.querySelector(".rte-approval-signoffs-list");
234
253
  if (r) {
235
- const i = ye(n.status, o);
236
- r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${n.comments.length} | Sign-offs: ${n.signoffs.length}${n.locked ? ` | ${o.labels.lockedSuffix}` : ""}`;
254
+ const i = ye(a.status, o);
255
+ r.textContent = `${o.labels.summaryPrefix}: ${i} | Comments: ${a.comments.length} | Sign-offs: ${a.signoffs.length}${a.locked ? ` | ${o.labels.lockedSuffix}` : ""}`;
237
256
  }
238
- a && (a.disabled = n.status !== "draft"), l && (l.disabled = n.status === "approved"), c && (c.disabled = n.status === "draft"), u && (n.comments.length === 0 ? u.innerHTML = `<li class="rte-approval-empty">${p(o.labels.noCommentsText)}</li>` : u.innerHTML = n.comments.slice().reverse().map(
257
+ 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(
239
258
  (i) => `
240
259
  <li class="rte-approval-item rte-approval-item-${i.kind}" role="listitem">
241
260
  <div class="rte-approval-item-head">
242
- <span class="rte-approval-item-author">${p(i.author)}</span>
243
- <time class="rte-approval-item-time" datetime="${p(i.createdAt)}">${p(
261
+ <span class="rte-approval-item-author">${c(i.author)}</span>
262
+ <time class="rte-approval-item-time" datetime="${c(i.createdAt)}">${c(
244
263
  new Date(i.createdAt).toLocaleString()
245
264
  )}</time>
246
265
  </div>
247
- <p class="rte-approval-item-message">${p(i.message)}</p>
266
+ <p class="rte-approval-item-message">${c(i.message)}</p>
248
267
  </li>
249
268
  `
250
- ).join("")), m && (n.signoffs.length === 0 ? m.innerHTML = `<li class="rte-approval-empty">${p(o.labels.noSignoffsText)}</li>` : m.innerHTML = n.signoffs.slice().reverse().map(
269
+ ).join("")), m && (a.signoffs.length === 0 ? m.innerHTML = `<li class="rte-approval-empty">${c(o.labels.noSignoffsText)}</li>` : m.innerHTML = a.signoffs.slice().reverse().map(
251
270
  (i) => `
252
271
  <li class="rte-approval-item" role="listitem">
253
272
  <div class="rte-approval-item-head">
254
- <span class="rte-approval-item-author">${p(i.author)}</span>
255
- <time class="rte-approval-item-time" datetime="${p(i.createdAt)}">${p(
273
+ <span class="rte-approval-item-author">${c(i.author)}</span>
274
+ <time class="rte-approval-item-time" datetime="${c(i.createdAt)}">${c(
256
275
  new Date(i.createdAt).toLocaleString()
257
276
  )}</time>
258
277
  </div>
259
- <p class="rte-approval-item-message">${p(i.comment || "Approved")}</p>
278
+ <p class="rte-approval-item-message">${c(i.comment || "Approved")}</p>
260
279
  </li>
261
280
  `
262
281
  ).join(""));
263
282
  }
264
283
  function G(e, t, o) {
265
- t.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), ce(e, t, o), q(e), Ae(e, t);
284
+ t.updatedAt = (/* @__PURE__ */ new Date()).toISOString(), pe(e, t, o), q(e), Ae(e, t);
266
285
  }
267
- function ae(e, t, o, n) {
286
+ function ae(e, t, o, a) {
268
287
  e.comments.push({
269
288
  id: J(),
270
289
  author: o || t.defaultActor,
271
- message: n,
290
+ message: a,
272
291
  kind: "system",
273
292
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
274
293
  }), e.comments = j(e.comments, t.maxHistoryEntries);
275
294
  }
276
- function E(e, t, o, n) {
295
+ function E(e, t, o, a) {
277
296
  const r = f(e, o);
278
- if (r.status === t) return !1;
279
- const a = e.innerHTML;
280
- return r.status = t, t === "review" ? ae(r, o, n, "Review requested.") : t === "draft" && ae(r, o, n, "Returned to draft."), G(e, r, o), Y(e), X(e, a), !0;
297
+ if (r.status === t)
298
+ return !1;
299
+ const n = e.innerHTML;
300
+ return r.status = t, t === "review" ? ae(r, o, a, "Review requested.") : t === "draft" && ae(r, o, a, "Returned to draft."), G(e, r, o), Y(e), X(e, n), !0;
281
301
  }
282
- function pe(e, t, o, n) {
283
- const r = n.normalizeText(t);
284
- if (!r) return !1;
285
- const a = n.normalizeText(o) || n.defaultActor, l = f(e, n), c = e.innerHTML;
302
+ function ce(e, t, o, a) {
303
+ const r = a.normalizeText(t);
304
+ if (!r)
305
+ return !1;
306
+ const n = a.normalizeText(o) || a.defaultActor, l = f(e, a), s = e.innerHTML;
286
307
  return l.comments.push({
287
308
  id: J(),
288
- author: a,
309
+ author: n,
289
310
  message: r,
290
311
  kind: "comment",
291
312
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
292
- }), l.comments = j(l.comments, n.maxHistoryEntries), G(e, l, n), Y(e), X(e, c), !0;
313
+ }), l.comments = j(l.comments, a.maxHistoryEntries), G(e, l, a), Y(e), X(e, s), !0;
293
314
  }
294
- function Q(e, t, o, n) {
295
- const r = t.normalizeText(o) || t.defaultActor, a = t.normalizeText(n);
296
- if (t.requireCommentOnApprove && !a) return !1;
297
- const l = f(e, t), c = e.innerHTML;
315
+ function Q(e, t, o, a) {
316
+ const r = t.normalizeText(o) || t.defaultActor, n = t.normalizeText(a);
317
+ if (t.requireCommentOnApprove && !n)
318
+ return !1;
319
+ const l = f(e, t), s = e.innerHTML;
298
320
  return l.status = "approved", l.signoffs.push({
299
321
  id: ke(),
300
322
  author: r,
301
- comment: a || void 0,
323
+ comment: n || void 0,
302
324
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
303
- }), l.signoffs = j(l.signoffs, t.maxHistoryEntries), a && (l.comments.push({
325
+ }), l.signoffs = j(l.signoffs, t.maxHistoryEntries), n && (l.comments.push({
304
326
  id: J(),
305
327
  author: r,
306
- message: a,
328
+ message: n,
307
329
  kind: "system",
308
330
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
309
- }), l.comments = j(l.comments, t.maxHistoryEntries)), G(e, l, t), Y(e), X(e, c), !0;
331
+ }), l.comments = j(l.comments, t.maxHistoryEntries)), G(e, l, t), Y(e), X(e, s), !0;
310
332
  }
311
333
  function N(e, t) {
312
334
  return e.querySelector(`[data-field="${t}"]`);
313
335
  }
314
336
  function Se(e) {
315
- const t = N(e, "actor")?.value || "", o = N(e, "comment")?.value || "";
337
+ var a, r;
338
+ const t = ((a = N(e, "actor")) == null ? void 0 : a.value) || "", o = ((r = N(e, "comment")) == null ? void 0 : r.value) || "";
316
339
  return { actor: t, comment: o };
317
340
  }
318
341
  function V(e, t) {
319
- if (!t.classList.contains("show")) return;
320
- const n = U(e).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 420), a = Math.max(10, window.innerWidth - r - 10), l = Math.min(Math.max(10, n.right - r), a), c = Math.max(10, Math.min(window.innerHeight - 10 - 280, n.top + 12));
321
- t.style.width = `${r}px`, t.style.left = `${l}px`, t.style.top = `${c}px`, t.style.maxHeight = `${Math.max(280, window.innerHeight - 24)}px`;
342
+ if (!t.classList.contains("show"))
343
+ return;
344
+ const a = U(e).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));
345
+ t.style.width = `${r}px`, t.style.left = `${l}px`, t.style.top = `${s}px`, t.style.maxHeight = `${Math.max(280, window.innerHeight - 24)}px`;
322
346
  }
323
347
  function $e(e) {
324
348
  const t = k.get(e);
325
- if (t) return t;
326
- const o = s.get(e) || R || z(), n = `rte-approval-panel-${me++}`, r = document.createElement("section");
327
- return r.className = d, r.id = n, r.setAttribute("role", "dialog"), r.setAttribute("aria-modal", "false"), r.setAttribute("aria-label", o.labels.panelAriaLabel), r.setAttribute("tabindex", "-1"), r.innerHTML = `
349
+ if (t)
350
+ return t;
351
+ const o = p.get(e) || R || z(), a = `rte-approval-panel-${me++}`, r = document.createElement("section");
352
+ 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 = `
328
353
  <header class="rte-approval-header">
329
- <h2 class="rte-approval-title">${p(o.labels.panelTitle)}</h2>
330
- <button type="button" class="rte-approval-icon-btn" data-action="close" aria-label="${p(
354
+ <h2 class="rte-approval-title">${c(o.labels.panelTitle)}</h2>
355
+ <button type="button" class="rte-approval-icon-btn" data-action="close" aria-label="${c(
331
356
  o.labels.closeText
332
357
  )}">✕</button>
333
358
  </header>
@@ -335,55 +360,57 @@ function $e(e) {
335
360
  <p class="rte-approval-summary" aria-live="polite"></p>
336
361
 
337
362
  <div class="rte-approval-controls" role="toolbar" aria-label="Approval actions">
338
- <button type="button" class="rte-approval-btn" data-action="request-review">${p(
363
+ <button type="button" class="rte-approval-btn" data-action="request-review">${c(
339
364
  o.labels.requestReviewText
340
365
  )}</button>
341
- <button type="button" class="rte-approval-btn rte-approval-btn-primary" data-action="approve">${p(
366
+ <button type="button" class="rte-approval-btn rte-approval-btn-primary" data-action="approve">${c(
342
367
  o.labels.approveText
343
368
  )}</button>
344
- <button type="button" class="rte-approval-btn" data-action="reopen-draft">${p(
369
+ <button type="button" class="rte-approval-btn" data-action="reopen-draft">${c(
345
370
  o.labels.reopenDraftText
346
371
  )}</button>
347
372
  </div>
348
373
 
349
374
  <div class="rte-approval-form">
350
375
  <label class="rte-approval-label">
351
- ${p(o.labels.actorLabel)}
352
- <input type="text" data-field="actor" class="rte-approval-field" autocomplete="off" placeholder="${p(
376
+ ${c(o.labels.actorLabel)}
377
+ <input type="text" data-field="actor" class="rte-approval-field" autocomplete="off" placeholder="${c(
353
378
  o.labels.actorPlaceholder
354
379
  )}" />
355
380
  </label>
356
381
  <label class="rte-approval-label">
357
- ${p(o.labels.commentLabel)}
358
- <textarea data-field="comment" class="rte-approval-field" rows="2" placeholder="${p(
382
+ ${c(o.labels.commentLabel)}
383
+ <textarea data-field="comment" class="rte-approval-field" rows="2" placeholder="${c(
359
384
  o.labels.commentPlaceholder
360
385
  )}"></textarea>
361
386
  </label>
362
- <button type="button" class="rte-approval-btn" data-action="add-comment">${p(
387
+ <button type="button" class="rte-approval-btn" data-action="add-comment">${c(
363
388
  o.labels.addCommentText
364
389
  )}</button>
365
390
  </div>
366
391
 
367
- <section class="rte-approval-section" aria-label="${p(o.labels.commentsHeading)}">
368
- <h3 class="rte-approval-section-title">${p(o.labels.commentsHeading)}</h3>
392
+ <section class="rte-approval-section" aria-label="${c(o.labels.commentsHeading)}">
393
+ <h3 class="rte-approval-section-title">${c(o.labels.commentsHeading)}</h3>
369
394
  <ul class="rte-approval-comments-list" role="list"></ul>
370
395
  </section>
371
396
 
372
- <section class="rte-approval-section" aria-label="${p(o.labels.signoffsHeading)}">
373
- <h3 class="rte-approval-section-title">${p(o.labels.signoffsHeading)}</h3>
397
+ <section class="rte-approval-section" aria-label="${c(o.labels.signoffsHeading)}">
398
+ <h3 class="rte-approval-section-title">${c(o.labels.signoffsHeading)}</h3>
374
399
  <ul class="rte-approval-signoffs-list" role="list"></ul>
375
400
  </section>
376
401
 
377
- <p class="rte-approval-shortcut">${p(o.labels.shortcutText)}</p>
402
+ <p class="rte-approval-shortcut">${c(o.labels.shortcutText)}</p>
378
403
  <span class="rte-approval-live" aria-live="polite"></span>
379
404
  </div>
380
- `, r.addEventListener("click", (a) => {
381
- const l = a.target;
382
- if (!l) return;
383
- const c = l.closest("[data-action]");
384
- if (!c) return;
385
- const u = c.getAttribute("data-action") || "", m = s.get(e) || R || o;
386
- if (s.set(e, m), f(e, m), u === "close") {
405
+ `, r.addEventListener("click", (n) => {
406
+ const l = n.target;
407
+ if (!l)
408
+ return;
409
+ const s = l.closest("[data-action]");
410
+ if (!s)
411
+ return;
412
+ const u = s.getAttribute("data-action") || "", m = p.get(e) || R || o;
413
+ if (p.set(e, m), f(e, m), u === "close") {
387
414
  P(e, !0);
388
415
  return;
389
416
  }
@@ -409,13 +436,14 @@ function $e(e) {
409
436
  return;
410
437
  }
411
438
  if (u === "add-comment") {
412
- if (!pe(e, i.comment, i.actor, m)) return;
439
+ if (!ce(e, i.comment, i.actor, m))
440
+ return;
413
441
  const $ = N(r, "comment");
414
442
  $ && ($.value = ""), M(r, "Comment added.");
415
443
  return;
416
444
  }
417
- }), r.addEventListener("keydown", (a) => {
418
- a.key === "Escape" && (a.preventDefault(), P(e, !0));
445
+ }), r.addEventListener("keydown", (n) => {
446
+ n.key === "Escape" && (n.preventDefault(), P(e, !0));
419
447
  }), K(r, e), document.body.appendChild(r), k.set(e, r), O.set(e, !1), q(e), r;
420
448
  }
421
449
  function Z(e) {
@@ -424,8 +452,8 @@ function Z(e) {
424
452
  function A(e) {
425
453
  D();
426
454
  const t = $e(e);
427
- k.forEach((o, n) => {
428
- n !== e && P(n, !1);
455
+ k.forEach((o, a) => {
456
+ a !== e && P(a, !1);
429
457
  }), t.classList.add("show"), O.set(e, !0), C(e, "toggleApprovalWorkflowPanel", !0), K(t, e), V(e, t), q(e);
430
458
  }
431
459
  function P(e, t = !1) {
@@ -455,28 +483,31 @@ function Le(e) {
455
483
  function Re(e) {
456
484
  R = e, T || (T = (t) => {
457
485
  D();
458
- const n = t.target?.closest(w);
459
- if (!n) return;
460
- v = n;
461
- const r = s.get(n) || e;
462
- s.set(n, r), f(n, r);
463
- const a = k.get(n);
464
- a && (K(a, n), V(n, a));
486
+ const o = t.target, a = o == null ? void 0 : o.closest(w);
487
+ if (!a)
488
+ return;
489
+ g = a;
490
+ const r = p.get(a) || e;
491
+ p.set(a, r), f(a, r);
492
+ const n = k.get(a);
493
+ n && (K(n, a), V(a, n));
465
494
  }, document.addEventListener("focusin", T, !0)), L || (L = (t) => {
466
- if (t.defaultPrevented) return;
467
- const o = Ee(t), n = Ce(t), r = Te(t), a = Le(t), l = t.key === "Escape";
468
- if (!l && !o && !n && !r && !a)
495
+ if (t.defaultPrevented)
496
+ return;
497
+ const o = Ee(t), a = Ce(t), r = Te(t), n = Le(t), l = t.key === "Escape";
498
+ if (!l && !o && !a && !r && !n)
469
499
  return;
470
500
  D();
471
- const c = t.target, u = !!c?.closest(`.${d} input, .${d} textarea, .${d} select`);
472
- if (!xe(c) && !we())
501
+ const s = t.target, u = !!(s != null && s.closest(`.${d} input, .${d} textarea, .${d} select`));
502
+ if (!xe(s) && !we())
473
503
  return;
474
504
  const i = x(void 0, !1);
475
- if (!i) return;
476
- const b = s.get(i) || R || e;
477
- s.set(i, b);
505
+ if (!i)
506
+ return;
507
+ const b = p.get(i) || R || e;
508
+ p.set(i, b);
478
509
  const $ = f(i, b);
479
- if (v = i, l && Z(i)) {
510
+ if (g = i, l && Z(i)) {
480
511
  t.preventDefault(), P(i, !0);
481
512
  return;
482
513
  }
@@ -485,7 +516,7 @@ function Re(e) {
485
516
  t.preventDefault(), t.stopPropagation(), de(i);
486
517
  return;
487
518
  }
488
- if (n) {
519
+ if (a) {
489
520
  t.preventDefault(), t.stopPropagation(), E(i, "review", b, b.defaultActor) && A(i);
490
521
  return;
491
522
  }
@@ -493,7 +524,7 @@ function Re(e) {
493
524
  t.preventDefault(), t.stopPropagation(), Q(i, b, b.defaultActor, "Approved via keyboard shortcut.") && A(i);
494
525
  return;
495
526
  }
496
- a && (t.preventDefault(), t.stopPropagation(), $.status !== "draft" && E(i, "draft", b, b.defaultActor) && A(i));
527
+ n && (t.preventDefault(), t.stopPropagation(), $.status !== "draft" && E(i, "draft", b, b.defaultActor) && A(i));
497
528
  }
498
529
  }, document.addEventListener("keydown", L, !0)), S || (S = () => {
499
530
  D(), k.forEach((t, o) => {
@@ -510,10 +541,11 @@ function Me(e) {
510
541
  ));
511
542
  }
512
543
  function De() {
513
- 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), k.forEach((e) => e.remove()), k.clear(), H.forEach((e) => Me(e)), H.clear(), R = null, v = null;
544
+ 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), k.forEach((e) => e.remove()), k.clear(), H.forEach((e) => Me(e)), H.clear(), R = null, g = null;
514
545
  }
515
546
  function He() {
516
- if (typeof document > "u" || document.getElementById(te)) return;
547
+ if (typeof document > "u" || document.getElementById(te))
548
+ return;
517
549
  const e = document.createElement("style");
518
550
  e.id = te, e.textContent = `
519
551
  .rte-toolbar-group-items.${h},
@@ -542,10 +574,10 @@ function He() {
542
574
  background-color: #ccc;
543
575
  }
544
576
 
545
- ${g} .rte-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
546
- ${g} .editora-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
547
- ${g} .rte-toolbar-button[data-command="reopenDraft"].active,
548
- ${g} .editora-toolbar-button[data-command="reopenDraft"].active {
577
+ ${v} .rte-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
578
+ ${v} .editora-toolbar-button[data-command="toggleApprovalWorkflowPanel"].active,
579
+ ${v} .rte-toolbar-button[data-command="reopenDraft"].active,
580
+ ${v} .editora-toolbar-button[data-command="reopenDraft"].active {
549
581
  background: linear-gradient(180deg, #5eaaf6 0%, #4a95de 100%);
550
582
  }
551
583
 
@@ -556,23 +588,23 @@ function He() {
556
588
  border-right: none;
557
589
  }
558
590
 
559
- ${g} .rte-toolbar-group-items.${h},
560
- ${g} .editora-toolbar-group-items.${h},
561
- ${g} .rte-toolbar-group-items.${y},
562
- ${g} .editora-toolbar-group-items.${y},
591
+ ${v} .rte-toolbar-group-items.${h},
592
+ ${v} .editora-toolbar-group-items.${h},
593
+ ${v} .rte-toolbar-group-items.${y},
594
+ ${v} .editora-toolbar-group-items.${y},
563
595
  .${d}.rte-approval-theme-dark {
564
596
  border-color: #566275;
565
597
  }
566
- ${g} .rte-toolbar-group-items.${h} .rte-toolbar-button svg,
567
- ${g} .editora-toolbar-group-items.${h} .editora-toolbar-button svg,
568
- ${g} .rte-toolbar-group-items.${y} .rte-toolbar-button svg,
569
- ${g} .editora-toolbar-group-items.${y} .editora-toolbar-button svg
598
+ ${v} .rte-toolbar-group-items.${h} .rte-toolbar-button svg,
599
+ ${v} .editora-toolbar-group-items.${h} .editora-toolbar-button svg,
600
+ ${v} .rte-toolbar-group-items.${y} .rte-toolbar-button svg,
601
+ ${v} .editora-toolbar-group-items.${y} .editora-toolbar-button svg
570
602
  {
571
603
  fill: none;
572
604
  }
573
605
 
574
- ${g} .rte-toolbar-group-items.${h} .rte-toolbar-button,
575
- ${g} .editora-toolbar-group-items.${h} .editora-toolbar-button
606
+ ${v} .rte-toolbar-group-items.${h} .rte-toolbar-button,
607
+ ${v} .editora-toolbar-group-items.${h} .editora-toolbar-button
576
608
  {
577
609
  border-color: #566275;
578
610
  }
@@ -951,90 +983,99 @@ const qe = (e = {}) => {
951
983
  }
952
984
  ],
953
985
  commands: {
954
- approvalWorkflow: (o, n) => {
955
- const r = x(n);
956
- if (!r) return !1;
957
- const a = s.get(r) || t;
958
- return s.set(r, a), f(r, a), v = r, A(r), q(r), !0;
986
+ approvalWorkflow: (o, a) => {
987
+ const r = x(a);
988
+ if (!r)
989
+ return !1;
990
+ const n = p.get(r) || t;
991
+ return p.set(r, n), f(r, n), g = r, A(r), q(r), !0;
959
992
  },
960
- toggleApprovalWorkflowPanel: (o, n) => {
961
- const r = x(n);
962
- if (!r) return !1;
963
- const a = s.get(r) || t;
964
- return s.set(r, a), f(r, a), v = r, de(r, typeof o == "boolean" ? o : void 0);
993
+ toggleApprovalWorkflowPanel: (o, a) => {
994
+ const r = x(a);
995
+ if (!r)
996
+ return !1;
997
+ const n = p.get(r) || t;
998
+ return p.set(r, n), f(r, n), g = r, de(r, typeof o == "boolean" ? o : void 0);
965
999
  },
966
- requestApprovalReview: (o, n) => {
967
- const r = x(n);
968
- if (!r) return !1;
969
- const a = s.get(r) || t;
970
- s.set(r, a), f(r, a);
971
- const l = E(r, "review", a, a.defaultActor);
1000
+ requestApprovalReview: (o, a) => {
1001
+ const r = x(a);
1002
+ if (!r)
1003
+ return !1;
1004
+ const n = p.get(r) || t;
1005
+ p.set(r, n), f(r, n);
1006
+ const l = E(r, "review", n, n.defaultActor);
972
1007
  return A(r), l;
973
1008
  },
974
- approveDocument: (o, n) => {
975
- const r = x(n);
976
- if (!r) return !1;
977
- const a = s.get(r) || t;
978
- s.set(r, a), f(r, a);
979
- const l = typeof o == "object" && o ? String(o.author || "") : a.defaultActor, c = typeof o == "object" && o ? String(o.comment || "") : typeof o == "string" ? o : "", u = Q(r, a, l, c);
1009
+ approveDocument: (o, a) => {
1010
+ const r = x(a);
1011
+ if (!r)
1012
+ return !1;
1013
+ const n = p.get(r) || t;
1014
+ p.set(r, n), f(r, n);
1015
+ const l = typeof o == "object" && o ? String(o.author || "") : n.defaultActor, s = typeof o == "object" && o ? String(o.comment || "") : typeof o == "string" ? o : "", u = Q(r, n, l, s);
980
1016
  return u && A(r), u;
981
1017
  },
982
- reopenDraft: (o, n) => {
983
- const r = x(n);
984
- if (!r) return !1;
985
- const a = s.get(r) || t;
986
- s.set(r, a), f(r, a);
987
- const l = E(r, "draft", a, a.defaultActor);
1018
+ reopenDraft: (o, a) => {
1019
+ const r = x(a);
1020
+ if (!r)
1021
+ return !1;
1022
+ const n = p.get(r) || t;
1023
+ p.set(r, n), f(r, n);
1024
+ const l = E(r, "draft", n, n.defaultActor);
988
1025
  return l && A(r), l;
989
1026
  },
990
- addApprovalComment: (o, n) => {
991
- const r = x(n);
992
- if (!r) return !1;
993
- const a = s.get(r) || t;
994
- s.set(r, a), f(r, a);
995
- const l = typeof o == "object" && o ? String(o.author || "") : a.defaultActor, c = typeof o == "object" && o ? String(o.message || "") : typeof o == "string" ? o : "", u = pe(r, c, l, a);
1027
+ addApprovalComment: (o, a) => {
1028
+ const r = x(a);
1029
+ if (!r)
1030
+ return !1;
1031
+ const n = p.get(r) || t;
1032
+ p.set(r, n), f(r, n);
1033
+ const l = typeof o == "object" && o ? String(o.author || "") : n.defaultActor, s = typeof o == "object" && o ? String(o.message || "") : typeof o == "string" ? o : "", u = ce(r, s, l, n);
996
1034
  return u && A(r), u;
997
1035
  },
998
- setApprovalStatus: (o, n) => {
999
- const r = x(n);
1000
- if (!r || !o) return !1;
1001
- const a = ne(o), l = s.get(r) || t;
1002
- s.set(r, l), f(r, l);
1003
- const c = E(r, a, l, l.defaultActor);
1004
- return c && A(r), c;
1036
+ setApprovalStatus: (o, a) => {
1037
+ const r = x(a);
1038
+ if (!r || !o)
1039
+ return !1;
1040
+ const n = ne(o), l = p.get(r) || t;
1041
+ p.set(r, l), f(r, l);
1042
+ const s = E(r, n, l, l.defaultActor);
1043
+ return s && A(r), s;
1005
1044
  },
1006
- setApprovalWorkflowOptions: (o, n) => {
1007
- const r = x(n);
1008
- if (!r || !o || typeof o != "object") return !1;
1009
- const a = s.get(r) || t, l = z({
1010
- ...a,
1045
+ setApprovalWorkflowOptions: (o, a) => {
1046
+ const r = x(a);
1047
+ if (!r || !o || typeof o != "object")
1048
+ return !1;
1049
+ const n = p.get(r) || t, l = z({
1050
+ ...n,
1011
1051
  ...o,
1012
1052
  labels: {
1013
- ...a.labels,
1053
+ ...n.labels,
1014
1054
  ...o.labels || {}
1015
1055
  },
1016
- normalizeText: o.normalizeText || a.normalizeText
1056
+ normalizeText: o.normalizeText || n.normalizeText
1017
1057
  });
1018
- s.set(r, l);
1019
- const c = f(r, l);
1020
- return G(r, c, l), !0;
1058
+ p.set(r, l);
1059
+ const s = f(r, l);
1060
+ return G(r, s, l), !0;
1021
1061
  },
1022
- getApprovalWorkflowState: (o, n) => {
1023
- const r = x(n);
1024
- if (!r) return !1;
1025
- const a = s.get(r) || t;
1026
- s.set(r, a);
1027
- const l = f(r, a), c = se(l);
1062
+ getApprovalWorkflowState: (o, a) => {
1063
+ const r = x(a);
1064
+ if (!r)
1065
+ return !1;
1066
+ const n = p.get(r) || t;
1067
+ p.set(r, n);
1068
+ const l = f(r, n), s = se(l);
1028
1069
  if (typeof o == "function")
1029
1070
  try {
1030
- o(c);
1071
+ o(s);
1031
1072
  } catch {
1032
1073
  }
1033
- return r.__approvalWorkflowState = c, r.dispatchEvent(
1074
+ return r.__approvalWorkflowState = s, r.dispatchEvent(
1034
1075
  new CustomEvent("editora:approval-state", {
1035
1076
  bubbles: !0,
1036
1077
  detail: {
1037
- state: c
1078
+ state: s
1038
1079
  }
1039
1080
  })
1040
1081
  ), !0;
@@ -1050,15 +1091,15 @@ const qe = (e = {}) => {
1050
1091
  "Mod-Alt-Shift-d": "reopenDraft",
1051
1092
  "Mod-Alt-Shift-D": "reopenDraft"
1052
1093
  },
1053
- init: function(n) {
1094
+ init: function(a) {
1054
1095
  _ += 1;
1055
1096
  const r = this && typeof this.__pluginConfig == "object" ? z({ ...t, ...this.__pluginConfig }) : t;
1056
1097
  Re(r);
1057
- const a = x(
1058
- n?.editorElement ? { editorElement: n.editorElement } : void 0,
1098
+ const n = x(
1099
+ a != null && a.editorElement ? { editorElement: a.editorElement } : void 0,
1059
1100
  !1
1060
1101
  );
1061
- a && (s.set(a, r), f(a, r), v = a, q(a));
1102
+ n && (p.set(n, r), f(n, r), g = n, q(n));
1062
1103
  },
1063
1104
  destroy: () => {
1064
1105
  _ = Math.max(0, _ - 1), !(_ > 0) && De();