@docx-editor.dev/core 2.9.1 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.js +1 -1
  3. package/dist/binding.cjs +1 -1
  4. package/dist/binding.d.cts +7 -7
  5. package/dist/binding.d.ts +7 -7
  6. package/dist/binding.js +1 -1
  7. package/dist/chunk-6JWP2H7K.js +2 -0
  8. package/dist/chunk-6KNLLEUW.cjs +18 -0
  9. package/dist/chunk-7ADTI533.cjs +10 -0
  10. package/dist/chunk-7ETDCPF6.cjs +2 -0
  11. package/dist/chunk-7I3BSGGS.js +1 -0
  12. package/dist/{chunk-XMHWBL3K.cjs → chunk-7UU5YFCD.cjs} +1 -1
  13. package/dist/chunk-CKDAK3MV.js +10 -0
  14. package/dist/chunk-DIMEYVNS.js +2 -0
  15. package/dist/{chunk-IEXDXWTA.cjs → chunk-H2656QDI.cjs} +1 -1
  16. package/dist/chunk-KQGENNL5.cjs +15 -0
  17. package/dist/chunk-LIXPSV4T.js +18 -0
  18. package/dist/{chunk-DKMKH77K.cjs → chunk-O4UULRAQ.cjs} +5 -5
  19. package/dist/chunk-SIIFNE6U.js +15 -0
  20. package/dist/chunk-VXYECPKA.js +5 -0
  21. package/dist/contracts/editor.d.cts +6 -6
  22. package/dist/contracts/editor.d.ts +6 -6
  23. package/dist/contracts/interaction.d.cts +6 -6
  24. package/dist/contracts/interaction.d.ts +6 -6
  25. package/dist/contracts/modules.d.cts +3 -3
  26. package/dist/contracts/modules.d.ts +3 -3
  27. package/dist/{custom-node-writes-QyVZdTUA.d.ts → custom-node-writes-D6SGwebL.d.ts} +20 -4
  28. package/dist/{custom-node-writes-7ERv0f_X.d.cts → custom-node-writes-Dy3b20PS.d.cts} +20 -4
  29. package/dist/{editor-PUlv5Pp7.d.ts → editor-Cvd7Geoc.d.ts} +4 -4
  30. package/dist/{editor-CojjwMmF.d.cts → editor-cAEf1uXW.d.cts} +4 -4
  31. package/dist/editor.cjs +1 -1
  32. package/dist/editor.css +9 -5
  33. package/dist/editor.d.cts +18 -18
  34. package/dist/editor.d.ts +18 -18
  35. package/dist/editor.js +1 -1
  36. package/dist/{image-resources-eZqD_-vC.d.ts → image-resources-BgA9EQxY.d.ts} +1 -1
  37. package/dist/{image-resources-DQOiwOuE.d.cts → image-resources-BiA-IXgo.d.cts} +1 -1
  38. package/dist/{index-oN-v8DQ5.d.ts → index-DRqY5JVF.d.ts} +58 -12
  39. package/dist/{index-DGPSeLI0.d.cts → index-wb-iOxfh.d.cts} +58 -12
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.d.cts +12 -12
  42. package/dist/index.d.ts +12 -12
  43. package/dist/index.js +1 -1
  44. package/dist/layout.cjs +1 -1
  45. package/dist/layout.d.cts +334 -306
  46. package/dist/layout.d.ts +334 -306
  47. package/dist/layout.js +1 -1
  48. package/dist/output.cjs +1 -1
  49. package/dist/output.d.cts +5 -5
  50. package/dist/output.d.ts +5 -5
  51. package/dist/output.js +1 -1
  52. package/dist/{review-items-DpsqTHio.d.cts → review-items-B8tffIXj.d.cts} +1 -1
  53. package/dist/{review-items-D5SPFtsO.d.ts → review-items-bdGxFWNA.d.ts} +1 -1
  54. package/dist/{review-reads-CP106AHp.d.cts → review-reads-Bxz03tHG.d.cts} +1 -1
  55. package/dist/{review-reads-B2Ji3fVU.d.ts → review-reads-CHODU0LI.d.ts} +1 -1
  56. package/dist/{semantic-cell-selection-DJPjBWzf.d.cts → semantic-cell-selection-BPzx6DdT.d.cts} +2 -2
  57. package/dist/{semantic-cell-selection-BWhVAk5B.d.ts → semantic-cell-selection-CsHcr-yk.d.ts} +2 -2
  58. package/dist/{semantic-interaction-BjOcDB06.d.cts → semantic-interaction-BfWDD_0V.d.cts} +1 -1
  59. package/dist/{semantic-interaction-Cca1-X_a.d.ts → semantic-interaction-D-RZ9Ust.d.ts} +1 -1
  60. package/dist/{semantic-paint-Ur7pAINj.d.cts → semantic-paint-Bd7EqzXV.d.cts} +2 -2
  61. package/dist/{semantic-paint-CufpIQFw.d.ts → semantic-paint-WhVtSDJK.d.ts} +2 -2
  62. package/dist/{semantic-records-Cc1MJrhM.d.ts → semantic-records-DCt-ZwKU.d.ts} +22 -4
  63. package/dist/{semantic-records-C3Z76KeN.d.cts → semantic-records-DadVT_E1.d.cts} +22 -4
  64. package/dist/{shaped-measurer-CwlTPDJO.d.ts → shaped-measurer-B9f4A7QA.d.ts} +1 -1
  65. package/dist/{shaped-measurer-CYSK20E2.d.cts → shaped-measurer-CninrHr_.d.cts} +1 -1
  66. package/dist/store.cjs +1 -1
  67. package/dist/store.d.cts +131 -131
  68. package/dist/store.d.ts +131 -131
  69. package/dist/store.js +1 -1
  70. package/dist/{tree-op-types-XMVsJSpe.d.ts → tree-op-types-CnRb7AYo.d.ts} +22 -1
  71. package/dist/{tree-op-types-B0-sCtw-.d.cts → tree-op-types-D1vNJ7XC.d.cts} +22 -1
  72. package/dist/{tree-session-D945D43B.d.cts → tree-session-Df02ajqc.d.cts} +5 -5
  73. package/dist/{tree-session-DBJgmdmc.d.ts → tree-session-ZuBFOhIh.d.ts} +5 -5
  74. package/dist/{tree-store-C6vc8E_2.d.cts → tree-store-B_sJBMIS.d.cts} +1 -1
  75. package/dist/{tree-store-ClA-qng4.d.ts → tree-store-DgETo6Mf.d.ts} +1 -1
  76. package/package.json +2 -2
  77. package/dist/chunk-5VC5HGJA.js +0 -2
  78. package/dist/chunk-A2JIBG75.js +0 -1
  79. package/dist/chunk-FWUI7EXG.cjs +0 -15
  80. package/dist/chunk-GZWMLQJO.js +0 -18
  81. package/dist/chunk-IMMAG4QP.cjs +0 -10
  82. package/dist/chunk-JTSNJQFO.js +0 -15
  83. package/dist/chunk-KBCC66CI.js +0 -5
  84. package/dist/chunk-LJ6BY6IU.cjs +0 -18
  85. package/dist/chunk-QDBAXFIK.js +0 -2
  86. package/dist/chunk-RD266XSK.cjs +0 -2
  87. package/dist/chunk-VUJGPCPU.js +0 -10
package/dist/layout.d.cts CHANGED
@@ -1,23 +1,23 @@
1
- import { V as VersionedShapingLibrary, T as TextShaper, F as FontByteValidator, a as FixedPointRoundingMode, b as FixedPoint, c as TextDirection, S as ShapedRun } from './shaped-measurer-CYSK20E2.cjs';
2
- export { C as CacheLookup, d as CacheMiss, e as CacheProvenance, D as DeclaredFontSubstitution, f as FontFingerprintInputs, g as FontRequest, h as FontResolutionError, i as FontResolutionErrorCode, j as FontResourceDefinition, k as FontResourceInstrumentation, l as FontResourceSnapshot, m as FontResourceSnapshotOptions, n as FontSubstitution, o as FontValidationResult, G as GlyphOutline, H as HARD_MAX_AGGREGATE_FONT_BYTES, p as HARD_MAX_FONT_BYTES, q as HARD_MAX_FONT_SOURCES, L as LayoutShapingOptions, N as NormalizationPolicy, O as OperationSnapshot, r as OperationSnapshotField, s as OperationSnapshotGuard, R as ResolvedCache, t as ResolvedFont, u as ResourceDependencyProvenance, v as ShapeInput, w as ShapedCluster, x as ShapedFontSpan, y as ShapedGlyph, z as ShapedMeasurerOptions, A as ShapedRunComparatorInputs, B as ShapedVerticalMetrics, E as ShapingEnvironment, I as ShapingEnvironmentFingerprintInputs, J as ShapingEnvironmentInput, K as boundedStructuralFontValidator, M as captureOperationSnapshot, P as createFontResourceSnapshot, Q as createShapedMeasurer, U as createShapedRun, W as createShapingEnvironment, X as fixedPoint, Y as fontRequestKey, Z as guardOperationSnapshot, _ as shapedRunComparatorInputs, $ as shapingEnvironmentFingerprint, a0 as shapingEnvironmentFingerprintInputs } from './shaped-measurer-CYSK20E2.cjs';
3
- import { d as LayoutBox, D as DrawingPoint, e as DrawingInsets, a as StyleSpanRecord, I as InlineDrawingRecord, M as ModelRange, S as SemanticLayout, B as BlockFragmentRecord, A as AnchoredDrawingRecord, f as PageRecord, R as ResolvedRunStyle, g as ThemeFonts, h as ParagraphSpacing, i as ParagraphLineSpacing, j as ParagraphBorderEdge, k as ParagraphBorders, l as ResolvedTabStops, m as TableBorderSide, C as ContentControlBoundaryRecord$1, n as ContentControlLock, o as ParagraphFragmentRecord, L as LineRecord, p as InlineDrawingLayoutContext, T as TextMeasurer, H as HyperlinkProjector, F as FieldLinkProjector, q as StoryPageFieldNeeds, P as PageGeometry, r as CellBorderBox, s as TableBorderBox } from './semantic-records-C3Z76KeN.cjs';
4
- export { t as AUTO_PARAGRAPH_SPACING_PT, u as BorderGridGeometry, v as ContentControlGeometryFragment, w as ContentControlLevel, x as ContentControlMappedType, y as DEFAULT_PAGE_GEOMETRY, z as DEFAULT_RUN_STYLE, E as DEFAULT_TAB_INTERVAL_PT, G as DEFAULT_TAB_INTERVAL_TWIPS, J as EMPTY_TAB_STOPS, K as EquationFractionGeometry, N as EquationGeometry, O as EquationNaryGeometry, Q as EquationRadicalGeometry, U as EquationRowGeometry, V as EquationScriptGeometry, W as EquationSpanRecord, X as EquationTextGeometry, Y as FieldAtomMarker, Z as HeaderFooterStoryRecord, _ as HyperlinkFieldSpec, $ as LineSpacingRule, a0 as ListMarkerRecord, a1 as MAX_BORDER_SPACE_PT, a2 as MAX_BORDER_WIDTH_PT, a3 as MAX_PARAGRAPH_SPACING_PT, a4 as MAX_TABLE_BORDER_STROKES, a5 as MAX_TAB_POSITION_TWIPS, a6 as MAX_TAB_STOPS, a7 as PARAGRAPH_BORDER_SIDES, a8 as ParagraphAutoSpacingContext, a9 as ParagraphBorderSide, aa as ParagraphBorderStrokeRecord, ab as ParagraphBottomBorderRecord, ac as ParagraphIndent, ad as ResolvedCellBorders, ae as ResolvedTableBorderEdge, af as ResolvedTableBorderEdgeSegment, ag as ResolvedUnderline, ah as SINGLE_LINE_SPACING, ai as SourceRange, aj as SpanLinkRecord, ak as TAB_LEADER_GLYPH, al as TabAlignment, am as TabDestination, an as TabLeader, ao as TabStop, ap as TableBorderSideName, aq as TableBorderStrokeRecord, c as TableCellFragmentRecord, ar as TableFragmentRecord, b as TableRowFragmentRecord, as as VerticalAlign, at as appliedSpaceBefore, au as applyLineSpacing, av as baselineShiftPtOf, aw as borderExtentPt, ax as borderWeight, ay as bottomBorderExtentPt, az as cascadedParagraphBorders, aA as cascadedTabStops, aB as collapsedSpaceBefore, aC as defaultTabIntervalFromSettings, aD as displayText, aE as layoutEquation, aF as measureDisplayText, aG as nextTabDestination, aH as paragraphBorderExtentPt, aI as paragraphBorderStrokeWidthPt, aJ as paragraphBorders, aK as paragraphBordersFingerprint, aL as paragraphBreaksBefore, aM as paragraphContextualSpacing, aN as paragraphLineSpacing, aO as paragraphSpacing, aP as paragraphTabStops, aQ as readBorderSide, aR as readCellBorders, aS as readTableBorders, aT as resolveBorderConflict, aU as resolveRunStyle, aV as resolveTableCellBorderGrid, aW as runStylesEqual, aX as tabAdvanceWidth, aY as tabStopsFingerprint, aZ as withDefaultTabInterval } from './semantic-records-C3Z76KeN.cjs';
1
+ import { V as VersionedShapingLibrary, T as TextShaper, F as FontByteValidator, a as FixedPointRoundingMode, b as FixedPoint, c as TextDirection, S as ShapedRun } from './shaped-measurer-CninrHr_.cjs';
2
+ export { C as CacheLookup, d as CacheMiss, e as CacheProvenance, D as DeclaredFontSubstitution, f as FontFingerprintInputs, g as FontRequest, h as FontResolutionError, i as FontResolutionErrorCode, j as FontResourceDefinition, k as FontResourceInstrumentation, l as FontResourceSnapshot, m as FontResourceSnapshotOptions, n as FontSubstitution, o as FontValidationResult, G as GlyphOutline, H as HARD_MAX_AGGREGATE_FONT_BYTES, p as HARD_MAX_FONT_BYTES, q as HARD_MAX_FONT_SOURCES, L as LayoutShapingOptions, N as NormalizationPolicy, O as OperationSnapshot, r as OperationSnapshotField, s as OperationSnapshotGuard, R as ResolvedCache, t as ResolvedFont, u as ResourceDependencyProvenance, v as ShapeInput, w as ShapedCluster, x as ShapedFontSpan, y as ShapedGlyph, z as ShapedMeasurerOptions, A as ShapedRunComparatorInputs, B as ShapedVerticalMetrics, E as ShapingEnvironment, I as ShapingEnvironmentFingerprintInputs, J as ShapingEnvironmentInput, K as boundedStructuralFontValidator, M as captureOperationSnapshot, P as createFontResourceSnapshot, Q as createShapedMeasurer, U as createShapedRun, W as createShapingEnvironment, X as fixedPoint, Y as fontRequestKey, Z as guardOperationSnapshot, _ as shapedRunComparatorInputs, $ as shapingEnvironmentFingerprint, a0 as shapingEnvironmentFingerprintInputs } from './shaped-measurer-CninrHr_.cjs';
3
+ import { d as LayoutBox, D as DrawingPoint, e as DrawingInsets, a as StyleSpanRecord, I as InlineDrawingRecord, M as ModelRange, f as ThemeFonts, g as ParagraphSpacing, h as ParagraphLineSpacing, i as ParagraphBorderEdge, j as ParagraphBorders, k as ResolvedTabStops, S as SemanticLayout, B as BlockFragmentRecord, A as AnchoredDrawingRecord, l as PageRecord, R as ResolvedRunStyle, m as TableBorderSide, C as ContentControlBoundaryRecord$1, n as ContentControlLock, o as ParagraphFragmentRecord, L as LineRecord, p as InlineDrawingLayoutContext, T as TextMeasurer, H as HyperlinkProjector, F as FieldLinkProjector, q as StoryPageFieldNeeds, P as PageGeometry, r as CellBorderBox, s as TableBorderBox } from './semantic-records-DadVT_E1.cjs';
4
+ export { t as AUTO_PARAGRAPH_SPACING_PT, u as BorderGridGeometry, v as ContentControlGeometryFragment, w as ContentControlLevel, x as ContentControlMappedType, y as DEFAULT_PAGE_GEOMETRY, z as DEFAULT_RUN_STYLE, E as DEFAULT_TAB_INTERVAL_PT, G as DEFAULT_TAB_INTERVAL_TWIPS, J as EMPTY_TAB_STOPS, K as EquationFractionGeometry, N as EquationGeometry, O as EquationNaryGeometry, Q as EquationRadicalGeometry, U as EquationRowGeometry, V as EquationScriptGeometry, W as EquationSpanRecord, X as EquationTextGeometry, Y as FieldAtomMarker, Z as HeaderFooterStoryRecord, _ as HyperlinkFieldSpec, $ as LineSpacingRule, a0 as ListMarkerRecord, a1 as MAX_BORDER_SPACE_PT, a2 as MAX_BORDER_WIDTH_PT, a3 as MAX_PARAGRAPH_SPACING_PT, a4 as MAX_TABLE_BORDER_STROKES, a5 as MAX_TAB_POSITION_TWIPS, a6 as MAX_TAB_STOPS, a7 as PARAGRAPH_BORDER_SIDES, a8 as ParagraphAutoSpacingContext, a9 as ParagraphBorderSide, aa as ParagraphBorderStrokeRecord, ab as ParagraphBottomBorderRecord, ac as ParagraphIndent, ad as ResolvedCellBorders, ae as ResolvedTableBorderEdge, af as ResolvedTableBorderEdgeSegment, ag as ResolvedUnderline, ah as SINGLE_LINE_SPACING, ai as SourceRange, aj as SpanLinkRecord, ak as TAB_LEADER_GLYPH, al as TabAlignment, am as TabDestination, an as TabLeader, ao as TabStop, ap as TableBorderSideName, aq as TableBorderStrokeRecord, c as TableCellFragmentRecord, ar as TableFragmentRecord, b as TableRowFragmentRecord, as as VerticalAlign, at as appliedSpaceBefore, au as applyLineSpacing, av as baselineShiftPtOf, aw as borderExtentPt, ax as borderWeight, ay as bottomBorderExtentPt, az as cascadedParagraphBorders, aA as cascadedTabStops, aB as collapsedSpaceBefore, aC as defaultTabIntervalFromSettings, aD as displayText, aE as layoutEquation, aF as measureDisplayText, aG as nextTabDestination, aH as paragraphBorderExtentPt, aI as paragraphBorderStrokeWidthPt, aJ as paragraphBorders, aK as paragraphBordersFingerprint, aL as paragraphBreaksBefore, aM as paragraphContextualSpacing, aN as paragraphLineSpacing, aO as paragraphSpacing, aP as paragraphTabStops, aQ as readBorderSide, aR as readCellBorders, aS as readTableBorders, aT as resolveBorderConflict, aU as resolveRunStyle, aV as resolveTableCellBorderGrid, aW as runStylesEqual, aX as tabAdvanceWidth, aY as tabStopsFingerprint, aZ as withDefaultTabInterval } from './semantic-records-DadVT_E1.cjs';
5
5
  import { a as OoxmlNode, b as OoxmlElement, O as OoxmlPart } from './ooxml-package-CdEy9ufK.cjs';
6
- import { O as OoxmlProperty, I as ImpactClass, C as ContentControlKind, n as ContentControlLevel, o as ContentControlLock$1, p as ContentControlDataBinding } from './tree-op-types-B0-sCtw-.cjs';
7
- export { m as TableBorderStyle } from './tree-op-types-B0-sCtw-.cjs';
6
+ import { O as OoxmlProperty, I as ImpactClass, C as ContentControlKind, o as ContentControlLevel, p as ContentControlLock$1, q as ContentControlDataBinding } from './tree-op-types-D1vNJ7XC.cjs';
7
+ export { n as TableBorderStyle } from './tree-op-types-D1vNJ7XC.cjs';
8
8
  import { N as NoteKind, n as noteTypeOf } from './note-nodes-DL-Au22P.cjs';
9
9
  import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties } from './note-properties-CQlxjic_.cjs';
10
- import { T as TreeModelChange, D as DocumentProperties } from './tree-store-C6vc8E_2.cjs';
10
+ import { T as TreeModelChange, D as DocumentProperties } from './tree-store-B_sJBMIS.cjs';
11
11
  import { R as RevisionDisplayMode } from './revision-projection-Cc4wz30g.cjs';
12
12
  export { D as DEFAULT_REVISION_DISPLAY_MODE, a as RevisionAttribution, b as RevisionKind, f as formatRevisionOf, m as markRevisionRemovesMark, p as paragraphMarkFormatRevisionOf, c as paragraphMarkRevisionOf, d as paragraphMarkRevisionsOf, r as revisionsAreDeletion, e as revisionsVisible, s as shownMarkRevision } from './revision-projection-Cc4wz30g.cjs';
13
- import { a as SectionColumns } from './semantic-cell-selection-DJPjBWzf.cjs';
14
- export { C as CellSelection, D as DEFAULT_SECTION_PROPERTIES, b as DEFAULT_VERTICAL_WEIGHT, c as DocumentSection, d as DocumentSectionsEnumeration, e as DrawingOverlayFrame, H as HitPoint, f as HitTestOptions, M as MAX_DOCUMENT_SECTIONS, P as PlacedCell, g as SectionBreakType, h as SectionColumnDefinition, i as SectionMargins, j as SectionPageNumbering, S as SectionProperties, k as SemanticHit, l as SemanticHitDrawing, T as TableCellAddress, m as TableCellContext, n as caretBoxOnLine, o as cellSelectionBetween, p as cellSelectionRects, q as cellSelectionText, r as contentControlAtPoint, s as enumerateDocumentSections, t as enumerateDocumentSectionsBounded, u as findDrawingOverlayFrameInLayout, v as geometryOfSection, w as hitTestPage, x as hitTestSheet, y as isFurniturePoint, z as lineEndOffset, A as pageAtY, B as paragraphSectionNode, E as paragraphsInCells, F as parsePageNumbering, G as parseSectionProperties, I as readSectionProperties, J as spanOffsetX, K as spansInCells, L as tableContextAt } from './semantic-cell-selection-DJPjBWzf.cjs';
15
- export { M as MAX_SDT_NESTING, c as collectFlowBlocks, a as commentBodyText, b as commentInitials, d as contentControlContentChildren, i as isContentControl, e as isContentControlContent, p as paragraphOrderOfPart } from './review-reads-CP106AHp.cjs';
16
- import { a as ReviewItem } from './review-items-DpsqTHio.cjs';
17
- export { i as CommentAnchor, j as CommentPosition, C as CommentRecord, h as CommentThreadState, c as ReviewCommentItem, d as ReviewCustomItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, W as W15_NAMESPACE_URI, k as activeReviewItem, l as firstReviewRange, r as reviewItemKey, m as reviewItemPositionRank, n as reviewItemRanges, o as reviewItemsAt, p as reviewThreadRootOf } from './review-items-DpsqTHio.cjs';
18
- import { S as SemanticPosition, b as SelectionRect, a as SemanticSelection } from './semantic-interaction-BjOcDB06.cjs';
19
- export { c as CaretAtOptions, C as CaretGeometry, M as MoveCaretOptions, N as NavigationCommand, d as caretAt, e as caretStops, f as caretStopsForBlocks, g as compositionAnchor, h as contentControlAtSemantic, i as contentControlsInLayout, j as hitTestSemantic, m as moveCaret, p as paragraphTextFromLayout, s as spansInSelection } from './semantic-interaction-BjOcDB06.cjs';
20
- import './image-resources-DQOiwOuE.cjs';
13
+ import { a as SectionColumns } from './semantic-cell-selection-BPzx6DdT.cjs';
14
+ export { C as CellSelection, D as DEFAULT_SECTION_PROPERTIES, b as DEFAULT_VERTICAL_WEIGHT, c as DocumentSection, d as DocumentSectionsEnumeration, e as DrawingOverlayFrame, H as HitPoint, f as HitTestOptions, M as MAX_DOCUMENT_SECTIONS, P as PlacedCell, g as SectionBreakType, h as SectionColumnDefinition, i as SectionMargins, j as SectionPageNumbering, S as SectionProperties, k as SemanticHit, l as SemanticHitDrawing, T as TableCellAddress, m as TableCellContext, n as caretBoxOnLine, o as cellSelectionBetween, p as cellSelectionRects, q as cellSelectionText, r as contentControlAtPoint, s as enumerateDocumentSections, t as enumerateDocumentSectionsBounded, u as findDrawingOverlayFrameInLayout, v as geometryOfSection, w as hitTestPage, x as hitTestSheet, y as isFurniturePoint, z as lineEndOffset, A as pageAtY, B as paragraphSectionNode, E as paragraphsInCells, F as parsePageNumbering, G as parseSectionProperties, I as readSectionProperties, J as spanOffsetX, K as spansInCells, L as tableContextAt } from './semantic-cell-selection-BPzx6DdT.cjs';
15
+ export { M as MAX_SDT_NESTING, c as collectFlowBlocks, a as commentBodyText, b as commentInitials, d as contentControlContentChildren, i as isContentControl, e as isContentControlContent, p as paragraphOrderOfPart } from './review-reads-Bxz03tHG.cjs';
16
+ import { a as ReviewItem } from './review-items-B8tffIXj.cjs';
17
+ export { i as CommentAnchor, j as CommentPosition, C as CommentRecord, h as CommentThreadState, c as ReviewCommentItem, d as ReviewCustomItem, R as ReviewModelInput, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, W as W15_NAMESPACE_URI, k as activeReviewItem, l as firstReviewRange, r as reviewItemKey, m as reviewItemPositionRank, n as reviewItemRanges, o as reviewItemsAt, p as reviewThreadRootOf } from './review-items-B8tffIXj.cjs';
18
+ import { S as SemanticPosition, b as SelectionRect, a as SemanticSelection } from './semantic-interaction-BfWDD_0V.cjs';
19
+ export { c as CaretAtOptions, C as CaretGeometry, M as MoveCaretOptions, N as NavigationCommand, d as caretAt, e as caretStops, f as caretStopsForBlocks, g as compositionAnchor, h as contentControlAtSemantic, i as contentControlsInLayout, j as hitTestSemantic, m as moveCaret, p as paragraphTextFromLayout, s as spansInSelection } from './semantic-interaction-BfWDD_0V.cjs';
20
+ import './image-resources-BiA-IXgo.cjs';
21
21
  import './omml-equation-BD-LsmWE.cjs';
22
22
  import './contracts/types.cjs';
23
23
 
@@ -27,6 +27,9 @@ import './contracts/types.cjs';
27
27
  * `pageNumber` is the displayed PAGE value after section `w:pgNumType/@w:start` (1-based).
28
28
  * `pageCount` is document NUMPAGES. `sectionPageCount` is SECTIONPAGES for the attached
29
29
  * section. `format` is the authored `w:pgNumType/@w:fmt` applied only to PAGE.
30
+ *
31
+ * A new field here must also join `sameFieldPageContext` below, or finalize compares two
32
+ * contexts that differ in it as equal and keeps a reused story's stale text.
30
33
  */
31
34
  interface FieldPageContext {
32
35
  readonly pageNumber: number;
@@ -194,73 +197,6 @@ interface ParagraphLayoutCacheOptions {
194
197
  */
195
198
  declare function createParagraphLayoutCache<T>(options?: ParagraphLayoutCacheOptions): ParagraphLayoutCache<T>;
196
199
 
197
- type WrapTextSide = 'bothSides' | 'left' | 'right' | 'largest';
198
- interface WrapExclusionInput {
199
- readonly mode: 'square' | 'tight' | 'through' | 'topAndBottom';
200
- readonly contentBounds: LayoutBox;
201
- readonly polygon: readonly DrawingPoint[] | null;
202
- readonly clipPolygon: readonly DrawingPoint[] | null;
203
- readonly wrapDistances: DrawingInsets;
204
- readonly effectInsets: DrawingInsets;
205
- readonly textSide: WrapTextSide;
206
- readonly contentLeft: number;
207
- readonly contentRight: number;
208
- }
209
-
210
- /** Paint layer relative to body text — not the OOXML wrap element. */
211
- type DrawingPaintLayer = 'behind' | 'inFront';
212
- interface ExclusionZone {
213
- readonly drawingNodeId: string;
214
- readonly anchorParagraphId: string;
215
- /** UTF-16 model offset of the anchor atom — exclusions apply at/after this point in the paragraph. */
216
- readonly anchorModelStart: number;
217
- readonly sourceOrder: number;
218
- readonly paintLayer: DrawingPaintLayer;
219
- readonly relativeHeight: number;
220
- readonly allowOverlap: boolean;
221
- /** Owning column index in a multi-column section — 0 for single-column and HF stories. */
222
- readonly columnIndex: number;
223
- /** Resolved top edge in page-content coordinates after overlap displacement. */
224
- readonly y: number;
225
- readonly verticalBand: LayoutBox;
226
- readonly input: WrapExclusionInput;
227
- }
228
-
229
- interface PendingLine {
230
- readonly spans: StyleSpanRecord[];
231
- readonly drawings: InlineDrawingRecord[];
232
- readonly start: number;
233
- end: number;
234
- width: number;
235
- height: number;
236
- baseline: number;
237
- /**
238
- * Space ABOVE the glyph band inside {@link height}.
239
- *
240
- * Exact spacing can center the glyphs and move the baseline. Auto/atLeast spacing leaves
241
- * this at zero and puts its extra depth below instead.
242
- */
243
- leading: number;
244
- /**
245
- * Auto/atLeast line-spacing depth below the painted glyph band.
246
- *
247
- * Word lets this external depth cross the bottom text margin when the glyphs themselves
248
- * still fit. Pagination therefore budgets {@link height} minus this amount at a page
249
- * bottom, while paint keeps the full box and padding.
250
- */
251
- trailingSpacing: number;
252
- /** When true, layout must start a new page after this line is placed. */
253
- pageBreakAfter?: boolean;
254
- /** When true, layout must advance to the next authored section column. */
255
- columnBreakAfter?: boolean;
256
- /** Model ranges on this line covering deleted content; see {@link LineRecord.deletedRanges}. */
257
- deletedRanges?: readonly ModelRange[];
258
- /** Vertical gap inserted before this line to clear a topAndBottom exclusion band. */
259
- exclusionSkipBefore?: number;
260
- }
261
- /** Horizontal alignment of a paragraph (`w:jc`, ECMA-376 §17.3.1.13). */
262
- type Alignment = 'left' | 'center' | 'right' | 'both';
263
-
264
200
  /** Soft ceiling on abstractNum / num entries read from one part. */
265
201
  declare const MAX_NUMBERING_DEFINITIONS = 512;
266
202
  /** Soft ceiling on override entries per `w:num`. */
@@ -372,32 +308,297 @@ interface NumberingIndex {
372
308
  readonly nums: ReadonlyMap<string, NumDefinition>;
373
309
  }
374
310
  /**
375
- * Build a numbering index from the root of a numbering part (`w:numbering`).
311
+ * Build a numbering index from the root of a numbering part (`w:numbering`).
312
+ *
313
+ * Empty / missing roots yield an empty index. Duplicate ids keep the first definition.
314
+ */
315
+ /**
316
+ * Project `numbering.xml` into the bounded index.
317
+ *
318
+ * Every ceiling here exists because the input is file-derived: definition counts, override
319
+ * counts, indent magnitudes and style-link hop depth are all capped, and nothing from the file
320
+ * becomes a loop bound or an allocation size.
321
+ */
322
+ declare function buildNumberingIndex(root: OoxmlElement | null | undefined): NumberingIndex;
323
+ /** Resolve the effective level for a `numId` + `ilvl`, applying overrides. */
324
+ /**
325
+ * The effective level for one paragraph's numbering reference, after overrides and style links.
326
+ *
327
+ * Answers null for a reference the index cannot resolve — a paragraph naming a definition the
328
+ * file never declared is an unnumbered paragraph, not an error.
329
+ */
330
+ declare function resolveNumberingLevel(index: NumberingIndex, numId: string, ilvl: number): {
331
+ readonly abstractNumId: string;
332
+ readonly level: NumberingLevel;
333
+ readonly startOverride?: number;
334
+ } | null;
335
+ /** Empty index for tests / documents without numbering. */
336
+ declare const EMPTY_NUMBERING_INDEX: NumberingIndex;
337
+
338
+ type WrapTextSide = 'bothSides' | 'left' | 'right' | 'largest';
339
+ interface WrapExclusionInput {
340
+ readonly mode: 'square' | 'tight' | 'through' | 'topAndBottom';
341
+ readonly contentBounds: LayoutBox;
342
+ readonly polygon: readonly DrawingPoint[] | null;
343
+ readonly clipPolygon: readonly DrawingPoint[] | null;
344
+ readonly wrapDistances: DrawingInsets;
345
+ readonly effectInsets: DrawingInsets;
346
+ readonly textSide: WrapTextSide;
347
+ readonly contentLeft: number;
348
+ readonly contentRight: number;
349
+ }
350
+
351
+ /** Paint layer relative to body text — not the OOXML wrap element. */
352
+ type DrawingPaintLayer = 'behind' | 'inFront';
353
+ interface ExclusionZone {
354
+ readonly drawingNodeId: string;
355
+ readonly anchorParagraphId: string;
356
+ /** UTF-16 model offset of the anchor atom — exclusions apply at/after this point in the paragraph. */
357
+ readonly anchorModelStart: number;
358
+ readonly sourceOrder: number;
359
+ readonly paintLayer: DrawingPaintLayer;
360
+ readonly relativeHeight: number;
361
+ readonly allowOverlap: boolean;
362
+ /** Owning column index in a multi-column section — 0 for single-column and HF stories. */
363
+ readonly columnIndex: number;
364
+ /** Resolved top edge in page-content coordinates after overlap displacement. */
365
+ readonly y: number;
366
+ readonly verticalBand: LayoutBox;
367
+ readonly input: WrapExclusionInput;
368
+ }
369
+
370
+ interface PendingLine {
371
+ readonly spans: StyleSpanRecord[];
372
+ readonly drawings: InlineDrawingRecord[];
373
+ readonly start: number;
374
+ end: number;
375
+ width: number;
376
+ height: number;
377
+ baseline: number;
378
+ /**
379
+ * Space ABOVE the glyph band inside {@link height}.
380
+ *
381
+ * Exact spacing can center the glyphs and move the baseline. Auto/atLeast spacing leaves
382
+ * this at zero and puts its extra depth below instead.
383
+ */
384
+ leading: number;
385
+ /**
386
+ * Auto/atLeast line-spacing depth below the painted glyph band.
387
+ *
388
+ * Word lets this external depth cross the bottom text margin when the glyphs themselves
389
+ * still fit. Pagination therefore budgets {@link height} minus this amount at a page
390
+ * bottom, while paint keeps the full box and padding.
391
+ */
392
+ trailingSpacing: number;
393
+ /** When true, layout must start a new page after this line is placed. */
394
+ pageBreakAfter?: boolean;
395
+ /** When true, layout must advance to the next authored section column. */
396
+ columnBreakAfter?: boolean;
397
+ /** Model ranges on this line covering deleted content; see {@link LineRecord.deletedRanges}. */
398
+ deletedRanges?: readonly ModelRange[];
399
+ /** Vertical gap inserted before this line to clear a topAndBottom exclusion band. */
400
+ exclusionSkipBefore?: number;
401
+ }
402
+ /** Horizontal alignment of a paragraph (`w:jc`, ECMA-376 §17.3.1.13). */
403
+ type Alignment = 'left' | 'center' | 'right' | 'both';
404
+
405
+ /** Soft ceiling on `basedOn` chain length — enough for real templates, refuses hostile graphs. */
406
+ declare const MAX_STYLE_BASED_ON_DEPTH = 32;
407
+ /** Soft ceiling on style definitions read from one styles part. */
408
+ declare const MAX_STYLE_DEFINITIONS = 4096;
409
+ /** One `w:style` as the cascade reads it: its properties, and the style it is based on. */
410
+ interface StyleDefinition {
411
+ readonly styleId: string;
412
+ readonly type: string;
413
+ readonly basedOn: string | null;
414
+ readonly paragraphProperties: readonly OoxmlProperty[];
415
+ readonly runProperties: readonly OoxmlProperty[];
416
+ /** The style's `w:pPr` node, when present — needed for nested `w:pBdr`. */
417
+ readonly paragraphPropertiesNode: OoxmlElement | undefined;
418
+ /** The style's `w:tblPr`, for a `w:type="table"` style. */
419
+ readonly tablePropertiesNode: OoxmlElement | undefined;
420
+ /**
421
+ * `w:tblStylePr` conditional formats by `w:type` (`firstRow`, `band1Horz`, …).
422
+ *
423
+ * Word puts a table's real appearance here: `Table Grid` carries its grid in the style's
424
+ * `w:tblBorders`, and the banded/​header looks live in these. A document states only
425
+ * `<w:tblStyle w:val="TableGrid"/>`.
426
+ */
427
+ readonly conditionalTableFormats: ReadonlyMap<string, OoxmlElement>;
428
+ }
429
+ /**
430
+ * The whole styles part, indexed and ready to resolve against.
431
+ *
432
+ * `cacheToken` is load-bearing: it folds into layout cache producers so breaks measured under one
433
+ * styles part are never reused under another.
434
+ */
435
+ interface StyleCascadeTable {
436
+ /**
437
+ * Bounded fingerprint folded into layout cache producers so a different styles part cannot
438
+ * reuse breaks measured under another cascade. Computed once per table (FNV-1a hex).
439
+ */
440
+ readonly cacheToken: string;
441
+ readonly docDefaultsRun: readonly OoxmlProperty[];
442
+ readonly docDefaultsParagraph: readonly OoxmlProperty[];
443
+ readonly docDefaultsParagraphNode: OoxmlElement | undefined;
444
+ /** `w:style[@w:default='1'][@w:type='paragraph']` — last wins among defaults of that type. */
445
+ readonly defaultParagraphStyleId: string | null;
446
+ /** `w:style[@w:default='1'][@w:type='character']` — last wins among defaults of that type. */
447
+ readonly defaultCharacterStyleId: string | null;
448
+ /**
449
+ * The theme part's Latin typefaces, for `w:rFonts` theme references.
450
+ *
451
+ * Lives on the cascade because it is document-level style material with the same
452
+ * lifetime, and because every site that resolves run properties already holds this table.
453
+ */
454
+ readonly themeFonts: ThemeFonts;
455
+ readonly styles: ReadonlyMap<string, StyleDefinition>;
456
+ }
457
+ /**
458
+ * A paragraph's properties after the cascade, plus the same list WITHOUT its own `w:pPr`.
459
+ *
460
+ * Both, because a writer needs to know what a paragraph INHERITS to decide whether setting a
461
+ * value is a change or a no-op — and writing back an inherited value freezes it into the
462
+ * paragraph as though the author had chosen it.
463
+ */
464
+ interface CascadedParagraphFormatting {
465
+ /** Flat paragraph properties in cascade order (defaults → bases → style → direct). */
466
+ readonly paragraphProperties: readonly OoxmlProperty[];
467
+ /**
468
+ * The same list WITHOUT the paragraph's own `w:pPr` — everything it inherits.
469
+ *
470
+ * Numbering needs the two tiers apart: a level's `w:pPr/w:ind` outranks the style's and is
471
+ * outranked by the paragraph's own, and a flattened list cannot say which is which.
472
+ */
473
+ readonly inheritedParagraphProperties: readonly OoxmlProperty[];
474
+ /** Matching `w:pPr` nodes for nested border resolution. */
475
+ readonly paragraphPropertyNodes: readonly OoxmlNode[];
476
+ /**
477
+ * Inherited run properties for CONTENT runs (before direct run `rPr`).
478
+ *
479
+ * Does NOT include direct `w:pPr/w:rPr` — that formats the paragraph MARK only
480
+ * (ECMA-376 §17.3.1.36). Folding mark `w:sz` into content made BodyText runs with no
481
+ * direct size paint at the mark's size (Selection Notice "or" alternative → 6.5pt).
482
+ */
483
+ readonly runProperties: readonly OoxmlProperty[];
484
+ /**
485
+ * Content cascade plus direct `w:pPr/w:rPr` — empty-line metrics and last-line mark height.
486
+ */
487
+ readonly markRunProperties: readonly OoxmlProperty[];
488
+ /**
489
+ * The style this paragraph resolved to, or null when it names none and there is no
490
+ * document default. `w:contextualSpacing` compares neighbours by exactly this.
491
+ */
492
+ readonly styleId: string | null;
493
+ }
494
+ /** Accepted style ids only — over-long, control-bearing, or dangerous keys are dropped. */
495
+ declare function isValidStyleId(raw: string | undefined): raw is string;
496
+ /**
497
+ * What a table style contributes to the paragraphs of ONE cell: the style's whole-table
498
+ * `w:pPr`/`w:rPr` followed by every `w:tblStylePr` the cell is under (17.7.6.6), weakest
499
+ * first in the caller's condition order (banding, column, row, corner).
500
+ *
501
+ * This is how Word makes a header row bold and centred while the document states nothing
502
+ * but `<w:tblStyle w:val="…"/>` on the table and plain runs in the cells.
503
+ */
504
+ interface TableCellStyleFormatting {
505
+ readonly paragraphProperties: readonly OoxmlProperty[];
506
+ /** Matching `w:pPr` nodes, for nested `w:pBdr` / `w:tabs` resolution. */
507
+ readonly paragraphPropertyNodes: readonly OoxmlElement[];
508
+ /** Inherited run properties for every run in the cell, before the paragraph style. */
509
+ readonly runProperties: readonly OoxmlProperty[];
510
+ }
511
+ /**
512
+ * Build a cascade table from a styles part root.
513
+ *
514
+ * Only direct `w:style` children of the root participate (bounded count). Duplicate
515
+ * `styleId` values keep the last definition, matching Word's reader for this fixture class.
516
+ * Default paragraph/character style ids track `w:default="1"` with the same last-wins rule.
517
+ */
518
+ declare function buildStyleCascadeTable(stylesRoot: OoxmlElement | null, themeFonts?: ThemeFonts): StyleCascadeTable;
519
+ /**
520
+ * Cascade paragraph + inherited run properties for one paragraph's direct `w:pPr`.
521
+ *
522
+ * Order: `docDefaults` → table style → `basedOn` ancestors → paragraph style → direct
523
+ * formatting, which is the style hierarchy of 17.7.2: a table style sits above the document
524
+ * defaults and below the paragraph style a cell paragraph names for itself.
525
+ * When `w:pStyle` is absent, the document's default paragraph style (`w:default="1"`) is used.
526
+ * Direct formatting is last so it overrides inherited values inside the existing resolvers.
527
+ */
528
+ declare function cascadeParagraphFormatting(table: StyleCascadeTable, directPPr: OoxmlNode | undefined, tableCellStyle?: TableCellStyleFormatting): CascadedParagraphFormatting;
529
+ /**
530
+ * Bottom border after cascade: a later `w:pBdr` replaces an earlier one; absence inherits.
531
+ * `nil`/`none` clear the edge via `paragraphBorders`.
532
+ */
533
+ declare function cascadedBottomBorder(paragraphPropertyNodes: readonly OoxmlNode[]): ParagraphBorderEdge | undefined;
534
+ /**
535
+ * Merge inherited paragraph-style run props with a run's direct `rPr` (direct last).
536
+ *
537
+ * When a cascade table is supplied, also resolves `w:rStyle` character styles (basedOn chain,
538
+ * cycle/depth capped). Runs without an explicit `rStyle` pick up the default character style
539
+ * (`w:default="1"`). Precedence: inherited → character style chain → direct formatting.
540
+ */
541
+ declare function cascadeRunProperties(inheritedRunProperties: readonly OoxmlProperty[], directRunProperties: readonly OoxmlProperty[], table?: StyleCascadeTable): readonly OoxmlProperty[];
542
+ /** Everything the line breaker needs about one paragraph, already cascaded and converted. */
543
+ interface ParagraphLayoutInputs {
544
+ readonly props: OoxmlProperty[];
545
+ readonly indent: {
546
+ left: number;
547
+ right: number;
548
+ hanging: number;
549
+ firstLine: number;
550
+ };
551
+ readonly available: number;
552
+ readonly alignment: Alignment;
553
+ readonly spacing: ParagraphSpacing;
554
+ /** Resolved `w:line` / `w:lineRule`; single spacing where the cascade says nothing. */
555
+ readonly lineSpacing: ParagraphLineSpacing;
556
+ /** `w:contextualSpacing`: drop before/after between same-style neighbours. */
557
+ readonly contextualSpacing: boolean;
558
+ /** Resolved paragraph style id, for the `w:contextualSpacing` neighbour comparison. */
559
+ readonly styleId: string | null;
560
+ readonly bottomBorder: ParagraphBorderEdge | undefined;
561
+ /**
562
+ * Every `CT_PBdr` edge after cascade, not just the bottom one.
563
+ *
564
+ * `bottomBorder` stays alongside it because the fragment signature and the table flow
565
+ * read that field by name; this is the whole box, so a cell paragraph gets the same
566
+ * frame a body paragraph does.
567
+ */
568
+ readonly borders: ParagraphBorders;
569
+ /** Validated 6-hex paragraph shading fill from cascaded `w:pPr/w:shd`, absent for none. */
570
+ readonly shading: string | undefined;
571
+ readonly inheritedRunProperties: readonly OoxmlProperty[];
572
+ /**
573
+ * Paragraph-mark cascade (`inheritedRunProperties` + direct `w:pPr/w:rPr`).
574
+ * Empty-line sizing and last-line mark height — never content-run face.
575
+ */
576
+ readonly markRunProperties: readonly OoxmlProperty[];
577
+ /** Cascaded custom tab stops + default interval for paragraph-flow breaking. */
578
+ readonly tabStops: ResolvedTabStops;
579
+ /**
580
+ * Fingerprint folded into the paragraph layout cache key — nested `w:tabs` are absent
581
+ * from flat property bags, so style-inherited stops must be named explicitly.
582
+ */
583
+ readonly tabStopsCacheToken: string;
584
+ /** Resolved list marker inputs when the paragraph participates in numbering. */
585
+ readonly listItem?: ResolvedListItem;
586
+ }
587
+ /**
588
+ * Resolve every paragraph input semantic layout / table cells share: cascaded props when a
589
+ * style table is present, otherwise direct formatting only.
376
590
  *
377
- * Empty / missing roots yield an empty index. Duplicate ids keep the first definition.
378
- */
379
- /**
380
- * Project `numbering.xml` into the bounded index.
591
+ * When `listItem` is provided, its merged level indent becomes the paragraph indent (list
592
+ * hanging / left from `numbering.xml`), which is what Word uses for fixture list paragraphs
593
+ * that author no direct `w:ind`.
381
594
  *
382
- * Every ceiling here exists because the input is file-derived: definition counts, override
383
- * counts, indent magnitudes and style-link hop depth are all capped, and nothing from the file
384
- * becomes a loop bound or an allocation size.
385
- */
386
- declare function buildNumberingIndex(root: OoxmlElement | null | undefined): NumberingIndex;
387
- /** Resolve the effective level for a `numId` + `ilvl`, applying overrides. */
388
- /**
389
- * The effective level for one paragraph's numbering reference, after overrides and style links.
595
+ * `tableCellStyle` carries what the enclosing table's style says about this cell's
596
+ * paragraphs; body paragraphs pass nothing.
390
597
  *
391
- * Answers null for a reference the index cannot resolve — a paragraph naming a definition the
392
- * file never declared is an unnumbered paragraph, not an error.
598
+ * `inTableCell` is asked for separately because a cell paragraph may have no table style to
599
+ * inherit at all, and `w:beforeAutospacing` still needs to know it is in a cell.
393
600
  */
394
- declare function resolveNumberingLevel(index: NumberingIndex, numId: string, ilvl: number): {
395
- readonly abstractNumId: string;
396
- readonly level: NumberingLevel;
397
- readonly startOverride?: number;
398
- } | null;
399
- /** Empty index for tests / documents without numbering. */
400
- declare const EMPTY_NUMBERING_INDEX: NumberingIndex;
601
+ declare function resolveParagraphLayoutInputs(paragraph: OoxmlElement, contentWidth: number, styleCascade: StyleCascadeTable | undefined, listItem?: ResolvedListItem, tableCellStyle?: TableCellStyleFormatting, inTableCell?: boolean): ParagraphLayoutInputs;
401
602
 
402
603
  /**
403
604
  * What a batch of commits can affect.
@@ -543,6 +744,18 @@ interface SectionStackSpan {
543
744
  readonly sheetY: number;
544
745
  /** Remapped pages (projectors intact) from the last pass for this section. */
545
746
  readonly remappedPages: readonly PageRecord[];
747
+ /**
748
+ * The section-local pages this span's pass returned — identity evidence for reuse. (On a
749
+ * continuous section the host tail merges instead of remapping, so `remappedPages` covers
750
+ * only the overflow sheets while this list still holds every returned page.)
751
+ *
752
+ * A section can lay out more than once inside one document pass (a reserve re-run, a
753
+ * balancing probe), and the last run then reports "nothing placed" against its OWN session
754
+ * even though an earlier run this pass rebuilt the pages. Counts and stats cannot tell
755
+ * those apart; only these object identities can say the span still describes the pages the
756
+ * section just returned.
757
+ */
758
+ readonly sourcePages: readonly PageRecord[];
546
759
  }
547
760
  /** Orchestrator state for multi-section incremental layout. */
548
761
  interface MultiSectionLayoutState {
@@ -565,8 +778,19 @@ interface LayoutSession {
565
778
  previous: SemanticLayout | null;
566
779
  checkpoints: FlowCheckpoint[];
567
780
  keys: string[];
568
- /** Geometry and producer of the previous pass; a change to either forces a full pass. */
781
+ /** Geometry and flow context of the previous pass; a change forces a full pass. */
569
782
  context: string;
783
+ /**
784
+ * Producer of the previous pass, compared beside {@link context} rather than embedded in
785
+ * it: the producer carries the content-control token, which runs to kilobytes on a
786
+ * control-heavy document, and embedding it copied that token into every section's context
787
+ * string on every pass. Identity-stable when unchanged, so the comparison is a pointer
788
+ * check.
789
+ *
790
+ * Optional so a session literal built before this field existed still type-checks; an
791
+ * absent producer never matches and forces a conservative full pass.
792
+ */
793
+ producer?: string;
570
794
  /**
571
795
  * Whether the previous pass read page PARITY: even/odd header variants, or an anchored
572
796
  * drawing positioned against an inside/outside frame or alignment.
@@ -733,204 +957,6 @@ declare function listMarkerBox(item: ResolvedListItem, markerWidth: number, line
733
957
  height: number;
734
958
  } | null;
735
959
 
736
- /** Soft ceiling on `basedOn` chain length — enough for real templates, refuses hostile graphs. */
737
- declare const MAX_STYLE_BASED_ON_DEPTH = 32;
738
- /** Soft ceiling on style definitions read from one styles part. */
739
- declare const MAX_STYLE_DEFINITIONS = 4096;
740
- /** One `w:style` as the cascade reads it: its properties, and the style it is based on. */
741
- interface StyleDefinition {
742
- readonly styleId: string;
743
- readonly type: string;
744
- readonly basedOn: string | null;
745
- readonly paragraphProperties: readonly OoxmlProperty[];
746
- readonly runProperties: readonly OoxmlProperty[];
747
- /** The style's `w:pPr` node, when present — needed for nested `w:pBdr`. */
748
- readonly paragraphPropertiesNode: OoxmlElement | undefined;
749
- /** The style's `w:tblPr`, for a `w:type="table"` style. */
750
- readonly tablePropertiesNode: OoxmlElement | undefined;
751
- /**
752
- * `w:tblStylePr` conditional formats by `w:type` (`firstRow`, `band1Horz`, …).
753
- *
754
- * Word puts a table's real appearance here: `Table Grid` carries its grid in the style's
755
- * `w:tblBorders`, and the banded/​header looks live in these. A document states only
756
- * `<w:tblStyle w:val="TableGrid"/>`.
757
- */
758
- readonly conditionalTableFormats: ReadonlyMap<string, OoxmlElement>;
759
- }
760
- /**
761
- * The whole styles part, indexed and ready to resolve against.
762
- *
763
- * `cacheToken` is load-bearing: it folds into layout cache producers so breaks measured under one
764
- * styles part are never reused under another.
765
- */
766
- interface StyleCascadeTable {
767
- /**
768
- * Bounded fingerprint folded into layout cache producers so a different styles part cannot
769
- * reuse breaks measured under another cascade. Computed once per table (FNV-1a hex).
770
- */
771
- readonly cacheToken: string;
772
- readonly docDefaultsRun: readonly OoxmlProperty[];
773
- readonly docDefaultsParagraph: readonly OoxmlProperty[];
774
- readonly docDefaultsParagraphNode: OoxmlElement | undefined;
775
- /** `w:style[@w:default='1'][@w:type='paragraph']` — last wins among defaults of that type. */
776
- readonly defaultParagraphStyleId: string | null;
777
- /** `w:style[@w:default='1'][@w:type='character']` — last wins among defaults of that type. */
778
- readonly defaultCharacterStyleId: string | null;
779
- /**
780
- * The theme part's Latin typefaces, for `w:rFonts` theme references.
781
- *
782
- * Lives on the cascade because it is document-level style material with the same
783
- * lifetime, and because every site that resolves run properties already holds this table.
784
- */
785
- readonly themeFonts: ThemeFonts;
786
- readonly styles: ReadonlyMap<string, StyleDefinition>;
787
- }
788
- /**
789
- * A paragraph's properties after the cascade, plus the same list WITHOUT its own `w:pPr`.
790
- *
791
- * Both, because a writer needs to know what a paragraph INHERITS to decide whether setting a
792
- * value is a change or a no-op — and writing back an inherited value freezes it into the
793
- * paragraph as though the author had chosen it.
794
- */
795
- interface CascadedParagraphFormatting {
796
- /** Flat paragraph properties in cascade order (defaults → bases → style → direct). */
797
- readonly paragraphProperties: readonly OoxmlProperty[];
798
- /**
799
- * The same list WITHOUT the paragraph's own `w:pPr` — everything it inherits.
800
- *
801
- * Numbering needs the two tiers apart: a level's `w:pPr/w:ind` outranks the style's and is
802
- * outranked by the paragraph's own, and a flattened list cannot say which is which.
803
- */
804
- readonly inheritedParagraphProperties: readonly OoxmlProperty[];
805
- /** Matching `w:pPr` nodes for nested border resolution. */
806
- readonly paragraphPropertyNodes: readonly OoxmlNode[];
807
- /**
808
- * Inherited run properties for CONTENT runs (before direct run `rPr`).
809
- *
810
- * Does NOT include direct `w:pPr/w:rPr` — that formats the paragraph MARK only
811
- * (ECMA-376 §17.3.1.36). Folding mark `w:sz` into content made BodyText runs with no
812
- * direct size paint at the mark's size (Selection Notice "or" alternative → 6.5pt).
813
- */
814
- readonly runProperties: readonly OoxmlProperty[];
815
- /**
816
- * Content cascade plus direct `w:pPr/w:rPr` — empty-line metrics and last-line mark height.
817
- */
818
- readonly markRunProperties: readonly OoxmlProperty[];
819
- /**
820
- * The style this paragraph resolved to, or null when it names none and there is no
821
- * document default. `w:contextualSpacing` compares neighbours by exactly this.
822
- */
823
- readonly styleId: string | null;
824
- }
825
- /** Accepted style ids only — over-long, control-bearing, or dangerous keys are dropped. */
826
- declare function isValidStyleId(raw: string | undefined): raw is string;
827
- /**
828
- * What a table style contributes to the paragraphs of ONE cell: the style's whole-table
829
- * `w:pPr`/`w:rPr` followed by every `w:tblStylePr` the cell is under (17.7.6.6), weakest
830
- * first in the caller's condition order (banding, column, row, corner).
831
- *
832
- * This is how Word makes a header row bold and centred while the document states nothing
833
- * but `<w:tblStyle w:val="…"/>` on the table and plain runs in the cells.
834
- */
835
- interface TableCellStyleFormatting {
836
- readonly paragraphProperties: readonly OoxmlProperty[];
837
- /** Matching `w:pPr` nodes, for nested `w:pBdr` / `w:tabs` resolution. */
838
- readonly paragraphPropertyNodes: readonly OoxmlElement[];
839
- /** Inherited run properties for every run in the cell, before the paragraph style. */
840
- readonly runProperties: readonly OoxmlProperty[];
841
- }
842
- /**
843
- * Build a cascade table from a styles part root.
844
- *
845
- * Only direct `w:style` children of the root participate (bounded count). Duplicate
846
- * `styleId` values keep the last definition, matching Word's reader for this fixture class.
847
- * Default paragraph/character style ids track `w:default="1"` with the same last-wins rule.
848
- */
849
- declare function buildStyleCascadeTable(stylesRoot: OoxmlElement | null, themeFonts?: ThemeFonts): StyleCascadeTable;
850
- /**
851
- * Cascade paragraph + inherited run properties for one paragraph's direct `w:pPr`.
852
- *
853
- * Order: `docDefaults` → table style → `basedOn` ancestors → paragraph style → direct
854
- * formatting, which is the style hierarchy of 17.7.2: a table style sits above the document
855
- * defaults and below the paragraph style a cell paragraph names for itself.
856
- * When `w:pStyle` is absent, the document's default paragraph style (`w:default="1"`) is used.
857
- * Direct formatting is last so it overrides inherited values inside the existing resolvers.
858
- */
859
- declare function cascadeParagraphFormatting(table: StyleCascadeTable, directPPr: OoxmlNode | undefined, tableCellStyle?: TableCellStyleFormatting): CascadedParagraphFormatting;
860
- /**
861
- * Bottom border after cascade: a later `w:pBdr` replaces an earlier one; absence inherits.
862
- * `nil`/`none` clear the edge via `paragraphBorders`.
863
- */
864
- declare function cascadedBottomBorder(paragraphPropertyNodes: readonly OoxmlNode[]): ParagraphBorderEdge | undefined;
865
- /**
866
- * Merge inherited paragraph-style run props with a run's direct `rPr` (direct last).
867
- *
868
- * When a cascade table is supplied, also resolves `w:rStyle` character styles (basedOn chain,
869
- * cycle/depth capped). Runs without an explicit `rStyle` pick up the default character style
870
- * (`w:default="1"`). Precedence: inherited → character style chain → direct formatting.
871
- */
872
- declare function cascadeRunProperties(inheritedRunProperties: readonly OoxmlProperty[], directRunProperties: readonly OoxmlProperty[], table?: StyleCascadeTable): readonly OoxmlProperty[];
873
- /** Everything the line breaker needs about one paragraph, already cascaded and converted. */
874
- interface ParagraphLayoutInputs {
875
- readonly props: OoxmlProperty[];
876
- readonly indent: {
877
- left: number;
878
- right: number;
879
- hanging: number;
880
- firstLine: number;
881
- };
882
- readonly available: number;
883
- readonly alignment: Alignment;
884
- readonly spacing: ParagraphSpacing;
885
- /** Resolved `w:line` / `w:lineRule`; single spacing where the cascade says nothing. */
886
- readonly lineSpacing: ParagraphLineSpacing;
887
- /** `w:contextualSpacing`: drop before/after between same-style neighbours. */
888
- readonly contextualSpacing: boolean;
889
- /** Resolved paragraph style id, for the `w:contextualSpacing` neighbour comparison. */
890
- readonly styleId: string | null;
891
- readonly bottomBorder: ParagraphBorderEdge | undefined;
892
- /**
893
- * Every `CT_PBdr` edge after cascade, not just the bottom one.
894
- *
895
- * `bottomBorder` stays alongside it because the fragment signature and the table flow
896
- * read that field by name; this is the whole box, so a cell paragraph gets the same
897
- * frame a body paragraph does.
898
- */
899
- readonly borders: ParagraphBorders;
900
- /** Validated 6-hex paragraph shading fill from cascaded `w:pPr/w:shd`, absent for none. */
901
- readonly shading: string | undefined;
902
- readonly inheritedRunProperties: readonly OoxmlProperty[];
903
- /**
904
- * Paragraph-mark cascade (`inheritedRunProperties` + direct `w:pPr/w:rPr`).
905
- * Empty-line sizing and last-line mark height — never content-run face.
906
- */
907
- readonly markRunProperties: readonly OoxmlProperty[];
908
- /** Cascaded custom tab stops + default interval for paragraph-flow breaking. */
909
- readonly tabStops: ResolvedTabStops;
910
- /**
911
- * Fingerprint folded into the paragraph layout cache key — nested `w:tabs` are absent
912
- * from flat property bags, so style-inherited stops must be named explicitly.
913
- */
914
- readonly tabStopsCacheToken: string;
915
- /** Resolved list marker inputs when the paragraph participates in numbering. */
916
- readonly listItem?: ResolvedListItem;
917
- }
918
- /**
919
- * Resolve every paragraph input semantic layout / table cells share: cascaded props when a
920
- * style table is present, otherwise direct formatting only.
921
- *
922
- * When `listItem` is provided, its merged level indent becomes the paragraph indent (list
923
- * hanging / left from `numbering.xml`), which is what Word uses for fixture list paragraphs
924
- * that author no direct `w:ind`.
925
- *
926
- * `tableCellStyle` carries what the enclosing table's style says about this cell's
927
- * paragraphs; body paragraphs pass nothing.
928
- *
929
- * `inTableCell` is asked for separately because a cell paragraph may have no table style to
930
- * inherit at all, and `w:beforeAutospacing` still needs to know it is in a cell.
931
- */
932
- declare function resolveParagraphLayoutInputs(paragraph: OoxmlElement, contentWidth: number, styleCascade: StyleCascadeTable | undefined, listItem?: ResolvedListItem, tableCellStyle?: TableCellStyleFormatting, inTableCell?: boolean): ParagraphLayoutInputs;
933
-
934
960
  /**
935
961
  * What one cell side is before any ADJACENT cell has its say.
936
962
  *
@@ -1891,7 +1917,8 @@ interface HeaderFooterStoryLayout {
1891
1917
  */
1892
1918
  interface HeaderFooterStoryInputs {
1893
1919
  /**
1894
- * `numbering.xml`, so a `w:numPr` paragraph in this story resolves a marker.
1920
+ * `numbering.xml`, so a `w:numPr` paragraph in this story resolves a marker — directly or
1921
+ * inside an anchored text box, which lays out with its own per-box counters.
1895
1922
  *
1896
1923
  * Absent, the story lays out exactly as before: no marker record, and no numbering indent
1897
1924
  * merged into the paragraph's own.
@@ -2097,8 +2124,9 @@ interface SemanticLayoutOptions {
2097
2124
  */
2098
2125
  readonly notes?: NotesLayoutInput;
2099
2126
  /**
2100
- * Per-page bottom reserves (points) subtracted from content height before line placement.
2101
- * Produced by the note reflow loop; absent means full content column.
2127
+ * Per-page bottom reserves (points) subtracted from content height before line placement,
2128
+ * keyed by DOCUMENT page index. A section's pass reads its own slice through
2129
+ * `pageIndexStart`. Produced by the note reflow loop; absent means full content column.
2102
2130
  */
2103
2131
  readonly pageBottomReserves?: ReadonlyMap<number, number>;
2104
2132
  /** Derived note marks for body/note projection (provisional or final). */