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,788 @@
1
+ // Which rules a stored configuration was written for, and how one written
2
+ // for older rules is read in today's terms. A `.postext` manifest carries
3
+ // the number as `configVersion` (every writer since postext 1.5 sets it);
4
+ // the Sandbox numbers its stored projects the same way.
5
+ import { DEFAULT_MATH_CONFIG } from '../defaults/math';
6
+ import { dimensionsEqual } from '../defaults/shared';
7
+ import { DEFAULT_TEXT_ELEMENT, resolveDesignLineHeight } from '../defaults/headerFooter';
8
+ import { DEFAULT_PAGE_CONFIG } from '../defaults/page';
9
+ import { dimensionToPx } from '../units';
10
+ import { KNOWN_CONTAINERS } from '../parse/blockParser';
11
+ /**
12
+ * The configuration rules this engine writes: 8 since postext 1.5. Thirteen
13
+ * rules changed in that release, and a configuration stored under an older
14
+ * number (or none) is read through {@link migrateConfig}:
15
+ * - 3: a heading level's `breakBefore` (and a heading style's) merges field
16
+ * by field onto the level's default — H1's being `always-odd`
17
+ * ({@link pinLegacyHeadingBreaks});
18
+ * - 4: one em of a formula is the surrounding text's size ×
19
+ * `math.fontSizeScale`, where up to 1.4 formulas came out
20
+ * {@link LEGACY_MATH_SIZE}× larger ({@link pinLegacyMathSize});
21
+ * - 5: an inline resource keeps the float gap below it as well as above
22
+ * (`layout.inlineResourceGap: 'around'`), where up to 1.4 the text after
23
+ * it resumed at the next grid line ({@link pinLegacyInlineGap});
24
+ * - 6, five rules:
25
+ * - a heading reads its inline marks (`headings.inlineMarks: true`),
26
+ * where up to 1.4 it printed them as plain text ({@link
27
+ * pinLegacyHeadingMarks});
28
+ * - a design text's drop cap that names no size is set at the size that
29
+ * brings its top level with the first line's capitals, where up to 1.4
30
+ * it was as tall as all the line boxes it spans ({@link
31
+ * pinLegacyDropCapSize});
32
+ * - `bodyText.keepColonWithList` leaves room under the colon line for
33
+ * the list's first item to start by its orphan and widow rules
34
+ * (`bodyText.colonListRoom: 'item'`), where up to 1.4 one line was
35
+ * enough ({@link pinLegacyColonListRoom});
36
+ * - an inline resource inside a box keeps the float gap too
37
+ * (`layout.inlineResourceGapInBoxes`), where up to 1.4 it sat right
38
+ * against the text around it ({@link pinLegacyBoxResourceGap});
39
+ * - a box that splits inside a paragraph or list item leaves at least two
40
+ * lines of it on each side (`layout.boxChildSplitMinLines: 2`), where
41
+ * up to 1.4 a cut could leave one ({@link pinLegacyBoxChildCut});
42
+ * - 7, two rules:
43
+ * - a line may end after an em or en dash set closed between words
44
+ * (`bodyText.breakAfterDashes`), where up to 1.4 Knuth–Plass never
45
+ * broke there ({@link pinLegacyDashBreaks});
46
+ * - ragged running text is broken with Knuth–Plass too
47
+ * (`bodyText.optimalRagged`), where up to 1.4 it was set line by line
48
+ * ({@link pinLegacyRaggedBreaking});
49
+ * - 8, three rules:
50
+ * - a paragraph kept with the heading above it at a column's foot
51
+ * splits by the orphan rule too (`headings.keepWithNextSplit:
52
+ * 'rules'`), where up to 1.4 it kept as many lines as fit under the
53
+ * heading ({@link pinLegacyHeadingSplit});
54
+ * - the space under a `:::paragraphs` container merges with the next
55
+ * block's own and is at least the paragraph spacing of the text around
56
+ * it (`bodyText.paragraphContainerSpacing: 'collapse'`), where up to
57
+ * 1.4 the style's space was baked into the grid snap and the next
58
+ * block's space above added under it ({@link
59
+ * pinLegacyParagraphContainerSpacing});
60
+ * - Knuth–Plass may end a line after the hyphen of a compound in every
61
+ * paragraph (`bodyText.breakAfterHyphens`), where up to 1.4 a justified
62
+ * paragraph with no inline formatting never broke there ({@link
63
+ * pinLegacyHyphenBreaks}).
64
+ *
65
+ * A configuration stored without a version was written for postext 1.4 or
66
+ * earlier. One stored under 3 to 7 was written by a 1.5 prerelease, and
67
+ * gets the pins of the rules after its number: under 3 the maths,
68
+ * inline-gap, version-6, version-7 and version-8 pins, under 4 the
69
+ * inline-gap, version-6, version-7 and version-8 pins, under 5 the
70
+ * version-6, version-7 and version-8 pins, under 6 the version-7 and
71
+ * version-8 pins, under 7 the version-8 pins.
72
+ */
73
+ export const CONFIG_VERSION = 8;
74
+ /** The rules that merge a partial heading break onto its level's. */
75
+ const HEADING_BREAK_RULES = 3;
76
+ /** The rules that set a formula's em at the documented size. */
77
+ const MATH_SIZE_RULES = 4;
78
+ /** The rules that keep the float gap under an inline resource. */
79
+ const INLINE_GAP_RULES = 5;
80
+ /** The rules that read a heading's inline marks, and size a drop cap to
81
+ * the first line's capitals. */
82
+ const HEADING_MARKS_RULES = 6;
83
+ const DROP_CAP_SIZE_RULES = 6;
84
+ /** The rules that leave room for a list's first item under its colon line. */
85
+ const COLON_LIST_ROOM_RULES = 6;
86
+ /** The rules that keep the gap around an inline resource inside a box. */
87
+ const BOX_GAP_RULES = 6;
88
+ /** The rules that keep two lines of a paragraph or list item on each side
89
+ * of a box cut. */
90
+ const BOX_CHILD_CUT_RULES = 6;
91
+ /** The rules that let a line end after a closed dash. */
92
+ const DASH_BREAK_RULES = 7;
93
+ /** The rules that break ragged running text with Knuth–Plass. */
94
+ const RAGGED_BREAKING_RULES = 7;
95
+ /** The rules that keep the orphan minimum when a paragraph splits under a
96
+ * heading. */
97
+ const HEADING_SPLIT_RULES = 8;
98
+ /** The rules that merge the space under a `:::paragraphs` container with
99
+ * the next block's. */
100
+ const PARAGRAPH_CONTAINER_RULES = 8;
101
+ /** The rules that let Knuth–Plass break after a compound's hyphen in every
102
+ * paragraph. */
103
+ const HYPHEN_BREAK_RULES = 8;
104
+ /** Up to 1.4 a drop cap with no `fontSize` was as tall as the line boxes it
105
+ * spans divided by this, the share of a letter's size its capitals take. */
106
+ const CAP_HEIGHT = 0.72;
107
+ /**
108
+ * How much larger postext 1.4 set maths than the size it documents:
109
+ * MathJax gives a formula's box in `ex`, one `ex` of its TeX font is
110
+ * 0.442 em (the font's `x_height`), and 1.4 took it as half an em. So
111
+ * 0.5 ÷ 0.442 ≈ 1.1312; a configuration whose `math.fontSizeScale` is
112
+ * multiplied by it sets every formula at the size 1.4 did.
113
+ */
114
+ export const LEGACY_MATH_SIZE = 0.5 / 0.442;
115
+ function isRecord(v) {
116
+ return typeof v === 'object' && v !== null && !Array.isArray(v);
117
+ }
118
+ /** A stored `configVersion`: a finite number, anything else counting as
119
+ * none (written by postext 1.4 or earlier). */
120
+ function rulesOf(configVersion) {
121
+ return typeof configVersion === 'number' && Number.isFinite(configVersion) ? configVersion : 0;
122
+ }
123
+ /** A partial `breakBefore` as postext 1.4 resolved it where the default
124
+ * it filled from was the no-break one, written out in full; undefined
125
+ * when it already says all it lays out. */
126
+ function pinnedBreak(raw) {
127
+ const enabled = raw?.enabled ?? false;
128
+ if (raw?.enabled !== undefined && (!enabled || raw.parity !== undefined))
129
+ return undefined;
130
+ return { ...raw, enabled, ...(enabled && raw?.parity === undefined ? { parity: 'any' } : {}) };
131
+ }
132
+ /**
133
+ * A configuration written for postext 1.4 or earlier, pinned to the heading
134
+ * breaks it laid out then. Up to 1.4 a `headings` object turned the H1 page
135
+ * break off unless it set `levels[0].breakBefore.enabled` (and stripping the
136
+ * defaults dropped an H1 `enabled: false`, so saved and exported
137
+ * configurations never carried one), a partial H1 break took its missing
138
+ * field from the no-break default, and a heading style's `breakBefore`
139
+ * replaced its level's with the same fill. The engine now merges each onto
140
+ * the level's break — H1's being `always-odd` — so those breaks are written
141
+ * out: `enabled: false` on H1, or `parity: 'any'` beside an `enabled: true`.
142
+ * A configuration with no `headings` object, or one that spells every break
143
+ * out in full, is returned as it is (the same object).
144
+ */
145
+ export function pinLegacyHeadingBreaks(config) {
146
+ let out = config;
147
+ const headings = config.headings;
148
+ if (isRecord(headings)) {
149
+ const levels = Array.isArray(headings.levels) ? headings.levels : [];
150
+ const i = levels.findIndex((l) => isRecord(l) && l.level === 1);
151
+ const pin = pinnedBreak(i >= 0 && isRecord(levels[i].breakBefore) ? levels[i].breakBefore : undefined);
152
+ if (pin) {
153
+ const nextLevels = i >= 0
154
+ ? levels.map((l, k) => (k === i ? { ...l, breakBefore: pin } : l))
155
+ : [...levels, { level: 1, breakBefore: pin }];
156
+ out = { ...out, headings: { ...headings, levels: nextLevels } };
157
+ }
158
+ }
159
+ if (Array.isArray(config.headingStyles)) {
160
+ let changed = false;
161
+ const styles = config.headingStyles.map((style) => {
162
+ if (!isRecord(style) || !isRecord(style.breakBefore))
163
+ return style;
164
+ const pin = pinnedBreak(style.breakBefore);
165
+ if (!pin)
166
+ return style;
167
+ changed = true;
168
+ return { ...style, breakBefore: pin };
169
+ });
170
+ if (changed)
171
+ out = { ...out, headingStyles: styles };
172
+ }
173
+ return out;
174
+ }
175
+ function isDimension(v) {
176
+ return isRecord(v) && typeof v.value === 'number' && typeof v.unit === 'string';
177
+ }
178
+ /**
179
+ * A configuration written before postext 1.5, pinned to the maths size it
180
+ * laid out then: `math.fontSizeScale` (1 when unset) × {@link
181
+ * LEGACY_MATH_SIZE}. A display formula's margins in `em` or `rem` are
182
+ * lengths of the formula's own size, so they are divided by the same
183
+ * factor and keep the space 1.4 left around the formula. A value that
184
+ * lands on its default is left out (a scale of 0.884 becomes the default
185
+ * 1), and a configuration with maths switched off (`math.enabled: false`,
186
+ * whose formulas are set as their TeX source at the body size) is
187
+ * returned as it is (the same object).
188
+ */
189
+ export function pinLegacyMathSize(config) {
190
+ const math = isRecord(config.math) ? config.math : {};
191
+ if (math.enabled === false)
192
+ return config;
193
+ const next = { ...math };
194
+ const scale = typeof math.fontSizeScale === 'number' && Number.isFinite(math.fontSizeScale)
195
+ ? math.fontSizeScale
196
+ : DEFAULT_MATH_CONFIG.fontSizeScale;
197
+ const pinnedScale = scale * LEGACY_MATH_SIZE;
198
+ if (pinnedScale === DEFAULT_MATH_CONFIG.fontSizeScale)
199
+ delete next.fontSizeScale;
200
+ else
201
+ next.fontSizeScale = pinnedScale;
202
+ for (const key of ['marginTop', 'marginBottom']) {
203
+ const margin = isDimension(math[key]) ? math[key] : DEFAULT_MATH_CONFIG[key];
204
+ if (margin.unit !== 'em' && margin.unit !== 'rem')
205
+ continue;
206
+ const pinned = { ...margin, value: margin.value / LEGACY_MATH_SIZE };
207
+ if (dimensionsEqual(pinned, DEFAULT_MATH_CONFIG[key]))
208
+ delete next[key];
209
+ else
210
+ next[key] = pinned;
211
+ }
212
+ return { ...config, math: next };
213
+ }
214
+ /**
215
+ * A configuration written before postext 1.5, pinned to the space it left
216
+ * under an inline resource: `layout.inlineResourceGap: 'above'`, where 1.4
217
+ * kept the float gap above the resource only and set the text after it at
218
+ * the next grid line. A configuration that names a gap already is returned
219
+ * as it is (the same object).
220
+ */
221
+ export function pinLegacyInlineGap(config) {
222
+ const layout = isRecord(config.layout) ? config.layout : {};
223
+ if (layout.inlineResourceGap !== undefined)
224
+ return config;
225
+ return { ...config, layout: { ...layout, inlineResourceGap: 'above' } };
226
+ }
227
+ /**
228
+ * A configuration written before postext 1.5, pinned to the room it left
229
+ * for a list under the colon line that introduces it:
230
+ * `bodyText.colonListRoom: 'line'`, where 1.4 took one line of room as
231
+ * enough and a first item the orphan and widow rules keep whole went on
232
+ * to the next column without the colon line. A configuration that names a
233
+ * room already, or turns `keepColonWithList` off, is returned as it is
234
+ * (the same object).
235
+ */
236
+ export function pinLegacyColonListRoom(config) {
237
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
238
+ if (bodyText.colonListRoom !== undefined || bodyText.keepColonWithList === false)
239
+ return config;
240
+ return { ...config, bodyText: { ...bodyText, colonListRoom: 'line' } };
241
+ }
242
+ /** A paragraph line ending in a colon (emphasis markers may close after
243
+ * it) with a list item next, blank lines between them allowed: the lead-in
244
+ * `keepColonWithList` keeps with its list. */
245
+ const COLON_LIST_RE = /:[*_]*[^\S\n]*\n(?:[^\S\n]*\n)*[^\S\n]*(?:[-*+]|\d+[.)])[^\S\n]/;
246
+ /**
247
+ * A configuration written before postext 1.5, pinned to the space it left
248
+ * around an inline resource inside a box: `layout.inlineResourceGapInBoxes:
249
+ * false`, where 1.4 set the resource right under the text before it and
250
+ * the text after it right under the resource. A configuration that already
251
+ * says whether boxes keep the gap is returned as it is (the same object).
252
+ */
253
+ export function pinLegacyBoxResourceGap(config) {
254
+ const layout = isRecord(config.layout) ? config.layout : {};
255
+ if (layout.inlineResourceGapInBoxes !== undefined)
256
+ return config;
257
+ return { ...config, layout: { ...layout, inlineResourceGapInBoxes: false } };
258
+ }
259
+ /**
260
+ * A configuration written before postext 1.5, pinned to the cuts it made in
261
+ * a box that splits: `layout.boxChildSplitMinLines: 1`, where 1.4 cut
262
+ * inside a paragraph or list item wherever each side of the box held its
263
+ * `splitMinLines` lines in all, even when that left one line of the
264
+ * paragraph or item on a side. A configuration that names the setting
265
+ * already is returned as it is (the same object).
266
+ */
267
+ export function pinLegacyBoxChildCut(config) {
268
+ const layout = isRecord(config.layout) ? config.layout : {};
269
+ if (layout.boxChildSplitMinLines !== undefined)
270
+ return config;
271
+ return { ...config, layout: { ...layout, boxChildSplitMinLines: 1 } };
272
+ }
273
+ /**
274
+ * A configuration written before postext 1.5, pinned to the line breaks it
275
+ * made at a dash: `bodyText.breakAfterDashes: false`, where 1.4's
276
+ * Knuth–Plass never ended a line after an em or en dash set closed between
277
+ * words ("say—that’s"), and its line-by-line breaker for formatted text
278
+ * only between two letters. A configuration that names the setting already
279
+ * is returned as it is (the same object).
280
+ */
281
+ export function pinLegacyDashBreaks(config) {
282
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
283
+ if (bodyText.breakAfterDashes !== undefined)
284
+ return config;
285
+ return { ...config, bodyText: { ...bodyText, breakAfterDashes: false } };
286
+ }
287
+ /**
288
+ * A configuration written before postext 1.5, pinned to the way it broke
289
+ * ragged text: `bodyText.optimalRagged: false`, where 1.4 set every ragged
290
+ * paragraph line by line, filling each line before the next, whatever
291
+ * `optimalLineBreaking` said. A configuration that names the setting
292
+ * already, that sets no running text ragged (the body, a paragraph style,
293
+ * a box body, the body of a part or of a section style, in the
294
+ * configuration or in its HTML viewer's overrides), or that turns
295
+ * `optimalLineBreaking` off (the setting then changes nothing) is returned
296
+ * as it is (the same object).
297
+ */
298
+ export function pinLegacyRaggedBreaking(config) {
299
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
300
+ if (bodyText.optimalRagged !== undefined || bodyText.optimalLineBreaking === false)
301
+ return config;
302
+ if (!setsRaggedText(config))
303
+ return config;
304
+ return { ...config, bodyText: { ...bodyText, optimalRagged: false } };
305
+ }
306
+ /**
307
+ * A configuration written before postext 1.5, pinned to the way it split a
308
+ * paragraph kept with the heading above it at a column's foot:
309
+ * `headings.keepWithNextSplit: 'fill'`, where 1.4 kept as many lines as fit
310
+ * under the heading (at least `bodyText.widowMinLines`) however few went on
311
+ * to the next column. A configuration that names the setting already, that
312
+ * turns `headings.keepWithNext` off, or that turns `bodyText.avoidOrphans`
313
+ * off (the setting then changes nothing) is returned as it is (the same
314
+ * object).
315
+ */
316
+ export function pinLegacyHeadingSplit(config) {
317
+ const headings = isRecord(config.headings) ? config.headings : {};
318
+ if (headings.keepWithNextSplit !== undefined || headings.keepWithNext === false)
319
+ return config;
320
+ if (isRecord(config.bodyText) && config.bodyText.avoidOrphans === false)
321
+ return config;
322
+ return { ...config, headings: { ...headings, keepWithNextSplit: 'fill' } };
323
+ }
324
+ /**
325
+ * A configuration written before postext 1.5, pinned to the space it left
326
+ * under a `:::paragraphs` container: `bodyText.paragraphContainerSpacing:
327
+ * 'add'`, where 1.4 set the style's space (the larger of `spaceBetween` and
328
+ * `marginBottom`) under the last paragraph before the grid snap, added the
329
+ * next block's own space above (a heading's `marginTop`, the next
330
+ * container's) under it, and left the paragraph spacing of the text around
331
+ * the container out. A configuration that names the setting already, or
332
+ * declares no paragraph style (in the configuration or in its HTML
333
+ * viewer's overrides; a container naming no style is set as body text), is
334
+ * returned as it is (the same object).
335
+ */
336
+ export function pinLegacyParagraphContainerSpacing(config) {
337
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
338
+ if (bodyText.paragraphContainerSpacing !== undefined)
339
+ return config;
340
+ if (!declaresParagraphStyles(config))
341
+ return config;
342
+ return { ...config, bodyText: { ...bodyText, paragraphContainerSpacing: 'add' } };
343
+ }
344
+ /** Whether `config` (or the screen overrides of its HTML viewer) declares
345
+ * a paragraph style, which is all a `:::paragraphs` container is laid out
346
+ * with. */
347
+ function declaresParagraphStyles(config) {
348
+ const has = (c) => Array.isArray(c.paragraphStyles) && c.paragraphStyles.length > 0;
349
+ if (has(config))
350
+ return true;
351
+ const viewer = config.htmlViewer;
352
+ return isRecord(viewer) && isRecord(viewer.overrides) && has(viewer.overrides);
353
+ }
354
+ /** A `:::paragraphs` opening fence on a line of its own, as the block
355
+ * parser reads one (the line trimmed). */
356
+ const PARAGRAPHS_FENCE_LINE_RE = /^[^\S\n]*:::[^\S\n]*paragraphs[^\S\n]*(?:\{[^}\n]*\})?[^\S\n]*$/m;
357
+ /** Whether markdown may hold a `:::paragraphs` container. Unknown content
358
+ * (undefined) may. */
359
+ function mayHaveParagraphContainers(content) {
360
+ if (content === undefined)
361
+ return true;
362
+ if (typeof content === 'string')
363
+ return PARAGRAPHS_FENCE_LINE_RE.test(content);
364
+ return content.some((text) => PARAGRAPHS_FENCE_LINE_RE.test(text));
365
+ }
366
+ /**
367
+ * A configuration written before postext 1.5, pinned to the line breaks it
368
+ * made at the hyphen of a compound: `bodyText.breakAfterHyphens: false`,
369
+ * where 1.4's Knuth–Plass ended a justified line after a hyphen between two
370
+ * letters ("well-" | "known") only in a paragraph with inline formatting.
371
+ * A configuration that names the setting already, or turns
372
+ * `optimalLineBreaking` off (the setting then changes nothing), is returned
373
+ * as it is (the same object).
374
+ */
375
+ export function pinLegacyHyphenBreaks(config) {
376
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
377
+ if (bodyText.breakAfterHyphens !== undefined || bodyText.optimalLineBreaking === false)
378
+ return config;
379
+ return { ...config, bodyText: { ...bodyText, breakAfterHyphens: false } };
380
+ }
381
+ /** A compound a line may end in: a hyphen between two letters. The
382
+ * Markdown is read raw; only a paragraph with no inline mark is broken
383
+ * differently, and there the compound is written as it prints. */
384
+ const COMPOUND_RE = /\p{L}-\p{L}/u;
385
+ /** Whether markdown may set a compound. Unknown content (undefined) may. */
386
+ function mayHaveCompounds(content) {
387
+ if (content === undefined)
388
+ return true;
389
+ if (typeof content === 'string')
390
+ return COMPOUND_RE.test(content);
391
+ return content.some((text) => COMPOUND_RE.test(text));
392
+ }
393
+ /** Whether a `textAlign` value sets text ragged (anything but `'justify'`;
394
+ * an unset one follows the body). */
395
+ function isRaggedAlign(value) {
396
+ return typeof value === 'string' && value !== 'justify';
397
+ }
398
+ /** Whether `config` (or the screen overrides of its HTML viewer) sets some
399
+ * running text ragged: the body text (and so its blockquotes and lists), a
400
+ * paragraph style, a box body, the body of a part or the body of a
401
+ * section style (`headingStyles[].bodyStyle`). Headings do not count: they
402
+ * are not broken with Knuth–Plass when ragged. */
403
+ function setsRaggedText(config) {
404
+ const raggedBody = (st) => isRecord(st) && isRecord(st.bodyStyle) && isRaggedAlign(st.bodyStyle.textAlign);
405
+ const check = (c) => {
406
+ if (isRecord(c.bodyText) && isRaggedAlign(c.bodyText.textAlign))
407
+ return true;
408
+ if (Array.isArray(c.paragraphStyles) && c.paragraphStyles.some((st) => isRecord(st) && isRaggedAlign(st.textAlign)))
409
+ return true;
410
+ if (Array.isArray(c.calloutStyles) && c.calloutStyles.some((st) => isRecord(st) && isRecord(st.body) && isRaggedAlign(st.body.textAlign)))
411
+ return true;
412
+ if (Array.isArray(c.headingStyles) && c.headingStyles.some(raggedBody))
413
+ return true;
414
+ return raggedBody(c.parts);
415
+ };
416
+ if (check(config))
417
+ return true;
418
+ const viewer = config.htmlViewer;
419
+ return isRecord(viewer) && isRecord(viewer.overrides) && check(viewer.overrides);
420
+ }
421
+ /** A dash a line may end after (see `breaksAfterDash` in
422
+ * `measure/breakRules.ts`): an em or en dash set closed, a letter, a digit
423
+ * or closing punctuation before it, and a letter or a digit after it. A
424
+ * quotation mark before the dash counts only when something that may close
425
+ * a word stands before it (`"no"—and`, `„nein“—und`, `« non »—et`), not
426
+ * after a space (`said "—Hola`), where no rule breaks. The Markdown is read
427
+ * raw, so the inline marks that may touch the dash or the quote count on
428
+ * either side (`**riddles.**—I`, `*riddles*—and`, `*no*"—and`, a code
429
+ * span, a `:ref[…]`, an escape). An en dash between two digits, and a
430
+ * bracket or quote after the dash, which never break, are let through: the
431
+ * check only has to be safe. */
432
+ const CLOSED_DASH_RE = /(?:[\p{L}\p{N}.,;:!?)\]}…*_`~^\\]|[\p{L}\p{N}.,;:!?)\]}…*_`~^\\\u00A0\u202F]["'»”’“«])[\u2013\u2014][\p{L}\p{N}([{¿¡«“‘„"'*_`~^:\\<]/u;
433
+ /** Whether markdown may set a dash a line can now end after. Unknown
434
+ * content (undefined) may. */
435
+ function mayHaveClosedDashes(content) {
436
+ if (content === undefined)
437
+ return true;
438
+ if (typeof content === 'string')
439
+ return CLOSED_DASH_RE.test(content);
440
+ return content.some((text) => CLOSED_DASH_RE.test(text));
441
+ }
442
+ /**
443
+ * A configuration written before postext 1.5, pinned to the headings it
444
+ * laid out then: `headings.inlineMarks: false`, where 1.4 printed the text
445
+ * of a heading's `*italic*`, `**bold**` and other marks in the heading's
446
+ * plain style. A configuration that names the setting already is returned
447
+ * as it is (the same object).
448
+ */
449
+ export function pinLegacyHeadingMarks(config) {
450
+ const headings = isRecord(config.headings) ? config.headings : {};
451
+ if (headings.inlineMarks !== undefined)
452
+ return config;
453
+ return { ...config, headings: { ...headings, inlineMarks: false } };
454
+ }
455
+ /** The double next to `v`, one step towards `+∞` (`dir` 1) or `−∞`. */
456
+ function nextDouble(v, dir) {
457
+ if (v === 0)
458
+ return dir * Number.MIN_VALUE;
459
+ const view = new DataView(new ArrayBuffer(8));
460
+ view.setFloat64(0, v);
461
+ view.setBigInt64(0, view.getBigInt64(0) + ((v > 0) === (dir > 0) ? 1n : -1n));
462
+ return view.getFloat64(0);
463
+ }
464
+ /** A length in `unit` that `dimensionToPx` reads back as `px` at `dpi`
465
+ * (em against `basePx`): the plain conversion, or one of the doubles next
466
+ * to it when rounding leaves that a hair off. Most sizes read back
467
+ * exactly; for some unit, dpi and leading combinations no double does, and
468
+ * the plain conversion is kept, a rounding step or two (1e-14 px) away. */
469
+ function lengthOf(px, unit, dpi, basePx) {
470
+ const toPx = (value) => dimensionToPx({ value, unit }, dpi, basePx);
471
+ const first = px / toPx(1);
472
+ let up = first;
473
+ let down = first;
474
+ for (let step = 0; step < 16; step++) {
475
+ if (toPx(up) === px)
476
+ return { value: up, unit };
477
+ if (toPx(down) === px)
478
+ return { value: down, unit };
479
+ up = nextDouble(up, 1);
480
+ down = nextDouble(down, -1);
481
+ }
482
+ return { value: first, unit };
483
+ }
484
+ /** The size postext 1.4 set the drop cap of the design text `el` at, when
485
+ * the cap names none, `dpi` being the document's: the line boxes it spans
486
+ * over {@link CAP_HEIGHT}, worked out as 1.4 did and written in the unit of
487
+ * the element's leading (a length) or of its font size (a multiplier of
488
+ * it). Undefined when that cannot be written out. */
489
+ function legacyDropCapSize(el, dropCap, dpi) {
490
+ const lines = Math.max(1, Math.round(Number(dropCap.lines ?? 2)));
491
+ if (!Number.isFinite(lines))
492
+ return undefined;
493
+ const fontSize = isDimension(el.fontSize) ? el.fontSize : DEFAULT_TEXT_ELEMENT.fontSize;
494
+ // A design text's size is a length; one in em has nothing to read against.
495
+ if (fontSize.unit === 'em' || fontSize.unit === 'rem')
496
+ return undefined;
497
+ const fontSizePx = dimensionToPx(fontSize, dpi);
498
+ const leading = resolveDesignLineHeight(el.lineHeight, fontSize);
499
+ const lineHeightPx = leading.lineHeightLength ? dimensionToPx(leading.lineHeightLength, dpi) : fontSizePx * leading.lineHeight;
500
+ const capPx = (lines * lineHeightPx) / CAP_HEIGHT;
501
+ if (!Number.isFinite(capPx) || capPx <= 0)
502
+ return undefined;
503
+ return lengthOf(capPx, leading.lineHeightLength?.unit ?? fontSize.unit, dpi, fontSizePx);
504
+ }
505
+ /** `value` with every design text in it — a `kind: 'text'` object whose
506
+ * `dropCap` names no `fontSize` — given its 1.4 size, wherever it sits;
507
+ * the same object where nothing changed. */
508
+ function pinDropCaps(value, dpi) {
509
+ if (Array.isArray(value)) {
510
+ let changed = false;
511
+ const next = value.map((v) => {
512
+ const out = pinDropCaps(v, dpi);
513
+ if (out !== v)
514
+ changed = true;
515
+ return out;
516
+ });
517
+ return changed ? next : value;
518
+ }
519
+ if (!isRecord(value))
520
+ return value;
521
+ let out = value;
522
+ for (const [key, v] of Object.entries(value)) {
523
+ const next = pinDropCaps(v, dpi);
524
+ if (next === v)
525
+ continue;
526
+ if (out === value)
527
+ out = { ...value };
528
+ out[key] = next;
529
+ }
530
+ const dropCap = out.dropCap;
531
+ if (out.kind === 'text' && isRecord(dropCap) && dropCap.fontSize === undefined) {
532
+ const size = legacyDropCapSize(out, dropCap, dpi);
533
+ if (size)
534
+ out = { ...out, dropCap: { ...dropCap, fontSize: size } };
535
+ }
536
+ return out;
537
+ }
538
+ /**
539
+ * A configuration written before postext 1.5, pinned to the drop caps it
540
+ * laid out then. Up to 1.4 a design text's `dropCap` that named no
541
+ * `fontSize` was as tall as the line boxes it spans over 0.72 (the share of
542
+ * the size its capitals take), so its top stood above the capitals of the
543
+ * first line; today's default brings the two level. Every such drop cap,
544
+ * in whatever design it sits (running heads, heading designs and styles,
545
+ * part pages, the contents' part rows), gets that size written out: in the
546
+ * unit of the element's leading when that is a length, else in the unit of
547
+ * its font size, at the size 1.4 set at the document's `page.dpi` (to the
548
+ * last digit in most cases, and never more than a rounding step or two
549
+ * away). A configuration with none is returned as it is (the same object).
550
+ */
551
+ export function pinLegacyDropCapSize(config) {
552
+ const dpi = isRecord(config.page) && typeof config.page.dpi === 'number' && config.page.dpi > 0
553
+ ? config.page.dpi
554
+ : DEFAULT_PAGE_CONFIG.dpi;
555
+ return pinDropCaps(config, dpi);
556
+ }
557
+ /** A heading line of markdown, its title in group 1. The block parser
558
+ * trims a line before it reads a heading, so any indent will do. */
559
+ const HEADING_LINE_RE = /^[^\S\n]*#{1,6}[^\S\n]+(.*)$/gm;
560
+ /** A mark a heading's title may carry: `*`, `_`, `^`, `~`, `:smallcaps[`
561
+ * or the `](` of a link. */
562
+ const HEADING_MARK_RE = /[*_^~]|:smallcaps\[|\]\(/;
563
+ /** The trailing `{…}` attributes of a heading line. */
564
+ const HEADING_ATTRS_TAIL_RE = /\s*\{[^{}]*\}\s*$/;
565
+ /** Whether markdown may hold a heading whose title carries an inline mark
566
+ * (its attributes left out). Unknown content (undefined) may. */
567
+ function mayHaveHeadingMarks(content) {
568
+ if (content === undefined)
569
+ return true;
570
+ const test = (text) => {
571
+ for (const m of text.matchAll(HEADING_LINE_RE)) {
572
+ if (HEADING_MARK_RE.test(m[1].replace(HEADING_ATTRS_TAIL_RE, '')))
573
+ return true;
574
+ }
575
+ return false;
576
+ };
577
+ return typeof content === 'string' ? test(content) : content.some(test);
578
+ }
579
+ /** Whether markdown may hold a heading, which is all a paragraph keeps
580
+ * with. Unknown content (undefined) may. */
581
+ function mayHaveHeadings(content) {
582
+ if (content === undefined)
583
+ return true;
584
+ const test = (text) => new RegExp(HEADING_LINE_RE.source, 'm').test(text);
585
+ return typeof content === 'string' ? test(content) : content.some(test);
586
+ }
587
+ /** A `::resource{id="…"}` embed alone on its line, as the block parser
588
+ * reads one (the line trimmed): a mention in running text or in a code
589
+ * span embeds nothing. */
590
+ const RESOURCE_EMBED_LINE_RE = /^[^\S\n]*::resource[^\S\n]*\{id="[^"\n]+"\}[^\S\n]*$/m;
591
+ /** The same, for one line. */
592
+ const RESOURCE_EMBED_RE = /^[^\S\n]*::resource[^\S\n]*\{id="[^"\n]+"\}[^\S\n]*$/;
593
+ /** A container's opening fence (`:::callout{…}`) and its bare closing
594
+ * fence, as the block parser reads them (the line trimmed). */
595
+ const FENCE_OPEN_RE = /^:::\s*([a-z][a-z0-9-]*)\s*(?:\{[^}]*\})?\s*$/;
596
+ const FENCE_CLOSE_RE = /^:::\s*$/;
597
+ /** A `:::callout` opening fence on a line of its own, as the block parser
598
+ * reads one (the line trimmed). */
599
+ const CALLOUT_FENCE_LINE_RE = /^[^\S\n]*:::[^\S\n]*callout[^\S\n]*(?:\{[^}\n]*\})?[^\S\n]*$/m;
600
+ /** Whether markdown may hold a box, which is all that splits by the box
601
+ * cut rules. Unknown content (undefined) may. */
602
+ function mayHaveBoxes(content) {
603
+ if (content === undefined)
604
+ return true;
605
+ if (typeof content === 'string')
606
+ return CALLOUT_FENCE_LINE_RE.test(content);
607
+ return content.some((text) => CALLOUT_FENCE_LINE_RE.test(text));
608
+ }
609
+ /** Whether markdown embeds a resource inside a box: a `::resource` line
610
+ * while a `:::callout` fence is open. */
611
+ function embedsResourceInBox(text) {
612
+ if (!RESOURCE_EMBED_LINE_RE.test(text))
613
+ return false;
614
+ const open = [];
615
+ let boxes = 0;
616
+ for (const raw of text.split('\n')) {
617
+ const line = raw.trim();
618
+ const fence = FENCE_OPEN_RE.exec(line);
619
+ if (fence && KNOWN_CONTAINERS.has(fence[1])) {
620
+ const box = fence[1] === 'callout';
621
+ open.push(box);
622
+ if (box)
623
+ boxes++;
624
+ }
625
+ else if (open.length > 0 && FENCE_CLOSE_RE.test(line)) {
626
+ if (open.pop())
627
+ boxes--;
628
+ }
629
+ else if (boxes > 0 && RESOURCE_EMBED_RE.test(line)) {
630
+ return true;
631
+ }
632
+ }
633
+ return false;
634
+ }
635
+ /** `MigrateConfigOptions.content` as a string or an array. Both checks
636
+ * below read it, and an iterator (a generator, a Map's `values()`) can be
637
+ * walked only once, so the migrations take its texts into an array first. */
638
+ function readContent(content) {
639
+ return content === undefined || typeof content === 'string' ? content : [...content];
640
+ }
641
+ /** Whether markdown may embed a resource inline: only a `::resource`
642
+ * directive on a line of its own does. Unknown content (undefined) may. */
643
+ function mayEmbedResources(content) {
644
+ if (content === undefined)
645
+ return true;
646
+ if (typeof content === 'string')
647
+ return RESOURCE_EMBED_LINE_RE.test(content);
648
+ return content.some((text) => RESOURCE_EMBED_LINE_RE.test(text));
649
+ }
650
+ /** Whether markdown may embed a resource inside a box. Unknown content
651
+ * (undefined) may. */
652
+ function mayEmbedResourcesInBoxes(content) {
653
+ if (content === undefined)
654
+ return true;
655
+ if (typeof content === 'string')
656
+ return embedsResourceInBox(content);
657
+ return content.some(embedsResourceInBox);
658
+ }
659
+ /** Whether markdown may introduce a list with a colon. Unknown content
660
+ * (undefined) may. */
661
+ function mayLeadListWithColon(content) {
662
+ if (content === undefined)
663
+ return true;
664
+ if (typeof content === 'string')
665
+ return COLON_LIST_RE.test(content);
666
+ return content.some((text) => COLON_LIST_RE.test(text));
667
+ }
668
+ /** Whether markdown sets maths: a formula is written between `$` signs.
669
+ * Unknown content (undefined) may. */
670
+ function mayHaveMaths(content) {
671
+ if (content === undefined)
672
+ return true;
673
+ if (typeof content === 'string')
674
+ return content.includes('$');
675
+ return content.some((text) => text.includes('$'));
676
+ }
677
+ /**
678
+ * A configuration stored under `configVersion` (see {@link CONFIG_VERSION}),
679
+ * in today's terms. One with no version (a number is expected; anything
680
+ * else counts as none) or one older than 3 has its heading breaks pinned by
681
+ * {@link pinLegacyHeadingBreaks}; one older than 4 has its maths size
682
+ * pinned by {@link pinLegacyMathSize}, unless `options.content` shows it
683
+ * sets no maths; one older than 5 has its inline gap pinned by {@link
684
+ * pinLegacyInlineGap}, unless `options.content` shows it embeds no
685
+ * resource; one older than 6 has its heading marks pinned by {@link
686
+ * pinLegacyHeadingMarks}, unless `options.content` shows no heading
687
+ * carries one, its drop caps by {@link pinLegacyDropCapSize}, its
688
+ * colon-list room by {@link pinLegacyColonListRoom}, unless
689
+ * `options.content` shows no list introduced by a colon, and its box gap
690
+ * by {@link pinLegacyBoxResourceGap}, unless `options.content` shows it
691
+ * embeds no resource inside a box, and its box cut by {@link
692
+ * pinLegacyBoxChildCut}, unless `options.content` shows it holds no box;
693
+ * one older than 7 has its dash breaks pinned by {@link
694
+ * pinLegacyDashBreaks}, unless `options.content` shows no closed dash, and
695
+ * its ragged breaking by {@link pinLegacyRaggedBreaking}, when it sets some
696
+ * running text ragged; one older than 8 has its split under a heading
697
+ * pinned by {@link pinLegacyHeadingSplit}, unless `options.content` shows
698
+ * no heading, the space under its `:::paragraphs` containers by {@link
699
+ * pinLegacyParagraphContainerSpacing}, when it declares a paragraph style,
700
+ * unless `options.content` shows no such container, and its compound
701
+ * breaks by {@link pinLegacyHyphenBreaks}, unless `options.content` shows
702
+ * no compound. A current one is returned as it is (the same object).
703
+ * Migrate a stored configuration once and store it again under
704
+ * `CONFIG_VERSION`: the maths pin multiplies a scale, so a configuration
705
+ * read twice under its old number would grow twice.
706
+ */
707
+ export function migrateConfig(config, configVersion, options = {}) {
708
+ const rules = rulesOf(configVersion);
709
+ let out = rules < HEADING_BREAK_RULES ? pinLegacyHeadingBreaks(config) : config;
710
+ const content = rules < CONFIG_VERSION ? readContent(options.content) : undefined;
711
+ if (rules < MATH_SIZE_RULES && mayHaveMaths(content))
712
+ out = pinLegacyMathSize(out);
713
+ if (rules < INLINE_GAP_RULES && mayEmbedResources(content))
714
+ out = pinLegacyInlineGap(out);
715
+ if (rules < HEADING_MARKS_RULES && mayHaveHeadingMarks(content))
716
+ out = pinLegacyHeadingMarks(out);
717
+ if (rules < DROP_CAP_SIZE_RULES)
718
+ out = pinLegacyDropCapSize(out);
719
+ if (rules < COLON_LIST_ROOM_RULES && mayLeadListWithColon(content))
720
+ out = pinLegacyColonListRoom(out);
721
+ if (rules < BOX_GAP_RULES && mayEmbedResourcesInBoxes(content))
722
+ out = pinLegacyBoxResourceGap(out);
723
+ if (rules < BOX_CHILD_CUT_RULES && mayHaveBoxes(content))
724
+ out = pinLegacyBoxChildCut(out);
725
+ if (rules < DASH_BREAK_RULES && mayHaveClosedDashes(content))
726
+ out = pinLegacyDashBreaks(out);
727
+ if (rules < RAGGED_BREAKING_RULES)
728
+ out = pinLegacyRaggedBreaking(out);
729
+ if (rules < HEADING_SPLIT_RULES && mayHaveHeadings(content))
730
+ out = pinLegacyHeadingSplit(out);
731
+ if (rules < PARAGRAPH_CONTAINER_RULES && mayHaveParagraphContainers(content))
732
+ out = pinLegacyParagraphContainerSpacing(out);
733
+ if (rules < HYPHEN_BREAK_RULES && mayHaveCompounds(content))
734
+ out = pinLegacyHyphenBreaks(out);
735
+ return out;
736
+ }
737
+ /**
738
+ * A bundle's configuration in today's terms: `base` (the reader's own)
739
+ * under the manifest's `config` and the locale's overrides, both stored
740
+ * under `configVersion`. Top-level keys replace one another wholesale, so
741
+ * the heading breaks are pinned layer by layer (the base's are taken as
742
+ * they are) and the maths size once, on the `math` the layers leave in
743
+ * force — the size 1.4 set this bundle's formulas at, whichever layer
744
+ * named it, the base included when neither the manifest nor the locale
745
+ * names one. The inline gap, the box gap and the box cut are pinned the
746
+ * same way, on the `layout` in force, the colon-list room, the dash
747
+ * breaks, the compound breaks, the ragged breaking and the space under
748
+ * `:::paragraphs` containers on the `bodyText` in force (the ragged
749
+ * breaking when the merged configuration sets some running text ragged,
750
+ * the container space when it declares a paragraph style), the heading
751
+ * marks and the split under a heading on the `headings` in force, and the
752
+ * drop caps wherever they sit in the merged configuration.
753
+ * @internal `readBundle`'s; hosts call {@link migrateConfig}.
754
+ */
755
+ export function migrateBundleConfig(base, layers, configVersion, options = {}) {
756
+ const rules = rulesOf(configVersion);
757
+ let merged = { ...base };
758
+ for (const layer of layers) {
759
+ Object.assign(merged, rules < HEADING_BREAK_RULES ? pinLegacyHeadingBreaks(layer) : layer);
760
+ }
761
+ const content = rules < CONFIG_VERSION ? readContent(options.content) : undefined;
762
+ if (rules < MATH_SIZE_RULES && mayHaveMaths(content))
763
+ merged = pinLegacyMathSize(merged);
764
+ if (rules < INLINE_GAP_RULES && mayEmbedResources(content))
765
+ merged = pinLegacyInlineGap(merged);
766
+ if (rules < HEADING_MARKS_RULES && mayHaveHeadingMarks(content))
767
+ merged = pinLegacyHeadingMarks(merged);
768
+ if (rules < DROP_CAP_SIZE_RULES)
769
+ merged = pinLegacyDropCapSize(merged);
770
+ if (rules < COLON_LIST_ROOM_RULES && mayLeadListWithColon(content))
771
+ merged = pinLegacyColonListRoom(merged);
772
+ if (rules < BOX_GAP_RULES && mayEmbedResourcesInBoxes(content))
773
+ merged = pinLegacyBoxResourceGap(merged);
774
+ if (rules < BOX_CHILD_CUT_RULES && mayHaveBoxes(content))
775
+ merged = pinLegacyBoxChildCut(merged);
776
+ if (rules < DASH_BREAK_RULES && mayHaveClosedDashes(content))
777
+ merged = pinLegacyDashBreaks(merged);
778
+ if (rules < RAGGED_BREAKING_RULES)
779
+ merged = pinLegacyRaggedBreaking(merged);
780
+ if (rules < HEADING_SPLIT_RULES && mayHaveHeadings(content))
781
+ merged = pinLegacyHeadingSplit(merged);
782
+ if (rules < PARAGRAPH_CONTAINER_RULES && mayHaveParagraphContainers(content))
783
+ merged = pinLegacyParagraphContainerSpacing(merged);
784
+ if (rules < HYPHEN_BREAK_RULES && mayHaveCompounds(content))
785
+ merged = pinLegacyHyphenBreaks(merged);
786
+ return merged;
787
+ }
788
+ //# sourceMappingURL=configVersion.js.map