superdoc 2.0.0-next.44 → 2.0.0-next.46

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 (34) hide show
  1. package/AGENTS.md +15 -8
  2. package/dist/chunks/{create-super-doc-ui-DYky1UEo.cjs → create-super-doc-ui-6FUZ9d-y.cjs} +204 -159
  3. package/dist/chunks/{create-super-doc-ui-BFz0iim0.es.js → create-super-doc-ui-DCFTmVRK.es.js} +205 -160
  4. package/dist/collaboration-upgrade-engine.cjs +1 -1
  5. package/dist/collaboration-upgrade-engine.es.js +1 -1
  6. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  7. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  8. package/dist/public/ui-react.cjs +17 -14
  9. package/dist/public/ui-react.es.js +17 -14
  10. package/dist/public/ui.cjs +1 -1
  11. package/dist/public/ui.es.js +1 -1
  12. package/dist/style.css +28 -28
  13. package/dist/style.layered.css +28 -28
  14. package/dist/superdoc/src/components/surfaces/FindReplaceSurface.vue.d.ts +2 -2
  15. package/dist/superdoc/src/components/surfaces/PasswordPromptSurface.vue.d.ts +2 -2
  16. package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +2 -2
  17. package/dist/superdoc/src/composables/use-find-replace.d.ts +2 -2
  18. package/dist/superdoc/src/core/SuperDoc.d.ts +41 -0
  19. package/dist/superdoc/src/core/types/index.d.ts +76 -30
  20. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +5 -5
  21. package/dist/superdoc/src/public/browser-document-api.d.ts +53 -0
  22. package/dist/superdoc/src/public/index.d.cts +4 -0
  23. package/dist/superdoc/src/public/index.d.ts +2 -0
  24. package/dist/superdoc/src/public/ui/react.d.ts +18 -7
  25. package/dist/superdoc/src/public/ui/types.d.ts +81 -12
  26. package/dist/superdoc/src/public/ui-react.d.ts +4 -3
  27. package/dist/superdoc/src/public/ui.d.cts +8 -0
  28. package/dist/superdoc/src/public/ui.d.ts +1 -1
  29. package/dist/superdoc.cjs +85 -141
  30. package/dist/superdoc.es.js +85 -141
  31. package/dist-cdn/style.layered.css +1 -1
  32. package/dist-cdn/superdoc.min.css +1 -1
  33. package/dist-cdn/superdoc.min.js +36 -36
  34. package/package.json +2 -2
@@ -1,27 +1,30 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../chunks/rolldown-runtime-_dR15c8t.cjs");
3
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DYky1UEo.cjs");
3
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-6FUZ9d-y.cjs");
4
4
  let react = require("react");
5
5
  var SuperDocUIContext = (0, react.createContext)(null);
6
+ function disposeOwnedUi(ref) {
7
+ const ui = ref.current;
8
+ if (!ui) return;
9
+ ui.destroy();
10
+ ref.current = null;
11
+ }
6
12
  function SuperDocUIProvider(props) {
7
13
  const [ui, setUi] = (0, react.useState)(null);
8
14
  const [host, setHost] = (0, react.useState)(null);
9
- const uiRef = (0, react.useRef)(null);
15
+ const ownedUiRef = (0, react.useRef)(null);
10
16
  const setSuperDoc = (0, react.useCallback)((superdoc) => {
11
- if (uiRef.current) uiRef.current.destroy();
12
- const next = require_create_super_doc_ui.createSuperDocUI({ superdoc });
13
- uiRef.current = next;
14
- setUi(next);
17
+ const hostUi = superdoc.ui;
18
+ disposeOwnedUi(ownedUiRef);
19
+ if (hostUi) setUi(hostUi);
20
+ else {
21
+ const created = require_create_super_doc_ui.createSuperDocUI({ superdoc });
22
+ ownedUiRef.current = created;
23
+ setUi(created);
24
+ }
15
25
  setHost(superdoc);
16
26
  }, []);
17
- (0, react.useEffect)(() => {
18
- return () => {
19
- if (uiRef.current) {
20
- uiRef.current.destroy();
21
- uiRef.current = null;
22
- }
23
- };
24
- }, []);
27
+ (0, react.useEffect)(() => () => disposeOwnedUi(ownedUiRef), []);
25
28
  const value = {
26
29
  ui,
27
30
  host,
@@ -1,25 +1,28 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BFz0iim0.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DCFTmVRK.es.js";
2
2
  import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
3
3
  var SuperDocUIContext = createContext(null);
4
+ function disposeOwnedUi(ref) {
5
+ const ui = ref.current;
6
+ if (!ui) return;
7
+ ui.destroy();
8
+ ref.current = null;
9
+ }
4
10
  function SuperDocUIProvider(props) {
5
11
  const [ui, setUi] = useState(null);
6
12
  const [host, setHost] = useState(null);
7
- const uiRef = useRef(null);
13
+ const ownedUiRef = useRef(null);
8
14
  const setSuperDoc = useCallback((superdoc) => {
9
- if (uiRef.current) uiRef.current.destroy();
10
- const next = createSuperDocUI({ superdoc });
11
- uiRef.current = next;
12
- setUi(next);
15
+ const hostUi = superdoc.ui;
16
+ disposeOwnedUi(ownedUiRef);
17
+ if (hostUi) setUi(hostUi);
18
+ else {
19
+ const created = createSuperDocUI({ superdoc });
20
+ ownedUiRef.current = created;
21
+ setUi(created);
22
+ }
13
23
  setHost(superdoc);
14
24
  }, []);
15
- useEffect(() => {
16
- return () => {
17
- if (uiRef.current) {
18
- uiRef.current.destroy();
19
- uiRef.current = null;
20
- }
21
- };
22
- }, []);
25
+ useEffect(() => () => disposeOwnedUi(ownedUiRef), []);
23
26
  const value = {
24
27
  ui,
25
28
  host,
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DYky1UEo.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-6FUZ9d-y.cjs");
3
3
  exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
4
4
  exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
5
5
  exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
@@ -1,2 +1,2 @@
1
- import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BFz0iim0.es.js";
1
+ import { n as shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-DCFTmVRK.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
package/dist/style.css CHANGED
@@ -1368,28 +1368,28 @@ img[data-v-c95b2073] {
1368
1368
  background-color: #1355ff7f;
1369
1369
  }
1370
1370
 
1371
- .comment-placeholder[data-v-7f4821a8] {
1371
+ .comment-placeholder[data-v-a1bd2282] {
1372
1372
  position: absolute;
1373
1373
  width: 300px;
1374
1374
  transition: top 0.3s ease;
1375
1375
  }
1376
- .comment-placeholder.is-direct-decision-continuity-target[data-v-7f4821a8] .overflow-menu {
1376
+ .comment-placeholder.is-direct-decision-continuity-target[data-v-a1bd2282] .overflow-menu {
1377
1377
  opacity: 1;
1378
1378
  pointer-events: auto;
1379
1379
  }
1380
- .floating-comment[data-v-7f4821a8] {
1380
+ .floating-comment[data-v-a1bd2282] {
1381
1381
  position: relative;
1382
1382
  display: block;
1383
1383
  min-width: 300px;
1384
1384
  }
1385
- .sidebar-container[data-v-7f4821a8] {
1385
+ .sidebar-container[data-v-a1bd2282] {
1386
1386
  position: absolute;
1387
1387
  width: 300px;
1388
1388
  min-height: 300px;
1389
1389
  transition: transform 0.3s ease;
1390
1390
  will-change: transform;
1391
1391
  }
1392
- .section-wrapper[data-v-7f4821a8] {
1392
+ .section-wrapper[data-v-a1bd2282] {
1393
1393
  position: relative;
1394
1394
  min-height: 100%;
1395
1395
  width: 300px;
@@ -1727,11 +1727,11 @@ img[data-v-c95b2073] {
1727
1727
  pointer-events: auto;
1728
1728
  }
1729
1729
 
1730
- .superdoc[data-v-91c4cd11] {
1730
+ .superdoc[data-v-41f40a40] {
1731
1731
  display: flex;
1732
1732
  position: relative;
1733
1733
  }
1734
- .sd-visually-hidden[data-v-91c4cd11] {
1734
+ .sd-visually-hidden[data-v-41f40a40] {
1735
1735
  position: absolute;
1736
1736
  width: 1px;
1737
1737
  height: 1px;
@@ -1742,30 +1742,30 @@ img[data-v-c95b2073] {
1742
1742
  white-space: nowrap;
1743
1743
  border: 0;
1744
1744
  }
1745
- .right-sidebar[data-v-91c4cd11] {
1745
+ .right-sidebar[data-v-41f40a40] {
1746
1746
  min-width: 320px;
1747
1747
  height: 100%;
1748
1748
  }
1749
- .floating-comments[data-v-91c4cd11] {
1749
+ .floating-comments[data-v-41f40a40] {
1750
1750
  min-width: 300px;
1751
1751
  width: 300px;
1752
1752
  height: 100%;
1753
1753
  overflow: visible;
1754
1754
  }
1755
- .superdoc__layers[data-v-91c4cd11] {
1755
+ .superdoc__layers[data-v-41f40a40] {
1756
1756
  height: 100%;
1757
1757
  position: relative;
1758
1758
  box-sizing: border-box;
1759
1759
  }
1760
- .superdoc__document[data-v-91c4cd11] {
1760
+ .superdoc__document[data-v-41f40a40] {
1761
1761
  width: 100%;
1762
1762
  position: relative;
1763
1763
  }
1764
- .superdoc__sub-document[data-v-91c4cd11] {
1764
+ .superdoc__sub-document[data-v-41f40a40] {
1765
1765
  width: 100%;
1766
1766
  position: relative;
1767
1767
  }
1768
- .superdoc__selection-layer[data-v-91c4cd11] {
1768
+ .superdoc__selection-layer[data-v-41f40a40] {
1769
1769
  position: absolute;
1770
1770
  min-width: 100%;
1771
1771
  min-height: 100%;
@@ -1776,13 +1776,13 @@ img[data-v-c95b2073] {
1776
1776
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
1777
1777
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
1778
1778
  clickable, and below the selection layer (z-index 10). */
1779
- .superdoc__whiteboard-layer[data-v-91c4cd11] {
1779
+ .superdoc__whiteboard-layer[data-v-41f40a40] {
1780
1780
  z-index: 4;
1781
1781
  }
1782
- .superdoc__temp-selection[data-v-91c4cd11] {
1782
+ .superdoc__temp-selection[data-v-41f40a40] {
1783
1783
  position: absolute;
1784
1784
  }
1785
- .superdoc__right-sidebar[data-v-91c4cd11] {
1785
+ .superdoc__right-sidebar[data-v-41f40a40] {
1786
1786
  width: 320px;
1787
1787
  min-width: 320px;
1788
1788
  padding: 0 10px;
@@ -1790,7 +1790,7 @@ img[data-v-c95b2073] {
1790
1790
  position: relative;
1791
1791
  z-index: 2;
1792
1792
  }
1793
- .superdoc__compact-comment-popover[data-v-91c4cd11] {
1793
+ .superdoc__compact-comment-popover[data-v-41f40a40] {
1794
1794
  position: absolute;
1795
1795
  top: 12px;
1796
1796
  right: 12px;
@@ -1799,14 +1799,14 @@ img[data-v-c95b2073] {
1799
1799
  }
1800
1800
 
1801
1801
  /* Tools styles */
1802
- .tools[data-v-91c4cd11] {
1802
+ .tools[data-v-41f40a40] {
1803
1803
  position: absolute;
1804
1804
  z-index: 3;
1805
1805
  display: flex;
1806
1806
  flex-direction: column;
1807
1807
  gap: var(--sd-ui-tools-gap, 6px);
1808
1808
  }
1809
- .tools-item[data-v-91c4cd11] {
1809
+ .tools-item[data-v-41f40a40] {
1810
1810
  display: flex;
1811
1811
  align-items: center;
1812
1812
  justify-content: center;
@@ -1817,10 +1817,10 @@ img[data-v-c95b2073] {
1817
1817
  cursor: pointer;
1818
1818
  position: relative;
1819
1819
  }
1820
- .tools-item i[data-v-91c4cd11] {
1820
+ .tools-item i[data-v-41f40a40] {
1821
1821
  cursor: pointer;
1822
1822
  }
1823
- .superdoc__tools-icon[data-v-91c4cd11] {
1823
+ .superdoc__tools-icon[data-v-41f40a40] {
1824
1824
  width: var(--sd-ui-tools-icon-size, 20px);
1825
1825
  height: var(--sd-ui-tools-icon-size, 20px);
1826
1826
  flex-shrink: 0;
@@ -1835,22 +1835,22 @@ img[data-v-c95b2073] {
1835
1835
 
1836
1836
  /* 834px is iPad screen size in portrait orientation */
1837
1837
  @media (max-width: 834px) {
1838
- .superdoc .superdoc__layers[data-v-91c4cd11] {
1838
+ .superdoc .superdoc__layers[data-v-41f40a40] {
1839
1839
  margin: 0;
1840
1840
  border: 0 !important;
1841
1841
  box-shadow: none;
1842
1842
  }
1843
- .superdoc__sub-document[data-v-91c4cd11] {
1843
+ .superdoc__sub-document[data-v-41f40a40] {
1844
1844
  max-width: 100%;
1845
1845
  }
1846
- .superdoc__right-sidebar[data-v-91c4cd11] {
1846
+ .superdoc__right-sidebar[data-v-41f40a40] {
1847
1847
  padding: 10px;
1848
1848
  position: relative;
1849
1849
  }
1850
1850
  }
1851
1851
 
1852
1852
  /* AI Writer styles */
1853
- .ai-writer-container[data-v-91c4cd11] {
1853
+ .ai-writer-container[data-v-41f40a40] {
1854
1854
  position: fixed;
1855
1855
  z-index: 1000;
1856
1856
  background: white;
@@ -1866,10 +1866,10 @@ img[data-v-c95b2073] {
1866
1866
  transform: translateY(-50%);
1867
1867
  z-index: 50;
1868
1868
  } */
1869
- .ai-tool > svg[data-v-91c4cd11] {
1869
+ .ai-tool > svg[data-v-41f40a40] {
1870
1870
  fill: transparent;
1871
1871
  }
1872
- .ai-tool[data-v-91c4cd11]::before {
1872
+ .ai-tool[data-v-41f40a40]::before {
1873
1873
  content: '';
1874
1874
  position: absolute;
1875
1875
  width: 20px;
@@ -1890,7 +1890,7 @@ img[data-v-c95b2073] {
1890
1890
  filter: brightness(1.2);
1891
1891
  transition: filter 0.2s ease;
1892
1892
  }
1893
- .ai-tool[data-v-91c4cd11]:hover::before {
1893
+ .ai-tool[data-v-41f40a40]:hover::before {
1894
1894
  filter: brightness(1.3);
1895
1895
  }
1896
1896
 
@@ -1368,28 +1368,28 @@ img[data-v-c95b2073] {
1368
1368
  background-color: #1355ff7f;
1369
1369
  }
1370
1370
 
1371
- .comment-placeholder[data-v-7f4821a8] {
1371
+ .comment-placeholder[data-v-a1bd2282] {
1372
1372
  position: absolute;
1373
1373
  width: 300px;
1374
1374
  transition: top 0.3s ease;
1375
1375
  }
1376
- .comment-placeholder.is-direct-decision-continuity-target[data-v-7f4821a8] .overflow-menu {
1376
+ .comment-placeholder.is-direct-decision-continuity-target[data-v-a1bd2282] .overflow-menu {
1377
1377
  opacity: 1;
1378
1378
  pointer-events: auto;
1379
1379
  }
1380
- .floating-comment[data-v-7f4821a8] {
1380
+ .floating-comment[data-v-a1bd2282] {
1381
1381
  position: relative;
1382
1382
  display: block;
1383
1383
  min-width: 300px;
1384
1384
  }
1385
- .sidebar-container[data-v-7f4821a8] {
1385
+ .sidebar-container[data-v-a1bd2282] {
1386
1386
  position: absolute;
1387
1387
  width: 300px;
1388
1388
  min-height: 300px;
1389
1389
  transition: transform 0.3s ease;
1390
1390
  will-change: transform;
1391
1391
  }
1392
- .section-wrapper[data-v-7f4821a8] {
1392
+ .section-wrapper[data-v-a1bd2282] {
1393
1393
  position: relative;
1394
1394
  min-height: 100%;
1395
1395
  width: 300px;
@@ -1727,11 +1727,11 @@ img[data-v-c95b2073] {
1727
1727
  pointer-events: auto;
1728
1728
  }
1729
1729
 
1730
- .superdoc[data-v-91c4cd11] {
1730
+ .superdoc[data-v-41f40a40] {
1731
1731
  display: flex;
1732
1732
  position: relative;
1733
1733
  }
1734
- .sd-visually-hidden[data-v-91c4cd11] {
1734
+ .sd-visually-hidden[data-v-41f40a40] {
1735
1735
  position: absolute;
1736
1736
  width: 1px;
1737
1737
  height: 1px;
@@ -1742,30 +1742,30 @@ img[data-v-c95b2073] {
1742
1742
  white-space: nowrap;
1743
1743
  border: 0;
1744
1744
  }
1745
- .right-sidebar[data-v-91c4cd11] {
1745
+ .right-sidebar[data-v-41f40a40] {
1746
1746
  min-width: 320px;
1747
1747
  height: 100%;
1748
1748
  }
1749
- .floating-comments[data-v-91c4cd11] {
1749
+ .floating-comments[data-v-41f40a40] {
1750
1750
  min-width: 300px;
1751
1751
  width: 300px;
1752
1752
  height: 100%;
1753
1753
  overflow: visible;
1754
1754
  }
1755
- .superdoc__layers[data-v-91c4cd11] {
1755
+ .superdoc__layers[data-v-41f40a40] {
1756
1756
  height: 100%;
1757
1757
  position: relative;
1758
1758
  box-sizing: border-box;
1759
1759
  }
1760
- .superdoc__document[data-v-91c4cd11] {
1760
+ .superdoc__document[data-v-41f40a40] {
1761
1761
  width: 100%;
1762
1762
  position: relative;
1763
1763
  }
1764
- .superdoc__sub-document[data-v-91c4cd11] {
1764
+ .superdoc__sub-document[data-v-41f40a40] {
1765
1765
  width: 100%;
1766
1766
  position: relative;
1767
1767
  }
1768
- .superdoc__selection-layer[data-v-91c4cd11] {
1768
+ .superdoc__selection-layer[data-v-41f40a40] {
1769
1769
  position: absolute;
1770
1770
  min-width: 100%;
1771
1771
  min-height: 100%;
@@ -1776,13 +1776,13 @@ img[data-v-c95b2073] {
1776
1776
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
1777
1777
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
1778
1778
  clickable, and below the selection layer (z-index 10). */
1779
- .superdoc__whiteboard-layer[data-v-91c4cd11] {
1779
+ .superdoc__whiteboard-layer[data-v-41f40a40] {
1780
1780
  z-index: 4;
1781
1781
  }
1782
- .superdoc__temp-selection[data-v-91c4cd11] {
1782
+ .superdoc__temp-selection[data-v-41f40a40] {
1783
1783
  position: absolute;
1784
1784
  }
1785
- .superdoc__right-sidebar[data-v-91c4cd11] {
1785
+ .superdoc__right-sidebar[data-v-41f40a40] {
1786
1786
  width: 320px;
1787
1787
  min-width: 320px;
1788
1788
  padding: 0 10px;
@@ -1790,7 +1790,7 @@ img[data-v-c95b2073] {
1790
1790
  position: relative;
1791
1791
  z-index: 2;
1792
1792
  }
1793
- .superdoc__compact-comment-popover[data-v-91c4cd11] {
1793
+ .superdoc__compact-comment-popover[data-v-41f40a40] {
1794
1794
  position: absolute;
1795
1795
  top: 12px;
1796
1796
  right: 12px;
@@ -1799,14 +1799,14 @@ img[data-v-c95b2073] {
1799
1799
  }
1800
1800
 
1801
1801
  /* Tools styles */
1802
- .tools[data-v-91c4cd11] {
1802
+ .tools[data-v-41f40a40] {
1803
1803
  position: absolute;
1804
1804
  z-index: 3;
1805
1805
  display: flex;
1806
1806
  flex-direction: column;
1807
1807
  gap: var(--sd-ui-tools-gap, 6px);
1808
1808
  }
1809
- .tools-item[data-v-91c4cd11] {
1809
+ .tools-item[data-v-41f40a40] {
1810
1810
  display: flex;
1811
1811
  align-items: center;
1812
1812
  justify-content: center;
@@ -1817,10 +1817,10 @@ img[data-v-c95b2073] {
1817
1817
  cursor: pointer;
1818
1818
  position: relative;
1819
1819
  }
1820
- .tools-item i[data-v-91c4cd11] {
1820
+ .tools-item i[data-v-41f40a40] {
1821
1821
  cursor: pointer;
1822
1822
  }
1823
- .superdoc__tools-icon[data-v-91c4cd11] {
1823
+ .superdoc__tools-icon[data-v-41f40a40] {
1824
1824
  width: var(--sd-ui-tools-icon-size, 20px);
1825
1825
  height: var(--sd-ui-tools-icon-size, 20px);
1826
1826
  flex-shrink: 0;
@@ -1835,22 +1835,22 @@ img[data-v-c95b2073] {
1835
1835
 
1836
1836
  /* 834px is iPad screen size in portrait orientation */
1837
1837
  @media (max-width: 834px) {
1838
- .superdoc .superdoc__layers[data-v-91c4cd11] {
1838
+ .superdoc .superdoc__layers[data-v-41f40a40] {
1839
1839
  margin: 0;
1840
1840
  border: 0 !important;
1841
1841
  box-shadow: none;
1842
1842
  }
1843
- .superdoc__sub-document[data-v-91c4cd11] {
1843
+ .superdoc__sub-document[data-v-41f40a40] {
1844
1844
  max-width: 100%;
1845
1845
  }
1846
- .superdoc__right-sidebar[data-v-91c4cd11] {
1846
+ .superdoc__right-sidebar[data-v-41f40a40] {
1847
1847
  padding: 10px;
1848
1848
  position: relative;
1849
1849
  }
1850
1850
  }
1851
1851
 
1852
1852
  /* AI Writer styles */
1853
- .ai-writer-container[data-v-91c4cd11] {
1853
+ .ai-writer-container[data-v-41f40a40] {
1854
1854
  position: fixed;
1855
1855
  z-index: 1000;
1856
1856
  background: white;
@@ -1866,10 +1866,10 @@ img[data-v-c95b2073] {
1866
1866
  transform: translateY(-50%);
1867
1867
  z-index: 50;
1868
1868
  } */
1869
- .ai-tool > svg[data-v-91c4cd11] {
1869
+ .ai-tool > svg[data-v-41f40a40] {
1870
1870
  fill: transparent;
1871
1871
  }
1872
- .ai-tool[data-v-91c4cd11]::before {
1872
+ .ai-tool[data-v-41f40a40]::before {
1873
1873
  content: '';
1874
1874
  position: absolute;
1875
1875
  width: 20px;
@@ -1890,7 +1890,7 @@ img[data-v-c95b2073] {
1890
1890
  filter: brightness(1.2);
1891
1891
  transition: filter 0.2s ease;
1892
1892
  }
1893
- .ai-tool[data-v-91c4cd11]:hover::before {
1893
+ .ai-tool[data-v-41f40a40]:hover::before {
1894
1894
  filter: brightness(1.3);
1895
1895
  }
1896
1896
 
@@ -1,15 +1,15 @@
1
1
  declare const _default: import('vue').DefineComponent<{}, {
2
2
  close: Function;
3
3
  resolve: Function;
4
- mode: string;
5
4
  request: Record<string, any>;
5
+ mode: string;
6
6
  surfaceId: string;
7
7
  findReplace: Record<string, any>;
8
8
  $props: {
9
9
  readonly close?: Function | undefined;
10
10
  readonly resolve?: Function | undefined;
11
- readonly mode?: string | undefined;
12
11
  readonly request?: Record<string, any> | undefined;
12
+ readonly mode?: string | undefined;
13
13
  readonly surfaceId?: string | undefined;
14
14
  readonly findReplace?: Record<string, any> | undefined;
15
15
  };
@@ -1,15 +1,15 @@
1
1
  declare const _default: import('vue').DefineComponent<{}, {
2
2
  close: Function;
3
3
  resolve: Function;
4
- mode: string;
5
4
  request: Record<string, any>;
5
+ mode: string;
6
6
  surfaceId: string;
7
7
  passwordPrompt: Record<string, any>;
8
8
  $props: {
9
9
  readonly close?: Function | undefined;
10
10
  readonly resolve?: Function | undefined;
11
- readonly mode?: string | undefined;
12
11
  readonly request?: Record<string, any> | undefined;
12
+ readonly mode?: string | undefined;
13
13
  readonly surfaceId?: string | undefined;
14
14
  readonly passwordPrompt?: Record<string, any> | undefined;
15
15
  };
@@ -1,15 +1,15 @@
1
1
  declare const _default: import('vue').DefineComponent<{}, {
2
2
  close: Function;
3
3
  resolve: Function;
4
- mode: string;
5
4
  request: Record<string, any>;
5
+ mode: string;
6
6
  render: Function;
7
7
  surfaceId: string;
8
8
  $props: {
9
9
  readonly close?: Function | undefined;
10
10
  readonly resolve?: Function | undefined;
11
- readonly mode?: string | undefined;
12
11
  readonly request?: Record<string, any> | undefined;
12
+ readonly mode?: string | undefined;
13
13
  readonly render?: Function | undefined;
14
14
  readonly surfaceId?: string | undefined;
15
15
  };
@@ -10,8 +10,8 @@
10
10
  * @param {() => SearchEditor | null} options.getActiveEditor
11
11
  * @param {import('vue').Ref} [options.activeEditorRef] - Reactive ref to the active editor (for watching switches)
12
12
  * @param {() => boolean | FindReplaceConfig | undefined} [options.getFindReplaceConfig] - Config getter
13
- * @param {() => { search?: any } | null | undefined} [options.getSuperDocUI] - V2 UI controller getter
14
- * (`createSuperDocUI({ superdoc })`). Its `.search` slice is the single V2
13
+ * @param {() => { search?: any } | null | undefined} [options.getSuperDocUI] - Getter for the
14
+ * SuperDoc-owned UI controller (`superdoc.ui`). Its `.search` slice is the single V2
15
15
  * find/replace session authority; the V2 driver never touches `editor.commands`.
16
16
  */
17
17
  export function useFindReplace({ getSurfaceManager, getActiveEditor, activeEditorRef, getFindReplaceConfig, getSuperDocUI, }: {
@@ -3,6 +3,7 @@ import { HocuspocusProviderWebsocket } from '@hocuspocus/provider';
3
3
  import { createSuperdocVueApp } from './create-app.js';
4
4
  import { Whiteboard } from './whiteboard/Whiteboard.js';
5
5
  import { EditorRuntimeFocusOptions } from './editor-runtime/types.js';
6
+ import { BorrowedSuperDocUI } from '../public/ui/types.js';
6
7
  import { AwarenessUser, CanPerformPermissionParams, CollaborationProvider, Config, ContentControlActiveChangePayload, ContentControlClickPayload, DocumentMode, Editor, EditorUpdateEvent, ExportParams, FontsChangedPayload, FontsResolvedPayload, InternalConfig, ListDefinitionsPayload, NavigableAddress, DocumentRendererRuntime, SearchMatch, SuperDocAwarenessUpdatePayload, SuperDocCommentsUpdatePayload, SuperDocEditorPayload, SuperDocExceptionPayload, SuperDocFontsApi, SuperDocLockedPayload, SuperDocMeasurementUnit, SuperDocMeasurementUnitChangePayload, SuperDocReadyPayload, SuperDocState, SuperDocViewportChangePayload, SuperDocViewportMetrics, SuperDocZoomMode, SuperDocZoomPayload, SuperDocZoomState, SurfaceHandle, SurfaceRequest, UpgradeToCollaborationOptions, User } from './types/index.js';
7
8
  import { WhiteboardData } from './whiteboard/Whiteboard.js';
8
9
  type ToolbarLike = {
@@ -53,6 +54,13 @@ interface SuperDocEventMap {
53
54
  'measurement-unit-change': [SuperDocMeasurementUnitChangePayload];
54
55
  'formatting-marks-change': [SuperDocFormattingMarksPayload];
55
56
  'document-mode-change': [SuperDocDocumentModeChangePayload];
57
+ /**
58
+ * The active editor was assigned or cleared. Internal: the UI controller
59
+ * listens so its snapshot follows the live editor. `editorCreate` only
60
+ * covers assignment, and it is emitted after `broadcastReady()`, so
61
+ * neither a pre-ready read nor a clear would refresh without this.
62
+ */
63
+ 'active-editor-change': [];
56
64
  'editor-update': [EditorUpdateEvent];
57
65
  'content-error': [SuperDocContentErrorPayload];
58
66
  'fonts-resolved': [FontsResolvedPayload];
@@ -231,6 +239,39 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
231
239
  * @returns The number of required editors
232
240
  */
233
241
  get requiredNumberOfEditors(): number;
242
+ /**
243
+ * The UI controller for this instance: the single place to read command
244
+ * state and drive comments, track changes, selection, zoom, and the other
245
+ * UI surfaces from application code.
246
+ *
247
+ * SuperDoc owns exactly one controller per instance. Every internal
248
+ * consumer — the built-in toolbar, the link popover, keyboard command
249
+ * routing, and the React bindings — reads this same object, so command
250
+ * state never diverges between built-in and custom UI. The controller is
251
+ * created by the first read and its identity never changes afterwards:
252
+ * replacing the document, remounting an editor, or switching the active
253
+ * editor in a multi-document instance all keep the same controller.
254
+ *
255
+ * Reading it is safe before the document is ready. Slices report a `pending`
256
+ * status and commands report themselves disabled instead of throwing, so a
257
+ * custom UI can subscribe in the same tick as the constructor and will start
258
+ * receiving real values once an editor mounts.
259
+ *
260
+ * `SuperDoc.destroy()` destroys the controller. The returned type is
261
+ * {@link BorrowedSuperDocUI}, which omits `destroy()`, so a consumer tearing
262
+ * down state that other readers of this instance still observe is a compile
263
+ * error rather than a rule in a comment. The instance keeps the owning
264
+ * reference privately.
265
+ *
266
+ * This is an observation and command surface, not a permission boundary.
267
+ * Anything it exposes is reachable by the page that hosts SuperDoc.
268
+ *
269
+ * @example
270
+ * const superdoc = new SuperDoc({ selector: '#editor', document: file });
271
+ * const stop = superdoc.ui.comments.observe((comments) => render(comments));
272
+ * superdoc.ui.commands.get('bold').getState(); // { enabled, active, ... }
273
+ */
274
+ get ui(): BorrowedSuperDocUI;
234
275
  /**
235
276
  * Snapshot of the current SuperDoc state. Always reflects the most
236
277
  * recent values from the Pinia store; consumers must re-read on