@sobree/block-tools 0.1.9 → 0.1.11

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import './index.css';var V = Object.defineProperty;
2
2
  var z = (n, t, e) => t in n ? V(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var b = (n, t, e) => z(n, typeof t != "symbol" ? t + "" : t, e);
4
- import { resolveStyleCascade as K, toggleMark as j, MARK_PROP as U, MARK_ON as W, PAGE_SIZES as Z, enterZoneEdit as Q } from "@sobree/core";
4
+ import { PAGE_SIZES as K, resolveStyleCascade as j, toggleMark as U, MARK_PROP as W, MARK_ON as Z, enterZoneEdit as Q } from "@sobree/core";
5
5
  const Y = '<path d="M13 4v16"/><path d="M17 4v16"/><path d="M19 4H9.5a4.5 4.5 0 0 0 0 9H13"/>', J = '<path d="M4 12h8"/><path d="M4 18V6"/><path d="M12 18V6"/><path d="m17 12 3-2v8"/>', X = '<path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/>', tt = '<path d="M10 12h11"/><path d="M10 18h11"/><path d="M10 6h11"/><path d="M4 10h2"/><path d="M4 6h1v4"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/>', et = '<path d="M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/><path d="M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/>', nt = '<path d="M12 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/>', ot = '<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>', it = '<path d="m18 15-6-6-6 6"/>', rt = '<path d="m6 9 6 6 6-6"/>', at = '<path d="M3 12h18"/><path d="m8 8 4-4 4 4"/><path d="m16 16-4 4-4-4"/>', I = {
6
6
  paragraph: { kind: "paragraph", label: "Paragraph", iconPath: Y },
7
7
  heading: { kind: "heading", label: "Heading", iconPath: J },
@@ -38,7 +38,8 @@ function D(n, t) {
38
38
  const c = e.closest("table");
39
39
  if (c && i.contains(c)) return k({ kind: "table", element: c, paper: i });
40
40
  const r = e.closest("h1, h2, h3, h4, h5, h6");
41
- if (r && i.contains(r)) return k({ kind: "heading", element: r, paper: i });
41
+ if (r && i.contains(r))
42
+ return k({ kind: "heading", element: r, paper: i });
42
43
  const d = e.closest("blockquote");
43
44
  if (d && i.contains(d)) return k({ kind: "blockquote", element: d, paper: i });
44
45
  const u = e.closest("li");
@@ -217,10 +218,7 @@ class dt {
217
218
  t.left + e,
218
219
  Math.min(o.left, t.right - this.root.offsetWidth - e)
219
220
  );
220
- c ? r = t.top + e : (r = o.top - s - e, r < t.top + e && (r = t.top + e)), d = Math.max(
221
- 0,
222
- Math.min(d, window.innerWidth - this.root.offsetWidth)
223
- ), this.root.style.top = `${r}px`, this.root.style.left = `${d}px`, this.root.classList.toggle("is-stuck", c);
221
+ c ? r = t.top + e : (r = o.top - s - e, r < t.top + e && (r = t.top + e)), d = Math.max(0, Math.min(d, window.innerWidth - this.root.offsetWidth)), this.root.style.top = `${r}px`, this.root.style.left = `${d}px`, this.root.classList.toggle("is-stuck", c);
224
222
  }
225
223
  /**
226
224
  * Case C: if the block is small but the toolbar wouldn't fit above it
@@ -460,12 +458,10 @@ function zt(n, t, e) {
460
458
  if (!o) return;
461
459
  const s = i.body[o.index];
462
460
  if (!s || s.kind !== "paragraph") return;
463
- const a = i.numbering.find(
464
- (g) => {
465
- var f;
466
- return ((f = g.abstractFormat.levels[0]) == null ? void 0 : f.format) === e;
467
- }
468
- );
461
+ const a = i.numbering.find((g) => {
462
+ var f;
463
+ return ((f = g.abstractFormat.levels[0]) == null ? void 0 : f.format) === e;
464
+ });
469
465
  let l, c = i.numbering;
470
466
  a ? l = a.numId : (l = i.numbering.reduce((g, f) => Math.max(g, f.numId), 0) + 1, c = [
471
467
  ...i.numbering,
@@ -520,13 +516,214 @@ function Kt(n) {
520
516
  };
521
517
  n.editor.replaceBlock(t, l);
522
518
  }
519
+ const jt = ["A3", "A4", "A5", "B5", "Letter", "Legal", "Tabloid"], F = ["top", "right", "bottom", "left"], Ut = ["top", "center", "bottom", "both"];
520
+ function Wt(n, t, e) {
521
+ const i = Math.max(1, t.getSectionCount());
522
+ let o = Xt(Jt(t.editor), i);
523
+ const s = t.editor.selection.get(), a = document.createElement("div");
524
+ a.className = "sobree-page-setup-popover sobree-change-popover", a.setAttribute("role", "dialog"), a.setAttribute("aria-label", "Page and section setup"), a.tabIndex = -1, document.body.appendChild(a);
525
+ const l = t.editor.commands.has("section.insertBreakAfter"), c = () => {
526
+ const v = t.getSectionSetup(o);
527
+ a.innerHTML = Zt(i, o, v, l), Yt(
528
+ a,
529
+ t,
530
+ () => o,
531
+ (S) => {
532
+ o = S, c();
533
+ },
534
+ () => y(),
535
+ s
536
+ );
537
+ };
538
+ c();
539
+ const r = n.getBoundingClientRect(), u = Math.max(8, Math.min(window.innerWidth - 320 - 8, r.left));
540
+ a.style.top = `${r.bottom + 6}px`, a.style.left = `${u}px`, requestAnimationFrame(() => a.classList.add("is-open"));
541
+ const h = (v) => {
542
+ const S = v.target;
543
+ a.contains(S) || n.contains(S) || y();
544
+ }, p = window.setTimeout(() => {
545
+ document.addEventListener("mousedown", h, !0);
546
+ }, 0), g = (v) => {
547
+ v.key === "Escape" && (v.preventDefault(), y());
548
+ };
549
+ a.addEventListener("keydown", g), queueMicrotask(() => {
550
+ (a.querySelector("select, input") ?? a).focus();
551
+ });
552
+ let f = !1;
553
+ const y = () => {
554
+ f || (f = !0, window.clearTimeout(p), document.removeEventListener("mousedown", h, !0), a.removeEventListener("keydown", g), a.remove(), e());
555
+ };
556
+ return y;
557
+ }
558
+ function Zt(n, t, e, i) {
559
+ const o = n > 1 ? `
560
+ <label class="ps-row">
561
+ <span class="ps-label">Section</span>
562
+ <select data-field="section">
563
+ ${Array.from({ length: n }, (r, d) => `<option value="${d}"${d === t ? " selected" : ""}>Section ${d + 1}</option>`).join("")}
564
+ </select>
565
+ </label>` : "", s = `
566
+ <div class="ps-section-header">Page</div>
567
+ <div class="ps-grid">
568
+ <label class="ps-row">
569
+ <span class="ps-label">Size</span>
570
+ <select data-field="size">
571
+ ${jt.map((r) => {
572
+ const d = r === e.size ? " selected" : "", u = K[r];
573
+ return `<option value="${r}"${d}>${r} (${u.width} × ${u.height} mm)</option>`;
574
+ }).join("")}
575
+ </select>
576
+ </label>
577
+ <label class="ps-row">
578
+ <span class="ps-label">Orientation</span>
579
+ <select data-field="orientation">
580
+ <option value="portrait"${e.orientation === "portrait" ? " selected" : ""}>Portrait</option>
581
+ <option value="landscape"${e.orientation === "landscape" ? " selected" : ""}>Landscape</option>
582
+ </select>
583
+ </label>
584
+ <div class="ps-row ps-margins">
585
+ <span class="ps-label">Margins (mm)</span>
586
+ <div class="ps-margin-grid">
587
+ ${F.map(
588
+ (r) => `
589
+ <label class="ps-margin">
590
+ <span>${r}</span>
591
+ <input type="number" min="0" step="1" data-field="margin-${r}" value="${e.margins[r]}" />
592
+ </label>`
593
+ ).join("")}
594
+ </div>
595
+ </div>
596
+ </div>`, a = e.header.differentFirst || e.footer.differentFirst, l = e.header.differentLast || e.footer.differentLast, c = `
597
+ <div class="ps-section-header">Section</div>
598
+ <div class="ps-grid">
599
+ <label class="ps-row">
600
+ <span class="ps-label">Vertical alignment</span>
601
+ <select data-field="vertical-align">
602
+ ${Ut.map((r) => {
603
+ const d = r === e.verticalAlign ? " selected" : "";
604
+ return `<option value="${r}"${d}>${Qt(r)}</option>`;
605
+ }).join("")}
606
+ </select>
607
+ </label>
608
+ <label class="ps-row ps-checkbox">
609
+ <input type="checkbox" data-field="different-first"${a ? " checked" : ""} />
610
+ <span>Different header / footer for first page</span>
611
+ </label>
612
+ <label class="ps-row ps-checkbox">
613
+ <input type="checkbox" data-field="different-last"${l ? " checked" : ""} />
614
+ <span>Different header / footer for last page</span>
615
+ </label>
616
+ ${i ? `<button type="button" class="ps-insert-break" data-action="insert-section-break">
617
+ Insert section break after current block
618
+ </button>` : ""}
619
+ </div>`;
620
+ return `
621
+ <div class="ps-header">Page &amp; section setup</div>
622
+ ${o}
623
+ ${s}
624
+ ${c}
625
+ `;
626
+ }
627
+ function Qt(n) {
628
+ return n.charAt(0).toUpperCase() + n.slice(1);
629
+ }
630
+ function Yt(n, t, e, i, o, s) {
631
+ const a = n.querySelector('select[data-field="section"]');
632
+ a && a.addEventListener("change", () => {
633
+ const p = Number(a.value);
634
+ Number.isFinite(p) && i(p);
635
+ });
636
+ const l = n.querySelector('select[data-field="size"]');
637
+ l == null || l.addEventListener("change", () => {
638
+ t.setSectionSetup(e(), { size: l.value });
639
+ });
640
+ const c = n.querySelector('select[data-field="orientation"]');
641
+ c == null || c.addEventListener("change", () => {
642
+ t.setSectionSetup(e(), {
643
+ orientation: c.value
644
+ });
645
+ });
646
+ for (const p of F) {
647
+ const g = n.querySelector(`input[data-field="margin-${p}"]`);
648
+ if (!g) continue;
649
+ const f = () => {
650
+ const v = Number(g.value);
651
+ if (!Number.isFinite(v) || v < 0) return;
652
+ const S = t.getSectionSetup(e()), G = document.activeElement === g, x = g.selectionStart, C = g.selectionEnd;
653
+ t.setSectionSetup(e(), {
654
+ margins: { ...S.margins, [p]: v }
655
+ }), G && requestAnimationFrame(() => {
656
+ requestAnimationFrame(() => {
657
+ if (document.activeElement !== g && g.focus(), x !== null && C !== null)
658
+ try {
659
+ g.setSelectionRange(x, C);
660
+ } catch {
661
+ }
662
+ });
663
+ });
664
+ }, y = te(f, 1e3);
665
+ g.addEventListener("input", y), g.addEventListener("change", f);
666
+ }
667
+ const r = n.querySelector('select[data-field="vertical-align"]');
668
+ r == null || r.addEventListener("change", () => {
669
+ t.setSectionSetup(e(), {
670
+ verticalAlign: r.value
671
+ });
672
+ });
673
+ const d = n.querySelector(
674
+ 'input[data-field="different-first"]'
675
+ );
676
+ d == null || d.addEventListener("change", () => {
677
+ const p = t.getSectionSetup(e()), g = d.checked;
678
+ t.setSectionSetup(e(), {
679
+ header: { ...p.header, differentFirst: g },
680
+ footer: { ...p.footer, differentFirst: g }
681
+ });
682
+ });
683
+ const u = n.querySelector('input[data-field="different-last"]');
684
+ u == null || u.addEventListener("change", () => {
685
+ const p = t.getSectionSetup(e()), g = u.checked;
686
+ t.setSectionSetup(e(), {
687
+ header: { ...p.header, differentLast: g },
688
+ footer: { ...p.footer, differentLast: g }
689
+ });
690
+ });
691
+ const h = n.querySelector(
692
+ 'button[data-action="insert-section-break"]'
693
+ );
694
+ h == null || h.addEventListener("click", (p) => {
695
+ p.preventDefault(), s && t.editor.selection.set(s), t.editor.commands.execute("section.insertBreakAfter"), o();
696
+ });
697
+ }
698
+ function Jt(n) {
699
+ const t = n.selection.currentBlock();
700
+ if (!t) return 0;
701
+ const e = n.getBlocks();
702
+ let i = 0;
703
+ for (const o of e) {
704
+ if (o.id === t.id) return i;
705
+ o.kind === "section_break" && (i += 1);
706
+ }
707
+ return i;
708
+ }
709
+ function Xt(n, t) {
710
+ return !Number.isFinite(n) || n < 0 ? 0 : n >= t ? Math.max(0, t - 1) : n;
711
+ }
712
+ function te(n, t) {
713
+ let e = null;
714
+ return () => {
715
+ e !== null && clearTimeout(e), e = setTimeout(() => {
716
+ e = null, n();
717
+ }, t);
718
+ };
719
+ }
523
720
  const E = {
524
721
  blockKind: null,
525
722
  paragraphProps: null,
526
723
  listFormat: null,
527
724
  runProps: {}
528
725
  };
529
- function F(n) {
726
+ function _(n) {
530
727
  const t = n.selection.currentCaret();
531
728
  if (!t) return E;
532
729
  const e = n.getDocument(), i = n.getBlockById(t.block.id);
@@ -538,31 +735,31 @@ function F(n) {
538
735
  ...E,
539
736
  blockKind: o.kind
540
737
  };
541
- const s = Ut(n, o), { runDefaults: a } = K(e.styles, o.properties.styleId);
738
+ const s = ne(n, o), { runDefaults: a } = j(e.styles, o.properties.styleId);
542
739
  return {
543
740
  blockKind: "paragraph",
544
741
  paragraphProps: o.properties,
545
- listFormat: jt(e, o),
742
+ listFormat: ee(e, o),
546
743
  runProps: { ...a, ...s }
547
744
  };
548
745
  }
549
- function jt(n, t) {
746
+ function ee(n, t) {
550
747
  var s;
551
748
  const e = t.properties.numbering;
552
749
  if (!e) return null;
553
750
  const i = n.numbering.find((a) => a.numId === e.numId), o = (s = i == null ? void 0 : i.abstractFormat.levels[0]) == null ? void 0 : s.format;
554
751
  return o === "bullet" || o === "decimal" ? o : null;
555
752
  }
556
- function Ut(n, t) {
753
+ function ne(n, t) {
557
754
  const e = n.selection.currentRange();
558
755
  if (e && e.from.block.id === e.to.block.id) {
559
- const o = Math.min(e.from.offset, e.to.offset), s = Math.max(e.from.offset, e.to.offset), a = Wt(t.runs, o, s);
560
- return a.length === 0 ? {} : Qt(a.map((l) => l.properties));
756
+ const o = Math.min(e.from.offset, e.to.offset), s = Math.max(e.from.offset, e.to.offset), a = oe(t.runs, o, s);
757
+ return a.length === 0 ? {} : re(a.map((l) => l.properties));
561
758
  }
562
759
  const i = n.selection.currentCaret();
563
- return i ? Zt(t.runs, i.offset) : {};
760
+ return i ? ie(t.runs, i.offset) : {};
564
761
  }
565
- function Wt(n, t, e) {
762
+ function oe(n, t, e) {
566
763
  const i = [];
567
764
  let o = 0;
568
765
  return s(n), i;
@@ -576,13 +773,13 @@ function Wt(n, t, e) {
576
773
  }
577
774
  }
578
775
  }
579
- function Zt(n, t) {
776
+ function ie(n, t) {
580
777
  let e = 0, i = {};
581
778
  for (const o of n) {
582
779
  const s = L(o);
583
780
  if (o.kind === "text") i = o.properties;
584
781
  else if (o.kind === "hyperlink") {
585
- const a = _(o.children);
782
+ const a = O(o.children);
586
783
  a && (i = a);
587
784
  }
588
785
  if (t > e && t <= e + s)
@@ -591,12 +788,12 @@ function Zt(n, t) {
591
788
  }
592
789
  return i;
593
790
  }
594
- function _(n) {
791
+ function O(n) {
595
792
  let t = null;
596
793
  for (const e of n)
597
794
  if (e.kind === "text") t = e.properties;
598
795
  else if (e.kind === "hyperlink") {
599
- const i = _(e.children);
796
+ const i = O(e.children);
600
797
  i && (t = i);
601
798
  }
602
799
  return t;
@@ -610,7 +807,7 @@ function L(n) {
610
807
  }
611
808
  return 1;
612
809
  }
613
- function Qt(n) {
810
+ function re(n) {
614
811
  if (n.length === 0) return {};
615
812
  const t = n[0], e = {};
616
813
  for (const [i, o] of Object.entries(t)) {
@@ -625,12 +822,12 @@ function Qt(n) {
625
822
  }
626
823
  return e;
627
824
  }
628
- function Yt(n) {
825
+ function ae(n) {
629
826
  if (n === "table" || n === "header" || n === "footer") return "";
630
- const e = [ee()];
631
- return n === "heading" && e.push(ne()), (n === "list" || n === "listOrdered") && e.push(oe()), n === "image" && e.push(ie()), `<div class="tb-divider"></div>${e.join('<div class="tb-divider"></div>')}`;
827
+ const e = [de()];
828
+ return n === "heading" && e.push(ue()), (n === "list" || n === "listOrdered") && e.push(pe()), n === "image" && e.push(he()), `<div class="tb-divider"></div>${e.join('<div class="tb-divider"></div>')}`;
632
829
  }
633
- function Jt(n, t) {
830
+ function se(n, t) {
634
831
  const e = [], i = (c) => {
635
832
  const r = c.target.closest('button[data-action="align"]');
636
833
  if (!r) return;
@@ -639,7 +836,7 @@ function Jt(n, t) {
639
836
  const u = d === "justify" ? "both" : d;
640
837
  u !== "left" && u !== "center" && u !== "right" && u !== "both" || B(t, (h) => {
641
838
  const p = t.editor.applyBlockProperties([h], { alignment: u });
642
- O("align", p);
839
+ q("align", p);
643
840
  });
644
841
  };
645
842
  n.addEventListener("click", i), e.push(() => n.removeEventListener("click", i));
@@ -672,11 +869,12 @@ function Jt(n, t) {
672
869
  const d = r.target.closest("button[data-action]");
673
870
  if (!d) return;
674
871
  const u = d.getAttribute("data-action");
675
- if (u === "toggle-list-kind") ae(t);
872
+ if (u === "toggle-list-kind") be(t);
676
873
  else if (u === "align-list") {
677
874
  const h = d.getAttribute("data-arg"), p = h === "justify" ? "both" : h;
678
- if (p !== "left" && p !== "center" && p !== "right" && p !== "both") return;
679
- re(t, p);
875
+ if (p !== "left" && p !== "center" && p !== "right" && p !== "both")
876
+ return;
877
+ ge(t, p);
680
878
  }
681
879
  };
682
880
  n.addEventListener("click", c), e.push(() => n.removeEventListener("click", c));
@@ -686,43 +884,37 @@ function Jt(n, t) {
686
884
  const u = d.target;
687
885
  if (u.getAttribute("data-role") !== "image-alt") return;
688
886
  const p = u.value;
689
- se(t, p);
887
+ fe(t, p);
690
888
  };
691
889
  n.addEventListener("input", c), e.push(() => n.removeEventListener("input", c));
692
890
  const r = (d) => {
693
891
  const u = d.target.closest("button[data-action]");
694
- (u == null ? void 0 : u.getAttribute("data-action")) === "delete-image" && le(t);
892
+ (u == null ? void 0 : u.getAttribute("data-action")) === "delete-image" && me(t);
695
893
  };
696
894
  n.addEventListener("click", r), e.push(() => n.removeEventListener("click", r));
697
895
  }
698
- const s = () => Xt(n, t), a = t.editor.on("selection", s), l = t.editor.on("change", s);
896
+ const s = () => le(n, t), a = t.editor.on("selection", s), l = t.editor.on("change", s);
699
897
  return e.push(a, l), s(), () => {
700
898
  for (const c of e) c();
701
899
  };
702
900
  }
703
- function Xt(n, t) {
901
+ function le(n, t) {
704
902
  var r, d, u;
705
- const e = F(t.editor), i = (r = e.paragraphProps) == null ? void 0 : r.alignment, o = i === "both" ? "justify" : i === void 0 ? "left" : i, s = n.querySelectorAll(
706
- 'button[data-action="align"]'
707
- );
903
+ const e = _(t.editor), i = (r = e.paragraphProps) == null ? void 0 : r.alignment, o = i === "both" ? "justify" : i === void 0 ? "left" : i, s = n.querySelectorAll('button[data-action="align"]');
708
904
  for (const h of s) {
709
905
  const p = h.getAttribute("data-arg") === o;
710
906
  h.setAttribute("aria-pressed", String(p)), h.classList.toggle("is-active", p);
711
907
  }
712
- const a = n.querySelector(
713
- 'select[data-role="line-spacing"]'
714
- );
908
+ const a = n.querySelector('select[data-role="line-spacing"]');
715
909
  if (a) {
716
910
  const h = (d = e.paragraphProps) == null ? void 0 : d.spacing;
717
911
  if (h != null && h.line && h.lineRule === "auto") {
718
- const p = h.line / 240, g = te(a, String(p));
912
+ const p = h.line / 240, g = ce(a, String(p));
719
913
  a.value = g ?? "";
720
914
  } else
721
915
  a.value = "";
722
916
  }
723
- const l = n.querySelector(
724
- 'select[data-role="heading-level"]'
725
- );
917
+ const l = n.querySelector('select[data-role="heading-level"]');
726
918
  if (l) {
727
919
  const h = (u = e.paragraphProps) == null ? void 0 : u.styleId, p = h == null ? void 0 : h.match(/^Heading([1-6])$/);
728
920
  l.value = (p == null ? void 0 : p[1]) ?? "";
@@ -735,12 +927,12 @@ function Xt(n, t) {
735
927
  c.innerHTML = m(h ? "list-numbered" : "list-bullet"), c.title = h ? "Switch to bullet list" : "Switch to numbered list";
736
928
  }
737
929
  }
738
- function te(n, t) {
930
+ function ce(n, t) {
739
931
  for (const e of Array.from(n.options))
740
932
  if (e.value === t) return t;
741
933
  return null;
742
934
  }
743
- function ee() {
935
+ function de() {
744
936
  return `
745
937
  <div class="tb-group" data-group="alignment">
746
938
  <button type="button" data-action="align" data-arg="left" title="Align left">${m("align-left")}</button>
@@ -757,7 +949,7 @@ function ee() {
757
949
  </div>
758
950
  `;
759
951
  }
760
- function ne() {
952
+ function ue() {
761
953
  return `
762
954
  <div class="tb-group" data-group="heading">
763
955
  <select data-role="heading-level" aria-label="Heading level" title="Heading level">
@@ -772,7 +964,7 @@ function ne() {
772
964
  </div>
773
965
  `;
774
966
  }
775
- function oe(n) {
967
+ function pe(n) {
776
968
  return `
777
969
  <div class="tb-group" data-group="list">
778
970
  <button type="button" data-action="toggle-list-kind" title="Toggle bullet / numbered">${m("list-numbered")}</button>
@@ -783,7 +975,7 @@ function oe(n) {
783
975
  </div>
784
976
  `;
785
977
  }
786
- function ie() {
978
+ function he() {
787
979
  return `
788
980
  <div class="tb-group" data-group="image">
789
981
  <input type="text" data-role="image-alt" placeholder="Alt text" aria-label="Alt text" title="Alt text (screen reader description)" />
@@ -795,7 +987,7 @@ function B(n, t) {
795
987
  const e = w(n);
796
988
  e && t(e);
797
989
  }
798
- function O(n, t) {
990
+ function q(n, t) {
799
991
  t.ok || console.warn(`[block-tools] ${n} failed:`, t.error);
800
992
  }
801
993
  function w(n) {
@@ -807,7 +999,7 @@ function w(n) {
807
999
  const e = n.editor.selection.currentCaret();
808
1000
  return (e == null ? void 0 : e.block) ?? n.editor.getBlocks()[0] ?? null;
809
1001
  }
810
- function re(n, t) {
1002
+ function ge(n, t) {
811
1003
  var u, h;
812
1004
  const e = w(n);
813
1005
  if (!e) return;
@@ -819,13 +1011,15 @@ function re(n, t) {
819
1011
  let l = i.index;
820
1012
  for (; l > 0; ) {
821
1013
  const p = o.body[l - 1];
822
- if (!p || p.kind !== "paragraph" || ((u = p.properties.numbering) == null ? void 0 : u.numId) !== a) break;
1014
+ if (!p || p.kind !== "paragraph" || ((u = p.properties.numbering) == null ? void 0 : u.numId) !== a)
1015
+ break;
823
1016
  l--;
824
1017
  }
825
1018
  let c = i.index + 1;
826
1019
  for (; c < o.body.length; ) {
827
1020
  const p = o.body[c];
828
- if (!p || p.kind !== "paragraph" || ((h = p.properties.numbering) == null ? void 0 : h.numId) !== a) break;
1021
+ if (!p || p.kind !== "paragraph" || ((h = p.properties.numbering) == null ? void 0 : h.numId) !== a)
1022
+ break;
829
1023
  c++;
830
1024
  }
831
1025
  const r = [];
@@ -837,9 +1031,9 @@ function re(n, t) {
837
1031
  f && r.push({ id: f.id, version: f.version });
838
1032
  }
839
1033
  const d = n.editor.applyBlockProperties(r, { alignment: t });
840
- O("align-list", d);
1034
+ q("align-list", d);
841
1035
  }
842
- function ae(n) {
1036
+ function be(n) {
843
1037
  var p;
844
1038
  const t = w(n);
845
1039
  if (!t) return;
@@ -847,12 +1041,10 @@ function ae(n) {
847
1041
  if (!i) return;
848
1042
  const o = e.body[i.index];
849
1043
  if (!o || o.kind !== "paragraph" || !o.properties.numbering) return;
850
- const s = e.numbering.find(
851
- (g) => {
852
- var f;
853
- return g.numId === ((f = o.properties.numbering) == null ? void 0 : f.numId);
854
- }
855
- );
1044
+ const s = e.numbering.find((g) => {
1045
+ var f;
1046
+ return g.numId === ((f = o.properties.numbering) == null ? void 0 : f.numId);
1047
+ });
856
1048
  if (!s) return;
857
1049
  const l = (((p = s.abstractFormat.levels[0]) == null ? void 0 : p.format) ?? "bullet") !== "bullet", c = e.numbering.find(
858
1050
  (g) => {
@@ -887,19 +1079,17 @@ function ae(n) {
887
1079
  const h = { ...e, numbering: d, body: u };
888
1080
  n.editor.setDocument(h);
889
1081
  }
890
- function se(n, t) {
1082
+ function fe(n, t) {
891
1083
  const e = w(n);
892
1084
  if (!e) return;
893
1085
  const i = n.editor.getDocument(), o = n.editor.getBlockById(e.id);
894
1086
  if (!o) return;
895
1087
  const s = i.body[o.index];
896
1088
  if (!s || s.kind !== "paragraph") return;
897
- const a = s.runs.map(
898
- (l) => l.kind === "drawing" ? { ...l, altText: t } : l
899
- );
1089
+ const a = s.runs.map((l) => l.kind === "drawing" ? { ...l, altText: t } : l);
900
1090
  n.editor.replaceBlock(e, { ...s, runs: a });
901
1091
  }
902
- function le(n) {
1092
+ function me(n) {
903
1093
  const t = w(n);
904
1094
  if (!t) return;
905
1095
  const e = n.editor.getDocument(), i = n.editor.getBlockById(t.id);
@@ -909,7 +1099,7 @@ function le(n) {
909
1099
  const s = o.runs.filter((a) => a.kind !== "drawing");
910
1100
  n.editor.replaceBlock(t, { ...o, runs: s });
911
1101
  }
912
- function ce(n, t) {
1102
+ function ve(n, t) {
913
1103
  const e = `
914
1104
  <div class="tb-divider"></div>
915
1105
  <div class="tb-pill" role="tablist" aria-label="Table scope">
@@ -925,9 +1115,9 @@ function ce(n, t) {
925
1115
  </div>
926
1116
  <div class="tb-divider"></div>
927
1117
  `;
928
- return n === "cell" ? e + ue(t) : e + pe();
1118
+ return n === "cell" ? e + ye(t) : e + Se();
929
1119
  }
930
- function de(n, t, e) {
1120
+ function ke(n, t, e) {
931
1121
  const i = (s) => {
932
1122
  const a = s.target.closest("button[data-action]");
933
1123
  if (!a || a.hasAttribute("disabled")) return;
@@ -937,7 +1127,7 @@ function de(n, t, e) {
937
1127
  return;
938
1128
  }
939
1129
  const r = P(t);
940
- r && he(t, r, l, c);
1130
+ r && we(t, r, l, c);
941
1131
  }, o = (s) => {
942
1132
  const a = s.target, l = a.getAttribute("data-role");
943
1133
  if (!l) return;
@@ -954,7 +1144,7 @@ function de(n, t, e) {
954
1144
  n.removeEventListener("click", i), n.removeEventListener("change", o);
955
1145
  };
956
1146
  }
957
- function ue(n) {
1147
+ function ye(n) {
958
1148
  const t = n ? "" : "disabled";
959
1149
  return `
960
1150
  <div class="tb-group" data-group="cell-align">
@@ -976,7 +1166,7 @@ function ue(n) {
976
1166
  </div>
977
1167
  `;
978
1168
  }
979
- function pe() {
1169
+ function Se() {
980
1170
  return `
981
1171
  <div class="tb-group" data-group="row-ops">
982
1172
  <button type="button" data-action="row-above" title="Insert row above">+ Row ↑</button>
@@ -996,7 +1186,7 @@ function pe() {
996
1186
  </div>
997
1187
  `;
998
1188
  }
999
- function he(n, t, e, i) {
1189
+ function we(n, t, e, i) {
1000
1190
  if (!e) return;
1001
1191
  const o = n.editor, s = n.cell, a = (s == null ? void 0 : s.row) ?? 0, l = (s == null ? void 0 : s.col) ?? 0;
1002
1192
  switch (e) {
@@ -1006,7 +1196,7 @@ function he(n, t, e, i) {
1006
1196
  if (!r) return;
1007
1197
  const u = o.getDocument().body[r.index];
1008
1198
  if (!u || u.kind !== "table") return;
1009
- const h = u.rows[s.row], p = h == null ? void 0 : h.cells[ge(u, s.row, s.col)];
1199
+ const h = u.rows[s.row], p = h == null ? void 0 : h.cells[Te(u, s.row, s.col)];
1010
1200
  if (!p) return;
1011
1201
  const g = p.content.map(
1012
1202
  (f) => f.kind === "paragraph" ? { ...f, properties: { ...f.properties, alignment: c } } : f
@@ -1065,7 +1255,7 @@ function P(n) {
1065
1255
  const e = n.editor.getBlocks().find((o) => o.kind === "table");
1066
1256
  return e ? { id: e.id, version: e.version } : null;
1067
1257
  }
1068
- function ge(n, t, e) {
1258
+ function Te(n, t, e) {
1069
1259
  var s;
1070
1260
  const i = n.rows[t];
1071
1261
  if (!i) return -1;
@@ -1077,15 +1267,13 @@ function ge(n, t, e) {
1077
1267
  }
1078
1268
  return -1;
1079
1269
  }
1080
- function be(n) {
1270
+ function Ee(n) {
1081
1271
  var c;
1082
1272
  const t = window.getSelection();
1083
1273
  if (!t || t.rangeCount === 0) return null;
1084
1274
  const e = t.anchorNode;
1085
1275
  if (!e) return null;
1086
- const i = (c = e.nodeType === Node.TEXT_NODE ? e.parentElement : e) == null ? void 0 : c.closest(
1087
- "td, th"
1088
- );
1276
+ const i = (c = e.nodeType === Node.TEXT_NODE ? e.parentElement : e) == null ? void 0 : c.closest("td, th");
1089
1277
  if (!i || !n.contains(i)) return null;
1090
1278
  const o = i.parentElement;
1091
1279
  if (!o) return null;
@@ -1150,7 +1338,7 @@ function H(n, t) {
1150
1338
  const d = c.getAttribute("data-tag");
1151
1339
  if (!d) return;
1152
1340
  const u = N(t);
1153
- j(t.editor, u, d), requestAnimationFrame(() => A(n, t));
1341
+ U(t.editor, u, d), requestAnimationFrame(() => A(n, t));
1154
1342
  return;
1155
1343
  }
1156
1344
  if (r === "clear-formatting") {
@@ -1191,36 +1379,26 @@ function H(n, t) {
1191
1379
  };
1192
1380
  }
1193
1381
  function A(n, t) {
1194
- const e = F(t.editor), i = n.querySelectorAll(
1195
- 'button[data-action="wrap"][data-tag]'
1196
- );
1382
+ const e = _(t.editor), i = n.querySelectorAll('button[data-action="wrap"][data-tag]');
1197
1383
  for (const c of i) {
1198
1384
  const r = c.getAttribute("data-tag");
1199
1385
  if (!r || r === "mark") continue;
1200
- const d = U[r], u = W[r], h = d !== void 0 && e.runProps[d] === u;
1386
+ const d = W[r], u = Z[r], h = d !== void 0 && e.runProps[d] === u;
1201
1387
  c.setAttribute("aria-pressed", String(h)), c.classList.toggle("is-active", h);
1202
1388
  }
1203
- const o = n.querySelector(
1204
- 'select[data-role="font-family"]'
1205
- );
1389
+ const o = n.querySelector('select[data-role="font-family"]');
1206
1390
  if (o) {
1207
1391
  const c = e.runProps.fontFamily ?? "";
1208
1392
  o.value = M(o, c) ? c : "";
1209
1393
  }
1210
- const s = n.querySelector(
1211
- 'select[data-role="font-size"]'
1212
- );
1394
+ const s = n.querySelector('select[data-role="font-size"]');
1213
1395
  if (s) {
1214
1396
  const c = e.runProps.fontSizePt, r = c === void 0 ? "" : String(c);
1215
1397
  s.value = M(s, r) ? r : "";
1216
1398
  }
1217
- const a = n.querySelector(
1218
- 'input[data-role="color"]'
1219
- );
1399
+ const a = n.querySelector('input[data-role="color"]');
1220
1400
  a && e.runProps.color && (a.value = e.runProps.color);
1221
- const l = n.querySelector(
1222
- 'input[data-role="highlight"]'
1223
- );
1401
+ const l = n.querySelector('input[data-role="highlight"]');
1224
1402
  l && e.runProps.highlight && (l.value = e.runProps.highlight);
1225
1403
  }
1226
1404
  function M(n, t) {
@@ -1230,239 +1408,15 @@ function M(n, t) {
1230
1408
  }
1231
1409
  function N(n) {
1232
1410
  const t = n.editor.selection.currentRange();
1233
- return t || fe(n.editor, n.target);
1411
+ return t || Ae(n.editor, n.target);
1234
1412
  }
1235
- function fe(n, t) {
1413
+ function Ae(n, t) {
1236
1414
  const e = n.selection.currentCaret(), i = (e == null ? void 0 : e.block) ?? n.getBlocks()[0], o = n.getBlockById(i.id), s = (o == null ? void 0 : o.length) ?? 0;
1237
1415
  return {
1238
1416
  from: { block: i, offset: 0 },
1239
1417
  to: { block: i, offset: s }
1240
1418
  };
1241
1419
  }
1242
- const me = [
1243
- "A3",
1244
- "A4",
1245
- "A5",
1246
- "B5",
1247
- "Letter",
1248
- "Legal",
1249
- "Tabloid"
1250
- ], q = ["top", "right", "bottom", "left"], ve = ["top", "center", "bottom", "both"];
1251
- function ke(n, t, e) {
1252
- const i = Math.max(1, t.getSectionCount());
1253
- let o = Ee(Te(t.editor), i);
1254
- const s = t.editor.selection.get(), a = document.createElement("div");
1255
- a.className = "sobree-page-setup-popover sobree-change-popover", a.setAttribute("role", "dialog"), a.setAttribute("aria-label", "Page and section setup"), a.tabIndex = -1, document.body.appendChild(a);
1256
- const l = t.editor.commands.has("section.insertBreakAfter"), c = () => {
1257
- const v = t.getSectionSetup(o);
1258
- a.innerHTML = ye(i, o, v, l), we(
1259
- a,
1260
- t,
1261
- () => o,
1262
- (S) => {
1263
- o = S, c();
1264
- },
1265
- () => y(),
1266
- s
1267
- );
1268
- };
1269
- c();
1270
- const r = n.getBoundingClientRect(), u = Math.max(
1271
- 8,
1272
- Math.min(window.innerWidth - 320 - 8, r.left)
1273
- );
1274
- a.style.top = `${r.bottom + 6}px`, a.style.left = `${u}px`, requestAnimationFrame(() => a.classList.add("is-open"));
1275
- const h = (v) => {
1276
- const S = v.target;
1277
- a.contains(S) || n.contains(S) || y();
1278
- }, p = window.setTimeout(() => {
1279
- document.addEventListener("mousedown", h, !0);
1280
- }, 0), g = (v) => {
1281
- v.key === "Escape" && (v.preventDefault(), y());
1282
- };
1283
- a.addEventListener("keydown", g), queueMicrotask(() => {
1284
- (a.querySelector("select, input") ?? a).focus();
1285
- });
1286
- let f = !1;
1287
- const y = () => {
1288
- f || (f = !0, window.clearTimeout(p), document.removeEventListener("mousedown", h, !0), a.removeEventListener("keydown", g), a.remove(), e());
1289
- };
1290
- return y;
1291
- }
1292
- function ye(n, t, e, i) {
1293
- const o = n > 1 ? `
1294
- <label class="ps-row">
1295
- <span class="ps-label">Section</span>
1296
- <select data-field="section">
1297
- ${Array.from({ length: n }, (r, d) => `<option value="${d}"${d === t ? " selected" : ""}>Section ${d + 1}</option>`).join("")}
1298
- </select>
1299
- </label>` : "", s = `
1300
- <div class="ps-section-header">Page</div>
1301
- <div class="ps-grid">
1302
- <label class="ps-row">
1303
- <span class="ps-label">Size</span>
1304
- <select data-field="size">
1305
- ${me.map((r) => {
1306
- const d = r === e.size ? " selected" : "", u = Z[r];
1307
- return `<option value="${r}"${d}>${r} (${u.width} × ${u.height} mm)</option>`;
1308
- }).join("")}
1309
- </select>
1310
- </label>
1311
- <label class="ps-row">
1312
- <span class="ps-label">Orientation</span>
1313
- <select data-field="orientation">
1314
- <option value="portrait"${e.orientation === "portrait" ? " selected" : ""}>Portrait</option>
1315
- <option value="landscape"${e.orientation === "landscape" ? " selected" : ""}>Landscape</option>
1316
- </select>
1317
- </label>
1318
- <div class="ps-row ps-margins">
1319
- <span class="ps-label">Margins (mm)</span>
1320
- <div class="ps-margin-grid">
1321
- ${q.map(
1322
- (r) => `
1323
- <label class="ps-margin">
1324
- <span>${r}</span>
1325
- <input type="number" min="0" step="1" data-field="margin-${r}" value="${e.margins[r]}" />
1326
- </label>`
1327
- ).join("")}
1328
- </div>
1329
- </div>
1330
- </div>`, a = e.header.differentFirst || e.footer.differentFirst, l = e.header.differentLast || e.footer.differentLast, c = `
1331
- <div class="ps-section-header">Section</div>
1332
- <div class="ps-grid">
1333
- <label class="ps-row">
1334
- <span class="ps-label">Vertical alignment</span>
1335
- <select data-field="vertical-align">
1336
- ${ve.map((r) => {
1337
- const d = r === e.verticalAlign ? " selected" : "";
1338
- return `<option value="${r}"${d}>${Se(r)}</option>`;
1339
- }).join("")}
1340
- </select>
1341
- </label>
1342
- <label class="ps-row ps-checkbox">
1343
- <input type="checkbox" data-field="different-first"${a ? " checked" : ""} />
1344
- <span>Different header / footer for first page</span>
1345
- </label>
1346
- <label class="ps-row ps-checkbox">
1347
- <input type="checkbox" data-field="different-last"${l ? " checked" : ""} />
1348
- <span>Different header / footer for last page</span>
1349
- </label>
1350
- ${i ? `<button type="button" class="ps-insert-break" data-action="insert-section-break">
1351
- Insert section break after current block
1352
- </button>` : ""}
1353
- </div>`;
1354
- return `
1355
- <div class="ps-header">Page &amp; section setup</div>
1356
- ${o}
1357
- ${s}
1358
- ${c}
1359
- `;
1360
- }
1361
- function Se(n) {
1362
- return n.charAt(0).toUpperCase() + n.slice(1);
1363
- }
1364
- function we(n, t, e, i, o, s) {
1365
- const a = n.querySelector(
1366
- 'select[data-field="section"]'
1367
- );
1368
- a && a.addEventListener("change", () => {
1369
- const p = Number(a.value);
1370
- Number.isFinite(p) && i(p);
1371
- });
1372
- const l = n.querySelector(
1373
- 'select[data-field="size"]'
1374
- );
1375
- l == null || l.addEventListener("change", () => {
1376
- t.setSectionSetup(e(), { size: l.value });
1377
- });
1378
- const c = n.querySelector(
1379
- 'select[data-field="orientation"]'
1380
- );
1381
- c == null || c.addEventListener("change", () => {
1382
- t.setSectionSetup(e(), {
1383
- orientation: c.value
1384
- });
1385
- });
1386
- for (const p of q) {
1387
- const g = n.querySelector(
1388
- `input[data-field="margin-${p}"]`
1389
- );
1390
- if (!g) continue;
1391
- const f = () => {
1392
- const v = Number(g.value);
1393
- if (!Number.isFinite(v) || v < 0) return;
1394
- const S = t.getSectionSetup(e()), G = document.activeElement === g, x = g.selectionStart, C = g.selectionEnd;
1395
- t.setSectionSetup(e(), {
1396
- margins: { ...S.margins, [p]: v }
1397
- }), G && requestAnimationFrame(() => {
1398
- requestAnimationFrame(() => {
1399
- if (document.activeElement !== g && g.focus(), x !== null && C !== null)
1400
- try {
1401
- g.setSelectionRange(x, C);
1402
- } catch {
1403
- }
1404
- });
1405
- });
1406
- }, y = Ae(f, 1e3);
1407
- g.addEventListener("input", y), g.addEventListener("change", f);
1408
- }
1409
- const r = n.querySelector(
1410
- 'select[data-field="vertical-align"]'
1411
- );
1412
- r == null || r.addEventListener("change", () => {
1413
- t.setSectionSetup(e(), {
1414
- verticalAlign: r.value
1415
- });
1416
- });
1417
- const d = n.querySelector(
1418
- 'input[data-field="different-first"]'
1419
- );
1420
- d == null || d.addEventListener("change", () => {
1421
- const p = t.getSectionSetup(e()), g = d.checked;
1422
- t.setSectionSetup(e(), {
1423
- header: { ...p.header, differentFirst: g },
1424
- footer: { ...p.footer, differentFirst: g }
1425
- });
1426
- });
1427
- const u = n.querySelector(
1428
- 'input[data-field="different-last"]'
1429
- );
1430
- u == null || u.addEventListener("change", () => {
1431
- const p = t.getSectionSetup(e()), g = u.checked;
1432
- t.setSectionSetup(e(), {
1433
- header: { ...p.header, differentLast: g },
1434
- footer: { ...p.footer, differentLast: g }
1435
- });
1436
- });
1437
- const h = n.querySelector(
1438
- 'button[data-action="insert-section-break"]'
1439
- );
1440
- h == null || h.addEventListener("click", (p) => {
1441
- p.preventDefault(), s && t.editor.selection.set(s), t.editor.commands.execute("section.insertBreakAfter"), o();
1442
- });
1443
- }
1444
- function Te(n) {
1445
- const t = n.selection.currentBlock();
1446
- if (!t) return 0;
1447
- const e = n.getBlocks();
1448
- let i = 0;
1449
- for (const o of e) {
1450
- if (o.id === t.id) return i;
1451
- o.kind === "section_break" && (i += 1);
1452
- }
1453
- return i;
1454
- }
1455
- function Ee(n, t) {
1456
- return !Number.isFinite(n) || n < 0 ? 0 : n >= t ? Math.max(0, t - 1) : n;
1457
- }
1458
- function Ae(n, t) {
1459
- let e = null;
1460
- return () => {
1461
- e !== null && clearTimeout(e), e = setTimeout(() => {
1462
- e = null, n();
1463
- }, t);
1464
- };
1465
- }
1466
1420
  class Le {
1467
1421
  constructor(t) {
1468
1422
  b(this, "stackRoot");
@@ -1536,7 +1490,7 @@ class Le {
1536
1490
  if (t.kind === "table")
1537
1491
  this.renderTableToolbar(t, e);
1538
1492
  else {
1539
- const o = e.refs.length > 1, s = o ? "" : Yt(t.kind);
1493
+ const o = e.refs.length > 1, s = o ? "" : ae(t.kind);
1540
1494
  this.toolbar.setContent(
1541
1495
  R() + s + $(e.refs.length) + this.buildTrailingToolsHtml()
1542
1496
  ), this.toolbar.open(t);
@@ -1544,7 +1498,7 @@ class Le {
1544
1498
  editor: this.editor,
1545
1499
  target: t
1546
1500
  }), l = o ? () => {
1547
- } : Jt(this.toolbar.root, {
1501
+ } : se(this.toolbar.root, {
1548
1502
  editor: this.editor,
1549
1503
  target: t
1550
1504
  }), c = this.wireChangeTypeTrigger(e), r = this.wireTrailingTools();
@@ -1611,12 +1565,12 @@ class Le {
1611
1565
  renderTableToolbarBody(t, e, i) {
1612
1566
  var c;
1613
1567
  (c = this.detachTools) == null || c.call(this), this.toolbar.setContent(
1614
- R() + ce(this.tableMode, !!e) + $(i.refs.length) + this.buildTrailingToolsHtml()
1568
+ R() + ve(this.tableMode, !!e) + $(i.refs.length) + this.buildTrailingToolsHtml()
1615
1569
  );
1616
1570
  const o = H(this.toolbar.root, {
1617
1571
  editor: this.editor,
1618
1572
  target: t
1619
- }), s = de(
1573
+ }), s = ke(
1620
1574
  this.toolbar.root,
1621
1575
  { editor: this.editor, target: t, cell: e },
1622
1576
  (r) => {
@@ -1661,10 +1615,7 @@ class Le {
1661
1615
  );
1662
1616
  l && !p ? (p = document.createElement("input"), p.type = "text", p.className = "tb-author-input", p.dataset.role = "track-changes-author", p.placeholder = "Anonymous", p.title = "Track changes author", p.setAttribute("aria-label", "Track changes author"), p.maxLength = 60, p.value = a.author ?? "", u.insertAdjacentElement("afterend", p)) : !l && p ? p.remove() : p && p.value !== (a.author ?? "") && document.activeElement !== p && (p.value = a.author ?? "");
1663
1617
  }
1664
- }, e = this.editor.on(
1665
- "track-changes-change",
1666
- t
1667
- ), i = this.editor.on("change", t);
1618
+ }, e = this.editor.on("track-changes-change", t), i = this.editor.on("change", t);
1668
1619
  t();
1669
1620
  const o = (a) => {
1670
1621
  const l = a.target;
@@ -1698,7 +1649,7 @@ class Le {
1698
1649
  this.closePageSetupPopover();
1699
1650
  return;
1700
1651
  }
1701
- l.setAttribute("aria-expanded", "true"), this.closePageSetupPopover = ke(
1652
+ l.setAttribute("aria-expanded", "true"), this.closePageSetupPopover = Wt(
1702
1653
  l,
1703
1654
  {
1704
1655
  editor: this.editor,
@@ -1716,7 +1667,7 @@ class Le {
1716
1667
  };
1717
1668
  }
1718
1669
  resolveCell(t) {
1719
- return t.element.tagName.toLowerCase() !== "table" ? null : be(t.element);
1670
+ return t.element.tagName.toLowerCase() !== "table" ? null : Ee(t.element);
1720
1671
  }
1721
1672
  closeToolbar() {
1722
1673
  var t, e, i;