@editora/core 1.0.22 → 1.0.24

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 (65) hide show
  1. package/README.md +247 -243
  2. package/dist/{A11yCheckerPlugin.native-qW_njhLY.mjs → A11yCheckerPlugin.native-BBCsR5Ur.mjs} +7 -5
  3. package/dist/{AnchorPlugin.native-Drmxhy98.mjs → AnchorPlugin.native-Dk9R26cF.mjs} +20 -19
  4. package/dist/{ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs → ApprovalWorkflowPlugin.native-AeJsehXM.mjs} +56 -55
  5. package/dist/{BackgroundColorPlugin.native-H3XyYD7_.mjs → BackgroundColorPlugin.native-DCAd94kp.mjs} +103 -98
  6. package/dist/{BlocksLibraryPlugin.native-CownM6Rk.mjs → BlocksLibraryPlugin.native-D9OPcnQV.mjs} +42 -43
  7. package/dist/{CitationsPlugin.native-C_7wWQ-k.mjs → CitationsPlugin.native-BFChgCSV.mjs} +51 -51
  8. package/dist/{CodePlugin.native-CAHk9ecG.mjs → CodePlugin.native-BRBEIqY7.mjs} +167 -113
  9. package/dist/{CodePlugin.native-DZgIez08.mjs → CodePlugin.native-CPfKDrkr.mjs} +1383 -1094
  10. package/dist/{CodeSamplePlugin.native-svbAFWh_.mjs → CodeSamplePlugin.native-Bai8bgl3.mjs} +5 -5
  11. package/dist/{CommentsPlugin.native-DncTHiEe.mjs → CommentsPlugin.native-DHCDUm9f.mjs} +161 -141
  12. package/dist/{ConditionalContentPlugin.native-Bf7XgRSW.mjs → ConditionalContentPlugin.native-B3R6xcqn.mjs} +3 -3
  13. package/dist/{ContentRulesPlugin.native-vPx5nC73.mjs → ContentRulesPlugin.native-BISqhQKJ.mjs} +52 -52
  14. package/dist/{DataBindingPlugin.native-B7lpI_0c.mjs → DataBindingPlugin.native-DbaDeXNp.mjs} +37 -37
  15. package/dist/{DocumentManagerPlugin.native-B8K-Oqom.mjs → DocumentManagerPlugin.native-tZqIa9o5.mjs} +21 -20
  16. package/dist/{EmbedIframePlugin.native-BfZ_HGlV.mjs → EmbedIframePlugin.native-qHMf1Jtg.mjs} +7 -7
  17. package/dist/{EmojisPlugin.native-D92aaOKi.mjs → EmojisPlugin.native-B64efKg5.mjs} +4 -4
  18. package/dist/{FormatPainterPlugin.native-BhjzsiVq.mjs → FormatPainterPlugin.native-CAc1N6xU.mjs} +183 -161
  19. package/dist/{HeadingPlugin.native-DZdvubrQ.mjs → HeadingPlugin.native-C3YiGERx.mjs} +85 -72
  20. package/dist/HistoryPlugin.native-C8GyxsgC.mjs +330 -0
  21. package/dist/{LinkPlugin.native-BsQXYsK6.mjs → LinkPlugin.native-Dt_p6Ukb.mjs} +4 -4
  22. package/dist/ListPlugin.native-UYaoRiub.mjs +239 -0
  23. package/dist/{MathPlugin.native-Byo3WL0f.mjs → MathPlugin.native-Cq9WQ7cq.mjs} +148 -130
  24. package/dist/MediaManagerPlugin.native-BjrEarV6.mjs +1161 -0
  25. package/dist/{MediaManagerPlugin.native-BT1NZIJS.mjs → MediaManagerPlugin.native-CRi24Mrb.mjs} +340 -281
  26. package/dist/{MentionPlugin.native-S_lwGZQO.mjs → MentionPlugin.native-Zb1dwdxU.mjs} +304 -300
  27. package/dist/{MergeTagPlugin.native-7-6F3S1Y.mjs → MergeTagPlugin.native-BXkVPvCo.mjs} +6 -4
  28. package/dist/{PIIRedactionPlugin.native-g7j4jOmm.mjs → PIIRedactionPlugin.native-Cm0bpzQb.mjs} +2 -2
  29. package/dist/{PreviewPlugin.native-Dv5OsffK.mjs → PreviewPlugin.native-CrfiwP2J.mjs} +2 -2
  30. package/dist/{SlashCommandsPlugin.native-BDIIwGNs.mjs → SlashCommandsPlugin.native-BzGTRmMB.mjs} +264 -240
  31. package/dist/{SmartPastePlugin.native-BATLCds5.mjs → SmartPastePlugin.native-DnOJhDsf.mjs} +2 -2
  32. package/dist/{SpecialCharactersPlugin.native-CdZoc1GB.mjs → SpecialCharactersPlugin.native-B0XaCfjZ.mjs} +4 -4
  33. package/dist/{SpellCheckPlugin.native-BGm2qPfn.mjs → SpellCheckPlugin.native-BE7os1Xj.mjs} +302 -265
  34. package/dist/{TablePlugin.native-C1YZ372P.mjs → TablePlugin.native-CWxEFpV8.mjs} +159 -136
  35. package/dist/{TemplatePlugin.native-Dwk8TgxI.mjs → TemplatePlugin.native-OD8Wc1R7.mjs} +6 -4
  36. package/dist/{TextColorPlugin.native-KMZ2uzlq.mjs → TextColorPlugin.native-C2IjioNM.mjs} +75 -71
  37. package/dist/{TranslationWorkflowPlugin.native-CZtG--06.mjs → TranslationWorkflowPlugin.native-BGXVJD9f.mjs} +101 -98
  38. package/dist/{VersionDiffPlugin.native-Ca1fMWUJ.mjs → VersionDiffPlugin.native-DJZIzFSK.mjs} +11 -11
  39. package/dist/anchoredPopover-QN4jNbW1.mjs +134 -0
  40. package/dist/confirmDialog-BP8hZPpX.mjs +112 -0
  41. package/dist/dialogHelpers-Dzn8DHoF.mjs +194 -0
  42. package/dist/{documentManager-BWK_-KJp.mjs → documentManager-8gnG-uG_.mjs} +1728 -1715
  43. package/dist/editora.min.js +21 -21
  44. package/dist/editora.umd.js +10 -10
  45. package/dist/{index-C1sO7DAC.js → index--wO0CZVN.js} +6 -6
  46. package/dist/{index-DGMYWPLx.mjs → index-BICrB5kg.mjs} +397 -326
  47. package/dist/index.cjs.js +1 -1
  48. package/dist/index.esm.js +2 -2
  49. package/dist/katex-DLIObQUm.mjs +11683 -0
  50. package/dist/katex.min--Ws3c9be.mjs +6 -0
  51. package/dist/notify-DCQGpmq-.mjs +60 -0
  52. package/dist/plugin-loader.js +54 -54
  53. package/dist/webcomponent-core.js +305 -234
  54. package/dist/webcomponent-core.min.css +1 -1
  55. package/dist/webcomponent-core.min.js +153 -80
  56. package/dist/webcomponent.cjs.js +1 -1
  57. package/dist/webcomponent.esm.js +1 -1
  58. package/dist/webcomponent.js +631 -560
  59. package/dist/webcomponent.min.css +1 -1
  60. package/dist/webcomponent.min.js +1677 -1328
  61. package/package.json +1 -1
  62. package/dist/HistoryPlugin.native-DPvhks6h.mjs +0 -246
  63. package/dist/ListPlugin.native-Bt0LANbO.mjs +0 -139
  64. package/dist/anchoredPopover-DJFD2oAP.mjs +0 -116
  65. package/dist/dialogHelpers-DBf7WqYH.mjs +0 -40
@@ -1,4 +1,4 @@
1
- const S = ".rte-content, .editora-content", ht = "rte-citations-styles", m = "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", m = "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", m = "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, n) {
@@ -54,7 +54,7 @@ function wt(t, n) {
54
54
  function Q(t = {}) {
55
55
  var i, o;
56
56
  const n = t.defaultStyle && L.includes(t.defaultStyle) ? t.defaultStyle : "apa", e = {
57
- ...Pt,
57
+ ...Dt,
58
58
  ...t.labels || {}
59
59
  };
60
60
  return {
@@ -63,7 +63,7 @@ function Q(t = {}) {
63
63
  debounceMs: Math.max(80, Number((i = t.debounceMs) != null ? i : 220)),
64
64
  maxRecentCitations: Math.max(3, Math.min(30, Number((o = t.maxRecentCitations) != null ? o : 8))),
65
65
  labels: e,
66
- normalizeText: t.normalizeText || Ht,
66
+ normalizeText: t.normalizeText || Ft,
67
67
  generateCitationId: typeof t.generateCitationId == "function" ? t.generateCitationId : void 0
68
68
  };
69
69
  }
@@ -76,14 +76,14 @@ function ut(t) {
76
76
  function J(t) {
77
77
  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;
78
78
  }
79
- function Ft(t) {
79
+ function _t(t) {
80
80
  const n = ut(t);
81
81
  if (J(n)) return !0;
82
82
  const e = n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
83
83
  return J(e) ? !0 : J(document.documentElement) || J(document.body);
84
84
  }
85
85
  function et(t, n) {
86
- t.classList.remove("rte-citations-theme-dark"), Ft(n) && t.classList.add("rte-citations-theme-dark");
86
+ t.classList.remove("rte-citations-theme-dark"), _t(n) && t.classList.add("rte-citations-theme-dark");
87
87
  }
88
88
  function h(t, n = !0) {
89
89
  if ((t == null ? void 0 : t.contentElement) instanceof HTMLElement) return t.contentElement;
@@ -113,7 +113,7 @@ function j(t) {
113
113
  const n = vt(t);
114
114
  return n ? !!(n.closest(G) || n.closest(V)) : !1;
115
115
  }
116
- function _t(t, n) {
116
+ function qt(t, n) {
117
117
  if (st += 1, n.generateCitationId) {
118
118
  const e = n.generateCitationId({ editor: t, index: st }), i = _(n.normalizeText(e || ""));
119
119
  if (i) return i;
@@ -123,7 +123,7 @@ function _t(t, n) {
123
123
  function ct(t) {
124
124
  return t.map((n) => (n || "").trim()).filter(Boolean).join(" ").trim();
125
125
  }
126
- function qt(t, n) {
126
+ function Kt(t, n) {
127
127
  const e = t.author || "Unknown", i = t.year || "n.d.";
128
128
  return n === "mla" ? `(${e} ${i})` : n === "chicago" ? `(${e} ${i})` : `(${e}, ${i})`;
129
129
  }
@@ -161,7 +161,7 @@ function Et(t, n) {
161
161
  };
162
162
  }
163
163
  function St(t, n, e) {
164
- t.classList.add("rte-citation-ref"), t.setAttribute("data-citation-id", n.id), t.setAttribute("data-citation-author", n.author || ""), t.setAttribute("data-citation-year", n.year || ""), t.setAttribute("data-citation-title", n.title || ""), t.setAttribute("data-citation-source", n.source || ""), t.setAttribute("data-citation-url", n.url || ""), t.setAttribute("data-citation-note", n.note || ""), t.setAttribute("contenteditable", "false"), t.setAttribute("tabindex", "0"), t.setAttribute("role", "doc-biblioref"), t.setAttribute("data-style", e), t.textContent = qt(n, e);
164
+ t.classList.add("rte-citation-ref"), t.setAttribute("data-citation-id", n.id), t.setAttribute("data-citation-author", n.author || ""), t.setAttribute("data-citation-year", n.year || ""), t.setAttribute("data-citation-title", n.title || ""), t.setAttribute("data-citation-source", n.source || ""), t.setAttribute("data-citation-url", n.url || ""), t.setAttribute("data-citation-note", n.note || ""), t.setAttribute("contenteditable", "false"), t.setAttribute("tabindex", "0"), t.setAttribute("role", "doc-biblioref"), t.setAttribute("data-style", e), t.textContent = Kt(n, e);
165
165
  }
166
166
  function rt(t, n, e) {
167
167
  const i = ut(t);
@@ -198,7 +198,7 @@ function U(t, n) {
198
198
  });
199
199
  }), Array.from(i.values());
200
200
  }
201
- function Kt(t, n, e) {
201
+ function jt(t, n, e) {
202
202
  const i = wt(n, e);
203
203
  if (!i.id || !i.author || !i.title) return;
204
204
  const r = (H.get(t) || []).filter((a) => a.id !== i.id);
@@ -218,7 +218,7 @@ function $t(t, n, e, i) {
218
218
  const o = _(i.normalizeText(n || ""));
219
219
  return o && at(t, e, i).find((a) => a.id === o) || null;
220
220
  }
221
- function jt(t, n, e) {
221
+ function Ut(t, n, e) {
222
222
  const i = _(e.normalizeText(n || ""));
223
223
  if (!i) return !1;
224
224
  const o = H.get(t) || [], r = o.filter((a) => a.id !== i);
@@ -232,13 +232,13 @@ function At(t, n, e) {
232
232
  const r = document.createElement("ol");
233
233
  return r.className = "rte-citation-list", r.setAttribute("role", "list"), i.appendChild(o), i.appendChild(r), i;
234
234
  }
235
- function Ut(t, n) {
235
+ function Wt(t, n) {
236
236
  let e = t.querySelector(G);
237
237
  e || (e = At("rte-citation-bibliography", "citation-bibliography", n.labels.bibliographyTitle), t.appendChild(e));
238
238
  const i = e.querySelector(".rte-citation-section-title");
239
239
  return i && (i.textContent = n.labels.bibliographyTitle), e.setAttribute("aria-label", n.labels.bibliographyTitle), e;
240
240
  }
241
- function Wt(t, n) {
241
+ function Gt(t, n) {
242
242
  let e = t.querySelector(V);
243
243
  e || (e = At("rte-citation-footnotes", "citation-footnotes", n.labels.footnotesTitle), t.appendChild(e));
244
244
  const i = e.querySelector(".rte-citation-section-title");
@@ -248,12 +248,12 @@ function kt(t, n) {
248
248
  const e = t.querySelector(n);
249
249
  e == null || e.remove();
250
250
  }
251
- function Gt(t, n, e, i) {
251
+ function Vt(t, n, e, i) {
252
252
  if (n.length === 0) {
253
253
  kt(t, G);
254
254
  return;
255
255
  }
256
- const r = Ut(t, e).querySelector(".rte-citation-list");
256
+ const r = Wt(t, e).querySelector(".rte-citation-list");
257
257
  if (!r) return;
258
258
  const a = document.createDocumentFragment();
259
259
  n.forEach((s, d) => {
@@ -261,14 +261,14 @@ function Gt(t, n, e, i) {
261
261
  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(d + 1)), c.textContent = dt(s, i), a.appendChild(c);
262
262
  }), r.innerHTML = "", r.appendChild(a);
263
263
  }
264
- function Vt(t, n, e, i) {
264
+ function Yt(t, n, e, i) {
265
265
  if (!e.enableFootnoteSync || n.length === 0) {
266
266
  kt(t, V), R(t).forEach((l) => {
267
267
  l.removeAttribute("data-footnote-number"), l.removeAttribute("data-footnote-target");
268
268
  });
269
269
  return;
270
270
  }
271
- const r = Wt(t, e).querySelector(".rte-citation-list");
271
+ const r = Gt(t, e).querySelector(".rte-citation-list");
272
272
  if (!r) return;
273
273
  const a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
274
274
  n.forEach((l, u) => {
@@ -293,8 +293,8 @@ function Vt(t, n, e, i) {
293
293
  w.className = "rte-citation-footnote-number", w.textContent = `${u + 1}. `;
294
294
  const A = document.createElement("span");
295
295
  A.className = "rte-citation-footnote-text";
296
- const Ot = l.note ? `${l.note}. ` : "";
297
- A.textContent = `${Ot}${dt(l, i)}`, b.appendChild(w), b.appendChild(A);
296
+ const Pt = l.note ? `${l.note}. ` : "";
297
+ A.textContent = `${Pt}${dt(l, i)}`, b.appendChild(w), b.appendChild(A);
298
298
  const pt = a.get(l.id);
299
299
  if (pt) {
300
300
  const q = document.createElement("a");
@@ -303,11 +303,11 @@ function Vt(t, n, e, i) {
303
303
  c.appendChild(b);
304
304
  }), r.innerHTML = "", r.appendChild(c);
305
305
  }
306
- function Yt(t, n, e, i) {
306
+ function Xt(t, n, e, i) {
307
307
  const o = dt(n, e);
308
308
  t.setAttribute("data-citation-number", String(i)), t.setAttribute("aria-label", `Citation ${i}: ${o}`);
309
309
  }
310
- function Xt(t, n, e) {
310
+ function Jt(t, n, e) {
311
311
  const i = R(t);
312
312
  let o = `${n}:${e ? "1" : "0"}:${i.length}`;
313
313
  return i.forEach((r) => {
@@ -324,7 +324,7 @@ function F(t) {
324
324
  const c = o.length;
325
325
  a.textContent = `${e.labels.summaryPrefix}: ${c} | Style: ${i.toUpperCase()} | Footnotes: ${e.enableFootnoteSync ? "On" : "Off"}`;
326
326
  }
327
- if (s && (s.textContent = `${e.labels.styleButtonPrefix}: ${i.toUpperCase()}`, s.setAttribute("aria-label", `${e.labels.styleButtonPrefix}: ${i.toUpperCase()}`)), d) {
327
+ if (It(t, n, e), s && (s.textContent = `${e.labels.styleButtonPrefix}: ${i.toUpperCase()}`, s.setAttribute("aria-label", `${e.labels.styleButtonPrefix}: ${i.toUpperCase()}`)), d) {
328
328
  if (r.length === 0) {
329
329
  d.innerHTML = `<li class="rte-citations-empty">${g(e.labels.noCitationsText)}</li>`;
330
330
  return;
@@ -357,7 +357,7 @@ function F(t) {
357
357
  }
358
358
  }
359
359
  function y(t, n, e = !1) {
360
- const i = z(t, n), o = Xt(t, i, n.enableFootnoteSync);
360
+ const i = z(t, n), o = Jt(t, i, n.enableFootnoteSync);
361
361
  if (!e && xt.get(t) === o)
362
362
  return U(t, n);
363
363
  const r = R(t), a = /* @__PURE__ */ new Map();
@@ -375,8 +375,8 @@ function y(t, n, e = !1) {
375
375
  if (!u) return;
376
376
  St(c, u, i);
377
377
  const b = d.get(u.id) || 1;
378
- Yt(c, u, i, Math.max(1, b));
379
- }), Gt(t, s, n, i), Vt(t, s, n, i), xt.set(t, o), F(t), t.dispatchEvent(
378
+ Xt(c, u, i, Math.max(1, b));
379
+ }), Vt(t, s, n, i), Yt(t, s, n, i), xt.set(t, o), F(t), t.dispatchEvent(
380
380
  new CustomEvent("editora:citations-refreshed", {
381
381
  bubbles: !0,
382
382
  detail: {
@@ -400,7 +400,7 @@ function Mt(t) {
400
400
  }, n.debounceMs);
401
401
  K.add(e), tt.set(t, e);
402
402
  }
403
- function Jt(t) {
403
+ function Zt(t) {
404
404
  const n = window.getSelection();
405
405
  if (!n) throw new Error("Selection unavailable");
406
406
  if (n.rangeCount > 0) {
@@ -491,7 +491,7 @@ function D(t, n, e) {
491
491
  const s = t.nextSibling;
492
492
  return s instanceof Text && (s.data === " " ? s.remove() : s.data.startsWith(" ") && (s.data = s.data.slice(1))), t.remove(), Lt(o, a), y(i, e, !0), bt(i, r), ft(i), n === "Delete" && i.focus({ preventScroll: !0 }), !0;
493
493
  }
494
- function Zt(t, n, e) {
494
+ function Qt(t, n, e) {
495
495
  if (t.key !== "Backspace" && t.key !== "Delete") return !1;
496
496
  const i = t.key, o = t.target;
497
497
  if (o != null && o.matches(it) && n.contains(o) && !j(o))
@@ -519,7 +519,7 @@ function Nt(t, n, e) {
519
519
  s instanceof Text && (s.data === " " ? s.remove() : s.data.startsWith(" ") && (s.data = s.data.slice(1))), a.remove();
520
520
  }), Lt(t, t.childNodes.length), y(t, e, !0), bt(t, r), ft(t), t.focus({ preventScroll: !0 }), !0;
521
521
  }
522
- function Qt(t, n) {
522
+ function te(t, n) {
523
523
  const e = window.getSelection();
524
524
  if (!e || e.rangeCount === 0) return !1;
525
525
  const i = e.getRangeAt(0);
@@ -534,11 +534,11 @@ function nt(t, n, e) {
534
534
  var l, u;
535
535
  const i = wt(n, e);
536
536
  if (!i.author || !i.title) return !1;
537
- i.id || (i.id = _t(t, e));
537
+ i.id || (i.id = qt(t, e));
538
538
  const o = t.innerHTML;
539
539
  let r;
540
540
  try {
541
- r = Jt(t);
541
+ r = Zt(t);
542
542
  } catch (b) {
543
543
  return !1;
544
544
  }
@@ -560,9 +560,9 @@ function nt(t, n, e) {
560
560
  c.setStart(d.parentNode, Math.max(0, b));
561
561
  } else
562
562
  c.setStartAfter(s);
563
- return c.collapse(!0), a.removeAllRanges(), a.addRange(c), Kt(t, i, e), y(t, e, !0), bt(t, o), ft(t), !0;
563
+ return c.collapse(!0), a.removeAllRanges(), a.addRange(c), jt(t, i, e), y(t, e, !0), bt(t, o), ft(t), !0;
564
564
  }
565
- function te(t, n) {
565
+ function ee(t, n) {
566
566
  if (!n) return !1;
567
567
  const e = R(t).find((r) => r.getAttribute("data-citation-id") === n) || null;
568
568
  if (!e) return !1;
@@ -579,7 +579,7 @@ function W(t, n = !1) {
579
579
  const e = v.get(t);
580
580
  e && (e.classList.remove("show"), Y.set(t, !1), rt(t, "toggleCitationsPanel", !1), n && t.focus({ preventScroll: !0 }));
581
581
  }
582
- function ee(t) {
582
+ function ne(t) {
583
583
  v.forEach((n, e) => {
584
584
  e !== t && W(e, !1);
585
585
  });
@@ -592,7 +592,7 @@ function lt(t, n) {
592
592
  function C(t, n) {
593
593
  return t.querySelector(`[data-field="${n}"]`);
594
594
  }
595
- function ne(t) {
595
+ function oe(t) {
596
596
  var s, d, c, l, u, b;
597
597
  const n = ((s = C(t, "author")) == null ? void 0 : s.value) || "", e = ((d = C(t, "year")) == null ? void 0 : d.value) || "", i = ((c = C(t, "title")) == null ? void 0 : c.value) || "", o = ((l = C(t, "source")) == null ? void 0 : l.value) || "", r = ((u = C(t, "url")) == null ? void 0 : u.value) || "", a = ((b = C(t, "note")) == null ? void 0 : b.value) || "";
598
598
  return {
@@ -610,11 +610,11 @@ function E(t, n, e = !1) {
610
610
  const o = t.querySelector(".rte-citations-status");
611
611
  o && (o.textContent = n, o.classList.toggle("rte-citations-status-error", e));
612
612
  }
613
- function oe(t, n, e) {
613
+ function It(t, n, e) {
614
614
  const i = C(n, "style");
615
615
  i && (i.value = z(t, e));
616
616
  }
617
- function It(t, n, e) {
617
+ function Bt(t, n, e) {
618
618
  const i = L.includes(n) ? n : e.defaultStyle;
619
619
  return T.set(t, i), y(t, e, !0), i;
620
620
  }
@@ -625,7 +625,7 @@ function mt(t, n) {
625
625
  function ie(t) {
626
626
  const n = v.get(t);
627
627
  if (n) return n;
628
- const e = f.get(t) || M || Q(), i = `rte-citations-panel-${Dt++}`, o = document.createElement("section");
628
+ const e = f.get(t) || M || Q(), i = `rte-citations-panel-${Ht++}`, o = document.createElement("section");
629
629
  o.className = m, o.id = i, o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "false"), o.setAttribute("aria-label", e.labels.panelAriaLabel), o.setAttribute("tabindex", "-1"), o.innerHTML = `
630
630
  <header class="rte-citations-header">
631
631
  <h2 class="rte-citations-title">${g(e.labels.panelTitle)}</h2>
@@ -696,7 +696,7 @@ function ie(t) {
696
696
  }
697
697
  if (c === "insert") {
698
698
  if ($(t)) return;
699
- const u = ne(o);
699
+ const u = oe(o);
700
700
  if (!l.normalizeText(u.author) || !l.normalizeText(u.title)) {
701
701
  E(o, l.labels.invalidMessage, !0);
702
702
  return;
@@ -717,7 +717,7 @@ function ie(t) {
717
717
  }
718
718
  if (c === "cycle-style") {
719
719
  const u = mt(t, l);
720
- oe(t, o, l), E(o, `Style changed to ${u.toUpperCase()}.`);
720
+ It(t, o, l), E(o, `Style changed to ${u.toUpperCase()}.`);
721
721
  return;
722
722
  }
723
723
  if (c === "insert-from-recent") {
@@ -734,7 +734,7 @@ function ie(t) {
734
734
  E(o, "Citation deleted.");
735
735
  return;
736
736
  }
737
- jt(t, u, l) && (F(t), E(o, "Removed from recent citations."));
737
+ Ut(t, u, l) && (F(t), E(o, "Removed from recent citations."));
738
738
  }
739
739
  }), o.addEventListener("keydown", (a) => {
740
740
  if (a.key === "Escape") {
@@ -754,16 +754,16 @@ function ie(t) {
754
754
  const r = C(o, "style");
755
755
  return r == null || r.addEventListener("change", () => {
756
756
  const a = f.get(t) || M || e, s = r.value;
757
- It(t, s, a), E(o, `Style changed to ${s.toUpperCase()}.`);
757
+ Bt(t, s, a), E(o, `Style changed to ${s.toUpperCase()}.`);
758
758
  }), et(o, t), document.body.appendChild(o), v.set(t, o), Y.set(t, !1), F(t), o;
759
759
  }
760
760
  function I(t) {
761
761
  const n = ie(t);
762
- ee(t), n.classList.add("show"), Y.set(t, !0), rt(t, "toggleCitationsPanel", !0), et(n, t), lt(t, n), F(t);
762
+ ne(t), n.classList.add("show"), Y.set(t, !0), rt(t, "toggleCitationsPanel", !0), et(n, t), lt(t, n), F(t);
763
763
  const e = C(n, "author");
764
764
  e == null || e.focus();
765
765
  }
766
- function Bt(t, n) {
766
+ function Ot(t, n) {
767
767
  const e = ot(t);
768
768
  return (typeof n == "boolean" ? n : !e) ? I(t) : W(t, !1), !0;
769
769
  }
@@ -801,9 +801,9 @@ function ce(t) {
801
801
  n.preventDefault(), W(o, !0);
802
802
  return;
803
803
  }
804
- if (!i && !Zt(n, o, r)) {
804
+ if (!i && !Qt(n, o, r)) {
805
805
  if (re(n)) {
806
- n.preventDefault(), n.stopPropagation(), Bt(o);
806
+ n.preventDefault(), n.stopPropagation(), Ot(o);
807
807
  return;
808
808
  }
809
809
  if (ae(n)) {
@@ -1369,7 +1369,7 @@ const de = (t = {}) => {
1369
1369
  if (!o || $(o)) return !1;
1370
1370
  const r = f.get(o) || n;
1371
1371
  f.set(o, r), p = o;
1372
- const a = Bt(o, typeof e == "boolean" ? e : void 0);
1372
+ const a = Ot(o, typeof e == "boolean" ? e : void 0);
1373
1373
  return ot(o) && y(o, r, !1), a;
1374
1374
  },
1375
1375
  insertCitation: (e, i) => {
@@ -1390,7 +1390,7 @@ const de = (t = {}) => {
1390
1390
  const o = h(i);
1391
1391
  if (!o || !e) return !1;
1392
1392
  const r = f.get(o) || n;
1393
- return f.set(o, r), p = o, It(o, e, r), !0;
1393
+ return f.set(o, r), p = o, Bt(o, e, r), !0;
1394
1394
  },
1395
1395
  cycleCitationStyle: (e, i) => {
1396
1396
  const o = h(i);
@@ -1434,13 +1434,13 @@ const de = (t = {}) => {
1434
1434
  },
1435
1435
  locateCitation: (e, i) => {
1436
1436
  const o = h(i);
1437
- return !o || typeof e != "string" ? !1 : te(o, e);
1437
+ return !o || typeof e != "string" ? !1 : ee(o, e);
1438
1438
  },
1439
1439
  deleteCitation: (e, i) => {
1440
1440
  const o = h(i);
1441
1441
  if (!o || $(o)) return !1;
1442
1442
  const r = f.get(o) || n;
1443
- return f.set(o, r), typeof e == "string" && e.trim() ? Nt(o, e, r) : Qt(o, r);
1443
+ return f.set(o, r), typeof e == "string" && e.trim() ? Nt(o, e, r) : te(o, r);
1444
1444
  },
1445
1445
  insertRecentCitation: (e, i) => {
1446
1446
  const o = h(i);
@@ -1483,4 +1483,4 @@ const de = (t = {}) => {
1483
1483
  export {
1484
1484
  de as CitationsPlugin
1485
1485
  };
1486
- //# sourceMappingURL=CitationsPlugin.native-C_7wWQ-k.mjs.map
1486
+ //# sourceMappingURL=CitationsPlugin.native-BFChgCSV.mjs.map