@arbidocs/blocks 0.4.101 → 0.4.103

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 (209) hide show
  1. package/dist/chunk-6MG62I5B.cjs +272 -0
  2. package/dist/chunk-6MG62I5B.cjs.map +1 -0
  3. package/dist/{chunk-MYALCKDR.js → chunk-CVYY4X5R.js} +306 -75
  4. package/dist/chunk-CVYY4X5R.js.map +1 -0
  5. package/dist/chunk-EQB3WELX.js +269 -0
  6. package/dist/chunk-EQB3WELX.js.map +1 -0
  7. package/dist/{chunk-G5JH2YMQ.js → chunk-GQTIAATM.js} +3 -3
  8. package/dist/{chunk-G5JH2YMQ.js.map → chunk-GQTIAATM.js.map} +1 -1
  9. package/dist/{chunk-YGREW5TZ.js → chunk-H6DFXG5N.js} +3 -3
  10. package/dist/{chunk-YGREW5TZ.js.map → chunk-H6DFXG5N.js.map} +1 -1
  11. package/dist/{chunk-ZT2EBBSC.cjs → chunk-N36PWG7A.cjs} +5 -5
  12. package/dist/{chunk-ZT2EBBSC.cjs.map → chunk-N36PWG7A.cjs.map} +1 -1
  13. package/dist/{chunk-FAGQTB3D.cjs → chunk-O33EBMIX.cjs} +305 -74
  14. package/dist/chunk-O33EBMIX.cjs.map +1 -0
  15. package/dist/{chunk-Y5XW57U4.cjs → chunk-TFDU2KGS.cjs} +5 -5
  16. package/dist/{chunk-Y5XW57U4.cjs.map → chunk-TFDU2KGS.cjs.map} +1 -1
  17. package/dist/connect/docx.cjs +6 -6
  18. package/dist/connect/docx.js +4 -4
  19. package/dist/connect/index.cjs +3 -3
  20. package/dist/connect/index.js +2 -2
  21. package/dist/document-tools/AdoptSignatureDialog.d.ts +25 -0
  22. package/dist/document-tools/DocumentToolButtons.d.ts +2 -0
  23. package/dist/document-tools/SignatureRequestBanner.d.ts +18 -0
  24. package/dist/document-tools/index.cjs +175 -0
  25. package/dist/document-tools/index.cjs.map +1 -1
  26. package/dist/document-tools/index.d.ts +3 -1
  27. package/dist/document-tools/index.js +168 -3
  28. package/dist/document-tools/index.js.map +1 -1
  29. package/dist/document-tools/viewer/GuidedSigningViewer.d.ts +26 -0
  30. package/dist/document-tools/viewer/SignatureFieldsOverlay.d.ts +41 -0
  31. package/dist/document-tools/viewer/SignatureRequestEditor.d.ts +26 -0
  32. package/dist/document-tools/viewer/index.cjs +983 -0
  33. package/dist/document-tools/viewer/index.cjs.map +1 -1
  34. package/dist/document-tools/viewer/index.d.ts +3 -0
  35. package/dist/document-tools/viewer/index.js +983 -5
  36. package/dist/document-tools/viewer/index.js.map +1 -1
  37. package/dist/docx/RibbonMenu.d.ts +4 -1
  38. package/dist/docx/RibbonOverflow.d.ts +27 -0
  39. package/dist/docx/WordReferences.d.ts +3 -2
  40. package/dist/docx/index.cjs +35 -35
  41. package/dist/docx/index.js +3 -3
  42. package/dist/docx/noteStyles.d.ts +46 -0
  43. package/dist/docx/overflowPlan.d.ts +15 -0
  44. package/dist/index.cjs +5 -5
  45. package/dist/index.js +1 -1
  46. package/node_modules/@arbidocs/coedit/LICENSE +21 -0
  47. package/node_modules/@arbidocs/coedit/dist/encoding.cjs +751 -0
  48. package/node_modules/@arbidocs/coedit/dist/encoding.cjs.map +1 -0
  49. package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +192 -0
  50. package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +192 -0
  51. package/node_modules/@arbidocs/coedit/dist/encoding.js +716 -0
  52. package/node_modules/@arbidocs/coedit/dist/encoding.js.map +1 -0
  53. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +1759 -0
  54. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -0
  55. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +39 -0
  56. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +39 -0
  57. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +1736 -0
  58. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -0
  59. package/node_modules/@arbidocs/coedit/dist/index.cjs +1692 -0
  60. package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -0
  61. package/node_modules/@arbidocs/coedit/dist/index.d.cts +16 -0
  62. package/node_modules/@arbidocs/coedit/dist/index.d.ts +16 -0
  63. package/node_modules/@arbidocs/coedit/dist/index.js +1664 -0
  64. package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -0
  65. package/node_modules/@arbidocs/coedit/dist/server.cjs +1852 -0
  66. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -0
  67. package/node_modules/@arbidocs/coedit/dist/server.d.cts +43 -0
  68. package/node_modules/@arbidocs/coedit/dist/server.d.ts +43 -0
  69. package/node_modules/@arbidocs/coedit/dist/server.js +1822 -0
  70. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -0
  71. package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.cts +82 -0
  72. package/node_modules/@arbidocs/coedit/dist/session-Cf9iu1Vt.d.ts +82 -0
  73. package/node_modules/@arbidocs/coedit/dist/template.cjs +1627 -0
  74. package/node_modules/@arbidocs/coedit/dist/template.cjs.map +1 -0
  75. package/node_modules/@arbidocs/coedit/dist/template.d.cts +125 -0
  76. package/node_modules/@arbidocs/coedit/dist/template.d.ts +125 -0
  77. package/node_modules/@arbidocs/coedit/dist/template.js +1612 -0
  78. package/node_modules/@arbidocs/coedit/dist/template.js.map +1 -0
  79. package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.cts +8 -0
  80. package/node_modules/@arbidocs/coedit/dist/versions-DXiFQMA6.d.ts +8 -0
  81. package/node_modules/@arbidocs/coedit/package.json +68 -0
  82. package/node_modules/@docx-editor.dev/core/LICENSE +201 -0
  83. package/node_modules/@docx-editor.dev/core/README.md +125 -0
  84. package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +56 -0
  85. package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -0
  86. package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +162 -0
  87. package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -0
  88. package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -0
  89. package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +164 -0
  90. package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -0
  91. package/node_modules/@docx-editor.dev/core/dist/chunk-2GO5T2JU.cjs +1 -0
  92. package/node_modules/@docx-editor.dev/core/dist/chunk-2RC2EPND.js +3 -0
  93. package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +28 -0
  94. package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +18 -0
  95. package/node_modules/@docx-editor.dev/core/dist/chunk-5CSUYANV.js +1 -0
  96. package/node_modules/@docx-editor.dev/core/dist/chunk-6APGXLBB.cjs +3 -0
  97. package/node_modules/@docx-editor.dev/core/dist/chunk-6AWEKBLB.cjs +1 -0
  98. package/node_modules/@docx-editor.dev/core/dist/chunk-6EYYL7FL.js +1 -0
  99. package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +1 -0
  100. package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +1 -0
  101. package/node_modules/@docx-editor.dev/core/dist/chunk-E7BQA6UP.js +2 -0
  102. package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +2 -0
  103. package/node_modules/@docx-editor.dev/core/dist/chunk-ETTO6GK3.js +1 -0
  104. package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +18 -0
  105. package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +28 -0
  106. package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +2 -0
  107. package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +2 -0
  108. package/node_modules/@docx-editor.dev/core/dist/chunk-K5U2PLDP.cjs +2 -0
  109. package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +2 -0
  110. package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +27 -0
  111. package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +1 -0
  112. package/node_modules/@docx-editor.dev/core/dist/chunk-O2AL2HSJ.cjs +1 -0
  113. package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +1 -0
  114. package/node_modules/@docx-editor.dev/core/dist/chunk-QMLCVPCD.cjs +1 -0
  115. package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +27 -0
  116. package/node_modules/@docx-editor.dev/core/dist/chunk-RIYSCEFQ.js +2 -0
  117. package/node_modules/@docx-editor.dev/core/dist/chunk-S6J4O5XP.js +1 -0
  118. package/node_modules/@docx-editor.dev/core/dist/chunk-SRPILEWV.cjs +5 -0
  119. package/node_modules/@docx-editor.dev/core/dist/chunk-TSLBZ26X.js +1 -0
  120. package/node_modules/@docx-editor.dev/core/dist/chunk-UKVVUHZL.cjs +1 -0
  121. package/node_modules/@docx-editor.dev/core/dist/chunk-VDNNLG6X.js +2 -0
  122. package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +7 -0
  123. package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +7 -0
  124. package/node_modules/@docx-editor.dev/core/dist/chunk-Z6WBFXJU.js +5 -0
  125. package/node_modules/@docx-editor.dev/core/dist/chunk-ZUHOMK52.cjs +2 -0
  126. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -0
  127. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +270 -0
  128. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -0
  129. package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -0
  130. package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +269 -0
  131. package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -0
  132. package/node_modules/@docx-editor.dev/core/dist/contracts/document.cjs +1 -0
  133. package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +290 -0
  134. package/node_modules/@docx-editor.dev/core/dist/contracts/document.js +0 -0
  135. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.cjs +1 -0
  136. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +22 -0
  137. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.js +1 -0
  138. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.cjs +1 -0
  139. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +103 -0
  140. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.js +0 -0
  141. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -0
  142. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +143 -0
  143. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -0
  144. package/node_modules/@docx-editor.dev/core/dist/contracts/types.cjs +1 -0
  145. package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +11 -0
  146. package/node_modules/@docx-editor.dev/core/dist/contracts/types.js +0 -0
  147. package/node_modules/@docx-editor.dev/core/dist/custom-node-writes-cvL5rhcD.d.ts +323 -0
  148. package/node_modules/@docx-editor.dev/core/dist/dist-PKZR6RSH.js +2 -0
  149. package/node_modules/@docx-editor.dev/core/dist/document-protection-BAGVGqaP.d.ts +20 -0
  150. package/node_modules/@docx-editor.dev/core/dist/editor-Ci7IZGmG.d.ts +2448 -0
  151. package/node_modules/@docx-editor.dev/core/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
  152. package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -0
  153. package/node_modules/@docx-editor.dev/core/dist/editor.css +15 -0
  154. package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +1394 -0
  155. package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -0
  156. package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -0
  157. package/node_modules/@docx-editor.dev/core/dist/export.d.ts +391 -0
  158. package/node_modules/@docx-editor.dev/core/dist/export.js +2 -0
  159. package/node_modules/@docx-editor.dev/core/dist/failure-NS2lsya4.d.ts +115 -0
  160. package/node_modules/@docx-editor.dev/core/dist/font-resolver-BVQB14qT.d.ts +256 -0
  161. package/node_modules/@docx-editor.dev/core/dist/harfbuzz.wasm +0 -0
  162. package/node_modules/@docx-editor.dev/core/dist/headless-document-view-qH331moE.d.ts +143 -0
  163. package/node_modules/@docx-editor.dev/core/dist/image-resources-BN-hUgCn.d.ts +211 -0
  164. package/node_modules/@docx-editor.dev/core/dist/index-Bsg7oIKP.d.ts +3869 -0
  165. package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -0
  166. package/node_modules/@docx-editor.dev/core/dist/index.d.ts +53 -0
  167. package/node_modules/@docx-editor.dev/core/dist/index.js +1 -0
  168. package/node_modules/@docx-editor.dev/core/dist/layout-shaping-BEyuiQOk.d.ts +246 -0
  169. package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -0
  170. package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +3151 -0
  171. package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -0
  172. package/node_modules/@docx-editor.dev/core/dist/node-module-shim-TTKTT66I.js +1 -0
  173. package/node_modules/@docx-editor.dev/core/dist/note-properties-4Y9o6Gyk.d.ts +68 -0
  174. package/node_modules/@docx-editor.dev/core/dist/omml-equation-CuzBL5DD.d.ts +85 -0
  175. package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -0
  176. package/node_modules/@docx-editor.dev/core/dist/output.d.ts +97 -0
  177. package/node_modules/@docx-editor.dev/core/dist/output.js +1 -0
  178. package/node_modules/@docx-editor.dev/core/dist/protocol-Bqk4Izjc.d.ts +1651 -0
  179. package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +128 -0
  180. package/node_modules/@docx-editor.dev/core/dist/review-paragraph-order-DT-n6ouC.d.ts +85 -0
  181. package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +242 -0
  182. package/node_modules/@docx-editor.dev/core/dist/semantic-cell-selection-D9D1KSXq.d.ts +464 -0
  183. package/node_modules/@docx-editor.dev/core/dist/semantic-interaction-CIC-PooQ.d.ts +135 -0
  184. package/node_modules/@docx-editor.dev/core/dist/semantic-paint-BME37OMv.d.ts +326 -0
  185. package/node_modules/@docx-editor.dev/core/dist/semantic-record-queries-CBlZqZNa.d.ts +177 -0
  186. package/node_modules/@docx-editor.dev/core/dist/semantic-records-4B3WwFAi.d.ts +3532 -0
  187. package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -0
  188. package/node_modules/@docx-editor.dev/core/dist/store.d.ts +2706 -0
  189. package/node_modules/@docx-editor.dev/core/dist/store.js +1 -0
  190. package/node_modules/@docx-editor.dev/core/dist/tree-package-fragment-BeeKxDw8.d.ts +1201 -0
  191. package/node_modules/@docx-editor.dev/core/dist/tree-session-contract-CVbmlMlq.d.ts +664 -0
  192. package/node_modules/@docx-editor.dev/core/dist/types-barrel-D3xCgQX6.d.ts +4269 -0
  193. package/node_modules/@docx-editor.dev/core/licenses/HarfBuzz-COPYING.txt +42 -0
  194. package/node_modules/@docx-editor.dev/core/package.json +140 -0
  195. package/node_modules/@docx-editor.dev/react/LICENSE +201 -0
  196. package/node_modules/@docx-editor.dev/react/README.md +141 -0
  197. package/node_modules/@docx-editor.dev/react/THIRD_PARTY_NOTICES.md +18 -0
  198. package/node_modules/@docx-editor.dev/react/dist/index.d.mts +4928 -0
  199. package/node_modules/@docx-editor.dev/react/dist/index.d.ts +4928 -0
  200. package/node_modules/@docx-editor.dev/react/dist/index.js +4 -0
  201. package/node_modules/@docx-editor.dev/react/dist/index.mjs +4 -0
  202. package/node_modules/@docx-editor.dev/react/package.json +74 -0
  203. package/node_modules/@docx-editor.dev/react/src/styles/editor.css +6 -0
  204. package/node_modules/@docx-editor.dev/react/src/styles/zIndex.ts +28 -0
  205. package/package.json +26 -15
  206. package/src/docx/README.md +10 -0
  207. package/src/docx/styles.css +73 -5
  208. package/dist/chunk-FAGQTB3D.cjs.map +0 -1
  209. package/dist/chunk-MYALCKDR.js.map +0 -1
@@ -0,0 +1,464 @@
1
+ import { O as OoxmlPart, Z as OoxmlElement, N as OoxmlNode } from './types-barrel-D3xCgQX6.js';
2
+ import { b as RevisionDisplayMode, c as RevisionAuthorFilter } from './revision-projection-DZ4kKVev.js';
3
+ import { f as SectionPageBorders, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, e as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, g as TableRowFragmentRecord, h as TableCellFragmentRecord } from './semantic-records-4B3WwFAi.js';
4
+ import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-CIC-PooQ.js';
5
+
6
+ /** Page geometry, in points. */
7
+ interface PageGeometry {
8
+ readonly width: number;
9
+ readonly height: number;
10
+ readonly margin: {
11
+ readonly top: number;
12
+ readonly right: number;
13
+ readonly bottom: number;
14
+ readonly left: number;
15
+ };
16
+ /** `w:pgMar/@header` — sheet edge to header top, in points. Defaults to 36 (720 twips). */
17
+ readonly headerDistance?: number;
18
+ /** `w:pgMar/@footer` — sheet edge to footer bottom, in points. Defaults to 36. */
19
+ readonly footerDistance?: number;
20
+ }
21
+ /** US Letter with one-inch margins, in points. */
22
+ declare const DEFAULT_PAGE_GEOMETRY: PageGeometry;
23
+
24
+ /**
25
+ * Hard ceiling on sections enumerated from a document (matches write-path
26
+ * `MAX_SECTIONS` in note/hf lifecycle). Hostile packages with unbounded `w:sectPr`
27
+ * marks fail closed here rather than amplifying layout props arrays.
28
+ */
29
+ declare const MAX_DOCUMENT_SECTIONS = 4096;
30
+ /** A section's margins in twips, including the header and footer reserve bands. */
31
+ interface SectionMargins {
32
+ readonly topTwips: number;
33
+ readonly rightTwips: number;
34
+ readonly bottomTwips: number;
35
+ readonly leftTwips: number;
36
+ readonly headerTwips: number;
37
+ readonly footerTwips: number;
38
+ readonly gutterTwips: number;
39
+ }
40
+ /** One explicit `w:col`: its width and the gap after it. */
41
+ interface SectionColumnDefinition {
42
+ readonly widthTwips: number;
43
+ /** Space after this column; zero on the final column. */
44
+ readonly gapTwips: number;
45
+ }
46
+ /**
47
+ * A section's column layout.
48
+ *
49
+ * Equal-width and explicit-width columns are one type because a file may declare `w:num` with no
50
+ * `w:col` children at all, and layout must handle both without branching at every use site.
51
+ */
52
+ interface SectionColumns {
53
+ readonly count: number;
54
+ /** Shared gap for equal-width columns and fallback gap for incomplete explicit definitions. */
55
+ readonly gapTwips: number;
56
+ readonly equalWidth?: boolean;
57
+ readonly separator?: boolean;
58
+ /** Authored `w:col` geometry when `equalWidth` is false. */
59
+ readonly definitions?: readonly SectionColumnDefinition[];
60
+ }
61
+ /**
62
+ * How this section is placed relative to the previous one (ECMA-376 17.6.22,
63
+ * `ST_SectionMark`).
64
+ *
65
+ * All five schema values are read. `nextColumn` paginates like `nextPage` for now: in a
66
+ * single-column section that IS Word's behaviour, and multi-column flow is not modelled,
67
+ * so collapsing it at the parse boundary would only hide the authored value from a
68
+ * consumer that asks.
69
+ */
70
+ type SectionBreakType = 'nextPage' | 'continuous' | 'evenPage' | 'oddPage' | 'nextColumn';
71
+ /**
72
+ * Authored `w:pgNumType` (ECMA-376 CT_PageNumber).
73
+ *
74
+ * Distinguishes three states via {@link SectionProperties.pageNumbering}:
75
+ * - element absent → `undefined` (Word defaults; no empty element to re-emit)
76
+ * - empty `<w:pgNumType/>` → `{}` (present, no authored attrs; must round-trip empty)
77
+ * - attributes set → only those keys appear (never invent schema defaults like `fmt=decimal`)
78
+ *
79
+ * `chapStyle` / `chapSep` are preserved for consumers; PAGE projection does not yet compose
80
+ * chapter numbers (heading outline resolution is out of this slice).
81
+ */
82
+ interface SectionPageNumbering {
83
+ /** Authored `@w:start` when present and in range; otherwise omitted. */
84
+ readonly start?: number;
85
+ /** Authored `@w:fmt` (ST_NumberFormat) when present; otherwise omitted. */
86
+ readonly fmt?: string;
87
+ /** Authored `@w:chapStyle` outline level when present and in range. */
88
+ readonly chapStyle?: number;
89
+ /** Authored `@w:chapSep` when present (hyphen / period / colon / emDash / enDash). */
90
+ readonly chapSep?: string;
91
+ }
92
+ /**
93
+ * One section's resolved `w:sectPr`, as layout needs it.
94
+ *
95
+ * Resolved, not raw: defaults the file omitted are filled in here (an absent `w:type` is
96
+ * `nextPage`), so layout never has to know which attributes were authored and which were
97
+ * inherited.
98
+ */
99
+ interface SectionProperties {
100
+ /** Active document grid line pitch: line-unit paragraph margins and line snapping. */
101
+ readonly gridLinePitchTwips?: number;
102
+ readonly pageSize: {
103
+ readonly widthTwips: number;
104
+ readonly heightTwips: number;
105
+ };
106
+ readonly margins: SectionMargins;
107
+ readonly columns: SectionColumns;
108
+ readonly landscape: boolean;
109
+ readonly titlePage: boolean;
110
+ /** Absent `w:type` defaults to `nextPage`. */
111
+ readonly breakType: SectionBreakType;
112
+ /**
113
+ * Authored page-number type. Absent when `w:pgNumType` is missing; empty object when the
114
+ * element is present with no attributes (comprehensive-fixture shape).
115
+ */
116
+ readonly pageNumbering?: SectionPageNumbering;
117
+ /**
118
+ * Resolved `w:pgBorders` (§17.6.10). Absent when the section declares none, or when every
119
+ * edge it declares is off or an art border — see {@link parsePageBorders}.
120
+ */
121
+ readonly pageBorders?: SectionPageBorders;
122
+ }
123
+ /**
124
+ * One section of the body story: contiguous top-level blocks plus the properties that end it.
125
+ *
126
+ * `blockStart` / `blockEndExclusive` index into `storyBlocks(part)`.
127
+ */
128
+ interface DocumentSection {
129
+ readonly index: number;
130
+ readonly properties: SectionProperties;
131
+ readonly blockStart: number;
132
+ readonly blockEndExclusive: number;
133
+ }
134
+ /** US Letter, portrait, one-inch margins: Word's own default when a section says nothing. */
135
+ declare const DEFAULT_SECTION_PROPERTIES: SectionProperties;
136
+ /**
137
+ * Parse authored `w:pgNumType` without inventing schema defaults.
138
+ *
139
+ * Returns `undefined` when the element is absent. An empty element yields `{}` so callers
140
+ * can tell "present but unauthored" from "missing" and serialization can re-emit empty.
141
+ * Hostile / out-of-range attribute values are dropped rather than clamped into meaning.
142
+ */
143
+ declare function parsePageNumbering(sectPr: OoxmlNode): SectionPageNumbering | undefined;
144
+ /** Parse one `w:sectPr` into geometry/break properties (null reads as Word's defaults). */
145
+ declare function parseSectionProperties(sectPr: OoxmlNode | null | undefined): SectionProperties;
146
+ /** `w:sectPr` nested under a paragraph's `w:pPr`, if present. */
147
+ declare function paragraphSectionNode(paragraph: OoxmlElement): OoxmlElement | undefined;
148
+ /**
149
+ * The section properties a part declares, or Word's defaults where it says nothing.
150
+ *
151
+ * Returns the FINAL section (body-level `w:sectPr`, else the last paragraph-level one).
152
+ * Multi-section geometry belongs to `enumerateDocumentSections`; chrome that needs "the
153
+ * document's page" still reads the last section, which is what Word's body-level sectPr is.
154
+ */
155
+ declare function readSectionProperties(part: OoxmlPart): SectionProperties;
156
+ /**
157
+ * Split the body story into sections.
158
+ *
159
+ * A paragraph carrying `w:pPr/w:sectPr` ends the current section (that paragraph is IN the
160
+ * section being ended). The body-level `w:sectPr` ends the final section. A document with
161
+ * neither yields one section of Word defaults covering every block.
162
+ *
163
+ * Enumeration is capped at {@link MAX_DOCUMENT_SECTIONS}. Further paragraph-level section
164
+ * breaks are ignored and remaining blocks fold into the last accepted section (fail closed).
165
+ *
166
+ * `displayMode` MUST match the one the caller passes to `storyBlocks`. `blockStart` /
167
+ * `blockEndExclusive` are indices into that list, and the list changes shape with the mode:
168
+ * the proposed view drops a paragraph whose mark and content a revision both removed. Slicing
169
+ * a filtered list with indices counted over an unfiltered one puts body text under another
170
+ * section's page geometry — the wrong paper size, the wrong margins, the wrong header.
171
+ */
172
+ declare function enumerateDocumentSections(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): DocumentSection[];
173
+ /**
174
+ * Canonical section index behind each section in a revision-projected body.
175
+ *
176
+ * A removed paragraph mark can collapse an entire section. The projected section keeps the
177
+ * surviving paragraph's geometry, while package APIs such as header/footer resolution remain
178
+ * indexed over the canonical tree. This bridge prevents those two index spaces from being
179
+ * paired positionally.
180
+ */
181
+ declare function projectedSectionSourceIndexes(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): readonly number[];
182
+ /**
183
+ * Every section in a document, with a flag saying whether the list was cut short.
184
+ *
185
+ * `truncated` is reported rather than silent: section count comes from a file, so a crafted
186
+ * document declaring thousands of paragraph-level `w:sectPr` marks is bounded, and a reader
187
+ * should be able to tell that happened.
188
+ */
189
+ interface DocumentSectionsEnumeration {
190
+ readonly sections: DocumentSection[];
191
+ /** True when paragraph-level sectPr marks beyond {@link MAX_DOCUMENT_SECTIONS} were dropped. */
192
+ readonly truncated: boolean;
193
+ }
194
+ /**
195
+ * Like {@link enumerateDocumentSections}, but reports whether the section bound clipped
196
+ * hostile input. Prefer the plain enumerator for normal layout; use this when a caller
197
+ * needs a named fail-closed diagnostic.
198
+ */
199
+ declare function enumerateDocumentSectionsBounded(part: OoxmlPart, displayMode?: RevisionDisplayMode, authorFilter?: RevisionAuthorFilter): DocumentSectionsEnumeration;
200
+ /**
201
+ * Section properties as the geometry layout paginates against.
202
+ *
203
+ * The gutter is added to the LEFT margin: it is binding allowance, extra space on the inner
204
+ * edge, and folding it into the content width instead would silently narrow every line.
205
+ *
206
+ * Top and bottom keep the authored sign of `w:pgMar`: a negative value is an exact inset that
207
+ * header and footer height never moves. Read them through `page-body-margins.ts`.
208
+ */
209
+ declare function geometryOfSection(section: SectionProperties): PageGeometry;
210
+
211
+ /** A point in the coordinate space named by the function taking it. */
212
+ interface HitPoint {
213
+ readonly x: number;
214
+ readonly y: number;
215
+ }
216
+ /** The innermost table cell a point resolved through. */
217
+ interface TableCellAddress {
218
+ /** Canonical node id of the `w:tbl`. */
219
+ readonly tableId: string;
220
+ /** Canonical node id of the `w:tr`. */
221
+ readonly rowId: string;
222
+ /** Canonical node id of the `w:tc`. */
223
+ readonly cellId: string;
224
+ /** Ordinal in the WHOLE table, stable across fragments and header repeats. */
225
+ readonly rowIndex: number;
226
+ readonly gridColumn: number;
227
+ readonly gridSpan: number;
228
+ }
229
+ /** Stable inline drawing identity when a hit resolves to a drawing atom. */
230
+ interface SemanticHitDrawing {
231
+ readonly drawingNodeId: string;
232
+ readonly paragraphId: string;
233
+ readonly start: number;
234
+ }
235
+ /** What a point landed on: a semantic position, its caret geometry, and where it sits. */
236
+ interface SemanticHit {
237
+ readonly position: SemanticPosition;
238
+ readonly caret: CaretGeometry;
239
+ readonly pageIndex: number;
240
+ readonly lineId: string;
241
+ /** Null outside a table; the innermost cell when tables nest. */
242
+ readonly cell: TableCellAddress | null;
243
+ /**
244
+ * True when the point was inside the resolved line's box AND inside one of its spans.
245
+ *
246
+ * A caller distinguishing a click ON text from a click BESIDE it — to decide whether to
247
+ * claim the gesture at all — needs this, and cannot recover it from the position.
248
+ */
249
+ readonly onGlyphs: boolean;
250
+ /**
251
+ * Innermost content-control boundary covering the hit point, or null outside every control.
252
+ *
253
+ * Resolved from layout-published boundary geometry (not DOM). Nested controls prefer the
254
+ * deepest {@link ContentControlBoundaryRecord.nestingDepth}.
255
+ */
256
+ readonly contentControlId: string | null;
257
+ /** Non-null when the hit resolved to an inline drawing atom. */
258
+ readonly drawing: SemanticHitDrawing | null;
259
+ }
260
+ /**
261
+ * How precisely a hit resolves within a run.
262
+ *
263
+ * Without a measurer the offset is INTERPOLATED across the span's advance, which is exact only
264
+ * for monospaced text — supply one for proportional fonts, or a click lands a character or two
265
+ * away from the glyph under the pointer.
266
+ */
267
+ interface HitTestOptions {
268
+ /**
269
+ * Exact resolution of the character within a run.
270
+ *
271
+ * Absent, the offset is interpolated across the span's own advance, which is exact only for
272
+ * a uniform advance. Pass the measurer layout was produced with, or the answer can disagree
273
+ * with what was painted.
274
+ */
275
+ readonly measurer?: TextMeasurer;
276
+ /** Vertical weight for the nearest-block rule. */
277
+ readonly verticalWeight?: number;
278
+ }
279
+ /**
280
+ * How much more a point of vertical distance counts than a point of horizontal distance.
281
+ *
282
+ * Without it, clicking far out in the right margin beside a two-word line picks whichever
283
+ * block happens to be directly below, because that block is horizontally nearer. Weighting
284
+ * the vertical axis makes "the line I am level with" win, which is what the pointer meant.
285
+ */
286
+ declare const DEFAULT_VERTICAL_WEIGHT = 8;
287
+ /**
288
+ * The page a sheet-space y belongs to.
289
+ *
290
+ * The gutter between page *i* and page *i+1* resolves to page *i*, because the nearest text
291
+ * to a point in that gap is the last line of the page above it. That falls out of searching
292
+ * for the last page whose top is at or above the point, with no special case: the gutter is
293
+ * inside `[top(i), top(i+1))` by construction. A point above the first page clamps to it, and
294
+ * a point past the last page clamps to that.
295
+ */
296
+ declare function pageAtY(layout: SemanticLayout, sheetY: number): number;
297
+ /** True when a sheet-space point falls inside a page's header or footer box. */
298
+ declare function isFurniturePoint(layout: SemanticLayout, point: HitPoint): boolean;
299
+ /** Hit test a point given in PAGE-CONTENT coordinates, the space the fragment boxes use. */
300
+ declare function hitTestPage(layout: SemanticLayout, pageIndex: number, point: HitPoint, options?: HitTestOptions): SemanticHit | null;
301
+ /**
302
+ * Hit test a point given in SHEET coordinates — the space `page.box` lives in, and the space
303
+ * a surface's own pixel offsets convert into.
304
+ */
305
+ declare function hitTestSheet(layout: SemanticLayout, point: HitPoint, options?: HitTestOptions): SemanticHit | null;
306
+ /**
307
+ * Innermost content control whose published boundary geometry contains `point` on `pageIndex`.
308
+ *
309
+ * Nested controls that share the same content box resolve to the deepest nesting depth.
310
+ */
311
+ declare function contentControlAtPoint(layout: SemanticLayout, pageIndex: number, point: HitPoint): ContentControlBoundaryRecord | null;
312
+ /**
313
+ * Logical line end, excluding a hard break, whose following position belongs to the next line.
314
+ * Trailing spaces of a soft wrap stay on the line: the end is after them, where End puts the
315
+ * caret, and the caret shows on this line through its line affinity. Page breaks are excluded
316
+ * even on the paragraph's last line.
317
+ */
318
+ declare function lineEndOffset(layout: SemanticLayout, line: LineRecord): number;
319
+ /**
320
+ * The x of a model offset inside a span — the inverse of {@link offsetWithinSpan}.
321
+ *
322
+ * Shares the measurement, and the cache, with the hit test. Interpolating across the span's
323
+ * advance instead is exact only for a uniform one: in a proportional face the caret for
324
+ * offset 4 of an 8-character span is drawn at half its width, which lands in the middle of a
325
+ * glyph rather than between two.
326
+ */
327
+ declare function spanOffsetX(span: StyleSpanRecord, offset: number, measurer: TextMeasurer | undefined): number;
328
+ /**
329
+ * Where a caret sits on a line: its x, and the box it should be drawn at.
330
+ *
331
+ * The height comes from the RUN at the insertion point, not from the line. A line is as tall
332
+ * as its largest run, so a caret in 11pt text on a line that also carries 36pt text was drawn
333
+ * three times the height of the text it sits in. Word sizes the insertion point to the run it
334
+ * would type into, which is also how the painter already draws the selection band: every run
335
+ * is its own inline box, and the band steps with the text.
336
+ *
337
+ * Affinity at a shared model boundary:
338
+ * - after a layout-sized atom (tab / projected field), prefer the DOWNSTREAM span so the
339
+ * caret sits at the aligned destination (e.g. before CONFIDENTIAL after a right tab),
340
+ * matching hit-testing and caretStops;
341
+ * - otherwise the run BEFORE the offset wins — the run a keystroke would continue —
342
+ * except at the start of the line, where there is nothing before it.
343
+ */
344
+ declare function caretBoxOnLine(line: LineRecord, offset: number, measurer: TextMeasurer | undefined, segment?: {
345
+ readonly spans: readonly StyleSpanRecord[];
346
+ readonly drawings: readonly InlineDrawingRecord[];
347
+ } | null): {
348
+ x: number;
349
+ y: number;
350
+ height: number;
351
+ };
352
+ /** Page-content overlay rectangle for a drawing's painted extent. */
353
+ interface DrawingOverlayFrame {
354
+ readonly pageIndex: number;
355
+ /** Relative to {@link PageRecord.contentBox}. */
356
+ readonly x: number;
357
+ readonly y: number;
358
+ readonly width: number;
359
+ readonly height: number;
360
+ readonly record: InlineDrawingRecord | AnchoredDrawingRecord;
361
+ }
362
+ /**
363
+ * Locate a drawing's painted extent on the published layout.
364
+ *
365
+ * Coordinates are page-content relative — the same space {@link hitTestPage} uses — so an
366
+ * overlay can position from records without reading painted DOM geometry.
367
+ */
368
+ declare function findDrawingOverlayFrameInLayout(layout: SemanticLayout, drawingNodeId: string): DrawingOverlayFrame | null;
369
+
370
+ /** A rectangle of table cells. */
371
+ interface CellSelection {
372
+ readonly kind: 'cells';
373
+ /** Canonical node id of the `w:tbl`. */
374
+ readonly tableId: string;
375
+ /** Every selected `w:tc`, in document order, with merges resolved. */
376
+ readonly cellIds: readonly string[];
377
+ /** Inclusive row ordinals within the table. */
378
+ readonly rows: {
379
+ readonly from: number;
380
+ readonly to: number;
381
+ };
382
+ /** Inclusive grid columns. */
383
+ readonly columns: {
384
+ readonly from: number;
385
+ readonly to: number;
386
+ };
387
+ /**
388
+ * The equivalent text range.
389
+ *
390
+ * Every existing reader of a selection — deletion, the clipboard, the DOM mirror, viewport
391
+ * pinning — takes this and needs no knowledge that a rectangle produced it.
392
+ */
393
+ readonly text: SemanticSelection;
394
+ }
395
+ /** One painted occurrence of a cell, and where it sits. */
396
+ interface PlacedCell {
397
+ readonly pageIndex: number;
398
+ readonly tableId: string;
399
+ readonly row: TableRowFragmentRecord;
400
+ readonly cell: TableCellFragmentRecord;
401
+ /** Ordinal within the whole table, shared by a header row and every repeat of it. */
402
+ readonly rowIndex: number;
403
+ readonly isHeaderRepeat: boolean;
404
+ /**
405
+ * What to add to the cell's box to reach the page's content-box space.
406
+ *
407
+ * Zero for the body, whose fragments are already laid out from that box. A header's are laid
408
+ * out from the header's own box, which sits ABOVE it, and a footer's from a box past the
409
+ * bottom of it. `cellSelectionRects` promises page-content coordinates and the overlay
410
+ * painter places what it returns against `page.contentBox`, so a story's raw box painted a
411
+ * header's selection band down in the body text.
412
+ */
413
+ readonly offsetX: number;
414
+ /** The vertical half of the same offset. See {@link PlacedCell.offsetX}. */
415
+ readonly offsetY: number;
416
+ }
417
+ /**
418
+ * The rectangle two cells define.
419
+ *
420
+ * Grown to a fixpoint rather than taken literally: a cell that spans two columns cannot be
421
+ * half selected, and a vertically merged run cannot be selected in the middle. Word grows the
422
+ * rectangle until every cell it touches is wholly inside it, so dragging into a merged cell
423
+ * pulls the selection out to that cell's full extent.
424
+ */
425
+ declare function cellSelectionBetween(layout: SemanticLayout, anchor: TableCellAddress, head: TableCellAddress): CellSelection | null;
426
+ /** Paragraph ids inside a set of cells, in document order, each once. */
427
+ declare function paragraphsInCells(layout: SemanticLayout, cellIds: readonly string[]): readonly string[];
428
+ /** The style spans a cell selection covers, for reporting active formatting. */
429
+ declare function spansInCells(layout: SemanticLayout, cellIds: readonly string[]): readonly StyleSpanRecord[];
430
+ /** One rectangle per painted occurrence of a selected cell, in page-content coordinates. */
431
+ declare function cellSelectionRects(layout: SemanticLayout, cellIds: readonly string[]): readonly {
432
+ pageIndex: number;
433
+ x: number;
434
+ y: number;
435
+ width: number;
436
+ height: number;
437
+ }[];
438
+ /**
439
+ * A cell selection as plain text: tabs between cells, newlines between rows.
440
+ *
441
+ * What a spreadsheet and every other word processor put on the clipboard for a rectangle, and
442
+ * the only shape that survives the trip: the text range a rectangle stands in for would paste
443
+ * back as one run of characters with the grid gone.
444
+ */
445
+ declare function cellSelectionText(layout: SemanticLayout, selection: CellSelection, paragraphText?: (layout: SemanticLayout, paragraphId: string) => string): string;
446
+ /** Where a paragraph sits in a table, if it sits in one. */
447
+ interface TableCellContext {
448
+ readonly tableId: string;
449
+ readonly rows: number;
450
+ readonly columns: number;
451
+ readonly rowIndex: number;
452
+ readonly columnIndex: number;
453
+ }
454
+ /**
455
+ * The table context of one paragraph — what a toolbar reflects when the caret is in a cell.
456
+ *
457
+ * Answers for a plain caret, not only for a cell selection, because "am I in a table" is a
458
+ * question about where the caret is and a toolbar that only knew during a rectangle drag
459
+ * would show its table controls disabled while the user was typing in a cell.
460
+ */
461
+ declare function tableContextAt(layout: SemanticLayout, paragraphId: string): TableCellContext | null;
462
+
463
+ export { isFurniturePoint as A, lineEndOffset as B, DEFAULT_PAGE_GEOMETRY as D, pageAtY as E, paragraphSectionNode as F, paragraphsInCells as G, parsePageNumbering as I, parseSectionProperties as J, projectedSectionSourceIndexes as K, readSectionProperties as L, MAX_DOCUMENT_SECTIONS as M, spanOffsetX as N, spansInCells as O, tableContextAt as Q, DEFAULT_SECTION_PROPERTIES as b, DEFAULT_VERTICAL_WEIGHT as c, caretBoxOnLine as p, cellSelectionBetween as q, cellSelectionRects as r, cellSelectionText as s, contentControlAtPoint as t, enumerateDocumentSections as u, enumerateDocumentSectionsBounded as v, findDrawingOverlayFrameInLayout as w, geometryOfSection as x, hitTestPage as y, hitTestSheet as z };
464
+ export type { CellSelection as C, HitPoint as H, PageGeometry as P, SectionProperties as S, TableCellAddress as T, SectionColumns as a, DocumentSection as d, DocumentSectionsEnumeration as e, DrawingOverlayFrame as f, HitTestOptions as g, PlacedCell as h, SectionBreakType as i, SectionColumnDefinition as j, SectionMargins as k, SectionPageNumbering as l, SemanticHit as m, SemanticHitDrawing as n, TableCellContext as o };
@@ -0,0 +1,135 @@
1
+ import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, e as StyleSpanRecord } from './semantic-records-4B3WwFAi.js';
2
+
3
+ /** How `moveCaret` resolves a motion. */
4
+ interface MoveCaretOptions {
5
+ /** Precomputed active-story stops; body navigation keeps the indexed default. */
6
+ readonly stops?: readonly CaretGeometry[];
7
+ readonly measurer?: TextMeasurer;
8
+ /**
9
+ * The line the caret shows on (its line affinity), for an offset that ends one wrapped line
10
+ * and starts the next. Home, End, Up, and Down then start from that line. A line that does
11
+ * not hold the offset is ignored, and the default line for the offset applies.
12
+ */
13
+ readonly lineId?: string;
14
+ }
15
+
16
+ /** A caret position in the model. */
17
+ interface SemanticPosition {
18
+ readonly paragraphId: string;
19
+ readonly offset: number;
20
+ }
21
+ /** A caret position with the geometry that renders it. */
22
+ interface CaretGeometry {
23
+ readonly position: SemanticPosition;
24
+ /** Page-relative, in the same coordinate space as the line boxes. */
25
+ readonly x: number;
26
+ readonly y: number;
27
+ readonly height: number;
28
+ readonly lineId: string;
29
+ readonly pageIndex: number;
30
+ }
31
+ /**
32
+ * A selection as two semantic positions — never as DOM nodes.
33
+ *
34
+ * `anchor` is where the selection started and `head` is where it currently ends, so `head` before
35
+ * `anchor` is an ordinary backwards selection rather than an error. Collapsed when the two are
36
+ * equal, which is what a caret is.
37
+ */
38
+ interface SemanticSelection {
39
+ readonly anchor: SemanticPosition;
40
+ readonly head: SemanticPosition;
41
+ }
42
+ /** One painted selection rectangle, in page-relative layout points. */
43
+ interface SelectionRect {
44
+ readonly pageIndex: number;
45
+ readonly x: number;
46
+ readonly y: number;
47
+ readonly width: number;
48
+ readonly height: number;
49
+ }
50
+ declare function caretStops(layout: SemanticLayout, measurer?: TextMeasurer): CaretGeometry[];
51
+ /**
52
+ * Caret stops for one story's block fragments (header/footer), in reading order.
53
+ *
54
+ * Coordinates stay story-relative — the same space `hitTestFragments` and furniture paint
55
+ * use — so arrow motion follows tab-stop geometry and projected field atoms without mixing
56
+ * body sheet offsets.
57
+ */
58
+ declare function caretStopsForBlocks(layout: SemanticLayout, pageIndex: number, fragments: readonly BlockFragmentRecord[], measurer?: TextMeasurer): CaretGeometry[];
59
+ /**
60
+ * How caret geometry is resolved.
61
+ *
62
+ * `preferPage` disambiguates a paragraph that paints on SEVERAL pages — a shared header appears
63
+ * once per page, and without a preference the caret could be placed on any of its copies.
64
+ */
65
+ interface CaretAtOptions {
66
+ readonly measurer?: TextMeasurer;
67
+ /**
68
+ * Prefer geometry from this sheet when the same paragraph paints on multiple pages
69
+ * (shared header/footer copies).
70
+ */
71
+ readonly preferredPageIndex?: number;
72
+ /** Prefer this visual line when one model boundary has several painted occurrences. */
73
+ readonly preferredLineId?: string;
74
+ }
75
+ /** Geometry for one model position, or null when it is not laid out. */
76
+ declare function caretAt(layout: SemanticLayout, position: SemanticPosition, measurerOrOptions?: TextMeasurer | CaretAtOptions): CaretGeometry | null;
77
+
78
+ /** Layout-published content-control boundaries in document order. */
79
+ declare function contentControlsInLayout(layout: SemanticLayout): readonly ContentControlBoundaryRecord[];
80
+ /**
81
+ * One caret movement, in Word's own vocabulary.
82
+ *
83
+ * Visual rather than logical where the two differ: `left` means left on screen, which in
84
+ * right-to-left text is forward through the string.
85
+ */
86
+ type NavigationCommand = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'lineStart' | 'lineEnd' | 'documentStart' | 'documentEnd' | 'pageUp' | 'pageDown';
87
+ /**
88
+ * The text of one paragraph, read back from the layout records.
89
+ *
90
+ * Word boundaries need characters, and the records carry them: every span holds the text it
91
+ * was laid out from, keyed by the source range it covers. Reading them back keeps word
92
+ * motion in the interaction lane instead of making it a second consumer of the model.
93
+ */
94
+ declare function paragraphTextFromLayout(layout: SemanticLayout, paragraphId: string): string;
95
+ /** Visible deletion boundaries split words without changing canonical text offsets. */
96
+ declare function deletedTextBoundaries(layout: SemanticLayout, paragraphId: string): ReadonlySet<number>;
97
+
98
+ /** Move a caret; vertical movement carries a desired X through shorter lines. */
99
+ declare function moveCaret(layout: SemanticLayout, position: SemanticPosition, command: NavigationCommand, desiredX?: number | null, options?: MoveCaretOptions): {
100
+ position: SemanticPosition;
101
+ desiredX: number | null;
102
+ /**
103
+ * The line the caret shows on after the motion, when it is not the default line for the
104
+ * position (End at a wrap shows on the upper line). Pass it back as
105
+ * {@link MoveCaretOptions.lineId} and as `CaretAtOptions.preferredLineId`.
106
+ */
107
+ lineId?: string;
108
+ } | null;
109
+ /**
110
+ * The anchor an IME composition is attached to.
111
+ *
112
+ * Composition needs a position that survives the intermediate transactions it produces, so
113
+ * it is expressed in model coordinates and re-resolved against each new layout rather than
114
+ * cached as geometry.
115
+ */
116
+ declare function compositionAnchor(layout: SemanticLayout, position: SemanticPosition,
117
+ /** For an exact mid-span x (layout publishes no eager caret edges; see caretAt). */
118
+ measurer?: TextMeasurer): CaretGeometry | null;
119
+ /** The style spans a selection touches, for reporting active formatting. */
120
+ declare function spansInSelection(layout: SemanticLayout, selection: SemanticSelection,
121
+ /**
122
+ * Reading order of the ACTIVE story. See {@link orderPositions}.
123
+ *
124
+ * REQUIRED. A default here can only be one story's order, and whichever one it is will be
125
+ * wrong for every caret in another — which is exactly how this read came to answer about the
126
+ * body while the caret sat in a header. Requiring it is what makes the compiler find a call
127
+ * site that forgot, and it already found one.
128
+ *
129
+ * A caller with no story in hand passes {@link everyStoryOrder}, which covers all of them: a
130
+ * selection cannot span two stories, so only the order WITHIN one is ever compared.
131
+ */
132
+ order: readonly string[]): StyleSpanRecord[];
133
+
134
+ export { caretAt as d, caretStops as e, caretStopsForBlocks as f, compositionAnchor as g, contentControlsInLayout as h, deletedTextBoundaries as i, moveCaret as m, paragraphTextFromLayout as p, spansInSelection as s };
135
+ export type { CaretGeometry as C, MoveCaretOptions as M, NavigationCommand as N, SemanticPosition as S, SemanticSelection as a, SelectionRect as b, CaretAtOptions as c };