@kensio/colophon 2.4.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 +139 -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/background/gradient.d.ts +12 -0
- package/dist/background/gradient.d.ts.map +1 -0
- package/dist/background/gradient.js +21 -0
- package/dist/background/gradient.js.map +1 -0
- package/dist/background/image.d.ts +14 -0
- package/dist/background/image.d.ts.map +1 -0
- package/dist/background/image.js +36 -0
- package/dist/background/image.js.map +1 -0
- package/dist/{background.d.ts → background/index.d.ts} +5 -5
- package/dist/background/index.d.ts.map +1 -0
- package/dist/background/index.js +27 -0
- package/dist/background/index.js.map +1 -0
- package/dist/background/mesh.d.ts +12 -0
- package/dist/background/mesh.d.ts.map +1 -0
- package/dist/background/mesh.js +43 -0
- package/dist/background/mesh.js.map +1 -0
- package/dist/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 +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +27 -6
- 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/config/size.d.ts +6 -0
- package/dist/config/size.d.ts.map +1 -1
- package/dist/config/size.js +20 -8
- package/dist/config/size.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 +10 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- 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 +10 -2
- 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 +25 -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/badge-props.d.ts +16 -0
- package/dist/templates/banner/badge-props.d.ts.map +1 -0
- package/dist/templates/banner/badge-props.js +58 -0
- package/dist/templates/banner/badge-props.js.map +1 -0
- package/dist/templates/banner/index.d.ts.map +1 -1
- package/dist/templates/banner/index.js +6 -4
- package/dist/templates/banner/index.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/texture/grain.d.ts +17 -0
- package/dist/texture/grain.d.ts.map +1 -0
- package/dist/texture/grain.js +29 -0
- package/dist/texture/grain.js.map +1 -0
- package/dist/texture/index.d.ts +11 -0
- package/dist/texture/index.d.ts.map +1 -0
- package/dist/texture/index.js +20 -0
- package/dist/texture/index.js.map +1 -0
- package/dist/texture/pattern.d.ts +17 -0
- package/dist/texture/pattern.d.ts.map +1 -0
- package/dist/texture/pattern.js +45 -0
- package/dist/texture/pattern.js.map +1 -0
- package/dist/texture/resolve.d.ts +16 -0
- package/dist/texture/resolve.d.ts.map +1 -0
- package/dist/texture/resolve.js +20 -0
- package/dist/texture/resolve.js.map +1 -0
- package/dist/theme/index.d.ts +27 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +41 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/presets.d.ts +38 -0
- package/dist/theme/presets.d.ts.map +1 -0
- package/dist/theme/presets.js +150 -0
- package/dist/theme/presets.js.map +1 -0
- package/dist/types.d.ts +281 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/background.d.ts +12 -0
- package/dist/validate/background.d.ts.map +1 -0
- package/dist/validate/background.js +53 -0
- package/dist/validate/background.js.map +1 -0
- package/dist/validate/collect.d.ts +9 -0
- package/dist/validate/collect.d.ts.map +1 -0
- package/dist/validate/collect.js +35 -0
- package/dist/validate/collect.js.map +1 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +2 -20
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/keys.d.ts +22 -0
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +69 -0
- package/dist/validate/keys.js.map +1 -1
- package/dist/validate/overrides.d.ts.map +1 -1
- package/dist/validate/overrides.js +5 -1
- package/dist/validate/overrides.js.map +1 -1
- package/dist/validate/texture.d.ts +11 -0
- package/dist/validate/texture.d.ts.map +1 -0
- package/dist/validate/texture.js +34 -0
- package/dist/validate/texture.js.map +1 -0
- package/dist/validate/values.d.ts +16 -10
- package/dist/validate/values.d.ts.map +1 -1
- package/dist/validate/values.js +31 -44
- package/dist/validate/values.js.map +1 -1
- package/package.json +16 -2
- 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,23 @@
|
|
|
1
|
+
/** The eight bytes every PNG file starts with. */
|
|
2
|
+
export declare const pngSignature: Buffer<ArrayBuffer>;
|
|
3
|
+
/** One chunk of a PNG: its four-character type and the data it carries. */
|
|
4
|
+
export interface PngChunk {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly data: Buffer;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A whole PNG chunk as bytes: its length, its type, its data, and the CRC over
|
|
10
|
+
* the type and data together.
|
|
11
|
+
*/
|
|
12
|
+
export declare function chunkBytes(type: string, data: Buffer): Buffer;
|
|
13
|
+
/**
|
|
14
|
+
* The chunks of a PNG, in the order the file declares them.
|
|
15
|
+
*
|
|
16
|
+
* `undefined` where the bytes are not a PNG at all, or where a chunk runs past
|
|
17
|
+
* the end of them, which between them cover everything a caller can do about
|
|
18
|
+
* it: whatever this is, it is not a file to take apart and put back together.
|
|
19
|
+
* The CRCs are not checked, since nothing here is deciding whether to trust the
|
|
20
|
+
* image, only where one chunk ends and the next begins.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readChunks(png: Buffer): PngChunk[] | undefined;
|
|
23
|
+
//# sourceMappingURL=chunk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk.d.ts","sourceRoot":"","sources":["../../src/png/chunk.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,eAAO,MAAM,YAAY,qBAEvB,CAAC;AAEH,2EAA2E;AAC3E,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAY7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,SAAS,CAyB9D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { crc32 } from "node:zlib";
|
|
2
|
+
/** The eight bytes every PNG file starts with. */
|
|
3
|
+
export const pngSignature = Buffer.from([
|
|
4
|
+
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
|
|
5
|
+
]);
|
|
6
|
+
/**
|
|
7
|
+
* A whole PNG chunk as bytes: its length, its type, its data, and the CRC over
|
|
8
|
+
* the type and data together.
|
|
9
|
+
*/
|
|
10
|
+
export function chunkBytes(type, data) {
|
|
11
|
+
const chunk = Buffer.alloc(4 + 4 + data.length + 4);
|
|
12
|
+
chunk.writeUInt32BE(data.length, 0);
|
|
13
|
+
chunk.write(type, 4, "latin1");
|
|
14
|
+
data.copy(chunk, 8);
|
|
15
|
+
chunk.writeUInt32BE(crc32(chunk.subarray(4, 8 + data.length)), 8 + data.length);
|
|
16
|
+
return chunk;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The chunks of a PNG, in the order the file declares them.
|
|
20
|
+
*
|
|
21
|
+
* `undefined` where the bytes are not a PNG at all, or where a chunk runs past
|
|
22
|
+
* the end of them, which between them cover everything a caller can do about
|
|
23
|
+
* it: whatever this is, it is not a file to take apart and put back together.
|
|
24
|
+
* The CRCs are not checked, since nothing here is deciding whether to trust the
|
|
25
|
+
* image, only where one chunk ends and the next begins.
|
|
26
|
+
*/
|
|
27
|
+
export function readChunks(png) {
|
|
28
|
+
if (!png.subarray(0, pngSignature.length).equals(pngSignature)) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
const chunks = [];
|
|
32
|
+
let offset = pngSignature.length;
|
|
33
|
+
while (offset + 12 <= png.length) {
|
|
34
|
+
const length = png.readUInt32BE(offset);
|
|
35
|
+
const end = offset + 12 + length;
|
|
36
|
+
if (end > png.length) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
chunks.push({
|
|
40
|
+
type: png.toString("latin1", offset + 4, offset + 8),
|
|
41
|
+
data: png.subarray(offset + 8, offset + 8 + length),
|
|
42
|
+
});
|
|
43
|
+
offset = end;
|
|
44
|
+
}
|
|
45
|
+
// Trailing bytes that are not a chunk mean this was read wrong somewhere.
|
|
46
|
+
return offset === png.length ? chunks : undefined;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../src/png/chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC;IACtC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC/C,CAAC,CAAC;AAQH;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAAY;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEpD,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACpC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACpB,KAAK,CAAC,aAAa,CACjB,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EACzC,CAAC,GAAG,IAAI,CAAC,MAAM,CAChB,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;IAEjC,OAAO,MAAM,GAAG,EAAE,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC;QAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;YACrB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;YACpD,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;SACpD,CAAC,CAAC;QACH,MAAM,GAAG,GAAG,CAAC;IACf,CAAC;IAED,0EAA0E;IAC1E,OAAO,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading and rewriting the PNG container itself, as against the picture in it.
|
|
3
|
+
*
|
|
4
|
+
* Two things in the package have to open a finished PNG: the rebuild stamp,
|
|
5
|
+
* which puts a `tEXt` chunk in the header, and the recompressor, which replaces
|
|
6
|
+
* the image data with a smaller encoding of the same bytes. Both need the same
|
|
7
|
+
* chunk arithmetic, and writing a CRC in two places is how the two would come
|
|
8
|
+
* to disagree.
|
|
9
|
+
*/
|
|
10
|
+
export type { PngChunk } from "./chunk.js";
|
|
11
|
+
export { chunkBytes, pngSignature, readChunks } from "./chunk.js";
|
|
12
|
+
export { recompressPng } from "./recompress.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/png/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/png/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-encode a PNG's image data at zlib level `level`, returning the smaller of
|
|
3
|
+
* what that produced and what came in.
|
|
4
|
+
*
|
|
5
|
+
* This is lossless in the strongest sense available: the filtered scanlines are
|
|
6
|
+
* inflated and deflated again untouched, so not a pixel moves and not even a
|
|
7
|
+
* row filter changes. All that differs is how hard the deflater looked for
|
|
8
|
+
* matches. resvg encodes for speed, which on a 1200x1200 gradient costs about
|
|
9
|
+
* three times the file size, and these are images a site commits and then
|
|
10
|
+
* serves to everyone who shares a link.
|
|
11
|
+
*
|
|
12
|
+
* Re-filtering the rows adaptively rather than keeping resvg's fixed `Sub` was
|
|
13
|
+
* measured too, and bought about another 5% for more time again and a filter
|
|
14
|
+
* implementation to maintain, so it is not done.
|
|
15
|
+
*
|
|
16
|
+
* A `level` of `0` means leave the bytes alone, as does anything that is not a
|
|
17
|
+
* PNG this can take apart: a rasteriser other than the default may return a
|
|
18
|
+
* format with nothing in common with this, and refusing it here would be
|
|
19
|
+
* refusing it for the wrong reason. Bytes that claim to be a PNG and then fail
|
|
20
|
+
* to inflate are a broken image, and that does throw.
|
|
21
|
+
*/
|
|
22
|
+
export declare function recompressPng(png: Buffer, level: number): Promise<Buffer>;
|
|
23
|
+
//# sourceMappingURL=recompress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recompress.d.ts","sourceRoot":"","sources":["../../src/png/recompress.ts"],"names":[],"mappings":"AAuDA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CAmBjB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { promisify } from "node:util";
|
|
2
|
+
import { deflate, inflate } from "node:zlib";
|
|
3
|
+
import { chunkBytes, pngSignature, readChunks } from "./chunk.js";
|
|
4
|
+
const inflateAsync = promisify(inflate);
|
|
5
|
+
const deflateAsync = promisify(deflate);
|
|
6
|
+
/**
|
|
7
|
+
* Where the compression method sits in `IHDR`, after the width, the height,
|
|
8
|
+
* the bit depth and the colour type.
|
|
9
|
+
*/
|
|
10
|
+
const compressionMethodOffset = 10;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the image data is a plain zlib stream, which is the only compression
|
|
13
|
+
* method PNG defines and so the only one there is anything here to re-encode.
|
|
14
|
+
* A file whose header says otherwise is left as it is rather than guessed at.
|
|
15
|
+
*/
|
|
16
|
+
function isDeflated(chunks) {
|
|
17
|
+
const header = chunks[0];
|
|
18
|
+
return (header?.type === "IHDR" &&
|
|
19
|
+
header.data.length >= 13 &&
|
|
20
|
+
header.data[compressionMethodOffset] === 0);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The file put back together with `idat` in place of the image data it held.
|
|
24
|
+
*
|
|
25
|
+
* Every other chunk is kept, in its original order and at its original place:
|
|
26
|
+
* a rasteriser may have written a `pHYs` or a `gAMA` that says how the image is
|
|
27
|
+
* meant to be shown, and dropping one to save a few bytes would change what the
|
|
28
|
+
* image is. The new data goes where the first `IDAT` was, since the ones after
|
|
29
|
+
* it were the same stream split up.
|
|
30
|
+
*/
|
|
31
|
+
function rebuild(chunks, idat) {
|
|
32
|
+
const parts = [pngSignature];
|
|
33
|
+
let isWritten = false;
|
|
34
|
+
for (const chunk of chunks) {
|
|
35
|
+
if (chunk.type !== "IDAT") {
|
|
36
|
+
parts.push(chunkBytes(chunk.type, chunk.data));
|
|
37
|
+
}
|
|
38
|
+
else if (!isWritten) {
|
|
39
|
+
isWritten = true;
|
|
40
|
+
parts.push(chunkBytes("IDAT", idat));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return Buffer.concat(parts);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Re-encode a PNG's image data at zlib level `level`, returning the smaller of
|
|
47
|
+
* what that produced and what came in.
|
|
48
|
+
*
|
|
49
|
+
* This is lossless in the strongest sense available: the filtered scanlines are
|
|
50
|
+
* inflated and deflated again untouched, so not a pixel moves and not even a
|
|
51
|
+
* row filter changes. All that differs is how hard the deflater looked for
|
|
52
|
+
* matches. resvg encodes for speed, which on a 1200x1200 gradient costs about
|
|
53
|
+
* three times the file size, and these are images a site commits and then
|
|
54
|
+
* serves to everyone who shares a link.
|
|
55
|
+
*
|
|
56
|
+
* Re-filtering the rows adaptively rather than keeping resvg's fixed `Sub` was
|
|
57
|
+
* measured too, and bought about another 5% for more time again and a filter
|
|
58
|
+
* implementation to maintain, so it is not done.
|
|
59
|
+
*
|
|
60
|
+
* A `level` of `0` means leave the bytes alone, as does anything that is not a
|
|
61
|
+
* PNG this can take apart: a rasteriser other than the default may return a
|
|
62
|
+
* format with nothing in common with this, and refusing it here would be
|
|
63
|
+
* refusing it for the wrong reason. Bytes that claim to be a PNG and then fail
|
|
64
|
+
* to inflate are a broken image, and that does throw.
|
|
65
|
+
*/
|
|
66
|
+
export async function recompressPng(png, level) {
|
|
67
|
+
const chunks = level === 0 ? undefined : readChunks(png);
|
|
68
|
+
if (chunks === undefined || !isDeflated(chunks)) {
|
|
69
|
+
return png;
|
|
70
|
+
}
|
|
71
|
+
const image = chunks.filter((chunk) => chunk.type === "IDAT");
|
|
72
|
+
if (image.length === 0) {
|
|
73
|
+
return png;
|
|
74
|
+
}
|
|
75
|
+
const data = await inflateAsync(Buffer.concat(image.map(({ data }) => data)));
|
|
76
|
+
const rebuilt = rebuild(chunks, await deflateAsync(data, { level }));
|
|
77
|
+
// A rasteriser that already compresses well would otherwise be undone by a
|
|
78
|
+
// level that happens to suit it less than the one it chose for itself.
|
|
79
|
+
return rebuilt.length < png.length ? rebuilt : png;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=recompress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recompress.js","sourceRoot":"","sources":["../../src/png/recompress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AACxC,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAExC;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC;;;;GAIG;AACH,SAAS,UAAU,CAAC,MAA2B;IAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL,MAAM,EAAE,IAAI,KAAK,MAAM;QACvB,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE;QACxB,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAC3C,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,OAAO,CAAC,MAA2B,EAAE,IAAY;IACxD,MAAM,KAAK,GAAa,CAAC,YAAY,CAAC,CAAC;IACvC,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACjD,CAAC;aAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YACtB,SAAS,GAAG,IAAI,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,KAAa;IAEb,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAEzD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;IAE9D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9E,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,YAAY,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAErE,2EAA2E;IAC3E,uEAAuE;IACvE,OAAO,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACrD,CAAC"}
|
package/dist/props.d.ts
CHANGED
|
@@ -4,4 +4,15 @@
|
|
|
4
4
|
* templates treat "not a usable string" and "absent" the same way.
|
|
5
5
|
*/
|
|
6
6
|
export declare function optionalString(value: unknown): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Read a prop as a list of strings: a YAML sequence as it stands, and a single
|
|
9
|
+
* value as a list of one.
|
|
10
|
+
*
|
|
11
|
+
* Taking the scalar too is what stops `tags: release` being a post with no
|
|
12
|
+
* tags. Frontmatter is hand-written, the two forms are both ordinary YAML, and
|
|
13
|
+
* a template asking for a list has nothing useful to do with the difference.
|
|
14
|
+
* Entries that are not usable strings are dropped rather than rendered as
|
|
15
|
+
* holes, which is {@link optionalString}'s rule applied item by item.
|
|
16
|
+
*/
|
|
17
|
+
export declare function stringList(value: unknown): readonly string[];
|
|
7
18
|
//# sourceMappingURL=props.d.ts.map
|
package/dist/props.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcjE"}
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAM5D"}
|
package/dist/props.js
CHANGED
|
@@ -14,4 +14,20 @@ export function optionalString(value) {
|
|
|
14
14
|
}
|
|
15
15
|
return undefined;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Read a prop as a list of strings: a YAML sequence as it stands, and a single
|
|
19
|
+
* value as a list of one.
|
|
20
|
+
*
|
|
21
|
+
* Taking the scalar too is what stops `tags: release` being a post with no
|
|
22
|
+
* tags. Frontmatter is hand-written, the two forms are both ordinary YAML, and
|
|
23
|
+
* a template asking for a list has nothing useful to do with the difference.
|
|
24
|
+
* Entries that are not usable strings are dropped rather than rendered as
|
|
25
|
+
* holes, which is {@link optionalString}'s rule applied item by item.
|
|
26
|
+
*/
|
|
27
|
+
export function stringList(value) {
|
|
28
|
+
const items = Array.isArray(value) ? value : [value];
|
|
29
|
+
return items
|
|
30
|
+
.map((item) => optionalString(item))
|
|
31
|
+
.filter((item) => item !== undefined && item !== "");
|
|
32
|
+
}
|
|
17
33
|
//# sourceMappingURL=props.js.map
|
package/dist/props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAErD,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;SACnC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Dimensions, ResolvedConfig } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Rasterise an SVG string to image bytes at `dimensions`.
|
|
4
|
+
*
|
|
5
|
+
* Every path that produces an image goes through here, so this is the one place
|
|
6
|
+
* the configured rasteriser has to be chosen. A project that supplies its own
|
|
7
|
+
* gets it used by `renderMetaImages`, by `generate` and by `colophon preview`
|
|
8
|
+
* alike, none of which knows there was a choice to make.
|
|
9
|
+
*
|
|
10
|
+
* It is also where the bytes are encoded as `config.format`, for the same
|
|
11
|
+
* reason and on the same terms: which format a build writes is the project's
|
|
12
|
+
* decision rather than the rasteriser's, and a caller taking the bytes away to
|
|
13
|
+
* write them itself should not have to encode them again to get what it asked
|
|
14
|
+
* for.
|
|
15
|
+
*
|
|
16
|
+
* It was `renderSvgToPng` while PNG was the only thing it could return. Now
|
|
17
|
+
* that a config chooses, that name would be wrong three times in four.
|
|
18
|
+
*/
|
|
19
|
+
export declare function renderSvgToImage(svg: string, dimensions: Dimensions, config?: ResolvedConfig): Promise<Buffer>;
|
|
20
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/render/image.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,MAAM,GAAE,cAAgC,GACvC,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { resolveConfig } from "../config/index.js";
|
|
2
|
+
import { encodeImage } from "../encode/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Rasterise an SVG string to image bytes at `dimensions`.
|
|
5
|
+
*
|
|
6
|
+
* Every path that produces an image goes through here, so this is the one place
|
|
7
|
+
* the configured rasteriser has to be chosen. A project that supplies its own
|
|
8
|
+
* gets it used by `renderMetaImages`, by `generate` and by `colophon preview`
|
|
9
|
+
* alike, none of which knows there was a choice to make.
|
|
10
|
+
*
|
|
11
|
+
* It is also where the bytes are encoded as `config.format`, for the same
|
|
12
|
+
* reason and on the same terms: which format a build writes is the project's
|
|
13
|
+
* decision rather than the rasteriser's, and a caller taking the bytes away to
|
|
14
|
+
* write them itself should not have to encode them again to get what it asked
|
|
15
|
+
* for.
|
|
16
|
+
*
|
|
17
|
+
* It was `renderSvgToPng` while PNG was the only thing it could return. Now
|
|
18
|
+
* that a config chooses, that name would be wrong three times in four.
|
|
19
|
+
*/
|
|
20
|
+
export async function renderSvgToImage(svg, dimensions, config = resolveConfig()) {
|
|
21
|
+
const bytes = await config.rasteriser(svg, dimensions, config);
|
|
22
|
+
// A rasteriser returns bytes, since not every one of them has a `Buffer` to
|
|
23
|
+
// return. Everything downstream of here is Node, and the stamp reads the
|
|
24
|
+
// image with `Buffer`'s own methods, so this is where the two meet. A
|
|
25
|
+
// `Buffer` arrives as itself rather than being copied.
|
|
26
|
+
const raster = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
|
|
27
|
+
return encodeImage(raster, config);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/render/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,UAAsB,EACtB,MAAM,GAAmB,aAAa,EAAE;IAExC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAE/D,4EAA4E;IAC5E,yEAAyE;IACzE,sEAAsE;IACtE,uDAAuD;IACvD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEnE,OAAO,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/render/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ColophonConfig, MetaImageProps, RenderedMetaImage } from "../types.js";
|
|
2
2
|
export { buildSvg } from "./svg.js";
|
|
3
|
-
export {
|
|
3
|
+
export { renderSvgToImage } from "./image.js";
|
|
4
|
+
export { resvgRasteriser } from "./rasterise.js";
|
|
4
5
|
/**
|
|
5
6
|
* Render an image for every configured output size from a single set of props.
|
|
6
7
|
* This is the reusable core: it takes props and config and returns rendered
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,cAAc,EACrB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiB9B"}
|
package/dist/render/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { resolveConfig } from "../config/index.js";
|
|
2
2
|
import { resolveConfigForSize } from "../config/size.js";
|
|
3
|
-
import {
|
|
3
|
+
import { renderSvgToImage } from "./image.js";
|
|
4
4
|
import { buildSvg } from "./svg.js";
|
|
5
5
|
import { selectTemplate } from "./template.js";
|
|
6
6
|
export { buildSvg } from "./svg.js";
|
|
7
|
-
export {
|
|
7
|
+
export { renderSvgToImage } from "./image.js";
|
|
8
|
+
export { resvgRasteriser } from "./rasterise.js";
|
|
8
9
|
/**
|
|
9
10
|
* Render an image for every configured output size from a single set of props.
|
|
10
11
|
* This is the reusable core: it takes props and config and returns rendered
|
|
@@ -20,8 +21,8 @@ export async function renderMetaImages(props, config) {
|
|
|
20
21
|
const sizeConfig = resolveConfigForSize(config, size);
|
|
21
22
|
const dimensions = { width: size.width, height: size.height };
|
|
22
23
|
const svg = await buildSvg(props, sizeConfig, dimensions);
|
|
23
|
-
const
|
|
24
|
-
return { name: size.name, dimensions, svg,
|
|
24
|
+
const bytes = await renderSvgToImage(svg, dimensions, sizeConfig);
|
|
25
|
+
return { name: size.name, dimensions, svg, bytes };
|
|
25
26
|
}));
|
|
26
27
|
}
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/dist/render/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAqB,EACrB,MAAuB;IAEvB,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAEvC,gEAAgE;IAChE,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,CAChB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAChC,0EAA0E;QAC1E,sEAAsE;QACtE,MAAM,UAAU,GAAG,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACtD,MAAM,UAAU,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;QAClE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IACrD,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/render/png.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import type { Dimensions, ResolvedConfig } from "../types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Rasterise an SVG string to
|
|
3
|
+
* Rasterise an SVG string to image bytes at `dimensions`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Every path that produces an image goes through here, so this is the one place
|
|
6
|
+
* the configured rasteriser has to be chosen. A project that supplies its own
|
|
7
|
+
* gets it used by `renderMetaImages`, by `generate` and by `colophon preview`
|
|
8
|
+
* alike, none of which knows there was a choice to make.
|
|
9
|
+
*
|
|
10
|
+
* It is also where the bytes are compressed again, for the same reason and on
|
|
11
|
+
* the same terms: an image is worth shrinking whoever asked for it, and a
|
|
12
|
+
* caller taking the bytes away to write itself should not have to know that the
|
|
13
|
+
* rasteriser left three quarters of the saving on the table.
|
|
14
|
+
*
|
|
15
|
+
* The name is what it was before the backend became configurable. PNG is still
|
|
16
|
+
* what comes back by default, and renaming this would break every caller to say
|
|
17
|
+
* something the config already says.
|
|
8
18
|
*/
|
|
9
19
|
export declare function renderSvgToPng(svg: string, dimensions: Dimensions, config?: ResolvedConfig): Promise<Buffer>;
|
|
10
20
|
//# sourceMappingURL=png.d.ts.map
|
package/dist/render/png.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"png.d.ts","sourceRoot":"","sources":["../../src/render/png.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"png.d.ts","sourceRoot":"","sources":["../../src/render/png.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,UAAU,EACtB,MAAM,GAAE,cAAgC,GACvC,OAAO,CAAC,MAAM,CAAC,CAUjB"}
|
package/dist/render/png.js
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { renderAsync } from "@resvg/resvg-js";
|
|
2
1
|
import { resolveConfig } from "../config/index.js";
|
|
3
|
-
import {
|
|
2
|
+
import { recompressPng } from "../png/recompress.js";
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Rasterise an SVG string to a PNG buffer, scaled to `dimensions.width`.
|
|
4
|
+
* Rasterise an SVG string to image bytes at `dimensions`.
|
|
5
|
+
*
|
|
6
|
+
* Every path that produces an image goes through here, so this is the one place
|
|
7
|
+
* the configured rasteriser has to be chosen. A project that supplies its own
|
|
8
|
+
* gets it used by `renderMetaImages`, by `generate` and by `colophon preview`
|
|
9
|
+
* alike, none of which knows there was a choice to make.
|
|
10
|
+
*
|
|
11
|
+
* It is also where the bytes are compressed again, for the same reason and on
|
|
12
|
+
* the same terms: an image is worth shrinking whoever asked for it, and a
|
|
13
|
+
* caller taking the bytes away to write itself should not have to know that the
|
|
14
|
+
* rasteriser left three quarters of the saving on the table.
|
|
18
15
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
16
|
+
* The name is what it was before the backend became configurable. PNG is still
|
|
17
|
+
* what comes back by default, and renaming this would break every caller to say
|
|
18
|
+
* something the config already says.
|
|
22
19
|
*/
|
|
23
20
|
export async function renderSvgToPng(svg, dimensions, config = resolveConfig()) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
const bytes = await config.rasteriser(svg, dimensions, config);
|
|
22
|
+
// A rasteriser returns bytes, since not every one of them has a `Buffer` to
|
|
23
|
+
// return. Everything downstream of here is Node, and the stamp reads the PNG
|
|
24
|
+
// with `Buffer`'s own methods, so this is where the two meet. A `Buffer`
|
|
25
|
+
// arrives as itself rather than being copied.
|
|
26
|
+
const png = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
|
|
27
|
+
return recompressPng(png, config.compressionLevel);
|
|
29
28
|
}
|
|
30
29
|
//# sourceMappingURL=png.js.map
|
package/dist/render/png.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"png.js","sourceRoot":"","sources":["../../src/render/png.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"png.js","sourceRoot":"","sources":["../../src/render/png.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAW,EACX,UAAsB,EACtB,MAAM,GAAmB,aAAa,EAAE;IAExC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAE/D,4EAA4E;IAC5E,6EAA6E;IAC7E,yEAAyE;IACzE,8CAA8C;IAC9C,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEhE,OAAO,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Rasteriser } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The default rasteriser: resvg, scaled to `dimensions.width`.
|
|
4
|
+
*
|
|
5
|
+
* Text is drawn with the fonts named by `config`, which is what keeps the
|
|
6
|
+
* output the same on a laptop, in CI and in a container. Height follows the
|
|
7
|
+
* SVG's own aspect ratio; `buildSvg` sizes it to match.
|
|
8
|
+
*
|
|
9
|
+
* It lives here rather than in `png.ts` so that `resolveConfig` can name it as
|
|
10
|
+
* the default without importing the module that dispatches to it. Nothing here
|
|
11
|
+
* reads config beyond the fonts, which is the whole of what a rasteriser is
|
|
12
|
+
* given to work with.
|
|
13
|
+
*/
|
|
14
|
+
export declare const resvgRasteriser: Rasteriser;
|
|
15
|
+
//# sourceMappingURL=rasterise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rasterise.d.ts","sourceRoot":"","sources":["../../src/render/rasterise.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAC;AAkB9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,EAAE,UAO7B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { renderAsync } from "@resvg/resvg-js";
|
|
2
|
+
import { fallbackFamily, fontFilePaths } from "../fonts/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Font options for resvg: the configured font files, and whether to fall back
|
|
5
|
+
* to the machine's own.
|
|
6
|
+
*/
|
|
7
|
+
async function fontOptions(config) {
|
|
8
|
+
const fallback = fallbackFamily(config.fonts);
|
|
9
|
+
return {
|
|
10
|
+
loadSystemFonts: config.systemFonts,
|
|
11
|
+
fontFiles: await fontFilePaths(config.fonts),
|
|
12
|
+
...(fallback !== undefined && { defaultFontFamily: fallback }),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The default rasteriser: resvg, scaled to `dimensions.width`.
|
|
17
|
+
*
|
|
18
|
+
* Text is drawn with the fonts named by `config`, which is what keeps the
|
|
19
|
+
* output the same on a laptop, in CI and in a container. Height follows the
|
|
20
|
+
* SVG's own aspect ratio; `buildSvg` sizes it to match.
|
|
21
|
+
*
|
|
22
|
+
* It lives here rather than in `png.ts` so that `resolveConfig` can name it as
|
|
23
|
+
* the default without importing the module that dispatches to it. Nothing here
|
|
24
|
+
* reads config beyond the fonts, which is the whole of what a rasteriser is
|
|
25
|
+
* given to work with.
|
|
26
|
+
*/
|
|
27
|
+
export const resvgRasteriser = async (svg, dimensions, config) => {
|
|
28
|
+
const rendered = await renderAsync(svg, {
|
|
29
|
+
fitTo: { mode: "width", value: dimensions.width },
|
|
30
|
+
font: await fontOptions(config),
|
|
31
|
+
});
|
|
32
|
+
return rendered.asPng();
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=rasterise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rasterise.js","sourceRoot":"","sources":["../../src/render/rasterise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlE;;;GAGG;AACH,KAAK,UAAU,WAAW,CACxB,MAAsB;IAEtB,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO;QACL,eAAe,EAAE,MAAM,CAAC,WAAW;QACnC,SAAS,EAAE,MAAM,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5C,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE;IAC3E,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE;QACtC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE;QACjD,IAAI,EAAE,MAAM,WAAW,CAAC,MAAM,CAAC;KAChC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC,CAAC"}
|
package/dist/render/svg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM9E;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,MAAM,CAAC,CAmCjB"}
|
package/dist/render/svg.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { backgroundSvg } from "../background.js";
|
|
1
|
+
import { backgroundSvg } from "../background/index.js";
|
|
2
2
|
import { loadImages } from "../image/index.js";
|
|
3
3
|
import { createMeasurer } from "../measure/index.js";
|
|
4
|
+
import { textureSvg } from "../texture/index.js";
|
|
4
5
|
import { selectTemplate } from "./template.js";
|
|
5
6
|
const backgroundId = "colophon-bg";
|
|
7
|
+
const textureId = "colophon-texture";
|
|
6
8
|
/**
|
|
7
9
|
* Build the complete SVG document for one image: the enclosing `<svg>` root,
|
|
8
10
|
* the config-driven background, and the template's foreground content.
|
|
@@ -19,6 +21,11 @@ export async function buildSvg(props, config, dimensions) {
|
|
|
19
21
|
loadImages(config, props),
|
|
20
22
|
]);
|
|
21
23
|
const background = backgroundSvg(config.background, dimensions, backgroundId, images.background);
|
|
24
|
+
// Over the background and under the template, so that a treatment gives the
|
|
25
|
+
// background some surface without ever coming between text and reader.
|
|
26
|
+
const texture = config.texture === undefined
|
|
27
|
+
? ""
|
|
28
|
+
: textureSvg(config.texture, dimensions, textureId);
|
|
22
29
|
const body = await template.render({
|
|
23
30
|
props,
|
|
24
31
|
config,
|
|
@@ -26,10 +33,11 @@ export async function buildSvg(props, config, dimensions) {
|
|
|
26
33
|
measure,
|
|
27
34
|
logo: images.logo,
|
|
28
35
|
avatar: images.avatar,
|
|
36
|
+
picture: images.picture,
|
|
29
37
|
});
|
|
30
38
|
const { width, height } = dimensions;
|
|
31
39
|
return (`<svg width="${String(width)}" height="${String(height)}"` +
|
|
32
40
|
` viewBox="0 0 ${String(width)} ${String(height)}"` +
|
|
33
|
-
` xmlns="http://www.w3.org/2000/svg">${background}${body}</svg>`);
|
|
41
|
+
` xmlns="http://www.w3.org/2000/svg">${background}${texture}${body}</svg>`);
|
|
34
42
|
}
|
|
35
43
|
//# sourceMappingURL=svg.js.map
|
package/dist/render/svg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/render/svg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,KAAqB,EACrB,MAAsB,EACtB,UAAsB;IAEtB,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,cAAc,CAAC,MAAM,CAAC;QACtB,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC;KAC1B,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,aAAa,CAC9B,MAAM,CAAC,UAAU,EACjB,UAAU,EACV,YAAY,EACZ,MAAM,CAAC,UAAU,CAClB,CAAC;IACF,4EAA4E;IAC5E,uEAAuE;IACvE,MAAM,OAAO,GACX,MAAM,CAAC,OAAO,KAAK,SAAS;QAC1B,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACjC,KAAK;QACL,MAAM;QACN,UAAU;QACV,OAAO;QACP,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IACH,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IAErC,OAAO,CACL,eAAe,MAAM,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,GAAG;QAC1D,iBAAiB,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG;QACnD,uCAAuC,UAAU,GAAG,OAAO,GAAG,IAAI,QAAQ,CAC3E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base64url, which is what a signature has to be to travel in a URL.
|
|
3
|
+
*
|
|
4
|
+
* It is ordinary base64 with two characters swapped and the padding dropped,
|
|
5
|
+
* so the encoding itself comes from `platform/base64.ts` and this is only the
|
|
6
|
+
* alphabet. `+`, `/` and `=` all mean something in a query string, and a
|
|
7
|
+
* signature carrying them would depend on every proxy between the two ends
|
|
8
|
+
* escaping them the same way.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toBase64Url(bytes: Uint8Array): string;
|
|
11
|
+
/**
|
|
12
|
+
* The reverse. The padding `toBase64Url` dropped is not needed to decode, since
|
|
13
|
+
* the length of the input says where the bytes end.
|
|
14
|
+
*/
|
|
15
|
+
export declare function fromBase64Url(text: string): Uint8Array<ArrayBuffer>;
|
|
16
|
+
//# sourceMappingURL=base64url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../../src/sign/base64url.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAKrD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAEnE"}
|