superdoc 2.4.0-next.9 → 2.5.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.
Files changed (113) hide show
  1. package/README.md +12 -90
  2. package/dist/chunks/{FindReplaceSurface-9VkPw_-X.cjs → FindReplaceSurface-0p7EtMZh.cjs} +4 -3
  3. package/dist/chunks/{FindReplaceSurface-BuvaIrQ5.es.js → FindReplaceSurface-40AnrqWk.es.js} +4 -2
  4. package/dist/chunks/{PasswordPromptSurface-Bu5xHm91.cjs → PasswordPromptSurface-31lYPcCK.cjs} +4 -3
  5. package/dist/chunks/{PasswordPromptSurface-Bz9_sKhX.es.js → PasswordPromptSurface-CwYeO3iQ.es.js} +4 -2
  6. package/dist/chunks/{PdfViewer-CdVGB6Fe.es.js → PdfViewer-D8h7LRZy.es.js} +103 -19
  7. package/dist/chunks/{PdfViewer-D4eD2dV1.cjs → PdfViewer-Dug6yDRC.cjs} +105 -20
  8. package/dist/chunks/_plugin-vue_export-helper-BOaGB7Aw.es.js +8 -0
  9. package/dist/chunks/_plugin-vue_export-helper-SDR04tiH.cjs +13 -0
  10. package/dist/chunks/{blank-docx-DP8RUPW-.cjs → blank-docx-BuFAbRjs.cjs} +2 -0
  11. package/dist/chunks/{blank-docx-XRX6Ker2.es.js → blank-docx-DzQccOlW.es.js} +2 -0
  12. package/dist/chunks/constants-B6VBlmKp.es.js +4 -0
  13. package/dist/chunks/constants-DpXuDx_g.cjs +9 -0
  14. package/dist/chunks/{create-super-doc-ui-ByvmsAAG.cjs → create-super-doc-ui-Bom7oDPv.cjs} +2027 -1158
  15. package/dist/chunks/{create-super-doc-ui-DBXOhHdW.es.js → create-super-doc-ui-DbzVC0rr.es.js} +2216 -1107
  16. package/dist/chunks/{eventemitter3-Bt2s0X0a.es.js → eventemitter3-CMOjDs74.es.js} +124 -16
  17. package/dist/chunks/{eventemitter3-DqY4aSMf.cjs → eventemitter3-D38u8ta_.cjs} +125 -16
  18. package/dist/chunks/jszip-RC64TPzL.cjs +4758 -0
  19. package/dist/chunks/jszip-VxCFV9YS.es.js +4717 -0
  20. package/dist/chunks/{rolldown-runtime-D7PMmH3s.es.js → rolldown-runtime-B5TtN50X.es.js} +13 -4
  21. package/dist/chunks/{rolldown-runtime-1Y-nnZJ3.cjs → rolldown-runtime-DtsSbkrh.cjs} +12 -3
  22. package/dist/chunks/{uuid-CFp0WGVU.cjs → uuid-BhG0ngwk.cjs} +10 -6
  23. package/dist/chunks/{uuid-B2Sqk-3p.es.js → uuid-H0Xcmmhy.es.js} +8 -3
  24. package/dist/collaboration-upgrade-engine.cjs +34 -9
  25. package/dist/collaboration-upgrade-engine.es.js +30 -5
  26. package/dist/document-api/src/citations/citations.types.d.ts +9 -0
  27. package/dist/document-api/src/comments/comments.types.d.ts +7 -0
  28. package/dist/document-api/src/types/receipt.d.ts +9 -5
  29. package/dist/document-api/src/types/track-changes.types.d.ts +17 -0
  30. package/dist/layout-engine/contracts/src/graphic-placement.d.ts +35 -6
  31. package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +22 -2
  32. package/dist/layout-engine/contracts/src/index.d.ts +370 -15
  33. package/dist/layout-engine/contracts/src/inline-box.d.ts +19 -0
  34. package/dist/layout-engine/contracts/src/paragraph-visible-text.d.ts +19 -0
  35. package/dist/layout-engine/contracts/src/resolved-layout.d.ts +5 -0
  36. package/dist/layout-engine/dom-contract/src/class-names.d.ts +2 -0
  37. package/dist/layout-engine/layout-bridge/src/footnote-scorer.d.ts +1 -1
  38. package/dist/layout-engine/layout-bridge/src/hydrateTableTextboxMeasures.d.ts +9 -0
  39. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +42 -11
  40. package/dist/layout-engine/layout-bridge/src/index.d.ts +4 -2
  41. package/dist/layout-engine/layout-bridge/src/inline-box-key.d.ts +3 -0
  42. package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +11 -4
  43. package/dist/layout-engine/layout-bridge/src/remeasure.d.ts +2 -2
  44. package/dist/layout-engine/layout-bridge/src/run-visual-marks.d.ts +2 -0
  45. package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +0 -12
  46. package/dist/layout-engine/layout-engine/src/anchors.d.ts +4 -0
  47. package/dist/layout-engine/layout-engine/src/execution.d.ts +21 -0
  48. package/dist/layout-engine/layout-engine/src/floating-objects.d.ts +15 -2
  49. package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +2 -0
  50. package/dist/layout-engine/layout-engine/src/footnote-anchor-index.d.ts +17 -0
  51. package/dist/layout-engine/layout-engine/src/index.d.ts +13 -10
  52. package/dist/layout-engine/layout-engine/src/inline-drawing-alignment.d.ts +9 -0
  53. package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +3 -3
  54. package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +2 -2
  55. package/dist/layout-engine/layout-engine/src/layout-textbox.d.ts +3 -3
  56. package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +3 -41
  57. package/dist/layout-engine/layout-engine/src/paginator.d.ts +7 -2
  58. package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +2 -0
  59. package/dist/layout-engine/layout-engine/src/section-breaks.d.ts +1 -0
  60. package/dist/layout-engine/layout-engine/src/section-props.d.ts +5 -0
  61. package/dist/layout-engine/painters/dom/src/chart-renderer.d.ts +3 -3
  62. package/dist/layout-engine/painters/dom/src/images/image-outline.d.ts +7 -0
  63. package/dist/layout-engine/painters/dom/src/images/render-placeholder.d.ts +12 -0
  64. package/dist/layout-engine/painters/dom/src/renderer.d.ts +54 -0
  65. package/dist/layout-engine/painters/dom/src/runs/inline-box.d.ts +8 -0
  66. package/dist/layout-engine/painters/dom/src/runs/text-effects.d.ts +30 -0
  67. package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +6 -4
  68. package/dist/layout-engine/painters/dom/src/shapes/preset-text-warp-data.d.ts +32 -0
  69. package/dist/layout-engine/painters/dom/src/shapes/wordart-warp.d.ts +39 -0
  70. package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +20 -27
  71. package/dist/layout-engine/painters/dom/src/table/renderTableFragment.d.ts +1 -1
  72. package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +7 -0
  73. package/dist/public/ui-react.cjs +66 -2
  74. package/dist/public/ui-react.es.js +66 -1
  75. package/dist/public/ui.cjs +1 -1
  76. package/dist/public/ui.es.js +1 -1
  77. package/dist/style.css +134 -98
  78. package/dist/style.layered.css +134 -98
  79. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +2 -0
  80. package/dist/superdoc/src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue.d.ts +16 -0
  81. package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +3 -1
  82. package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +12 -0
  83. package/dist/superdoc/src/core/SuperDoc.d.ts +10 -7
  84. package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +5 -0
  85. package/dist/superdoc/src/core/extensions/index.d.ts +1 -1
  86. package/dist/superdoc/src/core/extensions/types.d.ts +63 -5
  87. package/dist/superdoc/src/core/types/index.d.ts +423 -37
  88. package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +3 -3
  89. package/dist/superdoc/src/helpers/comment-small-screen.d.ts +10 -0
  90. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +3 -5
  91. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +4 -4
  92. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +11 -0
  93. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +1 -1
  94. package/dist/superdoc/src/public/index.d.cts +20 -0
  95. package/dist/superdoc/src/public/index.d.ts +10 -0
  96. package/dist/superdoc/src/public/ui/types.d.ts +5 -5
  97. package/dist/superdoc/src/stores/comments-store.d.ts +81 -78
  98. package/dist/superdoc/src/stores/superdoc-store.d.ts +243 -234
  99. package/dist/superdoc.cjs +6748 -2162
  100. package/dist/superdoc.es.js +6621 -2035
  101. package/dist-cdn/style.layered.css +1 -1
  102. package/dist-cdn/superdoc.min.css +1 -1
  103. package/dist-cdn/superdoc.min.js +37 -37
  104. package/package.json +14 -18
  105. package/AGENTS.md +0 -337
  106. package/dist/chunks/_plugin-vue_export-helper-CZ1Nl59K.cjs +0 -11
  107. package/dist/chunks/_plugin-vue_export-helper-DSMAhhwD.es.js +0 -6
  108. package/dist/chunks/constants-BfH0br5u.es.js +0 -3
  109. package/dist/chunks/constants-D7TNtyJd.cjs +0 -14
  110. package/dist/chunks/jszip-C8srOKAO.es.js +0 -4650
  111. package/dist/chunks/jszip-Cs9JBLlJ.cjs +0 -4691
  112. package/dist/superdoc/src/helpers/v2-remote-review-hydration.d.ts +0 -12
  113. package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +0 -19
@@ -1,6 +1,7 @@
1
1
  import { TabStop } from './engines/tabs.js';
2
2
  import { PageNumberChapterSeparator, PageNumberFieldFormat, PageNumberFormat } from './page-number-formatting.js';
3
3
  import { TrackedChangeSemanticColorKey } from './semantic-colors.js';
4
+ import { AnchorAlignH, AnchorAlignV, AnchorHRelative, AnchorVRelative } from './graphic-placement.js';
4
5
  import { ParagraphDirectionContext, RunBidiContext, RunScriptContext, TableDirectionContext } from './direction-context.js';
5
6
  import { LayoutSourceIdentity } from './layout-identity.js';
6
7
  export { computeTabStops, layoutWithTabs, calculateTabWidth } from './engines/tabs.js';
@@ -17,7 +18,7 @@ export { shouldApplyJustify, calculateJustifySpacing, getFirstLineIndentOffset,
17
18
  export { parseInsetClipPathForScale, formatInsetClipPathTransform, type InsetClipPathScale, } from './clip-path-inset.js';
18
19
  export { SUBSCRIPT_SUPERSCRIPT_SCALE, normalizeBaselineShift, hasExplicitBaselineShift, isSuperscriptOrSubscript, usesDefaultScriptLayout, scaleFontSizeForVerticalText, resolveBaseFontSizeForVerticalText, type VerticalTextAlign, } from './vertical-text.js';
19
20
  export { computeFragmentPmRange, computeLinePmRange, type LinePmRange } from './pm-range.js';
20
- export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, } from './graphic-placement.js';
21
+ export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, isAnchorHRelative, isAnchorVRelative, isAnchorAlignH, isAnchorAlignV, ANCHOR_H_RELATIVE_VALUES, ANCHOR_V_RELATIVE_VALUES, ANCHOR_H_ALIGN_VALUES, ANCHOR_V_ALIGN_VALUES, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, type ResolveAnchoredGraphicXContext, type AnchorHRelative, type AnchorVRelative, type AnchorAlignH, type AnchorAlignV, } from './graphic-placement.js';
21
22
  export { LAYOUT_BOUNDARY_SCHEMA, bodyStoryLocator, namedStoryLocator, computeLayoutFragmentId, buildLayoutSourceIdentity, buildLayoutSourceIdentityForFragment, } from './layout-identity.js';
22
23
  export type { LayoutBlockRef, LayoutFragmentId, LayoutPartialRowIdentity, LayoutSourceIdentity, LayoutStoryKind, LayoutStoryLocator, } from './layout-identity.js';
23
24
  export { LAYOUT_SEGMENT_GEOMETRY_SCHEMA } from './segment-geometry.js';
@@ -120,7 +121,7 @@ export type DocPartMetadata = {
120
121
  * - Doc parts: special objects like tables of contents
121
122
  */
122
123
  export type SdtMetadata = FieldAnnotationMetadata | StructuredContentMetadata | DocumentSectionMetadata | DocPartMetadata;
123
- export declare const CONTRACTS_VERSION = "1.1.0";
124
+ export declare const CONTRACTS_VERSION = "1.2.0";
124
125
  /** Unique identifier for a block in the document. Format: `${pos}-${type}`. */
125
126
  export type BlockId = string;
126
127
  /**
@@ -317,6 +318,8 @@ export type RunMarks = {
317
318
  * Rendering normalizes a shift of zero to "no explicit shift".
318
319
  */
319
320
  baselineShift?: number;
321
+ /** Paint-only Word 2010+ text effects (`w14:textFill`, outline, shadow, reflection). */
322
+ textEffects?: TextEffects;
320
323
  };
321
324
  export type PageReferenceRelativePositionText = 'above' | 'below';
322
325
  export type FieldResultFormat = 'charformat' | 'mergeformat';
@@ -472,6 +475,31 @@ export type ImageHyperlink = {
472
475
  * baseline next to the surrounding text instead of floating above it.
473
476
  */
474
477
  export type ImageRunVerticalAlign = 'top' | 'bottom' | 'baseline';
478
+ /**
479
+ * Paint-only frame authored on a DrawingML picture (`pic:spPr/a:ln`).
480
+ *
481
+ * The frame is intentionally separate from the image dimensions: DrawingML
482
+ * strokes are centered on the picture geometry and must not enlarge the
483
+ * layout box. Keeping this as a shared contract lets inline and anchored
484
+ * pictures use the same extraction and paint path.
485
+ */
486
+ export type ImageOutline = {
487
+ color: string;
488
+ /** Physical CSS-pixel width resolved from `a:ln/@w`. */
489
+ width: number;
490
+ };
491
+ /**
492
+ * Explicit fail-closed rendering metadata for content that keeps its authored
493
+ * layout box but cannot be painted faithfully.
494
+ *
495
+ * The producer owns the diagnostic identity; painters only expose it on the
496
+ * visible, accessible placeholder. This keeps support decisions out of the DOM
497
+ * layer and makes degraded output observable in browser regression proofs.
498
+ */
499
+ export type RenderPlaceholder = {
500
+ diagnosticIds: string[];
501
+ accessibleName: string;
502
+ };
475
503
  /**
476
504
  * Inline image run for images that flow with text on the same line.
477
505
  * Unlike ImageBlock (anchored/floating images), ImageRun is part of the paragraph's run array
@@ -498,14 +526,22 @@ export type ImageRun = {
498
526
  width: number;
499
527
  /** Image height in pixels. */
500
528
  height: number;
529
+ /** Font family of the owning OOXML run, used to compose an image-only line box. */
530
+ fontFamily?: string;
531
+ /** Font size of the owning OOXML run, used to compose an image-only line box. */
532
+ fontSize?: number;
501
533
  /** Alternative text for accessibility. */
502
534
  alt?: string;
503
535
  /** Image title (tooltip). */
504
536
  title?: string;
537
+ /** Visible fail-closed replacement when the image source cannot be painted. */
538
+ placeholder?: RenderPlaceholder;
505
539
  /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
506
540
  imageId?: string;
507
541
  /** Clip-path value for cropped images. */
508
542
  clipPath?: string;
543
+ /** DrawingML picture frame; paint-only and excluded from layout sizing. */
544
+ outline?: ImageOutline;
509
545
  /**
510
546
  * Spacing around the image (from DOCX distT/distB/distL/distR attributes).
511
547
  * Applied as CSS margins in the DOM painter.
@@ -655,12 +691,58 @@ export type MathRun = {
655
691
  sdt?: SdtMetadata;
656
692
  };
657
693
  export type Run = TextRun | TabRun | ImageRun | LineBreakRun | BreakRun | FieldAnnotationRun | MathRun;
694
+ /** Layout-affecting inline-box values, resolved to logical CSS pixel sides. */
695
+ export type ResolvedInlineBoxLayout = {
696
+ paddingInlineStart: number;
697
+ paddingInlineEnd: number;
698
+ paddingBlockStart: number;
699
+ paddingBlockEnd: number;
700
+ gapBefore: number;
701
+ gapAfter: number;
702
+ borderWidth: number;
703
+ };
704
+ /** Sanitized, paint-only inline-box appearance. */
705
+ export type ResolvedInlineBoxAppearance = {
706
+ backgroundColor?: string;
707
+ borderColor?: string;
708
+ borderStyle?: 'solid' | 'dashed' | 'dotted';
709
+ borderRadius?: number;
710
+ color?: string;
711
+ };
712
+ /** Paint-ready inline-box style emitted on measured line slices. */
713
+ export type ResolvedInlineBoxStyle = ResolvedInlineBoxLayout & ResolvedInlineBoxAppearance;
714
+ /**
715
+ * An internal, layout-aware presentation over a paragraph-visible text range.
716
+ *
717
+ * The proof uses leaf styling (D1): measurement creates box-edge segment
718
+ * boundaries and the painter styles the canonical text leaves. The fallback
719
+ * sibling layer was not needed. Extension-authored boxes reach this internal
720
+ * layout contract through the v2 host bridge. RTL input is ignored (D12), and
721
+ * the synchronous paragraph remeasurer does not consume this field (D14).
722
+ */
723
+ export type InlineBoxSpan = {
724
+ id: string;
725
+ /**
726
+ * UTF-16 offsets over the paragraph's flattened visible text. Every
727
+ * non-text run contributes one placeholder character. These offsets never
728
+ * alter run PM ranges, run indices, source anchors, or document identity.
729
+ */
730
+ from: number;
731
+ to: number;
732
+ layout: ResolvedInlineBoxLayout;
733
+ appearance: ResolvedInlineBoxAppearance;
734
+ className?: string;
735
+ data?: Record<string, string>;
736
+ cursor?: 'default' | 'pointer' | 'text' | 'help';
737
+ };
658
738
  export type ParagraphBlock = {
659
739
  kind: 'paragraph';
660
740
  id: BlockId;
661
741
  runs: Run[];
662
742
  attrs?: ParagraphAttrs;
663
743
  sourceAnchor?: SourceAnchor;
744
+ /** @internal Layout-aware presentation projected from the extension API by the v2 host. */
745
+ inlineBoxes?: InlineBoxSpan[];
664
746
  };
665
747
  /** Border style (subset of OOXML ST_Border). */
666
748
  export type BorderStyle = 'none' | 'single' | 'double' | 'dashed' | 'dotted' | 'thick' | 'triple' | 'dotDash' | 'dotDotDash' | 'wave' | 'doubleWave';
@@ -671,6 +753,12 @@ export type BorderSpec = {
671
753
  color?: string;
672
754
  space?: number;
673
755
  };
756
+ /**
757
+ * Returns the complete painted width of an OOXML table border in CSS pixels.
758
+ * `w:sz` is the width of the complete border, including compound styles such
759
+ * as double. `thick` retains the existing table-painter minimum used in V2.
760
+ */
761
+ export declare const getRenderedTableBorderWidthPx: (border: Pick<BorderSpec, "style" | "width"> | undefined, defaultWidth?: number) => number;
674
762
  /**
675
763
  * Three-state border value for table borders.
676
764
  * - `null`: inherit from table style
@@ -696,6 +784,16 @@ export type CellBorders = {
696
784
  bottom?: BorderSpec;
697
785
  left?: BorderSpec;
698
786
  };
787
+ /** True when a normalized border contributes a visible edge. */
788
+ export declare const isPresentBorder: (border?: BorderSpec) => border is BorderSpec;
789
+ /** True when the source explicitly suppresses an edge rather than omitting it. */
790
+ export declare const isExplicitNoneBorder: (border?: unknown) => boolean;
791
+ /**
792
+ * Resolve the single visible edge shared by two cells according to
793
+ * ECMA-376 Part 1 §17.4.66. Kept in the editor-neutral contract package so
794
+ * import and DOM paint use one conflict algorithm.
795
+ */
796
+ export declare const resolveBorderConflict: (first?: BorderSpec, second?: BorderSpec) => BorderSpec | undefined;
699
797
  export type TableCellAttrs = {
700
798
  borders?: CellBorders;
701
799
  padding?: BoxSpacing;
@@ -828,6 +926,10 @@ export type ImageBlock = {
828
926
  height?: number;
829
927
  alt?: string;
830
928
  title?: string;
929
+ /** DrawingML picture frame; paint-only and excluded from layout sizing. */
930
+ outline?: ImageOutline;
931
+ /** Visible fail-closed replacement when the image source cannot be painted. */
932
+ placeholder?: RenderPlaceholder;
831
933
  /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
832
934
  imageId?: string;
833
935
  objectFit?: 'contain' | 'cover' | 'fill' | 'scale-down';
@@ -923,11 +1025,73 @@ export type TextFormatting = {
923
1025
  fontSize?: number;
924
1026
  fontFamily?: string;
925
1027
  letterSpacing?: number;
1028
+ /** Paint-only Word 2010+ text effects shared with ordinary text runs. */
1029
+ textEffects?: TextEffects;
1030
+ };
1031
+ /** Solid color used by a text effect, with optional opacity. */
1032
+ export type TextEffectColor = {
1033
+ color: string;
1034
+ alpha?: number;
1035
+ };
1036
+ /** Word 2010+ text outline (`w14:textOutline`). */
1037
+ export type TextOutlineEffect = {
1038
+ /** Outline width converted from EMU to CSS pixels. */
1039
+ width: number;
1040
+ fill: FillColor;
1041
+ };
1042
+ /** Word 2010+ text glow (`w14:glow`). */
1043
+ export type TextGlowEffect = {
1044
+ color: TextEffectColor;
1045
+ /** Glow radius converted from EMU to CSS pixels. */
1046
+ radius: number;
1047
+ };
1048
+ /** Word 2010+ outer text shadow (`w14:shadow`). */
1049
+ export type TextShadowEffect = {
1050
+ color: TextEffectColor;
1051
+ /** Blur radius converted from EMU to CSS pixels. */
1052
+ blurRadius: number;
1053
+ /** Shadow distance converted from EMU to CSS pixels. */
1054
+ distance: number;
1055
+ /** Direction in DrawingML degrees (`0` points right, `90` points down). */
1056
+ direction: number;
1057
+ };
1058
+ /** Word 2010+ reflected-text mask (`w14:reflection`). */
1059
+ export type TextReflectionEffect = {
1060
+ blurRadius: number;
1061
+ distance: number;
1062
+ direction: number;
1063
+ /** Direction of the reflection opacity gradient; defaults to `direction`. */
1064
+ fadeDirection?: number;
1065
+ startAlpha: number;
1066
+ startPosition: number;
1067
+ endAlpha: number;
1068
+ endPosition: number;
1069
+ scaleX: number;
1070
+ scaleY: number;
1071
+ };
1072
+ /**
1073
+ * Paint-only text effects shared by paragraph runs and flattened shape text.
1074
+ * These effects do not change glyph advances, so layout measurement continues
1075
+ * to use the run's ordinary typography contract.
1076
+ */
1077
+ export type TextEffects = {
1078
+ fill?: FillColor;
1079
+ outline?: TextOutlineEffect;
1080
+ glow?: TextGlowEffect;
1081
+ shadow?: TextShadowEffect;
1082
+ reflection?: TextReflectionEffect;
926
1083
  };
927
1084
  /** A single text part with optional formatting. */
928
1085
  export type TextPart = {
929
1086
  text: string;
930
1087
  formatting?: TextFormatting;
1088
+ /**
1089
+ * Paragraph properties carried by the first visible part of a shape-text
1090
+ * paragraph. Shape text is intentionally flattened into `parts`, so this
1091
+ * marker preserves the authored block geometry without introducing a second
1092
+ * competing text model.
1093
+ */
1094
+ paragraphProperties?: ShapeTextParagraphProperties;
931
1095
  /** Optional field token (e.g., PAGE/NUMPAGES/SECTIONPAGES) resolved at render time. */
932
1096
  fieldType?: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES';
933
1097
  /** PAGE/SECTIONPAGES field-local value formatting override. */
@@ -953,6 +1117,17 @@ export type TextPart = {
953
1117
  height?: number;
954
1118
  alt?: string;
955
1119
  };
1120
+ /** Paragraph geometry used by flattened DrawingML/VML shape text. */
1121
+ export type ShapeTextParagraphProperties = {
1122
+ horizontalAlign?: 'left' | 'center' | 'right' | 'justify';
1123
+ spacingBefore?: number;
1124
+ spacingAfter?: number;
1125
+ line?: number;
1126
+ lineUnit?: 'px' | 'multiplier';
1127
+ leftIndent?: number;
1128
+ rightIndent?: number;
1129
+ firstLineIndent?: number;
1130
+ };
956
1131
  /** Text content configuration for shapes. */
957
1132
  export type ShapeTextContent = {
958
1133
  /** Array of text parts with individual formatting. */
@@ -960,6 +1135,34 @@ export type ShapeTextContent = {
960
1135
  /** Horizontal text alignment within the shape. */
961
1136
  horizontalAlign?: 'left' | 'center' | 'right';
962
1137
  };
1138
+ /** DrawingML textbox flow/overflow semantics from `a:bodyPr`. */
1139
+ export type ShapeTextLayout = {
1140
+ /** `a:bodyPr/@wrap`; `none` keeps authored paragraphs on explicit lines only. */
1141
+ wrap?: 'square' | 'none';
1142
+ /** `a:bodyPr/@horzOverflow`. */
1143
+ horizontalOverflow?: 'overflow' | 'clip';
1144
+ /** `a:bodyPr/@vertOverflow`. */
1145
+ verticalOverflow?: 'overflow' | 'clip' | 'ellipsis';
1146
+ };
1147
+ /** ECMA-376 Part 1 `ST_TextShapeType` preset text-warp vocabulary. */
1148
+ export declare const SHAPE_TEXT_WARP_PRESETS: readonly ["textNoShape", "textPlain", "textStop", "textTriangle", "textTriangleInverted", "textChevron", "textChevronInverted", "textRingInside", "textRingOutside", "textArchUp", "textArchDown", "textCircle", "textButton", "textArchUpPour", "textArchDownPour", "textCirclePour", "textButtonPour", "textCurveUp", "textCurveDown", "textCanUp", "textCanDown", "textWave1", "textWave2", "textDoubleWave1", "textWave4", "textInflate", "textDeflate", "textInflateBottom", "textDeflateBottom", "textInflateTop", "textDeflateTop", "textDeflateInflate", "textDeflateInflateDeflate", "textFadeRight", "textFadeLeft", "textFadeUp", "textFadeDown", "textSlantUp", "textSlantDown", "textCascadeUp", "textCascadeDown"];
1149
+ export type ShapeTextWarpPreset = (typeof SHAPE_TEXT_WARP_PRESETS)[number];
1150
+ export declare function isShapeTextBaselineWarp(warp: ShapeTextWarp | undefined): boolean;
1151
+ export declare function isShapeTextSingleBandEnvelopeWarp(warp: ShapeTextWarp | undefined): boolean;
1152
+ /** Preserved `a:prstTxWarp` geometry and guide formulas from `a:bodyPr`. */
1153
+ export type ShapeTextWarp = {
1154
+ preset: ShapeTextWarpPreset;
1155
+ adjustments?: Array<{
1156
+ name: string;
1157
+ /** Raw DrawingML guide formula, for example `val 25000`. */
1158
+ formula: string;
1159
+ }>;
1160
+ };
1161
+ /** Resolve the line-breaking width for DrawingML textbox content. */
1162
+ export declare function resolveShapeTextContentMeasureWidth(shapeWidth: number, insets: {
1163
+ left: number;
1164
+ right: number;
1165
+ }, layout: ShapeTextLayout | undefined, autoFitBoundaryWidth?: number): number;
963
1166
  export type LineEnd = {
964
1167
  type?: string;
965
1168
  width?: string;
@@ -975,14 +1178,53 @@ export type EffectExtent = {
975
1178
  right: number;
976
1179
  bottom: number;
977
1180
  };
1181
+ /**
1182
+ * DrawingML relative rectangle in the source 1000ths-of-a-percent units.
1183
+ * Values may be negative: ECMA-376 allows an outset as well as an inset.
1184
+ */
1185
+ export type ShapeImageFillRect = {
1186
+ left: number;
1187
+ top: number;
1188
+ right: number;
1189
+ bottom: number;
1190
+ };
1191
+ /** DrawingML `a:tile` parameters, preserved without painter-specific conversion. */
1192
+ export type ShapeImageFillTile = {
1193
+ offsetX?: number;
1194
+ offsetY?: number;
1195
+ scaleX?: number;
1196
+ scaleY?: number;
1197
+ flip?: string;
1198
+ alignment?: string;
1199
+ };
1200
+ /** Resolved bitmap used as the fill paint for vector geometry. */
1201
+ export type ShapeImageFill = {
1202
+ src: string;
1203
+ mode: 'stretch' | 'tile';
1204
+ sourceRect?: ShapeImageFillRect;
1205
+ fillRect?: ShapeImageFillRect;
1206
+ tile?: ShapeImageFillTile;
1207
+ dpi?: number;
1208
+ rotateWithShape?: boolean;
1209
+ };
978
1210
  export type VectorShapeStyle = {
979
1211
  fillColor?: FillColor;
1212
+ imageFill?: ShapeImageFill;
980
1213
  strokeColor?: StrokeColor;
981
1214
  strokeWidth?: number;
1215
+ /** Physical CSS-pixel dash/gap lengths resolved from the source stroke. */
1216
+ strokeDashArray?: number[];
1217
+ strokeLineJoin?: 'round' | 'bevel' | 'miter';
1218
+ strokeLineCap?: 'round' | 'square' | 'butt';
1219
+ /** Optional per-edge frame used by render-only table cells inside legacy shape groups. */
1220
+ borders?: CellBorders;
982
1221
  lineEnds?: LineEnds;
983
1222
  textContent?: ShapeTextContent;
1223
+ textLayout?: ShapeTextLayout;
984
1224
  textAlign?: string;
985
1225
  textVerticalAlign?: 'top' | 'center' | 'bottom';
1226
+ /** Legacy VML textbox text-flow semantics. */
1227
+ textFlow?: 'horizontal' | 'vertical' | 'vertical-ideographic' | 'horizontal-ideographic' | 'bottom-to-top';
986
1228
  textInsets?: {
987
1229
  top: number;
988
1230
  right: number;
@@ -1040,6 +1282,8 @@ export type DrawingBlockBase = {
1040
1282
  drawingContent?: DrawingContentSnapshot;
1041
1283
  attrs?: Record<string, unknown>;
1042
1284
  sourceAnchor?: SourceAnchor;
1285
+ /** Visible fail-closed replacement metadata owned by the projection layer. */
1286
+ placeholder?: RenderPlaceholder;
1043
1287
  };
1044
1288
  /**
1045
1289
  * Custom geometry path data extracted from a:custGeom/a:pathLst.
@@ -1061,13 +1305,20 @@ export type VectorShapeDrawing = DrawingBlockBase & {
1061
1305
  shapeKind?: string;
1062
1306
  customGeometry?: CustomGeometryData;
1063
1307
  fillColor?: FillColor;
1308
+ imageFill?: ShapeImageFill;
1064
1309
  strokeColor?: StrokeColor;
1065
1310
  strokeWidth?: number;
1311
+ strokeDashArray?: number[];
1312
+ strokeLineJoin?: 'round' | 'bevel' | 'miter';
1313
+ strokeLineCap?: 'round' | 'square' | 'butt';
1066
1314
  lineEnds?: LineEnds;
1067
1315
  effectExtent?: EffectExtent;
1068
1316
  textContent?: ShapeTextContent;
1317
+ textLayout?: ShapeTextLayout;
1318
+ textWarp?: ShapeTextWarp;
1069
1319
  textAlign?: string;
1070
1320
  textVerticalAlign?: 'top' | 'center' | 'bottom';
1321
+ textFlow?: 'horizontal' | 'vertical' | 'vertical-ideographic' | 'horizontal-ideographic' | 'bottom-to-top';
1071
1322
  textInsets?: {
1072
1323
  top: number;
1073
1324
  right: number;
@@ -1078,26 +1329,45 @@ export type VectorShapeDrawing = DrawingBlockBase & {
1078
1329
  export type TextboxDrawing = DrawingBlockBase & {
1079
1330
  drawingKind: 'textboxShape';
1080
1331
  geometry: DrawingGeometry;
1332
+ /** `a:spAutoFit`: resize the shape height to its measured text content. */
1333
+ autoFit?: boolean;
1081
1334
  shapeKind?: string;
1082
1335
  customGeometry?: CustomGeometryData;
1083
1336
  fillColor?: FillColor;
1337
+ imageFill?: ShapeImageFill;
1084
1338
  strokeColor?: StrokeColor;
1085
1339
  strokeWidth?: number;
1340
+ strokeDashArray?: number[];
1341
+ strokeLineJoin?: 'round' | 'bevel' | 'miter';
1342
+ strokeLineCap?: 'round' | 'square' | 'butt';
1086
1343
  lineEnds?: LineEnds;
1087
1344
  effectExtent?: EffectExtent;
1088
1345
  textContent?: ShapeTextContent;
1346
+ textLayout?: ShapeTextLayout;
1347
+ textWarp?: ShapeTextWarp;
1089
1348
  textAlign?: string;
1090
1349
  textVerticalAlign?: 'top' | 'center' | 'bottom';
1350
+ textFlow?: 'horizontal' | 'vertical' | 'vertical-ideographic' | 'horizontal-ideographic' | 'bottom-to-top';
1091
1351
  textInsets?: {
1092
1352
  top: number;
1093
1353
  right: number;
1094
1354
  bottom: number;
1095
1355
  left: number;
1096
1356
  };
1097
- contentBlocks: ParagraphBlock[];
1098
- /** Paragraph layout results for table-cell textboxes; populated by the layout bridge, read by the painter. */
1099
- contentMeasures?: ParagraphMeasure[];
1357
+ /**
1358
+ * Canonical block content owned by the textbox story.
1359
+ *
1360
+ * ECMA-376 permits general block-level WordprocessingML in `w:txbxContent`.
1361
+ * V2 currently supports paragraphs and tables explicitly; keeping this as a
1362
+ * named subset makes later block-family additions additive instead of
1363
+ * flattening rich content into drawing primitives.
1364
+ */
1365
+ contentBlocks: TextboxContentBlock[];
1366
+ /** Canonical layout results for textbox content; populated by measurement or the layout bridge. */
1367
+ contentMeasures?: TextboxContentMeasure[];
1100
1368
  };
1369
+ export type TextboxContentBlock = ParagraphBlock | TableBlock;
1370
+ export type TextboxContentMeasure = ParagraphMeasure | TableMeasure;
1101
1371
  export type ShapeGroupDrawing = DrawingBlockBase & {
1102
1372
  drawingKind: 'shapeGroup';
1103
1373
  geometry: DrawingGeometry;
@@ -1168,7 +1438,14 @@ export type SectionVerticalAlign = 'top' | 'center' | 'bottom' | 'both';
1168
1438
  export type SectionBreakBlock = {
1169
1439
  kind: 'sectionBreak';
1170
1440
  id: BlockId;
1171
- type?: 'continuous' | 'nextPage' | 'evenPage' | 'oddPage';
1441
+ type?: 'continuous' | 'nextColumn' | 'nextPage' | 'evenPage' | 'oddPage';
1442
+ /**
1443
+ * Physical page parity required for a `nextPage` break. Word derives this
1444
+ * when distinct odd/even headers are enabled and the new section explicitly
1445
+ * restarts page numbering; authored `evenPage`/`oddPage` breaks express the
1446
+ * same constraint through `type` instead.
1447
+ */
1448
+ requiredPageParity?: 'even' | 'odd';
1172
1449
  pageSize?: {
1173
1450
  w: number;
1174
1451
  h: number;
@@ -1266,10 +1543,21 @@ export type ColumnBreakBlock = {
1266
1543
  /** Positioning for anchored images (offsets in CSS px). */
1267
1544
  export type ImageAnchor = {
1268
1545
  isAnchored?: boolean;
1269
- hRelativeFrom?: 'column' | 'page' | 'margin';
1270
- vRelativeFrom?: 'paragraph' | 'page' | 'margin';
1271
- alignH?: 'left' | 'center' | 'right';
1272
- alignV?: 'top' | 'center' | 'bottom';
1546
+ /**
1547
+ * Page-space coordinates from `wp:simplePos` in CSS px.
1548
+ * ECMA-376 Part 1 §20.4.2.13: when present because `wp:anchor/@simplePos`
1549
+ * is true, these coordinates override positionH/positionV.
1550
+ */
1551
+ simplePos?: {
1552
+ x: number;
1553
+ y: number;
1554
+ };
1555
+ /** Keep the anchored object inside its table cell and resize the cell as needed. */
1556
+ layoutInCell?: boolean;
1557
+ hRelativeFrom?: AnchorHRelative;
1558
+ vRelativeFrom?: AnchorVRelative;
1559
+ alignH?: AnchorAlignH;
1560
+ alignV?: AnchorAlignV;
1273
1561
  offsetH?: number;
1274
1562
  offsetV?: number;
1275
1563
  behindDoc?: boolean;
@@ -1285,6 +1573,7 @@ export type ImageAnchor = {
1285
1573
  */
1286
1574
  export declare function isPageRelativeAnchor(input: {
1287
1575
  anchor?: {
1576
+ simplePos?: unknown;
1288
1577
  vRelativeFrom?: unknown;
1289
1578
  } | null;
1290
1579
  } | null | undefined): boolean;
@@ -1372,7 +1661,7 @@ export type ExclusionZone = {
1372
1661
  left: number;
1373
1662
  right: number;
1374
1663
  };
1375
- wrapMode: 'left' | 'right' | 'both' | 'none' | 'largest';
1664
+ wrapMode: 'left' | 'right' | 'both' | 'none' | 'largest' | 'topBottom';
1376
1665
  polygon?: number[][];
1377
1666
  };
1378
1667
  export type ParagraphSpacing = {
@@ -1645,6 +1934,8 @@ export type ParagraphAttrs = {
1645
1934
  tabIntervalTwips?: number;
1646
1935
  keepNext?: boolean;
1647
1936
  keepLines?: boolean;
1937
+ /** Prevent a single first or last paragraph line from appearing alone on a page. Defaults to true. */
1938
+ widowControl?: boolean;
1648
1939
  pageBreakBefore?: boolean;
1649
1940
  trackedChangesMode?: TrackedChangesMode;
1650
1941
  trackedChangesEnabled?: boolean;
@@ -1761,6 +2052,13 @@ export declare const isForcedSectPrSectionBreak: (block: FlowBlock | undefined)
1761
2052
  * accepted only when their source/anchor proves they belong to the same filler
1762
2053
  * run.
1763
2054
  */
2055
+ export type SectionBoundaryFillerScanCheckpoint = {
2056
+ index: number;
2057
+ total: number;
2058
+ };
2059
+ export declare function collectSectionBoundaryFillerBlockIdsSteps(blocks: readonly FlowBlock[], options?: {
2060
+ isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
2061
+ }, checkpointEveryBlocks?: number | null): Generator<SectionBoundaryFillerScanCheckpoint, ReadonlySet<string>, void>;
1764
2062
  export declare const collectSectionBoundaryFillerBlockIds: (blocks: readonly FlowBlock[], options?: {
1765
2063
  isTinyInlineBoundaryDrawing?: (block: DrawingBlock, index: number) => boolean;
1766
2064
  }) => ReadonlySet<string>;
@@ -1813,6 +2111,28 @@ export type LineInlineImageAlignment = {
1813
2111
  runIndex: number;
1814
2112
  verticalAlign: ImageRunVerticalAlign;
1815
2113
  };
2114
+ /**
2115
+ * Paint-ready geometry for one inline-box slice on a measured line.
2116
+ *
2117
+ * Measurement owns the slice geometry and resolved style. The painter consumes
2118
+ * these values directly and never normalizes logical sides or measures the DOM.
2119
+ */
2120
+ export type LineInlineBox = {
2121
+ id: string;
2122
+ /** Line-relative UTF-16 offsets covered by this slice. */
2123
+ from: number;
2124
+ to: number;
2125
+ x: number;
2126
+ width: number;
2127
+ top: number;
2128
+ height: number;
2129
+ startsRange: boolean;
2130
+ endsRange: boolean;
2131
+ style: ResolvedInlineBoxStyle;
2132
+ className?: string;
2133
+ data?: Record<string, string>;
2134
+ cursor?: 'default' | 'pointer' | 'text' | 'help';
2135
+ };
1816
2136
  export type Line = {
1817
2137
  fromRun: number;
1818
2138
  fromChar: number;
@@ -1843,6 +2163,8 @@ export type Line = {
1843
2163
  * wins over the entry here.
1844
2164
  */
1845
2165
  inlineImageAlignments?: LineInlineImageAlignment[];
2166
+ /** Paint-ready inline-box slices emitted by measurement. */
2167
+ inlineBoxes?: LineInlineBox[];
1846
2168
  /**
1847
2169
  * Measured tab widths keyed by tab run `pmStart`, stored alongside the
1848
2170
  * `ParagraphMeasure` so the painter can read them even after FlowBlock
@@ -1851,6 +2173,18 @@ export type Line = {
1851
2173
  */
1852
2174
  tabWidths?: Record<number, number>;
1853
2175
  };
2176
+ /**
2177
+ * One contiguous horizontal region available to a measured paragraph line.
2178
+ *
2179
+ * Coordinates are relative to the paragraph fragment's content origin. A line
2180
+ * can expose multiple regions when text wraps on both sides of a floating
2181
+ * object. Measuring owns the line breaks inside these regions; layout owns
2182
+ * deriving the regions from page/column float geometry.
2183
+ */
2184
+ export type ParagraphLineRegion = {
2185
+ offsetX: number;
2186
+ width: number;
2187
+ };
1854
2188
  export type LineSegment = {
1855
2189
  runIndex: number;
1856
2190
  fromChar: number;
@@ -1951,8 +2285,8 @@ export type DrawingMeasure = {
1951
2285
  naturalHeight: number;
1952
2286
  geometry: DrawingGeometry;
1953
2287
  groupTransform?: ShapeGroupTransform;
1954
- /** Canonical paragraph measurements for textbox content, when the drawing owns text. */
1955
- contentMeasures?: ParagraphMeasure[];
2288
+ /** Canonical block measurements for textbox content, when the drawing owns a textbox story. */
2289
+ contentMeasures?: TextboxContentMeasure[];
1956
2290
  };
1957
2291
  export type TableCellMeasure = {
1958
2292
  /** Multi-block cell measurements (new feature) */
@@ -2081,6 +2415,13 @@ export type FootnotePageLedger = {
2081
2415
  export type Page = {
2082
2416
  number: number;
2083
2417
  fragments: Fragment[];
2418
+ /**
2419
+ * Suppress header/footer stories on a physically inserted parity page.
2420
+ * Word emits these pages to satisfy odd/even section starts, but leaves the
2421
+ * page itself completely blank and does not treat it as page one of the new
2422
+ * section.
2423
+ */
2424
+ suppressHeaderFooter?: boolean;
2084
2425
  margins?: PageMargins;
2085
2426
  /**
2086
2427
  * Extra bottom space reserved on this page for footnotes (in px).
@@ -2314,7 +2655,7 @@ export type DrawingFragment = {
2314
2655
  drawingContentId?: string;
2315
2656
  /** V2 textbox story id for DrawingML textbox content painted inside this drawing. */
2316
2657
  textboxId?: string;
2317
- contentMeasures?: ParagraphMeasure[];
2658
+ contentMeasures?: TextboxContentMeasure[];
2318
2659
  pmStart?: number;
2319
2660
  pmEnd?: number;
2320
2661
  sourceAnchor?: SourceAnchor;
@@ -2345,6 +2686,18 @@ export type HeaderFooterType = 'default' | 'first' | 'even' | 'odd';
2345
2686
  export type HeaderFooterPage = {
2346
2687
  number: number;
2347
2688
  fragments: Fragment[];
2689
+ /**
2690
+ * Measurement height for this page's resolved story content. PAGE/NUMPAGES
2691
+ * fields can wrap differently across physical pages, so paint alignment must
2692
+ * not substitute the layout-wide maximum for this value.
2693
+ */
2694
+ measurementHeight?: number;
2695
+ /** Per-page minimum rendered y, including out-of-band decorations. */
2696
+ minY?: number;
2697
+ /** Per-page maximum rendered y + fragment height. */
2698
+ maxY?: number;
2699
+ /** Per-page visual extent (`maxY - minY`). */
2700
+ renderHeight?: number;
2348
2701
  numberText?: string;
2349
2702
  /** Section-aware numeric page value before formatting. */
2350
2703
  displayNumber?: number;
@@ -2455,5 +2808,7 @@ export declare const extractHeaderFooterSpace: (margins?: PageMargins | null) =>
2455
2808
  export type { ResolvedLayout, ResolvedPage, ResolvedPaintItem, ResolvedGroupItem, ResolvedFragmentItem, ResolvedParagraphContent, ResolvedTextLineItem, ResolvedDropCapItem, ResolvedListMarkerItem, ResolvedTableItem, ResolvedImageItem, ResolvedDrawingItem, ResolvedHeaderFooterPage, ResolvedHeaderFooterLayout, } from './resolved-layout.js';
2456
2809
  export { isResolvedTableItem, isResolvedImageItem, isResolvedDrawingItem } from './resolved-layout.js';
2457
2810
  export { expandRunsForInlineNewlines, isEmptyInlineSdtPlaceholderRun, isEmptySdtPlaceholderRun, sliceRunsForLine, } from './run-helpers.js';
2458
- export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
2811
+ export { INLINE_OBJECT_REPLACEMENT_CHARACTER, flattenParagraphVisibleText, mapVisibleRangeToRunSlices, type ParagraphVisibleRunSlice, } from './paragraph-visible-text.js';
2812
+ export { inlineBoxStyleSignature, isFiniteNonNegativeInteger, normalizeInlineBoxLogicalSides, type InlineBoxLogicalSides, type ResolvedInlineBoxLogicalSides, } from './inline-box.js';
2813
+ export { PAGE_CHECKPOINT_DEPENDENCY_CLASSES, areValidPageCheckpointDependencyClasses, type NonFlowingPageRelativeAnchorDependencyProof, type PageCheckpointDependencyClass, } from './incremental-dependency.js';
2459
2814
  export * as Engines from './engines/index.js';
@@ -0,0 +1,19 @@
1
+ import { ResolvedInlineBoxStyle } from './index.js';
2
+ export type InlineBoxLogicalSides = number | {
3
+ start: number;
4
+ end: number;
5
+ };
6
+ export type ResolvedInlineBoxLogicalSides = {
7
+ start: number;
8
+ end: number;
9
+ };
10
+ /** True for finite, non-negative integer CSS pixel values. */
11
+ export declare const isFiniteNonNegativeInteger: (value: unknown) => value is number;
12
+ /**
13
+ * Expands a scalar logical value into explicit start/end values.
14
+ *
15
+ * Undefined resolves to zero. Invalid or non-integer input fails closed.
16
+ */
17
+ export declare const normalizeInlineBoxLogicalSides: (value: InlineBoxLogicalSides | undefined) => ResolvedInlineBoxLogicalSides | null;
18
+ /** Stable signature for every metric and appearance value consumed by paint. */
19
+ export declare const inlineBoxStyleSignature: (style: ResolvedInlineBoxStyle) => string;
@@ -0,0 +1,19 @@
1
+ import { ParagraphBlock } from './index.js';
2
+ export declare const INLINE_OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
3
+ export type ParagraphVisibleRunSlice = {
4
+ runIndex: number;
5
+ fromChar: number;
6
+ toChar: number;
7
+ };
8
+ /**
9
+ * Flattens a paragraph into Document API visible-text coordinates.
10
+ *
11
+ * Text is preserved verbatim in UTF-16. Every non-text run contributes one
12
+ * U+FFFC object-replacement character, regardless of its rendered label.
13
+ */
14
+ export declare const flattenParagraphVisibleText: (block: ParagraphBlock) => string;
15
+ /**
16
+ * Maps a validated visible-text range to slices in the paragraph's run space.
17
+ * Returns null for non-integer, reversed, negative, or out-of-bounds ranges.
18
+ */
19
+ export declare const mapVisibleRangeToRunSlices: (block: ParagraphBlock, from: number, to: number) => ParagraphVisibleRunSlice[] | null;