superdoc 2.5.1 → 2.6.0-next.10

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.5.1",
22
+ superdocVersion: "2.6.0-next.10",
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.5.1",
21
+ superdocVersion: "2.6.0-next.10",
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
@@ -538,6 +538,8 @@ export type ImageRun = {
538
538
  placeholder?: RenderPlaceholder;
539
539
  /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
540
540
  imageId?: string;
541
+ /** Opaque Document API identity when projection can resolve it without a catalog read. */
542
+ imageMutationId?: string;
541
543
  /** Clip-path value for cropped images. */
542
544
  clipPath?: string;
543
545
  /** DrawingML picture frame; paint-only and excluded from layout sizing. */
@@ -932,6 +934,8 @@ export type ImageBlock = {
932
934
  placeholder?: RenderPlaceholder;
933
935
  /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
934
936
  imageId?: string;
937
+ /** Opaque Document API identity when projection can resolve it without a catalog read. */
938
+ imageMutationId?: string;
935
939
  objectFit?: 'contain' | 'cover' | 'fill' | 'scale-down';
936
940
  display?: 'inline' | 'block';
937
941
  padding?: BoxSpacing;
@@ -2807,7 +2811,7 @@ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) =>
2807
2811
  };
2808
2812
  export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
2809
2813
  export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
2810
- export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
2814
+ export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, usesPositionedTextGeometry, } from './run-helpers.js';
2811
2815
  export { INLINE_OBJECT_REPLACEMENT_CHARACTER, flattenParagraphVisibleText, mapVisibleRangeToRunSlices, type ParagraphVisibleRunSlice, } from './paragraph-visible-text.js';
2812
2816
  export { inlineBoxStyleSignature, isFiniteNonNegativeInteger, normalizeInlineBoxLogicalSides, type InlineBoxLogicalSides, type ResolvedInlineBoxLogicalSides, } from './inline-box.js';
2813
2817
  export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type NonFlowingPageRelativeAnchorDependencyProof, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
@@ -21,3 +21,13 @@ export declare function expandRunsForInlineNewlines(runs: Run[]): Run[];
21
21
  * @returns Array of runs present in the line
22
22
  */
23
23
  export declare function sliceRunsForLine(block: FlowBlock, line: Line): Run[];
24
+ /**
25
+ * Whether a line's text must be painted from measured segment coordinates.
26
+ *
27
+ * Explicit tab coordinates require positioned painting. Horizontally scaled
28
+ * text does as well because browser inline flow cannot preserve the measured
29
+ * advance after `scaleX`. Keeping this decision in the shared contracts layer
30
+ * prevents the resolver and painter from disagreeing about whether paragraph
31
+ * indentation is represented by CSS or by the segments' absolute X values.
32
+ */
33
+ export declare function usesPositionedTextGeometry(line: Line, runsForLine: Run[], isRtl: boolean): boolean;
@@ -59,11 +59,13 @@ export type MeasureCacheStats = {
59
59
  * Performance characteristics:
60
60
  * - get(): O(1) - Map lookup + delete + re-insert for LRU tracking
61
61
  * - set(): O(1) - eviction (delete first key) + insert
62
- * - invalidate(): O(n) - where n = number of keys matching blockId prefix
62
+ * - invalidate(): O(k) - where k = cached variants for the requested block IDs
63
63
  * - Memory: Bounded at 10K entries ~= 50-100MB
64
64
  */
65
65
  export declare class MeasureCache<T> {
66
66
  private cache;
67
+ private keysByBlockId;
68
+ private blockIdByKey;
67
69
  private stats;
68
70
  /**
69
71
  * Retrieve a cached measure for the given block and dimensions.
@@ -130,6 +132,7 @@ export declare class MeasureCache<T> {
130
132
  * Update size statistics
131
133
  */
132
134
  private updateSizeStats;
135
+ private deleteKey;
133
136
  /**
134
137
  * Composes a cache key from block properties and dimensions.
135
138
  * Validates and clamps dimensions to prevent memory exhaustion.
@@ -1,4 +1,4 @@
1
- import { NonFlowingPageRelativeAnchorDependencyProof, PageCheckpointDependencyClass, FlowBlock, Layout, Measure, HeaderFooterLayout, ColumnLayout } from '../../contracts/src/index.js';
1
+ import { NonFlowingPageRelativeAnchorDependencyProof, PageCheckpointDependencyClass, FlowBlock, Layout, LayoutBlockResumeCheckpoint, Measure, HeaderFooterLayout, ColumnLayout } from '../../contracts/src/index.js';
2
2
  import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
3
3
  import { LayoutOptions, HeaderFooterConstraints, LayoutExecutionCheckpoint } from '../../layout-engine/src/index.js';
4
4
  import { computeDirtyRegions } from './diff.js';
@@ -353,6 +353,11 @@ export declare function incrementalLayout(previousBlocks: FlowBlock[], _previous
353
353
  measures: Measure[];
354
354
  };
355
355
  }, layoutReuse?: IncrementalLayoutReuseOptions, measureReuseProof?: IncrementalMeasureReuseProof, execution?: IncrementalLayoutExecutionControl): Promise<IncrementalLayoutResult>;
356
+ export declare function __test_only_splicedCheckpointStats(map: ReadonlyMap<string, LayoutBlockResumeCheckpoint> | undefined): {
357
+ pieceCount: number;
358
+ sourceCount: number;
359
+ maximumTransformTreeDepth: number;
360
+ } | null;
356
361
  /**
357
362
  * Normalizes a margin value, using a fallback for undefined or non-finite values.
358
363
  * Prevents NaN content sizes when margin properties are partially defined.
@@ -5,6 +5,7 @@ export type FootnoteAnchorIndexInput = {
5
5
  refs?: Array<{
6
6
  id: string;
7
7
  pos: number;
8
+ blockId?: string;
8
9
  }>;
9
10
  bodyHeightById?: Map<string, number>;
10
11
  firstLineHeightById?: Map<string, number>;
@@ -71,6 +71,13 @@ export type ParagraphLayoutContext = {
71
71
  * vertical layout height.
72
72
  */
73
73
  layoutOnlyAnchorCarrier?: boolean;
74
+ /**
75
+ * Keep positioned objects on the page that owns this zero-height carrier.
76
+ * A carrier immediately before a forcing sectPr belongs to the preceding
77
+ * section; moving its object for page-fit would insert an extra page before
78
+ * the section break and detach it from its authored paragraph anchor.
79
+ */
80
+ preserveAnchorCarrierPage?: boolean;
74
81
  /**
75
82
  * True when a split line-break carrier carries paragraph spacing that should
76
83
  * remain in the flow. The carrier reserves one line plus spacing instead of
@@ -10,6 +10,7 @@ export type ParagraphLineIndentationParams = {
10
10
  continuesFromPrev?: boolean;
11
11
  suppressFirstLineIndent: boolean;
12
12
  resetContinuationTextIndent?: boolean;
13
+ positionedTextGeometry?: boolean;
13
14
  };
14
15
  export declare const hasExplicitSegmentPositioning: (line: Line) => boolean;
15
16
  export declare const applyParagraphLineIndentation: (params: ParagraphLineIndentationParams) => void;
@@ -229,9 +229,14 @@ export type PaintSnapshot = {
229
229
  pages: PaintSnapshotPage[];
230
230
  entities: PaintSnapshotEntities;
231
231
  };
232
+ type PainterFragmentFailure = {
233
+ readonly blockId: string;
234
+ readonly code: 'painter-fragment-unavailable';
235
+ };
232
236
  type PersistentPagePainterTransaction = {
233
237
  commit(): void;
234
238
  rollback(): void;
239
+ readFragmentFailures(): readonly PainterFragmentFailure[];
235
240
  };
236
241
  /**
237
242
  * DOM-based document painter that renders layout fragments to HTML elements.
@@ -478,14 +483,6 @@ export declare class DomPainter {
478
483
  * @returns HTMLElement containing the rendered fragment or error placeholder
479
484
  */
480
485
  private renderParagraphFragment;
481
- /**
482
- * Creates an error placeholder element for failed fragment renders.
483
- * Prevents entire paint operation from failing due to single fragment error.
484
- *
485
- * @param blockId - The block ID that failed to render
486
- * @param error - The error that occurred
487
- * @returns HTMLElement showing the error
488
- */
489
486
  private createErrorPlaceholder;
490
487
  private renderImageFragment;
491
488
  /**
@@ -628,6 +625,7 @@ export declare class DomPainter {
628
625
  * Selects the wrapper's section-scoped identity and legacy PM attributes.
629
626
  */
630
627
  private updateFragmentElement;
628
+ private applyRenderDiagnosticFragmentFrame;
631
629
  /**
632
630
  * Applies fragment positioning, dimensions, and metadata to an HTML element.
633
631
  *