superdoc 2.13.0-next.8 → 2.13.0-next.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
19
19
  var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
20
20
  var ENGINE_INFO = Object.freeze({
21
21
  ...PRIVATE_ENGINE_INFO,
22
- superdocVersion: "2.13.0-next.8",
22
+ superdocVersion: "2.13.0-next.9",
23
23
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
24
24
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
25
25
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
18
18
  var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
19
19
  var ENGINE_INFO = Object.freeze({
20
20
  ...PRIVATE_ENGINE_INFO,
21
- superdocVersion: "2.13.0-next.8",
21
+ superdocVersion: "2.13.0-next.9",
22
22
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
23
23
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
24
24
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
package/dist/style.css CHANGED
@@ -1818,11 +1818,11 @@ img[data-v-c95b2073] {
1818
1818
  pointer-events: auto;
1819
1819
  }
1820
1820
 
1821
- .superdoc[data-v-f0b56abb] {
1821
+ .superdoc[data-v-ebe9a1fb] {
1822
1822
  display: flex;
1823
1823
  position: relative;
1824
1824
  }
1825
- .sd-visually-hidden[data-v-f0b56abb] {
1825
+ .sd-visually-hidden[data-v-ebe9a1fb] {
1826
1826
  position: absolute;
1827
1827
  width: 1px;
1828
1828
  height: 1px;
@@ -1833,14 +1833,14 @@ img[data-v-c95b2073] {
1833
1833
  white-space: nowrap;
1834
1834
  border: 0;
1835
1835
  }
1836
- .superdoc__mutation-status[data-v-f0b56abb] {
1836
+ .superdoc__mutation-status[data-v-ebe9a1fb] {
1837
1837
  position: sticky;
1838
1838
  z-index: 10;
1839
1839
  top: 12px;
1840
1840
  height: 0;
1841
1841
  pointer-events: none;
1842
1842
  }
1843
- .superdoc__edit-rejected-status[data-v-f0b56abb] {
1843
+ .superdoc__edit-rejected-status[data-v-ebe9a1fb] {
1844
1844
  position: absolute;
1845
1845
  top: 0;
1846
1846
  left: 50%;
@@ -1858,30 +1858,30 @@ img[data-v-c95b2073] {
1858
1858
  line-height: 20px;
1859
1859
  pointer-events: none;
1860
1860
  }
1861
- .right-sidebar[data-v-f0b56abb] {
1861
+ .right-sidebar[data-v-ebe9a1fb] {
1862
1862
  min-width: 320px;
1863
1863
  height: 100%;
1864
1864
  }
1865
- .floating-comments[data-v-f0b56abb] {
1865
+ .floating-comments[data-v-ebe9a1fb] {
1866
1866
  min-width: 300px;
1867
1867
  width: 300px;
1868
1868
  height: 100%;
1869
1869
  overflow: visible;
1870
1870
  }
1871
- .superdoc__layers[data-v-f0b56abb] {
1871
+ .superdoc__layers[data-v-ebe9a1fb] {
1872
1872
  height: 100%;
1873
1873
  position: relative;
1874
1874
  box-sizing: border-box;
1875
1875
  }
1876
- .superdoc__document[data-v-f0b56abb] {
1876
+ .superdoc__document[data-v-ebe9a1fb] {
1877
1877
  width: 100%;
1878
1878
  position: relative;
1879
1879
  }
1880
- .superdoc__sub-document[data-v-f0b56abb] {
1880
+ .superdoc__sub-document[data-v-ebe9a1fb] {
1881
1881
  width: 100%;
1882
1882
  position: relative;
1883
1883
  }
1884
- .superdoc__selection-layer[data-v-f0b56abb] {
1884
+ .superdoc__selection-layer[data-v-ebe9a1fb] {
1885
1885
  position: absolute;
1886
1886
  min-width: 100%;
1887
1887
  min-height: 100%;
@@ -1892,13 +1892,13 @@ img[data-v-c95b2073] {
1892
1892
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
1893
1893
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
1894
1894
  clickable, and below the selection layer (z-index 10). */
1895
- .superdoc__whiteboard-layer[data-v-f0b56abb] {
1895
+ .superdoc__whiteboard-layer[data-v-ebe9a1fb] {
1896
1896
  z-index: 4;
1897
1897
  }
1898
- .superdoc__temp-selection[data-v-f0b56abb] {
1898
+ .superdoc__temp-selection[data-v-ebe9a1fb] {
1899
1899
  position: absolute;
1900
1900
  }
1901
- .superdoc__right-sidebar[data-v-f0b56abb] {
1901
+ .superdoc__right-sidebar[data-v-ebe9a1fb] {
1902
1902
  width: 320px;
1903
1903
  min-width: 320px;
1904
1904
  padding: 0 10px;
@@ -1906,7 +1906,7 @@ img[data-v-c95b2073] {
1906
1906
  position: relative;
1907
1907
  z-index: 2;
1908
1908
  }
1909
- .superdoc__compact-comment-popover[data-v-f0b56abb] {
1909
+ .superdoc__compact-comment-popover[data-v-ebe9a1fb] {
1910
1910
  position: absolute;
1911
1911
  top: 12px;
1912
1912
  right: 12px;
@@ -1915,14 +1915,14 @@ img[data-v-c95b2073] {
1915
1915
  }
1916
1916
 
1917
1917
  /* Tools styles */
1918
- .tools[data-v-f0b56abb] {
1918
+ .tools[data-v-ebe9a1fb] {
1919
1919
  position: absolute;
1920
1920
  z-index: 3;
1921
1921
  display: flex;
1922
1922
  flex-direction: column;
1923
1923
  gap: var(--sd-ui-tools-gap, 6px);
1924
1924
  }
1925
- .tools-item[data-v-f0b56abb] {
1925
+ .tools-item[data-v-ebe9a1fb] {
1926
1926
  display: flex;
1927
1927
  align-items: center;
1928
1928
  justify-content: center;
@@ -1933,10 +1933,10 @@ img[data-v-c95b2073] {
1933
1933
  cursor: pointer;
1934
1934
  position: relative;
1935
1935
  }
1936
- .tools-item i[data-v-f0b56abb] {
1936
+ .tools-item i[data-v-ebe9a1fb] {
1937
1937
  cursor: pointer;
1938
1938
  }
1939
- .superdoc__tools-icon[data-v-f0b56abb] {
1939
+ .superdoc__tools-icon[data-v-ebe9a1fb] {
1940
1940
  width: var(--sd-ui-tools-icon-size, 20px);
1941
1941
  height: var(--sd-ui-tools-icon-size, 20px);
1942
1942
  flex-shrink: 0;
@@ -1951,22 +1951,22 @@ img[data-v-c95b2073] {
1951
1951
 
1952
1952
  /* 834px is iPad screen size in portrait orientation */
1953
1953
  @media (max-width: 834px) {
1954
- .superdoc .superdoc__layers[data-v-f0b56abb] {
1954
+ .superdoc .superdoc__layers[data-v-ebe9a1fb] {
1955
1955
  margin: 0;
1956
1956
  border: 0 !important;
1957
1957
  box-shadow: none;
1958
1958
  }
1959
- .superdoc__sub-document[data-v-f0b56abb] {
1959
+ .superdoc__sub-document[data-v-ebe9a1fb] {
1960
1960
  max-width: 100%;
1961
1961
  }
1962
- .superdoc__right-sidebar[data-v-f0b56abb] {
1962
+ .superdoc__right-sidebar[data-v-ebe9a1fb] {
1963
1963
  padding: 10px;
1964
1964
  position: relative;
1965
1965
  }
1966
1966
  }
1967
1967
 
1968
1968
  /* AI Writer styles */
1969
- .ai-writer-container[data-v-f0b56abb] {
1969
+ .ai-writer-container[data-v-ebe9a1fb] {
1970
1970
  position: fixed;
1971
1971
  z-index: 1000;
1972
1972
  background: white;
@@ -1982,10 +1982,10 @@ img[data-v-c95b2073] {
1982
1982
  transform: translateY(-50%);
1983
1983
  z-index: 50;
1984
1984
  } */
1985
- .ai-tool > svg[data-v-f0b56abb] {
1985
+ .ai-tool > svg[data-v-ebe9a1fb] {
1986
1986
  fill: transparent;
1987
1987
  }
1988
- .ai-tool[data-v-f0b56abb]::before {
1988
+ .ai-tool[data-v-ebe9a1fb]::before {
1989
1989
  content: '';
1990
1990
  position: absolute;
1991
1991
  width: 20px;
@@ -2006,7 +2006,7 @@ img[data-v-c95b2073] {
2006
2006
  filter: brightness(1.2);
2007
2007
  transition: filter 0.2s ease;
2008
2008
  }
2009
- .ai-tool[data-v-f0b56abb]:hover::before {
2009
+ .ai-tool[data-v-ebe9a1fb]:hover::before {
2010
2010
  filter: brightness(1.3);
2011
2011
  }
2012
2012
 
@@ -1818,11 +1818,11 @@ img[data-v-c95b2073] {
1818
1818
  pointer-events: auto;
1819
1819
  }
1820
1820
 
1821
- .superdoc[data-v-f0b56abb] {
1821
+ .superdoc[data-v-ebe9a1fb] {
1822
1822
  display: flex;
1823
1823
  position: relative;
1824
1824
  }
1825
- .sd-visually-hidden[data-v-f0b56abb] {
1825
+ .sd-visually-hidden[data-v-ebe9a1fb] {
1826
1826
  position: absolute;
1827
1827
  width: 1px;
1828
1828
  height: 1px;
@@ -1833,14 +1833,14 @@ img[data-v-c95b2073] {
1833
1833
  white-space: nowrap;
1834
1834
  border: 0;
1835
1835
  }
1836
- .superdoc__mutation-status[data-v-f0b56abb] {
1836
+ .superdoc__mutation-status[data-v-ebe9a1fb] {
1837
1837
  position: sticky;
1838
1838
  z-index: 10;
1839
1839
  top: 12px;
1840
1840
  height: 0;
1841
1841
  pointer-events: none;
1842
1842
  }
1843
- .superdoc__edit-rejected-status[data-v-f0b56abb] {
1843
+ .superdoc__edit-rejected-status[data-v-ebe9a1fb] {
1844
1844
  position: absolute;
1845
1845
  top: 0;
1846
1846
  left: 50%;
@@ -1858,30 +1858,30 @@ img[data-v-c95b2073] {
1858
1858
  line-height: 20px;
1859
1859
  pointer-events: none;
1860
1860
  }
1861
- .right-sidebar[data-v-f0b56abb] {
1861
+ .right-sidebar[data-v-ebe9a1fb] {
1862
1862
  min-width: 320px;
1863
1863
  height: 100%;
1864
1864
  }
1865
- .floating-comments[data-v-f0b56abb] {
1865
+ .floating-comments[data-v-ebe9a1fb] {
1866
1866
  min-width: 300px;
1867
1867
  width: 300px;
1868
1868
  height: 100%;
1869
1869
  overflow: visible;
1870
1870
  }
1871
- .superdoc__layers[data-v-f0b56abb] {
1871
+ .superdoc__layers[data-v-ebe9a1fb] {
1872
1872
  height: 100%;
1873
1873
  position: relative;
1874
1874
  box-sizing: border-box;
1875
1875
  }
1876
- .superdoc__document[data-v-f0b56abb] {
1876
+ .superdoc__document[data-v-ebe9a1fb] {
1877
1877
  width: 100%;
1878
1878
  position: relative;
1879
1879
  }
1880
- .superdoc__sub-document[data-v-f0b56abb] {
1880
+ .superdoc__sub-document[data-v-ebe9a1fb] {
1881
1881
  width: 100%;
1882
1882
  position: relative;
1883
1883
  }
1884
- .superdoc__selection-layer[data-v-f0b56abb] {
1884
+ .superdoc__selection-layer[data-v-ebe9a1fb] {
1885
1885
  position: absolute;
1886
1886
  min-width: 100%;
1887
1887
  min-height: 100%;
@@ -1892,13 +1892,13 @@ img[data-v-c95b2073] {
1892
1892
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
1893
1893
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
1894
1894
  clickable, and below the selection layer (z-index 10). */
1895
- .superdoc__whiteboard-layer[data-v-f0b56abb] {
1895
+ .superdoc__whiteboard-layer[data-v-ebe9a1fb] {
1896
1896
  z-index: 4;
1897
1897
  }
1898
- .superdoc__temp-selection[data-v-f0b56abb] {
1898
+ .superdoc__temp-selection[data-v-ebe9a1fb] {
1899
1899
  position: absolute;
1900
1900
  }
1901
- .superdoc__right-sidebar[data-v-f0b56abb] {
1901
+ .superdoc__right-sidebar[data-v-ebe9a1fb] {
1902
1902
  width: 320px;
1903
1903
  min-width: 320px;
1904
1904
  padding: 0 10px;
@@ -1906,7 +1906,7 @@ img[data-v-c95b2073] {
1906
1906
  position: relative;
1907
1907
  z-index: 2;
1908
1908
  }
1909
- .superdoc__compact-comment-popover[data-v-f0b56abb] {
1909
+ .superdoc__compact-comment-popover[data-v-ebe9a1fb] {
1910
1910
  position: absolute;
1911
1911
  top: 12px;
1912
1912
  right: 12px;
@@ -1915,14 +1915,14 @@ img[data-v-c95b2073] {
1915
1915
  }
1916
1916
 
1917
1917
  /* Tools styles */
1918
- .tools[data-v-f0b56abb] {
1918
+ .tools[data-v-ebe9a1fb] {
1919
1919
  position: absolute;
1920
1920
  z-index: 3;
1921
1921
  display: flex;
1922
1922
  flex-direction: column;
1923
1923
  gap: var(--sd-ui-tools-gap, 6px);
1924
1924
  }
1925
- .tools-item[data-v-f0b56abb] {
1925
+ .tools-item[data-v-ebe9a1fb] {
1926
1926
  display: flex;
1927
1927
  align-items: center;
1928
1928
  justify-content: center;
@@ -1933,10 +1933,10 @@ img[data-v-c95b2073] {
1933
1933
  cursor: pointer;
1934
1934
  position: relative;
1935
1935
  }
1936
- .tools-item i[data-v-f0b56abb] {
1936
+ .tools-item i[data-v-ebe9a1fb] {
1937
1937
  cursor: pointer;
1938
1938
  }
1939
- .superdoc__tools-icon[data-v-f0b56abb] {
1939
+ .superdoc__tools-icon[data-v-ebe9a1fb] {
1940
1940
  width: var(--sd-ui-tools-icon-size, 20px);
1941
1941
  height: var(--sd-ui-tools-icon-size, 20px);
1942
1942
  flex-shrink: 0;
@@ -1951,22 +1951,22 @@ img[data-v-c95b2073] {
1951
1951
 
1952
1952
  /* 834px is iPad screen size in portrait orientation */
1953
1953
  @media (max-width: 834px) {
1954
- .superdoc .superdoc__layers[data-v-f0b56abb] {
1954
+ .superdoc .superdoc__layers[data-v-ebe9a1fb] {
1955
1955
  margin: 0;
1956
1956
  border: 0 !important;
1957
1957
  box-shadow: none;
1958
1958
  }
1959
- .superdoc__sub-document[data-v-f0b56abb] {
1959
+ .superdoc__sub-document[data-v-ebe9a1fb] {
1960
1960
  max-width: 100%;
1961
1961
  }
1962
- .superdoc__right-sidebar[data-v-f0b56abb] {
1962
+ .superdoc__right-sidebar[data-v-ebe9a1fb] {
1963
1963
  padding: 10px;
1964
1964
  position: relative;
1965
1965
  }
1966
1966
  }
1967
1967
 
1968
1968
  /* AI Writer styles */
1969
- .ai-writer-container[data-v-f0b56abb] {
1969
+ .ai-writer-container[data-v-ebe9a1fb] {
1970
1970
  position: fixed;
1971
1971
  z-index: 1000;
1972
1972
  background: white;
@@ -1982,10 +1982,10 @@ img[data-v-c95b2073] {
1982
1982
  transform: translateY(-50%);
1983
1983
  z-index: 50;
1984
1984
  } */
1985
- .ai-tool > svg[data-v-f0b56abb] {
1985
+ .ai-tool > svg[data-v-ebe9a1fb] {
1986
1986
  fill: transparent;
1987
1987
  }
1988
- .ai-tool[data-v-f0b56abb]::before {
1988
+ .ai-tool[data-v-ebe9a1fb]::before {
1989
1989
  content: '';
1990
1990
  position: absolute;
1991
1991
  width: 20px;
@@ -2006,7 +2006,7 @@ img[data-v-c95b2073] {
2006
2006
  filter: brightness(1.2);
2007
2007
  transition: filter 0.2s ease;
2008
2008
  }
2009
- .ai-tool[data-v-f0b56abb]:hover::before {
2009
+ .ai-tool[data-v-ebe9a1fb]:hover::before {
2010
2010
  filter: brightness(1.3);
2011
2011
  }
2012
2012
 
@@ -0,0 +1,2 @@
1
+ import { SuperDocExceptionCollaborationPayload } from '../types/index.js';
2
+ export declare function createCollaborationException(code: string, documentId: string | null): SuperDocExceptionCollaborationPayload | null;
@@ -7,7 +7,7 @@
7
7
  * first-class single-doc provider families — y-websocket, Hocuspocus, and
8
8
  * Liveblocks — each bound to one `Y.Doc`, one provider session, and one
9
9
  * awareness channel (implemented inside the bundled v2 runtime) and surfaced
10
- * publicly through {@link V2CollaborationConfig} (`Document.v2Collaboration`).
10
+ * publicly through {@link DocumentCollaborationConfig} (`Document.collaboration`).
11
11
  *
12
12
  * The resolver never returns a "maybe collaborative" result: it either returns
13
13
  * a normalized, supported target or a stable, redacted diagnostic. Tokens, auth
@@ -72,7 +72,9 @@ export interface LegacyCollaborationLike {
72
72
  [key: string]: unknown;
73
73
  }
74
74
  export interface ResolveV2CollaborationTargetInput {
75
- /** Document-level v2 collaboration config (canonical supported entry point). */
75
+ /** Preferred connection settings. Explicit null or invalid input never falls back to the alias. */
76
+ collaboration?: unknown;
77
+ /** Compatibility spelling for document-level connection settings. */
76
78
  v2Collaboration?: unknown;
77
79
  /** Legacy provider-agnostic collaboration block (`modules.collaboration` / upgrade opts). */
78
80
  legacyCollaboration?: LegacyCollaborationLike | null;
@@ -87,6 +89,11 @@ export interface ResolveV2CollaborationTargetInput {
87
89
  */
88
90
  authEndpointBaseUrl?: string;
89
91
  }
92
+ /** Select the public spelling before validation; do not merge settings from different rooms. */
93
+ export declare function readCollaborationConfig(input: {
94
+ collaboration?: unknown;
95
+ v2Collaboration?: unknown;
96
+ }): unknown;
90
97
  /**
91
98
  * Redact a connection URL for safe inclusion in diagnostics and artifacts.
92
99
  *
@@ -596,7 +596,7 @@ export interface CollaborationProvider {
596
596
  [key: string]: unknown;
597
597
  }
598
598
  /**
599
- * Document-level v2 collaboration handoff.
599
+ * Connection settings for one shared document, used at startup and during an upgrade.
600
600
  *
601
601
  * This is the public surface for SuperDoc v2's shipped real-time collaboration
602
602
  * model. v2 collaboration is always single-doc: one `Y.Doc`, one provider
@@ -616,7 +616,9 @@ export interface CollaborationProvider {
616
616
  * Y.Doc. Provider extensions receive that document inside the collaboration
617
617
  * Worker instead of replacing it.
618
618
  */
619
- export type V2CollaborationConfig = V2YWebsocketCollaborationConfig | V2HocuspocusCollaborationConfig | V2LiveblocksCollaborationConfig | V2ProviderExtensionCollaborationConfig;
619
+ export type DocumentCollaborationConfig = V2YWebsocketCollaborationConfig | V2HocuspocusCollaborationConfig | V2LiveblocksCollaborationConfig | V2ProviderExtensionCollaborationConfig;
620
+ /** @deprecated replaceWith=`DocumentCollaborationConfig` compat-indefinitely: existing v2 integrations import this type. */
621
+ export type V2CollaborationConfig = DocumentCollaborationConfig;
620
622
  /**
621
623
  * y-websocket single-doc provider config.
622
624
  *
@@ -947,29 +949,21 @@ export interface AwarenessUser extends User {
947
949
  }
948
950
  /**
949
951
  * One entry in the `states` array delivered to
950
- * {@link Config.onAwarenessUpdate}. SuperDoc emits an entry per remote
951
- * client, derived from the underlying Yjs awareness states.
952
+ * {@link Config.onAwarenessUpdate}. In V2, `states` includes the current
953
+ * user and remote participants. Do not append the current user again.
952
954
  *
953
- * The runtime helper `awarenessStatesToArray` spreads each remote user
954
- * onto the top of the entry (`{ clientId, ...value.user, color }`), so
955
- * `User` fields like `name`, `email`, `image` appear at the top level
956
- * (not nested under a `user` property). Consumers should read `state.id`,
957
- * `state.name`, and `state.email`, not `state.user.name`.
955
+ * Display fields such as `name`, `email`, and `color` are at the top
956
+ * level, not nested under `user`. Fields may be absent; a presence
957
+ * entry is not an authenticated account record.
958
958
  *
959
959
  * Application-specific fields attached to the awareness state by the
960
960
  * provider surface through the `[key: string]: unknown` index
961
961
  * signature; consumers narrow before use.
962
962
  */
963
963
  export interface AwarenessState extends User {
964
- /** Yjs client identifier for the remote peer. */
964
+ /** Presence identifier. In V2, scoped to this editor instance, not a Yjs transport id. */
965
965
  clientId?: number;
966
- /**
967
- * Color assigned by SuperDoc's presence system. Spread onto the
968
- * awareness entry after the user fields, so it takes precedence
969
- * over any color the awareness user carried in (see
970
- * {@link AwarenessUser.color}). Used when the presence system
971
- * computes a stable palette assignment for the remote peer.
972
- */
966
+ /** Resolved cursor color supplied by the presence system. */
973
967
  color?: string;
974
968
  /** Application-specific fields spread from the awareness provider. */
975
969
  [key: string]: unknown;
@@ -1013,12 +1007,11 @@ export interface Document {
1013
1007
  */
1014
1008
  provider?: CollaborationProvider;
1015
1009
  /**
1016
- * Document-level v2 collaboration handoff. When present, the v2 runtime
1017
- * makes this document collaborative through the shipped single-doc
1018
- * y-websocket provider (one room / Y.Doc / awareness channel per
1019
- * `documentId`). See {@link V2CollaborationConfig}. Ignored by the v1
1020
- * editor, which uses `Config.modules.collaboration` instead.
1010
+ * Connect this document to a shared room. SuperDoc owns the provider and Y.Doc.
1011
+ * Takes precedence over `v2Collaboration`; `null` opens a local document.
1021
1012
  */
1013
+ collaboration?: DocumentCollaborationConfig | null;
1014
+ /** @deprecated replaceWith=`collaboration` compat-indefinitely: existing v2 integrations use this field. */
1022
1015
  v2Collaboration?: V2CollaborationConfig | null;
1023
1016
  }
1024
1017
  type DocumentSourceOptions = Omit<Document, 'data' | 'type' | 'url'>;
@@ -1141,9 +1134,8 @@ export interface CollaborationConfig {
1141
1134
  /**
1142
1135
  * Options for `upgradeToCollaboration()`.
1143
1136
  *
1144
- * v2 promotes a local single-DOCX editor into the shipped single-doc
1145
- * y-websocket room described by {@link V2CollaborationConfig}. Pass a
1146
- * `v2Collaboration` target to promote into a supported v2 room.
1137
+ * Promote a local DOCX into a shared room using `collaboration`.
1138
+ * Supports the same providers as {@link DocumentCollaborationConfig}.
1147
1139
  *
1148
1140
  * The legacy `ydoc` / `provider` fields remain accepted for source
1149
1141
  * compatibility with v1-shaped callers, but v2 does **not** drive document
@@ -1153,14 +1145,15 @@ export interface CollaborationConfig {
1153
1145
  * fields are therefore optional and only honored when they resolve to a
1154
1146
  * supported v2 room.
1155
1147
  *
1156
- * @see {@link V2CollaborationConfig}
1148
+ * @see {@link DocumentCollaborationConfig}
1157
1149
  */
1158
1150
  export interface UpgradeToCollaborationOptions {
1159
1151
  /**
1160
- * Canonical supported v2 promotion target: the single-doc y-websocket room
1161
- * ({ documentId, serverUrl, params? }) to create from the current document.
1162
- * Promotion fails if the v2 room already exists.
1152
+ * Create a shared room from the current document. Fails if the room already exists.
1153
+ * Takes precedence over `v2Collaboration`.
1163
1154
  */
1155
+ collaboration?: DocumentCollaborationConfig;
1156
+ /** @deprecated replaceWith=`collaboration` compat-indefinitely: existing v2 integrations use this field. */
1164
1157
  v2Collaboration?: V2CollaborationConfig;
1165
1158
  /**
1166
1159
  * Legacy external Yjs document. Accepted for v1 source compatibility; not a
@@ -3257,6 +3250,14 @@ export interface SuperDocExceptionEditorPayload {
3257
3250
  /** Structured browser-worker failure detail when editor startup failed in its worker transport. */
3258
3251
  workerFailure?: SuperDocWorkerFailureDetail;
3259
3252
  }
3253
+ /** Connection failure while opening a collaboration room, reported through `onException`. */
3254
+ export interface SuperDocExceptionCollaborationPayload extends SuperDocExceptionEditorPayload {
3255
+ error: Error;
3256
+ code: 'collaboration-access-denied' | 'collaboration-connection-failed' | 'collaboration-sync-timeout';
3257
+ /** Access denial requires an explicit provider rejection; a timeout is not proof of denied access. */
3258
+ collaborationReason: 'access-denied' | 'connection-failed' | 'sync-timeout';
3259
+ editor: null;
3260
+ }
3260
3261
  /**
3261
3262
  * Exception payload raised by the built-in toolbar.
3262
3263
  *
@@ -3326,6 +3327,7 @@ export interface SuperDocExceptionDiagnosticPayload {
3326
3327
  * Consumers can narrow with `'stage' in payload` (store init),
3327
3328
  * `'code' in payload` (editor lifecycle), `'itemName' in payload`
3328
3329
  * (built-in toolbar), `'source' in payload` (hyperlink activation),
3330
+ * `'collaborationReason' in payload` (collaboration connection),
3329
3331
  * or `'diagnosticCode' in payload` (structured diagnostic).
3330
3332
  *
3331
3333
  * The union exists today because multiple independent emit sites pre-date a
@@ -3333,7 +3335,7 @@ export interface SuperDocExceptionDiagnosticPayload {
3333
3335
  * separate follow-up; consumers can narrow with the `in` checks above in the
3334
3336
  * meantime.
3335
3337
  */
3336
- export type SuperDocExceptionPayload = SuperDocExceptionStorePayload | SuperDocExceptionRestorePayload | SuperDocExceptionEditorPayload | SuperDocExceptionToolbarPayload | SuperDocExceptionHyperlinkPayload | SuperDocExceptionDiagnosticPayload;
3338
+ export type SuperDocExceptionPayload = SuperDocExceptionStorePayload | SuperDocExceptionRestorePayload | SuperDocExceptionEditorPayload | SuperDocExceptionCollaborationPayload | SuperDocExceptionToolbarPayload | SuperDocExceptionHyperlinkPayload | SuperDocExceptionDiagnosticPayload;
3337
3339
  /**
3338
3340
  * Zoom mode. `manual` holds whatever value was last set; `fit-width`
3339
3341
  * continuously recomputes the zoom that fits the page width into the
@@ -3842,7 +3844,7 @@ export interface Config {
3842
3844
  role?: 'editor' | 'viewer' | 'suggester';
3843
3845
  /**
3844
3846
  * Document to open. Pass a URL, file, byte source, or structured source.
3845
- * Use a structured document carrying `v2Collaboration` for collaboration,
3847
+ * Use a structured document carrying `collaboration` for collaboration,
3846
3848
  * or a structured source for other metadata. Omit it to open a blank DOCX.
3847
3849
  */
3848
3850
  document?: DocumentSource | null;
@@ -38,6 +38,7 @@ import type { DirectSurfaceRequest as __Cjs_DirectSurfaceRequest } from './index
38
38
  import type { DocRange as __Cjs_DocRange } from './index.js' with { "resolution-mode": "import" };
39
39
  import type { Document as __Cjs_Document } from './index.js' with { "resolution-mode": "import" };
40
40
  import type { DocumentApi as __Cjs_DocumentApi } from './index.js' with { "resolution-mode": "import" };
41
+ import type { DocumentCollaborationConfig as __Cjs_DocumentCollaborationConfig } from './index.js' with { "resolution-mode": "import" };
41
42
  import type { DocumentDataSource as __Cjs_DocumentDataSource } from './index.js' with { "resolution-mode": "import" };
42
43
  import type { DocumentMode as __Cjs_DocumentMode } from './index.js' with { "resolution-mode": "import" };
43
44
  import type { DocumentProtectionState as __Cjs_DocumentProtectionState } from './index.js' with { "resolution-mode": "import" };
@@ -131,6 +132,7 @@ import type { SuperDocDiagnosticStage as __Cjs_SuperDocDiagnosticStage } from '.
131
132
  import type { SuperDocDisposableBag as __Cjs_SuperDocDisposableBag } from './index.js' with { "resolution-mode": "import" };
132
133
  import type { SuperDocDocumentModeChangePayload as __Cjs_SuperDocDocumentModeChangePayload } from './index.js' with { "resolution-mode": "import" };
133
134
  import type { SuperDocEditorPayload as __Cjs_SuperDocEditorPayload } from './index.js' with { "resolution-mode": "import" };
135
+ import type { SuperDocExceptionCollaborationPayload as __Cjs_SuperDocExceptionCollaborationPayload } from './index.js' with { "resolution-mode": "import" };
134
136
  import type { SuperDocExceptionDiagnosticPayload as __Cjs_SuperDocExceptionDiagnosticPayload } from './index.js' with { "resolution-mode": "import" };
135
137
  import type { SuperDocExceptionEditorPayload as __Cjs_SuperDocExceptionEditorPayload } from './index.js' with { "resolution-mode": "import" };
136
138
  import type { SuperDocExceptionHyperlinkPayload as __Cjs_SuperDocExceptionHyperlinkPayload } from './index.js' with { "resolution-mode": "import" };
@@ -298,6 +300,7 @@ export type { __Cjs_DirectSurfaceRequest as DirectSurfaceRequest };
298
300
  export type { __Cjs_DocRange as DocRange };
299
301
  export type { __Cjs_Document as Document };
300
302
  export type { __Cjs_DocumentApi as DocumentApi };
303
+ export type { __Cjs_DocumentCollaborationConfig as DocumentCollaborationConfig };
301
304
  export type { __Cjs_DocumentDataSource as DocumentDataSource };
302
305
  export type { __Cjs_DocumentMode as DocumentMode };
303
306
  export type { __Cjs_DocumentProtectionState as DocumentProtectionState };
@@ -396,6 +399,7 @@ export type { __Cjs_SuperDocDiagnosticStage as SuperDocDiagnosticStage };
396
399
  export type { __Cjs_SuperDocDisposableBag as SuperDocDisposableBag };
397
400
  export type { __Cjs_SuperDocDocumentModeChangePayload as SuperDocDocumentModeChangePayload };
398
401
  export type { __Cjs_SuperDocEditorPayload as SuperDocEditorPayload };
402
+ export type { __Cjs_SuperDocExceptionCollaborationPayload as SuperDocExceptionCollaborationPayload };
399
403
  export type { __Cjs_SuperDocExceptionDiagnosticPayload as SuperDocExceptionDiagnosticPayload };
400
404
  export type { __Cjs_SuperDocExceptionEditorPayload as SuperDocExceptionEditorPayload };
401
405
  export type { __Cjs_SuperDocExceptionHyperlinkPayload as SuperDocExceptionHyperlinkPayload };
@@ -23,6 +23,7 @@ export type { Config } from '../core/types/index.js';
23
23
  export type { DirectSurfaceRequest } from '../core/types/index.js';
24
24
  export type { DocRange } from '../core/types/index.js';
25
25
  export type { Document } from '../core/types/index.js';
26
+ export type { DocumentCollaborationConfig } from '../core/types/index.js';
26
27
  export type { DocumentDataSource } from '../core/types/index.js';
27
28
  export type { DocumentSource } from '../core/types/index.js';
28
29
  export type { DocumentUploadSource } from '../core/types/index.js';
@@ -86,6 +87,7 @@ export type { SuperDocWorkerFailureDetail } from '../core/types/index.js';
86
87
  export type { SuperDocExceptionHyperlinkPayload } from '../core/types/index.js';
87
88
  export type { SuperDocExceptionToolbarPayload } from '../core/types/index.js';
88
89
  export type { SuperDocExceptionPayload } from '../core/types/index.js';
90
+ export type { SuperDocExceptionCollaborationPayload } from '../core/types/index.js';
89
91
  export type { SuperDocExceptionRestorePayload } from '../core/types/index.js';
90
92
  export type { SuperDocExceptionStorePayload } from '../core/types/index.js';
91
93
  export type { SuperDocFitWidthOptions } from '../core/types/index.js';