@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,63 @@
|
|
|
1
|
+
import { footerBaseline, hasFooter } from "./footer.js";
|
|
2
|
+
import { inset } from "../layout/index.js";
|
|
3
|
+
/** Margin from the image edge, as a fraction of its width. */
|
|
4
|
+
const defaultPadScale = 0.075;
|
|
5
|
+
/** The footer's size, as a fraction of the image's height. */
|
|
6
|
+
const footerScale = 0.032;
|
|
7
|
+
/** Clear space between the content and the footer line, as a fraction of it. */
|
|
8
|
+
const footerGap = 0.02;
|
|
9
|
+
/**
|
|
10
|
+
* Work out a template's frame. The avatar counts as a footer even where the
|
|
11
|
+
* config carries no text, since the picture is drawn on the same line and
|
|
12
|
+
* needs the same room.
|
|
13
|
+
*/
|
|
14
|
+
export function imageFrame(dimensions, config, avatar, options = {}) {
|
|
15
|
+
const { width, height } = dimensions;
|
|
16
|
+
const pad = Math.round(width * (options.padScale ?? defaultPadScale));
|
|
17
|
+
const footerFontSize = Math.round(height * footerScale);
|
|
18
|
+
const isDrawn = options.footer === true || hasFooter(config) || avatar !== undefined;
|
|
19
|
+
return {
|
|
20
|
+
pad,
|
|
21
|
+
footerFontSize,
|
|
22
|
+
full: { x: 0, y: 0, width, height },
|
|
23
|
+
footerRoom: isDrawn ? footerFontSize + Math.round(height * footerGap) : 0,
|
|
24
|
+
footerY: footerBaseline(height, pad, footerFontSize),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The room a mark along the top of the image takes, including the clear space
|
|
29
|
+
* under it, or nothing at all where there is no mark.
|
|
30
|
+
*
|
|
31
|
+
* A height of nothing is the same as no mark, since the gap under a mark that
|
|
32
|
+
* is not there is the space a template would then be reserving for nobody.
|
|
33
|
+
*/
|
|
34
|
+
export function markRoom(height, gap) {
|
|
35
|
+
return height === undefined || height === 0 ? 0 : height + gap;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The space a template's content has: the whole image, less the margins, less
|
|
39
|
+
* whatever sits along the top, less the footer line.
|
|
40
|
+
*
|
|
41
|
+
* `top` is what {@link markRoom} worked out, or whatever else the template put
|
|
42
|
+
* up there. It is extra: the margin is added here, so a template with nothing
|
|
43
|
+
* along the top passes nothing.
|
|
44
|
+
*/
|
|
45
|
+
export function contentArea(frame, top = 0) {
|
|
46
|
+
return inset(frame.full, {
|
|
47
|
+
top: frame.pad + top,
|
|
48
|
+
right: frame.pad,
|
|
49
|
+
left: frame.pad,
|
|
50
|
+
bottom: frame.pad + frame.footerRoom,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A gap that is only there when the thing before it is.
|
|
55
|
+
*
|
|
56
|
+
* Stacking a group that a post may not have given anything to means the space
|
|
57
|
+
* above it has to disappear along with it, or the layout keeps a hole where
|
|
58
|
+
* the missing part was.
|
|
59
|
+
*/
|
|
60
|
+
export function gapAfter(size, gap) {
|
|
61
|
+
return size === 0 ? 0 : gap;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/templates/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,8DAA8D;AAC9D,MAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,8DAA8D;AAC9D,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,gFAAgF;AAChF,MAAM,SAAS,GAAG,IAAI,CAAC;AAsCvB;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,UAAsB,EACtB,MAAsB,EACtB,MAA8B,EAC9B,OAAO,GAAiB,EAAE;IAE1B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,eAAe,CAAC,CAAC,CAAC;IACtE,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC;IACxD,MAAM,OAAO,GACX,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,SAAS,CAAC;IAEvE,OAAO;QACL,GAAG;QACH,cAAc;QACd,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE;QACnC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACzE,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC;KACrD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,MAA0B,EAAE,GAAW;IAC9D,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC;AACjE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY,EAAE,GAAG,GAAG,CAAC;IAC/C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE;QACvB,GAAG,EAAE,KAAK,CAAC,GAAG,GAAG,GAAG;QACpB,KAAK,EAAE,KAAK,CAAC,GAAG;QAChB,IAAI,EAAE,KAAK,CAAC,GAAG;QACf,MAAM,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,UAAU;KACrC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,GAAW;IAChD,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9B,CAAC"}
|
|
@@ -4,8 +4,17 @@ import type { Template } from "../types.js";
|
|
|
4
4
|
* via `config.templates`.
|
|
5
5
|
*/
|
|
6
6
|
export declare const builtinTemplates: Readonly<Record<string, Template>>;
|
|
7
|
+
export { articleTemplate } from "./article/index.js";
|
|
7
8
|
export { bannerTemplate } from "./banner/index.js";
|
|
8
9
|
export { cardTemplate } from "./card/index.js";
|
|
9
10
|
export { codeTemplate } from "./code/index.js";
|
|
11
|
+
export { docsTemplate } from "./docs/index.js";
|
|
12
|
+
export { eventTemplate } from "./event/index.js";
|
|
13
|
+
export { photoTemplate } from "./photo/index.js";
|
|
14
|
+
export { quoteTemplate } from "./quote/index.js";
|
|
15
|
+
export { releaseTemplate } from "./release/index.js";
|
|
16
|
+
export { statTemplate } from "./stat/index.js";
|
|
17
|
+
export { terminalTemplate } from "./terminal/index.js";
|
|
18
|
+
export { wordmarkTemplate } from "./wordmark/index.js";
|
|
10
19
|
export { optionalString } from "../props.js";
|
|
11
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAc5C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAa/D,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/templates/index.js
CHANGED
|
@@ -1,17 +1,44 @@
|
|
|
1
|
+
import { articleTemplate } from "./article/index.js";
|
|
1
2
|
import { bannerTemplate } from "./banner/index.js";
|
|
2
3
|
import { cardTemplate } from "./card/index.js";
|
|
3
4
|
import { codeTemplate } from "./code/index.js";
|
|
5
|
+
import { docsTemplate } from "./docs/index.js";
|
|
6
|
+
import { eventTemplate } from "./event/index.js";
|
|
7
|
+
import { photoTemplate } from "./photo/index.js";
|
|
8
|
+
import { quoteTemplate } from "./quote/index.js";
|
|
9
|
+
import { releaseTemplate } from "./release/index.js";
|
|
10
|
+
import { statTemplate } from "./stat/index.js";
|
|
11
|
+
import { terminalTemplate } from "./terminal/index.js";
|
|
12
|
+
import { wordmarkTemplate } from "./wordmark/index.js";
|
|
4
13
|
/**
|
|
5
14
|
* Templates registered out of the box. Projects can add to or override these
|
|
6
15
|
* via `config.templates`.
|
|
7
16
|
*/
|
|
8
17
|
export const builtinTemplates = {
|
|
18
|
+
[articleTemplate.name]: articleTemplate,
|
|
9
19
|
[bannerTemplate.name]: bannerTemplate,
|
|
10
20
|
[cardTemplate.name]: cardTemplate,
|
|
11
21
|
[codeTemplate.name]: codeTemplate,
|
|
22
|
+
[docsTemplate.name]: docsTemplate,
|
|
23
|
+
[eventTemplate.name]: eventTemplate,
|
|
24
|
+
[photoTemplate.name]: photoTemplate,
|
|
25
|
+
[quoteTemplate.name]: quoteTemplate,
|
|
26
|
+
[releaseTemplate.name]: releaseTemplate,
|
|
27
|
+
[statTemplate.name]: statTemplate,
|
|
28
|
+
[terminalTemplate.name]: terminalTemplate,
|
|
29
|
+
[wordmarkTemplate.name]: wordmarkTemplate,
|
|
12
30
|
};
|
|
31
|
+
export { articleTemplate } from "./article/index.js";
|
|
13
32
|
export { bannerTemplate } from "./banner/index.js";
|
|
14
33
|
export { cardTemplate } from "./card/index.js";
|
|
15
34
|
export { codeTemplate } from "./code/index.js";
|
|
35
|
+
export { docsTemplate } from "./docs/index.js";
|
|
36
|
+
export { eventTemplate } from "./event/index.js";
|
|
37
|
+
export { photoTemplate } from "./photo/index.js";
|
|
38
|
+
export { quoteTemplate } from "./quote/index.js";
|
|
39
|
+
export { releaseTemplate } from "./release/index.js";
|
|
40
|
+
export { statTemplate } from "./stat/index.js";
|
|
41
|
+
export { terminalTemplate } from "./terminal/index.js";
|
|
42
|
+
export { wordmarkTemplate } from "./wordmark/index.js";
|
|
16
43
|
export { optionalString } from "../props.js";
|
|
17
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAuC;IAClE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,eAAe;IACvC,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,cAAc;IACrC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa;IACnC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa;IACnC,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa;IACnC,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,eAAe;IACvC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,YAAY;IACjC,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,gBAAgB;IACzC,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,gBAAgB;CAC1C,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A photograph with the title over it, set along the bottom.
|
|
4
|
+
*
|
|
5
|
+
* The picture comes from the post's `image` prop rather than from config,
|
|
6
|
+
* which is what separates this from setting a background image: config is the
|
|
7
|
+
* same for every post, and the whole point here is a different photograph on
|
|
8
|
+
* each one. A post with no `image` still renders, over the configured
|
|
9
|
+
* background, which is what a template has to do with a prop it was not given.
|
|
10
|
+
*
|
|
11
|
+
* The wash over the picture is not optional. Text over an unshaded photograph
|
|
12
|
+
* is legible or not depending on what the photograph happens to hold, and a
|
|
13
|
+
* build cannot look at it. The scrim is heavier than the one a background
|
|
14
|
+
* image gets, because here the words sit right on top of it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const photoTemplate: Template;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/photo/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAYhE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,EAAE,QAoD3B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { drawLines, image, scrim } 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 { photoLines } from "./lines.js";
|
|
6
|
+
/** The wash over the picture: clear at the top, dark where the words are. */
|
|
7
|
+
const scrimFrom = 0.15;
|
|
8
|
+
const scrimTo = 0.85;
|
|
9
|
+
const scrimId = "colophon-photo-scrim";
|
|
10
|
+
/**
|
|
11
|
+
* A photograph with the title over it, set along the bottom.
|
|
12
|
+
*
|
|
13
|
+
* The picture comes from the post's `image` prop rather than from config,
|
|
14
|
+
* which is what separates this from setting a background image: config is the
|
|
15
|
+
* same for every post, and the whole point here is a different photograph on
|
|
16
|
+
* each one. A post with no `image` still renders, over the configured
|
|
17
|
+
* background, which is what a template has to do with a prop it was not given.
|
|
18
|
+
*
|
|
19
|
+
* The wash over the picture is not optional. Text over an unshaded photograph
|
|
20
|
+
* is legible or not depending on what the photograph happens to hold, and a
|
|
21
|
+
* build cannot look at it. The scrim is heavier than the one a background
|
|
22
|
+
* image gets, because here the words sit right on top of it.
|
|
23
|
+
*/
|
|
24
|
+
export const photoTemplate = {
|
|
25
|
+
name: "photo",
|
|
26
|
+
render({ props, config, dimensions, measure, logo, avatar, picture, }) {
|
|
27
|
+
const { width, height } = dimensions;
|
|
28
|
+
const { fontFamily, colors } = config;
|
|
29
|
+
const frame = imageFrame(dimensions, config, avatar);
|
|
30
|
+
const { pad } = frame;
|
|
31
|
+
const mark = logoRect(logo, dimensions, pad, "start");
|
|
32
|
+
const backdrop = picture === undefined
|
|
33
|
+
? ""
|
|
34
|
+
: image(frame.full, picture.href, { fit: "cover" }) +
|
|
35
|
+
scrim(frame.full, scrimId, { from: scrimFrom, to: scrimTo });
|
|
36
|
+
const area = contentArea(frame, markRoom(mark?.height, pad / 2));
|
|
37
|
+
// Set along the bottom, where the scrim is heaviest and where a picture
|
|
38
|
+
// usually has least going on.
|
|
39
|
+
const body = drawLines(photoLines(props, {
|
|
40
|
+
measure,
|
|
41
|
+
fontFamily,
|
|
42
|
+
contentWidth: area.width,
|
|
43
|
+
titleFs: Math.round(height * 0.086),
|
|
44
|
+
standfirstFs: Math.round(height * 0.042),
|
|
45
|
+
height,
|
|
46
|
+
}), area, { fontFamily, fill: colors.foreground, lineHeight: 1.24, align: "end" });
|
|
47
|
+
const footer = footerLine(config, frame, width, avatar, measure, "start", 0.85);
|
|
48
|
+
return backdrop + logoElement(logo, mark) + body + footer;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/photo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEhE,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,YAAY,CAAC;AAExC,6EAA6E;AAC7E,MAAM,SAAS,GAAG,IAAI,CAAC;AACvB,MAAM,OAAO,GAAG,IAAI,CAAC;AAErB,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAEvC;;;;;;;;;;;;;GAaG;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,EACN,OAAO,GACS;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,QAAQ,GACZ,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;gBACjD,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAEnE,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEjE,wEAAwE;QACxE,8BAA8B;QAC9B,MAAM,IAAI,GAAG,SAAS,CACpB,UAAU,CAAC,KAAK,EAAE;YAChB,OAAO;YACP,UAAU;YACV,YAAY,EAAE,IAAI,CAAC,KAAK;YACxB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACnC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;YACxC,MAAM;SACP,CAAC,EACF,IAAI,EACJ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CACxE,CAAC;QAEF,MAAM,MAAM,GAAG,UAAU,CACvB,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,CACL,CAAC;QAEF,OAAO,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC;IAC5D,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TextLine } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, MetaImageProps } from "../../types.js";
|
|
3
|
+
/** The space the photo's text has, and how to measure it into it. */
|
|
4
|
+
export interface PhotoText {
|
|
5
|
+
readonly measure: MeasureText;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly contentWidth: number;
|
|
8
|
+
readonly titleFs: number;
|
|
9
|
+
readonly standfirstFs: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The title, then the line under it.
|
|
14
|
+
*
|
|
15
|
+
* Both are shorter here than on the templates that have the whole image to
|
|
16
|
+
* themselves. Text over a photograph is harder to read whatever the scrim
|
|
17
|
+
* does, and a paragraph of it hides the picture that was the reason for
|
|
18
|
+
* choosing this template.
|
|
19
|
+
*/
|
|
20
|
+
export declare function photoLines(props: MetaImageProps, text: PhotoText): TextLine[];
|
|
21
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../../src/templates/photo/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,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,EAAE,CAsB7E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { blockLines } from "../../layout/index.js";
|
|
2
|
+
const maxTitleLines = 3;
|
|
3
|
+
const maxStandfirstLines = 2;
|
|
4
|
+
const titleFloor = 0.6;
|
|
5
|
+
const standfirstFloor = 0.8;
|
|
6
|
+
/**
|
|
7
|
+
* The title, then the line under it.
|
|
8
|
+
*
|
|
9
|
+
* Both are shorter here than on the templates that have the whole image to
|
|
10
|
+
* themselves. Text over a photograph is harder to read whatever the scrim
|
|
11
|
+
* does, and a paragraph of it hides the picture that was the reason for
|
|
12
|
+
* choosing this template.
|
|
13
|
+
*/
|
|
14
|
+
export function photoLines(props, text) {
|
|
15
|
+
const { measure, fontFamily, contentWidth } = text;
|
|
16
|
+
return [
|
|
17
|
+
...blockLines(props.title, measure, fontFamily, {
|
|
18
|
+
maxWidth: contentWidth,
|
|
19
|
+
maxLines: maxTitleLines,
|
|
20
|
+
fontSize: text.titleFs,
|
|
21
|
+
floor: titleFloor,
|
|
22
|
+
fontWeight: 800,
|
|
23
|
+
opacity: 1,
|
|
24
|
+
}),
|
|
25
|
+
...blockLines(props.subtitle, measure, fontFamily, {
|
|
26
|
+
maxWidth: contentWidth,
|
|
27
|
+
maxLines: maxStandfirstLines,
|
|
28
|
+
fontSize: text.standfirstFs,
|
|
29
|
+
floor: standfirstFloor,
|
|
30
|
+
fontWeight: 500,
|
|
31
|
+
opacity: 0.9,
|
|
32
|
+
gapBefore: Math.round(text.height * 0.025),
|
|
33
|
+
}),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=lines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../../src/templates/photo/lines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,eAAe,GAAG,GAAG,CAAC;AAY5B;;;;;;;GAOG;AACH,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,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE;YACjD,QAAQ,EAAE,YAAY;YACtB,QAAQ,EAAE,kBAAkB;YAC5B,QAAQ,EAAE,IAAI,CAAC,YAAY;YAC3B,KAAK,EAAE,eAAe;YACtB,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,33 @@
|
|
|
1
|
+
import type { Rect } from "../layout/index.js";
|
|
2
|
+
import type { MeasureText } from "../types.js";
|
|
3
|
+
/** How a pill is filled and set. */
|
|
4
|
+
export interface PillStyle {
|
|
5
|
+
readonly fontFamily: string;
|
|
6
|
+
readonly fontWeight: number;
|
|
7
|
+
/** The text colour. */
|
|
8
|
+
readonly fill: string;
|
|
9
|
+
readonly background: string;
|
|
10
|
+
readonly backgroundOpacity?: number;
|
|
11
|
+
/** Corner radius. Defaults to half the height, so the ends are round. */
|
|
12
|
+
readonly radius?: number;
|
|
13
|
+
}
|
|
14
|
+
/** The text size a pill of this height sets its label at. */
|
|
15
|
+
export declare function pillFontSize(height: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* How wide a pill has to be to hold its label.
|
|
18
|
+
*
|
|
19
|
+
* Measured rather than counted, because a tag is whatever word a post used and
|
|
20
|
+
* a row of them is laid out before any of it is drawn. The corner badge on the
|
|
21
|
+
* `banner` guesses from the character count, which is why it only ever holds a
|
|
22
|
+
* word or two.
|
|
23
|
+
*/
|
|
24
|
+
export declare function pillWidth(text: string, height: number, style: PillStyle, measure: MeasureText): number;
|
|
25
|
+
/**
|
|
26
|
+
* A label on a rounded plate: a tag on an article, a date on an event.
|
|
27
|
+
*
|
|
28
|
+
* The text is centred in the rectangle it was given rather than set from the
|
|
29
|
+
* left, so a pill drawn wider than {@link pillWidth} asked for still looks
|
|
30
|
+
* deliberate.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pill(text: string, rect: Rect, style: PillStyle): string;
|
|
33
|
+
//# sourceMappingURL=pill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pill.d.ts","sourceRoot":"","sources":["../../src/templates/pill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ/C,oCAAoC;AACpC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uBAAuB;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,WAAW,GACnB,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAsBvE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { baselineFor, box, measureIn, textElement } from "../layout/index.js";
|
|
2
|
+
/** The text's size within the pill, as a fraction of its height. */
|
|
3
|
+
const textScale = 0.5;
|
|
4
|
+
/** Clear space at each end of the text, as a fraction of the pill's height. */
|
|
5
|
+
const padScale = 0.42;
|
|
6
|
+
/** The text size a pill of this height sets its label at. */
|
|
7
|
+
export function pillFontSize(height) {
|
|
8
|
+
return Math.round(height * textScale);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* How wide a pill has to be to hold its label.
|
|
12
|
+
*
|
|
13
|
+
* Measured rather than counted, because a tag is whatever word a post used and
|
|
14
|
+
* a row of them is laid out before any of it is drawn. The corner badge on the
|
|
15
|
+
* `banner` guesses from the character count, which is why it only ever holds a
|
|
16
|
+
* word or two.
|
|
17
|
+
*/
|
|
18
|
+
export function pillWidth(text, height, style, measure) {
|
|
19
|
+
const fontSize = pillFontSize(height);
|
|
20
|
+
const width = measureIn(measure, style.fontFamily, style.fontWeight)(text, fontSize);
|
|
21
|
+
return Math.round(width + height * padScale * 2);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A label on a rounded plate: a tag on an article, a date on an event.
|
|
25
|
+
*
|
|
26
|
+
* The text is centred in the rectangle it was given rather than set from the
|
|
27
|
+
* left, so a pill drawn wider than {@link pillWidth} asked for still looks
|
|
28
|
+
* deliberate.
|
|
29
|
+
*/
|
|
30
|
+
export function pill(text, rect, style) {
|
|
31
|
+
const fontSize = pillFontSize(rect.height);
|
|
32
|
+
const plate = box(rect, {
|
|
33
|
+
fill: style.background,
|
|
34
|
+
radius: style.radius ?? Math.round(rect.height / 2),
|
|
35
|
+
...(style.backgroundOpacity !== undefined && {
|
|
36
|
+
fillOpacity: style.backgroundOpacity,
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
const label = textElement(text, {
|
|
40
|
+
x: Math.round(rect.x + rect.width / 2),
|
|
41
|
+
y: baselineFor(rect.y + (rect.height - fontSize) / 2, fontSize),
|
|
42
|
+
fontFamily: style.fontFamily,
|
|
43
|
+
fontSize,
|
|
44
|
+
fontWeight: style.fontWeight,
|
|
45
|
+
fill: style.fill,
|
|
46
|
+
anchor: "middle",
|
|
47
|
+
});
|
|
48
|
+
return plate + label;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=pill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pill.js","sourceRoot":"","sources":["../../src/templates/pill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAI9E,oEAAoE;AACpE,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,+EAA+E;AAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC;AActB,6DAA6D;AAC7D,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,MAAc,EACd,KAAgB,EAChB,OAAoB;IAEpB,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,SAAS,CACrB,OAAO,EACP,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,CACjB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAElB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,IAAU,EAAE,KAAgB;IAC7D,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE3C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE;QACtB,IAAI,EAAE,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACnD,GAAG,CAAC,KAAK,CAAC,iBAAiB,KAAK,SAAS,IAAI;YAC3C,WAAW,EAAE,KAAK,CAAC,iBAAiB;SACrC,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE;QAC9B,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,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,QAAQ;QACR,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAC;IAEH,OAAO,KAAK,GAAG,KAAK,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Rect } from "../layout/index.js";
|
|
2
|
+
import type { ImageAsset } from "../types.js";
|
|
3
|
+
import type { FooterPlacement } from "./footer.js";
|
|
4
|
+
/**
|
|
5
|
+
* How much of the line the picture takes before the words start.
|
|
6
|
+
*
|
|
7
|
+
* A template with something else on the same line, such as the article's
|
|
8
|
+
* footer at the other end of it, has to know this before it can work out what
|
|
9
|
+
* room the words are left with.
|
|
10
|
+
*/
|
|
11
|
+
export declare function portraitAdvance(fontSize: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* How tall a line with a picture on it is, which is more than the words alone
|
|
14
|
+
* would need. A template stacking such a line with anything else has to leave
|
|
15
|
+
* room for the picture or the two collide.
|
|
16
|
+
*/
|
|
17
|
+
export declare function portraitHeight(fontSize: number): number;
|
|
18
|
+
/** A line with an avatar on it: the space it has, and where the line sits. */
|
|
19
|
+
export interface PortraitPlacement extends FooterPlacement {
|
|
20
|
+
/** Left edge and width of the content area the line is set within. */
|
|
21
|
+
readonly left: number;
|
|
22
|
+
readonly width: number;
|
|
23
|
+
}
|
|
24
|
+
/** Where the picture and the words beside it ended up. */
|
|
25
|
+
export interface Portrait {
|
|
26
|
+
readonly rect: Rect;
|
|
27
|
+
/** Where the label starts, which is after the picture and its gap. */
|
|
28
|
+
readonly labelX: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Set a circular avatar and a label beside it on one line.
|
|
32
|
+
*
|
|
33
|
+
* Only the horizontal placement comes from the row. The baseline is the one
|
|
34
|
+
* the template asked for, so a line with an avatar and a line without one sit
|
|
35
|
+
* at the same height.
|
|
36
|
+
*/
|
|
37
|
+
export declare function portraitRow(placement: PortraitPlacement, textWidth: number): Portrait;
|
|
38
|
+
/** The avatar itself, clipped to a circle. */
|
|
39
|
+
export declare function portraitImage(avatar: ImageAsset, rect: Rect, id: string): string;
|
|
40
|
+
//# sourceMappingURL=portrait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portrait.d.ts","sourceRoot":"","sources":["../../src/templates/portrait.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,0DAA0D;AAC1D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,MAAM,GAChB,QAAQ,CAoBV;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,GACT,MAAM,CAMR"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { image, row } from "../layout/index.js";
|
|
2
|
+
/** The avatar's diameter, as a multiple of the line's font size. */
|
|
3
|
+
const avatarScale = 1.9;
|
|
4
|
+
/** Where a circular avatar's centre sits above the line's baseline. */
|
|
5
|
+
const avatarRise = 0.34;
|
|
6
|
+
/** Space between the picture and the words, as a multiple of the size. */
|
|
7
|
+
const gapScale = 0.5;
|
|
8
|
+
/**
|
|
9
|
+
* How much of the line the picture takes before the words start.
|
|
10
|
+
*
|
|
11
|
+
* A template with something else on the same line, such as the article's
|
|
12
|
+
* footer at the other end of it, has to know this before it can work out what
|
|
13
|
+
* room the words are left with.
|
|
14
|
+
*/
|
|
15
|
+
export function portraitAdvance(fontSize) {
|
|
16
|
+
return portraitHeight(fontSize) + Math.round(fontSize * gapScale);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* How tall a line with a picture on it is, which is more than the words alone
|
|
20
|
+
* would need. A template stacking such a line with anything else has to leave
|
|
21
|
+
* room for the picture or the two collide.
|
|
22
|
+
*/
|
|
23
|
+
export function portraitHeight(fontSize) {
|
|
24
|
+
return Math.round(fontSize * avatarScale);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Set a circular avatar and a label beside it on one line.
|
|
28
|
+
*
|
|
29
|
+
* Only the horizontal placement comes from the row. The baseline is the one
|
|
30
|
+
* the template asked for, so a line with an avatar and a line without one sit
|
|
31
|
+
* at the same height.
|
|
32
|
+
*/
|
|
33
|
+
export function portraitRow(placement, textWidth) {
|
|
34
|
+
const { fontSize } = placement;
|
|
35
|
+
const size = Math.round(fontSize * avatarScale);
|
|
36
|
+
const gap = textWidth === 0 ? 0 : Math.round(fontSize * gapScale);
|
|
37
|
+
const [portrait, label] = row([{ size }, { size: Math.round(textWidth), gapBefore: gap }], { x: placement.left, y: placement.y, width: placement.width, height: size }, placement.anchor === "middle" ? "centre" : "start");
|
|
38
|
+
return {
|
|
39
|
+
rect: {
|
|
40
|
+
x: portrait?.x ?? placement.left,
|
|
41
|
+
y: Math.round(placement.y - fontSize * avatarRise - size / 2),
|
|
42
|
+
width: size,
|
|
43
|
+
height: size,
|
|
44
|
+
},
|
|
45
|
+
labelX: label?.x ?? placement.left,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** The avatar itself, clipped to a circle. */
|
|
49
|
+
export function portraitImage(avatar, rect, id) {
|
|
50
|
+
return image(rect, avatar.href, {
|
|
51
|
+
fit: "cover",
|
|
52
|
+
radius: Math.round(rect.width / 2),
|
|
53
|
+
id,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=portrait.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portrait.js","sourceRoot":"","sources":["../../src/templates/portrait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAKhD,oEAAoE;AACpE,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,uEAAuE;AACvE,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,0EAA0E;AAC1E,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;AAC5C,CAAC;AAgBD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,SAA4B,EAC5B,SAAiB;IAEjB,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;IAChD,MAAM,GAAG,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC;IAElE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,GAAG,CAC3B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAC3D,EAAE,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAC3E,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CACnD,CAAC;IAEF,OAAO;QACL,IAAI,EAAE;YACJ,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI;YAChC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,QAAQ,GAAG,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC;YAC7D,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;SACb;QACD,MAAM,EAAE,KAAK,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI;KACnC,CAAC;AACJ,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,aAAa,CAC3B,MAAkB,EAClB,IAAU,EACV,EAAU;IAEV,OAAO,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;QAC9B,GAAG,EAAE,OAAO;QACZ,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QAClC,EAAE;KACH,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Template } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A pull quote: the quotation mark, the words, and who said them.
|
|
4
|
+
*
|
|
5
|
+
* The quotation is the whole image, so there is no logo up in the corner
|
|
6
|
+
* competing with it. What the post carries instead is the speaker: an `author`
|
|
7
|
+
* and an optional `role`, with the `avatar` prop drawn beside them where there
|
|
8
|
+
* is one.
|
|
9
|
+
*/
|
|
10
|
+
export declare const quoteTemplate: Template;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/quote/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,gBAAgB,CAAC;AAUhE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,QA0D3B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { linesHeight, stack } from "../../layout/index.js";
|
|
2
|
+
import { drawSlot, footerLine } from "../bottom.js";
|
|
3
|
+
import { contentArea, imageFrame } from "../frame.js";
|
|
4
|
+
import { attributionText, quoteLines } from "./lines.js";
|
|
5
|
+
import { markBand, quoteMark } from "./mark.js";
|
|
6
|
+
import { speaker, speakerRoom } from "./speaker.js";
|
|
7
|
+
/** How the lines of the quotation are stacked. */
|
|
8
|
+
const lineHeight = 1.3;
|
|
9
|
+
/**
|
|
10
|
+
* A pull quote: the quotation mark, the words, and who said them.
|
|
11
|
+
*
|
|
12
|
+
* The quotation is the whole image, so there is no logo up in the corner
|
|
13
|
+
* competing with it. What the post carries instead is the speaker: an `author`
|
|
14
|
+
* and an optional `role`, with the `avatar` prop drawn beside them where there
|
|
15
|
+
* is one.
|
|
16
|
+
*/
|
|
17
|
+
export const quoteTemplate = {
|
|
18
|
+
name: "quote",
|
|
19
|
+
render({ props, config, dimensions, measure, avatar, }) {
|
|
20
|
+
const { width, height } = dimensions;
|
|
21
|
+
const { fontFamily, colors } = config;
|
|
22
|
+
// The avatar goes on the attribution line rather than the footer, so as
|
|
23
|
+
// far as the frame is concerned there is none.
|
|
24
|
+
const frame = imageFrame(dimensions, config, undefined, {
|
|
25
|
+
padScale: 0.09,
|
|
26
|
+
});
|
|
27
|
+
const area = contentArea(frame);
|
|
28
|
+
const lines = quoteLines(props, {
|
|
29
|
+
measure,
|
|
30
|
+
fontFamily,
|
|
31
|
+
contentWidth: area.width,
|
|
32
|
+
quoteFs: Math.round(height * 0.075),
|
|
33
|
+
});
|
|
34
|
+
const markFs = Math.round(height * 0.17);
|
|
35
|
+
const said = attributionText(props);
|
|
36
|
+
const saidFs = Math.round(height * 0.04);
|
|
37
|
+
const [markSlot, textSlot, saidSlot] = stack([
|
|
38
|
+
{ size: markBand(markFs) },
|
|
39
|
+
{
|
|
40
|
+
size: linesHeight(lines, lineHeight),
|
|
41
|
+
gapBefore: Math.round(height * 0.03),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
size: speakerRoom(said, saidFs, avatar),
|
|
45
|
+
gapBefore: Math.round(height * 0.055),
|
|
46
|
+
},
|
|
47
|
+
], area);
|
|
48
|
+
const body = drawSlot(lines, textSlot, {
|
|
49
|
+
fontFamily,
|
|
50
|
+
fill: colors.foreground,
|
|
51
|
+
lineHeight,
|
|
52
|
+
anchor: "middle",
|
|
53
|
+
});
|
|
54
|
+
return (quoteMark(markSlot, markFs, fontFamily, colors.brandWarm) +
|
|
55
|
+
body +
|
|
56
|
+
speaker(said, saidSlot, saidFs, config, avatar, measure) +
|
|
57
|
+
footerLine(config, frame, width, undefined, measure, "middle", 0.7));
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/quote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpD,kDAAkD;AAClD,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAa;IACrC,IAAI,EAAE,OAAO;IACb,MAAM,CAAC,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,MAAM,GACU;QAChB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QACrC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QACtC,wEAAwE;QACxE,+CAA+C;QAC/C,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAEhC,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;SACpC,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAEzC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,KAAK,CAC1C;YACE,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC1B;gBACE,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC;gBACpC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;aACrC;YACD;gBACE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;gBACvC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;aACtC;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,OAAO,CACL,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC;YACzD,IAAI;YACJ,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;YACxD,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CACpE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TextLine } from "../../layout/index.js";
|
|
2
|
+
import type { MeasureText, MetaImageProps } from "../../types.js";
|
|
3
|
+
/** The space the quotation has, and how to measure it into it. */
|
|
4
|
+
export interface QuoteText {
|
|
5
|
+
readonly measure: MeasureText;
|
|
6
|
+
readonly fontFamily: string;
|
|
7
|
+
readonly contentWidth: number;
|
|
8
|
+
readonly quoteFs: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The quotation itself, read from `quote` or from `title`.
|
|
12
|
+
*
|
|
13
|
+
* Both names are taken because a post that is about one sentence usually has
|
|
14
|
+
* that sentence in its title already, and making it write the same words twice
|
|
15
|
+
* to get an image of them would be a poor trade for a tidier prop list.
|
|
16
|
+
*/
|
|
17
|
+
export declare function quoteLines(props: MetaImageProps, text: QuoteText): TextLine[];
|
|
18
|
+
/**
|
|
19
|
+
* Who said it: the name, then whatever the post added about them, after an em
|
|
20
|
+
* dash. The dash is what makes the line read as an attribution rather than as
|
|
21
|
+
* another line of the quotation.
|
|
22
|
+
*/
|
|
23
|
+
export declare function attributionText(props: MetaImageProps): string;
|
|
24
|
+
//# sourceMappingURL=lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../../src/templates/quote/lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAKlE,kEAAkE;AAClE,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;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,QAAQ,EAAE,CAW7E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAS7D"}
|