superdoc 2.18.0-next.9 → 2.18.0

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.18.0-next.9",
22
+ superdocVersion: "2.18.0",
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.18.0-next.9",
21
+ superdocVersion: "2.18.0",
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
@@ -44,7 +44,7 @@ export interface DiffSummary {
44
44
  };
45
45
  }
46
46
  /** Stable reason code for a compare-time apply blocker. */
47
- export type DiffApplyEligibilityBlockerCode = 'family-apply-lane-unavailable' | 'header-footer-physical-lifecycle-unsafe' | 'header-footer-tracked-lifecycle-unsupported' | 'comment-replay-unsafe' | 'comment-anchor-marker-semantics-unsafe' | 'styles-replay-unsafe' | 'numbering-replay-unsafe' | 'section-reference-replay-unsafe' | 'structural-paragraph-unsupported';
47
+ export type DiffApplyEligibilityBlockerCode = 'family-apply-lane-unavailable' | 'header-footer-physical-lifecycle-unsafe' | 'header-footer-tracked-lifecycle-unsupported' | 'comment-replay-unsafe' | 'comment-anchor-marker-semantics-unsafe' | 'styles-replay-unsafe' | 'numbering-replay-unsafe' | 'definition-replay-tracked-unsupported' | 'section-reference-replay-unsafe' | 'structural-paragraph-unsupported';
48
48
  /** A known reason that the complete diff cannot be applied in one change mode. */
49
49
  export interface DiffApplyEligibilityBlocker {
50
50
  code: DiffApplyEligibilityBlockerCode;
@@ -181,6 +181,8 @@ export interface CreateImageSuccessResult {
181
181
  success: true;
182
182
  image: ImageAddress;
183
183
  trackedChangeRefs?: ReceiptInsert[];
184
+ /** Commit id for the insertion, including its alt text when that was set in the same call. */
185
+ txId?: string;
184
186
  }
185
187
  export interface CreateImageFailureResult {
186
188
  success: false;
@@ -110,7 +110,26 @@ export type SDPasteLeafInline = {
110
110
  title?: string;
111
111
  sourcePath?: readonly (string | number)[];
112
112
  };
113
- export type SDPasteInline = SDPasteLeafInline | {
113
+ export interface SDPasteSdtInline {
114
+ kind: 'sdt';
115
+ controlType: 'text' | 'richText';
116
+ tag?: string;
117
+ alias?: string;
118
+ lockMode?: 'unlocked' | 'sdtLocked' | 'contentLocked' | 'sdtContentLocked';
119
+ multiline?: boolean;
120
+ sourcePath?: readonly (string | number)[];
121
+ inlines: readonly (SDPasteLeafInline | SDPasteSdtInline)[];
122
+ }
123
+ export interface SDPasteBlockSdt {
124
+ /** Clipboard-local wrapper identity shared by adjacent paragraphs. */
125
+ sourceId: string;
126
+ controlType: 'text' | 'richText';
127
+ tag?: string;
128
+ alias?: string;
129
+ lockMode?: 'unlocked' | 'sdtLocked' | 'contentLocked' | 'sdtContentLocked';
130
+ multiline?: boolean;
131
+ }
132
+ export type SDPasteInline = SDPasteLeafInline | SDPasteSdtInline | {
114
133
  kind: 'hyperlink';
115
134
  target: {
116
135
  kind: 'external';
@@ -176,6 +195,8 @@ export interface SDPasteParagraphBlock {
176
195
  * paste anchor's paragraph, independent of whether they carry formatting.
177
196
  */
178
197
  complete?: boolean;
198
+ /** Outermost-first complete block content-control ancestry. */
199
+ blockSdts?: readonly SDPasteBlockSdt[];
179
200
  /** Transient conversion identity used to map mutation effects back to source nodes. */
180
201
  sourcePath?: readonly (string | number)[];
181
202
  }
@@ -215,6 +236,8 @@ export interface SDPasteTableRow {
215
236
  */
216
237
  export interface SDPasteTableBlock {
217
238
  kind: 'table';
239
+ /** Direct between-cell spacing in points (not cell padding). */
240
+ cellSpacingPt?: number;
218
241
  rows: readonly SDPasteTableRow[];
219
242
  sourcePath?: readonly (string | number)[];
220
243
  }
@@ -427,6 +427,10 @@ export type TextRun = RunMarks & {
427
427
  export type TabRun = RunMarks & {
428
428
  kind: 'tab';
429
429
  text: '\t';
430
+ positionedTab?: {
431
+ relativeTo: 'margin' | 'indent';
432
+ alignment: 'start' | 'center' | 'end';
433
+ };
430
434
  /**
431
435
  * Font of the tab, inherited from the paragraph's resolved run properties. A tab has
432
436
  * no glyphs, but its font drives the line height (so a tab-only line matches a text
@@ -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-D9JWPXRh.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-wDvhW9Tz.cjs");
3
3
  const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
4
4
  let react = require("react");
5
5
  //#region src/public/ui/react.ts
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-qTSa0PbD.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-wKzxrztu.es.js";
2
2
  import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
3
3
  import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
4
4
  //#region src/public/ui/react.ts
@@ -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-D9JWPXRh.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-wDvhW9Tz.cjs");
3
3
  const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
4
4
  let vue = require("vue");
5
5
  //#region src/public/ui/vue.ts
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-qTSa0PbD.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-wKzxrztu.es.js";
2
2
  import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
3
3
  import { computed, inject, onScopeDispose, provide, shallowRef, toRaw, toValue, watch } from "vue";
4
4
  //#region src/public/ui/vue.ts
@@ -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-D9JWPXRh.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-wDvhW9Tz.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 shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-qTSa0PbD.es.js";
1
+ import { i as BUILT_IN_COMMAND_IDS, s as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-wKzxrztu.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
package/dist/style.css CHANGED
@@ -1823,34 +1823,34 @@ img[data-v-c95b2073] {
1823
1823
  pointer-events: auto;
1824
1824
  }
1825
1825
 
1826
- .superdoc[data-v-4efb0cab] {
1826
+ .superdoc[data-v-77e0209a] {
1827
1827
  display: flex;
1828
1828
  position: relative;
1829
1829
  }
1830
- .right-sidebar[data-v-4efb0cab] {
1830
+ .right-sidebar[data-v-77e0209a] {
1831
1831
  min-width: 320px;
1832
1832
  height: 100%;
1833
1833
  }
1834
- .floating-comments[data-v-4efb0cab] {
1834
+ .floating-comments[data-v-77e0209a] {
1835
1835
  min-width: 300px;
1836
1836
  width: 300px;
1837
1837
  height: 100%;
1838
1838
  overflow: visible;
1839
1839
  }
1840
- .superdoc__layers[data-v-4efb0cab] {
1840
+ .superdoc__layers[data-v-77e0209a] {
1841
1841
  height: 100%;
1842
1842
  position: relative;
1843
1843
  box-sizing: border-box;
1844
1844
  }
1845
- .superdoc__document[data-v-4efb0cab] {
1845
+ .superdoc__document[data-v-77e0209a] {
1846
1846
  width: 100%;
1847
1847
  position: relative;
1848
1848
  }
1849
- .superdoc__sub-document[data-v-4efb0cab] {
1849
+ .superdoc__sub-document[data-v-77e0209a] {
1850
1850
  width: 100%;
1851
1851
  position: relative;
1852
1852
  }
1853
- .superdoc__selection-layer[data-v-4efb0cab] {
1853
+ .superdoc__selection-layer[data-v-77e0209a] {
1854
1854
  position: absolute;
1855
1855
  min-width: 100%;
1856
1856
  min-height: 100%;
@@ -1861,13 +1861,13 @@ img[data-v-c95b2073] {
1861
1861
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
1862
1862
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
1863
1863
  clickable, and below the selection layer (z-index 10). */
1864
- .superdoc__whiteboard-layer[data-v-4efb0cab] {
1864
+ .superdoc__whiteboard-layer[data-v-77e0209a] {
1865
1865
  z-index: 4;
1866
1866
  }
1867
- .superdoc__temp-selection[data-v-4efb0cab] {
1867
+ .superdoc__temp-selection[data-v-77e0209a] {
1868
1868
  position: absolute;
1869
1869
  }
1870
- .superdoc__right-sidebar[data-v-4efb0cab] {
1870
+ .superdoc__right-sidebar[data-v-77e0209a] {
1871
1871
  width: 320px;
1872
1872
  min-width: 320px;
1873
1873
  padding: 0 10px;
@@ -1875,7 +1875,7 @@ img[data-v-c95b2073] {
1875
1875
  position: relative;
1876
1876
  z-index: 2;
1877
1877
  }
1878
- .superdoc__compact-comment-popover[data-v-4efb0cab] {
1878
+ .superdoc__compact-comment-popover[data-v-77e0209a] {
1879
1879
  position: absolute;
1880
1880
  top: 12px;
1881
1881
  right: 12px;
@@ -1884,14 +1884,14 @@ img[data-v-c95b2073] {
1884
1884
  }
1885
1885
 
1886
1886
  /* Tools styles */
1887
- .tools[data-v-4efb0cab] {
1887
+ .tools[data-v-77e0209a] {
1888
1888
  position: absolute;
1889
1889
  z-index: 3;
1890
1890
  display: flex;
1891
1891
  flex-direction: column;
1892
1892
  gap: var(--sd-ui-tools-gap, 6px);
1893
1893
  }
1894
- .tools-item[data-v-4efb0cab] {
1894
+ .tools-item[data-v-77e0209a] {
1895
1895
  display: flex;
1896
1896
  align-items: center;
1897
1897
  justify-content: center;
@@ -1902,10 +1902,10 @@ img[data-v-c95b2073] {
1902
1902
  cursor: pointer;
1903
1903
  position: relative;
1904
1904
  }
1905
- .tools-item i[data-v-4efb0cab] {
1905
+ .tools-item i[data-v-77e0209a] {
1906
1906
  cursor: pointer;
1907
1907
  }
1908
- .superdoc__tools-icon[data-v-4efb0cab] {
1908
+ .superdoc__tools-icon[data-v-77e0209a] {
1909
1909
  width: var(--sd-ui-tools-icon-size, 20px);
1910
1910
  height: var(--sd-ui-tools-icon-size, 20px);
1911
1911
  flex-shrink: 0;
@@ -1920,22 +1920,22 @@ img[data-v-c95b2073] {
1920
1920
 
1921
1921
  /* 834px is iPad screen size in portrait orientation */
1922
1922
  @media (max-width: 834px) {
1923
- .superdoc .superdoc__layers[data-v-4efb0cab] {
1923
+ .superdoc .superdoc__layers[data-v-77e0209a] {
1924
1924
  margin: 0;
1925
1925
  border: 0 !important;
1926
1926
  box-shadow: none;
1927
1927
  }
1928
- .superdoc__sub-document[data-v-4efb0cab] {
1928
+ .superdoc__sub-document[data-v-77e0209a] {
1929
1929
  max-width: 100%;
1930
1930
  }
1931
- .superdoc__right-sidebar[data-v-4efb0cab] {
1931
+ .superdoc__right-sidebar[data-v-77e0209a] {
1932
1932
  padding: 10px;
1933
1933
  position: relative;
1934
1934
  }
1935
1935
  }
1936
1936
 
1937
1937
  /* AI Writer styles */
1938
- .ai-writer-container[data-v-4efb0cab] {
1938
+ .ai-writer-container[data-v-77e0209a] {
1939
1939
  position: fixed;
1940
1940
  z-index: 1000;
1941
1941
  background: white;
@@ -1951,10 +1951,10 @@ img[data-v-c95b2073] {
1951
1951
  transform: translateY(-50%);
1952
1952
  z-index: 50;
1953
1953
  } */
1954
- .ai-tool > svg[data-v-4efb0cab] {
1954
+ .ai-tool > svg[data-v-77e0209a] {
1955
1955
  fill: transparent;
1956
1956
  }
1957
- .ai-tool[data-v-4efb0cab]::before {
1957
+ .ai-tool[data-v-77e0209a]::before {
1958
1958
  content: '';
1959
1959
  position: absolute;
1960
1960
  width: 20px;
@@ -1975,7 +1975,7 @@ img[data-v-c95b2073] {
1975
1975
  filter: brightness(1.2);
1976
1976
  transition: filter 0.2s ease;
1977
1977
  }
1978
- .ai-tool[data-v-4efb0cab]:hover::before {
1978
+ .ai-tool[data-v-77e0209a]:hover::before {
1979
1979
  filter: brightness(1.3);
1980
1980
  }
1981
1981
 
@@ -1823,34 +1823,34 @@ img[data-v-c95b2073] {
1823
1823
  pointer-events: auto;
1824
1824
  }
1825
1825
 
1826
- .superdoc[data-v-4efb0cab] {
1826
+ .superdoc[data-v-77e0209a] {
1827
1827
  display: flex;
1828
1828
  position: relative;
1829
1829
  }
1830
- .right-sidebar[data-v-4efb0cab] {
1830
+ .right-sidebar[data-v-77e0209a] {
1831
1831
  min-width: 320px;
1832
1832
  height: 100%;
1833
1833
  }
1834
- .floating-comments[data-v-4efb0cab] {
1834
+ .floating-comments[data-v-77e0209a] {
1835
1835
  min-width: 300px;
1836
1836
  width: 300px;
1837
1837
  height: 100%;
1838
1838
  overflow: visible;
1839
1839
  }
1840
- .superdoc__layers[data-v-4efb0cab] {
1840
+ .superdoc__layers[data-v-77e0209a] {
1841
1841
  height: 100%;
1842
1842
  position: relative;
1843
1843
  box-sizing: border-box;
1844
1844
  }
1845
- .superdoc__document[data-v-4efb0cab] {
1845
+ .superdoc__document[data-v-77e0209a] {
1846
1846
  width: 100%;
1847
1847
  position: relative;
1848
1848
  }
1849
- .superdoc__sub-document[data-v-4efb0cab] {
1849
+ .superdoc__sub-document[data-v-77e0209a] {
1850
1850
  width: 100%;
1851
1851
  position: relative;
1852
1852
  }
1853
- .superdoc__selection-layer[data-v-4efb0cab] {
1853
+ .superdoc__selection-layer[data-v-77e0209a] {
1854
1854
  position: absolute;
1855
1855
  min-width: 100%;
1856
1856
  min-height: 100%;
@@ -1861,13 +1861,13 @@ img[data-v-c95b2073] {
1861
1861
  /* SD-3497: PDF whiteboard overlay sits above the rendered PDF canvas but below
1862
1862
  the PDF comment anchors (z-index 6 in PdfCommentsLayer) so anchors stay
1863
1863
  clickable, and below the selection layer (z-index 10). */
1864
- .superdoc__whiteboard-layer[data-v-4efb0cab] {
1864
+ .superdoc__whiteboard-layer[data-v-77e0209a] {
1865
1865
  z-index: 4;
1866
1866
  }
1867
- .superdoc__temp-selection[data-v-4efb0cab] {
1867
+ .superdoc__temp-selection[data-v-77e0209a] {
1868
1868
  position: absolute;
1869
1869
  }
1870
- .superdoc__right-sidebar[data-v-4efb0cab] {
1870
+ .superdoc__right-sidebar[data-v-77e0209a] {
1871
1871
  width: 320px;
1872
1872
  min-width: 320px;
1873
1873
  padding: 0 10px;
@@ -1875,7 +1875,7 @@ img[data-v-c95b2073] {
1875
1875
  position: relative;
1876
1876
  z-index: 2;
1877
1877
  }
1878
- .superdoc__compact-comment-popover[data-v-4efb0cab] {
1878
+ .superdoc__compact-comment-popover[data-v-77e0209a] {
1879
1879
  position: absolute;
1880
1880
  top: 12px;
1881
1881
  right: 12px;
@@ -1884,14 +1884,14 @@ img[data-v-c95b2073] {
1884
1884
  }
1885
1885
 
1886
1886
  /* Tools styles */
1887
- .tools[data-v-4efb0cab] {
1887
+ .tools[data-v-77e0209a] {
1888
1888
  position: absolute;
1889
1889
  z-index: 3;
1890
1890
  display: flex;
1891
1891
  flex-direction: column;
1892
1892
  gap: var(--sd-ui-tools-gap, 6px);
1893
1893
  }
1894
- .tools-item[data-v-4efb0cab] {
1894
+ .tools-item[data-v-77e0209a] {
1895
1895
  display: flex;
1896
1896
  align-items: center;
1897
1897
  justify-content: center;
@@ -1902,10 +1902,10 @@ img[data-v-c95b2073] {
1902
1902
  cursor: pointer;
1903
1903
  position: relative;
1904
1904
  }
1905
- .tools-item i[data-v-4efb0cab] {
1905
+ .tools-item i[data-v-77e0209a] {
1906
1906
  cursor: pointer;
1907
1907
  }
1908
- .superdoc__tools-icon[data-v-4efb0cab] {
1908
+ .superdoc__tools-icon[data-v-77e0209a] {
1909
1909
  width: var(--sd-ui-tools-icon-size, 20px);
1910
1910
  height: var(--sd-ui-tools-icon-size, 20px);
1911
1911
  flex-shrink: 0;
@@ -1920,22 +1920,22 @@ img[data-v-c95b2073] {
1920
1920
 
1921
1921
  /* 834px is iPad screen size in portrait orientation */
1922
1922
  @media (max-width: 834px) {
1923
- .superdoc .superdoc__layers[data-v-4efb0cab] {
1923
+ .superdoc .superdoc__layers[data-v-77e0209a] {
1924
1924
  margin: 0;
1925
1925
  border: 0 !important;
1926
1926
  box-shadow: none;
1927
1927
  }
1928
- .superdoc__sub-document[data-v-4efb0cab] {
1928
+ .superdoc__sub-document[data-v-77e0209a] {
1929
1929
  max-width: 100%;
1930
1930
  }
1931
- .superdoc__right-sidebar[data-v-4efb0cab] {
1931
+ .superdoc__right-sidebar[data-v-77e0209a] {
1932
1932
  padding: 10px;
1933
1933
  position: relative;
1934
1934
  }
1935
1935
  }
1936
1936
 
1937
1937
  /* AI Writer styles */
1938
- .ai-writer-container[data-v-4efb0cab] {
1938
+ .ai-writer-container[data-v-77e0209a] {
1939
1939
  position: fixed;
1940
1940
  z-index: 1000;
1941
1941
  background: white;
@@ -1951,10 +1951,10 @@ img[data-v-c95b2073] {
1951
1951
  transform: translateY(-50%);
1952
1952
  z-index: 50;
1953
1953
  } */
1954
- .ai-tool > svg[data-v-4efb0cab] {
1954
+ .ai-tool > svg[data-v-77e0209a] {
1955
1955
  fill: transparent;
1956
1956
  }
1957
- .ai-tool[data-v-4efb0cab]::before {
1957
+ .ai-tool[data-v-77e0209a]::before {
1958
1958
  content: '';
1959
1959
  position: absolute;
1960
1960
  width: 20px;
@@ -1975,7 +1975,7 @@ img[data-v-c95b2073] {
1975
1975
  filter: brightness(1.2);
1976
1976
  transition: filter 0.2s ease;
1977
1977
  }
1978
- .ai-tool[data-v-4efb0cab]:hover::before {
1978
+ .ai-tool[data-v-77e0209a]:hover::before {
1979
1979
  filter: brightness(1.3);
1980
1980
  }
1981
1981
 
@@ -9,7 +9,7 @@ import { normalizeInteractionConfig } from './config/normalize-interaction-confi
9
9
  import { normalizeSurfacesConfig } from './config/normalize-surfaces-config.js';
10
10
  import { EditorRuntimeFocusOptions } from './editor-runtime/types.js';
11
11
  import { BorrowedSuperDocUI } from '../public/ui/types.js';
12
- import { AwarenessUser, CanPerformPermissionParams, CollaborationProvider, Config, ContentControlActiveChangePayload, ContentControlClickPayload, DocumentMode, Editor, EditorUpdateEvent, ExportParams, FontsChangedPayload, FontsResolvedPayload, InternalConfig, ListDefinitionsPayload, NavigableAddress, DocumentRendererRuntime, SearchMatch, SuperDocAwarenessUpdatePayload, SuperDocCommentsUpdatePayload, SuperDocCommentsListChangePayload, SuperDocDocumentModeChangePayload, SuperDocDocumentReplacedPayload, SuperDocEditorPayload, SuperDocExceptionPayload, SuperDocFontsApi, SuperDocFormattingMarksChangePayload, SuperDocLockedPayload, SuperDocMeasurementUnit, SuperDocMeasurementUnitChangePayload, SuperDocPageMarginsChangePayload, SuperDocPaginationUpdatePayload, SuperDocReadyPayload, SuperDocState, SuperDocTrackedChangesBulkDecisionPayload, SuperDocViewportChangePayload, SuperDocViewportMetrics, SuperDocZoomMode, SuperDocZoomPayload, SuperDocZoomState, SurfaceHandle, SurfaceRequest, UpgradeToCollaborationOptions, User, ViewingOptions } from './types/index.js';
12
+ import { AwarenessUser, CanPerformPermissionParams, CollaborationProvider, Config, ContentControlActiveChangePayload, ContentControlClickPayload, DocumentMode, Editor, EditorUpdateEvent, ExportParams, FontsChangedPayload, FontsResolvedPayload, InternalConfig, ListDefinitionsPayload, NavigableAddress, DocumentRendererRuntime, SearchMatch, SuperDocAwarenessUpdatePayload, SuperDocCommentsUpdatePayload, SuperDocCommentsListChangePayload, SuperDocDocumentModeChangePayload, SuperDocDocumentReplacedPayload, SuperDocEditorPayload, SuperDocExceptionPayload, SuperDocFontsApi, SuperDocFormattingMarksChangePayload, SuperDocLockedPayload, SuperDocCollaborationConnectionChangePayload, SuperDocMeasurementUnit, SuperDocMeasurementUnitChangePayload, SuperDocPageMarginsChangePayload, SuperDocPaginationUpdatePayload, SuperDocReadyPayload, SuperDocState, SuperDocTrackedChangesBulkDecisionPayload, SuperDocViewportChangePayload, SuperDocViewportMetrics, SuperDocZoomMode, SuperDocZoomPayload, SuperDocZoomState, SurfaceHandle, SurfaceRequest, UpgradeToCollaborationOptions, UpgradeToCollaborationResult, User, ViewingOptions } from './types/index.js';
13
13
  import { WhiteboardData } from './whiteboard/Whiteboard.js';
14
14
  type ToolbarLike = {
15
15
  activeEditor?: unknown;
@@ -86,6 +86,7 @@ interface SuperDocEventMap {
86
86
  'collaboration-ready': [SuperDocEditorPayload];
87
87
  'awareness-update': [SuperDocAwarenessUpdatePayload];
88
88
  locked: [SuperDocLockedPayload];
89
+ 'collaboration-connection-change': [SuperDocCollaborationConnectionChangePayload];
89
90
  'whiteboard:init': [SuperDocWhiteboardPayload];
90
91
  'whiteboard:ready': [SuperDocWhiteboardPayload];
91
92
  'whiteboard:change': [WhiteboardData];
@@ -347,6 +348,12 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
347
348
  * Get the SuperDoc container element
348
349
  */
349
350
  get element(): Element | null;
351
+ /**
352
+ * Latest v2 collaboration connection change, or `null` when no v2
353
+ * collaboration session has reported one. Same payload as the
354
+ * `collaboration-connection-change` event.
355
+ */
356
+ getCollaborationConnectionState(): SuperDocCollaborationConnectionChangePayload | null;
350
357
  /**
351
358
  * Upgrade a local SuperDoc instance into collaboration by creating the
352
359
  * supplied room from the current local document and comment state, then
@@ -360,9 +367,9 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
360
367
  * - A supported v2 single-doc `v2Collaboration` target
361
368
  * - Create-and-upgrade only (no merge semantics)
362
369
  *
363
- * @returns Resolves once the collaborative runtime is ready
370
+ * @returns The attached room and document once the collaborative runtime is ready
364
371
  */
365
- upgradeToCollaboration(options: UpgradeToCollaborationOptions): Promise<void>;
372
+ upgradeToCollaboration(options: UpgradeToCollaborationOptions): Promise<UpgradeToCollaborationResult>;
366
373
  /**
367
374
  * Add a user to the shared users list. Requires the instance to be
368
375
  * ready; pre-ready mutations would be silently overwritten by the
@@ -1193,6 +1193,15 @@ export interface UpgradeToCollaborationOptions {
1193
1193
  */
1194
1194
  provider?: CollaborationProvider;
1195
1195
  }
1196
+ /** Confirmed identities of the room and local document attached by a successful upgrade. */
1197
+ export interface UpgradeToCollaborationResult {
1198
+ roomId: string;
1199
+ documentId: string;
1200
+ }
1201
+ /** Machine-readable failures returned by a create-and-upgrade attempt. */
1202
+ export interface SuperDocCollaborationUpgradeError extends Error {
1203
+ code: 'collaboration-v2-room-already-exists' | 'collaboration-upgrade-target-conflict';
1204
+ }
1196
1205
  /** Context passed to a hyperlink activation handler. */
1197
1206
  export interface HyperlinkActivationContext {
1198
1207
  /** The editor instance. */
@@ -3013,6 +3022,32 @@ export interface SuperDocLockedPayload {
3013
3022
  isLocked: boolean;
3014
3023
  lockedBy: User | null;
3015
3024
  }
3025
+ /** Collaboration transport state reported by `collaboration-connection-change`. */
3026
+ export type SuperDocCollaborationConnectionState = 'connecting' | 'synced' | 'degraded' | 'failed';
3027
+ /**
3028
+ * What a `collaboration-connection-change` means for the session:
3029
+ * - `initial`: opening, before the first sync completes (or the first sync itself)
3030
+ * - `lost`: the transport dropped after the room had synced
3031
+ * - `reconnecting`: the provider is retrying while the connection is degraded
3032
+ * - `recovered`: the connection re-synced after an outage
3033
+ * - `failed`: terminal transport or auth failure
3034
+ */
3035
+ export type SuperDocCollaborationConnectionKind = 'initial' | 'lost' | 'reconnecting' | 'recovered' | 'failed';
3036
+ /**
3037
+ * Payload emitted with the `collaboration-connection-change` event and passed to
3038
+ * `Config.onCollaborationConnectionChange`. Emitted for v2 collaboration sessions
3039
+ * when the real provider transport changes state.
3040
+ */
3041
+ export interface SuperDocCollaborationConnectionChangePayload {
3042
+ /** Collaboration document id (`v2Collaboration.documentId`) for the affected room. */
3043
+ documentId: string;
3044
+ state: SuperDocCollaborationConnectionState;
3045
+ previousState: SuperDocCollaborationConnectionState | null;
3046
+ kind: SuperDocCollaborationConnectionKind;
3047
+ /** Extra transport detail, e.g. `reconnecting` or `transport-disconnected`. */
3048
+ detail: string | null;
3049
+ superdoc: SuperDoc;
3050
+ }
3016
3051
  /**
3017
3052
  * Payload emitted with the `awareness-update` event and passed to
3018
3053
  * `Config.onAwarenessUpdate`. Field set differs from older inline
@@ -4108,6 +4143,8 @@ export interface Config {
4108
4143
  onSidebarToggle?: (isOpened: boolean) => void;
4109
4144
  /** Callback when collaboration is ready. Receives a wrapper carrying the editor. */
4110
4145
  onCollaborationReady?: (params: SuperDocEditorPayload) => void;
4146
+ /** Callback when the v2 collaboration connection is lost, retries, recovers, or fails. */
4147
+ onCollaborationConnectionChange?: (params: SuperDocCollaborationConnectionChangePayload) => void;
4111
4148
  /** Callback when document is updated. */
4112
4149
  onEditorUpdate?: (params: EditorUpdateEvent) => void;
4113
4150
  /** Callback after an Accept All or Reject All tracked-change decision. */
@@ -5,15 +5,15 @@ declare const _default: import('vue').DefineComponent<{}, {
5
5
  rel: string;
6
6
  documentMode: string;
7
7
  ui: Record<string, any>;
8
+ textTarget: Record<string, any>;
9
+ hyperlinkTarget: Record<string, any>;
8
10
  showInput: boolean;
9
11
  showLink: boolean;
10
12
  goToAnchor: Function;
11
13
  linkItem: Record<string, any>;
12
14
  closePopover: Function;
13
15
  clickedElement: Record<string, any>;
14
- hyperlinkTarget: Record<string, any>;
15
16
  hyperlinkText: string;
16
- textTarget: Record<string, any>;
17
17
  restoreSelection: Function;
18
18
  $props: {
19
19
  readonly target?: string | undefined;
@@ -22,15 +22,15 @@ declare const _default: import('vue').DefineComponent<{}, {
22
22
  readonly rel?: string | undefined;
23
23
  readonly documentMode?: string | undefined;
24
24
  readonly ui?: Record<string, any> | undefined;
25
+ readonly textTarget?: Record<string, any> | undefined;
26
+ readonly hyperlinkTarget?: Record<string, any> | undefined;
25
27
  readonly showInput?: boolean | undefined;
26
28
  readonly showLink?: boolean | undefined;
27
29
  readonly goToAnchor?: Function | undefined;
28
30
  readonly linkItem?: Record<string, any> | undefined;
29
31
  readonly closePopover?: Function | undefined;
30
32
  readonly clickedElement?: Record<string, any> | undefined;
31
- readonly hyperlinkTarget?: Record<string, any> | undefined;
32
33
  readonly hyperlinkText?: string | undefined;
33
- readonly textTarget?: Record<string, any> | undefined;
34
34
  readonly restoreSelection?: Function | undefined;
35
35
  };
36
36
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
@@ -127,6 +127,10 @@ import type { SuperDocAnchorStatus as __Cjs_SuperDocAnchorStatus } from './index
127
127
  import type { SuperDocAnchorTarget as __Cjs_SuperDocAnchorTarget } from './index.js' with { "resolution-mode": "import" };
128
128
  import type { SuperDocAwarenessUpdatePayload as __Cjs_SuperDocAwarenessUpdatePayload } from './index.js' with { "resolution-mode": "import" };
129
129
  import type { SuperDocCharRange as __Cjs_SuperDocCharRange } from './index.js' with { "resolution-mode": "import" };
130
+ import type { SuperDocCollaborationConnectionChangePayload as __Cjs_SuperDocCollaborationConnectionChangePayload } from './index.js' with { "resolution-mode": "import" };
131
+ import type { SuperDocCollaborationConnectionKind as __Cjs_SuperDocCollaborationConnectionKind } from './index.js' with { "resolution-mode": "import" };
132
+ import type { SuperDocCollaborationConnectionState as __Cjs_SuperDocCollaborationConnectionState } from './index.js' with { "resolution-mode": "import" };
133
+ import type { SuperDocCollaborationUpgradeError as __Cjs_SuperDocCollaborationUpgradeError } from './index.js' with { "resolution-mode": "import" };
130
134
  import type { SuperDocCommandApi as __Cjs_SuperDocCommandApi } from './index.js' with { "resolution-mode": "import" };
131
135
  import type { SuperDocCommandExecuteContext as __Cjs_SuperDocCommandExecuteContext } from './index.js' with { "resolution-mode": "import" };
132
136
  import type { SuperDocCommandState as __Cjs_SuperDocCommandState } from './index.js' with { "resolution-mode": "import" };
@@ -270,6 +274,7 @@ import type { TrackedChangeSemanticColorKey as __Cjs_TrackedChangeSemanticColorK
270
274
  import type { TrackedChangeSemanticColorResolverInput as __Cjs_TrackedChangeSemanticColorResolverInput } from './index.js' with { "resolution-mode": "import" };
271
275
  import type { UIConfig as __Cjs_UIConfig } from './index.js' with { "resolution-mode": "import" };
272
276
  import type { UpgradeToCollaborationOptions as __Cjs_UpgradeToCollaborationOptions } from './index.js' with { "resolution-mode": "import" };
277
+ import type { UpgradeToCollaborationResult as __Cjs_UpgradeToCollaborationResult } from './index.js' with { "resolution-mode": "import" };
273
278
  import type { User as __Cjs_User } from './index.js' with { "resolution-mode": "import" };
274
279
  import type { V2CollaborationConfig as __Cjs_V2CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
275
280
  import type { ViewingOptions as __Cjs_ViewingOptions } from './index.js' with { "resolution-mode": "import" };
@@ -414,6 +419,10 @@ export type { __Cjs_SuperDocAnchorStatus as SuperDocAnchorStatus };
414
419
  export type { __Cjs_SuperDocAnchorTarget as SuperDocAnchorTarget };
415
420
  export type { __Cjs_SuperDocAwarenessUpdatePayload as SuperDocAwarenessUpdatePayload };
416
421
  export type { __Cjs_SuperDocCharRange as SuperDocCharRange };
422
+ export type { __Cjs_SuperDocCollaborationConnectionChangePayload as SuperDocCollaborationConnectionChangePayload };
423
+ export type { __Cjs_SuperDocCollaborationConnectionKind as SuperDocCollaborationConnectionKind };
424
+ export type { __Cjs_SuperDocCollaborationConnectionState as SuperDocCollaborationConnectionState };
425
+ export type { __Cjs_SuperDocCollaborationUpgradeError as SuperDocCollaborationUpgradeError };
417
426
  export type { __Cjs_SuperDocCommandApi as SuperDocCommandApi };
418
427
  export type { __Cjs_SuperDocCommandExecuteContext as SuperDocCommandExecuteContext };
419
428
  export type { __Cjs_SuperDocCommandState as SuperDocCommandState };
@@ -557,6 +566,7 @@ export type { __Cjs_TrackedChangeSemanticColorKey as TrackedChangeSemanticColorK
557
566
  export type { __Cjs_TrackedChangeSemanticColorResolverInput as TrackedChangeSemanticColorResolverInput };
558
567
  export type { __Cjs_UIConfig as UIConfig };
559
568
  export type { __Cjs_UpgradeToCollaborationOptions as UpgradeToCollaborationOptions };
569
+ export type { __Cjs_UpgradeToCollaborationResult as UpgradeToCollaborationResult };
560
570
  export type { __Cjs_User as User };
561
571
  export type { __Cjs_V2CollaborationConfig as V2CollaborationConfig };
562
572
  export type { __Cjs_ViewingOptions as ViewingOptions };
@@ -135,6 +135,9 @@ export type { LinkPopoverContext } from '../core/types/index.js';
135
135
  export type { LinkPopoverResolution } from '../core/types/index.js';
136
136
  export type { LinkPopoverResolver } from '../core/types/index.js';
137
137
  export type { SuperDocLockedPayload } from '../core/types/index.js';
138
+ export type { SuperDocCollaborationConnectionChangePayload } from '../core/types/index.js';
139
+ export type { SuperDocCollaborationConnectionKind } from '../core/types/index.js';
140
+ export type { SuperDocCollaborationConnectionState } from '../core/types/index.js';
138
141
  export type { SuperDocMeasurementUnit } from '../core/types/index.js';
139
142
  export type { SuperDocMeasurementUnitChangePayload } from '../core/types/index.js';
140
143
  export type { SuperDocPageCountKnownPayload } from '../core/types/index.js';
@@ -178,6 +181,8 @@ export type { InteractionConfig } from '../core/types/index.js';
178
181
  export type { SurfacesConfig } from '../core/types/index.js';
179
182
  export type { UIConfig } from '../core/types/index.js';
180
183
  export type { UpgradeToCollaborationOptions } from '../core/types/index.js';
184
+ export type { UpgradeToCollaborationResult } from '../core/types/index.js';
185
+ export type { SuperDocCollaborationUpgradeError } from '../core/types/index.js';
181
186
  export type { V2CollaborationConfig } from '../core/types/index.js';
182
187
  export type { User } from '../core/types/index.js';
183
188
  export type { ViewOptions } from '../core/types/index.js';
@@ -1,4 +1,11 @@
1
- import { SuperDocUI, SuperDocUIOptions } from './types.js';
1
+ import { CommandExecutionResult, SuperDocUI, SuperDocUIOptions } from './types.js';
2
+ type FirstPartyCommandMutation = {
3
+ supports: (memberPath: string) => boolean;
4
+ run: (memberPath: string, args: readonly unknown[]) => unknown;
5
+ runListApply: (input: unknown) => Promise<boolean>;
6
+ };
7
+ export declare function registerFirstPartyCommandMutation(superdoc: object, host: object, mutation: FirstPartyCommandMutation): void;
8
+ export declare function executeFirstPartyCommandAsync(ui: Pick<SuperDocUI, 'commands'>, id: string, payload?: unknown): Promise<CommandExecutionResult>;
2
9
  /**
3
10
  * Heavy-read policy for the async read coordinator (source-loading deferral).
4
11
  * One shared table: the coordinator's gate and the table-driven policy tests
@@ -16,3 +23,4 @@ export declare const HEAVY_DOC_READ_POLICY: readonly HeavyDocReadPolicyEntry[];
16
23
  /** Whether a coordinator cache key falls under the heavy-read policy. */
17
24
  export declare function isHeavyDocReadKey(key: string): boolean;
18
25
  export declare function createSuperDocUI(options: SuperDocUIOptions): SuperDocUI;
26
+ export {};