postext 1.22.3 → 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/dist/__tests__/bundle/bitmapInfo.test.d.ts +2 -0
  2. package/dist/__tests__/bundle/bitmapInfo.test.d.ts.map +1 -0
  3. package/dist/__tests__/bundle/bitmapInfo.test.js +78 -0
  4. package/dist/__tests__/bundle/bitmapInfo.test.js.map +1 -0
  5. package/dist/__tests__/bundle/designOverflowPin.test.d.ts +2 -0
  6. package/dist/__tests__/bundle/designOverflowPin.test.d.ts.map +1 -0
  7. package/dist/__tests__/bundle/designOverflowPin.test.js +87 -0
  8. package/dist/__tests__/bundle/designOverflowPin.test.js.map +1 -0
  9. package/dist/__tests__/bundle.test.js +1 -1
  10. package/dist/__tests__/bundle.test.js.map +1 -1
  11. package/dist/__tests__/codeBlocks.test.d.ts +2 -0
  12. package/dist/__tests__/codeBlocks.test.d.ts.map +1 -0
  13. package/dist/__tests__/codeBlocks.test.js +550 -0
  14. package/dist/__tests__/codeBlocks.test.js.map +1 -0
  15. package/dist/__tests__/design/designTextOverflow.test.d.ts +2 -0
  16. package/dist/__tests__/design/designTextOverflow.test.d.ts.map +1 -0
  17. package/dist/__tests__/design/designTextOverflow.test.js +102 -0
  18. package/dist/__tests__/design/designTextOverflow.test.js.map +1 -0
  19. package/dist/__tests__/exports.test.js +30 -0
  20. package/dist/__tests__/exports.test.js.map +1 -1
  21. package/dist/__tests__/frontmatterInvalid.test.d.ts +2 -0
  22. package/dist/__tests__/frontmatterInvalid.test.d.ts.map +1 -0
  23. package/dist/__tests__/frontmatterInvalid.test.js +101 -0
  24. package/dist/__tests__/frontmatterInvalid.test.js.map +1 -0
  25. package/dist/__tests__/hardBreaks.test.d.ts +2 -0
  26. package/dist/__tests__/hardBreaks.test.d.ts.map +1 -0
  27. package/dist/__tests__/hardBreaks.test.js +226 -0
  28. package/dist/__tests__/hardBreaks.test.js.map +1 -0
  29. package/dist/__tests__/headingFirstLineIndent.test.d.ts +2 -0
  30. package/dist/__tests__/headingFirstLineIndent.test.d.ts.map +1 -0
  31. package/dist/__tests__/headingFirstLineIndent.test.js +185 -0
  32. package/dist/__tests__/headingFirstLineIndent.test.js.map +1 -0
  33. package/dist/__tests__/headingInlineMarks.test.js +1 -1
  34. package/dist/__tests__/headingInlineMarks.test.js.map +1 -1
  35. package/dist/__tests__/headingLetterSpacing.test.js +1 -1
  36. package/dist/__tests__/headingLetterSpacing.test.js.map +1 -1
  37. package/dist/__tests__/lineNumbers.test.d.ts +2 -0
  38. package/dist/__tests__/lineNumbers.test.d.ts.map +1 -0
  39. package/dist/__tests__/lineNumbers.test.js +304 -0
  40. package/dist/__tests__/lineNumbers.test.js.map +1 -0
  41. package/dist/__tests__/mathSizeMigration.test.js +2 -2
  42. package/dist/__tests__/mathSizeMigration.test.js.map +1 -1
  43. package/dist/__tests__/paragraphDropCap.test.d.ts +2 -0
  44. package/dist/__tests__/paragraphDropCap.test.d.ts.map +1 -0
  45. package/dist/__tests__/paragraphDropCap.test.js +442 -0
  46. package/dist/__tests__/paragraphDropCap.test.js.map +1 -0
  47. package/dist/__tests__/paragraphStyleIndent.test.js +26 -2
  48. package/dist/__tests__/paragraphStyleIndent.test.js.map +1 -1
  49. package/dist/__tests__/pipeline/bitmapResolution.test.d.ts +2 -0
  50. package/dist/__tests__/pipeline/bitmapResolution.test.d.ts.map +1 -0
  51. package/dist/__tests__/pipeline/bitmapResolution.test.js +139 -0
  52. package/dist/__tests__/pipeline/bitmapResolution.test.js.map +1 -0
  53. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
  54. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js.map +1 -1
  55. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
  56. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js.map +1 -1
  57. package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
  58. package/dist/__tests__/pipeline/colonListRoom.test.js.map +1 -1
  59. package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
  60. package/dist/__tests__/pipeline/compoundBreaks.test.js.map +1 -1
  61. package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
  62. package/dist/__tests__/pipeline/dashBreaks.test.js.map +1 -1
  63. package/dist/__tests__/pipeline/designTextTruncated.test.d.ts +2 -0
  64. package/dist/__tests__/pipeline/designTextTruncated.test.d.ts.map +1 -0
  65. package/dist/__tests__/pipeline/designTextTruncated.test.js +116 -0
  66. package/dist/__tests__/pipeline/designTextTruncated.test.js.map +1 -0
  67. package/dist/__tests__/pipeline/floatPlacement.test.js +3 -3
  68. package/dist/__tests__/pipeline/floatPlacement.test.js.map +1 -1
  69. package/dist/__tests__/pipeline/floatShrink.test.d.ts +2 -0
  70. package/dist/__tests__/pipeline/floatShrink.test.d.ts.map +1 -0
  71. package/dist/__tests__/pipeline/floatShrink.test.js +298 -0
  72. package/dist/__tests__/pipeline/floatShrink.test.js.map +1 -0
  73. package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
  74. package/dist/__tests__/pipeline/headingSplitOrphans.test.js.map +1 -1
  75. package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
  76. package/dist/__tests__/pipeline/inlineFigureSpace.test.js.map +1 -1
  77. package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
  78. package/dist/__tests__/pipeline/paragraphContainerTail.test.js.map +1 -1
  79. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +7 -1
  80. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -1
  81. package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
  82. package/dist/__tests__/pipeline/raggedOptimal.test.js.map +1 -1
  83. package/dist/__tests__/pipeline/textWrap.test.d.ts +2 -0
  84. package/dist/__tests__/pipeline/textWrap.test.d.ts.map +1 -0
  85. package/dist/__tests__/pipeline/textWrap.test.js +453 -0
  86. package/dist/__tests__/pipeline/textWrap.test.js.map +1 -0
  87. package/dist/__tests__/preflight.test.js +30 -1
  88. package/dist/__tests__/preflight.test.js.map +1 -1
  89. package/dist/__tests__/presets/showcaseDesignOverflow.test.d.ts +2 -0
  90. package/dist/__tests__/presets/showcaseDesignOverflow.test.d.ts.map +1 -0
  91. package/dist/__tests__/presets/showcaseDesignOverflow.test.js +58 -0
  92. package/dist/__tests__/presets/showcaseDesignOverflow.test.js.map +1 -0
  93. package/dist/__tests__/tabStops.test.d.ts +2 -0
  94. package/dist/__tests__/tabStops.test.d.ts.map +1 -0
  95. package/dist/__tests__/tabStops.test.js +394 -0
  96. package/dist/__tests__/tabStops.test.js.map +1 -0
  97. package/dist/__tests__/table/booktabs.test.d.ts +2 -0
  98. package/dist/__tests__/table/booktabs.test.d.ts.map +1 -0
  99. package/dist/__tests__/table/booktabs.test.js +290 -0
  100. package/dist/__tests__/table/booktabs.test.js.map +1 -0
  101. package/dist/__tests__/textWrapMeasure.test.d.ts +2 -0
  102. package/dist/__tests__/textWrapMeasure.test.d.ts.map +1 -0
  103. package/dist/__tests__/textWrapMeasure.test.js +162 -0
  104. package/dist/__tests__/textWrapMeasure.test.js.map +1 -0
  105. package/dist/__tests__/verseLines.test.d.ts +2 -0
  106. package/dist/__tests__/verseLines.test.d.ts.map +1 -0
  107. package/dist/__tests__/verseLines.test.js +505 -0
  108. package/dist/__tests__/verseLines.test.js.map +1 -0
  109. package/dist/bitmapResolution.d.ts +42 -0
  110. package/dist/bitmapResolution.d.ts.map +1 -0
  111. package/dist/bitmapResolution.js +82 -0
  112. package/dist/bitmapResolution.js.map +1 -0
  113. package/dist/bundle/codec.d.ts +9 -2
  114. package/dist/bundle/codec.d.ts.map +1 -1
  115. package/dist/bundle/codec.js +24 -2
  116. package/dist/bundle/codec.js.map +1 -1
  117. package/dist/bundle/configVersion.d.ts +119 -8
  118. package/dist/bundle/configVersion.d.ts.map +1 -1
  119. package/dist/bundle/configVersion.js +395 -6
  120. package/dist/bundle/configVersion.js.map +1 -1
  121. package/dist/bundle/index.d.ts +3 -3
  122. package/dist/bundle/index.d.ts.map +1 -1
  123. package/dist/bundle/index.js +2 -2
  124. package/dist/bundle/index.js.map +1 -1
  125. package/dist/bundle/manifest.d.ts +12 -2
  126. package/dist/bundle/manifest.d.ts.map +1 -1
  127. package/dist/bundle/manifest.js +132 -6
  128. package/dist/bundle/manifest.js.map +1 -1
  129. package/dist/bundle/types.d.ts +28 -2
  130. package/dist/bundle/types.d.ts.map +1 -1
  131. package/dist/canvas-backend/blockRender.d.ts.map +1 -1
  132. package/dist/canvas-backend/blockRender.js +45 -9
  133. package/dist/canvas-backend/blockRender.js.map +1 -1
  134. package/dist/canvas-backend/index.d.ts.map +1 -1
  135. package/dist/canvas-backend/index.js +3 -0
  136. package/dist/canvas-backend/index.js.map +1 -1
  137. package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
  138. package/dist/canvas-backend/renderResourceBlock.js +15 -1
  139. package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
  140. package/dist/cjkMarks.js +1 -1
  141. package/dist/cjkMarks.js.map +1 -1
  142. package/dist/code/highlight.d.ts +34 -0
  143. package/dist/code/highlight.d.ts.map +1 -0
  144. package/dist/code/highlight.js +406 -0
  145. package/dist/code/highlight.js.map +1 -0
  146. package/dist/configWarnings.d.ts.map +1 -1
  147. package/dist/configWarnings.js +220 -4
  148. package/dist/configWarnings.js.map +1 -1
  149. package/dist/defaults/bodyText.d.ts.map +1 -1
  150. package/dist/defaults/bodyText.js +25 -0
  151. package/dist/defaults/bodyText.js.map +1 -1
  152. package/dist/defaults/calloutStyles.d.ts.map +1 -1
  153. package/dist/defaults/calloutStyles.js +7 -0
  154. package/dist/defaults/calloutStyles.js.map +1 -1
  155. package/dist/defaults/codeStyle.d.ts +29 -0
  156. package/dist/defaults/codeStyle.d.ts.map +1 -0
  157. package/dist/defaults/codeStyle.js +284 -0
  158. package/dist/defaults/codeStyle.js.map +1 -0
  159. package/dist/defaults/dropCap.d.ts +49 -0
  160. package/dist/defaults/dropCap.d.ts.map +1 -0
  161. package/dist/defaults/dropCap.js +66 -0
  162. package/dist/defaults/dropCap.js.map +1 -0
  163. package/dist/defaults/headerFooter.d.ts +21 -6
  164. package/dist/defaults/headerFooter.d.ts.map +1 -1
  165. package/dist/defaults/headerFooter.js +37 -14
  166. package/dist/defaults/headerFooter.js.map +1 -1
  167. package/dist/defaults/headings.d.ts +5 -4
  168. package/dist/defaults/headings.d.ts.map +1 -1
  169. package/dist/defaults/headings.js +26 -4
  170. package/dist/defaults/headings.js.map +1 -1
  171. package/dist/defaults/index.d.ts +4 -1
  172. package/dist/defaults/index.d.ts.map +1 -1
  173. package/dist/defaults/index.js +20 -1
  174. package/dist/defaults/index.js.map +1 -1
  175. package/dist/defaults/layout.d.ts +30 -1
  176. package/dist/defaults/layout.d.ts.map +1 -1
  177. package/dist/defaults/layout.js +105 -1
  178. package/dist/defaults/layout.js.map +1 -1
  179. package/dist/defaults/lineNumbers.d.ts +19 -0
  180. package/dist/defaults/lineNumbers.d.ts.map +1 -0
  181. package/dist/defaults/lineNumbers.js +101 -0
  182. package/dist/defaults/lineNumbers.js.map +1 -0
  183. package/dist/defaults/paragraphStyles.d.ts.map +1 -1
  184. package/dist/defaults/paragraphStyles.js +20 -0
  185. package/dist/defaults/paragraphStyles.js.map +1 -1
  186. package/dist/defaults/parts.js +4 -4
  187. package/dist/defaults/parts.js.map +1 -1
  188. package/dist/defaults/tabStops.d.ts +29 -0
  189. package/dist/defaults/tabStops.d.ts.map +1 -0
  190. package/dist/defaults/tabStops.js +94 -0
  191. package/dist/defaults/tabStops.js.map +1 -0
  192. package/dist/defaults/tableStyle.d.ts.map +1 -1
  193. package/dist/defaults/tableStyle.js +44 -0
  194. package/dist/defaults/tableStyle.js.map +1 -1
  195. package/dist/defaults/toc.js +2 -2
  196. package/dist/defaults/verse.d.ts +11 -0
  197. package/dist/defaults/verse.d.ts.map +1 -0
  198. package/dist/defaults/verse.js +57 -0
  199. package/dist/defaults/verse.js.map +1 -0
  200. package/dist/design/layout.d.ts +15 -1
  201. package/dist/design/layout.d.ts.map +1 -1
  202. package/dist/design/layout.js +28 -4
  203. package/dist/design/layout.js.map +1 -1
  204. package/dist/fonts/usage.d.ts +7 -0
  205. package/dist/fonts/usage.d.ts.map +1 -1
  206. package/dist/fonts/usage.js +71 -0
  207. package/dist/fonts/usage.js.map +1 -1
  208. package/dist/frontmatter.d.ts +20 -0
  209. package/dist/frontmatter.d.ts.map +1 -1
  210. package/dist/frontmatter.js +69 -3
  211. package/dist/frontmatter.js.map +1 -1
  212. package/dist/html-backend.d.ts.map +1 -1
  213. package/dist/html-backend.js +107 -15
  214. package/dist/html-backend.js.map +1 -1
  215. package/dist/index.d.ts +18 -10
  216. package/dist/index.d.ts.map +1 -1
  217. package/dist/index.js +9 -4
  218. package/dist/index.js.map +1 -1
  219. package/dist/measure/bidiLines.d.ts +4 -3
  220. package/dist/measure/bidiLines.d.ts.map +1 -1
  221. package/dist/measure/bidiLines.js +14 -9
  222. package/dist/measure/bidiLines.js.map +1 -1
  223. package/dist/measure/cache.js +2 -2
  224. package/dist/measure/cache.js.map +1 -1
  225. package/dist/measure/cjkCompose.d.ts.map +1 -1
  226. package/dist/measure/cjkCompose.js +10 -6
  227. package/dist/measure/cjkCompose.js.map +1 -1
  228. package/dist/measure/hardBreaks.d.ts +46 -0
  229. package/dist/measure/hardBreaks.d.ts.map +1 -0
  230. package/dist/measure/hardBreaks.js +228 -0
  231. package/dist/measure/hardBreaks.js.map +1 -0
  232. package/dist/measure/index.d.ts +4 -3
  233. package/dist/measure/index.d.ts.map +1 -1
  234. package/dist/measure/index.js +5 -4
  235. package/dist/measure/index.js.map +1 -1
  236. package/dist/measure/leader.d.ts +20 -0
  237. package/dist/measure/leader.d.ts.map +1 -0
  238. package/dist/measure/leader.js +46 -0
  239. package/dist/measure/leader.js.map +1 -0
  240. package/dist/measure/links.js +1 -1
  241. package/dist/measure/links.js.map +1 -1
  242. package/dist/measure/plain.d.ts.map +1 -1
  243. package/dist/measure/plain.js +23 -26
  244. package/dist/measure/plain.js.map +1 -1
  245. package/dist/measure/rich.d.ts +19 -0
  246. package/dist/measure/rich.d.ts.map +1 -1
  247. package/dist/measure/rich.js +215 -39
  248. package/dist/measure/rich.js.map +1 -1
  249. package/dist/measure/tabs.d.ts +103 -0
  250. package/dist/measure/tabs.d.ts.map +1 -0
  251. package/dist/measure/tabs.js +123 -0
  252. package/dist/measure/tabs.js.map +1 -0
  253. package/dist/measure/types.d.ts +72 -2
  254. package/dist/measure/types.d.ts.map +1 -1
  255. package/dist/measure/types.js +87 -3
  256. package/dist/measure/types.js.map +1 -1
  257. package/dist/parse/blockParser.d.ts +13 -6
  258. package/dist/parse/blockParser.d.ts.map +1 -1
  259. package/dist/parse/blockParser.js +457 -87
  260. package/dist/parse/blockParser.js.map +1 -1
  261. package/dist/parse/codeFence.d.ts +18 -0
  262. package/dist/parse/codeFence.d.ts.map +1 -0
  263. package/dist/parse/codeFence.js +52 -0
  264. package/dist/parse/codeFence.js.map +1 -0
  265. package/dist/parse/index.d.ts +1 -1
  266. package/dist/parse/index.d.ts.map +1 -1
  267. package/dist/parse/index.js.map +1 -1
  268. package/dist/parse/indexMarks.d.ts +3 -1
  269. package/dist/parse/indexMarks.d.ts.map +1 -1
  270. package/dist/parse/indexMarks.js +22 -2
  271. package/dist/parse/indexMarks.js.map +1 -1
  272. package/dist/parse/inlineFormatting.d.ts +50 -0
  273. package/dist/parse/inlineFormatting.d.ts.map +1 -1
  274. package/dist/parse/inlineFormatting.js +94 -0
  275. package/dist/parse/inlineFormatting.js.map +1 -1
  276. package/dist/parse/sourceMapping.d.ts.map +1 -1
  277. package/dist/parse/sourceMapping.js +65 -1
  278. package/dist/parse/sourceMapping.js.map +1 -1
  279. package/dist/parse/types.d.ts +144 -9
  280. package/dist/parse/types.d.ts.map +1 -1
  281. package/dist/pipeline/build.d.ts.map +1 -1
  282. package/dist/pipeline/build.js +629 -47
  283. package/dist/pipeline/build.js.map +1 -1
  284. package/dist/pipeline/buildBlockKind.d.ts +5 -0
  285. package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
  286. package/dist/pipeline/buildBlockKind.js +74 -2
  287. package/dist/pipeline/buildBlockKind.js.map +1 -1
  288. package/dist/pipeline/buildHelpers.d.ts +3 -0
  289. package/dist/pipeline/buildHelpers.d.ts.map +1 -1
  290. package/dist/pipeline/buildHelpers.js +7 -2
  291. package/dist/pipeline/buildHelpers.js.map +1 -1
  292. package/dist/pipeline/buildMeasurement.js +1 -1
  293. package/dist/pipeline/buildMeasurement.js.map +1 -1
  294. package/dist/pipeline/calloutLayout.d.ts.map +1 -1
  295. package/dist/pipeline/calloutLayout.js +33 -2
  296. package/dist/pipeline/calloutLayout.js.map +1 -1
  297. package/dist/pipeline/chips.d.ts.map +1 -1
  298. package/dist/pipeline/chips.js +4 -0
  299. package/dist/pipeline/chips.js.map +1 -1
  300. package/dist/pipeline/codeBlocks.d.ts +38 -0
  301. package/dist/pipeline/codeBlocks.d.ts.map +1 -0
  302. package/dist/pipeline/codeBlocks.js +146 -0
  303. package/dist/pipeline/codeBlocks.js.map +1 -0
  304. package/dist/pipeline/codeInline.d.ts +22 -0
  305. package/dist/pipeline/codeInline.d.ts.map +1 -0
  306. package/dist/pipeline/codeInline.js +93 -0
  307. package/dist/pipeline/codeInline.js.map +1 -0
  308. package/dist/pipeline/codeLines.d.ts +91 -0
  309. package/dist/pipeline/codeLines.d.ts.map +1 -0
  310. package/dist/pipeline/codeLines.js +399 -0
  311. package/dist/pipeline/codeLines.js.map +1 -0
  312. package/dist/pipeline/columnBalancing.d.ts.map +1 -1
  313. package/dist/pipeline/columnBalancing.js +5 -0
  314. package/dist/pipeline/columnBalancing.js.map +1 -1
  315. package/dist/pipeline/config.d.ts.map +1 -1
  316. package/dist/pipeline/config.js +8 -1
  317. package/dist/pipeline/config.js.map +1 -1
  318. package/dist/pipeline/contentWarnings.d.ts +25 -0
  319. package/dist/pipeline/contentWarnings.d.ts.map +1 -1
  320. package/dist/pipeline/contentWarnings.js +173 -19
  321. package/dist/pipeline/contentWarnings.js.map +1 -1
  322. package/dist/pipeline/continuation.d.ts.map +1 -1
  323. package/dist/pipeline/continuation.js +9 -2
  324. package/dist/pipeline/continuation.js.map +1 -1
  325. package/dist/pipeline/dropCap.d.ts +128 -0
  326. package/dist/pipeline/dropCap.d.ts.map +1 -0
  327. package/dist/pipeline/dropCap.js +412 -0
  328. package/dist/pipeline/dropCap.js.map +1 -0
  329. package/dist/pipeline/floatPlacement.d.ts +34 -4
  330. package/dist/pipeline/floatPlacement.d.ts.map +1 -1
  331. package/dist/pipeline/floatPlacement.js +35 -5
  332. package/dist/pipeline/floatPlacement.js.map +1 -1
  333. package/dist/pipeline/floatSlots.d.ts +7 -0
  334. package/dist/pipeline/floatSlots.d.ts.map +1 -1
  335. package/dist/pipeline/floatSlots.js.map +1 -1
  336. package/dist/pipeline/hardBreaks.d.ts +19 -0
  337. package/dist/pipeline/hardBreaks.d.ts.map +1 -0
  338. package/dist/pipeline/hardBreaks.js +36 -0
  339. package/dist/pipeline/hardBreaks.js.map +1 -0
  340. package/dist/pipeline/headerFooter.d.ts +4 -1
  341. package/dist/pipeline/headerFooter.d.ts.map +1 -1
  342. package/dist/pipeline/headerFooter.js +23 -6
  343. package/dist/pipeline/headerFooter.js.map +1 -1
  344. package/dist/pipeline/lineNumbers.d.ts +37 -0
  345. package/dist/pipeline/lineNumbers.d.ts.map +1 -0
  346. package/dist/pipeline/lineNumbers.js +441 -0
  347. package/dist/pipeline/lineNumbers.js.map +1 -0
  348. package/dist/pipeline/measureContentBlock.d.ts +38 -5
  349. package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
  350. package/dist/pipeline/measureContentBlock.js +284 -69
  351. package/dist/pipeline/measureContentBlock.js.map +1 -1
  352. package/dist/pipeline/partPalette.d.ts +1 -1
  353. package/dist/pipeline/partPalette.d.ts.map +1 -1
  354. package/dist/pipeline/partPalette.js +24 -2
  355. package/dist/pipeline/partPalette.js.map +1 -1
  356. package/dist/pipeline/placement.d.ts.map +1 -1
  357. package/dist/pipeline/placement.js +7 -0
  358. package/dist/pipeline/placement.js.map +1 -1
  359. package/dist/pipeline/resourceLayout.d.ts +15 -0
  360. package/dist/pipeline/resourceLayout.d.ts.map +1 -1
  361. package/dist/pipeline/resourceLayout.js +95 -15
  362. package/dist/pipeline/resourceLayout.js.map +1 -1
  363. package/dist/pipeline/styles.d.ts +18 -2
  364. package/dist/pipeline/styles.d.ts.map +1 -1
  365. package/dist/pipeline/styles.js +23 -8
  366. package/dist/pipeline/styles.js.map +1 -1
  367. package/dist/pipeline/tabs.d.ts +35 -0
  368. package/dist/pipeline/tabs.d.ts.map +1 -0
  369. package/dist/pipeline/tabs.js +99 -0
  370. package/dist/pipeline/tabs.js.map +1 -0
  371. package/dist/pipeline/textWrap.d.ts +94 -0
  372. package/dist/pipeline/textWrap.d.ts.map +1 -0
  373. package/dist/pipeline/textWrap.js +188 -0
  374. package/dist/pipeline/textWrap.js.map +1 -0
  375. package/dist/pipeline/toc.d.ts.map +1 -1
  376. package/dist/pipeline/toc.js +3 -38
  377. package/dist/pipeline/toc.js.map +1 -1
  378. package/dist/pipeline/verseLines.d.ts +98 -0
  379. package/dist/pipeline/verseLines.d.ts.map +1 -0
  380. package/dist/pipeline/verseLines.js +293 -0
  381. package/dist/pipeline/verseLines.js.map +1 -0
  382. package/dist/preflight.d.ts +46 -1
  383. package/dist/preflight.d.ts.map +1 -1
  384. package/dist/preflight.js +43 -7
  385. package/dist/preflight.js.map +1 -1
  386. package/dist/table/booktabs.d.ts +37 -0
  387. package/dist/table/booktabs.d.ts.map +1 -0
  388. package/dist/table/booktabs.js +82 -0
  389. package/dist/table/booktabs.js.map +1 -0
  390. package/dist/types.d.ts +787 -12
  391. package/dist/types.d.ts.map +1 -1
  392. package/dist/vdt.d.ts +367 -9
  393. package/dist/vdt.d.ts.map +1 -1
  394. package/dist/vdt.js +9 -2
  395. package/dist/vdt.js.map +1 -1
  396. package/dist/word/docxRead.d.ts.map +1 -1
  397. package/dist/word/docxRead.js +15 -0
  398. package/dist/word/docxRead.js.map +1 -1
  399. package/dist/word/index.d.ts +1 -1
  400. package/dist/word/index.d.ts.map +1 -1
  401. package/dist/word/index.js +1 -1
  402. package/dist/word/index.js.map +1 -1
  403. package/dist/word/inline.d.ts +6 -1
  404. package/dist/word/inline.d.ts.map +1 -1
  405. package/dist/word/inline.js +35 -1
  406. package/dist/word/inline.js.map +1 -1
  407. package/dist/word/model.d.ts +14 -0
  408. package/dist/word/model.d.ts.map +1 -1
  409. package/dist/word/model.js.map +1 -1
  410. package/dist/word/template.d.ts +12 -3
  411. package/dist/word/template.d.ts.map +1 -1
  412. package/dist/word/template.js +13 -3
  413. package/dist/word/template.js.map +1 -1
  414. package/dist/word/toDocx.d.ts.map +1 -1
  415. package/dist/word/toDocx.js +52 -8
  416. package/dist/word/toDocx.js.map +1 -1
  417. package/dist/word/toMarkdown.d.ts +15 -1
  418. package/dist/word/toMarkdown.d.ts.map +1 -1
  419. package/dist/word/toMarkdown.js +133 -7
  420. package/dist/word/toMarkdown.js.map +1 -1
  421. package/dist/word/word.test.js +124 -2
  422. package/dist/word/word.test.js.map +1 -1
  423. package/dist/worker/fonts.d.ts +2 -1
  424. package/dist/worker/fonts.d.ts.map +1 -1
  425. package/dist/worker/fonts.js +6 -2
  426. package/dist/worker/fonts.js.map +1 -1
  427. package/package.json +1 -1
package/dist/vdt.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorPaletteEntry, DocumentMetadata, PostextResource, Resource, ResourceSafeArea, TableCellAlign, TableCellVerticalAlign, ResolvedPageConfig, ResolvedLayoutConfig, ResolvedBodyTextConfig, ResolvedHeadingsConfig, ResolvedTableStyleConfig, ResolvedNamedTableStyleConfig, TableRules, ResolvedCaptionStyleConfig, ResolvedDiagramStyleConfig, ResolvedVideoStyleConfig, ResolvedVideoPlayerOptions, VideoSource, ResolvedParagraphStyleConfig, ResolvedCalloutStyleConfig, ResolvedChipStyleConfig, CalloutSpan, CalloutPlacement, ResolvedUnorderedListsConfig, ResolvedOrderedListsConfig, ResolvedMathConfig, ResolvedPdfGenerationConfig, ResolvedPrintConfig, ResolvedFolioConfig, ResolvedDesignSlot, ResolvedPartsConfig, ResolvedHeadingStyleConfig, ResolvedTocConfig, ResolvedIndexConfig, ResolvedFootnotesConfig, ResolvedCrossRefsConfig, ResolvedCitationsConfig, ResolvedCjkConfig, CjkRegion, PageRole, PartState, PostextConfig, FolioPaperConfig, ResolvedComicsConfig } from './types';
1
+ import type { ColorPaletteEntry, DocumentMetadata, PostextResource, Resource, ResourceSafeArea, TableCellAlign, TableCellVerticalAlign, ResolvedPageConfig, ResolvedLayoutConfig, ResolvedBodyTextConfig, ResolvedHeadingsConfig, ResolvedTableStyleConfig, ResolvedNamedTableStyleConfig, TableRules, ResolvedCaptionStyleConfig, ResolvedDiagramStyleConfig, ResolvedVideoStyleConfig, ResolvedVideoPlayerOptions, VideoSource, ResolvedParagraphStyleConfig, ResolvedCalloutStyleConfig, ResolvedChipStyleConfig, CalloutSpan, CalloutPlacement, ResolvedUnorderedListsConfig, ResolvedOrderedListsConfig, ResolvedMathConfig, ResolvedPdfGenerationConfig, ResolvedPrintConfig, ResolvedFolioConfig, ResolvedDesignSlot, ResolvedPartsConfig, ResolvedHeadingStyleConfig, ResolvedTocConfig, ResolvedIndexConfig, ResolvedFootnotesConfig, ResolvedCrossRefsConfig, ResolvedCitationsConfig, ResolvedCjkConfig, CjkRegion, PageRole, PartState, PostextConfig, FolioPaperConfig, ResolvedComicsConfig, ResolvedLineNumbersConfig, ResolvedCodeStyleConfig } from './types';
2
2
  import type { NumeralStyle } from './numbering';
3
3
  import type { MathRender } from './math/types';
4
4
  export interface BoundingBox {
@@ -77,8 +77,18 @@ export interface ResolvedConfig {
77
77
  * hashes) as before. Read it with `resolvedComics()`, which falls back
78
78
  * to the defaults of the document language. */
79
79
  comics?: ResolvedComicsConfig;
80
- }
81
- export type VDTBlockType = 'paragraph' | 'heading' | 'resource' | 'blockquote' | 'listItem' | 'footnoteRef' | 'mathDisplay' | 'callout';
80
+ /** Line numbers (`PostextConfig.lineNumbers`, #621), resolved, when the
81
+ * config sets the section; absent otherwise (no numbers). */
82
+ lineNumbers?: ResolvedLineNumbersConfig;
83
+ /** Code listings and inline code (`PostextConfig.codeStyle`, #624),
84
+ * resolved, when the config sets the section; absent otherwise (the
85
+ * defaults apply, `resolvedCodeStyle`). */
86
+ codeStyle?: ResolvedCodeStyleConfig;
87
+ }
88
+ export type VDTBlockType = 'paragraph' | 'heading' | 'resource' | 'blockquote' | 'listItem' | 'footnoteRef' | 'mathDisplay' | 'callout'
89
+ /** A line of a code listing (#624): one line per source line, set as
90
+ * written (see `VDTLine.codeLine`), inside the listing's box. */
91
+ | 'code';
82
92
  export type TextAlign = 'left' | 'justify' | 'center' | 'right';
83
93
  /** One run of a chip's text: its own font (bold / italic / script, at the
84
94
  * chip size) and advance. */
@@ -200,6 +210,25 @@ export interface VDTLineSegment {
200
210
  /** A space of a bibliography entry's label column (#290): its width is
201
211
  * set, so renderers paint the line segment by segment. */
202
212
  labelTab?: true;
213
+ /** A leader (#622): the dots of a contents row, or of a tab stop in body
214
+ * text, painted over the room before the text at the stop. `'text'`:
215
+ * `text` is the run of the leader character, painted like a word;
216
+ * `'rule'`: a line drawn across the segment's `width` a little under the
217
+ * baseline (`text` is empty). A leader is no character of the
218
+ * paragraph: it is not in the line's `text`, copied or extracted text,
219
+ * search or the source map; the HTML viewer hides it from assistive
220
+ * technology and the tagged PDF paints it as an artifact. */
221
+ leader?: 'text' | 'rule';
222
+ /** A tab at its stop (#622; the `space` segment flagged `labelTab`, text
223
+ * `'\t'`): how the stop aligns the text after it and where it stands,
224
+ * px from the start edge of the measure (the measure being the line's
225
+ * box less its indent: `bbox.x` is that edge plus the line's indent).
226
+ * Read by outputs that cannot keep the stops exactly (the reflowable
227
+ * EPUB). */
228
+ tab?: {
229
+ align: import('./types').TabStopAlign;
230
+ at: number;
231
+ };
203
232
  /** True when this segment is part of a caption's numbered label, so renderers
204
233
  * paint it in the configured caption-label colour. */
205
234
  captionLabel?: boolean;
@@ -574,9 +603,25 @@ export interface VDTLine {
574
603
  segments?: VDTLineSegment[];
575
604
  /** Whether this is the last line of the paragraph (ragged even when justified) */
576
605
  isLastLine?: boolean;
606
+ /** The line ends at a forced line break the author typed inside the
607
+ * paragraph (#620: a backslash ending a source line, or `\\`): it is set
608
+ * at its natural width like a last line ({@link isLastLine} is set), the
609
+ * paragraph goes on on the next line, copied text takes a line feed
610
+ * there, the reflowable EPUB a `<br/>`. Absent otherwise. */
611
+ hardBreak?: true;
612
+ /** The line holds a tab that went to a tab stop (#622): its `space`
613
+ * segment flagged `labelTab`, `text` `'\t'`, is as wide as the stop asks,
614
+ * followed, when the stop has a leader, by the leader's segment and the
615
+ * gap after it (an empty `space`). The widths are final: in a justified
616
+ * paragraph the line is {@link ragged} and the measurer gave the slack
617
+ * to the word spaces after the last tab; in a centred or right-aligned
618
+ * one a last empty `space` fills the line to its measure, so every
619
+ * renderer sets it from its start side. Absent otherwise. */
620
+ tabbed?: true;
577
621
  /** Set ragged inside a justified paragraph: a line a URL made unfillable
578
- * (its few word spaces would stretch past the loose-line threshold), or
579
- * a CJK line flagged {@link cjkLoose}. */
622
+ * (its few word spaces would stretch past the loose-line threshold), a
623
+ * CJK line flagged {@link cjkLoose}, or a line holding a tab stop
624
+ * ({@link tabbed}). */
580
625
  ragged?: boolean;
581
626
  /** A justified CJK line that needed more inter-character spacing than the
582
627
  * cap (½ em, or `bodyText.maxJustifyTracking` when it is set): it is set
@@ -649,10 +694,14 @@ export interface VDTLine {
649
694
  * direction opposes its frame's (an English quotation in an Arabic book),
650
695
  * whose indent and ragged edge fall on the other side. Absent
651
696
  * otherwise. Its start side is the right of the span: renderers align
652
- * the line there (see {@link lineTextAlign}). */
697
+ * the line there (see {@link lineTextAlign}).
698
+ * Also set, flagged `wrap`, on a line set short beside a picture that
699
+ * text wraps round (#627): the span is the line's narrowed measure, and
700
+ * the line keeps its block's alignment in it. */
653
701
  measure?: {
654
702
  x: number;
655
703
  width: number;
704
+ wrap?: true;
656
705
  };
657
706
  /** How many kashidas (tatweels, U+0640) justification inserted into the
658
707
  * line's words, for warnings and overlays. The tatweels themselves are in
@@ -676,6 +725,44 @@ export interface VDTLine {
676
725
  bayt: number;
677
726
  part: 'bayt' | 'sadr' | 'ajuz' | 'single';
678
727
  };
728
+ /** A line of a `:::verse` poem in the line layout (#620): the stanza it
729
+ * sets (0-based, in its poem), the line of verse (0-based, counted
730
+ * through the whole poem) and whether it is a turnover, the part of a
731
+ * line of verse too wide for the measure set on the line after it. A
732
+ * column or page never breaks between a line and its turnover.
733
+ * `indent` is the line's indent (px, from the poem's start side: its
734
+ * leading spaces × `indentStep`, or where a stepped line starts), set
735
+ * on its first line when not 0. `stanzaEnd` is set on the last line of
736
+ * a stanza another follows (copied text puts a blank line there).
737
+ * `spaceRatio` is set on a line a little too wide for the measure whose
738
+ * word spaces were tightened so it stays on one line: their width as a
739
+ * share of their natural width (never under `bodyText.minWordSpacing`).
740
+ * The widths of the line's segments are final (the block is set flush
741
+ * left): renderers paint them as they are. Absent on any other line. */
742
+ verseLine?: {
743
+ stanza: number;
744
+ line: number;
745
+ turnover: boolean;
746
+ indent?: number;
747
+ stanzaEnd?: true;
748
+ spaceRatio?: number;
749
+ };
750
+ /** A line of a code listing (#624, a `code` block): `line` is the source
751
+ * line it sets (0-based in the listing), `number` its printed number
752
+ * when the listing is numbered (never on a continuation), `continued`
753
+ * a continuation of a wrapped line, `highlight` a line the fence's
754
+ * `highlight` names, `wrapped` a line that goes on in the next one,
755
+ * `clipped` a line cut at the box's edge. The segments carry final
756
+ * widths from the block's left edge (spaces are kept, never
757
+ * stretched). Absent on any other line. */
758
+ codeLine?: {
759
+ line: number;
760
+ number?: string;
761
+ continued?: true;
762
+ highlight?: true;
763
+ wrapped?: true;
764
+ clipped?: true;
765
+ };
679
766
  /** The first line of an entry of a back-of-book index (`:::index`): the
680
767
  * entry's level (0 a main entry, 1 a sub-entry…). A block of the index
681
768
  * may set more than one entry (the page-less entries heading its
@@ -763,6 +850,13 @@ export interface VDTResourceTableLayout {
763
850
  rowEdges: number[];
764
851
  /** Which rules to stroke with `borderWidthPx` (`'grid'` when absent). */
765
852
  rules?: TableRules;
853
+ /** The rules of a `'booktabs'` table (#625), computed by the layout: the
854
+ * renderers stroke exactly these, in `borderColor`, and skip the
855
+ * {@link rules} pattern (and the rounded frame). Coordinates are
856
+ * relative to the table body's top-left corner, like {@link rowEdges};
857
+ * each stroke is centred on its line. `borderWidthPx` is then the
858
+ * widest stroke. Absent for the other patterns. */
859
+ strokes?: VDTTableStroke[];
766
860
  /** Radii (px) of the outer frame's corners — top-left, top-right,
767
861
  * bottom-right, bottom-left — from `tableStyle.borderRadius`, clamped to
768
862
  * half the table's width and height. The frame is stroked round and the
@@ -770,6 +864,15 @@ export interface VDTResourceTableLayout {
770
864
  * corners where it continues. Absent for a square frame. */
771
865
  frameRadii?: [number, number, number, number];
772
866
  }
867
+ /** One rule of a table (`VDTResourceTableLayout.strokes`): a straight
868
+ * line from `(x1, y1)` to `(x2, y2)`, `widthPx` thick, with butt ends. */
869
+ export interface VDTTableStroke {
870
+ x1: number;
871
+ y1: number;
872
+ x2: number;
873
+ y2: number;
874
+ widthPx: number;
875
+ }
773
876
  /** A rounded outline: a rect and its corner radii (top-left, top-right,
774
877
  * bottom-right, bottom-left). */
775
878
  export interface RoundedOutline {
@@ -953,10 +1056,18 @@ export declare function pageIsVertical(page: Pick<VDTPage, 'flow'>): boolean;
953
1056
  * block set against its frame's direction), whose start side is the right
954
1057
  * of its span: `left` (the start; also the last line of a justified
955
1058
  * paragraph, `justify` coming back as `right`) is flush right, `right` (the
956
- * end) flush left, and a centred line stays centred. A justified line that
1059
+ * end) flush left, and a centred line stays centred. A span flagged `wrap`
1060
+ * (a line beside a wrapped picture, #627) keeps the block's alignment. A justified line that
957
1061
  * is not its paragraph's last is filled across the span either way.
958
1062
  */
959
1063
  export declare function lineTextAlign(line: Pick<VDTLine, 'measure'>, textAlign: TextAlign): TextAlign;
1064
+ /** A rule leader (`VDTLineSegment.leader: 'rule'`, #622) at a text size of
1065
+ * `fontSizePx`: its centre `dy` px under the baseline and its stroke
1066
+ * `thickness` px, the same on every renderer. */
1067
+ export declare function leaderRuleGeometry(fontSizePx: number): {
1068
+ dy: number;
1069
+ thickness: number;
1070
+ };
960
1071
  export declare function pageIsMirrored(page: Pick<VDTPage, 'flow'>): boolean;
961
1072
  /** Map a point of a page's flow frame to page coordinates: the identity on
962
1073
  * a left-to-right horizontal page, `(page.width − y, x)` on a vertical
@@ -1074,6 +1185,11 @@ export interface ResolvedResourceBlock {
1074
1185
  grow: number;
1075
1186
  delta: number;
1076
1187
  };
1188
+ /** For a floated picture scaled to the room of its slot
1189
+ * (`placement.shrink`, #626): the share of its width it keeps, below 1.
1190
+ * Absent when the picture is set at its size (or only cropped within
1191
+ * its safe area). */
1192
+ shrinkScale?: number;
1077
1193
  /** For bitmap/svg: the out-of-band binary id to resolve at render time. */
1078
1194
  fileId?: string;
1079
1195
  /** For bitmap: the source format (e.g. `'png'`, `'jpeg'`, `'webp'`). */
@@ -1113,6 +1229,55 @@ export interface ResolvedResourceBlock {
1113
1229
  * note fonts and colour. Empty otherwise. */
1114
1230
  continuesLines: VDTLine[];
1115
1231
  }
1232
+ /**
1233
+ * A paragraph's drop cap (#623, {@link VDTBlock.dropCap}), in page
1234
+ * coordinates of the flow frame, as a list marker's are. The block's
1235
+ * lines do not hold it: its first line starts after it. Its plain text and
1236
+ * source range are the paragraph's own, so the block's `sourceMap` and the
1237
+ * first line's `plainStart` (which counts past it) read the word whole.
1238
+ */
1239
+ export interface VDTDropCap {
1240
+ /** The initial as printed: its letters, with an opening mark set with
1241
+ * the cap (`punctuation: 'with-cap'`). */
1242
+ text: string;
1243
+ fontString: string;
1244
+ /** Hex. */
1245
+ color: string;
1246
+ /** Left edge of the initial's advance. */
1247
+ x: number;
1248
+ /** The baseline it stands on: that of the paragraph's line `sink`. */
1249
+ baselineY: number;
1250
+ /** Its advance width. */
1251
+ width: number;
1252
+ /** Its size (px) and how many lines it spans and sinks. */
1253
+ fontSizePx: number;
1254
+ lines: number;
1255
+ sink: number;
1256
+ /** Source range of the characters it prints (an opening mark hung or set
1257
+ * with it included). */
1258
+ sourceStart?: number;
1259
+ sourceEnd?: number;
1260
+ /** The paragraph's plain-text range it stands for, from 0 (the first
1261
+ * line's `plainStart` counts past it). */
1262
+ plainStart: number;
1263
+ plainEnd: number;
1264
+ /** The whole first word as the paragraph reads it, the initial
1265
+ * included ("Se" of "Se puso"): a tagged PDF gives it as the
1266
+ * `/ActualText` of the initial and the rest of the word. */
1267
+ word: string;
1268
+ /** How many characters of the first line's text finish that word (the
1269
+ * "e" of "Se"); 0 when the initial is a word of its own. */
1270
+ wordRest: number;
1271
+ /** An opening mark hung before the initial at text size
1272
+ * (`punctuation: 'hang'`), on the first line's baseline. */
1273
+ hang?: {
1274
+ text: string;
1275
+ fontString: string;
1276
+ x: number;
1277
+ baselineY: number;
1278
+ width: number;
1279
+ };
1280
+ }
1116
1281
  /** See {@link VDTBlock.stripCaption}. */
1117
1282
  export interface VDTStripCaption {
1118
1283
  /** Index of the first caption line in the block's `lines`, and how many
@@ -1304,6 +1469,28 @@ export interface VDTBlock {
1304
1469
  /** Absolute page X coordinate where the prefix run starts (on the
1305
1470
  * bullet's `bulletY` / `bulletBaselineY`, as the separator). */
1306
1471
  prefixX?: number;
1472
+ /** A drop cap opening the paragraph (#623), on the fragment that holds
1473
+ * its first line only: renderers paint it beside the lines, which were
1474
+ * set short of it. */
1475
+ dropCap?: VDTDropCap;
1476
+ /** A code listing's lines (#624, `type: 'code'`): its language as the
1477
+ * fence names it; when its lines are numbered, the numbers' face and
1478
+ * colour and the room between them and the code (they are set in the
1479
+ * page's `lineNumbers` slot, out of the text, right-aligned before the
1480
+ * code); and how its lines were fitted when one was too wide. */
1481
+ code?: {
1482
+ lang?: string;
1483
+ numbers?: {
1484
+ gap: number;
1485
+ fontString: string;
1486
+ color: string;
1487
+ };
1488
+ fit?: {
1489
+ mode: 'wrap' | 'shrink' | 'clip';
1490
+ lines: number;
1491
+ scale: number;
1492
+ };
1493
+ };
1307
1494
  /** List kind for `listItem` blocks — drives bullet shape and text decoration. */
1308
1495
  listKind?: 'unordered' | 'ordered' | 'task';
1309
1496
  /** When true, the canvas backend draws a strikethrough through the block's lines (completed tasks). */
@@ -1448,6 +1635,30 @@ export interface VDTColumn {
1448
1635
  * level: its bottom is the level cut, and column balancing fills the
1449
1636
  * column up to it even though the page does not flow on. */
1450
1637
  trailingCap?: boolean;
1638
+ /** Regions of the column that text wraps round (#627): a picture or a
1639
+ * box narrower than the column, set at one of its sides, with the lines
1640
+ * beside it set short. Page coordinates of the flow frame (as `bbox`);
1641
+ * each covers the item and its gap on the text's side and under it, its
1642
+ * height in whole grid lines from its top. Absent when nothing in the
1643
+ * column wraps. */
1644
+ exclusions?: VDTExclusion[];
1645
+ }
1646
+ /** A region of a column that text wraps round (see `VDTColumn.exclusions`,
1647
+ * #627). */
1648
+ export interface VDTExclusion {
1649
+ x: number;
1650
+ y: number;
1651
+ width: number;
1652
+ height: number;
1653
+ /** The side of the column it stands at, in the flow (the text runs on the
1654
+ * other side). */
1655
+ side: 'left' | 'right';
1656
+ /** The space between the item and the text beside it (px), part of
1657
+ * `width`. */
1658
+ gap: number;
1659
+ /** The id of the block that wraps the text: an inline figure's block, a
1660
+ * float's, or a box's frame. */
1661
+ ownerId: string;
1451
1662
  }
1452
1663
  /** The notes set at the foot of one column (`footnotes.placement:
1453
1664
  * 'column'`). The note paragraphs themselves are in `VDTPage.floats` (and
@@ -1587,6 +1798,18 @@ export interface VDTDesignTextBlock {
1587
1798
  * runs were ordered at that paragraph level, and an HTML line takes
1588
1799
  * `dir="rtl"`. Absent for left-to-right text. */
1589
1800
  direction?: 'rtl';
1801
+ /** The element lost part of a line to fit its width (#628): `mode` is
1802
+ * how (its `overflow`, or `'clip'` with ink past the box), `elementId`
1803
+ * the element's id, `slot` where its design is painted and `text` the
1804
+ * whole text it was given. The build reports it as a
1805
+ * `designTextTruncated` content warning. Absent when every line shows
1806
+ * whole. */
1807
+ truncated?: {
1808
+ elementId: string;
1809
+ slot: VDTDesignSlotKind;
1810
+ mode: 'ellipsis-start' | 'ellipsis-end' | 'ellipsis-middle' | 'clip';
1811
+ text: string;
1812
+ };
1590
1813
  /** Set vertically on a page or a slot whose text is horizontal
1591
1814
  * (`DesignTextElement.writingMode: 'vertical-rl'`): the lines are laid
1592
1815
  * out in the block's own frame, turned a quarter turn clockwise about
@@ -1953,6 +2176,28 @@ export interface VDTPage {
1953
2176
  * split lines and lettering, in sheet coordinates. The page's columns
1954
2177
  * are empty: nothing flows on it. */
1955
2178
  comic?: VDTComicPage;
2179
+ /** The line numbers printed on the page (`lineNumbers`, #621): one text
2180
+ * block per number, physical like the header and footer, each flagged
2181
+ * `artifact` (a tagged PDF marks it so, the HTML hides it from
2182
+ * assistive technology and from selection). Absent on a page with
2183
+ * none. */
2184
+ lineNumbers?: VDTDesignSlot;
2185
+ /** The line each block of {@link lineNumbers} labels, in the same order:
2186
+ * for overlays and references. */
2187
+ lineNumberMarks?: VDTLineNumberMark[];
2188
+ }
2189
+ /** The line a printed line number labels (#621). */
2190
+ export interface VDTLineNumberMark {
2191
+ /** The line's number in the count. */
2192
+ number: number;
2193
+ /** The number as printed (in `lineNumbers.format`). */
2194
+ label: string;
2195
+ /** The column the line sits in (`VDTColumn.index`). */
2196
+ columnIndex: number;
2197
+ /** The line's block (`VDTBlock.id`) and its index in the block's
2198
+ * `lines`. */
2199
+ blockId: string;
2200
+ lineIndex: number;
1956
2201
  }
1957
2202
  /** Something the layout could not set as asked and placed anyway — a box
1958
2203
  * taller than any column it could go to. Hosts surface these as warnings;
@@ -2010,8 +2255,13 @@ export interface ConfigWarning {
2010
2255
  * the word it is closest to, when one is close.
2011
2256
  * `unknownNumerals`: a `numerals` value that is not `'auto'`,
2012
2257
  * `'latn'`, `'arab'` or `'arabext'`; the digits follow the document
2013
- * language, and `used` is the digit system that gives. */
2014
- kind: 'unknownNumberFormat' | 'fontFamilyStack' | 'sideColumnPercentClamped' | 'columnCountClamped' | 'unknownConfigKey' | 'cjkGridClamped' | 'unknownConfigValue' | 'unknownNumerals';
2258
+ * language, and `used` is the digit system that gives.
2259
+ * `lineNumbersUnsupported`: `lineNumbers.enabled` on a vertical
2260
+ * document (#621), which gets no line numbers; `used` is `false`.
2261
+ * `wrapUnsupported`: a resource type's `defaultPlacement.wrap` in a
2262
+ * vertical document (#627), whose figures keep their bands whole;
2263
+ * `used` is `none`. */
2264
+ kind: 'unknownNumberFormat' | 'fontFamilyStack' | 'sideColumnPercentClamped' | 'columnCountClamped' | 'unknownConfigKey' | 'cjkGridClamped' | 'unknownConfigValue' | 'unknownNumerals' | 'lineNumbersUnsupported' | 'wrapUnsupported';
2015
2265
  /** Where the value sits in the config, e.g.
2016
2266
  * `orderedLists.levels[1].numberFormat`, `header.elements[0].fontFamily`,
2017
2267
  * `headingStyles[2].layout.sideColumnPercent`. */
@@ -2078,6 +2328,13 @@ export type ContentWarning = ContentWarningBase & (
2078
2328
  kind: 'referencesUnreadable';
2079
2329
  message: string;
2080
2330
  }
2331
+ /** The front matter block is not valid YAML (an unclosed quote, text
2332
+ * after a quoted value): the document is set without its metadata.
2333
+ * `message` is the parser's reason, with the line and column. */
2334
+ | {
2335
+ kind: 'invalidFrontmatter';
2336
+ message: string;
2337
+ }
2081
2338
  /** A `:::name` line whose name is neither a directive nor a container:
2082
2339
  * it is set as text. */
2083
2340
  | {
@@ -2317,6 +2574,11 @@ export type ContentWarning = ContentWarningBase & (
2317
2574
  kind: 'rotateIgnoredVertical';
2318
2575
  resourceId: string;
2319
2576
  }
2577
+ /** A `:tab` in a block set in vertical text (#622): tab stops are set in
2578
+ * horizontal text only, so the tab is a word space. */
2579
+ | {
2580
+ kind: 'tabInVerticalText';
2581
+ }
2320
2582
  /** A comic page's `split` attribute the grammar cannot read whole (a
2321
2583
  * stray character, an unclosed `[`, `/` and `|` mixed in one list, a
2322
2584
  * bracketed list on its parent's axis): the readable part is used, an
@@ -2393,7 +2655,93 @@ export type ContentWarning = ContentWarningBase & (
2393
2655
  | {
2394
2656
  kind: 'comicUnknownSpeaker';
2395
2657
  speaker: string;
2658
+ }
2659
+ /** A line number set in the side column (`lineNumbers.position:
2660
+ * 'side'`, #621) overlaps a side box, a side caption or another float
2661
+ * of that column: both are painted where they are. Points at the line
2662
+ * it numbers; `number` is the number as printed. */
2663
+ | {
2664
+ kind: 'lineNumberOverlap';
2665
+ number: string;
2666
+ }
2667
+ /** A paragraph a drop cap opens (#623) that could not take it as
2668
+ * configured. `reason`: `'shortParagraph'`, fewer lines than the
2669
+ * initial sinks (`handling` says what `shortParagraph` did: kept the
2670
+ * room, shrank the initial to `lines`, or left it out); `'split'`, the
2671
+ * paragraph broke before the initial's last line, alone in a column
2672
+ * too short for it; `'joiningScript'`, its first letter joins the next
2673
+ * (Arabic, Syriac, N'Ko) and is not set apart; `'verticalText'`, drop
2674
+ * caps are set in horizontal text only; `'noLetter'`, it opens with no
2675
+ * letter or digit to set large (a reference, a formula, a note mark).
2676
+ * `text` is the paragraph's first line. Found by the layout. */
2677
+ | {
2678
+ kind: 'dropCap';
2679
+ reason: 'shortParagraph' | 'split' | 'joiningScript' | 'verticalText' | 'noLetter';
2680
+ handling?: 'reserve' | 'shrink' | 'skip';
2681
+ lines?: number;
2682
+ text: string;
2683
+ }
2684
+ /** `codeOverflow` (#624): a code listing has lines wider than its box,
2685
+ * fitted as `codeStyle.overflow` says: turned over (`'wrap'`), set
2686
+ * smaller (`'shrink'`, at `scale` of its size; past `minFontScale` its
2687
+ * lines wrap too) or cut at the box's edge (`'clip'`). `lines` counts
2688
+ * the source lines too wide. Found by the layout. */
2689
+ | {
2690
+ kind: 'codeOverflow';
2691
+ mode: 'wrap' | 'shrink' | 'clip';
2692
+ lines: number;
2693
+ scale?: number;
2694
+ lang?: string;
2695
+ }
2696
+ /** `floatShrunk` (#626): a floated picture was set smaller than its size
2697
+ * to fit the room of its slot (`placement.shrink`), at `scale` of its
2698
+ * width. `overflowPx`: at its smallest scale (`placement.minScale`) it
2699
+ * still runs this far past the foot of the page's text block, on a page
2700
+ * where it had nowhere else to go. Found by the layout; information
2701
+ * more than a fault, unless it overflows. */
2702
+ | {
2703
+ kind: 'floatShrunk';
2704
+ resourceId: string;
2705
+ scale: number;
2706
+ overflowPx?: number;
2707
+ }
2708
+ /** `textWrap` (#627): a resource or a box set to wrap text round it
2709
+ * (`placement.wrap`, a box's `wrap`) that does not as asked.
2710
+ * `'tooNarrow'`: the text beside it would be narrower than
2711
+ * `layout.wrap.minTextWidth`, so it takes its band whole; `'fewLines'`:
2712
+ * it is shorter than `layout.wrap.minLinesBeside` lines, so it takes
2713
+ * its band whole; `'moved'`: an inline one was too tall for the room
2714
+ * left in its column and moved on to the next, its anchor with it;
2715
+ * `'verticalText'`: text wraps in horizontal text only, so in a
2716
+ * vertical flow it takes its band whole. `resourceId` names a
2717
+ * resource, `box` a box's style. Found by the layout. */
2718
+ | {
2719
+ kind: 'textWrap';
2720
+ reason: 'tooNarrow' | 'fewLines' | 'moved' | 'verticalText';
2721
+ resourceId?: string;
2722
+ box?: string;
2723
+ }
2724
+ /** `designTextTruncated` (#628): a design text element did not fit its
2725
+ * width and lost part of a line: cut by an ellipsis (`mode`
2726
+ * `'ellipsis-*'`, its `overflow`) or clipped with ink past its box
2727
+ * (`'clip'`). `slot` is where the design is painted (a running head or
2728
+ * folio, a heading design, a part page, a contents part row),
2729
+ * `elementId` the element's id and `text` the whole text it was given.
2730
+ * One per element and page; a running head or folio once per element
2731
+ * and chapter (a chapter title cut on every page of its chapter is one
2732
+ * warning). `sourceStart` / `sourceEnd` when the text mirrors a heading
2733
+ * or a frontmatter field. Found by the layout. */
2734
+ | {
2735
+ kind: 'designTextTruncated';
2736
+ slot: VDTDesignSlotKind;
2737
+ elementId: string;
2738
+ text: string;
2739
+ mode: 'ellipsis-start' | 'ellipsis-end' | 'ellipsis-middle' | 'clip';
2396
2740
  });
2741
+ /** Where a design slot is painted: a running head (`'header'`), a folio
2742
+ * (`'footer'`), a heading design (`'heading'`), a part page or its verso
2743
+ * (`'part'`), a part row of the contents (`'tocRow'`). */
2744
+ export type VDTDesignSlotKind = 'header' | 'footer' | 'heading' | 'part' | 'tocRow';
2397
2745
  /** What a build reports in `VDTDocument.warnings`: a construct the layout
2398
2746
  * had to force ({@link CalloutOverflowWarning}), with the shape it has had
2399
2747
  * since postext 1.4. What the source names wrongly is in
@@ -2501,6 +2849,16 @@ export interface VDTDocument {
2501
2849
  title: string;
2502
2850
  palette?: Record<string, string>;
2503
2851
  }[];
2852
+ /** The number of the last line the document counted (`lineNumbers`,
2853
+ * #621), printed or not; absent when line numbers are off or nothing
2854
+ * was counted. A host laying out a book chapter by chapter hands it to
2855
+ * the next chapter (`continuation.lineNumber`) when lines are counted
2856
+ * through the book. */
2857
+ lastLineNumber?: number;
2858
+ /** Set when the count of {@link lastLineNumber} started again inside
2859
+ * the document (a restart, a poem's `lineStart`): it does not depend on
2860
+ * the number the document inherited. */
2861
+ lineNumberRestarted?: true;
2504
2862
  }
2505
2863
  /** What a design image block records of the resource picture `fileId`
2506
2864
  * (already picked from `resource`): its kind, which decides whether