@docx-editor.dev/core 2.12.0 → 2.14.0
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 +18 -14
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.cts +5 -5
- package/dist/automation.d.ts +5 -5
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +8 -8
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-2PIHW2QM.cjs +1 -0
- package/dist/chunk-2QTY5S6T.js +1 -0
- package/dist/chunk-4Z5MODAE.cjs +2 -0
- package/dist/chunk-5TKAPFZT.cjs +2 -0
- package/dist/chunk-DRQHIQ4R.cjs +1 -0
- package/dist/chunk-F2K6SDHA.cjs +20 -0
- package/dist/chunk-FBA57EUJ.js +2 -0
- package/dist/{chunk-XCFM3G5L.cjs → chunk-KIAP7PFQ.cjs} +1 -1
- package/dist/chunk-KTAQ7BRQ.js +20 -0
- package/dist/chunk-LBAHXZCU.cjs +5 -0
- package/dist/chunk-MCDUQYWP.js +5 -0
- package/dist/chunk-MQP26KCF.js +1 -0
- package/dist/chunk-NDJGSR6M.cjs +19 -0
- package/dist/chunk-NJNFJPGB.cjs +11 -0
- package/dist/chunk-O5M4CR4P.cjs +2 -0
- package/dist/{chunk-W77HJGYX.js → chunk-OKEDGR65.js} +1 -1
- package/dist/{chunk-WU7PUTVA.js → chunk-RIYSCEFQ.js} +1 -1
- package/dist/chunk-UKUOZXUD.js +19 -0
- package/dist/chunk-VQ4R5LTU.js +2 -0
- package/dist/chunk-ZBEJHJN2.js +11 -0
- package/dist/chunk-ZVTW7RGD.js +2 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.cts +3 -3
- package/dist/collaboration/replication.d.ts +3 -3
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.cts +3 -3
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/editor.d.cts +7 -7
- package/dist/contracts/editor.d.ts +7 -7
- package/dist/contracts/interaction.d.cts +7 -7
- package/dist/contracts/interaction.d.ts +7 -7
- package/dist/contracts/modules.d.cts +7 -7
- package/dist/contracts/modules.d.ts +7 -7
- package/dist/{custom-node-writes-D4rMJIES.d.cts → custom-node-writes-C46r3_5O.d.cts} +2 -2
- package/dist/{custom-node-writes-CcNeHH5C.d.ts → custom-node-writes-DntmaAVW.d.ts} +2 -2
- package/dist/{dist-YFULGVS3.js → dist-OSUJGKTK.js} +1 -1
- package/dist/{editor-B76SEMZw.d.cts → editor-AJ06hyyg.d.cts} +45 -9
- package/dist/{editor-BcdsPdbY.d.ts → editor-a6VvsfYU.d.ts} +45 -9
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.cts +22 -22
- package/dist/editor.d.ts +22 -22
- package/dist/editor.js +1 -1
- package/dist/{index-BYTvklN5.d.ts → index-C5ZnSRkF.d.ts} +209 -20
- package/dist/{index-CDGhPib1.d.cts → index-Cbw4lkOt.d.cts} +209 -20
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +203 -593
- package/dist/layout.d.ts +203 -593
- package/dist/layout.js +1 -1
- package/dist/{note-properties-Bx7rXruA.d.ts → note-properties-CDFiNXcD.d.ts} +1 -1
- package/dist/{note-properties-zQ8w04en.d.cts → note-properties-Y6qYh2Hv.d.cts} +1 -1
- package/dist/{omml-equation-69O1Pd8G.d.ts → omml-equation-BY49UOIF.d.ts} +1 -1
- package/dist/{omml-equation-BmV51rim.d.cts → omml-equation-DB8d-jCq.d.cts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +6 -6
- package/dist/output.d.ts +6 -6
- package/dist/output.js +1 -1
- package/dist/{protocol-DC7ueVuo.d.ts → protocol-BsmQgblT.d.ts} +2 -2
- package/dist/{protocol-FTXtrAIT.d.cts → protocol-gOY5GA8K.d.cts} +2 -2
- package/dist/{review-items-B78OsJU2.d.ts → review-items-CCS1h93f.d.ts} +1 -1
- package/dist/{review-items-C-2WQdEb.d.cts → review-items-CaAkgi5s.d.cts} +1 -1
- package/dist/{review-reads-UexYBp-m.d.ts → review-reads-BjZYeMd4.d.ts} +8 -21
- package/dist/{review-reads-CbBQlb-n.d.cts → review-reads-DEsV0OOW.d.cts} +8 -21
- package/dist/{revision-projection-6u8lae9J.d.cts → revision-projection-BeXVrSSV.d.ts} +24 -3
- package/dist/{revision-projection-B2v9U3qx.d.ts → revision-projection-DXbrfNGD.d.cts} +24 -3
- package/dist/{semantic-cell-selection-DsYz2Vg3.d.ts → semantic-cell-selection-BK91NCCG.d.ts} +16 -7
- package/dist/{semantic-cell-selection-nEE7E3Z8.d.cts → semantic-cell-selection-BMhku3B1.d.cts} +16 -7
- package/dist/{semantic-interaction-C00BpIyC.d.ts → semantic-interaction-BmQ7h2cq.d.ts} +4 -2
- package/dist/{semantic-interaction-DiOX0FIH.d.cts → semantic-interaction-DUAnxbgf.d.cts} +4 -2
- package/dist/{semantic-paint-Cc11nrDL.d.cts → semantic-paint-DufNL1Zr.d.cts} +2 -2
- package/dist/{semantic-paint-ofuoBsYo.d.ts → semantic-paint-WJD2KeG1.d.ts} +2 -2
- package/dist/{semantic-records-CRG1r6-a.d.cts → semantic-records-92UnKeU_.d.ts} +1146 -10
- package/dist/{semantic-records-CzI0ZEuR.d.ts → semantic-records-BpozY7-j.d.cts} +1146 -10
- package/dist/shaped-measurer-BWbindlI.d.ts +168 -0
- package/dist/shaped-measurer-CFPnXFs9.d.cts +168 -0
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +26 -16
- package/dist/store.d.ts +26 -16
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-CA7qgAUF.d.cts → tree-op-types-BUulYD5y.d.cts} +15 -2
- package/dist/{tree-op-types-HKfUzt_-.d.ts → tree-op-types-D6HzlPR4.d.ts} +15 -2
- package/dist/{tree-package-fragment-oJZX_5iN.d.ts → tree-package-fragment-CWFjgH6a.d.ts} +3 -11
- package/dist/{tree-package-fragment-Cz-v-0B3.d.cts → tree-package-fragment-Dhyw7oPm.d.cts} +3 -11
- package/dist/{tree-session-contract-BPDLrEPX.d.ts → tree-session-contract-B2HfGt79.d.ts} +33 -6
- package/dist/{tree-session-contract-Cbl87xa8.d.cts → tree-session-contract-BY9xd7s_.d.cts} +33 -6
- package/dist/{tree-store-B7hd6cEa.d.ts → tree-store-APgWx6qn.d.ts} +1 -1
- package/dist/{tree-store-BenW0Mg_.d.cts → tree-store-DEEQ9wz_.d.cts} +1 -1
- package/package.json +5 -2
- package/dist/chunk-3JON7JMD.cjs +0 -1
- package/dist/chunk-5V6FNKBE.cjs +0 -2
- package/dist/chunk-BXRVGHTY.cjs +0 -18
- package/dist/chunk-BXTTPJSH.js +0 -5
- package/dist/chunk-ILTZTY3K.cjs +0 -10
- package/dist/chunk-IUM7FZPA.js +0 -2
- package/dist/chunk-JWZG4QJ5.cjs +0 -2
- package/dist/chunk-JXZYDBKU.cjs +0 -19
- package/dist/chunk-KBOOIC2Q.js +0 -19
- package/dist/chunk-L6XZTLPS.js +0 -10
- package/dist/chunk-L7OR5TJK.cjs +0 -5
- package/dist/chunk-MHQNR2OU.js +0 -2
- package/dist/chunk-MLGPISGH.js +0 -1
- package/dist/chunk-NJXQABQU.js +0 -18
- package/dist/chunk-TKEGK4GQ.cjs +0 -2
- package/dist/chunk-VGFMPWND.js +0 -2
- package/dist/shaped-measurer-CkOGZQn9.d.ts +0 -611
- package/dist/shaped-measurer-CneACGcP.d.cts +0 -611
package/dist/layout.d.cts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { V as VersionedShapingLibrary,
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties } from './note-properties-zQ8w04en.cjs';
|
|
1
|
+
import { g as NumberingLevel, h as NumberingIndex, i as LayoutBox, D as DrawingPoint, j as DrawingInsets, a as StyleSpanRecord, I as InlineDrawingRecord, M as ModelRange, S as SemanticLayout, B as BlockFragmentRecord, A as AnchoredDrawingRecord, k as PageRecord, l as TableBorderSide, C as ContentControlBoundaryRecord$1, m as ContentControlLock, n as ParagraphFragmentRecord, L as LineRecord, T as TextMeasurer, V as VersionedShapingLibrary, b as TextShaper, o as FontByteValidator, c as FixedPointRoundingMode, p as FixedPoint, q as ShapedRun, r as InlineDrawingLayoutContext, s as StyleCascadeTable, H as HyperlinkProjector, t as FieldLinkProjector, u as RefFieldContext, v as StoryPageFieldNeeds, P as PageGeometry, w as ResolvedListItem, x as CellBorderBox, y as TableCellStyleFormatting, z as TableBorderBox } from './semantic-records-BpozY7-j.cjs';
|
|
2
|
+
export { E as AUTO_PARAGRAPH_SPACING_PT, G as AbstractNumDefinition, J as BidiEmbeddingLevels, K as BorderGridGeometry, O as CascadedParagraphFormatting, Q as ContentControlGeometryFragment, U as ContentControlLevel, W as ContentControlMappedType, X as DEFAULT_PAGE_GEOMETRY, Y as DEFAULT_RUN_STYLE, Z as DEFAULT_TAB_INTERVAL_PT, _ as DEFAULT_TAB_INTERVAL_TWIPS, $ as DeclaredFontSubstitution, a0 as EMPTY_NUMBERING_INDEX, a1 as EMPTY_TAB_STOPS, a2 as EquationFractionGeometry, a3 as EquationGeometry, a4 as EquationNaryGeometry, a5 as EquationRadicalGeometry, a6 as EquationRowGeometry, a7 as EquationScriptGeometry, a8 as EquationSpanRecord, a9 as EquationTextGeometry, aa as FieldAtomMarker, ab as FontFingerprintInputs, ac as FontRequest, ad as FontResolutionError, ae as FontResolutionErrorCode, af as FontResourceDefinition, ag as FontResourceInstrumentation, F as FontResourceSnapshot, ah as FontResourceSnapshotOptions, ai as FontSlot, aj as FontSubstitution, ak as FontValidationResult, al as GlyphOutline, am as HARD_MAX_AGGREGATE_FONT_BYTES, an as HARD_MAX_FONT_BYTES, ao as HARD_MAX_FONT_SOURCES, ap as HeaderFooterStoryRecord, aq as HyperlinkFieldSpec, ar as LevelOverride, as as LineSpacingRule, at as ListMarkerAlign, au as ListMarkerRecord, av as ListSuffix, aw as MAX_BORDER_SPACE_PT, ax as MAX_BORDER_WIDTH_PT, ay as MAX_LVL_OVERRIDES, az as MAX_NUMBERING_DEFINITIONS, aA as MAX_PARAGRAPH_SPACING_PT, aB as MAX_STYLE_BASED_ON_DEPTH, aC as MAX_STYLE_DEFINITIONS, aD as MAX_TABLE_BORDER_STROKES, aE as MAX_TAB_POSITION_TWIPS, aF as MAX_TAB_STOPS, N as NormalizationPolicy, aG as NumDefinition, aH as NumberingLevelIndent, aI as PARAGRAPH_BORDER_SIDES, aJ as PageRefCalibrationCell, aK as PageRefFieldProjection, aL as ParagraphAutoSpacingContext, aM as ParagraphBorderEdge, aN as ParagraphBorderSide, aO as ParagraphBorderStrokeRecord, aP as ParagraphBorders, aQ as ParagraphBottomBorderRecord, aR as ParagraphIndent, aS as ParagraphLayoutInputs, aT as ParagraphLineSpacing, aU as ParagraphSpacing, aV as RefFieldSpec, aW as RefNoteParts, aX as ResolvedCellBorders, d as ResolvedFont, R as ResolvedRunStyle, aY as ResolvedTabStops, aZ as ResolvedTableBorderEdge, a_ as ResolvedTableBorderEdgeSegment, a$ as ResolvedUnderline, b0 as SINGLE_LINE_SPACING, b1 as ScriptItem, b2 as ShapeInput, b3 as ShapedCluster, b4 as ShapedFontSpan, b5 as ShapedGlyph, b6 as ShapedRunComparatorInputs, b7 as ShapedVerticalMetrics, b8 as ShapingEnvironment, b9 as ShapingEnvironmentFingerprintInputs, ba as ShapingEnvironmentInput, bb as SourceRange, bc as SpanLinkRecord, bd as StyleDefinition, be as TAB_LEADER_GLYPH, bf as TabAlignment, bg as TabDestination, bh as TabLeader, bi as TabStop, bj as TableBorderSideName, bk as TableBorderStrokeRecord, f as TableCellFragmentRecord, bl as TableFragmentRecord, e as TableRowFragmentRecord, bm as TextDirection, bn as UnsupportedScriptError, bo as VerticalAlign, bp as appliedSpaceBefore, bq as applyLineSpacing, br as baselineShiftPtOf, bs as borderExtentPt, bt as borderWeight, bu as bottomBorderExtentPt, bv as boundedStructuralFontValidator, bw as buildNumberingIndex, bx as buildStyleCascadeTable, by as cascadeParagraphFormatting, bz as cascadeRunProperties, bA as cascadedBottomBorder, bB as cascadedParagraphBorders, bC as cascadedTabStops, bD as collapsedSpaceBefore, bE as createFontResourceSnapshot, bF as createShapedRun, bG as createShapingEnvironment, bH as defaultTabIntervalFromSettings, bI as displayText, bJ as fixedPoint, bK as fontRequestKey, bL as isValidStyleId, bM as itemizeScriptFontSlots, bN as layoutEquation, bO as listMarkerBox, bP as measureDisplayText, bQ as mergeListIndent, bR as nextTabDestination, bS as paragraphBorderExtentPt, bT as paragraphBorderStrokeWidthPt, bU as paragraphBorders, bV as paragraphBordersFingerprint, bW as paragraphBreaksBefore, bX as paragraphContextualSpacing, bY as paragraphLineSpacing, bZ as paragraphSpacing, b_ as paragraphTabStops, b$ as parseRefInstruction, c0 as readBorderSide, c1 as readCellBorders, c2 as readNumPr, c3 as readTableBorders, c4 as resolveBorderConflict, c5 as resolveNumberingLevel, c6 as resolveParagraphLayoutInputs, c7 as resolveRunStyle, c8 as resolveStoryListItems, c9 as resolveStoryRefFields, ca as resolveTableCellBorderGrid, cb as runStylesEqual, cc as shapedRunComparatorInputs, cd as shapingEnvironmentFingerprint, ce as shapingEnvironmentFingerprintInputs, cf as styleForFontSlot, cg as tabAdvanceWidth, ch as tabStopsFingerprint, ci as walkStoryParagraphs, cj as withDefaultTabInterval, ck as withNumberingStyleLinks, cl as withResolvedListItems } from './semantic-records-BpozY7-j.cjs';
|
|
3
|
+
export { C as CacheLookup, a as CacheMiss, b as CacheProvenance, L as LayoutShapingOptions, O as OperationSnapshot, c as OperationSnapshotField, d as OperationSnapshotGuard, R as ResolvedCache, e as ResourceDependencyProvenance, S as ShapedMeasurerOptions, f as captureOperationSnapshot, g as createShapedMeasurer, h as guardOperationSnapshot } from './shaped-measurer-CFPnXFs9.cjs';
|
|
4
|
+
import { a as OoxmlNode, s as OoxmlProperty, I as ImpactClass, g as OoxmlElement, O as OoxmlPart, T as TreeDocOp, b as OoxmlPackage, $ as ContentControlKind, a0 as ContentControlLevel, a1 as ContentControlLock$1, a2 as ContentControlDataBinding } from './tree-op-types-BUulYD5y.cjs';
|
|
5
|
+
export { _ as TableBorderStyle } from './tree-op-types-BUulYD5y.cjs';
|
|
6
|
+
import { N as NoteKind, T as TreeModelChange, n as noteTypeOf } from './tree-store-DEEQ9wz_.cjs';
|
|
7
|
+
import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties } from './note-properties-Y6qYh2Hv.cjs';
|
|
9
8
|
import { D as DocumentProperties } from './document-properties-D6Ahr8D6.cjs';
|
|
10
|
-
import {
|
|
11
|
-
export { D as DEFAULT_REVISION_DISPLAY_MODE,
|
|
12
|
-
import { a as SectionColumns } from './semantic-cell-selection-
|
|
13
|
-
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
|
|
14
|
-
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-
|
|
15
|
-
import { a as ReviewItem } from './review-items-
|
|
16
|
-
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-
|
|
17
|
-
import { S as SemanticPosition, b as SelectionRect, a as SemanticSelection } from './semantic-interaction-
|
|
18
|
-
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 deletedTextBoundaries, k as hitTestSemantic, m as moveCaret, p as paragraphTextFromLayout, s as spansInSelection } from './semantic-interaction-
|
|
19
|
-
import './omml-equation-
|
|
9
|
+
import { b as RevisionAttribution, R as RevisionDisplayMode, a as RevisionAuthorFilter } from './revision-projection-DXbrfNGD.cjs';
|
|
10
|
+
export { D as DEFAULT_REVISION_DISPLAY_MODE, c as RevisionFilter, d as RevisionKind, f as formatRevisionOf, m as markRevisionRemovesMark, p as paragraphMarkFormatRevisionOf, e as paragraphMarkRevisionOf, g as paragraphMarkRevisionsOf, r as revisionAuthorFilter, h as revisionsAreDeletion, i as revisionsVisible, s as shownMarkRevision } from './revision-projection-DXbrfNGD.cjs';
|
|
11
|
+
import { a as SectionColumns } from './semantic-cell-selection-BMhku3B1.cjs';
|
|
12
|
+
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 projectedSectionSourceIndexes, J as readSectionProperties, K as spanOffsetX, L as spansInCells, N as tableContextAt } from './semantic-cell-selection-BMhku3B1.cjs';
|
|
13
|
+
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-DEsV0OOW.cjs';
|
|
14
|
+
import { a as ReviewItem } from './review-items-CaAkgi5s.cjs';
|
|
15
|
+
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-CaAkgi5s.cjs';
|
|
16
|
+
import { S as SemanticPosition, b as SelectionRect, a as SemanticSelection } from './semantic-interaction-DUAnxbgf.cjs';
|
|
17
|
+
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 deletedTextBoundaries, k as hitTestSemantic, m as moveCaret, p as paragraphTextFromLayout, s as spansInSelection } from './semantic-interaction-DUAnxbgf.cjs';
|
|
18
|
+
import './omml-equation-DB8d-jCq.cjs';
|
|
20
19
|
import './contracts/types.cjs';
|
|
21
20
|
|
|
21
|
+
/** Synchronous platform-neutral SHA-256 used before font bytes cross into a shaping implementation. */
|
|
22
|
+
declare const sha256FontBytes: (bytes: Uint8Array) => string;
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Page-field evaluation context for furniture projection.
|
|
24
26
|
*
|
|
@@ -46,6 +48,45 @@ interface FieldPageContext {
|
|
|
46
48
|
*/
|
|
47
49
|
declare function formatPageNumber(value: number, format: string | undefined): string;
|
|
48
50
|
|
|
51
|
+
/**
|
|
52
|
+
* The result of counting ONE list paragraph: the level that applied, the counter vector after it,
|
|
53
|
+
* and the marker text a reader sees.
|
|
54
|
+
*
|
|
55
|
+
* Counters are a vector across all nine levels, not a single number, because a deeper level
|
|
56
|
+
* restarting resets the ones below it while leaving those above intact.
|
|
57
|
+
*/
|
|
58
|
+
interface ListCounterAdvance {
|
|
59
|
+
/** Effective abstract numbering template for this num instance. */
|
|
60
|
+
readonly abstractNumId: string;
|
|
61
|
+
readonly numId: string;
|
|
62
|
+
readonly ilvl: number;
|
|
63
|
+
readonly level: NumberingLevel;
|
|
64
|
+
/** Counter vector after this item was counted (indices 0..8). */
|
|
65
|
+
readonly counters: readonly number[];
|
|
66
|
+
/** Expanded marker text (empty when vanished / empty lvlText). */
|
|
67
|
+
readonly markerText: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The running counters for one layout pass over one story.
|
|
71
|
+
*
|
|
72
|
+
* Stateful and order-dependent by nature: a list number is a function of every numbered paragraph
|
|
73
|
+
* before it, which is why markers are computed during layout and cannot be read off a paragraph
|
|
74
|
+
* in isolation.
|
|
75
|
+
*/
|
|
76
|
+
interface ListCounterState {
|
|
77
|
+
/**
|
|
78
|
+
* Advance counters for one list paragraph.
|
|
79
|
+
*
|
|
80
|
+
* Returns null when the numbering definition cannot be resolved — callers treat the
|
|
81
|
+
* paragraph as non-list (inert fallback).
|
|
82
|
+
*/
|
|
83
|
+
advance(numId: string, ilvl: number): ListCounterAdvance | null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create a fresh counter bag for one story (body, or one header/footer part).
|
|
87
|
+
*/
|
|
88
|
+
declare function createListCounterState(index: NumberingIndex): ListCounterState;
|
|
89
|
+
|
|
49
90
|
/**
|
|
50
91
|
* Lookup of derived display marks keyed by {@link formatNoteScopeId}.
|
|
51
92
|
*
|
|
@@ -195,144 +236,6 @@ interface ParagraphLayoutCacheOptions {
|
|
|
195
236
|
*/
|
|
196
237
|
declare function createParagraphLayoutCache<T>(options?: ParagraphLayoutCacheOptions): ParagraphLayoutCache<T>;
|
|
197
238
|
|
|
198
|
-
/** Soft ceiling on abstractNum / num entries read from one part. */
|
|
199
|
-
declare const MAX_NUMBERING_DEFINITIONS = 512;
|
|
200
|
-
/** Soft ceiling on override entries per `w:num`. */
|
|
201
|
-
declare const MAX_LVL_OVERRIDES = 9;
|
|
202
|
-
/** `w:suff` — what separates a list marker from the text after it. */
|
|
203
|
-
type ListSuffix = 'tab' | 'space' | 'nothing';
|
|
204
|
-
/** `w:lvlJc` — how a list marker aligns within its own indent. */
|
|
205
|
-
type ListMarkerAlign = 'left' | 'center' | 'right';
|
|
206
|
-
/**
|
|
207
|
-
* One level's indent, plus which parts the level actually AUTHORED.
|
|
208
|
-
*
|
|
209
|
-
* The provenance matters: `w:ind` cascades per-attribute, so a level that authored only `left`
|
|
210
|
-
* must not overwrite an inherited `hanging` with a synthesized zero.
|
|
211
|
-
*/
|
|
212
|
-
interface NumberingLevelIndent {
|
|
213
|
-
readonly left: number;
|
|
214
|
-
readonly right: number;
|
|
215
|
-
readonly hanging: number;
|
|
216
|
-
readonly firstLine: number;
|
|
217
|
-
/**
|
|
218
|
-
* Which of these the LEVEL actually authored.
|
|
219
|
-
*
|
|
220
|
-
* A level's `w:pPr/w:ind` sits between the paragraph style and direct formatting, so the
|
|
221
|
-
* merge has to tell "the level says left = 0" from "the level says nothing about left and
|
|
222
|
-
* the style's value stands". Absent (the default) reads as "says nothing", which is what a
|
|
223
|
-
* hand-built level in a test means.
|
|
224
|
-
*/
|
|
225
|
-
readonly stated?: {
|
|
226
|
-
readonly left: boolean;
|
|
227
|
-
readonly right: boolean;
|
|
228
|
-
/** `w:hanging`/`w:firstLine` are one mutually exclusive slot (§17.3.1.10, §17.3.1.12). */
|
|
229
|
-
readonly firstLineOffset: boolean;
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
/** One `w:lvl`: how this depth numbers, what its marker looks like, and how it indents. */
|
|
233
|
-
interface NumberingLevel {
|
|
234
|
-
readonly ilvl: number;
|
|
235
|
-
readonly start: number;
|
|
236
|
-
readonly numFmt: string;
|
|
237
|
-
readonly lvlText: string;
|
|
238
|
-
readonly lvlJc: ListMarkerAlign;
|
|
239
|
-
readonly suff: ListSuffix;
|
|
240
|
-
readonly indent: NumberingLevelIndent;
|
|
241
|
-
/**
|
|
242
|
-
* `w:lvlRestart` one-based trigger level, or `0` when the level never restarts.
|
|
243
|
-
* Omitted in XML → restart when the previous level (or any earlier level) is used.
|
|
244
|
-
*/
|
|
245
|
-
readonly lvlRestart?: number;
|
|
246
|
-
/**
|
|
247
|
-
* `w:isLgl` (§17.9.9): render EVERY level referenced by this level's `w:lvlText` in
|
|
248
|
-
* decimal, whatever number format those levels declare for themselves.
|
|
249
|
-
*/
|
|
250
|
-
readonly isLgl: boolean;
|
|
251
|
-
/** Level `w:rPr` as flat properties (for marker face / vanish). */
|
|
252
|
-
readonly runProperties: readonly OoxmlProperty[];
|
|
253
|
-
/** True when level run props request vanish — marker must not paint. */
|
|
254
|
-
readonly vanish: boolean;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* One `w:lvlOverride` on a `w:num`: a restart value, a replacement level, or both.
|
|
258
|
-
*
|
|
259
|
-
* How two lists share an abstract definition while numbering independently.
|
|
260
|
-
*/
|
|
261
|
-
interface LevelOverride {
|
|
262
|
-
readonly startOverride?: number;
|
|
263
|
-
/** Full level replacement when `w:lvl` is present under the override. */
|
|
264
|
-
readonly level?: NumberingLevel;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* One `w:abstractNum` — the shape of a list, without being a list.
|
|
268
|
-
*
|
|
269
|
-
* Never referenced by a paragraph directly. Paragraphs name a {@link NumDefinition}, which names
|
|
270
|
-
* one of these, so several lists can share a definition and still count separately.
|
|
271
|
-
*/
|
|
272
|
-
interface AbstractNumDefinition {
|
|
273
|
-
readonly abstractNumId: string;
|
|
274
|
-
readonly levels: ReadonlyMap<number, NumberingLevel>;
|
|
275
|
-
/**
|
|
276
|
-
* `w:numStyleLink` (§17.9.21): this definition carries no levels of its own — the numbering
|
|
277
|
-
* lives on the named style. Word follows the link; resolve it with
|
|
278
|
-
* {@link resolveNumberingStyleLinks} before reading levels, or every paragraph on this
|
|
279
|
-
* abstract renders with NO marker at all.
|
|
280
|
-
*/
|
|
281
|
-
readonly numStyleLink?: string;
|
|
282
|
-
/**
|
|
283
|
-
* `w:styleLink` (§17.9.23): the definition side of the same pair — this abstract IS the
|
|
284
|
-
* numbering of the named style. Kept so a link can be verified rather than assumed.
|
|
285
|
-
*/
|
|
286
|
-
readonly styleLink?: string;
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* One `w:num` — the thing a paragraph's `w:numId` actually names.
|
|
290
|
-
*
|
|
291
|
-
* Points at an {@link AbstractNumDefinition} and may override any of its levels.
|
|
292
|
-
*/
|
|
293
|
-
interface NumDefinition {
|
|
294
|
-
readonly numId: string;
|
|
295
|
-
readonly abstractNumId: string;
|
|
296
|
-
readonly overrides: ReadonlyMap<number, LevelOverride>;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* The bounded projection of `numbering.xml` that list layout resolves against.
|
|
300
|
-
*
|
|
301
|
-
* Projection ONLY — never a mutation or serialization authority. Hostile values are dropped or
|
|
302
|
-
* clamped, and a missing definition resolves to "no list" rather than a guess.
|
|
303
|
-
*/
|
|
304
|
-
interface NumberingIndex {
|
|
305
|
-
readonly abstractNums: ReadonlyMap<string, AbstractNumDefinition>;
|
|
306
|
-
readonly nums: ReadonlyMap<string, NumDefinition>;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Build a numbering index from the root of a numbering part (`w:numbering`).
|
|
310
|
-
*
|
|
311
|
-
* Empty / missing roots yield an empty index. Duplicate ids keep the first definition.
|
|
312
|
-
*/
|
|
313
|
-
/**
|
|
314
|
-
* Project `numbering.xml` into the bounded index.
|
|
315
|
-
*
|
|
316
|
-
* Every ceiling here exists because the input is file-derived: definition counts, override
|
|
317
|
-
* counts, indent magnitudes and style-link hop depth are all capped, and nothing from the file
|
|
318
|
-
* becomes a loop bound or an allocation size.
|
|
319
|
-
*/
|
|
320
|
-
declare function buildNumberingIndex(root: OoxmlElement | null | undefined): NumberingIndex;
|
|
321
|
-
/** Resolve the effective level for a `numId` + `ilvl`, applying overrides. */
|
|
322
|
-
/**
|
|
323
|
-
* The effective level for one paragraph's numbering reference, after overrides and style links.
|
|
324
|
-
*
|
|
325
|
-
* Answers null for a reference the index cannot resolve — a paragraph naming a definition the
|
|
326
|
-
* file never declared is an unnumbered paragraph, not an error.
|
|
327
|
-
*/
|
|
328
|
-
declare function resolveNumberingLevel(index: NumberingIndex, numId: string, ilvl: number): {
|
|
329
|
-
readonly abstractNumId: string;
|
|
330
|
-
readonly level: NumberingLevel;
|
|
331
|
-
readonly startOverride?: number;
|
|
332
|
-
} | null;
|
|
333
|
-
/** Empty index for tests / documents without numbering. */
|
|
334
|
-
declare const EMPTY_NUMBERING_INDEX: NumberingIndex;
|
|
335
|
-
|
|
336
239
|
type WrapTextSide = 'bothSides' | 'left' | 'right' | 'largest';
|
|
337
240
|
interface WrapExclusionInput {
|
|
338
241
|
readonly mode: 'square' | 'tight' | 'through' | 'topAndBottom';
|
|
@@ -400,234 +303,6 @@ interface PendingLine {
|
|
|
400
303
|
anchorRevisions?: readonly RevisionAttribution[];
|
|
401
304
|
}
|
|
402
305
|
|
|
403
|
-
/** Horizontal alignment of a paragraph (`w:jc`, ECMA-376 §17.3.1.13). */
|
|
404
|
-
type Alignment = 'left' | 'center' | 'right' | 'both';
|
|
405
|
-
|
|
406
|
-
/** Soft ceiling on `basedOn` chain length — enough for real templates, refuses hostile graphs. */
|
|
407
|
-
declare const MAX_STYLE_BASED_ON_DEPTH = 32;
|
|
408
|
-
/** Soft ceiling on style definitions read from one styles part. */
|
|
409
|
-
declare const MAX_STYLE_DEFINITIONS = 4096;
|
|
410
|
-
/** One `w:style` as the cascade reads it: its properties, and the style it is based on. */
|
|
411
|
-
interface StyleDefinition {
|
|
412
|
-
readonly styleId: string;
|
|
413
|
-
readonly type: string;
|
|
414
|
-
readonly basedOn: string | null;
|
|
415
|
-
/**
|
|
416
|
-
* `w:next` — the style Word gives the paragraph that FOLLOWS one in this style.
|
|
417
|
-
*
|
|
418
|
-
* Nothing in layout reads it: it is a rule about authoring, not about painting. It is
|
|
419
|
-
* read here because this is the one place `styles.xml` is parsed, and a second reader
|
|
420
|
-
* would be a second answer to what a style id means.
|
|
421
|
-
*/
|
|
422
|
-
readonly next: string | null;
|
|
423
|
-
readonly paragraphProperties: readonly OoxmlProperty[];
|
|
424
|
-
readonly runProperties: readonly OoxmlProperty[];
|
|
425
|
-
/** The style's `w:pPr` node, when present — needed for nested `w:pBdr`. */
|
|
426
|
-
readonly paragraphPropertiesNode: OoxmlElement | undefined;
|
|
427
|
-
/** The style's `w:tblPr`, for a `w:type="table"` style. */
|
|
428
|
-
readonly tablePropertiesNode: OoxmlElement | undefined;
|
|
429
|
-
/**
|
|
430
|
-
* `w:tblStylePr` conditional formats by `w:type` (`firstRow`, `band1Horz`, …).
|
|
431
|
-
*
|
|
432
|
-
* Word puts a table's real appearance here: `Table Grid` carries its grid in the style's
|
|
433
|
-
* `w:tblBorders`, and the banded/header looks live in these. A document states only
|
|
434
|
-
* `<w:tblStyle w:val="TableGrid"/>`.
|
|
435
|
-
*/
|
|
436
|
-
readonly conditionalTableFormats: ReadonlyMap<string, OoxmlElement>;
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* The whole styles part, indexed and ready to resolve against.
|
|
440
|
-
*
|
|
441
|
-
* `cacheToken` is load-bearing: it folds into layout cache producers so breaks measured under one
|
|
442
|
-
* styles part are never reused under another.
|
|
443
|
-
*/
|
|
444
|
-
interface StyleCascadeTable {
|
|
445
|
-
/**
|
|
446
|
-
* Bounded fingerprint folded into layout cache producers so a different styles part cannot
|
|
447
|
-
* reuse breaks measured under another cascade. Computed once per table (FNV-1a hex).
|
|
448
|
-
*/
|
|
449
|
-
readonly cacheToken: string;
|
|
450
|
-
readonly docDefaultsRun: readonly OoxmlProperty[];
|
|
451
|
-
readonly docDefaultsParagraph: readonly OoxmlProperty[];
|
|
452
|
-
readonly docDefaultsParagraphNode: OoxmlElement | undefined;
|
|
453
|
-
/** `w:style[@w:default='1'][@w:type='paragraph']` — last wins among defaults of that type. */
|
|
454
|
-
readonly defaultParagraphStyleId: string | null;
|
|
455
|
-
/** `w:style[@w:default='1'][@w:type='character']` — last wins among defaults of that type. */
|
|
456
|
-
readonly defaultCharacterStyleId: string | null;
|
|
457
|
-
/**
|
|
458
|
-
* `w:style[@w:default='1'][@w:type='table']` — last wins among defaults of that type.
|
|
459
|
-
*
|
|
460
|
-
* A `w:tbl` with no `w:tblStyle` still resolves against this one. Word's own
|
|
461
|
-
* `TableNormal` is where the 0/108/0/108 twip cell margins live, so skipping it gives
|
|
462
|
-
* every unstyled table padding the document says it does not have.
|
|
463
|
-
*/
|
|
464
|
-
readonly defaultTableStyleId: string | null;
|
|
465
|
-
/**
|
|
466
|
-
* The theme part's Latin typefaces, for `w:rFonts` theme references.
|
|
467
|
-
*
|
|
468
|
-
* Lives on the cascade because it is document-level style material with the same
|
|
469
|
-
* lifetime, and because every site that resolves run properties already holds this table.
|
|
470
|
-
*/
|
|
471
|
-
readonly themeFonts: ThemeFonts;
|
|
472
|
-
readonly styles: ReadonlyMap<string, StyleDefinition>;
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* A paragraph's properties after the cascade, plus the same list WITHOUT its own `w:pPr`.
|
|
476
|
-
*
|
|
477
|
-
* Both, because a writer needs to know what a paragraph INHERITS to decide whether setting a
|
|
478
|
-
* value is a change or a no-op — and writing back an inherited value freezes it into the
|
|
479
|
-
* paragraph as though the author had chosen it.
|
|
480
|
-
*/
|
|
481
|
-
interface CascadedParagraphFormatting {
|
|
482
|
-
/** Flat paragraph properties in cascade order (defaults → bases → style → direct). */
|
|
483
|
-
readonly paragraphProperties: readonly OoxmlProperty[];
|
|
484
|
-
/**
|
|
485
|
-
* The same list WITHOUT the paragraph's own `w:pPr` — everything it inherits.
|
|
486
|
-
*
|
|
487
|
-
* Numbering needs the two tiers apart: a level's `w:pPr/w:ind` outranks the style's and is
|
|
488
|
-
* outranked by the paragraph's own, and a flattened list cannot say which is which.
|
|
489
|
-
*/
|
|
490
|
-
readonly inheritedParagraphProperties: readonly OoxmlProperty[];
|
|
491
|
-
/** Matching `w:pPr` nodes for nested border resolution. */
|
|
492
|
-
readonly paragraphPropertyNodes: readonly OoxmlNode[];
|
|
493
|
-
/**
|
|
494
|
-
* Inherited run properties for CONTENT runs (before direct run `rPr`).
|
|
495
|
-
*
|
|
496
|
-
* Does NOT include direct `w:pPr/w:rPr` — that formats the paragraph MARK only
|
|
497
|
-
* (ECMA-376 §17.3.1.36). Folding mark `w:sz` into content made BodyText runs with no
|
|
498
|
-
* direct size paint at the mark's size (Selection Notice "or" alternative → 6.5pt).
|
|
499
|
-
*/
|
|
500
|
-
readonly runProperties: readonly OoxmlProperty[];
|
|
501
|
-
/**
|
|
502
|
-
* Content cascade plus direct `w:pPr/w:rPr` — empty-line metrics and last-line mark height.
|
|
503
|
-
*/
|
|
504
|
-
readonly markRunProperties: readonly OoxmlProperty[];
|
|
505
|
-
/**
|
|
506
|
-
* The style this paragraph resolved to, or null when it names none and there is no
|
|
507
|
-
* document default. `w:contextualSpacing` compares neighbours by exactly this.
|
|
508
|
-
*/
|
|
509
|
-
readonly styleId: string | null;
|
|
510
|
-
}
|
|
511
|
-
/** Accepted style ids only — over-long, control-bearing, or dangerous keys are dropped. */
|
|
512
|
-
declare function isValidStyleId(raw: string | undefined): raw is string;
|
|
513
|
-
/**
|
|
514
|
-
* What a table style contributes to the paragraphs of ONE cell: the style's whole-table
|
|
515
|
-
* `w:pPr`/`w:rPr` followed by every `w:tblStylePr` the cell is under (17.7.6.6), weakest
|
|
516
|
-
* first in the caller's condition order (banding, column, row, corner).
|
|
517
|
-
*
|
|
518
|
-
* This is how Word makes a header row bold and centred while the document states nothing
|
|
519
|
-
* but `<w:tblStyle w:val="…"/>` on the table and plain runs in the cells.
|
|
520
|
-
*/
|
|
521
|
-
interface TableCellStyleFormatting {
|
|
522
|
-
readonly paragraphProperties: readonly OoxmlProperty[];
|
|
523
|
-
/** Matching `w:pPr` nodes, for nested `w:pBdr` / `w:tabs` resolution. */
|
|
524
|
-
readonly paragraphPropertyNodes: readonly OoxmlElement[];
|
|
525
|
-
/** Inherited run properties for every run in the cell, before the paragraph style. */
|
|
526
|
-
readonly runProperties: readonly OoxmlProperty[];
|
|
527
|
-
}
|
|
528
|
-
/**
|
|
529
|
-
* Build a cascade table from a styles part root.
|
|
530
|
-
*
|
|
531
|
-
* Only direct `w:style` children of the root participate (bounded count). Duplicate
|
|
532
|
-
* `styleId` values keep the last definition, matching Word's reader for this fixture class.
|
|
533
|
-
* Default paragraph/character style ids track `w:default="1"` with the same last-wins rule.
|
|
534
|
-
*/
|
|
535
|
-
declare function buildStyleCascadeTable(stylesRoot: OoxmlElement | null, themeFonts?: ThemeFonts): StyleCascadeTable;
|
|
536
|
-
/**
|
|
537
|
-
* Cascade paragraph + inherited run properties for one paragraph's direct `w:pPr`.
|
|
538
|
-
*
|
|
539
|
-
* Order: `docDefaults` → table style → `basedOn` ancestors → paragraph style → direct
|
|
540
|
-
* formatting, which is the style hierarchy of 17.7.2: a table style sits above the document
|
|
541
|
-
* defaults and below the paragraph style a cell paragraph names for itself.
|
|
542
|
-
* When `w:pStyle` is absent, the document's default paragraph style (`w:default="1"`) is used.
|
|
543
|
-
* Direct formatting is last so it overrides inherited values inside the existing resolvers.
|
|
544
|
-
*/
|
|
545
|
-
declare function cascadeParagraphFormatting(table: StyleCascadeTable, directPPr: OoxmlNode | undefined, tableCellStyle?: TableCellStyleFormatting): CascadedParagraphFormatting;
|
|
546
|
-
/**
|
|
547
|
-
* Bottom border after cascade: a later `w:pBdr` replaces an earlier one; absence inherits.
|
|
548
|
-
* `nil`/`none` clear the edge via `paragraphBorders`.
|
|
549
|
-
*/
|
|
550
|
-
declare function cascadedBottomBorder(paragraphPropertyNodes: readonly OoxmlNode[]): ParagraphBorderEdge | undefined;
|
|
551
|
-
/**
|
|
552
|
-
* Merge inherited paragraph-style run props with a run's direct `rPr` (direct last).
|
|
553
|
-
*
|
|
554
|
-
* When a cascade table is supplied, also resolves `w:rStyle` character styles (basedOn chain,
|
|
555
|
-
* cycle/depth capped). Runs without an explicit `rStyle` pick up the default character style
|
|
556
|
-
* (`w:default="1"`). Precedence: inherited → character style chain → direct formatting.
|
|
557
|
-
*
|
|
558
|
-
* PASS `inheritedRunProperties` BY IDENTITY. It must be an array
|
|
559
|
-
* {@link cascadeParagraphFormatting} returned — `runProperties` or `markRunProperties` — and
|
|
560
|
-
* not a copy of one. A toggle property (ECMA-376 §17.7.3) resolves per level of the style
|
|
561
|
-
* hierarchy, and the levels below the character style resolve to more than a true or a false:
|
|
562
|
-
* whether the document defaults' short circuit is still standing decides what the character
|
|
563
|
-
* style's own toggle does next, and no single `w:b` element can spell that. The paragraph
|
|
564
|
-
* cascade attaches that state to the array it returns, so spreading, filtering or sorting the
|
|
565
|
-
* list drops it. (`Object.freeze` returns the same object, so that one is safe.) A list
|
|
566
|
-
* without it is read as one ordinary level, which is the most a bare property list can say
|
|
567
|
-
* and is what a caller assembling its own list gets.
|
|
568
|
-
*/
|
|
569
|
-
declare function cascadeRunProperties(inheritedRunProperties: readonly OoxmlProperty[], directRunProperties: readonly OoxmlProperty[], table?: StyleCascadeTable): readonly OoxmlProperty[];
|
|
570
|
-
/** Everything the line breaker needs about one paragraph, already cascaded and converted. */
|
|
571
|
-
interface ParagraphLayoutInputs {
|
|
572
|
-
readonly props: OoxmlProperty[];
|
|
573
|
-
readonly indent: {
|
|
574
|
-
left: number;
|
|
575
|
-
right: number;
|
|
576
|
-
hanging: number;
|
|
577
|
-
firstLine: number;
|
|
578
|
-
};
|
|
579
|
-
readonly available: number;
|
|
580
|
-
readonly alignment: Alignment;
|
|
581
|
-
readonly spacing: ParagraphSpacing;
|
|
582
|
-
/** Resolved `w:line` / `w:lineRule`; single spacing where the cascade says nothing. */
|
|
583
|
-
readonly lineSpacing: ParagraphLineSpacing;
|
|
584
|
-
/** `w:contextualSpacing`: drop before/after between same-style neighbours. */
|
|
585
|
-
readonly contextualSpacing: boolean;
|
|
586
|
-
/** Resolved paragraph style id, for the `w:contextualSpacing` neighbour comparison. */
|
|
587
|
-
readonly styleId: string | null;
|
|
588
|
-
readonly bottomBorder: ParagraphBorderEdge | undefined;
|
|
589
|
-
/**
|
|
590
|
-
* Every `CT_PBdr` edge after cascade, not just the bottom one.
|
|
591
|
-
*
|
|
592
|
-
* `bottomBorder` stays alongside it because the fragment signature and the table flow
|
|
593
|
-
* read that field by name; this is the whole box, so a cell paragraph gets the same
|
|
594
|
-
* frame a body paragraph does.
|
|
595
|
-
*/
|
|
596
|
-
readonly borders: ParagraphBorders;
|
|
597
|
-
/** Validated 6-hex paragraph shading fill from cascaded `w:pPr/w:shd`, absent for none. */
|
|
598
|
-
readonly shading: string | undefined;
|
|
599
|
-
readonly inheritedRunProperties: readonly OoxmlProperty[];
|
|
600
|
-
/**
|
|
601
|
-
* Paragraph-mark cascade (`inheritedRunProperties` + direct `w:pPr/w:rPr`).
|
|
602
|
-
* Empty-line sizing and last-line mark height — never content-run face.
|
|
603
|
-
*/
|
|
604
|
-
readonly markRunProperties: readonly OoxmlProperty[];
|
|
605
|
-
/** Cascaded custom tab stops + default interval for paragraph-flow breaking. */
|
|
606
|
-
readonly tabStops: ResolvedTabStops;
|
|
607
|
-
/**
|
|
608
|
-
* Fingerprint folded into the paragraph layout cache key — nested `w:tabs` are absent
|
|
609
|
-
* from flat property bags, so style-inherited stops must be named explicitly.
|
|
610
|
-
*/
|
|
611
|
-
readonly tabStopsCacheToken: string;
|
|
612
|
-
/** Resolved list marker inputs when the paragraph participates in numbering. */
|
|
613
|
-
readonly listItem?: ResolvedListItem;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Resolve every paragraph input semantic layout / table cells share: cascaded props when a
|
|
617
|
-
* style table is present, otherwise direct formatting only.
|
|
618
|
-
*
|
|
619
|
-
* When `listItem` is provided, its merged level indent becomes the paragraph indent (list
|
|
620
|
-
* hanging / left from `numbering.xml`), which is what Word uses for fixture list paragraphs
|
|
621
|
-
* that author no direct `w:ind`.
|
|
622
|
-
*
|
|
623
|
-
* `tableCellStyle` carries what the enclosing table's style says about this cell's
|
|
624
|
-
* paragraphs; body paragraphs pass nothing.
|
|
625
|
-
*
|
|
626
|
-
* `inTableCell` is asked for separately because a cell paragraph may have no table style to
|
|
627
|
-
* inherit at all, and `w:beforeAutospacing` still needs to know it is in a cell.
|
|
628
|
-
*/
|
|
629
|
-
declare function resolveParagraphLayoutInputs(paragraph: OoxmlElement, contentWidth: number, styleCascade: StyleCascadeTable | undefined, listItem?: ResolvedListItem, tableCellStyle?: TableCellStyleFormatting, inTableCell?: boolean): ParagraphLayoutInputs;
|
|
630
|
-
|
|
631
306
|
/**
|
|
632
307
|
* What a batch of commits can affect.
|
|
633
308
|
*
|
|
@@ -793,6 +468,12 @@ interface MultiSectionLayoutState {
|
|
|
793
468
|
previousRemapped: readonly PageRecord[];
|
|
794
469
|
previousFinalized: SemanticLayout | null;
|
|
795
470
|
previousPageCount: number;
|
|
471
|
+
/**
|
|
472
|
+
* The PAGEREF assignment token of the pages behind `previousFinalized`. A target can move
|
|
473
|
+
* sheets while the TOC page's own remapped record stays identity-unchanged, so the finalized
|
|
474
|
+
* restore must compare this before handing back a previously substituted sheet.
|
|
475
|
+
*/
|
|
476
|
+
previousPageRefToken: string;
|
|
796
477
|
}
|
|
797
478
|
/**
|
|
798
479
|
* Carried-over state that makes layout incremental.
|
|
@@ -891,99 +572,21 @@ interface LayoutSession {
|
|
|
891
572
|
*/
|
|
892
573
|
declare function createLayoutSession(): LayoutSession;
|
|
893
574
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
readonly
|
|
902
|
-
readonly ilvl: number;
|
|
903
|
-
readonly abstractNumId: string;
|
|
904
|
-
/** `w:numFmt` of the resolved level — `bullet` or a numbering format. */
|
|
905
|
-
readonly numFmt: string;
|
|
906
|
-
readonly markerText: string;
|
|
907
|
-
readonly markerAlign: ListMarkerAlign;
|
|
908
|
-
readonly suffix: ListSuffix;
|
|
909
|
-
/** Effective indent after merging level + paragraph indents, in points. */
|
|
910
|
-
readonly indent: NumberingLevelIndent;
|
|
911
|
-
readonly markerStyle: ResolvedRunStyle;
|
|
912
|
-
/** Fingerprint for layout cache keys (indent, marker text, marker face). */
|
|
913
|
-
readonly cacheToken: string;
|
|
575
|
+
type AutonumFieldKind = 'AUTONUM' | 'AUTONUMLGL' | 'AUTONUMOUT';
|
|
576
|
+
/** One recognized AUTONUM-family instruction: the kind and its supported switches. */
|
|
577
|
+
interface AutonumFieldSpec {
|
|
578
|
+
readonly kind: AutonumFieldKind;
|
|
579
|
+
/** ST_NumberFormat resolved from the `\*` switch; null paints decimal. */
|
|
580
|
+
readonly numFmt: string | null;
|
|
581
|
+
/** `\e`: display the number without its trailing period. */
|
|
582
|
+
readonly suppressPeriod: boolean;
|
|
914
583
|
}
|
|
915
584
|
/**
|
|
916
|
-
*
|
|
917
|
-
*
|
|
918
|
-
*
|
|
919
|
-
* the same way borders and tabs do.
|
|
920
|
-
*/
|
|
921
|
-
declare function readNumPr(paragraphPropertyNodes: readonly OoxmlNode[]): {
|
|
922
|
-
numId: string;
|
|
923
|
-
ilvl: number;
|
|
924
|
-
} | null;
|
|
925
|
-
/**
|
|
926
|
-
* Resolve `w:numStyleLink` delegation using the document's styles (§17.9.21).
|
|
927
|
-
*
|
|
928
|
-
* Without a style table there is nothing to follow, so the index is returned unchanged —
|
|
929
|
-
* and so it is when nothing delegates, which keeps layout cache identity.
|
|
930
|
-
*/
|
|
931
|
-
declare function withNumberingStyleLinks(index: NumberingIndex, styleCascade: StyleCascadeTable | undefined): NumberingIndex;
|
|
932
|
-
/**
|
|
933
|
-
* The effective indent of a list paragraph: STYLE, then the numbering LEVEL, then DIRECT.
|
|
934
|
-
*
|
|
935
|
-
* Word applies a level's `w:pPr/w:ind` between the paragraph style and the paragraph's own
|
|
936
|
-
* formatting, per attribute — and the ordering matters on real documents. A converted
|
|
937
|
-
* agreement numbers its `(a)` items with a level stating `left=1512 hanging=738` under a
|
|
938
|
-
* `ListParagraph` style stating `left=775 hanging=624`, and states only `hanging="737"` on
|
|
939
|
-
* the paragraph itself. Reading the flattened cascade as "the paragraph's indent" gave the
|
|
940
|
-
* STYLE's 775 to a level that had overridden it, so every lettered sub-item hung a full
|
|
941
|
-
* indent step to the left of where Word puts it.
|
|
942
|
-
*
|
|
943
|
-
* `inherited` is the cascade WITHOUT the paragraph's own `w:pPr` (defaults, table cell style,
|
|
944
|
-
* style chain); `direct` is that `w:pPr` alone.
|
|
945
|
-
*/
|
|
946
|
-
declare function mergeListIndent(levelIndent: NumberingLevelIndent, inherited: readonly OoxmlProperty[], direct?: readonly OoxmlProperty[]): NumberingLevelIndent;
|
|
947
|
-
/**
|
|
948
|
-
* Collect paragraphs of a block list in document order, descending into tables.
|
|
949
|
-
*
|
|
950
|
-
* Caps nesting so a hostile nested-table document cannot recurse without bound.
|
|
585
|
+
* Recognize `AUTONUM | AUTONUMLGL | AUTONUMOUT [\* <format>] [\e] [\* MERGEFORMAT]`, or null
|
|
586
|
+
* for anything else. Any unrecognized switch fails the parse so the field stays inert (paints
|
|
587
|
+
* nothing — its historical rendering), never the raw instruction, never a guessed number.
|
|
951
588
|
*/
|
|
952
|
-
declare function
|
|
953
|
-
/**
|
|
954
|
-
* Resolve every list paragraph in a story to a {@link ResolvedListItem}, keyed by node id.
|
|
955
|
-
*
|
|
956
|
-
* Non-list paragraphs are absent from the map. Hostile / missing numbering resolves inertly
|
|
957
|
-
* (paragraph omitted — laid out as ordinary text).
|
|
958
|
-
*/
|
|
959
|
-
declare function resolveStoryListItems(blocks: readonly OoxmlElement[], index: NumberingIndex, styleCascade: StyleCascadeTable | undefined, isFontAvailable?: (family: string) => boolean): ReadonlyMap<string, ResolvedListItem>;
|
|
960
|
-
/**
|
|
961
|
-
* Attach a full-story list-item map to layout options.
|
|
962
|
-
*
|
|
963
|
-
* Resolves once over `blocks` (body story including table cells) so counters continue across
|
|
964
|
-
* section boundaries. No-ops when numbering is absent.
|
|
965
|
-
*/
|
|
966
|
-
declare function withResolvedListItems<T extends {
|
|
967
|
-
readonly numberingIndex?: NumberingIndex;
|
|
968
|
-
readonly listItems?: ReadonlyMap<string, ResolvedListItem>;
|
|
969
|
-
readonly styleCascade?: StyleCascadeTable;
|
|
970
|
-
readonly isFontAvailable?: (family: string) => boolean;
|
|
971
|
-
}>(options: T, blocks: readonly OoxmlElement[]): T & {
|
|
972
|
-
readonly numberingIndex: NumberingIndex;
|
|
973
|
-
readonly listItems?: ReadonlyMap<string, ResolvedListItem>;
|
|
974
|
-
};
|
|
975
|
-
/**
|
|
976
|
-
* Horizontal marker box inside the hanging indent slot.
|
|
977
|
-
*
|
|
978
|
-
* Coordinates are relative to the same origin as paragraph content (`indent.left` is the
|
|
979
|
-
* text start). Returns null when there is nothing to paint.
|
|
980
|
-
*/
|
|
981
|
-
declare function listMarkerBox(item: ResolvedListItem, markerWidth: number, lineY: number, lineHeight: number): {
|
|
982
|
-
x: number;
|
|
983
|
-
y: number;
|
|
984
|
-
width: number;
|
|
985
|
-
height: number;
|
|
986
|
-
} | null;
|
|
589
|
+
declare function parseAutonumInstruction(raw: string): AutonumFieldSpec | null;
|
|
987
590
|
|
|
988
591
|
/**
|
|
989
592
|
* What one cell side is before any ADJACENT cell has its say.
|
|
@@ -1092,7 +695,13 @@ declare function selectionRects(layout: SemanticLayout, selection: SemanticSelec
|
|
|
1092
695
|
* it is wrong for every caret outside that story. A caller with no story in hand passes
|
|
1093
696
|
* {@link everyStoryOrder}.
|
|
1094
697
|
*/
|
|
1095
|
-
order: readonly string[]
|
|
698
|
+
order: readonly string[],
|
|
699
|
+
/**
|
|
700
|
+
* For EXACT edge x positions inside a span. Layout no longer publishes eager per-character
|
|
701
|
+
* caret edges, so without a measurer an intra-span boundary interpolates across the span's
|
|
702
|
+
* advance — visibly wrong in a proportional face. Pass the layout's measurer.
|
|
703
|
+
*/
|
|
704
|
+
measurer?: TextMeasurer): SelectionRect[];
|
|
1096
705
|
/** A model range to highlight, and the key the caller knows it by. */
|
|
1097
706
|
interface KeyedRange {
|
|
1098
707
|
readonly key: string;
|
|
@@ -1116,7 +725,9 @@ declare function keyedRangeRects(layout: SemanticLayout, ranges: readonly KeyedR
|
|
|
1116
725
|
* materialized pages is what keeps typing in a heavily reviewed document as fast as
|
|
1117
726
|
* typing in a clean one.
|
|
1118
727
|
*/
|
|
1119
|
-
pages?: ReadonlySet<number
|
|
728
|
+
pages?: ReadonlySet<number>,
|
|
729
|
+
/** For exact intra-span edge positions (see {@link selectionRects}). */
|
|
730
|
+
measurer?: TextMeasurer): Map<string, SelectionRect[]>;
|
|
1120
731
|
|
|
1121
732
|
/**
|
|
1122
733
|
* The next word boundary from `offset`, in `direction`.
|
|
@@ -1149,9 +760,6 @@ declare function wordBoundary(text: string, offset: number, direction: -1 | 1, s
|
|
|
1149
760
|
*/
|
|
1150
761
|
declare function positionPastDeletion(layout: SemanticLayout, position: SemanticPosition): SemanticPosition;
|
|
1151
762
|
|
|
1152
|
-
/** Synchronous platform-neutral SHA-256 used before font bytes cross into a shaping implementation. */
|
|
1153
|
-
declare const sha256FontBytes: (bytes: Uint8Array) => string;
|
|
1154
|
-
|
|
1155
763
|
/**
|
|
1156
764
|
* The exact HarfBuzz build this engine shapes against.
|
|
1157
765
|
*
|
|
@@ -1296,63 +904,6 @@ declare const createHarfBuzzTextShaper: (options?: HarfBuzzTextShaperOptions) =>
|
|
|
1296
904
|
*/
|
|
1297
905
|
declare function setHarfBuzzWasmUrl(url: string | URL): void;
|
|
1298
906
|
|
|
1299
|
-
/**
|
|
1300
|
-
* UAX #9 embedding levels, one per UTF-16 code unit, plus the paragraph ranges they were resolved
|
|
1301
|
-
* within.
|
|
1302
|
-
*
|
|
1303
|
-
* The level is EXACT, not a direction: its parity gives direction, but the numeric value is what
|
|
1304
|
-
* reordering needs, and collapsing it early loses nested isolates.
|
|
1305
|
-
*/
|
|
1306
|
-
interface BidiEmbeddingLevels {
|
|
1307
|
-
readonly levels: Uint8Array;
|
|
1308
|
-
readonly paragraphs: readonly {
|
|
1309
|
-
readonly start: number;
|
|
1310
|
-
readonly end: number;
|
|
1311
|
-
readonly level: number;
|
|
1312
|
-
}[];
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
/**
|
|
1316
|
-
* Which `w:rFonts` slot a character resolves its face through.
|
|
1317
|
-
*
|
|
1318
|
-
* OOXML gives a run up to four faces and picks between them by SCRIPT, so one run of mixed Latin
|
|
1319
|
-
* and CJK text uses two different fonts without saying so anywhere in its properties.
|
|
1320
|
-
*/
|
|
1321
|
-
type FontSlot = 'ascii' | 'hAnsi' | 'eastAsia' | 'cs';
|
|
1322
|
-
/**
|
|
1323
|
-
* A run of text sharing one script, direction and font slot — the unit handed to the shaper.
|
|
1324
|
-
*
|
|
1325
|
-
* Shaping cannot span a script change: Arabic and Latin in one call would produce wrong joining
|
|
1326
|
-
* behaviour, so a run is itemized into these first.
|
|
1327
|
-
*/
|
|
1328
|
-
interface ScriptItem {
|
|
1329
|
-
readonly from: number;
|
|
1330
|
-
readonly to: number;
|
|
1331
|
-
readonly direction: TextDirection;
|
|
1332
|
-
readonly bidiLevel: number;
|
|
1333
|
-
readonly script: 'Zyyy' | 'Latn' | 'Grek' | 'Cyrl' | 'Hani' | 'Hebr' | 'Arab' | 'Deva' | 'Beng' | 'Thai' | 'Khmr';
|
|
1334
|
-
readonly slot: FontSlot;
|
|
1335
|
-
}
|
|
1336
|
-
/**
|
|
1337
|
-
* A code point whose script this engine does not itemize.
|
|
1338
|
-
*
|
|
1339
|
-
* Carries the offending `codePoint` so the caller can report which character stopped it, rather
|
|
1340
|
-
* than failing anonymously somewhere in the middle of a paragraph.
|
|
1341
|
-
*/
|
|
1342
|
-
declare class UnsupportedScriptError extends Error {
|
|
1343
|
-
readonly name = "UnsupportedScriptError";
|
|
1344
|
-
readonly code = "unsupportedScript";
|
|
1345
|
-
readonly codePoint: number;
|
|
1346
|
-
constructor(codePoint: number);
|
|
1347
|
-
}
|
|
1348
|
-
/**
|
|
1349
|
-
* Split text into shapeable runs by script, bidi level and font slot.
|
|
1350
|
-
*
|
|
1351
|
-
* Consumes the bidi levels rather than re-deriving direction, so itemization and reordering agree
|
|
1352
|
-
* by construction instead of by two implementations happening to match.
|
|
1353
|
-
*/
|
|
1354
|
-
declare function itemizeScriptFontSlots(text: string, paragraphOffset: number, embedding: BidiEmbeddingLevels): readonly ScriptItem[];
|
|
1355
|
-
|
|
1356
907
|
/** UTF-16 boundaries that are both whole-grapheme and HarfBuzz cluster edges. */
|
|
1357
908
|
declare function shapedHorizontalBoundaries(run: ShapedRun): readonly number[];
|
|
1358
909
|
/**
|
|
@@ -1668,15 +1219,33 @@ interface LayoutNoteStoryOptions {
|
|
|
1668
1219
|
*/
|
|
1669
1220
|
readonly numberingIndex?: NumberingIndex;
|
|
1670
1221
|
readonly defaultTabStopPt?: number;
|
|
1222
|
+
readonly displayMode?: RevisionDisplayMode;
|
|
1223
|
+
readonly revisionAuthorFilter?: RevisionAuthorFilter;
|
|
1671
1224
|
/**
|
|
1672
1225
|
* Same projector seams the BODY walk uses. Without them a `w:hyperlink` or a HYPERLINK
|
|
1673
1226
|
* field inside a note painted as plain text — measured, but carrying no link record for
|
|
1674
1227
|
* paint to anchor and navigation to activate.
|
|
1675
1228
|
*/
|
|
1676
1229
|
readonly projectLink?: HyperlinkProjector;
|
|
1230
|
+
/**
|
|
1231
|
+
* Per-part projector, preferred over `projectLink` when `ownerPartName` names the part.
|
|
1232
|
+
*
|
|
1233
|
+
* A `w:hyperlink` in `/word/footnotes.xml` declares its `r:id` in `footnotes.xml.rels`,
|
|
1234
|
+
* so it must resolve there — the body projector answers from the body part's
|
|
1235
|
+
* relationships, and when the two parts assign one id to different targets the footnote
|
|
1236
|
+
* link navigated to the body's target. Same per-part rule pictures follow through
|
|
1237
|
+
* {@link drawingsForPart}.
|
|
1238
|
+
*/
|
|
1239
|
+
readonly projectLinkForPart?: (ownerPartName: string) => HyperlinkProjector | undefined;
|
|
1677
1240
|
readonly projectFieldLink?: FieldLinkProjector;
|
|
1678
1241
|
/** Document properties for a document-property field inside a note story. */
|
|
1679
1242
|
readonly documentProperties?: DocumentProperties;
|
|
1243
|
+
/**
|
|
1244
|
+
* The document's resolved REF inputs, so a footnote's cross-reference paints the live
|
|
1245
|
+
* value the body paints. The flow folds each paragraph's resolved values into its break
|
|
1246
|
+
* key, which is what repaints a note after a renumbering edit it cannot otherwise see.
|
|
1247
|
+
*/
|
|
1248
|
+
readonly refFields?: RefFieldContext;
|
|
1680
1249
|
/** Derived display marks for noteRef projection inside the note body. */
|
|
1681
1250
|
readonly noteMarks?: NoteMarkContext;
|
|
1682
1251
|
/**
|
|
@@ -1742,8 +1311,26 @@ declare function syntheticSeparatorBox(contentWidth: number, flowHeight: number)
|
|
|
1742
1311
|
/** Absolute separator box: short rule for marker/synthetic, full width for authored stories. */
|
|
1743
1312
|
declare function noteSeparatorAreaBox(separator: NoteSeparatorLayout, contentX: number, contentWidth: number, areaTop: number): LayoutBox;
|
|
1744
1313
|
|
|
1745
|
-
|
|
1746
|
-
|
|
1314
|
+
interface PageRefHit {
|
|
1315
|
+
readonly noteKind: NoteKind;
|
|
1316
|
+
readonly noteId: number;
|
|
1317
|
+
readonly paragraphId: string;
|
|
1318
|
+
/** Canonical UTF-16 atom offset within the paragraph. */
|
|
1319
|
+
readonly atomOffset: number;
|
|
1320
|
+
readonly customMarkFollows: boolean;
|
|
1321
|
+
readonly sectionIndex: number;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Bound on reflow attempts for an UNSEEDED document layout pass (cold open).
|
|
1326
|
+
*
|
|
1327
|
+
* Sized for a cold open of a reference-dense document: adoption is a forward fixed-point
|
|
1328
|
+
* iteration whose settled prefix extends a few pages per round, so a legal document with a
|
|
1329
|
+
* hundred footnotes converges in tens of rounds (a 53-page/108-note fixture took 24).
|
|
1330
|
+
* Orbits exit earlier through the fingerprint/envelope checks below, so the cap is a
|
|
1331
|
+
* safety bound, not the expected cost.
|
|
1332
|
+
*/
|
|
1333
|
+
declare const MAX_NOTE_REFLOW_ATTEMPTS = 64;
|
|
1747
1334
|
/** Cap on empty pages created solely to drain footnote/endnote overflow. */
|
|
1748
1335
|
declare const MAX_NOTE_OVERFLOW_PAGES = 256;
|
|
1749
1336
|
/**
|
|
@@ -1792,15 +1379,40 @@ interface NotesLayoutInput {
|
|
|
1792
1379
|
/** `numbering.xml`, so a `w:numPr` paragraph inside a note resolves a marker. */
|
|
1793
1380
|
readonly numberingIndex?: NumberingIndex;
|
|
1794
1381
|
readonly defaultTabStopPt?: number;
|
|
1382
|
+
readonly displayMode?: RevisionDisplayMode;
|
|
1383
|
+
readonly revisionAuthorFilter?: RevisionAuthorFilter;
|
|
1795
1384
|
/**
|
|
1796
1385
|
* Link projector seams, same as the body walk's. Normally injected by `semantic-layout`
|
|
1797
1386
|
* from its own options, so a note's `w:hyperlink` / HYPERLINK field carries the same
|
|
1798
1387
|
* sanitized record a body one does instead of painting dead text.
|
|
1799
1388
|
*/
|
|
1800
1389
|
readonly projectLink?: HyperlinkProjector;
|
|
1390
|
+
/**
|
|
1391
|
+
* Per notes-part link projector, preferred over `projectLink`: a `w:hyperlink` inside
|
|
1392
|
+
* `/word/footnotes.xml` or `/word/endnotes.xml` declares its `r:id` in that part's own
|
|
1393
|
+
* `.rels`, not the body part's. The surface supplies this; the inherited body projector
|
|
1394
|
+
* remains only a fallback for callers without per-part resolution.
|
|
1395
|
+
*/
|
|
1396
|
+
readonly projectLinkForPart?: (ownerPartName: string) => HyperlinkProjector | undefined;
|
|
1397
|
+
/**
|
|
1398
|
+
* Content token over the notes parts' relationship records, standing in for
|
|
1399
|
+
* {@link projectLinkForPart}'s closure in the notes-pass memo. The projector reads
|
|
1400
|
+
* relationship state the pinned part identity cannot see move: a replicated rels-only
|
|
1401
|
+
* change lands without splicing the notes part, so only a content token catches it.
|
|
1402
|
+
* Required whenever `projectLinkForPart` is supplied — without it the memo is disabled,
|
|
1403
|
+
* the same fail-closed rule `drawingsForPart` follows through `drawingLayoutEpoch`.
|
|
1404
|
+
*/
|
|
1405
|
+
readonly linkRelsEpoch?: string;
|
|
1801
1406
|
readonly projectFieldLink?: FieldLinkProjector;
|
|
1802
1407
|
/** Document properties for a document-property field inside a note story. */
|
|
1803
1408
|
readonly documentProperties?: DocumentProperties;
|
|
1409
|
+
/**
|
|
1410
|
+
* The document's resolved REF inputs, so a footnote's cross-reference paints the live
|
|
1411
|
+
* value the body paints. Normally injected by `semantic-layout` from the context it built
|
|
1412
|
+
* over the body and note stories; its values token joins the notes-pass fingerprint so a
|
|
1413
|
+
* renumbering edit repaints the notes that cite the renumbered target.
|
|
1414
|
+
*/
|
|
1415
|
+
readonly refFields?: RefFieldContext;
|
|
1804
1416
|
/**
|
|
1805
1417
|
* Inline drawing support per notes part. Absent means note paragraphs flow without
|
|
1806
1418
|
* drawing records, which is what a headless caller with no image port wants.
|
|
@@ -1826,16 +1438,6 @@ interface NotesAttachResult {
|
|
|
1826
1438
|
/** Mark context used for the final body projection (for incremental cache tokens). */
|
|
1827
1439
|
readonly noteMarks: NoteMarkContext;
|
|
1828
1440
|
}
|
|
1829
|
-
interface PageRefHit {
|
|
1830
|
-
readonly noteKind: NoteKind;
|
|
1831
|
-
readonly noteId: number;
|
|
1832
|
-
readonly paragraphId: string;
|
|
1833
|
-
/** Canonical UTF-16 atom offset within the paragraph. */
|
|
1834
|
-
readonly atomOffset: number;
|
|
1835
|
-
readonly customMarkFollows: boolean;
|
|
1836
|
-
readonly sectionIndex: number;
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
1441
|
/**
|
|
1840
1442
|
* Whether a paragraph fragment owns a note atom at `atomOffset`.
|
|
1841
1443
|
*
|
|
@@ -1867,7 +1469,14 @@ declare function filterRefsOnPage(page: PageRecord, allRefs: readonly PageRefHit
|
|
|
1867
1469
|
*/
|
|
1868
1470
|
declare function computeFootnoteReserves(layout: SemanticLayout, allRefs: readonly PageRefHit[], input: NotesLayoutInput, noteMarks: NoteMarkContext,
|
|
1869
1471
|
/** Session-carried notes memo (opaque; owned by this module). */
|
|
1870
|
-
passMemo?: unknown
|
|
1472
|
+
passMemo?: unknown,
|
|
1473
|
+
/**
|
|
1474
|
+
* The reserve map `layout` was laid under. Feeds the hold-out's observed-refusal test
|
|
1475
|
+
* (a block the body pass declined to split under a known budget only moves whole);
|
|
1476
|
+
* absent, the hold-out releases the ambiguous cases — a caller outside the reflow loop
|
|
1477
|
+
* must not manufacture holds the loop never observed.
|
|
1478
|
+
*/
|
|
1479
|
+
previousReserves?: ReadonlyMap<number, number>): {
|
|
1871
1480
|
readonly reserves: ReadonlyMap<number, number>;
|
|
1872
1481
|
readonly stable: boolean;
|
|
1873
1482
|
readonly reasons: readonly NotePaginationFallbackReason[];
|
|
@@ -1960,6 +1569,8 @@ interface HeaderFooterStoryInputs {
|
|
|
1960
1569
|
* merged into the paragraph's own.
|
|
1961
1570
|
*/
|
|
1962
1571
|
readonly numberingIndex?: NumberingIndex;
|
|
1572
|
+
/** Reviewers whose changes project as accepted in this story. */
|
|
1573
|
+
readonly revisionAuthorFilter?: RevisionAuthorFilter;
|
|
1963
1574
|
}
|
|
1964
1575
|
/**
|
|
1965
1576
|
* Lay one header/footer part out at `contentWidth`.
|
|
@@ -2096,6 +1707,8 @@ interface SemanticLayoutOptions {
|
|
|
2096
1707
|
* accepted every proposal in it.
|
|
2097
1708
|
*/
|
|
2098
1709
|
readonly displayMode?: RevisionDisplayMode;
|
|
1710
|
+
/** Reviewers whose revisions render as their accepted projection. */
|
|
1711
|
+
readonly revisionAuthorFilter?: RevisionAuthorFilter;
|
|
2099
1712
|
/**
|
|
2100
1713
|
* Per-section furniture, index-aligned with `enumerateDocumentSections`.
|
|
2101
1714
|
*
|
|
@@ -2256,45 +1869,6 @@ declare function formatNumFmt(numFmt: string, value: number): string;
|
|
|
2256
1869
|
*/
|
|
2257
1870
|
declare function expandLvlText(lvlText: string, counters: readonly number[], formats: readonly string[]): string;
|
|
2258
1871
|
|
|
2259
|
-
/**
|
|
2260
|
-
* The result of counting ONE list paragraph: the level that applied, the counter vector after it,
|
|
2261
|
-
* and the marker text a reader sees.
|
|
2262
|
-
*
|
|
2263
|
-
* Counters are a vector across all nine levels, not a single number, because a deeper level
|
|
2264
|
-
* restarting resets the ones below it while leaving those above intact.
|
|
2265
|
-
*/
|
|
2266
|
-
interface ListCounterAdvance {
|
|
2267
|
-
/** Effective abstract numbering template for this num instance. */
|
|
2268
|
-
readonly abstractNumId: string;
|
|
2269
|
-
readonly numId: string;
|
|
2270
|
-
readonly ilvl: number;
|
|
2271
|
-
readonly level: NumberingLevel;
|
|
2272
|
-
/** Counter vector after this item was counted (indices 0..8). */
|
|
2273
|
-
readonly counters: readonly number[];
|
|
2274
|
-
/** Expanded marker text (empty when vanished / empty lvlText). */
|
|
2275
|
-
readonly markerText: string;
|
|
2276
|
-
}
|
|
2277
|
-
/**
|
|
2278
|
-
* The running counters for one layout pass over one story.
|
|
2279
|
-
*
|
|
2280
|
-
* Stateful and order-dependent by nature: a list number is a function of every numbered paragraph
|
|
2281
|
-
* before it, which is why markers are computed during layout and cannot be read off a paragraph
|
|
2282
|
-
* in isolation.
|
|
2283
|
-
*/
|
|
2284
|
-
interface ListCounterState {
|
|
2285
|
-
/**
|
|
2286
|
-
* Advance counters for one list paragraph.
|
|
2287
|
-
*
|
|
2288
|
-
* Returns null when the numbering definition cannot be resolved — callers treat the
|
|
2289
|
-
* paragraph as non-list (inert fallback).
|
|
2290
|
-
*/
|
|
2291
|
-
advance(numId: string, ilvl: number): ListCounterAdvance | null;
|
|
2292
|
-
}
|
|
2293
|
-
/**
|
|
2294
|
-
* Create a fresh counter bag for one story (body, or one header/footer part).
|
|
2295
|
-
*/
|
|
2296
|
-
declare function createListCounterState(index: NumberingIndex): ListCounterState;
|
|
2297
|
-
|
|
2298
1872
|
/**
|
|
2299
1873
|
* The stack used when a run names no font (or names one the sink refuses).
|
|
2300
1874
|
*
|
|
@@ -2405,6 +1979,42 @@ declare function tryCreateCanvasMeasurer(options?: CanvasMeasurerOptions): TextM
|
|
|
2405
1979
|
*/
|
|
2406
1980
|
declare function resolveDefaultSurfaceMeasurer(scale?: number, options?: CanvasMeasurerOptions): ResolvedSurfaceMeasurer;
|
|
2407
1981
|
|
|
1982
|
+
type RefreshFieldResultsOp = Extract<TreeDocOp, {
|
|
1983
|
+
op: 'refreshFieldResults';
|
|
1984
|
+
}>;
|
|
1985
|
+
|
|
1986
|
+
interface RefFieldRefreshOptions {
|
|
1987
|
+
/**
|
|
1988
|
+
* The package the part belongs to, for the note-part half of the resolution context —
|
|
1989
|
+
* the same context paint uses, so a body REF that targets a footnote bookmark computes
|
|
1990
|
+
* the same value both places. Absent narrows resolution to body-declared bookmarks.
|
|
1991
|
+
*/
|
|
1992
|
+
readonly package?: OoxmlPackage;
|
|
1993
|
+
readonly styleCascade?: StyleCascadeTable;
|
|
1994
|
+
readonly numberingIndex?: NumberingIndex;
|
|
1995
|
+
/** The mode the surface painted under, so the saved values match the painted ones. */
|
|
1996
|
+
readonly displayMode?: RevisionDisplayMode;
|
|
1997
|
+
/**
|
|
1998
|
+
* The DISPLAYED page number of one paragraph in the current finalized layout, or null when
|
|
1999
|
+
* it is not placed. PAGEREF results ride the plan through this: the value is pagination's,
|
|
2000
|
+
* so only a caller holding the laid-out pages can answer, and a plan without it keeps every
|
|
2001
|
+
* PAGEREF result as loaded. The same calibration verdict paint took gates each rewrite.
|
|
2002
|
+
*/
|
|
2003
|
+
readonly pageRefPageNumberOf?: (targetParagraphId: string) => string | null;
|
|
2004
|
+
}
|
|
2005
|
+
/**
|
|
2006
|
+
* A {@link RefFieldRefreshOptions.pageRefPageNumberOf} source over one finalized layout.
|
|
2007
|
+
*
|
|
2008
|
+
* Builds the target → host-page index once, on first demand, and answers every field from
|
|
2009
|
+
* it — the same walk finalize substitution takes, so the saved number is the painted one.
|
|
2010
|
+
*/
|
|
2011
|
+
declare function pageRefPageNumbersFromLayout(layout: SemanticLayout): (targetParagraphId: string) => string | null;
|
|
2012
|
+
/**
|
|
2013
|
+
* Plan the refresh for one body part, or null when every supported REF result is already
|
|
2014
|
+
* fresh (the no-op save path — no transaction, no revision bump, no undo entry).
|
|
2015
|
+
*/
|
|
2016
|
+
declare function planRefFieldResultRefresh(part: OoxmlPart, options: RefFieldRefreshOptions): RefreshFieldResultsOp | null;
|
|
2017
|
+
|
|
2408
2018
|
/**
|
|
2409
2019
|
* The story's blocks — paragraphs and tables — in document order, flattening through
|
|
2410
2020
|
* block-level content-control wrappers under the shared nesting budget.
|
|
@@ -2412,14 +2022,14 @@ declare function resolveDefaultSurfaceMeasurer(scale?: number, options?: CanvasM
|
|
|
2412
2022
|
* Repeated calls with the same part and display mode return the SAME array instance,
|
|
2413
2023
|
* shared by every caller — treat it as read-only; mutating it corrupts later callers.
|
|
2414
2024
|
*/
|
|
2415
|
-
declare function storyBlocks(part: OoxmlPart, displayMode?: RevisionDisplayMode): OoxmlElement[];
|
|
2025
|
+
declare function storyBlocks(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): OoxmlElement[];
|
|
2416
2026
|
/**
|
|
2417
2027
|
* Blocks of one typed footnote/endnote node — a separate semantic story root.
|
|
2418
2028
|
*
|
|
2419
2029
|
* The footnotes/endnotes part root is never a story; each note is laid out independently
|
|
2420
2030
|
* so line ids and incremental convergence stay namespaced by note identity.
|
|
2421
2031
|
*/
|
|
2422
|
-
declare function noteStoryBlocks(note: OoxmlNode, displayMode?: RevisionDisplayMode): OoxmlElement[];
|
|
2032
|
+
declare function noteStoryBlocks(note: OoxmlNode, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): OoxmlElement[];
|
|
2423
2033
|
|
|
2424
2034
|
/** Paragraph ids for TOC field begin/end chrome that must not reserve vertical flow when empty. */
|
|
2425
2035
|
declare function tocFieldChromeParagraphIds(part: OoxmlPart): ReadonlySet<string>;
|
|
@@ -2838,7 +2448,7 @@ declare function tableOriginX(structure: SemanticTableStructure, containerWidthP
|
|
|
2838
2448
|
*/
|
|
2839
2449
|
declare function readTableStructure(table: OoxmlNode, contentWidthPt: number, depth: number, styleCascade?: StyleCascadeTable,
|
|
2840
2450
|
/** Which revisions the view resolves away; only the proposed result performs the join. */
|
|
2841
|
-
displayMode?: RevisionDisplayMode): SemanticTableStructure | null;
|
|
2451
|
+
displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): SemanticTableStructure | null;
|
|
2842
2452
|
|
|
2843
2453
|
/**
|
|
2844
2454
|
* `w:pPr/w:rPr/w:del` or `w:moveFrom` — a tracked revision REMOVES the paragraph mark.
|
|
@@ -2853,7 +2463,7 @@ declare function paragraphMarkDeleted(paragraph: OoxmlNode): boolean;
|
|
|
2853
2463
|
* True when a tracked revision has removed this paragraph from the rendered document, so
|
|
2854
2464
|
* layout should emit no box for it at all.
|
|
2855
2465
|
*/
|
|
2856
|
-
declare function revisionRemovesParagraph(paragraph: OoxmlNode, displayMode?:
|
|
2466
|
+
declare function revisionRemovesParagraph(paragraph: OoxmlNode, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): boolean;
|
|
2857
2467
|
|
|
2858
2468
|
/** Soft ceiling on fragments emitted for one authored row (hostile / runaway splits). */
|
|
2859
2469
|
declare const MAX_TABLE_ROW_FRAGMENTS = 4096;
|
|
@@ -2873,4 +2483,4 @@ declare class TablePaginationError extends Error {
|
|
|
2873
2483
|
constructor(code: TablePaginationErrorCode, message: string);
|
|
2874
2484
|
}
|
|
2875
2485
|
|
|
2876
|
-
export { AUTO_PREFERRED_WIDTH, type
|
|
2486
|
+
export { AUTO_PREFERRED_WIDTH, type AutonumFieldKind, type AutonumFieldSpec, BlockFragmentRecord, CELL_PAD, COMPOUND_BORDER_MIN_GAP_PT, COMPOUND_BORDER_MIN_STROKE_PT, type CanvasMeasurerOptions, type CanvasTextContext, type CanvasTextMetrics, CellBorderBox, type CellMarginsPt, type CellVerticalAlign, type CompoundBorderMetrics, ContentControlBoundaryRecord$1 as ContentControlBoundaryRecord, type ContentControlFragmentRecord, ContentControlLock, DEFAULT_CANVAS_FONT_STACK, DEFAULT_CELL_MARGINS, FieldLinkProjector, FixedPoint, FixedPointRoundingMode, FontByteValidator, GRAPHEME_SEGMENTER_LOCALE, type GraphemeBoundary, type GraphemeSegment, type GraphemeWordSegmentRecord, HARFBUZZ_SHAPING_LIBRARY, type HarfBuzzFaceCacheEvent, type HarfBuzzOutlineCacheEvent, type HarfBuzzShapeCacheEvent, HarfBuzzShapingError, type HarfBuzzShapingErrorCode, type HarfBuzzTextShaper, type HarfBuzzTextShaperInstrumentation, type HarfBuzzTextShaperOptions, type HeaderFooterVariantName, HyperlinkProjector, type KeyedRange, LayoutBox, type LayoutCacheStats, type LayoutScheduler, type LayoutSchedulerOptions, type LayoutScope, type LayoutSession, type LayoutSessionStats, LineRecord, type ListCounterAdvance, type ListCounterState, MAX_EACH_PAGE_MARK_CANDIDATES, MAX_LVL_TEXT_LENGTH, MAX_MARKER_TEXT_LENGTH, MAX_NOTES_LAID_OUT, MAX_NOTE_FRAGMENTS, MAX_NOTE_OVERFLOW_PAGES, MAX_NOTE_REFLOW_ATTEMPTS, MAX_TABLE_COLUMNS, MAX_TABLE_NESTING, MAX_TABLE_ROW_FRAGMENTS, MAX_TABLE_ROW_HEIGHT_PT, type MaterializationInput, type NoteDisplayMark, type NoteLayoutFallbackReason, type NoteMarkContext, type NotePaginationFallbackReason, type NoteReferenceSite, type NoteSeparatorLayout, type NoteSeparatorRuleStyle, type NoteStoryDrawings, type NoteStoryLayout, type NotesAttachResult, type NotesLayoutInput, NumberingIndex, NumberingLevel, type PageFurniture, PageGeometry, PageRecord, type PageRefIndex, ParagraphFragmentRecord, type ParagraphKeyInputs, type ParagraphLayoutCache, type ParagraphLayoutCacheOptions, type PreferredWidth, type PreferredWidthType, RefFieldContext, type RefFieldRefreshOptions, ResolvedListItem, type ResolvedSurfaceMeasurer, ReviewItem, type ReviewParagraphAnchor, RevisionAttribution, RevisionAuthorFilter, RevisionDisplayMode, SectionColumns, SelectionRect, SemanticLayout, type SemanticLayoutOptions, SemanticPosition, SemanticSelection, type SemanticTableCell, type SemanticTableRow, type SemanticTableStructure, ShapedRun, StyleCascadeTable, StyleSpanRecord, type TableAlignment, TableBorderBox, TableBorderSide, TableCellStyleFormatting, TablePaginationError, type TablePaginationErrorCode, type TableRowHeight, type TableRowHeightRule, TextMeasurer, TextShaper, VersionedShapingLibrary, type ViewportWindow, WORD_SEGMENTER_LOCALE, type WordBoundary, type WordBoundaryResolverDeps, type WordSegment, anchorLineY, attachNotesToLayout, boundedFallbackWordSegments, buildPageRefIndex, clampListValue, computeDoubleBorderMetricsPt, computeFootnoteReserves, contentControlBoundaries, contentControlHoldingParagraph, contentControlRecordsInPart, contentControlsOfLayout, createBoundedFallbackWordBoundary, createDefaultWordBoundary, createFixedMeasurer, createHarfBuzzTextShaper, createIntlWordBoundary, createLayoutScheduler, createLayoutSession, createListCounterState, createParagraphLayoutCache, defaultNoteSeparatorRuleStyle, deriveNoteDisplayMarks, deriveNoteDisplayMarksResolved, documentOrder, effectiveBorderSide, effectiveContentControlLock, emptyTocPlaceholderParagraphIds, emptyTocSuppressedResultParagraphIds, everyStoryOrder, expandLvlText, filterRefsOnPage, findSeparatorNote, formatDecimal, formatDecimalZero, formatLowerLetter, formatLowerRoman, formatNumFmt, formatPageNumber, formatUpperLetter, formatUpperRoman, fragmentOwnsAtomOffset, fragmentsOfParagraph, graphemeBoundaryEpoch, graphemeCount, graphemeOffsetToUtf16, harfBuzzFontValidator, initializeHarfBuzz, intlGraphemeBoundary, isCanvasMeasurementAvailable, isCumulativeGeometryTrustedFromLineOrigin, isGeometryTrustedCaretOffset, isHarfBuzzInitialized, isIntlSegmenterAvailable, isIntlWordSegmenterAvailable, isMarkerOnlySeparatorNote, isWholeGraphemeHorizontalBoundary, keyedRangeRects, layoutHeaderFooterStory, layoutNoteById, layoutNoteSeparator, layoutNoteStory, layoutSemanticDocument, lineAtPosition, linesOf, normalNotesOf, noteDisplayMarkMap, noteLineIdPrefix, noteMarkKey, noteSeparatorAreaBox, noteStoryBlocks, pageRefPageNumbersFromLayout, pagesToMaterialize, paragraphFragmentsOf, paragraphFragmentsOfBlocks, paragraphLayoutKey, paragraphMarkDeleted, paragraphShading, paragraphShadingBox, parseAutonumInstruction, planRefFieldResultRefresh, positionPastDeletion, projectedNoteMarkText, provisionalNoteMarks, readTableStructure, resetGraphemeBoundary, resolveDefaultSurfaceMeasurer, resolveDefaultWordBoundary, resolveOoxmlShadingFill, resolveStrictHexFill, reviewAnchorIndex, reviewItemGeometry, revisionRemovesParagraph, roundFontUnitToFixedPoint, segmentGraphemes, segmentWords, selectionRects, semanticHorizontalBoundaries, setGraphemeBoundary, setHarfBuzzWasmUrl, sha256FontBytes, shadingFillFromElement, shapedHorizontalBoundaries, storyBlocks, syntheticSeparatorBox, tableOriginX, tocFieldChromeParagraphIds, tryCreateCanvasMeasurer, unionLayoutBoxes, utf16OffsetToGrapheme, wordBoundary, wordSegmentsToGraphemeRecords };
|