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
@@ -1 +1 @@
1
- {"version":3,"file":"html-backend.d.ts","sourceRoot":"","sources":["../src/html-backend.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EAoBX,aAAa,EACd,MAAM,OAAO,CAAC;AA+Df,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MA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} from './vdt';
2
+ import { leaderRuleGeometry, lineTextAlign, tableCellFillRects, tableFrameOutline } from './vdt';
3
3
  import { dimensionToPx } from './units';
4
4
  import { documentInkHex, isSingleInkSvgUrl, singleInkColorMatrix } from './svg/singleInk';
5
5
  import { lineInkExtent, lineTrailingTracking } from './lineInk';
@@ -521,8 +521,10 @@ function lineEndHtml(text, x) {
521
521
  * What a copy puts between a line and the one after it in the same block
522
522
  * (`next`), or after a block's last line (#403): nothing after a line that
523
523
  * ends inside a word or on a hyphen or dash (`VDTLine.hyphenated`); a
524
- * newline after a line of verse and after the last line of a paragraph (or
525
- * of a heading, a caption, a cell); between two lines of a block, a space
524
+ * space before the turnover of a line of verse, a blank line after a
525
+ * stanza (#620); a newline after a line of verse, after a line that ends
526
+ * at a forced line break (`VDTLine.hardBreak`, #620) and after the last line
527
+ * of a paragraph (or of a heading, a caption, a cell); between two lines of a block, a space
526
528
  * where the break consumed one — the plain text skips a character between
527
529
  * them (`plainEnd` / `plainStart`) — and nothing where it did not (between
528
530
  * two ideographs). Lines without those offsets, and a block's last line
@@ -533,7 +535,16 @@ function lineEndHtml(text, x) {
533
535
  function lineEndText(line, next) {
534
536
  if (line.hyphenated)
535
537
  return '';
536
- if (line.verse || (!next && line.isLastLine !== false))
538
+ // A line of verse in the line layout (#620): a space before its
539
+ // turnover, a newline after it, a blank line after a stanza.
540
+ if (line.verseLine)
541
+ return next?.verseLine?.turnover ? ' ' : line.verseLine.stanzaEnd ? '\n\n' : '\n';
542
+ // A line of a code listing (#624): nothing before its continuation (a
543
+ // wrapped line reads whole), a newline after each source line.
544
+ if (line.codeLine)
545
+ return next?.codeLine?.continued ? '' : '\n';
546
+ // A forced line break the author typed (#620).
547
+ if (line.verse || line.hardBreak || (!next && line.isLastLine !== false))
537
548
  return '\n';
538
549
  if (next && line.plainEnd !== undefined && next.plainStart !== undefined)
539
550
  return next.plainStart > line.plainEnd ? ' ' : '';
@@ -599,7 +610,7 @@ end = '') {
599
610
  // assumption that its inter-word glue shrinks (TeX glue-setting semantics),
600
611
  // so honor that by compressing the spaces to fit the measure exactly.
601
612
  const useJustify = block.textAlign === 'justify' && spaceCount > 0 &&
602
- ((!line.isLastLine && !line.ragged) || contentWidth > effectiveWidth);
613
+ !line.tabbed && ((!line.isLastLine && !line.ragged) || contentWidth > effectiveWidth);
603
614
  const justifiedSpaceWidth = useJustify
604
615
  ? (effectiveWidth - wordWidth) / spaceCount
605
616
  : 0;
@@ -616,7 +627,7 @@ end = '') {
616
627
  // x are taken in that order; the markup stays in logical order, so the
617
628
  // text copies as written.
618
629
  const at = line.order ? orderedOffsets(segs, line.order, leadingGap, useJustify ? justifiedSpaceWidth : undefined) : undefined;
619
- const cjk = block.tocEntry !== undefined || hasCJK(line.text);
630
+ const cjk = block.tocEntry !== undefined || hasCJK(line.text) || (line.tabbed === true && segs.some((sg) => sg.leader === 'text'));
620
631
  const paintText = (seg, at, inLink = false) => {
621
632
  const font = quoteFontString(pickSegmentFont(seg, block));
622
633
  const color = pickSegmentColor(seg, block);
@@ -636,6 +647,13 @@ end = '') {
636
647
  x += useJustify ? justifiedSpaceWidth : seg.width;
637
648
  continue;
638
649
  }
650
+ if (seg.leader) {
651
+ // A leader (#622): painted, hidden from assistive technology and
652
+ // left out of a selection.
653
+ parts.push(leaderHtml(seg, x, line.baseline - line.bbox.y, block));
654
+ x += seg.width;
655
+ continue;
656
+ }
639
657
  parts.push(links.at(segmentHref(seg)));
640
658
  if (seg.kind === 'math') {
641
659
  parts.push(renderMathSegmentSvg(seg, x, line, block));
@@ -698,19 +716,22 @@ function renderComposedSegments(line, block, targets, rootDir = 'ltr', end = '')
698
716
  // right alignment leave it out (EF-153), as the canvas does.
699
717
  const lineTracking = (block.letterSpacing ?? 0) + (line.letterSpacing ?? 0);
700
718
  const trailing = lineTrailingTracking(line, lineTracking);
719
+ // A line beside a wrapped picture (#627) fills its own span.
720
+ const wrapRoom = line.measure?.wrap ? line.measure.width : undefined;
701
721
  if (!line.segments || line.segments.length === 0) {
702
722
  const plainIndent = line.bbox.x - block.bbox.x;
703
723
  const plainWidth = line.bbox.width - trailing;
724
+ const plainRoom = wrapRoom ?? block.bbox.width - plainIndent;
704
725
  const plainLeft = block.textAlign === 'right'
705
- ? Math.max(0, block.bbox.width - plainIndent - plainWidth)
726
+ ? Math.max(0, plainRoom - plainWidth)
706
727
  : block.textAlign === 'center'
707
- ? Math.max(0, (block.bbox.width - plainIndent - plainWidth) / 2)
728
+ ? Math.max(0, (plainRoom - plainWidth) / 2)
708
729
  : 0;
709
730
  return `<span style="position:absolute;left:${plainLeft.toFixed(3)}px;top:0;white-space:pre;">${esc(line.text)}</span>` + lineEndHtml(end, plainLeft + plainWidth);
710
731
  }
711
732
  // Match canvas justification: stretch inter-word spaces to fill effective width.
712
733
  const lineIndent = line.bbox.x - block.bbox.x;
713
- const effectiveWidth = block.bbox.width - lineIndent;
734
+ const effectiveWidth = wrapRoom ?? block.bbox.width - lineIndent;
714
735
  let wordWidth = 0;
715
736
  let spaceCount = 0;
716
737
  for (const seg of line.segments) {
@@ -729,7 +750,7 @@ function renderComposedSegments(line, block, targets, rootDir = 'ltr', end = '')
729
750
  // assumption that its inter-word glue shrinks (TeX glue-setting semantics),
730
751
  // so honor that by compressing the spaces to fit the measure exactly.
731
752
  const useJustify = block.textAlign === 'justify' && spaceCount > 0 &&
732
- ((!line.isLastLine && !line.ragged) || contentWidth > effectiveWidth);
753
+ !line.tabbed && ((!line.isLastLine && !line.ragged) || contentWidth > effectiveWidth);
733
754
  const justifiedSpaceWidth = useJustify
734
755
  ? (effectiveWidth - wordWidth) / spaceCount
735
756
  : 0;
@@ -767,6 +788,13 @@ function renderComposedSegments(line, block, targets, rootDir = 'ltr', end = '')
767
788
  x += gap;
768
789
  continue;
769
790
  }
791
+ if (seg.leader) {
792
+ // A leader (#622): painted, hidden from assistive technology and
793
+ // left out of a selection.
794
+ parts.push(leaderHtml(seg, x, line.baseline - line.bbox.y, block));
795
+ x += seg.width;
796
+ continue;
797
+ }
770
798
  parts.push(links.at(segmentHref(seg)));
771
799
  if (seg.kind === 'math') {
772
800
  parts.push(renderMathSegmentSvg(seg, x, line, block));
@@ -824,6 +852,28 @@ function renderComposedSegments(line, block, targets, rootDir = 'ltr', end = '')
824
852
  parts.push(lineMarksHtml(line, block.color));
825
853
  return parts.join('');
826
854
  }
855
+ /** A leader (#622, `VDTLineSegment.leader`): a contents row's or a tab
856
+ * stop's dots in the segment's font, or a rule under the baseline
857
+ * (`baselineOffset` from the line top), `aria-hidden` and unselectable,
858
+ * so neither a screen reader nor a copy reads it. */
859
+ function leaderHtml(seg, x, baselineOffset, block) {
860
+ const color = pickSegmentColor(seg, block);
861
+ const hidden = 'aria-hidden="true"';
862
+ const noSelect = 'user-select:none;-webkit-user-select:none;pointer-events:none;';
863
+ if (seg.leader === 'rule') {
864
+ const m = /(\d*\.?\d+)px/.exec(block.fontString);
865
+ const { dy, thickness } = leaderRuleGeometry(m ? Number(m[1]) : 16);
866
+ return `<span ${hidden} style="position:absolute;left:${x.toFixed(3)}px;top:${(baselineOffset + dy - thickness / 2).toFixed(3)}px;`
867
+ + `width:${seg.width.toFixed(3)}px;height:${thickness.toFixed(3)}px;background:${color};${noSelect}"></span>`;
868
+ }
869
+ const font = quoteFontString(pickSegmentFont(seg, block));
870
+ const fontDecl = font !== quoteFontString(block.fontString) ? `font:${font};` : '';
871
+ const colorDecl = color !== block.color ? `color:${color};` : '';
872
+ const pos = `position:absolute;left:${x.toFixed(3)}px;top:0;white-space:pre;${noSelect}`;
873
+ if (fontDecl)
874
+ return `<span ${hidden} style="${pos}"><span style="${fontDecl}line-height:0;${colorDecl}">${esc(seg.text)}</span></span>`;
875
+ return `<span ${hidden} style="${pos}${colorDecl}">${esc(seg.text)}</span>`;
876
+ }
827
877
  /** Inline colour swatch (`:swatch{…}`): a square of `side` px on the line's
828
878
  * baseline (`baselineOffset` from the line top), filled with `fill` when
829
879
  * the colour resolved and outlined in the text colour. */
@@ -927,7 +977,10 @@ function renderBullet(block, rootDir = 'ltr') {
927
977
  }
928
978
  function renderLine(line, block, targets, rootDir = 'ltr', rootLang,
929
979
  /** The block's line after this one (see {@link lineEndText}). */
930
- next) {
980
+ next,
981
+ /** Markup set at the start of the line's box, before its text (a drop
982
+ * cap, #623). */
983
+ lead = '') {
931
984
  const font = quoteFontString(block.fontString);
932
985
  const strikethroughDecl = block.strikethroughText ? 'text-decoration:line-through;' : '';
933
986
  // Tracking — the block's (column balancing, a runt set short) and the
@@ -945,7 +998,24 @@ next) {
945
998
  strikethroughDecl +
946
999
  trackingDecl +
947
1000
  (lineCjkDecl(line) ? CJK_TEXT_DECL : '') +
948
- `">${renderSegments(line, block, targets, rootDir, rootLang, lineEndText(line, next))}</div>`);
1001
+ `">${lead}${renderSegments(line, block, targets, rootDir, rootLang, lineEndText(line, next))}</div>`);
1002
+ }
1003
+ /**
1004
+ * A paragraph's drop cap (#623), as the first runs of its first line's box:
1005
+ * an opening mark hung before it, then the initial, each standing on its
1006
+ * baseline (a box in the line's font shifted down to it, the glyphs in an
1007
+ * inner box of their own face with no line height, as a contents number
1008
+ * sits on its line). In the markup they come right before the line's text,
1009
+ * with nothing between, so a copy and a screen reader read the first word
1010
+ * whole.
1011
+ */
1012
+ function dropCapHtml(cap, line, lineFont) {
1013
+ const run = (text, font, x, baselineY, width, cls) => `<span class="${cls}" style="position:absolute;left:${(x - line.bbox.x).toFixed(3)}px;top:${(baselineY - line.baseline).toFixed(3)}px;` +
1014
+ `width:${width.toFixed(3)}px;height:${line.bbox.height}px;font:${lineFont};color:${cap.color};white-space:pre;` +
1015
+ (hasCJK(text) ? CJK_TEXT_DECL : '') +
1016
+ `"><span style="font:${quoteFontString(font)};line-height:0;">${esc(text)}</span></span>`;
1017
+ const hang = cap.hang ? run(cap.hang.text, cap.hang.fontString, cap.hang.x, cap.hang.baselineY, cap.hang.width, 'pt-dropcap-hang') : '';
1018
+ return hang + run(cap.text, cap.fontString, cap.x, cap.baselineY, cap.width, 'pt-dropcap');
949
1019
  }
950
1020
  // ---------------------------------------------------------------------------
951
1021
  // Vertical text (`VDTPage.flow`)
@@ -1094,7 +1164,7 @@ function renderVerticalLine(line, block, v, targets, next) {
1094
1164
  }
1095
1165
  const contentWidth = line.segments && line.segments.length > 0 ? lineInkExtent(line, 0).width : line.bbox.width;
1096
1166
  const useJustify = block.textAlign === 'justify' && spaceCount > 0
1097
- && ((!line.isLastLine && !line.ragged) || contentWidth > effectiveWidth);
1167
+ && !line.tabbed && ((!line.isLastLine && !line.ragged) || contentWidth > effectiveWidth);
1098
1168
  const justifiedSpaceWidth = useJustify ? (effectiveWidth - wordWidth) / spaceCount : 0;
1099
1169
  const slack = Math.max(0, effectiveWidth - (contentWidth - trailing));
1100
1170
  let x = block.textAlign === 'center' ? slack / 2 : block.textAlign === 'right' ? slack : 0;
@@ -1528,7 +1598,22 @@ function renderResourceTable(rb, bx, by, options) {
1528
1598
  }
1529
1599
  }
1530
1600
  parts.push(rounded ? clipToOutline(fills.join(''), outline(0)) : fills.join(''));
1531
- if (t.borderWidthPx > 0) {
1601
+ if (t.strokes) {
1602
+ // Booktabs (#625): one box per stroke of the layout, centred on its
1603
+ // line (the rules are horizontal; a vertical one is drawn as tall).
1604
+ for (const s of t.strokes) {
1605
+ const x = bx + Math.min(s.x1, s.x2);
1606
+ const y = by + Math.min(s.y1, s.y2);
1607
+ const w = Math.abs(s.x2 - s.x1);
1608
+ const h = Math.abs(s.y2 - s.y1);
1609
+ parts.push(`<div aria-hidden="true" style="position:absolute;` +
1610
+ (h === 0
1611
+ ? `left:${x}px;top:${y - s.widthPx / 2}px;width:${w}px;height:${s.widthPx}px;`
1612
+ : `left:${x - s.widthPx / 2}px;top:${y}px;width:${s.widthPx}px;height:${h}px;`) +
1613
+ `background:${t.borderColor};"></div>`);
1614
+ }
1615
+ }
1616
+ else if (t.borderWidthPx > 0) {
1532
1617
  // Border boxes are inflated by half the stroke so the border centres on
1533
1618
  // the cell edge — adjacent cells overlap exactly, like canvas strokeRect.
1534
1619
  const bw = t.borderWidthPx;
@@ -1877,7 +1962,8 @@ function renderBlockInner(block, options) {
1877
1962
  parts.push(v ? renderVerticalBullet(block, v) : renderBullet(block, options.dir));
1878
1963
  block.lines.forEach((line, i) => {
1879
1964
  const next = block.lines[i + 1];
1880
- parts.push(v ? renderVerticalLine(line, block, v, options.linkTargets, next) : renderLine(line, block, options.linkTargets, options.dir, options.rootLang, next));
1965
+ const lead = i === 0 && block.dropCap && !v ? dropCapHtml(block.dropCap, line, quoteFontString(block.fontString)) : '';
1966
+ parts.push(v ? renderVerticalLine(line, block, v, options.linkTargets, next) : renderLine(line, block, options.linkTargets, options.dir, options.rootLang, next, lead));
1881
1967
  });
1882
1968
  return parts.join('');
1883
1969
  }
@@ -1992,6 +2078,12 @@ verticalRegion, verticalDigits) {
1992
2078
  // Running heads and folios stay on the sheet, horizontal.
1993
2079
  const sheetOptions = options.vertical ? { ...options, vertical: undefined } : options;
1994
2080
  const slotParts = [];
2081
+ // Line numbers (#621): on the sheet, hidden from assistive technology
2082
+ // (each block is an artifact) and left out of a selection, so copied
2083
+ // text runs from line to line without them.
2084
+ if (page.lineNumbers) {
2085
+ slotParts.push(`<div class="pt-line-numbers" style="user-select:none;-webkit-user-select:none;pointer-events:none;">${renderDesignSlot(page.lineNumbers, sheetOptions)}</div>`);
2086
+ }
1995
2087
  if (page.header)
1996
2088
  slotParts.push(renderDesignSlot(page.header, sheetOptions));
1997
2089
  if (page.footer)