postext 1.78.0 → 1.79.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 (312) hide show
  1. package/dist/__tests__/bundle/chapterStyles.test.js +92 -22
  2. package/dist/__tests__/bundle/chapterStyles.test.js.map +1 -1
  3. package/dist/__tests__/bundle/chapterStylesWholeBook.test.d.ts +2 -0
  4. package/dist/__tests__/bundle/chapterStylesWholeBook.test.d.ts.map +1 -0
  5. package/dist/__tests__/bundle/chapterStylesWholeBook.test.js +115 -0
  6. package/dist/__tests__/bundle/chapterStylesWholeBook.test.js.map +1 -0
  7. package/dist/__tests__/bundle/designBundle.test.d.ts +2 -0
  8. package/dist/__tests__/bundle/designBundle.test.d.ts.map +1 -0
  9. package/dist/__tests__/bundle/designBundle.test.js +84 -0
  10. package/dist/__tests__/bundle/designBundle.test.js.map +1 -0
  11. package/dist/__tests__/bundle/lineBindingRename.test.d.ts +2 -0
  12. package/dist/__tests__/bundle/lineBindingRename.test.d.ts.map +1 -0
  13. package/dist/__tests__/bundle/lineBindingRename.test.js +77 -0
  14. package/dist/__tests__/bundle/lineBindingRename.test.js.map +1 -0
  15. package/dist/__tests__/bundle/sectionLines.test.d.ts +2 -0
  16. package/dist/__tests__/bundle/sectionLines.test.d.ts.map +1 -0
  17. package/dist/__tests__/bundle/sectionLines.test.js +57 -0
  18. package/dist/__tests__/bundle/sectionLines.test.js.map +1 -0
  19. package/dist/__tests__/composed/reflow/crossChapterJumps.test.js +20 -0
  20. package/dist/__tests__/composed/reflow/crossChapterJumps.test.js.map +1 -1
  21. package/dist/__tests__/defaults/designPageBreaks.test.d.ts +2 -0
  22. package/dist/__tests__/defaults/designPageBreaks.test.d.ts.map +1 -0
  23. package/dist/__tests__/defaults/designPageBreaks.test.js +49 -0
  24. package/dist/__tests__/defaults/designPageBreaks.test.js.map +1 -0
  25. package/dist/__tests__/defaults/designs.test.d.ts +2 -0
  26. package/dist/__tests__/defaults/designs.test.d.ts.map +1 -0
  27. package/dist/__tests__/defaults/designs.test.js +122 -0
  28. package/dist/__tests__/defaults/designs.test.js.map +1 -0
  29. package/dist/__tests__/exports.test.js +24 -0
  30. package/dist/__tests__/exports.test.js.map +1 -1
  31. package/dist/__tests__/knuthPlass/wasmLineBreaker.test.js +5 -1
  32. package/dist/__tests__/knuthPlass/wasmLineBreaker.test.js.map +1 -1
  33. package/dist/__tests__/pipeline/references/citationMarks.test.d.ts +2 -0
  34. package/dist/__tests__/pipeline/references/citationMarks.test.d.ts.map +1 -0
  35. package/dist/__tests__/pipeline/references/citationMarks.test.js +77 -0
  36. package/dist/__tests__/pipeline/references/citationMarks.test.js.map +1 -0
  37. package/dist/__tests__/pipeline/text/spaceBreaks.test.d.ts +2 -0
  38. package/dist/__tests__/pipeline/text/spaceBreaks.test.d.ts.map +1 -0
  39. package/dist/__tests__/pipeline/text/spaceBreaks.test.js +203 -0
  40. package/dist/__tests__/pipeline/text/spaceBreaks.test.js.map +1 -0
  41. package/dist/bundle/api.d.ts +8 -1
  42. package/dist/bundle/api.d.ts.map +1 -1
  43. package/dist/bundle/api.js +5 -1
  44. package/dist/bundle/api.js.map +1 -1
  45. package/dist/bundle/book.d.ts.map +1 -1
  46. package/dist/bundle/book.js +34 -15
  47. package/dist/bundle/book.js.map +1 -1
  48. package/dist/bundle/codec/plan.d.ts +3 -1
  49. package/dist/bundle/codec/plan.d.ts.map +1 -1
  50. package/dist/bundle/codec/plan.js +1 -0
  51. package/dist/bundle/codec/plan.js.map +1 -1
  52. package/dist/bundle/configVersion/migrate.d.ts +7 -1
  53. package/dist/bundle/configVersion/migrate.d.ts.map +1 -1
  54. package/dist/bundle/configVersion/migrate.js +11 -3
  55. package/dist/bundle/configVersion/migrate.js.map +1 -1
  56. package/dist/bundle/design.d.ts +77 -0
  57. package/dist/bundle/design.d.ts.map +1 -0
  58. package/dist/bundle/design.js +112 -0
  59. package/dist/bundle/design.js.map +1 -0
  60. package/dist/bundle/index.d.ts +3 -1
  61. package/dist/bundle/index.d.ts.map +1 -1
  62. package/dist/bundle/index.js +1 -0
  63. package/dist/bundle/index.js.map +1 -1
  64. package/dist/bundle/manifest/locale.d.ts.map +1 -1
  65. package/dist/bundle/manifest/locale.js +3 -0
  66. package/dist/bundle/manifest/locale.js.map +1 -1
  67. package/dist/bundle/manifest/validation.d.ts.map +1 -1
  68. package/dist/bundle/manifest/validation.js +10 -2
  69. package/dist/bundle/manifest/validation.js.map +1 -1
  70. package/dist/bundle/types.d.ts +9 -0
  71. package/dist/bundle/types.d.ts.map +1 -1
  72. package/dist/checks/compositionRules.d.ts +1 -0
  73. package/dist/checks/compositionRules.d.ts.map +1 -1
  74. package/dist/checks/compositionRules.js +3 -2
  75. package/dist/checks/compositionRules.js.map +1 -1
  76. package/dist/checks/configWarnings/chapterStyles.d.ts +5 -0
  77. package/dist/checks/configWarnings/chapterStyles.d.ts.map +1 -0
  78. package/dist/checks/configWarnings/chapterStyles.js +12 -0
  79. package/dist/checks/configWarnings/chapterStyles.js.map +1 -0
  80. package/dist/checks/configWarnings/choices.d.ts.map +1 -1
  81. package/dist/checks/configWarnings/choices.js +2 -0
  82. package/dist/checks/configWarnings/choices.js.map +1 -1
  83. package/dist/checks/configWarnings/collect.d.ts +3 -1
  84. package/dist/checks/configWarnings/collect.d.ts.map +1 -1
  85. package/dist/checks/configWarnings/collect.js +5 -2
  86. package/dist/checks/configWarnings/collect.js.map +1 -1
  87. package/dist/checks/hyphenRules.d.ts.map +1 -1
  88. package/dist/checks/hyphenRules.js +2 -23
  89. package/dist/checks/hyphenRules.js.map +1 -1
  90. package/dist/checks/paragraphLines.d.ts +15 -0
  91. package/dist/checks/paragraphLines.d.ts.map +1 -0
  92. package/dist/checks/paragraphLines.js +23 -0
  93. package/dist/checks/paragraphLines.js.map +1 -0
  94. package/dist/checks/spaceBreaks.d.ts +39 -0
  95. package/dist/checks/spaceBreaks.d.ts.map +1 -0
  96. package/dist/checks/spaceBreaks.js +50 -0
  97. package/dist/checks/spaceBreaks.js.map +1 -0
  98. package/dist/defaults/chapterStyles.d.ts +28 -24
  99. package/dist/defaults/chapterStyles.d.ts.map +1 -1
  100. package/dist/defaults/chapterStyles.js +90 -73
  101. package/dist/defaults/chapterStyles.js.map +1 -1
  102. package/dist/defaults/index.d.ts +1 -1
  103. package/dist/defaults/index.d.ts.map +1 -1
  104. package/dist/defaults/index.js +1 -1
  105. package/dist/defaults/index.js.map +1 -1
  106. package/dist/defaults/text/bodyText/defaults.d.ts.map +1 -1
  107. package/dist/defaults/text/bodyText/defaults.js +4 -0
  108. package/dist/defaults/text/bodyText/defaults.js.map +1 -1
  109. package/dist/defaults/text/bodyText/legacyBinding.d.ts +19 -0
  110. package/dist/defaults/text/bodyText/legacyBinding.d.ts.map +1 -0
  111. package/dist/defaults/text/bodyText/legacyBinding.js +51 -0
  112. package/dist/defaults/text/bodyText/legacyBinding.js.map +1 -0
  113. package/dist/defaults/text/bodyText/resolve.d.ts.map +1 -1
  114. package/dist/defaults/text/bodyText/resolve.js +6 -3
  115. package/dist/defaults/text/bodyText/resolve.js.map +1 -1
  116. package/dist/defaults/text/bodyText/strip.d.ts.map +1 -1
  117. package/dist/defaults/text/bodyText/strip.js +10 -7
  118. package/dist/defaults/text/bodyText/strip.js.map +1 -1
  119. package/dist/designs/design.d.ts +66 -0
  120. package/dist/designs/design.d.ts.map +1 -0
  121. package/dist/designs/design.js +252 -0
  122. package/dist/designs/design.js.map +1 -0
  123. package/dist/designs/index.d.ts +7 -0
  124. package/dist/designs/index.d.ts.map +1 -0
  125. package/dist/designs/index.js +4 -0
  126. package/dist/designs/index.js.map +1 -0
  127. package/dist/designs/missingStyles.d.ts +18 -0
  128. package/dist/designs/missingStyles.d.ts.map +1 -0
  129. package/dist/designs/missingStyles.js +38 -0
  130. package/dist/designs/missingStyles.js.map +1 -0
  131. package/dist/designs/pageBreaks.d.ts +27 -0
  132. package/dist/designs/pageBreaks.d.ts.map +1 -0
  133. package/dist/designs/pageBreaks.js +97 -0
  134. package/dist/designs/pageBreaks.js.map +1 -0
  135. package/dist/designs/parts.d.ts +79 -0
  136. package/dist/designs/parts.d.ts.map +1 -0
  137. package/dist/designs/parts.js +162 -0
  138. package/dist/designs/parts.js.map +1 -0
  139. package/dist/index.d.ts +8 -7
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +5 -3
  142. package/dist/index.js.map +1 -1
  143. package/dist/knuthPlass/breakpoints/search.d.ts.map +1 -1
  144. package/dist/knuthPlass/breakpoints/search.js +4 -2
  145. package/dist/knuthPlass/breakpoints/search.js.map +1 -1
  146. package/dist/knuthPlass/pretextAdapter.d.ts +5 -1
  147. package/dist/knuthPlass/pretextAdapter.d.ts.map +1 -1
  148. package/dist/knuthPlass/pretextAdapter.js +7 -1
  149. package/dist/knuthPlass/pretextAdapter.js.map +1 -1
  150. package/dist/knuthPlass/richAdapter.d.ts +5 -1
  151. package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
  152. package/dist/knuthPlass/richAdapter.js +7 -1
  153. package/dist/knuthPlass/richAdapter.js.map +1 -1
  154. package/dist/knuthPlass/spaceBreaks.d.ts +43 -0
  155. package/dist/knuthPlass/spaceBreaks.d.ts.map +1 -0
  156. package/dist/knuthPlass/spaceBreaks.js +89 -0
  157. package/dist/knuthPlass/spaceBreaks.js.map +1 -0
  158. package/dist/knuthPlass/types.d.ts +5 -0
  159. package/dist/knuthPlass/types.d.ts.map +1 -1
  160. package/dist/knuthPlass/wasm/abi.js +1 -1
  161. package/dist/knuthPlass/wasm/abi.js.map +1 -1
  162. package/dist/knuthPlass/wasm/bytes.generated.d.ts +1 -1
  163. package/dist/knuthPlass/wasm/bytes.generated.d.ts.map +1 -1
  164. package/dist/knuthPlass/wasm/bytes.generated.js +404 -402
  165. package/dist/knuthPlass/wasm/bytes.generated.js.map +1 -1
  166. package/dist/measure/cache.js +1 -1
  167. package/dist/measure/cache.js.map +1 -1
  168. package/dist/measure/plain.js +1 -1
  169. package/dist/measure/plain.js.map +1 -1
  170. package/dist/measure/rich/measure.js +1 -1
  171. package/dist/measure/rich/measure.js.map +1 -1
  172. package/dist/measure/types.d.ts +5 -0
  173. package/dist/measure/types.d.ts.map +1 -1
  174. package/dist/measure/types.js.map +1 -1
  175. package/dist/parse/blockParser/sectionBreaks.d.ts +14 -0
  176. package/dist/parse/blockParser/sectionBreaks.d.ts.map +1 -0
  177. package/dist/parse/blockParser/sectionBreaks.js +59 -0
  178. package/dist/parse/blockParser/sectionBreaks.js.map +1 -0
  179. package/dist/parse/blockParser.d.ts +3 -2
  180. package/dist/parse/blockParser.d.ts.map +1 -1
  181. package/dist/parse/blockParser.js +6 -2
  182. package/dist/parse/blockParser.js.map +1 -1
  183. package/dist/parse/citations.d.ts.map +1 -1
  184. package/dist/parse/citations.js +6 -0
  185. package/dist/parse/citations.js.map +1 -1
  186. package/dist/parse/injectSpans.d.ts.map +1 -1
  187. package/dist/parse/injectSpans.js +7 -4
  188. package/dist/parse/injectSpans.js.map +1 -1
  189. package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts +1 -0
  190. package/dist/pipeline/blocks/measureContentBlock/measureOptions.d.ts.map +1 -1
  191. package/dist/pipeline/blocks/measureContentBlock/measureOptions.js +9 -1
  192. package/dist/pipeline/blocks/measureContentBlock/measureOptions.js.map +1 -1
  193. package/dist/pipeline/blocks/measureContentBlock.d.ts.map +1 -1
  194. package/dist/pipeline/blocks/measureContentBlock.js +8 -13
  195. package/dist/pipeline/blocks/measureContentBlock.js.map +1 -1
  196. package/dist/pipeline/build/bookChapters.d.ts +34 -0
  197. package/dist/pipeline/build/bookChapters.d.ts.map +1 -0
  198. package/dist/pipeline/build/bookChapters.js +170 -0
  199. package/dist/pipeline/build/bookChapters.js.map +1 -0
  200. package/dist/pipeline/build/drivers.d.ts.map +1 -1
  201. package/dist/pipeline/build/drivers.js +49 -41
  202. package/dist/pipeline/build/drivers.js.map +1 -1
  203. package/dist/pipeline/build/pass/blocks/blockDispatch.d.ts +1 -1
  204. package/dist/pipeline/build/pass/blocks/blockDispatch.d.ts.map +1 -1
  205. package/dist/pipeline/build/pass/blocks/blockDispatch.js +6 -4
  206. package/dist/pipeline/build/pass/blocks/blockDispatch.js.map +1 -1
  207. package/dist/pipeline/contentWarnings/chapterStyleWarnings.d.ts +13 -0
  208. package/dist/pipeline/contentWarnings/chapterStyleWarnings.d.ts.map +1 -0
  209. package/dist/pipeline/contentWarnings/chapterStyleWarnings.js +64 -0
  210. package/dist/pipeline/contentWarnings/chapterStyleWarnings.js.map +1 -0
  211. package/dist/pipeline/contentWarnings/formatWarning.d.ts.map +1 -1
  212. package/dist/pipeline/contentWarnings/formatWarning.js +21 -0
  213. package/dist/pipeline/contentWarnings/formatWarning.js.map +1 -1
  214. package/dist/pipeline/contentWarnings/layoutWarnings.d.ts +7 -0
  215. package/dist/pipeline/contentWarnings/layoutWarnings.d.ts.map +1 -1
  216. package/dist/pipeline/contentWarnings/layoutWarnings.js +22 -0
  217. package/dist/pipeline/contentWarnings/layoutWarnings.js.map +1 -1
  218. package/dist/pipeline/contentWarnings/sourceWarnings.d.ts +5 -2
  219. package/dist/pipeline/contentWarnings/sourceWarnings.d.ts.map +1 -1
  220. package/dist/pipeline/contentWarnings/sourceWarnings.js +7 -5
  221. package/dist/pipeline/contentWarnings/sourceWarnings.js.map +1 -1
  222. package/dist/pipeline/contentWarnings.d.ts +1 -1
  223. package/dist/pipeline/contentWarnings.d.ts.map +1 -1
  224. package/dist/pipeline/contentWarnings.js +1 -1
  225. package/dist/pipeline/contentWarnings.js.map +1 -1
  226. package/dist/pipeline/contents/outline.d.ts.map +1 -1
  227. package/dist/pipeline/contents/outline.js +2 -1
  228. package/dist/pipeline/contents/outline.js.map +1 -1
  229. package/dist/pipeline/continuation.d.ts +3 -2
  230. package/dist/pipeline/continuation.d.ts.map +1 -1
  231. package/dist/pipeline/continuation.js +21 -16
  232. package/dist/pipeline/continuation.js.map +1 -1
  233. package/dist/pipeline/references/citations/spans.d.ts +7 -1
  234. package/dist/pipeline/references/citations/spans.d.ts.map +1 -1
  235. package/dist/pipeline/references/citations/spans.js +15 -4
  236. package/dist/pipeline/references/citations/spans.js.map +1 -1
  237. package/dist/pipeline/references/citations.js +2 -2
  238. package/dist/pipeline/references/citations.js.map +1 -1
  239. package/dist/pipeline/resources/resourceLayout/captions.d.ts.map +1 -1
  240. package/dist/pipeline/resources/resourceLayout/captions.js +2 -2
  241. package/dist/pipeline/resources/resourceLayout/captions.js.map +1 -1
  242. package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js +2 -2
  243. package/dist/pipeline/resources/resourceLayout/resourceBlock/captionNotes.js.map +1 -1
  244. package/dist/pipeline/resources/resourceLayout/resourceBlock.js +2 -2
  245. package/dist/pipeline/resources/resourceLayout/resourceBlock.js.map +1 -1
  246. package/dist/pipeline/resources/resourceLayout/snippets.d.ts +6 -4
  247. package/dist/pipeline/resources/resourceLayout/snippets.d.ts.map +1 -1
  248. package/dist/pipeline/resources/resourceLayout/snippets.js +12 -7
  249. package/dist/pipeline/resources/resourceLayout/snippets.js.map +1 -1
  250. package/dist/pipeline/resources/resourceLayout/tableLayout.d.ts +1 -1
  251. package/dist/pipeline/resources/resourceLayout/tableLayout.d.ts.map +1 -1
  252. package/dist/pipeline/sections/parts.d.ts +13 -0
  253. package/dist/pipeline/sections/parts.d.ts.map +1 -1
  254. package/dist/pipeline/sections/parts.js +13 -0
  255. package/dist/pipeline/sections/parts.js.map +1 -1
  256. package/dist/pipeline/text/spaceBreaks.d.ts +7 -0
  257. package/dist/pipeline/text/spaceBreaks.d.ts.map +1 -0
  258. package/dist/pipeline/text/spaceBreaks.js +7 -0
  259. package/dist/pipeline/text/spaceBreaks.js.map +1 -0
  260. package/dist/types/content.d.ts +17 -0
  261. package/dist/types/content.d.ts.map +1 -1
  262. package/dist/types/text/bodyText/config.d.ts +33 -13
  263. package/dist/types/text/bodyText/config.d.ts.map +1 -1
  264. package/dist/types/text/bodyText/resolved.d.ts +4 -6
  265. package/dist/types/text/bodyText/resolved.d.ts.map +1 -1
  266. package/dist/vdt/contentWarnings/source.d.ts +23 -0
  267. package/dist/vdt/contentWarnings/source.d.ts.map +1 -1
  268. package/dist/vdt/contentWarnings/text.d.ts +22 -0
  269. package/dist/vdt/contentWarnings/text.d.ts.map +1 -1
  270. package/dist/vdt/warnings.d.ts +9 -2
  271. package/dist/vdt/warnings.d.ts.map +1 -1
  272. package/dist/word/semantic/chapterStyles/chapterStyles.test.d.ts +2 -0
  273. package/dist/word/semantic/chapterStyles/chapterStyles.test.d.ts.map +1 -0
  274. package/dist/word/semantic/chapterStyles/chapterStyles.test.js +96 -0
  275. package/dist/word/semantic/chapterStyles/chapterStyles.test.js.map +1 -0
  276. package/dist/word/semantic/chapterStyles/looks.d.ts +52 -0
  277. package/dist/word/semantic/chapterStyles/looks.d.ts.map +1 -0
  278. package/dist/word/semantic/chapterStyles/looks.js +168 -0
  279. package/dist/word/semantic/chapterStyles/looks.js.map +1 -0
  280. package/dist/word/semantic/containers.d.ts.map +1 -1
  281. package/dist/word/semantic/containers.js +6 -4
  282. package/dist/word/semantic/containers.js.map +1 -1
  283. package/dist/word/semantic/context.d.ts +6 -0
  284. package/dist/word/semantic/context.d.ts.map +1 -1
  285. package/dist/word/semantic/context.js.map +1 -1
  286. package/dist/word/semantic/engineNumbers.d.ts +4 -2
  287. package/dist/word/semantic/engineNumbers.d.ts.map +1 -1
  288. package/dist/word/semantic/engineNumbers.js +10 -7
  289. package/dist/word/semantic/engineNumbers.js.map +1 -1
  290. package/dist/word/semantic/index.d.ts.map +1 -1
  291. package/dist/word/semantic/index.js +24 -3
  292. package/dist/word/semantic/index.js.map +1 -1
  293. package/dist/word/semantic/page/furniture.d.ts.map +1 -1
  294. package/dist/word/semantic/page/furniture.js +5 -2
  295. package/dist/word/semantic/page/furniture.js.map +1 -1
  296. package/dist/word/semantic/styles.d.ts +2 -1
  297. package/dist/word/semantic/styles.d.ts.map +1 -1
  298. package/dist/word/semantic/styles.js +1 -0
  299. package/dist/word/semantic/styles.js.map +1 -1
  300. package/package.json +1 -1
  301. package/dist/__tests__/pipeline/text/boundSpaces.test.d.ts +0 -2
  302. package/dist/__tests__/pipeline/text/boundSpaces.test.d.ts.map +0 -1
  303. package/dist/__tests__/pipeline/text/boundSpaces.test.js +0 -71
  304. package/dist/__tests__/pipeline/text/boundSpaces.test.js.map +0 -1
  305. package/dist/pipeline/build/sectionMerge.d.ts +0 -32
  306. package/dist/pipeline/build/sectionMerge.d.ts.map +0 -1
  307. package/dist/pipeline/build/sectionMerge.js +0 -111
  308. package/dist/pipeline/build/sectionMerge.js.map +0 -1
  309. package/dist/pipeline/text/boundSpaces.d.ts +0 -32
  310. package/dist/pipeline/text/boundSpaces.d.ts.map +0 -1
  311. package/dist/pipeline/text/boundSpaces.js +0 -93
  312. package/dist/pipeline/text/boundSpaces.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Blank pages and the breaks that make them (#1523, #1532). A design
3
+ * element shown only on blank pages (`pages: 'blank'`) is drawn for the
4
+ * blank pages its book's breaks leave: the guide paints its blank versos in
5
+ * the part's colour because the only blank versos its breaks leave are the
6
+ * ones facing a part divider. The breaks are settings of the headings and
7
+ * the parts, the element is usually in the running heads; a design applied
8
+ * by parts can bring one without the other, and the element then paints
9
+ * every blank page the other breaks leave (a solid page before each
10
+ * chapter).
11
+ *
12
+ * So the breaks go with the blank-page elements: when the book keeps such
13
+ * an element from a part the design leaves, the book keeps its breaks; when
14
+ * only the design brings one, the design's breaks come with it. The breaks
15
+ * are the `breakBefore` of each heading level and of each heading style,
16
+ * and the part pages' `breakBefore` and `breakAfter`.
17
+ */
18
+ import { sameConfig } from '../defaults/configLayers.js';
19
+ import { readDesignSlot } from './parts.js';
20
+ const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
21
+ /** Whether `node` holds a design element shown only on blank pages. */
22
+ export function paintsBlankPages(node) {
23
+ if (Array.isArray(node))
24
+ return node.some(paintsBlankPages);
25
+ if (!isObject(node))
26
+ return false;
27
+ if (node.pages === 'blank' && typeof node.kind === 'string')
28
+ return true;
29
+ return Object.values(node).some(paintsBlankPages);
30
+ }
31
+ /** Whether any of `slots` of `config` holds such an element. */
32
+ export function slotsPaintBlankPages(config, slots) {
33
+ return slots.some((slot) => paintsBlankPages(readDesignSlot(config, slot)));
34
+ }
35
+ function pageBreaksOf(config) {
36
+ const levels = new Map();
37
+ for (const l of (config.headings?.levels ?? [])) {
38
+ if (typeof l.level === 'number' && l.breakBefore !== undefined)
39
+ levels.set(l.level, l.breakBefore);
40
+ }
41
+ const styles = new Map();
42
+ for (const s of (config.headingStyles ?? [])) {
43
+ if (typeof s.id === 'string')
44
+ styles.set(s.id, s.breakBefore);
45
+ }
46
+ return { levels, styles, partBefore: config.parts?.breakBefore, partAfter: config.parts?.breakAfter };
47
+ }
48
+ /** `obj` with `key` set to `value` (unset when undefined), as a copy. */
49
+ function withField(obj, key, value) {
50
+ const out = { ...obj };
51
+ if (value === undefined)
52
+ delete out[key];
53
+ else
54
+ out[key] = structuredClone(value);
55
+ return out;
56
+ }
57
+ const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
58
+ /** `config` with the breaks of `from`: every heading level's, the heading
59
+ * styles both have, the part pages'. Nothing else changes. */
60
+ export function withPageBreaksOf(config, from) {
61
+ const want = pageBreaksOf(from);
62
+ const have = pageBreaksOf(config);
63
+ let next = config;
64
+ let levels = [...(config.headings?.levels ?? [])];
65
+ let levelsChanged = false;
66
+ for (const n of HEADING_LEVELS) {
67
+ if (sameConfig(want.levels.get(n), have.levels.get(n)))
68
+ continue;
69
+ levelsChanged = true;
70
+ const at = levels.findIndex((l) => l.level === n);
71
+ if (at >= 0)
72
+ levels[at] = withField(levels[at], 'breakBefore', want.levels.get(n));
73
+ else
74
+ levels.push({ level: n, breakBefore: structuredClone(want.levels.get(n)) });
75
+ }
76
+ if (levelsChanged) {
77
+ levels = levels.filter((l) => Object.keys(l).some((k) => k !== 'level'));
78
+ const headings = withField({ ...(config.headings ?? {}) }, 'levels', levels.length > 0 ? levels : undefined);
79
+ next = { ...next, headings: headings };
80
+ if (Object.keys(headings).length === 0)
81
+ delete next.headings;
82
+ }
83
+ if (config.headingStyles?.some((s) => want.styles.has(s.id) && !sameConfig(want.styles.get(s.id), have.styles.get(s.id)))) {
84
+ next = {
85
+ ...next,
86
+ headingStyles: config.headingStyles.map((s) => (want.styles.has(s.id) ? withField(s, 'breakBefore', want.styles.get(s.id)) : s)),
87
+ };
88
+ }
89
+ if (!sameConfig(want.partBefore, have.partBefore) || !sameConfig(want.partAfter, have.partAfter)) {
90
+ const parts = withField(withField({ ...(config.parts ?? {}) }, 'breakBefore', want.partBefore), 'breakAfter', want.partAfter);
91
+ next = { ...next, parts: parts };
92
+ if (Object.keys(parts).length === 0)
93
+ delete next.parts;
94
+ }
95
+ return next;
96
+ }
97
+ //# sourceMappingURL=pageBreaks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageBreaks.js","sourceRoot":"","sources":["../../src/designs/pageBreaks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAuB,MAAM,YAAY,CAAC;AAIjE,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAa,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAErG,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC5D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,IAAI,CAAC,KAAK,KAAK,OAAO,IAAI,OAAO,IAAI,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,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAoB,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3K,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QACjG,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,EAAU,EAAE,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACtI,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,KAA+B,EAAE,CAAC;QAC3D,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The parts of a book's design (#1523): the groups of the Sandbox's Design
3
+ * panel, one by one, so a design is saved, tried and applied in the same
4
+ * pieces the settings are edited in. Every top-level setting belongs to
5
+ * one part, or is the book's own (`BOOK_OWN_KEYS`), or travels with the
6
+ * parts that use it (`customFonts`, `chapterStyles`): the type check
7
+ * below fails to compile when a setting is added to `PostextConfig` and
8
+ * not here.
9
+ *
10
+ * Two settings are shared by several groups, as the panel shows them:
11
+ *
12
+ * - `page`: the binding is edited with the writing system, the crop marks
13
+ * with the print preparation, the baseline grid with the advanced
14
+ * settings; the rest of `page` (size, margins, ground, numbering) is
15
+ * the page part.
16
+ * - `layout`: the writing mode belongs to the writing system; the rest of
17
+ * `layout` (columns, gutters, floats, balancing) is the page part.
18
+ *
19
+ * A dotted entry (`page.binding`) claims that one field; the whole-key
20
+ * entry (`page`) takes every field the dotted entries leave.
21
+ */
22
+ import type { PostextConfig } from '../types.js';
23
+ import type { PageConfig } from '../types/page.js';
24
+ import type { LayoutConfig } from '../types/layout.js';
25
+ /** A part of a design: a group of the Design panel. */
26
+ export type DesignPart = 'page' | 'writing' | 'colors' | 'text' | 'headings' | 'lists' | 'figures' | 'callouts' | 'exercises' | 'comics' | 'running' | 'parts' | 'output' | 'folio' | 'advanced';
27
+ /** Every part, in the Design panel's order. */
28
+ export declare const DESIGN_PARTS: readonly DesignPart[];
29
+ /** A top-level setting, or one field of `page` or `layout`. */
30
+ export type DesignKeyPath = keyof PostextConfig | `page.${keyof PageConfig & string}` | `layout.${keyof LayoutConfig & string}`;
31
+ /** The settings of each part. */
32
+ export declare const DESIGN_PART_KEYS: {
33
+ readonly page: readonly ["page", "layout", "pageTemplates"];
34
+ readonly writing: readonly ["cjk", "layout.writingMode", "page.binding"];
35
+ readonly colors: readonly ["colorPalette", "contrast"];
36
+ readonly text: readonly ["bodyText", "paragraphStyles", "chipStyles", "characterStyles", "markStyles", "codeStyle", "math", "footnotes", "links", "lineNumbers", "citations", "symbolFont"];
37
+ readonly headings: readonly ["headings", "headingStyles", "toc", "index", "crossRefs"];
38
+ readonly lists: readonly ["unorderedLists", "orderedLists"];
39
+ readonly figures: readonly ["captionStyle", "tableStyle", "tableStyles", "diagramStyle", "scoreStyle", "scoreStyles", "videoStyle", "labelStyles"];
40
+ readonly callouts: readonly ["calloutStyles", "frameLooks"];
41
+ readonly exercises: readonly ["exerciseStyles", "exercises"];
42
+ readonly comics: readonly ["comics"];
43
+ readonly running: readonly ["header", "footer"];
44
+ readonly parts: readonly ["parts"];
45
+ readonly output: readonly ["print", "pdfGeneration", "htmlViewer", "canvasViewer", "page.cutLines"];
46
+ readonly folio: readonly ["folio"];
47
+ readonly advanced: readonly ["page.baselineGrid"];
48
+ };
49
+ /** Settings that are no part but travel with the parts that use them: the
50
+ * font families the parts set text in, and the chapter styles, each cut
51
+ * down to the parts. */
52
+ export declare const DESIGN_CARRIED_KEYS: readonly ["customFonts", "chapterStyles"];
53
+ /** One slot of a configuration a part owns: a top-level key less the
54
+ * fields other parts claim, or one field of a key. */
55
+ export interface DesignPartSlot {
56
+ part: DesignPart;
57
+ key: keyof PostextConfig;
58
+ /** One field of `key`. */
59
+ field?: string;
60
+ /** The fields of `key` that belong to other parts. */
61
+ except?: readonly string[];
62
+ }
63
+ /** Every slot, in part order. */
64
+ export declare const DESIGN_PART_SLOTS: readonly DesignPartSlot[];
65
+ /** The slots of `parts`. */
66
+ export declare function designPartSlots(parts: readonly DesignPart[]): DesignPartSlot[];
67
+ /** Whether `v` names a part. */
68
+ export declare function isDesignPart(v: unknown): v is DesignPart;
69
+ /** The part a setting belongs to (`key`, or `key` + one of its fields):
70
+ * undefined for the book's own settings and the carried ones. */
71
+ export declare function designPartOf(key: string, field?: string): DesignPart | undefined;
72
+ /** The value of `slot` in `config` (an override works as well): undefined
73
+ * when it is unset (an object slot left with no field counts as unset). */
74
+ export declare function readDesignSlot(config: object, slot: DesignPartSlot): unknown;
75
+ /** `config` with `slot` set to `value` (unset when undefined), the other
76
+ * parts' fields of the same key kept. Returns a new object; `config` is
77
+ * not changed. */
78
+ export declare function writeDesignSlot<T extends object>(config: T, slot: DesignPartSlot, value: unknown): T;
79
+ //# sourceMappingURL=parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../src/designs/parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE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BAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAO5E;AAED;;mBAEmB;AACnB,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAsBpG"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * The parts of a book's design (#1523): the groups of the Sandbox's Design
3
+ * panel, one by one, so a design is saved, tried and applied in the same
4
+ * pieces the settings are edited in. Every top-level setting belongs to
5
+ * one part, or is the book's own (`BOOK_OWN_KEYS`), or travels with the
6
+ * parts that use it (`customFonts`, `chapterStyles`): the type check
7
+ * below fails to compile when a setting is added to `PostextConfig` and
8
+ * not here.
9
+ *
10
+ * Two settings are shared by several groups, as the panel shows them:
11
+ *
12
+ * - `page`: the binding is edited with the writing system, the crop marks
13
+ * with the print preparation, the baseline grid with the advanced
14
+ * settings; the rest of `page` (size, margins, ground, numbering) is
15
+ * the page part.
16
+ * - `layout`: the writing mode belongs to the writing system; the rest of
17
+ * `layout` (columns, gutters, floats, balancing) is the page part.
18
+ *
19
+ * A dotted entry (`page.binding`) claims that one field; the whole-key
20
+ * entry (`page`) takes every field the dotted entries leave.
21
+ */
22
+ /** Every part, in the Design panel's order. */
23
+ export const DESIGN_PARTS = [
24
+ 'page', 'writing', 'colors', 'text', 'headings', 'lists', 'figures',
25
+ 'callouts', 'exercises', 'comics', 'running', 'parts', 'output', 'folio', 'advanced',
26
+ ];
27
+ /** The settings of each part. */
28
+ export const DESIGN_PART_KEYS = {
29
+ page: ['page', 'layout', 'pageTemplates'],
30
+ writing: ['cjk', 'layout.writingMode', 'page.binding'],
31
+ colors: ['colorPalette', 'contrast'],
32
+ text: [
33
+ 'bodyText', 'paragraphStyles', 'chipStyles', 'characterStyles', 'markStyles', 'codeStyle',
34
+ 'math', 'footnotes', 'links', 'lineNumbers', 'citations', 'symbolFont',
35
+ ],
36
+ headings: ['headings', 'headingStyles', 'toc', 'index', 'crossRefs'],
37
+ lists: ['unorderedLists', 'orderedLists'],
38
+ figures: ['captionStyle', 'tableStyle', 'tableStyles', 'diagramStyle', 'scoreStyle', 'scoreStyles', 'videoStyle', 'labelStyles'],
39
+ callouts: ['calloutStyles', 'frameLooks'],
40
+ exercises: ['exerciseStyles', 'exercises'],
41
+ comics: ['comics'],
42
+ running: ['header', 'footer'],
43
+ parts: ['parts'],
44
+ output: ['print', 'pdfGeneration', 'htmlViewer', 'canvasViewer', 'page.cutLines'],
45
+ folio: ['folio'],
46
+ advanced: ['page.baselineGrid'],
47
+ };
48
+ /** Settings that are no part but travel with the parts that use them: the
49
+ * font families the parts set text in, and the chapter styles, each cut
50
+ * down to the parts. */
51
+ export const DESIGN_CARRIED_KEYS = ['customFonts', 'chapterStyles'];
52
+ /** Compile-time check: every setting has a place. A setting named here
53
+ * is missing from `DESIGN_PART_KEYS` (or from `BOOK_OWN_KEYS`). */
54
+ const everySettingPlaced = true;
55
+ void everySettingPlaced;
56
+ function buildSlots() {
57
+ const claimed = new Map();
58
+ for (const part of DESIGN_PARTS) {
59
+ for (const path of DESIGN_PART_KEYS[part]) {
60
+ const dot = path.indexOf('.');
61
+ if (dot < 0)
62
+ continue;
63
+ const key = path.slice(0, dot);
64
+ claimed.set(key, [...(claimed.get(key) ?? []), path.slice(dot + 1)]);
65
+ }
66
+ }
67
+ const slots = [];
68
+ for (const part of DESIGN_PARTS) {
69
+ for (const path of DESIGN_PART_KEYS[part]) {
70
+ const dot = path.indexOf('.');
71
+ if (dot >= 0) {
72
+ slots.push({ part, key: path.slice(0, dot), field: path.slice(dot + 1) });
73
+ }
74
+ else {
75
+ const except = claimed.get(path);
76
+ slots.push({ part, key: path, ...(except ? { except } : {}) });
77
+ }
78
+ }
79
+ }
80
+ return slots;
81
+ }
82
+ /** Every slot, in part order. */
83
+ export const DESIGN_PART_SLOTS = buildSlots();
84
+ /** The slots of `parts`. */
85
+ export function designPartSlots(parts) {
86
+ const wanted = new Set(parts);
87
+ return DESIGN_PART_SLOTS.filter((s) => wanted.has(s.part));
88
+ }
89
+ /** Whether `v` names a part. */
90
+ export function isDesignPart(v) {
91
+ return typeof v === 'string' && DESIGN_PARTS.includes(v);
92
+ }
93
+ /** The part a setting belongs to (`key`, or `key` + one of its fields):
94
+ * undefined for the book's own settings and the carried ones. */
95
+ export function designPartOf(key, field) {
96
+ let whole;
97
+ for (const s of DESIGN_PART_SLOTS) {
98
+ if (s.key !== key)
99
+ continue;
100
+ if (s.field !== undefined) {
101
+ if (s.field === field)
102
+ return s.part;
103
+ }
104
+ else {
105
+ whole = s.part;
106
+ }
107
+ }
108
+ return whole;
109
+ }
110
+ const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
111
+ /** The value of `slot` in `config` (an override works as well): undefined
112
+ * when it is unset (an object slot left with no field counts as unset). */
113
+ export function readDesignSlot(config, slot) {
114
+ const value = config[slot.key];
115
+ if (slot.field !== undefined)
116
+ return isObject(value) ? value[slot.field] : undefined;
117
+ if (!slot.except || !isObject(value))
118
+ return value;
119
+ const rest = {};
120
+ for (const [k, v] of Object.entries(value))
121
+ if (!slot.except.includes(k))
122
+ rest[k] = v;
123
+ return Object.keys(rest).length > 0 ? rest : undefined;
124
+ }
125
+ /** `config` with `slot` set to `value` (unset when undefined), the other
126
+ * parts' fields of the same key kept. Returns a new object; `config` is
127
+ * not changed. */
128
+ export function writeDesignSlot(config, slot, value) {
129
+ const next = { ...config };
130
+ const current = next[slot.key];
131
+ if (slot.field !== undefined) {
132
+ const obj = isObject(current) ? { ...current } : {};
133
+ if (value === undefined)
134
+ delete obj[slot.field];
135
+ else
136
+ obj[slot.field] = value;
137
+ if (Object.keys(obj).length > 0)
138
+ next[slot.key] = obj;
139
+ else
140
+ delete next[slot.key];
141
+ return next;
142
+ }
143
+ if (!slot.except) {
144
+ if (value === undefined)
145
+ delete next[slot.key];
146
+ else
147
+ next[slot.key] = value;
148
+ return next;
149
+ }
150
+ const kept = {};
151
+ if (isObject(current))
152
+ for (const k of slot.except)
153
+ if (current[k] !== undefined)
154
+ kept[k] = current[k];
155
+ const merged = { ...(isObject(value) ? value : {}), ...kept };
156
+ if (Object.keys(merged).length > 0)
157
+ next[slot.key] = merged;
158
+ else
159
+ delete next[slot.key];
160
+ return next;
161
+ }
162
+ //# sourceMappingURL=parts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/designs/parts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAaH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS;IACnE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU;CACrF,CAAC;AAKF,iCAAiC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC;IACzC,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,cAAc,CAAC;IACtD,MAAM,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC;IACpC,IAAI,EAAE;QACJ,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW;QACzF,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY;KACvE;IACD,QAAQ,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC;IACpE,KAAK,EAAE,CAAC,gBAAgB,EAAE,cAAc,CAAC;IACzC,OAAO,EAAE,CAAC,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,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IAAI,IAAI,CAAC,MAAM;YAAE,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS;gBAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvG,MAAM,MAAM,GAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;IACpE,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;;QACvD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,IAAS,CAAC;AACnB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -43,7 +43,7 @@ export { balancingOnByDefault, avoidWidowsByDefault, avoidOrphansByDefault } fro
43
43
  export { renderTemplateNumber } from './pipeline/resources/resourceNumbering.js';
44
44
  export { bandOutline, dashedPieces, outlineToSvgPath, type BandShape, type OutlineCommand } from './marks/markGeometry.js';
45
45
  export { findLooseLines, drawLooseLines, lineLooseness, lineWordSpacing, type LooseLine, type FindLooseLinesOptions, type DrawLooseLinesOptions } from './checks/looseLines.js';
46
- export { findStacks, findHyphenFaults, type Stack, type StackRange, type FindStacksOptions, type HyphenFault, type FindHyphenFaultsOptions } from './checks/compositionRules.js';
46
+ export { findStacks, findHyphenFaults, findSpaceBreaks, type Stack, type StackRange, type FindStacksOptions, type HyphenFault, type FindHyphenFaultsOptions, type SpaceBreakFault, type FindSpaceBreaksOptions } from './checks/compositionRules.js';
47
47
  export { primaryFontFamily } from './measure/font.js';
48
48
  export { buildFontString, setSymbolFont, symbolFont, withSymbolFont, measureBlock, measureRichBlock, measureGlyphWidth, initHyphenator, clearMeasurementCache, createMeasurementCache, cachedMeasureBlock, cachedMeasureRichBlock, setCjkLineBreak, getCjkLineBreak, setCjkComposition, getCjkComposition, cjkCompositionOf, punctuationAdvance, punctuationSide, PLAIN_CJK_COMPOSITION } from './measure/index.js';
49
49
  export type { CjkComposition, PunctuationSide } from './measure/index.js';
@@ -56,7 +56,7 @@ export { parseMarkdown } from './parse/index.js';
56
56
  export { addRow, addColumn, removeRow, removeColumn, mergeCells, unmergeCell, setCellContent, setCellImage, setCellBackground, setAlignment, parseTSV, tableGridIssues, transposeTable } from './table/index.js';
57
57
  export type { CellPos, CellRange, ParseTSVOptions, TableGridIssue } from './table/index.js';
58
58
  export { collectContentWarnings, formatWarning } from './pipeline/contentWarnings.js';
59
- export { collectHeadingDesignCuts } from './pipeline/sections/headingDesignCuts.js';
59
+ export { collectHeadingDesignCuts, type HeadingDesignCut } from './pipeline/sections/headingDesignCuts.js';
60
60
  export { normalizeSafeArea, resourceSafeArea, safeAreaHeightRange, safeAreaSource, uncroppedPictureBox, resourceCrop } from './pipeline/resources/safeArea.js';
61
61
  export { parseComicSplit, serializeComicSplit, moveComicSplitLine, splitComicCell, mergeComicCells, comicSplitLines, comicSplitLeaves, comicSplitListAt, COMIC_MIN_CELL_PERCENT, parseComicScript, parseComicPoint, readBalloonText, parseComicFence, isComicFence, COMIC_FENCES, comicGeometry, pointInPolygon, polygonBBox, physicalSide, comicArtCrop, comicCropFeasibleRange, comicArtPointToPage, comicArtRectToPage, anchorsOutsideSafeArea, layoutComicPage, comicViewerLeaf, letterPanels, comicPageDirection, comicPanelPadding, parseComicDimension, comicPageLayoutWarnings, comicSourceWarnings, COMIC_RESERVED_KEYS, layoutComicFrame, comicPageFrame, layoutComicStrip, comicStripPlacement, comicStripExtent, comicStripAspect, comicSplitGrid, parseComicAspect, parseComicStripWidth, parseComicStripAlign, comicStripWidth, comicStripOffset, layoutComicSpread, isComicSpread, translateComicPage, translateComicPanel, translateComicSplitter, translateComicBalloon, translateComicFrame, translateSvgPath, comicBlockOnSheet, pageComics, comicElementId, comicFrameElementId, comicBalloonElementId, comicFrameName, isComicTextPanel, comicBoxStyle, comicFrameSpecs, comicTextPanelsSupported, comicLetteringStyle, comicLetteringLocale, comicLetteringVertical, comicFontFamilies, markdownHasComics, letterPanel, letterPanelDetailed, presetLetteringStyles, comicBalloonKind, comicBalloonText, comicBalloonMatrix, comicSpeakerName, comicBalloonGroups, comicPanelPathData, comicBorderPathData, polygonPathData, comicPanelContinues, isComicSpreadPartner, joinComicSpread, } from './comics/index.js';
62
62
  export type { ComicSplitAxis, ComicSplitSize, ComicSplitItem, ComicSplitList, ComicSplitToken, ComicSplitIssue, ComicSplitParse, ComicScriptLine, ComicCell, ComicSplitLine, ComicGeometry, ComicGeometryInput, ComicFrameSide, ComicCropInput, ComicCrop, ComicPageContext, LetterPanelsInput, LetteringItem, LetteringPanel, LetteringStyle, LetteringAnchor, LetteringDiagnostic, LetteringResult, LetteringEnv, ComicPageSource, ComicPanelSource, ComicScriptItem, ComicScriptRole, ComicSourceRange, ComicTailSide, ComicFrameContext, ComicFrameSpec, ComicStripPlacement, ComicStripContext, ComicStripAlign, ComicSpreadContext, ComicSpreadPage, ComicBalloonKind, } from './comics/index.js';
@@ -72,12 +72,12 @@ export type { ExerciseGridInfo, ExerciseRecord, ExerciseSlot, ExerciseSlotKind }
72
72
  export type { QrMatrix, QrErrorCorrection } from './video/qr.js';
73
73
  export { parseVideoUrl, videoWatchUrl, resourceVideoLink, videoEmbedUrl, videoEmbedAllow, videoElementAttributes, mediaFragment, videoMimeType, videoFormatOfUrl, resourceVideoFormat, isHlsMimeType, HLS_MIME_TYPE, youtubePosterUrls } from './video/url.js';
74
74
  export type { ParsedVideoUrl } from './video/url.js';
75
- export type { HeadingDesignCut } from './pipeline/sections/headingDesignCuts.js';
76
75
  export { extractFrontmatter, metadataText } from './parse/frontmatter.js';
77
76
  export type { FrontmatterError, ParsedFrontmatter } from './parse/frontmatter.js';
78
77
  export { styledLinkOf, lineLinkUnderlines } from './marks/linkUnderline.js';
79
78
  export { BOOK_PAGE_KEYS, BOOK_WIDE_KEYS, BOOK_OWN_KEYS, isBookWideKey, isBookOwnKey, isBookPageKey, DEFAULT_PAGE_CONFIG, DEFAULT_CUT_LINES, DEFAULT_PAGE_NUMBERING, PAGE_SIZE_PRESETS, resolvePageConfig, DEFAULT_LAYOUT_CONFIG, DEFAULT_FLOAT_MIN_SCALE, MAX_PIN_PAGE_OFFSET, DEFAULT_MAX_TOP_FRACTION, DEFAULT_TEXT_WRAP, DEFAULT_COLUMN_RULE, DEFAULT_COLUMN_BALANCING, resolveLayoutConfig, stripLayoutDefaults, DEFAULT_BODY_TEXT_CONFIG, DEFAULT_HYPHENATION_CONFIG, DEFAULT_BLOCKQUOTE_CONFIG, DEFAULT_VERSE_CONFIG, resolveVerseConfig, stripVerseDefaults, resolveBodyTextConfig, stripBodyTextDefaults, hyphenationEqual, DEFAULT_HEADINGS_CONFIG, resolveHeadingsConfig, stripHeadingsDefaults, resolveTableStyleConfig, stripTableStyleDefaults, resolveTableStylesConfig, stripTableStylesDefaults, pickTableStyle, defaultTableContinuationStrings, resolveCaptionStyleConfig, stripCaptionStyleDefaults, mergeCaptionStyle, defaultCaptionLabels, DEFAULT_DIAGRAM_STYLE_CONFIG, resolveDiagramStyleConfig, stripDiagramStyleDefaults, DEFAULT_SCORE_STYLE_CONFIG, resolveScoreStyleConfig, resolveScoreStylesConfig, pickScoreStyle, stripScoreStyleDefaults, stripScoreStylesDefaults, DEFAULT_VIDEO_STYLE_CONFIG, DEFAULT_VIDEO_PLAYER_OPTIONS, resolveVideoStyleConfig, resolveVideoPlayerOptions, stripVideoStyleDefaults, DEFAULT_PARAGRAPH_STYLES, resolveParagraphStylesConfig, stripParagraphStylesDefaults, DEFAULT_CALLOUT_STYLES, DEFAULT_CALLOUT_STYLE_STATIC, resolveCalloutStylesConfig, stripCalloutStylesDefaults, inheritCalloutStyles, calloutStyleChain, DEFAULT_CHIP_STYLES, DEFAULT_CHIP_STYLE_STATIC, resolveChipStylesConfig, stripChipStylesDefaults, pickChipStyle, DEFAULT_CHARACTER_STYLES, DEFAULT_CHARACTER_STYLE_STATIC, resolveCharacterStylesConfig, stripCharacterStylesDefaults, pickCharacterStyle, DEFAULT_MARK_STYLES, DEFAULT_MARK_STYLE_STATIC, resolveMarkStylesConfig, stripMarkStylesDefaults, pickMarkStyle, DEFAULT_UNORDERED_LISTS_STATIC, resolveUnorderedListsConfig, stripUnorderedListsDefaults, DEFAULT_ORDERED_LISTS_STATIC, resolveOrderedListsConfig, stripOrderedListsDefaults, DEFAULT_MATH_CONFIG, resolveMathConfig, stripMathDefaults, dimensionsEqual, colorsEqual, resolveColorValue, paletteTintHex, tintedEntryValue, tintPaperOf, applyPaletteToConfig, applyPaletteToResolvedConfig, DEFAULT_COLOR_PALETTE, DEFAULT_MAIN_COLOR, DEFAULT_MAIN_COLOR_ID, DEFAULT_MAIN_COLOR_NAME, DEFAULT_MAIN_COLOR_HEX, cloneDefaultColorPalette, isDefaultColorPalette, stripPageDefaults, stripConfigDefaults, DEFAULT_DEBUG_CONFIG, FIT_MARKS_MODES, resolveDebugConfig, stripDebugDefaults, DEFAULT_CANVAS_VIEWER_CONFIG, CANVAS_VIEWER_MAX_GAP, resolveCanvasViewerConfig, stripCanvasViewerDefaults, DEFAULT_HTML_VIEWER_CONFIG, resolveHtmlViewerConfig, stripHtmlViewerDefaults, mergeConfigOverrides, applyHtmlViewerOverrides, mergeConfigLayers, diffConfigLayers, leastConfigOverride, commonConfig, overridePaths, sameConfig, REMOVE_ENTRY, DEFAULT_PDF_GENERATION_CONFIG, resolvePdfGenerationConfig, stripPdfGenerationDefaults, FOLIO_PAPER_STOCKS, FOLIO_MAX_TILT, DEFAULT_FOLIO_CONFIG, isNewspaperSizePreset, folioDefaultsFor, folioForTrim, resolveFolioConfig, stripFolioDefaults, wrapFolioYaw, DEFAULT_HEADER_FOOTER_SLOT, DEFAULT_HEADER_SLOT, DEFAULT_FOOTER_SLOT, DEFAULT_TEXT_ELEMENT, DEFAULT_RULE_ELEMENT, resolveHeaderFooterConfig, stripHeaderFooterDefaults, defaultResourceTypes, defaultVideoResourceType, defaultExampleResourceType, effectiveResourceTypes, DEFAULT_PARTS_CONFIG, resolvePartsConfig, stripPartsDefaults, DEFAULT_HEADING_STYLES, resolveHeadingStylesConfig, stripHeadingStylesDefaults, DEFAULT_TOC_CONFIG, resolveTocConfig, stripTocDefaults, DEFAULT_FOOTNOTES_CONFIG, resolveFootnotesConfig, stripFootnotesDefaults, parseFootnoteNumberFormat, DEFAULT_LINE_NUMBERS_CONFIG, resolveLineNumbersConfig, stripLineNumbersDefaults, defaultLineNumbersRestart, DEFAULT_CODE_STYLE, DEFAULT_CODE_TOKENS, CODE_TOKEN_KINDS, CODE_OVERFLOWS, resolveCodeStyleConfig, resolvedCodeStyle, stripCodeStyleDefaults, resolveCrossRefsConfig, stripCrossRefsDefaults, DEFAULT_CITATIONS_CONFIG, resolveCitationsConfig, stripCitationsDefaults, DEFAULT_LINKS_CONFIG, DEFAULT_LINK_STYLE_OUTPUTS, LINK_STYLE_OUTPUTS, resolveLinksConfig, resolveLinkStyleConfig, linkStyleFor, stripLinksDefaults, DEFAULT_INDEX_CONFIG, resolveIndexConfig, stripIndexDefaults, DEFAULT_CJK_CONFIG, resolveCjkConfig, stripCjkDefaults, defaultCjkLineBreak, defaultCjkPunctuationWidth, defaultCjkCompression, defaultCjkEmphasis, defaultCjkBookTitleMark, defaultCjkBookTitleBrackets, defaultCjkEmphasisMark, defaultCjkWarichuBrackets, defaultCjkHangingPunctuation, defaultCjkSpaceAfterQuestion, defaultCjkParagraphStartBracket, defaultCjkRubyOverhang, defaultCjkRubyAlign, defaultCjkLatinSpacingEdge } from './defaults/index.js';
80
- export { DEFAULT_EXERCISE_STYLES, exerciseWords, resolveExerciseStylesConfig, resolveExercisesConfig, stripExerciseStylesDefaults, stripExercisesDefaults, CHAPTER_STYLE_KEY, blankChapterFrontmatter, chapterConfig, chapterConfigOf, chapterStyleOf } from './defaults/index.js';
79
+ export { DEFAULT_EXERCISE_STYLES, exerciseWords, resolveExerciseStylesConfig, resolveExercisesConfig, stripExerciseStylesDefaults, stripExercisesDefaults, CHAPTER_STYLE_KEY, blankChapterFrontmatter, chapterConfig, chapterConfigOf, chapterStyleOf, chapterStyleIdOf, openingPart, bookSettingsOf } from './defaults/index.js';
80
+ export { partPageAttr } from './pipeline/sections/parts.js';
81
81
  export type { ExerciseWords, ResolvedExerciseStyle, ResolvedExerciseNumber, ResolvedExercisesConfig } from './defaults/index.js';
82
82
  export type { ExerciseNumberShape, ExerciseNumberStyle, ExerciseInstructionStyle, ExerciseOptionLabels, ExerciseOptionsStyle, ExerciseBlankStyle, ExerciseTrueFalseStyle, ExerciseMatchStyle, ExerciseBankStyle, ExerciseAreaStyle, ExerciseGridStyle, ExerciseArithmeticStyle, ExerciseLevelStyle, ExerciseIcon, ExerciseAnswersStyle, ExerciseSolutionPlacement, ExerciseSolutionsConfig, ExerciseAssessmentConfig, ExerciseDigitalStyle, ExerciseShowSolution, ExerciseStyleConfig, ExercisesConfig, ChipUnderline, FigureStyle, } from './types.js';
83
83
  export { DEFAULT_PRINT_CONFIG, DEFAULT_PRINT_BLACK_CONFIG, DEFAULT_PRINT_PREFLIGHT_CONFIG, DEFAULT_RICH_BLACK, resolvePrintConfig, resolvePrintBlackConfig, resolvePrintPreflightConfig, resolvePrintInks, resolvePrintPlates, resolvePrintImageColor, stripPrintDefaults, profileInkLimit } from './defaults/index.js';
@@ -101,7 +101,7 @@ export type { DesignSlotLayout, LayoutContext, LayoutIssue, ResolvedPrimitive, R
101
101
  export { classifyPages } from './pipeline/pages/pageRoles.js';
102
102
  export { migrateLegacyHeaderFooterConfig, isLegacyHeaderFooterSlot, resolveDesignSlot, stripDesignSlotDefaults, defaultTextOverflow, DEFAULT_BOX_ELEMENT } from './defaults/structure/headerFooter.js';
103
103
  export type { DesignSlotKind } from './defaults/structure/headerFooter.js';
104
- export type { PostextContent, LayoutContinuation, OutlineEntry, HeadingStyleConfig, HeadingStyleSectionEnd, ResolvedHeadingStyleConfig, ResolvedHeadingStyleOverrides, SectionBodyStyleConfig, ResolvedSectionBodyStyleConfig, TocConfig, IndexConfig, IndexGroupsConfig, IndexGroupBy, ResolvedIndexConfig, OutlineIndexMark, TocLevelConfig, TocLeaderFaceConfig, TocEntryStyleConfig, ResolvedTocConfig, ResolvedTocLevelConfig, ResolvedTocEntryStyleConfig, TocGroupsConfig, TocGroupHead, ResolvedTocGroupsConfig, DesignImageElement, ResolvedDesignImageElement, DesignPathElement, ResolvedDesignPathElement, HeadingCounters, ResourceNumberEntry, DocumentMetadata, PostextResource, ResourceType, ResourceKind, ResourceCounterFormat, ResourceCounterReset, ResourceFloatPosition, ResourceFloatSpan, ResourceRotation, ResourcePlacement, ResourcePlateArea, ResourcePin, ResourceSafeArea, ResourceContour, ContourTrace, ResourceWrap, ResourceAnchor, ComicsConfig, ResolvedComicsConfig, ComicReadingDirection, ComicPanelBorderStyle, ComicPanelFit, PanelStyleConfig, NamedPanelStyleConfig, ResolvedPanelStyleConfig, ResolvedNamedPanelStyleConfig, LetteringConfig, ResolvedLetteringConfig, ComicBalloonShape, ComicBalloonTail, ComicBalloonPosition, BalloonStyleConfig, ResolvedBalloonStyleConfig, ComicCastMember, ComicViewerLeafConfig, Resource, TableCell, TableCellAlign, TableCellImage, TableCellVerticalAlign, TableCellPos, TableModel, PostextNote, PostextConfig, ChapterStyleConfig, ColorModel, ColorValue, ColorPaletteEntry, DimensionUnit, Dimension, PageSizePreset, PageMargins, BaselineGridConfig, CutLinesConfig, PageConfig, ResolvedPageConfig, PageNumberFormat, PageNumberingConfig, ResolvedPageNumberingConfig, HeadingBreakParity, HeadingBreakBeforeConfig, ResolvedHeadingBreakBeforeConfig, LayoutType, WritingMode, PageBinding, ColumnRuleConfig, ColumnBalancingConfig, ClosingBoxLever, StretchAfterWideFloats, TrailingStep, ColumnHeadSpace, GridLinesLever, KeepWithNextSplit, ColonListRoom, CompositionRule, ParagraphContainerSpacing, ParagraphStylesInBoxes, ParagraphBodyField, EmphasisStyle, TashkilMode, LayoutConfig, ResolvedLayoutConfig, InlineResourceGap, BitmapResolution, FloatShrinkMode, FloatShrinkConfig, WrapSide, TextWrapConfig, ResolvedTextWrapConfig, TextAlign, HyphenationLocale, LocaleTag, DocumentDirection, DigitSystem, NumeralsSetting, HyphenationConfig, ResolvedHyphenationConfig, HyphenationLimits, BodyTextConfig, ResolvedBodyTextConfig, KashidaSetting, KashidaPatterns, ResolvedKashidaConfig, BlockquoteConfig, ResolvedBlockquoteConfig, VerseConfig, ResolvedVerseConfig, VerseTurnover, HeadingLevelConfig, ResolvedHeadingLevelConfig, HeadingsConfig, ResolvedHeadingsConfig, TableStyleConfig, ResolvedTableStyleConfig, NamedTableStyleConfig, ResolvedNamedTableStyleConfig, TableRules, TableSpanRules, TableContinuedFootRule, TableOverflow, TableTextTransform, CaptionStyleConfig, ResolvedCaptionStyleConfig, CaptionPosition, CaptionNoteStyleConfig, ResolvedCaptionNoteStyleConfig, DiagramStyleConfig, ResolvedDiagramStyleConfig, ScoreStyleConfig, ResolvedScoreStyleConfig, NamedScoreStyleConfig, ResolvedNamedScoreStyleConfig, ScoreMusicFont, VideoSource, VideoPlayerOptions, ResolvedVideoPlayerOptions, ResourceVideo, ResourceVideoPoster, VideoOverlayPosition, VideoPlayMarkConfig, VideoQrConfig, VideoStyleConfig, ResolvedVideoPlayMarkConfig, ResolvedVideoQrConfig, ResolvedVideoStyleConfig, ParagraphStyleConfig, ResolvedParagraphStyleConfig, ParagraphTextTransform, TabStop, ParagraphDropCap, DropCapLeadIn, DropCapPunctuation, DropCapShortParagraph, TabStopAlign, TabStopPosition, CalloutStyleConfig, CalloutDesignConfig, ResolvedCalloutDesignConfig, CalloutFixedConfig, ResolvedCalloutStyleConfig, ChipStyleConfig, ResolvedChipStyleConfig, CharacterStyleConfig, CharacterStyleCase, ResolvedCharacterStyleConfig, MarkStyleConfig, MarkDecorationBreak, MarkLineConfig, MarkLinePosition, MarkLineStyle, ResolvedMarkLineConfig, ResolvedMarkStyleConfig, CalloutSpan, CalloutSideAtColumnEnd, CalloutPlacement, CalloutWidth, CalloutStripeSide, CalloutIconKind, CalloutIconAlign, CalloutIconPosition, CalloutIconCornerSide, CalloutLabelConfig, CalloutLabelIconConfig, CalloutLabelIconKind, CalloutIconShape, IconTint, CalloutTextTransform, CalloutMarkerTextAlign, CalloutBorderConfig, CalloutPaddingConfig, CalloutStripeConfig, CalloutIconConfig, CalloutMarkerConfig, CalloutMarkerRuleConfig, CalloutTitleStyleConfig, CalloutBodyStyleConfig, CalloutListStyleConfig, PartsConfig, PartsBreakBeforeConfig, PartsBreakAfterConfig, PartsBodyStyleConfig, ResolvedPartsConfig, ResolvedPartsBreakBeforeConfig, ResolvedPartsBreakAfterConfig, ResolvedPartsBodyStyleConfig, HeadingTextTransform, UnorderedListLevelConfig, ResolvedUnorderedListLevelConfig, UnorderedListsConfig, ResolvedUnorderedListsConfig, OrderedListLevelConfig, ResolvedOrderedListLevelConfig, OrderedListsConfig, ResolvedOrderedListsConfig, OrderedListNumberWidth, OrderedListNumberAlign, OrderedListNumberFormat, SyncIndicatorConfig, DebugConfig, ResolvedDebugConfig, FitMarksMode, WarningsToggleConfig, ResolvedWarningsToggleConfig, CanvasViewerConfig, ResolvedCanvasViewerConfig, HtmlViewerConfig, HtmlViewerOverrides, ResolvedHtmlViewerConfig, MathConfig, ResolvedMathConfig, FootnotesConfig, ResolvedFootnotesConfig, LineNumbersConfig, ResolvedLineNumbersConfig, CodeStyleConfig, ResolvedCodeStyleConfig, InlineCodeStyleConfig, ResolvedInlineCodeStyleConfig, CodeTokenKind, CodeTokenStyle, CodeOverflow, LineNumbersCount, LineNumbersRestart, LineNumbersPosition, LineNumbersMultiColumn, CrossRefsConfig, ResolvedCrossRefsConfig, CitationsConfig, ResolvedCitationsConfig, LinksConfig, ResolvedLinksConfig, LinkPrintMode, LinkNoteContent, LinkQrConfig, ResolvedLinkQrConfig, LinkStyleConfig, ResolvedLinkStyleConfig, LinkStyleOutput, LinkUnderline, CjkConfig, CjkRegion, CjkLineBreak, CjkPunctuationWidth, CjkHangingPunctuation, CjkWordBreak, CjkLatinSpacingEdge, CjkGridConfig, CjkEmphasis, CjkBookTitleMark, CjkBracketPair, CjkEmphasisMarkConfig, CjkEmphasisMarkStyle, ResolvedCjkEmphasisMarkConfig, CjkRubyPosition, CjkRubyConfig, CjkRubyOverhang, CjkRubyAlign, CjkWarichuConfig, CjkKuntenConfig, CjkKuntenPlacement, ResolvedCjkConfig, ResolvedCjkGridConfig, ResolvedCjkRubyConfig, ResolvedCjkWarichuConfig, ResolvedCjkKuntenConfig, FootnotePlacement, FootnoteNumbering, FootnoteNumberFormat, FootnoteMarkerPosition, FootnoteSeparatorConfig, PdfColorSpace, PdfGenerationConfig, PdfFormsConfig, PdfFormFieldFont, ResolvedPdfGenerationConfig, PdfXStandard, PrintRenderingIntent, CmykPercent, SpotColor, PrintBlackConfig, ResolvedPrintBlackConfig, PrintInk, ResolvedPrintInk, PrintPlatesConfig, ResolvedPrintPlatesConfig, PrintImageColorConfig, ResolvedPrintImageColorConfig, PrintPreflightConfig, ResolvedPrintPreflightConfig, CustomOutputProfile, PrintConfig, ResolvedPrintConfig, ContrastLevel, ContrastMode, ContrastReversedTextConfig, ResolvedContrastReversedTextConfig, ContrastConfig, ContrastAllowEntry, ResolvedContrastConfig, ChecksConfig, ResolvedChecksConfig, ContentInConfigCheckConfig, ResolvedContentInConfigCheckConfig, FolioConfig, FolioPaperConfig, FolioBindingConfig, FolioSurfaceConfig, FolioLightingConfig, ResolvedFolioConfig, FolioPaperType, FolioPaperFinish, FolioPaperTexture, FolioBindingType, FolioCoverMaterial, FolioCoverSource, FolioSurfaceType, FolioEnvironment, CustomFontFormat, CustomFontStyle, CustomFontVariant, CustomFontFamily, PageParity, PageRole, PageRoleFilter, HeaderFooterHAlign, HeaderFooterTextElement, HeaderFooterRuleElement, HeaderFooterElement, HeaderFooterSlot, ResolvedHeaderFooterTextElement, ResolvedHeaderFooterRuleElement, ResolvedHeaderFooterElement, ResolvedHeaderFooterSlot, HAlign, DesignTextAlign, VAlign, AnchorEdge, ElementAnchor, ElementPlacement, ElementSize, ElementSizeTo, SidePosition, ElementBoxStyle, CornerRadius, BorderSide, BorderSides, BoxSideName, TextOverflow, DesignTextStroke, TextDotsStyle, DesignTextRepeat, DesignTextElement, DesignRuleElement, DesignBoxElement, DesignConnectorElement, ConnectorEnd, LineCap, LeaderStyle, PlacedDesignElement, ResolvedPlacedDesignElement, ResolvedDesignConnectorElement, DesignElement, DesignSlot, ResolvedDesignTextElement, ResolvedDesignRuleElement, ResolvedDesignBoxElement, ResolvedDesignElement, ResolvedDesignSlot, LegacyHeaderFooterTextElement, LegacyHeaderFooterRuleElement, LegacyHeaderFooterElement, LegacyHeaderFooterSlot, HeadingSpan, HeadingNumberPosition, HeadingAdvancedDesignConfig, ResolvedHeadingAdvancedDesignConfig, } from './types.js';
104
+ export type { PostextContent, BookChapterRange, LayoutContinuation, OutlineEntry, HeadingStyleConfig, HeadingStyleSectionEnd, ResolvedHeadingStyleConfig, ResolvedHeadingStyleOverrides, SectionBodyStyleConfig, ResolvedSectionBodyStyleConfig, TocConfig, IndexConfig, IndexGroupsConfig, IndexGroupBy, ResolvedIndexConfig, OutlineIndexMark, TocLevelConfig, TocLeaderFaceConfig, TocEntryStyleConfig, ResolvedTocConfig, ResolvedTocLevelConfig, ResolvedTocEntryStyleConfig, TocGroupsConfig, TocGroupHead, ResolvedTocGroupsConfig, DesignImageElement, ResolvedDesignImageElement, DesignPathElement, ResolvedDesignPathElement, HeadingCounters, ResourceNumberEntry, DocumentMetadata, PostextResource, ResourceType, ResourceKind, ResourceCounterFormat, ResourceCounterReset, ResourceFloatPosition, ResourceFloatSpan, ResourceRotation, ResourcePlacement, ResourcePlateArea, ResourcePin, ResourceSafeArea, ResourceContour, ContourTrace, ResourceWrap, ResourceAnchor, ComicsConfig, ResolvedComicsConfig, ComicReadingDirection, ComicPanelBorderStyle, ComicPanelFit, PanelStyleConfig, NamedPanelStyleConfig, ResolvedPanelStyleConfig, ResolvedNamedPanelStyleConfig, LetteringConfig, ResolvedLetteringConfig, ComicBalloonShape, ComicBalloonTail, ComicBalloonPosition, BalloonStyleConfig, ResolvedBalloonStyleConfig, ComicCastMember, ComicViewerLeafConfig, Resource, TableCell, TableCellAlign, TableCellImage, TableCellVerticalAlign, TableCellPos, TableModel, PostextNote, PostextConfig, ChapterStyleConfig, ColorModel, ColorValue, ColorPaletteEntry, DimensionUnit, Dimension, PageSizePreset, PageMargins, BaselineGridConfig, CutLinesConfig, PageConfig, ResolvedPageConfig, PageNumberFormat, PageNumberingConfig, ResolvedPageNumberingConfig, HeadingBreakParity, HeadingBreakBeforeConfig, ResolvedHeadingBreakBeforeConfig, LayoutType, WritingMode, PageBinding, ColumnRuleConfig, ColumnBalancingConfig, ClosingBoxLever, StretchAfterWideFloats, TrailingStep, ColumnHeadSpace, GridLinesLever, KeepWithNextSplit, ColonListRoom, CompositionRule, ParagraphContainerSpacing, ParagraphStylesInBoxes, ParagraphBodyField, EmphasisStyle, TashkilMode, LayoutConfig, ResolvedLayoutConfig, InlineResourceGap, BitmapResolution, FloatShrinkMode, FloatShrinkConfig, WrapSide, TextWrapConfig, ResolvedTextWrapConfig, TextAlign, HyphenationLocale, LocaleTag, DocumentDirection, DigitSystem, NumeralsSetting, HyphenationConfig, ResolvedHyphenationConfig, HyphenationLimits, BodyTextConfig, ResolvedBodyTextConfig, KashidaSetting, KashidaPatterns, ResolvedKashidaConfig, BlockquoteConfig, ResolvedBlockquoteConfig, VerseConfig, ResolvedVerseConfig, VerseTurnover, HeadingLevelConfig, ResolvedHeadingLevelConfig, HeadingsConfig, ResolvedHeadingsConfig, TableStyleConfig, ResolvedTableStyleConfig, NamedTableStyleConfig, ResolvedNamedTableStyleConfig, TableRules, TableSpanRules, TableContinuedFootRule, TableOverflow, TableTextTransform, CaptionStyleConfig, ResolvedCaptionStyleConfig, CaptionPosition, CaptionNoteStyleConfig, ResolvedCaptionNoteStyleConfig, DiagramStyleConfig, ResolvedDiagramStyleConfig, ScoreStyleConfig, ResolvedScoreStyleConfig, NamedScoreStyleConfig, ResolvedNamedScoreStyleConfig, ScoreMusicFont, VideoSource, VideoPlayerOptions, ResolvedVideoPlayerOptions, ResourceVideo, ResourceVideoPoster, VideoOverlayPosition, VideoPlayMarkConfig, VideoQrConfig, VideoStyleConfig, ResolvedVideoPlayMarkConfig, ResolvedVideoQrConfig, ResolvedVideoStyleConfig, ParagraphStyleConfig, ResolvedParagraphStyleConfig, ParagraphTextTransform, TabStop, ParagraphDropCap, DropCapLeadIn, DropCapPunctuation, DropCapShortParagraph, TabStopAlign, TabStopPosition, CalloutStyleConfig, CalloutDesignConfig, ResolvedCalloutDesignConfig, CalloutFixedConfig, ResolvedCalloutStyleConfig, ChipStyleConfig, ResolvedChipStyleConfig, CharacterStyleConfig, CharacterStyleCase, ResolvedCharacterStyleConfig, MarkStyleConfig, MarkDecorationBreak, MarkLineConfig, MarkLinePosition, MarkLineStyle, ResolvedMarkLineConfig, ResolvedMarkStyleConfig, CalloutSpan, CalloutSideAtColumnEnd, CalloutPlacement, CalloutWidth, CalloutStripeSide, CalloutIconKind, CalloutIconAlign, CalloutIconPosition, CalloutIconCornerSide, CalloutLabelConfig, CalloutLabelIconConfig, CalloutLabelIconKind, CalloutIconShape, IconTint, CalloutTextTransform, CalloutMarkerTextAlign, CalloutBorderConfig, CalloutPaddingConfig, CalloutStripeConfig, CalloutIconConfig, CalloutMarkerConfig, CalloutMarkerRuleConfig, CalloutTitleStyleConfig, CalloutBodyStyleConfig, CalloutListStyleConfig, PartsConfig, PartsBreakBeforeConfig, PartsBreakAfterConfig, PartsBodyStyleConfig, ResolvedPartsConfig, ResolvedPartsBreakBeforeConfig, ResolvedPartsBreakAfterConfig, ResolvedPartsBodyStyleConfig, HeadingTextTransform, UnorderedListLevelConfig, ResolvedUnorderedListLevelConfig, UnorderedListsConfig, ResolvedUnorderedListsConfig, OrderedListLevelConfig, ResolvedOrderedListLevelConfig, OrderedListsConfig, ResolvedOrderedListsConfig, OrderedListNumberWidth, OrderedListNumberAlign, OrderedListNumberFormat, SyncIndicatorConfig, DebugConfig, ResolvedDebugConfig, FitMarksMode, WarningsToggleConfig, ResolvedWarningsToggleConfig, CanvasViewerConfig, ResolvedCanvasViewerConfig, HtmlViewerConfig, HtmlViewerOverrides, ResolvedHtmlViewerConfig, MathConfig, ResolvedMathConfig, FootnotesConfig, ResolvedFootnotesConfig, LineNumbersConfig, ResolvedLineNumbersConfig, CodeStyleConfig, ResolvedCodeStyleConfig, InlineCodeStyleConfig, ResolvedInlineCodeStyleConfig, CodeTokenKind, CodeTokenStyle, CodeOverflow, LineNumbersCount, LineNumbersRestart, LineNumbersPosition, LineNumbersMultiColumn, CrossRefsConfig, ResolvedCrossRefsConfig, CitationsConfig, ResolvedCitationsConfig, LinksConfig, ResolvedLinksConfig, LinkPrintMode, LinkNoteContent, LinkQrConfig, ResolvedLinkQrConfig, LinkStyleConfig, ResolvedLinkStyleConfig, LinkStyleOutput, LinkUnderline, CjkConfig, CjkRegion, CjkLineBreak, CjkPunctuationWidth, CjkHangingPunctuation, CjkWordBreak, CjkLatinSpacingEdge, CjkGridConfig, CjkEmphasis, CjkBookTitleMark, CjkBracketPair, CjkEmphasisMarkConfig, CjkEmphasisMarkStyle, ResolvedCjkEmphasisMarkConfig, CjkRubyPosition, CjkRubyConfig, CjkRubyOverhang, CjkRubyAlign, CjkWarichuConfig, CjkKuntenConfig, CjkKuntenPlacement, ResolvedCjkConfig, ResolvedCjkGridConfig, ResolvedCjkRubyConfig, ResolvedCjkWarichuConfig, ResolvedCjkKuntenConfig, FootnotePlacement, FootnoteNumbering, FootnoteNumberFormat, FootnoteMarkerPosition, FootnoteSeparatorConfig, PdfColorSpace, PdfGenerationConfig, PdfFormsConfig, PdfFormFieldFont, ResolvedPdfGenerationConfig, PdfXStandard, PrintRenderingIntent, CmykPercent, SpotColor, PrintBlackConfig, ResolvedPrintBlackConfig, PrintInk, ResolvedPrintInk, PrintPlatesConfig, ResolvedPrintPlatesConfig, PrintImageColorConfig, ResolvedPrintImageColorConfig, PrintPreflightConfig, ResolvedPrintPreflightConfig, CustomOutputProfile, PrintConfig, ResolvedPrintConfig, ContrastLevel, ContrastMode, ContrastReversedTextConfig, ResolvedContrastReversedTextConfig, ContrastConfig, ContrastAllowEntry, ResolvedContrastConfig, ChecksConfig, ResolvedChecksConfig, ContentInConfigCheckConfig, ResolvedContentInConfigCheckConfig, FolioConfig, FolioPaperConfig, FolioBindingConfig, FolioSurfaceConfig, FolioLightingConfig, ResolvedFolioConfig, FolioPaperType, FolioPaperFinish, FolioPaperTexture, FolioBindingType, FolioCoverMaterial, FolioCoverSource, FolioSurfaceType, FolioEnvironment, CustomFontFormat, CustomFontStyle, CustomFontVariant, CustomFontFamily, PageParity, PageRole, PageRoleFilter, HeaderFooterHAlign, HeaderFooterTextElement, HeaderFooterRuleElement, HeaderFooterElement, HeaderFooterSlot, ResolvedHeaderFooterTextElement, ResolvedHeaderFooterRuleElement, ResolvedHeaderFooterElement, ResolvedHeaderFooterSlot, HAlign, DesignTextAlign, VAlign, AnchorEdge, ElementAnchor, ElementPlacement, ElementSize, ElementSizeTo, SidePosition, ElementBoxStyle, CornerRadius, BorderSide, BorderSides, BoxSideName, TextOverflow, DesignTextStroke, TextDotsStyle, DesignTextRepeat, DesignTextElement, DesignRuleElement, DesignBoxElement, DesignConnectorElement, ConnectorEnd, LineCap, LeaderStyle, PlacedDesignElement, ResolvedPlacedDesignElement, ResolvedDesignConnectorElement, DesignElement, DesignSlot, ResolvedDesignTextElement, ResolvedDesignRuleElement, ResolvedDesignBoxElement, ResolvedDesignElement, ResolvedDesignSlot, LegacyHeaderFooterTextElement, LegacyHeaderFooterRuleElement, LegacyHeaderFooterElement, LegacyHeaderFooterSlot, HeadingSpan, HeadingNumberPosition, HeadingAdvancedDesignConfig, ResolvedHeadingAdvancedDesignConfig, } from './types.js';
105
105
  export type { BoundingBox, ResolvedConfig, VDTBlockType, VDTLineSegment, VDTInlineIcon, VDTSegmentMarks, VDTAnnotationRun, VDTRuby, VDTKunten, VDTWarichu, VDTLineMark, VDTLineHighlight, VDTLinkUnderline, VDTSegmentMark, VDTSegmentStrike, VDTChipStrike, VDTSegmentCharStyle, VDTChip, VDTSwatch, VDTChipRun, VDTLine, VDTLineQr, VDTAnchor, VDTCarriedOutlineEntry, VDTBlock, VDTColumn, VDTExclusion, VDTExclusionContour, VDTContourSpan, VDTColumnRule, VDTFootnoteArea, VDTPage, VDTDocument, VDTHeaderFooterSlot, VDTHeaderFooterBlock, VDTHeaderFooterTextBlock, VDTRuleBlock, VDTDesignSlot, VDTDesignSlotKind, VDTDesignBlock, VDTDesignTextBlock, VDTDesignTextLine, VDTDesignTextRun, VDTDesignTextStroke, VDTTextDots, VDTDesignRuleBlock, VDTDesignBoxBlock, VDTDesignImageBlock, VDTDesignPathBlock, VDTPathCommand, VDTPathStroke, VDTPathMarker, VDTDesignBoxStyle, ResolvedResourceBlock, VDTResourceVideo, VDTVideoPlayMark, VDTVideoQr, ResolvedCalloutBlock, VDTCaptionBar, VDTBalancing, VDTGridBalancing, BalanceLever, LayoutWarning, ConfigWarning, PageTemplateWarningKind, CalloutOverflowWarning, ContentWarning, MissingImageWarning, SvgFontUnavailableWarning, SvgFontsTooLargeWarning, SvgPictureFontWarning, RenderWarning, VDTResourceTableCell, VDTResourceTableCellImage, VDTResourceTableLayout, VDTTableStroke, RoundedOutline, VDTResourceRotation, VDTFlowFrame, VDTVerticalFlowFrame, VDTMirroredFlowFrame, TableCellFillRects, VDTPoint, VDTComicArt, VDTComicPanel, VDTComicSplitter, VDTComicBalloon, VDTComicPage, VDTComposedPage, VDTFrame, VDTFigureLabel, VDTFigureLabelLayout, VDTFigureLabelLeader, ReflowEvent, ReflowEventKind, FrameOverflowProposal, FrameCoverProposal, FrameOutsideProposal, FrameFitStep, VDTStripCaption, VDTDropCap, } from './vdt.js';
106
106
  export { resourceBlockToPage, resourceBlockToLocal, resourceBlockRectToPage, tableFrameOutline, tableCellFill, tableCellFillRects } from './vdt.js';
107
107
  export { flowToPage, pageToFlow, flowRectToPage, pageRectToFlow, pageIsVertical, pageIsMirrored, verticalFlowOf, lineTextAlign, leaderRuleGeometry, DEFAULT_CENTRAL_BASELINE } from './vdt.js';
@@ -203,8 +203,9 @@ export { invalidateConfig } from './pipeline/config.js';
203
203
  export { stableStringify, stableHash, hashString, hashStringWide } from './util/stableHash.js';
204
204
  export { registerSvgImage, prepareSvgMarkup, decodeSvgImage } from './svg/image.js';
205
205
  export type { RegisterSvgImageOptions, PrepareSvgOptions } from './svg/image.js';
206
- export { openBundle, createBundle, buildBundle, createBundleLayoutCache, loadBundleFonts, registerBundleImages, bundleImageUrl, bundleVideoUrl, bundleResourceBytes, bundlePreviewBytes, bundleFontProvider, bundleSvgFontProvider, svgInlinesFonts, readBundle, traceBundleContours, planBundle, resolveBundleFiles, openBundleZip, zipBundle, isBundleManifest, pickBundleMeta, POSTEXT_EXTENSION } from './bundle/index.js';
207
- export type { PostextBundle, OpenBundleOptions, CreateBundleInput, CreateBundleLocale, CreatedBundle, BundleFileData, BuildBundleOptions, BundleLayoutCache, BundleLayoutStats, BundleSource, BundleFontProviderOptions, BundleFontRequest, LoadBundleFontsOptions, BundleImageOptions, BundleManifest, BundleManifestV1, BundleManifestV2, BundleStart, BundleChapter, BundleFontFile, ReadBundleOptions, ReadBundleResult, ZipBundleOptions } from './bundle/index.js';
206
+ export * from './designs/index.js';
207
+ export { openBundle, createBundle, createDesignBundle, openDesignBundle, buildBundle, createBundleLayoutCache, loadBundleFonts, registerBundleImages, bundleImageUrl, bundleVideoUrl, bundleResourceBytes, bundlePreviewBytes, bundleFontProvider, bundleSvgFontProvider, svgInlinesFonts, readBundle, traceBundleContours, planBundle, resolveBundleFiles, openBundleZip, zipBundle, isBundleManifest, pickBundleMeta, POSTEXT_EXTENSION } from './bundle/index.js';
208
+ export type { PostextBundle, OpenBundleOptions, CreateBundleInput, DesignBundleInput, OpenedDesign, OpenDesignOptions, BundleDesignSpec, CreateBundleLocale, CreatedBundle, BundleFileData, BuildBundleOptions, BundleLayoutCache, BundleLayoutStats, BundleSource, BundleFontProviderOptions, BundleFontRequest, LoadBundleFontsOptions, BundleImageOptions, BundleManifest, BundleManifestV1, BundleManifestV2, BundleStart, BundleChapter, BundleFontFile, ReadBundleOptions, ReadBundleResult, ZipBundleOptions } from './bundle/index.js';
208
209
  export { registerCitationEngine, citationEngine, setCitationEngineLoader, ensureCitationEngine, mayNeedCitations } from './citations/registry.js';
209
210
  export { bookCitationContexts, citationSourceOf, citationContextKey, needsCitationContext, type CitationContext, type CitationSource } from './citations/context.js';
210
211
  export { parseLocator } from './parse/citations.js';