@editora/plugins 1.0.10 → 1.0.12

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