superdoc 2.24.0-next.4 → 2.24.0-next.6

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.
@@ -1496,7 +1496,7 @@ img[data-v-c95b2073] {
1496
1496
  font-size: 11px;
1497
1497
  }
1498
1498
 
1499
- .comments-dialog[data-v-c189ab35] {
1499
+ .comments-dialog[data-v-5ace8cef] {
1500
1500
  display: flex;
1501
1501
  flex-direction: column;
1502
1502
  padding: var(--sd-ui-comments-card-padding, 16px);
@@ -1515,79 +1515,79 @@ img[data-v-c95b2073] {
1515
1515
  overflow-wrap: break-word;
1516
1516
  word-break: break-word;
1517
1517
  }
1518
- .comments-dialog[data-v-c189ab35]:not(.is-active) {
1518
+ .comments-dialog[data-v-5ace8cef]:not(.is-active) {
1519
1519
  cursor: pointer;
1520
1520
  }
1521
- .comments-dialog[data-v-c189ab35]:not(.is-active):not(.is-resolved):hover {
1521
+ .comments-dialog[data-v-5ace8cef]:not(.is-active):not(.is-resolved):hover {
1522
1522
  background-color: var(--sd-ui-comments-card-hover-bg, #f3f6fd);
1523
1523
  }
1524
- .comments-dialog[data-v-c189ab35]:not(.is-resolved):hover .overflow-menu {
1524
+ .comments-dialog[data-v-5ace8cef]:not(.is-resolved):hover .overflow-menu {
1525
1525
  opacity: 1;
1526
1526
  pointer-events: auto;
1527
1527
  }
1528
- .comments-dialog.is-active[data-v-c189ab35] {
1528
+ .comments-dialog.is-active[data-v-5ace8cef] {
1529
1529
  background-color: var(--sd-ui-comments-card-active-bg, #ffffff);
1530
1530
  border-color: var(--sd-ui-comments-card-active-border, #e0e0e0);
1531
1531
  box-shadow: var(--sd-ui-comments-card-shadow, 0px 4px 12px 0px rgba(50, 50, 50, 0.15));
1532
1532
  z-index: 10;
1533
1533
  }
1534
- .comments-dialog.is-resolved[data-v-c189ab35] {
1534
+ .comments-dialog.is-resolved[data-v-5ace8cef] {
1535
1535
  background-color: var(--sd-ui-comments-card-resolved-bg, #f0f0f0);
1536
1536
  }
1537
- .comment-separator[data-v-c189ab35] {
1537
+ .comment-separator[data-v-5ace8cef] {
1538
1538
  background-color: var(--sd-ui-comments-separator, #e0e0e0);
1539
1539
  height: 1px;
1540
1540
  width: 100%;
1541
1541
  margin: 10px 0;
1542
1542
  }
1543
- .comment[data-v-c189ab35] {
1543
+ .comment[data-v-5ace8cef] {
1544
1544
  font-size: var(--sd-ui-comments-body-size, 14px);
1545
1545
  line-height: 1.5;
1546
1546
  white-space: pre-wrap;
1547
1547
  color: var(--sd-ui-comments-body-text, #212121);
1548
1548
  margin: 4px 0 0 0;
1549
1549
  }
1550
- .comment[data-v-c189ab35] p {
1550
+ .comment[data-v-5ace8cef] p {
1551
1551
  margin: 0;
1552
1552
  }
1553
- .comment[data-v-c189ab35] a {
1553
+ .comment[data-v-5ace8cef] a {
1554
1554
  color: var(--sd-ui-action, #1354ff);
1555
1555
  text-decoration: underline;
1556
1556
  }
1557
- .tracked-change[data-v-c189ab35] {
1557
+ .tracked-change[data-v-5ace8cef] {
1558
1558
  font-size: var(--sd-ui-comments-body-size, 14px);
1559
1559
  line-height: 1.5;
1560
1560
  color: var(--sd-ui-comments-body-text, #212121);
1561
1561
  margin: 4px 0 0 0;
1562
1562
  }
1563
- .change-type[data-v-c189ab35] {
1563
+ .change-type[data-v-5ace8cef] {
1564
1564
  color: var(--sd-ui-comments-body-text, #212121);
1565
1565
  }
1566
- .tracked-change-text[data-v-c189ab35] {
1566
+ .tracked-change-text[data-v-5ace8cef] {
1567
1567
  color: var(--sd-ui-comments-body-text, #212121);
1568
1568
  white-space: pre-wrap;
1569
1569
  }
1570
- .tracked-change-text.is-deleted[data-v-c189ab35] {
1570
+ .tracked-change-text.is-deleted[data-v-5ace8cef] {
1571
1571
  color: var(--sd-ui-comments-delete-text, #cb0e47);
1572
1572
  }
1573
- .tracked-change-text.is-inserted[data-v-c189ab35] {
1573
+ .tracked-change-text.is-inserted[data-v-5ace8cef] {
1574
1574
  color: var(--sd-ui-comments-insert-text, #1f6feb);
1575
1575
  font-weight: 500;
1576
1576
  }
1577
- .tracked-change[data-track-change-semantic-color-key='move-from'] .tracked-change-text.is-deleted[data-v-c189ab35] {
1577
+ .tracked-change[data-track-change-semantic-color-key='move-from'] .tracked-change-text.is-deleted[data-v-5ace8cef] {
1578
1578
  color: var(--sd-ui-comments-move-from-text, #00853d);
1579
1579
  }
1580
- .tracked-change[data-track-change-semantic-color-key='move-to'] .tracked-change-text.is-inserted[data-v-c189ab35] {
1580
+ .tracked-change[data-track-change-semantic-color-key='move-to'] .tracked-change-text.is-inserted[data-v-5ace8cef] {
1581
1581
  color: var(--sd-ui-comments-move-to-text, #00853d);
1582
1582
  }
1583
- .tracked-change-detail-lines[data-v-c189ab35] {
1583
+ .tracked-change-detail-lines[data-v-5ace8cef] {
1584
1584
  margin-top: 4px;
1585
1585
  }
1586
- .tracked-change-detail-line[data-v-c189ab35] {
1586
+ .tracked-change-detail-line[data-v-5ace8cef] {
1587
1587
  font-size: 12px;
1588
1588
  line-height: 1.4;
1589
1589
  }
1590
- .tracked-change-image-preview[data-v-c189ab35] {
1590
+ .tracked-change-image-preview[data-v-5ace8cef] {
1591
1591
  display: inline-flex;
1592
1592
  align-items: center;
1593
1593
  justify-content: center;
@@ -1598,7 +1598,7 @@ img[data-v-c95b2073] {
1598
1598
  max-width: 96px;
1599
1599
  max-height: 96px;
1600
1600
  }
1601
- .tracked-change-image-preview__image[data-v-c189ab35] {
1601
+ .tracked-change-image-preview__image[data-v-5ace8cef] {
1602
1602
  display: block;
1603
1603
  width: auto;
1604
1604
  height: auto;
@@ -1608,7 +1608,7 @@ img[data-v-c95b2073] {
1608
1608
  }
1609
1609
 
1610
1610
  /* ── Failed tracked-change decision alert (SD-3772 §6) ── */
1611
- .tracked-change-decision-alert[data-v-c189ab35] {
1611
+ .tracked-change-decision-alert[data-v-5ace8cef] {
1612
1612
  display: flex;
1613
1613
  align-items: center;
1614
1614
  justify-content: space-between;
@@ -1622,12 +1622,12 @@ img[data-v-c95b2073] {
1622
1622
  font-size: var(--sd-ui-comments-body-size, 14px);
1623
1623
  line-height: 1.4;
1624
1624
  }
1625
- .tracked-change-decision-alert__retry[data-v-c189ab35] {
1625
+ .tracked-change-decision-alert__retry[data-v-5ace8cef] {
1626
1626
  flex-shrink: 0;
1627
1627
  }
1628
1628
 
1629
1629
  /* ── Resolved badge ── */
1630
- .resolved-badge[data-v-c189ab35] {
1630
+ .resolved-badge[data-v-5ace8cef] {
1631
1631
  display: inline-flex;
1632
1632
  align-items: center;
1633
1633
  gap: 4px;
@@ -1636,33 +1636,33 @@ img[data-v-c95b2073] {
1636
1636
  color: var(--sd-ui-comments-resolved-text, #00853d);
1637
1637
  margin-bottom: 4px;
1638
1638
  }
1639
- .resolved-badge__icon[data-v-c189ab35] {
1639
+ .resolved-badge__icon[data-v-5ace8cef] {
1640
1640
  display: inline-flex;
1641
1641
  width: 12px;
1642
1642
  height: 12px;
1643
1643
  }
1644
- .resolved-badge__icon[data-v-c189ab35] svg {
1644
+ .resolved-badge__icon[data-v-5ace8cef] svg {
1645
1645
  width: 100%;
1646
1646
  height: 100%;
1647
1647
  fill: currentColor;
1648
1648
  }
1649
1649
 
1650
1650
  /* ── Text truncation ── */
1651
- .comment.is-truncated[data-v-c189ab35],
1652
- .tracked-change.is-truncated[data-v-c189ab35] {
1651
+ .comment.is-truncated[data-v-5ace8cef],
1652
+ .tracked-change.is-truncated[data-v-5ace8cef] {
1653
1653
  display: -webkit-box;
1654
1654
  -webkit-line-clamp: 3;
1655
1655
  -webkit-box-orient: vertical;
1656
1656
  max-height: 4.5em;
1657
1657
  overflow: hidden;
1658
1658
  }
1659
- .comment.is-scrollable[data-v-c189ab35],
1660
- .tracked-change.is-scrollable[data-v-c189ab35] {
1659
+ .comment.is-scrollable[data-v-5ace8cef],
1660
+ .tracked-change.is-scrollable[data-v-5ace8cef] {
1661
1661
  max-height: 220px;
1662
1662
  overflow-y: auto;
1663
1663
  padding-right: 4px;
1664
1664
  }
1665
- .show-more-toggle[data-v-c189ab35] {
1665
+ .show-more-toggle[data-v-5ace8cef] {
1666
1666
  font-size: 12px;
1667
1667
  color: var(--sd-ui-action, #1355ff);
1668
1668
  cursor: pointer;
@@ -1670,12 +1670,12 @@ img[data-v-c95b2073] {
1670
1670
  margin-top: 4px;
1671
1671
  user-select: none;
1672
1672
  }
1673
- .show-more-toggle[data-v-c189ab35]:hover {
1673
+ .show-more-toggle[data-v-5ace8cef]:hover {
1674
1674
  text-decoration: underline;
1675
1675
  }
1676
1676
 
1677
1677
  /* ── Thread collapse ── */
1678
- .collapsed-replies[data-v-c189ab35] {
1678
+ .collapsed-replies[data-v-5ace8cef] {
1679
1679
  display: flex;
1680
1680
  align-items: center;
1681
1681
  gap: 6px;
@@ -1686,24 +1686,24 @@ img[data-v-c95b2073] {
1686
1686
  cursor: pointer;
1687
1687
  user-select: none;
1688
1688
  }
1689
- .collapsed-replies[data-v-c189ab35]:hover {
1689
+ .collapsed-replies[data-v-5ace8cef]:hover {
1690
1690
  text-decoration: underline;
1691
1691
  }
1692
- .collapsed-avatars[data-v-c189ab35] {
1692
+ .collapsed-avatars[data-v-5ace8cef] {
1693
1693
  display: flex;
1694
1694
  }
1695
- .collapsed-avatars .mini-avatar[data-v-c189ab35] {
1695
+ .collapsed-avatars .mini-avatar[data-v-5ace8cef] {
1696
1696
  --sd-comment-avatar-size: 20px;
1697
1697
  --sd-comment-avatar-font-size: 8px;
1698
1698
  margin-left: -4px;
1699
1699
  border: 2px solid var(--sd-ui-comments-card-active-bg, #ffffff);
1700
1700
  }
1701
- .collapsed-avatars .mini-avatar[data-v-c189ab35]:first-child {
1701
+ .collapsed-avatars .mini-avatar[data-v-5ace8cef]:first-child {
1702
1702
  margin-left: 0;
1703
1703
  }
1704
1704
 
1705
1705
  /* ── New comment input ── */
1706
- .new-comment-input-wrapper[data-v-c189ab35] {
1706
+ .new-comment-input-wrapper[data-v-5ace8cef] {
1707
1707
  border: 1.5px solid var(--sd-ui-comments-input-border, #dbdbdb);
1708
1708
  border-radius: 12px;
1709
1709
  padding: 8.5px 10.5px;
@@ -1712,17 +1712,17 @@ img[data-v-c95b2073] {
1712
1712
  max-height: 150px;
1713
1713
  overflow: visible;
1714
1714
  }
1715
- .new-comment-input-wrapper[data-v-c189ab35]:focus-within {
1715
+ .new-comment-input-wrapper[data-v-5ace8cef]:focus-within {
1716
1716
  border-color: var(--sd-ui-comments-input-focus-border, #4f7cff);
1717
1717
  box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.16);
1718
1718
  }
1719
- .new-comment-input-wrapper[data-v-c189ab35] .comment-entry {
1719
+ .new-comment-input-wrapper[data-v-5ace8cef] .comment-entry {
1720
1720
  border-radius: 0;
1721
1721
  }
1722
- .new-comment-input-wrapper[data-v-c189ab35] .input-section {
1722
+ .new-comment-input-wrapper[data-v-5ace8cef] .input-section {
1723
1723
  margin: 0;
1724
1724
  }
1725
- .new-comment-input-wrapper[data-v-c189ab35] .superdoc-field {
1725
+ .new-comment-input-wrapper[data-v-5ace8cef] .superdoc-field {
1726
1726
  font-size: 14px;
1727
1727
  line-height: 20px;
1728
1728
  border: none;
@@ -1733,18 +1733,18 @@ img[data-v-c95b2073] {
1733
1733
  max-height: 132px;
1734
1734
  resize: none;
1735
1735
  }
1736
- .new-comment-input-wrapper[data-v-c189ab35] .superdoc-field:focus,
1737
- .new-comment-input-wrapper[data-v-c189ab35] .superdoc-field:active {
1736
+ .new-comment-input-wrapper[data-v-5ace8cef] .superdoc-field:focus,
1737
+ .new-comment-input-wrapper[data-v-5ace8cef] .superdoc-field:active {
1738
1738
  border: none;
1739
1739
  box-shadow: none;
1740
1740
  outline: none;
1741
1741
  }
1742
- .new-comment-input-wrapper[data-v-c189ab35] .sd-editor-placeholder::before {
1742
+ .new-comment-input-wrapper[data-v-5ace8cef] .sd-editor-placeholder::before {
1743
1743
  content: 'Comment or add others with @';
1744
1744
  }
1745
1745
 
1746
1746
  /* ── Reply pill & expanded input ── */
1747
- .reply-pill[data-v-c189ab35] {
1747
+ .reply-pill[data-v-5ace8cef] {
1748
1748
  width: 100%;
1749
1749
  padding: 8.5px 10.5px;
1750
1750
  border: 1.5px solid transparent;
@@ -1758,16 +1758,16 @@ img[data-v-c95b2073] {
1758
1758
  cursor: text;
1759
1759
  transition: background 150ms ease;
1760
1760
  }
1761
- .reply-pill[data-v-c189ab35]:hover {
1761
+ .reply-pill[data-v-5ace8cef]:hover {
1762
1762
  background: var(--sd-color-gray-200, #f2f2f2);
1763
1763
  }
1764
- .reply-pill[data-v-c189ab35]:disabled {
1764
+ .reply-pill[data-v-5ace8cef]:disabled {
1765
1765
  cursor: not-allowed;
1766
1766
  }
1767
- .reply-expanded[data-v-c189ab35] {
1767
+ .reply-expanded[data-v-5ace8cef] {
1768
1768
  margin-top: 10px;
1769
1769
  }
1770
- .reply-input-wrapper[data-v-c189ab35] {
1770
+ .reply-input-wrapper[data-v-5ace8cef] {
1771
1771
  border: 1.5px solid var(--sd-ui-comments-input-border, #dbdbdb);
1772
1772
  border-radius: 12px;
1773
1773
  padding: 8.5px 10.5px;
@@ -1775,17 +1775,17 @@ img[data-v-c95b2073] {
1775
1775
  max-height: 150px;
1776
1776
  overflow: visible;
1777
1777
  }
1778
- .reply-input-wrapper[data-v-c189ab35]:focus-within {
1778
+ .reply-input-wrapper[data-v-5ace8cef]:focus-within {
1779
1779
  border-color: var(--sd-ui-comments-input-focus-border, #4f7cff);
1780
1780
  box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.16);
1781
1781
  }
1782
- .reply-input-wrapper[data-v-c189ab35] .comment-entry {
1782
+ .reply-input-wrapper[data-v-5ace8cef] .comment-entry {
1783
1783
  border-radius: 0;
1784
1784
  }
1785
- .reply-input-wrapper[data-v-c189ab35] .input-section {
1785
+ .reply-input-wrapper[data-v-5ace8cef] .input-section {
1786
1786
  margin: 0;
1787
1787
  }
1788
- .reply-input-wrapper[data-v-c189ab35] .superdoc-field {
1788
+ .reply-input-wrapper[data-v-5ace8cef] .superdoc-field {
1789
1789
  font-size: 14px;
1790
1790
  line-height: 20px;
1791
1791
  border: none;
@@ -1796,23 +1796,23 @@ img[data-v-c95b2073] {
1796
1796
  max-height: 132px;
1797
1797
  resize: none;
1798
1798
  }
1799
- .reply-input-wrapper[data-v-c189ab35] .superdoc-field:focus,
1800
- .reply-input-wrapper[data-v-c189ab35] .superdoc-field:active {
1799
+ .reply-input-wrapper[data-v-5ace8cef] .superdoc-field:focus,
1800
+ .reply-input-wrapper[data-v-5ace8cef] .superdoc-field:active {
1801
1801
  border: none;
1802
1802
  box-shadow: none;
1803
1803
  outline: none;
1804
1804
  }
1805
- .reply-input-wrapper[data-v-c189ab35] .sd-editor-placeholder::before {
1805
+ .reply-input-wrapper[data-v-5ace8cef] .sd-editor-placeholder::before {
1806
1806
  content: 'Reply or add others with @';
1807
1807
  }
1808
- .reply-actions[data-v-c189ab35] {
1808
+ .reply-actions[data-v-5ace8cef] {
1809
1809
  display: flex;
1810
1810
  justify-content: flex-end;
1811
1811
  align-items: center;
1812
1812
  gap: 16px;
1813
1813
  margin-top: 8px;
1814
1814
  }
1815
- .reply-btn-cancel[data-v-c189ab35] {
1815
+ .reply-btn-cancel[data-v-5ace8cef] {
1816
1816
  background: none;
1817
1817
  border: none;
1818
1818
  font-size: 13px;
@@ -1823,10 +1823,10 @@ img[data-v-c95b2073] {
1823
1823
  font-family: inherit;
1824
1824
  transition: color 150ms;
1825
1825
  }
1826
- .reply-btn-cancel[data-v-c189ab35]:hover {
1826
+ .reply-btn-cancel[data-v-5ace8cef]:hover {
1827
1827
  color: var(--sd-ui-text, #212121);
1828
1828
  }
1829
- .reply-btn-primary[data-v-c189ab35] {
1829
+ .reply-btn-primary[data-v-5ace8cef] {
1830
1830
  background: var(--sd-ui-action, #1355ff);
1831
1831
  border: none;
1832
1832
  font-size: 13px;
@@ -1838,19 +1838,19 @@ img[data-v-c95b2073] {
1838
1838
  font-family: inherit;
1839
1839
  transition: background 150ms;
1840
1840
  }
1841
- .reply-btn-primary[data-v-c189ab35]:hover {
1841
+ .reply-btn-primary[data-v-5ace8cef]:hover {
1842
1842
  background: var(--sd-ui-action-hover, #0f44cc);
1843
1843
  }
1844
- .reply-btn-primary.sd-is-disabled[data-v-c189ab35] {
1844
+ .reply-btn-primary.sd-is-disabled[data-v-5ace8cef] {
1845
1845
  background: var(--sd-color-gray-400, #dbdbdb);
1846
1846
  color: var(--sd-color-gray-600, #888888);
1847
1847
  cursor: default;
1848
1848
  pointer-events: none;
1849
1849
  }
1850
- .existing-internal-input[data-v-c189ab35] {
1850
+ .existing-internal-input[data-v-5ace8cef] {
1851
1851
  margin-bottom: 10px;
1852
1852
  }
1853
- .sd-internal-dropdown[data-v-c189ab35] {
1853
+ .sd-internal-dropdown[data-v-5ace8cef] {
1854
1854
  display: inline-block;
1855
1855
  }
1856
1856
 
package/dist/superdoc.cjs CHANGED
@@ -304,7 +304,7 @@ var awarenessStatesToArray = (context, states) => {
304
304
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
305
305
  function getSuperdocVersion() {
306
306
  try {
307
- return "2.24.0-next.4";
307
+ return "2.24.0-next.6";
308
308
  } catch {
309
309
  return "unknown";
310
310
  }
@@ -13932,10 +13932,35 @@ var _sfc_main$34 = {
13932
13932
  require__plugin_vue_export_helper.nextTick(() => emit("resize"));
13933
13933
  });
13934
13934
  };
13935
- const isV2Mode = require__plugin_vue_export_helper.computed(() => proxy.$superdoc?.activeEditor?.editorVersion === 2);
13936
- const v2CommentsAdapter = require__plugin_vue_export_helper.computed(() => isV2Mode.value ? proxy.$superdoc?.activeEditor?.v2Comments ?? null : null);
13937
- const v2TrackedChangesAdapter = require__plugin_vue_export_helper.computed(() => isV2Mode.value ? proxy.$superdoc?.activeEditor?.v2TrackedChanges ?? null : null);
13935
+ const activeEditorRevision = require__plugin_vue_export_helper.ref(0);
13936
+ const v2CapabilityRevision = require__plugin_vue_export_helper.ref(0);
13937
+ const refreshActiveEditor = () => {
13938
+ activeEditorRevision.value += 1;
13939
+ };
13940
+ const isV2Mode = require__plugin_vue_export_helper.computed(() => {
13941
+ activeEditorRevision.value;
13942
+ return proxy.$superdoc?.activeEditor?.editorVersion === 2;
13943
+ });
13944
+ const v2CommentsAdapter = require__plugin_vue_export_helper.computed(() => {
13945
+ activeEditorRevision.value;
13946
+ return isV2Mode.value ? proxy.$superdoc?.activeEditor?.v2Comments ?? null : null;
13947
+ });
13948
+ const v2TrackedChangesAdapter = require__plugin_vue_export_helper.computed(() => {
13949
+ activeEditorRevision.value;
13950
+ return isV2Mode.value ? proxy.$superdoc?.activeEditor?.v2TrackedChanges ?? null : null;
13951
+ });
13952
+ require__plugin_vue_export_helper.watch(() => {
13953
+ activeEditorRevision.value;
13954
+ return isV2Mode.value ? proxy.$superdoc?.activeEditor?.host ?? null : null;
13955
+ }, (host, _previous, onCleanup) => {
13956
+ v2CapabilityRevision.value += 1;
13957
+ const unsubscribe = host?.subscribe?.(() => {
13958
+ v2CapabilityRevision.value += 1;
13959
+ });
13960
+ onCleanup(() => unsubscribe?.());
13961
+ }, { immediate: true });
13938
13962
  const v2WriteCapability = require__plugin_vue_export_helper.computed(() => {
13963
+ v2CapabilityRevision.value;
13939
13964
  if (!v2CommentsAdapter.value) return null;
13940
13965
  const documentMode = commentsStore.viewingVisibility.documentMode;
13941
13966
  const command = isPendingNewComment.value ? "comments.createFromSelection" : null;
@@ -13959,6 +13984,7 @@ var _sfc_main$34 = {
13959
13984
  return v2WriteCapability.value?.reason ?? "v2-write-unavailable";
13960
13985
  });
13961
13986
  const v2TrackedChangeCapability = require__plugin_vue_export_helper.computed(() => {
13987
+ v2CapabilityRevision.value;
13962
13988
  if (!v2TrackedChangesAdapter.value) return null;
13963
13989
  const documentMode = commentsStore.viewingVisibility.documentMode;
13964
13990
  const capability = v2TrackedChangesAdapter.value.getCapabilityState?.() ?? null;
@@ -14243,6 +14269,7 @@ var _sfc_main$34 = {
14243
14269
  return users;
14244
14270
  });
14245
14271
  require__plugin_vue_export_helper.onMounted(() => {
14272
+ proxy.$superdoc?.on?.("active-editor-change", refreshActiveEditor);
14246
14273
  if (props.autoFocus) require__plugin_vue_export_helper.nextTick(() => setFocus());
14247
14274
  if (isPendingNewComment.value) require__plugin_vue_export_helper.nextTick(() => {
14248
14275
  commentInput.value?.focus?.({ preventScroll: true });
@@ -14256,6 +14283,9 @@ var _sfc_main$34 = {
14256
14283
  checkOverflow();
14257
14284
  });
14258
14285
  });
14286
+ require__plugin_vue_export_helper.onBeforeUnmount(() => {
14287
+ proxy.$superdoc?.off?.("active-editor-change", refreshActiveEditor);
14288
+ });
14259
14289
  require__plugin_vue_export_helper.watch(showInputSection, (isVisible) => {
14260
14290
  if (!isVisible) return;
14261
14291
  require__plugin_vue_export_helper.nextTick(() => {
@@ -14503,7 +14533,7 @@ var _sfc_main$34 = {
14503
14533
  };
14504
14534
  }
14505
14535
  };
14506
- var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$34, [["__scopeId", "data-v-c189ab35"]]);
14536
+ var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$34, [["__scopeId", "data-v-5ace8cef"]]);
14507
14537
  //#endregion
14508
14538
  //#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
14509
14539
  var _hoisted_1$25 = [
@@ -19735,6 +19765,11 @@ function textTargetFromQueryMatch(doc, text, blockId) {
19735
19765
  function isTocEntryLinkElement(element) {
19736
19766
  return Boolean(element && typeof element.closest === "function" && element.closest(".superdoc-toc-entry"));
19737
19767
  }
19768
+ /** @param {Element | null | undefined} element */
19769
+ function isNoteCrossReferenceLinkElement(element) {
19770
+ const kind = element?.getAttribute("data-sd-note-cross-reference");
19771
+ return (kind === "ref" || kind === "noteRef") && Boolean(element?.closest("[data-sd-note-role=\"body\"]"));
19772
+ }
19738
19773
  /**
19739
19774
  * @param {Object} options
19740
19775
  * @param {() => SurfaceManager | null | undefined} options.getSurfaceManager
@@ -19878,9 +19913,9 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
19878
19913
  * Navigate to a body bookmark through its model address. A mounted-anchor
19879
19914
  * fallback is reserved for runtimes without a callable bookmark model.
19880
19915
  * @param {string | null | undefined} anchorUrl
19881
- * @param {{ placeCaret?: boolean }} [options]
19916
+ * @param {{ placeCaret?: boolean, revalidateCaretAfterReveal?: boolean }} [options]
19882
19917
  */
19883
- async function navigateToAnchor(anchorUrl, { placeCaret = false } = {}) {
19918
+ async function navigateToAnchor(anchorUrl, { placeCaret = false, revalidateCaretAfterReveal = false } = {}) {
19884
19919
  if (typeof anchorUrl !== "string" || !anchorUrl.startsWith("#")) return false;
19885
19920
  const anchorName = decodeAnchorFragment(anchorUrl.slice(1));
19886
19921
  const editor = getActiveEditor();
@@ -19897,48 +19932,65 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
19897
19932
  });
19898
19933
  return true;
19899
19934
  }
19900
- /** @type {BookmarkGetResult | null} */
19901
- let bookmark = null;
19902
- try {
19903
- const list = doc?.bookmarks?.list;
19904
- if (typeof list === "function") {
19905
- if ((await Promise.resolve(list.call(doc.bookmarks)))?.items?.filter((item) => item.name === anchorName).length !== 1) return false;
19935
+ async function readBodyBookmark() {
19936
+ try {
19937
+ const list = doc?.bookmarks?.list;
19938
+ if (typeof list === "function") {
19939
+ if ((await Promise.resolve(list.call(doc.bookmarks)))?.items?.filter((item) => item.name === anchorName).length !== 1) return null;
19940
+ }
19941
+ const bookmark = await Promise.resolve(bookmarkGet.call(doc.bookmarks, { target: {
19942
+ kind: "entity",
19943
+ entityType: "bookmark",
19944
+ name: anchorName
19945
+ } }));
19946
+ if (editor !== getActiveEditor() || generation !== openGeneration) return null;
19947
+ const story = bookmark?.address?.story;
19948
+ if (story && story.storyType !== "body" || bookmark?.tableColumn) return null;
19949
+ const blockId = bookmark?.range?.from?.blockId;
19950
+ const offset = bookmark?.range?.from?.offset ?? 0;
19951
+ if (typeof blockId !== "string" || !Number.isInteger(offset) || offset < 0) return null;
19952
+ return {
19953
+ blockId,
19954
+ offset
19955
+ };
19956
+ } catch {
19957
+ return null;
19906
19958
  }
19907
- bookmark = await Promise.resolve(bookmarkGet.call(doc.bookmarks, { target: {
19908
- kind: "entity",
19909
- entityType: "bookmark",
19910
- name: anchorName
19911
- } }));
19912
- bookmark ??= null;
19913
- } catch {
19914
- return false;
19915
19959
  }
19916
- if (editor !== getActiveEditor() || generation !== openGeneration) return false;
19917
- const story = bookmark?.address?.story;
19918
- if (story && story.storyType !== "body" || bookmark?.tableColumn) return false;
19919
- const blockId = bookmark?.range?.from?.blockId;
19920
- const offset = bookmark?.range?.from?.offset ?? 0;
19921
- if (typeof blockId !== "string" || !Number.isInteger(offset) || offset < 0) return false;
19922
- if (placeCaret) await placeCaretAtBookmark(blockId, offset);
19960
+ let position = await readBodyBookmark();
19961
+ if (!position) return false;
19962
+ if (placeCaret && !revalidateCaretAfterReveal) await placeCaretAtBookmark(position.blockId, position.offset);
19923
19963
  const viewport = getUi()?.viewport;
19924
19964
  const scrollIntoView = viewport?.scrollIntoView;
19925
19965
  if (typeof scrollIntoView !== "function") return false;
19926
- const target = {
19927
- kind: "text",
19928
- blockId,
19929
- range: {
19930
- start: offset,
19931
- end: offset
19932
- }
19933
- };
19934
19966
  for (let step = 0; step < MAX_ANCHOR_NAVIGATION_STEPS; step += 1) try {
19967
+ const target = {
19968
+ kind: "text",
19969
+ blockId: position.blockId,
19970
+ range: {
19971
+ start: position.offset,
19972
+ end: position.offset
19973
+ }
19974
+ };
19935
19975
  const result = await Promise.resolve(scrollIntoView.call(viewport, {
19936
19976
  target,
19937
19977
  block: "start",
19938
19978
  behavior: "instant"
19939
19979
  }));
19940
19980
  if (editor !== getActiveEditor() || generation !== openGeneration) return false;
19941
- if (result?.success !== false) return true;
19981
+ if (result?.success !== false) {
19982
+ if (revalidateCaretAfterReveal) {
19983
+ const current = await readBodyBookmark();
19984
+ if (!current) return false;
19985
+ if (current.blockId !== position.blockId || current.offset !== position.offset) {
19986
+ position = current;
19987
+ continue;
19988
+ }
19989
+ if (placeCaret) await placeCaretAtBookmark(current.blockId, current.offset);
19990
+ if (editor !== getActiveEditor() || generation !== openGeneration) return false;
19991
+ }
19992
+ return true;
19993
+ }
19942
19994
  } catch {
19943
19995
  return false;
19944
19996
  }
@@ -20064,8 +20116,13 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
20064
20116
  return;
20065
20117
  }
20066
20118
  if (ctx.defaultAction === "navigate") {
20067
- if (ctx.isAnchorLink) navigateToAnchor(ctx.href);
20068
- else if (ctx.href) {
20119
+ if (ctx.isAnchorLink) {
20120
+ const noteReference = isNoteCrossReferenceLinkElement(ctx.element);
20121
+ navigateToAnchor(ctx.href, {
20122
+ placeCaret: noteReference && ctx.documentMode !== "viewing",
20123
+ revalidateCaretAfterReveal: noteReference && ctx.documentMode !== "viewing"
20124
+ });
20125
+ } else if (ctx.href) {
20069
20126
  const target = ctx.target || "_self";
20070
20127
  const features = linkOpenFeaturesForTarget(ctx.rel, target);
20071
20128
  if (features) window.open(ctx.href, target, features);
@@ -46564,7 +46621,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
46564
46621
  }
46565
46622
  this.userColorMap = /* @__PURE__ */ new Map();
46566
46623
  this.colorIndex = 0;
46567
- this.version = "2.24.0-next.4";
46624
+ this.version = "2.24.0-next.6";
46568
46625
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46569
46626
  this.superdocId = config.superdocId || require_uuid.v4();
46570
46627
  this.colors = this.config.colors ?? [];
@@ -48742,11 +48799,12 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
48742
48799
  async #replaceActiveDocument(source) {
48743
48800
  const activeEditor = this.activeEditor;
48744
48801
  if (isV2ActiveEditorFacade(activeEditor) && typeof activeEditor.replaceFile === "function") {
48745
- const result = await activeEditor.replaceFile(source);
48802
+ const replacementSource = this.#savedDocxToBlob(source);
48803
+ const result = await activeEditor.replaceFile(replacementSource);
48746
48804
  const state = result && typeof result === "object" ? result.state : null;
48747
48805
  const confirmed = state === null || state === "review-ready" || state === "editing-ready";
48748
48806
  if (confirmed) {
48749
- this.#replaceActiveDocumentData(activeEditor, source);
48807
+ this.#replaceActiveDocumentData(activeEditor, replacementSource);
48750
48808
  this.emit("document-replaced", {
48751
48809
  editor: activeEditor,
48752
48810
  host: activeEditor?.host