superdoc 2.4.0-next.6 → 2.4.0-next.60
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.
- package/README.md +12 -90
- package/dist/chunks/{FindReplaceSurface-C-I4GcRE.cjs → FindReplaceSurface-0p7EtMZh.cjs} +4 -4
- package/dist/chunks/{FindReplaceSurface-B_1Ksbr0.es.js → FindReplaceSurface-40AnrqWk.es.js} +5 -4
- package/dist/chunks/{PasswordPromptSurface-Bu5xHm91.cjs → PasswordPromptSurface-31lYPcCK.cjs} +4 -3
- package/dist/chunks/{PasswordPromptSurface-Bz9_sKhX.es.js → PasswordPromptSurface-CwYeO3iQ.es.js} +4 -2
- package/dist/chunks/{PdfViewer-CdVGB6Fe.es.js → PdfViewer-D8h7LRZy.es.js} +103 -19
- package/dist/chunks/{PdfViewer-D4eD2dV1.cjs → PdfViewer-Dug6yDRC.cjs} +105 -20
- package/dist/chunks/_plugin-vue_export-helper-BOaGB7Aw.es.js +8 -0
- package/dist/chunks/_plugin-vue_export-helper-SDR04tiH.cjs +13 -0
- package/dist/chunks/{blank-docx-DP8RUPW-.cjs → blank-docx-BuFAbRjs.cjs} +2 -0
- package/dist/chunks/{blank-docx-XRX6Ker2.es.js → blank-docx-DzQccOlW.es.js} +2 -0
- package/dist/chunks/constants-B6VBlmKp.es.js +4 -0
- package/dist/chunks/constants-DpXuDx_g.cjs +9 -0
- package/dist/chunks/{create-super-doc-ui-BquF8bnZ.es.js → create-super-doc-ui-B_1l545i.es.js} +2134 -1099
- package/dist/chunks/{create-super-doc-ui-sMXbYzhs.cjs → create-super-doc-ui-DNtHxzz_.cjs} +1945 -1150
- package/dist/chunks/{eventemitter3-Bt2s0X0a.es.js → eventemitter3-CMOjDs74.es.js} +124 -16
- package/dist/chunks/{eventemitter3-DqY4aSMf.cjs → eventemitter3-D38u8ta_.cjs} +125 -16
- package/dist/chunks/jszip-RC64TPzL.cjs +4758 -0
- package/dist/chunks/jszip-VxCFV9YS.es.js +4717 -0
- package/dist/chunks/{rolldown-runtime-D7PMmH3s.es.js → rolldown-runtime-B5TtN50X.es.js} +13 -4
- package/dist/chunks/{rolldown-runtime-1Y-nnZJ3.cjs → rolldown-runtime-DtsSbkrh.cjs} +12 -3
- package/dist/chunks/{uuid-CFp0WGVU.cjs → uuid-BhG0ngwk.cjs} +10 -6
- package/dist/chunks/{uuid-B2Sqk-3p.es.js → uuid-H0Xcmmhy.es.js} +8 -3
- package/dist/collaboration-upgrade-engine.cjs +34 -9
- package/dist/collaboration-upgrade-engine.es.js +30 -5
- package/dist/document-api/src/citations/citations.types.d.ts +9 -0
- package/dist/document-api/src/comments/comments.types.d.ts +7 -0
- package/dist/document-api/src/types/receipt.d.ts +9 -5
- package/dist/document-api/src/types/track-changes.types.d.ts +17 -0
- package/dist/layout-engine/contracts/src/graphic-placement.d.ts +35 -6
- package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +22 -2
- package/dist/layout-engine/contracts/src/index.d.ts +208 -14
- package/dist/layout-engine/contracts/src/inline-box.d.ts +19 -0
- package/dist/layout-engine/contracts/src/paragraph-visible-text.d.ts +19 -0
- package/dist/layout-engine/contracts/src/resolved-layout.d.ts +5 -0
- package/dist/layout-engine/dom-contract/src/class-names.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/footnote-scorer.d.ts +1 -1
- package/dist/layout-engine/layout-bridge/src/hydrateTableTextboxMeasures.d.ts +9 -0
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +42 -11
- package/dist/layout-engine/layout-bridge/src/index.d.ts +4 -2
- package/dist/layout-engine/layout-bridge/src/inline-box-key.d.ts +3 -0
- package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +11 -4
- package/dist/layout-engine/layout-bridge/src/remeasure.d.ts +2 -2
- package/dist/layout-engine/layout-bridge/src/run-visual-marks.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +0 -12
- package/dist/layout-engine/layout-engine/src/anchors.d.ts +4 -0
- package/dist/layout-engine/layout-engine/src/execution.d.ts +21 -0
- package/dist/layout-engine/layout-engine/src/floating-objects.d.ts +15 -2
- package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +2 -0
- package/dist/layout-engine/layout-engine/src/footnote-anchor-index.d.ts +17 -0
- package/dist/layout-engine/layout-engine/src/index.d.ts +13 -10
- package/dist/layout-engine/layout-engine/src/inline-drawing-alignment.d.ts +9 -0
- package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +3 -3
- package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +2 -2
- package/dist/layout-engine/layout-engine/src/layout-textbox.d.ts +3 -3
- package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +3 -41
- package/dist/layout-engine/layout-engine/src/paginator.d.ts +7 -2
- package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +2 -0
- package/dist/layout-engine/layout-engine/src/section-props.d.ts +5 -0
- package/dist/layout-engine/painters/dom/src/renderer.d.ts +18 -0
- package/dist/layout-engine/painters/dom/src/runs/inline-box.d.ts +8 -0
- package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +6 -4
- package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +20 -27
- package/dist/layout-engine/painters/dom/src/table/renderTableFragment.d.ts +1 -1
- package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +6 -0
- package/dist/public/ui-react.cjs +66 -2
- package/dist/public/ui-react.es.js +66 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +174 -138
- package/dist/style.layered.css +174 -138
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +2 -0
- package/dist/superdoc/src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue.d.ts +16 -0
- package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +3 -1
- package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +12 -0
- package/dist/superdoc/src/core/SuperDoc.d.ts +10 -7
- package/dist/superdoc/src/core/extensions/index.d.ts +1 -1
- package/dist/superdoc/src/core/extensions/types.d.ts +63 -5
- package/dist/superdoc/src/core/types/index.d.ts +535 -42
- package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +3 -3
- package/dist/superdoc/src/helpers/comment-small-screen.d.ts +10 -0
- package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +3 -5
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +4 -4
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +11 -0
- package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +1 -1
- package/dist/superdoc/src/public/index.d.cts +28 -0
- package/dist/superdoc/src/public/index.d.ts +14 -0
- package/dist/superdoc/src/public/ui/types.d.ts +30 -6
- package/dist/superdoc/src/stores/comments-store.d.ts +81 -78
- package/dist/superdoc/src/stores/superdoc-store.d.ts +243 -234
- package/dist/superdoc.cjs +6735 -2163
- package/dist/superdoc.es.js +6608 -2036
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +37 -37
- package/package.json +14 -18
- package/AGENTS.md +0 -337
- package/dist/chunks/_plugin-vue_export-helper-CZ1Nl59K.cjs +0 -11
- package/dist/chunks/_plugin-vue_export-helper-DSMAhhwD.es.js +0 -6
- package/dist/chunks/constants-BfH0br5u.es.js +0 -3
- package/dist/chunks/constants-D7TNtyJd.cjs +0 -14
- package/dist/chunks/jszip-C8srOKAO.es.js +0 -4650
- package/dist/chunks/jszip-Cs9JBLlJ.cjs +0 -4691
- package/dist/superdoc/src/helpers/v2-remote-review-hydration.d.ts +0 -12
- package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +0 -19
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TabStop } from './engines/tabs.js';
|
|
2
2
|
import { PageNumberChapterSeparator, PageNumberFieldFormat, PageNumberFormat } from './page-number-formatting.js';
|
|
3
3
|
import { TrackedChangeSemanticColorKey } from './semantic-colors.js';
|
|
4
|
+
import { AnchorAlignH, AnchorAlignV, AnchorHRelative, AnchorVRelative } from './graphic-placement.js';
|
|
4
5
|
import { ParagraphDirectionContext, RunBidiContext, RunScriptContext, TableDirectionContext } from './direction-context.js';
|
|
5
6
|
import { LayoutSourceIdentity } from './layout-identity.js';
|
|
6
7
|
export { computeTabStops, layoutWithTabs, calculateTabWidth } from './engines/tabs.js';
|
|
@@ -17,7 +18,7 @@ export { shouldApplyJustify, calculateJustifySpacing, getFirstLineIndentOffset,
|
|
|
17
18
|
export { parseInsetClipPathForScale, formatInsetClipPathTransform, type InsetClipPathScale, } from './clip-path-inset.js';
|
|
18
19
|
export { SUBSCRIPT_SUPERSCRIPT_SCALE, normalizeBaselineShift, hasExplicitBaselineShift, isSuperscriptOrSubscript, usesDefaultScriptLayout, scaleFontSizeForVerticalText, resolveBaseFontSizeForVerticalText, type VerticalTextAlign, } from './vertical-text.js';
|
|
19
20
|
export { computeFragmentPmRange, computeLinePmRange, type LinePmRange } from './pm-range.js';
|
|
20
|
-
export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, } from './graphic-placement.js';
|
|
21
|
+
export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, isAnchorHRelative, isAnchorVRelative, isAnchorAlignH, isAnchorAlignV, ANCHOR_H_RELATIVE_VALUES, ANCHOR_V_RELATIVE_VALUES, ANCHOR_H_ALIGN_VALUES, ANCHOR_V_ALIGN_VALUES, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, type ResolveAnchoredGraphicXContext, type AnchorHRelative, type AnchorVRelative, type AnchorAlignH, type AnchorAlignV, } from './graphic-placement.js';
|
|
21
22
|
export { LAYOUT_BOUNDARY_SCHEMA, bodyStoryLocator, namedStoryLocator, computeLayoutFragmentId, buildLayoutSourceIdentity, buildLayoutSourceIdentityForFragment, } from './layout-identity.js';
|
|
22
23
|
export type { LayoutBlockRef, LayoutFragmentId, LayoutPartialRowIdentity, LayoutSourceIdentity, LayoutStoryKind, LayoutStoryLocator, } from './layout-identity.js';
|
|
23
24
|
export { LAYOUT_SEGMENT_GEOMETRY_SCHEMA } from './segment-geometry.js';
|
|
@@ -120,7 +121,7 @@ export type DocPartMetadata = {
|
|
|
120
121
|
* - Doc parts: special objects like tables of contents
|
|
121
122
|
*/
|
|
122
123
|
export type SdtMetadata = FieldAnnotationMetadata | StructuredContentMetadata | DocumentSectionMetadata | DocPartMetadata;
|
|
123
|
-
export declare const CONTRACTS_VERSION = "1.
|
|
124
|
+
export declare const CONTRACTS_VERSION = "1.2.0";
|
|
124
125
|
/** Unique identifier for a block in the document. Format: `${pos}-${type}`. */
|
|
125
126
|
export type BlockId = string;
|
|
126
127
|
/**
|
|
@@ -655,12 +656,58 @@ export type MathRun = {
|
|
|
655
656
|
sdt?: SdtMetadata;
|
|
656
657
|
};
|
|
657
658
|
export type Run = TextRun | TabRun | ImageRun | LineBreakRun | BreakRun | FieldAnnotationRun | MathRun;
|
|
659
|
+
/** Layout-affecting inline-box values, resolved to logical CSS pixel sides. */
|
|
660
|
+
export type ResolvedInlineBoxLayout = {
|
|
661
|
+
paddingInlineStart: number;
|
|
662
|
+
paddingInlineEnd: number;
|
|
663
|
+
paddingBlockStart: number;
|
|
664
|
+
paddingBlockEnd: number;
|
|
665
|
+
gapBefore: number;
|
|
666
|
+
gapAfter: number;
|
|
667
|
+
borderWidth: number;
|
|
668
|
+
};
|
|
669
|
+
/** Sanitized, paint-only inline-box appearance. */
|
|
670
|
+
export type ResolvedInlineBoxAppearance = {
|
|
671
|
+
backgroundColor?: string;
|
|
672
|
+
borderColor?: string;
|
|
673
|
+
borderStyle?: 'solid' | 'dashed' | 'dotted';
|
|
674
|
+
borderRadius?: number;
|
|
675
|
+
color?: string;
|
|
676
|
+
};
|
|
677
|
+
/** Paint-ready inline-box style emitted on measured line slices. */
|
|
678
|
+
export type ResolvedInlineBoxStyle = ResolvedInlineBoxLayout & ResolvedInlineBoxAppearance;
|
|
679
|
+
/**
|
|
680
|
+
* An internal, layout-aware presentation over a paragraph-visible text range.
|
|
681
|
+
*
|
|
682
|
+
* The proof uses leaf styling (D1): measurement creates box-edge segment
|
|
683
|
+
* boundaries and the painter styles the canonical text leaves. The fallback
|
|
684
|
+
* sibling layer was not needed. Extension-authored boxes reach this internal
|
|
685
|
+
* layout contract through the v2 host bridge. RTL input is ignored (D12), and
|
|
686
|
+
* the synchronous paragraph remeasurer does not consume this field (D14).
|
|
687
|
+
*/
|
|
688
|
+
export type InlineBoxSpan = {
|
|
689
|
+
id: string;
|
|
690
|
+
/**
|
|
691
|
+
* UTF-16 offsets over the paragraph's flattened visible text. Every
|
|
692
|
+
* non-text run contributes one placeholder character. These offsets never
|
|
693
|
+
* alter run PM ranges, run indices, source anchors, or document identity.
|
|
694
|
+
*/
|
|
695
|
+
from: number;
|
|
696
|
+
to: number;
|
|
697
|
+
layout: ResolvedInlineBoxLayout;
|
|
698
|
+
appearance: ResolvedInlineBoxAppearance;
|
|
699
|
+
className?: string;
|
|
700
|
+
data?: Record<string, string>;
|
|
701
|
+
cursor?: 'default' | 'pointer' | 'text' | 'help';
|
|
702
|
+
};
|
|
658
703
|
export type ParagraphBlock = {
|
|
659
704
|
kind: 'paragraph';
|
|
660
705
|
id: BlockId;
|
|
661
706
|
runs: Run[];
|
|
662
707
|
attrs?: ParagraphAttrs;
|
|
663
708
|
sourceAnchor?: SourceAnchor;
|
|
709
|
+
/** @internal Layout-aware presentation projected from the extension API by the v2 host. */
|
|
710
|
+
inlineBoxes?: InlineBoxSpan[];
|
|
664
711
|
};
|
|
665
712
|
/** Border style (subset of OOXML ST_Border). */
|
|
666
713
|
export type BorderStyle = 'none' | 'single' | 'double' | 'dashed' | 'dotted' | 'thick' | 'triple' | 'dotDash' | 'dotDotDash' | 'wave' | 'doubleWave';
|
|
@@ -671,6 +718,12 @@ export type BorderSpec = {
|
|
|
671
718
|
color?: string;
|
|
672
719
|
space?: number;
|
|
673
720
|
};
|
|
721
|
+
/**
|
|
722
|
+
* Returns the complete painted width of an OOXML table border in CSS pixels.
|
|
723
|
+
* `w:sz` is the width of the complete border, including compound styles such
|
|
724
|
+
* as double. `thick` retains the existing table-painter minimum used in V2.
|
|
725
|
+
*/
|
|
726
|
+
export declare const getRenderedTableBorderWidthPx: (border: Pick<BorderSpec, "style" | "width"> | undefined, defaultWidth?: number) => number;
|
|
674
727
|
/**
|
|
675
728
|
* Three-state border value for table borders.
|
|
676
729
|
* - `null`: inherit from table style
|
|
@@ -696,6 +749,16 @@ export type CellBorders = {
|
|
|
696
749
|
bottom?: BorderSpec;
|
|
697
750
|
left?: BorderSpec;
|
|
698
751
|
};
|
|
752
|
+
/** True when a normalized border contributes a visible edge. */
|
|
753
|
+
export declare const isPresentBorder: (border?: BorderSpec) => border is BorderSpec;
|
|
754
|
+
/** True when the source explicitly suppresses an edge rather than omitting it. */
|
|
755
|
+
export declare const isExplicitNoneBorder: (border?: unknown) => boolean;
|
|
756
|
+
/**
|
|
757
|
+
* Resolve the single visible edge shared by two cells according to
|
|
758
|
+
* ECMA-376 Part 1 §17.4.66. Kept in the editor-neutral contract package so
|
|
759
|
+
* import and DOM paint use one conflict algorithm.
|
|
760
|
+
*/
|
|
761
|
+
export declare const resolveBorderConflict: (first?: BorderSpec, second?: BorderSpec) => BorderSpec | undefined;
|
|
699
762
|
export type TableCellAttrs = {
|
|
700
763
|
borders?: CellBorders;
|
|
701
764
|
padding?: BoxSpacing;
|
|
@@ -928,6 +991,13 @@ export type TextFormatting = {
|
|
|
928
991
|
export type TextPart = {
|
|
929
992
|
text: string;
|
|
930
993
|
formatting?: TextFormatting;
|
|
994
|
+
/**
|
|
995
|
+
* Paragraph properties carried by the first visible part of a shape-text
|
|
996
|
+
* paragraph. Shape text is intentionally flattened into `parts`, so this
|
|
997
|
+
* marker preserves the authored block geometry without introducing a second
|
|
998
|
+
* competing text model.
|
|
999
|
+
*/
|
|
1000
|
+
paragraphProperties?: ShapeTextParagraphProperties;
|
|
931
1001
|
/** Optional field token (e.g., PAGE/NUMPAGES/SECTIONPAGES) resolved at render time. */
|
|
932
1002
|
fieldType?: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES';
|
|
933
1003
|
/** PAGE/SECTIONPAGES field-local value formatting override. */
|
|
@@ -953,6 +1023,17 @@ export type TextPart = {
|
|
|
953
1023
|
height?: number;
|
|
954
1024
|
alt?: string;
|
|
955
1025
|
};
|
|
1026
|
+
/** Paragraph geometry used by flattened DrawingML/VML shape text. */
|
|
1027
|
+
export type ShapeTextParagraphProperties = {
|
|
1028
|
+
horizontalAlign?: 'left' | 'center' | 'right' | 'justify';
|
|
1029
|
+
spacingBefore?: number;
|
|
1030
|
+
spacingAfter?: number;
|
|
1031
|
+
line?: number;
|
|
1032
|
+
lineUnit?: 'px' | 'multiplier';
|
|
1033
|
+
leftIndent?: number;
|
|
1034
|
+
rightIndent?: number;
|
|
1035
|
+
firstLineIndent?: number;
|
|
1036
|
+
};
|
|
956
1037
|
/** Text content configuration for shapes. */
|
|
957
1038
|
export type ShapeTextContent = {
|
|
958
1039
|
/** Array of text parts with individual formatting. */
|
|
@@ -979,10 +1060,18 @@ export type VectorShapeStyle = {
|
|
|
979
1060
|
fillColor?: FillColor;
|
|
980
1061
|
strokeColor?: StrokeColor;
|
|
981
1062
|
strokeWidth?: number;
|
|
1063
|
+
/** Physical CSS-pixel dash/gap lengths resolved from the source stroke. */
|
|
1064
|
+
strokeDashArray?: number[];
|
|
1065
|
+
strokeLineJoin?: 'round' | 'bevel' | 'miter';
|
|
1066
|
+
strokeLineCap?: 'round' | 'square' | 'butt';
|
|
1067
|
+
/** Optional per-edge frame used by render-only table cells inside legacy shape groups. */
|
|
1068
|
+
borders?: CellBorders;
|
|
982
1069
|
lineEnds?: LineEnds;
|
|
983
1070
|
textContent?: ShapeTextContent;
|
|
984
1071
|
textAlign?: string;
|
|
985
1072
|
textVerticalAlign?: 'top' | 'center' | 'bottom';
|
|
1073
|
+
/** Legacy VML textbox text-flow semantics. */
|
|
1074
|
+
textFlow?: 'horizontal' | 'vertical' | 'vertical-ideographic' | 'horizontal-ideographic' | 'bottom-to-top';
|
|
986
1075
|
textInsets?: {
|
|
987
1076
|
top: number;
|
|
988
1077
|
right: number;
|
|
@@ -1063,11 +1152,15 @@ export type VectorShapeDrawing = DrawingBlockBase & {
|
|
|
1063
1152
|
fillColor?: FillColor;
|
|
1064
1153
|
strokeColor?: StrokeColor;
|
|
1065
1154
|
strokeWidth?: number;
|
|
1155
|
+
strokeDashArray?: number[];
|
|
1156
|
+
strokeLineJoin?: 'round' | 'bevel' | 'miter';
|
|
1157
|
+
strokeLineCap?: 'round' | 'square' | 'butt';
|
|
1066
1158
|
lineEnds?: LineEnds;
|
|
1067
1159
|
effectExtent?: EffectExtent;
|
|
1068
1160
|
textContent?: ShapeTextContent;
|
|
1069
1161
|
textAlign?: string;
|
|
1070
1162
|
textVerticalAlign?: 'top' | 'center' | 'bottom';
|
|
1163
|
+
textFlow?: 'horizontal' | 'vertical' | 'vertical-ideographic' | 'horizontal-ideographic' | 'bottom-to-top';
|
|
1071
1164
|
textInsets?: {
|
|
1072
1165
|
top: number;
|
|
1073
1166
|
right: number;
|
|
@@ -1078,26 +1171,42 @@ export type VectorShapeDrawing = DrawingBlockBase & {
|
|
|
1078
1171
|
export type TextboxDrawing = DrawingBlockBase & {
|
|
1079
1172
|
drawingKind: 'textboxShape';
|
|
1080
1173
|
geometry: DrawingGeometry;
|
|
1174
|
+
/** `a:spAutoFit`: resize the shape height to its measured text content. */
|
|
1175
|
+
autoFit?: boolean;
|
|
1081
1176
|
shapeKind?: string;
|
|
1082
1177
|
customGeometry?: CustomGeometryData;
|
|
1083
1178
|
fillColor?: FillColor;
|
|
1084
1179
|
strokeColor?: StrokeColor;
|
|
1085
1180
|
strokeWidth?: number;
|
|
1181
|
+
strokeDashArray?: number[];
|
|
1182
|
+
strokeLineJoin?: 'round' | 'bevel' | 'miter';
|
|
1183
|
+
strokeLineCap?: 'round' | 'square' | 'butt';
|
|
1086
1184
|
lineEnds?: LineEnds;
|
|
1087
1185
|
effectExtent?: EffectExtent;
|
|
1088
1186
|
textContent?: ShapeTextContent;
|
|
1089
1187
|
textAlign?: string;
|
|
1090
1188
|
textVerticalAlign?: 'top' | 'center' | 'bottom';
|
|
1189
|
+
textFlow?: 'horizontal' | 'vertical' | 'vertical-ideographic' | 'horizontal-ideographic' | 'bottom-to-top';
|
|
1091
1190
|
textInsets?: {
|
|
1092
1191
|
top: number;
|
|
1093
1192
|
right: number;
|
|
1094
1193
|
bottom: number;
|
|
1095
1194
|
left: number;
|
|
1096
1195
|
};
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1196
|
+
/**
|
|
1197
|
+
* Canonical block content owned by the textbox story.
|
|
1198
|
+
*
|
|
1199
|
+
* ECMA-376 permits general block-level WordprocessingML in `w:txbxContent`.
|
|
1200
|
+
* V2 currently supports paragraphs and tables explicitly; keeping this as a
|
|
1201
|
+
* named subset makes later block-family additions additive instead of
|
|
1202
|
+
* flattening rich content into drawing primitives.
|
|
1203
|
+
*/
|
|
1204
|
+
contentBlocks: TextboxContentBlock[];
|
|
1205
|
+
/** Canonical layout results for textbox content; populated by measurement or the layout bridge. */
|
|
1206
|
+
contentMeasures?: TextboxContentMeasure[];
|
|
1100
1207
|
};
|
|
1208
|
+
export type TextboxContentBlock = ParagraphBlock | TableBlock;
|
|
1209
|
+
export type TextboxContentMeasure = ParagraphMeasure | TableMeasure;
|
|
1101
1210
|
export type ShapeGroupDrawing = DrawingBlockBase & {
|
|
1102
1211
|
drawingKind: 'shapeGroup';
|
|
1103
1212
|
geometry: DrawingGeometry;
|
|
@@ -1169,6 +1278,13 @@ export type SectionBreakBlock = {
|
|
|
1169
1278
|
kind: 'sectionBreak';
|
|
1170
1279
|
id: BlockId;
|
|
1171
1280
|
type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
|
|
1281
|
+
/**
|
|
1282
|
+
* Physical page parity required for a `nextPage` break. Word derives this
|
|
1283
|
+
* when distinct odd/even headers are enabled and the new section explicitly
|
|
1284
|
+
* restarts page numbering; authored `evenPage`/`oddPage` breaks express the
|
|
1285
|
+
* same constraint through `type` instead.
|
|
1286
|
+
*/
|
|
1287
|
+
requiredPageParity?: 'even' | 'odd';
|
|
1172
1288
|
pageSize?: {
|
|
1173
1289
|
w: number;
|
|
1174
1290
|
h: number;
|
|
@@ -1266,10 +1382,21 @@ export type ColumnBreakBlock = {
|
|
|
1266
1382
|
/** Positioning for anchored images (offsets in CSS px). */
|
|
1267
1383
|
export type ImageAnchor = {
|
|
1268
1384
|
isAnchored?: boolean;
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1385
|
+
/**
|
|
1386
|
+
* Page-space coordinates from `wp:simplePos` in CSS px.
|
|
1387
|
+
* ECMA-376 Part 1 §20.4.2.13: when present because `wp:anchor/@simplePos`
|
|
1388
|
+
* is true, these coordinates override positionH/positionV.
|
|
1389
|
+
*/
|
|
1390
|
+
simplePos?: {
|
|
1391
|
+
x: number;
|
|
1392
|
+
y: number;
|
|
1393
|
+
};
|
|
1394
|
+
/** Keep the anchored object inside its table cell and resize the cell as needed. */
|
|
1395
|
+
layoutInCell?: boolean;
|
|
1396
|
+
hRelativeFrom?: AnchorHRelative;
|
|
1397
|
+
vRelativeFrom?: AnchorVRelative;
|
|
1398
|
+
alignH?: AnchorAlignH;
|
|
1399
|
+
alignV?: AnchorAlignV;
|
|
1273
1400
|
offsetH?: number;
|
|
1274
1401
|
offsetV?: number;
|
|
1275
1402
|
behindDoc?: boolean;
|
|
@@ -1285,6 +1412,7 @@ export type ImageAnchor = {
|
|
|
1285
1412
|
*/
|
|
1286
1413
|
export declare function isPageRelativeAnchor(input: {
|
|
1287
1414
|
anchor?: {
|
|
1415
|
+
simplePos?: unknown;
|
|
1288
1416
|
vRelativeFrom?: unknown;
|
|
1289
1417
|
} | null;
|
|
1290
1418
|
} | null | undefined): boolean;
|
|
@@ -1372,7 +1500,7 @@ export type ExclusionZone = {
|
|
|
1372
1500
|
left: number;
|
|
1373
1501
|
right: number;
|
|
1374
1502
|
};
|
|
1375
|
-
wrapMode: 'left' | 'right' | 'both' | 'none' | 'largest';
|
|
1503
|
+
wrapMode: 'left' | 'right' | 'both' | 'none' | 'largest' | 'topBottom';
|
|
1376
1504
|
polygon?: number[][];
|
|
1377
1505
|
};
|
|
1378
1506
|
export type ParagraphSpacing = {
|
|
@@ -1645,6 +1773,8 @@ export type ParagraphAttrs = {
|
|
|
1645
1773
|
tabIntervalTwips?: number;
|
|
1646
1774
|
keepNext?: boolean;
|
|
1647
1775
|
keepLines?: boolean;
|
|
1776
|
+
/** Prevent a single first or last paragraph line from appearing alone on a page. Defaults to true. */
|
|
1777
|
+
widowControl?: boolean;
|
|
1648
1778
|
pageBreakBefore?: boolean;
|
|
1649
1779
|
trackedChangesMode?: TrackedChangesMode;
|
|
1650
1780
|
trackedChangesEnabled?: boolean;
|
|
@@ -1761,6 +1891,13 @@ export declare const isForcedSectPrSectionBreak: (block: FlowBlock | undefined)
|
|
|
1761
1891
|
* accepted only when their source/anchor proves they belong to the same filler
|
|
1762
1892
|
* run.
|
|
1763
1893
|
*/
|
|
1894
|
+
export type SectionBoundaryFillerScanCheckpoint = {
|
|
1895
|
+
index: number;
|
|
1896
|
+
total: number;
|
|
1897
|
+
};
|
|
1898
|
+
export declare function collectSectionBoundaryFillerBlockIdsSteps(blocks: readonly FlowBlock[], options?: {
|
|
1899
|
+
isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
|
|
1900
|
+
}, checkpointEveryBlocks?: number | null): Generator<SectionBoundaryFillerScanCheckpoint, ReadonlySet<string>, void>;
|
|
1764
1901
|
export declare const collectSectionBoundaryFillerBlockIds: (blocks: readonly FlowBlock[], options?: {
|
|
1765
1902
|
isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
|
|
1766
1903
|
}) => ReadonlySet<string>;
|
|
@@ -1813,6 +1950,28 @@ export type LineInlineImageAlignment = {
|
|
|
1813
1950
|
runIndex: number;
|
|
1814
1951
|
verticalAlign: ImageRunVerticalAlign;
|
|
1815
1952
|
};
|
|
1953
|
+
/**
|
|
1954
|
+
* Paint-ready geometry for one inline-box slice on a measured line.
|
|
1955
|
+
*
|
|
1956
|
+
* Measurement owns the slice geometry and resolved style. The painter consumes
|
|
1957
|
+
* these values directly and never normalizes logical sides or measures the DOM.
|
|
1958
|
+
*/
|
|
1959
|
+
export type LineInlineBox = {
|
|
1960
|
+
id: string;
|
|
1961
|
+
/** Line-relative UTF-16 offsets covered by this slice. */
|
|
1962
|
+
from: number;
|
|
1963
|
+
to: number;
|
|
1964
|
+
x: number;
|
|
1965
|
+
width: number;
|
|
1966
|
+
top: number;
|
|
1967
|
+
height: number;
|
|
1968
|
+
startsRange: boolean;
|
|
1969
|
+
endsRange: boolean;
|
|
1970
|
+
style: ResolvedInlineBoxStyle;
|
|
1971
|
+
className?: string;
|
|
1972
|
+
data?: Record<string, string>;
|
|
1973
|
+
cursor?: 'default' | 'pointer' | 'text' | 'help';
|
|
1974
|
+
};
|
|
1816
1975
|
export type Line = {
|
|
1817
1976
|
fromRun: number;
|
|
1818
1977
|
fromChar: number;
|
|
@@ -1843,6 +2002,8 @@ export type Line = {
|
|
|
1843
2002
|
* wins over the entry here.
|
|
1844
2003
|
*/
|
|
1845
2004
|
inlineImageAlignments?: LineInlineImageAlignment[];
|
|
2005
|
+
/** Paint-ready inline-box slices emitted by measurement. */
|
|
2006
|
+
inlineBoxes?: LineInlineBox[];
|
|
1846
2007
|
/**
|
|
1847
2008
|
* Measured tab widths keyed by tab run `pmStart`, stored alongside the
|
|
1848
2009
|
* `ParagraphMeasure` so the painter can read them even after FlowBlock
|
|
@@ -1851,6 +2012,18 @@ export type Line = {
|
|
|
1851
2012
|
*/
|
|
1852
2013
|
tabWidths?: Record<number, number>;
|
|
1853
2014
|
};
|
|
2015
|
+
/**
|
|
2016
|
+
* One contiguous horizontal region available to a measured paragraph line.
|
|
2017
|
+
*
|
|
2018
|
+
* Coordinates are relative to the paragraph fragment's content origin. A line
|
|
2019
|
+
* can expose multiple regions when text wraps on both sides of a floating
|
|
2020
|
+
* object. Measuring owns the line breaks inside these regions; layout owns
|
|
2021
|
+
* deriving the regions from page/column float geometry.
|
|
2022
|
+
*/
|
|
2023
|
+
export type ParagraphLineRegion = {
|
|
2024
|
+
offsetX: number;
|
|
2025
|
+
width: number;
|
|
2026
|
+
};
|
|
1854
2027
|
export type LineSegment = {
|
|
1855
2028
|
runIndex: number;
|
|
1856
2029
|
fromChar: number;
|
|
@@ -1951,8 +2124,8 @@ export type DrawingMeasure = {
|
|
|
1951
2124
|
naturalHeight: number;
|
|
1952
2125
|
geometry: DrawingGeometry;
|
|
1953
2126
|
groupTransform?: ShapeGroupTransform;
|
|
1954
|
-
/** Canonical
|
|
1955
|
-
contentMeasures?:
|
|
2127
|
+
/** Canonical block measurements for textbox content, when the drawing owns a textbox story. */
|
|
2128
|
+
contentMeasures?: TextboxContentMeasure[];
|
|
1956
2129
|
};
|
|
1957
2130
|
export type TableCellMeasure = {
|
|
1958
2131
|
/** Multi-block cell measurements (new feature) */
|
|
@@ -2081,6 +2254,13 @@ export type FootnotePageLedger = {
|
|
|
2081
2254
|
export type Page = {
|
|
2082
2255
|
number: number;
|
|
2083
2256
|
fragments: Fragment[];
|
|
2257
|
+
/**
|
|
2258
|
+
* Suppress header/footer stories on a physically inserted parity page.
|
|
2259
|
+
* Word emits these pages to satisfy odd/even section starts, but leaves the
|
|
2260
|
+
* page itself completely blank and does not treat it as page one of the new
|
|
2261
|
+
* section.
|
|
2262
|
+
*/
|
|
2263
|
+
suppressHeaderFooter?: boolean;
|
|
2084
2264
|
margins?: PageMargins;
|
|
2085
2265
|
/**
|
|
2086
2266
|
* Extra bottom space reserved on this page for footnotes (in px).
|
|
@@ -2314,7 +2494,7 @@ export type DrawingFragment = {
|
|
|
2314
2494
|
drawingContentId?: string;
|
|
2315
2495
|
/** V2 textbox story id for DrawingML textbox content painted inside this drawing. */
|
|
2316
2496
|
textboxId?: string;
|
|
2317
|
-
contentMeasures?:
|
|
2497
|
+
contentMeasures?: TextboxContentMeasure[];
|
|
2318
2498
|
pmStart?: number;
|
|
2319
2499
|
pmEnd?: number;
|
|
2320
2500
|
sourceAnchor?: SourceAnchor;
|
|
@@ -2345,6 +2525,18 @@ export type HeaderFooterType = 'default' | 'first' | 'even' | 'odd';
|
|
|
2345
2525
|
export type HeaderFooterPage = {
|
|
2346
2526
|
number: number;
|
|
2347
2527
|
fragments: Fragment[];
|
|
2528
|
+
/**
|
|
2529
|
+
* Measurement height for this page's resolved story content. PAGE/NUMPAGES
|
|
2530
|
+
* fields can wrap differently across physical pages, so paint alignment must
|
|
2531
|
+
* not substitute the layout-wide maximum for this value.
|
|
2532
|
+
*/
|
|
2533
|
+
measurementHeight?: number;
|
|
2534
|
+
/** Per-page minimum rendered y, including out-of-band decorations. */
|
|
2535
|
+
minY?: number;
|
|
2536
|
+
/** Per-page maximum rendered y + fragment height. */
|
|
2537
|
+
maxY?: number;
|
|
2538
|
+
/** Per-page visual extent (`maxY - minY`). */
|
|
2539
|
+
renderHeight?: number;
|
|
2348
2540
|
numberText?: string;
|
|
2349
2541
|
/** Section-aware numeric page value before formatting. */
|
|
2350
2542
|
displayNumber?: number;
|
|
@@ -2455,5 +2647,7 @@ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) =>
|
|
|
2455
2647
|
export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
|
|
2456
2648
|
export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
|
|
2457
2649
|
export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
|
|
2458
|
-
export {
|
|
2650
|
+
export { INLINE_OBJECT_REPLACEMENT_CHARACTER, flattenParagraphVisibleText, mapVisibleRangeToRunSlices, type ParagraphVisibleRunSlice, } from './paragraph-visible-text.js';
|
|
2651
|
+
export { inlineBoxStyleSignature, isFiniteNonNegativeInteger, normalizeInlineBoxLogicalSides, type InlineBoxLogicalSides, type ResolvedInlineBoxLogicalSides, } from './inline-box.js';
|
|
2652
|
+
export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type NonFlowingPageRelativeAnchorDependencyProof, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
|
|
2459
2653
|
export * as Engines from './engines/index.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResolvedInlineBoxStyle } from './index.js';
|
|
2
|
+
export type InlineBoxLogicalSides = number | {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
};
|
|
6
|
+
export type ResolvedInlineBoxLogicalSides = {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
/** True for finite, non-negative integer CSS pixel values. */
|
|
11
|
+
export declare const isFiniteNonNegativeInteger: (value: unknown) => value is number;
|
|
12
|
+
/**
|
|
13
|
+
* Expands a scalar logical value into explicit start/end values.
|
|
14
|
+
*
|
|
15
|
+
* Undefined resolves to zero. Invalid or non-integer input fails closed.
|
|
16
|
+
*/
|
|
17
|
+
export declare const normalizeInlineBoxLogicalSides: (value: InlineBoxLogicalSides | undefined) => ResolvedInlineBoxLogicalSides | null;
|
|
18
|
+
/** Stable signature for every metric and appearance value consumed by paint. */
|
|
19
|
+
export declare const inlineBoxStyleSignature: (style: ResolvedInlineBoxStyle) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ParagraphBlock } from './index.js';
|
|
2
|
+
export declare const INLINE_OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
|
|
3
|
+
export type ParagraphVisibleRunSlice = {
|
|
4
|
+
runIndex: number;
|
|
5
|
+
fromChar: number;
|
|
6
|
+
toChar: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Flattens a paragraph into Document API visible-text coordinates.
|
|
10
|
+
*
|
|
11
|
+
* Text is preserved verbatim in UTF-16. Every non-text run contributes one
|
|
12
|
+
* U+FFFC object-replacement character, regardless of its rendered label.
|
|
13
|
+
*/
|
|
14
|
+
export declare const flattenParagraphVisibleText: (block: ParagraphBlock) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Maps a validated visible-text range to slices in the paragraph's run space.
|
|
17
|
+
* Returns null for non-integer, reversed, negative, or out-of-bounds ranges.
|
|
18
|
+
*/
|
|
19
|
+
export declare const mapVisibleRangeToRunSlices: (block: ParagraphBlock, from: number, to: number) => ParagraphVisibleRunSlice[] | null;
|
|
@@ -476,6 +476,11 @@ export declare function isResolvedDrawingItem(item: ResolvedPaintItem): item is
|
|
|
476
476
|
/** A resolved header/footer page — mirrors HeaderFooterPage but with resolved items. */
|
|
477
477
|
export type ResolvedHeaderFooterPage = {
|
|
478
478
|
number: number;
|
|
479
|
+
/** Page-local measurement height; see `HeaderFooterPage.measurementHeight`. */
|
|
480
|
+
measurementHeight?: number;
|
|
481
|
+
minY?: number;
|
|
482
|
+
maxY?: number;
|
|
483
|
+
renderHeight?: number;
|
|
479
484
|
numberText?: string;
|
|
480
485
|
/** Section-aware numeric page value before formatting. */
|
|
481
486
|
displayNumber?: number;
|
|
@@ -12,6 +12,8 @@ export declare const DOM_CLASS_NAMES: {
|
|
|
12
12
|
readonly PAGE: "superdoc-page";
|
|
13
13
|
/** Fragment container (paragraph, table, image block, etc.). */
|
|
14
14
|
readonly FRAGMENT: "superdoc-fragment";
|
|
15
|
+
/** Non-flowing fragment whose visual position must not define body flow geometry. */
|
|
16
|
+
readonly FLOATING_FRAGMENT: "superdoc-floating-fragment";
|
|
15
17
|
/** Line container within a fragment. */
|
|
16
18
|
readonly LINE: "superdoc-line";
|
|
17
19
|
/**
|
|
@@ -42,7 +42,7 @@ export type FootnoteWindowScoreResult = {
|
|
|
42
42
|
};
|
|
43
43
|
export declare const isMandatoryOnlyFootnotePage: (ledger: FootnotePageLedger, preferredDeltaThresholdPx?: number, mandatoryOnlyTolerancePx?: number) => boolean;
|
|
44
44
|
/**
|
|
45
|
-
* SD-2656
|
|
45
|
+
* SD-2656: a page whose LAST anchor partially rendered
|
|
46
46
|
* but spilled to a later page. The user-visible bug is a footnote split across
|
|
47
47
|
* pages even when the preferred reserve would fit the whole anchor on the
|
|
48
48
|
* anchor page (Word does keep it together).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FlowBlock, ParagraphBlock, ParagraphMeasure } from '../../contracts/src/index.js';
|
|
2
|
+
type TextboxRemeasure = (block: ParagraphBlock, maxWidth: number) => ParagraphMeasure;
|
|
3
|
+
/**
|
|
4
|
+
* Derives table-cell textbox measurements without mutating the projection
|
|
5
|
+
* plane supplied by the caller. Only the textbox and its table ancestry are
|
|
6
|
+
* copied; documents without table textboxes retain their original identities.
|
|
7
|
+
*/
|
|
8
|
+
export declare function hydrateTableTextboxMeasures(blocks: FlowBlock[], remeasure: TextboxRemeasure): FlowBlock[];
|
|
9
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PageCheckpointDependencyClass, FlowBlock, Layout, Measure, HeaderFooterLayout,
|
|
1
|
+
import { NonFlowingPageRelativeAnchorDependencyProof, PageCheckpointDependencyClass, FlowBlock, Layout, Measure, HeaderFooterLayout, ColumnLayout } from '../../contracts/src/index.js';
|
|
2
2
|
import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
|
|
3
|
-
import { LayoutOptions, HeaderFooterConstraints } from '../../layout-engine/src/index.js';
|
|
3
|
+
import { LayoutOptions, HeaderFooterConstraints, LayoutExecutionCheckpoint } from '../../layout-engine/src/index.js';
|
|
4
4
|
import { computeDirtyRegions } from './diff.js';
|
|
5
5
|
import { MeasureCache } from './cache.js';
|
|
6
6
|
import { HeaderFooterBatch } from './layoutHeaderFooter.js';
|
|
@@ -52,6 +52,8 @@ export type FootnoteReserveSeed = {
|
|
|
52
52
|
};
|
|
53
53
|
export type IncrementalLayoutResult = {
|
|
54
54
|
layout: Layout;
|
|
55
|
+
/** Pass-owned block plane after derived layout annotations are attached. */
|
|
56
|
+
blocks: FlowBlock[];
|
|
55
57
|
measures: Measure[];
|
|
56
58
|
dirty: ReturnType<typeof computeDirtyRegions>;
|
|
57
59
|
headers?: HeaderFooterLayoutResult[];
|
|
@@ -68,9 +70,11 @@ export type IncrementalLayoutResult = {
|
|
|
68
70
|
* out no footnotes) — the next run then starts cold.
|
|
69
71
|
*/
|
|
70
72
|
footnoteReserveSeed?: FootnoteReserveSeed | null;
|
|
73
|
+
/** Canonical pre-layout furniture heights that can affect body margins. */
|
|
74
|
+
headerFooterGeometryFingerprint: string;
|
|
71
75
|
layoutReuse?: IncrementalLayoutReuseSummary;
|
|
72
76
|
measureReuse?: {
|
|
73
|
-
mode: 'full-scan' | 'proved-dirty-only';
|
|
77
|
+
mode: 'full-scan' | 'proved-dirty-only' | 'body-stable';
|
|
74
78
|
blocksMeasured: number;
|
|
75
79
|
measuresAdopted: number;
|
|
76
80
|
reason: string;
|
|
@@ -117,6 +121,16 @@ export type IncrementalLayoutBridgeTiming = {
|
|
|
117
121
|
measuresAdopted: number;
|
|
118
122
|
pagesPaginated: number | null;
|
|
119
123
|
pagesSplicedByReuse: number;
|
|
124
|
+
paginationPasses: number;
|
|
125
|
+
pageTokenRelayouts: number;
|
|
126
|
+
footnoteRelayouts: number;
|
|
127
|
+
footnoteReserveRelayouts: number;
|
|
128
|
+
footnoteGrowRelayouts: number;
|
|
129
|
+
footnoteTightenRelayouts: number;
|
|
130
|
+
footnotePreferredRelayouts: number;
|
|
131
|
+
footnoteWidowRelayouts: number;
|
|
132
|
+
footnoteRevertRelayouts: number;
|
|
133
|
+
footnoteOtherRelayouts: number;
|
|
120
134
|
};
|
|
121
135
|
};
|
|
122
136
|
/**
|
|
@@ -168,6 +182,13 @@ export type IncrementalSectionPageNumberTransform = {
|
|
|
168
182
|
/** Difference between target and source section-relative page positions. */
|
|
169
183
|
delta: number;
|
|
170
184
|
};
|
|
185
|
+
export type IncrementalDisplayPageNumberTransform = {
|
|
186
|
+
/** First section whose retained display-page values inherit the local page delta. */
|
|
187
|
+
startSectionIndex: number;
|
|
188
|
+
/** First later section with an explicit numbering restart. */
|
|
189
|
+
endSectionIndexExclusive: number;
|
|
190
|
+
delta: number;
|
|
191
|
+
};
|
|
171
192
|
export type IncrementalLayoutTailAdoption = {
|
|
172
193
|
startPageIndex: number;
|
|
173
194
|
endPageIndexExclusive: number;
|
|
@@ -175,6 +196,9 @@ export type IncrementalLayoutTailAdoption = {
|
|
|
175
196
|
sourcePageEndIndexExclusive: number;
|
|
176
197
|
pageIndexDelta: number;
|
|
177
198
|
sectionPageNumberTransform: IncrementalSectionPageNumberTransform | null;
|
|
199
|
+
displayPageNumberTransform?: IncrementalDisplayPageNumberTransform | null;
|
|
200
|
+
/** Exact proof that PAGEREF page/numbering locations are unchanged in the adopted tail. */
|
|
201
|
+
pageReferenceLocationsStable: boolean;
|
|
178
202
|
sourceLayoutEpoch: number | null;
|
|
179
203
|
positionTransforms: readonly LayoutPositionTransform[];
|
|
180
204
|
/** Lazy old->current block-id rekeys for an ordinal-changing structural splice. */
|
|
@@ -207,6 +231,7 @@ export type IncrementalPaginationProof = IncrementalPaginationProofBase & ({
|
|
|
207
231
|
globalDependenciesAbsent: false;
|
|
208
232
|
globalDependenciesFencedByPageCheckpoint: true;
|
|
209
233
|
admittedDependencyClasses: readonly PageCheckpointDependencyClass[];
|
|
234
|
+
nonFlowingPageRelativeAnchorDependency?: NonFlowingPageRelativeAnchorDependencyProof;
|
|
210
235
|
localKeepDependencyClosure?: {
|
|
211
236
|
checkpointPageIndex: number;
|
|
212
237
|
checkpointBlockId: string | null;
|
|
@@ -265,6 +290,15 @@ export type IncrementalLayoutReuseOptions = {
|
|
|
265
290
|
noteIds: readonly string[];
|
|
266
291
|
bodyReferenceBlockIds: readonly string[];
|
|
267
292
|
};
|
|
293
|
+
/**
|
|
294
|
+
* Host-proved header/footer-only refresh. The bridge still compares the
|
|
295
|
+
* current pre-layout height fingerprint before retaining body pagination.
|
|
296
|
+
*/
|
|
297
|
+
provedHeaderFooterOnlyRefresh?: {
|
|
298
|
+
bodyProjectionRetainedExact: true;
|
|
299
|
+
bodyLayoutInputsUnchanged: true;
|
|
300
|
+
previousGeometryFingerprint: string;
|
|
301
|
+
};
|
|
268
302
|
};
|
|
269
303
|
export declare const measureCache: MeasureCache<Measure>;
|
|
270
304
|
/**
|
|
@@ -276,10 +310,13 @@ export declare const measureCache: MeasureCache<Measure>;
|
|
|
276
310
|
*/
|
|
277
311
|
export declare function clearIncrementalModuleState(): void;
|
|
278
312
|
export interface IncrementalLayoutExecutionControl {
|
|
313
|
+
signal?: AbortSignal;
|
|
279
314
|
/** Budget-aware host-task yield; may resolve immediately. */
|
|
280
|
-
yieldToHost?: () => Promise<void>;
|
|
281
|
-
/**
|
|
315
|
+
yieldToHost?: (checkpoint?: LayoutExecutionCheckpoint) => Promise<void>;
|
|
316
|
+
/** Measurement checkpoints default to 32 blocks; nested layout checkpoints default to 16. */
|
|
282
317
|
yieldEveryBlocks?: number;
|
|
318
|
+
/** Time-aware mounted probe. Null is the allocation-free under-budget path. */
|
|
319
|
+
checkpointIfDue?: (checkpoint?: LayoutExecutionCheckpoint) => Promise<void> | null;
|
|
283
320
|
}
|
|
284
321
|
export declare function incrementalLayout(previousBlocks: FlowBlock[], _previousLayout: Layout | null, nextBlocks: FlowBlock[], options: LayoutOptions, measureBlock: (block: FlowBlock, constraints: {
|
|
285
322
|
maxWidth: number;
|
|
@@ -325,12 +362,6 @@ export declare function incrementalLayout(previousBlocks: FlowBlock[], _previous
|
|
|
325
362
|
* @returns The normalized margin value (guaranteed to be finite)
|
|
326
363
|
*/
|
|
327
364
|
export declare const normalizeMargin: (value: number | undefined, fallback: number) => number;
|
|
328
|
-
/**
|
|
329
|
-
* Walks table blocks (including nested tables) and computes `contentMeasures` for any
|
|
330
|
-
* `textboxShape` drawings found in table cells. Stores results directly on the block so
|
|
331
|
-
* the painter can read them without a `DrawingFragment` (table-cell drawings have none).
|
|
332
|
-
*/
|
|
333
|
-
export declare function hydrateTableTextboxMeasures(blocks: FlowBlock[], remeasure: (block: ParagraphBlock, maxWidth: number) => ParagraphMeasure): void;
|
|
334
365
|
/**
|
|
335
366
|
* Resolves the maximum measurement constraints (width and height) needed for measuring blocks
|
|
336
367
|
* across all sections in a document.
|
|
@@ -11,8 +11,10 @@ export { findWordBoundaries, findParagraphBoundaries } from './text-boundaries.j
|
|
|
11
11
|
export type { BoundaryRange } from './text-boundaries.js';
|
|
12
12
|
export { buildSectionAwareHeaderFooterLayoutKey, buildSectionContentWidth, buildEffectiveHeaderFooterRefsBySection, collectReferencedHeaderFooterRIds, buildSectionAwareHeaderFooterMeasurementGroups, } from './sectionAwareHeaderFooter.js';
|
|
13
13
|
export type { HeaderFooterSectionKind, HeaderFooterRefs, SectionAwareHeaderFooterMeasurementGroup, } from './sectionAwareHeaderFooter.js';
|
|
14
|
-
export { clearIncrementalModuleState, incrementalLayout, measureCache, normalizeMargin
|
|
15
|
-
export
|
|
14
|
+
export { clearIncrementalModuleState, incrementalLayout, measureCache, normalizeMargin } from './incrementalLayout.js';
|
|
15
|
+
export { hydrateTableTextboxMeasures } from './hydrateTableTextboxMeasures.js';
|
|
16
|
+
export { hashMeasureContent } from './cache.js';
|
|
17
|
+
export type { HeaderFooterLayoutResult, IncrementalLayoutBridgeTiming, IncrementalLayoutResult, IncrementalLayoutExecutionControl, IncrementalMeasureReuseProof, IncrementalLayoutReuseOptions, IncrementalLayoutReuseSummary, IncrementalSectionPageNumberTransform, IncrementalLayoutTailAdoption, IncrementalLayoutTailDisposition, IncrementalPaginationProof, LayoutPositionTransform, FootnoteReserveSeed, } from './incrementalLayout.js';
|
|
16
18
|
export { collectFootnoteLedgers, getPreferredReserveCandidates, getPreferredReserveTrialTargets, isMandatoryOnlyFootnotePage, scoreFootnoteWindow, summarizeFootnoteWindow, } from './footnote-scorer.js';
|
|
17
19
|
export type { FootnotePreferredReserveCandidate, FootnoteWindowScoreInput, FootnoteWindowScoreReason, FootnoteWindowScoreResult, FootnoteWindowStats, } from './footnote-scorer.js';
|
|
18
20
|
export { computeDisplayPageNumber } from '../../layout-engine/src/index.js';
|