postext 0.3.18 → 0.3.20

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 (281) hide show
  1. package/dist/__tests__/columnBalancing.test.js +183 -5
  2. package/dist/__tests__/columnBalancing.test.js.map +1 -1
  3. package/dist/__tests__/defaults/calloutStyles.test.d.ts +2 -0
  4. package/dist/__tests__/defaults/calloutStyles.test.d.ts.map +1 -0
  5. package/dist/__tests__/defaults/calloutStyles.test.js +201 -0
  6. package/dist/__tests__/defaults/calloutStyles.test.js.map +1 -0
  7. package/dist/__tests__/defaults/captionStyle.test.d.ts +2 -0
  8. package/dist/__tests__/defaults/captionStyle.test.d.ts.map +1 -0
  9. package/dist/__tests__/defaults/captionStyle.test.js +87 -0
  10. package/dist/__tests__/defaults/captionStyle.test.js.map +1 -0
  11. package/dist/__tests__/defaults/pageSizePreset.test.d.ts +2 -0
  12. package/dist/__tests__/defaults/pageSizePreset.test.d.ts.map +1 -0
  13. package/dist/__tests__/defaults/pageSizePreset.test.js +24 -0
  14. package/dist/__tests__/defaults/pageSizePreset.test.js.map +1 -0
  15. package/dist/__tests__/defaults/paragraphStyles.test.d.ts +2 -0
  16. package/dist/__tests__/defaults/paragraphStyles.test.d.ts.map +1 -0
  17. package/dist/__tests__/defaults/paragraphStyles.test.js +93 -0
  18. package/dist/__tests__/defaults/paragraphStyles.test.js.map +1 -0
  19. package/dist/__tests__/design/pageAnchors.test.d.ts +2 -0
  20. package/dist/__tests__/design/pageAnchors.test.d.ts.map +1 -0
  21. package/dist/__tests__/design/pageAnchors.test.js +140 -0
  22. package/dist/__tests__/design/pageAnchors.test.js.map +1 -0
  23. package/dist/__tests__/directives.test.js +58 -0
  24. package/dist/__tests__/directives.test.js.map +1 -1
  25. package/dist/__tests__/exports.test.js +19 -0
  26. package/dist/__tests__/exports.test.js.map +1 -1
  27. package/dist/__tests__/knuthPlass.test.js +60 -0
  28. package/dist/__tests__/knuthPlass.test.js.map +1 -1
  29. package/dist/__tests__/mirroredMargins.test.d.ts +2 -0
  30. package/dist/__tests__/mirroredMargins.test.d.ts.map +1 -0
  31. package/dist/__tests__/mirroredMargins.test.js +136 -0
  32. package/dist/__tests__/mirroredMargins.test.js.map +1 -0
  33. package/dist/__tests__/numbering.test.js +54 -0
  34. package/dist/__tests__/numbering.test.js.map +1 -1
  35. package/dist/__tests__/openerTitleSource.test.d.ts +2 -0
  36. package/dist/__tests__/openerTitleSource.test.d.ts.map +1 -0
  37. package/dist/__tests__/openerTitleSource.test.js +108 -0
  38. package/dist/__tests__/openerTitleSource.test.js.map +1 -0
  39. package/dist/__tests__/pageRoles.test.d.ts +2 -0
  40. package/dist/__tests__/pageRoles.test.d.ts.map +1 -0
  41. package/dist/__tests__/pageRoles.test.js +95 -0
  42. package/dist/__tests__/pageRoles.test.js.map +1 -0
  43. package/dist/__tests__/parse/containers.test.d.ts +2 -0
  44. package/dist/__tests__/parse/containers.test.d.ts.map +1 -0
  45. package/dist/__tests__/parse/containers.test.js +204 -0
  46. package/dist/__tests__/parse/containers.test.js.map +1 -0
  47. package/dist/__tests__/parse/headingAttrs.test.d.ts +2 -0
  48. package/dist/__tests__/parse/headingAttrs.test.d.ts.map +1 -0
  49. package/dist/__tests__/parse/headingAttrs.test.js +62 -0
  50. package/dist/__tests__/parse/headingAttrs.test.js.map +1 -0
  51. package/dist/__tests__/parse/inlineRef.test.js +26 -0
  52. package/dist/__tests__/parse/inlineRef.test.js.map +1 -1
  53. package/dist/__tests__/parts.test.d.ts +2 -0
  54. package/dist/__tests__/parts.test.d.ts.map +1 -0
  55. package/dist/__tests__/parts.test.js +405 -0
  56. package/dist/__tests__/parts.test.js.map +1 -0
  57. package/dist/__tests__/pipeline/calloutLayout.test.d.ts +2 -0
  58. package/dist/__tests__/pipeline/calloutLayout.test.d.ts.map +1 -0
  59. package/dist/__tests__/pipeline/calloutLayout.test.js +273 -0
  60. package/dist/__tests__/pipeline/calloutLayout.test.js.map +1 -0
  61. package/dist/__tests__/pipeline/calloutPlacement.test.d.ts +2 -0
  62. package/dist/__tests__/pipeline/calloutPlacement.test.d.ts.map +1 -0
  63. package/dist/__tests__/pipeline/calloutPlacement.test.js +239 -0
  64. package/dist/__tests__/pipeline/calloutPlacement.test.js.map +1 -0
  65. package/dist/__tests__/pipeline/captionLayout.test.d.ts +2 -0
  66. package/dist/__tests__/pipeline/captionLayout.test.d.ts.map +1 -0
  67. package/dist/__tests__/pipeline/captionLayout.test.js +269 -0
  68. package/dist/__tests__/pipeline/captionLayout.test.js.map +1 -0
  69. package/dist/__tests__/pipeline/inlineRefRender.test.js +53 -0
  70. package/dist/__tests__/pipeline/inlineRefRender.test.js.map +1 -1
  71. package/dist/__tests__/pipeline/orderedSeparator.test.d.ts +2 -0
  72. package/dist/__tests__/pipeline/orderedSeparator.test.d.ts.map +1 -0
  73. package/dist/__tests__/pipeline/orderedSeparator.test.js +196 -0
  74. package/dist/__tests__/pipeline/orderedSeparator.test.js.map +1 -0
  75. package/dist/__tests__/pipeline/paragraphStyles.test.d.ts +2 -0
  76. package/dist/__tests__/pipeline/paragraphStyles.test.d.ts.map +1 -0
  77. package/dist/__tests__/pipeline/paragraphStyles.test.js +172 -0
  78. package/dist/__tests__/pipeline/paragraphStyles.test.js.map +1 -0
  79. package/dist/__tests__/pipeline/spanBands.test.d.ts +2 -0
  80. package/dist/__tests__/pipeline/spanBands.test.d.ts.map +1 -0
  81. package/dist/__tests__/pipeline/spanBands.test.js +303 -0
  82. package/dist/__tests__/pipeline/spanBands.test.js.map +1 -0
  83. package/dist/__tests__/pipeline/spanBlocks.test.d.ts +2 -0
  84. package/dist/__tests__/pipeline/spanBlocks.test.d.ts.map +1 -0
  85. package/dist/__tests__/pipeline/spanBlocks.test.js +407 -0
  86. package/dist/__tests__/pipeline/spanBlocks.test.js.map +1 -0
  87. package/dist/__tests__/placeholders.test.d.ts +2 -0
  88. package/dist/__tests__/placeholders.test.d.ts.map +1 -0
  89. package/dist/__tests__/placeholders.test.js +130 -0
  90. package/dist/__tests__/placeholders.test.js.map +1 -0
  91. package/dist/__tests__/table/model.test.js +24 -0
  92. package/dist/__tests__/table/model.test.js.map +1 -1
  93. package/dist/canvas-backend/blockRender.d.ts.map +1 -1
  94. package/dist/canvas-backend/blockRender.js +13 -1
  95. package/dist/canvas-backend/blockRender.js.map +1 -1
  96. package/dist/canvas-backend/decorations.d.ts +3 -0
  97. package/dist/canvas-backend/decorations.d.ts.map +1 -1
  98. package/dist/canvas-backend/decorations.js +14 -8
  99. package/dist/canvas-backend/decorations.js.map +1 -1
  100. package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
  101. package/dist/canvas-backend/headerFooter.js +23 -0
  102. package/dist/canvas-backend/headerFooter.js.map +1 -1
  103. package/dist/canvas-backend/index.d.ts.map +1 -1
  104. package/dist/canvas-backend/index.js +4 -2
  105. package/dist/canvas-backend/index.js.map +1 -1
  106. package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
  107. package/dist/canvas-backend/renderResourceBlock.js +33 -5
  108. package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
  109. package/dist/columnRule.d.ts +19 -0
  110. package/dist/columnRule.d.ts.map +1 -0
  111. package/dist/columnRule.js +36 -0
  112. package/dist/columnRule.js.map +1 -0
  113. package/dist/defaults/calloutStyles.d.ts +61 -0
  114. package/dist/defaults/calloutStyles.d.ts.map +1 -0
  115. package/dist/defaults/calloutStyles.js +292 -0
  116. package/dist/defaults/calloutStyles.js.map +1 -0
  117. package/dist/defaults/captionStyle.d.ts +11 -1
  118. package/dist/defaults/captionStyle.d.ts.map +1 -1
  119. package/dist/defaults/captionStyle.js +127 -2
  120. package/dist/defaults/captionStyle.js.map +1 -1
  121. package/dist/defaults/headerFooter.d.ts.map +1 -1
  122. package/dist/defaults/headerFooter.js +3 -0
  123. package/dist/defaults/headerFooter.js.map +1 -1
  124. package/dist/defaults/headings.d.ts +3 -0
  125. package/dist/defaults/headings.d.ts.map +1 -1
  126. package/dist/defaults/headings.js +33 -6
  127. package/dist/defaults/headings.js.map +1 -1
  128. package/dist/defaults/index.d.ts +4 -1
  129. package/dist/defaults/index.d.ts.map +1 -1
  130. package/dist/defaults/index.js +28 -1
  131. package/dist/defaults/index.js.map +1 -1
  132. package/dist/defaults/orderedLists.d.ts +9 -8
  133. package/dist/defaults/orderedLists.d.ts.map +1 -1
  134. package/dist/defaults/orderedLists.js +66 -4
  135. package/dist/defaults/orderedLists.js.map +1 -1
  136. package/dist/defaults/page.d.ts.map +1 -1
  137. package/dist/defaults/page.js +14 -3
  138. package/dist/defaults/page.js.map +1 -1
  139. package/dist/defaults/paragraphStyles.d.ts +10 -0
  140. package/dist/defaults/paragraphStyles.d.ts.map +1 -0
  141. package/dist/defaults/paragraphStyles.js +67 -0
  142. package/dist/defaults/paragraphStyles.js.map +1 -0
  143. package/dist/defaults/parts.d.ts +22 -0
  144. package/dist/defaults/parts.d.ts.map +1 -0
  145. package/dist/defaults/parts.js +139 -0
  146. package/dist/defaults/parts.js.map +1 -0
  147. package/dist/defaults/shared.d.ts.map +1 -1
  148. package/dist/defaults/shared.js +110 -17
  149. package/dist/defaults/shared.js.map +1 -1
  150. package/dist/defaults/tableStyle.d.ts.map +1 -1
  151. package/dist/defaults/tableStyle.js +6 -0
  152. package/dist/defaults/tableStyle.js.map +1 -1
  153. package/dist/design/layout.d.ts +27 -1
  154. package/dist/design/layout.d.ts.map +1 -1
  155. package/dist/design/layout.js +39 -8
  156. package/dist/design/layout.js.map +1 -1
  157. package/dist/design/placeholders.d.ts +21 -4
  158. package/dist/design/placeholders.d.ts.map +1 -1
  159. package/dist/design/placeholders.js +38 -7
  160. package/dist/design/placeholders.js.map +1 -1
  161. package/dist/html-backend.d.ts.map +1 -1
  162. package/dist/html-backend.js +71 -16
  163. package/dist/html-backend.js.map +1 -1
  164. package/dist/index.d.ts +13 -9
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js +7 -4
  167. package/dist/index.js.map +1 -1
  168. package/dist/knuthPlass/breakpoints.d.ts.map +1 -1
  169. package/dist/knuthPlass/breakpoints.js +34 -0
  170. package/dist/knuthPlass/breakpoints.js.map +1 -1
  171. package/dist/knuthPlass/types.d.ts +7 -0
  172. package/dist/knuthPlass/types.d.ts.map +1 -1
  173. package/dist/measure/cache.js +2 -2
  174. package/dist/measure/cache.js.map +1 -1
  175. package/dist/measure/plain.d.ts.map +1 -1
  176. package/dist/measure/plain.js +1 -0
  177. package/dist/measure/plain.js.map +1 -1
  178. package/dist/measure/rich.d.ts.map +1 -1
  179. package/dist/measure/rich.js +1 -0
  180. package/dist/measure/rich.js.map +1 -1
  181. package/dist/measure/types.d.ts +4 -0
  182. package/dist/measure/types.d.ts.map +1 -1
  183. package/dist/measure/types.js.map +1 -1
  184. package/dist/parse/attrs.d.ts +10 -0
  185. package/dist/parse/attrs.d.ts.map +1 -0
  186. package/dist/parse/attrs.js +20 -0
  187. package/dist/parse/attrs.js.map +1 -0
  188. package/dist/parse/blockParser.d.ts +8 -4
  189. package/dist/parse/blockParser.d.ts.map +1 -1
  190. package/dist/parse/blockParser.js +134 -20
  191. package/dist/parse/blockParser.js.map +1 -1
  192. package/dist/parse/index.d.ts +2 -2
  193. package/dist/parse/index.d.ts.map +1 -1
  194. package/dist/parse/index.js +1 -1
  195. package/dist/parse/index.js.map +1 -1
  196. package/dist/parse/inlineFormatting.d.ts +17 -1
  197. package/dist/parse/inlineFormatting.d.ts.map +1 -1
  198. package/dist/parse/inlineFormatting.js +56 -7
  199. package/dist/parse/inlineFormatting.js.map +1 -1
  200. package/dist/parse/sourceMapping.d.ts.map +1 -1
  201. package/dist/parse/sourceMapping.js +13 -1
  202. package/dist/parse/sourceMapping.js.map +1 -1
  203. package/dist/parse/types.d.ts +55 -5
  204. package/dist/parse/types.d.ts.map +1 -1
  205. package/dist/pipeline/bandCaps.d.ts +86 -0
  206. package/dist/pipeline/bandCaps.d.ts.map +1 -0
  207. package/dist/pipeline/bandCaps.js +142 -0
  208. package/dist/pipeline/bandCaps.js.map +1 -0
  209. package/dist/pipeline/build.d.ts +32 -0
  210. package/dist/pipeline/build.d.ts.map +1 -1
  211. package/dist/pipeline/build.js +621 -162
  212. package/dist/pipeline/build.js.map +1 -1
  213. package/dist/pipeline/buildBlockKind.d.ts +8 -0
  214. package/dist/pipeline/buildBlockKind.d.ts.map +1 -1
  215. package/dist/pipeline/buildBlockKind.js +40 -11
  216. package/dist/pipeline/buildBlockKind.js.map +1 -1
  217. package/dist/pipeline/buildHelpers.d.ts +23 -1
  218. package/dist/pipeline/buildHelpers.d.ts.map +1 -1
  219. package/dist/pipeline/buildHelpers.js +50 -6
  220. package/dist/pipeline/buildHelpers.js.map +1 -1
  221. package/dist/pipeline/calloutLayout.d.ts +107 -0
  222. package/dist/pipeline/calloutLayout.d.ts.map +1 -0
  223. package/dist/pipeline/calloutLayout.js +498 -0
  224. package/dist/pipeline/calloutLayout.js.map +1 -0
  225. package/dist/pipeline/columnBalancing.d.ts +54 -10
  226. package/dist/pipeline/columnBalancing.d.ts.map +1 -1
  227. package/dist/pipeline/columnBalancing.js +136 -22
  228. package/dist/pipeline/columnBalancing.js.map +1 -1
  229. package/dist/pipeline/config.d.ts.map +1 -1
  230. package/dist/pipeline/config.js +17 -5
  231. package/dist/pipeline/config.js.map +1 -1
  232. package/dist/pipeline/headerFooter.d.ts +37 -2
  233. package/dist/pipeline/headerFooter.d.ts.map +1 -1
  234. package/dist/pipeline/headerFooter.js +231 -15
  235. package/dist/pipeline/headerFooter.js.map +1 -1
  236. package/dist/pipeline/lists.d.ts +15 -0
  237. package/dist/pipeline/lists.d.ts.map +1 -1
  238. package/dist/pipeline/lists.js +73 -16
  239. package/dist/pipeline/lists.js.map +1 -1
  240. package/dist/pipeline/measureContentBlock.d.ts +59 -0
  241. package/dist/pipeline/measureContentBlock.d.ts.map +1 -0
  242. package/dist/pipeline/measureContentBlock.js +124 -0
  243. package/dist/pipeline/measureContentBlock.js.map +1 -0
  244. package/dist/pipeline/pageRoles.d.ts +23 -0
  245. package/dist/pipeline/pageRoles.d.ts.map +1 -0
  246. package/dist/pipeline/pageRoles.js +54 -0
  247. package/dist/pipeline/pageRoles.js.map +1 -0
  248. package/dist/pipeline/paragraphContainers.d.ts +32 -0
  249. package/dist/pipeline/paragraphContainers.d.ts.map +1 -0
  250. package/dist/pipeline/paragraphContainers.js +61 -0
  251. package/dist/pipeline/paragraphContainers.js.map +1 -0
  252. package/dist/pipeline/parts.d.ts +47 -0
  253. package/dist/pipeline/parts.d.ts.map +1 -0
  254. package/dist/pipeline/parts.js +230 -0
  255. package/dist/pipeline/parts.js.map +1 -0
  256. package/dist/pipeline/placeholders.d.ts +46 -1
  257. package/dist/pipeline/placeholders.d.ts.map +1 -1
  258. package/dist/pipeline/placeholders.js +93 -11
  259. package/dist/pipeline/placeholders.js.map +1 -1
  260. package/dist/pipeline/placement.d.ts +61 -7
  261. package/dist/pipeline/placement.d.ts.map +1 -1
  262. package/dist/pipeline/placement.js +151 -12
  263. package/dist/pipeline/placement.js.map +1 -1
  264. package/dist/pipeline/resourceLayout.d.ts +18 -5
  265. package/dist/pipeline/resourceLayout.d.ts.map +1 -1
  266. package/dist/pipeline/resourceLayout.js +145 -23
  267. package/dist/pipeline/resourceLayout.js.map +1 -1
  268. package/dist/pipeline/styles.d.ts +9 -1
  269. package/dist/pipeline/styles.d.ts.map +1 -1
  270. package/dist/pipeline/styles.js +50 -0
  271. package/dist/pipeline/styles.js.map +1 -1
  272. package/dist/table/model.d.ts.map +1 -1
  273. package/dist/table/model.js +16 -2
  274. package/dist/table/model.js.map +1 -1
  275. package/dist/types.d.ts +466 -2
  276. package/dist/types.d.ts.map +1 -1
  277. package/dist/vdt.d.ts +128 -4
  278. package/dist/vdt.d.ts.map +1 -1
  279. package/dist/vdt.js +2 -1
  280. package/dist/vdt.js.map +1 -1
  281. package/package.json +8 -8
package/dist/types.d.ts CHANGED
@@ -60,6 +60,10 @@ export interface ResourceType {
60
60
  /** Default placement for resources of this type, used when a resource does
61
61
  * not specify its own `placement`. Falls back to `top` / `column`. */
62
62
  defaultPlacement?: ResourcePlacement;
63
+ /** Optional partial caption-style override for resources of this type.
64
+ * Only the keys set here replace the resolved global `captionStyle`; the
65
+ * rest is inherited (see `mergeCaptionStyle`). */
66
+ captionStyle?: CaptionStyleConfig;
63
67
  }
64
68
  /** The concrete payload kind a `Resource` carries. */
65
69
  export type ResourceKind = 'bitmap' | 'svg' | 'table';
@@ -93,6 +97,10 @@ export interface TableModel {
93
97
  rows: TableCell[][];
94
98
  /** Number of leading rows that form the table header. Default 0. */
95
99
  headerRowCount?: number;
100
+ /** Relative column weights (one per column), normalised at layout time —
101
+ * `[2, 1, 1]` gives the first column half the width. Unset, a wrong
102
+ * length, or any non-positive weight falls back to an equal split. */
103
+ columnWidths?: number[];
96
104
  }
97
105
  /** A user-managed resource instance. Binary payloads (bitmaps, SVGs) are
98
106
  * stored out-of-band (IndexedDB in the sandbox) and referenced by
@@ -105,6 +113,10 @@ export interface Resource {
105
113
  kind: ResourceKind;
106
114
  /** Optional caption text (the type prefix + number are computed). */
107
115
  caption?: string;
116
+ /** Optional note (source line, credits, footnote-like remark) set in a
117
+ * smaller run under the resource. Accepts the same inline formatting and
118
+ * `:ref` marks as the caption. Styled by `captionStyle.note`. */
119
+ note?: string;
108
120
  /** Accessibility alt text. */
109
121
  altText?: string;
110
122
  /** Creation timestamp (ms since epoch). */
@@ -224,8 +236,15 @@ export type PageSizePreset = '11x17' | '12x19' | '17x24' | '21x28' | 'custom';
224
236
  export interface PageMargins {
225
237
  top?: Dimension;
226
238
  bottom?: Dimension;
239
+ /** Inner (spine-side) margin when `mirror` is on; left margin otherwise. */
227
240
  left?: Dimension;
241
+ /** Outer margin when `mirror` is on; right margin otherwise. */
228
242
  right?: Dimension;
243
+ /** Mirrored (facing-page) margins: `left` is the inner margin and `right`
244
+ * the outer one. Odd pages (page 1 = odd) keep them as written; even
245
+ * pages swap them so the inner margin always faces the spine. Default
246
+ * `false`. */
247
+ mirror?: boolean;
229
248
  }
230
249
  export interface BaselineGridConfig {
231
250
  enabled: boolean;
@@ -481,7 +500,12 @@ export interface TableStyleConfig {
481
500
  borderWidth?: Dimension;
482
501
  /** Inner padding inside each cell. Default `0.375em`. */
483
502
  cellPadding?: Dimension;
503
+ /** Which rules to stroke when {@link borders} is on. Default `'grid'`. */
504
+ rules?: TableRules;
484
505
  }
506
+ /** Rule pattern of a table: the full cell grid, horizontal rules only (top
507
+ * and bottom edge of every row), the outer frame only, or none. */
508
+ export type TableRules = 'grid' | 'horizontal' | 'outer' | 'none';
485
509
  export interface ResolvedTableStyleConfig {
486
510
  bodyFontFamily: string;
487
511
  bodyFontSize: Dimension;
@@ -499,6 +523,31 @@ export interface ResolvedTableStyleConfig {
499
523
  borderColor: ColorValue;
500
524
  borderWidth: Dimension;
501
525
  cellPadding: Dimension;
526
+ rules: TableRules;
527
+ }
528
+ /** Where a resource caption sits relative to the figure body. */
529
+ export type CaptionPosition = 'above' | 'below';
530
+ /** Styling of the optional resource note (`Resource.note`) — a smaller run
531
+ * set under the resource (source line, credits). Inherits the caption
532
+ * typeface; every field is optional. */
533
+ export interface CaptionNoteStyleConfig {
534
+ /** Note font size. Default 0.85 × the caption size. */
535
+ fontSize?: Dimension;
536
+ /** Note text colour. Defaults to the caption {@link CaptionStyleConfig.color}. */
537
+ color?: ColorValue;
538
+ /** Render the note italic. Default `false`. */
539
+ italic?: boolean;
540
+ /** Gap between the note and what precedes it (body or caption). Default `0.35em`. */
541
+ gap?: Dimension;
542
+ /** Horizontal alignment of the note. Default `'left'`. */
543
+ align?: TextAlign;
544
+ }
545
+ export interface ResolvedCaptionNoteStyleConfig {
546
+ fontSize: Dimension;
547
+ color: ColorValue;
548
+ italic: boolean;
549
+ gap: Dimension;
550
+ align: TextAlign;
502
551
  }
503
552
  /** User-facing styling for resource captions (the numbered label such as
504
553
  * "Figure 1." plus the description text). The label and description share one
@@ -524,6 +573,17 @@ export interface CaptionStyleConfig {
524
573
  labelColor?: ColorValue;
525
574
  /** Render the description italic. Default `false`. */
526
575
  descriptionItalic?: boolean;
576
+ /** Caption placement: under the figure body (`'below'`, default) or on top
577
+ * of it (`'above'`), as a table heading. */
578
+ position?: CaptionPosition;
579
+ /** Paint a bar behind the caption spanning the block width. Default `false`. */
580
+ backgroundEnabled?: boolean;
581
+ /** Bar colour. Defaults to the document's main palette colour. */
582
+ background?: ColorValue;
583
+ /** Inner padding between the bar edge and the caption text. Default `0.35em`. */
584
+ padding?: Dimension;
585
+ /** Styling of the optional resource note (`Resource.note`). */
586
+ note?: CaptionNoteStyleConfig;
527
587
  }
528
588
  export interface ResolvedCaptionStyleConfig {
529
589
  fontFamily: string;
@@ -535,6 +595,11 @@ export interface ResolvedCaptionStyleConfig {
535
595
  labelItalic: boolean;
536
596
  labelColor: ColorValue;
537
597
  descriptionItalic: boolean;
598
+ position: CaptionPosition;
599
+ backgroundEnabled: boolean;
600
+ background: ColorValue;
601
+ padding: Dimension;
602
+ note: ResolvedCaptionNoteStyleConfig;
538
603
  }
539
604
  /** Styling for embedded SVG diagrams (`kind: 'svg'` resources). When
540
605
  * {@link singleInk} is on, every colour in the SVG is remapped to a tint of
@@ -551,6 +616,247 @@ export interface ResolvedDiagramStyleConfig {
551
616
  singleInk: boolean;
552
617
  inkColor: ColorValue;
553
618
  }
619
+ /** A named paragraph style, applied to the paragraphs inside a
620
+ * `:::paragraphs{style="<id>"}` container. Every typographic field is
621
+ * optional and inherits the body text when unset, so a style only needs to
622
+ * spell out what differs from running text. See
623
+ * {@link ResolvedParagraphStyleConfig}. */
624
+ export interface ParagraphStyleConfig {
625
+ /** Identifier referenced from `:::paragraphs{style="…"}`. */
626
+ id: string;
627
+ /** Human-readable name (editor UI only). Defaults to {@link id}. */
628
+ name?: string;
629
+ /** Defaults to the body font family. */
630
+ fontFamily?: string;
631
+ /** Defaults to the body font size. */
632
+ fontSize?: Dimension;
633
+ /** Leading. `em`/`rem` are relative to the style's own font size.
634
+ * Defaults to the body line height. */
635
+ lineHeight?: Dimension;
636
+ /** Defaults to the body text colour. */
637
+ color?: ColorValue;
638
+ /** Defaults to the body alignment (`center` is not available here). */
639
+ textAlign?: 'left' | 'justify';
640
+ /** Hyphenate when justified. Defaults to the body hyphenation setting. */
641
+ hyphenation?: boolean;
642
+ /** Defaults to the body first-line indent. Ignored when
643
+ * {@link hangingIndent} is non-zero. */
644
+ firstLineIndent?: Dimension;
645
+ /** Indent applied to every line except the first (bibliographies,
646
+ * glossaries). Non-zero replaces {@link firstLineIndent}. Default `0`. */
647
+ hangingIndent?: Dimension;
648
+ /** Vertical gap between consecutive paragraphs in the container. Default
649
+ * `0` — entries abut, off the baseline grid until the container closes. */
650
+ spaceBetween?: Dimension;
651
+ /** Space above the container's first block. Default `0`. */
652
+ marginTop?: Dimension;
653
+ /** Minimum space below the container's last block; the flow snaps back
654
+ * to the baseline grid after it. Default `0`. */
655
+ marginBottom?: Dimension;
656
+ }
657
+ export interface ResolvedParagraphStyleConfig {
658
+ id: string;
659
+ name: string;
660
+ fontFamily: string;
661
+ fontSize: Dimension;
662
+ lineHeight: Dimension;
663
+ color: ColorValue;
664
+ textAlign: 'left' | 'justify';
665
+ hyphenation: boolean;
666
+ firstLineIndent: Dimension;
667
+ hangingIndent: Dimension;
668
+ spaceBetween: Dimension;
669
+ marginTop: Dimension;
670
+ marginBottom: Dimension;
671
+ }
672
+ /** Horizontal extent of a callout: its column, or the full content width. */
673
+ export type CalloutSpan = 'column' | 'page';
674
+ /** Where a callout lands: inline in the flow (`'here'`), or floated to the
675
+ * top / bottom band of a page like a resource. */
676
+ export type CalloutPlacement = 'here' | 'top' | 'bottom';
677
+ /** `'fill'` spans the available width; `'auto'` shrink-wraps the title
678
+ * (badge use — children are ignored). */
679
+ export type CalloutWidth = 'fill' | 'auto';
680
+ export type CalloutStripeSide = 'left' | 'right' | 'top';
681
+ export type CalloutIconKind = 'none' | 'glyph' | 'resource';
682
+ export type CalloutIconAlign = 'top' | 'center';
683
+ export type CalloutTextTransform = 'none' | 'uppercase';
684
+ export interface CalloutBorderConfig {
685
+ enabled?: boolean;
686
+ color?: ColorValue;
687
+ width?: Dimension;
688
+ }
689
+ export interface CalloutPaddingConfig {
690
+ top?: Dimension;
691
+ right?: Dimension;
692
+ bottom?: Dimension;
693
+ left?: Dimension;
694
+ }
695
+ /** Solid band along one edge of the box. A side stripe reduces the inner
696
+ * width; a top stripe reduces the inner height. */
697
+ export interface CalloutStripeConfig {
698
+ enabled?: boolean;
699
+ side?: CalloutStripeSide;
700
+ width?: Dimension;
701
+ color?: ColorValue;
702
+ }
703
+ /** Icon drawn beside the title/body: a text glyph or a resource image. When
704
+ * the style has a side stripe the icon is centred over the stripe;
705
+ * otherwise it reserves its own column (`size` + `titleStyle.gap`). */
706
+ export interface CalloutIconConfig {
707
+ kind?: CalloutIconKind;
708
+ /** Glyph text for `kind: 'glyph'` (e.g. `'!'`, `'✎'`). */
709
+ glyph?: string;
710
+ /** Resource id (bitmap / svg) for `kind: 'resource'`. */
711
+ resourceId?: string;
712
+ /** Glyph font family. Defaults to the headings font. */
713
+ fontFamily?: string;
714
+ fontWeight?: number;
715
+ /** Icon box size (square). Default `1.5em` of the callout body size. */
716
+ size?: Dimension;
717
+ color?: ColorValue;
718
+ align?: CalloutIconAlign;
719
+ }
720
+ export interface CalloutTitleStyleConfig {
721
+ /** Defaults to the headings font family. */
722
+ fontFamily?: string;
723
+ /** Defaults to the body font size. */
724
+ fontSize?: Dimension;
725
+ fontWeight?: number;
726
+ italic?: boolean;
727
+ color?: ColorValue;
728
+ textTransform?: CalloutTextTransform;
729
+ /** Vertical gap between the title and the first child block (also the
730
+ * horizontal gap between the icon column and the content). */
731
+ gap?: Dimension;
732
+ }
733
+ /** Body typography inside the callout. Every field inherits `bodyText`. */
734
+ export interface CalloutBodyStyleConfig {
735
+ fontFamily?: string;
736
+ fontSize?: Dimension;
737
+ lineHeight?: Dimension;
738
+ color?: ColorValue;
739
+ textAlign?: 'left' | 'justify';
740
+ hyphenation?: boolean;
741
+ paragraphSpacing?: boolean;
742
+ firstLineIndent?: Dimension;
743
+ }
744
+ /** List typography inside the callout. Every field inherits
745
+ * `unorderedLists` (`color`, `indent`, `gap`, `itemSpacing` also apply to
746
+ * ordered lists). */
747
+ export interface CalloutListStyleConfig {
748
+ bulletChar?: string;
749
+ color?: ColorValue;
750
+ indent?: Dimension;
751
+ gap?: Dimension;
752
+ itemSpacing?: Dimension;
753
+ }
754
+ /** A named callout style, selected by `:::callout{type="<id>"}`. */
755
+ export interface CalloutStyleConfig {
756
+ id: string;
757
+ /** Human-readable name (editor UI only). Defaults to {@link id}. */
758
+ name?: string;
759
+ /** Default title text; empty / unset = no title. The fence `title`
760
+ * attribute overrides it per instance. */
761
+ title?: string;
762
+ /** Default `'column'`. Overridable per instance with the `span` attribute. */
763
+ span?: CalloutSpan;
764
+ /** Default `'here'`. Overridable per instance with the `placement` attribute. */
765
+ placement?: CalloutPlacement;
766
+ /** Default `'fill'`. */
767
+ width?: CalloutWidth;
768
+ /** Default `true`. */
769
+ backgroundEnabled?: boolean;
770
+ /** Default `#f4f4f4`. */
771
+ background?: ColorValue;
772
+ /** Default off, `#cccccc`, `0.5pt`. */
773
+ border?: CalloutBorderConfig;
774
+ /** Default `0`. */
775
+ borderRadius?: Dimension;
776
+ /** Default `0.75em` on every side. */
777
+ padding?: CalloutPaddingConfig;
778
+ /** Default off, `left`, `1.5em`, main colour. */
779
+ stripe?: CalloutStripeConfig;
780
+ /** Default `kind: 'none'`. */
781
+ icon?: CalloutIconConfig;
782
+ titleStyle?: CalloutTitleStyleConfig;
783
+ body?: CalloutBodyStyleConfig;
784
+ lists?: CalloutListStyleConfig;
785
+ /** Space above the box. Default `0.75em`. */
786
+ marginTop?: Dimension;
787
+ /** Minimum space below the box; the flow snaps back to the baseline grid
788
+ * after it. Default `0.75em`. */
789
+ marginBottom?: Dimension;
790
+ /** Always `true` in v1: callouts never split across columns or pages. */
791
+ keepTogether?: boolean;
792
+ }
793
+ export interface ResolvedCalloutStyleConfig {
794
+ id: string;
795
+ name: string;
796
+ title: string;
797
+ span: CalloutSpan;
798
+ placement: CalloutPlacement;
799
+ width: CalloutWidth;
800
+ backgroundEnabled: boolean;
801
+ background: ColorValue;
802
+ border: {
803
+ enabled: boolean;
804
+ color: ColorValue;
805
+ width: Dimension;
806
+ };
807
+ borderRadius: Dimension;
808
+ padding: {
809
+ top: Dimension;
810
+ right: Dimension;
811
+ bottom: Dimension;
812
+ left: Dimension;
813
+ };
814
+ stripe: {
815
+ enabled: boolean;
816
+ side: CalloutStripeSide;
817
+ width: Dimension;
818
+ color: ColorValue;
819
+ };
820
+ icon: {
821
+ kind: CalloutIconKind;
822
+ glyph: string;
823
+ resourceId: string;
824
+ fontFamily: string;
825
+ fontWeight: number;
826
+ size: Dimension;
827
+ color: ColorValue;
828
+ align: CalloutIconAlign;
829
+ };
830
+ titleStyle: {
831
+ fontFamily: string;
832
+ fontSize: Dimension;
833
+ fontWeight: number;
834
+ italic: boolean;
835
+ color: ColorValue;
836
+ textTransform: CalloutTextTransform;
837
+ gap: Dimension;
838
+ };
839
+ body: {
840
+ fontFamily: string;
841
+ fontSize: Dimension;
842
+ lineHeight: Dimension;
843
+ color: ColorValue;
844
+ textAlign: 'left' | 'justify';
845
+ hyphenation: boolean;
846
+ paragraphSpacing: boolean;
847
+ firstLineIndent: Dimension;
848
+ };
849
+ lists: {
850
+ bulletChar: string;
851
+ color: ColorValue;
852
+ indent: Dimension;
853
+ gap: Dimension;
854
+ itemSpacing: Dimension;
855
+ };
856
+ marginTop: Dimension;
857
+ marginBottom: Dimension;
858
+ keepTogether: boolean;
859
+ }
554
860
  /** Parity constraint for a forced page break.
555
861
  *
556
862
  * - `'any'` — no constraint; the break just opens a new page.
@@ -587,10 +893,16 @@ export type HeadingSpan = 'column' | 'page';
587
893
  export interface HeadingAdvancedDesignConfig {
588
894
  enabled: boolean;
589
895
  slot: DesignSlot;
896
+ /** Minimum height reserved for the heading in the column flow. The
897
+ * reserved height is `max(design content bottom, minHeight)`, so an
898
+ * opener can push body text down even when its elements are short (or
899
+ * anchored to the page/bleed frames above the heading). */
900
+ minHeight?: Dimension;
590
901
  }
591
902
  export interface ResolvedHeadingAdvancedDesignConfig {
592
903
  enabled: boolean;
593
904
  slot: ResolvedDesignSlot;
905
+ minHeight?: Dimension;
594
906
  }
595
907
  export interface HeadingLevelConfig {
596
908
  level: number;
@@ -608,7 +920,13 @@ export interface HeadingLevelConfig {
608
920
  span?: HeadingSpan;
609
921
  /** When enabled, the heading renders as a design slot. */
610
922
  advancedDesign?: HeadingAdvancedDesignConfig;
923
+ /** Letter-case transform applied to the heading title (after any
924
+ * numbering prefix, which is kept as written). Length-preserving so the
925
+ * editor's source map stays 1:1 — characters whose upper-case form
926
+ * expands (`ß` → `SS`) are left unchanged. Default `'none'`. */
927
+ textTransform?: HeadingTextTransform;
611
928
  }
929
+ export type HeadingTextTransform = 'none' | 'uppercase';
612
930
  export interface ResolvedHeadingLevelConfig {
613
931
  level: number;
614
932
  fontSize: Dimension;
@@ -623,6 +941,7 @@ export interface ResolvedHeadingLevelConfig {
623
941
  breakBefore: ResolvedHeadingBreakBeforeConfig;
624
942
  span: HeadingSpan;
625
943
  advancedDesign: ResolvedHeadingAdvancedDesignConfig;
944
+ textTransform: HeadingTextTransform;
626
945
  }
627
946
  export interface HeadingsConfig {
628
947
  fontFamily?: string;
@@ -649,6 +968,15 @@ export interface ColumnBalancingConfig {
649
968
  enabled?: boolean;
650
969
  /** Maximum extra grid lines that may be added above a single heading. */
651
970
  maxLinesPerHeading?: number;
971
+ /** Allow extra grid lines where a list/enumeration ends, when the column's
972
+ * headings cannot absorb the whole gap. Default true. */
973
+ stretchAfterLists?: boolean;
974
+ /** Maximum extra grid lines after a single list end. Default 1. */
975
+ maxLinesAfterList?: number;
976
+ /** Last resort: re-break one paragraph per short column one line looser
977
+ * (TeX \looseness=+1), within the configured `bodyText.maxWordSpacing`.
978
+ * Requires `bodyText.optimalLineBreaking`. Default true. */
979
+ looseParagraphs?: boolean;
652
980
  }
653
981
  export interface ResolvedHeadingsConfig {
654
982
  fontFamily: string;
@@ -662,6 +990,9 @@ export interface ResolvedHeadingsConfig {
662
990
  balancing: {
663
991
  enabled: boolean;
664
992
  maxLinesPerHeading: number;
993
+ stretchAfterLists: boolean;
994
+ maxLinesAfterList: number;
995
+ looseParagraphs: boolean;
665
996
  };
666
997
  levels: ResolvedHeadingLevelConfig[];
667
998
  }
@@ -747,6 +1078,13 @@ export interface OrderedListLevelConfig {
747
1078
  italic?: boolean;
748
1079
  indent?: Dimension;
749
1080
  verticalOffset?: Dimension;
1081
+ /** Separator run styling for this level; each field inherits the level's
1082
+ * number style (or the list-wide separator setting) when unset. */
1083
+ separatorFontFamily?: string;
1084
+ separatorFontWeight?: number;
1085
+ separatorItalic?: boolean;
1086
+ separatorColor?: ColorValue;
1087
+ separatorGap?: Dimension;
750
1088
  }
751
1089
  export interface ResolvedOrderedListLevelConfig {
752
1090
  level: number;
@@ -760,6 +1098,11 @@ export interface ResolvedOrderedListLevelConfig {
760
1098
  /** User-overridden indent for this level. Undefined => pipeline cascades. */
761
1099
  indent?: Dimension;
762
1100
  verticalOffset: Dimension;
1101
+ separatorFontFamily: string;
1102
+ separatorFontWeight: number;
1103
+ separatorItalic: boolean;
1104
+ separatorColor: ColorValue;
1105
+ separatorGap: Dimension;
763
1106
  }
764
1107
  export interface OrderedListsConfig {
765
1108
  fontFamily?: string;
@@ -777,6 +1120,16 @@ export interface OrderedListsConfig {
777
1120
  itemSpacing?: Dimension;
778
1121
  hangingIndent?: boolean;
779
1122
  levels?: OrderedListLevelConfig[];
1123
+ /** Font family of the separator run. Inherits the number's `fontFamily`. */
1124
+ separatorFontFamily?: string;
1125
+ /** Weight of the separator run. Inherits the number's `fontWeight`. */
1126
+ separatorFontWeight?: number;
1127
+ /** Italic separator run. Inherits the number's `italic`. */
1128
+ separatorItalic?: boolean;
1129
+ /** Colour of the separator run. Inherits the number's `color`. */
1130
+ separatorColor?: ColorValue;
1131
+ /** Space between the number and the separator. Default `0em`. */
1132
+ separatorGap?: Dimension;
780
1133
  }
781
1134
  export interface ResolvedOrderedListsConfig {
782
1135
  fontFamily: string;
@@ -794,6 +1147,11 @@ export interface ResolvedOrderedListsConfig {
794
1147
  itemSpacing: Dimension;
795
1148
  hangingIndent: boolean;
796
1149
  levels: ResolvedOrderedListLevelConfig[];
1150
+ separatorFontFamily: string;
1151
+ separatorFontWeight: number;
1152
+ separatorItalic: boolean;
1153
+ separatorColor: ColorValue;
1154
+ separatorGap: Dimension;
797
1155
  }
798
1156
  export interface SyncIndicatorConfig {
799
1157
  enabled: boolean;
@@ -931,12 +1289,28 @@ export interface CustomFontFamily {
931
1289
  }
932
1290
  export type PageParity = 'all' | 'odd' | 'even';
933
1291
  export type HeaderFooterHAlign = 'left' | 'center' | 'right';
1292
+ /** Classification of a laid-out page, computed after placement
1293
+ * (`pipeline/pageRoles.ts`):
1294
+ * - `'blank'` — parity / force-blank padding, or a page with no content;
1295
+ * - `'part'` — a part-divider page (`partInfo` set);
1296
+ * - `'opener'` — the first block in reading order is a heading whose level
1297
+ * spans the page or forces a page break before it (a chapter opener);
1298
+ * - `'body'` — everything else. */
1299
+ export type PageRole = 'body' | 'opener' | 'part' | 'blank';
1300
+ /** Which page roles a design element renders on. `'all'` (default) renders
1301
+ * on every page the parity filter admits. */
1302
+ export type PageRoleFilter = 'all' | PageRole;
934
1303
  export type HAlign = 'left' | 'center' | 'right';
935
1304
  export type VAlign = 'top' | 'middle' | 'bottom';
936
1305
  export type AnchorEdge = 'top-left' | 'top' | 'top-right' | 'left' | 'center' | 'right' | 'bottom-left' | 'bottom' | 'bottom-right' | 'right-of' | 'left-of' | 'below' | 'above' | 'align-top' | 'align-bottom' | 'align-left' | 'align-right';
937
1306
  export interface ElementAnchor {
938
- /** `'container'` or `'#elementId'` reference to another element in the slot. */
939
- to: 'container' | `#${string}`;
1307
+ /** `'container'` (the slot's own container), `'page'` (the trim box),
1308
+ * `'bleed'` (the trim box expanded by `cutLines.bleed` when cut lines are
1309
+ * enabled, otherwise the trim box) or `'#elementId'` — a reference to
1310
+ * another element in the slot. Page/bleed anchoring also makes that frame
1311
+ * the reference for `size: 'fill'` and auto-width clamping, so a band can
1312
+ * run edge to edge regardless of the page margins. */
1313
+ to: 'container' | 'page' | 'bleed' | `#${string}`;
940
1314
  edge: AnchorEdge;
941
1315
  }
942
1316
  export type ElementSize = 'auto' | 'fill' | Dimension;
@@ -970,6 +1344,9 @@ export interface DesignTextElement {
970
1344
  id: string;
971
1345
  /** Header/footer only; ignored by heading designs. */
972
1346
  parity?: PageParity;
1347
+ /** Page roles this element renders on (see `PageRoleFilter`). Default
1348
+ * `'all'`. */
1349
+ pages?: PageRoleFilter;
973
1350
  placement: ElementPlacement;
974
1351
  /** Template with placeholders (see design/placeholders.ts). Use `{{`/`}}`
975
1352
  * for literal braces. */
@@ -995,6 +1372,8 @@ export interface DesignRuleElement {
995
1372
  kind: 'rule';
996
1373
  id: string;
997
1374
  parity?: PageParity;
1375
+ /** Page roles this element renders on. Default `'all'`. */
1376
+ pages?: PageRoleFilter;
998
1377
  placement: ElementPlacement;
999
1378
  direction: 'horizontal' | 'vertical';
1000
1379
  color: ColorValue;
@@ -1004,6 +1383,8 @@ export interface DesignBoxElement {
1004
1383
  kind: 'box';
1005
1384
  id: string;
1006
1385
  parity?: PageParity;
1386
+ /** Page roles this element renders on. Default `'all'`. */
1387
+ pages?: PageRoleFilter;
1007
1388
  placement: ElementPlacement;
1008
1389
  style: ElementBoxStyle;
1009
1390
  }
@@ -1078,6 +1459,81 @@ export type HeaderFooterRuleElement = DesignRuleElement;
1078
1459
  export type ResolvedHeaderFooterTextElement = ResolvedDesignTextElement;
1079
1460
  /** @deprecated Use `ResolvedDesignRuleElement`. */
1080
1461
  export type ResolvedHeaderFooterRuleElement = ResolvedDesignRuleElement;
1462
+ export interface PartsBreakBeforeConfig {
1463
+ /** Parity of the page the part opens on. Default `'odd'`. */
1464
+ parity?: HeadingBreakParity;
1465
+ }
1466
+ export interface PartsBreakAfterConfig {
1467
+ /** Whether the content after the part moves to a fresh page. Default `true`. */
1468
+ enabled?: boolean;
1469
+ /** Parity of that fresh page. Default `'any'` — the next chapter's own
1470
+ * `breakBefore.parity` then decides whether a blank verso follows. */
1471
+ parity?: HeadingBreakParity;
1472
+ }
1473
+ /** Typography of the blocks inside a `:::part` container. Every field
1474
+ * inherits `bodyText` / the list configs when unset. */
1475
+ export interface PartsBodyStyleConfig {
1476
+ fontFamily?: string;
1477
+ fontSize?: Dimension;
1478
+ lineHeight?: Dimension;
1479
+ color?: ColorValue;
1480
+ textAlign?: TextAlign;
1481
+ /** Bullet colour of unordered lists inside the part. */
1482
+ bulletColor?: ColorValue;
1483
+ /** Number colour of ordered lists inside the part (numbers are set bold). */
1484
+ numberColor?: ColorValue;
1485
+ /** Partial overrides applied on top of the document's `unorderedLists`
1486
+ * inside the part (after `bulletColor`). */
1487
+ unorderedLists?: UnorderedListsConfig;
1488
+ /** Partial overrides applied on top of the document's `orderedLists`
1489
+ * inside the part (after `numberColor` and the bold weight). */
1490
+ orderedLists?: OrderedListsConfig;
1491
+ }
1492
+ export interface PartsConfig {
1493
+ breakBefore?: PartsBreakBeforeConfig;
1494
+ breakAfter?: PartsBreakAfterConfig;
1495
+ /** Body area of the part page. Defaults to the page margins (`mirror`
1496
+ * honoured). */
1497
+ margins?: PageMargins;
1498
+ /** Opener design. Its container is the page trim box, so `'page'` /
1499
+ * `'bleed'` anchors and container anchors coincide. Purely decorative —
1500
+ * it never reserves body space; raise `margins.top` to leave room for
1501
+ * it. When empty, `{number} {titleText}` is synthesised from the H1
1502
+ * typography. */
1503
+ design?: DesignSlot;
1504
+ /** Design of the blank verso that follows a part page (the back of the
1505
+ * divider leaf). Same container and placeholders as `design`; when
1506
+ * empty the verso stays plain. */
1507
+ versoDesign?: DesignSlot;
1508
+ bodyStyle?: PartsBodyStyleConfig;
1509
+ }
1510
+ export interface ResolvedPartsBreakBeforeConfig {
1511
+ parity: HeadingBreakParity;
1512
+ }
1513
+ export interface ResolvedPartsBreakAfterConfig {
1514
+ enabled: boolean;
1515
+ parity: HeadingBreakParity;
1516
+ }
1517
+ export interface ResolvedPartsBodyStyleConfig {
1518
+ fontFamily: string;
1519
+ fontSize: Dimension;
1520
+ lineHeight: Dimension;
1521
+ color: ColorValue;
1522
+ textAlign: TextAlign;
1523
+ bulletColor: ColorValue;
1524
+ numberColor: ColorValue;
1525
+ /** Kept partial: applied on top of the resolved document lists inside parts. */
1526
+ unorderedLists?: UnorderedListsConfig;
1527
+ orderedLists?: OrderedListsConfig;
1528
+ }
1529
+ export interface ResolvedPartsConfig {
1530
+ breakBefore: ResolvedPartsBreakBeforeConfig;
1531
+ breakAfter: ResolvedPartsBreakAfterConfig;
1532
+ margins: Required<PageMargins>;
1533
+ design: ResolvedDesignSlot;
1534
+ versoDesign: ResolvedDesignSlot;
1535
+ bodyStyle: ResolvedPartsBodyStyleConfig;
1536
+ }
1081
1537
  export interface PostextConfig {
1082
1538
  page?: PageConfig;
1083
1539
  layout?: LayoutConfig;
@@ -1089,6 +1545,14 @@ export interface PostextConfig {
1089
1545
  captionStyle?: CaptionStyleConfig;
1090
1546
  /** Styling for embedded SVG diagrams (single-ink reproduction). */
1091
1547
  diagramStyle?: DiagramStyleConfig;
1548
+ /** Named paragraph styles for `:::paragraphs{style="…"}` containers. */
1549
+ paragraphStyles?: ParagraphStyleConfig[];
1550
+ /** Named callout styles for `:::callout{type="…"}` containers. Defaults
1551
+ * to a single neutral `note` style when unset. */
1552
+ calloutStyles?: CalloutStyleConfig[];
1553
+ /** Part dividers (`:::part` containers): page breaks, body area,
1554
+ * opener design and body typography. */
1555
+ parts?: PartsConfig;
1092
1556
  unorderedLists?: UnorderedListsConfig;
1093
1557
  orderedLists?: OrderedListsConfig;
1094
1558
  math?: MathConfig;