@kensio/colophon 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/README.md +107 -798
  2. package/dist/background/gradient.d.ts +12 -0
  3. package/dist/background/gradient.d.ts.map +1 -0
  4. package/dist/background/gradient.js +21 -0
  5. package/dist/background/gradient.js.map +1 -0
  6. package/dist/background/image.d.ts +14 -0
  7. package/dist/background/image.d.ts.map +1 -0
  8. package/dist/background/image.js +36 -0
  9. package/dist/background/image.js.map +1 -0
  10. package/dist/background/index.d.ts +13 -0
  11. package/dist/background/index.d.ts.map +1 -0
  12. package/dist/background/index.js +27 -0
  13. package/dist/background/index.js.map +1 -0
  14. package/dist/background/mesh.d.ts +12 -0
  15. package/dist/background/mesh.d.ts.map +1 -0
  16. package/dist/background/mesh.js +43 -0
  17. package/dist/background/mesh.js.map +1 -0
  18. package/dist/background.d.ts +7 -2
  19. package/dist/background.d.ts.map +1 -1
  20. package/dist/background.js +44 -1
  21. package/dist/background.js.map +1 -1
  22. package/dist/cli/args.d.ts +1 -1
  23. package/dist/cli/args.d.ts.map +1 -1
  24. package/dist/cli/args.js +1 -1
  25. package/dist/cli/config.d.ts +1 -1
  26. package/dist/cli/config.js +1 -1
  27. package/dist/config/defaults.d.ts +8 -7
  28. package/dist/config/defaults.d.ts.map +1 -1
  29. package/dist/config/defaults.js +8 -8
  30. package/dist/config/defaults.js.map +1 -1
  31. package/dist/config/index.d.ts +1 -1
  32. package/dist/config/index.d.ts.map +1 -1
  33. package/dist/config/index.js +14 -5
  34. package/dist/config/index.js.map +1 -1
  35. package/dist/config/resolve.d.ts +7 -0
  36. package/dist/config/resolve.d.ts.map +1 -1
  37. package/dist/config/resolve.js +16 -0
  38. package/dist/config/resolve.js.map +1 -1
  39. package/dist/config/size.d.ts +7 -1
  40. package/dist/config/size.d.ts.map +1 -1
  41. package/dist/config/size.js +22 -9
  42. package/dist/config/size.js.map +1 -1
  43. package/dist/content/props.d.ts +2 -2
  44. package/dist/content/props.js +2 -2
  45. package/dist/content/slug.d.ts +5 -5
  46. package/dist/content/slug.js +6 -6
  47. package/dist/content/slug.js.map +1 -1
  48. package/dist/content/walk.d.ts +1 -1
  49. package/dist/content/walk.js +1 -1
  50. package/dist/fonts/index.d.ts +3 -2
  51. package/dist/fonts/index.d.ts.map +1 -1
  52. package/dist/fonts/index.js +3 -2
  53. package/dist/fonts/index.js.map +1 -1
  54. package/dist/fonts/resolve.js +1 -1
  55. package/dist/generate/extra.js +4 -4
  56. package/dist/generate/extra.js.map +1 -1
  57. package/dist/generate/options.d.ts +1 -1
  58. package/dist/generate/outputs.d.ts +4 -4
  59. package/dist/generate/outputs.js +4 -4
  60. package/dist/highlight/language.d.ts +2 -3
  61. package/dist/highlight/language.d.ts.map +1 -1
  62. package/dist/highlight/language.js +3 -4
  63. package/dist/highlight/language.js.map +1 -1
  64. package/dist/highlight/normalise.d.ts +2 -2
  65. package/dist/highlight/normalise.js +2 -2
  66. package/dist/image/index.d.ts +18 -0
  67. package/dist/image/index.d.ts.map +1 -0
  68. package/dist/image/index.js +42 -0
  69. package/dist/image/index.js.map +1 -0
  70. package/dist/image/jpeg.d.ts +10 -0
  71. package/dist/image/jpeg.d.ts.map +1 -0
  72. package/dist/image/jpeg.js +57 -0
  73. package/dist/image/jpeg.js.map +1 -0
  74. package/dist/image/load.d.ts +4 -0
  75. package/dist/image/load.d.ts.map +1 -0
  76. package/dist/image/load.js +60 -0
  77. package/dist/image/load.js.map +1 -0
  78. package/dist/image/media.d.ts +10 -0
  79. package/dist/image/media.d.ts.map +1 -0
  80. package/dist/image/media.js +37 -0
  81. package/dist/image/media.js.map +1 -0
  82. package/dist/image/resolve.d.ts +13 -0
  83. package/dist/image/resolve.d.ts.map +1 -0
  84. package/dist/image/resolve.js +38 -0
  85. package/dist/image/resolve.js.map +1 -0
  86. package/dist/image/size.d.ts +22 -0
  87. package/dist/image/size.d.ts.map +1 -0
  88. package/dist/image/size.js +60 -0
  89. package/dist/image/size.js.map +1 -0
  90. package/dist/image/svg.d.ts +12 -0
  91. package/dist/image/svg.d.ts.map +1 -0
  92. package/dist/image/svg.js +61 -0
  93. package/dist/image/svg.js.map +1 -0
  94. package/dist/image/uri.d.ts +9 -0
  95. package/dist/image/uri.d.ts.map +1 -0
  96. package/dist/image/uri.js +22 -0
  97. package/dist/image/uri.js.map +1 -0
  98. package/dist/index.d.ts +8 -3
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +7 -2
  101. package/dist/index.js.map +1 -1
  102. package/dist/layout/block.d.ts +37 -0
  103. package/dist/layout/block.d.ts.map +1 -0
  104. package/dist/layout/block.js +26 -0
  105. package/dist/layout/block.js.map +1 -0
  106. package/dist/layout/box.d.ts +20 -0
  107. package/dist/layout/box.d.ts.map +1 -0
  108. package/dist/layout/box.js +61 -0
  109. package/dist/layout/box.js.map +1 -0
  110. package/dist/layout/distribute.d.ts +15 -0
  111. package/dist/layout/distribute.d.ts.map +1 -0
  112. package/dist/layout/distribute.js +30 -0
  113. package/dist/layout/distribute.js.map +1 -0
  114. package/dist/layout/image.d.ts +42 -0
  115. package/dist/layout/image.d.ts.map +1 -0
  116. package/dist/layout/image.js +34 -0
  117. package/dist/layout/image.js.map +1 -0
  118. package/dist/layout/index.d.ts +40 -0
  119. package/dist/layout/index.d.ts.map +1 -0
  120. package/dist/layout/index.js +30 -0
  121. package/dist/layout/index.js.map +1 -0
  122. package/dist/layout/lines.d.ts +45 -0
  123. package/dist/layout/lines.d.ts.map +1 -0
  124. package/dist/layout/lines.js +71 -0
  125. package/dist/layout/lines.js.map +1 -0
  126. package/dist/layout/measure.d.ts +11 -0
  127. package/dist/layout/measure.d.ts.map +1 -0
  128. package/dist/layout/measure.js +11 -0
  129. package/dist/layout/measure.js.map +1 -0
  130. package/dist/layout/panel.d.ts +20 -0
  131. package/dist/layout/panel.d.ts.map +1 -0
  132. package/dist/layout/panel.js +22 -0
  133. package/dist/layout/panel.js.map +1 -0
  134. package/dist/layout/row.d.ts +15 -0
  135. package/dist/layout/row.d.ts.map +1 -0
  136. package/dist/layout/row.js +20 -0
  137. package/dist/layout/row.js.map +1 -0
  138. package/dist/layout/scrim.d.ts +23 -0
  139. package/dist/layout/scrim.d.ts.map +1 -0
  140. package/dist/layout/scrim.js +38 -0
  141. package/dist/layout/scrim.js.map +1 -0
  142. package/dist/layout/stack.d.ts +14 -0
  143. package/dist/layout/stack.d.ts.map +1 -0
  144. package/dist/layout/stack.js +19 -0
  145. package/dist/layout/stack.js.map +1 -0
  146. package/dist/layout/types.d.ts +49 -0
  147. package/dist/layout/types.d.ts.map +1 -0
  148. package/dist/layout/types.js +2 -0
  149. package/dist/layout/types.js.map +1 -0
  150. package/dist/manifest/build.d.ts +1 -1
  151. package/dist/manifest/build.js +1 -1
  152. package/dist/manifest/index.d.ts +1 -1
  153. package/dist/manifest/index.js +1 -1
  154. package/dist/manifest/order.d.ts +1 -1
  155. package/dist/manifest/order.js +1 -1
  156. package/dist/manifest/page.d.ts +2 -2
  157. package/dist/manifest/page.js +3 -3
  158. package/dist/measure/estimate.d.ts +10 -0
  159. package/dist/measure/estimate.d.ts.map +1 -0
  160. package/dist/measure/estimate.js +58 -0
  161. package/dist/measure/estimate.js.map +1 -0
  162. package/dist/measure/faces.d.ts +15 -0
  163. package/dist/measure/faces.d.ts.map +1 -0
  164. package/dist/measure/faces.js +70 -0
  165. package/dist/measure/faces.js.map +1 -0
  166. package/dist/measure/index.d.ts +16 -0
  167. package/dist/measure/index.d.ts.map +1 -0
  168. package/dist/measure/index.js +0 -0
  169. package/dist/measure/index.js.map +1 -0
  170. package/dist/measure/runs.d.ts +17 -0
  171. package/dist/measure/runs.d.ts.map +1 -0
  172. package/dist/measure/runs.js +39 -0
  173. package/dist/measure/runs.js.map +1 -0
  174. package/dist/measure/select.d.ts +13 -0
  175. package/dist/measure/select.d.ts.map +1 -0
  176. package/dist/measure/select.js +47 -0
  177. package/dist/measure/select.js.map +1 -0
  178. package/dist/meta/tags.d.ts +6 -6
  179. package/dist/meta/tags.js +6 -6
  180. package/dist/meta/url.d.ts +4 -4
  181. package/dist/meta/url.js +4 -4
  182. package/dist/placement/check.d.ts +1 -1
  183. package/dist/placement/check.js +1 -1
  184. package/dist/placement/index.js +1 -1
  185. package/dist/placement/relative.d.ts +3 -3
  186. package/dist/placement/relative.js +3 -3
  187. package/dist/pool.d.ts +2 -2
  188. package/dist/pool.js +3 -3
  189. package/dist/pool.js.map +1 -1
  190. package/dist/props.d.ts +7 -0
  191. package/dist/props.d.ts.map +1 -0
  192. package/dist/props.js +17 -0
  193. package/dist/props.js.map +1 -0
  194. package/dist/render/svg.d.ts +4 -2
  195. package/dist/render/svg.d.ts.map +1 -1
  196. package/dist/render/svg.js +28 -6
  197. package/dist/render/svg.js.map +1 -1
  198. package/dist/stamp/config-digest.d.ts.map +1 -1
  199. package/dist/stamp/config-digest.js +21 -1
  200. package/dist/stamp/config-digest.js.map +1 -1
  201. package/dist/stamp/index.js +2 -2
  202. package/dist/stamp/index.js.map +1 -1
  203. package/dist/stamp/read.d.ts +1 -1
  204. package/dist/stamp/read.js +4 -4
  205. package/dist/templates/attribution.d.ts +17 -0
  206. package/dist/templates/attribution.d.ts.map +1 -0
  207. package/dist/templates/attribution.js +39 -0
  208. package/dist/templates/attribution.js.map +1 -0
  209. package/dist/templates/banner/badge-props.d.ts +16 -0
  210. package/dist/templates/banner/badge-props.d.ts.map +1 -0
  211. package/dist/templates/banner/badge-props.js +58 -0
  212. package/dist/templates/banner/badge-props.js.map +1 -0
  213. package/dist/templates/banner/badge.d.ts.map +1 -1
  214. package/dist/templates/banner/badge.js +3 -6
  215. package/dist/templates/banner/badge.js.map +1 -1
  216. package/dist/templates/banner/index.d.ts +3 -0
  217. package/dist/templates/banner/index.d.ts.map +1 -1
  218. package/dist/templates/banner/index.js +41 -37
  219. package/dist/templates/banner/index.js.map +1 -1
  220. package/dist/templates/banner/lines.d.ts +7 -12
  221. package/dist/templates/banner/lines.d.ts.map +1 -1
  222. package/dist/templates/banner/lines.js +23 -34
  223. package/dist/templates/banner/lines.js.map +1 -1
  224. package/dist/templates/banner/version.d.ts +9 -0
  225. package/dist/templates/banner/version.d.ts.map +1 -0
  226. package/dist/templates/banner/version.js +21 -0
  227. package/dist/templates/banner/version.js.map +1 -0
  228. package/dist/templates/card/index.d.ts +4 -1
  229. package/dist/templates/card/index.d.ts.map +1 -1
  230. package/dist/templates/card/index.js +37 -25
  231. package/dist/templates/card/index.js.map +1 -1
  232. package/dist/templates/card/lines.d.ts +17 -13
  233. package/dist/templates/card/lines.d.ts.map +1 -1
  234. package/dist/templates/card/lines.js +24 -20
  235. package/dist/templates/card/lines.js.map +1 -1
  236. package/dist/templates/code/chrome.d.ts +7 -3
  237. package/dist/templates/code/chrome.d.ts.map +1 -1
  238. package/dist/templates/code/chrome.js +12 -11
  239. package/dist/templates/code/chrome.js.map +1 -1
  240. package/dist/templates/code/clip.d.ts +1 -1
  241. package/dist/templates/code/clip.js +1 -1
  242. package/dist/templates/code/fit.d.ts +2 -2
  243. package/dist/templates/code/fit.d.ts.map +1 -1
  244. package/dist/templates/code/fit.js +4 -4
  245. package/dist/templates/code/fit.js.map +1 -1
  246. package/dist/templates/code/index.d.ts.map +1 -1
  247. package/dist/templates/code/index.js +7 -6
  248. package/dist/templates/code/index.js.map +1 -1
  249. package/dist/templates/code/layout.d.ts +1 -1
  250. package/dist/templates/code/layout.d.ts.map +1 -1
  251. package/dist/templates/code/layout.js +6 -6
  252. package/dist/templates/code/layout.js.map +1 -1
  253. package/dist/templates/code/panel.d.ts +13 -0
  254. package/dist/templates/code/panel.d.ts.map +1 -1
  255. package/dist/templates/code/panel.js +34 -2
  256. package/dist/templates/code/panel.js.map +1 -1
  257. package/dist/templates/code/plate.d.ts +3 -1
  258. package/dist/templates/code/plate.d.ts.map +1 -1
  259. package/dist/templates/code/plate.js +11 -9
  260. package/dist/templates/code/plate.js.map +1 -1
  261. package/dist/templates/code/spans.js +1 -1
  262. package/dist/templates/code/spans.js.map +1 -1
  263. package/dist/templates/code/width.d.ts +10 -0
  264. package/dist/templates/code/width.d.ts.map +1 -0
  265. package/dist/templates/code/width.js +26 -0
  266. package/dist/templates/code/width.js.map +1 -0
  267. package/dist/templates/footer.d.ts +8 -0
  268. package/dist/templates/footer.d.ts.map +1 -1
  269. package/dist/templates/footer.js +11 -1
  270. package/dist/templates/footer.js.map +1 -1
  271. package/dist/templates/index.d.ts +1 -1
  272. package/dist/templates/index.d.ts.map +1 -1
  273. package/dist/templates/index.js +1 -1
  274. package/dist/templates/index.js.map +1 -1
  275. package/dist/templates/logo.d.ts +15 -0
  276. package/dist/templates/logo.d.ts.map +1 -0
  277. package/dist/templates/logo.js +30 -0
  278. package/dist/templates/logo.js.map +1 -0
  279. package/dist/templates/measure.d.ts +11 -0
  280. package/dist/templates/measure.d.ts.map +1 -0
  281. package/dist/templates/measure.js +11 -0
  282. package/dist/templates/measure.js.map +1 -0
  283. package/dist/templates/props.d.ts +2 -2
  284. package/dist/templates/props.js +2 -2
  285. package/dist/templates/text.d.ts +37 -0
  286. package/dist/templates/text.d.ts.map +1 -0
  287. package/dist/templates/text.js +26 -0
  288. package/dist/templates/text.js.map +1 -0
  289. package/dist/text/break.d.ts +11 -0
  290. package/dist/text/break.d.ts.map +1 -0
  291. package/dist/text/break.js +30 -0
  292. package/dist/text/break.js.map +1 -0
  293. package/dist/text/fit.d.ts +30 -0
  294. package/dist/text/fit.d.ts.map +1 -0
  295. package/dist/text/fit.js +29 -0
  296. package/dist/text/fit.js.map +1 -0
  297. package/dist/text/index.d.ts +5 -3
  298. package/dist/text/index.d.ts.map +1 -1
  299. package/dist/text/index.js +3 -2
  300. package/dist/text/index.js.map +1 -1
  301. package/dist/text/wrap.d.ts +17 -7
  302. package/dist/text/wrap.d.ts.map +1 -1
  303. package/dist/text/wrap.js +25 -17
  304. package/dist/text/wrap.js.map +1 -1
  305. package/dist/texture/grain.d.ts +17 -0
  306. package/dist/texture/grain.d.ts.map +1 -0
  307. package/dist/texture/grain.js +29 -0
  308. package/dist/texture/grain.js.map +1 -0
  309. package/dist/texture/index.d.ts +11 -0
  310. package/dist/texture/index.d.ts.map +1 -0
  311. package/dist/texture/index.js +20 -0
  312. package/dist/texture/index.js.map +1 -0
  313. package/dist/texture/pattern.d.ts +17 -0
  314. package/dist/texture/pattern.d.ts.map +1 -0
  315. package/dist/texture/pattern.js +45 -0
  316. package/dist/texture/pattern.js.map +1 -0
  317. package/dist/texture/resolve.d.ts +16 -0
  318. package/dist/texture/resolve.d.ts.map +1 -0
  319. package/dist/texture/resolve.js +20 -0
  320. package/dist/texture/resolve.js.map +1 -0
  321. package/dist/theme/index.d.ts +27 -0
  322. package/dist/theme/index.d.ts.map +1 -0
  323. package/dist/theme/index.js +41 -0
  324. package/dist/theme/index.js.map +1 -0
  325. package/dist/theme/presets.d.ts +38 -0
  326. package/dist/theme/presets.d.ts.map +1 -0
  327. package/dist/theme/presets.js +150 -0
  328. package/dist/theme/presets.js.map +1 -0
  329. package/dist/types.d.ts +281 -46
  330. package/dist/types.d.ts.map +1 -1
  331. package/dist/validate/background.d.ts +12 -0
  332. package/dist/validate/background.d.ts.map +1 -0
  333. package/dist/validate/background.js +53 -0
  334. package/dist/validate/background.js.map +1 -0
  335. package/dist/validate/collect.d.ts +9 -0
  336. package/dist/validate/collect.d.ts.map +1 -0
  337. package/dist/validate/collect.js +34 -0
  338. package/dist/validate/collect.js.map +1 -0
  339. package/dist/validate/index.d.ts +1 -1
  340. package/dist/validate/index.d.ts.map +1 -1
  341. package/dist/validate/index.js +3 -20
  342. package/dist/validate/index.js.map +1 -1
  343. package/dist/validate/keys.d.ts +35 -2
  344. package/dist/validate/keys.d.ts.map +1 -1
  345. package/dist/validate/keys.js +92 -3
  346. package/dist/validate/keys.js.map +1 -1
  347. package/dist/validate/overrides.d.ts.map +1 -1
  348. package/dist/validate/overrides.js +5 -1
  349. package/dist/validate/overrides.js.map +1 -1
  350. package/dist/validate/suggest.d.ts.map +1 -1
  351. package/dist/validate/suggest.js +21 -3
  352. package/dist/validate/suggest.js.map +1 -1
  353. package/dist/validate/texture.d.ts +11 -0
  354. package/dist/validate/texture.d.ts.map +1 -0
  355. package/dist/validate/texture.js +34 -0
  356. package/dist/validate/texture.js.map +1 -0
  357. package/dist/validate/values.d.ts +10 -10
  358. package/dist/validate/values.d.ts.map +1 -1
  359. package/dist/validate/values.js +21 -31
  360. package/dist/validate/values.js.map +1 -1
  361. package/package.json +7 -1
package/dist/types.d.ts CHANGED
@@ -26,7 +26,57 @@ export interface GradientStop {
26
26
  readonly color: string;
27
27
  }
28
28
  /**
29
- * Background fill for an image: a flat colour or a linear gradient.
29
+ * A raster or SVG image to draw into a generated one, given either as a file
30
+ * path or as its bytes. It mirrors {@link FontSource}, and for the same
31
+ * reasons: a path is checked when the config is resolved rather than when the
32
+ * image is drawn, and the bytes are what the rebuild stamp hashes, so replacing
33
+ * a logo at the same path re-renders everything drawn with it.
34
+ *
35
+ * PNG, JPEG, GIF, WebP and SVG are understood. Text inside an SVG is not
36
+ * rendered, because a nested document is drawn without the fonts the build
37
+ * loaded; convert it to paths first, or use a raster image.
38
+ */
39
+ export type ImageSource = {
40
+ /** Resolved from the working directory when relative. */
41
+ readonly path: string;
42
+ } | {
43
+ /**
44
+ * The image file's bytes. The format is read from them, so there is
45
+ * nothing to declare and nothing to get wrong.
46
+ */
47
+ readonly data: Uint8Array;
48
+ };
49
+ /** A wash of colour over a background image, so that text stays legible. */
50
+ export interface Scrim {
51
+ /** Defaults to black. */
52
+ readonly color?: string;
53
+ /** Opacity at the top edge. Defaults to `0.25`. */
54
+ readonly from?: number;
55
+ /** Opacity at the bottom edge. Defaults to `0.65`. */
56
+ readonly to?: number;
57
+ }
58
+ /**
59
+ * One soft blob of colour in a mesh background.
60
+ *
61
+ * The position is in fractions of the image, so the same mesh describes the
62
+ * same picture at every output size. The radius is a fraction of the longer
63
+ * side, which keeps a blob covering as much of a landscape image as it does of
64
+ * a square one.
65
+ */
66
+ export interface MeshBlob {
67
+ readonly color: string;
68
+ /** Centre, across. Defaults to the middle. */
69
+ readonly x?: number;
70
+ /** Centre, down. Defaults to the middle. */
71
+ readonly y?: number;
72
+ /** Defaults to `0.7`. */
73
+ readonly radius?: number;
74
+ /** Opacity at the centre, fading to nothing at the edge. Defaults to `1`. */
75
+ readonly opacity?: number;
76
+ }
77
+ /**
78
+ * Background fill for an image: a flat colour, a linear gradient, a mesh of
79
+ * soft colour, or a photo.
30
80
  *
31
81
  * Gradient coordinates use SVG object-bounding-box units (0–1); the default
32
82
  * runs diagonally from the top-left `(0, 0)` to the bottom-right `(1, 1)`.
@@ -45,10 +95,108 @@ export type Background = {
45
95
  readonly x: number;
46
96
  readonly y: number;
47
97
  };
98
+ } | {
99
+ /**
100
+ * Overlapping blobs of colour over a flat base, which is the look a
101
+ * linear gradient cannot give: colour that moves in more than one
102
+ * direction. Each blob is a radial fade, so nothing here is expensive to
103
+ * draw.
104
+ */
105
+ readonly type: "mesh";
106
+ /** The flat colour the blobs are laid over. */
107
+ readonly color: string;
108
+ readonly blobs: readonly MeshBlob[];
109
+ } | {
110
+ readonly type: "image";
111
+ readonly source: ImageSource;
112
+ /**
113
+ * `cover` fills the image and crops the overflow, which is what a photo
114
+ * behind a headline wants. `contain` fits the whole picture in and shows
115
+ * `color` in what is left over.
116
+ */
117
+ readonly fit?: "cover" | "contain";
118
+ /** Behind the image, and either side of a `contain` fit. */
119
+ readonly color?: string;
120
+ /**
121
+ * Defaults to a gentle shade towards the bottom. A photograph is light
122
+ * and dark wherever it likes, and white text over a bright sky cannot be
123
+ * read, so this is what makes the difference between a designed image and
124
+ * text sitting on a picture. Set `{ from: 0, to: 0 }` for none: `from`
125
+ * has a default of its own, so naming only `to` leaves the top shaded.
126
+ */
127
+ readonly scrim?: Scrim;
48
128
  };
129
+ /**
130
+ * A treatment laid over the background, under everything a template draws.
131
+ *
132
+ * A flat fill or a gradient is clean but a little bare, and these are the
133
+ * cheap ways to give one some surface: film grain, a dot grid, or ruled
134
+ * lines. All three are a few elements of SVG rather than an image to load,
135
+ * and all three are meant to be felt rather than seen, so the defaults are
136
+ * faint.
137
+ *
138
+ * Lengths are in pixels at the size being rendered, so a texture is a little
139
+ * finer on a large image than on a small one, which is what keeps a dot grid
140
+ * looking like the same grid across a set of sizes.
141
+ */
142
+ export type Texture = {
143
+ /**
144
+ * Film grain, from one turbulence filter. It lightens what is under it
145
+ * slightly, since the noise it lays down is grey.
146
+ */
147
+ readonly type: "grain";
148
+ /** Defaults to `0.1`. */
149
+ readonly opacity?: number;
150
+ /** Roughly the size of a speck, in pixels. Defaults to `1.4`. */
151
+ readonly scale?: number;
152
+ } | {
153
+ readonly type: "dots";
154
+ /** Defaults to the foreground colour. */
155
+ readonly color?: string;
156
+ /** Defaults to `0.08`. */
157
+ readonly opacity?: number;
158
+ /** Dot diameter. Defaults to `5`. */
159
+ readonly size?: number;
160
+ /** Centre-to-centre spacing. Defaults to `44`. */
161
+ readonly gap?: number;
162
+ } | {
163
+ readonly type: "rules";
164
+ /** Defaults to the foreground colour. */
165
+ readonly color?: string;
166
+ /** Defaults to `0.06`. */
167
+ readonly opacity?: number;
168
+ /** Line thickness. Defaults to `2`. */
169
+ readonly width?: number;
170
+ /** Spacing between lines. Defaults to `28`. */
171
+ readonly gap?: number;
172
+ /** Degrees clockwise from vertical. Defaults to `45`. */
173
+ readonly angle?: number;
174
+ };
175
+ /**
176
+ * A named preset: a palette, a background and, for some of them, a texture.
177
+ *
178
+ * Choosing colours from nothing is the step that stops someone trying a
179
+ * package, and a theme is the answer to it. Everything a theme sets is an
180
+ * ordinary config default, so naming `colors` or `background` alongside one
181
+ * keeps that field and takes the rest of the look.
182
+ */
183
+ export type ThemeName = "midnight" | "aurora" | "ember" | "forest" | "bloom" | "slate" | "paper" | "sandstone";
184
+ /**
185
+ * An image that has been loaded and is ready to draw: the `data:` URI a
186
+ * template hands to `image`, and the shape of the picture behind it.
187
+ */
188
+ export interface ImageAsset {
189
+ readonly href: string;
190
+ /**
191
+ * Width divided by height. `1` where the format is one whose dimensions
192
+ * cannot be read, so a template reserves a square and the picture sits
193
+ * inside it rather than being stretched.
194
+ */
195
+ readonly aspect: number;
196
+ }
49
197
  /**
50
198
  * Brand colours used to derive the default gradient and text colour. All are
51
- * configurable per project nothing here is tied to a specific site.
199
+ * configurable per project, and nothing here is tied to a specific site.
52
200
  */
53
201
  export interface BrandColors {
54
202
  readonly brand: string;
@@ -82,12 +230,6 @@ export interface CodeStyle {
82
230
  * installed one when `systemFonts` is on.
83
231
  */
84
232
  readonly fontFamily?: string;
85
- /**
86
- * Glyph advance width as a fraction of the font size. `0.6` matches most
87
- * monospace faces (Source Code Pro, Menlo, DejaVu Sans Mono); narrower faces
88
- * such as Consolas want ~`0.55`.
89
- */
90
- readonly charWidthRatio?: number;
91
233
  /** Line advance as a multiple of the font size. Default `1.55`. */
92
234
  readonly lineHeight?: number;
93
235
  /** Spaces a tab expands to before layout. Default `2`. */
@@ -97,8 +239,8 @@ export interface CodeStyle {
97
239
  /** Upper bound on the auto-fitted font size, as a fraction of image width. */
98
240
  readonly maxFontScale?: number;
99
241
  /**
100
- * Lower bound on the auto-fitted font size, as a fraction of image width
101
- * width, because that is what a feed scales a share image to. Code too long
242
+ * Lower bound on the auto-fitted font size, as a fraction of image width.
243
+ * Width, because that is what a feed scales a share image to. Code too long
102
244
  * to fit at this size is truncated with an ellipsis rather than shrunk into
103
245
  * illegibility, so raising this trades lines of code for readability and
104
246
  * lowering it does the reverse.
@@ -111,8 +253,8 @@ export interface CodeStyle {
111
253
  * the file itself, so a bold and a regular face are two entries, and the SVG's
112
254
  * `font-weight` picks between them.
113
255
  *
114
- * `family` is optional and does not affect matching the family name in the
115
- * font file does that. When given on the first font it seeds `fontFamily`,
256
+ * `family` is optional and does not affect matching, since the family name in
257
+ * the font file does that. When given on the first font it seeds `fontFamily`,
116
258
  * which saves repeating the name for the common single-font case.
117
259
  */
118
260
  export type FontSource = {
@@ -141,6 +283,18 @@ export interface MetaImageProps {
141
283
  readonly title?: string;
142
284
  readonly subtitle?: string;
143
285
  readonly version?: string | number;
286
+ /**
287
+ * An author photo, as a path to an image file or its `data:` URI. Named here
288
+ * with the other well-known props because the renderer has to load it before
289
+ * a template can draw it, which it cannot do for a prop it does not know.
290
+ */
291
+ readonly avatar?: string;
292
+ /**
293
+ * Corner badge for the `banner` template, overriding whatever the config or
294
+ * the size sets. `false` draws none, which is how one post opts out of a
295
+ * site-wide badge that does not describe it.
296
+ */
297
+ readonly badge?: Badge | false;
144
298
  readonly [key: string]: unknown;
145
299
  }
146
300
  /**
@@ -149,7 +303,7 @@ export interface MetaImageProps {
149
303
  *
150
304
  * Return `undefined` to leave a post without images. That is the filter for
151
305
  * drafts, section indexes and anything else in the tree that is not a page
152
- * worth sharing without it, mapping frontmatter would mean an image for every
306
+ * worth sharing. Without it, mapping frontmatter would mean an image for every
153
307
  * markdown file there is. It only settles posts that say nothing for
154
308
  * themselves, though: one declaring a props block is rendered either way, since
155
309
  * asking for an image outright beats a blanket rule.
@@ -160,7 +314,7 @@ export interface MetaImageProps {
160
314
  */
161
315
  export type PropsFromFrontmatter = (frontmatter: Record<string, unknown>) => Record<string, unknown> | undefined;
162
316
  /**
163
- * How a post's slug the base name for its images is derived from its path
317
+ * How a post's slug, the base name for its images, is derived from its path
164
318
  * when the frontmatter does not declare one.
165
319
  *
166
320
  * - `basename`: the filename without extension, or the parent directory for
@@ -173,10 +327,10 @@ export type SlugStrategy = "basename" | "route";
173
327
  /**
174
328
  * How to read image props out of a content tree. Every field is optional.
175
329
  *
176
- * This is the host-project half of the job finding posts and understanding
177
- * their frontmatter and is deliberately absent from {@link ResolvedConfig}:
178
- * a template is handed the resolved config, and where the props came from is
179
- * none of its business.
330
+ * This is the host-project half of the job, finding posts and understanding
331
+ * their frontmatter. It is deliberately absent from {@link ResolvedConfig},
332
+ * which is what a template is handed, and where the props came from is none of
333
+ * a template's business.
180
334
  */
181
335
  export interface ContentOptions {
182
336
  /** Frontmatter key holding the image props object. Default `meta_img_props`. */
@@ -225,14 +379,14 @@ export interface ContentFile {
225
379
  *
226
380
  * `outputPath` alone says where the bytes go and nothing about how anyone
227
381
  * reaches them, so every site ends up rebuilding that mapping in its own
228
- * templates from information Colophon had at generate time and threw away.
382
+ * templates, from information Colophon had at generate time and threw away.
229
383
  *
230
384
  * - `beside-content`: next to the post, which is the page-bundle convention
231
385
  * and what Colophon has always done. Still the default.
232
386
  * - `public-dir`: gathered into one directory, as Astro, Eleventy and Vite
233
387
  * expect. A slug carrying directories keeps them underneath it.
234
- * - `custom`: for a site whose mapping is its own images under a dated
235
- * directory, say.
388
+ * - `custom`: for a site whose mapping is its own, such as images under a
389
+ * dated directory.
236
390
  *
237
391
  * `urlBase` is what makes a URL: it is prefixed to the image's path under the
238
392
  * root that placed it, and without one there is no URL, because no directory
@@ -269,7 +423,7 @@ export type Placement = {
269
423
  * otherwise, and a size they later change leaves the tags behind.
270
424
  */
271
425
  export interface ManifestImage {
272
- /** Absent where the placement knows no URL see {@link Placement}. */
426
+ /** Absent where the placement knows no URL. See {@link Placement}. */
273
427
  readonly url?: string;
274
428
  readonly width: number;
275
429
  readonly height: number;
@@ -290,7 +444,7 @@ export interface ManifestPage {
290
444
  * What a build generated, for the site to read back: a JSON file listing every
291
445
  * page's images, their URLs and the dimensions they were rendered at.
292
446
  *
293
- * Without it a site reconstructs all of that in template code globbing for
447
+ * Without it a site reconstructs all of that in template code, globbing for
294
448
  * `*-og.png` to find the landscape variant, or writing image paths back into
295
449
  * each post's frontmatter. All of it is known while generating.
296
450
  *
@@ -307,7 +461,7 @@ export interface Manifest {
307
461
  *
308
462
  * Open Graph names its tags with `property` and Twitter with `name`, which is
309
463
  * a distinction sites get wrong routinely. Keeping them apart in the type
310
- * means a component can spread a tag `<meta {...tag} />` and be right
464
+ * means a component can spread a tag with `<meta {...tag} />` and be right
311
465
  * either way.
312
466
  */
313
467
  export type MetaTag = {
@@ -322,20 +476,49 @@ export interface MetaTagOptions {
322
476
  /**
323
477
  * Absolute base for a site-relative image URL, e.g. `https://example.com`.
324
478
  *
325
- * Open Graph wants an absolute URL a crawler has no page to resolve a
326
- * relative one against and a manifest records whatever the placement's
479
+ * Open Graph wants an absolute URL, since a crawler has no page to resolve a
480
+ * relative one against. A manifest records whatever the placement's
327
481
  * `urlBase` said, which is usually site-relative. A URL that is already
328
482
  * absolute is left alone, so a CDN base needs nothing here.
329
483
  */
330
484
  readonly baseUrl?: string;
331
485
  }
332
486
  /**
333
- * Reports something a template had to compromise on code truncated to stay
334
- * legible, so far. Rendering carries on regardless: a share image is worth
335
- * having even when the input did not quite fit, but the author should hear
336
- * about it rather than discover it in someone else's timeline.
487
+ * Reports something a template had to compromise on, so far only code
488
+ * truncated to stay legible. Rendering carries on regardless, since a share
489
+ * image is worth having even when the input did not quite fit, but the author
490
+ * should hear about it rather than discover it in someone else's timeline.
337
491
  */
338
492
  export type WarningHandler = (message: string) => void;
493
+ /**
494
+ * How a run of text is drawn, as far as its width is concerned. Style that
495
+ * cannot move a glyph's advance, such as colour, is not here.
496
+ */
497
+ export interface TextStyle {
498
+ /** CSS-style stack, matched against the configured fonts in order. */
499
+ readonly fontFamily: string;
500
+ readonly fontSize: number;
501
+ /** Defaults to `400`. The nearest weight in the family is measured. */
502
+ readonly fontWeight?: number;
503
+ /**
504
+ * Advance width to assume, as a fraction of the font size, when no
505
+ * configured font matches the stack and the width has to be guessed.
506
+ *
507
+ * The default suits proportional text. A caller drawing monospace passes its
508
+ * own, because the same guess would be far too narrow for a face whose every
509
+ * glyph is as wide as an `M`.
510
+ */
511
+ readonly fallbackRatio?: number;
512
+ }
513
+ /**
514
+ * The width, in pixels, that `text` occupies when drawn in `style`.
515
+ *
516
+ * Exact where the style resolves to a font the build loaded, since then the
517
+ * glyph advances are read from the file the rasteriser is drawing with.
518
+ * Estimated otherwise, which is the best there is when the text will be drawn
519
+ * in whichever font the machine happens to have.
520
+ */
521
+ export type MeasureText = (text: string, style: TextStyle) => number;
339
522
  /**
340
523
  * Everything a template needs to produce its SVG foreground content.
341
524
  */
@@ -343,15 +526,32 @@ export interface TemplateContext {
343
526
  readonly props: MetaImageProps;
344
527
  readonly config: ResolvedConfig;
345
528
  readonly dimensions: Dimensions;
529
+ /**
530
+ * Measures text in the fonts this build is rendering with, so a template can
531
+ * wrap and fit its text to the space it has rather than guessing.
532
+ */
533
+ readonly measure: MeasureText;
534
+ /**
535
+ * The configured logo, loaded and ready to draw, or `undefined` where there
536
+ * is none. Reading the file is the renderer's job rather than the template's,
537
+ * so that a template stays a synchronous function over values it was handed.
538
+ *
539
+ * Present and possibly undefined, as `footer` and `badge` are on a resolved
540
+ * config: a context is built once and handed over whole, and a field that is
541
+ * sometimes absent makes every construction of one a conditional.
542
+ */
543
+ readonly logo: ImageAsset | undefined;
544
+ /** The same for a post's `avatar` prop. */
545
+ readonly avatar: ImageAsset | undefined;
346
546
  }
347
547
  /**
348
548
  * A registered template. `render` returns the SVG *foreground* content (text,
349
549
  * badges, etc.) for the given dimensions; the background and the enclosing
350
550
  * `<svg>` root are added by the renderer.
351
551
  *
352
- * Rendering may be asynchronous the `code` template loads syntax grammars on
353
- * demand so `render` can return a promise. Simple templates can stay
354
- * synchronous and just return a string.
552
+ * Rendering may be asynchronous, since the `code` template loads syntax
553
+ * grammars on demand, so `render` can return a promise. Simple templates can
554
+ * stay synchronous and just return a string.
355
555
  */
356
556
  export interface Template {
357
557
  readonly name: string;
@@ -362,9 +562,20 @@ export interface Template {
362
562
  * by `resolveConfig`.
363
563
  */
364
564
  export interface ColophonConfig {
565
+ /**
566
+ * A named look to start from: see {@link ThemeName}. A theme supplies
567
+ * `colors`, `background` and sometimes `texture`, and any of those the
568
+ * config sets for itself wins.
569
+ */
570
+ readonly theme?: ThemeName;
365
571
  readonly colors?: BrandColors;
366
572
  /** Explicit background, overriding the gradient derived from `colors`. */
367
573
  readonly background?: Background;
574
+ /**
575
+ * A treatment over the background: grain, a dot grid or ruled lines. Omit
576
+ * (the default) for none, unless a theme brings one.
577
+ */
578
+ readonly texture?: Texture;
368
579
  /**
369
580
  * Fonts to load into the rasteriser, so the output does not depend on what
370
581
  * the build machine happens to have installed. Supplying any font turns
@@ -376,7 +587,7 @@ export interface ColophonConfig {
376
587
  * Whether to also load the machine's installed fonts. Defaults to `true`
377
588
  * when no `fonts` are configured (nothing else would render) and `false`
378
589
  * when they are. Turn it on alongside `fonts` to fall back to system fonts
379
- * for families you have not supplied at the cost of determinism.
590
+ * for families you have not supplied, at the cost of determinism.
380
591
  */
381
592
  readonly systemFonts?: boolean;
382
593
  /**
@@ -388,6 +599,12 @@ export interface ColophonConfig {
388
599
  readonly footer?: string;
389
600
  /** Corner badge for the `banner` template. Omit (the default) for none. */
390
601
  readonly badge?: Badge;
602
+ /**
603
+ * A logo to draw in the corner, which is most of what branding an image
604
+ * means. Where it goes is the template's business; how big it is comes from
605
+ * the image's own proportions and the size being drawn.
606
+ */
607
+ readonly logo?: ImageSource;
391
608
  /** Styling for the `code` template. */
392
609
  readonly code?: CodeStyle;
393
610
  /**
@@ -421,16 +638,16 @@ export interface ColophonConfig {
421
638
  */
422
639
  readonly manifest?: string;
423
640
  /**
424
- * One-off images that belong to the project rather than to any post a
425
- * package card, a repository social preview. Rendered by the same build, and
426
- * skipped or re-rendered on the same stamps.
641
+ * One-off images that belong to the project rather than to any post, such as
642
+ * a package card or a repository social preview. Rendered by the same build,
643
+ * and skipped or re-rendered on the same stamps.
427
644
  */
428
645
  readonly extra?: readonly ExtraImage[];
429
646
  }
430
647
  /**
431
648
  * A function a config module may export instead of a config object, so that a
432
- * config which has to compute something brand colours read out of the site's
433
- * own stylesheet, say — can still be a config module rather than a script.
649
+ * config which has to compute something, such as brand colours read out of the
650
+ * site's own stylesheet, can still be a config module rather than a script.
434
651
  *
435
652
  * It takes no arguments. Anything it might be handed is either already on the
436
653
  * command line or a decision the config itself is making.
@@ -449,20 +666,31 @@ export type ColophonConfigInput = ColophonConfig | ColophonConfigFactory;
449
666
  *
450
667
  * Only what a template reads while drawing is overridable. `fonts`,
451
668
  * `systemFonts` and `templates` are shared build inputs rather than part of the
452
- * picture; `onWarning` is where messages go, not what they say; and `sizes`
453
- * inside a size would be nonsense.
669
+ * picture. `onWarning` is where messages go rather than what they say, and
670
+ * `sizes` inside a size would be nonsense.
454
671
  */
455
672
  export interface SizeOverrides {
456
673
  /**
457
- * Merged over the config's `colors`, so a size can change one shade on its
458
- * own `brand` is optional here precisely because the rest are kept.
674
+ * Replaces the config's theme, for a size that wants a different look.
675
+ * Whatever the config names for itself still wins over it, exactly as it
676
+ * does over the config's own theme.
677
+ */
678
+ readonly theme?: ThemeName;
679
+ /**
680
+ * Merged over the config's `colors`, or over the theme's where the config
681
+ * names none, so a size can change one shade on its own. `brand` is optional
682
+ * here precisely because the rest are kept.
459
683
  */
460
684
  readonly colors?: Partial<BrandColors>;
461
- /** Replaces the config's background outright see the note on merging. */
685
+ /** Replaces the config's background outright. See the note on merging. */
462
686
  readonly background?: Background;
687
+ /** Replaces the config's texture. */
688
+ readonly texture?: Texture;
463
689
  readonly fontFamily?: string;
464
690
  readonly footer?: string;
465
691
  readonly badge?: Badge;
692
+ /** Replaces the config's logo, for a size that wants a different mark. */
693
+ readonly logo?: ImageSource;
466
694
  /** Merged over the config's `code`, so a size can change one setting. */
467
695
  readonly code?: CodeStyle;
468
696
  }
@@ -471,7 +699,7 @@ export interface SizeOverrides {
471
699
  * it, and the size to draw it at.
472
700
  *
473
701
  * The alternative is a script that calls `renderMetaImages` and writes the
474
- * bytes itself, which is a lot of machinery for one card and one that keeps
702
+ * bytes itself, which is a lot of machinery for one card, and which keeps
475
703
  * neither the rebuild stamps nor the build log a content image gets.
476
704
  */
477
705
  export interface ExtraImage {
@@ -483,7 +711,7 @@ export interface ExtraImage {
483
711
  */
484
712
  readonly output: string;
485
713
  /**
486
- * The size to render at, {@link SizeOverrides} and all an inline size is
714
+ * The size to render at, {@link SizeOverrides} and all. An inline size is
487
715
  * how a one-off image gets its own footer or palette without a whole entry
488
716
  * in `sizes`. Defaults to the first configured size, since a one-off card
489
717
  * usually wants to match the site's primary share format.
@@ -496,12 +724,19 @@ export interface ExtraImage {
496
724
  export interface ResolvedConfig {
497
725
  readonly colors: Required<BrandColors>;
498
726
  readonly background: Background;
727
+ /**
728
+ * The texture over the background, with any colour it left open filled in
729
+ * from the palette. There is no theme here: a theme is a set of defaults for
730
+ * these fields, and by this point they have been applied.
731
+ */
732
+ readonly texture: Texture | undefined;
499
733
  /** Configured fonts, with every `path` made absolute. */
500
734
  readonly fonts: readonly FontSource[];
501
735
  readonly systemFonts: boolean;
502
736
  readonly fontFamily: string;
503
737
  readonly footer: string | undefined;
504
738
  readonly badge: Badge | undefined;
739
+ readonly logo: ImageSource | undefined;
505
740
  readonly code: Required<CodeStyle>;
506
741
  readonly onWarning: WarningHandler;
507
742
  readonly sizes: readonly OutputSize[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CA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AAE,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Check a background against the keys of whichever variant it declares.
3
+ *
4
+ * A misspelt `type` is worth reporting on its own: `backgroundSvg` treats
5
+ * anything that is not one of the names it knows as a gradient, so `gradiant`
6
+ * silently becomes one and then falls over on the stops it does not have. A
7
+ * background with no `type` at all is left alone, since the type is what says
8
+ * which keys apply, and guessing would report the keys rather than the
9
+ * omission.
10
+ */
11
+ export declare function checkBackground(background: unknown, path: string, problems: string[]): void;
12
+ //# sourceMappingURL=background.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../src/validate/background.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,OAAO,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAAE,GACjB,IAAI,CA4CN"}
@@ -0,0 +1,53 @@
1
+ import { checkEach, checkKeys, isRecord } from "./check.js";
2
+ import { backgroundFits, backgroundTypes, gradientBackgroundKeys, gradientPointKeys, gradientStopKeys, imageBackgroundKeys, imageSourceKeys, meshBackgroundKeys, meshBlobKeys, scrimKeys, solidBackgroundKeys, } from "./keys.js";
3
+ import { describeUnknownValue } from "./values.js";
4
+ /** Check a background image's fit names one of the two there are. */
5
+ function checkFit(fit, problems) {
6
+ if (typeof fit !== "string" || backgroundFits.includes(fit)) {
7
+ return;
8
+ }
9
+ problems.push(describeUnknownValue("background fit", "fits", fit, backgroundFits));
10
+ }
11
+ /**
12
+ * Check a background against the keys of whichever variant it declares.
13
+ *
14
+ * A misspelt `type` is worth reporting on its own: `backgroundSvg` treats
15
+ * anything that is not one of the names it knows as a gradient, so `gradiant`
16
+ * silently becomes one and then falls over on the stops it does not have. A
17
+ * background with no `type` at all is left alone, since the type is what says
18
+ * which keys apply, and guessing would report the keys rather than the
19
+ * omission.
20
+ */
21
+ export function checkBackground(background, path, problems) {
22
+ if (!isRecord(background)) {
23
+ return;
24
+ }
25
+ const { type, stops, from, to } = background;
26
+ if (type === "solid") {
27
+ checkKeys(background, path, solidBackgroundKeys, problems);
28
+ return;
29
+ }
30
+ if (type === "image") {
31
+ checkKeys(background, path, imageBackgroundKeys, problems);
32
+ checkKeys(background["source"], `${path}.source`, imageSourceKeys, problems);
33
+ checkKeys(background["scrim"], `${path}.scrim`, scrimKeys, problems);
34
+ checkFit(background["fit"], problems);
35
+ return;
36
+ }
37
+ if (type === "mesh") {
38
+ checkKeys(background, path, meshBackgroundKeys, problems);
39
+ checkEach(background["blobs"], `${path}.blobs`, meshBlobKeys, problems);
40
+ return;
41
+ }
42
+ if (type === "gradient") {
43
+ checkKeys(background, path, gradientBackgroundKeys, problems);
44
+ checkEach(stops, `${path}.stops`, gradientStopKeys, problems);
45
+ checkKeys(from, `${path}.from`, gradientPointKeys, problems);
46
+ checkKeys(to, `${path}.to`, gradientPointKeys, problems);
47
+ return;
48
+ }
49
+ if (typeof type === "string") {
50
+ problems.push(describeUnknownValue("background type", "types", type, backgroundTypes));
51
+ }
52
+ }
53
+ //# sourceMappingURL=background.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background.js","sourceRoot":"","sources":["../../src/validate/background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,qEAAqE;AACrE,SAAS,QAAQ,CAAC,GAAY,EAAE,QAAkB;IAChD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC,CACpE,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAmB,EACnB,IAAY,EACZ,QAAkB;IAElB,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,UAAU,CAAC;IAE7C,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,mBAAmB,EAAE,QA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I,EAAE,eAAe,CAAC,CACxE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ColophonConfig } from "../types.js";
2
+ /**
3
+ * Everything wrong with a config, in the order the config declares it.
4
+ *
5
+ * Collecting rather than throwing at the first problem is the point: a config
6
+ * with three typos in it should take one run to fix rather than three.
7
+ */
8
+ export declare function collectProblems(config: ColophonConfig): string[];
9
+ //# sourceMappingURL=collect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect.d.ts","sourceRoot":"","sources":["../../src/validate/collect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAiBlD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAkChE"}