@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/dist/input.d.ts
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/** A point on the screen, px. */
|
|
2
|
+
export type Point = readonly [x: number, y: number];
|
|
3
|
+
/** How an aimed movement goes: its shape, its time, where it lands, its tremor. */
|
|
4
|
+
export interface ReachOptions {
|
|
5
|
+
/** How far it goes past the target, a share of the distance (negative: it falls short); the correction comes back. */
|
|
6
|
+
overshoot?: number;
|
|
7
|
+
/** When its speed peaks, a share of its primary movement's time: under a half is a quick start and a longer settle. */
|
|
8
|
+
peak?: number;
|
|
9
|
+
/** How much a seed changes the shape from move to move, 0 to 1. */
|
|
10
|
+
vary?: number;
|
|
11
|
+
/** Fitts' law, without a duration: seconds = a + b · log2(1 + distance / size). */
|
|
12
|
+
fitts?: {
|
|
13
|
+
a?: number;
|
|
14
|
+
b?: number;
|
|
15
|
+
};
|
|
16
|
+
/** How far it lands from the target's centre: a standard deviation, a share of the target's size. */
|
|
17
|
+
scatter?: number;
|
|
18
|
+
/** How early or late it lands: a standard deviation, seconds. */
|
|
19
|
+
jitter?: number;
|
|
20
|
+
/** How far its path bows to one side, at most, a share of the distance (the side and amount drawn by the seed). */
|
|
21
|
+
bow?: number;
|
|
22
|
+
/** A hand's tremor: its standard deviation, px, and the middle of its band, Hz. */
|
|
23
|
+
tremor?: {
|
|
24
|
+
px?: number;
|
|
25
|
+
frequency?: number;
|
|
26
|
+
};
|
|
27
|
+
/** Another seed is another hand. */
|
|
28
|
+
seed?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const INPUT_DEFAULTS: {
|
|
31
|
+
reach: {
|
|
32
|
+
overshoot: number;
|
|
33
|
+
peak: number;
|
|
34
|
+
vary: number;
|
|
35
|
+
fitts: {
|
|
36
|
+
a: number;
|
|
37
|
+
b: number;
|
|
38
|
+
};
|
|
39
|
+
scatter: number;
|
|
40
|
+
jitter: number;
|
|
41
|
+
bow: number;
|
|
42
|
+
tremor: {
|
|
43
|
+
px: number;
|
|
44
|
+
frequency: number;
|
|
45
|
+
};
|
|
46
|
+
seed: number;
|
|
47
|
+
};
|
|
48
|
+
/** A target's size when a step gives none, px. */
|
|
49
|
+
size: number;
|
|
50
|
+
/** Seconds the pointer rests on a target before it presses, and a press's hold. */
|
|
51
|
+
dwell: number;
|
|
52
|
+
hold: number;
|
|
53
|
+
/** A drag: the finger's rest before it moves and after, s; its Fitts' b (a drag is slower than a move); its tremor while down. */
|
|
54
|
+
drag: {
|
|
55
|
+
settle: number;
|
|
56
|
+
release: number;
|
|
57
|
+
fitts: {
|
|
58
|
+
a: number;
|
|
59
|
+
b: number;
|
|
60
|
+
};
|
|
61
|
+
tremor: {
|
|
62
|
+
px: number;
|
|
63
|
+
frequency: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/** A tap: how far the finger slides while it is down, px, and its contact's growth, s. */
|
|
67
|
+
tap: {
|
|
68
|
+
slide: number;
|
|
69
|
+
grow: number;
|
|
70
|
+
};
|
|
71
|
+
/** A wheel: px a notch, seconds each notch is animated over, seconds between notches in a burst and between bursts, notches in a burst. */
|
|
72
|
+
wheel: {
|
|
73
|
+
notch: number;
|
|
74
|
+
animate: number;
|
|
75
|
+
interval: number;
|
|
76
|
+
pause: number;
|
|
77
|
+
burst: number;
|
|
78
|
+
};
|
|
79
|
+
/** A flick: the finger's seconds on the glass, the momentum's time constant (iOS's normal deceleration, 0.998 a millisecond), and the rubber band past an edge (its reach, px, and the seconds it springs back in). */
|
|
80
|
+
flick: {
|
|
81
|
+
contact: number;
|
|
82
|
+
decay: number;
|
|
83
|
+
band: number;
|
|
84
|
+
spring: number;
|
|
85
|
+
};
|
|
86
|
+
/** Typing: characters a second; how uneven the keys are (a share of the interval); how much longer the interval is before a word and after a mark; a pause to think before a word, how likely and how long; a mistake noticed after, and each backspace's seconds. */
|
|
87
|
+
typing: {
|
|
88
|
+
cps: number;
|
|
89
|
+
spread: number;
|
|
90
|
+
word: number;
|
|
91
|
+
mark: number;
|
|
92
|
+
think: {
|
|
93
|
+
chance: number;
|
|
94
|
+
seconds: number;
|
|
95
|
+
};
|
|
96
|
+
notice: number;
|
|
97
|
+
backspace: number;
|
|
98
|
+
seed: number;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/** Why a reach's options cannot be used, or undefined. */
|
|
102
|
+
export declare function reachProblem(o: ReachOptions, what: string): string | undefined;
|
|
103
|
+
/** Seconds an aimed movement takes by Fitts' law. */
|
|
104
|
+
export declare function fittsTime(distance: number, size: number, fitts?: {
|
|
105
|
+
a?: number;
|
|
106
|
+
b?: number;
|
|
107
|
+
}): number;
|
|
108
|
+
/** One aimed movement from a point to another, between two moments. */
|
|
109
|
+
export interface Movement {
|
|
110
|
+
/** When it leaves and when it lands. */
|
|
111
|
+
start: number;
|
|
112
|
+
end: number;
|
|
113
|
+
from: Point;
|
|
114
|
+
/** Where it lands (the target moved by its scatter). */
|
|
115
|
+
to: Point;
|
|
116
|
+
/** Where it is at `t`: `from` before, `to` after. */
|
|
117
|
+
at: (t: number) => Point;
|
|
118
|
+
/** Its share of the way over its share of the time (past 1 and back), and how far its path bows to the side (a share of the distance, signed). */
|
|
119
|
+
progress: (u: number) => number;
|
|
120
|
+
bow: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* An aimed movement from `from` to `to` (a target `size` px across),
|
|
124
|
+
* landing at `end` (moved by its jitter) after `duration` seconds or the
|
|
125
|
+
* time Fitts' law gives: its shape drawn by the seed and `index`, the
|
|
126
|
+
* landing point moved by its scatter, the path bowed to one side.
|
|
127
|
+
*/
|
|
128
|
+
export declare function reach(from: Point, to: Point, at: {
|
|
129
|
+
end: number;
|
|
130
|
+
duration?: number;
|
|
131
|
+
size?: number;
|
|
132
|
+
index?: number;
|
|
133
|
+
}, opts?: ReachOptions): Movement;
|
|
134
|
+
/** One step of a pointer: it lands on `to` by `at`, or presses there at `at`. */
|
|
135
|
+
export interface PointerStep {
|
|
136
|
+
/** Seconds: when it lands, or with `press`, when it presses. */
|
|
137
|
+
at: number;
|
|
138
|
+
to: Point;
|
|
139
|
+
/** The target's size, px: how far it may land from its centre and how long the move takes. */
|
|
140
|
+
size?: number;
|
|
141
|
+
/** It presses there (a click, or a finger's tap). */
|
|
142
|
+
press?: boolean;
|
|
143
|
+
/** Seconds the move takes; default by Fitts' law. */
|
|
144
|
+
duration?: number;
|
|
145
|
+
/** Seconds it rests before the press, and the press's hold; default `dwell` and `hold`. */
|
|
146
|
+
dwell?: number;
|
|
147
|
+
hold?: number;
|
|
148
|
+
}
|
|
149
|
+
export interface PointerOptions extends ReachOptions {
|
|
150
|
+
/** Where it is before its first step. */
|
|
151
|
+
from: Point;
|
|
152
|
+
steps: readonly PointerStep[];
|
|
153
|
+
dwell?: number;
|
|
154
|
+
hold?: number;
|
|
155
|
+
}
|
|
156
|
+
export interface PointerState {
|
|
157
|
+
x: number;
|
|
158
|
+
y: number;
|
|
159
|
+
/** Pressed at that moment. */
|
|
160
|
+
down: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface Pointer {
|
|
163
|
+
at: (t: number) => PointerState;
|
|
164
|
+
/** Each move, in order. */
|
|
165
|
+
moves: readonly Movement[];
|
|
166
|
+
/** Each press: when it goes down and comes up, and where. */
|
|
167
|
+
presses: readonly {
|
|
168
|
+
down: number;
|
|
169
|
+
up: number;
|
|
170
|
+
at: Point;
|
|
171
|
+
}[];
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* A pointer (a mouse's, or a finger hovering a screen) going from place to
|
|
175
|
+
* place: each step an aimed movement that lands on its target by its
|
|
176
|
+
* moment, resting `dwell` before a press, which goes down at the step's
|
|
177
|
+
* moment and up `hold` later (each drawn a little differently); a hand's
|
|
178
|
+
* tremor on it throughout.
|
|
179
|
+
*/
|
|
180
|
+
export declare function pointer(opts: PointerOptions): Pointer;
|
|
181
|
+
export interface TapOptions {
|
|
182
|
+
/** When the finger touches, s. */
|
|
183
|
+
at: number;
|
|
184
|
+
to: Point;
|
|
185
|
+
/** Seconds it stays down; default `hold` (a long press: more). */
|
|
186
|
+
hold?: number;
|
|
187
|
+
/** How far the finger slides while it is down, px, and the seconds its contact takes to grow. */
|
|
188
|
+
slide?: number;
|
|
189
|
+
grow?: number;
|
|
190
|
+
/** The target's size: how far from its centre it lands. */
|
|
191
|
+
size?: number;
|
|
192
|
+
scatter?: number;
|
|
193
|
+
seed?: number;
|
|
194
|
+
index?: number;
|
|
195
|
+
}
|
|
196
|
+
export interface Tap {
|
|
197
|
+
/** When it touches and when it lifts: a phone highlights on the first and acts on the second. */
|
|
198
|
+
down: number;
|
|
199
|
+
up: number;
|
|
200
|
+
at: (t: number) => PointerState & {
|
|
201
|
+
/** How much of the fingertip touches, 0 to 1. */
|
|
202
|
+
contact: number;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/** A finger's tap: down at its moment, a little off the target's centre, sliding a little, up after its hold. */
|
|
206
|
+
export declare function tap(opts: TapOptions): Tap;
|
|
207
|
+
export interface DragOptions extends ReachOptions {
|
|
208
|
+
/** Where it is pressed and where it is let go. */
|
|
209
|
+
from: Point;
|
|
210
|
+
to: Point;
|
|
211
|
+
/** When it is pressed, s. */
|
|
212
|
+
at: number;
|
|
213
|
+
/** Seconds it moves; default by Fitts' law (a drag's, slower than a move's). */
|
|
214
|
+
duration?: number;
|
|
215
|
+
/** The target's size, px (how far from it it lands, and how long it takes). */
|
|
216
|
+
size?: number;
|
|
217
|
+
/** Seconds the finger rests after it is pressed and before it is let go. */
|
|
218
|
+
settle?: number;
|
|
219
|
+
release?: number;
|
|
220
|
+
index?: number;
|
|
221
|
+
}
|
|
222
|
+
export interface Drag {
|
|
223
|
+
/** When it is pressed, starts moving, stops and is let go. */
|
|
224
|
+
down: number;
|
|
225
|
+
start: number;
|
|
226
|
+
end: number;
|
|
227
|
+
up: number;
|
|
228
|
+
/** Where it is let go. */
|
|
229
|
+
to: Point;
|
|
230
|
+
at: (t: number) => PointerState;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A drag: pressed at its moment, a rest, then an aimed movement to the
|
|
234
|
+
* target (a quick start, a longer settle, past it and back), a rest, and
|
|
235
|
+
* let go; a hand's tremor on it while it is down.
|
|
236
|
+
*/
|
|
237
|
+
export declare function drag(opts: DragOptions): Drag;
|
|
238
|
+
export interface ScrollOptions {
|
|
239
|
+
/** When it starts, s. */
|
|
240
|
+
at: number;
|
|
241
|
+
/** How far, px (negative: back up). */
|
|
242
|
+
by: number;
|
|
243
|
+
/** A mouse wheel's notches, or a finger's (or a trackpad's) flick and its momentum. */
|
|
244
|
+
kind?: "wheel" | "flick";
|
|
245
|
+
/** The furthest it can go, px (the content's end): a flick past it stretches and springs back. */
|
|
246
|
+
limit?: number;
|
|
247
|
+
wheel?: Partial<typeof INPUT_DEFAULTS.wheel>;
|
|
248
|
+
flick?: Partial<typeof INPUT_DEFAULTS.flick>;
|
|
249
|
+
seed?: number;
|
|
250
|
+
index?: number;
|
|
251
|
+
}
|
|
252
|
+
export interface Scroll {
|
|
253
|
+
/** When it starts and when it has (all but) stopped. */
|
|
254
|
+
start: number;
|
|
255
|
+
end: number;
|
|
256
|
+
/** How far it has scrolled at `t`, px. */
|
|
257
|
+
at: (t: number) => number;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* A scroll by `by` px from its moment: a wheel's notches in bursts (each
|
|
261
|
+
* notch animated as a browser animates it, the notches adding up), or a
|
|
262
|
+
* flick: the finger's push, then momentum that slows as a phone's does,
|
|
263
|
+
* stretching past `limit` and springing back.
|
|
264
|
+
*/
|
|
265
|
+
export declare function scroll(opts: ScrollOptions): Scroll;
|
|
266
|
+
export interface TypingOptions {
|
|
267
|
+
/** When the first key goes down, s. */
|
|
268
|
+
at: number;
|
|
269
|
+
cps?: number;
|
|
270
|
+
spread?: number;
|
|
271
|
+
word?: number;
|
|
272
|
+
mark?: number;
|
|
273
|
+
think?: {
|
|
274
|
+
chance?: number;
|
|
275
|
+
seconds?: number;
|
|
276
|
+
};
|
|
277
|
+
/** Mistakes to make and correct: before the character at `at` (its index in the text), `typed` is typed instead, noticed, deleted and typed right. */
|
|
278
|
+
mistakes?: readonly {
|
|
279
|
+
at: number;
|
|
280
|
+
typed: string;
|
|
281
|
+
}[];
|
|
282
|
+
notice?: number;
|
|
283
|
+
backspace?: number;
|
|
284
|
+
seed?: number;
|
|
285
|
+
}
|
|
286
|
+
export interface Typed {
|
|
287
|
+
/** Every key in order: a character, or "Backspace". */
|
|
288
|
+
keys: readonly {
|
|
289
|
+
t: number;
|
|
290
|
+
key: string;
|
|
291
|
+
}[];
|
|
292
|
+
/** When each character of the text was typed, the last time. */
|
|
293
|
+
times: readonly number[];
|
|
294
|
+
/** When the last key went down. */
|
|
295
|
+
end: number;
|
|
296
|
+
/** What the field shows at `t`. */
|
|
297
|
+
text: (t: number) => string;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* When each key of `text` goes down: intervals that vary (log-normal
|
|
301
|
+
* round 1 / cps), longer before a word and after a mark, now and then a
|
|
302
|
+
* pause to think before a word, and the mistakes asked for typed, noticed,
|
|
303
|
+
* deleted and typed right.
|
|
304
|
+
*/
|
|
305
|
+
export declare function typing(text: string, opts: TypingOptions): Typed;
|
|
306
|
+
//# sourceMappingURL=input.d.ts.map
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{aimAt as q,aimShape as E,bandNoise as I,unit3 as v}from"@allyhub-next/scenery";export const INPUT_DEFAULTS={reach:{overshoot:.06,peak:.38,vary:.5,fitts:{a:.2,b:.15},scatter:.1,jitter:.02,bow:.06,tremor:{px:.3,frequency:9},seed:1},size:40,dwell:.12,hold:.1,drag:{settle:.08,release:.06,fitts:{a:.25,b:.2},tremor:{px:.8,frequency:8}},tap:{slide:1.2,grow:.03},wheel:{notch:100,animate:.15,interval:.05,pause:.25,burst:4},flick:{contact:.12,decay:.4995,band:800,spring:.12},typing:{cps:9,spread:.35,word:1.5,mark:2,think:{chance:.08,seconds:.35},notice:.3,backspace:.07,seed:1}};function z(t,o=INPUT_DEFAULTS.reach){return{...o,...t,fitts:{...o.fitts,...t?.fitts},tremor:{...o.tremor,...t?.tremor}}}const w=(t,o,r)=>2*v(t,o,r)-1,M=(t,o,r)=>Math.sqrt(-2*Math.log(v(t,o,r)))*Math.cos(2*Math.PI*v(t^625341585,o,r));export function reachProblem(t,o){const r=[["scatter",t.scatter],["jitter",t.jitter],["bow",t.bow],["vary",t.vary],["fitts.a",t.fitts?.a],["fitts.b",t.fitts?.b],["tremor.px",t.tremor?.px],["tremor.frequency",t.tremor?.frequency]];for(const[n,c]of r)if(c!==void 0&&!(Number.isFinite(c)&&c>=0))return`${o}'s ${n} is a number from 0, not ${String(c)}`;if(t.overshoot!==void 0&&!(t.overshoot>=-.5&&t.overshoot<=1))return`${o}'s overshoot is a share from -0.5 to 1, not ${String(t.overshoot)}`;if(t.peak!==void 0&&!(t.peak>=.15&&t.peak<=.6))return`${o}'s peak is a share from 0.15 to 0.6, not ${String(t.peak)}`;if(t.seed!==void 0&&!Number.isInteger(t.seed))return`${o}'s seed is a whole number, not ${String(t.seed)}`}export function fittsTime(t,o,r={}){const n={...INPUT_DEFAULTS.reach.fitts,...r};return n.a+n.b*Math.log2(1+t/Math.max(1,o))}export function reach(t,o,r,n={}){const c=reachProblem(n,"reach");if(c)throw new Error(c);const a=z(n),f=r.index??0,h=r.size??INPUT_DEFAULTS.size,y=[o[0]+a.scatter*h*M(a.seed,f,11),o[1]+a.scatter*h*M(a.seed,f,12)],m=y[0]-t[0],s=y[1]-t[1],u=Math.hypot(m,s),d=Math.max(.05,(r.duration??fittsTime(u,h,a.fitts))*(1+.15*a.vary*w(a.seed,f,13))),e=r.end+a.jitter*M(a.seed,f,14),i=e-d,x=E({overshoot:a.overshoot,peak:a.peak,vary:a.vary,seed:a.seed,index:f}),l=a.bow*w(a.seed,f,15);return{start:i,end:e,from:t,to:y,bow:l,progress:b=>q(x,b),at(b){if(b<=i)return t;if(b>=e)return y;const p=(b-i)/d,k=q(x,p),g=l*Math.sin(Math.PI*Math.min(1,p));return[t[0]+m*k-s*g,t[1]+s*k+m*g]}}}function S(t,o,r){if(r.px<=0)return()=>[0,0];const n={center:r.frequency,spread:r.frequency/5},c=I(t+o*31,101,n),a=I(t+o*31,102,n);return f=>[r.px*c(f),r.px*a(f)]}export function pointer(t){const o=reachProblem(t,"pointer");if(o)throw new Error(o);const r=z(t),n=t.dwell??INPUT_DEFAULTS.dwell,c=t.hold??INPUT_DEFAULTS.hold,a=[],f=[];let h=t.from;for(const[m,s]of t.steps.entries()){const u=s.press?(s.dwell??n)*(1+.4*r.vary*w(r.seed,m,21)):0,d=reach(h,s.to,{end:s.at-u,...s.duration===void 0?{}:{duration:s.duration},size:s.size??INPUT_DEFAULTS.size,index:m},t);if(a.push(d),s.press){const e=(s.hold??c)*(1+.4*r.vary*w(r.seed,m,22));f.push({down:s.at,up:s.at+e,at:d.to})}h=d.to}const y=S(r.seed,0,r.tremor);return{moves:a,presses:f,at(m){let s=t.from;for(const e of a)m>=e.start&&(s=e.at(m));const[u,d]=y(m);return{x:s[0]+u,y:s[1]+d,down:f.some(e=>m>=e.down&&m<e.up)}}}}export function tap(t){const o=t.seed??INPUT_DEFAULTS.reach.seed,r=t.index??0,n=t.size??INPUT_DEFAULTS.size,c=t.scatter??INPUT_DEFAULTS.reach.scatter,a=t.slide??INPUT_DEFAULTS.tap.slide,f=t.grow??INPUT_DEFAULTS.tap.grow,h=(t.hold??INPUT_DEFAULTS.hold)*(1+.3*w(o,r,31)),y=t.to[0]+c*n*M(o,r,32),m=t.to[1]+c*n*M(o,r,33),s=2*Math.PI*v(o,r,34),u=t.at,d=u+h;return{down:u,up:d,at(e){const i=Math.min(1,Math.max(0,(e-u)/h)),x=a*(i*i*(3-2*i)),l=e>=u&&e<d,b=l?Math.min(1,(e-u)/f,(d-e)/f):0;return{x:y+x*Math.cos(s),y:m+x*Math.sin(s),down:l,contact:b}}}}export function drag(t){const o=reachProblem(t,"drag");if(o)throw new Error(o);const r=INPUT_DEFAULTS.drag,n=z(t,{...INPUT_DEFAULTS.reach,fitts:r.fitts,tremor:r.tremor}),c=t.index??0,a=(t.settle??r.settle)*(1+.4*n.vary*w(n.seed,c,41)),f=(t.release??r.release)*(1+.4*n.vary*w(n.seed,c,42)),h=t.size??INPUT_DEFAULTS.size,y=Math.hypot(t.to[0]-t.from[0],t.to[1]-t.from[1]),m=t.duration??fittsTime(y,h,n.fitts),s=reach(t.from,t.to,{end:t.at+a+m,duration:m,size:h,index:c},{...n,jitter:0}),u=S(n.seed,c+1e3,n.tremor),d=s.end+f;return{down:t.at,start:s.start,end:s.end,up:d,to:s.to,at(e){const i=s.at(e),x=e>=t.at&&e<d,l=x?Math.min(1,(e-t.at)/.05,(d-e)/.05):0,[b,p]=u(e);return{x:i[0]+l*b,y:i[1]+l*p,down:x}}}}export function scroll(t){const o=t.seed??INPUT_DEFAULTS.reach.seed,r=t.index??0,n=t.by<0?-1:1;if((t.kind??"flick")==="wheel"){const e={...INPUT_DEFAULTS.wheel,...t.wheel},i=Math.max(1,Math.round(Math.abs(t.by)/e.notch)),x=t.by/i,l=[];let b=t.at;for(let k=0;k<i;k++){l.push(b);const g=(k+1)%Math.max(1,e.burst)===0?e.pause:e.interval;b+=g*(1+.4*w(o,r*997+k,51))}const p=k=>1-(1-k)**3;return{start:t.at,end:(l.at(-1)??t.at)+e.animate,at(k){let g=0;for(const $ of l)k>$&&(g+=x*p(Math.min(1,(k-$)/e.animate)));return g}}}const c={...INPUT_DEFAULTS.flick,...t.flick},a=c.contact*(1+.3*w(o,r,52)),f=Math.abs(t.by)/(a/2+c.decay),h=f*a/2,y=t.at+a,m=e=>{if(e<=t.at)return 0;if(e<=y){const i=(e-t.at)/a;return h*i*i}return h+f*c.decay*(1-Math.exp(-(e-y)/c.decay))},s=t.limit===void 0?1/0:Math.abs(t.limit);let u=1/0;Math.abs(t.by)>s&&(s<=h?u=t.at+a*Math.sqrt(s/h):u=y-c.decay*Math.log(1-(s-h)/(f*c.decay)));const d=e=>(1-1/(e*.55/c.band+1))*c.band;return{start:t.at,end:y+c.decay*5,at(e){const i=m(e);if(i<=s)return n*i;const x=Math.max(0,e-u),l=(1+x/c.spring)*Math.exp(-x/c.spring);return n*(s+d(i-s)*l)}}}const j=t=>t!==void 0&&/[\p{L}\p{N}]/u.test(t);export function typing(t,o){const r=INPUT_DEFAULTS.typing,n={...r,...o,think:{...r.think,...o.think}};if(!(n.cps>0))throw new Error(`typing's cps is above 0, not ${String(n.cps)}`);const c=Array.from(t),a=[],f=[];let h=n.at,y=0;const m=(d,e)=>{const i=1/n.cps,x=n.spread,l=M(n.seed,y,61);let b=i*Math.exp(x*l-x*x/2);return!j(d)&&j(e)&&(b*=n.word,v(n.seed,y,62)<n.think.chance&&(b+=n.think.seconds)),d!==void 0&&/[.,;:!?。,、!?]/u.test(d)&&(b*=n.mark),b},s=(d,e,i)=>{a.length>0&&(h+=i??m(d,e)),a.push({t:h,key:e}),y++};let u;for(const[d,e]of c.entries()){for(const i of n.mistakes??[]){if(i.at!==d)continue;const x=Array.from(i.typed);for(const l of x)s(u,l),u=l;h+=n.notice*(1+.3*w(n.seed,y,63));for(let l=0;l<x.length;l++)s(u,"Backspace",l===0?0:n.backspace);u=c[d-1]}s(u,e),f[d]=h,u=e}return{keys:a,times:f,end:h,text(d){let e=[];for(const i of a){if(i.t>d)break;i.key==="Backspace"?e=e.slice(0,-1):e.push(i.key)}return e.join("")}}}
|
package/dist/media.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { type MediaInfo } from "@allyhub/
|
|
2
|
-
type Resolver = (path: string) => string;
|
|
3
|
-
/** Installed by the runtime before a piece module loads. */
|
|
4
|
-
export declare function setMediaResolver(resolve: Resolver | undefined): void;
|
|
1
|
+
import { type MediaInfo } from "@allyhub-next/video-core";
|
|
5
2
|
/** A media value. Used by the code the build generates for media imports. */
|
|
6
|
-
export declare function media(info:
|
|
3
|
+
export declare function media(info: MediaInfo): MediaInfo;
|
|
4
|
+
/** Whether a value is a media value (an import, or ctx.asset's). */
|
|
7
5
|
export declare function isMedia(v: unknown): v is MediaInfo;
|
|
8
|
-
export {};
|
|
9
6
|
//# sourceMappingURL=media.d.ts.map
|
package/dist/media.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// what the build measured. The URL is
|
|
4
|
-
// not known when the code is built: the stage serves the bytes wherever it
|
|
5
|
-
// likes, so `url` asks the runtime, which also records the read. Turned
|
|
6
|
-
// into a string, a media value is its url (`img.src = logo`).
|
|
7
|
-
const RESOLVER = Symbol.for(MEDIA_RESOLVER);
|
|
8
|
-
/** Installed by the runtime before a piece module loads. */
|
|
9
|
-
export function setMediaResolver(resolve) {
|
|
10
|
-
globalThis[RESOLVER] = resolve;
|
|
11
|
-
}
|
|
12
|
-
/** A media value. Used by the code the build generates for media imports. */
|
|
13
|
-
export function media(info) {
|
|
14
|
-
const out = { [MEDIA_BRAND]: true, ...info };
|
|
15
|
-
Object.defineProperty(out, "url", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get() {
|
|
18
|
-
const resolve = globalThis[RESOLVER];
|
|
19
|
-
return resolve ? resolve(info.path) : info.path;
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
return asUrlString(out);
|
|
23
|
-
}
|
|
24
|
-
export function isMedia(v) {
|
|
25
|
-
return typeof v === "object" && v !== null && MEDIA_BRAND in v;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=media.js.map
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{asUrlString as e,MEDIA_BRAND as t}from"@allyhub-next/video-core";export function media(r){return e({[t]:!0,...r})}export function isMedia(r){return typeof r=="object"&&r!==null&&t in r}
|
package/dist/messages.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageHint } from "@allyhub/
|
|
1
|
+
import type { MessageHint } from "@allyhub-next/video-core";
|
|
2
2
|
/**
|
|
3
3
|
* Every message key of the default language → the inputs s.with() takes
|
|
4
4
|
* for it ({name} variables, plural counts). Filled by the generated types.
|
|
@@ -15,7 +15,8 @@ type Typed = [keyof Messages] extends [never] ? false : true;
|
|
|
15
15
|
/** A message key: the generated keys, or any string before they exist. */
|
|
16
16
|
export type MessageKey = Typed extends true ? keyof Messages & string : string;
|
|
17
17
|
/** A prefix s.list() reads: the generated prefixes, or any string. */
|
|
18
|
-
export type ListPrefix = [keyof MessageLists] extends [never] ? string :
|
|
18
|
+
export type ListPrefix = [keyof MessageLists] extends [never] ? string : // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- the prefixes come by declaration merging
|
|
19
|
+
keyof MessageLists & string;
|
|
19
20
|
/** The inputs a key takes in s.with(). */
|
|
20
21
|
export type MessageInputs<K extends string> = K extends keyof Messages ? Messages[K] : Readonly<Record<string, string | number>>;
|
|
21
22
|
/** One item of the list under a prefix. */
|
package/dist/messages.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export{};
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as free from "./free.js";
|
|
2
|
+
import { type FootageFn, type PartFn, type TakeFn } from "./parts.js";
|
|
3
|
+
import { type SlidesFn, type VideoFn } from "./piece.js";
|
|
4
|
+
import { type SdkModule } from "./written.js";
|
|
5
|
+
export type { SdkModule } from "./written.js";
|
|
6
|
+
/** The functions that name files, and so are made for a module. */
|
|
7
|
+
export declare const BOUND: readonly ["video", "slides", "part", "take", "footage"];
|
|
8
|
+
/** The functions sdkFor makes for a module. */
|
|
9
|
+
export interface BoundSdk {
|
|
10
|
+
video: VideoFn;
|
|
11
|
+
slides: SlidesFn;
|
|
12
|
+
part: PartFn;
|
|
13
|
+
take: TakeFn;
|
|
14
|
+
footage: FootageFn;
|
|
15
|
+
}
|
|
16
|
+
/** The whole authoring API, bound to one module. */
|
|
17
|
+
export type Sdk = typeof free & BoundSdk;
|
|
18
|
+
/**
|
|
19
|
+
* The authoring API for the module `module.file` (a project path; "" the
|
|
20
|
+
* project's root): the paths its parts, takes, footage and pieces name
|
|
21
|
+
* are from that module's folder.
|
|
22
|
+
*/
|
|
23
|
+
export declare function sdkFor(module: SdkModule): Sdk;
|
|
24
|
+
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import*as e from"./free.js";import{footageFor as i,partFor as a,takeFor as s}from"./parts.js";import{slidesFor as f,videoFor as n}from"./piece.js";import{writtenIn as p}from"./written.js";export const BOUND=["video","slides","part","take","footage"];export function sdkFor(r){const o=p(r),t={video:n(o),slides:f(o),part:a(o),take:s(o),footage:i(o)};return{...e,...t}}
|
package/dist/noise.js
CHANGED
|
@@ -1,233 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
// The algorithm follows Stefan Gustavson's public-domain reference
|
|
5
|
-
// ("Simplex noise demystified", 2005; SimplexNoise.java, 2012), as the
|
|
6
|
-
// simplex-noise package does (https://github.com/jwagner/simplex-noise.js,
|
|
7
|
-
// Copyright (c) 2022 Jonas Wagner, MIT). The API, a seed then coordinates,
|
|
8
|
-
// is after Remotion's @remotion/noise
|
|
9
|
-
// (https://github.com/remotion-dev/remotion/tree/main/packages/noise, MIT),
|
|
10
|
-
// which wraps simplex-noise. Written again here; see NOTICE.
|
|
11
|
-
import { rand } from "./anim.js";
|
|
12
|
-
const F2 = 0.5 * (Math.sqrt(3) - 1);
|
|
13
|
-
const G2 = (3 - Math.sqrt(3)) / 6;
|
|
14
|
-
const F3 = 1 / 3;
|
|
15
|
-
const G3 = 1 / 6;
|
|
16
|
-
const F4 = (Math.sqrt(5) - 1) / 4;
|
|
17
|
-
const G4 = (5 - Math.sqrt(5)) / 20;
|
|
18
|
-
// The 12 midpoints of a cube's edges; 2D uses their x and y.
|
|
19
|
-
const GRAD3 = new Float64Array([
|
|
20
|
-
1, 1, 0, -1, 1, 0, 1, -1, 0, -1, -1, 0, 1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0,
|
|
21
|
-
-1, 0, 1, 1, 0, -1, 1, 0, 1, -1, 0, -1, -1,
|
|
22
|
-
]);
|
|
23
|
-
// The 32 midpoints of a tesseract's edges.
|
|
24
|
-
const GRAD4 = new Float64Array([
|
|
25
|
-
0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0, -1, 1, 1, 0, -1, 1, -1,
|
|
26
|
-
0, -1, -1, 1, 0, -1, -1, -1, 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1,
|
|
27
|
-
-1, -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1, 1, 1, 0, 1, 1, 1,
|
|
28
|
-
0, -1, 1, -1, 0, 1, 1, -1, 0, -1, -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1,
|
|
29
|
-
-1, 0, -1, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0, -1, 1, 1, 0,
|
|
30
|
-
-1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0,
|
|
31
|
-
]);
|
|
32
|
-
const TABLES = new Map();
|
|
33
|
-
const TABLE_CACHE = 32;
|
|
34
|
-
function tableOf(seed) {
|
|
35
|
-
const key = String(seed);
|
|
36
|
-
const found = TABLES.get(key);
|
|
37
|
-
if (found)
|
|
38
|
-
return found;
|
|
39
|
-
const next = rand(seed);
|
|
40
|
-
const p = new Uint8Array(256);
|
|
41
|
-
for (let i = 0; i < 256; i++)
|
|
42
|
-
p[i] = i;
|
|
43
|
-
// Fisher–Yates, driven by the seed.
|
|
44
|
-
for (let i = 255; i > 0; i--) {
|
|
45
|
-
const r = Math.floor(next() * (i + 1));
|
|
46
|
-
const tmp = p[i] ?? 0;
|
|
47
|
-
p[i] = p[r] ?? 0;
|
|
48
|
-
p[r] = tmp;
|
|
49
|
-
}
|
|
50
|
-
const perm = new Uint8Array(512);
|
|
51
|
-
const mod12 = new Uint8Array(512);
|
|
52
|
-
for (let i = 0; i < 512; i++) {
|
|
53
|
-
perm[i] = p[i & 255] ?? 0;
|
|
54
|
-
mod12[i] = (perm[i] ?? 0) % 12;
|
|
55
|
-
}
|
|
56
|
-
const table = { perm, mod12 };
|
|
57
|
-
if (TABLES.size >= TABLE_CACHE) {
|
|
58
|
-
const oldest = TABLES.keys().next();
|
|
59
|
-
if (!oldest.done)
|
|
60
|
-
TABLES.delete(oldest.value);
|
|
61
|
-
}
|
|
62
|
-
TABLES.set(key, table);
|
|
63
|
-
return table;
|
|
64
|
-
}
|
|
65
|
-
// Indices below are always inside the 512-entry tables; `?? 0` only
|
|
66
|
-
// satisfies the type checker.
|
|
67
|
-
/**
|
|
68
|
-
* 2D simplex noise at (x, y) for a seed: a smooth value in [-1, 1] that
|
|
69
|
-
* changes over about one unit. Scale the coordinates to change its speed
|
|
70
|
-
* (`noise2D("cam", t * 0.5, 0)` drifts slowly with time t).
|
|
71
|
-
*/
|
|
72
|
-
export function noise2D(seed, x, y) {
|
|
73
|
-
const { perm, mod12 } = tableOf(seed);
|
|
74
|
-
const s = (x + y) * F2;
|
|
75
|
-
const i = Math.floor(x + s);
|
|
76
|
-
const j = Math.floor(y + s);
|
|
77
|
-
const t = (i + j) * G2;
|
|
78
|
-
const x0 = x - (i - t);
|
|
79
|
-
const y0 = y - (j - t);
|
|
80
|
-
const i1 = x0 > y0 ? 1 : 0;
|
|
81
|
-
const j1 = 1 - i1;
|
|
82
|
-
const x1 = x0 - i1 + G2;
|
|
83
|
-
const y1 = y0 - j1 + G2;
|
|
84
|
-
const x2 = x0 - 1 + 2 * G2;
|
|
85
|
-
const y2 = y0 - 1 + 2 * G2;
|
|
86
|
-
const ii = i & 255;
|
|
87
|
-
const jj = j & 255;
|
|
88
|
-
let n = 0;
|
|
89
|
-
let t0 = 0.5 - x0 * x0 - y0 * y0;
|
|
90
|
-
if (t0 > 0) {
|
|
91
|
-
const g = (mod12[ii + (perm[jj] ?? 0)] ?? 0) * 3;
|
|
92
|
-
t0 *= t0;
|
|
93
|
-
n += t0 * t0 * ((GRAD3[g] ?? 0) * x0 + (GRAD3[g + 1] ?? 0) * y0);
|
|
94
|
-
}
|
|
95
|
-
let t1 = 0.5 - x1 * x1 - y1 * y1;
|
|
96
|
-
if (t1 > 0) {
|
|
97
|
-
const g = (mod12[ii + i1 + (perm[jj + j1] ?? 0)] ?? 0) * 3;
|
|
98
|
-
t1 *= t1;
|
|
99
|
-
n += t1 * t1 * ((GRAD3[g] ?? 0) * x1 + (GRAD3[g + 1] ?? 0) * y1);
|
|
100
|
-
}
|
|
101
|
-
let t2 = 0.5 - x2 * x2 - y2 * y2;
|
|
102
|
-
if (t2 > 0) {
|
|
103
|
-
const g = (mod12[ii + 1 + (perm[jj + 1] ?? 0)] ?? 0) * 3;
|
|
104
|
-
t2 *= t2;
|
|
105
|
-
n += t2 * t2 * ((GRAD3[g] ?? 0) * x2 + (GRAD3[g + 1] ?? 0) * y2);
|
|
106
|
-
}
|
|
107
|
-
return 70 * n;
|
|
108
|
-
}
|
|
109
|
-
function corner3(g, x, y, z) {
|
|
110
|
-
let t = 0.6 - x * x - y * y - z * z;
|
|
111
|
-
if (t <= 0)
|
|
112
|
-
return 0;
|
|
113
|
-
const k = g * 3;
|
|
114
|
-
t *= t;
|
|
115
|
-
return (t *
|
|
116
|
-
t *
|
|
117
|
-
((GRAD3[k] ?? 0) * x + (GRAD3[k + 1] ?? 0) * y + (GRAD3[k + 2] ?? 0) * z));
|
|
118
|
-
}
|
|
119
|
-
/** 3D simplex noise for a seed, in [-1, 1]: a 2D field that moves smoothly with z. */
|
|
120
|
-
export function noise3D(seed, x, y, z) {
|
|
121
|
-
const { perm, mod12 } = tableOf(seed);
|
|
122
|
-
const s = (x + y + z) * F3;
|
|
123
|
-
const i = Math.floor(x + s);
|
|
124
|
-
const j = Math.floor(y + s);
|
|
125
|
-
const k = Math.floor(z + s);
|
|
126
|
-
const t = (i + j + k) * G3;
|
|
127
|
-
const x0 = x - (i - t);
|
|
128
|
-
const y0 = y - (j - t);
|
|
129
|
-
const z0 = z - (k - t);
|
|
130
|
-
let i1, j1, k1, i2, j2, k2;
|
|
131
|
-
if (x0 >= y0) {
|
|
132
|
-
if (y0 >= z0)
|
|
133
|
-
[i1, j1, k1, i2, j2, k2] = [1, 0, 0, 1, 1, 0];
|
|
134
|
-
else if (x0 >= z0)
|
|
135
|
-
[i1, j1, k1, i2, j2, k2] = [1, 0, 0, 1, 0, 1];
|
|
136
|
-
else
|
|
137
|
-
[i1, j1, k1, i2, j2, k2] = [0, 0, 1, 1, 0, 1];
|
|
138
|
-
}
|
|
139
|
-
else if (y0 < z0)
|
|
140
|
-
[i1, j1, k1, i2, j2, k2] = [0, 0, 1, 0, 1, 1];
|
|
141
|
-
else if (x0 < z0)
|
|
142
|
-
[i1, j1, k1, i2, j2, k2] = [0, 1, 0, 0, 1, 1];
|
|
143
|
-
else
|
|
144
|
-
[i1, j1, k1, i2, j2, k2] = [0, 1, 0, 1, 1, 0];
|
|
145
|
-
const ii = i & 255;
|
|
146
|
-
const jj = j & 255;
|
|
147
|
-
const kk = k & 255;
|
|
148
|
-
const g = (a, b, c) => mod12[ii + a + (perm[jj + b + (perm[kk + c] ?? 0)] ?? 0)] ?? 0;
|
|
149
|
-
const n = corner3(g(0, 0, 0), x0, y0, z0) +
|
|
150
|
-
corner3(g(i1, j1, k1), x0 - i1 + G3, y0 - j1 + G3, z0 - k1 + G3) +
|
|
151
|
-
corner3(g(i2, j2, k2), x0 - i2 + 2 * G3, y0 - j2 + 2 * G3, z0 - k2 + 2 * G3) +
|
|
152
|
-
corner3(g(1, 1, 1), x0 - 1 + 3 * G3, y0 - 1 + 3 * G3, z0 - 1 + 3 * G3);
|
|
153
|
-
return 32 * n;
|
|
154
|
-
}
|
|
155
|
-
function corner4(g, x, y, z, w) {
|
|
156
|
-
let t = 0.6 - x * x - y * y - z * z - w * w;
|
|
157
|
-
if (t <= 0)
|
|
158
|
-
return 0;
|
|
159
|
-
const k = g * 4;
|
|
160
|
-
t *= t;
|
|
161
|
-
return (t *
|
|
162
|
-
t *
|
|
163
|
-
((GRAD4[k] ?? 0) * x +
|
|
164
|
-
(GRAD4[k + 1] ?? 0) * y +
|
|
165
|
-
(GRAD4[k + 2] ?? 0) * z +
|
|
166
|
-
(GRAD4[k + 3] ?? 0) * w));
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* 4D simplex noise for a seed, in [-1, 1]. Two of its axes on a circle make
|
|
170
|
-
* a loop: `noise4D(seed, x, y, cos(a) * r, sin(a) * r)` comes back to where
|
|
171
|
-
* it started when `a` turns once.
|
|
172
|
-
*/
|
|
173
|
-
export function noise4D(seed, x, y, z, w) {
|
|
174
|
-
const { perm } = tableOf(seed);
|
|
175
|
-
const s = (x + y + z + w) * F4;
|
|
176
|
-
const i = Math.floor(x + s);
|
|
177
|
-
const j = Math.floor(y + s);
|
|
178
|
-
const k = Math.floor(z + s);
|
|
179
|
-
const l = Math.floor(w + s);
|
|
180
|
-
const t = (i + j + k + l) * G4;
|
|
181
|
-
const x0 = x - (i - t);
|
|
182
|
-
const y0 = y - (j - t);
|
|
183
|
-
const z0 = z - (k - t);
|
|
184
|
-
const w0 = w - (l - t);
|
|
185
|
-
// Which simplex: each coordinate's rank among the four.
|
|
186
|
-
let rx = 0;
|
|
187
|
-
let ry = 0;
|
|
188
|
-
let rz = 0;
|
|
189
|
-
let rw = 0;
|
|
190
|
-
if (x0 > y0)
|
|
191
|
-
rx++;
|
|
192
|
-
else
|
|
193
|
-
ry++;
|
|
194
|
-
if (x0 > z0)
|
|
195
|
-
rx++;
|
|
196
|
-
else
|
|
197
|
-
rz++;
|
|
198
|
-
if (x0 > w0)
|
|
199
|
-
rx++;
|
|
200
|
-
else
|
|
201
|
-
rw++;
|
|
202
|
-
if (y0 > z0)
|
|
203
|
-
ry++;
|
|
204
|
-
else
|
|
205
|
-
rz++;
|
|
206
|
-
if (y0 > w0)
|
|
207
|
-
ry++;
|
|
208
|
-
else
|
|
209
|
-
rw++;
|
|
210
|
-
if (z0 > w0)
|
|
211
|
-
rz++;
|
|
212
|
-
else
|
|
213
|
-
rw++;
|
|
214
|
-
const ii = i & 255;
|
|
215
|
-
const jj = j & 255;
|
|
216
|
-
const kk = k & 255;
|
|
217
|
-
const ll = l & 255;
|
|
218
|
-
const g = (a, b, c, d) => (perm[ii + a + (perm[jj + b + (perm[kk + c + (perm[ll + d] ?? 0)] ?? 0)] ?? 0)] ?? 0) % 32;
|
|
219
|
-
let n = corner4(g(0, 0, 0, 0), x0, y0, z0, w0);
|
|
220
|
-
for (let step = 1; step <= 3; step++) {
|
|
221
|
-
const rank = 4 - step;
|
|
222
|
-
const a = rx >= rank ? 1 : 0;
|
|
223
|
-
const b = ry >= rank ? 1 : 0;
|
|
224
|
-
const c = rz >= rank ? 1 : 0;
|
|
225
|
-
const d = rw >= rank ? 1 : 0;
|
|
226
|
-
const o = step * G4;
|
|
227
|
-
n += corner4(g(a, b, c, d), x0 - a + o, y0 - b + o, z0 - c + o, w0 - d + o);
|
|
228
|
-
}
|
|
229
|
-
const o = 4 * G4;
|
|
230
|
-
n += corner4(g(1, 1, 1, 1), x0 - 1 + o, y0 - 1 + o, z0 - 1 + o, w0 - 1 + o);
|
|
231
|
-
return 27 * n;
|
|
232
|
-
}
|
|
233
|
-
//# sourceMappingURL=noise.js.map
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{rand as K}from"./anim.js";const N=.5*(Math.sqrt(3)-1),B=(3-Math.sqrt(3))/6,P=1/3,D=1/6,Q=(Math.sqrt(5)-1)/4,H=(5-Math.sqrt(5))/20,w=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),v=new Float64Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),C=new Map,V=32;function O(g){const s=String(g),c=C.get(s);if(c)return c;const e=K(g),o=new Uint8Array(256);for(let t=0;t<256;t++)o[t]=t;for(let t=255;t>0;t--){const u=Math.floor(e()*(t+1)),p=o[t]??0;o[t]=o[u]??0,o[u]=p}const n=new Uint8Array(512),r=new Uint8Array(512);for(let t=0;t<512;t++)n[t]=o[t&255]??0,r[t]=(n[t]??0)%12;const d={perm:n,mod12:r};if(C.size>=V){const t=C.keys().next();t.done||C.delete(t.value)}return C.set(s,d),d}export function noise2D(g,s,c){const{perm:e,mod12:o}=O(g),n=(s+c)*N,r=Math.floor(s+n),d=Math.floor(c+n),t=(r+d)*B,u=s-(r-t),p=c-(d-t),m=u>p?1:0,M=1-m,i=u-m+B,l=p-M+B,f=u-1+2*B,h=p-1+2*B,k=r&255,j=d&255;let a=0,F=.5-u*u-p*p;if(F>0){const A=(o[k+(e[j]??0)]??0)*3;F*=F,a+=F*F*((w[A]??0)*u+(w[A+1]??0)*p)}let G=.5-i*i-l*l;if(G>0){const A=(o[k+m+(e[j+M]??0)]??0)*3;G*=G,a+=G*G*((w[A]??0)*i+(w[A+1]??0)*l)}let q=.5-f*f-h*h;if(q>0){const A=(o[k+1+(e[j+1]??0)]??0)*3;q*=q,a+=q*q*((w[A]??0)*f+(w[A+1]??0)*h)}return 70*a}function x(g,s,c,e){let o=.6-s*s-c*c-e*e;if(o<=0)return 0;const n=g*3;return o*=o,o*o*((w[n]??0)*s+(w[n+1]??0)*c+(w[n+2]??0)*e)}export function noise3D(g,s,c,e){const{perm:o,mod12:n}=O(g),r=(s+c+e)*P,d=Math.floor(s+r),t=Math.floor(c+r),u=Math.floor(e+r),p=(d+t+u)*D,m=s-(d-p),M=c-(t-p),i=e-(u-p);let l,f,h,k,j,a;m>=M?M>=i?[l,f,h,k,j,a]=[1,0,0,1,1,0]:m>=i?[l,f,h,k,j,a]=[1,0,0,1,0,1]:[l,f,h,k,j,a]=[0,0,1,1,0,1]:M<i?[l,f,h,k,j,a]=[0,0,1,0,1,1]:m<i?[l,f,h,k,j,a]=[0,1,0,0,1,1]:[l,f,h,k,j,a]=[0,1,0,1,1,0];const F=d&255,G=t&255,q=u&255,A=(U,y,b)=>n[F+U+(o[G+y+(o[q+b]??0)]??0)]??0;return 32*(x(A(0,0,0),m,M,i)+x(A(l,f,h),m-l+D,M-f+D,i-h+D)+x(A(k,j,a),m-k+2*D,M-j+2*D,i-a+2*D)+x(A(1,1,1),m-1+3*D,M-1+3*D,i-1+3*D))}function _(g,s,c,e,o){let n=.6-s*s-c*c-e*e-o*o;if(n<=0)return 0;const r=g*4;return n*=n,n*n*((v[r]??0)*s+(v[r+1]??0)*c+(v[r+2]??0)*e+(v[r+3]??0)*o)}export function noise4D(g,s,c,e,o){const{perm:n}=O(g),r=(s+c+e+o)*Q,d=Math.floor(s+r),t=Math.floor(c+r),u=Math.floor(e+r),p=Math.floor(o+r),m=(d+t+u+p)*H,M=s-(d-m),i=c-(t-m),l=e-(u-m),f=o-(p-m);let h=0,k=0,j=0,a=0;M>i?h++:k++,M>l?h++:j++,M>f?h++:a++,i>l?k++:j++,i>f?k++:a++,l>f?j++:a++;const F=d&255,G=t&255,q=u&255,A=p&255,L=(b,E,R,S)=>(n[F+b+(n[G+E+(n[q+R+(n[A+S]??0)]??0)]??0)]??0)%32;let U=_(L(0,0,0,0),M,i,l,f);for(let b=1;b<=3;b++){const E=4-b,R=h>=E?1:0,S=k>=E?1:0,I=j>=E?1:0,J=a>=E?1:0,T=b*H;U+=_(L(R,S,I,J),M-R+T,i-S+T,l-I+T,f-J+T)}const y=4*H;return U+=_(L(1,1,1,1),M-1+y,i-1+y,l-1+y,f-1+y),27*U}
|