@editora/plugins 1.0.21 → 1.0.23

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 (100) hide show
  1. package/README.md +259 -645
  2. package/dist/{CodePlugin.native-D8gGxB8i.mjs → CodePlugin.native-DESvGCrJ.mjs} +61 -53
  3. package/dist/{CodePlugin.native-CKJo7IFG.js → CodePlugin.native-DJqwsRPZ.js} +11 -11
  4. package/dist/a11y-checker.cjs.js +3 -3
  5. package/dist/a11y-checker.esm.js +6 -4
  6. package/dist/anchor.cjs.js +4 -4
  7. package/dist/anchor.esm.js +19 -18
  8. package/dist/anchoredPopover-BNJ8e7j-.mjs +128 -0
  9. package/dist/anchoredPopover-Cygmit_o.js +1 -0
  10. package/dist/approval-workflow.cjs.js +7 -7
  11. package/dist/approval-workflow.esm.js +55 -54
  12. package/dist/background-color.cjs.js +2 -2
  13. package/dist/background-color.esm.js +72 -67
  14. package/dist/blocks-library.cjs.js +18 -19
  15. package/dist/blocks-library.esm.js +41 -42
  16. package/dist/citations.cjs.js +4 -4
  17. package/dist/citations.esm.js +50 -50
  18. package/dist/code-sample.cjs.js +10 -10
  19. package/dist/code-sample.esm.js +4 -4
  20. package/dist/code.cjs.js +1 -1
  21. package/dist/code.esm.js +1 -1
  22. package/dist/comments.cjs.js +23 -11
  23. package/dist/comments.esm.js +167 -149
  24. package/dist/conditional-content.cjs.js +2 -2
  25. package/dist/conditional-content.esm.js +2 -2
  26. package/dist/confirmDialog-6BPaNPis.mjs +106 -0
  27. package/dist/confirmDialog-C4UWENes.js +46 -0
  28. package/dist/content-rules.cjs.js +6 -6
  29. package/dist/content-rules.esm.js +51 -51
  30. package/dist/data-binding.cjs.js +2 -2
  31. package/dist/data-binding.esm.js +2 -2
  32. package/dist/dialogHelpers-BbwpIXD9.mjs +183 -0
  33. package/dist/dialogHelpers-BxSQ7A6M.js +12 -0
  34. package/dist/document-manager.cjs.js +1 -1
  35. package/dist/document-manager.esm.js +1 -1
  36. package/dist/{documentManager-BL98a7YZ.mjs → documentManager-BFjGIeI8.mjs} +793 -781
  37. package/dist/{documentManager-r8t7yZEd.js → documentManager-C9d17K5W.js} +10 -10
  38. package/dist/embed-iframe.cjs.js +6 -6
  39. package/dist/embed-iframe.esm.js +6 -6
  40. package/dist/emojis.cjs.js +5 -5
  41. package/dist/emojis.esm.js +3 -3
  42. package/dist/enterprise.cjs.js +1 -1
  43. package/dist/enterprise.esm.js +1 -1
  44. package/dist/format-painter.cjs.js +1 -1
  45. package/dist/format-painter.esm.js +172 -151
  46. package/dist/heading.cjs.js +1 -1
  47. package/dist/heading.esm.js +96 -83
  48. package/dist/history.cjs.js +1 -1
  49. package/dist/history.esm.js +176 -97
  50. package/dist/{index-D5xugkYA.js → index-CtR8olYy.js} +2 -2
  51. package/dist/{index-B-VitI3v.mjs → index-Du_Ljqfz.mjs} +36 -35
  52. package/dist/index.cjs.js +1 -1
  53. package/dist/index.esm.js +2 -2
  54. package/dist/katex-Cc3-mvOY.js +257 -0
  55. package/dist/katex-DoRnZ_sp.mjs +11682 -0
  56. package/dist/katex.min--Ws3c9be.mjs +5 -0
  57. package/dist/katex.min-Dk2VscxB.js +2 -0
  58. package/dist/link.cjs.js +3 -3
  59. package/dist/link.esm.js +3 -3
  60. package/dist/list.cjs.js +1 -1
  61. package/dist/list.esm.js +140 -52
  62. package/dist/math.cjs.js +14 -14
  63. package/dist/math.esm.js +149 -136
  64. package/dist/media-manager.cjs.js +46 -46
  65. package/dist/media-manager.esm.js +320 -264
  66. package/dist/mentions.cjs.js +12 -12
  67. package/dist/mentions.esm.js +149 -143
  68. package/dist/merge-tag.cjs.js +5 -3
  69. package/dist/merge-tag.esm.js +5 -3
  70. package/dist/notify-BkbzMopb.js +32 -0
  71. package/dist/notify-zOp-mUOJ.mjs +59 -0
  72. package/dist/pii-redaction.cjs.js +1 -1
  73. package/dist/pii-redaction.esm.js +1 -1
  74. package/dist/preview.cjs.js +1 -1
  75. package/dist/preview.esm.js +1 -1
  76. package/dist/shared-config.cjs.js +1 -1
  77. package/dist/shared-config.esm.js +14 -14
  78. package/dist/slash-commands.cjs.js +5 -5
  79. package/dist/slash-commands.esm.js +259 -236
  80. package/dist/smart-paste.cjs.js +1 -1
  81. package/dist/smart-paste.esm.js +1 -1
  82. package/dist/special-characters.cjs.js +3 -3
  83. package/dist/special-characters.esm.js +3 -3
  84. package/dist/spell-check.cjs.js +9 -9
  85. package/dist/spell-check.esm.js +288 -251
  86. package/dist/table.cjs.js +14 -14
  87. package/dist/table.esm.js +175 -154
  88. package/dist/template.cjs.js +5 -3
  89. package/dist/template.esm.js +15 -13
  90. package/dist/text-color.cjs.js +4 -4
  91. package/dist/text-color.esm.js +38 -34
  92. package/dist/translation-workflow.cjs.js +9 -9
  93. package/dist/translation-workflow.esm.js +98 -95
  94. package/dist/version-diff.cjs.js +4 -4
  95. package/dist/version-diff.esm.js +36 -36
  96. package/package.json +6 -5
  97. package/dist/anchoredPopover-Bg-ey7Yo.js +0 -1
  98. package/dist/anchoredPopover-D_JbjvdA.mjs +0 -111
  99. package/dist/dialogHelpers-5d5BuOCW.mjs +0 -39
  100. package/dist/dialogHelpers-zU6zpMIA.js +0 -12
@@ -1,4 +1,4 @@
1
- const S = ".rte-content, .editora-content", ht = "rte-citations-styles", b = "rte-citations-panel", it = ".rte-citation-ref[data-citation-id]", G = '.rte-citation-bibliography[data-type="citation-bibliography"]', V = '.rte-citation-footnotes[data-type="citation-footnotes"]', x = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', L = ["apa", "mla", "chicago"], Pt = {
1
+ const S = ".rte-content, .editora-content", ht = "rte-citations-styles", b = "rte-citations-panel", it = ".rte-citation-ref[data-citation-id]", G = '.rte-citation-bibliography[data-type="citation-bibliography"]', V = '.rte-citation-footnotes[data-type="citation-footnotes"]', x = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', L = ["apa", "mla", "chicago"], Dt = {
2
2
  panelTitle: "Citations",
3
3
  panelAriaLabel: "Citations panel",
4
4
  styleLabel: "Citation style",
@@ -20,11 +20,11 @@ const S = ".rte-content, .editora-content", ht = "rte-citations-styles", b = "rt
20
20
  summaryPrefix: "Citations",
21
21
  invalidMessage: "Author and title are required."
22
22
  }, f = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new Set();
23
- let B = null, O = null, P = null, k = null, X = 0, Dt = 0, st = 0, M = null, p = null;
23
+ let B = null, O = null, P = null, k = null, X = 0, Ht = 0, st = 0, M = null, p = null;
24
24
  function g(t) {
25
25
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
26
26
  }
27
- function Ht(t) {
27
+ function Ft(t) {
28
28
  return t.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
29
29
  }
30
30
  function yt(t, e) {
@@ -53,7 +53,7 @@ function wt(t, e) {
53
53
  }
54
54
  function Q(t = {}) {
55
55
  const e = t.defaultStyle && L.includes(t.defaultStyle) ? t.defaultStyle : "apa", o = {
56
- ...Pt,
56
+ ...Dt,
57
57
  ...t.labels || {}
58
58
  };
59
59
  return {
@@ -62,7 +62,7 @@ function Q(t = {}) {
62
62
  debounceMs: Math.max(80, Number(t.debounceMs ?? 220)),
63
63
  maxRecentCitations: Math.max(3, Math.min(30, Number(t.maxRecentCitations ?? 8))),
64
64
  labels: o,
65
- normalizeText: t.normalizeText || Ht,
65
+ normalizeText: t.normalizeText || Ft,
66
66
  generateCitationId: typeof t.generateCitationId == "function" ? t.generateCitationId : void 0
67
67
  };
68
68
  }
@@ -75,14 +75,14 @@ function ut(t) {
75
75
  function J(t) {
76
76
  return t ? (t.getAttribute("data-theme") || t.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : t.classList.contains("dark") || t.classList.contains("editora-theme-dark") || t.classList.contains("rte-theme-dark") : !1;
77
77
  }
78
- function Ft(t) {
78
+ function _t(t) {
79
79
  const e = ut(t);
80
80
  if (J(e)) return !0;
81
81
  const o = e.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
82
82
  return J(o) ? !0 : J(document.documentElement) || J(document.body);
83
83
  }
84
84
  function et(t, e) {
85
- t.classList.remove("rte-citations-theme-dark"), Ft(e) && t.classList.add("rte-citations-theme-dark");
85
+ t.classList.remove("rte-citations-theme-dark"), _t(e) && t.classList.add("rte-citations-theme-dark");
86
86
  }
87
87
  function h(t, e = !0) {
88
88
  if (t?.contentElement instanceof HTMLElement) return t.contentElement;
@@ -112,7 +112,7 @@ function j(t) {
112
112
  const e = vt(t);
113
113
  return e ? !!(e.closest(G) || e.closest(V)) : !1;
114
114
  }
115
- function _t(t, e) {
115
+ function qt(t, e) {
116
116
  if (st += 1, e.generateCitationId) {
117
117
  const o = e.generateCitationId({ editor: t, index: st }), i = _(e.normalizeText(o || ""));
118
118
  if (i) return i;
@@ -122,7 +122,7 @@ function _t(t, e) {
122
122
  function ct(t) {
123
123
  return t.map((e) => (e || "").trim()).filter(Boolean).join(" ").trim();
124
124
  }
125
- function qt(t, e) {
125
+ function Kt(t, e) {
126
126
  const o = t.author || "Unknown", i = t.year || "n.d.";
127
127
  return e === "mla" ? `(${o} ${i})` : e === "chicago" ? `(${o} ${i})` : `(${o}, ${i})`;
128
128
  }
@@ -160,7 +160,7 @@ function Et(t, e) {
160
160
  };
161
161
  }
162
162
  function St(t, e, o) {
163
- t.classList.add("rte-citation-ref"), t.setAttribute("data-citation-id", e.id), t.setAttribute("data-citation-author", e.author || ""), t.setAttribute("data-citation-year", e.year || ""), t.setAttribute("data-citation-title", e.title || ""), t.setAttribute("data-citation-source", e.source || ""), t.setAttribute("data-citation-url", e.url || ""), t.setAttribute("data-citation-note", e.note || ""), t.setAttribute("contenteditable", "false"), t.setAttribute("tabindex", "0"), t.setAttribute("role", "doc-biblioref"), t.setAttribute("data-style", o), t.textContent = qt(e, o);
163
+ t.classList.add("rte-citation-ref"), t.setAttribute("data-citation-id", e.id), t.setAttribute("data-citation-author", e.author || ""), t.setAttribute("data-citation-year", e.year || ""), t.setAttribute("data-citation-title", e.title || ""), t.setAttribute("data-citation-source", e.source || ""), t.setAttribute("data-citation-url", e.url || ""), t.setAttribute("data-citation-note", e.note || ""), t.setAttribute("contenteditable", "false"), t.setAttribute("tabindex", "0"), t.setAttribute("role", "doc-biblioref"), t.setAttribute("data-style", o), t.textContent = Kt(e, o);
164
164
  }
165
165
  function rt(t, e, o) {
166
166
  const i = ut(t);
@@ -197,7 +197,7 @@ function U(t, e) {
197
197
  });
198
198
  }), Array.from(i.values());
199
199
  }
200
- function Kt(t, e, o) {
200
+ function jt(t, e, o) {
201
201
  const i = wt(e, o);
202
202
  if (!i.id || !i.author || !i.title) return;
203
203
  const r = (H.get(t) || []).filter((a) => a.id !== i.id);
@@ -217,7 +217,7 @@ function $t(t, e, o, i) {
217
217
  const n = _(i.normalizeText(e || ""));
218
218
  return n && at(t, o, i).find((a) => a.id === n) || null;
219
219
  }
220
- function jt(t, e, o) {
220
+ function Ut(t, e, o) {
221
221
  const i = _(o.normalizeText(e || ""));
222
222
  if (!i) return !1;
223
223
  const n = H.get(t) || [], r = n.filter((a) => a.id !== i);
@@ -231,13 +231,13 @@ function At(t, e, o) {
231
231
  const r = document.createElement("ol");
232
232
  return r.className = "rte-citation-list", r.setAttribute("role", "list"), i.appendChild(n), i.appendChild(r), i;
233
233
  }
234
- function Ut(t, e) {
234
+ function Wt(t, e) {
235
235
  let o = t.querySelector(G);
236
236
  o || (o = At("rte-citation-bibliography", "citation-bibliography", e.labels.bibliographyTitle), t.appendChild(o));
237
237
  const i = o.querySelector(".rte-citation-section-title");
238
238
  return i && (i.textContent = e.labels.bibliographyTitle), o.setAttribute("aria-label", e.labels.bibliographyTitle), o;
239
239
  }
240
- function Wt(t, e) {
240
+ function Gt(t, e) {
241
241
  let o = t.querySelector(V);
242
242
  o || (o = At("rte-citation-footnotes", "citation-footnotes", e.labels.footnotesTitle), t.appendChild(o));
243
243
  const i = o.querySelector(".rte-citation-section-title");
@@ -246,12 +246,12 @@ function Wt(t, e) {
246
246
  function kt(t, e) {
247
247
  t.querySelector(e)?.remove();
248
248
  }
249
- function Gt(t, e, o, i) {
249
+ function Vt(t, e, o, i) {
250
250
  if (e.length === 0) {
251
251
  kt(t, G);
252
252
  return;
253
253
  }
254
- const r = Ut(t, o).querySelector(".rte-citation-list");
254
+ const r = Wt(t, o).querySelector(".rte-citation-list");
255
255
  if (!r) return;
256
256
  const a = document.createDocumentFragment();
257
257
  e.forEach((s, u) => {
@@ -259,14 +259,14 @@ function Gt(t, e, o, i) {
259
259
  c.className = "rte-citation-item", c.id = `rte-citation-entry-${s.id}`, c.setAttribute("data-citation-id", s.id), c.setAttribute("data-citation-number", String(u + 1)), c.textContent = dt(s, i), a.appendChild(c);
260
260
  }), r.innerHTML = "", r.appendChild(a);
261
261
  }
262
- function Vt(t, e, o, i) {
262
+ function Yt(t, e, o, i) {
263
263
  if (!o.enableFootnoteSync || e.length === 0) {
264
264
  kt(t, V), R(t).forEach((l) => {
265
265
  l.removeAttribute("data-footnote-number"), l.removeAttribute("data-footnote-target");
266
266
  });
267
267
  return;
268
268
  }
269
- const r = Wt(t, o).querySelector(".rte-citation-list");
269
+ const r = Gt(t, o).querySelector(".rte-citation-list");
270
270
  if (!r) return;
271
271
  const a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
272
272
  e.forEach((l, d) => {
@@ -291,8 +291,8 @@ function Vt(t, e, o, i) {
291
291
  w.className = "rte-citation-footnote-number", w.textContent = `${d + 1}. `;
292
292
  const A = document.createElement("span");
293
293
  A.className = "rte-citation-footnote-text";
294
- const Ot = l.note ? `${l.note}. ` : "";
295
- A.textContent = `${Ot}${dt(l, i)}`, m.appendChild(w), m.appendChild(A);
294
+ const Pt = l.note ? `${l.note}. ` : "";
295
+ A.textContent = `${Pt}${dt(l, i)}`, m.appendChild(w), m.appendChild(A);
296
296
  const pt = a.get(l.id);
297
297
  if (pt) {
298
298
  const q = document.createElement("a");
@@ -301,11 +301,11 @@ function Vt(t, e, o, i) {
301
301
  c.appendChild(m);
302
302
  }), r.innerHTML = "", r.appendChild(c);
303
303
  }
304
- function Yt(t, e, o, i) {
304
+ function Xt(t, e, o, i) {
305
305
  const n = dt(e, o);
306
306
  t.setAttribute("data-citation-number", String(i)), t.setAttribute("aria-label", `Citation ${i}: ${n}`);
307
307
  }
308
- function Xt(t, e, o) {
308
+ function Jt(t, e, o) {
309
309
  const i = R(t);
310
310
  let n = `${e}:${o ? "1" : "0"}:${i.length}`;
311
311
  return i.forEach((r) => {
@@ -322,7 +322,7 @@ function F(t) {
322
322
  const c = n.length;
323
323
  a.textContent = `${o.labels.summaryPrefix}: ${c} | Style: ${i.toUpperCase()} | Footnotes: ${o.enableFootnoteSync ? "On" : "Off"}`;
324
324
  }
325
- if (s && (s.textContent = `${o.labels.styleButtonPrefix}: ${i.toUpperCase()}`, s.setAttribute("aria-label", `${o.labels.styleButtonPrefix}: ${i.toUpperCase()}`)), u) {
325
+ if (It(t, e, o), s && (s.textContent = `${o.labels.styleButtonPrefix}: ${i.toUpperCase()}`, s.setAttribute("aria-label", `${o.labels.styleButtonPrefix}: ${i.toUpperCase()}`)), u) {
326
326
  if (r.length === 0) {
327
327
  u.innerHTML = `<li class="rte-citations-empty">${g(o.labels.noCitationsText)}</li>`;
328
328
  return;
@@ -355,7 +355,7 @@ function F(t) {
355
355
  }
356
356
  }
357
357
  function y(t, e, o = !1) {
358
- const i = z(t, e), n = Xt(t, i, e.enableFootnoteSync);
358
+ const i = z(t, e), n = Jt(t, i, e.enableFootnoteSync);
359
359
  if (!o && xt.get(t) === n)
360
360
  return U(t, e);
361
361
  const r = R(t), a = /* @__PURE__ */ new Map();
@@ -373,8 +373,8 @@ function y(t, e, o = !1) {
373
373
  if (!d) return;
374
374
  St(c, d, i);
375
375
  const m = u.get(d.id) || 1;
376
- Yt(c, d, i, Math.max(1, m));
377
- }), Gt(t, s, e, i), Vt(t, s, e, i), xt.set(t, n), F(t), t.dispatchEvent(
376
+ Xt(c, d, i, Math.max(1, m));
377
+ }), Vt(t, s, e, i), Yt(t, s, e, i), xt.set(t, n), F(t), t.dispatchEvent(
378
378
  new CustomEvent("editora:citations-refreshed", {
379
379
  bubbles: !0,
380
380
  detail: {
@@ -398,7 +398,7 @@ function Mt(t) {
398
398
  }, e.debounceMs);
399
399
  K.add(o), tt.set(t, o);
400
400
  }
401
- function Jt(t) {
401
+ function Zt(t) {
402
402
  const e = window.getSelection();
403
403
  if (!e) throw new Error("Selection unavailable");
404
404
  if (e.rangeCount > 0) {
@@ -489,7 +489,7 @@ function D(t, e, o) {
489
489
  const s = t.nextSibling;
490
490
  return s instanceof Text && (s.data === " " ? s.remove() : s.data.startsWith(" ") && (s.data = s.data.slice(1))), t.remove(), Lt(n, a), y(i, o, !0), bt(i, r), ft(i), e === "Delete" && i.focus({ preventScroll: !0 }), !0;
491
491
  }
492
- function Zt(t, e, o) {
492
+ function Qt(t, e, o) {
493
493
  if (t.key !== "Backspace" && t.key !== "Delete") return !1;
494
494
  const i = t.key, n = t.target;
495
495
  if (n?.matches(it) && e.contains(n) && !j(n))
@@ -517,7 +517,7 @@ function Nt(t, e, o) {
517
517
  s instanceof Text && (s.data === " " ? s.remove() : s.data.startsWith(" ") && (s.data = s.data.slice(1))), a.remove();
518
518
  }), Lt(t, t.childNodes.length), y(t, o, !0), bt(t, r), ft(t), t.focus({ preventScroll: !0 }), !0;
519
519
  }
520
- function Qt(t, e) {
520
+ function te(t, e) {
521
521
  const o = window.getSelection();
522
522
  if (!o || o.rangeCount === 0) return !1;
523
523
  const i = o.getRangeAt(0);
@@ -531,11 +531,11 @@ function Qt(t, e) {
531
531
  function nt(t, e, o) {
532
532
  const i = wt(e, o);
533
533
  if (!i.author || !i.title) return !1;
534
- i.id || (i.id = _t(t, o));
534
+ i.id || (i.id = qt(t, o));
535
535
  const n = t.innerHTML;
536
536
  let r;
537
537
  try {
538
- r = Jt(t);
538
+ r = Zt(t);
539
539
  } catch {
540
540
  return !1;
541
541
  }
@@ -557,9 +557,9 @@ function nt(t, e, o) {
557
557
  c.setStart(u.parentNode, Math.max(0, l));
558
558
  } else
559
559
  c.setStartAfter(s);
560
- return c.collapse(!0), a.removeAllRanges(), a.addRange(c), Kt(t, i, o), y(t, o, !0), bt(t, n), ft(t), !0;
560
+ return c.collapse(!0), a.removeAllRanges(), a.addRange(c), jt(t, i, o), y(t, o, !0), bt(t, n), ft(t), !0;
561
561
  }
562
- function te(t, e) {
562
+ function ee(t, e) {
563
563
  if (!e) return !1;
564
564
  const o = R(t).find((r) => r.getAttribute("data-citation-id") === e) || null;
565
565
  if (!o) return !1;
@@ -576,7 +576,7 @@ function W(t, e = !1) {
576
576
  const o = v.get(t);
577
577
  o && (o.classList.remove("show"), Y.set(t, !1), rt(t, "toggleCitationsPanel", !1), e && t.focus({ preventScroll: !0 }));
578
578
  }
579
- function ee(t) {
579
+ function ne(t) {
580
580
  v.forEach((e, o) => {
581
581
  o !== t && W(o, !1);
582
582
  });
@@ -589,7 +589,7 @@ function lt(t, e) {
589
589
  function C(t, e) {
590
590
  return t.querySelector(`[data-field="${e}"]`);
591
591
  }
592
- function ne(t) {
592
+ function oe(t) {
593
593
  const e = C(t, "author")?.value || "", o = C(t, "year")?.value || "", i = C(t, "title")?.value || "", n = C(t, "source")?.value || "", r = C(t, "url")?.value || "", a = C(t, "note")?.value || "";
594
594
  return {
595
595
  author: e,
@@ -606,11 +606,11 @@ function E(t, e, o = !1) {
606
606
  const n = t.querySelector(".rte-citations-status");
607
607
  n && (n.textContent = e, n.classList.toggle("rte-citations-status-error", o));
608
608
  }
609
- function oe(t, e, o) {
609
+ function It(t, e, o) {
610
610
  const i = C(e, "style");
611
611
  i && (i.value = z(t, o));
612
612
  }
613
- function It(t, e, o) {
613
+ function Bt(t, e, o) {
614
614
  const i = L.includes(e) ? e : o.defaultStyle;
615
615
  return T.set(t, i), y(t, o, !0), i;
616
616
  }
@@ -621,7 +621,7 @@ function gt(t, e) {
621
621
  function ie(t) {
622
622
  const e = v.get(t);
623
623
  if (e) return e;
624
- const o = f.get(t) || M || Q(), i = `rte-citations-panel-${Dt++}`, n = document.createElement("section");
624
+ const o = f.get(t) || M || Q(), i = `rte-citations-panel-${Ht++}`, n = document.createElement("section");
625
625
  n.className = b, n.id = i, n.setAttribute("role", "dialog"), n.setAttribute("aria-modal", "false"), n.setAttribute("aria-label", o.labels.panelAriaLabel), n.setAttribute("tabindex", "-1"), n.innerHTML = `
626
626
  <header class="rte-citations-header">
627
627
  <h2 class="rte-citations-title">${g(o.labels.panelTitle)}</h2>
@@ -692,7 +692,7 @@ function ie(t) {
692
692
  }
693
693
  if (c === "insert") {
694
694
  if ($(t)) return;
695
- const d = ne(n);
695
+ const d = oe(n);
696
696
  if (!l.normalizeText(d.author) || !l.normalizeText(d.title)) {
697
697
  E(n, l.labels.invalidMessage, !0);
698
698
  return;
@@ -713,7 +713,7 @@ function ie(t) {
713
713
  }
714
714
  if (c === "cycle-style") {
715
715
  const d = gt(t, l);
716
- oe(t, n, l), E(n, `Style changed to ${d.toUpperCase()}.`);
716
+ It(t, n, l), E(n, `Style changed to ${d.toUpperCase()}.`);
717
717
  return;
718
718
  }
719
719
  if (c === "insert-from-recent") {
@@ -730,7 +730,7 @@ function ie(t) {
730
730
  E(n, "Citation deleted.");
731
731
  return;
732
732
  }
733
- jt(t, d, l) && (F(t), E(n, "Removed from recent citations."));
733
+ Ut(t, d, l) && (F(t), E(n, "Removed from recent citations."));
734
734
  }
735
735
  }), n.addEventListener("keydown", (a) => {
736
736
  if (a.key === "Escape") {
@@ -750,14 +750,14 @@ function ie(t) {
750
750
  const r = C(n, "style");
751
751
  return r?.addEventListener("change", () => {
752
752
  const a = f.get(t) || M || o, s = r.value;
753
- It(t, s, a), E(n, `Style changed to ${s.toUpperCase()}.`);
753
+ Bt(t, s, a), E(n, `Style changed to ${s.toUpperCase()}.`);
754
754
  }), et(n, t), document.body.appendChild(n), v.set(t, n), Y.set(t, !1), F(t), n;
755
755
  }
756
756
  function I(t) {
757
757
  const e = ie(t);
758
- ee(t), e.classList.add("show"), Y.set(t, !0), rt(t, "toggleCitationsPanel", !0), et(e, t), lt(t, e), F(t), C(e, "author")?.focus();
758
+ ne(t), e.classList.add("show"), Y.set(t, !0), rt(t, "toggleCitationsPanel", !0), et(e, t), lt(t, e), F(t), C(e, "author")?.focus();
759
759
  }
760
- function Bt(t, e) {
760
+ function Ot(t, e) {
761
761
  const o = ot(t);
762
762
  return (typeof e == "boolean" ? e : !o) ? I(t) : W(t, !1), !0;
763
763
  }
@@ -795,9 +795,9 @@ function ce(t) {
795
795
  e.preventDefault(), W(n, !0);
796
796
  return;
797
797
  }
798
- if (!i && !Zt(e, n, r)) {
798
+ if (!i && !Qt(e, n, r)) {
799
799
  if (re(e)) {
800
- e.preventDefault(), e.stopPropagation(), Bt(n);
800
+ e.preventDefault(), e.stopPropagation(), Ot(n);
801
801
  return;
802
802
  }
803
803
  if (ae(e)) {
@@ -1363,7 +1363,7 @@ const de = (t = {}) => {
1363
1363
  if (!n || $(n)) return !1;
1364
1364
  const r = f.get(n) || e;
1365
1365
  f.set(n, r), p = n;
1366
- const a = Bt(n, typeof o == "boolean" ? o : void 0);
1366
+ const a = Ot(n, typeof o == "boolean" ? o : void 0);
1367
1367
  return ot(n) && y(n, r, !1), a;
1368
1368
  },
1369
1369
  insertCitation: (o, i) => {
@@ -1384,7 +1384,7 @@ const de = (t = {}) => {
1384
1384
  const n = h(i);
1385
1385
  if (!n || !o) return !1;
1386
1386
  const r = f.get(n) || e;
1387
- return f.set(n, r), p = n, It(n, o, r), !0;
1387
+ return f.set(n, r), p = n, Bt(n, o, r), !0;
1388
1388
  },
1389
1389
  cycleCitationStyle: (o, i) => {
1390
1390
  const n = h(i);
@@ -1428,13 +1428,13 @@ const de = (t = {}) => {
1428
1428
  },
1429
1429
  locateCitation: (o, i) => {
1430
1430
  const n = h(i);
1431
- return !n || typeof o != "string" ? !1 : te(n, o);
1431
+ return !n || typeof o != "string" ? !1 : ee(n, o);
1432
1432
  },
1433
1433
  deleteCitation: (o, i) => {
1434
1434
  const n = h(i);
1435
1435
  if (!n || $(n)) return !1;
1436
1436
  const r = f.get(n) || e;
1437
- return f.set(n, r), typeof o == "string" && o.trim() ? Nt(n, o, r) : Qt(n, r);
1437
+ return f.set(n, r), typeof o == "string" && o.trim() ? Nt(n, o, r) : te(n, r);
1438
1438
  },
1439
1439
  insertRecentCitation: (o, i) => {
1440
1440
  const n = h(i);
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const U=require("./escapeHtml-D2Zh82pD.js"),F=require("./dialogHelpers-zU6zpMIA.js"),P=require("./historyHelpers-Cu8Pk7m1.js"),G=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]);function M(e,o){let t=e;for(;t&&t!==o;){if(t.nodeType===Node.ELEMENT_NODE&&G.has(t.tagName))return t;t=t.parentNode}return null}const _=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const r=t;if(r.getAttribute("contenteditable")==="true")return r}t=t.parentNode}}const o=document.activeElement;if(o){if(o.getAttribute("contenteditable")==="true")return o;const t=o.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},h='[data-theme="dark"], .dark, .editora-theme-dark',Z=()=>{if(_()?.closest(h))return!0;const o=window.getSelection();if(o&&o.rangeCount>0){const r=o.getRangeAt(0).startContainer;if((r.nodeType===Node.ELEMENT_NODE?r:r.parentElement)?.closest(h))return!0}return document.activeElement?.closest(h)?!0:document.body.matches(h)||document.documentElement.matches(h)},J=[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"csharp",label:"C#"},{value:"cpp",label:"C++"},{value:"c",label:"C"},{value:"php",label:"PHP"},{value:"ruby",label:"Ruby"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"swift",label:"Swift"},{value:"kotlin",label:"Kotlin"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"scss",label:"SCSS"},{value:"json",label:"JSON"},{value:"xml",label:"XML"},{value:"yaml",label:"YAML"},{value:"markdown",label:"Markdown"},{value:"sql",label:"SQL"},{value:"bash",label:"Bash"},{value:"shell",label:"Shell"},{value:"plaintext",label:"Plain Text"}];let C=null;function O(e,o,t,r){C&&(C.remove(),C=null);const i=!!o,B=r||"javascript",s=t||"",c=Z(),n=c?{overlay:"rgba(0, 0, 0, 0.62)",dialogBg:"#1f2937",dialogBorder:"#4b5563",text:"#e2e8f0",mutedText:"#a8b5c8",headerFooterBg:"#222d3a",border:"#3b4657",fieldBg:"#111827",fieldBorder:"#4b5563",cancelBg:"#334155",cancelHover:"#475569",cancelText:"#e2e8f0",primaryBg:"#3b82f6",primaryHover:"#2563eb"}:{overlay:"rgba(0, 0, 0, 0.5)",dialogBg:"#ffffff",dialogBorder:"#e0e0e0",text:"#333333",mutedText:"#666666",headerFooterBg:"#ffffff",border:"#e0e0e0",fieldBg:"#ffffff",fieldBorder:"#dddddd",cancelBg:"#e5e7eb",cancelHover:"#d1d5db",cancelText:"#333333",primaryBg:"#2563eb",primaryHover:"#1d4ed8"},l=document.createElement("div");F.initDialogOverlay(l),l.className="rte-code-sample-overlay",c&&l.classList.add("rte-theme-dark"),l.style.cssText=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const U=require("./escapeHtml-D2Zh82pD.js"),F=require("./dialogHelpers-BxSQ7A6M.js"),P=require("./historyHelpers-Cu8Pk7m1.js"),G=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]);function M(e,o){let t=e;for(;t&&t!==o;){if(t.nodeType===Node.ELEMENT_NODE&&G.has(t.tagName))return t;t=t.parentNode}return null}const _=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const a=t;if(a.getAttribute("contenteditable")==="true")return a}t=t.parentNode}}const o=document.activeElement;if(o){if(o.getAttribute("contenteditable")==="true")return o;const t=o.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},h='[data-theme="dark"], .dark, .editora-theme-dark',Z=()=>{if(_()?.closest(h))return!0;const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0).startContainer;if((a.nodeType===Node.ELEMENT_NODE?a:a.parentElement)?.closest(h))return!0}return document.activeElement?.closest(h)?!0:document.body.matches(h)||document.documentElement.matches(h)},J=[{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"csharp",label:"C#"},{value:"cpp",label:"C++"},{value:"c",label:"C"},{value:"php",label:"PHP"},{value:"ruby",label:"Ruby"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"swift",label:"Swift"},{value:"kotlin",label:"Kotlin"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"scss",label:"SCSS"},{value:"json",label:"JSON"},{value:"xml",label:"XML"},{value:"yaml",label:"YAML"},{value:"markdown",label:"Markdown"},{value:"sql",label:"SQL"},{value:"bash",label:"Bash"},{value:"shell",label:"Shell"},{value:"plaintext",label:"Plain Text"}];let C=null;function O(e,o,t,a){C&&(C.remove(),C=null);const i=!!o,B=a||"javascript",s=t||"",c=Z(),n=c?{overlay:"rgba(0, 0, 0, 0.62)",dialogBg:"#1f2937",dialogBorder:"#4b5563",text:"#e2e8f0",mutedText:"#a8b5c8",headerFooterBg:"#222d3a",border:"#3b4657",fieldBg:"#111827",fieldBorder:"#4b5563",cancelBg:"#334155",cancelHover:"#475569",cancelText:"#e2e8f0",primaryBg:"#2563eb",primaryHover:"#2563eb"}:{overlay:"rgba(0, 0, 0, 0.5)",dialogBg:"#ffffff",dialogBorder:"#e0e0e0",text:"#333333",mutedText:"#666666",headerFooterBg:"#ffffff",border:"#e0e0e0",fieldBg:"#ffffff",fieldBorder:"#dddddd",cancelBg:"#e5e7eb",cancelHover:"#d1d5db",cancelText:"#333333",primaryBg:"#2563eb",primaryHover:"#1d4ed8"},l=document.createElement("div");F.initDialogOverlay(l),l.className="rte-code-sample-overlay",c&&l.classList.add("rte-theme-dark"),l.style.cssText=`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -38,8 +38,8 @@
38
38
  overflow-y: auto;
39
39
  padding: 20px;
40
40
  `;const E=document.createElement("div");E.style.marginBottom="20px",E.innerHTML=`
41
- <label style="display: block; margin-bottom: 8px; font-weight: 500; color: ${n.text}; font-size: 14px;">Language</label>
42
- <select class="rte-code-language" style="
41
+ <label for="rte-code-language-select" style="display: block; margin-bottom: 8px; font-weight: 500; color: ${n.text}; font-size: 14px;">Language</label>
42
+ <select id="rte-code-language-select" class="rte-code-language" style="
43
43
  width: 100%;
44
44
  padding: 10px 12px;
45
45
  border: 1px solid ${n.fieldBorder};
@@ -49,9 +49,9 @@
49
49
  color: ${n.text};
50
50
  cursor: pointer;
51
51
  ">
52
- ${J.map(a=>`
53
- <option value="${a.value}" ${a.value===B?"selected":""}>
54
- ${a.label}
52
+ ${J.map(r=>`
53
+ <option value="${r.value}" ${r.value===B?"selected":""}>
54
+ ${r.label}
55
55
  </option>
56
56
  `).join("")}
57
57
  </select>
@@ -101,7 +101,7 @@
101
101
  background: ${n.primaryBg};
102
102
  color: #fff;
103
103
  ">${i?"Update Code Sample":"Insert Code Sample"}</button>
104
- `,d.appendChild(p),d.appendChild(f),d.appendChild(g),l.appendChild(d);const V=E.querySelector(".rte-code-language"),k=b.querySelector(".rte-code-textarea"),H=b.querySelector(".rte-code-error"),u=p.querySelector(".rte-code-close-btn"),y=g.querySelector(".rte-code-cancel-btn"),x=g.querySelector(".rte-code-save-btn");u.onmouseover=()=>{u.style.color="#f8fafc",u.style.background=c?"#334155":"#f0f0f0",u.style.borderRadius="4px"},u.onmouseout=()=>{u.style.color=n.mutedText,u.style.background="none"},y.onmouseover=()=>{y.style.background=n.cancelHover},y.onmouseout=()=>{y.style.background=n.cancelBg},x.onmouseover=()=>{x.style.background=n.primaryHover},x.onmouseout=()=>{x.style.background=n.primaryBg};const v=()=>{l.remove(),C=null},R=()=>{const a=k.value.replace(/^(?:[ \t]*\r?\n)+/,"").replace(/\s+$/,"");if(!a.trim()){H.textContent="⚠ Code cannot be empty",H.style.display="block";return}const K=V.value;e(a,K),v()};if(u.onclick=v,y.onclick=v,x.onclick=R,k.addEventListener("keydown",a=>{(a.ctrlKey||a.metaKey)&&a.key==="Enter"&&(a.preventDefault(),R()),a.key==="Escape"&&v()}),k.addEventListener("input",()=>{H.style.display="none"}),l.addEventListener("click",a=>{a.target===l&&v()}),!document.getElementById("rte-code-sample-animations")){const a=document.createElement("style");a.id="rte-code-sample-animations",a.textContent=`
104
+ `,d.appendChild(p),d.appendChild(f),d.appendChild(g),l.appendChild(d);const V=E.querySelector(".rte-code-language"),k=b.querySelector(".rte-code-textarea"),H=b.querySelector(".rte-code-error"),u=p.querySelector(".rte-code-close-btn"),y=g.querySelector(".rte-code-cancel-btn"),x=g.querySelector(".rte-code-save-btn");u.onmouseover=()=>{u.style.color="#f8fafc",u.style.background=c?"#334155":"#f0f0f0",u.style.borderRadius="4px"},u.onmouseout=()=>{u.style.color=n.mutedText,u.style.background="none"},y.onmouseover=()=>{y.style.background=n.cancelHover},y.onmouseout=()=>{y.style.background=n.cancelBg},x.onmouseover=()=>{x.style.background=n.primaryHover},x.onmouseout=()=>{x.style.background=n.primaryBg};const v=()=>{l.remove(),C=null},R=()=>{const r=k.value.replace(/^(?:[ \t]*\r?\n)+/,"").replace(/\s+$/,"");if(!r.trim()){H.textContent="⚠ Code cannot be empty",H.style.display="block";return}const K=V.value;e(r,K),v()};if(u.onclick=v,y.onclick=v,x.onclick=R,k.addEventListener("keydown",r=>{(r.ctrlKey||r.metaKey)&&r.key==="Enter"&&(r.preventDefault(),R()),r.key==="Escape"&&v()}),k.addEventListener("input",()=>{H.style.display="none"}),l.addEventListener("click",r=>{r.target===l&&v()}),!document.getElementById("rte-code-sample-animations")){const r=document.createElement("style");r.id="rte-code-sample-animations",r.textContent=`
105
105
  @keyframes fadeIn {
106
106
  from { opacity: 0; }
107
107
  to { opacity: 1; }
@@ -110,7 +110,7 @@
110
110
  from { transform: translateY(20px); opacity: 0; }
111
111
  to { transform: translateY(0); opacity: 1; }
112
112
  }
113
- `,document.head.appendChild(a)}return C=l,document.body.appendChild(l),setTimeout(()=>k.focus(),100),l}const N='pre.rte-code-block, pre[data-type="code-block"]';function q(){if(document.getElementById("rte-code-sample-block-styles"))return;const e=document.createElement("style");e.id="rte-code-sample-block-styles",e.textContent=`
113
+ `,document.head.appendChild(r)}return C=l,document.body.appendChild(l),setTimeout(()=>k.focus(),100),l}const N='pre.rte-code-block, pre[data-type="code-block"]';function q(){if(document.getElementById("rte-code-sample-block-styles"))return;const e=document.createElement("style");e.id="rte-code-sample-block-styles",e.textContent=`
114
114
  pre.rte-code-block[data-lang]::after {
115
115
  content: attr(data-lang);
116
116
  position: absolute;
@@ -169,7 +169,7 @@
169
169
  color: #333;
170
170
  user-select: text;
171
171
  cursor: default;
172
- `;const r=document.createElement("code");return r.className=`language-${o}`,r.style.cssText=`
172
+ `;const a=document.createElement("code");return a.className=`language-${o}`,a.style.cssText=`
173
173
  font-family: inherit;
174
174
  font-size: inherit;
175
175
  line-height: inherit;
@@ -177,4 +177,4 @@
177
177
  white-space: pre;
178
178
  word-break: normal;
179
179
  display: block;
180
- `,r.textContent=e,t.appendChild(r),t}function X(e,o,t){let r=e.querySelector("code");r||(r=document.createElement("code")),r.textContent=o,r.className=`language-${t}`,Array.from(e.childNodes).forEach(i=>{i!==r&&e.removeChild(i)}),e.appendChild(r),e.setAttribute("data-lang",t),e.setAttribute("aria-label",`Code sample (${t}). Press Enter to edit.`),e.style.paddingTop="30px"}let m=null,A=null,T=null,w=null;function S(){T!==null&&(window.clearTimeout(T),T=null)}function $(){S(),m&&(m.style.display="none"),A=null}function j(){S(),T=window.setTimeout($,120)}async function W(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}const o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.cssText="position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none;",document.body.appendChild(o);const t=window.getSelection(),r=t&&t.rangeCount>0?t.getRangeAt(0).cloneRange():null;o.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return o.remove(),r&&t&&(t.removeAllRanges(),t.addRange(r)),i}function ee(){if(m&&m.isConnected)return m;const e=document.createElement("button");return e.type="button",e.className="rte-code-copy-floating",e.textContent="Copy",e.setAttribute("aria-label","Copy code"),e.addEventListener("mousedown",o=>o.preventDefault()),e.addEventListener("mouseenter",S),e.addEventListener("mouseleave",j),e.addEventListener("click",async o=>{o.stopPropagation();const t=A;if(!t)return;const r=await W(I(t));e.textContent=r?"✓ Copied!":"Copy failed",w!==null&&window.clearTimeout(w),w=window.setTimeout(()=>{e.textContent="Copy",w=null},2e3)}),document.body.appendChild(e),m=e,e}function te(e){q();const o=ee();S(),A=e;const t=e.getBoundingClientRect();o.style.left=`${Math.max(0,t.left+8)}px`,o.style.top=`${Math.max(0,t.top+5)}px`,o.style.display="block"}function D(e){return!!e.parentElement?.closest('[contenteditable="true"]')}function oe(){if(typeof document>"u"||window.__codeSampleInteractionsReady)return;window.__codeSampleInteractionsReady=!0;const e=o=>(o instanceof Element?o:o instanceof Node?o.parentElement:null)?.closest(N)??null;document.addEventListener("mouseover",o=>{const t=e(o.target);t&&te(t)}),document.addEventListener("mouseout",o=>{e(o.target)&&!(o.relatedTarget instanceof Node&&m?.contains(o.relatedTarget))&&j()}),document.addEventListener("scroll",$,!0),window.addEventListener("resize",$),document.addEventListener("dblclick",o=>{const t=e(o.target);t&&D(t)&&z(t)}),document.addEventListener("keydown",o=>{if(o.key!=="Enter"||o.target!==document.activeElement)return;const t=o.target instanceof HTMLElement&&o.target.matches(N)?o.target:null;t&&D(t)&&(o.preventDefault(),z(t))})}typeof window<"u"&&oe();function ne(){const e=_();if(!e||e.getAttribute("contenteditable")!=="true")return;let o=null;const t=window.getSelection();t&&t.rangeCount>0&&e.contains(t.getRangeAt(0).commonAncestorContainer)&&(o=t.getRangeAt(0).cloneRange()),O((r,i)=>{if(!e.isConnected)return;q();const B=e.innerHTML,s=Q(r,i),c=o?o.cloneRange():document.createRange();o||(c.selectNodeContents(e),c.collapse(!1));const n=M(c.endContainer,e)||M(c.startContainer,e);if(n&&n.parentNode?n.parentNode.insertBefore(s,n.nextSibling):o?c.insertNode(s):e.appendChild(s),!s.nextSibling){const p=document.createElement("p");p.appendChild(document.createElement("br")),s.after(p)}const l=document.createRange();l.setStartAfter(s),l.collapse(!0);const d=window.getSelection();d?.removeAllRanges(),d?.addRange(l),P.recordDomHistory(e,B),e.dispatchEvent(new Event("input",{bubbles:!0}))})}function z(e){const o=e.closest('[contenteditable="true"]');o&&O((t,r)=>{if(!e.isConnected)return;const i=o.innerHTML;X(e,t,r),P.recordDomHistory(o,i),o.dispatchEvent(new Event("input",{bubbles:!0}))},"editing",I(e),Y(e))}const re=()=>({name:"codeSample",toolbar:[{label:"Insert Code",command:"insertCodeBlock",icon:'<svg width="24" height="26" focusable="false"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-C"}],commands:{insertCodeBlock:()=>(ne(),!0)}});exports.CodeSamplePlugin=re;
180
+ `,a.textContent=e,t.appendChild(a),t}function X(e,o,t){let a=e.querySelector("code");a||(a=document.createElement("code")),a.textContent=o,a.className=`language-${t}`,Array.from(e.childNodes).forEach(i=>{i!==a&&e.removeChild(i)}),e.appendChild(a),e.setAttribute("data-lang",t),e.setAttribute("aria-label",`Code sample (${t}). Press Enter to edit.`),e.style.paddingTop="30px"}let m=null,A=null,T=null,w=null;function S(){T!==null&&(window.clearTimeout(T),T=null)}function $(){S(),m&&(m.style.display="none"),A=null}function j(){S(),T=window.setTimeout($,120)}async function W(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}const o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.cssText="position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none;",document.body.appendChild(o);const t=window.getSelection(),a=t&&t.rangeCount>0?t.getRangeAt(0).cloneRange():null;o.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return o.remove(),a&&t&&(t.removeAllRanges(),t.addRange(a)),i}function ee(){if(m&&m.isConnected)return m;const e=document.createElement("button");return e.type="button",e.className="rte-code-copy-floating",e.textContent="Copy",e.setAttribute("aria-label","Copy code"),e.addEventListener("mousedown",o=>o.preventDefault()),e.addEventListener("mouseenter",S),e.addEventListener("mouseleave",j),e.addEventListener("click",async o=>{o.stopPropagation();const t=A;if(!t)return;const a=await W(I(t));e.textContent=a?"✓ Copied!":"Copy failed",w!==null&&window.clearTimeout(w),w=window.setTimeout(()=>{e.textContent="Copy",w=null},2e3)}),document.body.appendChild(e),m=e,e}function te(e){q();const o=ee();S(),A=e;const t=e.getBoundingClientRect();o.style.left=`${Math.max(0,t.left+8)}px`,o.style.top=`${Math.max(0,t.top+5)}px`,o.style.display="block"}function D(e){return!!e.parentElement?.closest('[contenteditable="true"]')}function oe(){if(typeof document>"u"||window.__codeSampleInteractionsReady)return;window.__codeSampleInteractionsReady=!0;const e=o=>(o instanceof Element?o:o instanceof Node?o.parentElement:null)?.closest(N)??null;document.addEventListener("mouseover",o=>{const t=e(o.target);t&&te(t)}),document.addEventListener("mouseout",o=>{e(o.target)&&!(o.relatedTarget instanceof Node&&m?.contains(o.relatedTarget))&&j()}),document.addEventListener("scroll",$,!0),window.addEventListener("resize",$),document.addEventListener("dblclick",o=>{const t=e(o.target);t&&D(t)&&z(t)}),document.addEventListener("keydown",o=>{if(o.key!=="Enter"||o.target!==document.activeElement)return;const t=o.target instanceof HTMLElement&&o.target.matches(N)?o.target:null;t&&D(t)&&(o.preventDefault(),z(t))})}typeof window<"u"&&oe();function ne(){const e=_();if(!e||e.getAttribute("contenteditable")!=="true")return;let o=null;const t=window.getSelection();t&&t.rangeCount>0&&e.contains(t.getRangeAt(0).commonAncestorContainer)&&(o=t.getRangeAt(0).cloneRange()),O((a,i)=>{if(!e.isConnected)return;q();const B=e.innerHTML,s=Q(a,i),c=o?o.cloneRange():document.createRange();o||(c.selectNodeContents(e),c.collapse(!1));const n=M(c.endContainer,e)||M(c.startContainer,e);if(n&&n.parentNode?n.parentNode.insertBefore(s,n.nextSibling):o?c.insertNode(s):e.appendChild(s),!s.nextSibling){const p=document.createElement("p");p.appendChild(document.createElement("br")),s.after(p)}const l=document.createRange();l.setStartAfter(s),l.collapse(!0);const d=window.getSelection();d?.removeAllRanges(),d?.addRange(l),P.recordDomHistory(e,B),e.dispatchEvent(new Event("input",{bubbles:!0}))})}function z(e){const o=e.closest('[contenteditable="true"]');o&&O((t,a)=>{if(!e.isConnected)return;const i=o.innerHTML;X(e,t,a),P.recordDomHistory(o,i),o.dispatchEvent(new Event("input",{bubbles:!0}))},"editing",I(e),Y(e))}const ae=()=>({name:"codeSample",toolbar:[{label:"Insert Code",command:"insertCodeBlock",icon:'<svg width="24" height="26" focusable="false"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-C"}],commands:{insertCodeBlock:()=>(ne(),!0)}});exports.CodeSamplePlugin=ae;
@@ -1,5 +1,5 @@
1
1
  import { e as U } from "./escapeHtml-DyksyvcZ.mjs";
2
- import { i as F } from "./dialogHelpers-5d5BuOCW.mjs";
2
+ import { i as F } from "./dialogHelpers-BbwpIXD9.mjs";
3
3
  import { r as P } from "./historyHelpers-BEKwNOtA.mjs";
4
4
  const G = /* @__PURE__ */ new Set([
5
5
  "DIV",
@@ -96,7 +96,7 @@ function O(e, o, t, a) {
96
96
  cancelBg: "#334155",
97
97
  cancelHover: "#475569",
98
98
  cancelText: "#e2e8f0",
99
- primaryBg: "#3b82f6",
99
+ primaryBg: "#2563eb",
100
100
  primaryHover: "#2563eb"
101
101
  } : {
102
102
  overlay: "rgba(0, 0, 0, 0.5)",
@@ -162,8 +162,8 @@ function O(e, o, t, a) {
162
162
  `;
163
163
  const E = document.createElement("div");
164
164
  E.style.marginBottom = "20px", E.innerHTML = `
165
- <label style="display: block; margin-bottom: 8px; font-weight: 500; color: ${n.text}; font-size: 14px;">Language</label>
166
- <select class="rte-code-language" style="
165
+ <label for="rte-code-language-select" style="display: block; margin-bottom: 8px; font-weight: 500; color: ${n.text}; font-size: 14px;">Language</label>
166
+ <select id="rte-code-language-select" class="rte-code-language" style="
167
167
  width: 100%;
168
168
  padding: 10px 12px;
169
169
  border: 1px solid ${n.fieldBorder};
package/dist/code.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./CodePlugin.native-CKJo7IFG.js");exports.CodePlugin=e.CodePlugin;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./CodePlugin.native-DJqwsRPZ.js");exports.CodePlugin=e.CodePlugin;
package/dist/code.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as r } from "./CodePlugin.native-D8gGxB8i.mjs";
1
+ import { C as r } from "./CodePlugin.native-DESvGCrJ.mjs";
2
2
  export {
3
3
  r as CodePlugin
4
4
  };