@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.
- package/README.md +107 -798
- package/dist/background/gradient.d.ts +12 -0
- package/dist/background/gradient.d.ts.map +1 -0
- package/dist/background/gradient.js +21 -0
- package/dist/background/gradient.js.map +1 -0
- package/dist/background/image.d.ts +14 -0
- package/dist/background/image.d.ts.map +1 -0
- package/dist/background/image.js +36 -0
- package/dist/background/image.js.map +1 -0
- package/dist/background/index.d.ts +13 -0
- package/dist/background/index.d.ts.map +1 -0
- package/dist/background/index.js +27 -0
- package/dist/background/index.js.map +1 -0
- package/dist/background/mesh.d.ts +12 -0
- package/dist/background/mesh.d.ts.map +1 -0
- package/dist/background/mesh.js +43 -0
- package/dist/background/mesh.js.map +1 -0
- package/dist/background.d.ts +7 -2
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +44 -1
- package/dist/background.js.map +1 -1
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/config.d.ts +1 -1
- package/dist/cli/config.js +1 -1
- package/dist/config/defaults.d.ts +8 -7
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +8 -8
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +14 -5
- package/dist/config/index.js.map +1 -1
- package/dist/config/resolve.d.ts +7 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +16 -0
- package/dist/config/resolve.js.map +1 -1
- package/dist/config/size.d.ts +7 -1
- package/dist/config/size.d.ts.map +1 -1
- package/dist/config/size.js +22 -9
- package/dist/config/size.js.map +1 -1
- package/dist/content/props.d.ts +2 -2
- package/dist/content/props.js +2 -2
- package/dist/content/slug.d.ts +5 -5
- package/dist/content/slug.js +6 -6
- package/dist/content/slug.js.map +1 -1
- package/dist/content/walk.d.ts +1 -1
- package/dist/content/walk.js +1 -1
- package/dist/fonts/index.d.ts +3 -2
- package/dist/fonts/index.d.ts.map +1 -1
- package/dist/fonts/index.js +3 -2
- package/dist/fonts/index.js.map +1 -1
- package/dist/fonts/resolve.js +1 -1
- package/dist/generate/extra.js +4 -4
- package/dist/generate/extra.js.map +1 -1
- package/dist/generate/options.d.ts +1 -1
- package/dist/generate/outputs.d.ts +4 -4
- package/dist/generate/outputs.js +4 -4
- package/dist/highlight/language.d.ts +2 -3
- package/dist/highlight/language.d.ts.map +1 -1
- package/dist/highlight/language.js +3 -4
- package/dist/highlight/language.js.map +1 -1
- package/dist/highlight/normalise.d.ts +2 -2
- package/dist/highlight/normalise.js +2 -2
- package/dist/image/index.d.ts +18 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/index.js +42 -0
- package/dist/image/index.js.map +1 -0
- package/dist/image/jpeg.d.ts +10 -0
- package/dist/image/jpeg.d.ts.map +1 -0
- package/dist/image/jpeg.js +57 -0
- package/dist/image/jpeg.js.map +1 -0
- package/dist/image/load.d.ts +4 -0
- package/dist/image/load.d.ts.map +1 -0
- package/dist/image/load.js +60 -0
- package/dist/image/load.js.map +1 -0
- package/dist/image/media.d.ts +10 -0
- package/dist/image/media.d.ts.map +1 -0
- package/dist/image/media.js +37 -0
- package/dist/image/media.js.map +1 -0
- package/dist/image/resolve.d.ts +13 -0
- package/dist/image/resolve.d.ts.map +1 -0
- package/dist/image/resolve.js +38 -0
- package/dist/image/resolve.js.map +1 -0
- package/dist/image/size.d.ts +22 -0
- package/dist/image/size.d.ts.map +1 -0
- package/dist/image/size.js +60 -0
- package/dist/image/size.js.map +1 -0
- package/dist/image/svg.d.ts +12 -0
- package/dist/image/svg.d.ts.map +1 -0
- package/dist/image/svg.js +61 -0
- package/dist/image/svg.js.map +1 -0
- package/dist/image/uri.d.ts +9 -0
- package/dist/image/uri.d.ts.map +1 -0
- package/dist/image/uri.js +22 -0
- package/dist/image/uri.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/block.d.ts +37 -0
- package/dist/layout/block.d.ts.map +1 -0
- package/dist/layout/block.js +26 -0
- package/dist/layout/block.js.map +1 -0
- package/dist/layout/box.d.ts +20 -0
- package/dist/layout/box.d.ts.map +1 -0
- package/dist/layout/box.js +61 -0
- package/dist/layout/box.js.map +1 -0
- package/dist/layout/distribute.d.ts +15 -0
- package/dist/layout/distribute.d.ts.map +1 -0
- package/dist/layout/distribute.js +30 -0
- package/dist/layout/distribute.js.map +1 -0
- package/dist/layout/image.d.ts +42 -0
- package/dist/layout/image.d.ts.map +1 -0
- package/dist/layout/image.js +34 -0
- package/dist/layout/image.js.map +1 -0
- package/dist/layout/index.d.ts +40 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +30 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/lines.d.ts +45 -0
- package/dist/layout/lines.d.ts.map +1 -0
- package/dist/layout/lines.js +71 -0
- package/dist/layout/lines.js.map +1 -0
- package/dist/layout/measure.d.ts +11 -0
- package/dist/layout/measure.d.ts.map +1 -0
- package/dist/layout/measure.js +11 -0
- package/dist/layout/measure.js.map +1 -0
- package/dist/layout/panel.d.ts +20 -0
- package/dist/layout/panel.d.ts.map +1 -0
- package/dist/layout/panel.js +22 -0
- package/dist/layout/panel.js.map +1 -0
- package/dist/layout/row.d.ts +15 -0
- package/dist/layout/row.d.ts.map +1 -0
- package/dist/layout/row.js +20 -0
- package/dist/layout/row.js.map +1 -0
- package/dist/layout/scrim.d.ts +23 -0
- package/dist/layout/scrim.d.ts.map +1 -0
- package/dist/layout/scrim.js +38 -0
- package/dist/layout/scrim.js.map +1 -0
- package/dist/layout/stack.d.ts +14 -0
- package/dist/layout/stack.d.ts.map +1 -0
- package/dist/layout/stack.js +19 -0
- package/dist/layout/stack.js.map +1 -0
- package/dist/layout/types.d.ts +49 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/types.js +2 -0
- package/dist/layout/types.js.map +1 -0
- package/dist/manifest/build.d.ts +1 -1
- package/dist/manifest/build.js +1 -1
- package/dist/manifest/index.d.ts +1 -1
- package/dist/manifest/index.js +1 -1
- package/dist/manifest/order.d.ts +1 -1
- package/dist/manifest/order.js +1 -1
- package/dist/manifest/page.d.ts +2 -2
- package/dist/manifest/page.js +3 -3
- package/dist/measure/estimate.d.ts +10 -0
- package/dist/measure/estimate.d.ts.map +1 -0
- package/dist/measure/estimate.js +58 -0
- package/dist/measure/estimate.js.map +1 -0
- package/dist/measure/faces.d.ts +15 -0
- package/dist/measure/faces.d.ts.map +1 -0
- package/dist/measure/faces.js +70 -0
- package/dist/measure/faces.js.map +1 -0
- package/dist/measure/index.d.ts +16 -0
- package/dist/measure/index.d.ts.map +1 -0
- package/dist/measure/index.js +0 -0
- package/dist/measure/index.js.map +1 -0
- package/dist/measure/runs.d.ts +17 -0
- package/dist/measure/runs.d.ts.map +1 -0
- package/dist/measure/runs.js +39 -0
- package/dist/measure/runs.js.map +1 -0
- package/dist/measure/select.d.ts +13 -0
- package/dist/measure/select.d.ts.map +1 -0
- package/dist/measure/select.js +47 -0
- package/dist/measure/select.js.map +1 -0
- package/dist/meta/tags.d.ts +6 -6
- package/dist/meta/tags.js +6 -6
- package/dist/meta/url.d.ts +4 -4
- package/dist/meta/url.js +4 -4
- package/dist/placement/check.d.ts +1 -1
- package/dist/placement/check.js +1 -1
- package/dist/placement/index.js +1 -1
- package/dist/placement/relative.d.ts +3 -3
- package/dist/placement/relative.js +3 -3
- package/dist/pool.d.ts +2 -2
- package/dist/pool.js +3 -3
- package/dist/pool.js.map +1 -1
- package/dist/props.d.ts +7 -0
- package/dist/props.d.ts.map +1 -0
- package/dist/props.js +17 -0
- package/dist/props.js.map +1 -0
- package/dist/render/svg.d.ts +4 -2
- package/dist/render/svg.d.ts.map +1 -1
- package/dist/render/svg.js +28 -6
- package/dist/render/svg.js.map +1 -1
- package/dist/stamp/config-digest.d.ts.map +1 -1
- package/dist/stamp/config-digest.js +21 -1
- package/dist/stamp/config-digest.js.map +1 -1
- package/dist/stamp/index.js +2 -2
- package/dist/stamp/index.js.map +1 -1
- package/dist/stamp/read.d.ts +1 -1
- package/dist/stamp/read.js +4 -4
- package/dist/templates/attribution.d.ts +17 -0
- package/dist/templates/attribution.d.ts.map +1 -0
- package/dist/templates/attribution.js +39 -0
- package/dist/templates/attribution.js.map +1 -0
- package/dist/templates/banner/badge-props.d.ts +16 -0
- package/dist/templates/banner/badge-props.d.ts.map +1 -0
- package/dist/templates/banner/badge-props.js +58 -0
- package/dist/templates/banner/badge-props.js.map +1 -0
- package/dist/templates/banner/badge.d.ts.map +1 -1
- package/dist/templates/banner/badge.js +3 -6
- package/dist/templates/banner/badge.js.map +1 -1
- package/dist/templates/banner/index.d.ts +3 -0
- package/dist/templates/banner/index.d.ts.map +1 -1
- package/dist/templates/banner/index.js +41 -37
- package/dist/templates/banner/index.js.map +1 -1
- package/dist/templates/banner/lines.d.ts +7 -12
- package/dist/templates/banner/lines.d.ts.map +1 -1
- package/dist/templates/banner/lines.js +23 -34
- package/dist/templates/banner/lines.js.map +1 -1
- package/dist/templates/banner/version.d.ts +9 -0
- package/dist/templates/banner/version.d.ts.map +1 -0
- package/dist/templates/banner/version.js +21 -0
- package/dist/templates/banner/version.js.map +1 -0
- package/dist/templates/card/index.d.ts +4 -1
- package/dist/templates/card/index.d.ts.map +1 -1
- package/dist/templates/card/index.js +37 -25
- package/dist/templates/card/index.js.map +1 -1
- package/dist/templates/card/lines.d.ts +17 -13
- package/dist/templates/card/lines.d.ts.map +1 -1
- package/dist/templates/card/lines.js +24 -20
- package/dist/templates/card/lines.js.map +1 -1
- package/dist/templates/code/chrome.d.ts +7 -3
- package/dist/templates/code/chrome.d.ts.map +1 -1
- package/dist/templates/code/chrome.js +12 -11
- package/dist/templates/code/chrome.js.map +1 -1
- package/dist/templates/code/clip.d.ts +1 -1
- package/dist/templates/code/clip.js +1 -1
- package/dist/templates/code/fit.d.ts +2 -2
- package/dist/templates/code/fit.d.ts.map +1 -1
- package/dist/templates/code/fit.js +4 -4
- package/dist/templates/code/fit.js.map +1 -1
- package/dist/templates/code/index.d.ts.map +1 -1
- package/dist/templates/code/index.js +7 -6
- package/dist/templates/code/index.js.map +1 -1
- package/dist/templates/code/layout.d.ts +1 -1
- package/dist/templates/code/layout.d.ts.map +1 -1
- package/dist/templates/code/layout.js +6 -6
- package/dist/templates/code/layout.js.map +1 -1
- package/dist/templates/code/panel.d.ts +13 -0
- package/dist/templates/code/panel.d.ts.map +1 -1
- package/dist/templates/code/panel.js +34 -2
- package/dist/templates/code/panel.js.map +1 -1
- package/dist/templates/code/plate.d.ts +3 -1
- package/dist/templates/code/plate.d.ts.map +1 -1
- package/dist/templates/code/plate.js +11 -9
- package/dist/templates/code/plate.js.map +1 -1
- package/dist/templates/code/spans.js +1 -1
- package/dist/templates/code/spans.js.map +1 -1
- package/dist/templates/code/width.d.ts +10 -0
- package/dist/templates/code/width.d.ts.map +1 -0
- package/dist/templates/code/width.js +26 -0
- package/dist/templates/code/width.js.map +1 -0
- package/dist/templates/footer.d.ts +8 -0
- package/dist/templates/footer.d.ts.map +1 -1
- package/dist/templates/footer.js +11 -1
- package/dist/templates/footer.js.map +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/logo.d.ts +15 -0
- package/dist/templates/logo.d.ts.map +1 -0
- package/dist/templates/logo.js +30 -0
- package/dist/templates/logo.js.map +1 -0
- package/dist/templates/measure.d.ts +11 -0
- package/dist/templates/measure.d.ts.map +1 -0
- package/dist/templates/measure.js +11 -0
- package/dist/templates/measure.js.map +1 -0
- package/dist/templates/props.d.ts +2 -2
- package/dist/templates/props.js +2 -2
- package/dist/templates/text.d.ts +37 -0
- package/dist/templates/text.d.ts.map +1 -0
- package/dist/templates/text.js +26 -0
- package/dist/templates/text.js.map +1 -0
- package/dist/text/break.d.ts +11 -0
- package/dist/text/break.d.ts.map +1 -0
- package/dist/text/break.js +30 -0
- package/dist/text/break.js.map +1 -0
- package/dist/text/fit.d.ts +30 -0
- package/dist/text/fit.d.ts.map +1 -0
- package/dist/text/fit.js +29 -0
- package/dist/text/fit.js.map +1 -0
- package/dist/text/index.d.ts +5 -3
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +3 -2
- package/dist/text/index.js.map +1 -1
- package/dist/text/wrap.d.ts +17 -7
- package/dist/text/wrap.d.ts.map +1 -1
- package/dist/text/wrap.js +25 -17
- package/dist/text/wrap.js.map +1 -1
- package/dist/texture/grain.d.ts +17 -0
- package/dist/texture/grain.d.ts.map +1 -0
- package/dist/texture/grain.js +29 -0
- package/dist/texture/grain.js.map +1 -0
- package/dist/texture/index.d.ts +11 -0
- package/dist/texture/index.d.ts.map +1 -0
- package/dist/texture/index.js +20 -0
- package/dist/texture/index.js.map +1 -0
- package/dist/texture/pattern.d.ts +17 -0
- package/dist/texture/pattern.d.ts.map +1 -0
- package/dist/texture/pattern.js +45 -0
- package/dist/texture/pattern.js.map +1 -0
- package/dist/texture/resolve.d.ts +16 -0
- package/dist/texture/resolve.d.ts.map +1 -0
- package/dist/texture/resolve.js +20 -0
- package/dist/texture/resolve.js.map +1 -0
- package/dist/theme/index.d.ts +27 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +41 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/presets.d.ts +38 -0
- package/dist/theme/presets.d.ts.map +1 -0
- package/dist/theme/presets.js +150 -0
- package/dist/theme/presets.js.map +1 -0
- package/dist/types.d.ts +281 -46
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/background.d.ts +12 -0
- package/dist/validate/background.d.ts.map +1 -0
- package/dist/validate/background.js +53 -0
- package/dist/validate/background.js.map +1 -0
- package/dist/validate/collect.d.ts +9 -0
- package/dist/validate/collect.d.ts.map +1 -0
- package/dist/validate/collect.js +34 -0
- package/dist/validate/collect.js.map +1 -0
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +3 -20
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/keys.d.ts +35 -2
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +92 -3
- package/dist/validate/keys.js.map +1 -1
- package/dist/validate/overrides.d.ts.map +1 -1
- package/dist/validate/overrides.js +5 -1
- package/dist/validate/overrides.js.map +1 -1
- package/dist/validate/suggest.d.ts.map +1 -1
- package/dist/validate/suggest.js +21 -3
- package/dist/validate/suggest.js.map +1 -1
- package/dist/validate/texture.d.ts +11 -0
- package/dist/validate/texture.d.ts.map +1 -0
- package/dist/validate/texture.js +34 -0
- package/dist/validate/texture.js.map +1 -0
- package/dist/validate/values.d.ts +10 -10
- package/dist/validate/values.d.ts.map +1 -1
- package/dist/validate/values.js +21 -31
- package/dist/validate/values.js.map +1 -1
- package/package.json +7 -1
package/dist/placement/check.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* JavaScript with nothing checking it, and none of these omissions fails
|
|
6
6
|
* anywhere near the config: a missing `dir` surfaces as a complaint about an
|
|
7
7
|
* argument to `path`, and the rest as something not being a function. Key
|
|
8
|
-
* validation is no help either
|
|
8
|
+
* validation is no help either, since it is the option that is not there.
|
|
9
9
|
*
|
|
10
10
|
* This sits here rather than in `validate/`, which checks keys and the names
|
|
11
11
|
* of closed sets, for the reason `fonts/resolve.ts` does: what a value has to
|
package/dist/placement/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { besideContent, imageName } from "./relative.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Prefix a `urlBase` onto an image's path under the root that placed it.
|
|
7
7
|
*
|
|
8
|
-
* No base, no URL: a directory on disk does not say how
|
|
8
|
+
* No base, no URL: a directory on disk does not say how, or whether, it is
|
|
9
9
|
* served, and a URL Colophon invented would be worse than the gap it fills,
|
|
10
10
|
* since the whole point of writing one down is that a site can trust it.
|
|
11
11
|
*/
|
|
@@ -5,9 +5,9 @@ import type { ContentFile, OutputSize } from "../types.js";
|
|
|
5
5
|
* carries the post's keywords, and the size name keeps every image of a post
|
|
6
6
|
* distinct (`my-post-og.png`, `my-post-square.png`).
|
|
7
7
|
*
|
|
8
|
-
* A slug carrying directories of its own
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* A slug carrying directories of its own puts them in the name, so the image's
|
|
9
|
+
* path mirrors the route wherever it is placed. That is what the `route`
|
|
10
|
+
* strategy produces, and what a frontmatter `slug` of `docs/intro` means.
|
|
11
11
|
*
|
|
12
12
|
* The digest is the image's rebuild stamp: the props, the config and the size
|
|
13
13
|
* it is drawn from. Hashing the rendered bytes would be a truer name, but they
|
|
@@ -13,9 +13,9 @@ const hashLength = 8;
|
|
|
13
13
|
* carries the post's keywords, and the size name keeps every image of a post
|
|
14
14
|
* distinct (`my-post-og.png`, `my-post-square.png`).
|
|
15
15
|
*
|
|
16
|
-
* A slug carrying directories of its own
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* A slug carrying directories of its own puts them in the name, so the image's
|
|
17
|
+
* path mirrors the route wherever it is placed. That is what the `route`
|
|
18
|
+
* strategy produces, and what a frontmatter `slug` of `docs/intro` means.
|
|
19
19
|
*
|
|
20
20
|
* The digest is the image's rebuild stamp: the props, the config and the size
|
|
21
21
|
* it is drawn from. Hashing the rendered bytes would be a truer name, but they
|
package/dist/pool.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* flight stays bounded however large the input is.
|
|
10
10
|
*
|
|
11
11
|
* The first rejection propagates, as it would from `Promise.all`. Items
|
|
12
|
-
* already in flight run to completion
|
|
13
|
-
* no further ones are started.
|
|
12
|
+
* already in flight run to completion, since there is no cancelling a render,
|
|
13
|
+
* but no further ones are started.
|
|
14
14
|
*
|
|
15
15
|
* Throws if `limit` is not a positive integer.
|
|
16
16
|
*/
|
package/dist/pool.js
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* flight stays bounded however large the input is.
|
|
10
10
|
*
|
|
11
11
|
* The first rejection propagates, as it would from `Promise.all`. Items
|
|
12
|
-
* already in flight run to completion
|
|
13
|
-
* no further ones are started.
|
|
12
|
+
* already in flight run to completion, since there is no cancelling a render,
|
|
13
|
+
* but no further ones are started.
|
|
14
14
|
*
|
|
15
15
|
* Throws if `limit` is not a positive integer.
|
|
16
16
|
*/
|
|
17
17
|
export async function mapConcurrent(items, limit, worker) {
|
|
18
18
|
// A limit below one starts no workers at all, and an empty `Promise.all`
|
|
19
|
-
// resolves happily
|
|
19
|
+
// resolves happily, so the caller would get an empty result back as though
|
|
20
20
|
// there had been nothing to do. A build reporting success having rendered
|
|
21
21
|
// nothing is the failure worth being loud about.
|
|
22
22
|
if (!Number.isSafeInteger(limit) || limit < 1) {
|
package/dist/pool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.js","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAsB,EACtB,KAAa,EACb,MAAsD;IAEtD,yEAAyE;IACzE,
|
|
1
|
+
{"version":3,"file":"pool.js","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAsB,EACtB,KAAa,EACb,MAAsD;IAEtD,yEAAyE;IACzE,2EAA2E;IAC3E,0EAA0E;IAC1E,iDAAiD;IACjD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CACb,6BAA6B,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAC3E,CAAC;IACJ,CAAC;IAED,4EAA4E;IAC5E,kCAAkC;IAClC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,6EAA6E;IAC7E,4EAA4E;IAC5E,YAAY;IACZ,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC;IAC9B,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,KAAK,UAAU,GAAG;QAChB,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;YAClC,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO;YACT,CAAC;YACD,wEAAwE;YACxE,oEAAoE;YACpE,4CAA4C;YAC5C,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CACzE,GAAG,EAAE,CACN,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,yEAAyE;QACzE,qEAAqE;QACrE,SAAS,GAAG,IAAI,CAAC;QACjB,MAAM,KAAK,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/props.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a prop as a string, coercing the scalar types YAML frontmatter yields
|
|
3
|
+
* (numbers, booleans) and returning `undefined` for anything else, since
|
|
4
|
+
* templates treat "not a usable string" and "absent" the same way.
|
|
5
|
+
*/
|
|
6
|
+
export declare function optionalString(value: unknown): string | undefined;
|
|
7
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcjE"}
|
package/dist/props.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a prop as a string, coercing the scalar types YAML frontmatter yields
|
|
3
|
+
* (numbers, booleans) and returning `undefined` for anything else, since
|
|
4
|
+
* templates treat "not a usable string" and "absent" the same way.
|
|
5
|
+
*/
|
|
6
|
+
export function optionalString(value) {
|
|
7
|
+
if (typeof value === "string") {
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
if (typeof value === "number" ||
|
|
11
|
+
typeof value === "boolean" ||
|
|
12
|
+
typeof value === "bigint") {
|
|
13
|
+
return String(value);
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/render/svg.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ import type { Dimensions, MetaImageProps, ResolvedConfig } from "../types.js";
|
|
|
3
3
|
* Build the complete SVG document for one image: the enclosing `<svg>` root,
|
|
4
4
|
* the config-driven background, and the template's foreground content.
|
|
5
5
|
*
|
|
6
|
-
* Asynchronous because a template may need to load resources
|
|
7
|
-
* template fetches syntax grammars and themes on demand
|
|
6
|
+
* Asynchronous because a template may need to load resources. The `code`
|
|
7
|
+
* template fetches syntax grammars and themes on demand, the fonts the text is
|
|
8
|
+
* measured against have to be read before a template can lay it out, and so do
|
|
9
|
+
* the logo, the avatar and any background photo.
|
|
8
10
|
*/
|
|
9
11
|
export declare function buildSvg(props: MetaImageProps, config: ResolvedConfig, dimensions: Dimensions): Promise<string>;
|
|
10
12
|
//# sourceMappingURL=svg.d.ts.map
|
package/dist/render/svg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM9E;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,MAAM,CAAC,CAkCjB"}
|
package/dist/render/svg.js
CHANGED
|
@@ -1,20 +1,42 @@
|
|
|
1
|
-
import { backgroundSvg } from "../background.js";
|
|
1
|
+
import { backgroundSvg } from "../background/index.js";
|
|
2
|
+
import { loadImages } from "../image/index.js";
|
|
3
|
+
import { createMeasurer } from "../measure/index.js";
|
|
4
|
+
import { textureSvg } from "../texture/index.js";
|
|
2
5
|
import { selectTemplate } from "./template.js";
|
|
3
6
|
const backgroundId = "colophon-bg";
|
|
7
|
+
const textureId = "colophon-texture";
|
|
4
8
|
/**
|
|
5
9
|
* Build the complete SVG document for one image: the enclosing `<svg>` root,
|
|
6
10
|
* the config-driven background, and the template's foreground content.
|
|
7
11
|
*
|
|
8
|
-
* Asynchronous because a template may need to load resources
|
|
9
|
-
* template fetches syntax grammars and themes on demand
|
|
12
|
+
* Asynchronous because a template may need to load resources. The `code`
|
|
13
|
+
* template fetches syntax grammars and themes on demand, the fonts the text is
|
|
14
|
+
* measured against have to be read before a template can lay it out, and so do
|
|
15
|
+
* the logo, the avatar and any background photo.
|
|
10
16
|
*/
|
|
11
17
|
export async function buildSvg(props, config, dimensions) {
|
|
12
18
|
const template = selectTemplate(config, props.template);
|
|
13
|
-
const
|
|
14
|
-
|
|
19
|
+
const [measure, images] = await Promise.all([
|
|
20
|
+
createMeasurer(config),
|
|
21
|
+
loadImages(config, props),
|
|
22
|
+
]);
|
|
23
|
+
const background = backgroundSvg(config.background, dimensions, backgroundId, images.background);
|
|
24
|
+
// Over the background and under the template, so that a treatment gives the
|
|
25
|
+
// background some surface without ever coming between text and reader.
|
|
26
|
+
const texture = config.texture === undefined
|
|
27
|
+
? ""
|
|
28
|
+
: textureSvg(config.texture, dimensions, textureId);
|
|
29
|
+
const body = await template.render({
|
|
30
|
+
props,
|
|
31
|
+
config,
|
|
32
|
+
dimensions,
|
|
33
|
+
measure,
|
|
34
|
+
logo: images.logo,
|
|
35
|
+
avatar: images.avatar,
|
|
36
|
+
});
|
|
15
37
|
const { width, height } = dimensions;
|
|
16
38
|
return (`<svg width="${String(width)}" height="${String(height)}"` +
|
|
17
39
|
` viewBox="0 0 ${String(width)} ${String(height)}"` +
|
|
18
|
-
` xmlns="http://www.w3.org/2000/svg">${background}${body}</svg>`);
|
|
40
|
+
` xmlns="http://www.w3.org/2000/svg">${background}${texture}${body}</svg>`);
|
|
19
41
|
}
|
|
20
42
|
//# sourceMappingURL=svg.js.map
|
package/dist/render/svg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"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MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IAErC,OAAO,CACL,eAAe,MAAM,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,GAAG;QAC1D,iBAAiB,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG;QACnD,uCAAuC,UAAU,GAAG,OAAO,GAAG,IAAI,QAAQ,CAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-digest.d.ts","sourceRoot":"","sources":["../../src/stamp/config-digest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"config-digest.d.ts","sourceRoot":"","sources":["../../src/stamp/config-digest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,cAAc,EACf,MAAM,aAAa,CAAC;AA6CrB;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsB1E"}
|
|
@@ -18,6 +18,23 @@ async function fontDigest(font) {
|
|
|
18
18
|
const bytes = "data" in font ? font.data : await readFile(font.path);
|
|
19
19
|
return sha256(stableStringify({ family: font.family, bytes: sha256(bytes) }));
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Digest an image by its contents, for the reason a font is digested that way:
|
|
23
|
+
* a logo replaced at the same path is a different logo, and every image drawn
|
|
24
|
+
* with it wants rendering again.
|
|
25
|
+
*/
|
|
26
|
+
async function imageDigest(source) {
|
|
27
|
+
return sha256("data" in source ? source.data : await readFile(source.path));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A background, with any image it draws replaced by a digest of that image's
|
|
31
|
+
* bytes. Everything else about a background is already a value.
|
|
32
|
+
*/
|
|
33
|
+
async function backgroundDigest(background) {
|
|
34
|
+
return background.type === "image"
|
|
35
|
+
? { ...background, source: await imageDigest(background.source) }
|
|
36
|
+
: background;
|
|
37
|
+
}
|
|
21
38
|
/**
|
|
22
39
|
* Digest the config fields that affect what an image looks like.
|
|
23
40
|
*
|
|
@@ -28,11 +45,14 @@ async function fontDigest(font) {
|
|
|
28
45
|
*/
|
|
29
46
|
export async function configDigest(config) {
|
|
30
47
|
const fonts = await Promise.all(config.fonts.map(async (font) => fontDigest(font)));
|
|
48
|
+
const logo = config.logo === undefined ? undefined : await imageDigest(config.logo);
|
|
31
49
|
return sha256(stableStringify({
|
|
32
50
|
version: await packageVersion(),
|
|
33
51
|
colors: config.colors,
|
|
34
|
-
background: config.background,
|
|
52
|
+
background: await backgroundDigest(config.background),
|
|
53
|
+
texture: config.texture,
|
|
35
54
|
fonts,
|
|
55
|
+
logo,
|
|
36
56
|
systemFonts: config.systemFonts,
|
|
37
57
|
fontFamily: config.fontFamily,
|
|
38
58
|
footer: config.footer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-digest.js","sourceRoot":"","sources":["../../src/stamp/config-digest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-digest.js","sourceRoot":"","sources":["../../src/stamp/config-digest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAQ5C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;GAKG;AACH,KAAK,UAAU,cAAc;IAC3B,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAC7B,IAAI,GAAG,CAAC,oBAAoB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAC9C,MAAM,CACP,CAAC;IACF,OAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAyB,CAAC,OAAO,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,UAAU,CAAC,IAAgB;IACxC,MAAM,KAAK,GAAG,MAAM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gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC;QACrD,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,KAAK;QACL,IAAI;QACJ,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/stamp/index.js
CHANGED
|
@@ -12,8 +12,8 @@ export async function createStamper(config) {
|
|
|
12
12
|
// A custom template is config the project controls, so its source counts as
|
|
13
13
|
// part of the input. Built-in templates are covered by the package version.
|
|
14
14
|
// Source text is all there is to go on: a template that reads something its
|
|
15
|
-
// own code does not name
|
|
16
|
-
// the stamp noticing, and needs `overwrite` to pick it up.
|
|
15
|
+
// own code does not name, such as a closed-over value or a file it loads,
|
|
16
|
+
// can change without the stamp noticing, and needs `overwrite` to pick it up.
|
|
17
17
|
const templateDigest = (name) => {
|
|
18
18
|
const cached = templateDigests.get(name);
|
|
19
19
|
if (cached !== undefined) {
|
package/dist/stamp/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stamp/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAczC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAsB;IACxD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElD,4E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B,kEAAkE;gBAClE,kEAAkE;gBAClE,IAAI;gBACJ,KAAK;aACN,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/stamp/read.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Read the stamp out of a PNG file. Returns `undefined` when the file is
|
|
3
|
-
* missing, unreadable, not a PNG, or carries no stamp
|
|
3
|
+
* missing, unreadable, not a PNG, or carries no stamp, all of which mean the
|
|
4
4
|
* image cannot be shown to be up to date, so it should be rendered again.
|
|
5
5
|
*/
|
|
6
6
|
export declare function readPngStamp(file: string): Promise<string | undefined>;
|
package/dist/stamp/read.js
CHANGED
|
@@ -2,14 +2,14 @@ import { open } from "node:fs/promises";
|
|
|
2
2
|
import { pngSignature, stampKeyword } from "./chunk.js";
|
|
3
3
|
/**
|
|
4
4
|
* How much of a PNG to read when looking for a stamp. The stamp goes in
|
|
5
|
-
* immediately after `IHDR`, so this only has to cover the header
|
|
5
|
+
* immediately after `IHDR`, so this only has to cover the header. Reading
|
|
6
6
|
* whole images just to compare a hash would defeat the point of skipping them.
|
|
7
7
|
*/
|
|
8
8
|
const headBytes = 4096;
|
|
9
9
|
/**
|
|
10
10
|
* Find the stamp in the leading bytes of a PNG, or `undefined` if there is
|
|
11
|
-
* none
|
|
12
|
-
* not stamp yet.
|
|
11
|
+
* none, meaning the image was written by something else, or by a Colophon
|
|
12
|
+
* that did not stamp yet.
|
|
13
13
|
*/
|
|
14
14
|
function findStamp(head) {
|
|
15
15
|
if (!head.subarray(0, pngSignature.length).equals(pngSignature)) {
|
|
@@ -39,7 +39,7 @@ function findStamp(head) {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Read the stamp out of a PNG file. Returns `undefined` when the file is
|
|
42
|
-
* missing, unreadable, not a PNG, or carries no stamp
|
|
42
|
+
* missing, unreadable, not a PNG, or carries no stamp, all of which mean the
|
|
43
43
|
* image cannot be shown to be up to date, so it should be rendered again.
|
|
44
44
|
*/
|
|
45
45
|
export async function readPngStamp(file) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ImageAsset, MeasureText, ResolvedConfig } from "../types.js";
|
|
2
|
+
import type { FooterPlacement } from "./footer.js";
|
|
3
|
+
/** Where the attribution line goes: a footer placement, plus room to lay it out. */
|
|
4
|
+
export interface AttributionPlacement extends FooterPlacement {
|
|
5
|
+
/** Left edge and width of the content area the line is set within. */
|
|
6
|
+
readonly left: number;
|
|
7
|
+
readonly width: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The footer line, with the post's avatar before it.
|
|
11
|
+
*
|
|
12
|
+
* Both belong to the same idea, which is who made this, so they are drawn as
|
|
13
|
+
* one line rather than tucked into separate corners. Without an avatar this is
|
|
14
|
+
* the footer exactly as it was, down to the byte.
|
|
15
|
+
*/
|
|
16
|
+
export declare function attribution(config: ResolvedConfig, placement: AttributionPlacement, avatar: ImageAsset | undefined, measure: MeasureText): string;
|
|
17
|
+
//# sourceMappingURL=attribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../src/templates/attribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAYnD,oFAAoF;AACpF,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,oBAAoB,EAC/B,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,EAAE,WAAW,GACnB,MAAM,CAqCR"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { image, measureIn, row } from "../layout/index.js";
|
|
2
|
+
import { footerElement, hasFooter } from "./footer.js";
|
|
3
|
+
/** The avatar's diameter, as a multiple of the footer's font size. */
|
|
4
|
+
const avatarScale = 1.9;
|
|
5
|
+
/** Where a circular avatar's centre sits above the footer's baseline. */
|
|
6
|
+
const avatarRise = 0.34;
|
|
7
|
+
/** Unique within one image, which is as many avatars as there are. */
|
|
8
|
+
const avatarId = "colophon-avatar";
|
|
9
|
+
/**
|
|
10
|
+
* The footer line, with the post's avatar before it.
|
|
11
|
+
*
|
|
12
|
+
* Both belong to the same idea, which is who made this, so they are drawn as
|
|
13
|
+
* one line rather than tucked into separate corners. Without an avatar this is
|
|
14
|
+
* the footer exactly as it was, down to the byte.
|
|
15
|
+
*/
|
|
16
|
+
export function attribution(config, placement, avatar, measure) {
|
|
17
|
+
if (avatar === undefined) {
|
|
18
|
+
return footerElement(config, placement);
|
|
19
|
+
}
|
|
20
|
+
const { fontSize } = placement;
|
|
21
|
+
const size = Math.round(fontSize * avatarScale);
|
|
22
|
+
const text = hasFooter(config) ? (config.footer ?? "") : "";
|
|
23
|
+
const gap = text === "" ? 0 : Math.round(fontSize * 0.5);
|
|
24
|
+
const textWidth = text === ""
|
|
25
|
+
? 0
|
|
26
|
+
: measureIn(measure, config.fontFamily, 500)(text, fontSize);
|
|
27
|
+
// Only the horizontal placement comes from the row. The baseline is the one
|
|
28
|
+
// the template asked for, so a footer with no avatar and a footer with one
|
|
29
|
+
// sit at the same height.
|
|
30
|
+
const [portrait, label] = row([{ size }, { size: Math.round(textWidth), gapBefore: gap }], { x: placement.left, y: placement.y, width: placement.width, height: size }, placement.anchor === "middle" ? "centre" : "start");
|
|
31
|
+
const top = Math.round(placement.y - fontSize * avatarRise - size / 2);
|
|
32
|
+
return (image({ x: portrait?.x ?? placement.left, y: top, width: size, height: size }, avatar.href, { fit: "cover", radius: Math.round(size / 2), id: avatarId }) +
|
|
33
|
+
footerElement(config, {
|
|
34
|
+
...placement,
|
|
35
|
+
x: label?.x ?? placement.left,
|
|
36
|
+
anchor: "start",
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=attribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.js","sourceRoot":"","sources":["../../src/templates/attribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEvD,sEAAsE;AACtE,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,yEAAyE;AACzE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,sEAAsE;AACtE,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AASnC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,MAAsB,EACtB,SAA+B,EAC/B,MAA8B,EAC9B,OAAoB;IAEpB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5D,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;IACzD,MAAM,SAAS,GACb,IAAI,KAAK,EAAE;QACT,CAAC,CAAC,CAAC;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16 @@
|
|
|
1
|
+
import type { Badge, MetaImageProps, ResolvedConfig } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The badge to draw: the one the post declares, or the configured one where it
|
|
4
|
+
* declares nothing.
|
|
5
|
+
*
|
|
6
|
+
* A badge in config is the same badge on every image a site renders, and a
|
|
7
|
+
* post the badge does not describe has no other way to be rid of it. `false`
|
|
8
|
+
* is that way out, and an object is the same door in the other direction, so a
|
|
9
|
+
* post can carry a badge of its own without the config knowing about it.
|
|
10
|
+
*
|
|
11
|
+
* Anything else is a mistake in the frontmatter. It is reported and the
|
|
12
|
+
* configured badge is drawn, which leaves the post with the image it would
|
|
13
|
+
* have had if it had said nothing at all.
|
|
14
|
+
*/
|
|
15
|
+
export declare function badgeFor(props: MetaImageProps, config: ResolvedConfig): Badge | undefined;
|
|
16
|
+
//# sourceMappingURL=badge-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge-props.d.ts","sourceRoot":"","sources":["../../../src/templates/banner/badge-props.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAgC5E;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,GACrB,KAAK,GAAG,SAAS,CA6BnB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { optionalString } from "../../props.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read a badge out of the object a post declared, field by field, the way
|
|
4
|
+
* every other prop is read. What frontmatter yields is a plain value rather
|
|
5
|
+
* than the interface the compiler was shown, so a badge is built here from
|
|
6
|
+
* what is actually there instead of being passed along as one.
|
|
7
|
+
*
|
|
8
|
+
* Returns `undefined` for an object carrying no text, since the text is the
|
|
9
|
+
* badge and there is nothing to draw without it.
|
|
10
|
+
*/
|
|
11
|
+
function badgeFromProps(declared) {
|
|
12
|
+
const text = optionalString("text" in declared ? declared.text : undefined);
|
|
13
|
+
if (text === undefined || text === "") {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const color = optionalString("color" in declared ? declared.color : undefined);
|
|
17
|
+
const background = optionalString("background" in declared ? declared.background : undefined);
|
|
18
|
+
return {
|
|
19
|
+
text,
|
|
20
|
+
...(color !== undefined && { color }),
|
|
21
|
+
...(background !== undefined && { background }),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The badge to draw: the one the post declares, or the configured one where it
|
|
26
|
+
* declares nothing.
|
|
27
|
+
*
|
|
28
|
+
* A badge in config is the same badge on every image a site renders, and a
|
|
29
|
+
* post the badge does not describe has no other way to be rid of it. `false`
|
|
30
|
+
* is that way out, and an object is the same door in the other direction, so a
|
|
31
|
+
* post can carry a badge of its own without the config knowing about it.
|
|
32
|
+
*
|
|
33
|
+
* Anything else is a mistake in the frontmatter. It is reported and the
|
|
34
|
+
* configured badge is drawn, which leaves the post with the image it would
|
|
35
|
+
* have had if it had said nothing at all.
|
|
36
|
+
*/
|
|
37
|
+
export function badgeFor(props, config) {
|
|
38
|
+
// Widened because this arrives from a post's frontmatter: the declared type
|
|
39
|
+
// is what a project means to write, not what the file holds.
|
|
40
|
+
const declared = props.badge;
|
|
41
|
+
if (declared === undefined) {
|
|
42
|
+
return config.badge;
|
|
43
|
+
}
|
|
44
|
+
if (declared === false) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const badge = typeof declared === "object" && declared !== null
|
|
48
|
+
? badgeFromProps(declared)
|
|
49
|
+
: undefined;
|
|
50
|
+
if (badge === undefined) {
|
|
51
|
+
config.onWarning("props.badge is neither a badge nor false, so the configured badge was" +
|
|
52
|
+
" drawn. Give it an object with the `text` to draw, or `false` for no" +
|
|
53
|
+
" badge on this image.");
|
|
54
|
+
return config.badge;
|
|
55
|
+
}
|
|
56
|
+
return badge;
|
|
57
|
+
}
|
|
58
|
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AAC;IAED,MAAM,KAAK,GACT,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI;QAC/C,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;QAC1B,CAAC,CAAC,SAAS,CAAC;IAEhB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,CAAC,SAAS,CACd,uEAAuE;YACrE,sEAAsE;YACtE,uBAAuB,CAC1B,CAAC;QAEF,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/templates/banner/badge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,MAAM,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/templates/banner/badge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,MAAM,CAoBR"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { textElement } from "../../
|
|
1
|
+
import { box, textElement } from "../../layout/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* The corner badge: a rounded plate with the badge text on it, sized from the
|
|
4
4
|
* plate height so it scales with the image rather than the text length.
|
|
@@ -7,10 +7,7 @@ export function renderBadge(badge, fontFamily, brand, pad, height) {
|
|
|
7
7
|
const fontSize = Math.round(height * 0.6);
|
|
8
8
|
const padX = Math.round(height * 0.36);
|
|
9
9
|
const width = Math.round(badge.text.length * fontSize * 0.64 + padX * 2);
|
|
10
|
-
const
|
|
11
|
-
const rect = `<rect x="${String(pad)}" y="${String(pad)}"` +
|
|
12
|
-
` width="${String(width)}" height="${String(height)}"` +
|
|
13
|
-
` rx="${String(radius)}" fill="${badge.background ?? "#ffffff"}"/>`;
|
|
10
|
+
const plate = box({ x: pad, y: pad, width, height }, { radius: Math.round(height * 0.1), fill: badge.background ?? "#ffffff" });
|
|
14
11
|
const text = textElement(badge.text, {
|
|
15
12
|
x: pad + padX,
|
|
16
13
|
y: pad + Math.round(height * 0.72),
|
|
@@ -19,6 +16,6 @@ export function renderBadge(badge, fontFamily, brand, pad, height) {
|
|
|
19
16
|
fontWeight: 900,
|
|
20
17
|
fill: badge.color ?? brand,
|
|
21
18
|
});
|
|
22
|
-
return
|
|
19
|
+
return plate + text;
|
|
23
20
|
}
|
|
24
21
|
//# sourceMappingURL=badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/templates/banner/badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/templates/banner/badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,KAAY,EACZ,UAAkB,EAClB,KAAa,EACb,GAAW,EACX,MAAc;IAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;IAEzE,MAAM,KAAK,GAAG,GAAG,CACf,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EACjC,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,IAAI,SAAS,EAAE,CAC1E,CAAC;IAEF,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE;QACnC,CAAC,EAAE,GAAG,GAAG,IAAI;QACb,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QAClC,UAAU;QACV,QAAQ;QACR,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK;KAC3B,CAAC,CAAC;IAEH,OAAO,KAAK,GAAG,IAAI,CAAC;AACtB,CAAC"}
|
|
@@ -4,6 +4,9 @@ import type { Template } from "../../types.js";
|
|
|
4
4
|
* version and wrapped subtitle, an optional corner badge, and an optional
|
|
5
5
|
* footer. This is the configurable descendant of the original `npm_package`
|
|
6
6
|
* layout.
|
|
7
|
+
*
|
|
8
|
+
* A logo goes in the opposite corner to the badge, which is the corner the
|
|
9
|
+
* left-aligned text leaves free, and the avatar sits with the footer.
|
|
7
10
|
*/
|
|
8
11
|
export declare const bannerTemplate: Template;
|
|
9
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/banner/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/banner/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAQhE;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE,QA8E5B,CAAC"}
|