@editora/core 1.0.15 → 1.0.16

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 (68) hide show
  1. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-DIKuCeFw.mjs} +82 -79
  2. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-DXZdK3zr.mjs} +72 -71
  3. package/dist/{ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs → ApprovalWorkflowPlugin.native-ZsS_2xmn.mjs} +239 -238
  4. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-H3XyYD7_.mjs} +2 -2
  5. package/dist/{BlocksLibraryPlugin.native-5sdsXsiE.mjs → BlocksLibraryPlugin.native-CownM6Rk.mjs} +140 -116
  6. package/dist/{CapitalizationPlugin.native-DLV4oPmB.mjs → CapitalizationPlugin.native-C-HRbXGh.mjs} +10 -5
  7. package/dist/{ChecklistPlugin.native-BS-kMz9O.mjs → ChecklistPlugin.native-NVrBUkaL.mjs} +141 -103
  8. package/dist/{CitationsPlugin.native-DQgoCd1B.mjs → CitationsPlugin.native-C_7wWQ-k.mjs} +441 -422
  9. package/dist/{ClearFormattingPlugin.native-B6ro3a1h.mjs → ClearFormattingPlugin.native-Pp0O-SBf.mjs} +24 -23
  10. package/dist/{CodePlugin.native-knhM8NNo.mjs → CodePlugin.native-BH-K4xmW.mjs} +474 -342
  11. package/dist/CodePlugin.native-hNgfXlfS.mjs +4767 -0
  12. package/dist/CodeSamplePlugin.native-svbAFWh_.mjs +501 -0
  13. package/dist/CollaborationPlugin.native-oSybCGPW.mjs +7468 -0
  14. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-CLip9wAO.mjs} +233 -185
  15. package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-Bf7XgRSW.mjs} +401 -351
  16. package/dist/{DataBindingPlugin.native-BoXwghTz.mjs → DataBindingPlugin.native-B7lpI_0c.mjs} +29 -28
  17. package/dist/{DocumentManagerPlugin.native-D1YHQ2NN.mjs → DocumentManagerPlugin.native-iFip6s4Q.mjs} +94 -45
  18. package/dist/{EmbedIframePlugin.native-BF_-LjTq.mjs → EmbedIframePlugin.native-BfZ_HGlV.mjs} +231 -186
  19. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-D92aaOKi.mjs} +288 -76
  20. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-M3cNQ0KA.mjs} +57 -50
  21. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-DsLrH8eq.mjs} +41 -34
  22. package/dist/{FormatPainterPlugin.native-CsMrKfFU.mjs → FormatPainterPlugin.native-BhjzsiVq.mjs} +3 -2
  23. package/dist/{HistoryPlugin.native-D2wl32jV.mjs → HistoryPlugin.native-DPvhks6h.mjs} +36 -32
  24. package/dist/LinkPlugin.native-BsQXYsK6.mjs +352 -0
  25. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-Bt0LANbO.mjs} +68 -35
  26. package/dist/{MathPlugin.native-NwWPHVmj.mjs → MathPlugin.native-Byo3WL0f.mjs} +211 -115
  27. package/dist/{MediaManagerPlugin.native-eOsTJFpw.mjs → MediaManagerPlugin.native-BT1NZIJS.mjs} +139 -134
  28. package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-S_lwGZQO.mjs} +23 -18
  29. package/dist/{MergeTagPlugin.native-BzRVoD9-.mjs → MergeTagPlugin.native-7-6F3S1Y.mjs} +44 -43
  30. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-CiR51jql.mjs} +31 -28
  31. package/dist/{SlashCommandsPlugin.native-BiN6ODw5.mjs → SlashCommandsPlugin.native-BDIIwGNs.mjs} +90 -79
  32. package/dist/{SmartPastePlugin.native-CZAEHkyt.mjs → SmartPastePlugin.native-BATLCds5.mjs} +89 -85
  33. package/dist/{SpecialCharactersPlugin.native-DaG4b19I.mjs → SpecialCharactersPlugin.native-CdZoc1GB.mjs} +73 -26
  34. package/dist/SpellCheckPlugin.native-Bef2oTLB.mjs +10935 -0
  35. package/dist/TablePlugin.native-BjIxYZ2X.mjs +772 -0
  36. package/dist/{TemplatePlugin.native-DLjFUaPW.mjs → TemplatePlugin.native-D6n5RUnC.mjs} +288 -262
  37. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-KMZ2uzlq.mjs} +2 -2
  38. package/dist/{TranslationWorkflowPlugin.native-DdF16tgT.mjs → TranslationWorkflowPlugin.native-CZtG--06.mjs} +67 -65
  39. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-Ca1fMWUJ.mjs} +42 -42
  40. package/dist/anchoredPopover-DJFD2oAP.mjs +116 -0
  41. package/dist/core.css +1 -1
  42. package/dist/dialogHelpers-DBf7WqYH.mjs +40 -0
  43. package/dist/editora.min.js +26 -24
  44. package/dist/editora.umd.js +26 -24
  45. package/dist/escapeHtml-CX8RelZ1.mjs +7 -0
  46. package/dist/historyHelpers-B0-4mq1E.mjs +15 -0
  47. package/dist/index-B1_vtXRz.mjs +3910 -0
  48. package/dist/index-C6BoNR2t.js +12 -0
  49. package/dist/index.cjs.js +3 -3
  50. package/dist/index.esm.js +17 -14
  51. package/dist/plugin-loader.js +53 -52
  52. package/dist/webcomponent-core.js +2039 -473
  53. package/dist/webcomponent-core.min.css +1 -1
  54. package/dist/webcomponent-core.min.js +96 -66
  55. package/dist/webcomponent.cjs.js +1 -1
  56. package/dist/webcomponent.esm.js +1 -1
  57. package/dist/webcomponent.js +2208 -641
  58. package/dist/webcomponent.min.css +1 -1
  59. package/dist/webcomponent.min.js +1564 -1198
  60. package/index.d.ts +32 -0
  61. package/package.json +10 -3
  62. package/dist/CodeSamplePlugin.native-CgGoH-X4.mjs +0 -384
  63. package/dist/LinkPlugin.native-DYCIcdTm.mjs +0 -283
  64. package/dist/SpellCheckPlugin.native-BZB9AewP.mjs +0 -1039
  65. package/dist/TablePlugin.native-DrHX-efe.mjs +0 -495
  66. package/dist/anchoredPopover-Bxds0VoB.mjs +0 -110
  67. package/dist/index-BLm1MtzH.js +0 -10
  68. package/dist/index-Cd9jEuZP.mjs +0 -2341
@@ -1,4 +1,4 @@
1
- import { a as v, b as w } from "./anchoredPopover-Bxds0VoB.mjs";
1
+ import { a as v, b as w } from "./anchoredPopover-DJFD2oAP.mjs";
2
2
  let l = null, d = null, x = null, i = "#000000";
3
3
  const u = '[data-theme="dark"], .dark, .editora-theme-dark', C = [
4
4
  "#000000",
@@ -526,4 +526,4 @@ const M = () => ({
526
526
  export {
527
527
  M as TextColorPlugin
528
528
  };
529
- //# sourceMappingURL=TextColorPlugin.native-Bwl_bSmc.mjs.map
529
+ //# sourceMappingURL=TextColorPlugin.native-KMZ2uzlq.mjs.map
@@ -1,4 +1,4 @@
1
- const S = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ve = "__editoraCommandEditorRoot", $e = "rte-translation-workflow-styles", d = "rte-translation-workflow-panel", y = "translation-workflow", $ = "translationWorkflow", k = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', Ee = [
1
+ const y = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ve = "__editoraCommandEditorRoot", $e = "rte-translation-workflow-styles", d = "rte-translation-workflow-panel", S = "translation-workflow", $ = "translationWorkflow", k = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', Ee = [
2
2
  "p",
3
3
  "h1",
4
4
  "h2",
@@ -217,8 +217,8 @@ function we(e) {
217
217
  }
218
218
  function U(e) {
219
219
  if (!e) return null;
220
- if (e.matches(S)) return e;
221
- const n = e.querySelector(S);
220
+ if (e.matches(y)) return e;
221
+ const n = e.querySelector(y);
222
222
  return n instanceof HTMLElement ? n : null;
223
223
  }
224
224
  function Ze() {
@@ -233,7 +233,7 @@ function Ze() {
233
233
  const a = U(t);
234
234
  if (a) return a;
235
235
  }
236
- const r = e.closest(S);
236
+ const r = e.closest(y);
237
237
  return r instanceof HTMLElement ? r : null;
238
238
  }
239
239
  function Je(e) {
@@ -272,7 +272,7 @@ function Xe(e) {
272
272
  const i = l.removedNodes[s];
273
273
  if (i.nodeType !== Node.ELEMENT_NODE) continue;
274
274
  const c = i;
275
- if ((n = c.matches) != null && n.call(c, S) || (t = c.matches) != null && t.call(c, `.${d}`) || (r = c.querySelector) != null && r.call(c, S) || (a = c.querySelector) != null && a.call(c, `.${d}`))
275
+ if ((n = c.matches) != null && n.call(c, y) || (t = c.matches) != null && t.call(c, `.${d}`) || (r = c.querySelector) != null && r.call(c, y) || (a = c.querySelector) != null && a.call(c, `.${d}`))
276
276
  return !0;
277
277
  }
278
278
  }
@@ -280,7 +280,7 @@ function Xe(e) {
280
280
  }
281
281
  function le() {
282
282
  Array.from(Z).forEach((n) => {
283
- n.isConnected || Se(n);
283
+ n.isConnected || ye(n);
284
284
  });
285
285
  }
286
286
  function T(e, n = !0, t = !0) {
@@ -295,20 +295,20 @@ function T(e, n = !0, t = !0) {
295
295
  const a = window.getSelection();
296
296
  if (a && a.rangeCount > 0) {
297
297
  const i = (s = He(a.getRangeAt(0).startContainer)) == null ? void 0 : s.closest(
298
- S
298
+ y
299
299
  );
300
300
  if (i) return i;
301
301
  }
302
302
  const o = document.activeElement;
303
303
  if (o) {
304
- if (o.matches(S)) return o;
305
- const i = o.closest(S);
304
+ if (o.matches(y)) return o;
305
+ const i = o.closest(y);
306
306
  if (i) return i;
307
307
  }
308
308
  if (t && x && x.isConnected)
309
309
  return x;
310
310
  if (!n) return null;
311
- const l = document.querySelector(S);
311
+ const l = document.querySelector(y);
312
312
  return l instanceof HTMLElement ? l : null;
313
313
  }
314
314
  function et(e) {
@@ -319,7 +319,7 @@ function et(e) {
319
319
  const o = Array.from(h.entries()).find(([, l]) => l === r);
320
320
  if (o) return o[0];
321
321
  }
322
- const a = n.closest(S);
322
+ const a = n.closest(y);
323
323
  if (a) return a;
324
324
  }
325
325
  const t = document.activeElement;
@@ -329,7 +329,7 @@ function et(e) {
329
329
  const o = Array.from(h.entries()).find(([, l]) => l === r);
330
330
  if (o) return o[0];
331
331
  }
332
- const a = t.closest(S);
332
+ const a = t.closest(y);
333
333
  if (a) return a;
334
334
  }
335
335
  return null;
@@ -361,6 +361,9 @@ function tt(e, n) {
361
361
  preserveTokens: !0
362
362
  };
363
363
  }
364
+ function nt(e) {
365
+ return e.getAttribute("contenteditable") === "false" || e.getAttribute("data-readonly") === "true";
366
+ }
364
367
  function ne(e, n, t, r = {}) {
365
368
  return Re += 1, {
366
369
  id: `translation-workflow-issue-${Re}`,
@@ -378,11 +381,9 @@ function ce(e, n) {
378
381
  ), e.setAttribute("data-translation-locked", "true"), e.setAttribute("contenteditable", "false"), e.setAttribute("aria-readonly", "true"), e.classList.add("rte-translation-segment-locked");
379
382
  return;
380
383
  }
381
- if (e.removeAttribute("data-translation-locked"), e.removeAttribute("aria-readonly"), e.classList.remove("rte-translation-segment-locked"), e.hasAttribute("data-translation-prev-contenteditable")) {
382
- const t = e.getAttribute("data-translation-prev-contenteditable") || "";
383
- t === "inherit" ? e.setAttribute("contenteditable", "true") : e.setAttribute("contenteditable", t), e.removeAttribute("data-translation-prev-contenteditable");
384
- } else
385
- e.setAttribute("contenteditable", "true");
384
+ e.removeAttribute("data-translation-locked"), e.removeAttribute("aria-readonly"), e.classList.remove("rte-translation-segment-locked");
385
+ const t = e.getAttribute("data-translation-prev-contenteditable");
386
+ e.removeAttribute("data-translation-prev-contenteditable"), t === null || t === "inherit" || t === "" ? e.removeAttribute("contenteditable") : e.setAttribute("contenteditable", t);
386
387
  }
387
388
  function ue(e, n) {
388
389
  return e.querySelector(`[data-translation-segment-id="${Ve(n)}"]`);
@@ -393,7 +394,7 @@ function qe(e) {
393
394
  const t = He(n.getRangeAt(0).startContainer);
394
395
  return !t || !e.contains(t) ? null : t.closest("[data-translation-segment-id]");
395
396
  }
396
- function nt(e, n) {
397
+ function rt(e, n) {
397
398
  const t = Array.from(e.querySelectorAll(n));
398
399
  if (t.length <= 1) return t;
399
400
  const r = new Set(t);
@@ -407,7 +408,7 @@ function nt(e, n) {
407
408
  return !0;
408
409
  });
409
410
  }
410
- function rt(e, n, t) {
411
+ function ot(e, n, t) {
411
412
  let r = (t || "").trim();
412
413
  if (!r || n.has(r)) {
413
414
  do
@@ -434,9 +435,9 @@ function me(e, n) {
434
435
  }
435
436
  function M(e, n, t) {
436
437
  var l;
437
- const r = nt(e, n.segmentSelector), a = [], o = /* @__PURE__ */ new Set();
438
+ const r = rt(e, n.segmentSelector), a = [], o = /* @__PURE__ */ new Set();
438
439
  for (let s = 0; s < r.length && !(a.length >= n.maxSegments); s += 1) {
439
- const i = r[s], c = rt(i, o, i.getAttribute("data-translation-segment-id")), g = t.lockedSegmentIds.has(c), p = i.getAttribute("data-translation-locked") === "true", v = g || p;
440
+ const i = r[s], c = ot(i, o, i.getAttribute("data-translation-segment-id")), g = t.lockedSegmentIds.has(c), p = i.getAttribute("data-translation-locked") === "true", v = g || p;
440
441
  if (v)
441
442
  if (t.lockedSegmentIds.add(c), ce(i, !0), !t.lockedHtmlBySegmentId.has(c))
442
443
  t.lockedHtmlBySegmentId.set(c, i.innerHTML);
@@ -484,7 +485,7 @@ function b(e, n) {
484
485
  lastRunAt: null
485
486
  }, D.set(e, t)), Z.add(e), t;
486
487
  }
487
- function Se(e) {
488
+ function ye(e) {
488
489
  xe(e);
489
490
  const n = h.get(e);
490
491
  n && n.remove(), h.delete(e), Y.delete(e);
@@ -494,7 +495,7 @@ function Se(e) {
494
495
  a && ce(a, !1);
495
496
  }), t.lockedHtmlBySegmentId.clear()), u.delete(e), oe.delete(e), D.delete(e), Z.delete(e), x === e && (x = null);
496
497
  }
497
- function ye(e) {
498
+ function Se(e) {
498
499
  return Y.get(e) === !0;
499
500
  }
500
501
  function be(e, n) {
@@ -506,10 +507,10 @@ function P(e, n) {
506
507
  const t = e.querySelector(".rte-translation-live");
507
508
  t && (t.textContent = n);
508
509
  }
509
- function ot(e, n) {
510
+ function at(e, n) {
510
511
  return `${e.innerHTML}::${n.sourceLocale}::${n.targetLocale}::${Array.from(n.lockedSegmentIds).sort().join("|")}`;
511
512
  }
512
- function at(e, n, t) {
513
+ function lt(e, n, t) {
513
514
  const r = [], a = tt(t, n.targetLocale);
514
515
  for (let o = 0; o < e.length && !(r.length >= t.maxIssues); o += 1) {
515
516
  const l = e[o], s = t.normalizeText(l.sourceText || ""), i = t.normalizeText(l.text || "");
@@ -577,9 +578,9 @@ function Be(e) {
577
578
  }
578
579
  function E(e) {
579
580
  const n = D.get(e), t = n && n.selectedSegmentId ? n.segments.find((r) => r.id === n.selectedSegmentId) : null;
580
- fe(e, "toggleTranslationWorkflowPanel", ye(e)), fe(e, "toggleTranslationRealtime", (n == null ? void 0 : n.realtimeEnabled) === !0), fe(e, "toggleTranslationSegmentLock", (t == null ? void 0 : t.locked) === !0);
581
+ fe(e, "toggleTranslationWorkflowPanel", Se(e)), fe(e, "toggleTranslationRealtime", (n == null ? void 0 : n.realtimeEnabled) === !0), fe(e, "toggleTranslationSegmentLock", (t == null ? void 0 : t.locked) === !0);
581
582
  }
582
- function lt(e, n) {
583
+ function st(e, n) {
583
584
  const t = ue(e, n);
584
585
  if (!t) return;
585
586
  try {
@@ -671,10 +672,10 @@ function L(e, n, t) {
671
672
  if (!r) return [];
672
673
  const a = b(e, r), o = me(e, a);
673
674
  a.segments = M(e, r, a);
674
- const l = ot(e, a);
675
+ const l = at(e, a);
675
676
  if (!t && a.snapshot === l)
676
677
  return a.issues;
677
- a.issues = at(a.segments, a, r), a.lastRunAt = (/* @__PURE__ */ new Date()).toISOString(), a.snapshot = l, R(e), E(e), e.dispatchEvent(
678
+ a.issues = lt(a.segments, a, r), a.lastRunAt = (/* @__PURE__ */ new Date()).toISOString(), a.snapshot = l, R(e), E(e), e.dispatchEvent(
678
679
  new CustomEvent("editora:translation-workflow-validation", {
679
680
  bubbles: !0,
680
681
  detail: {
@@ -714,6 +715,7 @@ function De(e) {
714
715
  }
715
716
  function ie(e, n, t) {
716
717
  var c, g;
718
+ if (nt(e)) return !1;
717
719
  const r = u.get(e) || w;
718
720
  if (!r) return !1;
719
721
  const a = b(e, r);
@@ -743,7 +745,7 @@ function pe(e, n, t = !0) {
743
745
  const r = u.get(e) || w;
744
746
  if (!r) return !1;
745
747
  const a = b(e, r);
746
- return a.segments = M(e, r, a), a.segments.some((o) => o.id === n) ? (a.selectedSegmentId = n, R(e), E(e), t && lt(e, n), !0) : !1;
748
+ return a.segments = M(e, r, a), a.segments.some((o) => o.id === n) ? (a.selectedSegmentId = n, R(e), E(e), t && st(e, n), !0) : !1;
747
749
  }
748
750
  function re(e, n) {
749
751
  const t = u.get(e) || w;
@@ -764,7 +766,7 @@ function G(e, n = !1) {
764
766
  t && (t.classList.remove("show"), Y.set(e, !1), E(e), n && e.focus({ preventScroll: !0 }));
765
767
  }
766
768
  function he(e) {
767
- const n = dt(e);
769
+ const n = ft(e);
768
770
  h.forEach((r, a) => {
769
771
  a !== e && G(a, !1);
770
772
  }), n.classList.add("show"), Y.set(e, !0), L(e, "panel-open", !1), R(e), be(e, n), E(e);
@@ -772,31 +774,31 @@ function he(e) {
772
774
  t == null || t.focus();
773
775
  }
774
776
  function Ne(e, n) {
775
- const t = ye(e);
777
+ const t = Se(e);
776
778
  return (typeof n == "boolean" ? n : !t) ? he(e) : G(e, !1), !0;
777
779
  }
778
780
  function Le(e) {
779
781
  return typeof e.key == "string" ? e.key.toLowerCase() : "";
780
782
  }
781
- function st(e) {
783
+ function it(e) {
782
784
  const n = Le(e);
783
785
  return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && n === "l";
784
786
  }
785
- function it(e) {
787
+ function ct(e) {
786
788
  const n = Le(e);
787
789
  return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && n === "v";
788
790
  }
789
- function ct(e) {
791
+ function ut(e) {
790
792
  const n = Le(e);
791
793
  return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && n === "k";
792
794
  }
793
- function ut(e) {
795
+ function dt(e) {
794
796
  return e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey ? !0 : e.key === "Backspace" || e.key === "Delete" || e.key === "Enter";
795
797
  }
796
798
  function Me(e) {
797
799
  return e instanceof HTMLElement ? e.closest('[data-translation-locked="true"]') : null;
798
800
  }
799
- function dt(e) {
801
+ function ft(e) {
800
802
  const n = h.get(e);
801
803
  if (n) return n;
802
804
  const t = u.get(e) || w || ae();
@@ -916,11 +918,11 @@ function dt(e) {
916
918
  !(i != null && i.closest(".rte-translation-segments")) || !Ce.has(s.key) || (s.preventDefault(), s.key === "ArrowUp" ? re(e, -1) : s.key === "ArrowDown" ? re(e, 1) : s.key === "Home" ? re(e, "start") : s.key === "End" && re(e, "end"));
917
919
  }), ge(l, e), document.body.appendChild(l), h.set(e, l), Y.set(e, !1), R(e), l;
918
920
  }
919
- function ft(e) {
921
+ function gt(e) {
920
922
  w = e, N || (N = (n) => {
921
923
  var i;
922
924
  le();
923
- const t = n.target, r = t == null ? void 0 : t.closest(S);
925
+ const t = n.target, r = t == null ? void 0 : t.closest(y);
924
926
  if (!r) return;
925
927
  const a = u.get(r) || e, o = b(r, a);
926
928
  u.set(r, a), x = r;
@@ -929,7 +931,7 @@ function ft(e) {
929
931
  const s = h.get(r);
930
932
  s && (ge(s, r), be(r, s), R(r));
931
933
  }, document.addEventListener("focusin", N, !0)), O || (O = (n) => {
932
- const t = n.target, r = t == null ? void 0 : t.closest(S);
934
+ const t = n.target, r = t == null ? void 0 : t.closest(y);
933
935
  if (!r) return;
934
936
  const a = u.get(r) || w;
935
937
  if (!a) return;
@@ -944,7 +946,7 @@ function ft(e) {
944
946
  }
945
947
  Pe(r);
946
948
  }, document.addEventListener("input", O, !0)), _ || (_ = (n) => {
947
- const t = n, r = t.target, a = r == null ? void 0 : r.closest(S);
949
+ const t = n, r = t.target, a = r == null ? void 0 : r.closest(y);
948
950
  if (!a) return;
949
951
  const o = Me(r);
950
952
  if (!o || !a.contains(o)) return;
@@ -955,17 +957,17 @@ function ft(e) {
955
957
  if (n.defaultPrevented) return;
956
958
  const t = n.target;
957
959
  if ((t == null ? void 0 : t.closest(`.${d}`)) && n.key !== "Escape" && !Ce.has(n.key)) return;
958
- const a = n.key === "Escape", o = st(n), l = it(n), s = ct(n), i = Me(t);
960
+ const a = n.key === "Escape", o = it(n), l = ct(n), s = ut(n), i = Me(t);
959
961
  if (!a && !o && !l && !s && !i)
960
962
  return;
961
963
  const c = et(n);
962
964
  if (!c) return;
963
965
  const g = u.get(c) || w || e;
964
- if (b(c, g), u.set(c, g), x = c, a && ye(c)) {
966
+ if (b(c, g), u.set(c, g), x = c, a && Se(c)) {
965
967
  n.preventDefault(), G(c, !0);
966
968
  return;
967
969
  }
968
- if (i && c.contains(i) && ut(n)) {
970
+ if (i && c.contains(i) && dt(n)) {
969
971
  n.preventDefault();
970
972
  const p = h.get(c);
971
973
  p && P(p, g.labels.readonlySegmentMessage);
@@ -998,15 +1000,15 @@ function ft(e) {
998
1000
  characterData: !0
999
1001
  }));
1000
1002
  }
1001
- function gt() {
1002
- N && (document.removeEventListener("focusin", N, !0), N = null), O && (document.removeEventListener("input", O, !0), O = null), _ && (document.removeEventListener("beforeinput", _, !0), _ = null), F && (document.removeEventListener("keydown", F, !0), F = null), I && (window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I), I = null), W && (W.disconnect(), W = null), h.forEach((n) => n.remove()), h.clear(), Array.from(Z).forEach((n) => Se(n)), w = null, x = null;
1003
- }
1004
1003
  function mt() {
1004
+ N && (document.removeEventListener("focusin", N, !0), N = null), O && (document.removeEventListener("input", O, !0), O = null), _ && (document.removeEventListener("beforeinput", _, !0), _ = null), F && (document.removeEventListener("keydown", F, !0), F = null), I && (window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I), I = null), W && (W.disconnect(), W = null), h.forEach((n) => n.remove()), h.clear(), Array.from(Z).forEach((n) => ye(n)), w = null, x = null;
1005
+ }
1006
+ function bt() {
1005
1007
  if (typeof document == "undefined" || document.getElementById($e)) return;
1006
1008
  const e = document.createElement("style");
1007
1009
  e.id = $e, e.textContent = `
1008
- .rte-toolbar-group-items.${y},
1009
- .editora-toolbar-group-items.${y},
1010
+ .rte-toolbar-group-items.${S},
1011
+ .editora-toolbar-group-items.${S},
1010
1012
  .rte-toolbar-group-items.${$},
1011
1013
  .editora-toolbar-group-items.${$} {
1012
1014
  display: flex;
@@ -1015,8 +1017,8 @@ function mt() {
1015
1017
  background: #ffffff;
1016
1018
  }
1017
1019
 
1018
- .rte-toolbar-group-items.${y} .rte-toolbar-button,
1019
- .editora-toolbar-group-items.${y} .editora-toolbar-button,
1020
+ .rte-toolbar-group-items.${S} .rte-toolbar-button,
1021
+ .editora-toolbar-group-items.${S} .editora-toolbar-button,
1020
1022
  .rte-toolbar-group-items.${$} .rte-toolbar-button,
1021
1023
  .editora-toolbar-group-items.${$} .editora-toolbar-button {
1022
1024
  border: none;
@@ -1024,15 +1026,15 @@ function mt() {
1024
1026
  border-radius: 0;
1025
1027
  }
1026
1028
 
1027
- .rte-toolbar-group-items.${y} .rte-toolbar-item:last-child .rte-toolbar-button,
1028
- .editora-toolbar-group-items.${y} .editora-toolbar-item:last-child .editora-toolbar-button,
1029
+ .rte-toolbar-group-items.${S} .rte-toolbar-item:last-child .rte-toolbar-button,
1030
+ .editora-toolbar-group-items.${S} .editora-toolbar-item:last-child .editora-toolbar-button,
1029
1031
  .rte-toolbar-group-items.${$} .rte-toolbar-item:last-child .rte-toolbar-button,
1030
1032
  .editora-toolbar-group-items.${$} .editora-toolbar-item:last-child .editora-toolbar-button {
1031
1033
  border-right: none;
1032
1034
  }
1033
1035
 
1034
- ${k} .rte-toolbar-group-items.${y},
1035
- ${k} .editora-toolbar-group-items.${y},
1036
+ ${k} .rte-toolbar-group-items.${S},
1037
+ ${k} .editora-toolbar-group-items.${S},
1036
1038
  ${k} .rte-toolbar-group-items.${$},
1037
1039
  ${k} .editora-toolbar-group-items.${$} {
1038
1040
  border-color: #566275;
@@ -1045,15 +1047,15 @@ function mt() {
1045
1047
  .editora-toolbar-button[data-command="toggleTranslationRealtime"].active {
1046
1048
  background: #ccc;
1047
1049
  }
1048
- ${k} .rte-toolbar-group-items.${y} .rte-toolbar-button svg,
1049
- ${k} .editora-toolbar-group-items.${y} .editora-toolbar-button svg,
1050
+ ${k} .rte-toolbar-group-items.${S} .rte-toolbar-button svg,
1051
+ ${k} .editora-toolbar-group-items.${S} .editora-toolbar-button svg,
1050
1052
  ${k} .rte-toolbar-group-items.${$} .rte-toolbar-button svg,
1051
1053
  ${k} .editora-toolbar-group-items.${$} .editora-toolbar-button svg
1052
1054
  {
1053
1055
  fill: none;
1054
1056
  }
1055
- ${k} .rte-toolbar-group-items.${y} .rte-toolbar-button,
1056
- ${k} .editora-toolbar-group-items.${y} .editora-toolbar-button
1057
+ ${k} .rte-toolbar-group-items.${S} .rte-toolbar-button,
1058
+ ${k} .editora-toolbar-group-items.${S} .editora-toolbar-button
1057
1059
  {
1058
1060
  border-color: #566275;
1059
1061
  }
@@ -1569,9 +1571,9 @@ function mt() {
1569
1571
  }
1570
1572
  `, document.head.appendChild(e);
1571
1573
  }
1572
- const bt = (e = {}) => {
1574
+ const pt = (e = {}) => {
1573
1575
  const n = ae(e), t = /* @__PURE__ */ new Set();
1574
- return mt(), {
1576
+ return bt(), {
1575
1577
  name: "translationWorkflow",
1576
1578
  toolbar: [
1577
1579
  {
@@ -1709,7 +1711,7 @@ const bt = (e = {}) => {
1709
1711
  init: function(a) {
1710
1712
  ee += 1;
1711
1713
  const o = this && typeof this.__pluginConfig == "object" ? { ...e, ...this.__pluginConfig } : e, l = ae(o);
1712
- ft(l);
1714
+ gt(l);
1713
1715
  const s = T(
1714
1716
  a != null && a.editorElement ? { editorElement: a.editorElement } : void 0,
1715
1717
  !1,
@@ -1721,11 +1723,11 @@ const bt = (e = {}) => {
1721
1723
  u.set(s, l), oe.set(s, o), i.segments = M(s, l, i), L(s, "init", !0), E(s);
1722
1724
  },
1723
1725
  destroy: () => {
1724
- t.forEach((r) => Se(r)), t.clear(), ee = Math.max(0, ee - 1), !(ee > 0) && gt();
1726
+ t.forEach((r) => ye(r)), t.clear(), ee = Math.max(0, ee - 1), !(ee > 0) && mt();
1725
1727
  }
1726
1728
  };
1727
1729
  };
1728
1730
  export {
1729
- bt as TranslationWorkflowPlugin
1731
+ pt as TranslationWorkflowPlugin
1730
1732
  };
1731
- //# sourceMappingURL=TranslationWorkflowPlugin.native-DdF16tgT.mjs.map
1733
+ //# sourceMappingURL=TranslationWorkflowPlugin.native-CZtG--06.mjs.map