@editora/plugins 1.0.11 → 1.0.13

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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/approval-workflow.cjs.js +14 -14
  3. package/dist/approval-workflow.esm.js +265 -262
  4. package/dist/blockquote.cjs.js +1 -1
  5. package/dist/blockquote.esm.js +177 -15
  6. package/dist/blocks-library.cjs.js +6 -6
  7. package/dist/blocks-library.esm.js +95 -92
  8. package/dist/bold.cjs.js +1 -1
  9. package/dist/bold.esm.js +10 -6
  10. package/dist/capitalization.cjs.js +1 -1
  11. package/dist/capitalization.esm.js +124 -44
  12. package/dist/checklist.cjs.js +1 -1
  13. package/dist/checklist.esm.js +251 -191
  14. package/dist/citations.cjs.js +4 -4
  15. package/dist/citations.esm.js +131 -128
  16. package/dist/clear-formatting.cjs.js +1 -1
  17. package/dist/clear-formatting.esm.js +68 -36
  18. package/dist/code.cjs.js +121 -44
  19. package/dist/code.esm.js +2694 -889
  20. package/dist/content-rules.cjs.js +5 -5
  21. package/dist/content-rules.esm.js +104 -101
  22. package/dist/data-binding.cjs.js +3 -3
  23. package/dist/data-binding.esm.js +51 -48
  24. package/dist/direction.cjs.js +1 -1
  25. package/dist/direction.esm.js +97 -74
  26. package/dist/doc-schema.cjs.js +4 -4
  27. package/dist/doc-schema.esm.js +104 -101
  28. package/dist/embed-iframe.cjs.js +21 -4
  29. package/dist/embed-iframe.esm.js +279 -116
  30. package/dist/heading.cjs.js +1 -1
  31. package/dist/heading.esm.js +239 -56
  32. package/dist/history.cjs.js +1 -1
  33. package/dist/history.esm.js +74 -89
  34. package/dist/inlineFormatting-DOYOJdnD.js +1 -0
  35. package/dist/inlineFormatting-DuVTGXYG.mjs +95 -0
  36. package/dist/italic.cjs.js +1 -1
  37. package/dist/italic.esm.js +12 -8
  38. package/dist/math.cjs.js +27 -21
  39. package/dist/math.esm.js +218 -146
  40. package/dist/merge-tag.cjs.js +8 -2
  41. package/dist/merge-tag.esm.js +130 -111
  42. package/dist/pii-redaction.cjs.js +6 -6
  43. package/dist/pii-redaction.esm.js +169 -166
  44. package/dist/smart-paste.cjs.js +5 -5
  45. package/dist/smart-paste.esm.js +120 -117
  46. package/dist/special-characters.cjs.js +6 -10
  47. package/dist/special-characters.esm.js +97 -75
  48. package/dist/strikethrough.cjs.js +1 -1
  49. package/dist/strikethrough.esm.js +11 -25
  50. package/dist/translation-workflow.cjs.js +7 -7
  51. package/dist/translation-workflow.esm.js +103 -100
  52. package/dist/underline.cjs.js +1 -1
  53. package/dist/underline.esm.js +7 -3
  54. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- const S = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", Te = "__editoraCommandEditorRoot", ve = "rte-translation-workflow-styles", u = "rte-translation-workflow-panel", y = "translation-workflow", $ = "translationWorkflow", h = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', $e = [
1
+ const S = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", ve = "__editoraCommandEditorRoot", $e = "rte-translation-workflow-styles", u = "rte-translation-workflow-panel", y = "translation-workflow", $ = "translationWorkflow", h = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', Ee = [
2
2
  "p",
3
3
  "h1",
4
4
  "h2",
@@ -11,7 +11,7 @@ const S = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-ed
11
11
  "th",
12
12
  "blockquote",
13
13
  "figcaption"
14
- ].join(", "), Me = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "Home", "End"]), Ee = [
14
+ ].join(", "), Ce = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "Home", "End"]), Ae = [
15
15
  {
16
16
  locale: "en",
17
17
  label: "English",
@@ -68,7 +68,7 @@ const S = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-ed
68
68
  requireDifferentFromSource: !0,
69
69
  preserveTokens: !0
70
70
  }
71
- ], Oe = {
71
+ ], _e = {
72
72
  panelTitle: "Translation Workflow",
73
73
  panelAriaLabel: "Translation workflow panel",
74
74
  sourceLocaleLabel: "Source Locale",
@@ -98,11 +98,11 @@ const S = ".rte-content, .editora-content", ke = "[data-editora-editor], .rte-ed
98
98
  untranslatedMessage: "Segment appears untranslated (same as source).",
99
99
  lengthOutOfRangeMessage: "Translation length is outside expected locale range."
100
100
  }, c = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new Set();
101
- let X = 0, _e = 0, Ae = 0, Fe = 0, k = null, x = null, D = null, z = null, N = null, O = null, I = null, _ = null;
101
+ let X = 0, Fe = 0, Re = 0, We = 0, k = null, x = null, D = null, z = null, N = null, O = null, I = null, _ = null;
102
102
  function m(e) {
103
103
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
104
104
  }
105
- function We(e) {
105
+ function Ke(e) {
106
106
  return e.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
107
107
  }
108
108
  function C(e, t, r) {
@@ -114,25 +114,25 @@ function A(e) {
114
114
  function W(e) {
115
115
  return e.trim().toLowerCase();
116
116
  }
117
- function Ke(e) {
117
+ function Ve(e) {
118
118
  return e.replace(/"/g, "&quot;");
119
119
  }
120
- function Ve(e, t = 120) {
120
+ function je(e, t = 120) {
121
121
  return e.length <= t ? e : `${e.slice(0, Math.max(0, t - 1)).trimEnd()}…`;
122
122
  }
123
- function Re(e) {
123
+ function Ie(e) {
124
124
  const t = e.match(/\{\{[^{}]+\}\}|%[A-Z0-9_]+%|\$\{[^{}]+\}/gi);
125
125
  return !t || t.length === 0 ? [] : t.map((r) => r.trim()).filter(Boolean);
126
126
  }
127
- function je(e, t) {
128
- const r = Re(e).sort(), n = Re(t).sort();
127
+ function Ue(e, t) {
128
+ const r = Ie(e).sort(), n = Ie(t).sort();
129
129
  if (r.length !== n.length) return !1;
130
130
  for (let a = 0; a < r.length; a += 1)
131
131
  if (r[a] !== n[a]) return !1;
132
132
  return !0;
133
133
  }
134
- function Ue(e, t) {
135
- const r = Array.isArray(t) && t.length > 0 ? t : Ee, n = [], a = /* @__PURE__ */ new Set();
134
+ function Ge(e, t) {
135
+ const r = Array.isArray(t) && t.length > 0 ? t : Ae, n = [], a = /* @__PURE__ */ new Set();
136
136
  return r.forEach((o) => {
137
137
  const l = W(o.locale || "");
138
138
  if (!l) return;
@@ -148,7 +148,7 @@ function Ue(e, t) {
148
148
  }), e.forEach((o) => {
149
149
  const l = W(o);
150
150
  if (a.has(l)) return;
151
- const s = Ee.find((i) => l.startsWith(i.locale));
151
+ const s = Ae.find((i) => l.startsWith(i.locale));
152
152
  n.push(
153
153
  s ? { ...s, locale: l, label: o } : {
154
154
  locale: l,
@@ -162,13 +162,13 @@ function Ue(e, t) {
162
162
  }), n;
163
163
  }
164
164
  function oe(e = {}) {
165
- const t = e.normalizeText || We, r = A(e.sourceLocale || "en-US"), n = A(e.targetLocale || "fr-FR"), a = /* @__PURE__ */ new Set([r, n]);
165
+ const t = e.normalizeText || Ke, r = A(e.sourceLocale || "en-US"), n = A(e.targetLocale || "fr-FR"), a = /* @__PURE__ */ new Set([r, n]);
166
166
  (Array.isArray(e.locales) ? e.locales : []).forEach((s) => {
167
167
  if (typeof s != "string") return;
168
168
  const i = A(s);
169
169
  a.add(i);
170
170
  });
171
- const o = Array.from(a), l = Ue(o, e.localeRules);
171
+ const o = Array.from(a), l = Ge(o, e.localeRules);
172
172
  return {
173
173
  sourceLocale: r,
174
174
  targetLocale: n,
@@ -179,15 +179,15 @@ function oe(e = {}) {
179
179
  maxIssues: C(Number(e.maxIssues ?? 120), 5, 1e3),
180
180
  maxSegments: C(Number(e.maxSegments ?? 600), 20, 3e3),
181
181
  minSourceLengthForRatio: C(Number(e.minSourceLengthForRatio ?? 8), 2, 100),
182
- segmentSelector: (e.segmentSelector || $e).trim() || $e,
182
+ segmentSelector: (e.segmentSelector || Ee).trim() || Ee,
183
183
  labels: {
184
- ...Oe,
184
+ ..._e,
185
185
  ...e.labels || {}
186
186
  },
187
187
  normalizeText: t
188
188
  };
189
189
  }
190
- function Ge(e) {
190
+ function Ye(e) {
191
191
  return {
192
192
  sourceLocale: e.sourceLocale,
193
193
  targetLocale: e.targetLocale,
@@ -219,11 +219,11 @@ function K(e) {
219
219
  const t = e.querySelector(S);
220
220
  return t instanceof HTMLElement ? t : null;
221
221
  }
222
- function Ye() {
222
+ function Ze() {
223
223
  if (typeof window > "u") return null;
224
- const e = window[Te];
224
+ const e = window[ve];
225
225
  if (!(e instanceof HTMLElement)) return null;
226
- window[Te] = null;
226
+ window[ve] = null;
227
227
  const t = K(e);
228
228
  if (t) return t;
229
229
  const r = e.closest(ke);
@@ -234,7 +234,7 @@ function Ye() {
234
234
  const n = e.closest(S);
235
235
  return n instanceof HTMLElement ? n : null;
236
236
  }
237
- function Ze(e) {
237
+ function Je(e) {
238
238
  const t = e.closest("[data-editora-editor]");
239
239
  if (t && K(t) === e)
240
240
  return t;
@@ -246,22 +246,22 @@ function Ze(e) {
246
246
  }
247
247
  return xe(e);
248
248
  }
249
- function Ce(e) {
249
+ function He(e) {
250
250
  return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
251
251
  }
252
252
  function ee(e) {
253
253
  return e ? (e.getAttribute("data-theme") || e.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark") : !1;
254
254
  }
255
- function Je(e) {
255
+ function Qe(e) {
256
256
  const t = xe(e);
257
257
  if (ee(t)) return !0;
258
258
  const r = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
259
259
  return ee(r) ? !0 : ee(document.documentElement) || ee(document.body);
260
260
  }
261
261
  function ge(e, t) {
262
- e.classList.remove("rte-translation-workflow-theme-dark"), Je(t) && e.classList.add("rte-translation-workflow-theme-dark");
262
+ e.classList.remove("rte-translation-workflow-theme-dark"), Qe(t) && e.classList.add("rte-translation-workflow-theme-dark");
263
263
  }
264
- function Qe(e) {
264
+ function Xe(e) {
265
265
  for (let t = 0; t < e.length; t += 1) {
266
266
  const r = e[t];
267
267
  if (!(r.type !== "childList" || r.removedNodes.length === 0))
@@ -286,11 +286,11 @@ function T(e, t = !0, r = !0) {
286
286
  const s = K(e.editorElement);
287
287
  if (s) return s;
288
288
  }
289
- const n = Ye();
289
+ const n = Ze();
290
290
  if (n) return n;
291
291
  const a = window.getSelection();
292
292
  if (a && a.rangeCount > 0) {
293
- const s = Ce(a.getRangeAt(0).startContainer)?.closest(
293
+ const s = He(a.getRangeAt(0).startContainer)?.closest(
294
294
  S
295
295
  );
296
296
  if (s) return s;
@@ -307,7 +307,7 @@ function T(e, t = !0, r = !0) {
307
307
  const l = document.querySelector(S);
308
308
  return l instanceof HTMLElement ? l : null;
309
309
  }
310
- function Xe(e) {
310
+ function et(e) {
311
311
  const t = e.target;
312
312
  if (t) {
313
313
  const n = t.closest(`.${u}`);
@@ -331,7 +331,7 @@ function Xe(e) {
331
331
  return null;
332
332
  }
333
333
  function fe(e, t, r) {
334
- const n = Ze(e);
334
+ const n = Je(e);
335
335
  Array.from(
336
336
  n.querySelectorAll(
337
337
  `.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
@@ -344,7 +344,7 @@ function we(e) {
344
344
  const t = le.get(e);
345
345
  typeof t == "number" && (window.clearTimeout(t), le.delete(e));
346
346
  }
347
- function et(e, t) {
347
+ function tt(e, t) {
348
348
  const r = W(t), n = e.localeRules.find((l) => W(l.locale) === r);
349
349
  if (n) return n;
350
350
  const a = r.split("-")[0], o = e.localeRules.find((l) => W(l.locale).split("-")[0] === a);
@@ -358,8 +358,8 @@ function et(e, t) {
358
358
  };
359
359
  }
360
360
  function te(e, t, r, n = {}) {
361
- return Ae += 1, {
362
- id: `translation-workflow-issue-${Ae}`,
361
+ return Re += 1, {
362
+ id: `translation-workflow-issue-${Re}`,
363
363
  type: e,
364
364
  severity: t,
365
365
  message: r,
@@ -381,15 +381,15 @@ function ie(e, t) {
381
381
  e.setAttribute("contenteditable", "true");
382
382
  }
383
383
  function ce(e, t) {
384
- return e.querySelector(`[data-translation-segment-id="${Ke(t)}"]`);
384
+ return e.querySelector(`[data-translation-segment-id="${Ve(t)}"]`);
385
385
  }
386
- function He(e) {
386
+ function qe(e) {
387
387
  const t = window.getSelection();
388
388
  if (!t || t.rangeCount === 0) return null;
389
- const r = Ce(t.getRangeAt(0).startContainer);
389
+ const r = He(t.getRangeAt(0).startContainer);
390
390
  return !r || !e.contains(r) ? null : r.closest("[data-translation-segment-id]");
391
391
  }
392
- function tt(e, t) {
392
+ function nt(e, t) {
393
393
  const r = Array.from(e.querySelectorAll(t));
394
394
  if (r.length <= 1) return r;
395
395
  const n = new Set(r);
@@ -403,11 +403,11 @@ function tt(e, t) {
403
403
  return !0;
404
404
  });
405
405
  }
406
- function nt(e, t, r) {
406
+ function rt(e, t, r) {
407
407
  let n = (r || "").trim();
408
408
  if (!n || t.has(n)) {
409
409
  do
410
- n = `translation-segment-${_e++}`;
410
+ n = `translation-segment-${Fe++}`;
411
411
  while (t.has(n));
412
412
  e.setAttribute("data-translation-segment-id", n);
413
413
  }
@@ -429,9 +429,9 @@ function me(e, t) {
429
429
  }), r;
430
430
  }
431
431
  function M(e, t, r) {
432
- const n = tt(e, t.segmentSelector), a = [], o = /* @__PURE__ */ new Set();
432
+ const n = nt(e, t.segmentSelector), a = [], o = /* @__PURE__ */ new Set();
433
433
  for (let l = 0; l < n.length && !(a.length >= t.maxSegments); l += 1) {
434
- const s = n[l], i = nt(s, o, s.getAttribute("data-translation-segment-id")), d = r.lockedSegmentIds.has(i), g = s.getAttribute("data-translation-locked") === "true", w = d || g;
434
+ const s = n[l], i = rt(s, o, s.getAttribute("data-translation-segment-id")), d = r.lockedSegmentIds.has(i), g = s.getAttribute("data-translation-locked") === "true", w = d || g;
435
435
  if (w)
436
436
  if (r.lockedSegmentIds.add(i), ie(s, !0), !r.lockedHtmlBySegmentId.has(i))
437
437
  r.lockedHtmlBySegmentId.set(i, s.innerHTML);
@@ -501,11 +501,11 @@ function H(e, t) {
501
501
  const r = e.querySelector(".rte-translation-live");
502
502
  r && (r.textContent = t);
503
503
  }
504
- function rt(e, t) {
504
+ function ot(e, t) {
505
505
  return `${e.innerHTML}::${t.sourceLocale}::${t.targetLocale}::${Array.from(t.lockedSegmentIds).sort().join("|")}`;
506
506
  }
507
- function ot(e, t, r) {
508
- const n = [], a = et(r, t.targetLocale);
507
+ function at(e, t, r) {
508
+ const n = [], a = tt(r, t.targetLocale);
509
509
  for (let o = 0; o < e.length && !(n.length >= r.maxIssues); o += 1) {
510
510
  const l = e[o], s = r.normalizeText(l.sourceText || ""), i = r.normalizeText(l.text || "");
511
511
  if (!i) {
@@ -519,7 +519,7 @@ function ot(e, t, r) {
519
519
  );
520
520
  continue;
521
521
  }
522
- if (a.preserveTokens && s && !je(s, i) && (n.push(
522
+ if (a.preserveTokens && s && !Ue(s, i) && (n.push(
523
523
  te("token-mismatch", "error", r.labels.tokenMismatchMessage, {
524
524
  segmentId: l.id,
525
525
  sourceText: s,
@@ -549,7 +549,7 @@ function ot(e, t, r) {
549
549
  }
550
550
  return n;
551
551
  }
552
- function qe(e) {
552
+ function Be(e) {
553
553
  const t = c.get(e) || k, r = q.get(e);
554
554
  return {
555
555
  sourceLocale: r?.sourceLocale || t?.sourceLocale || "en-US",
@@ -574,7 +574,7 @@ function E(e) {
574
574
  const t = q.get(e), r = t && t.selectedSegmentId ? t.segments.find((n) => n.id === t.selectedSegmentId) : null;
575
575
  fe(e, "toggleTranslationWorkflowPanel", ye(e)), fe(e, "toggleTranslationRealtime", t?.realtimeEnabled === !0), fe(e, "toggleTranslationSegmentLock", r?.locked === !0);
576
576
  }
577
- function at(e, t) {
577
+ function lt(e, t) {
578
578
  const r = ce(e, t);
579
579
  if (!r) return;
580
580
  try {
@@ -617,8 +617,8 @@ function R(e) {
617
617
  B && (B.textContent = n.realtimeEnabled ? r.labels.realtimeOnText : r.labels.realtimeOffText, B.setAttribute("aria-pressed", n.realtimeEnabled ? "true" : "false"));
618
618
  const Y = t.querySelector('[data-action="lock-selected"]'), ue = n.selectedSegmentId && n.segments.find((f) => f.id === n.selectedSegmentId) || null;
619
619
  Y && (Y.textContent = ue?.locked ? r.labels.unlockSelectedText : r.labels.lockSelectedText, Y.disabled = !ue, Y.setAttribute("aria-pressed", ue?.locked ? "true" : "false"));
620
- const Le = t.querySelector('[data-action="close"]');
621
- Le && Le.setAttribute("aria-label", r.labels.closeText);
620
+ const Te = t.querySelector('[data-action="close"]');
621
+ Te && Te.setAttribute("aria-label", r.labels.closeText);
622
622
  const Z = t.querySelector(".rte-translation-issues"), F = t.querySelector(".rte-translation-empty");
623
623
  Z && (Z.setAttribute("aria-label", r.labels.issuesLabel), n.issues.length === 0 ? (Z.innerHTML = "", F && (F.hidden = !1, F.textContent = r.labels.noIssuesText)) : (F && (F.hidden = !0), Z.innerHTML = n.issues.map((f) => `
624
624
  <li class="rte-translation-issue ${f.severity === "error" ? "error" : f.severity === "warning" ? "warning" : "info"}" role="listitem" data-segment-id="${m(
@@ -630,14 +630,14 @@ function R(e) {
630
630
  `).join("")));
631
631
  const de = t.querySelector(".rte-translation-segments");
632
632
  de && (de.setAttribute("aria-label", r.labels.segmentsLabel), de.innerHTML = n.segments.map((f) => {
633
- const P = f.id === n.selectedSegmentId ? "selected" : "", Ne = f.locked ? "locked" : "";
633
+ const P = f.id === n.selectedSegmentId ? "selected" : "", Oe = f.locked ? "locked" : "";
634
634
  return `
635
- <li class="rte-translation-segment-item ${P} ${Ne}" role="option" aria-selected="${f.id === n.selectedSegmentId ? "true" : "false"}" data-segment-id="${m(f.id)}">
635
+ <li class="rte-translation-segment-item ${P} ${Oe}" role="option" aria-selected="${f.id === n.selectedSegmentId ? "true" : "false"}" data-segment-id="${m(f.id)}">
636
636
  <button type="button" class="rte-translation-segment-select" data-action="select-segment" data-segment-id="${m(
637
637
  f.id
638
638
  )}" title="${m(f.text)}">
639
639
  <span class="rte-translation-segment-meta">#${f.index + 1} • ${m(f.tagName)}</span>
640
- <span class="rte-translation-segment-text">${m(Ve(f.text, 110))}</span>
640
+ <span class="rte-translation-segment-text">${m(je(f.text, 110))}</span>
641
641
  </button>
642
642
  <button type="button" class="rte-translation-segment-lock" data-action="toggle-lock" data-segment-id="${m(
643
643
  f.id
@@ -652,7 +652,7 @@ function R(e) {
652
652
  }
653
653
  t.setAttribute("aria-label", r.labels.panelAriaLabel);
654
654
  }
655
- function Be(e) {
655
+ function Pe(e) {
656
656
  const t = c.get(e) || k;
657
657
  if (!t) return;
658
658
  we(e);
@@ -666,15 +666,15 @@ function L(e, t, r) {
666
666
  if (!n) return [];
667
667
  const a = b(e, n), o = me(e, a);
668
668
  a.segments = M(e, n, a);
669
- const l = rt(e, a);
669
+ const l = ot(e, a);
670
670
  if (!r && a.snapshot === l)
671
671
  return a.issues;
672
- a.issues = ot(a.segments, a, n), a.lastRunAt = (/* @__PURE__ */ new Date()).toISOString(), a.snapshot = l, R(e), E(e), e.dispatchEvent(
672
+ a.issues = at(a.segments, a, n), a.lastRunAt = (/* @__PURE__ */ new Date()).toISOString(), a.snapshot = l, R(e), E(e), e.dispatchEvent(
673
673
  new CustomEvent("editora:translation-workflow-validation", {
674
674
  bubbles: !0,
675
675
  detail: {
676
676
  reason: t,
677
- state: qe(e)
677
+ state: Be(e)
678
678
  }
679
679
  })
680
680
  );
@@ -689,7 +689,7 @@ function L(e, t, r) {
689
689
  }
690
690
  return a.issues;
691
691
  }
692
- function Pe(e) {
692
+ function De(e) {
693
693
  const t = c.get(e) || k;
694
694
  if (!t) return !1;
695
695
  const r = b(e, t), n = M(e, t, r);
@@ -712,7 +712,7 @@ function se(e, t, r) {
712
712
  if (!n) return !1;
713
713
  const a = b(e, n);
714
714
  a.segments = M(e, n, a);
715
- const o = He(e)?.getAttribute("data-translation-segment-id") || null, l = t || o || a.selectedSegmentId || a.segments[0]?.id || null;
715
+ const o = qe(e)?.getAttribute("data-translation-segment-id") || null, l = t || o || a.selectedSegmentId || a.segments[0]?.id || null;
716
716
  if (!l) return !1;
717
717
  const s = ce(e, l);
718
718
  if (!s) return !1;
@@ -727,17 +727,17 @@ function se(e, t, r) {
727
727
  })
728
728
  ), !0;
729
729
  }
730
- function De(e, t) {
730
+ function ze(e, t) {
731
731
  const r = c.get(e) || k;
732
732
  if (!r) return !1;
733
733
  const n = b(e, r), a = typeof t == "boolean" ? t : !n.realtimeEnabled;
734
- return n.realtimeEnabled = a, a ? Be(e) : we(e), R(e), E(e), !0;
734
+ return n.realtimeEnabled = a, a ? Pe(e) : we(e), R(e), E(e), !0;
735
735
  }
736
736
  function pe(e, t, r = !0) {
737
737
  const n = c.get(e) || k;
738
738
  if (!n) return !1;
739
739
  const a = b(e, n);
740
- return a.segments = M(e, n, a), a.segments.some((o) => o.id === t) ? (a.selectedSegmentId = t, R(e), E(e), r && at(e, t), !0) : !1;
740
+ return a.segments = M(e, n, a), a.segments.some((o) => o.id === t) ? (a.selectedSegmentId = t, R(e), E(e), r && lt(e, t), !0) : !1;
741
741
  }
742
742
  function ne(e, t) {
743
743
  const r = c.get(e) || k;
@@ -758,39 +758,42 @@ function V(e, t = !1) {
758
758
  r && (r.classList.remove("show"), j.set(e, !1), E(e), t && e.focus({ preventScroll: !0 }));
759
759
  }
760
760
  function he(e) {
761
- const t = ut(e);
761
+ const t = dt(e);
762
762
  p.forEach((n, a) => {
763
763
  a !== e && V(a, !1);
764
764
  }), t.classList.add("show"), j.set(e, !0), L(e, "panel-open", !1), R(e), be(e, t), E(e), t.querySelector('[data-field="target-locale"]')?.focus();
765
765
  }
766
- function ze(e, t) {
766
+ function Ne(e, t) {
767
767
  const r = ye(e);
768
768
  return (typeof t == "boolean" ? t : !r) ? he(e) : V(e, !1), !0;
769
769
  }
770
- function lt(e) {
771
- const t = e.key.toLowerCase();
772
- return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "l";
770
+ function Le(e) {
771
+ return typeof e.key == "string" ? e.key.toLowerCase() : "";
773
772
  }
774
773
  function st(e) {
775
- const t = e.key.toLowerCase();
776
- return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "v";
774
+ const t = Le(e);
775
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "l";
777
776
  }
778
777
  function it(e) {
779
- const t = e.key.toLowerCase();
780
- return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "k";
778
+ const t = Le(e);
779
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "v";
781
780
  }
782
781
  function ct(e) {
782
+ const t = Le(e);
783
+ return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "k";
784
+ }
785
+ function ut(e) {
783
786
  return e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey ? !0 : e.key === "Backspace" || e.key === "Delete" || e.key === "Enter";
784
787
  }
785
- function Ie(e) {
788
+ function Me(e) {
786
789
  return e instanceof HTMLElement ? e.closest('[data-translation-locked="true"]') : null;
787
790
  }
788
- function ut(e) {
791
+ function dt(e) {
789
792
  const t = p.get(e);
790
793
  if (t) return t;
791
794
  const r = c.get(e) || k || oe();
792
795
  b(e, r);
793
- const n = `rte-translation-workflow-panel-${Fe++}`, a = `${n}-source`, o = `${n}-target`, l = document.createElement("section");
796
+ const n = `rte-translation-workflow-panel-${We++}`, a = `${n}-source`, o = `${n}-target`, l = document.createElement("section");
794
797
  return l.className = u, l.id = n, l.setAttribute("role", "dialog"), l.setAttribute("aria-modal", "false"), l.setAttribute("aria-label", r.labels.panelAriaLabel), l.innerHTML = `
795
798
  <header class="rte-translation-header">
796
799
  <h2 class="rte-translation-title">${m(r.labels.panelTitle)}</h2>
@@ -865,7 +868,7 @@ function ut(e) {
865
868
  return;
866
869
  }
867
870
  if (g === "capture-source") {
868
- Pe(e);
871
+ De(e);
869
872
  return;
870
873
  }
871
874
  if (g === "lock-selected") {
@@ -873,7 +876,7 @@ function ut(e) {
873
876
  return;
874
877
  }
875
878
  if (g === "toggle-realtime") {
876
- De(e);
879
+ ze(e);
877
880
  return;
878
881
  }
879
882
  if (g === "select-segment") {
@@ -902,17 +905,17 @@ function ut(e) {
902
905
  s.preventDefault(), V(e, !0);
903
906
  return;
904
907
  }
905
- !i?.closest(".rte-translation-segments") || !Me.has(s.key) || (s.preventDefault(), s.key === "ArrowUp" ? ne(e, -1) : s.key === "ArrowDown" ? ne(e, 1) : s.key === "Home" ? ne(e, "start") : s.key === "End" && ne(e, "end"));
908
+ !i?.closest(".rte-translation-segments") || !Ce.has(s.key) || (s.preventDefault(), s.key === "ArrowUp" ? ne(e, -1) : s.key === "ArrowDown" ? ne(e, 1) : s.key === "Home" ? ne(e, "start") : s.key === "End" && ne(e, "end"));
906
909
  }), ge(l, e), document.body.appendChild(l), p.set(e, l), j.set(e, !1), R(e), l;
907
910
  }
908
- function dt(e) {
911
+ function ft(e) {
909
912
  k = e, D || (D = (t) => {
910
913
  ae();
911
914
  const n = t.target?.closest(S);
912
915
  if (!n) return;
913
916
  const a = c.get(n) || e, o = b(n, a);
914
917
  c.set(n, a), x = n;
915
- const l = He(n)?.getAttribute("data-translation-segment-id") || null;
918
+ const l = qe(n)?.getAttribute("data-translation-segment-id") || null;
916
919
  l && (o.selectedSegmentId = l), E(n);
917
920
  const s = p.get(n);
918
921
  s && (ge(s, n), be(n, s), R(n));
@@ -930,11 +933,11 @@ function dt(e) {
930
933
  R(n), E(n);
931
934
  return;
932
935
  }
933
- Be(n);
936
+ Pe(n);
934
937
  }, document.addEventListener("input", z, !0)), N || (N = (t) => {
935
938
  const r = t, n = r.target, a = n?.closest(S);
936
939
  if (!a) return;
937
- const o = Ie(n);
940
+ const o = Me(n);
938
941
  if (!o || !a.contains(o)) return;
939
942
  r.preventDefault();
940
943
  const l = p.get(a), s = c.get(a) || k;
@@ -942,25 +945,25 @@ function dt(e) {
942
945
  }, document.addEventListener("beforeinput", N, !0)), O || (O = (t) => {
943
946
  if (t.defaultPrevented) return;
944
947
  const r = t.target;
945
- if (r?.closest(`.${u}`) && t.key !== "Escape" && !Me.has(t.key)) return;
946
- const a = t.key === "Escape", o = lt(t), l = st(t), s = it(t), i = Ie(r);
948
+ if (r?.closest(`.${u}`) && t.key !== "Escape" && !Ce.has(t.key)) return;
949
+ const a = t.key === "Escape", o = st(t), l = it(t), s = ct(t), i = Me(r);
947
950
  if (!a && !o && !l && !s && !i)
948
951
  return;
949
- const d = Xe(t);
952
+ const d = et(t);
950
953
  if (!d) return;
951
954
  const g = c.get(d) || k || e;
952
955
  if (b(d, g), c.set(d, g), x = d, a && ye(d)) {
953
956
  t.preventDefault(), V(d, !0);
954
957
  return;
955
958
  }
956
- if (i && d.contains(i) && ct(t)) {
959
+ if (i && d.contains(i) && ut(t)) {
957
960
  t.preventDefault();
958
961
  const w = p.get(d);
959
962
  w && H(w, g.labels.readonlySegmentMessage);
960
963
  return;
961
964
  }
962
965
  if (o) {
963
- t.preventDefault(), t.stopPropagation(), ze(d);
966
+ t.preventDefault(), t.stopPropagation(), Ne(d);
964
967
  return;
965
968
  }
966
969
  if (l) {
@@ -973,7 +976,7 @@ function dt(e) {
973
976
  !r.isConnected || !t.isConnected || (ge(t, r), be(r, t));
974
977
  });
975
978
  }, window.addEventListener("scroll", I, !0), window.addEventListener("resize", I)), !_ && typeof MutationObserver < "u" && document.body && (_ = new MutationObserver((t) => {
976
- Qe(t) && ae(), t.some((n) => n.type === "characterData" ? !0 : n.type === "childList" && (n.addedNodes.length > 0 || n.removedNodes.length > 0)) && U.forEach((n) => {
979
+ Xe(t) && ae(), t.some((n) => n.type === "characterData" ? !0 : n.type === "childList" && (n.addedNodes.length > 0 || n.removedNodes.length > 0)) && U.forEach((n) => {
977
980
  const a = q.get(n);
978
981
  if (!a || a.lockedSegmentIds.size === 0 || !me(n, a)) return;
979
982
  a.snapshot = "";
@@ -986,13 +989,13 @@ function dt(e) {
986
989
  characterData: !0
987
990
  }));
988
991
  }
989
- function ft() {
992
+ function gt() {
990
993
  D && (document.removeEventListener("focusin", D, !0), D = null), z && (document.removeEventListener("input", z, !0), z = null), N && (document.removeEventListener("beforeinput", N, !0), N = null), O && (document.removeEventListener("keydown", O, !0), O = null), I && (window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I), I = null), _ && (_.disconnect(), _ = null), p.forEach((t) => t.remove()), p.clear(), Array.from(U).forEach((t) => Se(t)), k = null, x = null;
991
994
  }
992
- function gt() {
993
- if (typeof document > "u" || document.getElementById(ve)) return;
995
+ function mt() {
996
+ if (typeof document > "u" || document.getElementById($e)) return;
994
997
  const e = document.createElement("style");
995
- e.id = ve, e.textContent = `
998
+ e.id = $e, e.textContent = `
996
999
  .rte-toolbar-group-items.${y},
997
1000
  .editora-toolbar-group-items.${y},
998
1001
  .rte-toolbar-group-items.${$},
@@ -1557,9 +1560,9 @@ function gt() {
1557
1560
  }
1558
1561
  `, document.head.appendChild(e);
1559
1562
  }
1560
- const mt = (e = {}) => {
1563
+ const bt = (e = {}) => {
1561
1564
  const t = oe(e), r = /* @__PURE__ */ new Set();
1562
- return gt(), {
1565
+ return mt(), {
1563
1566
  name: "translationWorkflow",
1564
1567
  toolbar: [
1565
1568
  {
@@ -1615,7 +1618,7 @@ const mt = (e = {}) => {
1615
1618
  const o = T(a, !1, !1);
1616
1619
  if (!o) return !1;
1617
1620
  const l = c.get(o) || t;
1618
- return b(o, l), c.set(o, l), x = o, ze(o, typeof n == "boolean" ? n : void 0);
1621
+ return b(o, l), c.set(o, l), x = o, Ne(o, typeof n == "boolean" ? n : void 0);
1619
1622
  },
1620
1623
  runTranslationLocaleValidation: (n, a) => {
1621
1624
  const o = T(a, !1, !1);
@@ -1627,7 +1630,7 @@ const mt = (e = {}) => {
1627
1630
  const o = T(a, !1, !1);
1628
1631
  if (!o) return !1;
1629
1632
  const l = c.get(o) || t;
1630
- return b(o, l), c.set(o, l), x = o, De(o, typeof n == "boolean" ? n : void 0);
1633
+ return b(o, l), c.set(o, l), x = o, ze(o, typeof n == "boolean" ? n : void 0);
1631
1634
  },
1632
1635
  toggleTranslationSegmentLock: (n, a) => {
1633
1636
  const o = T(a, !1, !1);
@@ -1647,12 +1650,12 @@ const mt = (e = {}) => {
1647
1650
  const o = T(a, !1, !1);
1648
1651
  if (!o) return !1;
1649
1652
  const l = c.get(o) || t;
1650
- return b(o, l), c.set(o, l), x = o, Pe(o);
1653
+ return b(o, l), c.set(o, l), x = o, De(o);
1651
1654
  },
1652
1655
  setTranslationWorkflowOptions: (n, a) => {
1653
1656
  const o = T(a, !1, !1);
1654
1657
  if (!o || !n || typeof n != "object") return !1;
1655
- const l = c.get(o) || t, s = re.get(o) || Ge(l), i = {
1658
+ const l = c.get(o) || t, s = re.get(o) || Ye(l), i = {
1656
1659
  ...s,
1657
1660
  ...n,
1658
1661
  labels: {
@@ -1672,7 +1675,7 @@ const mt = (e = {}) => {
1672
1675
  if (!o) return !1;
1673
1676
  const l = c.get(o) || t;
1674
1677
  b(o, l);
1675
- const s = qe(o);
1678
+ const s = Be(o);
1676
1679
  if (typeof n == "function")
1677
1680
  try {
1678
1681
  n(s);
@@ -1697,7 +1700,7 @@ const mt = (e = {}) => {
1697
1700
  init: function(a) {
1698
1701
  X += 1;
1699
1702
  const o = this && typeof this.__pluginConfig == "object" ? { ...e, ...this.__pluginConfig } : e, l = oe(o);
1700
- dt(l);
1703
+ ft(l);
1701
1704
  const s = T(
1702
1705
  a?.editorElement ? { editorElement: a.editorElement } : void 0,
1703
1706
  !1,
@@ -1709,10 +1712,10 @@ const mt = (e = {}) => {
1709
1712
  c.set(s, l), re.set(s, o), i.segments = M(s, l, i), L(s, "init", !0), E(s);
1710
1713
  },
1711
1714
  destroy: () => {
1712
- r.forEach((n) => Se(n)), r.clear(), X = Math.max(0, X - 1), !(X > 0) && ft();
1715
+ r.forEach((n) => Se(n)), r.clear(), X = Math.max(0, X - 1), !(X > 0) && gt();
1713
1716
  }
1714
1717
  };
1715
1718
  };
1716
1719
  export {
1717
- mt as TranslationWorkflowPlugin
1720
+ bt as TranslationWorkflowPlugin
1718
1721
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=()=>({name:"underline",marks:{underline:{parseDOM:[{tag:"u"}],toDOM:()=>["u",{},0]}},toolbar:[{label:"Underline",command:"toggleUnderline",icon:'<svg width="24" height="24" focusable="false"><path d="M16 5c.6 0 1 .4 1 1v7c0 2.8-2.2 5-5 5s-5-2.2-5-5V6c0-.6.4-1 1-1s1 .4 1 1v7c0 1.7 1.3 3 3 3s3-1.3 3-3V6c0-.6.4-1 1-1ZM4 17h16c.6 0 1 .4 1 1s-.4 1-1 1H4a1 1 0 1 1 0-2Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-u"}],commands:{toggleUnderline:()=>(document.execCommand("underline",!1),!0)},keymap:{"Mod-u":"toggleUnderline","Mod-U":"toggleUnderline"}});exports.UnderlinePlugin=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("./inlineFormatting-DOYOJdnD.js"),l=()=>({name:"underline",marks:{underline:{parseDOM:[{tag:"u"}],toDOM:()=>["u",{},0]}},toolbar:[{label:"Underline",command:"toggleUnderline",icon:'<svg width="24" height="24" focusable="false"><path d="M16 5c.6 0 1 .4 1 1v7c0 2.8-2.2 5-5 5s-5-2.2-5-5V6c0-.6.4-1 1-1s1 .4 1 1v7c0 1.7 1.3 3 3 3s3-1.3 3-3V6c0-.6.4-1 1-1ZM4 17h16c.6 0 1 .4 1 1s-.4 1-1 1H4a1 1 0 1 1 0-2Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-u"}],commands:{toggleUnderline:(i,e)=>n.applyInlineFormatting({command:"underline",context:e})},keymap:{"Mod-u":"toggleUnderline","Mod-U":"toggleUnderline"}});exports.UnderlinePlugin=l;
@@ -1,4 +1,5 @@
1
- const e = () => ({
1
+ import { a as n } from "./inlineFormatting-DuVTGXYG.mjs";
2
+ const a = () => ({
2
3
  name: "underline",
3
4
  // Schema definition for underline mark
4
5
  marks: {
@@ -21,7 +22,10 @@ const e = () => ({
21
22
  /**
22
23
  * Toggle underline formatting on current selection
23
24
  */
24
- toggleUnderline: () => (document.execCommand("underline", !1), !0)
25
+ toggleUnderline: (l, e) => n({
26
+ command: "underline",
27
+ context: e
28
+ })
25
29
  },
26
30
  // Keyboard shortcuts
27
31
  keymap: {
@@ -30,5 +34,5 @@ const e = () => ({
30
34
  }
31
35
  });
32
36
  export {
33
- e as UnderlinePlugin
37
+ a as UnderlinePlugin
34
38
  };