postext 1.4.2 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1072) hide show
  1. package/README.md +76 -202
  2. package/dist/__tests__/breakOpportunities.test.d.ts +2 -0
  3. package/dist/__tests__/breakOpportunities.test.d.ts.map +1 -0
  4. package/dist/__tests__/breakOpportunities.test.js +204 -0
  5. package/dist/__tests__/breakOpportunities.test.js.map +1 -0
  6. package/dist/__tests__/bundle.test.js +399 -1
  7. package/dist/__tests__/bundle.test.js.map +1 -1
  8. package/dist/__tests__/bundleLocaleAndBytes.test.d.ts +2 -0
  9. package/dist/__tests__/bundleLocaleAndBytes.test.d.ts.map +1 -0
  10. package/dist/__tests__/bundleLocaleAndBytes.test.js +177 -0
  11. package/dist/__tests__/bundleLocaleAndBytes.test.js.map +1 -0
  12. package/dist/__tests__/colorAlpha.test.d.ts +2 -0
  13. package/dist/__tests__/colorAlpha.test.d.ts.map +1 -0
  14. package/dist/__tests__/colorAlpha.test.js +87 -0
  15. package/dist/__tests__/colorAlpha.test.js.map +1 -0
  16. package/dist/__tests__/columnBalancing.test.js +88 -0
  17. package/dist/__tests__/columnBalancing.test.js.map +1 -1
  18. package/dist/__tests__/columnClip.test.js +20 -0
  19. package/dist/__tests__/columnClip.test.js.map +1 -1
  20. package/dist/__tests__/columnRuleBands.test.d.ts +2 -0
  21. package/dist/__tests__/columnRuleBands.test.d.ts.map +1 -0
  22. package/dist/__tests__/columnRuleBands.test.js +146 -0
  23. package/dist/__tests__/columnRuleBands.test.js.map +1 -0
  24. package/dist/__tests__/contentWarnings.test.d.ts +2 -0
  25. package/dist/__tests__/contentWarnings.test.d.ts.map +1 -0
  26. package/dist/__tests__/contentWarnings.test.js +219 -0
  27. package/dist/__tests__/contentWarnings.test.js.map +1 -0
  28. package/dist/__tests__/continuation.test.js +2 -1
  29. package/dist/__tests__/continuation.test.js.map +1 -1
  30. package/dist/__tests__/createLayout.test.js +18 -1
  31. package/dist/__tests__/createLayout.test.js.map +1 -1
  32. package/dist/__tests__/cropMarks.test.d.ts +2 -0
  33. package/dist/__tests__/cropMarks.test.d.ts.map +1 -0
  34. package/dist/__tests__/cropMarks.test.js +138 -0
  35. package/dist/__tests__/cropMarks.test.js.map +1 -0
  36. package/dist/__tests__/defaults/calloutStyles.test.js +30 -0
  37. package/dist/__tests__/defaults/calloutStyles.test.js.map +1 -1
  38. package/dist/__tests__/defaults/headingsBreakBefore.test.d.ts +2 -0
  39. package/dist/__tests__/defaults/headingsBreakBefore.test.d.ts.map +1 -0
  40. package/dist/__tests__/defaults/headingsBreakBefore.test.js +78 -0
  41. package/dist/__tests__/defaults/headingsBreakBefore.test.js.map +1 -0
  42. package/dist/__tests__/defaults/paragraphStyles.test.js +22 -0
  43. package/dist/__tests__/defaults/paragraphStyles.test.js.map +1 -1
  44. package/dist/__tests__/design/bleedClip.test.d.ts +2 -0
  45. package/dist/__tests__/design/bleedClip.test.d.ts.map +1 -0
  46. package/dist/__tests__/design/bleedClip.test.js +91 -0
  47. package/dist/__tests__/design/bleedClip.test.js.map +1 -0
  48. package/dist/__tests__/design/boxBorderInside.test.d.ts +2 -0
  49. package/dist/__tests__/design/boxBorderInside.test.d.ts.map +1 -0
  50. package/dist/__tests__/design/boxBorderInside.test.js +102 -0
  51. package/dist/__tests__/design/boxBorderInside.test.js.map +1 -0
  52. package/dist/__tests__/design/designLineHeight.test.d.ts +2 -0
  53. package/dist/__tests__/design/designLineHeight.test.d.ts.map +1 -0
  54. package/dist/__tests__/design/designLineHeight.test.js +108 -0
  55. package/dist/__tests__/design/designLineHeight.test.js.map +1 -0
  56. package/dist/__tests__/design/designText.test.d.ts +2 -0
  57. package/dist/__tests__/design/designText.test.d.ts.map +1 -0
  58. package/dist/__tests__/design/designText.test.js +331 -0
  59. package/dist/__tests__/design/designText.test.js.map +1 -0
  60. package/dist/__tests__/design/designTextJustify.test.d.ts +2 -0
  61. package/dist/__tests__/design/designTextJustify.test.d.ts.map +1 -0
  62. package/dist/__tests__/design/designTextJustify.test.js +119 -0
  63. package/dist/__tests__/design/designTextJustify.test.js.map +1 -0
  64. package/dist/__tests__/design/designTextNegativeTracking.test.d.ts +2 -0
  65. package/dist/__tests__/design/designTextNegativeTracking.test.d.ts.map +1 -0
  66. package/dist/__tests__/design/designTextNegativeTracking.test.js +95 -0
  67. package/dist/__tests__/design/designTextNegativeTracking.test.js.map +1 -0
  68. package/dist/__tests__/design/designTextRender.test.d.ts +2 -0
  69. package/dist/__tests__/design/designTextRender.test.d.ts.map +1 -0
  70. package/dist/__tests__/design/designTextRender.test.js +106 -0
  71. package/dist/__tests__/design/designTextRender.test.js.map +1 -0
  72. package/dist/__tests__/design/dropCap.test.d.ts +2 -0
  73. package/dist/__tests__/design/dropCap.test.d.ts.map +1 -0
  74. package/dist/__tests__/design/dropCap.test.js +205 -0
  75. package/dist/__tests__/design/dropCap.test.js.map +1 -0
  76. package/dist/__tests__/design/ellipsis.test.d.ts +2 -0
  77. package/dist/__tests__/design/ellipsis.test.d.ts.map +1 -0
  78. package/dist/__tests__/design/ellipsis.test.js +113 -0
  79. package/dist/__tests__/design/ellipsis.test.js.map +1 -0
  80. package/dist/__tests__/design/headingDesignClip.test.d.ts +2 -0
  81. package/dist/__tests__/design/headingDesignClip.test.d.ts.map +1 -0
  82. package/dist/__tests__/design/headingDesignClip.test.js +60 -0
  83. package/dist/__tests__/design/headingDesignClip.test.js.map +1 -0
  84. package/dist/__tests__/design/headingDesignSideChannel.test.d.ts +2 -0
  85. package/dist/__tests__/design/headingDesignSideChannel.test.d.ts.map +1 -0
  86. package/dist/__tests__/design/headingDesignSideChannel.test.js +187 -0
  87. package/dist/__tests__/design/headingDesignSideChannel.test.js.map +1 -0
  88. package/dist/__tests__/design/inColumnTitleBreak.test.d.ts +2 -0
  89. package/dist/__tests__/design/inColumnTitleBreak.test.d.ts.map +1 -0
  90. package/dist/__tests__/design/inColumnTitleBreak.test.js +60 -0
  91. package/dist/__tests__/design/inColumnTitleBreak.test.js.map +1 -0
  92. package/dist/__tests__/design/openerBottomAnchor.test.d.ts +2 -0
  93. package/dist/__tests__/design/openerBottomAnchor.test.d.ts.map +1 -0
  94. package/dist/__tests__/design/openerBottomAnchor.test.js +106 -0
  95. package/dist/__tests__/design/openerBottomAnchor.test.js.map +1 -0
  96. package/dist/__tests__/design/openerChapterNumber.test.d.ts +2 -0
  97. package/dist/__tests__/design/openerChapterNumber.test.d.ts.map +1 -0
  98. package/dist/__tests__/design/openerChapterNumber.test.js +163 -0
  99. package/dist/__tests__/design/openerChapterNumber.test.js.map +1 -0
  100. package/dist/__tests__/design/openerImageReserve.test.d.ts +2 -0
  101. package/dist/__tests__/design/openerImageReserve.test.d.ts.map +1 -0
  102. package/dist/__tests__/design/openerImageReserve.test.js +83 -0
  103. package/dist/__tests__/design/openerImageReserve.test.js.map +1 -0
  104. package/dist/__tests__/design/openerReserve.test.d.ts +2 -0
  105. package/dist/__tests__/design/openerReserve.test.d.ts.map +1 -0
  106. package/dist/__tests__/design/openerReserve.test.js +147 -0
  107. package/dist/__tests__/design/openerReserve.test.js.map +1 -0
  108. package/dist/__tests__/design/ruleDefaults.test.d.ts +2 -0
  109. package/dist/__tests__/design/ruleDefaults.test.d.ts.map +1 -0
  110. package/dist/__tests__/design/ruleDefaults.test.js +59 -0
  111. package/dist/__tests__/design/ruleDefaults.test.js.map +1 -0
  112. package/dist/__tests__/design/runningHeads.test.js +4 -2
  113. package/dist/__tests__/design/runningHeads.test.js.map +1 -1
  114. package/dist/__tests__/design/titleTextWrapped.test.d.ts +2 -0
  115. package/dist/__tests__/design/titleTextWrapped.test.d.ts.map +1 -0
  116. package/dist/__tests__/design/titleTextWrapped.test.js +258 -0
  117. package/dist/__tests__/design/titleTextWrapped.test.js.map +1 -0
  118. package/dist/__tests__/design/trackingAlignment.test.d.ts +2 -0
  119. package/dist/__tests__/design/trackingAlignment.test.d.ts.map +1 -0
  120. package/dist/__tests__/design/trackingAlignment.test.js +101 -0
  121. package/dist/__tests__/design/trackingAlignment.test.js.map +1 -0
  122. package/dist/__tests__/design/verticalAlignOverflow.test.d.ts +2 -0
  123. package/dist/__tests__/design/verticalAlignOverflow.test.d.ts.map +1 -0
  124. package/dist/__tests__/design/verticalAlignOverflow.test.js +68 -0
  125. package/dist/__tests__/design/verticalAlignOverflow.test.js.map +1 -0
  126. package/dist/__tests__/exports.test.js +24 -0
  127. package/dist/__tests__/exports.test.js.map +1 -1
  128. package/dist/__tests__/fontStack.test.d.ts +2 -0
  129. package/dist/__tests__/fontStack.test.d.ts.map +1 -0
  130. package/dist/__tests__/fontStack.test.js +100 -0
  131. package/dist/__tests__/fontStack.test.js.map +1 -0
  132. package/dist/__tests__/frontmatterValues.test.d.ts +2 -0
  133. package/dist/__tests__/frontmatterValues.test.d.ts.map +1 -0
  134. package/dist/__tests__/frontmatterValues.test.js +119 -0
  135. package/dist/__tests__/frontmatterValues.test.js.map +1 -0
  136. package/dist/__tests__/gradedRunt.test.d.ts +2 -0
  137. package/dist/__tests__/gradedRunt.test.d.ts.map +1 -0
  138. package/dist/__tests__/gradedRunt.test.js +66 -0
  139. package/dist/__tests__/gradedRunt.test.js.map +1 -0
  140. package/dist/__tests__/headingAlign.test.d.ts +2 -0
  141. package/dist/__tests__/headingAlign.test.d.ts.map +1 -0
  142. package/dist/__tests__/headingAlign.test.js +92 -0
  143. package/dist/__tests__/headingAlign.test.js.map +1 -0
  144. package/dist/__tests__/headingInlineMarks.test.d.ts +2 -0
  145. package/dist/__tests__/headingInlineMarks.test.d.ts.map +1 -0
  146. package/dist/__tests__/headingInlineMarks.test.js +126 -0
  147. package/dist/__tests__/headingInlineMarks.test.js.map +1 -0
  148. package/dist/__tests__/headingLetterSpacing.test.d.ts +2 -0
  149. package/dist/__tests__/headingLetterSpacing.test.d.ts.map +1 -0
  150. package/dist/__tests__/headingLetterSpacing.test.js +135 -0
  151. package/dist/__tests__/headingLetterSpacing.test.js.map +1 -0
  152. package/dist/__tests__/headingNumberPlaceholders.test.d.ts +2 -0
  153. package/dist/__tests__/headingNumberPlaceholders.test.d.ts.map +1 -0
  154. package/dist/__tests__/headingNumberPlaceholders.test.js +104 -0
  155. package/dist/__tests__/headingNumberPlaceholders.test.js.map +1 -0
  156. package/dist/__tests__/headingNumberingStyles.test.d.ts +2 -0
  157. package/dist/__tests__/headingNumberingStyles.test.d.ts.map +1 -0
  158. package/dist/__tests__/headingNumberingStyles.test.js +151 -0
  159. package/dist/__tests__/headingNumberingStyles.test.js.map +1 -0
  160. package/dist/__tests__/headingSourceTitle.test.d.ts +2 -0
  161. package/dist/__tests__/headingSourceTitle.test.d.ts.map +1 -0
  162. package/dist/__tests__/headingSourceTitle.test.js +35 -0
  163. package/dist/__tests__/headingSourceTitle.test.js.map +1 -0
  164. package/dist/__tests__/headingStyleBreakAfterPagebreak.test.d.ts +2 -0
  165. package/dist/__tests__/headingStyleBreakAfterPagebreak.test.d.ts.map +1 -0
  166. package/dist/__tests__/headingStyleBreakAfterPagebreak.test.js +52 -0
  167. package/dist/__tests__/headingStyleBreakAfterPagebreak.test.js.map +1 -0
  168. package/dist/__tests__/hiddenHeadings.test.d.ts +2 -0
  169. package/dist/__tests__/hiddenHeadings.test.d.ts.map +1 -0
  170. package/dist/__tests__/hiddenHeadings.test.js +137 -0
  171. package/dist/__tests__/hiddenHeadings.test.js.map +1 -0
  172. package/dist/__tests__/htmlHostReset.test.d.ts +2 -0
  173. package/dist/__tests__/htmlHostReset.test.d.ts.map +1 -0
  174. package/dist/__tests__/htmlHostReset.test.js +63 -0
  175. package/dist/__tests__/htmlHostReset.test.js.map +1 -0
  176. package/dist/__tests__/hyphenationLocale.test.d.ts +2 -0
  177. package/dist/__tests__/hyphenationLocale.test.d.ts.map +1 -0
  178. package/dist/__tests__/hyphenationLocale.test.js +143 -0
  179. package/dist/__tests__/hyphenationLocale.test.js.map +1 -0
  180. package/dist/__tests__/justifyTracking.test.d.ts +2 -0
  181. package/dist/__tests__/justifyTracking.test.d.ts.map +1 -0
  182. package/dist/__tests__/justifyTracking.test.js +217 -0
  183. package/dist/__tests__/justifyTracking.test.js.map +1 -0
  184. package/dist/__tests__/layoutWorkerClient.test.d.ts +2 -0
  185. package/dist/__tests__/layoutWorkerClient.test.d.ts.map +1 -0
  186. package/dist/__tests__/layoutWorkerClient.test.js +140 -0
  187. package/dist/__tests__/layoutWorkerClient.test.js.map +1 -0
  188. package/dist/__tests__/links.test.d.ts +2 -0
  189. package/dist/__tests__/links.test.d.ts.map +1 -0
  190. package/dist/__tests__/links.test.js +227 -0
  191. package/dist/__tests__/links.test.js.map +1 -0
  192. package/dist/__tests__/localisedStrings.test.d.ts +2 -0
  193. package/dist/__tests__/localisedStrings.test.d.ts.map +1 -0
  194. package/dist/__tests__/localisedStrings.test.js +118 -0
  195. package/dist/__tests__/localisedStrings.test.js.map +1 -0
  196. package/dist/__tests__/looseLines.test.d.ts +2 -0
  197. package/dist/__tests__/looseLines.test.d.ts.map +1 -0
  198. package/dist/__tests__/looseLines.test.js +72 -0
  199. package/dist/__tests__/looseLines.test.js.map +1 -0
  200. package/dist/__tests__/mainEntryReact.test.d.ts +2 -0
  201. package/dist/__tests__/mainEntryReact.test.d.ts.map +1 -0
  202. package/dist/__tests__/mainEntryReact.test.js +13 -0
  203. package/dist/__tests__/mainEntryReact.test.js.map +1 -0
  204. package/dist/__tests__/mathBundle.test.d.ts +2 -0
  205. package/dist/__tests__/mathBundle.test.d.ts.map +1 -0
  206. package/dist/__tests__/mathBundle.test.js +80 -0
  207. package/dist/__tests__/mathBundle.test.js.map +1 -0
  208. package/dist/__tests__/mathEngine.test.d.ts +2 -0
  209. package/dist/__tests__/mathEngine.test.d.ts.map +1 -0
  210. package/dist/__tests__/mathEngine.test.js +69 -0
  211. package/dist/__tests__/mathEngine.test.js.map +1 -0
  212. package/dist/__tests__/mathEngineInit.test.d.ts +2 -0
  213. package/dist/__tests__/mathEngineInit.test.d.ts.map +1 -0
  214. package/dist/__tests__/mathEngineInit.test.js +33 -0
  215. package/dist/__tests__/mathEngineInit.test.js.map +1 -0
  216. package/dist/__tests__/mathSize.test.d.ts +2 -0
  217. package/dist/__tests__/mathSize.test.d.ts.map +1 -0
  218. package/dist/__tests__/mathSize.test.js +168 -0
  219. package/dist/__tests__/mathSize.test.js.map +1 -0
  220. package/dist/__tests__/mathSizeMigration.test.d.ts +2 -0
  221. package/dist/__tests__/mathSizeMigration.test.d.ts.map +1 -0
  222. package/dist/__tests__/mathSizeMigration.test.js +188 -0
  223. package/dist/__tests__/mathSizeMigration.test.js.map +1 -0
  224. package/dist/__tests__/measureCache.test.js +148 -4
  225. package/dist/__tests__/measureCache.test.js.map +1 -1
  226. package/dist/__tests__/measureCacheKeepBreaks.test.d.ts +2 -0
  227. package/dist/__tests__/measureCacheKeepBreaks.test.d.ts.map +1 -0
  228. package/dist/__tests__/measureCacheKeepBreaks.test.js +59 -0
  229. package/dist/__tests__/measureCacheKeepBreaks.test.js.map +1 -0
  230. package/dist/__tests__/noBreakSpaces.test.d.ts +2 -0
  231. package/dist/__tests__/noBreakSpaces.test.d.ts.map +1 -0
  232. package/dist/__tests__/noBreakSpaces.test.js +208 -0
  233. package/dist/__tests__/noBreakSpaces.test.js.map +1 -0
  234. package/dist/__tests__/numberFormats.test.d.ts +2 -0
  235. package/dist/__tests__/numberFormats.test.d.ts.map +1 -0
  236. package/dist/__tests__/numberFormats.test.js +142 -0
  237. package/dist/__tests__/numberFormats.test.js.map +1 -0
  238. package/dist/__tests__/paletteEverywhere.test.d.ts +2 -0
  239. package/dist/__tests__/paletteEverywhere.test.d.ts.map +1 -0
  240. package/dist/__tests__/paletteEverywhere.test.js +228 -0
  241. package/dist/__tests__/paletteEverywhere.test.js.map +1 -0
  242. package/dist/__tests__/paragraphStyleIndent.test.d.ts +2 -0
  243. package/dist/__tests__/paragraphStyleIndent.test.d.ts.map +1 -0
  244. package/dist/__tests__/paragraphStyleIndent.test.js +91 -0
  245. package/dist/__tests__/paragraphStyleIndent.test.js.map +1 -0
  246. package/dist/__tests__/parse/attrQuoting.test.d.ts +2 -0
  247. package/dist/__tests__/parse/attrQuoting.test.d.ts.map +1 -0
  248. package/dist/__tests__/parse/attrQuoting.test.js +87 -0
  249. package/dist/__tests__/parse/attrQuoting.test.js.map +1 -0
  250. package/dist/__tests__/parse/codeSpans.test.d.ts +2 -0
  251. package/dist/__tests__/parse/codeSpans.test.d.ts.map +1 -0
  252. package/dist/__tests__/parse/codeSpans.test.js +31 -0
  253. package/dist/__tests__/parse/codeSpans.test.js.map +1 -0
  254. package/dist/__tests__/parse/intrawordUnderscore.test.d.ts +2 -0
  255. package/dist/__tests__/parse/intrawordUnderscore.test.d.ts.map +1 -0
  256. package/dist/__tests__/parse/intrawordUnderscore.test.js +69 -0
  257. package/dist/__tests__/parse/intrawordUnderscore.test.js.map +1 -0
  258. package/dist/__tests__/parse/scripts.test.js +4 -1
  259. package/dist/__tests__/parse/scripts.test.js.map +1 -1
  260. package/dist/__tests__/parts.test.js +103 -0
  261. package/dist/__tests__/parts.test.js.map +1 -1
  262. package/dist/__tests__/pipeline/balancingRecord.test.d.ts +2 -0
  263. package/dist/__tests__/pipeline/balancingRecord.test.d.ts.map +1 -0
  264. package/dist/__tests__/pipeline/balancingRecord.test.js +176 -0
  265. package/dist/__tests__/pipeline/balancingRecord.test.js.map +1 -0
  266. package/dist/__tests__/pipeline/blockquoteStyle.test.d.ts +2 -0
  267. package/dist/__tests__/pipeline/blockquoteStyle.test.d.ts.map +1 -0
  268. package/dist/__tests__/pipeline/blockquoteStyle.test.js +99 -0
  269. package/dist/__tests__/pipeline/blockquoteStyle.test.js.map +1 -0
  270. package/dist/__tests__/pipeline/calloutContinuation.test.d.ts +2 -0
  271. package/dist/__tests__/pipeline/calloutContinuation.test.d.ts.map +1 -0
  272. package/dist/__tests__/pipeline/calloutContinuation.test.js +133 -0
  273. package/dist/__tests__/pipeline/calloutContinuation.test.js.map +1 -0
  274. package/dist/__tests__/pipeline/calloutContinuationInset.test.d.ts +2 -0
  275. package/dist/__tests__/pipeline/calloutContinuationInset.test.d.ts.map +1 -0
  276. package/dist/__tests__/pipeline/calloutContinuationInset.test.js +116 -0
  277. package/dist/__tests__/pipeline/calloutContinuationInset.test.js.map +1 -0
  278. package/dist/__tests__/pipeline/calloutCornerWideIcon.test.d.ts +2 -0
  279. package/dist/__tests__/pipeline/calloutCornerWideIcon.test.d.ts.map +1 -0
  280. package/dist/__tests__/pipeline/calloutCornerWideIcon.test.js +69 -0
  281. package/dist/__tests__/pipeline/calloutCornerWideIcon.test.js.map +1 -0
  282. package/dist/__tests__/pipeline/calloutFloatMargins.test.d.ts +2 -0
  283. package/dist/__tests__/pipeline/calloutFloatMargins.test.d.ts.map +1 -0
  284. package/dist/__tests__/pipeline/calloutFloatMargins.test.js +104 -0
  285. package/dist/__tests__/pipeline/calloutFloatMargins.test.js.map +1 -0
  286. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.d.ts +2 -0
  287. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.d.ts.map +1 -0
  288. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +148 -0
  289. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js.map +1 -0
  290. package/dist/__tests__/pipeline/calloutListColor.test.d.ts +2 -0
  291. package/dist/__tests__/pipeline/calloutListColor.test.d.ts.map +1 -0
  292. package/dist/__tests__/pipeline/calloutListColor.test.js +86 -0
  293. package/dist/__tests__/pipeline/calloutListColor.test.js.map +1 -0
  294. package/dist/__tests__/pipeline/calloutRaggedLines.test.d.ts +2 -0
  295. package/dist/__tests__/pipeline/calloutRaggedLines.test.d.ts.map +1 -0
  296. package/dist/__tests__/pipeline/calloutRaggedLines.test.js +65 -0
  297. package/dist/__tests__/pipeline/calloutRaggedLines.test.js.map +1 -0
  298. package/dist/__tests__/pipeline/calloutRuntTracking.test.d.ts +2 -0
  299. package/dist/__tests__/pipeline/calloutRuntTracking.test.d.ts.map +1 -0
  300. package/dist/__tests__/pipeline/calloutRuntTracking.test.js +84 -0
  301. package/dist/__tests__/pipeline/calloutRuntTracking.test.js.map +1 -0
  302. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.d.ts +2 -0
  303. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.d.ts.map +1 -0
  304. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +187 -0
  305. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js.map +1 -0
  306. package/dist/__tests__/pipeline/calloutStripeRadius.test.d.ts +2 -0
  307. package/dist/__tests__/pipeline/calloutStripeRadius.test.d.ts.map +1 -0
  308. package/dist/__tests__/pipeline/calloutStripeRadius.test.js +127 -0
  309. package/dist/__tests__/pipeline/calloutStripeRadius.test.js.map +1 -0
  310. package/dist/__tests__/pipeline/calloutTitleLineHeight.test.d.ts +2 -0
  311. package/dist/__tests__/pipeline/calloutTitleLineHeight.test.d.ts.map +1 -0
  312. package/dist/__tests__/pipeline/calloutTitleLineHeight.test.js +81 -0
  313. package/dist/__tests__/pipeline/calloutTitleLineHeight.test.js.map +1 -0
  314. package/dist/__tests__/pipeline/calloutTypography.test.d.ts +2 -0
  315. package/dist/__tests__/pipeline/calloutTypography.test.d.ts.map +1 -0
  316. package/dist/__tests__/pipeline/calloutTypography.test.js +97 -0
  317. package/dist/__tests__/pipeline/calloutTypography.test.js.map +1 -0
  318. package/dist/__tests__/pipeline/capUnderHeadFloats.test.d.ts +2 -0
  319. package/dist/__tests__/pipeline/capUnderHeadFloats.test.d.ts.map +1 -0
  320. package/dist/__tests__/pipeline/capUnderHeadFloats.test.js +68 -0
  321. package/dist/__tests__/pipeline/capUnderHeadFloats.test.js.map +1 -0
  322. package/dist/__tests__/pipeline/captionAlign.test.d.ts +2 -0
  323. package/dist/__tests__/pipeline/captionAlign.test.d.ts.map +1 -0
  324. package/dist/__tests__/pipeline/captionAlign.test.js +99 -0
  325. package/dist/__tests__/pipeline/captionAlign.test.js.map +1 -0
  326. package/dist/__tests__/pipeline/chipPalette.test.d.ts +2 -0
  327. package/dist/__tests__/pipeline/chipPalette.test.d.ts.map +1 -0
  328. package/dist/__tests__/pipeline/chipPalette.test.js +80 -0
  329. package/dist/__tests__/pipeline/chipPalette.test.js.map +1 -0
  330. package/dist/__tests__/pipeline/chipVerticalPadding.test.d.ts +2 -0
  331. package/dist/__tests__/pipeline/chipVerticalPadding.test.d.ts.map +1 -0
  332. package/dist/__tests__/pipeline/chipVerticalPadding.test.js +66 -0
  333. package/dist/__tests__/pipeline/chipVerticalPadding.test.js.map +1 -0
  334. package/dist/__tests__/pipeline/chips.test.js +32 -0
  335. package/dist/__tests__/pipeline/chips.test.js.map +1 -1
  336. package/dist/__tests__/pipeline/closingBoxLever.test.d.ts +2 -0
  337. package/dist/__tests__/pipeline/closingBoxLever.test.d.ts.map +1 -0
  338. package/dist/__tests__/pipeline/closingBoxLever.test.js +68 -0
  339. package/dist/__tests__/pipeline/closingBoxLever.test.js.map +1 -0
  340. package/dist/__tests__/pipeline/closingBoxOrder.test.d.ts +2 -0
  341. package/dist/__tests__/pipeline/closingBoxOrder.test.d.ts.map +1 -0
  342. package/dist/__tests__/pipeline/closingBoxOrder.test.js +87 -0
  343. package/dist/__tests__/pipeline/closingBoxOrder.test.js.map +1 -0
  344. package/dist/__tests__/pipeline/closingPageAfterFloat.test.d.ts +2 -0
  345. package/dist/__tests__/pipeline/closingPageAfterFloat.test.d.ts.map +1 -0
  346. package/dist/__tests__/pipeline/closingPageAfterFloat.test.js +159 -0
  347. package/dist/__tests__/pipeline/closingPageAfterFloat.test.js.map +1 -0
  348. package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.d.ts +2 -0
  349. package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.d.ts.map +1 -0
  350. package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.js +90 -0
  351. package/dist/__tests__/pipeline/closingPageAfterFloatPage.test.js.map +1 -0
  352. package/dist/__tests__/pipeline/colonBalancing.test.js +19 -15
  353. package/dist/__tests__/pipeline/colonBalancing.test.js.map +1 -1
  354. package/dist/__tests__/pipeline/colonListRoom.test.d.ts +2 -0
  355. package/dist/__tests__/pipeline/colonListRoom.test.d.ts.map +1 -0
  356. package/dist/__tests__/pipeline/colonListRoom.test.js +127 -0
  357. package/dist/__tests__/pipeline/colonListRoom.test.js.map +1 -0
  358. package/dist/__tests__/pipeline/columnWidthRebreak.test.d.ts +2 -0
  359. package/dist/__tests__/pipeline/columnWidthRebreak.test.d.ts.map +1 -0
  360. package/dist/__tests__/pipeline/columnWidthRebreak.test.js +124 -0
  361. package/dist/__tests__/pipeline/columnWidthRebreak.test.js.map +1 -0
  362. package/dist/__tests__/pipeline/compoundBreaks.test.d.ts +2 -0
  363. package/dist/__tests__/pipeline/compoundBreaks.test.d.ts.map +1 -0
  364. package/dist/__tests__/pipeline/compoundBreaks.test.js +368 -0
  365. package/dist/__tests__/pipeline/compoundBreaks.test.js.map +1 -0
  366. package/dist/__tests__/pipeline/continuationUnderFloat.test.d.ts +2 -0
  367. package/dist/__tests__/pipeline/continuationUnderFloat.test.d.ts.map +1 -0
  368. package/dist/__tests__/pipeline/continuationUnderFloat.test.js +64 -0
  369. package/dist/__tests__/pipeline/continuationUnderFloat.test.js.map +1 -0
  370. package/dist/__tests__/pipeline/crossChapterRef.test.d.ts +2 -0
  371. package/dist/__tests__/pipeline/crossChapterRef.test.d.ts.map +1 -0
  372. package/dist/__tests__/pipeline/crossChapterRef.test.js +124 -0
  373. package/dist/__tests__/pipeline/crossChapterRef.test.js.map +1 -0
  374. package/dist/__tests__/pipeline/dashBreaks.test.d.ts +2 -0
  375. package/dist/__tests__/pipeline/dashBreaks.test.d.ts.map +1 -0
  376. package/dist/__tests__/pipeline/dashBreaks.test.js +358 -0
  377. package/dist/__tests__/pipeline/dashBreaks.test.js.map +1 -0
  378. package/dist/__tests__/pipeline/defaultOpenerPaint.test.d.ts +2 -0
  379. package/dist/__tests__/pipeline/defaultOpenerPaint.test.d.ts.map +1 -0
  380. package/dist/__tests__/pipeline/defaultOpenerPaint.test.js +128 -0
  381. package/dist/__tests__/pipeline/defaultOpenerPaint.test.js.map +1 -0
  382. package/dist/__tests__/pipeline/displayMathFlow.test.d.ts +2 -0
  383. package/dist/__tests__/pipeline/displayMathFlow.test.d.ts.map +1 -0
  384. package/dist/__tests__/pipeline/displayMathFlow.test.js +156 -0
  385. package/dist/__tests__/pipeline/displayMathFlow.test.js.map +1 -0
  386. package/dist/__tests__/pipeline/emptyResourceTemplate.test.d.ts +2 -0
  387. package/dist/__tests__/pipeline/emptyResourceTemplate.test.d.ts.map +1 -0
  388. package/dist/__tests__/pipeline/emptyResourceTemplate.test.js +66 -0
  389. package/dist/__tests__/pipeline/emptyResourceTemplate.test.js.map +1 -0
  390. package/dist/__tests__/pipeline/figureBodyAlign.test.d.ts +2 -0
  391. package/dist/__tests__/pipeline/figureBodyAlign.test.d.ts.map +1 -0
  392. package/dist/__tests__/pipeline/figureBodyAlign.test.js +92 -0
  393. package/dist/__tests__/pipeline/figureBodyAlign.test.js.map +1 -0
  394. package/dist/__tests__/pipeline/floatAfterCitingLine.test.d.ts +2 -0
  395. package/dist/__tests__/pipeline/floatAfterCitingLine.test.d.ts.map +1 -0
  396. package/dist/__tests__/pipeline/floatAfterCitingLine.test.js +217 -0
  397. package/dist/__tests__/pipeline/floatAfterCitingLine.test.js.map +1 -0
  398. package/dist/__tests__/pipeline/floatFirstSlot.test.js +15 -0
  399. package/dist/__tests__/pipeline/floatFirstSlot.test.js.map +1 -1
  400. package/dist/__tests__/pipeline/floatOverInlineResource.test.d.ts +2 -0
  401. package/dist/__tests__/pipeline/floatOverInlineResource.test.d.ts.map +1 -0
  402. package/dist/__tests__/pipeline/floatOverInlineResource.test.js +75 -0
  403. package/dist/__tests__/pipeline/floatOverInlineResource.test.js.map +1 -0
  404. package/dist/__tests__/pipeline/floatPlacementRules.test.d.ts +2 -0
  405. package/dist/__tests__/pipeline/floatPlacementRules.test.d.ts.map +1 -0
  406. package/dist/__tests__/pipeline/floatPlacementRules.test.js +177 -0
  407. package/dist/__tests__/pipeline/floatPlacementRules.test.js.map +1 -0
  408. package/dist/__tests__/pipeline/floatSlots.test.js +35 -1
  409. package/dist/__tests__/pipeline/floatSlots.test.js.map +1 -1
  410. package/dist/__tests__/pipeline/hardHyphenBreaks.test.d.ts +2 -0
  411. package/dist/__tests__/pipeline/hardHyphenBreaks.test.d.ts.map +1 -0
  412. package/dist/__tests__/pipeline/hardHyphenBreaks.test.js +165 -0
  413. package/dist/__tests__/pipeline/hardHyphenBreaks.test.js.map +1 -0
  414. package/dist/__tests__/pipeline/headingDesignCuts.test.d.ts +2 -0
  415. package/dist/__tests__/pipeline/headingDesignCuts.test.d.ts.map +1 -0
  416. package/dist/__tests__/pipeline/headingDesignCuts.test.js +96 -0
  417. package/dist/__tests__/pipeline/headingDesignCuts.test.js.map +1 -0
  418. package/dist/__tests__/pipeline/headingSnapPerLevel.test.d.ts +2 -0
  419. package/dist/__tests__/pipeline/headingSnapPerLevel.test.d.ts.map +1 -0
  420. package/dist/__tests__/pipeline/headingSnapPerLevel.test.js +97 -0
  421. package/dist/__tests__/pipeline/headingSnapPerLevel.test.js.map +1 -0
  422. package/dist/__tests__/pipeline/headingSplitOrphans.test.d.ts +2 -0
  423. package/dist/__tests__/pipeline/headingSplitOrphans.test.d.ts.map +1 -0
  424. package/dist/__tests__/pipeline/headingSplitOrphans.test.js +134 -0
  425. package/dist/__tests__/pipeline/headingSplitOrphans.test.js.map +1 -0
  426. package/dist/__tests__/pipeline/hyphenAcrossColumns.test.d.ts +2 -0
  427. package/dist/__tests__/pipeline/hyphenAcrossColumns.test.d.ts.map +1 -0
  428. package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js +232 -0
  429. package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js.map +1 -0
  430. package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.d.ts +2 -0
  431. package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.d.ts.map +1 -0
  432. package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.js +93 -0
  433. package/dist/__tests__/pipeline/indentAfterOutOfFlow.test.js.map +1 -0
  434. package/dist/__tests__/pipeline/inlineFigureSpace.test.d.ts +2 -0
  435. package/dist/__tests__/pipeline/inlineFigureSpace.test.d.ts.map +1 -0
  436. package/dist/__tests__/pipeline/inlineFigureSpace.test.js +195 -0
  437. package/dist/__tests__/pipeline/inlineFigureSpace.test.js.map +1 -0
  438. package/dist/__tests__/pipeline/lineSourceEdges.test.d.ts +2 -0
  439. package/dist/__tests__/pipeline/lineSourceEdges.test.d.ts.map +1 -0
  440. package/dist/__tests__/pipeline/lineSourceEdges.test.js +143 -0
  441. package/dist/__tests__/pipeline/lineSourceEdges.test.js.map +1 -0
  442. package/dist/__tests__/pipeline/lineSourceRanges.test.d.ts +2 -0
  443. package/dist/__tests__/pipeline/lineSourceRanges.test.d.ts.map +1 -0
  444. package/dist/__tests__/pipeline/lineSourceRanges.test.js +96 -0
  445. package/dist/__tests__/pipeline/lineSourceRanges.test.js.map +1 -0
  446. package/dist/__tests__/pipeline/listTopSnap.test.d.ts +2 -0
  447. package/dist/__tests__/pipeline/listTopSnap.test.d.ts.map +1 -0
  448. package/dist/__tests__/pipeline/listTopSnap.test.js +90 -0
  449. package/dist/__tests__/pipeline/listTopSnap.test.js.map +1 -0
  450. package/dist/__tests__/pipeline/looseParagraphLimit.test.d.ts +2 -0
  451. package/dist/__tests__/pipeline/looseParagraphLimit.test.d.ts.map +1 -0
  452. package/dist/__tests__/pipeline/looseParagraphLimit.test.js +63 -0
  453. package/dist/__tests__/pipeline/looseParagraphLimit.test.js.map +1 -0
  454. package/dist/__tests__/pipeline/nestedListSpacing.test.d.ts +2 -0
  455. package/dist/__tests__/pipeline/nestedListSpacing.test.d.ts.map +1 -0
  456. package/dist/__tests__/pipeline/nestedListSpacing.test.js +62 -0
  457. package/dist/__tests__/pipeline/nestedListSpacing.test.js.map +1 -0
  458. package/dist/__tests__/pipeline/openerColumnStarts.test.d.ts +2 -0
  459. package/dist/__tests__/pipeline/openerColumnStarts.test.d.ts.map +1 -0
  460. package/dist/__tests__/pipeline/openerColumnStarts.test.js +189 -0
  461. package/dist/__tests__/pipeline/openerColumnStarts.test.js.map +1 -0
  462. package/dist/__tests__/pipeline/openerFillsPage.test.d.ts +2 -0
  463. package/dist/__tests__/pipeline/openerFillsPage.test.d.ts.map +1 -0
  464. package/dist/__tests__/pipeline/openerFillsPage.test.js +133 -0
  465. package/dist/__tests__/pipeline/openerFillsPage.test.js.map +1 -0
  466. package/dist/__tests__/pipeline/openerTallerThanColumn.test.d.ts +2 -0
  467. package/dist/__tests__/pipeline/openerTallerThanColumn.test.d.ts.map +1 -0
  468. package/dist/__tests__/pipeline/openerTallerThanColumn.test.js +139 -0
  469. package/dist/__tests__/pipeline/openerTallerThanColumn.test.js.map +1 -0
  470. package/dist/__tests__/pipeline/orderedNumberWidth.test.d.ts +2 -0
  471. package/dist/__tests__/pipeline/orderedNumberWidth.test.d.ts.map +1 -0
  472. package/dist/__tests__/pipeline/orderedNumberWidth.test.js +69 -0
  473. package/dist/__tests__/pipeline/orderedNumberWidth.test.js.map +1 -0
  474. package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.d.ts +2 -0
  475. package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.d.ts.map +1 -0
  476. package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.js +74 -0
  477. package/dist/__tests__/pipeline/pageSpanHeadingWidth.test.js.map +1 -0
  478. package/dist/__tests__/pipeline/paragraphContainerTail.test.d.ts +2 -0
  479. package/dist/__tests__/pipeline/paragraphContainerTail.test.d.ts.map +1 -0
  480. package/dist/__tests__/pipeline/paragraphContainerTail.test.js +218 -0
  481. package/dist/__tests__/pipeline/paragraphContainerTail.test.js.map +1 -0
  482. package/dist/__tests__/pipeline/paragraphStyleFaces.test.d.ts +2 -0
  483. package/dist/__tests__/pipeline/paragraphStyleFaces.test.d.ts.map +1 -0
  484. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +121 -0
  485. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -0
  486. package/dist/__tests__/pipeline/paragraphStyles.test.js +85 -0
  487. package/dist/__tests__/pipeline/paragraphStyles.test.js.map +1 -1
  488. package/dist/__tests__/pipeline/raggedOptimal.test.d.ts +2 -0
  489. package/dist/__tests__/pipeline/raggedOptimal.test.d.ts.map +1 -0
  490. package/dist/__tests__/pipeline/raggedOptimal.test.js +231 -0
  491. package/dist/__tests__/pipeline/raggedOptimal.test.js.map +1 -0
  492. package/dist/__tests__/pipeline/resolvedPaletteCopy.test.d.ts +2 -0
  493. package/dist/__tests__/pipeline/resolvedPaletteCopy.test.d.ts.map +1 -0
  494. package/dist/__tests__/pipeline/resolvedPaletteCopy.test.js +68 -0
  495. package/dist/__tests__/pipeline/resolvedPaletteCopy.test.js.map +1 -0
  496. package/dist/__tests__/pipeline/resourceNumberingRules.test.d.ts +2 -0
  497. package/dist/__tests__/pipeline/resourceNumberingRules.test.d.ts.map +1 -0
  498. package/dist/__tests__/pipeline/resourceNumberingRules.test.js +103 -0
  499. package/dist/__tests__/pipeline/resourceNumberingRules.test.js.map +1 -0
  500. package/dist/__tests__/pipeline/sectionPageOwnership.test.d.ts +2 -0
  501. package/dist/__tests__/pipeline/sectionPageOwnership.test.d.ts.map +1 -0
  502. package/dist/__tests__/pipeline/sectionPageOwnership.test.js +89 -0
  503. package/dist/__tests__/pipeline/sectionPageOwnership.test.js.map +1 -0
  504. package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.d.ts +2 -0
  505. package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.d.ts.map +1 -0
  506. package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.js +278 -0
  507. package/dist/__tests__/pipeline/sectionPaletteSharedBase.test.js.map +1 -0
  508. package/dist/__tests__/pipeline/sectionPaletteTables.test.d.ts +2 -0
  509. package/dist/__tests__/pipeline/sectionPaletteTables.test.d.ts.map +1 -0
  510. package/dist/__tests__/pipeline/sectionPaletteTables.test.js +104 -0
  511. package/dist/__tests__/pipeline/sectionPaletteTables.test.js.map +1 -0
  512. package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.d.ts +2 -0
  513. package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.d.ts.map +1 -0
  514. package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.js +176 -0
  515. package/dist/__tests__/pipeline/sideBoxAtColumnEnd.test.js.map +1 -0
  516. package/dist/__tests__/pipeline/sideColumnPercent.test.d.ts +2 -0
  517. package/dist/__tests__/pipeline/sideColumnPercent.test.d.ts.map +1 -0
  518. package/dist/__tests__/pipeline/sideColumnPercent.test.js +114 -0
  519. package/dist/__tests__/pipeline/sideColumnPercent.test.js.map +1 -0
  520. package/dist/__tests__/pipeline/snippetDollarEscape.test.d.ts +2 -0
  521. package/dist/__tests__/pipeline/snippetDollarEscape.test.d.ts.map +1 -0
  522. package/dist/__tests__/pipeline/snippetDollarEscape.test.js +112 -0
  523. package/dist/__tests__/pipeline/snippetDollarEscape.test.js.map +1 -0
  524. package/dist/__tests__/pipeline/snippetLineBreaks.test.d.ts +2 -0
  525. package/dist/__tests__/pipeline/snippetLineBreaks.test.d.ts.map +1 -0
  526. package/dist/__tests__/pipeline/snippetLineBreaks.test.js +178 -0
  527. package/dist/__tests__/pipeline/snippetLineBreaks.test.js.map +1 -0
  528. package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.d.ts +2 -0
  529. package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.d.ts.map +1 -0
  530. package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.js +90 -0
  531. package/dist/__tests__/pipeline/spanCutUnderColumnFloat.test.js.map +1 -0
  532. package/dist/__tests__/pipeline/splitBoxCappedBand.test.d.ts +2 -0
  533. package/dist/__tests__/pipeline/splitBoxCappedBand.test.d.ts.map +1 -0
  534. package/dist/__tests__/pipeline/splitBoxCappedBand.test.js +64 -0
  535. package/dist/__tests__/pipeline/splitBoxCappedBand.test.js.map +1 -0
  536. package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.d.ts +2 -0
  537. package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.d.ts.map +1 -0
  538. package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.js +97 -0
  539. package/dist/__tests__/pipeline/tableCellNoBreakSpaces.test.js.map +1 -0
  540. package/dist/__tests__/pipeline/tableHeaderTracking.test.d.ts +2 -0
  541. package/dist/__tests__/pipeline/tableHeaderTracking.test.d.ts.map +1 -0
  542. package/dist/__tests__/pipeline/tableHeaderTracking.test.js +139 -0
  543. package/dist/__tests__/pipeline/tableHeaderTracking.test.js.map +1 -0
  544. package/dist/__tests__/pipeline/tableSplitTextRoom.test.d.ts +2 -0
  545. package/dist/__tests__/pipeline/tableSplitTextRoom.test.d.ts.map +1 -0
  546. package/dist/__tests__/pipeline/tableSplitTextRoom.test.js +90 -0
  547. package/dist/__tests__/pipeline/tableSplitTextRoom.test.js.map +1 -0
  548. package/dist/__tests__/pipeline/tableStyles.test.js +94 -1
  549. package/dist/__tests__/pipeline/tableStyles.test.js.map +1 -1
  550. package/dist/__tests__/pipeline/tallParagraphShortColumn.test.d.ts +2 -0
  551. package/dist/__tests__/pipeline/tallParagraphShortColumn.test.d.ts.map +1 -0
  552. package/dist/__tests__/pipeline/tallParagraphShortColumn.test.js +79 -0
  553. package/dist/__tests__/pipeline/tallParagraphShortColumn.test.js.map +1 -0
  554. package/dist/__tests__/pipeline/textFaces.test.d.ts +2 -0
  555. package/dist/__tests__/pipeline/textFaces.test.d.ts.map +1 -0
  556. package/dist/__tests__/pipeline/textFaces.test.js +258 -0
  557. package/dist/__tests__/pipeline/textFaces.test.js.map +1 -0
  558. package/dist/__tests__/pipeline/trailingBand.test.js +29 -0
  559. package/dist/__tests__/pipeline/trailingBand.test.js.map +1 -1
  560. package/dist/__tests__/pipeline/trailingCapHeading.test.d.ts +2 -0
  561. package/dist/__tests__/pipeline/trailingCapHeading.test.d.ts.map +1 -0
  562. package/dist/__tests__/pipeline/trailingCapHeading.test.js +69 -0
  563. package/dist/__tests__/pipeline/trailingCapHeading.test.js.map +1 -0
  564. package/dist/__tests__/pipeline/trailingCapOverflow.test.d.ts +2 -0
  565. package/dist/__tests__/pipeline/trailingCapOverflow.test.d.ts.map +1 -0
  566. package/dist/__tests__/pipeline/trailingCapOverflow.test.js +116 -0
  567. package/dist/__tests__/pipeline/trailingCapOverflow.test.js.map +1 -0
  568. package/dist/__tests__/placeholders.test.js +100 -2
  569. package/dist/__tests__/placeholders.test.js.map +1 -1
  570. package/dist/__tests__/punctuationGlue.test.d.ts +2 -0
  571. package/dist/__tests__/punctuationGlue.test.d.ts.map +1 -0
  572. package/dist/__tests__/punctuationGlue.test.js +165 -0
  573. package/dist/__tests__/punctuationGlue.test.js.map +1 -0
  574. package/dist/__tests__/raggedHyphenation.test.d.ts +2 -0
  575. package/dist/__tests__/raggedHyphenation.test.d.ts.map +1 -0
  576. package/dist/__tests__/raggedHyphenation.test.js +184 -0
  577. package/dist/__tests__/raggedHyphenation.test.js.map +1 -0
  578. package/dist/__tests__/renderWarnings.test.d.ts +2 -0
  579. package/dist/__tests__/renderWarnings.test.d.ts.map +1 -0
  580. package/dist/__tests__/renderWarnings.test.js +72 -0
  581. package/dist/__tests__/renderWarnings.test.js.map +1 -0
  582. package/dist/__tests__/resolvedLocale.test.d.ts +2 -0
  583. package/dist/__tests__/resolvedLocale.test.d.ts.map +1 -0
  584. package/dist/__tests__/resolvedLocale.test.js +51 -0
  585. package/dist/__tests__/resolvedLocale.test.js.map +1 -0
  586. package/dist/__tests__/runningChapter.test.d.ts +2 -0
  587. package/dist/__tests__/runningChapter.test.d.ts.map +1 -0
  588. package/dist/__tests__/runningChapter.test.js +161 -0
  589. package/dist/__tests__/runningChapter.test.js.map +1 -0
  590. package/dist/__tests__/runtFixStretchLimit.test.d.ts +2 -0
  591. package/dist/__tests__/runtFixStretchLimit.test.d.ts.map +1 -0
  592. package/dist/__tests__/runtFixStretchLimit.test.js +145 -0
  593. package/dist/__tests__/runtFixStretchLimit.test.js.map +1 -0
  594. package/dist/__tests__/scriptStacking.test.d.ts +2 -0
  595. package/dist/__tests__/scriptStacking.test.d.ts.map +1 -0
  596. package/dist/__tests__/scriptStacking.test.js +331 -0
  597. package/dist/__tests__/scriptStacking.test.js.map +1 -0
  598. package/dist/__tests__/sectionPaletteFlow.test.d.ts +2 -0
  599. package/dist/__tests__/sectionPaletteFlow.test.d.ts.map +1 -0
  600. package/dist/__tests__/sectionPaletteFlow.test.js +51 -0
  601. package/dist/__tests__/sectionPaletteFlow.test.js.map +1 -0
  602. package/dist/__tests__/singleInk.test.js +64 -2
  603. package/dist/__tests__/singleInk.test.js.map +1 -1
  604. package/dist/__tests__/singleInkRender.test.d.ts +2 -0
  605. package/dist/__tests__/singleInkRender.test.d.ts.map +1 -0
  606. package/dist/__tests__/singleInkRender.test.js +396 -0
  607. package/dist/__tests__/singleInkRender.test.js.map +1 -0
  608. package/dist/__tests__/spaceDirective.test.js +75 -0
  609. package/dist/__tests__/spaceDirective.test.js.map +1 -1
  610. package/dist/__tests__/table/model.test.js +124 -1
  611. package/dist/__tests__/table/model.test.js.map +1 -1
  612. package/dist/__tests__/tableFillSeams.test.d.ts +2 -0
  613. package/dist/__tests__/tableFillSeams.test.d.ts.map +1 -0
  614. package/dist/__tests__/tableFillSeams.test.js +180 -0
  615. package/dist/__tests__/tableFillSeams.test.js.map +1 -0
  616. package/dist/__tests__/toc.test.js +23 -2
  617. package/dist/__tests__/toc.test.js.map +1 -1
  618. package/dist/__tests__/tocLeaderKerning.test.d.ts +2 -0
  619. package/dist/__tests__/tocLeaderKerning.test.d.ts.map +1 -0
  620. package/dist/__tests__/tocLeaderKerning.test.js +83 -0
  621. package/dist/__tests__/tocLeaderKerning.test.js.map +1 -0
  622. package/dist/__tests__/tocNumberBaseline.test.d.ts +2 -0
  623. package/dist/__tests__/tocNumberBaseline.test.d.ts.map +1 -0
  624. package/dist/__tests__/tocNumberBaseline.test.js +90 -0
  625. package/dist/__tests__/tocNumberBaseline.test.js.map +1 -0
  626. package/dist/__tests__/tocPartsHeight.test.d.ts +2 -0
  627. package/dist/__tests__/tocPartsHeight.test.d.ts.map +1 -0
  628. package/dist/__tests__/tocPartsHeight.test.js +41 -0
  629. package/dist/__tests__/tocPartsHeight.test.js.map +1 -0
  630. package/dist/__tests__/trackedLineAlign.test.d.ts +2 -0
  631. package/dist/__tests__/trackedLineAlign.test.d.ts.map +1 -0
  632. package/dist/__tests__/trackedLineAlign.test.js +96 -0
  633. package/dist/__tests__/trackedLineAlign.test.js.map +1 -0
  634. package/dist/bundle/adapters.d.ts +10 -3
  635. package/dist/bundle/adapters.d.ts.map +1 -1
  636. package/dist/bundle/adapters.js +13 -5
  637. package/dist/bundle/adapters.js.map +1 -1
  638. package/dist/bundle/api.d.ts +32 -0
  639. package/dist/bundle/api.d.ts.map +1 -1
  640. package/dist/bundle/api.js +12 -2
  641. package/dist/bundle/api.js.map +1 -1
  642. package/dist/bundle/book.d.ts +6 -1
  643. package/dist/bundle/book.d.ts.map +1 -1
  644. package/dist/bundle/book.js +89 -17
  645. package/dist/bundle/book.js.map +1 -1
  646. package/dist/bundle/codec.d.ts +87 -3
  647. package/dist/bundle/codec.d.ts.map +1 -1
  648. package/dist/bundle/codec.js +193 -13
  649. package/dist/bundle/codec.js.map +1 -1
  650. package/dist/bundle/configVersion.d.ts +295 -0
  651. package/dist/bundle/configVersion.d.ts.map +1 -0
  652. package/dist/bundle/configVersion.js +788 -0
  653. package/dist/bundle/configVersion.js.map +1 -0
  654. package/dist/bundle/index.d.ts +6 -4
  655. package/dist/bundle/index.d.ts.map +1 -1
  656. package/dist/bundle/index.js +2 -1
  657. package/dist/bundle/index.js.map +1 -1
  658. package/dist/bundle/manifest.d.ts +19 -5
  659. package/dist/bundle/manifest.d.ts.map +1 -1
  660. package/dist/bundle/manifest.js +53 -21
  661. package/dist/bundle/manifest.js.map +1 -1
  662. package/dist/bundle/types.d.ts +19 -0
  663. package/dist/bundle/types.d.ts.map +1 -1
  664. package/dist/bundle/zip.d.ts +14 -1
  665. package/dist/bundle/zip.d.ts.map +1 -1
  666. package/dist/bundle/zip.js +13 -2
  667. package/dist/bundle/zip.js.map +1 -1
  668. package/dist/canvas-backend/blockRender.d.ts +3 -1
  669. package/dist/canvas-backend/blockRender.d.ts.map +1 -1
  670. package/dist/canvas-backend/blockRender.js +27 -17
  671. package/dist/canvas-backend/blockRender.js.map +1 -1
  672. package/dist/canvas-backend/decorations.d.ts.map +1 -1
  673. package/dist/canvas-backend/decorations.js +6 -36
  674. package/dist/canvas-backend/decorations.js.map +1 -1
  675. package/dist/canvas-backend/headerFooter.d.ts +3 -1
  676. package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
  677. package/dist/canvas-backend/headerFooter.js +85 -22
  678. package/dist/canvas-backend/headerFooter.js.map +1 -1
  679. package/dist/canvas-backend/index.d.ts +17 -3
  680. package/dist/canvas-backend/index.d.ts.map +1 -1
  681. package/dist/canvas-backend/index.js +75 -14
  682. package/dist/canvas-backend/index.js.map +1 -1
  683. package/dist/canvas-backend/renderResourceBlock.d.ts +45 -5
  684. package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
  685. package/dist/canvas-backend/renderResourceBlock.js +133 -22
  686. package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
  687. package/dist/columnClip.d.ts +13 -2
  688. package/dist/columnClip.d.ts.map +1 -1
  689. package/dist/columnClip.js +37 -4
  690. package/dist/columnClip.js.map +1 -1
  691. package/dist/columnRule.d.ts +7 -2
  692. package/dist/columnRule.d.ts.map +1 -1
  693. package/dist/columnRule.js +27 -2
  694. package/dist/columnRule.js.map +1 -1
  695. package/dist/configWarnings.d.ts +26 -0
  696. package/dist/configWarnings.d.ts.map +1 -0
  697. package/dist/configWarnings.js +223 -0
  698. package/dist/configWarnings.js.map +1 -0
  699. package/dist/createLayout.d.ts +16 -1
  700. package/dist/createLayout.d.ts.map +1 -1
  701. package/dist/createLayout.js +25 -22
  702. package/dist/createLayout.js.map +1 -1
  703. package/dist/cropMarks.d.ts +28 -0
  704. package/dist/cropMarks.d.ts.map +1 -0
  705. package/dist/cropMarks.js +40 -0
  706. package/dist/cropMarks.js.map +1 -0
  707. package/dist/defaults/bodyText.d.ts +12 -2
  708. package/dist/defaults/bodyText.d.ts.map +1 -1
  709. package/dist/defaults/bodyText.js +132 -7
  710. package/dist/defaults/bodyText.js.map +1 -1
  711. package/dist/defaults/calloutStyles.d.ts +13 -2
  712. package/dist/defaults/calloutStyles.d.ts.map +1 -1
  713. package/dist/defaults/calloutStyles.js +64 -4
  714. package/dist/defaults/calloutStyles.js.map +1 -1
  715. package/dist/defaults/chipStyles.d.ts +4 -3
  716. package/dist/defaults/chipStyles.d.ts.map +1 -1
  717. package/dist/defaults/chipStyles.js +11 -3
  718. package/dist/defaults/chipStyles.js.map +1 -1
  719. package/dist/defaults/headerFooter.d.ts +11 -1
  720. package/dist/defaults/headerFooter.d.ts.map +1 -1
  721. package/dist/defaults/headerFooter.js +52 -4
  722. package/dist/defaults/headerFooter.js.map +1 -1
  723. package/dist/defaults/headingStyles.d.ts +7 -3
  724. package/dist/defaults/headingStyles.d.ts.map +1 -1
  725. package/dist/defaults/headingStyles.js +34 -6
  726. package/dist/defaults/headingStyles.js.map +1 -1
  727. package/dist/defaults/headings.d.ts +10 -2
  728. package/dist/defaults/headings.d.ts.map +1 -1
  729. package/dist/defaults/headings.js +79 -16
  730. package/dist/defaults/headings.js.map +1 -1
  731. package/dist/defaults/index.d.ts +1 -1
  732. package/dist/defaults/index.d.ts.map +1 -1
  733. package/dist/defaults/index.js +1 -1
  734. package/dist/defaults/index.js.map +1 -1
  735. package/dist/defaults/layout.d.ts.map +1 -1
  736. package/dist/defaults/layout.js +27 -0
  737. package/dist/defaults/layout.js.map +1 -1
  738. package/dist/defaults/lists-shared.d.ts +2 -0
  739. package/dist/defaults/lists-shared.d.ts.map +1 -1
  740. package/dist/defaults/lists-shared.js +2 -0
  741. package/dist/defaults/lists-shared.js.map +1 -1
  742. package/dist/defaults/math.d.ts.map +1 -1
  743. package/dist/defaults/math.js +12 -0
  744. package/dist/defaults/math.js.map +1 -1
  745. package/dist/defaults/orderedLists.d.ts +7 -1
  746. package/dist/defaults/orderedLists.d.ts.map +1 -1
  747. package/dist/defaults/orderedLists.js +30 -4
  748. package/dist/defaults/orderedLists.js.map +1 -1
  749. package/dist/defaults/page.d.ts.map +1 -1
  750. package/dist/defaults/page.js +7 -2
  751. package/dist/defaults/page.js.map +1 -1
  752. package/dist/defaults/paragraphStyles.d.ts +2 -1
  753. package/dist/defaults/paragraphStyles.d.ts.map +1 -1
  754. package/dist/defaults/paragraphStyles.js +26 -1
  755. package/dist/defaults/paragraphStyles.js.map +1 -1
  756. package/dist/defaults/resourceTypes.d.ts +5 -1
  757. package/dist/defaults/resourceTypes.d.ts.map +1 -1
  758. package/dist/defaults/resourceTypes.js +37 -6
  759. package/dist/defaults/resourceTypes.js.map +1 -1
  760. package/dist/defaults/shared.d.ts +10 -0
  761. package/dist/defaults/shared.d.ts.map +1 -1
  762. package/dist/defaults/shared.js +79 -0
  763. package/dist/defaults/shared.js.map +1 -1
  764. package/dist/defaults/tableStyle.d.ts +1 -1
  765. package/dist/defaults/tableStyle.d.ts.map +1 -1
  766. package/dist/defaults/tableStyle.js +40 -6
  767. package/dist/defaults/tableStyle.js.map +1 -1
  768. package/dist/defaults/toc.d.ts +2 -1
  769. package/dist/defaults/toc.d.ts.map +1 -1
  770. package/dist/defaults/toc.js +2 -1
  771. package/dist/defaults/toc.js.map +1 -1
  772. package/dist/defaults/unorderedLists.d.ts +1 -0
  773. package/dist/defaults/unorderedLists.d.ts.map +1 -1
  774. package/dist/defaults/unorderedLists.js +7 -1
  775. package/dist/defaults/unorderedLists.js.map +1 -1
  776. package/dist/design/layout.d.ts +41 -3
  777. package/dist/design/layout.d.ts.map +1 -1
  778. package/dist/design/layout.js +322 -90
  779. package/dist/design/layout.js.map +1 -1
  780. package/dist/design/placeholders.d.ts +39 -4
  781. package/dist/design/placeholders.d.ts.map +1 -1
  782. package/dist/design/placeholders.js +61 -11
  783. package/dist/design/placeholders.js.map +1 -1
  784. package/dist/design/richText.d.ts +110 -0
  785. package/dist/design/richText.d.ts.map +1 -0
  786. package/dist/design/richText.js +458 -0
  787. package/dist/design/richText.js.map +1 -0
  788. package/dist/frontmatter.d.ts +14 -0
  789. package/dist/frontmatter.d.ts.map +1 -1
  790. package/dist/frontmatter.js +61 -0
  791. package/dist/frontmatter.js.map +1 -1
  792. package/dist/html-backend.d.ts +60 -2
  793. package/dist/html-backend.d.ts.map +1 -1
  794. package/dist/html-backend.js +317 -62
  795. package/dist/html-backend.js.map +1 -1
  796. package/dist/hyphenate.d.ts +30 -4
  797. package/dist/hyphenate.d.ts.map +1 -1
  798. package/dist/hyphenate.js +71 -5
  799. package/dist/hyphenate.js.map +1 -1
  800. package/dist/index.d.ts +28 -19
  801. package/dist/index.d.ts.map +1 -1
  802. package/dist/index.js +17 -11
  803. package/dist/index.js.map +1 -1
  804. package/dist/knuthPlass/breakpoints.d.ts +21 -0
  805. package/dist/knuthPlass/breakpoints.d.ts.map +1 -1
  806. package/dist/knuthPlass/breakpoints.js +205 -14
  807. package/dist/knuthPlass/breakpoints.js.map +1 -1
  808. package/dist/knuthPlass/constants.d.ts +15 -0
  809. package/dist/knuthPlass/constants.d.ts.map +1 -1
  810. package/dist/knuthPlass/constants.js +15 -0
  811. package/dist/knuthPlass/constants.js.map +1 -1
  812. package/dist/knuthPlass/pretextAdapter.d.ts +23 -2
  813. package/dist/knuthPlass/pretextAdapter.d.ts.map +1 -1
  814. package/dist/knuthPlass/pretextAdapter.js +95 -9
  815. package/dist/knuthPlass/pretextAdapter.js.map +1 -1
  816. package/dist/knuthPlass/richAdapter.d.ts +26 -2
  817. package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
  818. package/dist/knuthPlass/richAdapter.js +79 -18
  819. package/dist/knuthPlass/richAdapter.js.map +1 -1
  820. package/dist/knuthPlass/tracking.d.ts +24 -0
  821. package/dist/knuthPlass/tracking.d.ts.map +1 -0
  822. package/dist/knuthPlass/tracking.js +77 -0
  823. package/dist/knuthPlass/tracking.js.map +1 -0
  824. package/dist/knuthPlass/types.d.ts +66 -4
  825. package/dist/knuthPlass/types.d.ts.map +1 -1
  826. package/dist/lineInk.d.ts +12 -0
  827. package/dist/lineInk.d.ts.map +1 -0
  828. package/dist/lineInk.js +20 -0
  829. package/dist/lineInk.js.map +1 -0
  830. package/dist/locale.d.ts +26 -0
  831. package/dist/locale.d.ts.map +1 -0
  832. package/dist/locale.js +63 -0
  833. package/dist/locale.js.map +1 -0
  834. package/dist/looseLines.d.ts +44 -0
  835. package/dist/looseLines.d.ts.map +1 -0
  836. package/dist/looseLines.js +46 -0
  837. package/dist/looseLines.js.map +1 -0
  838. package/dist/math/THIRD_PARTY_LICENSES.txt +221 -0
  839. package/dist/math/engine.d.ts +24 -0
  840. package/dist/math/engine.d.ts.map +1 -1
  841. package/dist/math/engine.js +252 -83
  842. package/dist/math/engine.js.map +1 -1
  843. package/dist/math/index.d.ts +1 -1
  844. package/dist/math/index.d.ts.map +1 -1
  845. package/dist/math/index.js +1 -1
  846. package/dist/math/index.js.map +1 -1
  847. package/dist/math/mathjax.d.ts +20 -0
  848. package/dist/math/mathjax.d.ts.map +1 -0
  849. package/dist/math/mathjax.js +29 -0
  850. package/dist/measure/breakRules.d.ts +50 -0
  851. package/dist/measure/breakRules.d.ts.map +1 -0
  852. package/dist/measure/breakRules.js +116 -0
  853. package/dist/measure/breakRules.js.map +1 -0
  854. package/dist/measure/cache.d.ts.map +1 -1
  855. package/dist/measure/cache.js +26 -5
  856. package/dist/measure/cache.js.map +1 -1
  857. package/dist/measure/cjk.d.ts +19 -0
  858. package/dist/measure/cjk.d.ts.map +1 -0
  859. package/dist/measure/cjk.js +70 -0
  860. package/dist/measure/cjk.js.map +1 -0
  861. package/dist/measure/font.d.ts +21 -5
  862. package/dist/measure/font.d.ts.map +1 -1
  863. package/dist/measure/font.js +61 -4
  864. package/dist/measure/font.js.map +1 -1
  865. package/dist/measure/index.d.ts +16 -2
  866. package/dist/measure/index.d.ts.map +1 -1
  867. package/dist/measure/index.js +61 -1
  868. package/dist/measure/index.js.map +1 -1
  869. package/dist/measure/links.d.ts +15 -0
  870. package/dist/measure/links.d.ts.map +1 -0
  871. package/dist/measure/links.js +115 -0
  872. package/dist/measure/links.js.map +1 -0
  873. package/dist/measure/plain.d.ts +10 -2
  874. package/dist/measure/plain.d.ts.map +1 -1
  875. package/dist/measure/plain.js +175 -25
  876. package/dist/measure/plain.js.map +1 -1
  877. package/dist/measure/rich.d.ts +86 -6
  878. package/dist/measure/rich.d.ts.map +1 -1
  879. package/dist/measure/rich.js +808 -131
  880. package/dist/measure/rich.js.map +1 -1
  881. package/dist/measure/spaces.d.ts +34 -0
  882. package/dist/measure/spaces.d.ts.map +1 -0
  883. package/dist/measure/spaces.js +42 -0
  884. package/dist/measure/spaces.js.map +1 -0
  885. package/dist/measure/types.d.ts +99 -0
  886. package/dist/measure/types.d.ts.map +1 -1
  887. package/dist/measure/types.js +19 -0
  888. package/dist/measure/types.js.map +1 -1
  889. package/dist/numberWords.d.ts +22 -0
  890. package/dist/numberWords.d.ts.map +1 -0
  891. package/dist/numberWords.js +155 -0
  892. package/dist/numberWords.js.map +1 -0
  893. package/dist/numbering.d.ts +52 -3
  894. package/dist/numbering.d.ts.map +1 -1
  895. package/dist/numbering.js +116 -16
  896. package/dist/numbering.js.map +1 -1
  897. package/dist/parse/blockParser.d.ts.map +1 -1
  898. package/dist/parse/blockParser.js +54 -7
  899. package/dist/parse/blockParser.js.map +1 -1
  900. package/dist/parse/index.d.ts +1 -1
  901. package/dist/parse/index.d.ts.map +1 -1
  902. package/dist/parse/index.js.map +1 -1
  903. package/dist/parse/injectSpans.d.ts +3 -1
  904. package/dist/parse/injectSpans.d.ts.map +1 -1
  905. package/dist/parse/injectSpans.js +8 -4
  906. package/dist/parse/injectSpans.js.map +1 -1
  907. package/dist/parse/inlineFormatting.d.ts +50 -2
  908. package/dist/parse/inlineFormatting.d.ts.map +1 -1
  909. package/dist/parse/inlineFormatting.js +441 -26
  910. package/dist/parse/inlineFormatting.js.map +1 -1
  911. package/dist/parse/inlineSnippet.d.ts +12 -3
  912. package/dist/parse/inlineSnippet.d.ts.map +1 -1
  913. package/dist/parse/inlineSnippet.js +10 -3
  914. package/dist/parse/inlineSnippet.js.map +1 -1
  915. package/dist/parse/links.d.ts +9 -0
  916. package/dist/parse/links.d.ts.map +1 -0
  917. package/dist/parse/links.js +23 -0
  918. package/dist/parse/links.js.map +1 -0
  919. package/dist/parse/sourceMapping.d.ts.map +1 -1
  920. package/dist/parse/sourceMapping.js +68 -7
  921. package/dist/parse/sourceMapping.js.map +1 -1
  922. package/dist/parse/types.d.ts +32 -0
  923. package/dist/parse/types.d.ts.map +1 -1
  924. package/dist/pipeline/bandCaps.d.ts +26 -5
  925. package/dist/pipeline/bandCaps.d.ts.map +1 -1
  926. package/dist/pipeline/bandCaps.js +47 -20
  927. package/dist/pipeline/bandCaps.js.map +1 -1
  928. package/dist/pipeline/build.d.ts.map +1 -1
  929. package/dist/pipeline/build.js +1417 -172
  930. package/dist/pipeline/build.js.map +1 -1
  931. package/dist/pipeline/buildBlockKind.d.ts +4 -0
  932. package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
  933. package/dist/pipeline/buildBlockKind.js +38 -7
  934. package/dist/pipeline/buildBlockKind.js.map +1 -1
  935. package/dist/pipeline/buildHelpers.d.ts +5 -2
  936. package/dist/pipeline/buildHelpers.d.ts.map +1 -1
  937. package/dist/pipeline/buildHelpers.js +101 -25
  938. package/dist/pipeline/buildHelpers.js.map +1 -1
  939. package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
  940. package/dist/pipeline/buildMeasurement.js +6 -2
  941. package/dist/pipeline/buildMeasurement.js.map +1 -1
  942. package/dist/pipeline/calloutLayout.d.ts +34 -7
  943. package/dist/pipeline/calloutLayout.d.ts.map +1 -1
  944. package/dist/pipeline/calloutLayout.js +331 -44
  945. package/dist/pipeline/calloutLayout.js.map +1 -1
  946. package/dist/pipeline/chips.d.ts.map +1 -1
  947. package/dist/pipeline/chips.js +3 -0
  948. package/dist/pipeline/chips.js.map +1 -1
  949. package/dist/pipeline/columnBalancing.d.ts +26 -6
  950. package/dist/pipeline/columnBalancing.d.ts.map +1 -1
  951. package/dist/pipeline/columnBalancing.js +82 -21
  952. package/dist/pipeline/columnBalancing.js.map +1 -1
  953. package/dist/pipeline/config.d.ts +18 -0
  954. package/dist/pipeline/config.d.ts.map +1 -1
  955. package/dist/pipeline/config.js +44 -7
  956. package/dist/pipeline/config.js.map +1 -1
  957. package/dist/pipeline/contentWarnings.d.ts +50 -0
  958. package/dist/pipeline/contentWarnings.d.ts.map +1 -0
  959. package/dist/pipeline/contentWarnings.js +362 -0
  960. package/dist/pipeline/contentWarnings.js.map +1 -0
  961. package/dist/pipeline/continuation.d.ts.map +1 -1
  962. package/dist/pipeline/continuation.js +25 -5
  963. package/dist/pipeline/continuation.js.map +1 -1
  964. package/dist/pipeline/floatPlacement.d.ts +16 -7
  965. package/dist/pipeline/floatPlacement.d.ts.map +1 -1
  966. package/dist/pipeline/floatPlacement.js +22 -5
  967. package/dist/pipeline/floatPlacement.js.map +1 -1
  968. package/dist/pipeline/floatSlots.d.ts +30 -4
  969. package/dist/pipeline/floatSlots.d.ts.map +1 -1
  970. package/dist/pipeline/floatSlots.js +42 -7
  971. package/dist/pipeline/floatSlots.js.map +1 -1
  972. package/dist/pipeline/headerFooter.d.ts +125 -11
  973. package/dist/pipeline/headerFooter.d.ts.map +1 -1
  974. package/dist/pipeline/headerFooter.js +444 -69
  975. package/dist/pipeline/headerFooter.js.map +1 -1
  976. package/dist/pipeline/headingDesignCuts.d.ts +40 -0
  977. package/dist/pipeline/headingDesignCuts.d.ts.map +1 -0
  978. package/dist/pipeline/headingDesignCuts.js +72 -0
  979. package/dist/pipeline/headingDesignCuts.js.map +1 -0
  980. package/dist/pipeline/headingStyles.d.ts +12 -0
  981. package/dist/pipeline/headingStyles.d.ts.map +1 -1
  982. package/dist/pipeline/headingStyles.js +45 -1
  983. package/dist/pipeline/headingStyles.js.map +1 -1
  984. package/dist/pipeline/lists.d.ts +33 -1
  985. package/dist/pipeline/lists.d.ts.map +1 -1
  986. package/dist/pipeline/lists.js +53 -2
  987. package/dist/pipeline/lists.js.map +1 -1
  988. package/dist/pipeline/measureContentBlock.d.ts +25 -1
  989. package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
  990. package/dist/pipeline/measureContentBlock.js +137 -17
  991. package/dist/pipeline/measureContentBlock.js.map +1 -1
  992. package/dist/pipeline/outline.d.ts +10 -5
  993. package/dist/pipeline/outline.d.ts.map +1 -1
  994. package/dist/pipeline/outline.js +38 -14
  995. package/dist/pipeline/outline.js.map +1 -1
  996. package/dist/pipeline/paragraphContainers.d.ts +13 -4
  997. package/dist/pipeline/paragraphContainers.d.ts.map +1 -1
  998. package/dist/pipeline/paragraphContainers.js +4 -3
  999. package/dist/pipeline/paragraphContainers.js.map +1 -1
  1000. package/dist/pipeline/partPalette.d.ts +49 -3
  1001. package/dist/pipeline/partPalette.d.ts.map +1 -1
  1002. package/dist/pipeline/partPalette.js +414 -46
  1003. package/dist/pipeline/partPalette.js.map +1 -1
  1004. package/dist/pipeline/parts.d.ts +5 -1
  1005. package/dist/pipeline/parts.d.ts.map +1 -1
  1006. package/dist/pipeline/parts.js +16 -0
  1007. package/dist/pipeline/parts.js.map +1 -1
  1008. package/dist/pipeline/placeholders.d.ts +152 -3
  1009. package/dist/pipeline/placeholders.d.ts.map +1 -1
  1010. package/dist/pipeline/placeholders.js +259 -33
  1011. package/dist/pipeline/placeholders.js.map +1 -1
  1012. package/dist/pipeline/placement.d.ts +6 -1
  1013. package/dist/pipeline/placement.d.ts.map +1 -1
  1014. package/dist/pipeline/placement.js +13 -2
  1015. package/dist/pipeline/placement.js.map +1 -1
  1016. package/dist/pipeline/raggedLines.d.ts +5 -0
  1017. package/dist/pipeline/raggedLines.d.ts.map +1 -1
  1018. package/dist/pipeline/raggedLines.js +24 -3
  1019. package/dist/pipeline/raggedLines.js.map +1 -1
  1020. package/dist/pipeline/resourceLayout.d.ts +6 -4
  1021. package/dist/pipeline/resourceLayout.d.ts.map +1 -1
  1022. package/dist/pipeline/resourceLayout.js +137 -36
  1023. package/dist/pipeline/resourceLayout.js.map +1 -1
  1024. package/dist/pipeline/resourceNumbering.d.ts.map +1 -1
  1025. package/dist/pipeline/resourceNumbering.js +5 -15
  1026. package/dist/pipeline/resourceNumbering.js.map +1 -1
  1027. package/dist/pipeline/styles.d.ts +38 -5
  1028. package/dist/pipeline/styles.d.ts.map +1 -1
  1029. package/dist/pipeline/styles.js +99 -46
  1030. package/dist/pipeline/styles.js.map +1 -1
  1031. package/dist/pipeline/toc.d.ts.map +1 -1
  1032. package/dist/pipeline/toc.js +41 -5
  1033. package/dist/pipeline/toc.js.map +1 -1
  1034. package/dist/react/createLayout.d.ts +20 -0
  1035. package/dist/react/createLayout.d.ts.map +1 -0
  1036. package/dist/react/createLayout.js +50 -0
  1037. package/dist/react/createLayout.js.map +1 -0
  1038. package/dist/react/index.d.ts +3 -0
  1039. package/dist/react/index.d.ts.map +1 -0
  1040. package/dist/react/index.js +4 -0
  1041. package/dist/react/index.js.map +1 -0
  1042. package/dist/svg/singleInk.d.ts +46 -1
  1043. package/dist/svg/singleInk.d.ts.map +1 -1
  1044. package/dist/svg/singleInk.js +180 -10
  1045. package/dist/svg/singleInk.js.map +1 -1
  1046. package/dist/table/model.d.ts +36 -1
  1047. package/dist/table/model.d.ts.map +1 -1
  1048. package/dist/table/model.js +163 -20
  1049. package/dist/table/model.js.map +1 -1
  1050. package/dist/types.d.ts +979 -68
  1051. package/dist/types.d.ts.map +1 -1
  1052. package/dist/vdt.d.ts +439 -13
  1053. package/dist/vdt.d.ts.map +1 -1
  1054. package/dist/vdt.js +91 -0
  1055. package/dist/vdt.js.map +1 -1
  1056. package/dist/worker/client.d.ts +15 -1
  1057. package/dist/worker/client.d.ts.map +1 -1
  1058. package/dist/worker/client.js +52 -3
  1059. package/dist/worker/client.js.map +1 -1
  1060. package/dist/worker/entryUrl.d.ts +15 -0
  1061. package/dist/worker/entryUrl.d.ts.map +1 -0
  1062. package/dist/worker/entryUrl.js +33 -0
  1063. package/dist/worker/entryUrl.js.map +1 -0
  1064. package/dist/worker/fonts.d.ts +18 -0
  1065. package/dist/worker/fonts.d.ts.map +1 -0
  1066. package/dist/worker/fonts.js +53 -0
  1067. package/dist/worker/fonts.js.map +1 -0
  1068. package/dist/worker/layout.worker.js +41 -6
  1069. package/dist/worker/layout.worker.js.map +1 -1
  1070. package/dist/worker/protocol.d.ts +4 -0
  1071. package/dist/worker/protocol.d.ts.map +1 -1
  1072. package/package.json +12 -5
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Whether a line may end after the em or en dash `dash`, set closed between
3
+ * `prev` and `next` (the characters around it; undefined at the edge of the
4
+ * text, or where a space stands): "say—that’s", "riddles.—I", "Hamburg–Berlin".
5
+ * `beforePrev` is the character before `prev`, read the same way.
6
+ * The dash is the Unicode line-breaking class B2 (em) or BA (en), both of
7
+ * which allow a break after them. Never after a dash that opens an aside or a
8
+ * line of dialogue: a space before it ("—dijo"), or a space and a quotation
9
+ * mark (`said "—Hola`, German `sagte »—Ich`). A straight quote, `»`, `”` or
10
+ * `’` before the dash may open a quote as well as close one, so it counts as
11
+ * closing only after a letter, a digit or closing punctuation ("\"no\"—and",
12
+ * "boys'—and", "«no»—y"), and `»` also after a no-break space (French
13
+ * "« non »—et"). `“` and `«`, which German and Danish close with, count as
14
+ * closing only after a letter, a digit, `.`, `!`, `?` or `…` ("„nein“—und",
15
+ * "»nej«—og"). Never before punctuation ("él—,"), a quotation mark
16
+ * or a bracket ("thinking—\" and", "says—“no”", "says—(no)"), inside a run of
17
+ * dashes ("——"), or inside a range of numbers set with an en dash
18
+ * ("1914–1918"). A quote after a dash may close the speech as well as open
19
+ * one, and UAX #14 allows no break before it; pretext, which sets plain text
20
+ * line by line, keeps a dash with the quote or bracket after it, so both
21
+ * breakers agree.
22
+ */
23
+ export declare function breaksAfterDash(prev: string | undefined, dash: string, next: string | undefined, beforePrev?: string): boolean;
24
+ /** Whether `ch` is an em or an en dash. */
25
+ export declare function isDash(ch: string | undefined): boolean;
26
+ /** Whether `text` holds a compound (see {@link COMPOUND_RE}). A soft hyphen
27
+ * next to the hyphen hides it, as it hides it from the breakers. */
28
+ export declare function hasCompound(text: string): boolean;
29
+ /**
30
+ * Whether a line may end after a hyphen the text carries, between `prev`
31
+ * and `next` (the characters around it): between two letters only
32
+ * ("meta-analyses", "UNE-EN"), never in "-5", "1-2" or "pre-(war)". The
33
+ * line then ends on that hyphen and nothing is added.
34
+ */
35
+ export declare function breaksAfterHardHyphen(prev: string | undefined, next: string | undefined): boolean;
36
+ /**
37
+ * How far a ragged line may fall short of its measure at the cost a
38
+ * justified line pays at its word-spacing limit, in ems of the text: the
39
+ * right-hand "glue" of a ragged setting in Knuth and Plass's model (TeX's
40
+ * `\rightskip` of `0pt plus 3em`). A shorter line costs less, a line short by
41
+ * more than this is priced like one stretched past the limit.
42
+ */
43
+ export declare const RAGGED_STRETCH_EM = 3;
44
+ /** The size of a CSS font string, in px (the `16px` of `italic 16px Serif`);
45
+ * 16 when it names none. */
46
+ export declare function fontSizePxOf(font: string): number;
47
+ /** The stretch a ragged line of `font` gets in the Knuth–Plass model (see
48
+ * {@link RAGGED_STRETCH_EM}). */
49
+ export declare function raggedStretchPx(font: string): number;
50
+ //# sourceMappingURL=breakRules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakRules.d.ts","sourceRoot":"","sources":["../../src/measure/breakRules.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAOT;AAED,2CAA2C;AAC3C,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEtD;AAQD;qEACqE;AACrE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEjG;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC;6BAC6B;AAC7B,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED;kCACkC;AAClC,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,116 @@
1
+ // Break opportunities and costs shared by the plain and the rich line
2
+ // breakers.
3
+ const EM_DASH = '—';
4
+ const EN_DASH = '–';
5
+ /** What may stand right before a closed dash a line breaks after: a letter,
6
+ * a digit, or punctuation that closes ("riddles.—I", "so,—and", "(1914)—the"). */
7
+ const BEFORE_DASH_RE = /[\p{L}\p{N}.,;:!?)\]}»”’"'“«…]/u;
8
+ /** The marks of {@link BEFORE_DASH_RE} that may open a quote as well as
9
+ * close one: a straight quote, `»` (German opens with it), `”` (Swedish and
10
+ * Finnish open with it), `’`, and `“` and `«`, which German and Danish
11
+ * close with („nein“, »nej«) and English and Spanish open with. */
12
+ const QUOTE_BEFORE_DASH_RE = /["'»”’“«]/u;
13
+ /** What must stand before such a quote for it to close a word: a letter, a
14
+ * digit or closing punctuation ("no"—and, “no.”—and, boys'—and). */
15
+ const BEFORE_CLOSING_QUOTE_RE = /[\p{L}\p{N}.,;:!?)\]}…]/u;
16
+ /** What must stand before `“` or `«` for it to close a word: a letter, a
17
+ * digit, or a stop that ends the quoted words („nein“—und, „Nein!“—und,
18
+ * »nej«—og). A comma, colon or bracket before them is taken for the start
19
+ * of a quote. */
20
+ const BEFORE_CLOSING_OPENER_RE = /[\p{L}\p{N}.!?…]/u;
21
+ /** French sets a no-break space inside its guillemets: `»` after one closes
22
+ * a quote (`« non »—et`). */
23
+ const NO_BREAK_SPACE_RE = /[\u00A0\u202F]/u;
24
+ /** What may follow a dash a line breaks after: a letter or a digit. Not a
25
+ * quotation mark, which after a dash often closes the speech the dash broke
26
+ * off (`thinking—" and`, German `dachte—“ sagte`), nor an opening bracket
27
+ * or `¿`, which pretext keeps with the dash in plain text. */
28
+ const AFTER_DASH_RE = /[\p{L}\p{N}]/u;
29
+ const DIGIT_RE = /\p{N}/u;
30
+ /** Whether the quotation mark `quote`, with `before` standing right before
31
+ * it, closes a word (see {@link QUOTE_BEFORE_DASH_RE}). */
32
+ function closesQuote(quote, before) {
33
+ if (before === undefined)
34
+ return false;
35
+ if (quote === '“' || quote === '«')
36
+ return BEFORE_CLOSING_OPENER_RE.test(before);
37
+ return BEFORE_CLOSING_QUOTE_RE.test(before) || (quote === '»' && NO_BREAK_SPACE_RE.test(before));
38
+ }
39
+ /**
40
+ * Whether a line may end after the em or en dash `dash`, set closed between
41
+ * `prev` and `next` (the characters around it; undefined at the edge of the
42
+ * text, or where a space stands): "say—that’s", "riddles.—I", "Hamburg–Berlin".
43
+ * `beforePrev` is the character before `prev`, read the same way.
44
+ * The dash is the Unicode line-breaking class B2 (em) or BA (en), both of
45
+ * which allow a break after them. Never after a dash that opens an aside or a
46
+ * line of dialogue: a space before it ("—dijo"), or a space and a quotation
47
+ * mark (`said "—Hola`, German `sagte »—Ich`). A straight quote, `»`, `”` or
48
+ * `’` before the dash may open a quote as well as close one, so it counts as
49
+ * closing only after a letter, a digit or closing punctuation ("\"no\"—and",
50
+ * "boys'—and", "«no»—y"), and `»` also after a no-break space (French
51
+ * "« non »—et"). `“` and `«`, which German and Danish close with, count as
52
+ * closing only after a letter, a digit, `.`, `!`, `?` or `…` ("„nein“—und",
53
+ * "»nej«—og"). Never before punctuation ("él—,"), a quotation mark
54
+ * or a bracket ("thinking—\" and", "says—“no”", "says—(no)"), inside a run of
55
+ * dashes ("——"), or inside a range of numbers set with an en dash
56
+ * ("1914–1918"). A quote after a dash may close the speech as well as open
57
+ * one, and UAX #14 allows no break before it; pretext, which sets plain text
58
+ * line by line, keeps a dash with the quote or bracket after it, so both
59
+ * breakers agree.
60
+ */
61
+ export function breaksAfterDash(prev, dash, next, beforePrev) {
62
+ if (dash !== EM_DASH && dash !== EN_DASH)
63
+ return false;
64
+ if (prev === undefined || next === undefined)
65
+ return false;
66
+ if (!BEFORE_DASH_RE.test(prev) || !AFTER_DASH_RE.test(next))
67
+ return false;
68
+ if (QUOTE_BEFORE_DASH_RE.test(prev) && !closesQuote(prev, beforePrev))
69
+ return false;
70
+ if (dash === EN_DASH && DIGIT_RE.test(prev) && DIGIT_RE.test(next))
71
+ return false;
72
+ return true;
73
+ }
74
+ /** Whether `ch` is an em or an en dash. */
75
+ export function isDash(ch) {
76
+ return ch === EM_DASH || ch === EN_DASH;
77
+ }
78
+ const LETTER_RE = /\p{L}/u;
79
+ /** A compound: a hyphen between two letters ("after-dinner", "vencer-se"),
80
+ * where {@link breaksAfterHardHyphen} lets a line end. */
81
+ const COMPOUND_RE = /\p{L}-\p{L}/u;
82
+ /** Whether `text` holds a compound (see {@link COMPOUND_RE}). A soft hyphen
83
+ * next to the hyphen hides it, as it hides it from the breakers. */
84
+ export function hasCompound(text) {
85
+ return text.includes('-') && COMPOUND_RE.test(text);
86
+ }
87
+ /**
88
+ * Whether a line may end after a hyphen the text carries, between `prev`
89
+ * and `next` (the characters around it): between two letters only
90
+ * ("meta-analyses", "UNE-EN"), never in "-5", "1-2" or "pre-(war)". The
91
+ * line then ends on that hyphen and nothing is added.
92
+ */
93
+ export function breaksAfterHardHyphen(prev, next) {
94
+ return prev !== undefined && next !== undefined && LETTER_RE.test(prev) && LETTER_RE.test(next);
95
+ }
96
+ /**
97
+ * How far a ragged line may fall short of its measure at the cost a
98
+ * justified line pays at its word-spacing limit, in ems of the text: the
99
+ * right-hand "glue" of a ragged setting in Knuth and Plass's model (TeX's
100
+ * `\rightskip` of `0pt plus 3em`). A shorter line costs less, a line short by
101
+ * more than this is priced like one stretched past the limit.
102
+ */
103
+ export const RAGGED_STRETCH_EM = 3;
104
+ /** The size of a CSS font string, in px (the `16px` of `italic 16px Serif`);
105
+ * 16 when it names none. */
106
+ export function fontSizePxOf(font) {
107
+ const m = /(\d*\.?\d+)px/.exec(font);
108
+ const size = m ? Number(m[1]) : 16;
109
+ return Number.isFinite(size) && size > 0 ? size : 16;
110
+ }
111
+ /** The stretch a ragged line of `font` gets in the Knuth–Plass model (see
112
+ * {@link RAGGED_STRETCH_EM}). */
113
+ export function raggedStretchPx(font) {
114
+ return RAGGED_STRETCH_EM * fontSizePxOf(font);
115
+ }
116
+ //# sourceMappingURL=breakRules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakRules.js","sourceRoot":"","sources":["../../src/measure/breakRules.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,YAAY;AAEZ,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,OAAO,GAAG,GAAG,CAAC;AAEpB;mFACmF;AACnF,MAAM,cAAc,GAAG,iCAAiC,CAAC;AACzD;;;oEAGoE;AACpE,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC1C;qEACqE;AACrE,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAC3D;;;kBAGkB;AAClB,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AACrD;8BAC8B;AAC9B,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C;;;+DAG+D;AAC/D,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAE1B;4DAC4D;AAC5D,SAAS,WAAW,CAAC,KAAa,EAAE,M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AI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAOf;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAOf"}
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/measure/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkEpF,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAOf;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAOf"}
@@ -1,26 +1,47 @@
1
1
  import { measureBlock } from './plain';
2
2
  import { measureRichBlock } from './rich';
3
+ import { getHyphenationLocale } from '../hyphenate';
4
+ /** Options that change a block's lines, joined into its cache key. The
5
+ * active hyphenation dictionary is one: soft hyphens (and the syllables an
6
+ * overlong word is divided at) depend on it. */
7
+ function optionsKey(options) {
8
+ return `${options?.textAlign ?? ''}\x00${options?.hyphenate ?? ''}\x00${options?.firstLineIndentPx ?? ''}\x00${options?.hangingIndent ?? ''}\x00${options?.optimal ?? ''}\x00${options?.maxStretchRatio ?? ''}\x00${options?.minShrinkRatio ?? ''}\x00${options?.runtPenalty ?? ''}\x00${options?.runtMinCharacters ?? ''}\x00${options?.looseness ?? ''}\x00${options?.letterSpacingPx ?? ''}\x00${options?.hyphenationZonePx ?? ''}\x00${getHyphenationLocale()}${options?.justifyTrackingPx ? `\x00${options.justifyTrackingPx}` : ''}${options?.runtGraded ? '\x00rg' : ''}${options?.avoidHyphenAtLines?.length ? `\x00ah${options.avoidHyphenAtLines.join(',')}` : ''}`;
9
+ }
3
10
  function buildPlainCacheKey(text, font, maxWidthPx, lineHeightPx, options) {
4
- return `${text}\x00${font}\x00${maxWidthPx}\x00${lineHeightPx}\x00${options?.textAlign ?? ''}\x00${options?.hyphenate ?? ''}\x00${options?.firstLineIndentPx ?? ''}\x00${options?.hangingIndent ?? ''}\x00${options?.optimal ?? ''}\x00${options?.maxStretchRatio ?? ''}\x00${options?.minShrinkRatio ?? ''}\x00${options?.runtPenalty ?? ''}\x00${options?.runtMinCharacters ?? ''}\x00${options?.looseness ?? ''}\x00${options?.letterSpacingPx ?? ''}`;
11
+ return `${text}\x00${font}\x00${maxWidthPx}\x00${lineHeightPx}\x00${optionsKey(options)}`;
5
12
  }
6
13
  /** A chip is one placeholder char in the span text: its words and resolved
7
14
  * box decide its measure, so they join the key. */
8
15
  function chipCacheKey(chip) {
9
- const words = chip.spans.map((s) => `${s.text}~${s.bold}~${s.italic}~${s.script ?? ''}`).join('~');
16
+ const words = chip.spans.map((s) => `${s.text}~${s.bold}~${s.italic}~${s.script ?? ''}${s.smallCaps ? '~sc' : ''}`).join('~');
10
17
  return `|chip:${words}|${chip.box ? JSON.stringify(chip.box) : ''}`;
11
18
  }
19
+ /** A formula is one placeholder char in the span text too: its TeX decides
20
+ * what is painted, and its render's size (which follows the maths font
21
+ * scale, or is a placeholder's before the engine is ready) its measure. */
22
+ function mathCacheKey(span) {
23
+ const render = span.mathRender;
24
+ return `|m:${span.math.tex}${render ? `|${render.widthPx}x${render.heightPx}` : ''}`;
25
+ }
12
26
  function buildRichCacheKey(spans, fonts, maxWidthPx, lineHeightPx, options) {
13
- const spanKey = spans.map((s) => `${s.text}|${s.bold}|${s.italic}|${s.ref?.resourceId ?? ''}${s.chip ? chipCacheKey(s.chip) : ''}`).join('\x01');
14
- return `R\x00${spanKey}\x00${fonts[0]}\x00${fonts[1]}\x00${fonts[2]}\x00${fonts[3]}\x00${maxWidthPx}\x00${lineHeightPx}\x00${options?.textAlign ?? ''}\x00${options?.hyphenate ?? ''}\x00${options?.firstLineIndentPx ?? ''}\x00${options?.hangingIndent ?? ''}\x00${options?.optimal ?? ''}\x00${options?.maxStretchRatio ?? ''}\x00${options?.minShrinkRatio ?? ''}\x00${options?.runtPenalty ?? ''}\x00${options?.runtMinCharacters ?? ''}\x00${options?.looseness ?? ''}\x00${options?.letterSpacingPx ?? ''}`;
27
+ // Script and small-caps marks change the measure of the same text, and a
28
+ // formula or a swatch colour what a placeholder paints: they join the key
29
+ // only when set, so the common keys are unchanged.
30
+ const spanKey = spans.map((s) => `${s.text}|${s.bold}|${s.italic}|${s.ref?.resourceId ?? ''}${s.chip ? chipCacheKey(s.chip) : ''}${s.math ? mathCacheKey(s) : ''}${s.swatch ? `|sw:${s.swatch.color}` : ''}${s.script ? `|${s.script}` : ''}${s.smallCaps ? '|sc' : ''}`).join('\x01');
31
+ return `R\x00${spanKey}\x00${fonts[0]}\x00${fonts[1]}\x00${fonts[2]}\x00${fonts[3]}\x00${maxWidthPx}\x00${lineHeightPx}\x00${optionsKey(options)}`;
15
32
  }
33
+ /** A cached result must read exactly like a fresh measure: the block's own
34
+ * fields (`totalHeight`, `lastLineRunt`, whatever it gains) are carried
35
+ * whole, and only the lines — which the pipeline shifts and stamps — are
36
+ * copied. */
16
37
  function cloneMeasuredBlock(block) {
17
38
  return {
39
+ ...block,
18
40
  lines: block.lines.map((l) => ({
19
41
  ...l,
20
42
  bbox: { ...l.bbox },
21
43
  segments: l.segments ? l.segments.map((s) => ({ ...s })) : undefined,
22
44
  })),
23
- totalHeight: block.totalHeight,
24
45
  };
25
46
  }
26
47
  export function cachedMeasureBlock(text, font, maxWidthPx, lineHeightPx, options, cache) {
@@ -1 +1 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../src/measure/cache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,SAAS,kBAAkB,CACzB,IAAY,EACZ,IAAY,EACZ,UAAkB,EAClB,YAAoB,EACpB,OAAwC;IAExC,OAAO,GAAG,IAAI,OAAO,IAAI,OAAO,UAAU,OAAO,YAAY,OAAO,OAAO,EAAE,SAAS,IAAI,EAAE,OAAO,OAAO,EAAE,SAAS,IAAI,EAAE,OAAO,OAAO,EAAE,iBAAiB,IAAI,EAAE,OAAO,OAAO,EAAE,aAAa,IAAI,EAAE,OAAO,OAAO,EAAE,OAAO,IAAI,EAAE,OAAO,OAAO,EAAE,eAAe,IAAI,EAAE,OAAO,OAAO,EAAE,cAAc,IAAI,EAAE,OAAO,OAAO,EAAE,WAAW,IAAI,EAAE,OAAO,OAAO,EAAE,iBAAiB,IAAI,EAAE,OAAO,OAAO,EAAE,SAAS,IAAI,EAAE,OAAO,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,CAAC;AAC5b,CAAC;AAED;oDACoD;AACpD,SAAS,YAAY,CAAC,IAAqC;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAA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AClB,QAAgB,EAChB,UAAkB,EAClB,cAAsB,EACtB,UAAkB,EAClB,YAAoB,EACpB,OAAwC,EACxC,KAAuB;IAEvB,MAAM,GAAG,GAAG,iBAAiB,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5H,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,MAAM;QAAE,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5H,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,19 @@
1
+ /** Whether the text holds any CJK character. */
2
+ export declare function hasCJK(text: string): boolean;
3
+ /** Whether the text holds words set without spaces between them (see
4
+ * {@link CJK_RUN_RE}), which only a first-fit breaker can divide: optimal
5
+ * line breaking breaks at spaces and hyphenation points. */
6
+ export declare function hasCJKRun(text: string): boolean;
7
+ /**
8
+ * Where a line may break inside a run of text with no spaces, as pretext's
9
+ * own breaker finds it: between two characters when either is CJK. Pretext's
10
+ * segments carry its kinsoku rules, so no line starts with closing
11
+ * punctuation (。、」ー…) and none ends with an opening bracket (「(…).
12
+ * Offsets into `text`, ascending; none when the run holds no CJK.
13
+ */
14
+ export declare function cjkBreakIndices(text: string, font: string): number[];
15
+ /** Whether a line may break where two runs meet with no space between them
16
+ * (`**日本**語`): only between ideographs, under the same kinsoku rules as
17
+ * inside a run. */
18
+ export declare function cjkJoinBreaks(left: string, right: string, font: string): boolean;
19
+ //# sourceMappingURL=cjk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cjk.d.ts","sourceRoot":"","sources":["../../src/measure/cjk.ts"],"names":[],"mappings":"AAUA,gDAAgD;AAChD,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C;AAUD;;6DAE6D;AAC7D,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAYpE;AAED;;oBAEoB;AACpB,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKhF"}
@@ -0,0 +1,70 @@
1
+ import { prepareWithSegments } from '@chenglou/pretext';
2
+ /**
3
+ * Chinese, Japanese and Korean: scripts set without spaces between words.
4
+ * The ranges pretext's line breaker treats as breakable between characters
5
+ * (CJK punctuation and fullwidth forms included), so the plain and the rich
6
+ * breaker agree on where such text may break.
7
+ */
8
+ const CJK_RE = /[\u3000-\u30FF\u3130-\u318F\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF00-\uFFEF\u{20000}-\u{2A6DF}\u{2A700}-\u{2EE5D}\u{2F800}-\u{2FA1F}\u{30000}-\u{33479}]/u;
9
+ /** Whether the text holds any CJK character. */
10
+ export function hasCJK(text) {
11
+ return CJK_RE.test(text);
12
+ }
13
+ /**
14
+ * Words set without spaces: two ideographs, kana or hangul syllables in a
15
+ * row (the iteration marks 々 〆 〇 count as ideographs). CJK punctuation,
16
+ * brackets (〈 「), the middle dot ・ alone and fullwidth signs (% +) do
17
+ * not: quoted in Latin text they need no break between characters.
18
+ */
19
+ const CJK_RUN_RE = /[\u3005-\u3007\u3040-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF66-\uFF9F\u{20000}-\u{2A6DF}\u{2A700}-\u{2EE5D}\u{2F800}-\u{2FA1F}\u{30000}-\u{33479}]{2}/u;
20
+ /** Whether the text holds words set without spaces between them (see
21
+ * {@link CJK_RUN_RE}), which only a first-fit breaker can divide: optimal
22
+ * line breaking breaks at spaces and hyphenation points. */
23
+ export function hasCJKRun(text) {
24
+ return CJK_RUN_RE.test(text);
25
+ }
26
+ /**
27
+ * Where a line may break inside a run of text with no spaces, as pretext's
28
+ * own breaker finds it: between two characters when either is CJK. Pretext's
29
+ * segments carry its kinsoku rules, so no line starts with closing
30
+ * punctuation (。、」ー…) and none ends with an opening bracket (「(…).
31
+ * Offsets into `text`, ascending; none when the run holds no CJK.
32
+ */
33
+ export function cjkBreakIndices(text, font) {
34
+ if (!CJK_RE.test(text))
35
+ return [];
36
+ const segments = prepareWithSegments(text, font).segments;
37
+ if (segments.join('') !== text)
38
+ return [];
39
+ const out = [];
40
+ let at = 0;
41
+ for (let k = 0; k < segments.length; k++) {
42
+ const seg = segments[k];
43
+ if (k > 0 && at > 0 && (CJK_RE.test(lastChar(segments[k - 1])) || CJK_RE.test(firstChar(seg))))
44
+ out.push(at);
45
+ at += seg.length;
46
+ }
47
+ return out;
48
+ }
49
+ /** Whether a line may break where two runs meet with no space between them
50
+ * (`**日本**語`): only between ideographs, under the same kinsoku rules as
51
+ * inside a run. */
52
+ export function cjkJoinBreaks(left, right, font) {
53
+ const a = lastChar(left);
54
+ const b = firstChar(right);
55
+ if (a === '' || b === '')
56
+ return false;
57
+ return cjkBreakIndices(a + b, font).length > 0;
58
+ }
59
+ function firstChar(text) {
60
+ const cp = text.codePointAt(0);
61
+ return cp === undefined ? '' : String.fromCodePoint(cp);
62
+ }
63
+ function lastChar(text) {
64
+ if (text.length === 0)
65
+ return '';
66
+ const low = text.charCodeAt(text.length - 1);
67
+ const start = low >= 0xdc00 && low <= 0xdfff && text.length > 1 ? text.length - 2 : text.length - 1;
68
+ return text.slice(start);
69
+ }
70
+ //# sourceMappingURL=cjk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cjk.js","sourceRoot":"","sources":["../../src/measure/cjk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,GAAG,4KAA4K,CAAC;AAE5L,gDAAgD;AAChD,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,GAAG,yMAAyM,CAAC;AAE7N;;6DAE6D;AAC7D,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,IAAY;IACxD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC1D,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC1C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAE,CAAC;QACzB,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,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AI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,24 +1,40 @@
1
- import type { HyphenationLocale } from '../types';
1
+ import type { LocaleTag } from '../types';
2
2
  import type { MeasurementCache } from './types';
3
3
  /**
4
4
  * Build a CSS font shorthand string for canvas / pretext.
5
5
  * Example: "75px EB Garamond"
6
6
  */
7
7
  export declare function buildFontString(fontFamily: string, fontSizePx: number, weight?: string, style?: string): string;
8
+ /** Whether a `fontFamily` value is a CSS font stack (`'EB Garamond',
9
+ * Georgia, serif`) rather than one family: it has a comma outside quotes. */
10
+ export declare function isFontStack(fontFamily: string): boolean;
11
+ /**
12
+ * The one family a `fontFamily` value sets text in. A `fontFamily` names a
13
+ * single family: canvas, HTML and PDF must measure and paint the same face,
14
+ * and the PDF embeds a font per family, with no fallback chain. A CSS font
15
+ * stack is therefore cut to its first family (`'EB Garamond', serif` →
16
+ * `EB Garamond`) instead of being read as one family whose name has a
17
+ * comma in it — which matched no face and measured with a fallback font.
18
+ * Any other value comes back unchanged (a comma inside quotes is part of
19
+ * the name).
20
+ */
21
+ export declare function primaryFontFamily(fontFamily: string): string;
8
22
  /**
9
23
  * A family name the CSS font shorthand would not take bare — a word that
10
24
  * starts with a digit ("Optima 105", "DIN Pro 120"), a character outside
11
25
  * letters, digits, spaces, hyphens and underscores — goes in double quotes;
12
26
  * canvas silently ignores the whole shorthand otherwise. Plain names stay
13
27
  * bare (the existing font-string cache keys), and a name already quoted is
14
- * left alone.
28
+ * left alone. A font stack sets in its first family (see
29
+ * {@link primaryFontFamily}).
15
30
  */
16
31
  export declare function quoteFamily(fontFamily: string): string;
17
32
  /**
18
- * Initializes the hyphenator for a given locale.
19
- * Must be called before measureBlock is used with hyphenation.
33
+ * Initializes the hyphenator for a given locale (any BCP 47 tag; see
34
+ * `matchHyphenationLocale`). Must be called before measureBlock is used with
35
+ * hyphenation.
20
36
  */
21
- export declare function initHyphenator(locale: HyphenationLocale): void;
37
+ export declare function initHyphenator(locale: LocaleTag): void;
22
38
  /**
23
39
  * Clear pretext's internal measurement caches and the engine's own
24
40
  * text-width cache. Call this after fonts finish loading (or are removed)
@@ -1 +1 @@
1
- {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/measure/font.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,MAAiB,EACzB,KAAK,GAAE,MAAiB,GACvB,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD"}
1
+ {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/measure/font.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,MAAiB,EACzB,KAAK,GAAE,MAAiB,GACvB,MAAM,CAOR;AAgCD;8EAC8E;AAC9E,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAEzD"}
@@ -15,16 +15,72 @@ export function buildFontString(fontFamily, fontSizePx, weight = 'normal', style
15
15
  parts.push(quoteFamily(fontFamily));
16
16
  return parts.join(' ');
17
17
  }
18
+ /** The families of a CSS font stack, split at the commas outside quotes,
19
+ * trimmed and unquoted, empty entries dropped — or `undefined` when the
20
+ * value has no comma outside quotes (it names one family). */
21
+ function stackFamilies(fontFamily) {
22
+ const out = [];
23
+ let quote;
24
+ let start = 0;
25
+ let split = false;
26
+ const push = (end) => {
27
+ let f = fontFamily.slice(start, end).trim();
28
+ if (f.length >= 2 && /^["']/.test(f) && f.endsWith(f[0]))
29
+ f = f.slice(1, -1).trim();
30
+ if (f.length > 0)
31
+ out.push(f);
32
+ };
33
+ for (let i = 0; i < fontFamily.length; i++) {
34
+ const c = fontFamily[i];
35
+ if (quote) {
36
+ if (c === quote)
37
+ quote = undefined;
38
+ }
39
+ else if (c === '"' || c === "'") {
40
+ quote = c;
41
+ }
42
+ else if (c === ',') {
43
+ push(i);
44
+ start = i + 1;
45
+ split = true;
46
+ }
47
+ }
48
+ if (!split)
49
+ return undefined;
50
+ push(fontFamily.length);
51
+ return out;
52
+ }
53
+ /** Whether a `fontFamily` value is a CSS font stack (`'EB Garamond',
54
+ * Georgia, serif`) rather than one family: it has a comma outside quotes. */
55
+ export function isFontStack(fontFamily) {
56
+ return fontFamily.includes(',') && (stackFamilies(fontFamily)?.length ?? 0) > 0;
57
+ }
58
+ /**
59
+ * The one family a `fontFamily` value sets text in. A `fontFamily` names a
60
+ * single family: canvas, HTML and PDF must measure and paint the same face,
61
+ * and the PDF embeds a font per family, with no fallback chain. A CSS font
62
+ * stack is therefore cut to its first family (`'EB Garamond', serif` →
63
+ * `EB Garamond`) instead of being read as one family whose name has a
64
+ * comma in it — which matched no face and measured with a fallback font.
65
+ * Any other value comes back unchanged (a comma inside quotes is part of
66
+ * the name).
67
+ */
68
+ export function primaryFontFamily(fontFamily) {
69
+ if (!fontFamily.includes(','))
70
+ return fontFamily;
71
+ return stackFamilies(fontFamily)?.[0] ?? fontFamily;
72
+ }
18
73
  /**
19
74
  * A family name the CSS font shorthand would not take bare — a word that
20
75
  * starts with a digit ("Optima 105", "DIN Pro 120"), a character outside
21
76
  * letters, digits, spaces, hyphens and underscores — goes in double quotes;
22
77
  * canvas silently ignores the whole shorthand otherwise. Plain names stay
23
78
  * bare (the existing font-string cache keys), and a name already quoted is
24
- * left alone.
79
+ * left alone. A font stack sets in its first family (see
80
+ * {@link primaryFontFamily}).
25
81
  */
26
82
  export function quoteFamily(fontFamily) {
27
- const f = fontFamily.trim();
83
+ const f = primaryFontFamily(fontFamily).trim();
28
84
  if (/^["'].*["']$/.test(f))
29
85
  return f;
30
86
  if (/(^|\s)\d/.test(f) || /[^\w\s-]/.test(f))
@@ -32,8 +88,9 @@ export function quoteFamily(fontFamily) {
32
88
  return f;
33
89
  }
34
90
  /**
35
- * Initializes the hyphenator for a given locale.
36
- * Must be called before measureBlock is used with hyphenation.
91
+ * Initializes the hyphenator for a given locale (any BCP 47 tag; see
92
+ * `matchHyphenationLocale`). Must be called before measureBlock is used with
93
+ * hyphenation.
37
94
  */
38
95
  export function initHyphenator(locale) {
39
96
  setHyphenationLocale(locale);
@@ -1 +1 @@
1
- {"version":3,"file":"font.js","sourceRoot":"","sources":["../../src/measure/font.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C;;;GAGG;AACH,MAAM,UAAU,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kB;IAC5C,MAAM,CAAC,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACrC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IACnF,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAiB;IAC9C,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,UAAU,EAAE,CAAC;IACb,mBAAmB,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAChC,CAAC"}
@@ -1,7 +1,21 @@
1
- export type { MeasuredBlock, MeasurementCache, MeasureBlockOptions } from './types';
1
+ import type { InlineSpan } from '../parse';
2
+ import type { MeasuredBlock, MeasurementCache, MeasureBlockOptions } from './types';
3
+ export type { BreakTrace, LineWidthStep, MeasuredBlock, MeasurementCache, MeasureBlockOptions } from './types';
2
4
  export { buildFontString, initHyphenator, clearMeasurementCache, createMeasurementCache } from './font';
3
5
  export { measureGlyphWidth, measureTextWidth } from './canvas';
4
6
  export { measureBlock } from './plain';
5
7
  export { measureRichBlock } from './rich';
6
- export { cachedMeasureBlock, cachedMeasureRichBlock } from './cache';
8
+ /** {@link measureBlock} through `cache`: the same text, font, width,
9
+ * leading and options measured before come back from it (a copy). A
10
+ * measurement with `options.keepBreaks` or `options.restWidths` is never
11
+ * cached, since its lines follow the breaks it keeps or the measures it
12
+ * was given: it is measured afresh and leaves the cache as it was. One
13
+ * with `breakAfterDashes`, `optimalRagged`, `breakAfterHyphens`,
14
+ * `hyphenateCompounds: false` or `repeatHyphen` is kept apart from the
15
+ * others, one set per combination of them. */
16
+ export declare function cachedMeasureBlock(text: string, font: string, maxWidthPx: number, lineHeightPx: number, options: MeasureBlockOptions | undefined, cache: MeasurementCache): MeasuredBlock;
17
+ /** {@link measureRichBlock} through `cache`, as {@link cachedMeasureBlock}
18
+ * does it: a measurement with `options.keepBreaks` or
19
+ * `options.restWidths` is never cached. */
20
+ export declare function cachedMeasureRichBlock(spans: InlineSpan[], normalFont: string, boldFont: string, italicFont: string, boldItalicFont: string, maxWidthPx: number, lineHeightPx: number, options: MeasureBlockOptions | undefined, cache: MeasurementCache): MeasuredBlock;
7
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/measure/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/measure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMpF,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAwC1C;;;;;;;+CAO+C;AAC/C,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAIf;AAED;;4CAE4C;AAC5C,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,mBAAmB,GAAG,SAAS,EACxC,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAIf"}
@@ -1,6 +1,66 @@
1
+ import { measureBlock } from './plain';
2
+ import { measureRichBlock } from './rich';
3
+ import { cachedMeasureBlock as cachedPlainBlock, cachedMeasureRichBlock as cachedRichBlock } from './cache';
4
+ import { hasCompound } from './breakRules';
1
5
  export { buildFontString, initHyphenator, clearMeasurementCache, createMeasurementCache } from './font';
2
6
  export { measureGlyphWidth, measureTextWidth } from './canvas';
3
7
  export { measureBlock } from './plain';
4
8
  export { measureRichBlock } from './rich';
5
- export { cachedMeasureBlock, cachedMeasureRichBlock } from './cache';
9
+ /** The caches that hold measurements made with the line-breaking options
10
+ * added after postext 1.4 (`breakAfterDashes`, `optimalRagged`,
11
+ * `breakAfterHyphens`, `hyphenateCompounds: false`, `repeatHyphen`), per
12
+ * cache and per combination of them. `measure/cache.ts` keys a block on
13
+ * the options it knew; a block measured with one of these goes to a cache
14
+ * of its own, so each combination keeps its own lines and the keys of the
15
+ * others are unchanged. A worker that drops its cache for a fresh one
16
+ * drops these with it. */
17
+ const optionVariants = new WeakMap();
18
+ const DASH_RE = /[\u2013\u2014]/;
19
+ /** The cache for a measurement of `text` with `options`. An option that
20
+ * cannot change these lines (no dash or compound in the text, justified or
21
+ * first-fit text, hyphenation off) leaves it in the shared one. */
22
+ function cacheFor(cache, options, text) {
23
+ const dashes = options?.breakAfterDashes === true && DASH_RE.test(text);
24
+ const ragged = options?.optimalRagged === true && options.optimal === true && (options.textAlign ?? 'left') !== 'justify';
25
+ const compound = (options?.breakAfterHyphens === true || options?.repeatHyphen === true
26
+ || (options?.hyphenateCompounds === false && options.hyphenate === true)) && hasCompound(text);
27
+ const hyphens = compound && options?.breakAfterHyphens === true;
28
+ const whole = compound && options?.hyphenateCompounds === false && options.hyphenate === true;
29
+ const repeat = compound && options?.repeatHyphen === true;
30
+ const variant = `${dashes ? 'd' : ''}${ragged ? 'r' : ''}${hyphens ? 'h' : ''}${whole ? 'w' : ''}${repeat ? 'p' : ''}`;
31
+ if (variant === '')
32
+ return cache;
33
+ let byVariant = optionVariants.get(cache);
34
+ if (!byVariant) {
35
+ byVariant = new Map();
36
+ optionVariants.set(cache, byVariant);
37
+ }
38
+ let own = byVariant.get(variant);
39
+ if (!own) {
40
+ own = { _blocks: new Map() };
41
+ byVariant.set(variant, own);
42
+ }
43
+ return own;
44
+ }
45
+ /** {@link measureBlock} through `cache`: the same text, font, width,
46
+ * leading and options measured before come back from it (a copy). A
47
+ * measurement with `options.keepBreaks` or `options.restWidths` is never
48
+ * cached, since its lines follow the breaks it keeps or the measures it
49
+ * was given: it is measured afresh and leaves the cache as it was. One
50
+ * with `breakAfterDashes`, `optimalRagged`, `breakAfterHyphens`,
51
+ * `hyphenateCompounds: false` or `repeatHyphen` is kept apart from the
52
+ * others, one set per combination of them. */
53
+ export function cachedMeasureBlock(text, font, maxWidthPx, lineHeightPx, options, cache) {
54
+ return options?.keepBreaks || options?.restWidths
55
+ ? measureBlock(text, font, maxWidthPx, lineHeightPx, options)
56
+ : cachedPlainBlock(text, font, maxWidthPx, lineHeightPx, options, cacheFor(cache, options, text));
57
+ }
58
+ /** {@link measureRichBlock} through `cache`, as {@link cachedMeasureBlock}
59
+ * does it: a measurement with `options.keepBreaks` or
60
+ * `options.restWidths` is never cached. */
61
+ export function cachedMeasureRichBlock(spans, normalFont, boldFont, italicFont, boldItalicFont, maxWidthPx, lineHeightPx, options, cache) {
62
+ return options?.keepBreaks || options?.restWidths
63
+ ? measureRichBlock(spans, normalFont, boldFont, italicFont, boldItalicFont, maxWidthPx, lineHeightPx, options)
64
+ : cachedRichBlock(spans, normalFont, boldFont, italicFont, boldItalicFont, maxWidthPx, lineHeightPx, options, cacheFor(cache, options, spans.map((s) => s.text).join('')));
65
+ }
6
66
  //# sourceMappingURL=index.js.map