@editora/plugins 1.0.10 → 1.0.11

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