@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
|
@@ -7,5 +7,5 @@ import type { Dimensions, ResolvedConfig } from "../../types.js";
|
|
|
7
7
|
export declare function warnIfTruncated(config: ResolvedConfig, dimensions: Dimensions, counts: {
|
|
8
8
|
readonly dropped: number;
|
|
9
9
|
readonly clipped: number;
|
|
10
|
-
}, total: number): void;
|
|
10
|
+
}, total: number, subject?: string): void;
|
|
11
11
|
//# sourceMappingURL=warn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warn.d.ts","sourceRoot":"","sources":["../../../src/templates/code/warn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMjE;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"warn.d.ts","sourceRoot":"","sources":["../../../src/templates/code/warn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMjE;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC9D,KAAK,EAAE,MAAM,EACb,OAAO,SAAiB,GACvB,IAAI,CAoBN"}
|
|
@@ -6,7 +6,7 @@ function plural(count, noun) {
|
|
|
6
6
|
* says the sample continued, so silent truncation is how a half-a-function
|
|
7
7
|
* share card ends up on someone else's timeline.
|
|
8
8
|
*/
|
|
9
|
-
export function warnIfTruncated(config, dimensions, counts, total) {
|
|
9
|
+
export function warnIfTruncated(config, dimensions, counts, total, subject = "code snippet") {
|
|
10
10
|
const parts = [];
|
|
11
11
|
if (counts.dropped > 0) {
|
|
12
12
|
parts.push(`${String(counts.dropped)} of ${plural(total, "line")} dropped`);
|
|
@@ -17,7 +17,7 @@ export function warnIfTruncated(config, dimensions, counts, total) {
|
|
|
17
17
|
if (parts.length === 0) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
config.onWarning(
|
|
20
|
+
config.onWarning(`${subject} does not fit the ${String(dimensions.width)}x${String(dimensions.height)}` +
|
|
21
21
|
` image at a legible size: ${parts.join(", ")}.` +
|
|
22
22
|
` Shorten the sample, or lower code.minFontScale to fit it in smaller.`);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warn.js","sourceRoot":"","sources":["../../../src/templates/code/warn.ts"],"names":[],"mappings":"AAEA,SAAS,MAAM,CAAC,KAAa,EAAE,IAAY;IACzC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAsB,EACtB,UAAsB,EACtB,MAA8D,EAC9D,KAAa;
|
|
1
|
+
{"version":3,"file":"warn.js","sourceRoot":"","sources":["../../../src/templates/code/warn.ts"],"names":[],"mappings":"AAEA,SAAS,MAAM,CAAC,KAAa,EAAE,IAAY;IACzC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAsB,EACtB,UAAsB,EACtB,MAA8D,EAC9D,KAAa,EACb,OAAO,GAAG,cAAc;IAExB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,6BAA6B,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IAED,MAAM,CAAC,SAAS,CACd,GAAG,OAAO,qBAAqB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACpF,6BAA6B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QAChD,uEAAuE,CAC1E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Dimensions, MeasureText, MetaImageProps, ResolvedConfig } from "../../types.js";
|
|
2
|
+
/** The trail and the rule under it, along with the room the two take. */
|
|
3
|
+
export interface Chrome {
|
|
4
|
+
readonly svg: string;
|
|
5
|
+
/** How far down the image the content below it may start. */
|
|
6
|
+
readonly bottom: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The trail through the documentation and the rule under it.
|
|
10
|
+
*
|
|
11
|
+
* The rule is only drawn where there is a trail above it to separate, since a
|
|
12
|
+
* line across an image with nothing above it is decoration rather than
|
|
13
|
+
* structure. `room` is what the trail leaves for the title, and it is nothing
|
|
14
|
+
* at all when the post named no breadcrumb.
|
|
15
|
+
*/
|
|
16
|
+
export declare function docsChrome(props: MetaImageProps, config: ResolvedConfig, dimensions: Dimensions, pad: number, reserved: number, measure: MeasureText): Chrome;
|
|
17
|
+
//# sourceMappingURL=chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/templates/docs/chrome.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,cAAc,EACf,MAAM,gBAAgB,CAAC;AAYxB,yEAAyE;AACzE,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,MAAM,CAsCR"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { baselineFor, box, measureIn, stringList, textElement, } from "../../layout/index.js";
|
|
2
|
+
import { crumbLine } from "./crumbs.js";
|
|
3
|
+
/** The trail's size, as a fraction of the image's height. */
|
|
4
|
+
const trailScale = 0.036;
|
|
5
|
+
/** Where the rule under the trail goes, as a fraction of the height. */
|
|
6
|
+
const ruleOffset = 0.058;
|
|
7
|
+
/** Clear space between the rule and the title, as a fraction of the height. */
|
|
8
|
+
const ruleGap = 0.05;
|
|
9
|
+
/**
|
|
10
|
+
* The trail through the documentation and the rule under it.
|
|
11
|
+
*
|
|
12
|
+
* The rule is only drawn where there is a trail above it to separate, since a
|
|
13
|
+
* line across an image with nothing above it is decoration rather than
|
|
14
|
+
* structure. `room` is what the trail leaves for the title, and it is nothing
|
|
15
|
+
* at all when the post named no breadcrumb.
|
|
16
|
+
*/
|
|
17
|
+
export function docsChrome(props, config, dimensions, pad, reserved, measure) {
|
|
18
|
+
const { width, height } = dimensions;
|
|
19
|
+
const fontSize = Math.round(height * trailScale);
|
|
20
|
+
const trail = crumbLine(stringList(props["breadcrumb"]), width - pad * 2 - reserved, measureIn(measure, config.fontFamily, 600), fontSize);
|
|
21
|
+
if (trail === undefined) {
|
|
22
|
+
return { svg: "", bottom: 0 };
|
|
23
|
+
}
|
|
24
|
+
const ruleY = pad + Math.round(height * ruleOffset);
|
|
25
|
+
return {
|
|
26
|
+
svg: textElement(trail, {
|
|
27
|
+
x: pad,
|
|
28
|
+
y: baselineFor(pad, fontSize),
|
|
29
|
+
fontFamily: config.fontFamily,
|
|
30
|
+
fontSize,
|
|
31
|
+
fontWeight: 600,
|
|
32
|
+
fill: config.colors.foreground,
|
|
33
|
+
fillOpacity: 0.72,
|
|
34
|
+
}) +
|
|
35
|
+
box({
|
|
36
|
+
x: pad,
|
|
37
|
+
y: ruleY,
|
|
38
|
+
width: width - pad * 2,
|
|
39
|
+
height: Math.max(1, Math.round(height * 0.003)),
|
|
40
|
+
}, { fill: config.colors.foreground, fillOpacity: 0.22 }),
|
|
41
|
+
bottom: ruleY + Math.round(height * ruleGap),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../../src/templates/docs/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,GAAG,EACH,SAAS,EACT,UAAU,EACV,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,6DAA6D;AAC7D,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,wEAAwE;AACxE,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,+EAA+E;AAC/E,MAAM,OAAO,GAAG,IAAI,CAAC;AASrB;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,KAAqB,EACrB,MAAsB,EACtB,UAAsB,EACtB,GAAW,EACX,QAAgB,EAChB,OAAoB;IAEpB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,SAAS,CACrB,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAC/B,KAAK,GAAG,GAAG,GAAG,CAAC,GAAG,QAAQ,EAC1B,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,EAC1C,QAAQ,CACT,CAAC;IAEF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChC,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IAEpD,OAAO;QACL,GAAG,EACD,WAAW,CAAC,KAAK,EAAE;YACjB,CAAC,EAAE,GAAG;YACN,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC;YAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,QAAQ;YACR,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;YAC9B,WAAW,EAAE,IAAI;SAClB,CAAC;YACF,GAAG,CACD;gBACE,CAAC,EAAE,GAAG;gBACN,CAAC,EAAE,KAAK;gBACR,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,CAAC;gBACtB,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;aAChD,EACD,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,CACtD;QACH,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MeasureAt } from "../../layout/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The breadcrumb as one line, narrow enough for the width it has.
|
|
4
|
+
*
|
|
5
|
+
* Segments are dropped from the front rather than the back, and an ellipsis
|
|
6
|
+
* put in their place. The trail's last segments say where the page sits and
|
|
7
|
+
* its first say which site it is on, and the reader can see the site from
|
|
8
|
+
* everything else in the image.
|
|
9
|
+
*
|
|
10
|
+
* It is never wrapped or shrunk. A breadcrumb is chrome: two lines of it would
|
|
11
|
+
* be competing with the title, which is the thing being shared.
|
|
12
|
+
*/
|
|
13
|
+
export declare function crumbLine(parts: readonly string[], maxWidth: number, measure: MeasureAt, fontSize: number): string | undefined;
|
|
14
|
+
//# sourceMappingURL=crumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crumbs.d.ts","sourceRoot":"","sources":["../../../src/templates/docs/crumbs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQvD;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAiBpB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { clampLine } from "../../layout/index.js";
|
|
2
|
+
/** What goes between two segments of the trail. */
|
|
3
|
+
const separator = " / ";
|
|
4
|
+
/** What stands for the segments that were dropped. */
|
|
5
|
+
const elided = "…";
|
|
6
|
+
/**
|
|
7
|
+
* The breadcrumb as one line, narrow enough for the width it has.
|
|
8
|
+
*
|
|
9
|
+
* Segments are dropped from the front rather than the back, and an ellipsis
|
|
10
|
+
* put in their place. The trail's last segments say where the page sits and
|
|
11
|
+
* its first say which site it is on, and the reader can see the site from
|
|
12
|
+
* everything else in the image.
|
|
13
|
+
*
|
|
14
|
+
* It is never wrapped or shrunk. A breadcrumb is chrome: two lines of it would
|
|
15
|
+
* be competing with the title, which is the thing being shared.
|
|
16
|
+
*/
|
|
17
|
+
export function crumbLine(parts, maxWidth, measure, fontSize) {
|
|
18
|
+
if (parts.length === 0) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
for (let from = 0; from < parts.length; from += 1) {
|
|
22
|
+
const kept = parts.slice(from);
|
|
23
|
+
const line = (from === 0 ? kept : [elided, ...kept]).join(separator);
|
|
24
|
+
if (measure(line, fontSize) <= maxWidth) {
|
|
25
|
+
return line;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// Not even the last segment on its own fits, so it is cut to the width
|
|
29
|
+
// rather than drawn past the margin.
|
|
30
|
+
return clampLine(parts.at(-1) ?? "", maxWidth, measure, fontSize);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=crumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crumbs.js","sourceRoot":"","sources":["../../../src/templates/docs/crumbs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,mDAAmD;AACnD,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB,sDAAsD;AACtD,MAAM,MAAM,GAAG,GAAG,CAAC;AAEnB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CACvB,KAAwB,EACxB,QAAgB,EAChB,OAAkB,EAClB,QAAgB;IAEhB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAErE,IAAI,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,uEAAuE;IACvE,qCAAqC;IACrC,OAAO,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A reference page: the trail through the documentation that leads to it, a
|
|
4
|
+
* rule, then the page's title and summary.
|
|
5
|
+
*
|
|
6
|
+
* Docs pages share badly. Their titles are short and often ambiguous on their
|
|
7
|
+
* own, since "Fonts" or "Configuration" says nothing about which project's,
|
|
8
|
+
* and the trail above the title is what a reader needs to place them. It reads
|
|
9
|
+
* `breadcrumb`, which may be a list or a single string, along with the usual
|
|
10
|
+
* `title` and `subtitle`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const docsTemplate: Template;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/docs/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAOhE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,QAqD1B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { docsChrome } from "./chrome.js";
|
|
6
|
+
import { docsLines } from "./lines.js";
|
|
7
|
+
/**
|
|
8
|
+
* A reference page: the trail through the documentation that leads to it, a
|
|
9
|
+
* rule, then the page's title and summary.
|
|
10
|
+
*
|
|
11
|
+
* Docs pages share badly. Their titles are short and often ambiguous on their
|
|
12
|
+
* own, since "Fonts" or "Configuration" says nothing about which project's,
|
|
13
|
+
* and the trail above the title is what a reader needs to place them. It reads
|
|
14
|
+
* `breadcrumb`, which may be a list or a single string, along with the usual
|
|
15
|
+
* `title` and `subtitle`.
|
|
16
|
+
*/
|
|
17
|
+
export const docsTemplate = {
|
|
18
|
+
name: "docs",
|
|
19
|
+
render({ props, config, dimensions, measure, logo, avatar, }) {
|
|
20
|
+
const { width, height } = dimensions;
|
|
21
|
+
const { fontFamily, colors } = config;
|
|
22
|
+
const frame = imageFrame(dimensions, config, avatar);
|
|
23
|
+
const { pad } = frame;
|
|
24
|
+
const mark = logoRect(logo, dimensions, pad, "start");
|
|
25
|
+
const chrome = docsChrome(props, config, dimensions, pad, markRoom(mark?.width, pad / 2), measure);
|
|
26
|
+
// The title starts below whichever of the trail and the logo reaches
|
|
27
|
+
// furthest down. Both are measured from the top of the image, so the room
|
|
28
|
+
// the content area is asked for is the larger of the two, less the margin
|
|
29
|
+
// it adds back.
|
|
30
|
+
const belowMark = markRoom(mark?.height, Math.round(height * 0.03));
|
|
31
|
+
const belowTrail = Math.max(0, chrome.bottom - pad);
|
|
32
|
+
const area = contentArea(frame, Math.max(belowMark, belowTrail));
|
|
33
|
+
const body = drawLines(docsLines(props, {
|
|
34
|
+
measure,
|
|
35
|
+
fontFamily,
|
|
36
|
+
contentWidth: area.width,
|
|
37
|
+
titleFs: Math.round(height * 0.088),
|
|
38
|
+
summaryFs: Math.round(height * 0.044),
|
|
39
|
+
height,
|
|
40
|
+
}), area, { fontFamily, fill: colors.foreground, lineHeight: 1.28 });
|
|
41
|
+
return (chrome.svg +
|
|
42
|
+
logoElement(logo, mark) +
|
|
43
|
+
body +
|
|
44
|
+
footerLine(config, frame, width, avatar, measure));
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/docs/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,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;;GASG;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,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACtC,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;QACtB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAEtD,MAAM,MAAM,GAAG,UAAU,CACvB,KAAK,EACL,MAAM,EACN,UAAU,EACV,GAAG,EACH,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,EAC9B,OAAO,CACR,CAAC;QAEF,qEAAqE;QACrE,0EAA0E;QAC1E,0EAA0E;QAC1E,gBAAgB;QAChB,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;QACpE,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;QAEjE,MAAM,IAAI,GAAG,SAAS,CACpB,SAAS,CAAC,KAAK,EAAE;YACf,OAAO;YACP,UAAU;YACV,YAAY,EAAE,IAAI,CAAC,KAAK;YACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACrC,MAAM;SACP,CAAC,EACF,IAAI,EACJ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAC1D,CAAC;QAEF,OAAO,CACL,MAAM,CAAC,GAAG;YACV,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC;YACvB,IAAI;YACJ,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAClD,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TextLine } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, MetaImageProps } from "../../types.js";
|
|
3
|
+
/** The space the page's text has, and how to measure it into it. */
|
|
4
|
+
export interface DocsText {
|
|
5
|
+
readonly measure: MeasureText;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly contentWidth: number;
|
|
8
|
+
readonly titleFs: number;
|
|
9
|
+
readonly summaryFs: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
/** The page title, then the summary under it. */
|
|
13
|
+
export declare function docsLines(props: MetaImageProps, text: DocsText): TextLine[];
|
|
14
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../../src/templates/docs/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,oEAAoE;AACpE,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,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,iDAAiD;AACjD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAsB3E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { blockLines } from "../../layout/index.js";
|
|
2
|
+
const maxTitleLines = 3;
|
|
3
|
+
const maxSummaryLines = 3;
|
|
4
|
+
const titleFloor = 0.62;
|
|
5
|
+
const summaryFloor = 0.8;
|
|
6
|
+
/** The page title, then the summary under it. */
|
|
7
|
+
export function docsLines(props, text) {
|
|
8
|
+
const { measure, fontFamily, contentWidth } = text;
|
|
9
|
+
return [
|
|
10
|
+
...blockLines(props.title, measure, fontFamily, {
|
|
11
|
+
maxWidth: contentWidth,
|
|
12
|
+
maxLines: maxTitleLines,
|
|
13
|
+
fontSize: text.titleFs,
|
|
14
|
+
floor: titleFloor,
|
|
15
|
+
fontWeight: 800,
|
|
16
|
+
opacity: 1,
|
|
17
|
+
}),
|
|
18
|
+
...blockLines(props.subtitle, measure, fontFamily, {
|
|
19
|
+
maxWidth: contentWidth,
|
|
20
|
+
maxLines: maxSummaryLines,
|
|
21
|
+
fontSize: text.summaryFs,
|
|
22
|
+
floor: summaryFloor,
|
|
23
|
+
fontWeight: 500,
|
|
24
|
+
opacity: 0.85,
|
|
25
|
+
gapBefore: Math.round(text.height * 0.035),
|
|
26
|
+
}),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../../src/templates/docs/lines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,YAAY,GAAG,GAAG,CAAC;AAYzB,iDAAiD;AACjD,MAAM,UAAU,SAAS,CAAC,KAAqB,EAAE,IAAc;IAC7D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEnD,OAAO;QACL,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE;YAC9C,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,aAAa;YACvB,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,CAAC;SACX,CAAC;QACF,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE;YACjD,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,eAAe;YACzB,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,KAAK,EAAE,YAAY;YACnB,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A talk, a meetup or a workshop: the date on a plate, then what it is and
|
|
4
|
+
* where. Reads `date`, `title` and `location`.
|
|
5
|
+
*
|
|
6
|
+
* The date is set apart on the accent colour rather than being another line of
|
|
7
|
+
* text, because it is the one thing a reader is scanning for. Nothing here
|
|
8
|
+
* parses or formats it: whatever the post wrote is what is drawn, since a
|
|
9
|
+
* build cannot know which locale or how much precision the event wants.
|
|
10
|
+
*/
|
|
11
|
+
export declare const eventTemplate: Template;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/event/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAUhE;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,QA2D3B,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { linesHeight, optionalString, stack } 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 { eventLines } from "./lines.js";
|
|
6
|
+
import { datePlate, plateHeight, plateStyle } from "./plate.js";
|
|
7
|
+
/** How the lines of the title and location are stacked. */
|
|
8
|
+
const lineHeight = 1.24;
|
|
9
|
+
/**
|
|
10
|
+
* A talk, a meetup or a workshop: the date on a plate, then what it is and
|
|
11
|
+
* where. Reads `date`, `title` and `location`.
|
|
12
|
+
*
|
|
13
|
+
* The date is set apart on the accent colour rather than being another line of
|
|
14
|
+
* text, because it is the one thing a reader is scanning for. Nothing here
|
|
15
|
+
* parses or formats it: whatever the post wrote is what is drawn, since a
|
|
16
|
+
* build cannot know which locale or how much precision the event wants.
|
|
17
|
+
*/
|
|
18
|
+
export const eventTemplate = {
|
|
19
|
+
name: "event",
|
|
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
|
+
padScale: 0.09,
|
|
25
|
+
});
|
|
26
|
+
const { pad } = frame;
|
|
27
|
+
const mark = logoRect(logo, dimensions, pad, "middle");
|
|
28
|
+
const area = contentArea(frame, markRoom(mark?.height, pad / 2));
|
|
29
|
+
const lines = eventLines(props, {
|
|
30
|
+
measure,
|
|
31
|
+
fontFamily,
|
|
32
|
+
contentWidth: area.width,
|
|
33
|
+
titleFs: Math.round(height * 0.095),
|
|
34
|
+
locationFs: Math.round(height * 0.045),
|
|
35
|
+
height,
|
|
36
|
+
});
|
|
37
|
+
const date = optionalString(props["date"]) ?? "";
|
|
38
|
+
const plate = plateHeight(date, height);
|
|
39
|
+
const [dateSlot, textSlot] = stack([
|
|
40
|
+
{ size: plate },
|
|
41
|
+
{
|
|
42
|
+
size: linesHeight(lines, lineHeight),
|
|
43
|
+
gapBefore: gapAfter(plate, Math.round(height * 0.045)),
|
|
44
|
+
},
|
|
45
|
+
], area);
|
|
46
|
+
const body = drawSlot(lines, textSlot, {
|
|
47
|
+
fontFamily,
|
|
48
|
+
fill: colors.foreground,
|
|
49
|
+
lineHeight,
|
|
50
|
+
anchor: "middle",
|
|
51
|
+
});
|
|
52
|
+
const footer = footerLine(config, frame, width, avatar, measure, "middle");
|
|
53
|
+
return (logoElement(logo, mark) +
|
|
54
|
+
datePlate(date, dateSlot, plateStyle(config), measure) +
|
|
55
|
+
body +
|
|
56
|
+
footer);
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEhE,2DAA2D;AAC3D,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAa;IACrC,IAAI,EAAE,OAAO;IACb,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,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACtC,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,UAAU,CAAC,KAAK,EAAE;YAC9B,OAAO;YACP,UAAU;YACV,YAAY,EAAE,IAAI,CAAC,KAAK;YACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACnC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACtC,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAExC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,KAAK,CAChC;YACE,EAAE,IAAI,EAAE,KAAK,EAAE;YACf;gBACE,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC;gBACpC,SAAS,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;aACvD;SACF,EACD,IAAI,CACL,CAAC;QAEF,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;YACrC,UAAU;YACV,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,UAAU;YACV,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,CACL,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC;YACvB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;YACtD,IAAI;YACJ,MAAM,CACP,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TextLine } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, MetaImageProps } from "../../types.js";
|
|
3
|
+
/** The space the event's text has, and how to measure it into it. */
|
|
4
|
+
export interface EventText {
|
|
5
|
+
readonly measure: MeasureText;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly contentWidth: number;
|
|
8
|
+
readonly titleFs: number;
|
|
9
|
+
readonly locationFs: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
/** What the event is, then where it is. */
|
|
13
|
+
export declare function eventLines(props: MetaImageProps, text: EventText): TextLine[];
|
|
14
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../../src/templates/event/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,qEAAqE;AACrE,MAAM,WAAW,SAAS;IACxB,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,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,2CAA2C;AAC3C,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,EAAE,CAsB7E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { blockLines } from "../../layout/index.js";
|
|
2
|
+
const maxTitleLines = 3;
|
|
3
|
+
const maxLocationLines = 2;
|
|
4
|
+
const titleFloor = 0.6;
|
|
5
|
+
const locationFloor = 0.8;
|
|
6
|
+
/** What the event is, then where it is. */
|
|
7
|
+
export function eventLines(props, text) {
|
|
8
|
+
const { measure, fontFamily, contentWidth } = text;
|
|
9
|
+
return [
|
|
10
|
+
...blockLines(props.title, measure, fontFamily, {
|
|
11
|
+
maxWidth: contentWidth,
|
|
12
|
+
maxLines: maxTitleLines,
|
|
13
|
+
fontSize: text.titleFs,
|
|
14
|
+
floor: titleFloor,
|
|
15
|
+
fontWeight: 800,
|
|
16
|
+
opacity: 1,
|
|
17
|
+
}),
|
|
18
|
+
...blockLines(props["location"], measure, fontFamily, {
|
|
19
|
+
maxWidth: contentWidth,
|
|
20
|
+
maxLines: maxLocationLines,
|
|
21
|
+
fontSize: text.locationFs,
|
|
22
|
+
floor: locationFloor,
|
|
23
|
+
fontWeight: 500,
|
|
24
|
+
opacity: 0.85,
|
|
25
|
+
gapBefore: Math.round(text.height * 0.035),
|
|
26
|
+
}),
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../../src/templates/event/lines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,aAAa,GAAG,GAAG,CAAC;AAY1B,2CAA2C;AAC3C,MAAM,UAAU,UAAU,CAAC,KAAqB,EAAE,IAAe;IAC/D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEnD,OAAO;QACL,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE;YAC9C,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,aAAa;YACvB,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,CAAC;SACX,CAAC;QACF,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE;YACpD,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,gBAAgB;YAC1B,QAAQ,EAAE,IAAI,CAAC,UAAU;YACzB,KAAK,EAAE,aAAa;YACpB,UAAU,EAAE,GAAG;YACf,OAAO,EAAE,IAAI;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 { Rect } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, ResolvedConfig } from "../../types.js";
|
|
3
|
+
import type { PillStyle } from "../pill.js";
|
|
4
|
+
/** How the date's plate is filled and set. */
|
|
5
|
+
export declare function plateStyle(config: ResolvedConfig): PillStyle;
|
|
6
|
+
/** How tall the plate is, or nothing at all where the post named no date. */
|
|
7
|
+
export declare function plateHeight(date: string, imageHeight: number): number;
|
|
8
|
+
/**
|
|
9
|
+
* The date on its plate, centred in the slot the stack gave it, or nothing
|
|
10
|
+
* where the post named no date.
|
|
11
|
+
*
|
|
12
|
+
* The slot is the full width of the content area, since that is what a stack
|
|
13
|
+
* hands back, and the plate is only as wide as the words on it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function datePlate(date: string, slot: Rect | undefined, style: PillStyle, measure: MeasureText): string;
|
|
16
|
+
//# sourceMappingURL=plate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plate.d.ts","sourceRoot":"","sources":["../../../src/templates/event/plate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM5C,8CAA8C;AAC9C,wBAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAO5D;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,WAAW,GACnB,MAAM,CAiBR"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { pill, pillWidth } from "../pill.js";
|
|
2
|
+
/** The plate's height, as a fraction of the image's. */
|
|
3
|
+
const plateScale = 0.07;
|
|
4
|
+
/** How the date's plate is filled and set. */
|
|
5
|
+
export function plateStyle(config) {
|
|
6
|
+
return {
|
|
7
|
+
fontFamily: config.fontFamily,
|
|
8
|
+
fontWeight: 700,
|
|
9
|
+
fill: config.colors.foreground,
|
|
10
|
+
background: config.colors.brandWarm,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** How tall the plate is, or nothing at all where the post named no date. */
|
|
14
|
+
export function plateHeight(date, imageHeight) {
|
|
15
|
+
return date === "" ? 0 : Math.round(imageHeight * plateScale);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The date on its plate, centred in the slot the stack gave it, or nothing
|
|
19
|
+
* where the post named no date.
|
|
20
|
+
*
|
|
21
|
+
* The slot is the full width of the content area, since that is what a stack
|
|
22
|
+
* hands back, and the plate is only as wide as the words on it.
|
|
23
|
+
*/
|
|
24
|
+
export function datePlate(date, slot, style, measure) {
|
|
25
|
+
if (date === "" || slot === undefined || slot.height === 0) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
const width = pillWidth(date, slot.height, style, measure);
|
|
29
|
+
return pill(date, {
|
|
30
|
+
x: Math.round(slot.x + (slot.width - width) / 2),
|
|
31
|
+
y: slot.y,
|
|
32
|
+
width,
|
|
33
|
+
height: slot.height,
|
|
34
|
+
}, style);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=plate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plate.js","sourceRoot":"","sources":["../../../src/templates/event/plate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE7C,wDAAwD;AACxD,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,8CAA8C;AAC9C,MAAM,UAAU,UAAU,CAAC,MAAsB;IAC/C,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;QAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS;KACpC,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,WAAmB;IAC3D,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,IAAsB,EACtB,KAAgB,EAChB,OAAoB;IAEpB,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAE3D,OAAO,IAAI,CACT,IAAI,EACJ;QACE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAChD,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,KAAK;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,EACD,KAAK,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Rect } from "../layout/index.js";
|
|
2
|
+
import type { Dimensions, ImageAsset, ResolvedConfig } from "../types.js";
|
|
3
|
+
/**
|
|
4
|
+
* The measurements every template starts from: where its margins are, and what
|
|
5
|
+
* the line along the bottom leaves it.
|
|
6
|
+
*
|
|
7
|
+
* Each of the built-ins worked these out for itself, which was fine while there
|
|
8
|
+
* were three of them and is nine copies of the same arithmetic now. The values
|
|
9
|
+
* are the ones the layouts already used, so what this replaces is the repetition
|
|
10
|
+
* rather than the decisions.
|
|
11
|
+
*/
|
|
12
|
+
export interface Frame {
|
|
13
|
+
/** The margin, applied to every edge. */
|
|
14
|
+
readonly pad: number;
|
|
15
|
+
readonly footerFontSize: number;
|
|
16
|
+
/** The whole image, as the rectangle the content is inset from. */
|
|
17
|
+
readonly full: Rect;
|
|
18
|
+
/**
|
|
19
|
+
* Vertical room to leave below the content, which is the footer line plus
|
|
20
|
+
* its clear space, or nothing at all where there is no footer to draw.
|
|
21
|
+
*/
|
|
22
|
+
readonly footerRoom: number;
|
|
23
|
+
/** The baseline that footer sits on, whether or not there is one. */
|
|
24
|
+
readonly footerY: number;
|
|
25
|
+
}
|
|
26
|
+
/** What a template can tell the frame about itself. */
|
|
27
|
+
export interface FrameOptions {
|
|
28
|
+
/** The margin, as a fraction of the image's width. */
|
|
29
|
+
readonly padScale?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the template draws something of its own on the bottom line, such
|
|
32
|
+
* as a byline, so the room is left for it even where the config has no
|
|
33
|
+
* footer and the post has no avatar.
|
|
34
|
+
*/
|
|
35
|
+
readonly footer?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Work out a template's frame. The avatar counts as a footer even where the
|
|
39
|
+
* config carries no text, since the picture is drawn on the same line and
|
|
40
|
+
* needs the same room.
|
|
41
|
+
*/
|
|
42
|
+
export declare function imageFrame(dimensions: Dimensions, config: ResolvedConfig, avatar: ImageAsset | undefined, options?: FrameOptions): Frame;
|
|
43
|
+
/**
|
|
44
|
+
* The room a mark along the top of the image takes, including the clear space
|
|
45
|
+
* under it, or nothing at all where there is no mark.
|
|
46
|
+
*
|
|
47
|
+
* A height of nothing is the same as no mark, since the gap under a mark that
|
|
48
|
+
* is not there is the space a template would then be reserving for nobody.
|
|
49
|
+
*/
|
|
50
|
+
export declare function markRoom(height: number | undefined, gap: number): number;
|
|
51
|
+
/**
|
|
52
|
+
* The space a template's content has: the whole image, less the margins, less
|
|
53
|
+
* whatever sits along the top, less the footer line.
|
|
54
|
+
*
|
|
55
|
+
* `top` is what {@link markRoom} worked out, or whatever else the template put
|
|
56
|
+
* up there. It is extra: the margin is added here, so a template with nothing
|
|
57
|
+
* along the top passes nothing.
|
|
58
|
+
*/
|
|
59
|
+
export declare function contentArea(frame: Frame, top?: number): Rect;
|
|
60
|
+
/**
|
|
61
|
+
* A gap that is only there when the thing before it is.
|
|
62
|
+
*
|
|
63
|
+
* Stacking a group that a post may not have given anything to means the space
|
|
64
|
+
* above it has to disappear along with it, or the layout keeps a hole where
|
|
65
|
+
* the missing part was.
|
|
66
|
+
*/
|
|
67
|
+
export declare function gapAfter(size: number, gap: number): number;
|
|
68
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/templates/frame.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAW1E;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;IACpB,yCAAyC;IACzC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,OAAO,GAAE,YAAiB,GACzB,KAAK,CAcP;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,SAAI,GAAG,IAAI,CAOvD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|