@editora/core 1.0.8 → 1.0.9

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 (88) hide show
  1. package/README.md +5 -0
  2. package/dist/{A11yCheckerPlugin.native-BRdGYMju.mjs → A11yCheckerPlugin.native-58d12bed.mjs} +23 -12
  3. package/dist/{AnchorPlugin.native-BcYGEtd9.mjs → AnchorPlugin.native-289a112a.mjs} +112 -102
  4. package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-449ce66c.mjs} +79 -40
  5. package/dist/{BackgroundColorPlugin.native-50iAT9xU.mjs → BackgroundColorPlugin.native-8aceb5cc.mjs} +16 -9
  6. package/dist/{BlockquotePlugin.native-JFmOLsxN.mjs → BlockquotePlugin.native-3541c714.mjs} +3 -2
  7. package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-1cc51e63.mjs} +119 -60
  8. package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-f9d7f8e4.mjs} +1 -1
  9. package/dist/{CapitalizationPlugin.native-DOMsh5R7.mjs → CapitalizationPlugin.native-42c135dc.mjs} +3 -2
  10. package/dist/{ChecklistPlugin.native-nuSSEFNI.mjs → ChecklistPlugin.native-3b397ee9.mjs} +43 -22
  11. package/dist/{CitationsPlugin.native-BnU0qCwR.mjs → CitationsPlugin.native-169fb1e8.mjs} +137 -69
  12. package/dist/{ClearFormattingPlugin.native-Bq_XcTh2.mjs → ClearFormattingPlugin.native-77baa514.mjs} +11 -6
  13. package/dist/{CodePlugin.native-DlpTPdkd.mjs → CodePlugin.native-989cf0aa.mjs} +629 -580
  14. package/dist/{CodeSamplePlugin.native-CgGoH-X4.mjs → CodeSamplePlugin.native-6cc0148e.mjs} +19 -10
  15. package/dist/{CommentsPlugin.native-DPSqTkiv.mjs → CommentsPlugin.native-03659874.mjs} +55 -28
  16. package/dist/{ConditionalContentPlugin.native-CfhY46rU.mjs → ConditionalContentPlugin.native-4983143a.mjs} +108 -51
  17. package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-63ed405b.mjs} +100 -50
  18. package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-427e9d75.mjs} +79 -40
  19. package/dist/{DirectionPlugin.native-CDnbdNyl.mjs → DirectionPlugin.native-4e742f42.mjs} +19 -10
  20. package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-8e41eda0.mjs} +115 -58
  21. package/dist/{DocumentManagerPlugin.native-C2cs_1w4.mjs → DocumentManagerPlugin.native-e69895ad.mjs} +4 -4
  22. package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-55209c87.mjs} +70 -70
  23. package/dist/{EmojisPlugin.native-CitxxlWX.mjs → EmojisPlugin.native-65c5ac47.mjs} +11 -6
  24. package/dist/{FontFamilyPlugin.native-j8hMTbg4.mjs → FontFamilyPlugin.native-f9bc255a.mjs} +7 -4
  25. package/dist/{FontSizePlugin.native-B_jCh7dY.mjs → FontSizePlugin.native-f5647872.mjs} +19 -10
  26. package/dist/{FootnotePlugin.native-D730OGRm.mjs → FootnotePlugin.native-494657b3.mjs} +77 -39
  27. package/dist/{FullscreenPlugin.native-ChXyxeNw.mjs → FullscreenPlugin.native-87ce92e9.mjs} +1 -1
  28. package/dist/{HeadingPlugin.native-DrLYwQnQ.mjs → HeadingPlugin.native-e38c4a16.mjs} +1 -1
  29. package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-92ed4be4.mjs} +43 -22
  30. package/dist/{IndentPlugin.native-BHixp8sP.mjs → IndentPlugin.native-e4ee902b.mjs} +23 -12
  31. package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-7c95cfbc.mjs} +1 -1
  32. package/dist/{LineHeightPlugin.native-CM7iXdQj.mjs → LineHeightPlugin.native-5668f78c.mjs} +19 -10
  33. package/dist/{LinkPlugin.native-DYCIcdTm.mjs → LinkPlugin.native-6df29111.mjs} +9 -5
  34. package/dist/{ListPlugin.native-V7EZC1lM.mjs → ListPlugin.native-fe2e115a.mjs} +9 -5
  35. package/dist/{MathPlugin.native-f_mDp8VL.mjs → MathPlugin.native-735bbac2.mjs} +9 -5
  36. package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-3cf48a00.mjs} +219 -207
  37. package/dist/{MentionPlugin.native-BMDlOqur.mjs → MentionPlugin.native-3b1e8c05.mjs} +89 -45
  38. package/dist/{MergeTagPlugin.native-C3eOfEgw.mjs → MergeTagPlugin.native-31cf7d48.mjs} +51 -26
  39. package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-7ab10b9f.mjs} +107 -54
  40. package/dist/{PageBreakPlugin.native-DijGuHJZ.mjs → PageBreakPlugin.native-1794c5fb.mjs} +31 -16
  41. package/dist/{PreviewPlugin.native-WuIwOAOR.mjs → PreviewPlugin.native-f7b67cc0.mjs} +11 -6
  42. package/dist/{PrintPlugin.native-7qt5v7L5.mjs → PrintPlugin.native-f6a168c2.mjs} +5 -3
  43. package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-8d45e511.mjs} +72 -37
  44. package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-a6c5efec.mjs} +99 -50
  45. package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-7f06d4ba.mjs} +17 -9
  46. package/dist/{SpellCheckPlugin.native-BZB9AewP.mjs → SpellCheckPlugin.native-04e20834.mjs} +41 -21
  47. package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-905e9501.mjs} +9 -5
  48. package/dist/{TablePlugin.native-DrHX-efe.mjs → TablePlugin.native-7d5458c1.mjs} +58 -30
  49. package/dist/{TemplatePlugin.native-CrpfKRJ8.mjs → TemplatePlugin.native-580f0f63.mjs} +32 -17
  50. package/dist/{TextAlignmentPlugin.native-sM_1s00t.mjs → TextAlignmentPlugin.native-9357b3ed.mjs} +11 -6
  51. package/dist/{TextColorPlugin.native-Bwl_bSmc.mjs → TextColorPlugin.native-d53ed459.mjs} +26 -14
  52. package/dist/{TrackChangesPlugin.native-Bghu2q4a.mjs → TrackChangesPlugin.native-e96da509.mjs} +115 -58
  53. package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-4e711b1e.mjs} +160 -91
  54. package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-8080c998.mjs} +1 -1
  55. package/dist/{VersionDiffPlugin.native-Bvxgy--t.mjs → VersionDiffPlugin.native-5bbeff85.mjs} +51 -26
  56. package/dist/_commonjsHelpers-69d58be2.mjs +31 -0
  57. package/dist/{anchoredPopover-Bxds0VoB.mjs → anchoredPopover-5cca53ba.mjs} +1 -1
  58. package/dist/documentManager-8327fb6e.mjs +9166 -0
  59. package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +3 -2
  60. package/dist/editora.min.js +14 -13
  61. package/dist/editora.umd.js +14 -13
  62. package/dist/{html2canvas.esm-AYkPY5LS.mjs → html2canvas.esm-c51cb3b9.mjs} +978 -894
  63. package/dist/index-072ef022.js +11 -0
  64. package/dist/index-49d31221.mjs +16860 -0
  65. package/dist/{index-DqC57IEH.mjs → index-7da30697.mjs} +163 -124
  66. package/dist/index.cjs.js +1 -1
  67. package/dist/index.es-b47a189f.mjs +5782 -0
  68. package/dist/index.esm.js +12 -7
  69. package/dist/{jspdf.es.min-BJGtOnRT.mjs → jspdf.es.min-780c82db.mjs} +4808 -3784
  70. package/dist/plugin-loader.js +67 -67
  71. package/dist/{purify.es-CKpwg8Tk.mjs → purify.es-3bdbcfc5.mjs} +20 -10
  72. package/dist/style.css +1 -0
  73. package/dist/webcomponent-core.js +164 -125
  74. package/dist/webcomponent-core.min.css +1 -1
  75. package/dist/webcomponent-core.min.js +18 -17
  76. package/dist/webcomponent.cjs.js +1 -1
  77. package/dist/webcomponent.esm.js +1 -1
  78. package/dist/webcomponent.js +226 -187
  79. package/dist/webcomponent.min.css +1 -1
  80. package/dist/webcomponent.min.js +1324 -1117
  81. package/package.json +11 -5
  82. package/LICENSE +0 -21
  83. package/dist/_commonjsHelpers-DOllISpa.mjs +0 -32
  84. package/dist/core.css +0 -1
  85. package/dist/documentManager-vQ1VkbUY.mjs +0 -8418
  86. package/dist/index-BslAFzmv.mjs +0 -16544
  87. package/dist/index-D1LOqg5C.js +0 -10
  88. package/dist/index.es-BYD2KEo6.mjs +0 -6666
@@ -126,9 +126,11 @@ function Re(e) {
126
126
  }
127
127
  function je(e, n) {
128
128
  const t = Re(e).sort(), r = Re(n).sort();
129
- if (t.length !== r.length) return !1;
129
+ if (t.length !== r.length)
130
+ return !1;
130
131
  for (let a = 0; a < t.length; a += 1)
131
- if (t[a] !== r[a]) return !1;
132
+ if (t[a] !== r[a])
133
+ return !1;
132
134
  return !0;
133
135
  }
134
136
  function Ue(e, n) {
@@ -136,7 +138,8 @@ function Ue(e, n) {
136
138
  return t.forEach((o) => {
137
139
  var i, c;
138
140
  const l = j(o.locale || "");
139
- if (!l) return;
141
+ if (!l)
142
+ return;
140
143
  const s = l;
141
144
  a.has(s) || (a.add(s), r.push({
142
145
  locale: s,
@@ -148,7 +151,8 @@ function Ue(e, n) {
148
151
  }));
149
152
  }), e.forEach((o) => {
150
153
  const l = j(o);
151
- if (a.has(l)) return;
154
+ if (a.has(l))
155
+ return;
152
156
  const s = Ee.find((i) => l.startsWith(i.locale));
153
157
  r.push(
154
158
  s ? { ...s, locale: l, label: o } : {
@@ -166,9 +170,10 @@ function ae(e = {}) {
166
170
  var s, i, c, g;
167
171
  const n = e.normalizeText || We, t = A(e.sourceLocale || "en-US"), r = A(e.targetLocale || "fr-FR"), a = /* @__PURE__ */ new Set([t, r]);
168
172
  (Array.isArray(e.locales) ? e.locales : []).forEach((p) => {
169
- if (typeof p != "string") return;
170
- const v = A(p);
171
- a.add(v);
173
+ if (typeof p != "string")
174
+ return;
175
+ const T = A(p);
176
+ T && a.add(T);
172
177
  });
173
178
  const o = Array.from(a), l = Ue(o, e.localeRules);
174
179
  return {
@@ -216,22 +221,28 @@ function we(e) {
216
221
  return e.closest(ke) || e;
217
222
  }
218
223
  function U(e) {
219
- if (!e) return null;
220
- if (e.matches(S)) return e;
224
+ if (!e)
225
+ return null;
226
+ if (e.matches(S))
227
+ return e;
221
228
  const n = e.querySelector(S);
222
229
  return n instanceof HTMLElement ? n : null;
223
230
  }
224
231
  function Ye() {
225
- if (typeof window == "undefined") return null;
232
+ if (typeof window == "undefined")
233
+ return null;
226
234
  const e = window[Te];
227
- if (!(e instanceof HTMLElement)) return null;
235
+ if (!(e instanceof HTMLElement))
236
+ return null;
228
237
  window[Te] = null;
229
238
  const n = U(e);
230
- if (n) return n;
239
+ if (n)
240
+ return n;
231
241
  const t = e.closest(ke);
232
242
  if (t) {
233
243
  const a = U(t);
234
- if (a) return a;
244
+ if (a)
245
+ return a;
235
246
  }
236
247
  const r = e.closest(S);
237
248
  return r instanceof HTMLElement ? r : null;
@@ -256,7 +267,8 @@ function te(e) {
256
267
  }
257
268
  function Je(e) {
258
269
  const n = we(e);
259
- if (te(n)) return !0;
270
+ if (te(n))
271
+ return !0;
260
272
  const t = n.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
261
273
  return te(t) ? !0 : te(document.documentElement) || te(document.body);
262
274
  }
@@ -270,7 +282,8 @@ function Qe(e) {
270
282
  if (!(l.type !== "childList" || l.removedNodes.length === 0))
271
283
  for (let s = 0; s < l.removedNodes.length; s += 1) {
272
284
  const i = l.removedNodes[s];
273
- if (i.nodeType !== Node.ELEMENT_NODE) continue;
285
+ if (i.nodeType !== Node.ELEMENT_NODE)
286
+ continue;
274
287
  const c = i;
275
288
  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}`))
276
289
  return !0;
@@ -283,31 +296,38 @@ function le() {
283
296
  n.isConnected || Se(n);
284
297
  });
285
298
  }
286
- function T(e, n = !0, t = !0) {
299
+ function v(e, n = !0, t = !0) {
287
300
  var s;
288
- if (le(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
301
+ if (le(), (e == null ? void 0 : e.contentElement) instanceof HTMLElement)
302
+ return e.contentElement;
289
303
  if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
290
304
  const i = U(e.editorElement);
291
- if (i) return i;
305
+ if (i)
306
+ return i;
292
307
  }
293
308
  const r = Ye();
294
- if (r) return r;
309
+ if (r)
310
+ return r;
295
311
  const a = window.getSelection();
296
312
  if (a && a.rangeCount > 0) {
297
313
  const i = (s = Ce(a.getRangeAt(0).startContainer)) == null ? void 0 : s.closest(
298
314
  S
299
315
  );
300
- if (i) return i;
316
+ if (i)
317
+ return i;
301
318
  }
302
319
  const o = document.activeElement;
303
320
  if (o) {
304
- if (o.matches(S)) return o;
321
+ if (o.matches(S))
322
+ return o;
305
323
  const i = o.closest(S);
306
- if (i) return i;
324
+ if (i)
325
+ return i;
307
326
  }
308
327
  if (t && x && x.isConnected)
309
328
  return x;
310
- if (!n) return null;
329
+ if (!n)
330
+ return null;
311
331
  const l = document.querySelector(S);
312
332
  return l instanceof HTMLElement ? l : null;
313
333
  }
@@ -317,20 +337,24 @@ function Xe(e) {
317
337
  const r = n.closest(`.${d}`);
318
338
  if (r) {
319
339
  const o = Array.from(h.entries()).find(([, l]) => l === r);
320
- if (o) return o[0];
340
+ if (o)
341
+ return o[0];
321
342
  }
322
343
  const a = n.closest(S);
323
- if (a) return a;
344
+ if (a)
345
+ return a;
324
346
  }
325
347
  const t = document.activeElement;
326
348
  if (t) {
327
349
  const r = t.closest(`.${d}`);
328
350
  if (r) {
329
351
  const o = Array.from(h.entries()).find(([, l]) => l === r);
330
- if (o) return o[0];
352
+ if (o)
353
+ return o[0];
331
354
  }
332
355
  const a = t.closest(S);
333
- if (a) return a;
356
+ if (a)
357
+ return a;
334
358
  }
335
359
  return null;
336
360
  }
@@ -350,7 +374,8 @@ function xe(e) {
350
374
  }
351
375
  function et(e, n) {
352
376
  const t = j(n), r = e.localeRules.find((l) => j(l.locale) === t);
353
- if (r) return r;
377
+ if (r)
378
+ return r;
354
379
  const a = t.split("-")[0], o = e.localeRules.find((l) => j(l.locale).split("-")[0] === a);
355
380
  return o || {
356
381
  locale: t,
@@ -389,13 +414,15 @@ function ue(e, n) {
389
414
  }
390
415
  function He(e) {
391
416
  const n = window.getSelection();
392
- if (!n || n.rangeCount === 0) return null;
417
+ if (!n || n.rangeCount === 0)
418
+ return null;
393
419
  const t = Ce(n.getRangeAt(0).startContainer);
394
420
  return !t || !e.contains(t) ? null : t.closest("[data-translation-segment-id]");
395
421
  }
396
422
  function tt(e, n) {
397
423
  const t = Array.from(e.querySelectorAll(n));
398
- if (t.length <= 1) return t;
424
+ if (t.length <= 1)
425
+ return t;
399
426
  const r = new Set(t);
400
427
  return t.filter((a) => {
401
428
  let o = a.parentElement;
@@ -418,11 +445,13 @@ function nt(e, n, t) {
418
445
  return r;
419
446
  }
420
447
  function me(e, n) {
421
- if (n.lockedSegmentIds.size === 0) return !1;
448
+ if (n.lockedSegmentIds.size === 0)
449
+ return !1;
422
450
  let t = !1;
423
451
  return n.lockedSegmentIds.forEach((r) => {
424
452
  const a = ue(e, r);
425
- if (!a) return;
453
+ if (!a)
454
+ return;
426
455
  ce(a, !0);
427
456
  const o = n.lockedHtmlBySegmentId.get(r);
428
457
  if (typeof o == "string") {
@@ -436,8 +465,8 @@ function M(e, n, t) {
436
465
  var l;
437
466
  const r = tt(e, n.segmentSelector), a = [], o = /* @__PURE__ */ new Set();
438
467
  for (let s = 0; s < r.length && !(a.length >= n.maxSegments); s += 1) {
439
- const i = r[s], c = nt(i, o, i.getAttribute("data-translation-segment-id")), g = t.lockedSegmentIds.has(c), p = i.getAttribute("data-translation-locked") === "true", v = g || p;
440
- if (v)
468
+ const i = r[s], c = nt(i, o, i.getAttribute("data-translation-segment-id")), g = t.lockedSegmentIds.has(c), p = i.getAttribute("data-translation-locked") === "true", T = g || p;
469
+ if (T)
441
470
  if (t.lockedSegmentIds.add(c), ce(i, !0), !t.lockedHtmlBySegmentId.has(c))
442
471
  t.lockedHtmlBySegmentId.set(c, i.innerHTML);
443
472
  else {
@@ -447,7 +476,8 @@ function M(e, n, t) {
447
476
  else
448
477
  t.lockedHtmlBySegmentId.delete(c);
449
478
  const C = n.normalizeText(i.textContent || "");
450
- if (!C) continue;
479
+ if (!C)
480
+ continue;
451
481
  t.sourceTextBySegmentId.has(c) || t.sourceTextBySegmentId.set(c, C);
452
482
  const K = t.sourceTextBySegmentId.get(c) || C;
453
483
  a.push({
@@ -456,7 +486,7 @@ function M(e, n, t) {
456
486
  index: a.length,
457
487
  text: C,
458
488
  sourceText: K,
459
- locked: v
489
+ locked: T
460
490
  }), o.add(c);
461
491
  }
462
492
  return Array.from(t.sourceTextBySegmentId.keys()).forEach((s) => {
@@ -498,7 +528,8 @@ function ye(e) {
498
528
  return Y.get(e) === !0;
499
529
  }
500
530
  function be(e, n) {
501
- if (!n.classList.contains("show")) return;
531
+ if (!n.classList.contains("show"))
532
+ return;
502
533
  const t = we(e).getBoundingClientRect(), r = Math.min(window.innerWidth - 20, 520), a = Math.max(10, window.innerWidth - r - 10), o = Math.min(Math.max(10, t.right - r), a), l = Math.max(10, Math.min(window.innerHeight - 10, t.top + 12));
503
534
  n.style.width = `${r}px`, n.style.left = `${o}px`, n.style.top = `${l}px`, n.style.maxHeight = `${Math.max(260, window.innerHeight - 20)}px`;
504
535
  }
@@ -581,7 +612,8 @@ function E(e) {
581
612
  }
582
613
  function at(e, n) {
583
614
  const t = ue(e, n);
584
- if (!t) return;
615
+ if (!t)
616
+ return;
585
617
  try {
586
618
  t.scrollIntoView({ block: "nearest", inline: "nearest" });
587
619
  } catch (a) {
@@ -596,9 +628,11 @@ function at(e, n) {
596
628
  }
597
629
  function R(e) {
598
630
  const n = h.get(e);
599
- if (!n) return;
631
+ if (!n)
632
+ return;
600
633
  const t = u.get(e) || w;
601
- if (!t) return;
634
+ if (!t)
635
+ return;
602
636
  const r = b(e, t), a = n.querySelector(".rte-translation-source-label");
603
637
  a && (a.textContent = t.labels.sourceLocaleLabel);
604
638
  const o = n.querySelector(".rte-translation-target-label");
@@ -614,8 +648,8 @@ function R(e) {
614
648
  g && (g.textContent = t.labels.helperText);
615
649
  const p = n.querySelector(".rte-translation-shortcut");
616
650
  p && (p.textContent = t.labels.shortcutText);
617
- const v = n.querySelector('[data-action="run-validation"]');
618
- v && (v.textContent = t.labels.validateText);
651
+ const T = n.querySelector('[data-action="run-validation"]');
652
+ T && (T.textContent = t.labels.validateText);
619
653
  const C = n.querySelector('[data-action="capture-source"]');
620
654
  C && (C.textContent = t.labels.captureSourceText);
621
655
  const K = n.querySelector('[data-action="toggle-realtime"]');
@@ -659,7 +693,8 @@ function R(e) {
659
693
  }
660
694
  function Be(e) {
661
695
  const n = u.get(e) || w;
662
- if (!n) return;
696
+ if (!n)
697
+ return;
663
698
  xe(e);
664
699
  const t = window.setTimeout(() => {
665
700
  se.delete(e), L(e, "realtime", !1);
@@ -668,7 +703,8 @@ function Be(e) {
668
703
  }
669
704
  function L(e, n, t) {
670
705
  const r = u.get(e) || w;
671
- if (!r) return [];
706
+ if (!r)
707
+ return [];
672
708
  const a = b(e, r), o = me(e, a);
673
709
  a.segments = M(e, r, a);
674
710
  const l = rt(e, a);
@@ -696,7 +732,8 @@ function L(e, n, t) {
696
732
  }
697
733
  function Pe(e) {
698
734
  const n = u.get(e) || w;
699
- if (!n) return !1;
735
+ if (!n)
736
+ return !1;
700
737
  const t = b(e, n), r = M(e, n, t);
701
738
  r.forEach((o) => {
702
739
  t.sourceTextBySegmentId.set(o.id, o.text);
@@ -715,13 +752,16 @@ function Pe(e) {
715
752
  function ie(e, n, t) {
716
753
  var c, g;
717
754
  const r = u.get(e) || w;
718
- if (!r) return !1;
755
+ if (!r)
756
+ return !1;
719
757
  const a = b(e, r);
720
758
  a.segments = M(e, r, a);
721
759
  const o = ((c = He(e)) == null ? void 0 : c.getAttribute("data-translation-segment-id")) || null, l = n || o || a.selectedSegmentId || ((g = a.segments[0]) == null ? void 0 : g.id) || null;
722
- if (!l) return !1;
760
+ if (!l)
761
+ return !1;
723
762
  const s = ue(e, l);
724
- if (!s) return !1;
763
+ if (!s)
764
+ return !1;
725
765
  const i = typeof t == "boolean" ? t : !a.lockedSegmentIds.has(l);
726
766
  return i ? (a.lockedSegmentIds.add(l), a.lockedHtmlBySegmentId.set(l, s.innerHTML)) : (a.lockedSegmentIds.delete(l), a.lockedHtmlBySegmentId.delete(l)), ce(s, i), a.selectedSegmentId = l, a.snapshot = "", L(e, "lock-segment", !0), e.dispatchEvent(
727
767
  new CustomEvent("editora:translation-segment-lock", {
@@ -735,21 +775,25 @@ function ie(e, n, t) {
735
775
  }
736
776
  function De(e, n) {
737
777
  const t = u.get(e) || w;
738
- if (!t) return !1;
778
+ if (!t)
779
+ return !1;
739
780
  const r = b(e, t), a = typeof n == "boolean" ? n : !r.realtimeEnabled;
740
781
  return r.realtimeEnabled = a, a ? Be(e) : xe(e), R(e), E(e), !0;
741
782
  }
742
783
  function pe(e, n, t = !0) {
743
784
  const r = u.get(e) || w;
744
- if (!r) return !1;
785
+ if (!r)
786
+ return !1;
745
787
  const a = b(e, r);
746
788
  return a.segments = M(e, r, a), a.segments.some((o) => o.id === n) ? (a.selectedSegmentId = n, R(e), E(e), t && at(e, n), !0) : !1;
747
789
  }
748
790
  function re(e, n) {
749
791
  const t = u.get(e) || w;
750
- if (!t) return !1;
792
+ if (!t)
793
+ return !1;
751
794
  const r = b(e, t);
752
- if (r.segments = M(e, t, r), r.segments.length === 0) return !1;
795
+ if (r.segments = M(e, t, r), r.segments.length === 0)
796
+ return !1;
753
797
  const a = Math.max(
754
798
  0,
755
799
  r.segments.findIndex((s) => s.id === r.selectedSegmentId)
@@ -795,7 +839,8 @@ function Ie(e) {
795
839
  }
796
840
  function ut(e) {
797
841
  const n = h.get(e);
798
- if (n) return n;
842
+ if (n)
843
+ return n;
799
844
  const t = u.get(e) || w || ae();
800
845
  b(e, t);
801
846
  const r = `rte-translation-workflow-panel-${Fe++}`, a = `${r}-source`, o = `${r}-target`, l = document.createElement("section");
@@ -856,11 +901,12 @@ function ut(e) {
856
901
  <div class="rte-translation-live" aria-live="polite" aria-atomic="true"></div>
857
902
  `, l.addEventListener("click", (s) => {
858
903
  const i = s.target;
859
- if (!i) return;
904
+ if (!i)
905
+ return;
860
906
  const c = i.closest("[data-action]");
861
907
  if (!c) {
862
- const p = i.closest(".rte-translation-issue[data-segment-id]"), v = (p == null ? void 0 : p.getAttribute("data-segment-id")) || "";
863
- v && pe(e, v, !0);
908
+ const p = i.closest(".rte-translation-issue[data-segment-id]"), T = (p == null ? void 0 : p.getAttribute("data-segment-id")) || "";
909
+ T && pe(e, T, !0);
864
910
  return;
865
911
  }
866
912
  const g = c.getAttribute("data-action");
@@ -895,9 +941,11 @@ function ut(e) {
895
941
  }
896
942
  }), l.addEventListener("change", (s) => {
897
943
  const i = s.target;
898
- if (!(i instanceof HTMLSelectElement)) return;
944
+ if (!(i instanceof HTMLSelectElement))
945
+ return;
899
946
  const c = u.get(e) || w;
900
- if (!c) return;
947
+ if (!c)
948
+ return;
901
949
  const g = b(e, c);
902
950
  if (i.getAttribute("data-field") === "source-locale") {
903
951
  g.sourceLocale = A(i.value), g.snapshot = "", L(e, "source-locale-change", !0);
@@ -918,7 +966,8 @@ function dt(e) {
918
966
  var i;
919
967
  le();
920
968
  const t = n.target, r = t == null ? void 0 : t.closest(S);
921
- if (!r) return;
969
+ if (!r)
970
+ return;
922
971
  const a = u.get(r) || e, o = b(r, a);
923
972
  u.set(r, a), x = r;
924
973
  const l = ((i = He(r)) == null ? void 0 : i.getAttribute("data-translation-segment-id")) || null;
@@ -927,9 +976,11 @@ function dt(e) {
927
976
  s && (ge(s, r), be(r, s), R(r));
928
977
  }, document.addEventListener("focusin", N, !0)), O || (O = (n) => {
929
978
  const t = n.target, r = t == null ? void 0 : t.closest(S);
930
- if (!r) return;
979
+ if (!r)
980
+ return;
931
981
  const a = u.get(r) || w;
932
- if (!a) return;
982
+ if (!a)
983
+ return;
933
984
  const o = b(r, a), l = me(r, o);
934
985
  if (o.segments = M(r, a, o), !o.realtimeEnabled) {
935
986
  if (l) {
@@ -942,21 +993,26 @@ function dt(e) {
942
993
  Be(r);
943
994
  }, document.addEventListener("input", O, !0)), _ || (_ = (n) => {
944
995
  const t = n, r = t.target, a = r == null ? void 0 : r.closest(S);
945
- if (!a) return;
996
+ if (!a)
997
+ return;
946
998
  const o = Ie(r);
947
- if (!o || !a.contains(o)) return;
999
+ if (!o || !a.contains(o))
1000
+ return;
948
1001
  t.preventDefault();
949
1002
  const l = h.get(a), s = u.get(a) || w;
950
1003
  l && s && P(l, s.labels.readonlySegmentMessage);
951
1004
  }, document.addEventListener("beforeinput", _, !0)), F || (F = (n) => {
952
- if (n.defaultPrevented) return;
1005
+ if (n.defaultPrevented)
1006
+ return;
953
1007
  const t = n.target;
954
- if ((t == null ? void 0 : t.closest(`.${d}`)) && n.key !== "Escape" && !Me.has(n.key)) return;
1008
+ if ((t == null ? void 0 : t.closest(`.${d}`)) && n.key !== "Escape" && !Me.has(n.key))
1009
+ return;
955
1010
  const a = n.key === "Escape", o = lt(n), l = st(n), s = it(n), i = Ie(t);
956
1011
  if (!a && !o && !l && !s && !i)
957
1012
  return;
958
1013
  const c = Xe(n);
959
- if (!c) return;
1014
+ if (!c)
1015
+ return;
960
1016
  const g = u.get(c) || w || e;
961
1017
  if (b(c, g), u.set(c, g), x = c, a && ye(c)) {
962
1018
  n.preventDefault(), G(c, !0);
@@ -984,7 +1040,8 @@ function dt(e) {
984
1040
  }, window.addEventListener("scroll", I, !0), window.addEventListener("resize", I)), !W && typeof MutationObserver != "undefined" && document.body && (W = new MutationObserver((n) => {
985
1041
  Qe(n) && le(), n.some((r) => r.type === "characterData" ? !0 : r.type === "childList" && (r.addedNodes.length > 0 || r.removedNodes.length > 0)) && Z.forEach((r) => {
986
1042
  const a = D.get(r);
987
- if (!a || a.lockedSegmentIds.size === 0 || !me(r, a)) return;
1043
+ if (!a || a.lockedSegmentIds.size === 0 || !me(r, a))
1044
+ return;
988
1045
  a.snapshot = "";
989
1046
  const l = u.get(r) || w, s = h.get(r);
990
1047
  s && l && P(s, l.labels.readonlySegmentMessage), l && (a.segments = M(r, l, a), R(r), E(r));
@@ -999,7 +1056,8 @@ function ft() {
999
1056
  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;
1000
1057
  }
1001
1058
  function gt() {
1002
- if (typeof document == "undefined" || document.getElementById(ve)) return;
1059
+ if (typeof document == "undefined" || document.getElementById(ve))
1060
+ return;
1003
1061
  const e = document.createElement("style");
1004
1062
  e.id = ve, e.textContent = `
1005
1063
  .rte-toolbar-group-items.${y},
@@ -1609,58 +1667,67 @@ const mt = (e = {}) => {
1609
1667
  ],
1610
1668
  commands: {
1611
1669
  translationWorkflow: (r, a) => {
1612
- const o = T(a, !1, !1);
1613
- if (!o) return !1;
1670
+ const o = v(a, !1, !1);
1671
+ if (!o)
1672
+ return !1;
1614
1673
  const l = u.get(o) || n;
1615
1674
  return b(o, l), u.set(o, l), x = o, he(o), !0;
1616
1675
  },
1617
1676
  openTranslationWorkflowPanel: (r, a) => {
1618
- const o = T(a, !1, !1);
1619
- if (!o) return !1;
1677
+ const o = v(a, !1, !1);
1678
+ if (!o)
1679
+ return !1;
1620
1680
  const l = u.get(o) || n;
1621
1681
  return b(o, l), u.set(o, l), x = o, he(o), !0;
1622
1682
  },
1623
1683
  toggleTranslationWorkflowPanel: (r, a) => {
1624
- const o = T(a, !1, !1);
1625
- if (!o) return !1;
1684
+ const o = v(a, !1, !1);
1685
+ if (!o)
1686
+ return !1;
1626
1687
  const l = u.get(o) || n;
1627
1688
  return b(o, l), u.set(o, l), x = o, ze(o, typeof r == "boolean" ? r : void 0);
1628
1689
  },
1629
1690
  runTranslationLocaleValidation: (r, a) => {
1630
- const o = T(a, !1, !1);
1631
- if (!o) return !1;
1691
+ const o = v(a, !1, !1);
1692
+ if (!o)
1693
+ return !1;
1632
1694
  const l = u.get(o) || n;
1633
1695
  return b(o, l), u.set(o, l), x = o, L(o, "command", !0), !0;
1634
1696
  },
1635
1697
  toggleTranslationRealtime: (r, a) => {
1636
- const o = T(a, !1, !1);
1637
- if (!o) return !1;
1698
+ const o = v(a, !1, !1);
1699
+ if (!o)
1700
+ return !1;
1638
1701
  const l = u.get(o) || n;
1639
1702
  return b(o, l), u.set(o, l), x = o, De(o, typeof r == "boolean" ? r : void 0);
1640
1703
  },
1641
1704
  toggleTranslationSegmentLock: (r, a) => {
1642
- const o = T(a, !1, !1);
1643
- if (!o) return !1;
1705
+ const o = v(a, !1, !1);
1706
+ if (!o)
1707
+ return !1;
1644
1708
  const l = u.get(o) || n;
1645
1709
  b(o, l), u.set(o, l), x = o;
1646
1710
  const s = typeof r == "boolean" ? r : r == null ? void 0 : r.locked, i = typeof r == "object" ? r == null ? void 0 : r.segmentId : void 0;
1647
1711
  return ie(o, i, s);
1648
1712
  },
1649
1713
  setTranslationLocales: (r, a) => {
1650
- const o = T(a, !1, !1);
1651
- if (!o || !r || typeof r != "object") return !1;
1714
+ const o = v(a, !1, !1);
1715
+ if (!o || !r || typeof r != "object")
1716
+ return !1;
1652
1717
  const l = u.get(o) || n, s = b(o, l);
1653
1718
  return u.set(o, l), typeof r.sourceLocale == "string" && r.sourceLocale.trim() && (s.sourceLocale = A(r.sourceLocale)), typeof r.targetLocale == "string" && r.targetLocale.trim() && (s.targetLocale = A(r.targetLocale)), s.snapshot = "", L(o, "set-locales", !0), !0;
1654
1719
  },
1655
1720
  captureTranslationSourceSnapshot: (r, a) => {
1656
- const o = T(a, !1, !1);
1657
- if (!o) return !1;
1721
+ const o = v(a, !1, !1);
1722
+ if (!o)
1723
+ return !1;
1658
1724
  const l = u.get(o) || n;
1659
1725
  return b(o, l), u.set(o, l), x = o, Pe(o);
1660
1726
  },
1661
1727
  setTranslationWorkflowOptions: (r, a) => {
1662
- const o = T(a, !1, !1);
1663
- if (!o || !r || typeof r != "object") return !1;
1728
+ const o = v(a, !1, !1);
1729
+ if (!o || !r || typeof r != "object")
1730
+ return !1;
1664
1731
  const l = u.get(o) || n, s = oe.get(o) || Ge(l), i = {
1665
1732
  ...s,
1666
1733
  ...r,
@@ -1677,8 +1744,9 @@ const mt = (e = {}) => {
1677
1744
  return typeof r.enableRealtime == "boolean" && (g.realtimeEnabled = r.enableRealtime), typeof r.sourceLocale == "string" && r.sourceLocale.trim() && (g.sourceLocale = A(r.sourceLocale)), typeof r.targetLocale == "string" && r.targetLocale.trim() && (g.targetLocale = A(r.targetLocale)), g.snapshot = "", L(o, "set-options", !0), R(o), E(o), !0;
1678
1745
  },
1679
1746
  getTranslationWorkflowState: (r, a) => {
1680
- const o = T(a, !1, !1);
1681
- if (!o) return !1;
1747
+ const o = v(a, !1, !1);
1748
+ if (!o)
1749
+ return !1;
1682
1750
  const l = u.get(o) || n;
1683
1751
  b(o, l);
1684
1752
  const s = qe(o);
@@ -1707,12 +1775,13 @@ const mt = (e = {}) => {
1707
1775
  ee += 1;
1708
1776
  const o = this && typeof this.__pluginConfig == "object" ? { ...e, ...this.__pluginConfig } : e, l = ae(o);
1709
1777
  dt(l);
1710
- const s = T(
1778
+ const s = v(
1711
1779
  a != null && a.editorElement ? { editorElement: a.editorElement } : void 0,
1712
1780
  !1,
1713
1781
  !1
1714
1782
  );
1715
- if (!s) return;
1783
+ if (!s)
1784
+ return;
1716
1785
  x = s, t.add(s);
1717
1786
  const i = b(s, l);
1718
1787
  u.set(s, l), oe.set(s, o), i.segments = M(s, l, i), L(s, "init", !0), E(s);
@@ -1725,4 +1794,4 @@ const mt = (e = {}) => {
1725
1794
  export {
1726
1795
  mt as TranslationWorkflowPlugin
1727
1796
  };
1728
- //# sourceMappingURL=TranslationWorkflowPlugin.native-Bz6jDGvj.mjs.map
1797
+ //# sourceMappingURL=TranslationWorkflowPlugin.native-4e711b1e.mjs.map
@@ -32,4 +32,4 @@ const e = () => ({
32
32
  export {
33
33
  e as UnderlinePlugin
34
34
  };
35
- //# sourceMappingURL=UnderlinePlugin.native-QpIcK4L2.mjs.map
35
+ //# sourceMappingURL=UnderlinePlugin.native-8080c998.mjs.map