@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.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/NOTICE +85 -0
- package/client.d.ts +45 -1
- package/dist/anim.js +2 -75
- package/dist/define.d.ts +10 -4
- package/dist/define.js +2 -95
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +2 -457
- package/dist/fit.js +2 -60
- package/dist/free.d.ts +18 -0
- package/dist/free.js +2 -0
- package/dist/index.d.ts +28 -13
- package/dist/index.js +2 -11
- package/dist/input.d.ts +306 -0
- package/dist/input.js +2 -0
- package/dist/media.d.ts +3 -6
- package/dist/media.js +2 -27
- package/dist/messages.d.ts +3 -2
- package/dist/messages.js +2 -2
- package/dist/module.d.ts +24 -0
- package/dist/module.js +2 -0
- package/dist/noise.js +2 -233
- package/dist/parts.d.ts +97 -21
- package/dist/parts.js +2 -414
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +2 -720
- package/dist/phone.d.ts +26 -0
- package/dist/phone.js +2 -0
- package/dist/piece.d.ts +106 -35
- package/dist/piece.js +2 -38
- package/dist/props.d.ts +1 -1
- package/dist/props.js +2 -35
- package/dist/scenery.d.ts +2 -0
- package/dist/scenery.js +2 -0
- package/dist/text.js +2 -38
- package/dist/written.d.ts +12 -0
- package/dist/written.js +2 -0
- package/docs/README.md +18 -0
- package/docs/batches.md +148 -0
- package/docs/contract.md +51 -0
- package/docs/defaults.md +703 -0
- package/docs/docs.md +148 -0
- package/docs/footage.md +249 -0
- package/docs/layers.md +317 -0
- package/docs/modeling.md +143 -0
- package/docs/project.md +265 -0
- package/docs/scenery.md +308 -0
- package/docs/sheets.md +119 -0
- package/docs/slides.md +111 -0
- package/docs/sound.md +170 -0
- package/docs/speech.md +289 -0
- package/docs/video.md +265 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
- package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
- package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
- package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
- package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
- package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
- package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
- package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
- package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/audio/package.json +17 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
- package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
- package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
- package/node_modules/@allyhub-next/formats/package.json +14 -0
- package/node_modules/@allyhub-next/formats/schemas/comments.schema.json +152 -0
- package/node_modules/@allyhub-next/formats/schemas/config.schema.json +43 -0
- package/node_modules/@allyhub-next/formats/schemas/edits.schema.json +112 -0
- package/node_modules/@allyhub-next/formats/schemas/elements.schema.json +33 -0
- package/node_modules/@allyhub-next/formats/schemas/gen.schema.json +97 -0
- package/node_modules/@allyhub-next/formats/schemas/interpretation.schema.json +125 -0
- package/node_modules/@allyhub-next/formats/schemas/items.json +75 -0
- package/node_modules/@allyhub-next/formats/schemas/messages.schema.json +11 -0
- package/node_modules/@allyhub-next/formats/schemas/script.schema.json +162 -0
- package/node_modules/@allyhub-next/formats/schemas/sheet.schema.json +395 -0
- package/node_modules/@allyhub-next/formats/schemas/words.schema.json +63 -0
- package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
- package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +272 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
- package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
- package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
- package/node_modules/@allyhub-next/protocol/package.json +13 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
- package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
- package/node_modules/@allyhub-next/runtimes/package.json +14 -0
- package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
- package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
- package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
- package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
- package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
- package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
- package/node_modules/@allyhub-next/scenery/package.json +13 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
- package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
- package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
- package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
- package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
- package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
- package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
- package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
- package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
- package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
- package/node_modules/@allyhub-next/video-core/package.json +14 -0
- package/package.json +52 -41
- package/README.md +0 -17
- package/dist/anim.d.ts.map +0 -1
- package/dist/anim.js.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/define.js.map +0 -1
- package/dist/dom.d.ts.map +0 -1
- package/dist/dom.js.map +0 -1
- package/dist/fit.d.ts.map +0 -1
- package/dist/fit.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/media.d.ts.map +0 -1
- package/dist/media.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/noise.d.ts.map +0 -1
- package/dist/noise.js.map +0 -1
- package/dist/parts.d.ts.map +0 -1
- package/dist/parts.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/piece.d.ts.map +0 -1
- package/dist/piece.js.map +0 -1
- package/dist/props.d.ts.map +0 -1
- package/dist/props.js.map +0 -1
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js.map +0 -1
- /package/{LICENSE → LICENSE.md} +0 -0
package/docs/layers.md
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# Layers
|
|
2
|
+
|
|
3
|
+
A graphic layer is DOM a piece draws, made by a component (`defineComponent()`) or written in place (`custom()`). Here: both, the layer's `ctx`, the helpers of `@allyhub/sdk/dom` and `@allyhub/sdk`, and the starter components. A layer's timing (`at`, `until`, `dur`) and stacking (`z`) are in [video.md](video.md#layers); footage layers in [footage.md](footage.md).
|
|
4
|
+
|
|
5
|
+
## `custom()`
|
|
6
|
+
|
|
7
|
+
A graphic layer written in the piece, for what no component does. `custom({ mount?, render, at?, until?, dur?, z? })`:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { custom, ease, part, tween } from "@allyhub/sdk";
|
|
11
|
+
import { h, layout, one, tag } from "@allyhub/sdk/dom";
|
|
12
|
+
|
|
13
|
+
export const year = part({
|
|
14
|
+
key: "year",
|
|
15
|
+
dur: 3,
|
|
16
|
+
layers: [
|
|
17
|
+
custom({
|
|
18
|
+
at: 0.5,
|
|
19
|
+
mount(el, ctx) {
|
|
20
|
+
const L = layout(ctx);
|
|
21
|
+
const label = tag(
|
|
22
|
+
h("div", { fontSize: 240 * L.k, fontWeight: 900 }),
|
|
23
|
+
"year",
|
|
24
|
+
);
|
|
25
|
+
label.textContent = "2026";
|
|
26
|
+
el.append(
|
|
27
|
+
h(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
position: "absolute",
|
|
31
|
+
inset: 0,
|
|
32
|
+
display: "grid",
|
|
33
|
+
placeItems: "center",
|
|
34
|
+
},
|
|
35
|
+
[label],
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
render(el, t, ctx) {
|
|
40
|
+
const label = one(el, "year");
|
|
41
|
+
if (!label) return;
|
|
42
|
+
const x = tween(t, {
|
|
43
|
+
start: ctx.layer.start,
|
|
44
|
+
dur: 0.4,
|
|
45
|
+
ease: ease.outExpo,
|
|
46
|
+
});
|
|
47
|
+
label.style.opacity = String(x);
|
|
48
|
+
label.style.transform = `scale(${String(1.4 - 0.4 * x)})`;
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## `defineComponent()`
|
|
56
|
+
|
|
57
|
+
A component is a function that makes a graphic layer from its props and the layer's options, in one object.
|
|
58
|
+
|
|
59
|
+
```ts file=components/badge.ts
|
|
60
|
+
import { defineComponent, text, time, type Time } from "@allyhub/sdk";
|
|
61
|
+
import { h, layout, one, tag } from "@allyhub/sdk/dom";
|
|
62
|
+
|
|
63
|
+
export const badge = defineComponent<{
|
|
64
|
+
value: string;
|
|
65
|
+
label: string;
|
|
66
|
+
settle?: Time;
|
|
67
|
+
}>({
|
|
68
|
+
name: "badge",
|
|
69
|
+
label: { en: "Badge" },
|
|
70
|
+
summary: "A number with a label under it.",
|
|
71
|
+
props: {
|
|
72
|
+
value: text({ max: 6 }),
|
|
73
|
+
label: text({ max: { "16x9": 40, "9x16": 24 } }),
|
|
74
|
+
settle: time({ optional: true }),
|
|
75
|
+
},
|
|
76
|
+
defaults: { label: "" },
|
|
77
|
+
examples: { pilots: { value: "3", label: "pilot teams" } },
|
|
78
|
+
mount(el, p, ctx) {
|
|
79
|
+
const L = layout(ctx);
|
|
80
|
+
const value = tag(
|
|
81
|
+
h("div", { fontSize: 160 * L.k, color: "var(--ak-color-accent)" }),
|
|
82
|
+
"value",
|
|
83
|
+
);
|
|
84
|
+
value.textContent = p.value;
|
|
85
|
+
const label = h("div", {
|
|
86
|
+
fontSize: 48 * L.k,
|
|
87
|
+
fontFamily: "var(--ak-font-body)",
|
|
88
|
+
});
|
|
89
|
+
label.textContent = p.label;
|
|
90
|
+
el.append(
|
|
91
|
+
h("div", { position: "absolute", left: L.left, top: L.top }, [
|
|
92
|
+
value,
|
|
93
|
+
label,
|
|
94
|
+
]),
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
render(el, t, p, ctx) {
|
|
98
|
+
const value = one(el, "value");
|
|
99
|
+
if (!value) return;
|
|
100
|
+
value.style.opacity = t < (p.settle ?? ctx.layer.start) ? "0.4" : "1";
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```ts file=launch/film/parts.ts
|
|
106
|
+
import { part } from "@allyhub/sdk";
|
|
107
|
+
import { badge } from "../../components/badge.ts";
|
|
108
|
+
|
|
109
|
+
// Its props and the layer's options in one object; settle is given as a reference to the part's anchor.
|
|
110
|
+
export const teams = part({
|
|
111
|
+
key: "teams",
|
|
112
|
+
dur: 3,
|
|
113
|
+
anchors: { live: 1.2 },
|
|
114
|
+
layers: [
|
|
115
|
+
badge({ value: "3", label: "pilot teams", settle: "@live", at: 0.5 }),
|
|
116
|
+
],
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
| Field | What it is |
|
|
121
|
+
| --- | --- |
|
|
122
|
+
| `name` | The component's name, unique in the project |
|
|
123
|
+
| `label`, `summary` | Its name (default `name`) and one line on what it is for: a string, or by language |
|
|
124
|
+
| `props` | The props' semantic types, plain data (below) |
|
|
125
|
+
| `defaults` | Default prop values |
|
|
126
|
+
| `examples` | Named example props |
|
|
127
|
+
| `hidden` | Hides a deprecated component |
|
|
128
|
+
| `mount(el, props, ctx)` | Lays the layer out once: builds its elements, may measure text |
|
|
129
|
+
| `render(el, t, props, ctx)` | Sets everything that moves from `t` alone |
|
|
130
|
+
|
|
131
|
+
`at`, `until`, `dur` and `z` are the layer's options (`LAYER_OPTIONS`): a prop cannot have those names (`defineComponent` throws). A layer's length and still belong to its part.
|
|
132
|
+
|
|
133
|
+
**Prop types** (from `@allyhub/sdk`, plain data; each takes `label`, `examples` and `optional`):
|
|
134
|
+
|
|
135
|
+
| Function | What it is | Its limits |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| `text(o?)` | Text on screen | `max` (one number, or per preset format), `min`, `multiline` |
|
|
138
|
+
| `time(o?)` | A moment ([below](#time-props)) | |
|
|
139
|
+
| `asset(o?)` | Media: an import or `ctx.asset(path)` | `kind` |
|
|
140
|
+
| `color(o?)` | A look variable, such as `var(--ak-color-accent)` | |
|
|
141
|
+
| `number(o?)` | A number | `min`, `max`, `step` |
|
|
142
|
+
| `boolean(o?)` | A switch | |
|
|
143
|
+
| `list(of, o?)` | A list | `min`, `max` |
|
|
144
|
+
| `object(fields, o?)` | An object | |
|
|
145
|
+
|
|
146
|
+
### Time props
|
|
147
|
+
|
|
148
|
+
A prop declared `time()` (also inside `list()` and `object()`) is typed `Time` in the component. Where the layer is made it takes a word reference or seconds (`"live"`, `"@press+0.2"`, `1.2`: [speech.md](speech.md)); by the time `mount` runs it is seconds from the part's start. Only `time()` props take word references.
|
|
149
|
+
|
|
150
|
+
### `mount` and `render`
|
|
151
|
+
|
|
152
|
+
- `mount` runs once for each element a layer is drawn into, before any `render` of it: once per part that lists it, and again for a cover. Keep what `render` needs on the element (find it again with `one`, or a `WeakMap` keyed by `el`), not in a variable the elements share. The fonts the look and the text need have loaded by then, so it may measure.
|
|
153
|
+
- `render(el, t, …)` gets `t`, seconds from the part's start, and runs only between the layer's `at` and `until`: an entrance counts from `ctx.layer.start`. It sets every moving property from `t` alone, never from the frame before: the same moment draws the same frame in any order (AK-D002). What a layer may and may not do to stay deterministic is in [contract.md](contract.md).
|
|
154
|
+
- A style value the browser does not accept (`fontWeight: "900px"`, `width: "760"`) is dropped by the browser; while checking, every inline style set is watched and such a value is AK-R004.
|
|
155
|
+
- Text inside an element marked `data-ak-picture` is part of a picture (a mocked interface the frame crops on purpose): the frame's text checks leave it out.
|
|
156
|
+
|
|
157
|
+
### What the contract relies on
|
|
158
|
+
|
|
159
|
+
- **The look by its variables**: colours and fonts as `var(--ak-color-*)` and `var(--ak-font-*)` ([video.md](video.md#the-look)) follow the project's look; a literal colour does not. A `color()` prop holds a look variable.
|
|
160
|
+
- **Text as text**: the helpers set text as text nodes (`textContent`), so a string never becomes markup.
|
|
161
|
+
- **Every format**: lay out from `ctx.dims`, `ctx.content` or `layout(ctx)`, not by the format's name: a custom `WxH` has no preset's name, and a changed `safe` keeps the format's.
|
|
162
|
+
|
|
163
|
+
## The layer's `ctx`
|
|
164
|
+
|
|
165
|
+
`mount` and `render` get a `StageContext`:
|
|
166
|
+
|
|
167
|
+
| Name | What it is |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| `ctx.look` | The look (also the CSS variables `--ak-color-*`, `--ak-font-*`, `--ak-motion-beat`) |
|
|
170
|
+
| `ctx.format` | The format's name: `"9x16"`, `"1280x720"`; a deck's may be `"a4"` |
|
|
171
|
+
| `ctx.dims` | `{ width, height, orient, safe, profile? }` ([video.md](video.md#formats)) |
|
|
172
|
+
| `ctx.combo` | The combo. A layer may read the dimensions and its own part's slot, never another slot's pick (AK-X005): a part is rendered once for every combo that has it |
|
|
173
|
+
| `ctx.dur` | The part's length, seconds |
|
|
174
|
+
| `ctx.layer` | `{ start, end }`: this layer's window, seconds from the part's start |
|
|
175
|
+
| `ctx.asset(path)` | Media at a path relative to the piece's file |
|
|
176
|
+
| `ctx.optionalAsset?.(path)` | Media that may not be there (a scenery's bake): `undefined` when it is not, with no problem; the part is drawn again once it is made |
|
|
177
|
+
| `ctx.words()` | The part's words on its own clock, `[{ text, start, end }]`; empty without speech |
|
|
178
|
+
| `ctx.at(ref)` | Seconds from the part's start of a word reference or an anchor |
|
|
179
|
+
| `ctx.captions(opts?)` | The caption cues shown in this part, each with its words ([speech.md](speech.md)) |
|
|
180
|
+
| `ctx.face(t, id?)`, `ctx.faces(t)` | Faces on the frame at `t` ([footage.md](footage.md)) |
|
|
181
|
+
| `ctx.texts(t)` | The text of the layers listed before this one at `t`: `[{ layer, text, box }]`. It draws them to measure, so call it in `mount` |
|
|
182
|
+
| `ctx.covered` | The format's covered areas, `[x, y, w, h]` each in the frame's pixels; none for a custom format |
|
|
183
|
+
| `ctx.content` | The content box, `[x, y, w, h]` ([below](#the-content-box)) |
|
|
184
|
+
| `ctx.wait(promise)` | Work that must finish before anything is drawn (a scenery's build). A rejection is reported with the layer, under its `code` if it carries a rule's, else AK-R001; work that does not settle within `seekLimit` is AK-P003 |
|
|
185
|
+
| `ctx.report?.({ code, message, level? })` | Reports what went wrong drawing this layer, at any moment; a code that is not a rule's is AK-R001 |
|
|
186
|
+
| `ctx.film?` | The video on its clock: `start` (the part's start, film seconds), `part` (its key), `at(ref)` (film seconds of an anchor of any part, or a part's key), `outer` (where an outer video shows this one). Reading it makes the part's place in the film part of its identity |
|
|
187
|
+
| `ctx.video?.(piece, el)` | Another video item drawn in an element of this layer's ([below](#a-video-inside-a-layer)) |
|
|
188
|
+
| `ctx.embedded` | True in a video drawn inside another |
|
|
189
|
+
| `ctx.layoutOnly` | True while a moment is drawn only to measure its layout: nothing reads its pixels. A layer that paints a canvas no layout depends on may skip painting then; it still places its elements |
|
|
190
|
+
| `ctx.realTimers?` | The page's own clock and timers (`now`, `setTimeout`, `clearTimeout`), for work that waits on the wall clock (a loader, a worker), never for what a frame shows |
|
|
191
|
+
|
|
192
|
+
### The content box
|
|
193
|
+
|
|
194
|
+
`layout(ctx, opts?)` gives `{ W, H, k, orient, pad, top, bottom, left, right }`; `ctx.content` is the same box as `[x, y, w, h]`. In pixels:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
k = min(W, H) / 1080 the type scale: 1 in every preset and profile
|
|
198
|
+
margin = 120 × k (landscape), 84 × k (portrait, square)
|
|
199
|
+
pad = max(margin, safe.left, safe.right)
|
|
200
|
+
top = max(pad, safe.top + 30 × k)
|
|
201
|
+
bottom = H − max(pad, safe.bottom + 20 × k)
|
|
202
|
+
left = pad, right = W − pad
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
`right` and `bottom` are coordinates, not widths. `layout(ctx, { margin, topGap, bottomGap })` changes the margin and the gaps.
|
|
206
|
+
|
|
207
|
+
### A video inside a layer
|
|
208
|
+
|
|
209
|
+
`await ctx.video(piece, el)` draws another video item of the project (the piece this module imported) inside `el`, in its own format and, where it has it, this video's language. It gives `{ id, duration, width, height, seek(t), at(ref) }`: `seek(t)` draws its moment `t`, `at(ref)` finds its own anchor or part's key in its seconds. It draws its graphic layers over its background; what it reads counts as this video's. A chain of videos that reaches itself is AK-M010. Put it behind `ctx.wait`. More in [footage.md](footage.md).
|
|
210
|
+
|
|
211
|
+
## `@allyhub/sdk/dom`
|
|
212
|
+
|
|
213
|
+
| Helper | What it does |
|
|
214
|
+
| --- | --- |
|
|
215
|
+
| `h(tag, style?, children?, cls?)` | An element with styles and children; a string child is a text node |
|
|
216
|
+
| `css(el, style)` | Sets styles: camelCase or `--custom` names; a number gets `px`, except `opacity`, `zIndex`, `fontWeight`, `lineHeight`, `flex`, `flexGrow`, `flexShrink` |
|
|
217
|
+
| `layout(ctx, opts?)`, `contentBox(L, style?)` | The content box ([above](#the-content-box)); an absolutely placed flex column over it |
|
|
218
|
+
| `tag(el, name)`, `one(el, name)`, `all(el, name)` | Names an element (`data-ak`); finds the first, or every one, again. The measurements (`allyhub inspect`) name what they follow by it |
|
|
219
|
+
| `text(v)`, `list(v)` | A prop as a string; as a list of strings |
|
|
220
|
+
| `textBlock(value, { size, weight?, color?, font?, lineHeight?, align? })` | A `div` of balanced, wrapping text, Chinese broken only between words. Defaults 700, `var(--ak-color-fg)`, `var(--ak-font-display)`, 1.15, `"left"` |
|
|
221
|
+
| `wordBreaks(value)` | Chinese text with zero-width spaces between its words, for `word-break: keep-all` |
|
|
222
|
+
| `marked(line, styles?)` | A `span` of a line with its marks drawn (`**strong**`, `*em*`, `~~struck~~`, `` `code` ``): each marked run a span with `data-mark` and the style of its kinds, `styles` over `MARK_STYLES` (`strong` 700, `em` the accent colour, `strike` a line through, `code` the mono font at 0.9 em) |
|
|
223
|
+
| `fitTo(el, { min, max, maxHeight })` | The largest font size at which `el` fits its width and `maxHeight`; sets it |
|
|
224
|
+
| `fitLines(el \| text, { lines, min, max, width?, height?, precision? })` | `{ size, fits, lines }`: the largest size at which the text takes at most `lines` lines of the box (a text also takes `style`, and needs `width`). Also from `@allyhub/sdk` |
|
|
225
|
+
| `textLines(el)` | Each line of `el`'s text as the browser broke it. Also from `@allyhub/sdk` |
|
|
226
|
+
| `freeAreas(ctx, t, opts?)` | The bands of the content box at `t` clear of faces, other layers' text and covered areas, tallest first. Call it in `mount` |
|
|
227
|
+
| `captionTop(ctx, L, cue, w, h, opts?)` | A top for a block `w × h` over one cue: the first spot of `prefer` (default bottom, top, middle) clear of faces and other text. Call it in `mount` |
|
|
228
|
+
| `emphasized(words, list)`, `wordEmoji(words, map)` | Per word of a caption cue: whether `list` names it; the emoji `map` gives it |
|
|
229
|
+
| `emojiEl(value, style?)` | A span for an emoji in `var(--ak-font-emoji)` |
|
|
230
|
+
| `lightDark(el)` | The look's background and text colours as `{ light, dark }`. Call it in `mount` |
|
|
231
|
+
|
|
232
|
+
Nothing places, stresses or decorates on its own: these are measurements and builders a layer calls.
|
|
233
|
+
|
|
234
|
+
## Animation, text, paths and noise
|
|
235
|
+
|
|
236
|
+
From `@allyhub/sdk`; pure functions.
|
|
237
|
+
|
|
238
|
+
| Function | What it does |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| `tween(t, { from?, to?, start?, dur?, ease? })` | The value at `t`; defaults 0, 1, 0, 0.5, `ease.out` |
|
|
241
|
+
| `progress(t, start, dur)`, `lerp(a, b, x)`, `clamp(x, lo?, hi?)` | 0 → 1 over a span, clamped; interpolation; clamping (default 0 to 1) |
|
|
242
|
+
| `ease.linear`, `in`, `out`, `inOut`, `outExpo`, `outBack`, `spring(damping?, frequency?)` | Curves 0 → 1 (cubic `in`, `out`, `inOut`; `spring` defaults 7, 3.2). Any `(x) => number` is an `Ease` |
|
|
243
|
+
| `stagger(i, gap)` | `i × gap` |
|
|
244
|
+
| `rand(seed)` | A seeded random number generator: the same seed, the same numbers |
|
|
245
|
+
| `fitText(el, { min, max })` | The largest font size at which `el`'s text fits its own box; sets it |
|
|
246
|
+
| `splitText(text, by?)` | `"words"` (default), `"chars"`, or a separator |
|
|
247
|
+
| `countText(value, x, from?)` | `"$1,200.5M"` counting: its number `x` (0 → 1) of the way from `from`, keeping what is round it, its decimals and separators |
|
|
248
|
+
| `readMarks(line)`, `markRuns(text, marks)`, `withoutMarks(line)` | A line's marks read into its text and `InlineMark`s; as runs; the line without them |
|
|
249
|
+
| `pathLength(d)`, `pointAtLength(d, l)`, `tangentAtLength(d, l)` | An SVG path measured without the browser |
|
|
250
|
+
| `drawOn(d, progress)` | `{ strokeDasharray, strokeDashoffset }` showing the first `progress` of a stroke |
|
|
251
|
+
| `trimPath(d, from, to)`, `interpolatePath(a, b, x)`, `normalizePath(d)` | A stretch of a path (fractions of its length); the path between two with the same commands (it throws otherwise); absolute commands |
|
|
252
|
+
| `noise2D(seed, x, y)`, `noise3D(seed, x, y, z)`, `noise4D(seed, x, y, z, w)` | Seeded simplex noise in [−1, 1], changing over about one unit |
|
|
253
|
+
|
|
254
|
+
## A person's input
|
|
255
|
+
|
|
256
|
+
A cursor, a fingertip, a scrolled list or a field typed into, as functions of time: aimed movements that settle, land a little off their target and tremble, each drawn differently by `seed` and `index`. They place nothing: the piece says where and when, and draws what they return. Defaults: `INPUT_DEFAULTS` ([defaults.md](defaults.md)).
|
|
257
|
+
|
|
258
|
+
| Function | Returns |
|
|
259
|
+
| --- | --- |
|
|
260
|
+
| `pointer({ from, steps: [{ at, to, size?, press?, duration?, dwell?, hold? }], dwell?, hold?, …reach })` | `{ at(t) → { x, y, down }, moves, presses }` |
|
|
261
|
+
| `reach(from, to, { end, duration?, size?, index? }, reach?)` | One movement: `{ start, end, from, to, at(t), progress(u), bow }` |
|
|
262
|
+
| `tap({ at, to, hold?, slide?, grow?, size?, scatter?, seed?, index? })` | `{ down, up, at(t) → { x, y, down, contact } }` |
|
|
263
|
+
| `drag({ from, to, at, duration?, size?, settle?, release?, index?, …reach })` | `{ down, start, end, up, to, at(t) → { x, y, down } }` |
|
|
264
|
+
| `scroll({ at, by, kind?, limit?, wheel?, flick?, seed?, index? })` | `{ start, end, at(t) → px }`: `"flick"` (default) with momentum, or `"wheel"` notches |
|
|
265
|
+
| `typing(text, { at, cps?, spread?, word?, mark?, think?, mistakes?, notice?, backspace?, seed? })` | `{ keys, times, end, text(t) }`; `mistakes: [{ at, typed }]` types one and corrects it (none unless asked) |
|
|
266
|
+
| `fittsTime(distance, size, fitts?)` | `a + b · log2(1 + distance / size)` seconds |
|
|
267
|
+
| `aimed({ overshoot?, peak?, primary?, vary?, seed?, index? })` | An aimed movement's progress as an ease, 0 → 1 |
|
|
268
|
+
|
|
269
|
+
The reach options are `overshoot`, `peak`, `vary`, `fitts: { a, b }`, `scatter`, `jitter`, `bow`, `tremor: { px, frequency }` and `seed`.
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
import { custom, pointer } from "@allyhub/sdk";
|
|
273
|
+
import { h, one, tag } from "@allyhub/sdk/dom";
|
|
274
|
+
|
|
275
|
+
const hand = pointer({
|
|
276
|
+
from: [200, 900],
|
|
277
|
+
steps: [
|
|
278
|
+
{ at: 1, to: [960, 540], size: 120, press: true },
|
|
279
|
+
{ at: 2.4, to: [1400, 300] },
|
|
280
|
+
],
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
export const cursor = custom({
|
|
284
|
+
mount(el) {
|
|
285
|
+
el.append(
|
|
286
|
+
tag(
|
|
287
|
+
h("div", {
|
|
288
|
+
position: "absolute",
|
|
289
|
+
width: 24,
|
|
290
|
+
height: 24,
|
|
291
|
+
borderRadius: 12,
|
|
292
|
+
background: "var(--ak-color-fg)",
|
|
293
|
+
}),
|
|
294
|
+
"cursor",
|
|
295
|
+
),
|
|
296
|
+
);
|
|
297
|
+
},
|
|
298
|
+
render(el, t) {
|
|
299
|
+
const dot = one(el, "cursor");
|
|
300
|
+
if (!dot) return;
|
|
301
|
+
const p = hand.at(t);
|
|
302
|
+
dot.style.transform = `translate(${String(p.x - 12)}px, ${String(p.y - 12)}px) scale(${p.down ? "0.8" : "1"})`;
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Starter components
|
|
308
|
+
|
|
309
|
+
The SDK has no components of its own. `allyhub add <name>` (`caption-line` or `captionLine`) copies a starter component's source into the project's `components/`, where it is the project's code; `allyhub add` alone lists them. Each documents its props in its source, every value a prop with a default (its `*_DEFAULTS` constant where it has one): read it after adding. Import it by a relative path. Only mechanisms are provided, never a layout: a title, a list or an end card is the piece's own `custom()` or component.
|
|
310
|
+
|
|
311
|
+
| Component | What it does |
|
|
312
|
+
| --- | --- |
|
|
313
|
+
| `screenDemo` (and `uiDemo`, same file) | A demo on a screenshot with its elements file (`allyhub frames web`), or on an interface drawn in code: a camera in on what is acted on, a cursor that travels and clicks, typing, presses |
|
|
314
|
+
| `codePanel` | Code, data or a terminal in a panel: coloured, typed or revealed, lines and spans highlighted in time |
|
|
315
|
+
| `callout` | Marks places (a box, or another layer's element, followed), labels them, draws lines between them |
|
|
316
|
+
| `chart` | Bars, horizontal bars, a line or a ring, with its scale, labels fitted and the draw-on |
|
|
317
|
+
| `captionWord`, `captionLine`, `captionSubtitle` | Captions from `ctx.captions()`: a word at a time; a line with the word being said marked; a quiet subtitle |
|
package/docs/modeling.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Modeling props
|
|
2
|
+
|
|
3
|
+
A prop no library has is modelled in code with `@allyhub-next/model`: a subset of Blender 4.5's data API (`bpy.data`, `bmesh`, modifiers, materials, curves, UVs) in TypeScript, evaluated without Blender, the same in `allyhub model` and in a scenery's page. This file covers a model module, how it is built and measured, and how a scenery shows it. What the subset holds, every option and each deliberate difference from Blender, is `allyhub model capabilities` (JSON; also `capabilities` from `@allyhub-next/model`): a call outside it fails and names what is missing.
|
|
4
|
+
|
|
5
|
+
## A model module
|
|
6
|
+
|
|
7
|
+
A model module's default export is `defineModel(build)`. It is code, not an item: keep it in the folder of the scenery that uses it, or in `components/` when several do. `@allyhub-next/model` is lent by the CLI, with no `package.json` entry.
|
|
8
|
+
|
|
9
|
+
```ts file=room/stick.ts
|
|
10
|
+
import { defineModel } from "@allyhub-next/model";
|
|
11
|
+
|
|
12
|
+
export default defineModel((bpy, parameters) => {
|
|
13
|
+
const length = Number(parameters["length"] ?? 0.3);
|
|
14
|
+
const mesh = bpy.data.meshes.new("Stick");
|
|
15
|
+
mesh.from_pydata(
|
|
16
|
+
[
|
|
17
|
+
[0, 0, 0],
|
|
18
|
+
[0, 0.004, 0],
|
|
19
|
+
[-length, 0.004, 0],
|
|
20
|
+
[-length, 0, 0],
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
[0, 1],
|
|
24
|
+
[1, 2],
|
|
25
|
+
[2, 3],
|
|
26
|
+
],
|
|
27
|
+
[],
|
|
28
|
+
);
|
|
29
|
+
const stick = bpy.data.objects.new("Stick", mesh);
|
|
30
|
+
bpy.context.collection.objects.link(stick);
|
|
31
|
+
const lathe = stick.modifiers.new("Lathe", "SCREW");
|
|
32
|
+
lathe.axis = "X";
|
|
33
|
+
lathe.use_merge_vertices = true;
|
|
34
|
+
lathe.merge_threshold = 1e-6;
|
|
35
|
+
const brass = bpy.data.materials.new("Brass");
|
|
36
|
+
brass.diffuse_color = [0.8, 0.6, 0.3, 1];
|
|
37
|
+
brass.metallic = 1;
|
|
38
|
+
brass.roughness = 0.2;
|
|
39
|
+
mesh.materials.append(brass);
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `build(bpy, parameters)` may be async. `parameters` is plain JSON (`--args`, or a scenery's call). `bpy.random()` is seeded (`--param seed=`, default 0); `Math.random()` is not.
|
|
44
|
+
- There is no `bpy.ops`: no edit mode, selection or active object. `bmesh.ops.*` take the geometry they act on and return the new geometry, as in Blender's Python. `applyModifier(bpy, object, { modifier })` applies one named modifier to its base mesh (Blender's `modifier_apply`).
|
|
45
|
+
- Relative imports name their extension (`./parts.ts`); only erasable TypeScript.
|
|
46
|
+
- An object's name is what the scenery commands and measurements call it; a taken name gets Blender's suffix (`Part.001`).
|
|
47
|
+
|
|
48
|
+
**Axes.** Blender's: right-handed, **Z up**, metres, **radians** (Euler XYZ), unlike a scenery (Y up, degrees). The GLB and `modelObject` turn Z up to Y up with one root rotation: Blender's (x, y, z) is the scenery's (x, z, −y). Blender's length defaults are sized for a room (Bevel `width` 0.1 m, Solidify `thickness` 0.01 m, Screw and Array `merge_threshold` 0.01 m, Mirror 0.001 m): a hand-sized prop sets its own.
|
|
49
|
+
|
|
50
|
+
## A soft shape: a distance field
|
|
51
|
+
|
|
52
|
+
A shape with no edges (a foam hand, a pebble) can be written as a signed distance field, `Field = (p) => number`, negative inside. `meshField(field, { min, max, cell, project?, maxSamples? })` meshes it by surface nets, each vertex moved onto the surface by `project` Newton steps (default 3), refusing a grid over `maxSamples` (default 40 million; `FIELD_DEFAULTS`). It gives `{ vertices, faces, closed, samples }`: faces counterclockwise seen from outside, `closed` when the field is outside on all of the box's faces.
|
|
53
|
+
|
|
54
|
+
```ts file=room/hand.ts
|
|
55
|
+
import {
|
|
56
|
+
capsule,
|
|
57
|
+
defineModel,
|
|
58
|
+
ellipsoid,
|
|
59
|
+
meshField,
|
|
60
|
+
smoothUnion,
|
|
61
|
+
type Vec3,
|
|
62
|
+
} from "@allyhub-next/model";
|
|
63
|
+
|
|
64
|
+
export default defineModel((bpy) => {
|
|
65
|
+
// Millimetres while it is written, metres when it is made.
|
|
66
|
+
const fist = (p: Vec3) =>
|
|
67
|
+
smoothUnion(
|
|
68
|
+
ellipsoid(p, [-11, 0, 0], [13, 12.6, 10.8]),
|
|
69
|
+
capsule(p, [0, 0, 2], [26, 0, 6], 5.3, 4.5),
|
|
70
|
+
3.2,
|
|
71
|
+
);
|
|
72
|
+
const m = meshField(fist, {
|
|
73
|
+
min: [-36, -17, -17],
|
|
74
|
+
max: [34, 17, 16],
|
|
75
|
+
cell: 0.5,
|
|
76
|
+
});
|
|
77
|
+
const mesh = bpy.data.meshes.new("Hand");
|
|
78
|
+
mesh.from_pydata(
|
|
79
|
+
m.vertices.map(([x, y, z]): Vec3 => [x / 1000, y / 1000, z / 1000]),
|
|
80
|
+
[],
|
|
81
|
+
m.faces,
|
|
82
|
+
);
|
|
83
|
+
mesh.shade_smooth();
|
|
84
|
+
bpy.context.collection.objects.link(bpy.data.objects.new("Hand", mesh));
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Helper | The shape |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `sphere(p, center, radius)` | A ball |
|
|
91
|
+
| `box(p, center, half, round = 0)` | A box of half-sizes `half`, its edges rounded inside it |
|
|
92
|
+
| `capsule(p, a, b, ra, rb = ra)` | From `a` to `b`, its radius running from `ra` to `rb` |
|
|
93
|
+
| `ellipsoid(p, center, radii)` | Radii along the axes (exact on its surface) |
|
|
94
|
+
| `torus(p, center, axis, major, minor)` | Round `"x"`, `"y"` or `"z"` |
|
|
95
|
+
| `cylinder(p, a, b, radius, round = 0)` | From `a` to `b`, its rims rounded |
|
|
96
|
+
| `smoothUnion(d1, d2, k)`, `smoothIntersect`, `smoothSubtract` | Joined, intersected or cut, the seam rounded `k` wide |
|
|
97
|
+
|
|
98
|
+
The surface's detail is about one `cell`.
|
|
99
|
+
|
|
100
|
+
## Build and measure
|
|
101
|
+
|
|
102
|
+
- `allyhub model <file> --inspect` evaluates it without writing anything: each object's parent, matrix, bounds after its modifiers (Blender's Z-up metres), triangles, materials as glTF reads them, UV layers, a curve's splines, and the objects left with no triangles.
|
|
103
|
+
- `allyhub model <file>` writes a GLB (Y up), by default `.allyhub/out/<module>.glb` (the folder's name for a `model.ts`); `--out` names another (`assets/media/models/<name>.glb` to load it as media). A failed build leaves the last GLB in place.
|
|
104
|
+
- A build is kept in `.allyhub/cache/model/` while the module, the files it read, its folder's files, its parameters and seed are unchanged; `--fresh` builds anew.
|
|
105
|
+
- The program is trusted project code, run in a child process; its logs go to stderr. An error names the call and the place in the project's files it failed at.
|
|
106
|
+
- A subdivision surface lies inside its cage: measure the surface (`--inspect`), not the cage.
|
|
107
|
+
|
|
108
|
+
## In a scenery
|
|
109
|
+
|
|
110
|
+
`modelObject(w, model, parameters?, options?)` from `@allyhub-next/model/three` builds the model in the scenery's page, drawn as its GLB is, its images read through `w.texture`. It returns a `Group` not yet in the scene, whose own rotation turns Z up to Y up: place and turn it inside a group of the scenery's own. A model built once into a GLB loads as any model instead (`import`, `w.load`), and stays as built until built again.
|
|
111
|
+
|
|
112
|
+
```ts file=room/scenery.ts
|
|
113
|
+
import { Group, Mesh, MeshPhysicalMaterial } from "three";
|
|
114
|
+
import { defineScenery } from "@allyhub-next/scenery-host/layer";
|
|
115
|
+
import { modelObject } from "@allyhub-next/model/three";
|
|
116
|
+
import stick from "./stick.ts";
|
|
117
|
+
|
|
118
|
+
export default defineScenery({
|
|
119
|
+
async build(w) {
|
|
120
|
+
const held = new Group();
|
|
121
|
+
held.name = "stick";
|
|
122
|
+
held.add(await modelObject(w, stick, { length: 0.32 }));
|
|
123
|
+
w.scene.add(held);
|
|
124
|
+
held.traverse((o) => {
|
|
125
|
+
// A lacquer over the brass, which glTF's metallic-roughness cannot say.
|
|
126
|
+
if (
|
|
127
|
+
o instanceof Mesh &&
|
|
128
|
+
(o.material as MeshPhysicalMaterial).name === "Brass"
|
|
129
|
+
)
|
|
130
|
+
o.material = new MeshPhysicalMaterial({
|
|
131
|
+
color: 0xc89a4a,
|
|
132
|
+
metalness: 1,
|
|
133
|
+
roughness: 0.25,
|
|
134
|
+
clearcoat: 1,
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- **Materials** are glTF's metallic-roughness: the Principled BSDF's base colour, metallic, roughness, alpha, normal and emission, from values or images; anything else fails with `unsupported_material`, naming the node and socket. Each three.js material keeps its Blender material's name, so a scenery replaces one by name to draw what glTF cannot say (sheen, clearcoat, transmission).
|
|
142
|
+
- **Images**: `bpy.data.images.load(path)` takes a PNG or JPEG. A path that starts with `./` or `../` is from the module that draws the model (the scenery's module in a scenery, the model's own for `allyhub model`); any other is from the project's root.
|
|
143
|
+
- A model used as a scenery prop for one video only is a `SceneryProp` whose `build` calls `modelObject` ([scenery.md](scenery.md#the-scenery-layer)).
|