@kensio/colophon 2.5.0 → 2.6.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 +91 -13
- package/dist/astro/index.d.ts +49 -0
- package/dist/astro/index.d.ts.map +1 -0
- package/dist/astro/index.js +42 -0
- package/dist/astro/index.js.map +1 -0
- package/dist/cli/args/command.d.ts +13 -0
- package/dist/cli/args/command.d.ts.map +1 -0
- package/dist/cli/args/command.js +22 -0
- package/dist/cli/args/command.js.map +1 -0
- package/dist/cli/args/index.d.ts +28 -0
- package/dist/cli/args/index.d.ts.map +1 -0
- package/dist/cli/args/index.js +75 -0
- package/dist/cli/args/index.js.map +1 -0
- package/dist/cli/args/switches.d.ts +18 -0
- package/dist/cli/args/switches.d.ts.map +1 -0
- package/dist/cli/args/switches.js +42 -0
- package/dist/cli/args/switches.js.map +1 -0
- package/dist/cli/args/usage.d.ts +3 -0
- package/dist/cli/args/usage.d.ts.map +1 -0
- package/dist/cli/args/usage.js +34 -0
- package/dist/cli/args/usage.js.map +1 -0
- package/dist/cli/args/values.d.ts +11 -0
- package/dist/cli/args/values.d.ts.map +1 -0
- package/dist/cli/args/values.js +29 -0
- package/dist/cli/args/values.js.map +1 -0
- package/dist/cli/build.d.ts +10 -0
- package/dist/cli/build.d.ts.map +1 -0
- package/dist/cli/build.js +41 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/eject/adapters.d.ts +20 -0
- package/dist/cli/eject/adapters.d.ts.map +1 -0
- package/dist/cli/eject/adapters.js +29 -0
- package/dist/cli/eject/adapters.js.map +1 -0
- package/dist/cli/eject/astro.d.ts +13 -0
- package/dist/cli/eject/astro.d.ts.map +1 -0
- package/dist/cli/eject/astro.js +35 -0
- package/dist/cli/eject/astro.js.map +1 -0
- package/dist/cli/eject/hugo.d.ts +19 -0
- package/dist/cli/eject/hugo.d.ts.map +1 -0
- package/dist/cli/eject/hugo.js +127 -0
- package/dist/cli/eject/hugo.js.map +1 -0
- package/dist/cli/eject/index.d.ts +15 -0
- package/dist/cli/eject/index.d.ts.map +1 -0
- package/dist/cli/eject/index.js +46 -0
- package/dist/cli/eject/index.js.map +1 -0
- package/dist/cli/index.js +25 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/fs.d.ts +5 -0
- package/dist/cli/init/fs.d.ts.map +1 -0
- package/dist/cli/init/fs.js +19 -0
- package/dist/cli/init/fs.js.map +1 -0
- package/dist/cli/init/guess.d.ts +9 -0
- package/dist/cli/init/guess.d.ts.map +1 -0
- package/dist/cli/init/guess.js +27 -0
- package/dist/cli/init/guess.js.map +1 -0
- package/dist/cli/init/index.d.ts +11 -0
- package/dist/cli/init/index.d.ts.map +1 -0
- package/dist/cli/init/index.js +36 -0
- package/dist/cli/init/index.js.map +1 -0
- package/dist/cli/init/module.d.ts +12 -0
- package/dist/cli/init/module.d.ts.map +1 -0
- package/dist/cli/init/module.js +45 -0
- package/dist/cli/init/module.js.map +1 -0
- package/dist/cli/init/scaffold.d.ts +10 -0
- package/dist/cli/init/scaffold.d.ts.map +1 -0
- package/dist/cli/init/scaffold.js +52 -0
- package/dist/cli/init/scaffold.js.map +1 -0
- package/dist/cli/message.d.ts +7 -0
- package/dist/cli/message.d.ts.map +1 -0
- package/dist/cli/message.js +9 -0
- package/dist/cli/message.js.map +1 -0
- package/dist/cli/preview/index.d.ts +13 -0
- package/dist/cli/preview/index.d.ts.map +1 -0
- package/dist/cli/preview/index.js +27 -0
- package/dist/cli/preview/index.js.map +1 -0
- package/dist/cli/preview/open.d.ts +10 -0
- package/dist/cli/preview/open.d.ts.map +1 -0
- package/dist/cli/preview/open.js +32 -0
- package/dist/cli/preview/open.js.map +1 -0
- package/dist/cli/preview/render.d.ts +23 -0
- package/dist/cli/preview/render.d.ts.map +1 -0
- package/dist/cli/preview/render.js +40 -0
- package/dist/cli/preview/render.js.map +1 -0
- package/dist/cli/preview/root.d.ts +17 -0
- package/dist/cli/preview/root.d.ts.map +1 -0
- package/dist/cli/preview/root.js +22 -0
- package/dist/cli/preview/root.js.map +1 -0
- package/dist/cli/preview/size.d.ts +7 -0
- package/dist/cli/preview/size.d.ts.map +1 -0
- package/dist/cli/preview/size.js +13 -0
- package/dist/cli/preview/size.js.map +1 -0
- package/dist/cli/report.d.ts +6 -0
- package/dist/cli/report.d.ts.map +1 -0
- package/dist/cli/report.js +23 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/watch/filter.d.ts +14 -0
- package/dist/cli/watch/filter.d.ts.map +1 -0
- package/dist/cli/watch/filter.js +16 -0
- package/dist/cli/watch/filter.js.map +1 -0
- package/dist/cli/watch/index.d.ts +27 -0
- package/dist/cli/watch/index.d.ts.map +1 -0
- package/dist/cli/watch/index.js +38 -0
- package/dist/cli/watch/index.js.map +1 -0
- package/dist/cli/watch/queue.d.ts +24 -0
- package/dist/cli/watch/queue.d.ts.map +1 -0
- package/dist/cli/watch/queue.js +57 -0
- package/dist/cli/watch/queue.js.map +1 -0
- package/dist/config/defaults.d.ts +39 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +38 -0
- 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 +18 -4
- package/dist/config/index.js.map +1 -1
- package/dist/config/output.d.ts +26 -0
- package/dist/config/output.d.ts.map +1 -0
- package/dist/config/output.js +45 -0
- package/dist/config/output.js.map +1 -0
- package/dist/config/resolve.d.ts +10 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +20 -1
- package/dist/config/resolve.js.map +1 -1
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +1 -0
- package/dist/content/index.js.map +1 -1
- package/dist/content/read.d.ts +15 -0
- package/dist/content/read.d.ts.map +1 -0
- package/dist/content/read.js +36 -0
- package/dist/content/read.js.map +1 -0
- package/dist/content/walk.d.ts.map +1 -1
- package/dist/content/walk.js +4 -30
- package/dist/content/walk.js.map +1 -1
- package/dist/core/index.d.ts +37 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/encode/fit.d.ts +16 -0
- package/dist/encode/fit.d.ts.map +1 -0
- package/dist/encode/fit.js +23 -0
- package/dist/encode/fit.js.map +1 -0
- package/dist/encode/format.d.ts +12 -0
- package/dist/encode/format.d.ts.map +1 -0
- package/dist/encode/format.js +40 -0
- package/dist/encode/format.js.map +1 -0
- package/dist/encode/index.d.ts +14 -0
- package/dist/encode/index.d.ts.map +1 -0
- package/dist/encode/index.js +52 -0
- package/dist/encode/index.js.map +1 -0
- package/dist/encode/sharp.d.ts +19 -0
- package/dist/encode/sharp.d.ts.map +1 -0
- package/dist/encode/sharp.js +57 -0
- package/dist/encode/sharp.js.map +1 -0
- package/dist/encode/warn.d.ts +10 -0
- package/dist/encode/warn.d.ts.map +1 -0
- package/dist/encode/warn.js +31 -0
- package/dist/encode/warn.js.map +1 -0
- package/dist/fonts/resolve.d.ts.map +1 -1
- package/dist/fonts/resolve.js +2 -8
- package/dist/fonts/resolve.js.map +1 -1
- package/dist/generate/index.d.ts +4 -0
- package/dist/generate/index.d.ts.map +1 -1
- package/dist/generate/index.js +10 -4
- package/dist/generate/index.js.map +1 -1
- package/dist/generate/options.d.ts +11 -1
- package/dist/generate/options.d.ts.map +1 -1
- package/dist/generate/options.js.map +1 -1
- package/dist/generate/output-path.d.ts +6 -2
- package/dist/generate/output-path.d.ts.map +1 -1
- package/dist/generate/output-path.js +7 -2
- package/dist/generate/output-path.js.map +1 -1
- package/dist/generate/plan.d.ts.map +1 -1
- package/dist/generate/plan.js +3 -3
- package/dist/generate/plan.js.map +1 -1
- package/dist/generate/render-image.d.ts +6 -0
- package/dist/generate/render-image.d.ts.map +1 -1
- package/dist/generate/render-image.js +14 -4
- package/dist/generate/render-image.js.map +1 -1
- package/dist/image/index.d.ts +3 -1
- package/dist/image/index.d.ts.map +1 -1
- package/dist/image/index.js +4 -3
- package/dist/image/index.js.map +1 -1
- package/dist/image/jpeg.d.ts +5 -4
- package/dist/image/jpeg.d.ts.map +1 -1
- package/dist/image/jpeg.js +13 -36
- package/dist/image/jpeg.js.map +1 -1
- package/dist/image/load.d.ts.map +1 -1
- package/dist/image/load.js +4 -15
- package/dist/image/load.js.map +1 -1
- package/dist/image/resolve.d.ts.map +1 -1
- package/dist/image/resolve.js +2 -8
- package/dist/image/resolve.js.map +1 -1
- package/dist/image/uri.d.ts.map +1 -1
- package/dist/image/uri.js +2 -3
- package/dist/image/uri.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/jpeg/index.d.ts +10 -0
- package/dist/jpeg/index.d.ts.map +1 -0
- package/dist/jpeg/index.js +2 -0
- package/dist/jpeg/index.js.map +1 -0
- package/dist/jpeg/segments.d.ts +32 -0
- package/dist/jpeg/segments.d.ts.map +1 -0
- package/dist/jpeg/segments.js +66 -0
- package/dist/jpeg/segments.js.map +1 -0
- package/dist/layout/draw.d.ts +20 -0
- package/dist/layout/draw.d.ts.map +1 -0
- package/dist/layout/draw.js +32 -0
- package/dist/layout/draw.js.map +1 -0
- package/dist/layout/extent.d.ts +19 -0
- package/dist/layout/extent.d.ts.map +1 -0
- package/dist/layout/extent.js +24 -0
- package/dist/layout/extent.js.map +1 -0
- package/dist/layout/index.d.ts +7 -4
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +5 -3
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/lines.d.ts +0 -17
- package/dist/layout/lines.d.ts.map +1 -1
- package/dist/layout/lines.js +2 -35
- package/dist/layout/lines.js.map +1 -1
- package/dist/measure/faces.d.ts.map +1 -1
- package/dist/measure/faces.js +8 -2
- package/dist/measure/faces.js.map +1 -1
- package/dist/meta/index.d.ts +1 -0
- package/dist/meta/index.d.ts.map +1 -1
- package/dist/meta/index.js +1 -0
- package/dist/meta/index.js.map +1 -1
- package/dist/meta/path.d.ts +24 -0
- package/dist/meta/path.d.ts.map +1 -0
- package/dist/meta/path.js +41 -0
- package/dist/meta/path.js.map +1 -0
- package/dist/meta/tags.d.ts.map +1 -1
- package/dist/meta/tags.js +6 -1
- package/dist/meta/tags.js.map +1 -1
- package/dist/placement/index.d.ts +7 -2
- package/dist/placement/index.d.ts.map +1 -1
- package/dist/placement/index.js +9 -3
- package/dist/placement/index.js.map +1 -1
- package/dist/placement/relative.d.ts +8 -3
- package/dist/placement/relative.d.ts.map +1 -1
- package/dist/placement/relative.js +12 -5
- package/dist/placement/relative.js.map +1 -1
- package/dist/platform/base64.d.ts +13 -0
- package/dist/platform/base64.d.ts.map +1 -0
- package/dist/platform/base64.js +35 -0
- package/dist/platform/base64.js.map +1 -0
- package/dist/platform/rasteriser.browser.d.ts +16 -0
- package/dist/platform/rasteriser.browser.d.ts.map +1 -0
- package/dist/platform/rasteriser.browser.js +20 -0
- package/dist/platform/rasteriser.browser.js.map +1 -0
- package/dist/platform/rasteriser.node.d.ts +2 -0
- package/dist/platform/rasteriser.node.d.ts.map +1 -0
- package/dist/platform/rasteriser.node.js +2 -0
- package/dist/platform/rasteriser.node.js.map +1 -0
- package/dist/platform/read-file.browser.d.ts +17 -0
- package/dist/platform/read-file.browser.d.ts.map +1 -0
- package/dist/platform/read-file.browser.js +23 -0
- package/dist/platform/read-file.browser.js.map +1 -0
- package/dist/platform/read-file.node.d.ts +19 -0
- package/dist/platform/read-file.node.d.ts.map +1 -0
- package/dist/platform/read-file.node.js +31 -0
- package/dist/platform/read-file.node.js.map +1 -0
- package/dist/png/chunk.d.ts +23 -0
- package/dist/png/chunk.d.ts.map +1 -0
- package/dist/png/chunk.js +48 -0
- package/dist/png/chunk.js.map +1 -0
- package/dist/png/index.d.ts +13 -0
- package/dist/png/index.d.ts.map +1 -0
- package/dist/png/index.js +3 -0
- package/dist/png/index.js.map +1 -0
- package/dist/png/recompress.d.ts +23 -0
- package/dist/png/recompress.d.ts.map +1 -0
- package/dist/png/recompress.js +81 -0
- package/dist/png/recompress.js.map +1 -0
- package/dist/props.d.ts +11 -0
- package/dist/props.d.ts.map +1 -1
- package/dist/props.js +16 -0
- package/dist/props.js.map +1 -1
- package/dist/render/image.d.ts +20 -0
- package/dist/render/image.d.ts.map +1 -0
- package/dist/render/image.js +29 -0
- package/dist/render/image.js.map +1 -0
- package/dist/render/index.d.ts +2 -1
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +5 -4
- package/dist/render/index.js.map +1 -1
- package/dist/render/png.d.ts +14 -4
- package/dist/render/png.d.ts.map +1 -1
- package/dist/render/png.js +22 -23
- package/dist/render/png.js.map +1 -1
- package/dist/render/rasterise.d.ts +15 -0
- package/dist/render/rasterise.d.ts.map +1 -0
- package/dist/render/rasterise.js +34 -0
- package/dist/render/rasterise.js.map +1 -0
- package/dist/render/svg.d.ts.map +1 -1
- package/dist/render/svg.js +1 -0
- package/dist/render/svg.js.map +1 -1
- package/dist/sign/base64url.d.ts +16 -0
- package/dist/sign/base64url.d.ts.map +1 -0
- package/dist/sign/base64url.js +24 -0
- package/dist/sign/base64url.js.map +1 -0
- package/dist/sign/index.d.ts +49 -0
- package/dist/sign/index.d.ts.map +1 -0
- package/dist/sign/index.js +133 -0
- package/dist/sign/index.js.map +1 -0
- package/dist/stamp/carrier/index.d.ts +7 -0
- package/dist/stamp/carrier/index.d.ts.map +1 -0
- package/dist/stamp/carrier/index.js +27 -0
- package/dist/stamp/carrier/index.js.map +1 -0
- package/dist/stamp/carrier/isobmff.d.ts +7 -0
- package/dist/stamp/carrier/isobmff.d.ts.map +1 -0
- package/dist/stamp/carrier/isobmff.js +55 -0
- package/dist/stamp/carrier/isobmff.js.map +1 -0
- package/dist/stamp/carrier/jpeg.d.ts +4 -0
- package/dist/stamp/carrier/jpeg.d.ts.map +1 -0
- package/dist/stamp/carrier/jpeg.js +76 -0
- package/dist/stamp/carrier/jpeg.js.map +1 -0
- package/dist/stamp/carrier/png.d.ts +7 -0
- package/dist/stamp/carrier/png.d.ts.map +1 -0
- package/dist/stamp/carrier/png.js +50 -0
- package/dist/stamp/carrier/png.js.map +1 -0
- package/dist/stamp/carrier/riff.d.ts +4 -0
- package/dist/stamp/carrier/riff.d.ts.map +1 -0
- package/dist/stamp/carrier/riff.js +54 -0
- package/dist/stamp/carrier/riff.js.map +1 -0
- package/dist/stamp/carrier/types.d.ts +25 -0
- package/dist/stamp/carrier/types.d.ts.map +1 -0
- package/dist/stamp/carrier/types.js +2 -0
- package/dist/stamp/carrier/types.js.map +1 -0
- package/dist/stamp/chunk.d.ts +0 -2
- package/dist/stamp/chunk.d.ts.map +1 -1
- package/dist/stamp/chunk.js +10 -18
- package/dist/stamp/chunk.js.map +1 -1
- package/dist/stamp/config-digest.d.ts +18 -0
- package/dist/stamp/config-digest.d.ts.map +1 -1
- package/dist/stamp/config-digest.js +24 -0
- package/dist/stamp/config-digest.js.map +1 -1
- package/dist/stamp/index.d.ts +2 -2
- package/dist/stamp/index.d.ts.map +1 -1
- package/dist/stamp/index.js +2 -2
- package/dist/stamp/index.js.map +1 -1
- package/dist/stamp/payload.d.ts +28 -0
- package/dist/stamp/payload.d.ts.map +1 -0
- package/dist/stamp/payload.js +42 -0
- package/dist/stamp/payload.js.map +1 -0
- package/dist/stamp/read.d.ts +5 -4
- package/dist/stamp/read.d.ts.map +1 -1
- package/dist/stamp/read.js +26 -43
- package/dist/stamp/read.js.map +1 -1
- package/dist/stamp/window.d.ts +11 -0
- package/dist/stamp/window.d.ts.map +1 -0
- package/dist/stamp/window.js +11 -0
- package/dist/stamp/window.js.map +1 -0
- package/dist/stamp/write.d.ts +21 -0
- package/dist/stamp/write.d.ts.map +1 -0
- package/dist/stamp/write.js +31 -0
- package/dist/stamp/write.js.map +1 -0
- package/dist/templates/article/bottom.d.ts +15 -0
- package/dist/templates/article/bottom.d.ts.map +1 -0
- package/dist/templates/article/bottom.js +61 -0
- package/dist/templates/article/bottom.js.map +1 -0
- package/dist/templates/article/index.d.ts +12 -0
- package/dist/templates/article/index.d.ts.map +1 -0
- package/dist/templates/article/index.js +42 -0
- package/dist/templates/article/index.js.map +1 -0
- package/dist/templates/article/lines.d.ts +27 -0
- package/dist/templates/article/lines.d.ts.map +1 -0
- package/dist/templates/article/lines.js +53 -0
- package/dist/templates/article/lines.js.map +1 -0
- package/dist/templates/article/tags.d.ts +25 -0
- package/dist/templates/article/tags.d.ts.map +1 -0
- package/dist/templates/article/tags.js +63 -0
- package/dist/templates/article/tags.js.map +1 -0
- package/dist/templates/attribution.d.ts +2 -6
- package/dist/templates/attribution.d.ts.map +1 -1
- package/dist/templates/attribution.js +8 -22
- package/dist/templates/attribution.js.map +1 -1
- package/dist/templates/banner/version.d.ts.map +1 -1
- package/dist/templates/banner/version.js +4 -4
- package/dist/templates/banner/version.js.map +1 -1
- package/dist/templates/bottom.d.ts +23 -0
- package/dist/templates/bottom.d.ts.map +1 -0
- package/dist/templates/bottom.js +37 -0
- package/dist/templates/bottom.js.map +1 -0
- package/dist/templates/byline.d.ts +19 -0
- package/dist/templates/byline.d.ts.map +1 -0
- package/dist/templates/byline.js +45 -0
- package/dist/templates/byline.js.map +1 -0
- package/dist/templates/code/clip.js +1 -1
- package/dist/templates/code/clip.js.map +1 -1
- package/dist/templates/code/fit.js +1 -1
- package/dist/templates/code/fit.js.map +1 -1
- package/dist/templates/code/warn.d.ts +1 -1
- package/dist/templates/code/warn.d.ts.map +1 -1
- package/dist/templates/code/warn.js +2 -2
- package/dist/templates/code/warn.js.map +1 -1
- package/dist/templates/docs/chrome.d.ts +17 -0
- package/dist/templates/docs/chrome.d.ts.map +1 -0
- package/dist/templates/docs/chrome.js +44 -0
- package/dist/templates/docs/chrome.js.map +1 -0
- package/dist/templates/docs/crumbs.d.ts +14 -0
- package/dist/templates/docs/crumbs.d.ts.map +1 -0
- package/dist/templates/docs/crumbs.js +32 -0
- package/dist/templates/docs/crumbs.js.map +1 -0
- package/dist/templates/docs/index.d.ts +13 -0
- package/dist/templates/docs/index.d.ts.map +1 -0
- package/dist/templates/docs/index.js +47 -0
- package/dist/templates/docs/index.js.map +1 -0
- package/dist/templates/docs/lines.d.ts +14 -0
- package/dist/templates/docs/lines.d.ts.map +1 -0
- package/dist/templates/docs/lines.js +29 -0
- package/dist/templates/docs/lines.js.map +1 -0
- package/dist/templates/event/index.d.ts +12 -0
- package/dist/templates/event/index.d.ts.map +1 -0
- package/dist/templates/event/index.js +59 -0
- package/dist/templates/event/index.js.map +1 -0
- package/dist/templates/event/lines.d.ts +14 -0
- package/dist/templates/event/lines.d.ts.map +1 -0
- package/dist/templates/event/lines.js +29 -0
- package/dist/templates/event/lines.js.map +1 -0
- package/dist/templates/event/plate.d.ts +16 -0
- package/dist/templates/event/plate.d.ts.map +1 -0
- package/dist/templates/event/plate.js +36 -0
- package/dist/templates/event/plate.js.map +1 -0
- package/dist/templates/frame.d.ts +68 -0
- package/dist/templates/frame.d.ts.map +1 -0
- package/dist/templates/frame.js +63 -0
- package/dist/templates/frame.js.map +1 -0
- package/dist/templates/index.d.ts +9 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +27 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/photo/index.d.ts +17 -0
- package/dist/templates/photo/index.d.ts.map +1 -0
- package/dist/templates/photo/index.js +51 -0
- package/dist/templates/photo/index.js.map +1 -0
- package/dist/templates/photo/lines.d.ts +21 -0
- package/dist/templates/photo/lines.d.ts.map +1 -0
- package/dist/templates/photo/lines.js +36 -0
- package/dist/templates/photo/lines.js.map +1 -0
- package/dist/templates/pill.d.ts +33 -0
- package/dist/templates/pill.d.ts.map +1 -0
- package/dist/templates/pill.js +50 -0
- package/dist/templates/pill.js.map +1 -0
- package/dist/templates/portrait.d.ts +40 -0
- package/dist/templates/portrait.d.ts.map +1 -0
- package/dist/templates/portrait.js +56 -0
- package/dist/templates/portrait.js.map +1 -0
- package/dist/templates/quote/index.d.ts +11 -0
- package/dist/templates/quote/index.d.ts.map +1 -0
- package/dist/templates/quote/index.js +60 -0
- package/dist/templates/quote/index.js.map +1 -0
- package/dist/templates/quote/lines.d.ts +24 -0
- package/dist/templates/quote/lines.d.ts.map +1 -0
- package/dist/templates/quote/lines.js +35 -0
- package/dist/templates/quote/lines.js.map +1 -0
- package/dist/templates/quote/mark.d.ts +13 -0
- package/dist/templates/quote/mark.d.ts.map +1 -0
- package/dist/templates/quote/mark.js +39 -0
- package/dist/templates/quote/mark.js.map +1 -0
- package/dist/templates/quote/speaker.d.ts +18 -0
- package/dist/templates/quote/speaker.d.ts.map +1 -0
- package/dist/templates/quote/speaker.js +41 -0
- package/dist/templates/quote/speaker.js.map +1 -0
- package/dist/templates/release/block.d.ts +8 -0
- package/dist/templates/release/block.d.ts.map +1 -0
- package/dist/templates/release/block.js +16 -0
- package/dist/templates/release/block.js.map +1 -0
- package/dist/templates/release/changes.d.ts +23 -0
- package/dist/templates/release/changes.d.ts.map +1 -0
- package/dist/templates/release/changes.js +45 -0
- package/dist/templates/release/changes.js.map +1 -0
- package/dist/templates/release/index.d.ts +11 -0
- package/dist/templates/release/index.d.ts.map +1 -0
- package/dist/templates/release/index.js +55 -0
- package/dist/templates/release/index.js.map +1 -0
- package/dist/templates/release/lines.d.ts +21 -0
- package/dist/templates/release/lines.d.ts.map +1 -0
- package/dist/templates/release/lines.js +36 -0
- package/dist/templates/release/lines.js.map +1 -0
- package/dist/templates/stat/index.d.ts +11 -0
- package/dist/templates/stat/index.d.ts.map +1 -0
- package/dist/templates/stat/index.js +43 -0
- package/dist/templates/stat/index.js.map +1 -0
- package/dist/templates/stat/lines.d.ts +23 -0
- package/dist/templates/stat/lines.d.ts.map +1 -0
- package/dist/templates/stat/lines.js +47 -0
- package/dist/templates/stat/lines.js.map +1 -0
- package/dist/templates/terminal/index.d.ts +16 -0
- package/dist/templates/terminal/index.d.ts.map +1 -0
- package/dist/templates/terminal/index.js +62 -0
- package/dist/templates/terminal/index.js.map +1 -0
- package/dist/templates/terminal/session.d.ts +17 -0
- package/dist/templates/terminal/session.d.ts.map +1 -0
- package/dist/templates/terminal/session.js +86 -0
- package/dist/templates/terminal/session.js.map +1 -0
- package/dist/templates/terminal/window.d.ts +14 -0
- package/dist/templates/terminal/window.d.ts.map +1 -0
- package/dist/templates/terminal/window.js +84 -0
- package/dist/templates/terminal/window.js.map +1 -0
- package/dist/templates/version.d.ts +16 -0
- package/dist/templates/version.d.ts.map +1 -0
- package/dist/templates/version.js +23 -0
- package/dist/templates/version.js.map +1 -0
- package/dist/templates/wordmark/index.d.ts +13 -0
- package/dist/templates/wordmark/index.d.ts.map +1 -0
- package/dist/templates/wordmark/index.js +53 -0
- package/dist/templates/wordmark/index.js.map +1 -0
- package/dist/templates/wordmark/lines.d.ts +22 -0
- package/dist/templates/wordmark/lines.d.ts.map +1 -0
- package/dist/templates/wordmark/lines.js +61 -0
- package/dist/templates/wordmark/lines.js.map +1 -0
- package/dist/templates/wordmark/mark.d.ts +16 -0
- package/dist/templates/wordmark/mark.d.ts.map +1 -0
- package/dist/templates/wordmark/mark.js +30 -0
- package/dist/templates/wordmark/mark.js.map +1 -0
- package/dist/text/clamp.d.ts +12 -0
- package/dist/text/clamp.d.ts.map +1 -0
- package/dist/text/clamp.js +41 -0
- package/dist/text/clamp.js.map +1 -0
- package/dist/text/ellipsis.d.ts +3 -0
- package/dist/text/ellipsis.d.ts.map +1 -0
- package/dist/text/ellipsis.js +3 -0
- package/dist/text/ellipsis.js.map +1 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +2 -0
- package/dist/text/index.js.map +1 -1
- package/dist/types.d.ts +158 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/collect.d.ts.map +1 -1
- package/dist/validate/collect.js +2 -1
- package/dist/validate/collect.js.map +1 -1
- package/dist/validate/keys.d.ts +6 -0
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +17 -0
- package/dist/validate/keys.js.map +1 -1
- package/dist/validate/values.d.ts +6 -0
- package/dist/validate/values.d.ts.map +1 -1
- package/dist/validate/values.js +12 -1
- package/dist/validate/values.js.map +1 -1
- package/package.json +16 -2
- package/dist/background.d.ts +0 -13
- package/dist/background.d.ts.map +0 -1
- package/dist/background.js +0 -65
- package/dist/background.js.map +0 -1
- package/dist/cli/args.d.ts +0 -14
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -67
- package/dist/cli/args.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -102
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -95
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -208
- package/dist/config.js.map +0 -1
- package/dist/fonts.d.ts +0 -18
- package/dist/fonts.d.ts.map +0 -1
- package/dist/fonts.js +0 -102
- package/dist/fonts.js.map +0 -1
- package/dist/generate.d.ts +0 -63
- package/dist/generate.d.ts.map +0 -1
- package/dist/generate.js +0 -109
- package/dist/generate.js.map +0 -1
- package/dist/highlight.d.ts +0 -75
- package/dist/highlight.d.ts.map +0 -1
- package/dist/highlight.js +0 -137
- package/dist/highlight.js.map +0 -1
- package/dist/render.d.ts +0 -24
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -77
- package/dist/render.js.map +0 -1
- package/dist/stamp.d.ts +0 -29
- package/dist/stamp.d.ts.map +0 -1
- package/dist/stamp.js +0 -198
- package/dist/stamp.js.map +0 -1
- package/dist/templates/banner.d.ts +0 -9
- package/dist/templates/banner.d.ts.map +0 -1
- package/dist/templates/banner.js +0 -115
- package/dist/templates/banner.js.map +0 -1
- package/dist/templates/card.d.ts +0 -7
- package/dist/templates/card.d.ts.map +0 -1
- package/dist/templates/card.js +0 -72
- package/dist/templates/card.js.map +0 -1
- package/dist/templates/code.d.ts +0 -12
- package/dist/templates/code.d.ts.map +0 -1
- package/dist/templates/code.js +0 -275
- package/dist/templates/code.js.map +0 -1
- package/dist/templates/measure.d.ts +0 -11
- package/dist/templates/measure.d.ts.map +0 -1
- package/dist/templates/measure.js +0 -11
- package/dist/templates/measure.js.map +0 -1
- package/dist/templates/props.d.ts +0 -7
- package/dist/templates/props.d.ts.map +0 -1
- package/dist/templates/props.js +0 -17
- package/dist/templates/props.js.map +0 -1
- package/dist/templates/text.d.ts +0 -37
- package/dist/templates/text.d.ts.map +0 -1
- package/dist/templates/text.js +0 -26
- package/dist/templates/text.js.map +0 -1
- package/dist/text/stack.d.ts +0 -24
- package/dist/text/stack.d.ts.map +0 -1
- package/dist/text/stack.js +0 -18
- package/dist/text/stack.js.map +0 -1
- package/dist/text.d.ts +0 -56
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js +0 -78
- package/dist/text.js.map +0 -1
- package/dist/validate/sizes.d.ts +0 -9
- package/dist/validate/sizes.d.ts.map +0 -1
- package/dist/validate/sizes.js +0 -27
- package/dist/validate/sizes.js.map +0 -1
- package/dist/validate.d.ts +0 -15
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -300
- package/dist/validate.js.map +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { blockLines, optionalString } from "../../layout/index.js";
|
|
2
|
+
const maxQuoteLines = 4;
|
|
3
|
+
const quoteFloor = 0.55;
|
|
4
|
+
/**
|
|
5
|
+
* The quotation itself, read from `quote` or from `title`.
|
|
6
|
+
*
|
|
7
|
+
* Both names are taken because a post that is about one sentence usually has
|
|
8
|
+
* that sentence in its title already, and making it write the same words twice
|
|
9
|
+
* to get an image of them would be a poor trade for a tidier prop list.
|
|
10
|
+
*/
|
|
11
|
+
export function quoteLines(props, text) {
|
|
12
|
+
const quote = optionalString(props["quote"]) ?? props.title;
|
|
13
|
+
return blockLines(quote, text.measure, text.fontFamily, {
|
|
14
|
+
maxWidth: text.contentWidth,
|
|
15
|
+
maxLines: maxQuoteLines,
|
|
16
|
+
fontSize: text.quoteFs,
|
|
17
|
+
floor: quoteFloor,
|
|
18
|
+
fontWeight: 700,
|
|
19
|
+
opacity: 1,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Who said it: the name, then whatever the post added about them, after an em
|
|
24
|
+
* dash. The dash is what makes the line read as an attribution rather than as
|
|
25
|
+
* another line of the quotation.
|
|
26
|
+
*/
|
|
27
|
+
export function attributionText(props) {
|
|
28
|
+
const name = optionalString(props["author"]) ?? "";
|
|
29
|
+
const role = optionalString(props["role"]) ?? "";
|
|
30
|
+
if (name === "") {
|
|
31
|
+
return role === "" ? "" : role;
|
|
32
|
+
}
|
|
33
|
+
return role === "" ? `— ${name}` : `— ${name}, ${role}`;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../../src/templates/quote/lines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGnE,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AAUxB;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,KAAqB,EAAE,IAAe;IAC/D,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC;IAE5D,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;QACtD,QAAQ,EAAE,IAAI,CAAC,YAAY;QAC3B,QAAQ,EAAE,aAAa;QACvB,QAAQ,EAAE,IAAI,CAAC,OAAO;QACtB,KAAK,EAAE,UAAU;QACjB,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,CAAC;KACX,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAqB;IACnD,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAEjD,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACjC,CAAC;IAED,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,IAAI,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Rect } from "../../layout/index.js";
|
|
2
|
+
/** The band a quotation mark of this size needs. */
|
|
3
|
+
export declare function markBand(fontSize: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* The opening quotation mark, centred above the quotation.
|
|
6
|
+
*
|
|
7
|
+
* It is drawn in the accent colour at a size no text on the image reaches, so
|
|
8
|
+
* that a reader takes the words as quoted before reading any of them. That is
|
|
9
|
+
* the whole job of this template: the same sentence set plainly reads as the
|
|
10
|
+
* site's own opinion.
|
|
11
|
+
*/
|
|
12
|
+
export declare function quoteMark(slot: Rect | undefined, fontSize: number, fontFamily: string, fill: string): string;
|
|
13
|
+
//# sourceMappingURL=mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark.d.ts","sourceRoot":"","sources":["../../../src/templates/quote/mark.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAalD,oDAAoD;AACpD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,MAAM,CAeR"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { textElement } from "../../layout/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* How much of the glyph's own font size it takes up on the page.
|
|
4
|
+
*
|
|
5
|
+
* An opening quotation mark hangs at the top of its em: there is a cap height
|
|
6
|
+
* of ink and then nothing, where a letter would have had a descender. Reserving
|
|
7
|
+
* a full line for it leaves a hole between it and the words underneath, so the
|
|
8
|
+
* band is a little over half the size it is set at, and the baseline sits at
|
|
9
|
+
* the bottom of that band.
|
|
10
|
+
*/
|
|
11
|
+
const inkRatio = 0.56;
|
|
12
|
+
/** The band a quotation mark of this size needs. */
|
|
13
|
+
export function markBand(fontSize) {
|
|
14
|
+
return Math.round(fontSize * inkRatio);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The opening quotation mark, centred above the quotation.
|
|
18
|
+
*
|
|
19
|
+
* It is drawn in the accent colour at a size no text on the image reaches, so
|
|
20
|
+
* that a reader takes the words as quoted before reading any of them. That is
|
|
21
|
+
* the whole job of this template: the same sentence set plainly reads as the
|
|
22
|
+
* site's own opinion.
|
|
23
|
+
*/
|
|
24
|
+
export function quoteMark(slot, fontSize, fontFamily, fill) {
|
|
25
|
+
if (slot === undefined) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
return textElement("“", {
|
|
29
|
+
x: Math.round(slot.x + slot.width / 2),
|
|
30
|
+
y: slot.y + slot.height,
|
|
31
|
+
fontFamily,
|
|
32
|
+
fontSize,
|
|
33
|
+
fontWeight: 800,
|
|
34
|
+
fill,
|
|
35
|
+
fillOpacity: 0.55,
|
|
36
|
+
anchor: "middle",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark.js","sourceRoot":"","sources":["../../../src/templates/quote/mark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;;;;;;GAQG;AACH,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,oDAAoD;AACpD,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAsB,EACtB,QAAgB,EAChB,UAAkB,EAClB,IAAY;IAEZ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,EAAE;QACtB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACtC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM;QACvB,UAAU;QACV,QAAQ;QACR,UAAU,EAAE,GAAG;QACf,IAAI;QACJ,WAAW,EAAE,IAAI;QACjB,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Rect } from "../../layout/index.js";
|
|
2
|
+
import type { ImageAsset, MeasureText, ResolvedConfig } from "../../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The room the attribution line needs.
|
|
5
|
+
*
|
|
6
|
+
* A picture is taller than the words beside it, so a line carrying one takes
|
|
7
|
+
* its height rather than the type's. A quotation with neither takes nothing,
|
|
8
|
+
* and the words move down into the space.
|
|
9
|
+
*/
|
|
10
|
+
export declare function speakerRoom(said: string, fontSize: number, avatar: ImageAsset | undefined): number;
|
|
11
|
+
/**
|
|
12
|
+
* Who said it, centred under the quotation with the avatar before them.
|
|
13
|
+
*
|
|
14
|
+
* The line is centred within the slot rather than set from its top, since the
|
|
15
|
+
* slot is as tall as the picture and the words are not.
|
|
16
|
+
*/
|
|
17
|
+
export declare function speaker(said: string, slot: Rect | undefined, fontSize: number, config: ResolvedConfig, avatar: ImageAsset | undefined, measure: MeasureText): string;
|
|
18
|
+
//# sourceMappingURL=speaker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speaker.d.ts","sourceRoot":"","sources":["../../../src/templates/quote/speaker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAI9E;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,UAAU,GAAG,SAAS,GAC7B,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,EAAE,WAAW,GACnB,MAAM,CAwBR"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { baselineFor } from "../../layout/index.js";
|
|
2
|
+
import { byline } from "../byline.js";
|
|
3
|
+
import { portraitHeight } from "../portrait.js";
|
|
4
|
+
/**
|
|
5
|
+
* The room the attribution line needs.
|
|
6
|
+
*
|
|
7
|
+
* A picture is taller than the words beside it, so a line carrying one takes
|
|
8
|
+
* its height rather than the type's. A quotation with neither takes nothing,
|
|
9
|
+
* and the words move down into the space.
|
|
10
|
+
*/
|
|
11
|
+
export function speakerRoom(said, fontSize, avatar) {
|
|
12
|
+
if (avatar !== undefined) {
|
|
13
|
+
return portraitHeight(fontSize);
|
|
14
|
+
}
|
|
15
|
+
return said === "" ? 0 : fontSize;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Who said it, centred under the quotation with the avatar before them.
|
|
19
|
+
*
|
|
20
|
+
* The line is centred within the slot rather than set from its top, since the
|
|
21
|
+
* slot is as tall as the picture and the words are not.
|
|
22
|
+
*/
|
|
23
|
+
export function speaker(said, slot, fontSize, config, avatar, measure) {
|
|
24
|
+
if (slot === undefined) {
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
return byline(said, {
|
|
28
|
+
x: Math.round(slot.x + slot.width / 2),
|
|
29
|
+
y: baselineFor(slot.y + (slot.height - fontSize) / 2, fontSize),
|
|
30
|
+
fontSize,
|
|
31
|
+
opacity: 0.85,
|
|
32
|
+
anchor: "middle",
|
|
33
|
+
left: slot.x,
|
|
34
|
+
width: slot.width,
|
|
35
|
+
}, {
|
|
36
|
+
fontFamily: config.fontFamily,
|
|
37
|
+
fontWeight: 600,
|
|
38
|
+
fill: config.colors.foreground,
|
|
39
|
+
}, avatar, measure);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=speaker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speaker.js","sourceRoot":"","sources":["../../../src/templates/quote/speaker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,IAAY,EACZ,QAAgB,EAChB,MAA8B;IAE9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CACrB,IAAY,EACZ,IAAsB,EACtB,QAAgB,EAChB,MAAsB,EACtB,MAA8B,EAC9B,OAAoB;IAEpB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CACX,IAAI,EACJ;QACE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACtC,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;QAC/D,QAAQ;QACR,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,IAAI,CAAC,CAAC;QACZ,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,EACD;QACE,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;KAC/B,EACD,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Rect } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, ResolvedConfig } from "../../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The list in the slot the stack gave it, styled from the config, or nothing
|
|
5
|
+
* where the post listed no changes and the stack gave it no room.
|
|
6
|
+
*/
|
|
7
|
+
export declare function changeBlock(items: readonly string[], slot: Rect | undefined, fontSize: number, config: ResolvedConfig, measure: MeasureText): string;
|
|
8
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/templates/release/block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGlE;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,WAAW,GACnB,MAAM,CAcR"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { changeList } from "./changes.js";
|
|
2
|
+
/**
|
|
3
|
+
* The list in the slot the stack gave it, styled from the config, or nothing
|
|
4
|
+
* where the post listed no changes and the stack gave it no room.
|
|
5
|
+
*/
|
|
6
|
+
export function changeBlock(items, slot, fontSize, config, measure) {
|
|
7
|
+
return slot === undefined
|
|
8
|
+
? ""
|
|
9
|
+
: changeList(items, slot, {
|
|
10
|
+
fontFamily: config.fontFamily,
|
|
11
|
+
fontSize,
|
|
12
|
+
fill: config.colors.foreground,
|
|
13
|
+
accent: config.colors.brandWarm,
|
|
14
|
+
}, measure);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../../src/templates/release/block.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,KAAwB,EACxB,IAAsB,EACtB,QAAgB,EAChB,MAAsB,EACtB,OAAoB;IAEpB,OAAO,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,UAAU,CACR,KAAK,EACL,IAAI,EACJ;YACE,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,QAAQ;YACR,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS;SAChC,EACD,OAAO,CACR,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Rect } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText } from "../../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* How many changes are drawn.
|
|
5
|
+
*
|
|
6
|
+
* A changelog has as many entries as it has, and a share image showing all of
|
|
7
|
+
* them is a wall of small text nobody reads in a feed. Four is what fits at a
|
|
8
|
+
* size that can be read, and the post itself is where the rest of them are.
|
|
9
|
+
*/
|
|
10
|
+
export declare const maxChanges = 4;
|
|
11
|
+
/** How a list of changes is set. */
|
|
12
|
+
export interface ChangeStyle {
|
|
13
|
+
readonly fontFamily: string;
|
|
14
|
+
readonly fontSize: number;
|
|
15
|
+
readonly fill: string;
|
|
16
|
+
/** The bullets' colour, which is what marks the list as a list. */
|
|
17
|
+
readonly accent: string;
|
|
18
|
+
}
|
|
19
|
+
/** The room a list of this many changes takes. */
|
|
20
|
+
export declare function changesHeight(count: number, fontSize: number): number;
|
|
21
|
+
/** The list of changes, drawn down from the top of the space it was given. */
|
|
22
|
+
export declare function changeList(items: readonly string[], area: Rect, style: ChangeStyle, measure: MeasureText): string;
|
|
23
|
+
//# sourceMappingURL=changes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../../src/templates/release/changes.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAQ5B,oCAAoC;AACpC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,kDAAkD;AAClD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErE;AA4CD,8EAA8E;AAC9E,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,WAAW,GACnB,MAAM,CAYR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { baselineFor, box, clampLine, measureIn, textElement, } from "../../layout/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* How many changes are drawn.
|
|
4
|
+
*
|
|
5
|
+
* A changelog has as many entries as it has, and a share image showing all of
|
|
6
|
+
* them is a wall of small text nobody reads in a feed. Four is what fits at a
|
|
7
|
+
* size that can be read, and the post itself is where the rest of them are.
|
|
8
|
+
*/
|
|
9
|
+
export const maxChanges = 4;
|
|
10
|
+
/** Vertical advance from one change to the next, as a multiple of its size. */
|
|
11
|
+
const step = 1.85;
|
|
12
|
+
/** The bullet's diameter, as a fraction of the text's size. */
|
|
13
|
+
const bulletScale = 0.26;
|
|
14
|
+
/** The room a list of this many changes takes. */
|
|
15
|
+
export function changesHeight(count, fontSize) {
|
|
16
|
+
return count === 0 ? 0 : Math.round((count - 1) * fontSize * step + fontSize);
|
|
17
|
+
}
|
|
18
|
+
/** One change: its bullet, then the line, cut to the width it has. */
|
|
19
|
+
function change(text, top, area, style, measure) {
|
|
20
|
+
const { fontSize } = style;
|
|
21
|
+
const indent = Math.round(fontSize * 0.95);
|
|
22
|
+
const diameter = Math.round(fontSize * bulletScale);
|
|
23
|
+
return (box({
|
|
24
|
+
x: area.x,
|
|
25
|
+
y: Math.round(top + (fontSize - diameter) / 2),
|
|
26
|
+
width: diameter,
|
|
27
|
+
height: diameter,
|
|
28
|
+
}, { radius: Math.round(diameter / 2), fill: style.accent }) +
|
|
29
|
+
textElement(clampLine(text, area.width - indent, measureIn(measure, style.fontFamily, 500), fontSize), {
|
|
30
|
+
x: area.x + indent,
|
|
31
|
+
y: baselineFor(top, fontSize),
|
|
32
|
+
fontFamily: style.fontFamily,
|
|
33
|
+
fontSize,
|
|
34
|
+
fontWeight: 500,
|
|
35
|
+
fill: style.fill,
|
|
36
|
+
fillOpacity: 0.9,
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
/** The list of changes, drawn down from the top of the space it was given. */
|
|
40
|
+
export function changeList(items, area, style, measure) {
|
|
41
|
+
return items
|
|
42
|
+
.map((text, index) => change(text, area.y + Math.round(index * style.fontSize * step), area, style, measure))
|
|
43
|
+
.join("");
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=changes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changes.js","sourceRoot":"","sources":["../../../src/templates/release/changes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,GAAG,EACH,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAE5B,+EAA+E;AAC/E,MAAM,IAAI,GAAG,IAAI,CAAC;AAElB,+DAA+D;AAC/D,MAAM,WAAW,GAAG,IAAI,CAAC;AAWzB,kDAAkD;AAClD,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,QAAgB;IAC3D,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC;AAChF,CAAC;AAED,sEAAsE;AACtE,SAAS,MAAM,CACb,IAAY,EACZ,GAAW,EACX,IAAU,EACV,KAAkB,EAClB,OAAoB;IAEpB,MAAM,EAAE,QAAQ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AG,IAAI,CAAC,EAClD,IAAI,EACJ,KAAK,EACL,OAAO,CACR,CACF;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A release: the version, what it is, and the headline changes as a list.
|
|
4
|
+
*
|
|
5
|
+
* The `changes` prop is what this template has that the others do not. A
|
|
6
|
+
* changelog post's frontmatter usually carries the list already, for the
|
|
7
|
+
* release notes the site builds from it, so the image comes out of fields the
|
|
8
|
+
* post was going to have anyway.
|
|
9
|
+
*/
|
|
10
|
+
export declare const releaseTemplate: Template;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/release/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAWhE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,QA0D7B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { linesHeight, stack, stringList } from "../../layout/index.js";
|
|
2
|
+
import { drawSlot, footerLine } from "../bottom.js";
|
|
3
|
+
import { contentArea, gapAfter, imageFrame, markRoom } from "../frame.js";
|
|
4
|
+
import { logoElement, logoRect } from "../logo.js";
|
|
5
|
+
import { changeBlock } from "./block.js";
|
|
6
|
+
import { changesHeight, maxChanges } from "./changes.js";
|
|
7
|
+
import { releaseLines } from "./lines.js";
|
|
8
|
+
/** How the version and the headline are stacked. */
|
|
9
|
+
const lineHeight = 1.2;
|
|
10
|
+
/**
|
|
11
|
+
* A release: the version, what it is, and the headline changes as a list.
|
|
12
|
+
*
|
|
13
|
+
* The `changes` prop is what this template has that the others do not. A
|
|
14
|
+
* changelog post's frontmatter usually carries the list already, for the
|
|
15
|
+
* release notes the site builds from it, so the image comes out of fields the
|
|
16
|
+
* post was going to have anyway.
|
|
17
|
+
*/
|
|
18
|
+
export const releaseTemplate = {
|
|
19
|
+
name: "release",
|
|
20
|
+
render({ props, config, dimensions, measure, logo, avatar, }) {
|
|
21
|
+
const { width, height } = dimensions;
|
|
22
|
+
const { fontFamily, colors } = config;
|
|
23
|
+
const frame = imageFrame(dimensions, config, avatar);
|
|
24
|
+
const { pad } = frame;
|
|
25
|
+
const mark = logoRect(logo, dimensions, pad, "start");
|
|
26
|
+
const area = contentArea(frame, markRoom(mark?.height, Math.round(height * 0.03)));
|
|
27
|
+
const lines = releaseLines(props, {
|
|
28
|
+
measure,
|
|
29
|
+
fontFamily,
|
|
30
|
+
contentWidth: area.width,
|
|
31
|
+
versionFs: Math.round(height * 0.12),
|
|
32
|
+
headlineFs: Math.round(height * 0.052),
|
|
33
|
+
height,
|
|
34
|
+
});
|
|
35
|
+
const changes = stringList(props["changes"]).slice(0, maxChanges);
|
|
36
|
+
const changeFs = Math.round(height * 0.037);
|
|
37
|
+
const listHeight = changesHeight(changes.length, changeFs);
|
|
38
|
+
const [headSlot, listSlot] = stack([
|
|
39
|
+
{ size: linesHeight(lines, lineHeight) },
|
|
40
|
+
{
|
|
41
|
+
size: listHeight,
|
|
42
|
+
gapBefore: gapAfter(listHeight, Math.round(height * 0.06)),
|
|
43
|
+
},
|
|
44
|
+
], area);
|
|
45
|
+
const head = drawSlot(lines, headSlot, {
|
|
46
|
+
fontFamily,
|
|
47
|
+
fill: colors.foreground,
|
|
48
|
+
lineHeight,
|
|
49
|
+
});
|
|
50
|
+
const list = changeBlock(changes, listSlot, changeFs, config, measure);
|
|
51
|
+
const footer = footerLine(config, frame, width, avatar, measure);
|
|
52
|
+
return logoElement(logo, mark) + head + list + footer;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/release/index.ts"],"names":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 -0,0 +1,21 @@
|
|
|
1
|
+
import type { TextLine } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, MetaImageProps } from "../../types.js";
|
|
3
|
+
/** The space the release's heading has, and how to measure it into it. */
|
|
4
|
+
export interface ReleaseText {
|
|
5
|
+
readonly measure: MeasureText;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly contentWidth: number;
|
|
8
|
+
readonly versionFs: number;
|
|
9
|
+
readonly headlineFs: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The version, then what the release is about.
|
|
14
|
+
*
|
|
15
|
+
* The version is the headline here rather than a line under the title, which
|
|
16
|
+
* is the difference between this template and the `banner`. A changelog post
|
|
17
|
+
* is read by somebody who already knows what the project is and wants to know
|
|
18
|
+
* which release this is.
|
|
19
|
+
*/
|
|
20
|
+
export declare function releaseLines(props: MetaImageProps, text: ReleaseText): TextLine[];
|
|
21
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../../src/templates/release/lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAOlE,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,WAAW,GAChB,QAAQ,EAAE,CAsBZ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { blockLines } from "../../layout/index.js";
|
|
2
|
+
import { versionLabel } from "../version.js";
|
|
3
|
+
const maxHeadlineLines = 2;
|
|
4
|
+
const versionFloor = 0.45;
|
|
5
|
+
const headlineFloor = 0.7;
|
|
6
|
+
/**
|
|
7
|
+
* The version, then what the release is about.
|
|
8
|
+
*
|
|
9
|
+
* The version is the headline here rather than a line under the title, which
|
|
10
|
+
* is the difference between this template and the `banner`. A changelog post
|
|
11
|
+
* is read by somebody who already knows what the project is and wants to know
|
|
12
|
+
* which release this is.
|
|
13
|
+
*/
|
|
14
|
+
export function releaseLines(props, text) {
|
|
15
|
+
const { measure, fontFamily, contentWidth } = text;
|
|
16
|
+
return [
|
|
17
|
+
...blockLines(versionLabel(props.version), measure, fontFamily, {
|
|
18
|
+
maxWidth: contentWidth,
|
|
19
|
+
maxLines: 1,
|
|
20
|
+
fontSize: text.versionFs,
|
|
21
|
+
floor: versionFloor,
|
|
22
|
+
fontWeight: 800,
|
|
23
|
+
opacity: 1,
|
|
24
|
+
}),
|
|
25
|
+
...blockLines(props.title, measure, fontFamily, {
|
|
26
|
+
maxWidth: contentWidth,
|
|
27
|
+
maxLines: maxHeadlineLines,
|
|
28
|
+
fontSize: text.headlineFs,
|
|
29
|
+
floor: headlineFloor,
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
opacity: 0.9,
|
|
32
|
+
gapBefore: Math.round(text.height * 0.022),
|
|
33
|
+
}),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../../src/templates/release/lines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,aAAa,GAAG,GAAG,CAAC;AAY1B;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAqB,EACrB,IAAiB;IAEjB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEnD,OAAO;QACL,GAAG,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE;YAC9D,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,KAAK,EAAE,YAAY;YACnB,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,CAAC;SACX,CAAC;QACF,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE;YAC9C,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,gBAAgB;YAC1B,QAAQ,EAAE,IAAI,CAAC,UAAU;YACzB,KAAK,EAAE,aAAa;YACpB,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,GAAG;YACZ,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* One big number and a caption: downloads, uptime, a headline figure from a
|
|
4
|
+
* post. Reads `stat` for the figure, `title` for the small label above it and
|
|
5
|
+
* `subtitle` for the caption below, all of them optional.
|
|
6
|
+
*
|
|
7
|
+
* Everything is centred, as on the `card`, because a figure is looked at
|
|
8
|
+
* rather than read and the middle is where the eye lands.
|
|
9
|
+
*/
|
|
10
|
+
export declare const statTemplate: Template;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/stat/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAMhE;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,QAwC1B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { drawLines } from "../../layout/index.js";
|
|
2
|
+
import { footerLine } from "../bottom.js";
|
|
3
|
+
import { contentArea, imageFrame, markRoom } from "../frame.js";
|
|
4
|
+
import { logoElement, logoRect } from "../logo.js";
|
|
5
|
+
import { statLines } from "./lines.js";
|
|
6
|
+
/**
|
|
7
|
+
* One big number and a caption: downloads, uptime, a headline figure from a
|
|
8
|
+
* post. Reads `stat` for the figure, `title` for the small label above it and
|
|
9
|
+
* `subtitle` for the caption below, all of them optional.
|
|
10
|
+
*
|
|
11
|
+
* Everything is centred, as on the `card`, because a figure is looked at
|
|
12
|
+
* rather than read and the middle is where the eye lands.
|
|
13
|
+
*/
|
|
14
|
+
export const statTemplate = {
|
|
15
|
+
name: "stat",
|
|
16
|
+
render({ props, config, dimensions, measure, logo, avatar, }) {
|
|
17
|
+
const { width, height } = dimensions;
|
|
18
|
+
const frame = imageFrame(dimensions, config, avatar, {
|
|
19
|
+
padScale: 0.09,
|
|
20
|
+
});
|
|
21
|
+
const { pad } = frame;
|
|
22
|
+
const mark = logoRect(logo, dimensions, pad, "middle");
|
|
23
|
+
const area = contentArea(frame, markRoom(mark?.height, pad / 2));
|
|
24
|
+
const lines = statLines(props, {
|
|
25
|
+
measure,
|
|
26
|
+
fontFamily: config.fontFamily,
|
|
27
|
+
contentWidth: area.width,
|
|
28
|
+
labelFs: Math.round(height * 0.042),
|
|
29
|
+
figureFs: Math.round(height * 0.26),
|
|
30
|
+
captionFs: Math.round(height * 0.045),
|
|
31
|
+
height,
|
|
32
|
+
});
|
|
33
|
+
const body = drawLines(lines, area, {
|
|
34
|
+
fontFamily: config.fontFamily,
|
|
35
|
+
fill: config.colors.foreground,
|
|
36
|
+
lineHeight: 1.15,
|
|
37
|
+
anchor: "middle",
|
|
38
|
+
});
|
|
39
|
+
const footer = footerLine(config, frame, width, avatar, measure, "middle");
|
|
40
|
+
return logoElement(logo, mark) + body + footer;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/stat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa;IACpC,IAAI,EAAE,MAAM;IACZ,MAAM,CAAC,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,IAAI,EACJ,MAAM,GACU;QAChB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACrC,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE;YACnD,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;QACtB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEvD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEjE,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE;YAC7B,OAAO;YACP,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,YAAY,EAAE,IAAI,CAAC,KAAK;YACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACnC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;YACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACrC,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE;YAClC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YAC9B,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QAE3E,OAAO,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC;IACjD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TextLine } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, MetaImageProps } from "../../types.js";
|
|
3
|
+
/** The space the stat's three groups have, and how to measure text into them. */
|
|
4
|
+
export interface StatText {
|
|
5
|
+
readonly measure: MeasureText;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly contentWidth: number;
|
|
8
|
+
readonly labelFs: number;
|
|
9
|
+
readonly figureFs: number;
|
|
10
|
+
readonly captionFs: number;
|
|
11
|
+
readonly height: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The stat's text block: a label, the figure itself, then the caption under it.
|
|
15
|
+
*
|
|
16
|
+
* The figure has much further to shrink than anything else in the built-ins,
|
|
17
|
+
* because it is one line that must not wrap and the props decide how long it
|
|
18
|
+
* is: `42` and `1.4 million downloads` are both stats somebody will write.
|
|
19
|
+
* Shrinking is the only way both end up inside the margins, and the floor is
|
|
20
|
+
* low enough that the second still reads as the headline of the image.
|
|
21
|
+
*/
|
|
22
|
+
export declare function statLines(props: MetaImageProps, text: StatText): TextLine[];
|
|
23
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../../src/templates/stat/lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQlE,iFAAiF;AACjF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAE,CA+B3E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { blockLines } from "../../layout/index.js";
|
|
2
|
+
const maxLabelLines = 1;
|
|
3
|
+
const maxCaptionLines = 3;
|
|
4
|
+
const figureFloor = 0.35;
|
|
5
|
+
const labelFloor = 0.7;
|
|
6
|
+
const captionFloor = 0.8;
|
|
7
|
+
/**
|
|
8
|
+
* The stat's text block: a label, the figure itself, then the caption under it.
|
|
9
|
+
*
|
|
10
|
+
* The figure has much further to shrink than anything else in the built-ins,
|
|
11
|
+
* because it is one line that must not wrap and the props decide how long it
|
|
12
|
+
* is: `42` and `1.4 million downloads` are both stats somebody will write.
|
|
13
|
+
* Shrinking is the only way both end up inside the margins, and the floor is
|
|
14
|
+
* low enough that the second still reads as the headline of the image.
|
|
15
|
+
*/
|
|
16
|
+
export function statLines(props, text) {
|
|
17
|
+
const { measure, fontFamily, contentWidth } = text;
|
|
18
|
+
return [
|
|
19
|
+
...blockLines(props.title, measure, fontFamily, {
|
|
20
|
+
maxWidth: contentWidth,
|
|
21
|
+
maxLines: maxLabelLines,
|
|
22
|
+
fontSize: text.labelFs,
|
|
23
|
+
floor: labelFloor,
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
opacity: 0.75,
|
|
26
|
+
}),
|
|
27
|
+
...blockLines(props["stat"], measure, fontFamily, {
|
|
28
|
+
maxWidth: contentWidth,
|
|
29
|
+
maxLines: 1,
|
|
30
|
+
fontSize: text.figureFs,
|
|
31
|
+
floor: figureFloor,
|
|
32
|
+
fontWeight: 800,
|
|
33
|
+
opacity: 1,
|
|
34
|
+
gapBefore: Math.round(text.height * 0.02),
|
|
35
|
+
}),
|
|
36
|
+
...blockLines(props.subtitle, measure, fontFamily, {
|
|
37
|
+
maxWidth: contentWidth,
|
|
38
|
+
maxLines: maxCaptionLines,
|
|
39
|
+
fontSize: text.captionFs,
|
|
40
|
+
floor: captionFloor,
|
|
41
|
+
fontWeight: 500,
|
|
42
|
+
opacity: 0.85,
|
|
43
|
+
gapBefore: Math.round(text.height * 0.018),
|
|
44
|
+
}),
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceR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YACb,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A command and what it printed, in a terminal window.
|
|
4
|
+
*
|
|
5
|
+
* Reads `command`, `output`, an optional `prompt` (`$` by default) and an
|
|
6
|
+
* optional `title` for the window bar. What separates it from the `code`
|
|
7
|
+
* template is the chrome: the same text on a plain panel is a snippet, and in
|
|
8
|
+
* a window it is something somebody ran.
|
|
9
|
+
*
|
|
10
|
+
* Almost all of it is the `code` template underneath, down to the character
|
|
11
|
+
* grid, the fitting and the truncation warning, so everything under
|
|
12
|
+
* `config.code` applies here too: the monospace family, the line height, the
|
|
13
|
+
* syntax theme the window takes its colours from, and the font-size bounds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const terminalTemplate: Template;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/terminal/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAa/C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAoE9B,CAAC"}
|