@allyhub/sdk 0.8.0 → 0.9.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/CHANGELOG.md +11 -0
- package/NOTICE +46 -49
- package/dist/dom.d.ts +1 -209
- package/dist/dom.js +1 -1
- package/dist/image.d.ts +2 -0
- package/dist/image.js +2 -0
- package/dist/index.d.ts +1 -21
- package/dist/index.js +1 -1
- package/dist/media.d.ts +1 -5
- package/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/levels.d.ts +4 -5
- package/dist/node_modules/@allyhub/audio/dist/levels.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.d.ts +1 -6
- package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.js +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/LICENSE +241 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/fact.d.ts +37 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/fact.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +43 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.d.ts +30 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/package.json +14 -0
- package/dist/node_modules/@allyhub/formats/dist/contributed.d.ts +126 -0
- package/dist/node_modules/@allyhub/formats/dist/contributed.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +7 -12
- package/dist/node_modules/@allyhub/formats/dist/data/reference.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/script.d.ts +9 -4
- package/dist/node_modules/@allyhub/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +20 -82
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +96 -8
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.d.ts +2 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/extension.d.ts +91 -0
- package/dist/node_modules/@allyhub/formats/dist/extension.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/files.d.ts +51 -0
- package/dist/node_modules/@allyhub/formats/dist/files.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/index.d.ts +5 -1
- package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +226 -90
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +7 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +46 -42
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-draw/dist/context.d.ts +5 -0
- package/dist/node_modules/@allyhub/image-draw/dist/context.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/contrast.d.ts +13 -0
- package/dist/node_modules/@allyhub/image-draw/dist/contrast.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/env.d.ts +112 -0
- package/dist/node_modules/@allyhub/image-draw/dist/env.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/errors.d.ts +20 -0
- package/dist/node_modules/@allyhub/image-draw/dist/errors.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.d.ts +110 -0
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/guards.d.ts +32 -0
- package/dist/node_modules/@allyhub/image-draw/dist/guards.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/hash.d.ts +3 -0
- package/dist/node_modules/@allyhub/image-draw/dist/hash.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.d.ts +113 -0
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +3 -0
- package/dist/node_modules/@allyhub/image-draw/dist/layer-style.d.ts +151 -0
- package/dist/node_modules/@allyhub/image-draw/dist/layer-style.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/paint.d.ts +29 -0
- package/dist/node_modules/@allyhub/image-draw/dist/paint.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/pictures.d.ts +39 -0
- package/dist/node_modules/@allyhub/image-draw/dist/pictures.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/plan.d.ts +52 -0
- package/dist/node_modules/@allyhub/image-draw/dist/plan.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/reads.d.ts +145 -0
- package/dist/node_modules/@allyhub/image-draw/dist/reads.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/shape-path.d.ts +26 -0
- package/dist/node_modules/@allyhub/image-draw/dist/shape-path.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/stage.d.ts +56 -0
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/styles.d.ts +35 -0
- package/dist/node_modules/@allyhub/image-draw/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/tone.d.ts +53 -0
- package/dist/node_modules/@allyhub/image-draw/dist/tone.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/package.json +14 -0
- package/dist/node_modules/@allyhub/image-measure/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-measure/dist/contrast.d.ts +43 -0
- package/dist/node_modules/@allyhub/image-measure/dist/contrast.js +2 -0
- package/dist/node_modules/@allyhub/image-measure/dist/layout.d.ts +186 -0
- package/dist/node_modules/@allyhub/image-measure/dist/layout.js +5 -0
- package/dist/node_modules/@allyhub/image-measure/package.json +14 -0
- package/dist/node_modules/@allyhub/image-sdk/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.d.ts +13 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.js +2 -0
- package/dist/{define.d.ts → node_modules/@allyhub/image-sdk/dist/define.d.ts} +21 -4
- package/dist/node_modules/@allyhub/image-sdk/dist/define.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/dom.d.ts +210 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/dom.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/fill.d.ts +21 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/fill.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/group.d.ts +17 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/group.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +166 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/media.d.ts +6 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/media.js +2 -0
- package/dist/{messages.d.ts → node_modules/@allyhub/image-sdk/dist/messages.d.ts} +1 -1
- package/dist/node_modules/@allyhub/image-sdk/dist/picture.d.ts +59 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/picture.js +2 -0
- package/dist/{props.d.ts → node_modules/@allyhub/image-sdk/dist/props.d.ts} +4 -4
- package/dist/node_modules/@allyhub/image-sdk/dist/shape.d.ts +34 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/shape.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/stack.d.ts +16 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/stack.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.d.ts +38 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.js +2 -0
- package/dist/{written.js → node_modules/@allyhub/image-sdk/dist/written.js} +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +19 -0
- package/dist/node_modules/@allyhub/measure/LICENSE +241 -0
- package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +195 -0
- package/dist/node_modules/@allyhub/measure/dist/compare.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +8 -0
- package/dist/node_modules/@allyhub/measure/dist/grain.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/image.d.ts +16 -0
- package/dist/node_modules/@allyhub/measure/dist/image.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub/measure/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/measure/package.json +13 -0
- package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.d.ts +4 -1
- package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.d.ts +15 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/LICENSE +241 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.d.ts +1 -9
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/context.d.ts +39 -0
- package/dist/node_modules/@allyhub/piece/dist/context.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.d.ts +2 -2
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/export.d.ts +27 -10
- package/dist/node_modules/@allyhub/piece/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/formats.d.ts +12 -68
- package/dist/node_modules/@allyhub/piece/dist/formats.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +104 -0
- package/dist/node_modules/@allyhub/piece/dist/index.d.ts +26 -0
- package/dist/node_modules/@allyhub/piece/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layer-style.d.ts +1558 -0
- package/dist/node_modules/@allyhub/piece/dist/layer-style.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +389 -0
- package/dist/node_modules/@allyhub/piece/dist/layer.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +421 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.d.ts +1 -1
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.d.ts +39 -9
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.d.ts +6 -0
- package/dist/node_modules/@allyhub/piece/dist/names.d.ts +26 -0
- package/dist/node_modules/@allyhub/piece/dist/names.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +21 -0
- package/dist/node_modules/@allyhub/piece/dist/page/console.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +3 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +4 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/picture.d.ts +62 -0
- package/dist/node_modules/@allyhub/piece/dist/picture.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/piece.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/piece.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/script.d.ts +9 -4
- package/dist/node_modules/@allyhub/piece/dist/script.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +131 -0
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +285 -0
- package/dist/node_modules/@allyhub/piece/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/version.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/version.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.d.ts +1 -20
- package/dist/node_modules/@allyhub/piece/package.json +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +139 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +3 -10
- package/dist/node_modules/@allyhub/protocol/dist/app.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +12 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +232 -132
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/files.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +22 -9
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/image.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +5 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +98 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +273 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +26 -0
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +59 -0
- package/dist/node_modules/@allyhub/protocol/dist/peer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +21 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +125 -0
- package/dist/node_modules/@allyhub/protocol/dist/presence.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +35 -0
- package/dist/node_modules/@allyhub/protocol/dist/shape.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +2 -8
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +70 -40
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +224 -177
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +14 -0
- package/dist/node_modules/@allyhub/runtimes/dist/declared.js +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +15 -0
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.js +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +1 -0
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/manifest.json +0 -82
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/define.d.ts +2 -0
- package/dist/node_modules/@allyhub/scenery/dist/define.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/code.d.ts +4 -4
- package/dist/node_modules/@allyhub/sheet/dist/api/code.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +15 -11
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/server.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/file.d.ts +5 -0
- package/dist/node_modules/@allyhub/sheet/dist/file.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/generated.d.ts +5 -19
- package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/import.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +3 -4
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +76 -1
- package/dist/node_modules/@allyhub/sheet/dist/patch.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/patch.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/sdk.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/sdk.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +6 -6
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +5 -1
- package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +23 -7
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +44 -4
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +18 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/code.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/connect.d.ts +62 -0
- package/dist/node_modules/@allyhub/slides-core/dist/connect.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +208 -0
- package/dist/node_modules/@allyhub/slides-core/dist/fact.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +4 -4
- package/dist/node_modules/@allyhub/slides-core/dist/file.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.d.ts +4 -2
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/merge.d.ts +5 -5
- package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +19 -2
- package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/path.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +17 -10
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +18 -0
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/stage.d.ts +28 -11
- package/dist/node_modules/@allyhub/slides-core/dist/units.d.ts +3 -6
- package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +5 -1
- package/dist/node_modules/@allyhub/video-core/dist/audio-types.d.ts +1 -2
- package/dist/node_modules/@allyhub/video-core/dist/captions.d.ts +1 -10
- package/dist/node_modules/@allyhub/video-core/dist/captions.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/check.d.ts +62 -0
- package/dist/node_modules/@allyhub/video-core/dist/check.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/cut-report.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/cut-report.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/edits.d.ts +3 -3
- package/dist/node_modules/@allyhub/video-core/dist/edits.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/fact.d.ts +21 -762
- package/dist/node_modules/@allyhub/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.d.ts +3 -2
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/index.d.ts +3 -17
- package/dist/node_modules/@allyhub/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/measure.d.ts +72 -423
- package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -4
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.d.ts +44 -0
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/motion.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +22 -430
- package/dist/node_modules/@allyhub/video-core/dist/piece.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/placement.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +6 -12
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/script-edit.d.ts +11 -6
- package/dist/node_modules/@allyhub/video-core/dist/script-edit.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/seams.d.ts +2 -3
- package/dist/node_modules/@allyhub/video-core/dist/sound-under.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/sound-under.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/speech.d.ts +2 -4
- package/dist/node_modules/@allyhub/video-core/dist/speech.js +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/stage.d.ts +52 -0
- package/dist/node_modules/@allyhub/video-core/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +18 -136
- package/dist/node_modules/@allyhub/video-core/dist/timeline.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/timing.d.ts +3 -3
- package/dist/node_modules/@allyhub/video-core/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/transcript.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/transcript.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/LICENSE +241 -0
- package/dist/node_modules/@allyhub/video-sdk/NOTICE +118 -0
- package/dist/{free.d.ts → node_modules/@allyhub/video-sdk/dist/free.d.ts} +14 -10
- package/dist/node_modules/@allyhub/video-sdk/dist/free.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/index.d.ts +28 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/index.js +2 -0
- package/dist/{input.d.ts → node_modules/@allyhub/video-sdk/dist/input.d.ts} +76 -22
- package/dist/node_modules/@allyhub/video-sdk/dist/input.js +2 -0
- package/dist/{module.d.ts → node_modules/@allyhub/video-sdk/dist/module.d.ts} +6 -4
- package/dist/node_modules/@allyhub/video-sdk/dist/module.js +2 -0
- package/dist/{parts.d.ts → node_modules/@allyhub/video-sdk/dist/parts.d.ts} +15 -6
- package/dist/node_modules/@allyhub/video-sdk/dist/parts.js +2 -0
- package/dist/{piece.d.ts → node_modules/@allyhub/video-sdk/dist/piece.d.ts} +26 -16
- package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/route.d.ts +46 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/route.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/scenery.d.ts +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/scenery.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/package.json +19 -0
- package/dist/scenery.d.ts +1 -1
- package/dist/scenery.js +1 -1
- package/dist/sheets.d.ts +1 -1
- package/dist/sheets.js +1 -1
- package/dist/slides.d.ts +1 -9
- package/dist/slides.js +1 -1
- package/docs/README.md +8 -6
- package/docs/batches.md +5 -5
- package/docs/contract.md +2 -2
- package/docs/defaults.md +278 -20
- package/docs/docs.md +77 -63
- package/docs/footage.md +7 -7
- package/docs/image.md +165 -0
- package/docs/layers.md +22 -13
- package/docs/modeling.md +4 -4
- package/docs/pictures.md +65 -0
- package/docs/project.md +51 -31
- package/docs/scenery.md +11 -11
- package/docs/sheets.md +26 -25
- package/docs/slides.md +73 -65
- package/docs/sound.md +3 -3
- package/docs/speech.md +8 -8
- package/docs/video.md +16 -13
- package/docs/websites.md +4 -4
- package/package.json +7 -2
- package/dist/define.js +0 -2
- package/dist/free.js +0 -2
- package/dist/input.js +0 -2
- package/dist/module.js +0 -2
- package/dist/node_modules/@allyhub/formats/dist/data/comments.d.ts +0 -94
- package/dist/node_modules/@allyhub/formats/dist/data/comments.js +0 -2
- package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package-lock.json +0 -227
- package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package.json +0 -8
- package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -105
- package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package.json +0 -8
- package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package-lock.json +0 -128
- package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package.json +0 -9
- package/dist/node_modules/@allyhub/video-core/dist/export.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/formats.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/gen.d.ts +0 -37
- package/dist/node_modules/@allyhub/video-core/dist/problem.d.ts +0 -278
- package/dist/node_modules/@allyhub/video-core/dist/problem.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/script.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/source.d.ts +0 -7
- package/dist/parts.js +0 -2
- package/dist/piece.js +0 -2
- /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.js +0 -0
- /package/dist/{fit.d.ts → node_modules/@allyhub/image-sdk/dist/fit.d.ts} +0 -0
- /package/dist/{fit.js → node_modules/@allyhub/image-sdk/dist/fit.js} +0 -0
- /package/dist/{messages.js → node_modules/@allyhub/image-sdk/dist/messages.js} +0 -0
- /package/dist/{props.js → node_modules/@allyhub/image-sdk/dist/props.js} +0 -0
- /package/dist/{text.d.ts → node_modules/@allyhub/image-sdk/dist/text.d.ts} +0 -0
- /package/dist/{text.js → node_modules/@allyhub/image-sdk/dist/text.js} +0 -0
- /package/dist/{written.d.ts → node_modules/@allyhub/image-sdk/dist/written.d.ts} +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/gen.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/source.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.js +0 -0
- /package/dist/{anim.d.ts → node_modules/@allyhub/video-sdk/dist/anim.d.ts} +0 -0
- /package/dist/{anim.js → node_modules/@allyhub/video-sdk/dist/anim.js} +0 -0
- /package/dist/{noise.d.ts → node_modules/@allyhub/video-sdk/dist/noise.d.ts} +0 -0
- /package/dist/{noise.js → node_modules/@allyhub/video-sdk/dist/noise.js} +0 -0
- /package/dist/{paths.d.ts → node_modules/@allyhub/video-sdk/dist/paths.d.ts} +0 -0
- /package/dist/{paths.js → node_modules/@allyhub/video-sdk/dist/paths.js} +0 -0
- /package/dist/{phone.d.ts → node_modules/@allyhub/video-sdk/dist/phone.d.ts} +0 -0
- /package/dist/{phone.js → node_modules/@allyhub/video-sdk/dist/phone.js} +0 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { LAYER_BRAND, type BuildContext, type MediaInfo, type GraphicLayer, type LayerTiming, type Matrix } from "@allyhub/piece";
|
|
2
|
+
import { type FillFn } from "./fill.js";
|
|
3
|
+
import { type PictureFn } from "./picture.js";
|
|
4
|
+
import { type ShapeFn } from "./shape.js";
|
|
5
|
+
import { type TextLayerFn } from "./text-layer.js";
|
|
6
|
+
export type { PictureFit, PicturePoint } from "@allyhub/piece";
|
|
7
|
+
export type { PictureFn, PictureOptions } from "./picture.js";
|
|
8
|
+
export { LayerError, custom, defineComponent, type Component, type ComponentDefinition, type CustomOptions, type LayerOptions, type StageContext, } from "./define.js";
|
|
9
|
+
export { group, groupLayers, type GroupOptions } from "./group.js";
|
|
10
|
+
export { adjustment, type AdjustmentOptions } from "./adjustment.js";
|
|
11
|
+
export type { FillFn, FillOptions } from "./fill.js";
|
|
12
|
+
export type { ShapeFn, ShapeOptions } from "./shape.js";
|
|
13
|
+
export type { TextItem, TextLayerFn, TextLayerOptions } from "./text-layer.js";
|
|
14
|
+
export { mountLayer, mountStack } from "./stack.js";
|
|
15
|
+
export { ADJUSTMENT_DEFAULTS, ADJUSTMENT_KINDS, BLEND_DRAWN, BLEND_MODES, EFFECT_DEFAULTS, EFFECT_NAMES, LAYER_STYLE_DEFAULTS, SHAPE_DEFAULTS, TEXT_DEFAULTS, type Adjustment, type BlendMode, type Effects, type Fill, type Gradient, type LayerKind, type LayerMask, type LayerStyle, } from "@allyhub/piece";
|
|
16
|
+
/** A layer of a board: a component's, picture()'s or custom()'s (a footage layer is a video's). */
|
|
17
|
+
export type LayerSpec = GraphicLayer | (LayerTiming & {
|
|
18
|
+
readonly [LAYER_BRAND]: "footage";
|
|
19
|
+
});
|
|
20
|
+
/** Whether a value is a layer a component, picture(), custom() or footage() made. */
|
|
21
|
+
export declare const isLayerSpec: (v: unknown) => v is LayerSpec;
|
|
22
|
+
/** Marks an image image() made. */
|
|
23
|
+
export declare const IMAGE_BRAND = "__allyhubImage";
|
|
24
|
+
/** Marks a board board() made. */
|
|
25
|
+
export declare const BOARD_BRAND = "__allyhubBoard";
|
|
26
|
+
/**
|
|
27
|
+
* The defaults of a board whose height grows with what it holds
|
|
28
|
+
* (`height: "auto"`), each one changeable on the board: pixels.
|
|
29
|
+
*/
|
|
30
|
+
export declare const BOARD_DEFAULTS: {
|
|
31
|
+
/** The height its layers are laid out at before it is measured, and the least it is. */
|
|
32
|
+
readonly minHeight: 64;
|
|
33
|
+
/** The most it grows to; what reaches further is cut. */
|
|
34
|
+
readonly maxHeight: 16384;
|
|
35
|
+
/** Pixels per inch, for print and PSD (Photoshop's 72 for the screen). */
|
|
36
|
+
readonly resolution: 72;
|
|
37
|
+
/** The colour profile a board is drawn in and said to be. */
|
|
38
|
+
readonly colorProfile: "sRGB IEC61966-2.1";
|
|
39
|
+
};
|
|
40
|
+
/** The longest side a board takes, pixels: what one picture the stage draws holds. */
|
|
41
|
+
export declare const MAX_SIDE = 16384;
|
|
42
|
+
export interface BoardOptions {
|
|
43
|
+
/** Its name: unique in the image, the file it renders to (`og.png`), stable across combos. */
|
|
44
|
+
key: string;
|
|
45
|
+
/** Its size, `WIDTHxHEIGHT` in pixels ("1200x630"). Or `width` and `height`. */
|
|
46
|
+
size?: string;
|
|
47
|
+
/** Its width, pixels (with `height`, instead of `size`). */
|
|
48
|
+
width?: number;
|
|
49
|
+
/** Its height, pixels, or "auto": as tall as what its layers hold (a tall detail picture). */
|
|
50
|
+
height?: number | "auto";
|
|
51
|
+
/** A "auto" board's least height, and the height it is laid out at first; default BOARD_DEFAULTS.minHeight. */
|
|
52
|
+
minHeight?: number;
|
|
53
|
+
/** A "auto" board's most height; default BOARD_DEFAULTS.maxHeight. */
|
|
54
|
+
maxHeight?: number;
|
|
55
|
+
/** Its name for people; default its key. */
|
|
56
|
+
title?: string;
|
|
57
|
+
/** What it shows, back to front, each with its name (`key`); a group's layers too, each named once in the board. */
|
|
58
|
+
layers: LayerSpec[];
|
|
59
|
+
/** What is drawn under its layers, a CSS colour or "transparent" (Photoshop's artboard background); default the image's (white, or none when it is transparent). */
|
|
60
|
+
background?: string;
|
|
61
|
+
/** Its resolution for print and PSD, pixels per inch: metadata, nothing drawn changes; default BOARD_DEFAULTS.resolution. */
|
|
62
|
+
resolution?: number;
|
|
63
|
+
/** Its colour profile's name for print and PSD: metadata, it is drawn in sRGB; default BOARD_DEFAULTS.colorProfile. */
|
|
64
|
+
colorProfile?: string;
|
|
65
|
+
}
|
|
66
|
+
/** A board as board() makes it. */
|
|
67
|
+
export type Board = BoardOptions & {
|
|
68
|
+
readonly [BOARD_BRAND]: true;
|
|
69
|
+
};
|
|
70
|
+
/** Whether a value is a board board() made. */
|
|
71
|
+
export declare function isBoard(v: unknown): v is Board;
|
|
72
|
+
/** A board's size as written: whole pixels, or a height that grows. */
|
|
73
|
+
export type BoardSize = {
|
|
74
|
+
readonly width: number;
|
|
75
|
+
readonly height: number;
|
|
76
|
+
} | {
|
|
77
|
+
readonly width: number;
|
|
78
|
+
readonly height: "auto";
|
|
79
|
+
readonly minHeight: number;
|
|
80
|
+
readonly maxHeight: number;
|
|
81
|
+
};
|
|
82
|
+
/** `WIDTHxHEIGHT` as numbers, or undefined. */
|
|
83
|
+
export declare function parseSize(size: string): {
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
} | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* A board the size of a picture, as `size` takes it ("4032x3024"): for a
|
|
89
|
+
* board that starts from a photo, the photo its bottom layer
|
|
90
|
+
* (`picture({ key: "photo", src })`, drawn whole at its own pixels). The
|
|
91
|
+
* picture is an import, or what `ctx.asset()` gives; its file is never
|
|
92
|
+
* changed.
|
|
93
|
+
*/
|
|
94
|
+
export declare function fromPicture(src: MediaInfo): string;
|
|
95
|
+
/** A board's size as it writes it; a string says what is wrong. */
|
|
96
|
+
export declare function boardSize(b: BoardOptions): BoardSize | string;
|
|
97
|
+
/**
|
|
98
|
+
* What board() and image() refuse: the rule it breaks (`code`, the
|
|
99
|
+
* image's: AK-I001 a size, AK-I002 a name used twice, AK-I003 a layer) and
|
|
100
|
+
* why. The stage reports it under that rule, at the line that made it.
|
|
101
|
+
*/
|
|
102
|
+
export declare class ImageError extends Error {
|
|
103
|
+
readonly code: string;
|
|
104
|
+
constructor(code: string, message: string);
|
|
105
|
+
}
|
|
106
|
+
/** A board of an image: its key, its size and its layers, each named. */
|
|
107
|
+
export declare function board(opts: BoardOptions): Board;
|
|
108
|
+
/** What an image's boards function receives: its combo, the language's text, the project's media and data. */
|
|
109
|
+
export type ImageContext = BuildContext;
|
|
110
|
+
export interface ImageOptions {
|
|
111
|
+
/** A stable identity. Default: its module's file without its extension, from the project's root. */
|
|
112
|
+
id?: string;
|
|
113
|
+
/** A name for people. Default: its script's `title`, else the folder. */
|
|
114
|
+
title?: string | Record<string, string>;
|
|
115
|
+
/** The matrix, as a video's: `dims` (lang, variants) crossed in full, slots. Each combo is a set of its boards. */
|
|
116
|
+
matrix?: Matrix;
|
|
117
|
+
/** Any key-values: the platform filters and groups by them. */
|
|
118
|
+
meta?: Record<string, unknown>;
|
|
119
|
+
/**
|
|
120
|
+
* Its script, a file per language, from this module's folder: `{locale}`
|
|
121
|
+
* in its name stands for each (`./launch.{locale}.yaml`): its title,
|
|
122
|
+
* each board's words by layer key and a picture's alt text. None: it has
|
|
123
|
+
* no words of its own.
|
|
124
|
+
*/
|
|
125
|
+
script?: string;
|
|
126
|
+
/** Its boards have no background: their files keep the alpha channel (PNG, WebP, AVIF). */
|
|
127
|
+
transparent?: boolean;
|
|
128
|
+
/** Its boards, in order. */
|
|
129
|
+
boards(ctx: ImageContext): Board[] | Promise<Board[]>;
|
|
130
|
+
}
|
|
131
|
+
/** An image as image() makes it: its fields as written, and where. */
|
|
132
|
+
export type Image = ImageOptions & {
|
|
133
|
+
readonly [IMAGE_BRAND]: true;
|
|
134
|
+
readonly kind: "image";
|
|
135
|
+
readonly written: {
|
|
136
|
+
readonly file: string;
|
|
137
|
+
readonly base: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/** Whether a value is an image image() made. */
|
|
141
|
+
export declare function isImage(v: unknown): v is Image;
|
|
142
|
+
/** image() as a module calls it. */
|
|
143
|
+
export type ImageFn = (opts: ImageOptions) => Image;
|
|
144
|
+
/** image() for the module `file` names (a project path; "" the root). */
|
|
145
|
+
export declare const imageFor: (file: string) => ImageFn;
|
|
146
|
+
/** What the build gives the file that imports this entry: image(), picture(), textLayer(), shape() and fill() made for it. */
|
|
147
|
+
export declare const imageSdkFor: (module: {
|
|
148
|
+
file: string;
|
|
149
|
+
}) => {
|
|
150
|
+
image: ImageFn;
|
|
151
|
+
picture: PictureFn;
|
|
152
|
+
textLayer: TextLayerFn;
|
|
153
|
+
shape: ShapeFn;
|
|
154
|
+
fill: FillFn;
|
|
155
|
+
};
|
|
156
|
+
/** An image: the default export of an image's module. Its function returns its boards, in order. */
|
|
157
|
+
export declare const image: ImageFn;
|
|
158
|
+
/** A still on a layer, in CSS's terms: picture({ key, src: photo, fit: "cover", position: [0.62, 0.4] }). */
|
|
159
|
+
export declare const picture: PictureFn;
|
|
160
|
+
/** Photoshop's type layer: textLayer({ key, textItem: { contents: ctx.s("title"), characterStyle: { size: 96 } }, box }). */
|
|
161
|
+
export declare const textLayer: TextLayerFn;
|
|
162
|
+
/** Photoshop's shape layer: shape({ key, shape: "ellipse", box, fill: { color: "#e4572e" }, stroke: { width: 4 } }). */
|
|
163
|
+
export declare const shape: ShapeFn;
|
|
164
|
+
/** Photoshop's fill layer: fill({ key, fill: { gradient: { stops: [...] } } }). */
|
|
165
|
+
export declare const fill: FillFn;
|
|
166
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{dirOf as l,projectPath as g}from"@allyhub/formats";import{LAYER_BRAND as u}from"@allyhub/piece";import{isColor as y}from"@allyhub/piece";import{fillFor as p}from"./fill.js";import{groupLayers as w}from"./group.js";import{pictureFor as x}from"./picture.js";import{shapeFor as A}from"./shape.js";import{textLayerFor as $}from"./text-layer.js";import{writtenIn as k}from"./written.js";export{LayerError,custom,defineComponent}from"./define.js";export{group,groupLayers}from"./group.js";export{adjustment}from"./adjustment.js";export{mountLayer,mountStack}from"./stack.js";export{ADJUSTMENT_DEFAULTS,ADJUSTMENT_KINDS,BLEND_DRAWN,BLEND_MODES,EFFECT_DEFAULTS,EFFECT_NAMES,LAYER_STYLE_DEFAULTS,SHAPE_DEFAULTS,TEXT_DEFAULTS}from"@allyhub/piece";export const isLayerSpec=e=>typeof e=="object"&&e!==null&&u in e,IMAGE_BRAND="__allyhubImage",BOARD_BRAND="__allyhubBoard",BOARD_DEFAULTS={minHeight:64,maxHeight:16384,resolution:72,colorProfile:"sRGB IEC61966-2.1"},MAX_SIDE=16384;export function isBoard(e){return typeof e=="object"&&e!==null&&BOARD_BRAND in e}const n=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=MAX_SIDE;export function parseSize(e){const r=/^(\d+)x(\d+)$/u.exec(e.trim());if(!r)return;const t=Number(r[1]),i=Number(r[2]);return n(t)&&n(i)?{width:t,height:i}:void 0}export function fromPicture(e){const{width:r,height:t}=e;if(e.kind!=="image"||r===void 0||t===void 0||!n(r)||!n(t))throw new ImageError("AK-I001",`fromPicture(${JSON.stringify(e.path)}): ${e.kind==="image"?`its size is not known in whole pixels from 1 to ${String(MAX_SIDE)}`:"it is not a still picture"}. Import a still picture (import photo from "../assets/media/photo.jpg"), or give the board its size.`);return`${String(r)}x${String(t)}`}export function boardSize(e){const r=`whole pixels from 1 to ${String(MAX_SIDE)}`;if(e.size!==void 0)return e.width!==void 0||e.height!==void 0?`board ${e.key} gives both size and width/height: give one.`:(typeof e.size=="string"?parseSize(e.size):void 0)??`board ${e.key}: size ${JSON.stringify(e.size)} is not WIDTHxHEIGHT in ${r} ("1200x630").`;if(e.width===void 0&&e.height===void 0)return`board ${e.key} has no size: give size ("1200x630"), or width and height.`;if(!n(e.width))return`board ${e.key}: width is not ${r}.`;if(e.height==="auto"){const t=e.minHeight??BOARD_DEFAULTS.minHeight,i=e.maxHeight??BOARD_DEFAULTS.maxHeight;return!n(t)||!n(i)||t>i?`board ${e.key}: minHeight and maxHeight are ${r}, the least first.`:{width:e.width,height:"auto",minHeight:t,maxHeight:i}}return n(e.height)?{width:e.width,height:e.height}:`board ${e.key}: height is not ${r} or "auto".`}export class ImageError extends Error{code;constructor(r,t){super(t),this.name="ImageError",this.code=r}}export function board(e){if(typeof e.key!="string"||!/^[A-Za-z0-9][\w.-]*$/u.test(e.key))throw new ImageError("AK-I002",`board: key ${JSON.stringify(e.key)} is not a name (letters, digits, - _ and ., from a letter or digit): it names the board's file.`);const r=boardSize(e);if(typeof r=="string")throw new ImageError("AK-I001",`board ${r}`);if(!Array.isArray(e.layers))throw new ImageError("AK-I003",`board ${e.key}: layers is a list of layers.`);if(e.background!==void 0&&e.background!=="transparent"&&!y(e.background))throw new ImageError("AK-I001",`board ${e.key}: background ${JSON.stringify(e.background)} is not a CSS colour or "transparent".`);if(e.resolution!==void 0&&!(typeof e.resolution=="number"&&e.resolution>0&&e.resolution<=1e4))throw new ImageError("AK-I001",`board ${e.key}: resolution is pixels per inch, more than 0.`);if(e.colorProfile!==void 0&&typeof e.colorProfile!="string")throw new ImageError("AK-I001",`board ${e.key}: colorProfile is a profile's name.`);const t=new Set,i=(h,c)=>{h.forEach((s,m)=>{const f=`${c} ${String(m+1)}`;if(!isLayerSpec(s))throw new ImageError("AK-I003",`${f} is not a layer made by a component, picture(), textLayer(), shape(), fill(), adjustment(), group() or custom().`);const o=s.key;if(typeof o!="string"||o==="")throw new ImageError("AK-I003",`${f} has no name: give every layer of a board its key (picture({ key: "photo", … }), Caption({ key: "caption", … })).`);if(!/^[A-Za-z0-9][\w.-]*$/u.test(o))throw new ImageError("AK-I002",`board ${e.key}: layer key ${JSON.stringify(o)} is not a name (letters, digits, - _ and ., from a letter or digit).`);if(t.has(o))throw new ImageError("AK-I002",`board ${e.key}: two layers are named ${o}. Every layer of a board needs its own key, a group's layers too.`);t.add(o);const d=s[u]==="graphic"?w(s):[];d.length>0&&i(d,`board ${e.key}: group ${o}'s layer`)})};return i(e.layers,`board ${e.key}: layer`),{...e,[BOARD_BRAND]:!0}}export function isImage(e){return typeof e=="object"&&e!==null&&IMAGE_BRAND in e}function S(e){const r=g(e);if(r.startsWith("/")||r.split("/").includes(".."))throw new Error(`imageSdkFor: ${JSON.stringify(e)} is not a project path, such as "launch/og.ts".`);return{file:r,base:l(r)}}export const imageFor=e=>r=>{if(typeof r!="object"||typeof r.boards!="function")throw new ImageError("AK-I005",`An image's module exports one image: export default image({ script: "./launch.{locale}.yaml", boards: (ctx) => [ board({ key, size, layers }), … ] }).`);if(r.script!==void 0&&(typeof r.script!="string"||!r.script.includes("{locale}")))throw new ImageError("AK-I005",`An image's script is a file per language: write {locale} in its name for each (./launch.{locale}.yaml), not ${JSON.stringify(r.script)}.`);return{...r,[IMAGE_BRAND]:!0,kind:"image",written:S(e)}},imageSdkFor=e=>{const r=k(e);return{image:imageFor(e.file),picture:x(r),textLayer:$(r),shape:A(r),fill:p(r)}};const a=imageSdkFor({file:""});export const image=a.image,picture=a.picture,textLayer=a.textLayer,shape=a.shape,fill=a.fill;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type MediaInfo } from "@allyhub/piece";
|
|
2
|
+
/** A media value. Used by the code the build generates for media imports. */
|
|
3
|
+
export declare function media(info: MediaInfo): MediaInfo;
|
|
4
|
+
/** Whether a value is a media value (an import, or ctx.asset's). */
|
|
5
|
+
export declare function isMedia(v: unknown): v is MediaInfo;
|
|
6
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{asUrlString as o}from"@allyhub/piece";import{MEDIA_BRAND as t}from"@allyhub/piece";export function media(r){return o({[t]:!0,...r})}export function isMedia(r){return typeof r=="object"&&r!==null&&t in r}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type GraphicLayer, type MediaInfo, type PictureFit, type PicturePoint } from "@allyhub/piece";
|
|
2
|
+
import { type LayerMask } from "@allyhub/piece";
|
|
3
|
+
import { type LayerOptions } from "./define.js";
|
|
4
|
+
import type { Written } from "./written.js";
|
|
5
|
+
/** A still named by its project path, or as imported. */
|
|
6
|
+
type MediaRef = string | MediaInfo;
|
|
7
|
+
/** A box in shares: x, y, width, height. */
|
|
8
|
+
type Rect = [x: number, y: number, w: number, h: number];
|
|
9
|
+
/** A still's mask: "ellipse" (the ellipse in its box), a picture whose alpha masks it, or a CSS `mask-image` (a gradient); or a mask's object, laid over its box. */
|
|
10
|
+
export type PictureMask = LayerMask;
|
|
11
|
+
export interface PictureOptions extends LayerOptions {
|
|
12
|
+
/** The still: an import, or a path from the module that wrote picture(). PNG, JPEG, WebP, AVIF, GIF or SVG. */
|
|
13
|
+
src: MediaRef;
|
|
14
|
+
/** Where it shows, [x, y, w, h] as fractions of the layer's frame; default all of it. */
|
|
15
|
+
box?: Rect;
|
|
16
|
+
/** How it fills its box, CSS's `object-fit`; default "cover". */
|
|
17
|
+
fit?: PictureFit;
|
|
18
|
+
/**
|
|
19
|
+
* The point of the picture at the same point of the box, as shares (CSS's
|
|
20
|
+
* `object-position` in percentages), default [0.5, 0.5].
|
|
21
|
+
*/
|
|
22
|
+
position?: PicturePoint;
|
|
23
|
+
/** The part of the source shown, [x, y, w, h] as fractions of it, fitted as the whole picture would be. */
|
|
24
|
+
crop?: Rect;
|
|
25
|
+
/** Laid over its box: "ellipse", a picture (an import, or a path with an image's extension) whose alpha masks it, any other CSS `mask-image` value ("linear-gradient(black 60%, transparent)"), or a mask's object (its density, feather, inversion, a path). */
|
|
26
|
+
mask?: PictureMask;
|
|
27
|
+
/** The box's corners: CSS's `border-radius`, a number of the frame's pixels or any CSS value ("50%"). */
|
|
28
|
+
radius?: number | string;
|
|
29
|
+
/** CSS's `filter`: "blur(4px) saturate(0.8)", lengths in the frame's pixels. */
|
|
30
|
+
filter?: string;
|
|
31
|
+
/** What it shows, for a screen reader. */
|
|
32
|
+
alt?: string;
|
|
33
|
+
}
|
|
34
|
+
/** A picture layer's props: its options, and the folder its paths are from. */
|
|
35
|
+
export interface PictureProps extends Omit<PictureOptions, keyof LayerOptions> {
|
|
36
|
+
/** Its mask, laid over its box (the layer's, kept here for its drawing). */
|
|
37
|
+
mask?: PictureMask;
|
|
38
|
+
/** Its blend as CSS names it, drawn on its box (the layer's blend mode when it has no effects). */
|
|
39
|
+
blendCss?: string;
|
|
40
|
+
/** The folder of the module that wrote it, a project path ("" the root). */
|
|
41
|
+
base: string;
|
|
42
|
+
/** A number `radius` is px at 1080p, scaled with the frame's shorter side: footage()'s, for a still. */
|
|
43
|
+
at1080?: true;
|
|
44
|
+
}
|
|
45
|
+
/** The layer's component name. */
|
|
46
|
+
export declare const PICTURE = "picture";
|
|
47
|
+
/** What is wrong with a picture's options, or undefined. */
|
|
48
|
+
export declare function pictureProblem(o: PictureOptions): string | undefined;
|
|
49
|
+
/** The picture layer: a graphic layer whose props are its options and its module's folder. */
|
|
50
|
+
export declare function pictureLayer(opts: PictureOptions, base: string, more?: {
|
|
51
|
+
at1080?: true;
|
|
52
|
+
caller?: string;
|
|
53
|
+
}): GraphicLayer<PictureProps>;
|
|
54
|
+
/** picture({ src, fit, position, … }): a still on the layer. */
|
|
55
|
+
export type PictureFn = (opts: PictureOptions) => GraphicLayer<PictureProps>;
|
|
56
|
+
/** picture() for the module `at` names: its paths are from its folder. */
|
|
57
|
+
export declare const pictureFor: (at: Written) => PictureFn;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=picture.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{LAYER_BRAND as R,MEDIA_BRAND as J,PICTURE_DEFAULTS as C,mediaKindOf as x,pathIn as F,placePicture as D}from"@allyhub/piece";import{applyMask as L,defsOf as v}from"@allyhub/image-draw/layer-style";import{BLEND_DRAWN as B}from"@allyhub/piece";import{splitLayer as G,styleOf as T}from"./define.js";export const PICTURE="picture";const k=["cover","contain","fill","none"],O=e=>typeof e=="object"&&e!==null&&(J in e||"sha256"in e),S=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,$=e=>{if(!Array.isArray(e)||e.length!==4||!e.every(S))return!1;const[t,i,s,n]=e;return t+s<=1+1e-9&&i+n<=1+1e-9&&s>0&&n>0},W=e=>e!=="ellipse"&&x(e)==="image"&&!e.includes("(");export function pictureProblem(e){const t=e.src;if(typeof t!="string"&&!O(t))return`src ${JSON.stringify(t)} is not a still: an import (import photo from "./photo.jpg") or a path from the module.`;const i=typeof t=="string"?t:t.path;if((typeof t=="string"?x(i):t.kind)!=="image")return`src ${i} is not a still (PNG, JPEG, WebP, AVIF, GIF or SVG); a video is footage().`;if(e.fit!==void 0&&!k.includes(e.fit))return`fit ${JSON.stringify(e.fit)} is not one of ${k.map(n=>`"${n}"`).join(", ")}.`;if(e.position!==void 0&&!(Array.isArray(e.position)&&e.position.length===2&&e.position.every(S)))return`position ${JSON.stringify(e.position)} is not [x, y] as shares of the picture (each from 0 to 1).`;if(e.box!==void 0&&!$(e.box))return`box ${JSON.stringify(e.box)} is not [x, y, w, h] as fractions of the frame, inside it.`;if(e.crop!==void 0&&!$(e.crop))return`crop ${JSON.stringify(e.crop)} is not [x, y, w, h] as fractions of the source, inside it.`;if(e.radius!==void 0&&!(typeof e.radius=="number"&&Number.isFinite(e.radius)&&e.radius>=0||typeof e.radius=="string"&&e.radius.trim()!==""))return`radius ${JSON.stringify(e.radius)} is not a number of pixels from 0 or a CSS border-radius.`;if(e.blend!==void 0)return`blend is blendMode, every layer's, by Photoshop's names ("multiply", "screen", "softLight"…)`;if(e.filter!==void 0&&typeof e.filter!="string")return`filter ${JSON.stringify(e.filter)} is not a CSS filter such as "blur(4px) saturate(0.8)".`}function N(e,t,i){if(typeof e!="string"){const n=i.asset(`/${e.path}`);return n.sha256===e.sha256?n:e}const s=F(t,e);return i.asset(s===void 0?e:`/${s}`)}const r=e=>`${String(Math.round(e*1e3)/1e3)}px`;function _(e,t,i){const s=N(t.src,t.base,i);if(!s)return;const n=i.dims.width,f=i.dims.height,[a,d,u,p]=t.box?[t.box[0]*n,t.box[1]*f,t.box[2]*n,t.box[3]*f]:[0,0,n,f],b=D({source:{width:s.width??1,height:s.height??1},box:{width:u,height:p},fit:t.fit,position:t.position??C.position,crop:t.crop}),o=document.createElement("div");o.dataset.akPicture=s.path,Object.assign(o.style,{position:"absolute",left:r(a),top:r(d),width:r(u),height:r(p),overflow:"hidden"}),t.radius!==void 0&&(o.style.borderRadius=typeof t.radius=="number"?r(t.radius*(t.at1080?Math.min(n,f)/1080:1)):t.radius),t.blendCss!==void 0&&(o.style.mixBlendMode=t.blendCss),t.filter!==void 0&&(o.style.filter=t.filter);const m=[],c=H(t.mask);if(c==="ellipse")o.style.clipPath="ellipse(50% 50%)";else if(c!==void 0){const h=typeof c=="string"&&!W(c)?void 0:N(c,t.base,i);m.push(h?`url("${h.url}")`:c)}else if(t.mask!==void 0){const h=L(o,{mask:t.mask,box:[0,0,u,p],frame:{width:u,height:p},defs:v(e),ctx:i,base:t.base});if(h!==void 0)throw new Error(`picture(): mask: ${h}.`)}const y=document.createElement("div"),[g,w,E,P]=b.shown;Object.assign(y.style,{position:"absolute",left:r(g),top:r(w),width:r(E),height:r(P),overflow:"hidden"});const l=document.createElement("img");l.alt=t.alt??"",l.decoding="sync",l.src=s.url;const[A,j,I,M]=b.whole;Object.assign(l.style,{position:"absolute",left:r(A-g),top:r(j-w),width:r(I),height:r(M),maxWidth:"none",maxHeight:"none"}),m.length>0&&Object.assign(o.style,{maskImage:m.join(", "),maskSize:"100% 100%",maskRepeat:"no-repeat"}),y.append(l),o.append(y),e.append(o)}const U=e=>e!==void 0&&Object.values(e).some(t=>t!==void 0&&t.enabled!==!1);function H(e){if(e===void 0)return;if(typeof e=="string"||O(e))return e;const t=e,i=Object.keys(t).filter(s=>t[s]!==void 0);return i.length===1&&i[0]==="src"?t.src:void 0}export function pictureLayer(e,t,i={}){const s=pictureProblem(e);if(s)throw new Error(`${i.caller??"picture()"}: ${s}`);T(e,"pixel",i.caller??"picture()");const[n,f]=G(e);return{[R]:"graphic",...n,kind:"pixel",component:PICTURE,props:{...f,...n.mask===void 0?{}:{mask:n.mask},...(()=>{const a=n.blendMode,d=a===void 0?void 0:B[a];return d&&"css"in d&&a!=="normal"&&!U(n.effects)?{blendCss:d.css}:{}})(),base:t,...i.at1080?{at1080:!0}:{}},mount:(a,d,u)=>{_(a,d,u)},render:()=>{}}}export const pictureFor=e=>t=>pictureLayer(t,e.base);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MediaInfo, MediaKind,
|
|
1
|
+
import type { MediaInfo, MediaKind, PIECE_BRAND, Preset, WordRef } from "@allyhub/piece";
|
|
2
2
|
declare const TIME: unique symbol;
|
|
3
3
|
/**
|
|
4
4
|
* A prop that is a moment (declared time()): seconds from the part's start
|
|
@@ -70,8 +70,8 @@ export declare const text: <const O extends Opts<TextProp> = object>(o?: O) => T
|
|
|
70
70
|
*/
|
|
71
71
|
export declare const time: <const O extends Opts<TimeProp> = object>(o?: O) => TimeProp & O;
|
|
72
72
|
/**
|
|
73
|
-
* Media: an import or ctx.asset(path). In a deck's slides
|
|
74
|
-
* the deck's folder; with `kind: "video"` it may also be a video item of
|
|
73
|
+
* Media: an import or ctx.asset(path). In a deck's slides file, a path from
|
|
74
|
+
* the deck's module's folder; with `kind: "video"` it may also be a video item of
|
|
75
75
|
* the project (its folder), which a layout shows with footage().
|
|
76
76
|
*/
|
|
77
77
|
export declare const asset: <const O extends Opts<AssetProp> = object>(o?: O) => AssetProp & O;
|
|
@@ -86,7 +86,7 @@ export declare const object: <const F extends Record<string, PropSchema>, const
|
|
|
86
86
|
fields: F;
|
|
87
87
|
} & O;
|
|
88
88
|
/** A video a layout shows: a file's media, or a video item of the project. */
|
|
89
|
-
export type VideoValue = MediaInfo |
|
|
89
|
+
export type VideoValue = MediaInfo | Readonly<Record<typeof PIECE_BRAND, true>>;
|
|
90
90
|
/** The value a layout receives for a prop of this schema. */
|
|
91
91
|
export type PropValue<S> = S extends {
|
|
92
92
|
type: "text";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Fill, type GraphicLayer, type ShapeKind, type ShapeStroke } from "@allyhub/piece";
|
|
2
|
+
import { type LayerOptions } from "./define.js";
|
|
3
|
+
import type { Written } from "./written.js";
|
|
4
|
+
export interface ShapeOptions extends LayerOptions {
|
|
5
|
+
/** Photoshop's shape tools: rectangle, ellipse, triangle, polygon, line, or a path. */
|
|
6
|
+
shape: ShapeKind;
|
|
7
|
+
/** Where it lies, [x, y, w, h] as shares of the frame; default all of it. */
|
|
8
|
+
box?: readonly [number, number, number, number];
|
|
9
|
+
/** shape "path": SVG path data in the board's pixels. */
|
|
10
|
+
path?: string;
|
|
11
|
+
/** A rectangle's corners, px. */
|
|
12
|
+
radius?: number;
|
|
13
|
+
/** A polygon's sides, 3 to 100. */
|
|
14
|
+
sides?: number;
|
|
15
|
+
/** A polygon as a star: its inner points' distance, percent of its outer (100, a polygon). */
|
|
16
|
+
starRatio?: number;
|
|
17
|
+
/** Its fill: a colour, a gradient or a pattern; null for none. Default black. */
|
|
18
|
+
fill?: Fill | null;
|
|
19
|
+
/** Its stroke; null or left out for none (a line has one). */
|
|
20
|
+
stroke?: ShapeStroke | null;
|
|
21
|
+
}
|
|
22
|
+
/** A shape layer's props. */
|
|
23
|
+
export interface ShapeProps extends Omit<ShapeOptions, keyof LayerOptions> {
|
|
24
|
+
readonly base: string;
|
|
25
|
+
}
|
|
26
|
+
/** The component name of a shape layer. */
|
|
27
|
+
export declare const SHAPE = "shape";
|
|
28
|
+
/** What is wrong with a shape's options, or undefined. */
|
|
29
|
+
export declare function shapeProblem(o: ShapeOptions): string | undefined;
|
|
30
|
+
/** A shape layer: shape({ key, shape: "ellipse", box, fill: { gradient }, stroke: { color, width } }). */
|
|
31
|
+
export type ShapeFn = (opts: ShapeOptions) => GraphicLayer<ShapeProps>;
|
|
32
|
+
/** shape() for the module `at` names: its paths (a pattern's, a mask's) are from its folder. */
|
|
33
|
+
export declare const shapeFor: (at: Written) => ShapeFn;
|
|
34
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{FillSchema as u,LAYER_BRAND as d,SHAPE_KINDS as c,ShapeStrokeSchema as b,ShareBoxSchema as S,issueOf as x}from"@allyhub/piece";import{drawShape as k,gradientRefusal as $}from"@allyhub/image-draw/paint";import{z as r}from"zod";import{LayerError as m,splitLayer as g,styleOf as y}from"./define.js";import{paintRefusal as A}from"./fill.js";export const SHAPE="shape";const R=r.object({shape:r.enum(c),box:S.optional(),path:r.string().min(1).optional(),radius:r.number().min(0).max(1e5).optional(),sides:r.number().int().min(3).max(100).optional(),starRatio:r.number().min(1).max(100).optional(),fill:u.nullable().optional(),stroke:b.nullable().optional()});export function shapeProblem(s){const{shape:e,box:o,path:a,radius:t,sides:i,starRatio:p,fill:h,stroke:l}=s,n=R.safeParse({shape:e,box:o,path:a,radius:t,sides:i,starRatio:p,fill:h,stroke:l});if(!n.success)return x(n.error);if(e==="path"&&a===void 0)return`shape "path" takes a path: SVG path data in the board's pixels`;if(e!=="path"&&a!==void 0)return`a path is shape "path"'s, not ${e}'s`}export const shapeFor=s=>e=>{const o=`shape()${e.key===void 0?"":` ${e.key}`}`,a=shapeProblem(e);if(a)throw new m("AK-I003",`${o}: ${a}.`);const t=e.fill,i=t&&"gradient"in t?$(t.gradient,!0):A(t);if(i)throw new m("AK-I007",`${o}: ${i}.`);y(e,"shape","shape()");const[p,h]=g(e);return{[d]:"graphic",...p,kind:"shape",component:SHAPE,props:{...h,base:s.base},mount:(l,n,f)=>{k(l,n,f,n.base)},render:()=>{}}};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type GraphicLayer, type StageContext } from "@allyhub/piece";
|
|
2
|
+
/** Mounts a layer in its element with its style; the element its content is in (what it draws at each moment). */
|
|
3
|
+
export declare function mountLayer(el: HTMLElement, layer: GraphicLayer, ctx: StageContext): HTMLElement;
|
|
4
|
+
/** A layer of a stack, mounted: its element, and where its content is. */
|
|
5
|
+
export interface MountedLayer {
|
|
6
|
+
readonly layer: GraphicLayer;
|
|
7
|
+
readonly el: HTMLElement;
|
|
8
|
+
readonly content: HTMLElement;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Mounts layers back to front in a container, each in an element of its
|
|
12
|
+
* own marked with its name, those not visible left out, each clipped layer
|
|
13
|
+
* with its base.
|
|
14
|
+
*/
|
|
15
|
+
export declare function mountStack(container: HTMLElement, layers: readonly GraphicLayer[], ctx: StageContext): MountedLayer[];
|
|
16
|
+
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{LAYER_NAME as m}from"@allyhub/piece";import{baseOf as u,clipStack as c,contentOf as p,styleLayer as a}from"@allyhub/image-draw/layer-style";import{LayerError as f}from"./define.js";export function mountLayer(i,e,n){const o=p(i,e,n.dims);e.mount(o,e.props,n);const r=a(i,{layer:e,ctx:n,frame:n.dims,base:u(e)});if(r!==void 0)throw new f("AK-I007",`${e.component}${e.key===void 0?"":` ${e.key}`}: ${r}.`);return o}export function mountStack(i,e,n){const o=[];for(const s of e){if(s.visible===!1)continue;const t=i.ownerDocument.createElement("div");t.className="ak-layer",t.dataset.component=s.component,s.key!==void 0&&t.setAttribute(m,s.key),Object.assign(t.style,{position:"absolute",inset:"0"}),i.append(t),o.push({layer:s,el:t,content:mountLayer(t,s,n)})}const r=c(o,{frame:n.dims,ctx:n});if(r.length>0)throw new f("AK-I007",`${r.join("; ")}.`);return o}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CharacterStyle, type GraphicLayer, type ParagraphStyle } from "@allyhub/piece";
|
|
2
|
+
import { type LayerOptions } from "./define.js";
|
|
3
|
+
import type { Written } from "./written.js";
|
|
4
|
+
/** A type layer's text item: its words and how they are set. */
|
|
5
|
+
export interface TextItem {
|
|
6
|
+
/** Its words: the script's (`ctx.s("key")`); a line break starts a paragraph. */
|
|
7
|
+
contents: string;
|
|
8
|
+
characterStyle?: CharacterStyle;
|
|
9
|
+
paragraphStyle?: ParagraphStyle;
|
|
10
|
+
}
|
|
11
|
+
export interface TextLayerOptions extends LayerOptions {
|
|
12
|
+
textItem: TextItem;
|
|
13
|
+
/** Paragraph text: its box, [x, y, w, h] as shares of the frame; its words wrap in it. */
|
|
14
|
+
box?: readonly [number, number, number, number];
|
|
15
|
+
/** Point text: where it starts, [x, y] as shares of the frame (by its justification: its left, its centre or its right; the top of its first line). Default [0, 0]. */
|
|
16
|
+
position?: readonly [number, number];
|
|
17
|
+
}
|
|
18
|
+
/** A type layer's props. */
|
|
19
|
+
export interface TextLayerProps {
|
|
20
|
+
readonly textItem: TextItem;
|
|
21
|
+
readonly box?: readonly [number, number, number, number];
|
|
22
|
+
readonly position?: readonly [number, number];
|
|
23
|
+
readonly base: string;
|
|
24
|
+
}
|
|
25
|
+
/** The component name of a type layer. */
|
|
26
|
+
export declare const TEXT_LAYER = "textLayer";
|
|
27
|
+
/** What is wrong with a type layer's options, or undefined. */
|
|
28
|
+
export declare function textLayerProblem(o: TextLayerOptions): string | undefined;
|
|
29
|
+
/** The CSS of a text item's justification: text-align and the last line's. */
|
|
30
|
+
export declare function justified(j: ParagraphStyle["justification"]): {
|
|
31
|
+
textAlign: string;
|
|
32
|
+
textAlignLast: string;
|
|
33
|
+
};
|
|
34
|
+
/** A type layer: textLayer({ key, textItem: { contents: ctx.s("title"), characterStyle: { size: 96 } }, box }). */
|
|
35
|
+
export type TextLayerFn = (opts: TextLayerOptions) => GraphicLayer<TextLayerProps>;
|
|
36
|
+
/** textLayer() for the module `at` names: its paths (a mask's, a pattern's) are from its folder. */
|
|
37
|
+
export declare const textLayerFor: (at: Written) => TextLayerFn;
|
|
38
|
+
//# sourceMappingURL=text-layer.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{CharacterStyleSchema as m,LAYER_BRAND as A,ParagraphStyleSchema as b,ShareBoxSchema as S,TEXT_DEFAULTS as f,issueOf as L}from"@allyhub/piece";import{z as h}from"zod";import{LayerError as j,splitLayer as w,styleOf as I}from"./define.js";export const TEXT_LAYER="textLayer";const T=h.object({contents:h.string(),characterStyle:m.optional(),paragraphStyle:b.optional()});export function textLayerProblem(t){const n=T.safeParse(t.textItem);if(!n.success)return L(n.error,"textItem");if(t.box!==void 0&&!S.safeParse(t.box).success)return`box ${JSON.stringify(t.box)} is not [x, y, w, h] as shares of the frame, inside it`;if(t.box!==void 0&&t.position!==void 0)return"give a box (paragraph text) or a position (point text), not both";if(t.position!==void 0&&!(Array.isArray(t.position)&&t.position.length===2&&t.position.every(a=>typeof a=="number"&&a>=0&&a<=1)))return`position ${JSON.stringify(t.position)} is not [x, y] as shares of the frame`}const i=t=>`${String(Math.round(t*1e3)/1e3)}px`;export function justified(t){switch(t??f.justification){case"center":return{textAlign:"center",textAlignLast:"auto"};case"right":return{textAlign:"right",textAlignLast:"auto"};case"justifyLeft":return{textAlign:"justify",textAlignLast:"left"};case"justifyCenter":return{textAlign:"justify",textAlignLast:"center"};case"justifyRight":return{textAlign:"justify",textAlignLast:"right"};case"justifyAll":return{textAlign:"justify",textAlignLast:"justify"};default:return{textAlign:"left",textAlignLast:"auto"}}}function k(t,n,a){const g=a.dims.width,u=a.dims.height,e=n.textItem.characterStyle??{},r=n.textItem.paragraphStyle??{},x=e.size??f.size,c=document.createElement("div");c.dataset.akText="";const p=justified(r.justification);if(Object.assign(c.style,{position:"absolute",margin:"0",fontFamily:e.font===void 0?"var(--ak-font-body)":JSON.stringify(e.font),fontWeight:String(e.weight??f.weight),fontStyle:e.italic===!0?"italic":"normal",fontSize:i(x),color:e.color??f.color,letterSpacing:`${String((e.tracking??f.tracking)/1e3)}em`,lineHeight:e.leading===void 0||e.leading==="auto"?String(f.autoLeading):i(e.leading),textTransform:e.capitalization==="allCaps"?"uppercase":"none",fontVariantCaps:e.capitalization==="smallCaps"?"small-caps":"normal",textDecorationLine:[e.underline===!0?"underline":"",e.strikeThrough===!0?"line-through":""].filter(o=>o!=="").join(" ")||"none",textAlign:p.textAlign,textAlignLast:p.textAlignLast,paddingLeft:i(r.leftIndent??0),paddingRight:i(r.rightIndent??0),boxSizing:"border-box"}),n.box){const[o,l,s,y]=n.box;Object.assign(c.style,{left:i(o*g),top:i(l*u),width:i(s*g),height:i(y*u),whiteSpace:"pre-wrap",overflowWrap:"break-word"})}else{const[o,l]=n.position??[0,0],s=p.textAlign==="center"?"-50%":p.textAlign==="right"?"-100%":"0";Object.assign(c.style,{left:i(o*g),top:i(l*u),whiteSpace:"pre",...s==="0"?{}:{transform:`translateX(${s})`}})}const d=n.textItem.contents.split(/\r\n|\r|\n/u);d.forEach((o,l)=>{const s=document.createElement("p");Object.assign(s.style,{margin:"0",textIndent:i(r.firstLineIndent??0),...l>0&&r.spaceBefore?{marginTop:i(r.spaceBefore)}:{},...l<d.length-1&&r.spaceAfter?{marginBottom:i(r.spaceAfter)}:{}}),s.textContent=o===""?"":o,c.append(s)}),t.append(c)}export const textLayerFor=t=>n=>{const a=textLayerProblem(n);if(a)throw new j("AK-I003",`textLayer()${n.key===void 0?"":` ${n.key}`}: ${a}.`);I(n,"type","textLayer()");const[g,u]=w(n);return{[A]:"graphic",...g,kind:"type",component:TEXT_LAYER,props:{...u,base:t.base},mount:(e,r,x)=>{k(e,r,x)},render:()=>{}}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{dirOf as
|
|
2
|
+
import{dirOf as e,projectPath as s}from"@allyhub/formats";export function writtenIn(r){const t=s(r.file);if(t.startsWith("/")||/^[A-Za-z]:/u.test(t)||t.split("/").includes(".."))throw new Error(`sdkFor: ${JSON.stringify(r.file)} is not a project path: a file's path from the project's root, such as "launch/teaser.ts".`);return{file:t,base:e(t)}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@allyhub/image-sdk",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"default": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./*": {
|
|
11
|
+
"types": "./dist/*.d.ts",
|
|
12
|
+
"default": "./dist/*.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"private": true,
|
|
18
|
+
"license": "SEE LICENSE IN LICENSE.md"
|
|
19
|
+
}
|