superdoc 2.12.1-next.3 → 2.13.0-next.2

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.12.1-next.3",
22
+ superdocVersion: "2.13.0-next.2",
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.12.1-next.3",
21
+ superdocVersion: "2.13.0-next.2",
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
@@ -2012,7 +2012,7 @@ export type InvokeRequest<T extends OperationId> = OperationRegistry[T]['options
2012
2012
  /**
2013
2013
  * Typed invoke result, narrowed by operationId.
2014
2014
  */
2015
- export type InvokeResult<T extends OperationId> = OperationRegistry[T]['output'];
2015
+ export type InvokeResult<T extends OperationId> = T extends 'mutations.preview' | 'mutations.apply' ? Promise<OperationRegistry[T]['output']> : T extends 'plan.execute' ? OperationRegistry[T]['output'] | Promise<OperationRegistry[T]['output']> : OperationRegistry[T]['output'];
2016
2016
  /**
2017
2017
  * Loose invoke request for dynamic callers who don't know the operation at compile time.
2018
2018
  * Invalid inputs will produce adapter-level errors, not input-validation errors.
@@ -36,7 +36,7 @@ import { CapabilitiesAdapter, DocumentApiCapabilities } from './capabilities/cap
36
36
  import { SDHtmlMarkdownSupportCheckInput, SDHtmlMarkdownSupportCheckResult } from './capabilities/html-markdown-support.js';
37
37
  import { OperationId } from './contract/types.js';
38
38
  import { DynamicInvokeRequest, InvokeRequest, InvokeResult } from './contract/operation-registry.js';
39
- import { PlanApi } from './plan/plan.js';
39
+ import { PlanApi, PlanExecuteResult } from './plan/plan.js';
40
40
  import { HistoryAdapter, HistoryApi } from './history/history.js';
41
41
  import { DiffAdapter, DiffApi } from './diff/diff.js';
42
42
  import { ExportAdapter, ExportApi } from './export/export.js';
@@ -242,8 +242,8 @@ export interface QueryApi {
242
242
  match(input: QueryMatchInput | TextSelector | NodeSelector): QueryMatchOutput;
243
243
  }
244
244
  export interface MutationsApi {
245
- preview(input: MutationsPreviewInput): MutationsPreviewOutput;
246
- apply(input: MutationsApplyInput): PlanReceipt;
245
+ preview(input: MutationsPreviewInput): Promise<MutationsPreviewOutput>;
246
+ apply(input: MutationsApplyInput): Promise<PlanReceipt>;
247
247
  }
248
248
  export interface RangesApi {
249
249
  resolve(input: ResolveRangeInput): ResolveRangeOutput;
@@ -255,8 +255,8 @@ export interface QueryAdapter {
255
255
  match(input: QueryMatchInput): QueryMatchOutput;
256
256
  }
257
257
  export interface MutationsAdapter {
258
- preview(input: MutationsPreviewInput): MutationsPreviewOutput;
259
- apply(input: MutationsApplyInput): PlanReceipt;
258
+ preview(input: MutationsPreviewInput): Promise<MutationsPreviewOutput>;
259
+ apply(input: MutationsApplyInput): Promise<PlanReceipt>;
260
260
  }
261
261
  /**
262
262
  * The Document API interface for querying and inspecting document nodes.
@@ -460,7 +460,7 @@ export interface DocumentApi {
460
460
  /**
461
461
  * Throughput-oriented batch executor with stepwise operation semantics.
462
462
  */
463
- plan: PlanApi;
463
+ plan: PlanApi<PlanExecuteResult | Promise<PlanExecuteResult>>;
464
464
  /**
465
465
  * Snapshot-based document comparison and replay.
466
466
  */
@@ -1,7 +1,8 @@
1
1
  import { OperationId } from '../contract/types.js';
2
2
  import { OperationRegistry } from '../contract/operation-registry.js';
3
3
  import { DocumentApi } from '../index.js';
4
- type TypedDispatchHandler<K extends OperationId> = OperationRegistry[K]['options'] extends never ? (input: OperationRegistry[K]['input']) => OperationRegistry[K]['output'] : (input: OperationRegistry[K]['input'], options?: OperationRegistry[K]['options']) => OperationRegistry[K]['output'];
4
+ type DispatchOutput<K extends OperationId> = K extends 'mutations.preview' | 'mutations.apply' ? Promise<OperationRegistry[K]['output']> : K extends 'plan.execute' ? OperationRegistry[K]['output'] | Promise<OperationRegistry[K]['output']> : OperationRegistry[K]['output'];
5
+ type TypedDispatchHandler<K extends OperationId> = OperationRegistry[K]['options'] extends never ? (input: OperationRegistry[K]['input']) => DispatchOutput<K> : (input: OperationRegistry[K]['input'], options?: OperationRegistry[K]['options']) => DispatchOutput<K>;
5
6
  export type TypedDispatchTable = {
6
7
  [K in OperationId]: TypedDispatchHandler<K>;
7
8
  };
@@ -66,6 +66,10 @@ export type TextRewriteStep = {
66
66
  where: StepWhere;
67
67
  args: {
68
68
  replacement: ReplacementPayload;
69
+ /** Interpret positional `$1`…`$99` and `$&` tokens for regex matches. */
70
+ replacementMode?: 'literal' | 'regex-template';
71
+ /** Preserve the matched text's casing pattern instead of using replacement casing verbatim. */
72
+ caseHandling?: 'exact' | 'preserve-match';
69
73
  /**
70
74
  * Style policy for the replacement text.
71
75
  * When omitted, defaults to preserve mode:
@@ -157,10 +161,18 @@ export type MutationsPreviewInput = {
157
161
  atomic: true;
158
162
  changeMode: ChangeMode;
159
163
  steps: MutationStep[];
164
+ /** Optional page over verbose resolved-target details. Defaults to the first 100 targets. */
165
+ detail?: {
166
+ offset?: number;
167
+ limit?: number;
168
+ };
160
169
  };
161
170
  /** Maximum number of steps per mutation plan. */
162
171
  export declare const MAX_PLAN_STEPS = 200;
163
- /** Maximum total resolved targets across all steps in a plan. */
172
+ /**
173
+ * @deprecated Historical compatibility metadata. Text replacement no longer
174
+ * enforces this value; callers must not treat it as a supported target limit.
175
+ */
164
176
  export declare const MAX_PLAN_RESOLVED_TARGETS = 500;
165
177
  export type StepEffect = 'changed' | 'noop' | 'error' | 'assert_passed' | 'assert_failed';
166
178
  /** Resolution for a single-block (range) target. */
@@ -189,9 +201,14 @@ export type SelectionStepResolution = {
189
201
  };
190
202
  export type TextStepData = {
191
203
  domain: 'text';
192
- resolutions: TextStepResolution[];
193
- spanResolutions?: SpanStepResolution[];
194
- selectionResolutions?: SelectionStepResolution[];
204
+ /** Exact number of targets selected from the step's input revision. */
205
+ matchedCount: number;
206
+ /** Exact number of targets whose content changed. */
207
+ changedCount: number;
208
+ /** Exact number of targets already equal to their requested replacement. */
209
+ noopCount: number;
210
+ /** Exact number of tracked-change identities authored by this step. */
211
+ trackedChangeCount: number;
195
212
  };
196
213
  export type AssertStepData = {
197
214
  domain: 'assert';
@@ -247,7 +264,14 @@ export type PreviewFailure = {
247
264
  export type StepPreview = {
248
265
  stepId: string;
249
266
  op: string;
267
+ /** Exact number of targets resolved for this step. */
268
+ matchCount?: number;
250
269
  resolutions?: TextStepResolution[];
270
+ detailPage?: {
271
+ offset: number;
272
+ limit: number;
273
+ returned: number;
274
+ };
251
275
  spanResolutions?: SpanStepResolution[];
252
276
  selectionResolutions?: SelectionStepResolution[];
253
277
  style?: unknown;
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-770204b4] {
1821
+ .superdoc[data-v-0d27f262] {
1822
1822
  display: flex;
1823
1823
  position: relative;
1824
1824
  }
1825
- .sd-visually-hidden[data-v-770204b4] {
1825
+ .sd-visually-hidden[data-v-0d27f262] {
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-770204b4] {
1836
+ .superdoc__mutation-status[data-v-0d27f262] {
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-770204b4] {
1843
+ .superdoc__edit-rejected-status[data-v-0d27f262] {
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-770204b4] {
1861
+ .right-sidebar[data-v-0d27f262] {
1862
1862
  min-width: 320px;
1863
1863
  height: 100%;
1864
1864
  }
1865
- .floating-comments[data-v-770204b4] {
1865
+ .floating-comments[data-v-0d27f262] {
1866
1866
  min-width: 300px;
1867
1867
  width: 300px;
1868
1868
  height: 100%;
1869
1869
  overflow: visible;
1870
1870
  }
1871
- .superdoc__layers[data-v-770204b4] {
1871
+ .superdoc__layers[data-v-0d27f262] {
1872
1872
  height: 100%;
1873
1873
  position: relative;
1874
1874
  box-sizing: border-box;
1875
1875
  }
1876
- .superdoc__document[data-v-770204b4] {
1876
+ .superdoc__document[data-v-0d27f262] {
1877
1877
  width: 100%;
1878
1878
  position: relative;
1879
1879
  }
1880
- .superdoc__sub-document[data-v-770204b4] {
1880
+ .superdoc__sub-document[data-v-0d27f262] {
1881
1881
  width: 100%;
1882
1882
  position: relative;
1883
1883
  }
1884
- .superdoc__selection-layer[data-v-770204b4] {
1884
+ .superdoc__selection-layer[data-v-0d27f262] {
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-770204b4] {
1895
+ .superdoc__whiteboard-layer[data-v-0d27f262] {
1896
1896
  z-index: 4;
1897
1897
  }
1898
- .superdoc__temp-selection[data-v-770204b4] {
1898
+ .superdoc__temp-selection[data-v-0d27f262] {
1899
1899
  position: absolute;
1900
1900
  }
1901
- .superdoc__right-sidebar[data-v-770204b4] {
1901
+ .superdoc__right-sidebar[data-v-0d27f262] {
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-770204b4] {
1909
+ .superdoc__compact-comment-popover[data-v-0d27f262] {
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-770204b4] {
1918
+ .tools[data-v-0d27f262] {
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-770204b4] {
1925
+ .tools-item[data-v-0d27f262] {
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-770204b4] {
1936
+ .tools-item i[data-v-0d27f262] {
1937
1937
  cursor: pointer;
1938
1938
  }
1939
- .superdoc__tools-icon[data-v-770204b4] {
1939
+ .superdoc__tools-icon[data-v-0d27f262] {
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-770204b4] {
1954
+ .superdoc .superdoc__layers[data-v-0d27f262] {
1955
1955
  margin: 0;
1956
1956
  border: 0 !important;
1957
1957
  box-shadow: none;
1958
1958
  }
1959
- .superdoc__sub-document[data-v-770204b4] {
1959
+ .superdoc__sub-document[data-v-0d27f262] {
1960
1960
  max-width: 100%;
1961
1961
  }
1962
- .superdoc__right-sidebar[data-v-770204b4] {
1962
+ .superdoc__right-sidebar[data-v-0d27f262] {
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-770204b4] {
1969
+ .ai-writer-container[data-v-0d27f262] {
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-770204b4] {
1985
+ .ai-tool > svg[data-v-0d27f262] {
1986
1986
  fill: transparent;
1987
1987
  }
1988
- .ai-tool[data-v-770204b4]::before {
1988
+ .ai-tool[data-v-0d27f262]::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-770204b4]:hover::before {
2009
+ .ai-tool[data-v-0d27f262]: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-770204b4] {
1821
+ .superdoc[data-v-0d27f262] {
1822
1822
  display: flex;
1823
1823
  position: relative;
1824
1824
  }
1825
- .sd-visually-hidden[data-v-770204b4] {
1825
+ .sd-visually-hidden[data-v-0d27f262] {
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-770204b4] {
1836
+ .superdoc__mutation-status[data-v-0d27f262] {
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-770204b4] {
1843
+ .superdoc__edit-rejected-status[data-v-0d27f262] {
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-770204b4] {
1861
+ .right-sidebar[data-v-0d27f262] {
1862
1862
  min-width: 320px;
1863
1863
  height: 100%;
1864
1864
  }
1865
- .floating-comments[data-v-770204b4] {
1865
+ .floating-comments[data-v-0d27f262] {
1866
1866
  min-width: 300px;
1867
1867
  width: 300px;
1868
1868
  height: 100%;
1869
1869
  overflow: visible;
1870
1870
  }
1871
- .superdoc__layers[data-v-770204b4] {
1871
+ .superdoc__layers[data-v-0d27f262] {
1872
1872
  height: 100%;
1873
1873
  position: relative;
1874
1874
  box-sizing: border-box;
1875
1875
  }
1876
- .superdoc__document[data-v-770204b4] {
1876
+ .superdoc__document[data-v-0d27f262] {
1877
1877
  width: 100%;
1878
1878
  position: relative;
1879
1879
  }
1880
- .superdoc__sub-document[data-v-770204b4] {
1880
+ .superdoc__sub-document[data-v-0d27f262] {
1881
1881
  width: 100%;
1882
1882
  position: relative;
1883
1883
  }
1884
- .superdoc__selection-layer[data-v-770204b4] {
1884
+ .superdoc__selection-layer[data-v-0d27f262] {
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-770204b4] {
1895
+ .superdoc__whiteboard-layer[data-v-0d27f262] {
1896
1896
  z-index: 4;
1897
1897
  }
1898
- .superdoc__temp-selection[data-v-770204b4] {
1898
+ .superdoc__temp-selection[data-v-0d27f262] {
1899
1899
  position: absolute;
1900
1900
  }
1901
- .superdoc__right-sidebar[data-v-770204b4] {
1901
+ .superdoc__right-sidebar[data-v-0d27f262] {
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-770204b4] {
1909
+ .superdoc__compact-comment-popover[data-v-0d27f262] {
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-770204b4] {
1918
+ .tools[data-v-0d27f262] {
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-770204b4] {
1925
+ .tools-item[data-v-0d27f262] {
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-770204b4] {
1936
+ .tools-item i[data-v-0d27f262] {
1937
1937
  cursor: pointer;
1938
1938
  }
1939
- .superdoc__tools-icon[data-v-770204b4] {
1939
+ .superdoc__tools-icon[data-v-0d27f262] {
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-770204b4] {
1954
+ .superdoc .superdoc__layers[data-v-0d27f262] {
1955
1955
  margin: 0;
1956
1956
  border: 0 !important;
1957
1957
  box-shadow: none;
1958
1958
  }
1959
- .superdoc__sub-document[data-v-770204b4] {
1959
+ .superdoc__sub-document[data-v-0d27f262] {
1960
1960
  max-width: 100%;
1961
1961
  }
1962
- .superdoc__right-sidebar[data-v-770204b4] {
1962
+ .superdoc__right-sidebar[data-v-0d27f262] {
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-770204b4] {
1969
+ .ai-writer-container[data-v-0d27f262] {
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-770204b4] {
1985
+ .ai-tool > svg[data-v-0d27f262] {
1986
1986
  fill: transparent;
1987
1987
  }
1988
- .ai-tool[data-v-770204b4]::before {
1988
+ .ai-tool[data-v-0d27f262]::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-770204b4]:hover::before {
2009
+ .ai-tool[data-v-0d27f262]:hover::before {
2010
2010
  filter: brightness(1.3);
2011
2011
  }
2012
2012
 
package/dist/superdoc.cjs CHANGED
@@ -316,7 +316,7 @@ var shuffleArray = (array) => {
316
316
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
317
317
  function getSuperdocVersion() {
318
318
  try {
319
- return "2.12.1-next.3";
319
+ return "2.13.0-next.2";
320
320
  } catch {
321
321
  return "unknown";
322
322
  }
@@ -23758,6 +23758,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23758
23758
  return Boolean(editor.pageMetrics && editor.pageLayout);
23759
23759
  };
23760
23760
  const v2RulerHostStyle = (0, vue.ref)({});
23761
+ const v2RulerPageRect = (0, vue.ref)(null);
23761
23762
  let v2RulerEditorObserver = null;
23762
23763
  let v2RulerContainerObserver = null;
23763
23764
  let v2RulerActivePageIndex = 0;
@@ -23788,16 +23789,19 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23788
23789
  const syncV2RulerOffset = () => {
23789
23790
  if (!isV2Mode.value) {
23790
23791
  v2RulerHostStyle.value = {};
23792
+ v2RulerPageRect.value = null;
23791
23793
  return;
23792
23794
  }
23793
23795
  const alignmentContainer = resolveV2RulerAlignmentContainer();
23794
23796
  if (!alignmentContainer) {
23795
23797
  v2RulerHostStyle.value = {};
23798
+ v2RulerPageRect.value = null;
23796
23799
  return;
23797
23800
  }
23798
23801
  const pageRect = getV2ActivePageRect();
23799
23802
  if (!pageRect) {
23800
23803
  v2RulerHostStyle.value = {};
23804
+ v2RulerPageRect.value = null;
23801
23805
  return;
23802
23806
  }
23803
23807
  const containerRect = alignmentContainer.getBoundingClientRect();
@@ -23807,6 +23811,12 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23807
23811
  paddingLeft: `${paddingLeft}px`,
23808
23812
  paddingRight: `${paddingRight}px`
23809
23813
  };
23814
+ v2RulerPageRect.value = {
23815
+ left: pageRect.left,
23816
+ top: pageRect.top,
23817
+ width: pageRect.width,
23818
+ height: pageRect.height
23819
+ };
23810
23820
  };
23811
23821
  const cleanupV2RulerContextSubscription = () => {
23812
23822
  const unsubscribe = unsubscribeV2RulerContext;
@@ -23853,6 +23863,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23853
23863
  });
23854
23864
  };
23855
23865
  const cleanupV2RulerObservers = () => {
23866
+ if (typeof window !== "undefined") window.removeEventListener("scroll", syncV2RulerOffset, true);
23856
23867
  try {
23857
23868
  v2RulerEditorObserver?.disconnect();
23858
23869
  } catch {}
@@ -23864,6 +23875,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23864
23875
  };
23865
23876
  const setupV2RulerObservers = () => {
23866
23877
  cleanupV2RulerObservers();
23878
+ if (typeof window !== "undefined") window.addEventListener("scroll", syncV2RulerOffset, true);
23867
23879
  if (typeof ResizeObserver === "undefined") return;
23868
23880
  const layersEl = layers.value;
23869
23881
  const alignmentContainer = resolveV2RulerAlignmentContainer();
@@ -24043,10 +24055,12 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24043
24055
  }, [(0, vue.createVNode)((0, vue.unref)(V2Ruler), {
24044
24056
  "page-layout": (0, vue.unref)(proxy).$superdoc.activeEditor.pageLayout,
24045
24057
  "measurement-unit": (0, vue.unref)(measurementUnit),
24058
+ "active-page-rect": v2RulerPageRect.value,
24046
24059
  onPageMarginsChange: (event) => handleV2PageMarginsChange(doc, event)
24047
24060
  }, null, 8, [
24048
24061
  "page-layout",
24049
24062
  "measurement-unit",
24063
+ "active-page-rect",
24050
24064
  "onPageMarginsChange"
24051
24065
  ])], 4)], 8, ["to"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
24052
24066
  key: 1,
@@ -24055,10 +24069,12 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24055
24069
  }, [(0, vue.createVNode)((0, vue.unref)(V2Ruler), {
24056
24070
  "page-layout": (0, vue.unref)(proxy).$superdoc.activeEditor.pageLayout,
24057
24071
  "measurement-unit": (0, vue.unref)(measurementUnit),
24072
+ "active-page-rect": v2RulerPageRect.value,
24058
24073
  onPageMarginsChange: (event) => handleV2PageMarginsChange(doc, event)
24059
24074
  }, null, 8, [
24060
24075
  "page-layout",
24061
24076
  "measurement-unit",
24077
+ "active-page-rect",
24062
24078
  "onPageMarginsChange"
24063
24079
  ])], 4))], 64)) : (0, vue.createCommentVNode)("", true),
24064
24080
  doc.type === (0, vue.unref)("application/vnd.openxmlformats-officedocument.wordprocessingml.document") ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(V2DocumentEditor), {
@@ -24144,7 +24160,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24144
24160
  ], 38);
24145
24161
  };
24146
24162
  }
24147
- }, [["__scopeId", "data-v-770204b4"]]);
24163
+ }, [["__scopeId", "data-v-0d27f262"]]);
24148
24164
  //#endregion
24149
24165
  //#region src/core/create-app.js
24150
24166
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -45340,7 +45356,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
45340
45356
  this.config.colors = shuffleArray(this.config.colors);
45341
45357
  this.userColorMap = /* @__PURE__ */ new Map();
45342
45358
  this.colorIndex = 0;
45343
- this.version = "2.12.1-next.3";
45359
+ this.version = "2.13.0-next.2";
45344
45360
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
45345
45361
  this.superdocId = config.superdocId || require_uuid.v4();
45346
45362
  this.colors = this.config.colors ?? [];