@betteroffice/docx 0.0.1 → 0.0.3

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 (165) hide show
  1. package/README.md +19 -0
  2. package/dist/chunk-AEQOEQJ7.mjs +57 -0
  3. package/dist/chunk-AZ52IWB6.mjs +16 -0
  4. package/dist/{chunk-SINEY6ZF.mjs → chunk-B4IR6YP4.mjs} +1 -1
  5. package/dist/chunk-GGEGIQRK.mjs +1 -0
  6. package/dist/chunk-IFT6DUJX.mjs +1 -0
  7. package/dist/chunk-J7LNO6SM.mjs +1 -0
  8. package/dist/{chunk-H3JCIGWK.mjs → chunk-NJHOPXZW.mjs} +1 -1
  9. package/dist/{chunk-KXNZFTTK.mjs → chunk-WBH3SXI6.mjs} +1 -1
  10. package/dist/chunk-WON6K4FY.mjs +1 -0
  11. package/dist/chunk-Y7RUNRU2.mjs +1 -0
  12. package/dist/collaboration/index.d.mts +65 -0
  13. package/dist/collaboration/index.mjs +1 -0
  14. package/dist/{content-sSHuWw49.d.mts → content-MOZ6hKP4.d.mts} +357 -357
  15. package/dist/core.d.mts +148 -341
  16. package/dist/core.mjs +1 -1
  17. package/dist/{displayListQueries-p-ijSzdh.d.mts → displayListQueries-BJlo7Jkz.d.mts} +24 -6
  18. package/dist/docx/index.d.mts +40 -520
  19. package/dist/docx/index.mjs +2 -2
  20. package/dist/editor/index.d.mts +36 -151
  21. package/dist/editor/index.mjs +1 -1
  22. package/dist/{fontLoader-Bx6DK6-2.d.mts → fontLoader-aSewHMKF.d.mts} +65 -63
  23. package/dist/{formatting-DoL7KBSL.d.mts → formatting-D1EPSaJP.d.mts} +1 -1
  24. package/dist/{rustDisplayList-dqunvwxH.d.mts → frameDelta-D965X8yK.d.mts} +3 -274
  25. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  26. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  27. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  28. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  29. package/dist/index-Dx4Z3lkz.d.mts +1010 -0
  30. package/dist/layout/index.d.mts +19 -240
  31. package/dist/layout/index.mjs +1 -1
  32. package/dist/layout/pagination/index.d.mts +10 -58
  33. package/dist/layout/pagination/index.mjs +1 -1
  34. package/dist/layout/render/index.d.mts +11 -11
  35. package/dist/layout/render/index.mjs +1 -1
  36. package/dist/plugin-api/RenderedDomContext.d.mts +9 -9
  37. package/dist/plugin-api/index.d.mts +191 -6
  38. package/dist/plugin-api/resolveItemPositions.d.mts +4 -5
  39. package/dist/rustDisplayList-BRuZBqdL.d.mts +278 -0
  40. package/dist/rustMeasureSource-D1KsQvVC.d.mts +106 -0
  41. package/dist/selectiveSave-CVoajSKE.d.mts +56 -0
  42. package/dist/styles/index.d.mts +4 -39
  43. package/dist/styles/index.mjs +1 -1
  44. package/dist/{styles-VxNcXLdi.d.mts → styles-Dn_o3Vo5.d.mts} +2 -2
  45. package/dist/types/content.d.mts +2 -2
  46. package/dist/types/document.d.mts +40 -14
  47. package/dist/{types-DNrYr6yQ.d.mts → types-BfqUl2h_.d.mts} +3 -71
  48. package/dist/utils/comments.d.mts +2 -2
  49. package/dist/utils/index.d.mts +110 -576
  50. package/dist/utils/index.mjs +1 -84
  51. package/dist/utils/stylePreview.d.mts +2 -2
  52. package/dist/utils/units.d.mts +33 -2
  53. package/dist/wasm-DO3BUV7C.mjs +1 -0
  54. package/dist/wasm-NWXX4H5G.mjs +1 -0
  55. package/dist/wasm-edit.d.mts +14 -5
  56. package/dist/wasm-edit.mjs +1 -1
  57. package/dist/wasm-layout.d.mts +10 -1
  58. package/dist/wasm-layout.mjs +1 -1
  59. package/dist/wasm-opc.mjs +1 -1
  60. package/dist/wasm-parse.mjs +1 -1
  61. package/dist/yrs/index.d.mts +6 -881
  62. package/dist/yrs/index.mjs +1 -1
  63. package/dist/yrs/residentEngineWorker.mjs +1 -1
  64. package/package.json +16 -139
  65. package/dist/Subscribable-DOz6Ohoo.d.mts +0 -33
  66. package/dist/agent/index.d.mts +0 -531
  67. package/dist/agent/index.mjs +0 -1
  68. package/dist/chunk-34K66SY4.mjs +0 -1
  69. package/dist/chunk-4RCISPPE.mjs +0 -1
  70. package/dist/chunk-52GB3Y42.mjs +0 -1
  71. package/dist/chunk-6NEKRDXF.mjs +0 -1
  72. package/dist/chunk-6PW4CWUG.mjs +0 -1
  73. package/dist/chunk-7DEIW7FL.mjs +0 -1
  74. package/dist/chunk-7PCO5I2O.mjs +0 -1
  75. package/dist/chunk-BI3B33LI.mjs +0 -1
  76. package/dist/chunk-BIQWVK5P.mjs +0 -2
  77. package/dist/chunk-CIRN3LZA.mjs +0 -1
  78. package/dist/chunk-DXKG3HQ5.mjs +0 -16
  79. package/dist/chunk-FPZBTOD6.mjs +0 -1
  80. package/dist/chunk-FZIA7OFY.mjs +0 -1
  81. package/dist/chunk-GWKJ2Y4Y.mjs +0 -1
  82. package/dist/chunk-HJGAQIU7.mjs +0 -2
  83. package/dist/chunk-I6KKMUUC.mjs +0 -1
  84. package/dist/chunk-IL5JZJT7.mjs +0 -1
  85. package/dist/chunk-JY6ILTNS.mjs +0 -1
  86. package/dist/chunk-KEE52TT5.mjs +0 -1
  87. package/dist/chunk-KVKLLTDP.mjs +0 -58
  88. package/dist/chunk-L5ISVQ3W.mjs +0 -1
  89. package/dist/chunk-LDUWIM7M.mjs +0 -1
  90. package/dist/chunk-N5Q3YN64.mjs +0 -1
  91. package/dist/chunk-NEWOMDTX.mjs +0 -1
  92. package/dist/chunk-O2QSE2I7.mjs +0 -1
  93. package/dist/chunk-OJOHXQNQ.mjs +0 -1
  94. package/dist/chunk-OMR3TWCD.mjs +0 -2
  95. package/dist/chunk-P3KDV4M2.mjs +0 -1
  96. package/dist/chunk-Q7PO7V73.mjs +0 -1
  97. package/dist/chunk-QOUFE3VX.mjs +0 -1
  98. package/dist/chunk-TYHI7RAD.mjs +0 -1
  99. package/dist/chunk-UIEJWORW.mjs +0 -1
  100. package/dist/chunk-VAOUFAUH.mjs +0 -1
  101. package/dist/chunk-VBOTMRXV.mjs +0 -1
  102. package/dist/chunk-VCER63GQ.mjs +0 -1
  103. package/dist/chunk-WAUF2UC7.mjs +0 -2
  104. package/dist/chunk-X4XDO3LZ.mjs +0 -1
  105. package/dist/chunk-XQBCCJBO.mjs +0 -9
  106. package/dist/chunk-XWUOLYRQ.mjs +0 -2
  107. package/dist/chunk-XYH6XWP3.mjs +0 -10
  108. package/dist/chunk-YBIM6UJV.mjs +0 -8
  109. package/dist/chunk-YCIH2Q3E.mjs +0 -1
  110. package/dist/chunk-ZOV5KL7C.mjs +0 -1
  111. package/dist/colorResolver-n0o7H7ep.d.mts +0 -290
  112. package/dist/core-plugins.d.mts +0 -37
  113. package/dist/core-plugins.mjs +0 -1
  114. package/dist/docx/parser.d.mts +0 -41
  115. package/dist/docx/parser.mjs +0 -1
  116. package/dist/docx/rezip.d.mts +0 -148
  117. package/dist/docx/rezip.mjs +0 -1
  118. package/dist/docx/serializer/index.d.mts +0 -42
  119. package/dist/docx/serializer/index.mjs +0 -1
  120. package/dist/editorTree-DO5PyDK8.d.mts +0 -37
  121. package/dist/executor-7O2RBJ2B.mjs +0 -1
  122. package/dist/headerFooterLayout-0zPT64Qc.d.mts +0 -316
  123. package/dist/headless.d.mts +0 -69
  124. package/dist/headless.mjs +0 -1
  125. package/dist/layout/flow/index.d.mts +0 -149
  126. package/dist/layout/flow/index.mjs +0 -1
  127. package/dist/layout/measure/index.d.mts +0 -324
  128. package/dist/layout/measure/index.mjs +0 -1
  129. package/dist/layout/pagination/types.d.mts +0 -4
  130. package/dist/layout/pagination/types.mjs +0 -1
  131. package/dist/managers/AutoSaveManager.d.mts +0 -81
  132. package/dist/managers/AutoSaveManager.mjs +0 -1
  133. package/dist/managers/TableSelectionManager.d.mts +0 -74
  134. package/dist/managers/TableSelectionManager.mjs +0 -1
  135. package/dist/managers/types.d.mts +0 -113
  136. package/dist/managers/types.mjs +0 -0
  137. package/dist/mcp-cli.mjs +0 -142
  138. package/dist/mcp.d.mts +0 -162
  139. package/dist/mcp.mjs +0 -16
  140. package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +0 -109
  141. package/dist/measuredBlock-DZwz8zhD.d.mts +0 -26
  142. package/dist/plugin-api/types.d.mts +0 -193
  143. package/dist/plugin-api/types.mjs +0 -0
  144. package/dist/processTemplate-HDUIZFJ5.mjs +0 -1
  145. package/dist/registry-DMM5VTdT.d.mts +0 -165
  146. package/dist/rustPagination-Bj2hq013.d.mts +0 -106
  147. package/dist/sectionConfigs-DW3J8q0X.d.mts +0 -55
  148. package/dist/selectionContext-Buc9BCU1.d.mts +0 -570
  149. package/dist/selectiveSave-oFBJ1n71.d.mts +0 -16
  150. package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +0 -23
  151. package/dist/settingsParser-CcGvtmCK.d.mts +0 -33
  152. package/dist/types/agentApi.d.mts +0 -456
  153. package/dist/types/agentApi.mjs +0 -1
  154. package/dist/types-dYdjUZMo.d.mts +0 -311
  155. package/dist/units-O5Y02RKQ.d.mts +0 -34
  156. package/dist/utils/headingCollector.d.mts +0 -28
  157. package/dist/utils/headingCollector.mjs +0 -1
  158. package/dist/utils/highlightColors.d.mts +0 -14
  159. package/dist/utils/highlightColors.mjs +0 -1
  160. package/dist/utils/textSelection.d.mts +0 -92
  161. package/dist/utils/textSelection.mjs +0 -1
  162. package/dist/variableDetector-Borj29SF.d.mts +0 -115
  163. package/dist/wasm-FZQ5XB2Y.mjs +0 -1
  164. package/dist/wasm-SA237OSP.mjs +0 -1
  165. package/dist/watermarkApi-DCxjutkg.d.mts +0 -38
@@ -1,79 +1,14 @@
1
- export { ToLayoutBlocksOptions, convertBorderSpecToLayout, demoteBlockLikeFloatingTables, isBlockLikeFloatingTable, resetBlockIdCounter, resolveListTemplate, toLayoutBlocks } from './flow/index.mjs';
2
- import { ao as TableBlock, P as PageMargins, e as LayoutBlock, H as HeaderFooterContent, B as BlockExtent, ar as TableExtent, C as ColumnLayout } from '../types-DNrYr6yQ.mjs';
3
- export { F as FloatPageGeometry, a as FloatingExclusionRect, b as FloatingImageZone, c as FloatingLineSegmentZone, M as MeasureBlockFn, d as clampFloatingWrapMargins, g as getFloatingMargins, m as measureBlocksWithFloats, r as rectsToFloatingZones } from '../measureBlocksPipeline-Df0Bbrwy.mjs';
4
- export { BundledFontProvider, EmbeddedFaceInput, FontScript, FontStyle, RustMeasureSource, RustMeasureStats, RustTextEngine, createRustMeasureSource, getRustTextEngine, hashParagraphBlock } from './measure/index.mjs';
5
- export { C as ConvertFootnoteOptions, a as ConvertHeaderFooterOptions, F as FOOTNOTE_COLUMN_GAP_PX, b as FOOTNOTE_SEPARATOR_HEIGHT, c as FootnoteRefLocation, H as HeaderFooterMetrics, M as MAX_FOOTNOTE_LAYOUT_PASSES, d as MeasureBlocksFn, S as StabilizeFootnoteLayoutArgs, e as StabilizeFootnoteLayoutResult, f as applyFootnotePresentation, g as buildFootnoteContentMap, h as buildFootnoteRenderItems, i as calculateFootnoteReservedHeights, j as calculateHeaderFooterVisualBounds, k as collectFootnoteRefs, l as computeHfCaretRectsFromDisplayList, m as computeHfSelectionRectsFromDisplayList, n as contributesToHeaderFooterFlowHeight, o as convertFootnoteToContent, p as convertHeaderFooterToContent, q as distributeFootnotesIntoColumns, r as footnoteReservedHeightsEqual, s as mapFootnotesToPages, t as normalizeHeaderFooterMeasureBlocks, u as resolveHeaderFooterVisualTop, v as stabilizeFootnoteLayout } from '../headerFooterLayout-0zPT64Qc.mjs';
6
- import { S as SectionLayoutConfig } from '../sectionConfigs-DW3J8q0X.mjs';
1
+ export { B as BundledFontProvider, E as EmbeddedFaceInput, F as FontScript, a as ResidentFontRequirement, R as ResidentMeasurementConfig, b as RustMeasureSource, c as RustTextEngine, d as createRustMeasureSource, g as getRustTextEngine } from '../rustMeasureSource-D1KsQvVC.mjs';
7
2
  import { Document } from '../types/document.mjs';
8
- import { S as SectionProperties, m as HeaderFooter } from '../content-sSHuWw49.mjs';
9
- import '../editorTree-DO5PyDK8.mjs';
10
- import '../formatting-DoL7KBSL.mjs';
11
- import '../settingsParser-CcGvtmCK.mjs';
12
- import '../styles-VxNcXLdi.mjs';
13
- import '../measuredBlock-DZwz8zhD.mjs';
14
- import '../displayListQueries-p-ijSzdh.mjs';
15
- import '../rustDisplayList-dqunvwxH.mjs';
3
+ import { S as SectionProperties, H as HeaderFooter } from '../content-MOZ6hKP4.mjs';
4
+ import { a as DisplayListQueries, D as DisplayListRect } from '../displayListQueries-BJlo7Jkz.mjs';
5
+ import '../formatting-D1EPSaJP.mjs';
6
+ import '../styles-Dn_o3Vo5.mjs';
16
7
  import '../docx/wrapTypes.mjs';
17
-
18
- /**
19
- * @internal Helpers for resolving DOCX table-width metadata into pixel widths.
20
- */
21
-
22
- /**
23
- * Resolve a DOCX width pair to pixels. `pct` values are 50ths of a percent
24
- * (ECMA-376 §17.18.111 — 5000 means 100%). `dxa` / `auto` / unset are twips.
25
- *
26
- * @internal
27
- */
28
- declare function resolveTableWidthPx(value: number | undefined, widthType: string | undefined, parentWidth: number): number | undefined;
29
- /** A cell with its resolved grid position (column index honoring spans). */
30
- interface ResolvedGridCell {
31
- rowIndex: number;
32
- cellIndex: number;
33
- columnIndex: number;
34
- colSpan: number;
35
- rowSpan: number;
36
- }
37
- /**
38
- * Resolve every cell's grid column index, accounting for `colSpan` and the
39
- * columns occupied by vertically-merged (`rowSpan`) cells from earlier rows.
40
- *
41
- * Single source of truth for table grid geometry — the measurer, the painter,
42
- * and the row-break paginator all consume this so they agree on which column a
43
- * cell lives in. Width-free on purpose: callers multiply `columnIndex` by their
44
- * own (possibly scaled) column widths to get an x offset.
45
- *
46
- * @internal
47
- */
48
- declare function resolveCellGrid(tableBlock: TableBlock): ResolvedGridCell[];
49
- /** Total grid columns, derived from the widest row's accumulated colSpans. */
50
- declare function countTableColumns(tableBlock: TableBlock): number;
51
- /**
52
- * Make `columnWidths` exactly `colCount` long with every entry positive.
53
- * Missing trailing columns inherit the average of existing positives; zero
54
- * or negative entries split the leftover `targetWidth` evenly. Callers
55
- * scale down totals that exceed the target — this helper only fills gaps.
56
- */
57
- declare function normalizeTableColumnWidths(columnWidths: number[], colCount: number, targetWidth: number): number[];
58
- /**
59
- * Resolve a table's per-column pixel widths from its grid metadata and width
60
- * budget — the width half of `measureTableBlock`, with NO cell-content
61
- * measurement. Factored out so a caller that only needs widths (e.g. deciding
62
- * whether a floating table is effectively full-width, before the main measure
63
- * pass) doesn't have to measure every cell.
64
- *
65
- * @internal
66
- */
67
- declare function resolveTableColumnWidths(tableBlock: TableBlock, contentWidth: number): number[];
68
- /**
69
- * Total pixel width of a table — sum of its resolved column widths, falling
70
- * back to the explicit table width or the content-width budget. No cell-content
71
- * measurement, so it is safe to call before the main measure pass. Mirrors the
72
- * `totalWidth` that `measureTableBlock` produces.
73
- *
74
- * @internal
75
- */
76
- declare function resolveTableTotalWidthPx(tableBlock: TableBlock, contentWidth: number): number;
8
+ import '../frameDelta-D965X8yK.mjs';
9
+ import '../rustDisplayList-BRuZBqdL.mjs';
10
+ import '../types-BfqUl2h_.mjs';
11
+ import './pagination/index.mjs';
77
12
 
78
13
  /**
79
14
  * Selection-overlay geometry value types, shared by the canvas overlays and
@@ -116,68 +51,15 @@ type CaretPosition = {
116
51
  pageIndex: number;
117
52
  };
118
53
 
119
- /**
120
- * Header/footer body-margin extension.
121
- *
122
- * Word grows the header (or footer) band when its in-flow content is taller
123
- * than the authored top (or bottom) margin minus the header/footer distance,
124
- * pushing the body text down (or up). This module owns that computation so the
125
- * React and Vue adapters share one implementation instead of byte-identical
126
- * inline copies (the layout pipelines were drifting candidates — see
127
- * `docx-editor` engine-unification work, issue #696).
128
- *
129
- * Two correctness rules live here:
130
- *
131
- * 1. The band height is driven by `HeaderFooterContent.flowHeight` (in-flow
132
- * content only), NOT `height` / `visualBottom`. A page/margin-anchored
133
- * float — e.g. a full-page letterhead anchored in a header — is positioned
134
- * on the page and does not push the body in Word. Counting it inflated the
135
- * effective top margin past the page on real-world templates, so the
136
- * paginator hard-threw "page size and margins yield no content area" and
137
- * the document rendered blank (issue #705).
138
- *
139
- * 2. A clamp guarantees `top + bottom` never consumes the whole page, so a
140
- * pathological in-flow header degrades to a thin content band with a
141
- * warning instead of aborting pagination.
142
- */
143
-
144
- /** @public */
145
- interface ExtendMarginsForHeaderFooterInput {
146
- pageSize: {
147
- w: number;
148
- h: number;
149
- };
150
- /** Body fallback margins. */
151
- margins: PageMargins;
152
- /** Final-section margins (last `sectPr`). */
153
- finalMargins: PageMargins;
154
- /**
155
- * Body flow blocks. Each `sectionBreak` block's `margins` is extended IN
156
- * PLACE so multi-section documents paginate with the same band growth (the
157
- * layout engine prefers `sectionBreak.margins` over the body fallback).
158
- */
159
- bodyBlocks?: LayoutBlock[];
160
- /** Header variants in play this layout (e.g. default + first-page). */
161
- headers?: Array<HeaderFooterContent | undefined>;
162
- /** Footer variants in play this layout. */
163
- footers?: Array<HeaderFooterContent | undefined>;
164
- /** Optional diagnostic sink for the clamp (adapters pass `console.warn`). */
165
- warn?: (message: string) => void;
166
- }
167
- /** @public */
168
- interface ExtendMarginsForHeaderFooterResult {
169
- margins: PageMargins;
170
- finalMargins: PageMargins;
171
- }
172
- /**
173
- * Extend body margins so the body clears the header/footer bands, mirroring
174
- * Word. Returns new `margins` / `finalMargins`; mutates `sectionBreak.margins`
175
- * in place. When no extension is needed the original objects are returned
176
- * unchanged.
177
- *
178
- * @public
179
- */
180
- declare function extendMarginsForHeaderFooter(input: ExtendMarginsForHeaderFooterInput): ExtendMarginsForHeaderFooterResult;
54
+ declare const DEFAULT_PAGE_HEIGHT_PX = 1056;
55
+ declare function resolveHeaderFooter(document: Document | null, section: SectionProperties | null | undefined): {
56
+ header: HeaderFooter | null;
57
+ footer: HeaderFooter | null;
58
+ firstHeader: HeaderFooter | null;
59
+ firstFooter: HeaderFooter | null;
60
+ };
61
+ declare function computeHfCaretRectsFromDisplayList(queries: DisplayListQueries, section: 'header' | 'footer', rId: string, position: number, pageIndex?: number): DisplayListRect[];
62
+ declare function computeHfSelectionRectsFromDisplayList(queries: DisplayListQueries, section: 'header' | 'footer', rId: string, from: number, to: number, pageIndex?: number): DisplayListRect[];
181
63
 
182
64
  /** Coordinates selection paint with the latest completed layout sequence. */
183
65
  declare class LayoutSelectionGate {
@@ -201,107 +83,4 @@ declare class LayoutSelectionGate {
201
83
  };
202
84
  }
203
85
 
204
- /**
205
- * Shared table measurement helper.
206
- *
207
- * Both React's PagedEditor and Vue's useDocxEditor measure tables the
208
- * same way: resolve column widths through `tableWidthUtils`, track
209
- * column occupancy across vertically merged cells, then call back into
210
- * the adapter's `measureBlock` for each cell's contained blocks.
211
- *
212
- * This module lives in core (not in either adapter) so a fix on one
213
- * side automatically applies to both. The recursive cell-content
214
- * measurement is delegated to the caller via `measureBlock` because
215
- * each adapter's block coverage differs (React supports floating
216
- * zones, footnotes, textBoxes; Vue is a subset).
217
- */
218
-
219
- /**
220
- * Visual height of a single block inside a table cell.
221
- *
222
- * A one-line paragraph that contains only image runs is laid out at the
223
- * image's intrinsic height (plus the paragraph's explicit spacing), not
224
- * a full text line — matching Word's per-cell layout. Everything else
225
- * uses the measured `totalHeight` / `height`.
226
- */
227
- declare function measureTableCellBlockVisualHeight(block: LayoutBlock, blockMeasure: BlockExtent): number;
228
- /**
229
- * measure a `TableBlock` against a content-width budget: resolve the column
230
- * grid, measure every cell's blocks, then size rows — with vertically merged
231
- * cells distributing their surplus height in a second pass.
232
- *
233
- * `measureBlock` is the per-cell-content callback; the adapter supplies its
234
- * own so block coverage stays per-renderer.
235
- */
236
- declare function measureTableBlock(tableBlock: TableBlock, contentWidth: number, measureBlock: (block: LayoutBlock, contentWidth: number) => BlockExtent): TableExtent;
237
-
238
- /**
239
- * Section-properties → page geometry helpers.
240
- *
241
- * Both adapters need the same translation from `SectionProperties` (twips
242
- * + DOCX field names) into the layout engine's pixel-shaped `PageSize`
243
- * and `PageMargins`. Living in core eliminates the subtle React/Vue
244
- * drift that grows when each adapter ships its own twipsToPixels math.
245
- */
246
-
247
- /** US Letter at 96 DPI — Word's default page size. */
248
- declare const DEFAULT_PAGE_WIDTH_PX = 816;
249
- /** US Letter at 96 DPI. */
250
- declare const DEFAULT_PAGE_HEIGHT_PX = 1056;
251
- /** 1 inch at 96 DPI — Word's default body margins. */
252
- declare const DEFAULT_BODY_MARGIN_PX = 96;
253
- /** Word's default `headerDistance` / `footerDistance` (0.5in = 48px). */
254
- declare const DEFAULT_HF_DISTANCE_PX = 48;
255
- /** Convert twips to pixels (1 twip = 1/20 point, 96 pixels per inch). */
256
- declare function twipsToPixels(twips: number): number;
257
- /**
258
- * Convert SectionProperties page size (twips) → pixel `{ w, h }`.
259
- *
260
- * Page size is a SIZE: a literal `0` (malformed `w:pgSz`) defaults to Letter
261
- * rather than rendering a zero-area page — so the truthy guard is intentional
262
- * here (contrast `getMargins`, where `0` is honored). See `twipsToPxOr`.
263
- */
264
- declare function getPageSize(sp: SectionProperties | null | undefined): {
265
- w: number;
266
- h: number;
267
- };
268
- /**
269
- * Convert SectionProperties margins (twips) → pixel `PageMargins`.
270
- *
271
- * Every distance is an OFFSET, so an explicit `0` is honored (full-bleed body
272
- * margins; a header/footer pinned to the page edge — issue #740). Only an
273
- * ABSENT distance falls back to Word's default. `header`/`footer` default to
274
- * 48px (Word's 0.5in) so the HF margin-extension math needn't special-case
275
- * undefined.
276
- */
277
- declare function getMargins(sp: SectionProperties | null | undefined): PageMargins;
278
- /**
279
- * Resolve the HeaderFooter pair (default + first-page) for a section.
280
- *
281
- * Mirrors React's lookup in DocxEditor.tsx: read `pkg.headers`/`footers`
282
- * (Maps keyed by rId), resolve through `sp.headerReferences` /
283
- * `footerReferences`. When `titlePg` is unset and only `first` HFs
284
- * exist, they serve as the default — same Word fallback both adapters
285
- * have shipped.
286
- */
287
- declare function resolveHeaderFooter(doc: Document | null, sp: SectionProperties | null | undefined): {
288
- header: HeaderFooter | null;
289
- footer: HeaderFooter | null;
290
- firstHeader: HeaderFooter | null;
291
- firstFooter: HeaderFooter | null;
292
- };
293
- /**
294
- * Extract column layout from section properties.
295
- * Returns undefined for single-column (default) to avoid unnecessary paginator overhead.
296
- */
297
- declare function getColumns(sectionProps: SectionProperties | null | undefined): ColumnLayout | undefined;
298
- declare function columnWidthForSection(config: SectionLayoutConfig): number;
299
- /**
300
- * Compute per-block measurement widths by scanning for section breaks.
301
- * Blocks must be measured with the page width/margins/columns of their own
302
- * section so that the layout engine can paginate them against the right
303
- * geometry without remeasuring.
304
- */
305
- declare function computePerBlockWidths(blocks: LayoutBlock[], initialConfig: SectionLayoutConfig, finalConfig: SectionLayoutConfig): number[];
306
-
307
- export { type CaretPosition, DEFAULT_BODY_MARGIN_PX, DEFAULT_HF_DISTANCE_PX, DEFAULT_PAGE_HEIGHT_PX, DEFAULT_PAGE_WIDTH_PX, type ExtendMarginsForHeaderFooterInput, type ExtendMarginsForHeaderFooterResult, LayoutSelectionGate, type ResolvedGridCell, type SelectionRect, columnWidthForSection, computePerBlockWidths, countTableColumns, extendMarginsForHeaderFooter, getColumns, getMargins, getPageSize, measureTableBlock, measureTableCellBlockVisualHeight, normalizeTableColumnWidths, resolveCellGrid, resolveHeaderFooter, resolveTableColumnWidths, resolveTableTotalWidthPx, resolveTableWidthPx, twipsToPixels };
86
+ export { type CaretPosition, DEFAULT_PAGE_HEIGHT_PX, LayoutSelectionGate, type SelectionRect, computeHfCaretRectsFromDisplayList, computeHfSelectionRectsFromDisplayList, resolveHeaderFooter };
@@ -1 +1 @@
1
- export{A as DEFAULT_BODY_MARGIN_PX,B as DEFAULT_HF_DISTANCE_PX,z as DEFAULT_PAGE_HEIGHT_PX,y as DEFAULT_PAGE_WIDTH_PX,b as FOOTNOTE_COLUMN_GAP_PX,a as FOOTNOTE_SEPARATOR_HEIGHT,x as LayoutSelectionGate,c as MAX_FOOTNOTE_LAYOUT_PASSES,h as applyFootnotePresentation,k as buildFootnoteContentMap,o as buildFootnoteRenderItems,m as calculateFootnoteReservedHeights,s as calculateHeaderFooterVisualBounds,f as collectFootnoteRefs,H as columnWidthForSection,u as computeHfCaretRectsFromDisplayList,v as computeHfSelectionRectsFromDisplayList,I as computePerBlockWidths,r as contributesToHeaderFooterFlowHeight,i as convertFootnoteToContent,t as convertHeaderFooterToContent,l as distributeFootnotesIntoColumns,w as extendMarginsForHeaderFooter,d as footnoteReservedHeightsEqual,G as getColumns,E as getMargins,D as getPageSize,g as mapFootnotesToPages,p as normalizeHeaderFooterMeasureBlocks,F as resolveHeaderFooter,q as resolveHeaderFooterVisualTop,n as stabilizeFootnoteLayout,C as twipsToPixels}from'../chunk-P3KDV4M2.mjs';export{h as createRustMeasureSource,e as getRustTextEngine,d as hashParagraphBlock,c as measureBlocksWithFloats,b as measureTableBlock,a as measureTableCellBlockVisualHeight}from'../chunk-7DEIW7FL.mjs';export{a as convertBorderSpecToLayout,e as demoteBlockLikeFloatingTables,d as isBlockLikeFloatingTable,b as resolveListTemplate,c as toLayoutBlocks}from'../chunk-IL5JZJT7.mjs';export{d as resetBlockIdCounter}from'../chunk-GWKJ2Y4Y.mjs';export{g as clampFloatingWrapMargins,c as countTableColumns,i as getFloatingMargins,d as normalizeTableColumnWidths,h as rectsToFloatingZones,b as resolveCellGrid,e as resolveTableColumnWidths,f as resolveTableTotalWidthPx,a as resolveTableWidthPx}from'../chunk-52GB3Y42.mjs';import'../chunk-7PCO5I2O.mjs';import'../chunk-X4XDO3LZ.mjs';import'../chunk-L5ISVQ3W.mjs';import'../chunk-OMR3TWCD.mjs';import'../chunk-XWUOLYRQ.mjs';import'../chunk-HJGAQIU7.mjs';import'../chunk-FZIA7OFY.mjs';import'../chunk-OBQGPMPQ.mjs';import'../chunk-3UBMCDME.mjs';import'../chunk-FPZBTOD6.mjs';import'../chunk-H3JCIGWK.mjs';import'../chunk-SINEY6ZF.mjs';import'../chunk-T4EZMUXM.mjs';import'../chunk-TTRUPDAB.mjs';
1
+ import {d,e,g as g$1,c,f,b as b$1}from'../chunk-TTRUPDAB.mjs';function x(o){return o.trim().toLowerCase()}function B(o,e,t){return `${x(o)}|${e?1:0}|${t?1:0}`}var I=class{constructor(e,t){b$1(this,"sink");b$1(this,"bundled");b$1(this,"facesByFamily",new Map);b$1(this,"faceIds",new WeakMap);b$1(this,"bundledIds",new Map);b$1(this,"lastResortIds",new Map);b$1(this,"bufferIds",new WeakMap);b$1(this,"scriptIds",new Map);b$1(this,"scriptResults",new Map);b$1(this,"chains",new Map);b$1(this,"chainResults",new Map);b$1(this,"generation",0);this.sink=e,this.bundled=t?.bundled;}setEmbeddedFaces(e){this.generation++,this.facesByFamily=new Map;for(let t of e){let n=x(t.family),r=this.facesByFamily.get(n);r?r.push(t):this.facesByFamily.set(n,[t]);}this.chains=new Map,this.chainResults=new Map;}getFontIdChain(e,t,n){let r=B(e,t,n),i=this.chains.get(r);return i||(i=this.resolveChain(r,e,t,n),this.chains.set(r,i)),i}getCachedFontIdChain(e,t,n){return this.chainResults.get(B(e,t,n))}getScriptFallbackIds(e){let t=[...new Set(e)];return Promise.all(t.map(n=>this.resolveScript(n))).then(n=>{let r=[];for(let i of n)i!==null&&!r.includes(i)&&r.push(i);return r})}getCachedScriptFallbackIds(e){let t=[];for(let n of e){if(!this.scriptResults.has(n))return;let r=this.scriptResults.get(n);r!==null&&!t.includes(r)&&t.push(r);}return t}clear(){this.generation++,this.faceIds=new WeakMap,this.bundledIds=new Map,this.lastResortIds=new Map,this.bufferIds=new WeakMap,this.scriptIds=new Map,this.scriptResults=new Map,this.chains=new Map,this.chainResults=new Map;}async resolveChain(e,t,n,r){let i=this.generation,s=[],a=this.pickEmbeddedFace(t,n,r);if(a){let l=await this.registerFace(a);l!==null&&s.push(l);}let f=this.bundled?.resolve(t,n,r);if(f){let l=await this.registerBundled(e,f,t);l!==null&&!s.includes(l)&&s.push(l);}let h=this.bundled?.resolveLastResort?.(t,n,r);if(h){let l=await this.registerLastResort(e,h,t);l!==null&&!s.includes(l)&&s.push(l);}return i===this.generation&&this.chainResults.set(e,s),s}pickEmbeddedFace(e,t,n){let r=this.facesByFamily.get(x(e));if(!r)return;let i=t?"bold":"normal",s=n?"italic":"normal";return r.find(a=>a.weight===i&&a.style===s)??r.find(a=>a.weight==="normal"&&a.style==="normal")}registerBuffer(e){let t=this.bufferIds.get(e);return t||(t=Promise.resolve().then(()=>this.sink.registerFont(new Uint8Array(e))),t.catch(()=>{}),this.bufferIds.set(e,t)),t}registerFace(e){let t=this.faceIds.get(e);return t||(t=(async()=>{try{return await this.registerBuffer(e.data)}catch{return console.warn(`[fontRegistry] embedded face "${e.family}" (${e.weight} ${e.style}) was rejected by the text engine; falling back`),null}})(),this.faceIds.set(e,t)),t}registerBundled(e,t,n){let r=this.bundledIds.get(e);return r||(r=(async()=>{try{let i=await t();return await this.registerBuffer(i)}catch{return console.warn(`[fontRegistry] bundled face for "${n}" failed to load or register; falling back`),null}})(),this.bundledIds.set(e,r)),r}registerLastResort(e,t,n){let r=this.lastResortIds.get(e);return r||(r=(async()=>{try{let i=await t();return await this.registerBuffer(i)}catch{return console.warn(`[fontRegistry] last-resort base face for "${n}" failed to load or register; falling back`),null}})(),this.lastResortIds.set(e,r)),r}resolveScript(e){let t=this.scriptIds.get(e);if(!t){let n=this.scriptResults;t=(async()=>{let r=null,i=this.bundled?.resolveScriptFallback?.(e,false,false);if(i)try{let s=await i();r=await this.registerBuffer(s);}catch{console.warn(`[fontRegistry] script-fallback face for "${e}" failed to load or register; falling back`);}return n.set(e,r),r})(),this.scriptIds.set(e,t);}return t}};var L=null;function T(){return L??(L=import('../wasm-DO3BUV7C.mjs').then(async o=>(await o.preloadLayoutWasm(),{registerFont:o.registerMeasureFont,clearFonts:o.clearMeasureFonts}))),L}function H(o){let e=new I({registerFont:n=>o.engine.registerFont(n)},{bundled:o.bundled}),t;return {setEmbeddedFaces(n){e.setEmbeddedFaces(n);},setCompat(n){t=n;},async prepareFontRequirements(n){return (await Promise.all(n.flatMap(i=>[(async()=>{try{return e.getCachedFontIdChain(i.family,i.bold,i.italic)!==void 0?!1:(await e.getFontIdChain(i.family,i.bold,i.italic),!0)}catch{return false}})(),...Array.from(new Set(i.scripts??[]),async s=>{try{return e.getCachedScriptFallbackIds([s])!==void 0?!1:(await e.getScriptFallbackIds([s]),!0)}catch{return false}})]))).some(Boolean)},measurementConfigForRequirements(n){let r={};for(let i of n){let s=e.getCachedFontIdChain(i.family,i.bold,i.italic),a=e.getCachedScriptFallbackIds(i.scripts??[]);if(s===void 0||a===void 0)return;let f=Array.from(s);for(let h of a)f.includes(h)||f.push(h);f.length>0&&(r[i.key]=f);}return {fontChains:r,defaults:{fontSize:11,fontFamily:"Calibri"},compat:{noLeading:t?.noLeading??false,doNotExpandShiftReturn:t?.doNotExpandShiftReturn??false},authoritativeShaping:true}},clear(){e.clear();}}}var q=1056;function A(o,e){let t=o?.package.headers,n=o?.package.footers,r=e?.headerReferences?.find(y=>y.type==="default"),i=e?.headerReferences?.find(y=>y.type==="first"),s=e?.footerReferences?.find(y=>y.type==="default"),a=e?.footerReferences?.find(y=>y.type==="first"),f=r?t?.get(r.rId)??null:null,h=s?n?.get(s.rId)??null:null,l=i?t?.get(i.rId)??null:null,M=a?n?.get(a.rId)??null:null;return e?.titlePg||(f??(f=l),h??(h=M)),{header:f,footer:h,firstHeader:l,firstFooter:M}}function D(o,e,t,n,r){let i=o.hfCaretRects(e,t,n);return r===void 0?i:i.filter(s=>s.pageIndex===r)}function $(o,e,t,n,r,i){let s=o.hfRangeRects(e,t,Math.min(n,r),Math.max(n,r));return i===void 0?s:s.filter(a=>a.pageIndex===i)}var p,m,g,b,R,w,E,C=class{constructor(){d(this,w);d(this,p,0);d(this,m,0);d(this,g,false);d(this,b,false);d(this,R,new Set);}setStateSeq(e$1){e(this,p,e$1);}incrementStateSeq(){return ++g$1(this,p)._}getStateSeq(){return c(this,p)}getRenderSeq(){return c(this,m)}onLayoutStart(){e(this,g,true);}onLayoutComplete(e$1){e(this,m,e$1),e(this,g,false),c(this,b)&&this.isSafeToRender()&&(e(this,b,false),f(this,w,E).call(this));}isSafeToRender(){return !c(this,g)&&c(this,m)>=c(this,p)}requestRender(){this.isSafeToRender()?f(this,w,E).call(this):e(this,b,true);}onRender(e){return c(this,R).add(e),()=>c(this,R).delete(e)}reset(){e(this,p,0),e(this,m,0),e(this,g,false),e(this,b,false);}getDebugInfo(){return {stateSeq:c(this,p),renderSeq:c(this,m),layoutUpdating:c(this,g),hasPendingRender:c(this,b),isSafe:this.isSafeToRender()}}};p=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakMap,R=new WeakMap,w=new WeakSet,E=function(){for(let e of c(this,R))try{e();}catch(t){console.error("LayoutSelectionGate: render callback error",t);}};export{q as DEFAULT_PAGE_HEIGHT_PX,C as LayoutSelectionGate,D as computeHfCaretRectsFromDisplayList,$ as computeHfSelectionRectsFromDisplayList,H as createRustMeasureSource,T as getRustTextEngine,A as resolveHeaderFooter};
@@ -1,60 +1,12 @@
1
- import { a as Layout, T as TextBoxBlock } from '../../types-DNrYr6yQ.mjs';
2
- export { A as AnchoredObjectPositionInput, B as BlockExtent, f as BlockId, j as BorderStyle, k as CellBorderSpec, l as CellBorders, m as ChartBlock, n as ChartExtent, o as ChartFragment, p as ColumnBreakBlock, q as ColumnBreakExtent, C as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, r as DEFAULT_TEXTBOX_WIDTH, s as DocumentPosition, t as FieldRun, u as FloatingTablePosition, F as FootnoteContent, h as FootnoteRenderItem, v as Fragment, w as FragmentBase, H as HeaderFooterContent, x as HeaderFooterContentHeights, y as HeaderFooterLayout, z as HitTestResult, E as HyperlinkInfo, G as ImageBlock, J as ImageExtent, K as ImageFragment, I as ImageRun, M as ImageRunPosition, O as InlineSdtWidget, e as LayoutBlock, Q as LayoutCheckpoint, L as LayoutOptions, R as LineBreakRun, U as ListNumPr, V as NoteAreaContract, X as NoteLayoutItem, N as NoteSettingsContract, g as Page, d as PageBorderContract, Y as PageBreakBlock, Z as PageBreakExtent, _ as PageFlowGeometry, i as PageGeometry, b as PageHeaderFooterRefs, P as PageMargins, c as PageNumberingContract, $ as PageSectionState, a0 as ParagraphAttrs, a1 as ParagraphBlock, a2 as ParagraphBorders, a3 as ParagraphExtent, a4 as ParagraphFragment, a5 as ParagraphIndent, a6 as ParagraphSpacing, a7 as ResolvedLine, a8 as ResolvedSegment, a9 as Run, aa as RunFontSlots, ab as RunFormatting, ac as RunLanguageSlots, ad as SdtGroup, S as SectionBreakBlock, ae as SectionBreakExtent, af as ShapeBlock, ag as ShapeBlockFill, ah as ShapeBlockStroke, ai as ShapeBlockTransform, aj as ShapeExtent, ak as ShapeFragment, al as TabAlignment, am as TabRun, an as TabStop, ao as TableBlock, ap as TableCell, aq as TableCellExtent, ar as TableExtent, as as TableFragment, at as TableRow, au as TableRowExtent, av as TextBoxExtent, aw as TextBoxFragment, ax as TextRun, ay as TypesetBidiSlice, az as TypesetClusterAdvance, aA as TypesetRow, aB as TypesetRowSegment, aC as TypesetRunAdvance, W as WrapTextDirection, aD as assertExhaustiveLayoutBlock, aE as isTextWrappingFloatingImageRun, aF as pageGeometryFromPage, aG as resolveAnchoredObjectVerticalTop } from '../../types-DNrYr6yQ.mjs';
3
- export { M as MeasuredBlock, t as toMeasuredBlocks } from '../../measuredBlock-DZwz8zhD.mjs';
4
- export { S as SectionLayoutConfig, c as collectSectionConfigs } from '../../sectionConfigs-DW3J8q0X.mjs';
5
- export { L as LayoutPaginationSource, R as RustLayoutEngine, a as RustPaginationSource, b as RustPaginationSourceOptions, c as RustPaginationStats, d as createRustPaginationSource, g as getRustLayoutEngine } from '../../rustPagination-Bj2hq013.mjs';
6
- export { isFloatingWrapType, isWrapNone, wrapsAroundText } from '../../docx/wrapTypes.mjs';
7
- import '../../content-sSHuWw49.mjs';
8
- import '../../formatting-DoL7KBSL.mjs';
1
+ import { L as LayoutBlock, B as BlockExtent } from '../../types-BfqUl2h_.mjs';
2
+ export { A as AnchoredObjectPositionInput, d as BlockId, e as BorderStyle, C as CellBorderSpec, f as CellBorders, g as ChartBlock, h as ChartExtent, i as ChartFragment, j as ColumnBreakBlock, k as ColumnBreakExtent, l as ColumnLayout, D as DEFAULT_TEXTBOX_MARGINS, m as DEFAULT_TEXTBOX_WIDTH, n as DocumentPosition, o as FieldRun, p as FloatingTablePosition, F as FootnoteContent, q as FootnoteRenderItem, r as Fragment, s as FragmentBase, H as HeaderFooterContent, t as HeaderFooterContentHeights, u as HeaderFooterLayout, v as HitTestResult, w as HyperlinkInfo, I as ImageBlock, x as ImageExtent, y as ImageFragment, z as ImageRun, E as ImageRunPosition, G as InlineSdtWidget, a as Layout, b as LayoutOptions, J as LineBreakRun, K as ListNumPr, N as NoteAreaContract, M as NoteLayoutItem, O as NoteSettingsContract, P as Page, Q as PageBorderContract, S as PageBreakBlock, T as PageBreakExtent, U as PageGeometry, V as PageHeaderFooterRefs, W as PageMargins, X as PageNumberingContract, Y as ParagraphAttrs, Z as ParagraphBlock, _ as ParagraphBorders, $ as ParagraphExtent, a0 as ParagraphFragment, a1 as ParagraphIndent, a2 as ParagraphSpacing, R as ResolvedLine, c as ResolvedSegment, a3 as Run, a4 as RunFontSlots, a5 as RunFormatting, a6 as RunLanguageSlots, a7 as SdtGroup, a8 as SectionBreakBlock, a9 as SectionBreakExtent, aa as ShapeBlock, ab as ShapeBlockFill, ac as ShapeBlockStroke, ad as ShapeBlockTransform, ae as ShapeExtent, af as ShapeFragment, ag as TabAlignment, ah as TabRun, ai as TabStop, aj as TableBlock, ak as TableCell, al as TableCellExtent, am as TableExtent, an as TableFragment, ao as TableRow, ap as TableRowExtent, aq as TextBoxBlock, ar as TextBoxExtent, as as TextBoxFragment, at as TextRun, au as TypesetBidiSlice, av as TypesetClusterAdvance, aw as TypesetRow, ax as TypesetRowSegment, ay as TypesetRunAdvance, az as WrapTextDirection, aA as assertExhaustiveLayoutBlock, aB as isTextWrappingFloatingImageRun, aC as pageGeometryFromPage, aD as resolveAnchoredObjectVerticalTop } from '../../types-BfqUl2h_.mjs';
3
+ import '../../content-MOZ6hKP4.mjs';
4
+ import '../../formatting-D1EPSaJP.mjs';
5
+ import '../../docx/wrapTypes.mjs';
9
6
 
10
- /**
11
- * Page index (0-based) whose layout fragments cover `pmPos`, or null if none.
12
- * Used when the painted DOM may not yet have `[data-doc-start]` for this position (virtualization).
13
- *
14
- * Range semantics: `[pmStart, pmEnd)` — half-open, matching ProseMirror's
15
- * `pos + nodeSize` convention. Boundary positions belong to the next fragment,
16
- * so when a fragment ends at the same position the next one starts, the next
17
- * fragment wins (avoids returning the previous page for the start of the
18
- * next paragraph).
19
- */
20
- declare function findPageIndexContainingPmPos(layout: Layout, pmPos: number): number | null;
7
+ interface MeasuredBlock {
8
+ block: LayoutBlock;
9
+ measure: BlockExtent;
10
+ }
21
11
 
22
- /**
23
- * Subset of {@link TextBoxBlock} needed to classify how a text box flows
24
- * relative to surrounding content. Kept narrow so callers (measure, layout,
25
- * paint) can pass partial views without rebuilding the full block.
26
- *
27
- * @public
28
- */
29
- type TextBoxFlowAttrs = Pick<TextBoxBlock, 'displayMode' | 'wrapType'>;
30
- /**
31
- * True when a text box participates in float layout — either via the
32
- * `float` display mode (CSS-style) or via an OOXML `wrapType` that
33
- * positions the box outside paragraph flow (`square`, `tight`, `through`,
34
- * `behind`, `inFront`, `topAndBottom`).
35
- *
36
- * `topAndBottom` is positioned (it honours its OOXML anchor, e.g. a banner
37
- * pinned to the top of the page) even though text never wraps beside it —
38
- * see {@link floatingTextBoxReservesBand}.
39
- *
40
- * @public
41
- */
42
- declare function isFloatingTextBoxBlock(block: TextBoxFlowAttrs): boolean;
43
- /**
44
- * True when a floating text box reserves a full-width vertical band rather
45
- * than a side exclusion. `topAndBottom` boxes break the text above and below
46
- * the box (no text beside it), so surrounding lines flow past the band.
47
- *
48
- * @public
49
- */
50
- declare function floatingTextBoxReservesBand(block: TextBoxFlowAttrs): boolean;
51
- /**
52
- * True when a floating text box reserves an exclusion zone that narrows
53
- * surrounding text lines. `wrapNone` (`behind` / `inFront`) and
54
- * `topAndBottom` are floats that don't wrap text on their sides.
55
- *
56
- * @public
57
- */
58
- declare function floatingTextBoxWrapsText(block: TextBoxFlowAttrs): boolean;
59
-
60
- export { Layout, TextBoxBlock, type TextBoxFlowAttrs, findPageIndexContainingPmPos, floatingTextBoxReservesBand, floatingTextBoxWrapsText, isFloatingTextBoxBlock };
12
+ export { BlockExtent, LayoutBlock, type MeasuredBlock };
@@ -1 +1 @@
1
- export{b as collectSectionConfigs,d as createRustPaginationSource,e as findPageIndexContainingPmPos,g as floatingTextBoxReservesBand,h as floatingTextBoxWrapsText,c as getRustLayoutEngine,f as isFloatingTextBoxBlock,a as toMeasuredBlocks}from'../../chunk-7PCO5I2O.mjs';export{a as DEFAULT_TEXTBOX_MARGINS,b as DEFAULT_TEXTBOX_WIDTH,c as assertExhaustiveLayoutBlock,f as isTextWrappingFloatingImageRun,d as pageGeometryFromPage,e as resolveAnchoredObjectVerticalTop}from'../../chunk-X4XDO3LZ.mjs';export{a as isFloatingWrapType,b as isWrapNone,c as wrapsAroundText}from'../../chunk-OBQGPMPQ.mjs';import'../../chunk-3UBMCDME.mjs';import'../../chunk-TTRUPDAB.mjs';
1
+ import {b as b$2,c as c$1}from'../../chunk-OBQGPMPQ.mjs';import {b as b$1}from'../../chunk-3UBMCDME.mjs';import'../../chunk-TTRUPDAB.mjs';var c={top:4,bottom:4,left:7,right:7},h=200;function y(e,r){let o=e.kind??"<unknown>";throw new Error(`${r}: unhandled LayoutBlock kind "${o}". Add the case alongside the other LayoutBlock switches (see types.ts).`)}function x(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function f(e,r,o){return l(e,r,o)}function l(e,r,o){let n=e.position?.vertical;if(!n)return r;let t=b(n.relativeTo,r,o);return n.align==="top"?t.base:n.align==="center"?t.size?t.base+(t.size-e.height)/2:r:n.align==="bottom"?t.size?t.base+t.size-e.height:r:n.posOffset!==void 0?t.base+b$1(n.posOffset):n.relativeTo==="paragraph"||n.relativeTo==="line"?r:t.base}function b(e,r,o){let n=o?.pageHeight??0,t=o?.marginTop??0,a=o?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:r,size:0};case "page":return {base:-t,size:n};case "topMargin":return {base:-t,size:t};case "bottomMargin":return {base:a,size:t};default:return {base:0,size:a}}}function k(e){return b$2(e.wrapType)||e.wrapType==="topAndBottom"?false:c$1(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}export{c as DEFAULT_TEXTBOX_MARGINS,h as DEFAULT_TEXTBOX_WIDTH,y as assertExhaustiveLayoutBlock,k as isTextWrappingFloatingImageRun,x as pageGeometryFromPage,f as resolveAnchoredObjectVerticalTop};
@@ -1,17 +1,17 @@
1
- import { b as DisplayPage, c as DisplayPrimitive, D as DisplayList, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive } from '../../rustDisplayList-dqunvwxH.mjs';
2
- export { d as DecodedFrameDelta, e as DecorationPrimitive, f as DisplayBounds, g as DisplayListBuildInputs, a as DisplayListHeadersFooters, h as DisplayListHfVariant, i as DisplayListPictureWatermark, j as DisplayListTextWatermark, k as DisplayListWatermark, l as DocAttrs, F as FRAME_DELTA_HEADER_BYTES, m as FRAME_DELTA_PAGE_OP_BYTES, n as FRAME_DELTA_VERSION, o as FrameDeltaError, p as FrameDeltaErrorCode, q as FramePageOperation, H as HfRegion, I as ImagePrimitive, P as PositionedGlyph, r as RectPrimitive, s as RetainedFrame, t as RetainedFramePage, u as RustDisplayFrameResult, v as RustDisplayListEngine, R as RustDisplayListQueryEngine, w as RustDisplayListSourceError, x as RustDisplayListSourceErrorStage, y as TableCellRef, z as applyFrameDelta, A as applyFrameDeltaOwned, B as buildRustDisplayFrame, C as buildRustDisplayList, E as decodeFrameDelta, J as encodeDisplayListFrameExtras, K as loadRustDisplayListQueryEngine } from '../../rustDisplayList-dqunvwxH.mjs';
3
- import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-p-ijSzdh.mjs';
4
- export { c as DisplayListHitRegion, d as DisplayListImageGeometry, e as DisplayListImageRegion, f as DisplayListParagraphGeometry, g as DisplayListQuerySourceState, h as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, i as captureInlinePositionEmuFromDisplayList, j as createDisplayListQueries, k as findImagePrimitiveAtPoint, l as findImagePrimitiveByDocPos } from '../../displayListQueries-p-ijSzdh.mjs';
5
- import { YrsLoc, YrsSession, YrsRevisionInfo } from '../../yrs/index.mjs';
1
+ import { a as DisplayPage, b as DisplayPrimitive, D as DisplayList, G as GlyphRunPrimitive, L as LinePrimitive, T as TextRunPrimitive } from '../../frameDelta-D965X8yK.mjs';
2
+ export { c as DecodedFrameDelta, d as DecorationPrimitive, e as DisplayBounds, f as DocAttrs, F as FRAME_DELTA_HEADER_BYTES, g as FRAME_DELTA_PAGE_OP_BYTES, h as FRAME_DELTA_VERSION, i as FrameDeltaError, j as FrameDeltaErrorCode, k as FramePageOperation, H as HfRegion, I as ImagePrimitive, P as PositionedGlyph, l as RectPrimitive, R as RetainedFrame, m as RetainedFramePage, n as TableCellRef, o as applyFrameDelta, p as applyFrameDeltaOwned, q as decodeFrameDelta } from '../../frameDelta-D965X8yK.mjs';
3
+ export { a as DisplayListBuildInputs, D as DisplayListHeadersFooters, b as DisplayListHfVariant, c as DisplayListPictureWatermark, d as DisplayListTextWatermark, e as DisplayListWatermark, f as RustDisplayFrameResult, g as RustDisplayListEngine, R as RustDisplayListQueryEngine, h as RustDisplayListSourceError, i as RustDisplayListSourceErrorStage, j as buildRustDisplayFrame, k as buildRustDisplayList, l as encodeDisplayListFrameExtras, m as loadRustDisplayListQueryEngine } from '../../rustDisplayList-BRuZBqdL.mjs';
4
+ import { a as DisplayListQueries, b as DisplayListRegionHit, D as DisplayListRect } from '../../displayListQueries-BJlo7Jkz.mjs';
5
+ export { c as DisplayListHitRegion, d as DisplayListImageGeometry, e as DisplayListImageRegion, f as DisplayListParagraphGeometry, g as DisplayListQuerySourceState, h as DisplayListVisualLine, L as LocatedImagePrimitive, R as ResidentDisplayListQueryEngine, i as captureInlinePositionEmuFromDisplayList, j as createDisplayListQueries, k as findImagePrimitiveAtPoint, l as findImagePrimitiveByDocPos } from '../../displayListQueries-BJlo7Jkz.mjs';
6
+ import { m as YrsLoc, Y as YrsSession, n as YrsRevisionInfo } from '../../index-Dx4Z3lkz.mjs';
6
7
  import { TrackedChangeEntry } from '../../utils/comments.mjs';
7
- import '../../types-DNrYr6yQ.mjs';
8
- import '../../content-sSHuWw49.mjs';
9
- import '../../formatting-DoL7KBSL.mjs';
8
+ import '../../content-MOZ6hKP4.mjs';
9
+ import '../../formatting-D1EPSaJP.mjs';
10
10
  import '../../docx/wrapTypes.mjs';
11
- import '../../measuredBlock-DZwz8zhD.mjs';
11
+ import '../../types-BfqUl2h_.mjs';
12
+ import '../pagination/index.mjs';
12
13
  import '../../types/document.mjs';
13
- import '../../styles-VxNcXLdi.mjs';
14
- import '../../settingsParser-CcGvtmCK.mjs';
14
+ import '../../styles-Dn_o3Vo5.mjs';
15
15
 
16
16
  /** a cached glyph: its outline path (font units) plus the font's units-per-em. */
17
17
  interface GlyphOutline {