@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 v = ".rte-content, .editora-content", fe = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ye = "__editoraCommandEditorRoot", he = "rte-blocks-library-styles", u = "rte-blocks-library-panel", E = "blocks-library", B = "blocksLibrary", $ = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)';
1
+ const L = ".rte-content, .editora-content", fe = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ye = "__editoraCommandEditorRoot", he = "rte-blocks-library-styles", u = "rte-blocks-library-panel", E = "blocks-library", $ = "blocksLibrary", T = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)';
2
2
  const Ce = /* @__PURE__ */ new Set(["script", "style", "meta", "link", "object", "embed", "iframe"]), Pe = /^(https?:|mailto:|tel:|#|\/)/i, De = /^data:image\/(?:png|gif|jpeg|jpg|webp);base64,/i, Oe = {
3
3
  panelTitle: "Blocks Library",
4
4
  panelAriaLabel: "Blocks library panel",
@@ -18,8 +18,8 @@ const Ce = /* @__PURE__ */ new Set(["script", "style", "meta", "link", "object",
18
18
  helperText: "Use Arrow keys to move through blocks, Enter to insert, Esc to close.",
19
19
  lastInsertedPrefix: "Last inserted",
20
20
  resultsListLabel: "Block results"
21
- }, b = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new Set();
22
- let X = 0, Ne = 0, ke = 0, M = null, y = null, _ = null, P = null, A = null, D = null;
21
+ }, b = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new WeakMap(), oe = /* @__PURE__ */ new Set();
22
+ let X = 0, Ne = 0, ke = 0, A = null, y = null, _ = null, P = null, I = null, D = null;
23
23
  function m(e) {
24
24
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
25
25
  }
@@ -45,7 +45,8 @@ function xe(e) {
45
45
  /\s(href|src|xlink:href)\s*=\s*("([^"]*)"|'([^']*)')/gi,
46
46
  (r, o, l, n, a) => {
47
47
  const s = typeof n == "string" && n.length > 0 ? n : a || "", i = ce(s);
48
- if (!i) return "";
48
+ if (!i)
49
+ return "";
49
50
  const c = l.startsWith('"') ? '"' : "'";
50
51
  return ` ${o}=${c}${i}${c}`;
51
52
  }
@@ -61,7 +62,8 @@ function xe(e) {
61
62
  }).trim(), t;
62
63
  }
63
64
  function We(e) {
64
- if (!e) return "";
65
+ if (!e)
66
+ return "";
65
67
  if (typeof document > "u")
66
68
  return xe(e);
67
69
  const t = document.createElement("template");
@@ -98,7 +100,8 @@ function ne(e) {
98
100
  return e.trim().toLowerCase();
99
101
  }
100
102
  function Fe(e) {
101
- if (!e) return "";
103
+ if (!e)
104
+ return "";
102
105
  if (typeof document > "u")
103
106
  return e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
104
107
  const t = document.createElement("template");
@@ -107,17 +110,19 @@ function Fe(e) {
107
110
  return !r || typeof r.textContent != "string" ? e.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim() : r.textContent.replace(/\s+/g, " ").trim();
108
111
  }
109
112
  function Be(e, t) {
110
- if (!Array.isArray(e) || e.length === 0) return [];
113
+ if (!Array.isArray(e) || e.length === 0)
114
+ return [];
111
115
  const r = /* @__PURE__ */ new Set(), o = [];
112
116
  return e.forEach((l) => {
113
117
  const n = t.normalizeText(l.label || ""), a = t.sanitizeBlockHtml(l.html || "", l).trim();
114
- if (!n || !a) return;
118
+ if (!n || !a)
119
+ return;
115
120
  const s = t.normalizeText(l.category || "General") || "General", i = ne(s);
116
121
  let d = je(t.normalizeText(l.id || n)) || `block-${ke++}`;
117
122
  for (; r.has(d); )
118
123
  d = `${d}-${ke++}`;
119
124
  r.add(d);
120
- const f = (l.tags || []).map((H) => t.normalizeText(H)).filter(Boolean), g = (l.keywords || []).map((H) => t.normalizeText(H)).filter(Boolean), h = t.normalizeText(l.description || ""), R = Fe(a), V = [n, h, s, ...f, ...g, R].join(" ").toLowerCase();
125
+ const f = (l.tags || []).map((H) => t.normalizeText(H)).filter(Boolean), g = (l.keywords || []).map((H) => t.normalizeText(H)).filter(Boolean), h = t.normalizeText(l.description || ""), C = Fe(a), V = [n, h, s, ...f, ...g, C].join(" ").toLowerCase();
121
126
  o.push({
122
127
  id: d,
123
128
  label: n,
@@ -127,7 +132,7 @@ function Be(e, t) {
127
132
  categoryKey: i,
128
133
  tags: f,
129
134
  keywords: g,
130
- previewText: R,
135
+ previewText: C,
131
136
  searchBlob: V
132
137
  });
133
138
  }), o;
@@ -176,24 +181,30 @@ function le(e) {
176
181
  return e.closest(fe) || e;
177
182
  }
178
183
  function G(e) {
179
- if (!e) return null;
180
- if (e.matches(v)) return e;
181
- const t = e.querySelector(v);
184
+ if (!e)
185
+ return null;
186
+ if (e.matches(L))
187
+ return e;
188
+ const t = e.querySelector(L);
182
189
  return t instanceof HTMLElement ? t : null;
183
190
  }
184
191
  function Ue() {
185
- if (typeof window > "u") return null;
192
+ if (typeof window > "u")
193
+ return null;
186
194
  const e = window[ye];
187
- if (!(e instanceof HTMLElement)) return null;
195
+ if (!(e instanceof HTMLElement))
196
+ return null;
188
197
  window[ye] = null;
189
198
  const t = G(e);
190
- if (t) return t;
199
+ if (t)
200
+ return t;
191
201
  const r = e.closest(fe);
192
202
  if (r) {
193
203
  const l = G(r);
194
- if (l) return l;
204
+ if (l)
205
+ return l;
195
206
  }
196
- const o = e.closest(v);
207
+ const o = e.closest(L);
197
208
  return o instanceof HTMLElement ? o : null;
198
209
  }
199
210
  function Ve(e) {
@@ -216,41 +227,50 @@ function ee() {
216
227
  t.isConnected || ge(t);
217
228
  });
218
229
  }
219
- function T(e, t = !0, r = !0) {
220
- if (ee(), e?.contentElement instanceof HTMLElement) return e.contentElement;
221
- if (e?.editorElement instanceof HTMLElement) {
230
+ function S(e, t = !0, r = !0) {
231
+ if (ee(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
232
+ return e.contentElement;
233
+ if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
222
234
  const a = G(e.editorElement);
223
- if (a) return a;
235
+ if (a)
236
+ return a;
224
237
  }
225
238
  const o = Ue();
226
- if (o) return o;
239
+ if (o)
240
+ return o;
227
241
  const l = window.getSelection();
228
242
  if (l && l.rangeCount > 0) {
229
- const s = $e(l.getRangeAt(0).startContainer)?.closest(v);
230
- if (s) return s;
243
+ const a = $e(l.getRangeAt(0).startContainer), s = a == null ? void 0 : a.closest(L);
244
+ if (s)
245
+ return s;
231
246
  }
232
247
  const n = document.activeElement;
233
248
  if (n) {
234
- if (n.matches(v)) return n;
235
- const a = n.closest(v);
236
- if (a) return a;
249
+ if (n.matches(L))
250
+ return n;
251
+ const a = n.closest(L);
252
+ if (a)
253
+ return a;
237
254
  }
238
255
  if (r) {
239
- if (y && y.isConnected) return y;
256
+ if (y && y.isConnected)
257
+ return y;
240
258
  y && !y.isConnected && (y = null);
241
259
  }
242
- return t ? document.querySelector(v) : null;
260
+ return t ? document.querySelector(L) : null;
243
261
  }
244
262
  function Ye(e) {
245
263
  const t = e.target;
246
264
  if (t) {
247
- const o = t.closest(v);
248
- if (o) return o;
265
+ const o = t.closest(L);
266
+ if (o)
267
+ return o;
249
268
  }
250
269
  const r = window.getSelection();
251
270
  if (r && r.rangeCount > 0) {
252
- const l = $e(r.getRangeAt(0).startContainer)?.closest(v);
253
- if (l) return l;
271
+ const o = $e(r.getRangeAt(0).startContainer), l = o == null ? void 0 : o.closest(L);
272
+ if (l)
273
+ return l;
254
274
  }
255
275
  return null;
256
276
  }
@@ -259,7 +279,8 @@ function Z(e) {
259
279
  }
260
280
  function Xe(e) {
261
281
  const t = le(e);
262
- if (Z(t)) return !0;
282
+ if (Z(t))
283
+ return !0;
263
284
  const r = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
264
285
  return Z(r) ? !0 : Z(document.documentElement) || Z(document.body);
265
286
  }
@@ -293,7 +314,8 @@ function se(e) {
293
314
  }
294
315
  function Se(e) {
295
316
  const t = q.get(e);
296
- if (!t) return null;
317
+ if (!t)
318
+ return null;
297
319
  if (!e.isConnected)
298
320
  return q.delete(e), null;
299
321
  try {
@@ -308,10 +330,12 @@ function Ze(e) {
308
330
  return t ? (He(e, t), !0) : !1;
309
331
  }
310
332
  function Je(e) {
311
- if (te.has(e)) return;
333
+ if (te.has(e))
334
+ return;
312
335
  const t = () => {
313
336
  const r = window.getSelection();
314
- if (!r || r.rangeCount === 0) return;
337
+ if (!r || r.rangeCount === 0)
338
+ return;
315
339
  const o = r.getRangeAt(0);
316
340
  e.contains(o.commonAncestorContainer) && se(e);
317
341
  };
@@ -322,7 +346,7 @@ function Qe(e) {
322
346
  t && (e.removeEventListener("keyup", t), e.removeEventListener("mouseup", t), e.removeEventListener("touchend", t), te.delete(e));
323
347
  }
324
348
  function k(e, t) {
325
- b.has(e) || b.set(e, t), I.has(e) || (I.set(e, t.blocks), O.set(e, Date.now()));
349
+ b.has(e) || b.set(e, t), R.has(e) || (R.set(e, t.blocks), O.set(e, Date.now()));
326
350
  let r = w.get(e);
327
351
  return r || (r = {
328
352
  query: "",
@@ -343,19 +367,22 @@ function Me(e) {
343
367
  !t || t.debounceTimer === null || (window.clearTimeout(t.debounceTimer), t.debounceTimer = null);
344
368
  }
345
369
  function ge(e) {
370
+ var r;
346
371
  Me(e), Qe(e), q.delete(e);
347
372
  const t = W.get(e);
348
- t && (t.abort(), W.delete(e)), j.delete(e), z.delete(e), x.get(e)?.remove(), x.delete(e), U.delete(e), b.delete(e), J.delete(e), w.delete(e), I.delete(e), O.delete(e), oe.delete(e), y === e && (y = null);
373
+ t && (t.abort(), W.delete(e)), j.delete(e), z.delete(e), (r = x.get(e)) == null || r.remove(), x.delete(e), U.delete(e), b.delete(e), J.delete(e), w.delete(e), R.delete(e), O.delete(e), oe.delete(e), y === e && (y = null);
349
374
  }
350
375
  function et(e) {
351
- for (let t = 0; t < e.length; t += 1) {
352
- const r = e[t];
353
- if (!(r.type !== "childList" || r.removedNodes.length === 0))
354
- for (let o = 0; o < r.removedNodes.length; o += 1) {
355
- const l = r.removedNodes[o];
356
- if (l.nodeType !== Node.ELEMENT_NODE) continue;
357
- const n = l;
358
- if (n.matches?.(v) || n.matches?.(`.${u}`) || n.querySelector?.(v) || n.querySelector?.(`.${u}`))
376
+ var t, r, o, l;
377
+ for (let n = 0; n < e.length; n += 1) {
378
+ const a = e[n];
379
+ if (!(a.type !== "childList" || a.removedNodes.length === 0))
380
+ for (let s = 0; s < a.removedNodes.length; s += 1) {
381
+ const i = a.removedNodes[s];
382
+ if (i.nodeType !== Node.ELEMENT_NODE)
383
+ continue;
384
+ const c = i;
385
+ if ((t = c.matches) != null && t.call(c, L) || (r = c.matches) != null && r.call(c, `.${u}`) || (o = c.querySelector) != null && o.call(c, L) || (l = c.querySelector) != null && l.call(c, `.${u}`))
359
386
  return !0;
360
387
  }
361
388
  }
@@ -365,12 +392,14 @@ function pe(e) {
365
392
  return U.get(e) === !0;
366
393
  }
367
394
  function de(e, t) {
368
- if (!t.classList.contains("show")) return;
395
+ if (!t.classList.contains("show"))
396
+ return;
369
397
  const r = le(e).getBoundingClientRect(), o = Math.min(window.innerWidth - 20, 420), l = Math.max(10, window.innerWidth - o - 10), n = Math.min(Math.max(10, r.right - o), l), a = Math.max(10, Math.min(window.innerHeight - 10, r.top + 12));
370
398
  t.style.width = `${o}px`, t.style.left = `${n}px`, t.style.top = `${a}px`, t.style.maxHeight = `${Math.max(260, window.innerHeight - 20)}px`;
371
399
  }
372
400
  function ae(e) {
373
- return I.get(e) || b.get(e)?.blocks || [];
401
+ var t;
402
+ return R.get(e) || ((t = b.get(e)) == null ? void 0 : t.blocks) || [];
374
403
  }
375
404
  function tt(e, t) {
376
405
  const r = /* @__PURE__ */ new Map();
@@ -403,7 +432,8 @@ function Ae(e, t) {
403
432
  }
404
433
  function rt(e, t) {
405
434
  const r = w.get(e);
406
- if (!r) return;
435
+ if (!r)
436
+ return;
407
437
  if (t.length === 0) {
408
438
  r.selectedBlockId = null;
409
439
  return;
@@ -412,11 +442,12 @@ function rt(e, t) {
412
442
  }
413
443
  function N(e) {
414
444
  const t = w.get(e);
415
- we(e, "toggleBlocksLibraryPanel", pe(e)), we(e, "insertLastBlockSnippet", !!t?.lastInsertedBlockId);
445
+ we(e, "toggleBlocksLibraryPanel", pe(e)), we(e, "insertLastBlockSnippet", !!(t != null && t.lastInsertedBlockId));
416
446
  }
417
- function L(e) {
418
- const t = x.get(e), r = b.get(e) || M, o = w.get(e);
419
- if (!t || !r || !o) return;
447
+ function v(e) {
448
+ const t = x.get(e), r = b.get(e) || A, o = w.get(e);
449
+ if (!t || !r || !o)
450
+ return;
420
451
  re(t, e);
421
452
  const l = t.querySelector(".rte-blocks-library-title");
422
453
  l && (l.textContent = r.labels.panelTitle);
@@ -430,8 +461,8 @@ function L(e) {
430
461
  i && (i.textContent = r.labels.categoryLabel);
431
462
  const c = t.querySelector('[data-field="category"]');
432
463
  if (c) {
433
- const C = tt(e, r);
434
- c.innerHTML = C.map((p) => `<option value="${m(p.value)}">${m(p.label)}</option>`).join(""), C.some((p) => p.value === o.category) || (o.category = "all"), c.value = o.category;
464
+ const B = tt(e, r);
465
+ c.innerHTML = B.map((p) => `<option value="${m(p.value)}">${m(p.label)}</option>`).join(""), B.some((p) => p.value === o.category) || (o.category = "all"), c.value = o.category;
435
466
  }
436
467
  const d = t.querySelector(".rte-blocks-library-helper");
437
468
  d && (d.textContent = r.labels.helperText);
@@ -442,16 +473,16 @@ function L(e) {
442
473
  const h = t.querySelector('[data-action="insert-selected"]');
443
474
  if (h) {
444
475
  h.textContent = r.labels.insertText;
445
- const C = !Te(e) && !!o.selectedBlockId;
446
- h.disabled = !C, h.setAttribute("aria-disabled", C ? "false" : "true");
476
+ const B = !Te(e) && !!o.selectedBlockId;
477
+ h.disabled = !B, h.setAttribute("aria-disabled", B ? "false" : "true");
447
478
  }
448
- const R = t.querySelector(".rte-blocks-library-empty"), V = t.querySelector(".rte-blocks-library-list"), H = Ae(e, r);
479
+ const C = t.querySelector(".rte-blocks-library-empty"), V = t.querySelector(".rte-blocks-library-list"), H = Ae(e, r);
449
480
  rt(e, H);
450
481
  const Y = t.querySelector(".rte-blocks-library-status");
451
482
  if (Y && (o.loading ? Y.textContent = r.labels.loadingText : o.loadError ? Y.textContent = o.loadError : Y.textContent = `${r.labels.summaryPrefix}: ${o.visibleMatches}/${o.totalMatches}`), V) {
452
- const C = new Set(o.recentBlockIds);
483
+ const B = new Set(o.recentBlockIds);
453
484
  V.innerHTML = H.map((p) => {
454
- const ie = o.selectedBlockId === p.id, qe = p.tags.length ? ` • ${p.tags.join(", ")}` : "", _e = C.has(p.id), me = p.previewText.slice(0, 180);
485
+ const ie = o.selectedBlockId === p.id, qe = p.tags.length ? ` • ${p.tags.join(", ")}` : "", _e = B.has(p.id), me = p.previewText.slice(0, 180);
455
486
  return `
456
487
  <li class="rte-blocks-library-item-wrapper" role="presentation">
457
488
  <button
@@ -475,67 +506,77 @@ function L(e) {
475
506
  `;
476
507
  }).join("");
477
508
  }
478
- R && (R.hidden = H.length > 0, R.textContent = r.labels.noResultsText);
509
+ C && (C.hidden = H.length > 0, C.textContent = r.labels.noResultsText);
479
510
  const K = t.querySelector(".rte-blocks-library-last-inserted");
480
511
  if (K)
481
512
  if (o.lastInsertedBlockId) {
482
- const C = ae(e).find((p) => p.id === o.lastInsertedBlockId);
483
- C ? (K.hidden = !1, K.textContent = `${r.labels.lastInsertedPrefix}: ${C.label}`) : K.hidden = !0;
513
+ const B = ae(e).find((p) => p.id === o.lastInsertedBlockId);
514
+ B ? (K.hidden = !1, K.textContent = `${r.labels.lastInsertedPrefix}: ${B.label}`) : K.hidden = !0;
484
515
  } else
485
516
  K.hidden = !0;
486
517
  t.setAttribute("aria-label", r.labels.panelAriaLabel);
487
518
  }
488
- function S(e, t = !1) {
519
+ function M(e, t = !1) {
489
520
  const r = x.get(e);
490
521
  r && (r.classList.remove("show"), U.set(e, !1), N(e), t && (e.focus({ preventScroll: !0 }), Ze(e)));
491
522
  }
492
523
  function ot(e) {
493
- e.querySelector(".rte-blocks-library-item.active")?.focus();
524
+ const t = e.querySelector(".rte-blocks-library-item.active");
525
+ t == null || t.focus();
494
526
  }
495
- function ve(e, t) {
496
- const r = b.get(e) || M;
497
- if (!r) return;
527
+ function Le(e, t) {
528
+ const r = b.get(e) || A;
529
+ if (!r)
530
+ return;
498
531
  const o = w.get(e);
499
- if (!o) return;
532
+ if (!o)
533
+ return;
500
534
  const l = Ae(e, r);
501
- if (l.length === 0) return;
535
+ if (l.length === 0)
536
+ return;
502
537
  const a = (Math.max(
503
538
  0,
504
539
  l.findIndex((i) => i.id === o.selectedBlockId)
505
540
  ) + t + l.length) % l.length;
506
- o.selectedBlockId = l[a].id, L(e);
541
+ o.selectedBlockId = l[a].id, v(e);
507
542
  const s = x.get(e);
508
543
  s && ot(s);
509
544
  }
510
545
  function ue(e) {
511
546
  const t = it(e);
512
547
  se(e), x.forEach((o, l) => {
513
- l !== e && S(l, !1);
514
- }), t.classList.add("show"), U.set(e, !0), L(e), de(e, t), N(e), t.querySelector('[data-field="query"]')?.focus(), be(e, !1);
548
+ l !== e && M(l, !1);
549
+ }), t.classList.add("show"), U.set(e, !0), v(e), de(e, t), N(e);
550
+ const r = t.querySelector('[data-field="query"]');
551
+ r == null || r.focus(), be(e, !1);
515
552
  }
516
553
  function Ie(e, t) {
517
554
  const r = pe(e);
518
- return (typeof t == "boolean" ? t : !r) ? ue(e) : S(e, !1), !0;
555
+ return (typeof t == "boolean" ? t : !r) ? ue(e) : M(e, !1), !0;
519
556
  }
520
557
  function Re(e) {
521
558
  const t = window.getSelection();
522
- if (!t || t.rangeCount === 0) return null;
559
+ if (!t || t.rangeCount === 0)
560
+ return null;
523
561
  const r = t.getRangeAt(0);
524
562
  return e.contains(r.commonAncestorContainer) ? r : null;
525
563
  }
526
564
  function He(e, t) {
527
- if (!e.isConnected) return;
565
+ if (!e.isConnected)
566
+ return;
528
567
  const r = window.getSelection();
529
568
  r && (r.removeAllRanges(), r.addRange(t));
530
569
  }
531
- function Le(e, t, r) {
570
+ function ve(e, t, r) {
532
571
  const o = t.cloneRange();
533
- if (!e.contains(o.commonAncestorContainer)) return !1;
572
+ if (!e.contains(o.commonAncestorContainer))
573
+ return !1;
534
574
  o.deleteContents();
535
575
  const l = document.createElement("template");
536
576
  l.innerHTML = r;
537
577
  const n = l.content;
538
- if (!n) return !1;
578
+ if (!n)
579
+ return !1;
539
580
  const a = n.lastChild;
540
581
  if (o.insertNode(n), a) {
541
582
  const s = document.createRange();
@@ -546,7 +587,7 @@ function Le(e, t, r) {
546
587
  function nt(e, t) {
547
588
  e.focus({ preventScroll: !0 });
548
589
  const r = Se(e);
549
- if (r && Le(e, r, t))
590
+ if (r && ve(e, r, t))
550
591
  return !0;
551
592
  try {
552
593
  if (document.execCommand("insertHTML", !1, t))
@@ -554,10 +595,11 @@ function nt(e, t) {
554
595
  } catch {
555
596
  }
556
597
  const o = Re(e);
557
- return o ? Le(e, o, t) : !1;
598
+ return o ? ve(e, o, t) : !1;
558
599
  }
559
600
  function lt(e, t) {
560
- if (t === e.innerHTML) return;
601
+ if (t === e.innerHTML)
602
+ return;
561
603
  const r = window.execEditorCommand || window.executeEditorCommand;
562
604
  if (typeof r == "function")
563
605
  try {
@@ -569,13 +611,15 @@ function st(e) {
569
611
  e.dispatchEvent(new Event("input", { bubbles: !0 }));
570
612
  }
571
613
  function F(e, t) {
572
- const r = b.get(e) || M;
573
- if (!r) return !1;
614
+ const r = b.get(e) || A;
615
+ if (!r)
616
+ return !1;
574
617
  const o = k(e, r), l = x.get(e);
575
618
  if (Te(e))
576
619
  return l && Ee(l, r.labels.readonlyMessage), !1;
577
620
  const n = ae(e).find((i) => i.id === t);
578
- if (!n) return !1;
621
+ if (!n)
622
+ return !1;
579
623
  const a = e.innerHTML;
580
624
  return nt(e, n.html) ? (o.lastInsertedBlockId = n.id, o.selectedBlockId = n.id, o.recentBlockIds = [n.id, ...o.recentBlockIds.filter((i) => i !== n.id)].slice(
581
625
  0,
@@ -589,20 +633,22 @@ function F(e, t) {
589
633
  category: n.category
590
634
  }
591
635
  })
592
- ), L(e), l && Ee(l, `${r.labels.lastInsertedPrefix}: ${n.label}`), !0) : !1;
636
+ ), v(e), l && Ee(l, `${r.labels.lastInsertedPrefix}: ${n.label}`), !0) : !1;
593
637
  }
594
638
  function ze(e) {
595
639
  const t = w.get(e);
596
- return t?.lastInsertedBlockId ? F(e, t.lastInsertedBlockId) : !1;
640
+ return t != null && t.lastInsertedBlockId ? F(e, t.lastInsertedBlockId) : !1;
597
641
  }
598
642
  function at(e) {
599
- const t = b.get(e) || M;
600
- if (!t) return;
643
+ const t = b.get(e) || A;
644
+ if (!t)
645
+ return;
601
646
  const r = w.get(e);
602
- if (!r) return;
647
+ if (!r)
648
+ return;
603
649
  Me(e);
604
650
  const o = () => {
605
- r.debounceTimer = null, r.filterCache.clear(), L(e);
651
+ r.debounceTimer = null, r.filterCache.clear(), v(e);
606
652
  };
607
653
  if (t.debounceMs <= 0) {
608
654
  o();
@@ -612,8 +658,9 @@ function at(e) {
612
658
  }
613
659
  function it(e) {
614
660
  const t = x.get(e);
615
- if (t) return t;
616
- const r = b.get(e) || M || Q(), o = k(e, r), l = `rte-blocks-library-panel-${Ne++}`, n = `${l}-query`, a = `${l}-category`, s = document.createElement("section");
661
+ if (t)
662
+ return t;
663
+ const r = b.get(e) || A || Q(), o = k(e, r), l = `rte-blocks-library-panel-${Ne++}`, n = `${l}-query`, a = `${l}-category`, s = document.createElement("section");
617
664
  return s.className = u, s.id = l, s.setAttribute("role", "dialog"), s.setAttribute("aria-modal", "false"), s.setAttribute("aria-label", r.labels.panelAriaLabel), s.innerHTML = `
618
665
  <header class="rte-blocks-library-header">
619
666
  <h2 class="rte-blocks-library-title">${m(r.labels.panelTitle)}</h2>
@@ -638,65 +685,70 @@ function it(e) {
638
685
  </div>
639
686
  <div class="rte-blocks-library-live" aria-live="polite" aria-atomic="true"></div>
640
687
  `, s.addEventListener("click", (i) => {
641
- const c = i.target, d = c?.closest("[data-action]");
688
+ const c = i.target, d = c == null ? void 0 : c.closest("[data-action]");
642
689
  if (d) {
643
690
  const h = d.getAttribute("data-action");
644
691
  if (h === "close") {
645
- S(e, !0);
692
+ M(e, !0);
646
693
  return;
647
694
  }
648
695
  if (h === "insert-selected") {
649
- if (!o.selectedBlockId) return;
650
- F(e, o.selectedBlockId) && S(e, !0);
696
+ if (!o.selectedBlockId)
697
+ return;
698
+ F(e, o.selectedBlockId) && M(e, !0);
651
699
  }
652
700
  return;
653
701
  }
654
- const f = c?.closest("[data-block-id]");
655
- if (!f) return;
702
+ const f = c == null ? void 0 : c.closest("[data-block-id]");
703
+ if (!f)
704
+ return;
656
705
  const g = f.getAttribute("data-block-id");
657
- g && (o.selectedBlockId = g, L(e), i.detail >= 2 && F(e, g) && S(e, !0));
706
+ g && (o.selectedBlockId = g, v(e), i.detail >= 2 && F(e, g) && M(e, !0));
658
707
  }), s.addEventListener("input", (i) => {
659
708
  const c = i.target;
660
709
  !(c instanceof HTMLInputElement) || c.getAttribute("data-field") !== "query" || (o.query = r.normalizeText(c.value).toLowerCase(), o.filterCache.clear(), at(e));
661
710
  }), s.addEventListener("change", (i) => {
662
711
  const c = i.target;
663
- !(c instanceof HTMLSelectElement) || c.getAttribute("data-field") !== "category" || (o.category = ne(c.value || "all") || "all", o.filterCache.clear(), L(e));
712
+ !(c instanceof HTMLSelectElement) || c.getAttribute("data-field") !== "category" || (o.category = ne(c.value || "all") || "all", o.filterCache.clear(), v(e));
664
713
  }), s.addEventListener("keydown", (i) => {
665
714
  if (i.key === "Escape") {
666
- i.preventDefault(), S(e, !0);
715
+ i.preventDefault(), M(e, !0);
667
716
  return;
668
717
  }
669
718
  if (i.key === "ArrowDown") {
670
- i.preventDefault(), ve(e, 1);
719
+ i.preventDefault(), Le(e, 1);
671
720
  return;
672
721
  }
673
722
  if (i.key === "ArrowUp") {
674
- i.preventDefault(), ve(e, -1);
723
+ i.preventDefault(), Le(e, -1);
675
724
  return;
676
725
  }
677
726
  if (i.key === "Enter") {
678
- if (!i.target?.matches('[data-field="query"], [data-field="category"], [data-block-id]') || !o.selectedBlockId) return;
679
- i.preventDefault(), F(e, o.selectedBlockId) && S(e, !0);
727
+ const c = i.target;
728
+ if (!(c == null ? void 0 : c.matches('[data-field="query"], [data-field="category"], [data-block-id]')) || !o.selectedBlockId)
729
+ return;
730
+ i.preventDefault(), F(e, o.selectedBlockId) && M(e, !0);
680
731
  }
681
- }), re(s, e), document.body.appendChild(s), x.set(e, s), U.set(e, !1), L(e), s;
732
+ }), re(s, e), document.body.appendChild(s), x.set(e, s), U.set(e, !1), v(e), s;
682
733
  }
683
734
  function ct(e) {
684
735
  const t = w.get(e);
685
736
  return {
686
- query: t?.query || "",
687
- category: t?.category || "all",
688
- selectedBlockId: t?.selectedBlockId || null,
689
- totalMatches: t?.totalMatches || 0,
690
- visibleMatches: t?.visibleMatches || 0,
691
- recentBlockIds: t?.recentBlockIds ? [...t.recentBlockIds] : [],
692
- lastInsertedBlockId: t?.lastInsertedBlockId || null,
693
- loading: t?.loading === !0,
694
- loadError: t?.loadError || null
737
+ query: (t == null ? void 0 : t.query) || "",
738
+ category: (t == null ? void 0 : t.category) || "all",
739
+ selectedBlockId: (t == null ? void 0 : t.selectedBlockId) || null,
740
+ totalMatches: (t == null ? void 0 : t.totalMatches) || 0,
741
+ visibleMatches: (t == null ? void 0 : t.visibleMatches) || 0,
742
+ recentBlockIds: t != null && t.recentBlockIds ? [...t.recentBlockIds] : [],
743
+ lastInsertedBlockId: (t == null ? void 0 : t.lastInsertedBlockId) || null,
744
+ loading: (t == null ? void 0 : t.loading) === !0,
745
+ loadError: (t == null ? void 0 : t.loadError) || null
695
746
  };
696
747
  }
697
748
  async function be(e, t) {
698
- const r = b.get(e) || M;
699
- if (!r || typeof r.getBlocks != "function") return;
749
+ const r = b.get(e) || A;
750
+ if (!r || typeof r.getBlocks != "function")
751
+ return;
700
752
  const o = k(e, r), l = O.get(e) || 0;
701
753
  if (!t && r.cacheTtlMs > 0 && Date.now() - l < r.cacheTtlMs)
702
754
  return;
@@ -708,24 +760,27 @@ async function be(e, t) {
708
760
  const s = new AbortController();
709
761
  W.set(e, s);
710
762
  const i = (z.get(e) || 0) + 1;
711
- z.set(e, i), o.loading = !0, o.loadError = null, L(e);
763
+ z.set(e, i), o.loading = !0, o.loadError = null, v(e);
712
764
  const c = Promise.resolve().then(async () => {
765
+ var C;
713
766
  const d = {
714
767
  editor: e,
715
768
  editorRoot: le(e),
716
769
  signal: s.signal
717
- }, f = await r.getBlocks?.(d);
718
- if (s.signal.aborted || z.get(e) !== i) return;
770
+ }, f = await ((C = r.getBlocks) == null ? void 0 : C.call(r, d));
771
+ if (s.signal.aborted || z.get(e) !== i)
772
+ return;
719
773
  const g = Be(f || [], r);
720
- I.set(e, g), O.set(e, Date.now());
774
+ R.set(e, g), O.set(e, Date.now());
721
775
  const h = w.get(e);
722
776
  h && (h.loading = !1, h.loadError = null, h.filterCache.clear());
723
777
  }).catch(() => {
724
- if (s.signal.aborted || z.get(e) !== i) return;
778
+ if (s.signal.aborted || z.get(e) !== i)
779
+ return;
725
780
  const d = w.get(e);
726
781
  d && (d.loading = !1, d.loadError = r.labels.loadErrorText);
727
782
  }).finally(() => {
728
- z.get(e) === i && (j.delete(e), W.delete(e)), L(e);
783
+ z.get(e) === i && (j.delete(e), W.delete(e)), v(e);
729
784
  });
730
785
  return j.set(e, c), c;
731
786
  }
@@ -738,29 +793,32 @@ function ut(e) {
738
793
  return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "l";
739
794
  }
740
795
  function bt(e) {
741
- M = e, _ || (_ = (t) => {
796
+ A = e, _ || (_ = (t) => {
742
797
  ee();
743
- const o = t.target?.closest(v);
744
- if (!o) return;
798
+ const r = t.target, o = r == null ? void 0 : r.closest(L);
799
+ if (!o)
800
+ return;
745
801
  const l = b.get(o) || e;
746
802
  k(o, l), b.set(o, l), y = o, N(o);
747
803
  const n = x.get(o);
748
- n && (re(n, o), de(o, n), L(o));
804
+ n && (re(n, o), de(o, n), v(o));
749
805
  }, document.addEventListener("focusin", _, !0)), P || (P = (t) => {
750
- if (t.defaultPrevented) return;
806
+ if (t.defaultPrevented)
807
+ return;
751
808
  const r = `.${u} input, .${u} textarea, .${u} select`, o = t.target;
752
- if (o?.closest(r)) {
809
+ if (o != null && o.closest(r)) {
753
810
  if (t.key === "Escape") {
754
811
  const a = o.closest(`.${u}`), s = Array.from(x.entries()).find(([, i]) => i === a);
755
- s && (t.preventDefault(), S(s[0], !0));
812
+ s && (t.preventDefault(), M(s[0], !0));
756
813
  }
757
814
  return;
758
815
  }
759
816
  const l = Ye(t);
760
- if (!l) return;
761
- const n = b.get(l) || M || e;
817
+ if (!l)
818
+ return;
819
+ const n = b.get(l) || A || e;
762
820
  if (k(l, n), b.set(l, n), y = l, t.key === "Escape" && pe(l)) {
763
- t.preventDefault(), S(l, !0);
821
+ t.preventDefault(), M(l, !0);
764
822
  return;
765
823
  }
766
824
  if (dt(t)) {
@@ -768,11 +826,11 @@ function bt(e) {
768
826
  return;
769
827
  }
770
828
  ut(t) && (t.preventDefault(), t.stopPropagation(), ze(l));
771
- }, document.addEventListener("keydown", P, !0)), A || (A = () => {
829
+ }, document.addEventListener("keydown", P, !0)), I || (I = () => {
772
830
  ee(), x.forEach((t, r) => {
773
831
  !r.isConnected || !t.isConnected || (re(t, r), de(r, t));
774
832
  });
775
- }, window.addEventListener("scroll", A, !0), window.addEventListener("resize", A)), !D && typeof MutationObserver < "u" && document.body && (D = new MutationObserver((t) => {
833
+ }, window.addEventListener("scroll", I, !0), window.addEventListener("resize", I)), !D && typeof MutationObserver < "u" && document.body && (D = new MutationObserver((t) => {
776
834
  et(t) && ee();
777
835
  }), D.observe(document.body, {
778
836
  childList: !0,
@@ -780,16 +838,17 @@ function bt(e) {
780
838
  }));
781
839
  }
782
840
  function ft() {
783
- _ && (document.removeEventListener("focusin", _, !0), _ = null), P && (document.removeEventListener("keydown", P, !0), P = null), A && (window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A), A = null), D && (D.disconnect(), D = null), x.forEach((t) => t.remove()), x.clear(), Array.from(oe).forEach((t) => ge(t)), M = null, y = null;
841
+ _ && (document.removeEventListener("focusin", _, !0), _ = null), P && (document.removeEventListener("keydown", P, !0), P = null), I && (window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I), I = null), D && (D.disconnect(), D = null), x.forEach((t) => t.remove()), x.clear(), Array.from(oe).forEach((t) => ge(t)), A = null, y = null;
784
842
  }
785
843
  function gt() {
786
- if (typeof document > "u" || document.getElementById(he)) return;
844
+ if (typeof document > "u" || document.getElementById(he))
845
+ return;
787
846
  const e = document.createElement("style");
788
847
  e.id = he, e.textContent = `
789
848
  .rte-toolbar-group-items.${E},
790
849
  .editora-toolbar-group-items.${E},
791
- .rte-toolbar-group-items.${B},
792
- .editora-toolbar-group-items.${B} {
850
+ .rte-toolbar-group-items.${$},
851
+ .editora-toolbar-group-items.${$} {
793
852
  display: flex;
794
853
  border: 1px solid #cbd5e1;
795
854
  border-radius: 4px;
@@ -798,8 +857,8 @@ function gt() {
798
857
 
799
858
  .rte-toolbar-group-items.${E} .rte-toolbar-button,
800
859
  .editora-toolbar-group-items.${E} .editora-toolbar-button,
801
- .rte-toolbar-group-items.${B} .rte-toolbar-button,
802
- .editora-toolbar-group-items.${B} .editora-toolbar-button {
860
+ .rte-toolbar-group-items.${$} .rte-toolbar-button,
861
+ .editora-toolbar-group-items.${$} .editora-toolbar-button {
803
862
  border: none;
804
863
  border-right: 1px solid #cbd5e1;
805
864
  border-radius: 0;
@@ -807,8 +866,8 @@ function gt() {
807
866
 
808
867
  .rte-toolbar-group-items.${E} .rte-toolbar-item:last-child .rte-toolbar-button,
809
868
  .editora-toolbar-group-items.${E} .editora-toolbar-item:last-child .editora-toolbar-button,
810
- .rte-toolbar-group-items.${B} .rte-toolbar-item:last-child .rte-toolbar-button,
811
- .editora-toolbar-group-items.${B} .editora-toolbar-item:last-child .editora-toolbar-button {
869
+ .rte-toolbar-group-items.${$} .rte-toolbar-item:last-child .rte-toolbar-button,
870
+ .editora-toolbar-group-items.${$} .editora-toolbar-item:last-child .editora-toolbar-button {
812
871
  border-right: none;
813
872
  }
814
873
 
@@ -817,21 +876,21 @@ function gt() {
817
876
  background: rgba(15, 118, 110, 0.12);
818
877
  }
819
878
 
820
- ${$} .rte-toolbar-group-items.${E},
821
- ${$} .editora-toolbar-group-items.${E},
822
- ${$} .rte-toolbar-group-items.${B},
823
- ${$} .editora-toolbar-group-items.${B} {
879
+ ${T} .rte-toolbar-group-items.${E},
880
+ ${T} .editora-toolbar-group-items.${E},
881
+ ${T} .rte-toolbar-group-items.${$},
882
+ ${T} .editora-toolbar-group-items.${$} {
824
883
  border-color: #566275;
825
884
  }
826
- ${$} .rte-toolbar-group-items.${E} .rte-toolbar-button svg,
827
- ${$} .editora-toolbar-group-items.${E} .editora-toolbar-button svg,
828
- ${$} .rte-toolbar-group-items.${B} .rte-toolbar-button svg,
829
- ${$} .editora-toolbar-group-items.${B} .editora-toolbar-button svg
885
+ ${T} .rte-toolbar-group-items.${E} .rte-toolbar-button svg,
886
+ ${T} .editora-toolbar-group-items.${E} .editora-toolbar-button svg,
887
+ ${T} .rte-toolbar-group-items.${$} .rte-toolbar-button svg,
888
+ ${T} .editora-toolbar-group-items.${$} .editora-toolbar-button svg
830
889
  {
831
890
  fill: none;
832
891
  }
833
- ${$} .rte-toolbar-group-items.${E} .rte-toolbar-button,
834
- ${$} .editora-toolbar-group-items.${E} .editora-toolbar-button
892
+ ${T} .rte-toolbar-group-items.${E} .rte-toolbar-button,
893
+ ${T} .editora-toolbar-group-items.${E} .editora-toolbar-button
835
894
  {
836
895
  border-color: #566275;
837
896
  }
@@ -1215,46 +1274,53 @@ const pt = (e = {}) => {
1215
1274
  ],
1216
1275
  commands: {
1217
1276
  blocksLibrary: (o, l) => {
1218
- const n = T(l, !1, !1);
1219
- if (!n) return !1;
1277
+ const n = S(l, !1, !1);
1278
+ if (!n)
1279
+ return !1;
1220
1280
  const a = b.get(n) || t;
1221
1281
  return k(n, a), b.set(n, a), y = n, ue(n), !0;
1222
1282
  },
1223
1283
  openBlocksLibraryPanel: (o, l) => {
1224
- const n = T(l, !1, !1);
1225
- if (!n) return !1;
1284
+ const n = S(l, !1, !1);
1285
+ if (!n)
1286
+ return !1;
1226
1287
  const a = b.get(n) || t;
1227
1288
  return k(n, a), b.set(n, a), y = n, ue(n), !0;
1228
1289
  },
1229
1290
  toggleBlocksLibraryPanel: (o, l) => {
1230
- const n = T(l, !1, !1);
1231
- if (!n) return !1;
1291
+ const n = S(l, !1, !1);
1292
+ if (!n)
1293
+ return !1;
1232
1294
  const a = b.get(n) || t;
1233
1295
  return k(n, a), b.set(n, a), y = n, Ie(n, typeof o == "boolean" ? o : void 0);
1234
1296
  },
1235
1297
  insertBlockSnippet: (o, l) => {
1236
- const n = T(l, !1, !1);
1237
- if (!n) return !1;
1298
+ const n = S(l, !1, !1);
1299
+ if (!n)
1300
+ return !1;
1238
1301
  const a = b.get(n) || t;
1239
1302
  k(n, a), b.set(n, a);
1240
- const s = typeof o == "string" ? o : o?.id;
1303
+ const s = typeof o == "string" ? o : o == null ? void 0 : o.id;
1241
1304
  return s ? (y = n, F(n, s)) : !1;
1242
1305
  },
1243
1306
  insertLastBlockSnippet: (o, l) => {
1244
- const n = T(l, !1, !1);
1245
- if (!n) return !1;
1307
+ const n = S(l, !1, !1);
1308
+ if (!n)
1309
+ return !1;
1246
1310
  const a = b.get(n) || t;
1247
1311
  return k(n, a), b.set(n, a), y = n, ze(n);
1248
1312
  },
1249
1313
  refreshBlocksLibraryData: (o, l) => {
1250
- const n = T(l, !1, !1);
1251
- if (!n) return !1;
1314
+ const n = S(l, !1, !1);
1315
+ if (!n)
1316
+ return !1;
1252
1317
  const a = b.get(n) || t;
1253
1318
  return k(n, a), b.set(n, a), be(n, !0), !0;
1254
1319
  },
1255
1320
  setBlocksLibraryOptions: (o, l) => {
1256
- const n = T(l, !1, !1);
1257
- if (!n || !o || typeof o != "object") return !1;
1321
+ const n = S(l, !1, !1);
1322
+ if (!n || !o || typeof o != "object")
1323
+ return !1;
1258
1324
  const a = b.get(n) || t, s = J.get(n) || Ge(a), i = {
1259
1325
  ...s,
1260
1326
  ...o,
@@ -1267,13 +1333,14 @@ const pt = (e = {}) => {
1267
1333
  sanitizeBlockHtml: o.sanitizeBlockHtml || a.sanitizeBlockHtml,
1268
1334
  getBlocks: o.getBlocks || a.getBlocks
1269
1335
  }, c = Q(i), d = Array.isArray(o.blocks), f = o.getBlocks !== void 0;
1270
- b.set(n, c), J.set(n, i), (d || f || !I.has(n)) && (I.set(n, c.blocks), O.set(n, f ? 0 : Date.now()));
1336
+ b.set(n, c), J.set(n, i), (d || f || !R.has(n)) && (R.set(n, c.blocks), O.set(n, f ? 0 : Date.now()));
1271
1337
  const g = k(n, c);
1272
- return g.filterCache.clear(), typeof o.defaultCategory == "string" && (g.category = ne(c.defaultCategory) || "all"), L(n), N(n), f && be(n, !0), !0;
1338
+ return g.filterCache.clear(), typeof o.defaultCategory == "string" && (g.category = ne(c.defaultCategory) || "all"), v(n), N(n), f && be(n, !0), !0;
1273
1339
  },
1274
1340
  getBlocksLibraryState: (o, l) => {
1275
- const n = T(l, !1, !1);
1276
- if (!n) return !1;
1341
+ const n = S(l, !1, !1);
1342
+ if (!n)
1343
+ return !1;
1277
1344
  const a = b.get(n) || t;
1278
1345
  k(n, a);
1279
1346
  const s = ct(n);
@@ -1300,12 +1367,12 @@ const pt = (e = {}) => {
1300
1367
  X += 1;
1301
1368
  const n = this && typeof this.__pluginConfig == "object" ? { ...e, ...this.__pluginConfig } : e, a = Q(n);
1302
1369
  bt(a);
1303
- const s = T(
1304
- l?.editorElement ? { editorElement: l.editorElement } : void 0,
1370
+ const s = S(
1371
+ l != null && l.editorElement ? { editorElement: l.editorElement } : void 0,
1305
1372
  !1,
1306
1373
  !1
1307
1374
  );
1308
- s && (y = s, r.add(s), k(s, a), b.set(s, a), J.set(s, n), I.set(s, a.blocks), O.set(s, Date.now()), N(s));
1375
+ s && (y = s, r.add(s), k(s, a), b.set(s, a), J.set(s, n), R.set(s, a.blocks), O.set(s, Date.now()), N(s));
1309
1376
  },
1310
1377
  destroy: () => {
1311
1378
  r.forEach((o) => ge(o)), r.clear(), X = Math.max(0, X - 1), !(X > 0) && ft();