superdoc 2.25.0-next.3 → 2.25.0-next.4

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 (44) hide show
  1. package/dist/chunks/{create-super-doc-ui-D8ss5E0J.cjs → create-super-doc-ui-C-oN_R2a.cjs} +19 -0
  2. package/dist/chunks/{create-super-doc-ui-3habU4hL.es.js → create-super-doc-ui-D5waZHl3.es.js} +19 -0
  3. package/dist/collaboration-upgrade-engine.cjs +1 -1
  4. package/dist/collaboration-upgrade-engine.es.js +1 -1
  5. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  6. package/dist/document-api/src/index.d.ts +1 -0
  7. package/dist/document-api/src/permission-ranges/permission-ranges.d.ts +9 -1
  8. package/dist/document-api/src/permission-ranges/permission-ranges.types.d.ts +17 -0
  9. package/dist/document-api/src/protection/protection.types.d.ts +2 -2
  10. package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +2 -2
  11. package/dist/layout-engine/contracts/src/index.d.ts +4 -0
  12. package/dist/layout-engine/layout-bridge/src/font-metrics-cache.d.ts +2 -23
  13. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +11 -4
  14. package/dist/layout-engine/layout-bridge/src/index.d.ts +2 -2
  15. package/dist/layout-engine/layout-bridge/src/measurement-environment.d.ts +12 -0
  16. package/dist/layout-engine/layout-bridge/src/resolveLiveCrossReferences.d.ts +1 -1
  17. package/dist/layout-engine/painters/dom/src/index.d.ts +4 -0
  18. package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +2 -17
  19. package/dist/layout-engine/painters/dom/src/runs/text-style-facts.d.ts +9 -0
  20. package/dist/layout-engine/painters/dom/src/runs/tracked-changes.d.ts +6 -9
  21. package/dist/layout-engine/painters/dom/src/styles.d.ts +21 -0
  22. package/dist/public/ui-react.cjs +1 -1
  23. package/dist/public/ui-react.es.js +1 -1
  24. package/dist/public/ui-vue.cjs +1 -1
  25. package/dist/public/ui-vue.es.js +1 -1
  26. package/dist/public/ui.cjs +1 -1
  27. package/dist/public/ui.es.js +1 -1
  28. package/dist/shared/font-system/src/registry.d.ts +5 -1
  29. package/dist/shared/font-system/src/resolver.d.ts +2 -0
  30. package/dist/style.css +27 -27
  31. package/dist/style.layered.css +27 -27
  32. package/dist/superdoc/src/core/types/index.d.ts +1 -1
  33. package/dist/superdoc/src/index.d.cts +2 -0
  34. package/dist/superdoc/src/index.d.ts +1 -0
  35. package/dist/superdoc/src/public/index.d.cts +8 -0
  36. package/dist/superdoc/src/public/index.d.ts +2 -0
  37. package/dist/superdoc/src/stores/comments-store.d.ts +7 -4
  38. package/dist/superdoc/src/stores/superdoc-store.d.ts +21 -12
  39. package/dist/superdoc.cjs +160 -14
  40. package/dist/superdoc.es.js +159 -15
  41. package/dist-cdn/style.layered.css +1 -1
  42. package/dist-cdn/superdoc.min.css +1 -1
  43. package/dist-cdn/superdoc.min.js +42 -42
  44. package/package.json +2 -2
@@ -3970,6 +3970,7 @@ Object.keys(DRAWING_SUPPORT_TAXONOMY);
3970
3970
  Object.freeze([
3971
3971
  "multiple-sections",
3972
3972
  "furniture-page-tokens",
3973
+ "body-page-number-tokens",
3973
3974
  "non-balanceable-multi-column-sections",
3974
3975
  "body-anchored-objects",
3975
3976
  "non-flowing-page-relative-body-anchors",
@@ -7833,7 +7834,16 @@ function createSuperDocUI(options) {
7833
7834
  * query surfaces only DIRECT run properties, so inherited fonts have no
7834
7835
  * projected value; the layout has already resolved them for painting.
7835
7836
  */
7837
+ const appliedSelectionPresentation = (selection) => {
7838
+ const host = getHost(), read = host?.readAppliedSelectionPresentation;
7839
+ if (typeof read !== "function") return null;
7840
+ const value = safeCall(() => read.call(host), null);
7841
+ const info = normalizeSelectionInfo(value?.selection);
7842
+ return value && info && selectionSignature(selectionSliceFromInfo(info, "ready")) === selectionSignature(selection) ? value : null;
7843
+ };
7836
7844
  const resolveEffectiveInlineValuesFromLayout = (selection) => {
7845
+ const applied = appliedSelectionPresentation(selection);
7846
+ if (applied) return applied.inlineStyle ?? {};
7837
7847
  const host = getHost();
7838
7848
  const blockIds = new Set(selectionBlockIds(selection));
7839
7849
  if (blockIds.size === 0) return {};
@@ -7951,6 +7961,8 @@ function createSuperDocUI(options) {
7951
7961
  * `{ style: 'single' }`) when active, never a bare `true` — check presence.
7952
7962
  */
7953
7963
  const resolveEffectiveMarkValuesFromLayout = (selection) => {
7964
+ const applied = appliedSelectionPresentation(selection);
7965
+ if (applied) return applied.inlineStyle ?? {};
7954
7966
  const host = getHost();
7955
7967
  const blockIds = new Set(selectionBlockIds(selection));
7956
7968
  if (blockIds.size === 0) return {};
@@ -8786,6 +8798,11 @@ function createSuperDocUI(options) {
8786
8798
  };
8787
8799
  /** Read effective paragraph alignments from the mounted, style-resolved layout. */
8788
8800
  const readEffectiveParagraphAlignments = (selection, blockIds) => {
8801
+ const applied = appliedSelectionPresentation(selection);
8802
+ if (applied) return new Map(blockIds.flatMap((id) => {
8803
+ const alignment = normalizeParagraphAlignment(applied.paragraphAlignments?.[id]);
8804
+ return alignment ? [[id, alignment]] : [];
8805
+ }));
8789
8806
  const host = getHost();
8790
8807
  const readByIds = host?.readMountedProjectionBlocksByIds;
8791
8808
  if (typeof readByIds !== "function") return null;
@@ -11284,6 +11301,8 @@ function createSuperDocUI(options) {
11284
11301
  return Boolean(readLinkPayloadTarget(payload) || isLooseObject(record.hyperlinkTarget) || isLooseObject(record.textTarget));
11285
11302
  };
11286
11303
  const commandSelectionIsReady = (id, descriptor, payload) => {
11304
+ const foreground = foregroundMutationState();
11305
+ if (foreground && (foreground.active > 0 || foreground.pending > 0)) return false;
11287
11306
  if (state.selection.status !== "ready") return false;
11288
11307
  if (trackDecisionCommand(id)?.scope === "id") return true;
11289
11308
  if (!descriptor || descriptor.disposition !== "routed") return true;
@@ -3969,6 +3969,7 @@ Object.keys(DRAWING_SUPPORT_TAXONOMY);
3969
3969
  Object.freeze([
3970
3970
  "multiple-sections",
3971
3971
  "furniture-page-tokens",
3972
+ "body-page-number-tokens",
3972
3973
  "non-balanceable-multi-column-sections",
3973
3974
  "body-anchored-objects",
3974
3975
  "non-flowing-page-relative-body-anchors",
@@ -7832,7 +7833,16 @@ function createSuperDocUI(options) {
7832
7833
  * query surfaces only DIRECT run properties, so inherited fonts have no
7833
7834
  * projected value; the layout has already resolved them for painting.
7834
7835
  */
7836
+ const appliedSelectionPresentation = (selection) => {
7837
+ const host = getHost(), read = host?.readAppliedSelectionPresentation;
7838
+ if (typeof read !== "function") return null;
7839
+ const value = safeCall(() => read.call(host), null);
7840
+ const info = normalizeSelectionInfo(value?.selection);
7841
+ return value && info && selectionSignature(selectionSliceFromInfo(info, "ready")) === selectionSignature(selection) ? value : null;
7842
+ };
7835
7843
  const resolveEffectiveInlineValuesFromLayout = (selection) => {
7844
+ const applied = appliedSelectionPresentation(selection);
7845
+ if (applied) return applied.inlineStyle ?? {};
7836
7846
  const host = getHost();
7837
7847
  const blockIds = new Set(selectionBlockIds(selection));
7838
7848
  if (blockIds.size === 0) return {};
@@ -7950,6 +7960,8 @@ function createSuperDocUI(options) {
7950
7960
  * `{ style: 'single' }`) when active, never a bare `true` — check presence.
7951
7961
  */
7952
7962
  const resolveEffectiveMarkValuesFromLayout = (selection) => {
7963
+ const applied = appliedSelectionPresentation(selection);
7964
+ if (applied) return applied.inlineStyle ?? {};
7953
7965
  const host = getHost();
7954
7966
  const blockIds = new Set(selectionBlockIds(selection));
7955
7967
  if (blockIds.size === 0) return {};
@@ -8785,6 +8797,11 @@ function createSuperDocUI(options) {
8785
8797
  };
8786
8798
  /** Read effective paragraph alignments from the mounted, style-resolved layout. */
8787
8799
  const readEffectiveParagraphAlignments = (selection, blockIds) => {
8800
+ const applied = appliedSelectionPresentation(selection);
8801
+ if (applied) return new Map(blockIds.flatMap((id) => {
8802
+ const alignment = normalizeParagraphAlignment(applied.paragraphAlignments?.[id]);
8803
+ return alignment ? [[id, alignment]] : [];
8804
+ }));
8788
8805
  const host = getHost();
8789
8806
  const readByIds = host?.readMountedProjectionBlocksByIds;
8790
8807
  if (typeof readByIds !== "function") return null;
@@ -11283,6 +11300,8 @@ function createSuperDocUI(options) {
11283
11300
  return Boolean(readLinkPayloadTarget(payload) || isLooseObject(record.hyperlinkTarget) || isLooseObject(record.textTarget));
11284
11301
  };
11285
11302
  const commandSelectionIsReady = (id, descriptor, payload) => {
11303
+ const foreground = foregroundMutationState();
11304
+ if (foreground && (foreground.active > 0 || foreground.pending > 0)) return false;
11286
11305
  if (state.selection.status !== "ready") return false;
11287
11306
  if (trackDecisionCommand(id)?.scope === "id") return true;
11288
11307
  if (!descriptor || descriptor.disposition !== "routed") return true;
@@ -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.25.0-next.3",
22
+ superdocVersion: "2.25.0-next.4",
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.25.0-next.3",
21
+ superdocVersion: "2.25.0-next.4",
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
@@ -3369,7 +3369,7 @@ export declare const OPERATION_DEFINITIONS: {
3369
3369
  };
3370
3370
  readonly 'protection.setEditingRestriction': {
3371
3371
  readonly memberPath: "protection.setEditingRestriction";
3372
- readonly description: "Enable Word-style editing restriction on the document. Only readOnly mode is supported in v1.";
3372
+ readonly description: "Author a Word readOnly, comments, trackedChanges, or forms restriction. Inspect runtimeEnforced in the returned state: V2 currently enforces readOnly; the other modes are saved for Word and are not enforced in SuperDoc.";
3373
3373
  readonly expectedResult: "Returns a ProtectionMutationResult with the updated protection state on success.";
3374
3374
  readonly requiresDocumentContext: true;
3375
3375
  readonly metadata: CommandStaticMetadata;
@@ -132,6 +132,7 @@ export type { AnchoredMetadataApi, AnchoredMetadataAdapter } from './metadata/an
132
132
  export type { ProtectionApi, ProtectionAdapter } from './protection/protection.js';
133
133
  export * from './protection/protection.types.js';
134
134
  export type { PermissionRangesApi, PermissionRangesAdapter } from './permission-ranges/permission-ranges.js';
135
+ export { listPermissionRangeEditors, resolvePermissionRangeEditor } from './permission-ranges/permission-ranges.js';
135
136
  export type * from './permission-ranges/permission-ranges.types.js';
136
137
  export type { FootnotesApi, FootnotesAdapter } from './footnotes/footnotes.js';
137
138
  export type { ClipboardApi, ClipboardAdapter } from './clipboard/clipboard.js';
@@ -1,5 +1,13 @@
1
1
  import { MutationOptions } from '../write/write.js';
2
- import { PermissionRangesListInput, PermissionRangesListResult, PermissionRangesGetInput, PermissionRangeInfo, PermissionRangesCreateInput, PermissionRangesRemoveInput, PermissionRangesUpdatePrincipalInput, PermissionRangeMutationResult, PermissionRangeRemoveResult } from './permission-ranges.types.js';
2
+ import { PermissionRangesListInput, PermissionRangesListResult, PermissionRangesGetInput, PermissionRangeInfo, PermissionRangesCreateInput, PermissionRangesRemoveInput, PermissionRangesUpdatePrincipalInput, PermissionRangeMutationResult, PermissionRangeRemoveResult, PermissionRangeEditor, PermissionRangeEditorResolution } from './permission-ranges.types.js';
3
+ /**
4
+ * Resolve a host ID or imported Word email against an explicitly supplied roster.
5
+ * Word receives the email when available; opaque IDs remain host-specific.
6
+ * Duplicate IDs/emails are ambiguous. This does not authenticate a user.
7
+ */
8
+ export declare function resolvePermissionRangeEditor(editors: readonly PermissionRangeEditor[], id: string): PermissionRangeEditorResolution;
9
+ /** Enumerate the host roster for an editor picker, including ambiguous entries. */
10
+ export declare function listPermissionRangeEditors(editors: readonly PermissionRangeEditor[]): PermissionRangeEditorResolution[];
3
11
  export interface PermissionRangesApi {
4
12
  list(input?: PermissionRangesListInput): PermissionRangesListResult;
5
13
  get(input: PermissionRangesGetInput): PermissionRangeInfo;
@@ -9,6 +9,23 @@ export type PermissionRangePrincipal = {
9
9
  kind: 'editor';
10
10
  id: string;
11
11
  };
12
+ /** Trusted host roster entry. Names are display labels, never permission identities. */
13
+ export interface PermissionRangeEditor {
14
+ id?: string | null;
15
+ email?: string | null;
16
+ name?: string | null;
17
+ }
18
+ export type PermissionRangeEditorResolution = {
19
+ status: 'resolved';
20
+ id: string;
21
+ editor: PermissionRangeEditor;
22
+ principal: Extract<PermissionRangePrincipal, {
23
+ kind: 'editor';
24
+ }>;
25
+ } | {
26
+ status: 'unknown' | 'ambiguous';
27
+ id: string;
28
+ };
12
29
  export type PermissionRangeKind = 'inline' | 'block';
13
30
  export interface PermissionRangeInfo {
14
31
  id: string;
@@ -33,8 +33,8 @@ export declare const DEFAULT_PROTECTION_STATE: DocumentProtectionState;
33
33
  export type ProtectionGetInput = Record<string, never> | undefined;
34
34
  /** Input for `protection.setEditingRestriction`. */
35
35
  export interface SetEditingRestrictionInput {
36
- /** Only `'readOnly'` is accepted in v1. */
37
- mode: 'readOnly';
36
+ /** Word restriction to author. Inspect `runtimeEnforced` before relying on engine enforcement. */
37
+ mode: Exclude<EditingRestrictionMode, 'none'>;
38
38
  /** Whether to restrict formatting changes. Defaults to false. */
39
39
  formattingRestricted?: boolean;
40
40
  }
@@ -5,8 +5,8 @@
5
5
  * every retained dependency that required the checkpoint; consumers reject
6
6
  * empty, duplicate, or unknown lists instead of trusting a generic boolean.
7
7
  */
8
- export type PageCheckpointDependencyClass = 'multiple-sections' | 'furniture-page-tokens' | 'non-balanceable-multi-column-sections' | 'body-anchored-objects' | 'non-flowing-page-relative-body-anchors' | 'footnotes' | 'page-references' | 'cross-references' | 'keep-constraints' | 'tables' | 'furniture-anchored-objects';
9
- export declare const PAGE_CHECKPOINT_DEPENDENCY_CLASSES: readonly ["multiple-sections", "furniture-page-tokens", "non-balanceable-multi-column-sections", "body-anchored-objects", "non-flowing-page-relative-body-anchors", "footnotes", "page-references", "cross-references", "keep-constraints", "tables", "furniture-anchored-objects"];
8
+ export type PageCheckpointDependencyClass = 'multiple-sections' | 'furniture-page-tokens' | 'body-page-number-tokens' | 'non-balanceable-multi-column-sections' | 'body-anchored-objects' | 'non-flowing-page-relative-body-anchors' | 'footnotes' | 'page-references' | 'cross-references' | 'keep-constraints' | 'tables' | 'furniture-anchored-objects';
9
+ export declare const PAGE_CHECKPOINT_DEPENDENCY_CLASSES: readonly ["multiple-sections", "furniture-page-tokens", "body-page-number-tokens", "non-balanceable-multi-column-sections", "body-anchored-objects", "non-flowing-page-relative-body-anchors", "footnotes", "page-references", "cross-references", "keep-constraints", "tables", "furniture-anchored-objects"];
10
10
  /**
11
11
  * Exact retained-generation proof for page/margin-relative body anchors that
12
12
  * cannot influence paragraph flow (`wrap=None`). The host builds this once
@@ -2899,6 +2899,8 @@ export type LayoutBlockResumeCheckpoint = {
2899
2899
  columns: ColumnLayout;
2900
2900
  }[];
2901
2901
  activeConstraintIndex: number;
2902
+ /** Exact active configuration, including single-column state omitted from Page.columns. */
2903
+ activeColumns?: ColumnLayout;
2902
2904
  footnoteDemandThisPage: number;
2903
2905
  footnoteRefsThisPage: number;
2904
2906
  footnoteAnchorsThisPage: readonly {
@@ -2935,6 +2937,8 @@ export type Layout = {
2935
2937
  layoutEpoch?: number;
2936
2938
  /** Exact paragraph-boundary resume sidecar; never inferred from painted geometry. */
2937
2939
  blockResumeCheckpoints?: ReadonlyMap<BlockId, LayoutBlockResumeCheckpoint>;
2940
+ /** Engine-authored column state at physical page creation, including count=1 configurations. */
2941
+ pageStartColumns?: ReadonlyMap<number, ColumnLayout>;
2938
2942
  };
2939
2943
  export type WrapTextMode = 'bothSides' | 'left' | 'right' | 'largest';
2940
2944
  export type WrapExclusion = {
@@ -44,36 +44,15 @@ export interface FontMetricsCacheConfig {
44
44
  */
45
45
  export declare class FontMetricsCache {
46
46
  private cache;
47
- private canvas;
48
47
  private ctx;
48
+ private fontGeneration;
49
49
  /**
50
50
  * Creates a new FontMetricsCache instance.
51
51
  * Initializes the canvas context for measurements.
52
52
  */
53
53
  constructor();
54
- /**
55
- * Initializes the canvas and context for font measurements.
56
- *
57
- * Creates an offscreen 1x1 canvas with 2D rendering context optimized for
58
- * text measurement. The canvas is never attached to the DOM and is purely
59
- * used for the canvas.measureText() API.
60
- *
61
- * Performance considerations:
62
- * - Canvas is created once and reused for all measurements
63
- * - Size is minimal (1x1) as we only need measureText(), not rendering
64
- * - willReadFrequently hint optimizes for frequent measureText() calls
65
- *
66
- * Failure modes:
67
- * - Not in browser environment (SSR): Sets ctx to null, cache will be disabled
68
- * - Canvas creation fails: Catches error, sets ctx to null, measurements fall back to defaults
69
- *
70
- * Side effects:
71
- * - Creates this.canvas and this.ctx properties
72
- * - On failure, cache becomes read-only (getMetrics returns undefined for unmeasured fonts)
73
- *
74
- * @private
75
- */
76
54
  private initializeCanvas;
55
+ private ensureFontGeneration;
77
56
  /**
78
57
  * Pre-warms the cache by measuring all characters for the specified fonts.
79
58
  *
@@ -378,13 +378,14 @@ export type IncrementalPaginationProof = IncrementalPaginationProofBase & ({
378
378
  * mid-section checkpoint cannot seed. False is admissible only
379
379
  * together with `balanceableSectionsBoundaryBlockId`, the last
380
380
  * page-bearing block at or before the final balanceable section end.
381
- * The bridge requires a document-start replay, includes that section
382
- * finalizer, and refuses convergence until a stable page strictly
383
- * after the retained boundary. Anything else takes the canonical full
384
- * layout.
381
+ * The bridge replays from document start unless the separately proved
382
+ * unchanged balanced prefix precedes a complete single-column seed
383
+ * strictly after the boundary. Convergence remains fenced after it.
385
384
  */
386
385
  multiColumnSectionsProvedNonBalanceable: boolean;
387
386
  balanceableSectionsBoundaryBlockId?: string;
387
+ /** The unchanged balanced sections precede every dirty owner; the bridge re-verifies the seeded checkpoint. */
388
+ balanceableSectionsRetainedPrefix?: true;
388
389
  /** Last vertically aligned section page; validated before reuse. */
389
390
  vAlignSectionsBoundaryBlockId?: string;
390
391
  /** Replay page zero through the aligned boundary before convergence. */
@@ -617,6 +618,12 @@ export declare function __test_only_splicedCheckpointStats(map: ReadonlyMap<stri
617
618
  sourceCount: number;
618
619
  maximumTransformTreeDepth: number;
619
620
  } | null;
621
+ export type LayoutPageGeometry = Pick<Page, 'size' | 'margins' | 'sectionIndex'>;
622
+ /** Internal live identity readback; every fragment remains visible to ownership validation. */
623
+ export declare function readLayoutPageFragmentBlockIds(pages: Page[], pageIndex: number): IterableIterator<string>;
624
+ /** Read canonical page boxes without materializing retained PM or fragment transforms. */
625
+ export declare function readLayoutPageGeometry(pages: Page[], pageIndex: number): LayoutPageGeometry;
626
+ export declare function __test_only_pageSequenceMaterializationCount(pages: Page[]): number;
620
627
  export declare function __test_only_lazyPageTransformStats(pages: Page[]): {
621
628
  segmentCount: number;
622
629
  maximumLedgerCount: number;
@@ -12,9 +12,9 @@ export { findWordBoundaries, findParagraphBoundaries } from './text-boundaries.j
12
12
  export type { BoundaryRange } from './text-boundaries.js';
13
13
  export { buildSectionAwareHeaderFooterLayoutKey, buildSectionContentWidth, buildEffectiveHeaderFooterRefsBySection, collectReferencedHeaderFooterRIds, buildSectionAwareHeaderFooterMeasurementGroups, } from './sectionAwareHeaderFooter.js';
14
14
  export type { HeaderFooterSectionKind, HeaderFooterRefs, SectionAwareHeaderFooterMeasurementGroup, } from './sectionAwareHeaderFooter.js';
15
- export { clearIncrementalModuleState, incrementalLayout, measureCache, normalizeMargin } from './incrementalLayout.js';
15
+ export { clearIncrementalModuleState, incrementalLayout, measureCache, normalizeMargin, readLayoutPageGeometry, readLayoutPageFragmentBlockIds, } from './incrementalLayout.js';
16
16
  export { hashMeasureContent } from './cache.js';
17
- export type { HeaderFooterLayoutResult, HeaderFooterGeometrySeed, IncrementalLayoutBridgeTiming, IncrementalLayoutResult, IncrementalLayoutExecutionControl, IncrementalLayoutContinuation, IncrementalMeasureReuseProof, IncrementalLayoutReuseOptions, IncrementalLayoutReuseSummary, IncrementalSectionPageNumberTransform, IncrementalLayoutTailAdoption, IncrementalLayoutTailDisposition, IncrementalPaginationProof, LayoutPositionTransform, FootnoteReserveSeed, } from './incrementalLayout.js';
17
+ export type { HeaderFooterLayoutResult, HeaderFooterGeometrySeed, IncrementalLayoutBridgeTiming, IncrementalLayoutResult, IncrementalLayoutExecutionControl, IncrementalLayoutContinuation, IncrementalMeasureReuseProof, IncrementalLayoutReuseOptions, IncrementalLayoutReuseSummary, IncrementalSectionPageNumberTransform, IncrementalLayoutTailAdoption, IncrementalLayoutTailDisposition, IncrementalPaginationProof, LayoutPositionTransform, LayoutPageGeometry, FootnoteReserveSeed, } from './incrementalLayout.js';
18
18
  export { collectFootnoteLedgers, getPreferredReserveCandidates, getPreferredReserveTrialTargets, isMandatoryOnlyFootnotePage, scoreFootnoteWindow, summarizeFootnoteWindow, } from './footnote-scorer.js';
19
19
  export type { FootnotePreferredReserveCandidate, FootnoteWindowScoreInput, FootnoteWindowScoreReason, FootnoteWindowScoreResult, FootnoteWindowStats, } from './footnote-scorer.js';
20
20
  export { computeDisplayPageNumber } from '../../layout-engine/src/index.js';
@@ -0,0 +1,12 @@
1
+ /** Native Canvas2D allocation shared by the secondary layout measurers. */
2
+ export type LayoutMeasurementContext = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
3
+ type UnavailablePolicy = 'require-native' | 'headless-approximation';
4
+ export declare function getLayoutMeasurementFontGeneration(): number;
5
+ /** Invalidates secondary caches when a face changes behind an unchanged CSS font string. */
6
+ export declare function invalidateLayoutMeasurementFonts(): void;
7
+ export declare function createLayoutMeasurementContext(options?: {
8
+ context?: LayoutMeasurementContext;
9
+ ownerDocument?: Document;
10
+ unavailable?: UnavailablePolicy;
11
+ }): LayoutMeasurementContext | null;
12
+ export {};
@@ -18,6 +18,6 @@ export declare function cloneLiveCrossReferenceFieldBlocks<T extends FlowBlock>(
18
18
  * graph. This happens before measurement, so changed result text participates
19
19
  * in line wrapping and pagination without creating a second document mutation.
20
20
  */
21
- export declare function resolveLiveCrossReferences(bodyBlocks: FlowBlock[]): void;
21
+ export declare function resolveLiveCrossReferences(bodyBlocks: FlowBlock[]): boolean;
22
22
  /** Build the page-aware STYLEREF resolver used by repeated headers/footers. */
23
23
  export declare function buildPageStyleReferenceResolver(bodyBlocks: readonly FlowBlock[], layout: Layout): PageStyleReferenceResolver;
@@ -133,3 +133,7 @@ export type DomPainterHandle = {
133
133
  * `mode-ownership.test.ts` battery pins the surface deleted.
134
134
  */
135
135
  export declare const createDomPainter: (options: DomPainterOptions) => DomPainterHandle;
136
+ export { resolveRunTypographyStyles, resolveRunDecorationStyles } from './runs/text-style-facts.js';
137
+ export { resolveTrackedChangeDecorationFacts, getTrackedChangeLayers, resolveTrackedChangesConfig, } from './runs/tracked-changes.js';
138
+ export { buildLinkRenderData } from './runs/links.js';
139
+ export { INLINE_TRACKED_CHANGE_DEFAULTS } from './styles.js';
@@ -2,6 +2,8 @@ import { Run, TextRun } from '../../../../contracts/src/index.js';
2
2
  import { FragmentRenderContext } from '../renderer.js';
3
3
  import { BROWSER_DEFAULT_FONT_SIZE } from '../styles.js';
4
4
  import { RunRenderContext, TrackedChangesRenderConfig } from './types.js';
5
+ import { ResolvePhysicalFont } from './text-style-facts.js';
6
+ export { underlineThicknessPx } from './text-style-facts.js';
5
7
  export type CheckboxGlyphs = {
6
8
  checked: string;
7
9
  unchecked: string;
@@ -10,23 +12,6 @@ export type CheckboxGlyphs = {
10
12
  export declare const checkboxGlyphs: (run: TextRun) => CheckboxGlyphs | null;
11
13
  /** Stamps the authored states needed to reflect an accepted checkbox toggle. */
12
14
  export declare const applyCheckboxGlyphMetadata: (element: HTMLElement, run: TextRun) => CheckboxGlyphs | null;
13
- /**
14
- * Underline thickness in px, scaled to font size. Shared by text runs
15
- * (`text-decoration-thickness`) and tab underlines (border width) so a run's
16
- * underline renders as a single uniform weight across text and tab characters,
17
- * matching Word, on any display density (SD-3330). The divisor approximates the
18
- * font's natural underline weight (≈ what `text-decoration-thickness: auto`
19
- * produces) while staying deterministic across platforms.
20
- *
21
- * Rounded to an integer px because CSS borders snap to integer device pixels
22
- * while `text-decoration-thickness` keeps fractional values; using an integer
23
- * makes the tab border and the text underline rasterize to the same line weight.
24
- */
25
- export declare const underlineThicknessPx: (fontSize: number) => number;
26
- type ResolvePhysicalFont = (cssFontFamily: string, face: {
27
- weight: '400' | '700';
28
- style: 'normal' | 'italic';
29
- }) => string;
30
15
  export declare const applyRunTypographyStyles: (element: HTMLElement, run: TextRun, resolvePhysical?: ResolvePhysicalFont) => void;
31
16
  /**
32
17
  * Applies run styling properties to a DOM element.
@@ -0,0 +1,9 @@
1
+ import { TextRun } from '../../../../contracts/src/index.js';
2
+ export type ResolvePhysicalFont = (family: string, face: {
3
+ weight: '400' | '700';
4
+ style: 'normal' | 'italic';
5
+ }) => string;
6
+ /** The same paint-ready typography is consumed by the DOM painter and worker sinks. */
7
+ export declare function resolveRunTypographyStyles(run: TextRun, resolvePhysical?: ResolvePhysicalFont): Record<string, string>;
8
+ export declare const underlineThicknessPx: (fontSize: number) => number;
9
+ export declare function resolveRunDecorationStyles(run: TextRun): Record<string, string>;
@@ -21,17 +21,9 @@ export declare const resolveTrackedChangeVisualColor: (layer: TrackedChangeMeta)
21
21
  * `colorWithAlpha` can safely extend (named/non-hex visual colors still set
22
22
  * border/text but never fabricate a derived background).
23
23
  */
24
+ export declare const resolveTrackedChangeColorVariables: (layer: TrackedChangeMeta) => Record<string, string>;
24
25
  export declare const applyTrackedChangeColorVariables: (elem: HTMLElement, layer: TrackedChangeMeta) => void;
25
26
  export declare const TRACK_CHANGE_MODIFIER_CLASS: Record<TrackedChangeKind, Record<TrackedChangesMode, string | undefined>>;
26
- /**
27
- * Stamps the semantic class + datasets for a tracked-change layer. Shared by
28
- * inline, row-level, and cell-level paint paths so the dataset/class vocabulary
29
- * stays identical. Only fields that are present are stamped; this never reads
30
- * or writes the author `color` dataset. The semantic datasets are namespaced
31
- * (`data-track-change-semantic-*`, `-type`, `-subtype`, `-target-kind`,
32
- * `-semantic-anchor-scope`) so they never collide with the existing author/
33
- * structural datasets even when row + cell metadata coexist.
34
- */
35
27
  export declare const applySemanticTrackedChangeMetadata: (elem: HTMLElement, meta: TrackedChangeMeta) => void;
36
28
  type TrackedChangeCarrier = Partial<Pick<TextRun, 'trackedChange' | 'trackedChanges'>>;
37
29
  type TrackedChangeDecoratable = Run | TrackedChangeCarrier;
@@ -86,5 +78,10 @@ export declare const applyRowTrackedChangeToCell: (elem: HTMLElement, meta: Trac
86
78
  * @param config - Tracked-changes mode/enabled (same source inline runs use).
87
79
  */
88
80
  export declare const applyCellTrackedChangeToCell: (elem: HTMLElement, meta: TrackedChangeMeta, config: TrackedChangesRenderConfig) => void;
81
+ export declare const resolveTrackedChangeDecorationFacts: (run: TrackedChangeDecoratable, config: TrackedChangesRenderConfig) => {
82
+ classes: string[];
83
+ style: Record<string, string>;
84
+ attributes: Record<string, string>;
85
+ };
89
86
  export declare const applyTrackedChangeDecorations: (elem: HTMLElement, run: TrackedChangeDecoratable, config: TrackedChangesRenderConfig) => void;
90
87
  export {};
@@ -31,6 +31,27 @@ export declare const fragmentStyles: Partial<CSSStyleDeclaration>;
31
31
  * element itself gets z-index for layering within the line (e.g. above tab leaders).
32
32
  */
33
33
  export declare const lineStyles: (lineHeight: number) => Partial<CSSStyleDeclaration>;
34
+ /** Default inline tracking paint values shared with non-DOM drawing consumers. */
35
+ export declare const INLINE_TRACKED_CHANGE_DEFAULTS: {
36
+ readonly insert: {
37
+ readonly border: "#1f6feb";
38
+ readonly background: "#1f6feb22";
39
+ readonly borderWidth: 1;
40
+ readonly strikeWidth: 0;
41
+ };
42
+ readonly delete: {
43
+ readonly border: "#cb0e47";
44
+ readonly background: "#cb0e4722";
45
+ readonly borderWidth: 1;
46
+ readonly strikeWidth: 2;
47
+ };
48
+ readonly format: {
49
+ readonly border: "gold";
50
+ readonly background: "transparent";
51
+ readonly borderWidth: 2;
52
+ readonly strikeWidth: 0;
53
+ };
54
+ };
34
55
  /** One document-scoped stylesheet the paint surface requires: head marker attribute + CSS payload. */
35
56
  export type SurfaceStylePreflightEntry = {
36
57
  markerAttribute: string;
@@ -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-D8ss5E0J.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-C-oN_R2a.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-3habU4hL.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-D5waZHl3.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-D8ss5E0J.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-C-oN_R2a.cjs");
3
3
  const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
4
4
  let superdoc_entry_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-3habU4hL.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-D5waZHl3.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-D8ss5E0J.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-C-oN_R2a.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 { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-3habU4hL.es.js";
1
+ import { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-D5waZHl3.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
@@ -75,7 +75,9 @@ export declare class FontRegistry {
75
75
  * constructor: the family is recorded as `unloaded` and will resolve to
76
76
  * `fallback_used` when awaited.
77
77
  */
78
- register(descriptor: FontFaceDescriptor): RegisterFaceResult;
78
+ register(descriptor: FontFaceDescriptor, options?: {
79
+ preserveDescriptors?: boolean;
80
+ }): RegisterFaceResult;
79
81
  /** True if this registry created a managed face for the family. */
80
82
  isManaged(family: string): boolean;
81
83
  /**
@@ -126,6 +128,8 @@ export declare class FontRegistry {
126
128
  * Distinct from {@link isAvailable}, which asks whether a face is LOADED right now.
127
129
  */
128
130
  hasFace(family: string, weight: '400' | '700', style: 'normal' | 'italic'): boolean;
131
+ /** Face facts captured without retaining this registry or consulting later load state. */
132
+ snapshotFaces(): Pick<FontRegistry, 'hasFace' | 'getFaceStatus'>;
129
133
  /**
130
134
  * Synchronous availability check: is a real face for this family loaded and
131
135
  * usable in the set *right now*? Used by the gate's late-load handler to detect
@@ -124,6 +124,8 @@ export declare class FontResolver {
124
124
  * fonts must not leak into the next). Bumps {@link version} only if something was actually cleared.
125
125
  */
126
126
  reset(): void;
127
+ /** Immutable resolution owner for geometry retained with an already displayed scene. */
128
+ snapshot(): Pick<FontResolver, 'resolvePhysicalFamilyForFace' | 'signature'>;
127
129
  /** Monotonic version; bumps on every mapping change. A lightweight "did it change" signal. */
128
130
  get version(): number;
129
131
  /**