postext 1.27.1 → 1.28.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 (544) hide show
  1. package/dist/__tests__/bundle/balloonPlacementPin.test.d.ts +2 -0
  2. package/dist/__tests__/bundle/balloonPlacementPin.test.d.ts.map +1 -0
  3. package/dist/__tests__/bundle/balloonPlacementPin.test.js +71 -0
  4. package/dist/__tests__/bundle/balloonPlacementPin.test.js.map +1 -0
  5. package/dist/__tests__/bundle/cjkRulesPin.test.js +131 -7
  6. package/dist/__tests__/bundle/cjkRulesPin.test.js.map +1 -1
  7. package/dist/__tests__/bundle/designOverflowPin.test.js +3 -3
  8. package/dist/__tests__/bundle/designOverflowPin.test.js.map +1 -1
  9. package/dist/__tests__/bundle/flowColumnsPin.test.js +3 -1
  10. package/dist/__tests__/bundle/flowColumnsPin.test.js.map +1 -1
  11. package/dist/__tests__/bundle/gridBalancingPin.test.js +14 -5
  12. package/dist/__tests__/bundle/gridBalancingPin.test.js.map +1 -1
  13. package/dist/__tests__/bundle/gridBreakRulesPin.test.d.ts +2 -0
  14. package/dist/__tests__/bundle/gridBreakRulesPin.test.d.ts.map +1 -0
  15. package/dist/__tests__/bundle/gridBreakRulesPin.test.js +144 -0
  16. package/dist/__tests__/bundle/gridBreakRulesPin.test.js.map +1 -0
  17. package/dist/__tests__/bundle/indexGroupSplitPin.test.d.ts +2 -0
  18. package/dist/__tests__/bundle/indexGroupSplitPin.test.d.ts.map +1 -0
  19. package/dist/__tests__/bundle/indexGroupSplitPin.test.js +55 -0
  20. package/dist/__tests__/bundle/indexGroupSplitPin.test.js.map +1 -0
  21. package/dist/__tests__/bundle/inlineCaptionSidePin.test.d.ts +2 -0
  22. package/dist/__tests__/bundle/inlineCaptionSidePin.test.d.ts.map +1 -0
  23. package/dist/__tests__/bundle/inlineCaptionSidePin.test.js +60 -0
  24. package/dist/__tests__/bundle/inlineCaptionSidePin.test.js.map +1 -0
  25. package/dist/__tests__/bundle/inlineTableSplitPin.test.js +3 -1
  26. package/dist/__tests__/bundle/inlineTableSplitPin.test.js.map +1 -1
  27. package/dist/__tests__/bundle/looseOrderPin.test.d.ts +2 -0
  28. package/dist/__tests__/bundle/looseOrderPin.test.d.ts.map +1 -0
  29. package/dist/__tests__/bundle/looseOrderPin.test.js +76 -0
  30. package/dist/__tests__/bundle/looseOrderPin.test.js.map +1 -0
  31. package/dist/__tests__/bundle/openerHeadFloatsPin.test.js +2 -1
  32. package/dist/__tests__/bundle/openerHeadFloatsPin.test.js.map +1 -1
  33. package/dist/__tests__/bundle/refLabelBreaksPin.test.d.ts +2 -0
  34. package/dist/__tests__/bundle/refLabelBreaksPin.test.d.ts.map +1 -0
  35. package/dist/__tests__/bundle/refLabelBreaksPin.test.js +72 -0
  36. package/dist/__tests__/bundle/refLabelBreaksPin.test.js.map +1 -0
  37. package/dist/__tests__/bundle/scriptContextPin.test.d.ts +2 -0
  38. package/dist/__tests__/bundle/scriptContextPin.test.d.ts.map +1 -0
  39. package/dist/__tests__/bundle/scriptContextPin.test.js +66 -0
  40. package/dist/__tests__/bundle/scriptContextPin.test.js.map +1 -0
  41. package/dist/__tests__/bundle/trailingStepPin.test.d.ts +2 -0
  42. package/dist/__tests__/bundle/trailingStepPin.test.d.ts.map +1 -0
  43. package/dist/__tests__/bundle/trailingStepPin.test.js +59 -0
  44. package/dist/__tests__/bundle/trailingStepPin.test.js.map +1 -0
  45. package/dist/__tests__/bundle/wideFloatStretchPin.test.d.ts +2 -0
  46. package/dist/__tests__/bundle/wideFloatStretchPin.test.d.ts.map +1 -0
  47. package/dist/__tests__/bundle/wideFloatStretchPin.test.js +59 -0
  48. package/dist/__tests__/bundle/wideFloatStretchPin.test.js.map +1 -0
  49. package/dist/__tests__/bundle.test.js +8 -6
  50. package/dist/__tests__/bundle.test.js.map +1 -1
  51. package/dist/__tests__/cjk/annotations.test.js +223 -0
  52. package/dist/__tests__/cjk/annotations.test.js.map +1 -1
  53. package/dist/__tests__/cjk/annotationsRender.test.js +3 -3
  54. package/dist/__tests__/cjk/annotationsRender.test.js.map +1 -1
  55. package/dist/__tests__/cjk/chipLatinSpacing.test.js +13 -2
  56. package/dist/__tests__/cjk/chipLatinSpacing.test.js.map +1 -1
  57. package/dist/__tests__/cjk/designNumberSeams.test.d.ts +2 -0
  58. package/dist/__tests__/cjk/designNumberSeams.test.d.ts.map +1 -0
  59. package/dist/__tests__/cjk/designNumberSeams.test.js +221 -0
  60. package/dist/__tests__/cjk/designNumberSeams.test.js.map +1 -0
  61. package/dist/__tests__/cjk/grid.test.js +1 -1
  62. package/dist/__tests__/cjk/grid.test.js.map +1 -1
  63. package/dist/__tests__/cjk/gridBalancing.test.js +3 -1
  64. package/dist/__tests__/cjk/gridBalancing.test.js.map +1 -1
  65. package/dist/__tests__/cjk/japaneseSpacing.test.js +3 -1
  66. package/dist/__tests__/cjk/japaneseSpacing.test.js.map +1 -1
  67. package/dist/__tests__/cjk/keepAll.test.js +3 -1
  68. package/dist/__tests__/cjk/keepAll.test.js.map +1 -1
  69. package/dist/__tests__/cjk/keepAllLatinQuotation.test.d.ts +2 -0
  70. package/dist/__tests__/cjk/keepAllLatinQuotation.test.d.ts.map +1 -0
  71. package/dist/__tests__/cjk/keepAllLatinQuotation.test.js +166 -0
  72. package/dist/__tests__/cjk/keepAllLatinQuotation.test.js.map +1 -0
  73. package/dist/__tests__/cjk/latinSpacingEdge.test.d.ts +2 -0
  74. package/dist/__tests__/cjk/latinSpacingEdge.test.d.ts.map +1 -0
  75. package/dist/__tests__/cjk/latinSpacingEdge.test.js +179 -0
  76. package/dist/__tests__/cjk/latinSpacingEdge.test.js.map +1 -0
  77. package/dist/__tests__/cjk/runt.test.js +92 -1
  78. package/dist/__tests__/cjk/runt.test.js.map +1 -1
  79. package/dist/__tests__/codeBlocks.test.js +1 -1
  80. package/dist/__tests__/columnBalancing.test.js +216 -0
  81. package/dist/__tests__/columnBalancing.test.js.map +1 -1
  82. package/dist/__tests__/columnRuleBands.test.js +78 -0
  83. package/dist/__tests__/columnRuleBands.test.js.map +1 -1
  84. package/dist/__tests__/comics/readingDirection.test.js +52 -0
  85. package/dist/__tests__/comics/readingDirection.test.js.map +1 -1
  86. package/dist/__tests__/comics/script.test.js +5 -0
  87. package/dist/__tests__/comics/script.test.js.map +1 -1
  88. package/dist/__tests__/contrast.test.d.ts +2 -0
  89. package/dist/__tests__/contrast.test.d.ts.map +1 -0
  90. package/dist/__tests__/contrast.test.js +258 -0
  91. package/dist/__tests__/contrast.test.js.map +1 -0
  92. package/dist/__tests__/defaults/cjk.test.js +4 -4
  93. package/dist/__tests__/defaults/cjk.test.js.map +1 -1
  94. package/dist/__tests__/defaults/gridBreakRules.test.d.ts +2 -0
  95. package/dist/__tests__/defaults/gridBreakRules.test.d.ts.map +1 -0
  96. package/dist/__tests__/defaults/gridBreakRules.test.js +152 -0
  97. package/dist/__tests__/defaults/gridBreakRules.test.js.map +1 -0
  98. package/dist/__tests__/defaults/headingsBalancing.test.js +25 -0
  99. package/dist/__tests__/defaults/headingsBalancing.test.js.map +1 -1
  100. package/dist/__tests__/defaults/stripContextDefaults.test.js +41 -0
  101. package/dist/__tests__/defaults/stripContextDefaults.test.js.map +1 -1
  102. package/dist/__tests__/defaults/stripRoundTrip.test.js +8 -5
  103. package/dist/__tests__/defaults/stripRoundTrip.test.js.map +1 -1
  104. package/dist/__tests__/exports.test.js +30 -0
  105. package/dist/__tests__/exports.test.js.map +1 -1
  106. package/dist/__tests__/fontUsage.test.d.ts +2 -0
  107. package/dist/__tests__/fontUsage.test.d.ts.map +1 -0
  108. package/dist/__tests__/fontUsage.test.js +113 -0
  109. package/dist/__tests__/fontUsage.test.js.map +1 -0
  110. package/dist/__tests__/hardBreaks.test.js +1 -1
  111. package/dist/__tests__/headingInlineMarks.test.js +7 -5
  112. package/dist/__tests__/headingInlineMarks.test.js.map +1 -1
  113. package/dist/__tests__/hyphenationRules.test.d.ts +2 -0
  114. package/dist/__tests__/hyphenationRules.test.d.ts.map +1 -0
  115. package/dist/__tests__/hyphenationRules.test.js +295 -0
  116. package/dist/__tests__/hyphenationRules.test.js.map +1 -0
  117. package/dist/__tests__/indexGroupSplit.test.d.ts +2 -0
  118. package/dist/__tests__/indexGroupSplit.test.d.ts.map +1 -0
  119. package/dist/__tests__/indexGroupSplit.test.js +175 -0
  120. package/dist/__tests__/indexGroupSplit.test.js.map +1 -0
  121. package/dist/__tests__/mathSizeMigration.test.js +7 -5
  122. package/dist/__tests__/mathSizeMigration.test.js.map +1 -1
  123. package/dist/__tests__/multipleColumns.test.js +19 -0
  124. package/dist/__tests__/multipleColumns.test.js.map +1 -1
  125. package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
  126. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +3 -3
  127. package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js.map +1 -1
  128. package/dist/__tests__/pipeline/closingBandUnderOpener.test.d.ts +2 -0
  129. package/dist/__tests__/pipeline/closingBandUnderOpener.test.d.ts.map +1 -0
  130. package/dist/__tests__/pipeline/closingBandUnderOpener.test.js +90 -0
  131. package/dist/__tests__/pipeline/closingBandUnderOpener.test.js.map +1 -0
  132. package/dist/__tests__/pipeline/colonListRoom.test.js +5 -4
  133. package/dist/__tests__/pipeline/colonListRoom.test.js.map +1 -1
  134. package/dist/__tests__/pipeline/columnHeadSpace.test.d.ts +2 -0
  135. package/dist/__tests__/pipeline/columnHeadSpace.test.d.ts.map +1 -0
  136. package/dist/__tests__/pipeline/columnHeadSpace.test.js +175 -0
  137. package/dist/__tests__/pipeline/columnHeadSpace.test.js.map +1 -0
  138. package/dist/__tests__/pipeline/compoundBreaks.test.js +6 -6
  139. package/dist/__tests__/pipeline/compoundBreaks.test.js.map +1 -1
  140. package/dist/__tests__/pipeline/dashBreaks.test.js +5 -5
  141. package/dist/__tests__/pipeline/dashBreaks.test.js.map +1 -1
  142. package/dist/__tests__/pipeline/flowColumns.test.js +100 -0
  143. package/dist/__tests__/pipeline/flowColumns.test.js.map +1 -1
  144. package/dist/__tests__/pipeline/headingShortBand.test.js +2 -1
  145. package/dist/__tests__/pipeline/headingShortBand.test.js.map +1 -1
  146. package/dist/__tests__/pipeline/headingSplitOrphans.test.js +6 -5
  147. package/dist/__tests__/pipeline/headingSplitOrphans.test.js.map +1 -1
  148. package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js +188 -1
  149. package/dist/__tests__/pipeline/hyphenAcrossColumns.test.js.map +1 -1
  150. package/dist/__tests__/pipeline/inlineCaptionSide.test.d.ts +2 -0
  151. package/dist/__tests__/pipeline/inlineCaptionSide.test.d.ts.map +1 -0
  152. package/dist/__tests__/pipeline/inlineCaptionSide.test.js +270 -0
  153. package/dist/__tests__/pipeline/inlineCaptionSide.test.js.map +1 -0
  154. package/dist/__tests__/pipeline/inlineFigureSpace.test.js +5 -5
  155. package/dist/__tests__/pipeline/inlineFigureSpace.test.js.map +1 -1
  156. package/dist/__tests__/pipeline/inlineRefRender.test.js +8 -6
  157. package/dist/__tests__/pipeline/inlineRefRender.test.js.map +1 -1
  158. package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.d.ts +2 -0
  159. package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.d.ts.map +1 -0
  160. package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.js +73 -0
  161. package/dist/__tests__/pipeline/looseBeforeHeadingLines.test.js.map +1 -0
  162. package/dist/__tests__/pipeline/openerFloats.test.d.ts +2 -0
  163. package/dist/__tests__/pipeline/openerFloats.test.d.ts.map +1 -0
  164. package/dist/__tests__/pipeline/openerFloats.test.js +137 -0
  165. package/dist/__tests__/pipeline/openerFloats.test.js.map +1 -0
  166. package/dist/__tests__/pipeline/orderedNumberWidthItem.test.d.ts +2 -0
  167. package/dist/__tests__/pipeline/orderedNumberWidthItem.test.d.ts.map +1 -0
  168. package/dist/__tests__/pipeline/orderedNumberWidthItem.test.js +162 -0
  169. package/dist/__tests__/pipeline/orderedNumberWidthItem.test.js.map +1 -0
  170. package/dist/__tests__/pipeline/paragraphContainerTail.test.js +68 -8
  171. package/dist/__tests__/pipeline/paragraphContainerTail.test.js.map +1 -1
  172. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js +1 -1
  173. package/dist/__tests__/pipeline/paragraphStyleFaces.test.js.map +1 -1
  174. package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.d.ts +2 -0
  175. package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.d.ts.map +1 -0
  176. package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.js +151 -0
  177. package/dist/__tests__/pipeline/raggedLineAndRuntFix.test.js.map +1 -0
  178. package/dist/__tests__/pipeline/raggedOptimal.test.js +6 -6
  179. package/dist/__tests__/pipeline/raggedOptimal.test.js.map +1 -1
  180. package/dist/__tests__/pipeline/refLabelBreaks.test.d.ts +2 -0
  181. package/dist/__tests__/pipeline/refLabelBreaks.test.d.ts.map +1 -0
  182. package/dist/__tests__/pipeline/refLabelBreaks.test.js +324 -0
  183. package/dist/__tests__/pipeline/refLabelBreaks.test.js.map +1 -0
  184. package/dist/__tests__/pipeline/resourceTemplateStyles.test.d.ts +2 -0
  185. package/dist/__tests__/pipeline/resourceTemplateStyles.test.d.ts.map +1 -0
  186. package/dist/__tests__/pipeline/resourceTemplateStyles.test.js +145 -0
  187. package/dist/__tests__/pipeline/resourceTemplateStyles.test.js.map +1 -0
  188. package/dist/__tests__/pipeline/shortListSplit.test.d.ts +2 -0
  189. package/dist/__tests__/pipeline/shortListSplit.test.d.ts.map +1 -0
  190. package/dist/__tests__/pipeline/shortListSplit.test.js +181 -0
  191. package/dist/__tests__/pipeline/shortListSplit.test.js.map +1 -0
  192. package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.d.ts +2 -0
  193. package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.d.ts.map +1 -0
  194. package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.js +133 -0
  195. package/dist/__tests__/pipeline/snapTailAtColumnFoot.test.js.map +1 -0
  196. package/dist/__tests__/pipeline/stretchAfterDisplays.test.d.ts +2 -0
  197. package/dist/__tests__/pipeline/stretchAfterDisplays.test.d.ts.map +1 -0
  198. package/dist/__tests__/pipeline/stretchAfterDisplays.test.js +51 -0
  199. package/dist/__tests__/pipeline/stretchAfterDisplays.test.js.map +1 -0
  200. package/dist/__tests__/pipeline/trailingCapFloatHead.test.js +26 -0
  201. package/dist/__tests__/pipeline/trailingCapFloatHead.test.js.map +1 -1
  202. package/dist/__tests__/pipeline/trailingStep.test.d.ts +2 -0
  203. package/dist/__tests__/pipeline/trailingStep.test.d.ts.map +1 -0
  204. package/dist/__tests__/pipeline/trailingStep.test.js +187 -0
  205. package/dist/__tests__/pipeline/trailingStep.test.js.map +1 -0
  206. package/dist/__tests__/pipeline/wideFloatStretch.test.d.ts +2 -0
  207. package/dist/__tests__/pipeline/wideFloatStretch.test.d.ts.map +1 -0
  208. package/dist/__tests__/pipeline/wideFloatStretch.test.js +84 -0
  209. package/dist/__tests__/pipeline/wideFloatStretch.test.js.map +1 -0
  210. package/dist/__tests__/scriptContext.test.d.ts +2 -0
  211. package/dist/__tests__/scriptContext.test.d.ts.map +1 -0
  212. package/dist/__tests__/scriptContext.test.js +919 -0
  213. package/dist/__tests__/scriptContext.test.js.map +1 -0
  214. package/dist/__tests__/softHyphenEdges.test.d.ts +2 -0
  215. package/dist/__tests__/softHyphenEdges.test.d.ts.map +1 -0
  216. package/dist/__tests__/softHyphenEdges.test.js +217 -0
  217. package/dist/__tests__/softHyphenEdges.test.js.map +1 -0
  218. package/dist/__tests__/spaceLimitRatio.test.d.ts +2 -0
  219. package/dist/__tests__/spaceLimitRatio.test.d.ts.map +1 -0
  220. package/dist/__tests__/spaceLimitRatio.test.js +226 -0
  221. package/dist/__tests__/spaceLimitRatio.test.js.map +1 -0
  222. package/dist/__tests__/trackedLigatures.test.js +365 -24
  223. package/dist/__tests__/trackedLigatures.test.js.map +1 -1
  224. package/dist/__tests__/verseLines.test.js +9 -7
  225. package/dist/__tests__/verseLines.test.js.map +1 -1
  226. package/dist/bundle/configVersion.d.ts +201 -6
  227. package/dist/bundle/configVersion.d.ts.map +1 -1
  228. package/dist/bundle/configVersion.js +440 -6
  229. package/dist/bundle/configVersion.js.map +1 -1
  230. package/dist/bundle/index.d.ts +8 -0
  231. package/dist/bundle/index.d.ts.map +1 -1
  232. package/dist/bundle/index.js +8 -0
  233. package/dist/bundle/index.js.map +1 -1
  234. package/dist/canvas-backend/blockRender.d.ts.map +1 -1
  235. package/dist/canvas-backend/blockRender.js +3 -2
  236. package/dist/canvas-backend/blockRender.js.map +1 -1
  237. package/dist/canvas-backend/chip.js +1 -1
  238. package/dist/canvas-backend/chip.js.map +1 -1
  239. package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
  240. package/dist/canvas-backend/headerFooter.js +17 -2
  241. package/dist/canvas-backend/headerFooter.js.map +1 -1
  242. package/dist/canvas-backend/runDirection.d.ts +10 -6
  243. package/dist/canvas-backend/runDirection.d.ts.map +1 -1
  244. package/dist/canvas-backend/runDirection.js +12 -7
  245. package/dist/canvas-backend/runDirection.js.map +1 -1
  246. package/dist/canvas-backend/scriptText.d.ts +11 -0
  247. package/dist/canvas-backend/scriptText.d.ts.map +1 -0
  248. package/dist/canvas-backend/scriptText.js +75 -0
  249. package/dist/canvas-backend/scriptText.js.map +1 -0
  250. package/dist/canvas-backend/segmentText.d.ts.map +1 -1
  251. package/dist/canvas-backend/segmentText.js +9 -1
  252. package/dist/canvas-backend/segmentText.js.map +1 -1
  253. package/dist/canvas-backend/trackedText.d.ts +35 -20
  254. package/dist/canvas-backend/trackedText.d.ts.map +1 -1
  255. package/dist/canvas-backend/trackedText.js +58 -22
  256. package/dist/canvas-backend/trackedText.js.map +1 -1
  257. package/dist/canvas-backend/verticalText.d.ts.map +1 -1
  258. package/dist/canvas-backend/verticalText.js +10 -2
  259. package/dist/canvas-backend/verticalText.js.map +1 -1
  260. package/dist/canvas-backend/wordRuns.d.ts +14 -5
  261. package/dist/canvas-backend/wordRuns.d.ts.map +1 -1
  262. package/dist/canvas-backend/wordRuns.js +20 -7
  263. package/dist/canvas-backend/wordRuns.js.map +1 -1
  264. package/dist/citations/names.d.ts +8 -0
  265. package/dist/citations/names.d.ts.map +1 -0
  266. package/dist/citations/names.js +25 -0
  267. package/dist/citations/names.js.map +1 -0
  268. package/dist/columnClip.d.ts +8 -1
  269. package/dist/columnClip.d.ts.map +1 -1
  270. package/dist/columnClip.js +32 -3
  271. package/dist/columnClip.js.map +1 -1
  272. package/dist/columnRule.d.ts +6 -3
  273. package/dist/columnRule.d.ts.map +1 -1
  274. package/dist/columnRule.js +6 -3
  275. package/dist/columnRule.js.map +1 -1
  276. package/dist/comics/layoutPage.d.ts.map +1 -1
  277. package/dist/comics/layoutPage.js +51 -22
  278. package/dist/comics/layoutPage.js.map +1 -1
  279. package/dist/comics/lettering/__tests__/bystanderFaces.test.d.ts +2 -0
  280. package/dist/comics/lettering/__tests__/bystanderFaces.test.d.ts.map +1 -0
  281. package/dist/comics/lettering/__tests__/bystanderFaces.test.js +204 -0
  282. package/dist/comics/lettering/__tests__/bystanderFaces.test.js.map +1 -0
  283. package/dist/comics/lettering/__tests__/shapeTextDash.test.d.ts +2 -0
  284. package/dist/comics/lettering/__tests__/shapeTextDash.test.d.ts.map +1 -0
  285. package/dist/comics/lettering/__tests__/shapeTextDash.test.js +173 -0
  286. package/dist/comics/lettering/__tests__/shapeTextDash.test.js.map +1 -0
  287. package/dist/comics/lettering/__tests__/strictPlacement.test.d.ts +2 -0
  288. package/dist/comics/lettering/__tests__/strictPlacement.test.d.ts.map +1 -0
  289. package/dist/comics/lettering/__tests__/strictPlacement.test.js +130 -0
  290. package/dist/comics/lettering/__tests__/strictPlacement.test.js.map +1 -0
  291. package/dist/comics/lettering/letter.js +21 -8
  292. package/dist/comics/lettering/letter.js.map +1 -1
  293. package/dist/comics/lettering/placement.d.ts.map +1 -1
  294. package/dist/comics/lettering/placement.js +12 -3
  295. package/dist/comics/lettering/placement.js.map +1 -1
  296. package/dist/comics/lettering/shape-text.d.ts +3 -0
  297. package/dist/comics/lettering/shape-text.d.ts.map +1 -1
  298. package/dist/comics/lettering/shape-text.js +71 -12
  299. package/dist/comics/lettering/shape-text.js.map +1 -1
  300. package/dist/comics/lettering/text.d.ts +5 -0
  301. package/dist/comics/lettering/text.d.ts.map +1 -1
  302. package/dist/comics/lettering/text.js +6 -1
  303. package/dist/comics/lettering/text.js.map +1 -1
  304. package/dist/comics/lettering/types.d.ts +12 -2
  305. package/dist/comics/lettering/types.d.ts.map +1 -1
  306. package/dist/comics/script.js +1 -1
  307. package/dist/comics/script.js.map +1 -1
  308. package/dist/comics/types.d.ts +7 -3
  309. package/dist/comics/types.d.ts.map +1 -1
  310. package/dist/configWarnings.d.ts.map +1 -1
  311. package/dist/configWarnings.js +33 -6
  312. package/dist/configWarnings.js.map +1 -1
  313. package/dist/contrast.d.ts +188 -0
  314. package/dist/contrast.d.ts.map +1 -0
  315. package/dist/contrast.js +583 -0
  316. package/dist/contrast.js.map +1 -0
  317. package/dist/defaults/bodyText.d.ts +31 -3
  318. package/dist/defaults/bodyText.d.ts.map +1 -1
  319. package/dist/defaults/bodyText.js +76 -8
  320. package/dist/defaults/bodyText.js.map +1 -1
  321. package/dist/defaults/citations.d.ts.map +1 -1
  322. package/dist/defaults/citations.js +4 -0
  323. package/dist/defaults/citations.js.map +1 -1
  324. package/dist/defaults/cjk.d.ts +11 -1
  325. package/dist/defaults/cjk.d.ts.map +1 -1
  326. package/dist/defaults/cjk.js +41 -3
  327. package/dist/defaults/cjk.js.map +1 -1
  328. package/dist/defaults/comics.d.ts.map +1 -1
  329. package/dist/defaults/comics.js +2 -0
  330. package/dist/defaults/comics.js.map +1 -1
  331. package/dist/defaults/contrast.d.ts +11 -0
  332. package/dist/defaults/contrast.d.ts.map +1 -0
  333. package/dist/defaults/contrast.js +65 -0
  334. package/dist/defaults/contrast.js.map +1 -0
  335. package/dist/defaults/crossRefs.d.ts +1 -1
  336. package/dist/defaults/crossRefs.d.ts.map +1 -1
  337. package/dist/defaults/crossRefs.js +6 -1
  338. package/dist/defaults/crossRefs.js.map +1 -1
  339. package/dist/defaults/footnotes.d.ts.map +1 -1
  340. package/dist/defaults/footnotes.js +5 -0
  341. package/dist/defaults/footnotes.js.map +1 -1
  342. package/dist/defaults/headings.d.ts +5 -1
  343. package/dist/defaults/headings.d.ts.map +1 -1
  344. package/dist/defaults/headings.js +41 -1
  345. package/dist/defaults/headings.js.map +1 -1
  346. package/dist/defaults/index.d.ts +3 -2
  347. package/dist/defaults/index.d.ts.map +1 -1
  348. package/dist/defaults/index.js +15 -4
  349. package/dist/defaults/index.js.map +1 -1
  350. package/dist/defaults/indexConfig.d.ts +1 -0
  351. package/dist/defaults/indexConfig.d.ts.map +1 -1
  352. package/dist/defaults/indexConfig.js +7 -1
  353. package/dist/defaults/indexConfig.js.map +1 -1
  354. package/dist/defaults/layout.d.ts.map +1 -1
  355. package/dist/defaults/layout.js +13 -1
  356. package/dist/defaults/layout.js.map +1 -1
  357. package/dist/defaults/orderedLists.js +1 -1
  358. package/dist/defaults/orderedLists.js.map +1 -1
  359. package/dist/defaults/paragraphStyles.d.ts.map +1 -1
  360. package/dist/defaults/paragraphStyles.js +5 -0
  361. package/dist/defaults/paragraphStyles.js.map +1 -1
  362. package/dist/defaults/shared.d.ts +4 -1
  363. package/dist/defaults/shared.d.ts.map +1 -1
  364. package/dist/defaults/shared.js +5 -0
  365. package/dist/defaults/shared.js.map +1 -1
  366. package/dist/design/cjkText.d.ts +7 -2
  367. package/dist/design/cjkText.d.ts.map +1 -1
  368. package/dist/design/cjkText.js +8 -2
  369. package/dist/design/cjkText.js.map +1 -1
  370. package/dist/design/layout.d.ts.map +1 -1
  371. package/dist/design/layout.js +85 -12
  372. package/dist/design/layout.js.map +1 -1
  373. package/dist/design/richText.d.ts.map +1 -1
  374. package/dist/design/richText.js +7 -3
  375. package/dist/design/richText.js.map +1 -1
  376. package/dist/fonts/usage.d.ts.map +1 -1
  377. package/dist/fonts/usage.js +89 -0
  378. package/dist/fonts/usage.js.map +1 -1
  379. package/dist/html-backend.d.ts.map +1 -1
  380. package/dist/html-backend.js +97 -27
  381. package/dist/html-backend.js.map +1 -1
  382. package/dist/hyphenate.d.ts +58 -1
  383. package/dist/hyphenate.d.ts.map +1 -1
  384. package/dist/hyphenate.js +228 -19
  385. package/dist/hyphenate.js.map +1 -1
  386. package/dist/hyphenationExceptions.d.ts +10 -0
  387. package/dist/hyphenationExceptions.d.ts.map +1 -0
  388. package/dist/hyphenationExceptions.js +29 -0
  389. package/dist/hyphenationExceptions.js.map +1 -0
  390. package/dist/index.d.ts +12 -4
  391. package/dist/index.d.ts.map +1 -1
  392. package/dist/index.js +10 -3
  393. package/dist/index.js.map +1 -1
  394. package/dist/knuthPlass/pretextAdapter.d.ts.map +1 -1
  395. package/dist/knuthPlass/pretextAdapter.js +4 -17
  396. package/dist/knuthPlass/pretextAdapter.js.map +1 -1
  397. package/dist/knuthPlass/richAdapter.d.ts +9 -0
  398. package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
  399. package/dist/knuthPlass/richAdapter.js +15 -18
  400. package/dist/knuthPlass/richAdapter.js.map +1 -1
  401. package/dist/looseLines.d.ts +15 -4
  402. package/dist/looseLines.d.ts.map +1 -1
  403. package/dist/looseLines.js +17 -4
  404. package/dist/looseLines.js.map +1 -1
  405. package/dist/measure/cache.d.ts.map +1 -1
  406. package/dist/measure/cache.js +14 -4
  407. package/dist/measure/cache.js.map +1 -1
  408. package/dist/measure/canvas.d.ts +18 -0
  409. package/dist/measure/canvas.d.ts.map +1 -1
  410. package/dist/measure/canvas.js +104 -0
  411. package/dist/measure/canvas.js.map +1 -1
  412. package/dist/measure/cjkAnnotate.d.ts +11 -6
  413. package/dist/measure/cjkAnnotate.d.ts.map +1 -1
  414. package/dist/measure/cjkAnnotate.js +27 -11
  415. package/dist/measure/cjkAnnotate.js.map +1 -1
  416. package/dist/measure/cjkCompose.d.ts +6 -2
  417. package/dist/measure/cjkCompose.d.ts.map +1 -1
  418. package/dist/measure/cjkCompose.js +146 -30
  419. package/dist/measure/cjkCompose.js.map +1 -1
  420. package/dist/measure/cjkPunctuation.d.ts +17 -0
  421. package/dist/measure/cjkPunctuation.d.ts.map +1 -1
  422. package/dist/measure/cjkPunctuation.js +15 -1
  423. package/dist/measure/cjkPunctuation.js.map +1 -1
  424. package/dist/measure/font.d.ts +2 -1
  425. package/dist/measure/font.d.ts.map +1 -1
  426. package/dist/measure/font.js +4 -2
  427. package/dist/measure/font.js.map +1 -1
  428. package/dist/measure/hardBreaks.d.ts.map +1 -1
  429. package/dist/measure/hardBreaks.js +6 -2
  430. package/dist/measure/hardBreaks.js.map +1 -1
  431. package/dist/measure/kashida.d.ts.map +1 -1
  432. package/dist/measure/kashida.js +8 -11
  433. package/dist/measure/kashida.js.map +1 -1
  434. package/dist/measure/plain.d.ts +3 -0
  435. package/dist/measure/plain.d.ts.map +1 -1
  436. package/dist/measure/plain.js +70 -5
  437. package/dist/measure/plain.js.map +1 -1
  438. package/dist/measure/rich.d.ts +32 -0
  439. package/dist/measure/rich.d.ts.map +1 -1
  440. package/dist/measure/rich.js +227 -35
  441. package/dist/measure/rich.js.map +1 -1
  442. package/dist/measure/script.d.ts +180 -0
  443. package/dist/measure/script.d.ts.map +1 -0
  444. package/dist/measure/script.js +329 -0
  445. package/dist/measure/script.js.map +1 -0
  446. package/dist/measure/spaceRatios.d.ts +28 -0
  447. package/dist/measure/spaceRatios.d.ts.map +1 -0
  448. package/dist/measure/spaceRatios.js +48 -0
  449. package/dist/measure/spaceRatios.js.map +1 -0
  450. package/dist/measure/spaces.d.ts +10 -0
  451. package/dist/measure/spaces.d.ts.map +1 -1
  452. package/dist/measure/spaces.js +36 -0
  453. package/dist/measure/spaces.js.map +1 -1
  454. package/dist/measure/types.d.ts +9 -0
  455. package/dist/measure/types.d.ts.map +1 -1
  456. package/dist/measure/types.js.map +1 -1
  457. package/dist/numbering.d.ts +5 -0
  458. package/dist/numbering.d.ts.map +1 -1
  459. package/dist/numbering.js +5 -1
  460. package/dist/numbering.js.map +1 -1
  461. package/dist/parse/types.d.ts +13 -0
  462. package/dist/parse/types.d.ts.map +1 -1
  463. package/dist/pipeline/bandCaps.d.ts +35 -1
  464. package/dist/pipeline/bandCaps.d.ts.map +1 -1
  465. package/dist/pipeline/bandCaps.js +95 -3
  466. package/dist/pipeline/bandCaps.js.map +1 -1
  467. package/dist/pipeline/build.d.ts.map +1 -1
  468. package/dist/pipeline/build.js +754 -49
  469. package/dist/pipeline/build.js.map +1 -1
  470. package/dist/pipeline/buildHelpers.d.ts.map +1 -1
  471. package/dist/pipeline/buildHelpers.js +5 -1
  472. package/dist/pipeline/buildHelpers.js.map +1 -1
  473. package/dist/pipeline/buildMeasurement.d.ts +9 -0
  474. package/dist/pipeline/buildMeasurement.d.ts.map +1 -1
  475. package/dist/pipeline/buildMeasurement.js +3 -2
  476. package/dist/pipeline/buildMeasurement.js.map +1 -1
  477. package/dist/pipeline/calloutLayout.d.ts +10 -1
  478. package/dist/pipeline/calloutLayout.d.ts.map +1 -1
  479. package/dist/pipeline/calloutLayout.js +45 -9
  480. package/dist/pipeline/calloutLayout.js.map +1 -1
  481. package/dist/pipeline/columnBalancing.d.ts +44 -7
  482. package/dist/pipeline/columnBalancing.d.ts.map +1 -1
  483. package/dist/pipeline/columnBalancing.js +167 -40
  484. package/dist/pipeline/columnBalancing.js.map +1 -1
  485. package/dist/pipeline/config.d.ts +2 -2
  486. package/dist/pipeline/config.d.ts.map +1 -1
  487. package/dist/pipeline/config.js +18 -3
  488. package/dist/pipeline/config.js.map +1 -1
  489. package/dist/pipeline/contentWarnings.d.ts +6 -0
  490. package/dist/pipeline/contentWarnings.d.ts.map +1 -1
  491. package/dist/pipeline/contentWarnings.js +32 -0
  492. package/dist/pipeline/contentWarnings.js.map +1 -1
  493. package/dist/pipeline/crossRefs.d.ts +12 -1
  494. package/dist/pipeline/crossRefs.d.ts.map +1 -1
  495. package/dist/pipeline/crossRefs.js +22 -14
  496. package/dist/pipeline/crossRefs.js.map +1 -1
  497. package/dist/pipeline/flowColumns.d.ts +2 -1
  498. package/dist/pipeline/flowColumns.d.ts.map +1 -1
  499. package/dist/pipeline/flowColumns.js +12 -2
  500. package/dist/pipeline/flowColumns.js.map +1 -1
  501. package/dist/pipeline/footnotes.d.ts.map +1 -1
  502. package/dist/pipeline/footnotes.js +3 -0
  503. package/dist/pipeline/footnotes.js.map +1 -1
  504. package/dist/pipeline/indexDirective.d.ts.map +1 -1
  505. package/dist/pipeline/indexDirective.js +15 -0
  506. package/dist/pipeline/indexDirective.js.map +1 -1
  507. package/dist/pipeline/lists.d.ts +1 -1
  508. package/dist/pipeline/lists.d.ts.map +1 -1
  509. package/dist/pipeline/lists.js +9 -1
  510. package/dist/pipeline/lists.js.map +1 -1
  511. package/dist/pipeline/measureContentBlock.d.ts +18 -0
  512. package/dist/pipeline/measureContentBlock.d.ts.map +1 -1
  513. package/dist/pipeline/measureContentBlock.js +13 -3
  514. package/dist/pipeline/measureContentBlock.js.map +1 -1
  515. package/dist/pipeline/paragraphContainers.d.ts +4 -1
  516. package/dist/pipeline/paragraphContainers.d.ts.map +1 -1
  517. package/dist/pipeline/paragraphContainers.js +2 -0
  518. package/dist/pipeline/paragraphContainers.js.map +1 -1
  519. package/dist/pipeline/placement.d.ts +15 -0
  520. package/dist/pipeline/placement.d.ts.map +1 -1
  521. package/dist/pipeline/placement.js +36 -4
  522. package/dist/pipeline/placement.js.map +1 -1
  523. package/dist/pipeline/raggedLines.d.ts +8 -6
  524. package/dist/pipeline/raggedLines.d.ts.map +1 -1
  525. package/dist/pipeline/raggedLines.js +13 -10
  526. package/dist/pipeline/raggedLines.js.map +1 -1
  527. package/dist/pipeline/resourceLayout.d.ts +4 -0
  528. package/dist/pipeline/resourceLayout.d.ts.map +1 -1
  529. package/dist/pipeline/resourceLayout.js +22 -7
  530. package/dist/pipeline/resourceLayout.js.map +1 -1
  531. package/dist/pipeline/resourceNumbering.d.ts +6 -3
  532. package/dist/pipeline/resourceNumbering.d.ts.map +1 -1
  533. package/dist/pipeline/resourceNumbering.js +36 -19
  534. package/dist/pipeline/resourceNumbering.js.map +1 -1
  535. package/dist/pipeline/toc.d.ts +0 -3
  536. package/dist/pipeline/toc.d.ts.map +1 -1
  537. package/dist/pipeline/toc.js +19 -2
  538. package/dist/pipeline/toc.js.map +1 -1
  539. package/dist/types.d.ts +411 -15
  540. package/dist/types.d.ts.map +1 -1
  541. package/dist/vdt.d.ts +90 -7
  542. package/dist/vdt.d.ts.map +1 -1
  543. package/dist/vdt.js.map +1 -1
  544. package/package.json +1 -1
@@ -3,6 +3,9 @@
3
3
  // the number as `configVersion` (every writer since postext 1.5 sets it);
4
4
  // the Sandbox numbers its stored projects the same way.
5
5
  import { DEFAULT_MATH_CONFIG } from '../defaults/math';
6
+ import { avoidOrphansByDefault } from '../defaults/bodyText';
7
+ import { DEFAULT_COLUMN_BALANCING, balancingOnByDefault } from '../defaults/headings';
8
+ import { cjkRegionOfConfig } from '../defaults/cjk';
6
9
  import { dimensionsEqual } from '../defaults/shared';
7
10
  import { DEFAULT_TEXT_ELEMENT, resolveDesignLineHeight } from '../defaults/headerFooter';
8
11
  import { DEFAULT_PAGE_CONFIG } from '../defaults/page';
@@ -11,8 +14,8 @@ import { KNOWN_CONTAINERS } from '../parse/blockParser';
11
14
  import { codeFenceOpen } from '../parse/codeFence';
12
15
  import { hasCJK } from '../measure/cjk';
13
16
  /**
14
- * The configuration rules this engine writes: 11 since #632 (10 from
15
- * postext 1.24, 9 from 1.23, 8 from 1.5). Thirteen rules changed in 1.5 and
17
+ * The configuration rules this engine writes: 12 since #747 (11 from
18
+ * postext 1.25, 10 from 1.24, 9 from 1.23, 8 from 1.5). Thirteen rules changed in 1.5 and
16
19
  * more since, and a configuration
17
20
  * stored under an older
18
21
  * number (or none) is read through {@link migrateConfig}:
@@ -115,6 +118,51 @@ import { hasCJK } from '../measure/cjk';
115
118
  * the opener's own column is a slot for a top float
116
119
  * (`layout.floatsUnderOpener`, #639), where up to 1.24 such a float
117
120
  * landed from the second column on ({@link pinLegacyOpenerHeadFloats}).
121
+ * - 12 (#747), the rules of postext 1.28, each listed with its pin below.
122
+ * - column balancing tries the list ends, the displays, the float bands
123
+ * and the loose paragraphs before a heading takes a third line
124
+ * (`headings.balancing.maxLinesBeforeLoose: 2`, #707), where up to 1.27
125
+ * a heading took all its lines first ({@link pinLegacyLooseOrder});
126
+ * - under a float that stands over several text columns, column
127
+ * balancing lowers a column only with the others under it or to end it
128
+ * flush (`headings.balancing.stretchAfterWideFloats: 'flush'`, #708),
129
+ * where up to 1.27 a column took its after-float line as under any
130
+ * float ({@link pinLegacyWideFloatStretch});
131
+ * - the level cut of a closing band counts lines of the band's own text
132
+ * when it is off the baseline grid (`headings.balancing.trailingStep:
133
+ * 'lines'`, #711), where up to 1.27 every cut stood on a grid line
134
+ * ({@link pinLegacyTrailingStep});
135
+ * - a group of an index divided between two columns keeps two entries
136
+ * on each side (`index.groups.splitMinEntries: 2`, #712), where up to
137
+ * 1.27 a column could end between any two entries ({@link
138
+ * pinLegacyIndexGroupSplit});
139
+ * - a page on a character grid (`cjk.grid.enabled`) holds its lines:
140
+ * `bodyText.avoidWidows` is off by default there, and
141
+ * `bodyText.avoidOrphans` too in the Japan region (#717), where up to
142
+ * 1.27 both were on ({@link pinLegacyGridBreakRules});
143
+ * - a line breaks inside a two-row note only where two of its characters
144
+ * stand on either side (`cjk.warichu.minChars: 2`, #720), where up to
145
+ * 1.27 it could leave one ({@link pinLegacyNoteBreaks});
146
+ * - in the Japan region a Western word takes the Han–Latin space on a
147
+ * side that ends in a bracket or a sign (`cjk.latinSpacingEdge:
148
+ * 'western'`, #721), where up to 1.27 only a side that ends in a
149
+ * letter or a digit did ({@link pinLegacyLatinSpacingEdge});
150
+ * - a resource set in the text takes `placement.captionSide` as a column
151
+ * float does (`layout.inlineCaptionSide`, #729), where up to 1.27 its
152
+ * caption stayed under it ({@link pinLegacyInlineCaptionSide});
153
+ * - a reference whose label is words (an anchor's text, a title, a
154
+ * `text="…"` override) breaks at the spaces of its label
155
+ * (`crossRefs.breakLabels`, #702), where up to 1.27 every label was
156
+ * one unbreakable word ({@link pinLegacyRefLabelBreaks});
157
+ * - a comic balloon reshaped to fit its panel does not part a Chinese
158
+ * word to do so (`comics.lettering.strictPlacement`, #728), where up
159
+ * to 1.27 a narrow shape that cut one could win over a balloon read
160
+ * out of order ({@link pinLegacyBalloonPlacement});
161
+ * - a word with no letter (`46.`, `1367)`) is shaped in the script of
162
+ * the text around it, in a face that draws its punctuation by script
163
+ * (`bodyText.scriptContext`, #725), where up to 1.27 it was shaped
164
+ * alone, in the script each browser and the PDF picked ({@link
165
+ * pinLegacyScriptContext});
118
166
  *
119
167
  * A configuration stored without a version was written for postext 1.4 or
120
168
  * earlier. One stored under 3 to 7 was written by a 1.5 prerelease, and
@@ -127,9 +175,11 @@ import { hasCJK } from '../measure/cjk';
127
175
  * older one gets too); one stored under 9 was written by postext 1.23 and
128
176
  * gets the version-10 pins (which every older one gets too); one stored
129
177
  * under 10 was written by postext 1.24 and gets the version-11 pins (which
130
- * every older one gets too).
178
+ * every older one gets too); one stored under 11 was written by postext
179
+ * 1.25 to 1.27 and gets the version-12 pins (which every older one gets
180
+ * too).
131
181
  */
132
- export const CONFIG_VERSION = 11;
182
+ export const CONFIG_VERSION = 12;
133
183
  /** The rules that merge a partial heading break onto its level's. */
134
184
  const HEADING_BREAK_RULES = 3;
135
185
  /** The rules that set a formula's em at the documented size. */
@@ -192,6 +242,37 @@ const FLOW_COLUMNS_RULES = 11;
192
242
  /** The rules that offer a float the head of a page-span opener's own
193
243
  * column. */
194
244
  const OPENER_HEAD_FLOAT_RULES = 11;
245
+ /** The rules that try the other balancing levers before a heading takes a
246
+ * third line (#707). */
247
+ const LOOSE_ORDER_RULES = 12;
248
+ /** The rules that keep the heads level under a float over several columns
249
+ * (#708). */
250
+ const WIDE_FLOAT_STRETCH_RULES = 12;
251
+ /** The rules that cut a closing band in lines of its own text (#711). */
252
+ const TRAILING_STEP_RULES = 12;
253
+ /** The rules that keep two entries of an index group on each side of a
254
+ * column break (#712). */
255
+ const INDEX_GROUP_SPLIT_RULES = 12;
256
+ /** The rules that turn the widow rule off on a character grid, and the
257
+ * orphan rule too in the Japan region (#717). */
258
+ const GRID_BREAK_RULES = 12;
259
+ /** The rules that keep two characters of a two-row note on either side of
260
+ * a line break (#720). */
261
+ const NOTE_BREAK_RULES = 12;
262
+ /** The rules that set the Han–Latin space next to the brackets and signs
263
+ * of a Western word in the Japan region (#721). */
264
+ const LATIN_SPACING_EDGE_RULES = 12;
265
+ /** The rules that set the side caption of a resource set in the text (#729). */
266
+ const INLINE_CAPTION_SIDE_RULES = 12;
267
+ /** The rules that break a reference's label of words at its spaces
268
+ * (#702). */
269
+ const REF_LABEL_BREAK_RULES = 12;
270
+ /** The rules that keep a reshaped comic balloon from parting a Chinese
271
+ * word (#728). */
272
+ const BALLOON_PLACEMENT_RULES = 12;
273
+ /** The rules that shape a word with no letter in the script of its
274
+ * context (#725). */
275
+ const SCRIPT_CONTEXT_RULES = 12;
195
276
  /** Up to 1.4 a drop cap with no `fontSize` was as tall as the line boxes it
196
277
  * spans divided by this, the share of a letter's size its capitals take. */
197
278
  const CAP_HEIGHT = 0.72;
@@ -639,6 +720,160 @@ export function pinLegacyGridBalancing(config) {
639
720
  return config;
640
721
  return { ...config, headings: { ...headings, balancing: { ...balancing, enabled: true } } };
641
722
  }
723
+ /** Whether `config` balances its columns: what it says, else the default
724
+ * of its document ({@link balancingOnByDefault}). */
725
+ function balancesColumns(config) {
726
+ const balancing = isRecord(config.headings) && isRecord(config.headings.balancing) ? config.headings.balancing : {};
727
+ if (balancing.enabled !== undefined)
728
+ return balancing.enabled === true;
729
+ return balancingOnByDefault(config);
730
+ }
731
+ /**
732
+ * A configuration written before #707 (postext 1.27 or earlier), pinned to
733
+ * the order its columns were balanced in: `headings.balancing.
734
+ * maxLinesBeforeLoose` gets the configuration's own `maxLinesPerHeading`
735
+ * (4 when it sets none), so a heading takes all its lines before the list
736
+ * ends, the displays, the float bands and the loose paragraphs are tried,
737
+ * where today it takes two. A configuration that does not balance its
738
+ * columns, that sets the key, or whose headings take two lines or fewer
739
+ * (the order then changes nothing) is returned as it is (the same object).
740
+ */
741
+ export function pinLegacyLooseOrder(config) {
742
+ if (!balancesColumns(config))
743
+ return config;
744
+ const headings = isRecord(config.headings) ? config.headings : {};
745
+ const balancing = isRecord(headings.balancing) ? headings.balancing : {};
746
+ if (balancing.maxLinesBeforeLoose !== undefined)
747
+ return config;
748
+ const cap = typeof balancing.maxLinesPerHeading === 'number' ? balancing.maxLinesPerHeading : DEFAULT_COLUMN_BALANCING.maxLinesPerHeading;
749
+ if (cap <= DEFAULT_COLUMN_BALANCING.maxLinesBeforeLoose)
750
+ return config;
751
+ return { ...config, headings: { ...headings, balancing: { ...balancing, maxLinesBeforeLoose: cap } } };
752
+ }
753
+ /**
754
+ * A configuration written before #708 (postext 1.27 or earlier), pinned to
755
+ * the way 1.27 stretched a column under a float that stands over several
756
+ * columns: `headings.balancing.stretchAfterWideFloats: 'always'`, so the
757
+ * column takes its after-float line as under any float, where today it
758
+ * moves only with the others under the float or to end flush. A
759
+ * configuration that does not balance its columns, that turns
760
+ * `stretchAfterFloats` off or that sets the key is returned as it is (the
761
+ * same object).
762
+ */
763
+ export function pinLegacyWideFloatStretch(config) {
764
+ if (!balancesColumns(config))
765
+ return config;
766
+ const headings = isRecord(config.headings) ? config.headings : {};
767
+ const balancing = isRecord(headings.balancing) ? headings.balancing : {};
768
+ if (balancing.stretchAfterWideFloats !== undefined || balancing.stretchAfterFloats === false)
769
+ return config;
770
+ return { ...config, headings: { ...headings, balancing: { ...balancing, stretchAfterWideFloats: 'always' } } };
771
+ }
772
+ /**
773
+ * A configuration written before #711 (postext 1.27 or earlier), pinned to
774
+ * the way 1.27 cut a closing band level: `headings.balancing.trailingStep:
775
+ * 'grid'`, every cut a whole number of baseline-grid lines, where today a
776
+ * band whose text is set on a leading of its own is cut by lines of that
777
+ * leading. A configuration that does not balance its columns, that turns
778
+ * `trailing` and `beforeSpan` both off or that sets the key is returned as
779
+ * it is (the same object).
780
+ */
781
+ export function pinLegacyTrailingStep(config) {
782
+ if (!balancesColumns(config))
783
+ return config;
784
+ const headings = isRecord(config.headings) ? config.headings : {};
785
+ const balancing = isRecord(headings.balancing) ? headings.balancing : {};
786
+ if (balancing.trailingStep !== undefined || (balancing.trailing === false && balancing.beforeSpan === false))
787
+ return config;
788
+ return { ...config, headings: { ...headings, balancing: { ...balancing, trailingStep: 'grid' } } };
789
+ }
790
+ /** Whether markdown may set text off the body's leading in the flow, which
791
+ * is all the unit of a level cut changes: a container, a directive or a
792
+ * code fence, a quotation, a list, a display formula, a citation (its
793
+ * list of references). Prose under headings is on the grid. Unknown
794
+ * content (undefined) may. */
795
+ function mayHaveOffGridLines(content) {
796
+ if (content === undefined)
797
+ return true;
798
+ const test = (text) => /^[^\S\n]*(?::::|```|~~~|>|[-*+][^\S\n]|\d+[.)][^\S\n]|\$\$)|\[@/m.test(text);
799
+ return typeof content === 'string' ? test(content) : content.some(test);
800
+ }
801
+ /**
802
+ * A configuration written before #712 (postext 1.27 or earlier), pinned to
803
+ * the way 1.27 broke an index between columns: `index.groups.
804
+ * splitMinEntries: 1`, so a column may end between any two entries of a
805
+ * group, where today two of them stay and two go on. A configuration that
806
+ * sets the key is returned as it is (the same object).
807
+ */
808
+ export function pinLegacyIndexGroupSplit(config) {
809
+ const index = isRecord(config.index) ? config.index : {};
810
+ const groups = isRecord(index.groups) ? index.groups : {};
811
+ if (groups.splitMinEntries !== undefined)
812
+ return config;
813
+ return { ...config, index: { ...index, groups: { ...groups, splitMinEntries: 1 } } };
814
+ }
815
+ /** An `:::index` fence on a line of its own, as the block parser reads one
816
+ * (the line trimmed). */
817
+ const INDEX_FENCE_LINE_RE = /^[^\S\n]*:::[^\S\n]*index[^\S\n]*(?:\{[^}\n]*\})?[^\S\n]*$/m;
818
+ /** Whether markdown may print an index. Unknown content (undefined) may. */
819
+ function mayHaveIndexes(content) {
820
+ if (content === undefined)
821
+ return true;
822
+ if (typeof content === 'string')
823
+ return INDEX_FENCE_LINE_RE.test(content);
824
+ return content.some((text) => INDEX_FENCE_LINE_RE.test(text));
825
+ }
826
+ /** Whether markdown may set a float: a resource embedded on its own line
827
+ * (as {@link mayEmbedResources} reads one) or cited (`:ref`, LaTeX's
828
+ * `\ref`), or a box floated by its fence (`placement=`). Unknown content
829
+ * (undefined) may. */
830
+ function mayHaveFloats(content) {
831
+ if (content === undefined || mayEmbedResources(content))
832
+ return true;
833
+ const test = (text) => /:ref\s*[[{]|\\(?:eq)?ref\{|placement\s*=/.test(text);
834
+ return typeof content === 'string' ? test(content) : content.some(test);
835
+ }
836
+ /**
837
+ * A configuration written before #717 (postext 1.27 or earlier), pinned to
838
+ * the break rules it laid out with on a character grid: a config with
839
+ * `cjk.grid.enabled` gets `bodyText.avoidWidows: true`, and in the Japan
840
+ * region `bodyText.avoidOrphans: true` too, each where it does not set the
841
+ * key, where today the first is off by default on a grid and the second
842
+ * in the Japan region ({@link avoidOrphansByDefault}; a Chinese grid keeps
843
+ * it on, so nothing is written there). Any other configuration is
844
+ * returned as it is (the same object).
845
+ */
846
+ export function pinLegacyGridBreakRules(config) {
847
+ if (!isRecord(config.cjk) || !isRecord(config.cjk.grid) || config.cjk.grid.enabled !== true)
848
+ return config;
849
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
850
+ const widows = bodyText.avoidWidows === undefined;
851
+ const orphans = bodyText.avoidOrphans === undefined && !avoidOrphansByDefault(config);
852
+ if (!widows && !orphans)
853
+ return config;
854
+ return {
855
+ ...config,
856
+ bodyText: {
857
+ ...bodyText,
858
+ ...(widows ? { avoidWidows: true } : {}),
859
+ ...(orphans ? { avoidOrphans: true } : {}),
860
+ },
861
+ };
862
+ }
863
+ /**
864
+ * A configuration written before #729 (postext 1.27 or earlier), pinned to
865
+ * the caption 1.27 gave a resource set in the text: `layout.inlineCaptionSide:
866
+ * false` on a `oneAndHalf` layout that does not set the key, so
867
+ * `placement.captionSide` acts on column floats only and the caption of an
868
+ * inline embed stays under it, where today it goes to the float-only side
869
+ * column. Any other configuration is returned as it is (the same object).
870
+ */
871
+ export function pinLegacyInlineCaptionSide(config) {
872
+ const layout = isRecord(config.layout) ? config.layout : {};
873
+ if (layout.layoutType !== 'oneAndHalf' || layout.inlineCaptionSide !== undefined)
874
+ return config;
875
+ return { ...config, layout: { ...layout, inlineCaptionSide: false } };
876
+ }
642
877
  /**
643
878
  * A configuration written before #634 (postext 1.24 or earlier), pinned to
644
879
  * the way 1.24 placed a table set `here`: `tableStyle.splitInline: false`,
@@ -1201,6 +1436,123 @@ export function pinLegacyDesignText(config) {
1201
1436
  return config;
1202
1437
  return { ...config, cjk: { ...cjk, composeDesignText: false } };
1203
1438
  }
1439
+ /**
1440
+ * A configuration written before #720 (postext 1.27 or earlier), pinned to
1441
+ * the way 1.27 broke a line inside a two-row note: `cjk.warichu.minChars:
1442
+ * 1`, so a break may leave one character of the note at the end of a line
1443
+ * or at the head of the next, where today two stand on either side. A
1444
+ * configuration that sets `warichu.minChars` is returned as it is (the
1445
+ * same object).
1446
+ */
1447
+ export function pinLegacyNoteBreaks(config) {
1448
+ const cjk = cjkOf(config);
1449
+ const warichu = isRecord(cjk.warichu) ? cjk.warichu : {};
1450
+ if (warichu.minChars !== undefined)
1451
+ return config;
1452
+ return { ...config, cjk: { ...cjk, warichu: { ...warichu, minChars: 1 } } };
1453
+ }
1454
+ /**
1455
+ * A configuration written before #721 (postext 1.27 or earlier), pinned to
1456
+ * the sides of a Western word 1.27 set the Han–Latin space on:
1457
+ * `cjk.latinSpacingEdge: 'letters'` on a configuration that resolves to
1458
+ * the Japan region ({@link cjkRegionOfConfig}) and does not set the key,
1459
+ * where today such a document also sets the space on a side that ends in
1460
+ * a bracket or a sign (`normalize()関数`). A Chinese document keeps
1461
+ * `'letters'` by default, and any other configuration is returned as it is
1462
+ * (the same object).
1463
+ */
1464
+ export function pinLegacyLatinSpacingEdge(config) {
1465
+ const cjk = cjkOf(config);
1466
+ if (cjk.latinSpacingEdge !== undefined || cjkRegionOfConfig(config) !== 'japan')
1467
+ return config;
1468
+ return { ...config, cjk: { ...cjk, latinSpacingEdge: 'letters' } };
1469
+ }
1470
+ /**
1471
+ * A configuration written before #702 (postext 1.27 or earlier), pinned to
1472
+ * the way it set a cross-reference: `crossRefs.breakLabels: false`, every
1473
+ * label one word no line breaks inside, where today a label of words (the
1474
+ * text of a `[words]{#id}` anchor, a title, a `text="…"` override) breaks
1475
+ * at its spaces and those spaces stretch with the line. A configuration
1476
+ * that names the setting already is returned as it is (the same object).
1477
+ */
1478
+ export function pinLegacyRefLabelBreaks(config) {
1479
+ const crossRefs = isRecord(config.crossRefs) ? config.crossRefs : {};
1480
+ if (crossRefs.breakLabels !== undefined)
1481
+ return config;
1482
+ return { ...config, crossRefs: { ...crossRefs, breakLabels: false } };
1483
+ }
1484
+ /** A reference typed in the text: `:ref{…}`, LaTeX's `\ref{…}` and
1485
+ * `\eqref{…}`, or a pandoc-crossref `@id` (an `@` that opens a word). */
1486
+ const REF_RE = /:ref\{|\\(?:eq)?ref\{|(?:^|[^\p{L}\p{N}])@[\p{L}\p{N}_]/mu;
1487
+ /** Whether markdown may hold a cross-reference. Unknown content
1488
+ * (undefined) may. */
1489
+ function mayHaveRefs(content) {
1490
+ if (content === undefined)
1491
+ return true;
1492
+ return typeof content === 'string' ? REF_RE.test(content) : content.some((text) => REF_RE.test(text));
1493
+ }
1494
+ /**
1495
+ * A configuration written before #728 (postext 1.27 or earlier), pinned to
1496
+ * the way it placed its comic balloons: `comics.lettering.strictPlacement:
1497
+ * false`, so a balloon reshaped to fit its panel may part a Chinese word
1498
+ * as it did, where today such a shape pays for the cut and the placement
1499
+ * looks elsewhere first. A configuration that names the setting already is
1500
+ * returned as it is (the same object).
1501
+ */
1502
+ export function pinLegacyBalloonPlacement(config) {
1503
+ const comics = isRecord(config.comics) ? config.comics : {};
1504
+ const lettering = isRecord(comics.lettering) ? comics.lettering : {};
1505
+ if (lettering.strictPlacement !== undefined)
1506
+ return config;
1507
+ return { ...config, comics: { ...comics, lettering: { ...lettering, strictPlacement: false } } };
1508
+ }
1509
+ /**
1510
+ * A configuration written before #725 (postext 1.27 or earlier), pinned to
1511
+ * the way it shaped a word with no letter (`46.`, `1367)`):
1512
+ * `bodyText.scriptContext: false`, each such word shaped alone, in the
1513
+ * script the browser that measures it and the PDF's shaper pick, where
1514
+ * today it takes the script of the text around it. Every such
1515
+ * configuration gets it: the rule acts in a face that draws its
1516
+ * punctuation by script, and which faces a document loads is not known
1517
+ * here. A configuration that names the setting already is returned as it
1518
+ * is (the same object).
1519
+ */
1520
+ export function pinLegacyScriptContext(config) {
1521
+ const bodyText = isRecord(config.bodyText) ? config.bodyText : {};
1522
+ if (bodyText.scriptContext !== undefined)
1523
+ return config;
1524
+ return { ...config, bodyText: { ...bodyText, scriptContext: false } };
1525
+ }
1526
+ /** A line that opens a comic: a `:::page` or a `:::strip` fence. */
1527
+ const COMIC_FENCE_LINE_RE = /^[ \t]*:::(?:page|strip)(?=[\s{]|$)/m;
1528
+ /** Whether markdown may hold a comic page or strip. Unknown content
1529
+ * (undefined) may. */
1530
+ function mayHaveComics(content) {
1531
+ if (content === undefined)
1532
+ return true;
1533
+ return typeof content === 'string' ? COMIC_FENCE_LINE_RE.test(content) : content.some((text) => COMIC_FENCE_LINE_RE.test(text));
1534
+ }
1535
+ /** Whether markdown may hold kana or kanji. Unknown content (undefined)
1536
+ * may. */
1537
+ function mayHaveCjkText(content) {
1538
+ if (content === undefined)
1539
+ return true;
1540
+ return typeof content === 'string' ? hasCJK(content) : content.some(hasCJK);
1541
+ }
1542
+ /** A two-row note typed in the text. */
1543
+ const NOTE_RE = /:warichu\[/;
1544
+ /** Whether a document may set a two-row note: a `:warichu[…]` in its
1545
+ * markdown, or citations set as notes (`citations.notes: 'warichu'`).
1546
+ * Unknown content (undefined) may. */
1547
+ function mayHaveNotes(content, config) {
1548
+ if (content === undefined)
1549
+ return true;
1550
+ if (isRecord(config.citations) && config.citations.notes === 'warichu')
1551
+ return true;
1552
+ if (typeof content === 'string')
1553
+ return NOTE_RE.test(content);
1554
+ return content.some((text) => NOTE_RE.test(text));
1555
+ }
1204
1556
  /** A book title in brackets (《》 〈〉), or a `:book[…]` title. */
1205
1557
  const BOOK_TITLE_RE = /[《〈︽︿]|:book\[/;
1206
1558
  /** A circled, parenthesized or full-stop number or letter (①, ⑴, ⒈, ⓐ, ❶,
@@ -1281,7 +1633,33 @@ function mayHaveCjkDesignText(content, config) {
1281
1633
  * `options.content` nor the configuration holds CJK text, and the slots
1282
1634
  * under its page-span openers by {@link pinLegacyOpenerHeadFloats}, when
1283
1635
  * it sets a heading level or style with `span: 'page'`, unless
1284
- * `options.content` shows no heading. A current one is returned as it is (the same object).
1636
+ * `options.content` shows no heading; one older than 12 has the order of
1637
+ * its balancing levers pinned by {@link pinLegacyLooseOrder}, when it
1638
+ * balances its columns and lets a heading take more than two lines, unless
1639
+ * `options.content` shows no heading, and the after-float lever under a
1640
+ * float over several columns by {@link pinLegacyWideFloatStretch}, when it
1641
+ * balances its columns, unless `options.content` shows no float, the unit
1642
+ * of the level cut of its closing bands by {@link pinLegacyTrailingStep},
1643
+ * when it balances its columns, unless `options.content` shows prose and
1644
+ * headings only, and the
1645
+ * breaks inside the groups of its indexes by {@link
1646
+ * pinLegacyIndexGroupSplit}, unless `options.content` shows no `:::index`;
1647
+ * it also has the widow and
1648
+ * orphan rules of a page on a character grid pinned by {@link
1649
+ * pinLegacyGridBreakRules}, the breaks inside its two-row notes by
1650
+ * {@link pinLegacyNoteBreaks}, unless neither `options.content` nor the
1651
+ * configuration shows a note, and the sides of a Western word that take
1652
+ * the Han–Latin space in the Japan region by {@link
1653
+ * pinLegacyLatinSpacingEdge}, unless `options.content` shows no kana or
1654
+ * kanji, and the caption of a resource set in the text of a `oneAndHalf`
1655
+ * layout by {@link pinLegacyInlineCaptionSide}, unless `options.content`
1656
+ * shows it embeds no resource, and the labels of its cross-references kept whole by {@link
1657
+ * pinLegacyRefLabelBreaks}, unless `options.content` shows no reference,
1658
+ * and its comic balloons placed as 1.27 placed them by {@link
1659
+ * pinLegacyBalloonPlacement}, unless `options.content` shows no comic page
1660
+ * or strip, and its words with no letter shaped alone by {@link
1661
+ * pinLegacyScriptContext}.
1662
+ * A current one is returned as it is (the same object).
1285
1663
  * Migrate a stored configuration once and store it again under
1286
1664
  * `CONFIG_VERSION`: the maths pin multiplies a scale, so a configuration
1287
1665
  * read twice under its old number would grow twice.
@@ -1340,6 +1718,28 @@ export function migrateConfig(config, configVersion, options = {}) {
1340
1718
  out = pinLegacyFlowColumns(out);
1341
1719
  if (rules < OPENER_HEAD_FLOAT_RULES && setsPageSpanHeading(out) && mayHaveHeadings(content))
1342
1720
  out = pinLegacyOpenerHeadFloats(out);
1721
+ if (rules < LOOSE_ORDER_RULES && mayHaveHeadings(content))
1722
+ out = pinLegacyLooseOrder(out);
1723
+ if (rules < WIDE_FLOAT_STRETCH_RULES && mayHaveFloats(content))
1724
+ out = pinLegacyWideFloatStretch(out);
1725
+ if (rules < TRAILING_STEP_RULES && mayHaveOffGridLines(content))
1726
+ out = pinLegacyTrailingStep(out);
1727
+ if (rules < INDEX_GROUP_SPLIT_RULES && mayHaveIndexes(content))
1728
+ out = pinLegacyIndexGroupSplit(out);
1729
+ if (rules < GRID_BREAK_RULES)
1730
+ out = pinLegacyGridBreakRules(out);
1731
+ if (rules < NOTE_BREAK_RULES && mayHaveNotes(content, out))
1732
+ out = pinLegacyNoteBreaks(out);
1733
+ if (rules < LATIN_SPACING_EDGE_RULES && mayHaveCjkText(content))
1734
+ out = pinLegacyLatinSpacingEdge(out);
1735
+ if (rules < INLINE_CAPTION_SIDE_RULES && mayEmbedResources(content))
1736
+ out = pinLegacyInlineCaptionSide(out);
1737
+ if (rules < REF_LABEL_BREAK_RULES && mayHaveRefs(content))
1738
+ out = pinLegacyRefLabelBreaks(out);
1739
+ if (rules < BALLOON_PLACEMENT_RULES && mayHaveComics(content))
1740
+ out = pinLegacyBalloonPlacement(out);
1741
+ if (rules < SCRIPT_CONTEXT_RULES)
1742
+ out = pinLegacyScriptContext(out);
1343
1743
  return out;
1344
1744
  }
1345
1745
  /**
@@ -1363,7 +1763,19 @@ export function migrateConfig(config, configVersion, options = {}) {
1363
1763
  * inline tables on the `tableStyle` in force, the `:::columns` groups and
1364
1764
  * the slots under a page-span opener on the `layout` in force (the slots
1365
1765
  * when the merged configuration sets a page-span heading), and the book
1366
- * titles, the circled numbers and the design text on the `cjk` in force.
1766
+ * titles, the circled numbers and the design text on the `cjk` in force,
1767
+ * the order of the balancing levers and the after-float lever under a
1768
+ * float over several columns on the `headings` in force (when the
1769
+ * merged configuration balances its columns), with the unit of the level
1770
+ * cut of a closing band, the breaks inside the groups
1771
+ * of an index on the `index` in force,
1772
+ * and the widow and orphan rules of a character grid on the merged `cjk`
1773
+ * and `bodyText`, and the breaks inside two-row notes and the sides of a
1774
+ * Western word that take the Han–Latin space (in the Japan region, read
1775
+ * from the merged `cjk`, `locale` and hyphenation locale) on the `cjk` in
1776
+ * force, the side caption of a resource set in the text on the `layout` in
1777
+ * force, and the labels of cross-references on the `crossRefs` in force,
1778
+ * and the shaping of words with no letter on the `bodyText` in force.
1367
1779
  * @internal `readBundle`'s; hosts call {@link migrateConfig}.
1368
1780
  */
1369
1781
  export function migrateBundleConfig(base, layers, configVersion, options = {}) {
@@ -1423,6 +1835,28 @@ export function migrateBundleConfig(base, layers, configVersion, options = {}) {
1423
1835
  merged = pinLegacyFlowColumns(merged);
1424
1836
  if (rules < OPENER_HEAD_FLOAT_RULES && setsPageSpanHeading(merged) && mayHaveHeadings(content))
1425
1837
  merged = pinLegacyOpenerHeadFloats(merged);
1838
+ if (rules < LOOSE_ORDER_RULES && mayHaveHeadings(content))
1839
+ merged = pinLegacyLooseOrder(merged);
1840
+ if (rules < WIDE_FLOAT_STRETCH_RULES && mayHaveFloats(content))
1841
+ merged = pinLegacyWideFloatStretch(merged);
1842
+ if (rules < TRAILING_STEP_RULES && mayHaveOffGridLines(content))
1843
+ merged = pinLegacyTrailingStep(merged);
1844
+ if (rules < INDEX_GROUP_SPLIT_RULES && mayHaveIndexes(content))
1845
+ merged = pinLegacyIndexGroupSplit(merged);
1846
+ if (rules < GRID_BREAK_RULES)
1847
+ merged = pinLegacyGridBreakRules(merged);
1848
+ if (rules < NOTE_BREAK_RULES && mayHaveNotes(content, merged))
1849
+ merged = pinLegacyNoteBreaks(merged);
1850
+ if (rules < LATIN_SPACING_EDGE_RULES && mayHaveCjkText(content))
1851
+ merged = pinLegacyLatinSpacingEdge(merged);
1852
+ if (rules < INLINE_CAPTION_SIDE_RULES && mayEmbedResources(content))
1853
+ merged = pinLegacyInlineCaptionSide(merged);
1854
+ if (rules < REF_LABEL_BREAK_RULES && mayHaveRefs(content))
1855
+ merged = pinLegacyRefLabelBreaks(merged);
1856
+ if (rules < BALLOON_PLACEMENT_RULES && mayHaveComics(content))
1857
+ merged = pinLegacyBalloonPlacement(merged);
1858
+ if (rules < SCRIPT_CONTEXT_RULES)
1859
+ merged = pinLegacyScriptContext(merged);
1426
1860
  return merged;
1427
1861
  }
1428
1862
  //# sourceMappingURL=configVersion.js.map