@nodetool-ai/timeline 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/animation/bakedAnimation.d.ts +84 -0
- package/dist/animation/bakedAnimation.d.ts.map +1 -0
- package/dist/animation/bakedAnimation.js +95 -0
- package/dist/animation/bakedAnimation.js.map +1 -0
- package/dist/animation/beat.d.ts +7 -0
- package/dist/animation/beat.d.ts.map +1 -0
- package/dist/animation/beat.js +36 -0
- package/dist/animation/beat.js.map +1 -0
- package/dist/animation/compile.d.ts +184 -0
- package/dist/animation/compile.d.ts.map +1 -0
- package/dist/animation/compile.js +312 -0
- package/dist/animation/compile.js.map +1 -0
- package/dist/animation/custom.d.ts +183 -0
- package/dist/animation/custom.d.ts.map +1 -0
- package/dist/animation/custom.js +583 -0
- package/dist/animation/custom.js.map +1 -0
- package/dist/animation/easing.d.ts +34 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +332 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/index.d.ts +20 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/index.js +20 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/links.d.ts +33 -0
- package/dist/animation/links.d.ts.map +1 -0
- package/dist/animation/links.js +126 -0
- package/dist/animation/links.js.map +1 -0
- package/dist/animation/presets.d.ts +86 -0
- package/dist/animation/presets.d.ts.map +1 -0
- package/dist/animation/presets.js +642 -0
- package/dist/animation/presets.js.map +1 -0
- package/dist/animation/sample.d.ts +145 -0
- package/dist/animation/sample.d.ts.map +1 -0
- package/dist/animation/sample.js +390 -0
- package/dist/animation/sample.js.map +1 -0
- package/dist/animation/simplify.d.ts +70 -0
- package/dist/animation/simplify.d.ts.map +1 -0
- package/dist/animation/simplify.js +278 -0
- package/dist/animation/simplify.js.map +1 -0
- package/dist/animation/sourceCurves.d.ts +45 -0
- package/dist/animation/sourceCurves.d.ts.map +1 -0
- package/dist/animation/sourceCurves.js +168 -0
- package/dist/animation/sourceCurves.js.map +1 -0
- package/dist/animation/styleTracks.d.ts +23 -0
- package/dist/animation/styleTracks.d.ts.map +1 -0
- package/dist/animation/styleTracks.js +341 -0
- package/dist/animation/styleTracks.js.map +1 -0
- package/dist/animation/types.d.ts +269 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/types.js +173 -0
- package/dist/animation/types.js.map +1 -0
- package/dist/animation/typewriter.d.ts +8 -0
- package/dist/animation/typewriter.d.ts.map +1 -0
- package/dist/animation/typewriter.js +32 -0
- package/dist/animation/typewriter.js.map +1 -0
- package/dist/audioFade.d.ts +73 -0
- package/dist/audioFade.d.ts.map +1 -0
- package/dist/audioFade.js +134 -0
- package/dist/audioFade.js.map +1 -0
- package/dist/authoredStyles.d.ts +61 -0
- package/dist/authoredStyles.d.ts.map +1 -0
- package/dist/authoredStyles.js +90 -0
- package/dist/authoredStyles.js.map +1 -0
- package/dist/authoring.d.ts +50 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +207 -0
- package/dist/authoring.js.map +1 -0
- package/dist/beats.d.ts +103 -0
- package/dist/beats.d.ts.map +1 -0
- package/dist/beats.js +228 -0
- package/dist/beats.js.map +1 -0
- package/dist/clone.d.ts +32 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +53 -0
- package/dist/clone.js.map +1 -0
- package/dist/composition.d.ts +87 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +253 -0
- package/dist/composition.js.map +1 -0
- package/dist/crop.d.ts +48 -0
- package/dist/crop.d.ts.map +1 -0
- package/dist/crop.js +75 -0
- package/dist/crop.js.map +1 -0
- package/dist/defaults.d.ts +142 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +335 -0
- package/dist/defaults.js.map +1 -0
- package/dist/dependencyHash.d.ts +14 -0
- package/dist/dependencyHash.d.ts.map +1 -0
- package/dist/dependencyHash.js +19 -0
- package/dist/dependencyHash.js.map +1 -0
- package/dist/dropResolve.d.ts +40 -0
- package/dist/dropResolve.d.ts.map +1 -0
- package/dist/dropResolve.js +137 -0
- package/dist/dropResolve.js.map +1 -0
- package/dist/examples/node.d.ts +11 -0
- package/dist/examples/node.d.ts.map +1 -0
- package/dist/examples/node.js +87 -0
- package/dist/examples/node.js.map +1 -0
- package/dist/extension.d.ts +52 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +269 -0
- package/dist/extension.js.map +1 -0
- package/dist/extensionRequest.d.ts +40 -0
- package/dist/extensionRequest.d.ts.map +1 -0
- package/dist/extensionRequest.js +135 -0
- package/dist/extensionRequest.js.map +1 -0
- package/dist/fill-text.d.ts +30 -0
- package/dist/fill-text.d.ts.map +1 -0
- package/dist/fill-text.js +73 -0
- package/dist/fill-text.js.map +1 -0
- package/dist/fonts/catalog.d.ts +97 -0
- package/dist/fonts/catalog.d.ts.map +1 -0
- package/dist/fonts/catalog.js +276 -0
- package/dist/fonts/catalog.js.map +1 -0
- package/dist/fonts/css.d.ts +24 -0
- package/dist/fonts/css.d.ts.map +1 -0
- package/dist/fonts/css.js +50 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/index.d.ts +10 -0
- package/dist/fonts/index.d.ts.map +1 -0
- package/dist/fonts/index.js +10 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/register-node.d.ts +45 -0
- package/dist/fonts/register-node.d.ts.map +1 -0
- package/dist/fonts/register-node.js +71 -0
- package/dist/fonts/register-node.js.map +1 -0
- package/dist/generatedMatte.d.ts +86 -0
- package/dist/generatedMatte.d.ts.map +1 -0
- package/dist/generatedMatte.js +152 -0
- package/dist/generatedMatte.js.map +1 -0
- package/dist/generative.d.ts +145 -0
- package/dist/generative.d.ts.map +1 -0
- package/dist/generative.js +396 -0
- package/dist/generative.js.map +1 -0
- package/dist/group.d.ts +47 -0
- package/dist/group.d.ts.map +1 -0
- package/dist/group.js +131 -0
- package/dist/group.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/interchange.d.ts +47 -0
- package/dist/interchange.d.ts.map +1 -0
- package/dist/interchange.js +158 -0
- package/dist/interchange.js.map +1 -0
- package/dist/keyframes.d.ts +44 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/keyframes.js +148 -0
- package/dist/keyframes.js.map +1 -0
- package/dist/lineDelivery.d.ts +108 -0
- package/dist/lineDelivery.d.ts.map +1 -0
- package/dist/lineDelivery.js +154 -0
- package/dist/lineDelivery.js.map +1 -0
- package/dist/linked.d.ts +41 -0
- package/dist/linked.d.ts.map +1 -0
- package/dist/linked.js +166 -0
- package/dist/linked.js.map +1 -0
- package/dist/lipSyncRequest.d.ts +65 -0
- package/dist/lipSyncRequest.d.ts.map +1 -0
- package/dist/lipSyncRequest.js +73 -0
- package/dist/lipSyncRequest.js.map +1 -0
- package/dist/measureClipDurations.d.ts +7 -0
- package/dist/measureClipDurations.d.ts.map +1 -0
- package/dist/measureClipDurations.js +17 -0
- package/dist/measureClipDurations.js.map +1 -0
- package/dist/mediaTrack.d.ts +120 -0
- package/dist/mediaTrack.d.ts.map +1 -0
- package/dist/mediaTrack.js +269 -0
- package/dist/mediaTrack.js.map +1 -0
- package/dist/midi/cacheKey.d.ts +25 -0
- package/dist/midi/cacheKey.d.ts.map +1 -0
- package/dist/midi/cacheKey.js +54 -0
- package/dist/midi/cacheKey.js.map +1 -0
- package/dist/midi/edit.d.ts +48 -0
- package/dist/midi/edit.d.ts.map +1 -0
- package/dist/midi/edit.js +93 -0
- package/dist/midi/edit.js.map +1 -0
- package/dist/midi/engines/bl1.d.ts +29 -0
- package/dist/midi/engines/bl1.d.ts.map +1 -0
- package/dist/midi/engines/bl1.js +128 -0
- package/dist/midi/engines/bl1.js.map +1 -0
- package/dist/midi/engines/dr1.d.ts +28 -0
- package/dist/midi/engines/dr1.d.ts.map +1 -0
- package/dist/midi/engines/dr1.js +101 -0
- package/dist/midi/engines/dr1.js.map +1 -0
- package/dist/midi/engines/dsp.d.ts +126 -0
- package/dist/midi/engines/dsp.d.ts.map +1 -0
- package/dist/midi/engines/dsp.js +371 -0
- package/dist/midi/engines/dsp.js.map +1 -0
- package/dist/midi/engines/index.d.ts +13 -0
- package/dist/midi/engines/index.d.ts.map +1 -0
- package/dist/midi/engines/index.js +13 -0
- package/dist/midi/engines/index.js.map +1 -0
- package/dist/midi/engines/kits.d.ts +12 -0
- package/dist/midi/engines/kits.d.ts.map +1 -0
- package/dist/midi/engines/kits.js +121 -0
- package/dist/midi/engines/kits.js.map +1 -0
- package/dist/midi/engines/wavetables.d.ts +45 -0
- package/dist/midi/engines/wavetables.d.ts.map +1 -0
- package/dist/midi/engines/wavetables.js +334 -0
- package/dist/midi/engines/wavetables.js.map +1 -0
- package/dist/midi/engines/wt1.d.ts +30 -0
- package/dist/midi/engines/wt1.d.ts.map +1 -0
- package/dist/midi/engines/wt1.js +91 -0
- package/dist/midi/engines/wt1.js.map +1 -0
- package/dist/midi/grid.d.ts +51 -0
- package/dist/midi/grid.d.ts.map +1 -0
- package/dist/midi/grid.js +104 -0
- package/dist/midi/grid.js.map +1 -0
- package/dist/midi/index.d.ts +20 -0
- package/dist/midi/index.d.ts.map +1 -0
- package/dist/midi/index.js +20 -0
- package/dist/midi/index.js.map +1 -0
- package/dist/midi/instrument.d.ts +32 -0
- package/dist/midi/instrument.d.ts.map +1 -0
- package/dist/midi/instrument.js +73 -0
- package/dist/midi/instrument.js.map +1 -0
- package/dist/midi/notes.d.ts +46 -0
- package/dist/midi/notes.d.ts.map +1 -0
- package/dist/midi/notes.js +121 -0
- package/dist/midi/notes.js.map +1 -0
- package/dist/midi/notesEdit.d.ts +94 -0
- package/dist/midi/notesEdit.d.ts.map +1 -0
- package/dist/midi/notesEdit.js +159 -0
- package/dist/midi/notesEdit.js.map +1 -0
- package/dist/midi/presets.d.ts +29 -0
- package/dist/midi/presets.d.ts.map +1 -0
- package/dist/midi/presets.js +281 -0
- package/dist/midi/presets.js.map +1 -0
- package/dist/midi/tempo.d.ts +27 -0
- package/dist/midi/tempo.d.ts.map +1 -0
- package/dist/midi/tempo.js +57 -0
- package/dist/midi/tempo.js.map +1 -0
- package/dist/midi/ticks.d.ts +25 -0
- package/dist/midi/ticks.d.ts.map +1 -0
- package/dist/midi/ticks.js +35 -0
- package/dist/midi/ticks.js.map +1 -0
- package/dist/midi/voice.d.ts +148 -0
- package/dist/midi/voice.d.ts.map +1 -0
- package/dist/midi/voice.js +348 -0
- package/dist/midi/voice.js.map +1 -0
- package/dist/midi/wav.d.ts +14 -0
- package/dist/midi/wav.d.ts.map +1 -0
- package/dist/midi/wav.js +51 -0
- package/dist/midi/wav.js.map +1 -0
- package/dist/model3d.d.ts +41 -0
- package/dist/model3d.d.ts.map +1 -0
- package/dist/model3d.js +39 -0
- package/dist/model3d.js.map +1 -0
- package/dist/model3dBake.d.ts +80 -0
- package/dist/model3dBake.d.ts.map +1 -0
- package/dist/model3dBake.js +127 -0
- package/dist/model3dBake.js.map +1 -0
- package/dist/ops/apply.d.ts +32 -0
- package/dist/ops/apply.d.ts.map +1 -0
- package/dist/ops/apply.js +1595 -0
- package/dist/ops/apply.js.map +1 -0
- package/dist/ops/index.d.ts +13 -0
- package/dist/ops/index.d.ts.map +1 -0
- package/dist/ops/index.js +13 -0
- package/dist/ops/index.js.map +1 -0
- package/dist/ops/op.d.ts +407 -0
- package/dist/ops/op.d.ts.map +1 -0
- package/dist/ops/op.js +61 -0
- package/dist/ops/op.js.map +1 -0
- package/dist/ops/serialize.d.ts +77 -0
- package/dist/ops/serialize.d.ts.map +1 -0
- package/dist/ops/serialize.js +81 -0
- package/dist/ops/serialize.js.map +1 -0
- package/dist/ops/types.d.ts +150 -0
- package/dist/ops/types.d.ts.map +1 -0
- package/dist/ops/types.js +12 -0
- package/dist/ops/types.js.map +1 -0
- package/dist/pathSampling.d.ts +51 -0
- package/dist/pathSampling.d.ts.map +1 -0
- package/dist/pathSampling.js +111 -0
- package/dist/pathSampling.js.map +1 -0
- package/dist/placement/index.d.ts +2 -0
- package/dist/placement/index.d.ts.map +1 -0
- package/dist/placement/index.js +2 -0
- package/dist/placement/index.js.map +1 -0
- package/dist/placement/resolveTrackPlacement.d.ts +40 -0
- package/dist/placement/resolveTrackPlacement.d.ts.map +1 -0
- package/dist/placement/resolveTrackPlacement.js +71 -0
- package/dist/placement/resolveTrackPlacement.js.map +1 -0
- package/dist/production.d.ts +99 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +328 -0
- package/dist/production.js.map +1 -0
- package/dist/reassemble.d.ts +68 -0
- package/dist/reassemble.d.ts.map +1 -0
- package/dist/reassemble.js +187 -0
- package/dist/reassemble.js.map +1 -0
- package/dist/recipe.d.ts +24 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +89 -0
- package/dist/recipe.js.map +1 -0
- package/dist/recordedVoiceReplacement.d.ts +70 -0
- package/dist/recordedVoiceReplacement.d.ts.map +1 -0
- package/dist/recordedVoiceReplacement.js +82 -0
- package/dist/recordedVoiceReplacement.js.map +1 -0
- package/dist/reframe.d.ts +31 -0
- package/dist/reframe.d.ts.map +1 -0
- package/dist/reframe.js +227 -0
- package/dist/reframe.js.map +1 -0
- package/dist/render/canvas2d.d.ts +419 -0
- package/dist/render/canvas2d.d.ts.map +1 -0
- package/dist/render/canvas2d.js +1392 -0
- package/dist/render/canvas2d.js.map +1 -0
- package/dist/render/color.d.ts +26 -0
- package/dist/render/color.d.ts.map +1 -0
- package/dist/render/color.js +305 -0
- package/dist/render/color.js.map +1 -0
- package/dist/render/cpuLegacyEffects.d.ts +17 -0
- package/dist/render/cpuLegacyEffects.d.ts.map +1 -0
- package/dist/render/cpuLegacyEffects.js +347 -0
- package/dist/render/cpuLegacyEffects.js.map +1 -0
- package/dist/render/cpuVisualEffects.d.ts +13 -0
- package/dist/render/cpuVisualEffects.d.ts.map +1 -0
- package/dist/render/cpuVisualEffects.js +388 -0
- package/dist/render/cpuVisualEffects.js.map +1 -0
- package/dist/render/cubeLut.d.ts +12 -0
- package/dist/render/cubeLut.d.ts.map +1 -0
- package/dist/render/cubeLut.js +81 -0
- package/dist/render/cubeLut.js.map +1 -0
- package/dist/render/curveFitting.d.ts +28 -0
- package/dist/render/curveFitting.d.ts.map +1 -0
- package/dist/render/curveFitting.js +94 -0
- package/dist/render/curveFitting.js.map +1 -0
- package/dist/render/draw.d.ts +265 -0
- package/dist/render/draw.d.ts.map +1 -0
- package/dist/render/draw.js +929 -0
- package/dist/render/draw.js.map +1 -0
- package/dist/render/effects.d.ts +120 -0
- package/dist/render/effects.d.ts.map +1 -0
- package/dist/render/effects.js +804 -0
- package/dist/render/effects.js.map +1 -0
- package/dist/render/frameCompositor.d.ts +502 -0
- package/dist/render/frameCompositor.d.ts.map +1 -0
- package/dist/render/frameCompositor.js +1331 -0
- package/dist/render/frameCompositor.js.map +1 -0
- package/dist/render/index.d.ts +27 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +27 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/layout.d.ts +17 -0
- package/dist/render/layout.d.ts.map +1 -0
- package/dist/render/layout.js +197 -0
- package/dist/render/layout.js.map +1 -0
- package/dist/render/model3dBakeSamples.d.ts +45 -0
- package/dist/render/model3dBakeSamples.d.ts.map +1 -0
- package/dist/render/model3dBakeSamples.js +68 -0
- package/dist/render/model3dBakeSamples.js.map +1 -0
- package/dist/render/motionBlur.d.ts +170 -0
- package/dist/render/motionBlur.d.ts.map +1 -0
- package/dist/render/motionBlur.js +193 -0
- package/dist/render/motionBlur.js.map +1 -0
- package/dist/render/sceneModel.d.ts +577 -0
- package/dist/render/sceneModel.d.ts.map +1 -0
- package/dist/render/sceneModel.js +1460 -0
- package/dist/render/sceneModel.js.map +1 -0
- package/dist/render/shapeGeometry.d.ts +81 -0
- package/dist/render/shapeGeometry.d.ts.map +1 -0
- package/dist/render/shapeGeometry.js +460 -0
- package/dist/render/shapeGeometry.js.map +1 -0
- package/dist/render/spatial.d.ts +9 -0
- package/dist/render/spatial.d.ts.map +1 -0
- package/dist/render/spatial.js +58 -0
- package/dist/render/spatial.js.map +1 -0
- package/dist/render/svgPath.d.ts +80 -0
- package/dist/render/svgPath.d.ts.map +1 -0
- package/dist/render/svgPath.js +199 -0
- package/dist/render/svgPath.js.map +1 -0
- package/dist/render/temporal.d.ts +6 -0
- package/dist/render/temporal.d.ts.map +1 -0
- package/dist/render/temporal.js +74 -0
- package/dist/render/temporal.js.map +1 -0
- package/dist/render/textLayout.d.ts +159 -0
- package/dist/render/textLayout.d.ts.map +1 -0
- package/dist/render/textLayout.js +301 -0
- package/dist/render/textLayout.js.map +1 -0
- package/dist/render/trackEffects.d.ts +23 -0
- package/dist/render/trackEffects.d.ts.map +1 -0
- package/dist/render/trackEffects.js +93 -0
- package/dist/render/trackEffects.js.map +1 -0
- package/dist/render/transform.d.ts +54 -0
- package/dist/render/transform.d.ts.map +1 -0
- package/dist/render/transform.js +222 -0
- package/dist/render/transform.js.map +1 -0
- package/dist/render/transition.d.ts +109 -0
- package/dist/render/transition.d.ts.map +1 -0
- package/dist/render/transition.js +351 -0
- package/dist/render/transition.js.map +1 -0
- package/dist/retarget.d.ts +73 -0
- package/dist/retarget.d.ts.map +1 -0
- package/dist/retarget.js +305 -0
- package/dist/retarget.js.map +1 -0
- package/dist/rippleEdit.d.ts +83 -0
- package/dist/rippleEdit.d.ts.map +1 -0
- package/dist/rippleEdit.js +184 -0
- package/dist/rippleEdit.js.map +1 -0
- package/dist/scene.d.ts +28 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js +28 -0
- package/dist/scene.js.map +1 -0
- package/dist/script-link.d.ts +52 -0
- package/dist/script-link.d.ts.map +1 -0
- package/dist/script-link.js +78 -0
- package/dist/script-link.js.map +1 -0
- package/dist/script.d.ts +52 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +93 -0
- package/dist/script.js.map +1 -0
- package/dist/snap.d.ts +2 -0
- package/dist/snap.d.ts.map +1 -0
- package/dist/snap.js +21 -0
- package/dist/snap.js.map +1 -0
- package/dist/snapping/buildSnapPoints.d.ts +16 -0
- package/dist/snapping/buildSnapPoints.d.ts.map +1 -0
- package/dist/snapping/buildSnapPoints.js +39 -0
- package/dist/snapping/buildSnapPoints.js.map +1 -0
- package/dist/snapping/index.d.ts +3 -0
- package/dist/snapping/index.d.ts.map +1 -0
- package/dist/snapping/index.js +3 -0
- package/dist/snapping/index.js.map +1 -0
- package/dist/snapping/resolveSnap.d.ts +19 -0
- package/dist/snapping/resolveSnap.d.ts.map +1 -0
- package/dist/snapping/resolveSnap.js +39 -0
- package/dist/snapping/resolveSnap.js.map +1 -0
- package/dist/sourceRate.d.ts +12 -0
- package/dist/sourceRate.d.ts.map +1 -0
- package/dist/sourceRate.js +13 -0
- package/dist/sourceRate.js.map +1 -0
- package/dist/spatialVideoRequest.d.ts +91 -0
- package/dist/spatialVideoRequest.d.ts.map +1 -0
- package/dist/spatialVideoRequest.js +175 -0
- package/dist/spatialVideoRequest.js.map +1 -0
- package/dist/splitClip.d.ts +3 -0
- package/dist/splitClip.d.ts.map +1 -0
- package/dist/splitClip.js +190 -0
- package/dist/splitClip.js.map +1 -0
- package/dist/stableSerialize.d.ts +11 -0
- package/dist/stableSerialize.d.ts.map +1 -0
- package/dist/stableSerialize.js +31 -0
- package/dist/stableSerialize.js.map +1 -0
- package/dist/staleSet.d.ts +41 -0
- package/dist/staleSet.d.ts.map +1 -0
- package/dist/staleSet.js +106 -0
- package/dist/staleSet.js.map +1 -0
- package/dist/storyboard.d.ts +221 -0
- package/dist/storyboard.d.ts.map +1 -0
- package/dist/storyboard.js +417 -0
- package/dist/storyboard.js.map +1 -0
- package/dist/subtitles.d.ts +61 -0
- package/dist/subtitles.d.ts.map +1 -0
- package/dist/subtitles.js +92 -0
- package/dist/subtitles.js.map +1 -0
- package/dist/takes.d.ts +76 -0
- package/dist/takes.d.ts.map +1 -0
- package/dist/takes.js +238 -0
- package/dist/takes.js.map +1 -0
- package/dist/timeRemap.d.ts +101 -0
- package/dist/timeRemap.d.ts.map +1 -0
- package/dist/timeRemap.js +183 -0
- package/dist/timeRemap.js.map +1 -0
- package/dist/trackOrder.d.ts +38 -0
- package/dist/trackOrder.d.ts.map +1 -0
- package/dist/trackOrder.js +54 -0
- package/dist/trackOrder.js.map +1 -0
- package/dist/transitionAtCut.d.ts +89 -0
- package/dist/transitionAtCut.d.ts.map +1 -0
- package/dist/transitionAtCut.js +217 -0
- package/dist/transitionAtCut.js.map +1 -0
- package/dist/trimClip.d.ts +13 -0
- package/dist/trimClip.d.ts.map +1 -0
- package/dist/trimClip.js +60 -0
- package/dist/trimClip.js.map +1 -0
- package/dist/types.d.ts +1772 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +84 -0
- package/dist/types.js.map +1 -0
- package/fonts/BebasNeue-Regular.ttf +0 -0
- package/fonts/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter-Italic-Variable.ttf +0 -0
- package/fonts/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Italic-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Variable.ttf +0 -0
- package/fonts/Lora-Italic-Variable.ttf +0 -0
- package/fonts/Lora-Variable.ttf +0 -0
- package/fonts/OFL-BebasNeue.txt +93 -0
- package/fonts/OFL-Inter.txt +93 -0
- package/fonts/OFL-JetBrainsMono.txt +93 -0
- package/fonts/OFL-Lora.txt +93 -0
- package/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/fonts/OFL-SpaceGrotesk.txt +93 -0
- package/fonts/PlayfairDisplay-Italic-Variable.ttf +0 -0
- package/fonts/PlayfairDisplay-Variable.ttf +0 -0
- package/fonts/SpaceGrotesk-Variable.ttf +0 -0
- package/package.json +108 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preset → curve compiler. Presets never render directly; `compileClipAnimations`
|
|
3
|
+
* resolves each `ClipAnimation` into a `CompiledAnimation` — a window on the
|
|
4
|
+
* clip-local clock plus keyframe curves with easing baked onto each segment.
|
|
5
|
+
* The sampler (`sample.ts`) then needs no preset or role knowledge.
|
|
6
|
+
*
|
|
7
|
+
* Pure: no DOM, GPU, or store access.
|
|
8
|
+
*/
|
|
9
|
+
import { parseStaggerUnit } from "./types.js";
|
|
10
|
+
import { getAnimationPreset, resolvePresetParams } from "./presets.js";
|
|
11
|
+
import { CUSTOM_ANIMATION_PRESET_ID, normalizeCustomCurves, resolveCustomMask } from "./custom.js";
|
|
12
|
+
/**
|
|
13
|
+
* Per-unit delay in ms for unit `index` of a compiled stagger. `from`
|
|
14
|
+
* ordering: `"start"` = first unit first, `"end"` = last unit first,
|
|
15
|
+
* `"center"` = middle units first, rippling outward.
|
|
16
|
+
*
|
|
17
|
+
* The centre distance is floored so the middle unit — the middle PAIR, on an
|
|
18
|
+
* even count — starts at 0. An unfloored `|index - last/2|` gives an even
|
|
19
|
+
* count no unit at delay 0 (four units at 100ms each: 150, 50, 50, 150), which
|
|
20
|
+
* starts the whole line half an offset late and overstates the span by the
|
|
21
|
+
* same amount.
|
|
22
|
+
*/
|
|
23
|
+
export function staggerUnitDelayMs(stagger, index) {
|
|
24
|
+
const last = stagger.count - 1;
|
|
25
|
+
switch (stagger.from) {
|
|
26
|
+
case "end":
|
|
27
|
+
return (last - index) * stagger.offsetMs;
|
|
28
|
+
case "center":
|
|
29
|
+
return Math.floor(Math.abs(index - last / 2)) * stagger.offsetMs;
|
|
30
|
+
default:
|
|
31
|
+
return index * stagger.offsetMs;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Largest per-unit delay factor (delay = factor × offsetMs). Floored for
|
|
36
|
+
* `"center"` for the same reason {@link staggerUnitDelayMs} floors: the two
|
|
37
|
+
* have to name the same largest delay or the compiled span and the units
|
|
38
|
+
* inside it disagree.
|
|
39
|
+
*/
|
|
40
|
+
function maxStaggerFactor(from, count) {
|
|
41
|
+
return from === "center" ? Math.floor((count - 1) / 2) : count - 1;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Word count of a text — whitespace-separated words across all lines, matching
|
|
45
|
+
* the text rasterizer's wrap tokenization. The `"word"` case of
|
|
46
|
+
* `countTextStaggerUnits`, which is where the other units are counted (they
|
|
47
|
+
* need the wrap, and this module has no text measurement).
|
|
48
|
+
*/
|
|
49
|
+
export function countStaggerUnits(text) {
|
|
50
|
+
return text.split(/\s+/).filter(Boolean).length;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The stagger config when it can take effect: a known unit, matching the one
|
|
54
|
+
* the clip's text is laid out in, a positive offset, and at least two units.
|
|
55
|
+
* Anything else compiles as a plain block animation.
|
|
56
|
+
*/
|
|
57
|
+
function effectiveStagger(stagger, clipUnit, staggerCount) {
|
|
58
|
+
if (!stagger || parseStaggerUnit(stagger.unit) !== clipUnit)
|
|
59
|
+
return undefined;
|
|
60
|
+
if (!(stagger.offsetMs > 0))
|
|
61
|
+
return undefined;
|
|
62
|
+
if (staggerCount === undefined || staggerCount < 2)
|
|
63
|
+
return undefined;
|
|
64
|
+
return stagger;
|
|
65
|
+
}
|
|
66
|
+
/** Default segment easing when neither the animation nor the preset pins one. */
|
|
67
|
+
function roleDefaultEasing(role) {
|
|
68
|
+
switch (role) {
|
|
69
|
+
case "in":
|
|
70
|
+
return "easeOut";
|
|
71
|
+
case "out":
|
|
72
|
+
return "easeIn";
|
|
73
|
+
case "emphasis":
|
|
74
|
+
return "easeInOut";
|
|
75
|
+
case "loop":
|
|
76
|
+
return "linear";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Reverse a curve in time: an "in" curve run backwards is the "out" curve. */
|
|
80
|
+
function reverseCurve(curve) {
|
|
81
|
+
const n = curve.keyframes.length;
|
|
82
|
+
const keyframes = curve.keyframes.map((_, i) => {
|
|
83
|
+
const src = curve.keyframes[n - 1 - i];
|
|
84
|
+
return { t: 1 - src.t, value: src.value, easing: src.easing };
|
|
85
|
+
});
|
|
86
|
+
return { property: curve.property, keyframes };
|
|
87
|
+
}
|
|
88
|
+
/** Bake the effective easing onto each keyframe's incoming segment. */
|
|
89
|
+
function applyEasing(curves, animation, role, presetEasing) {
|
|
90
|
+
const override = animation.easing; // overrides every segment when set
|
|
91
|
+
const base = presetEasing ?? roleDefaultEasing(role);
|
|
92
|
+
return curves.map((curve) => ({
|
|
93
|
+
property: curve.property,
|
|
94
|
+
keyframes: curve.keyframes.map((kf) => ({
|
|
95
|
+
...kf,
|
|
96
|
+
easing: override ?? kf.easing ?? base
|
|
97
|
+
}))
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Compile a clip's animations into windowed curves.
|
|
102
|
+
*
|
|
103
|
+
* - `canvas` resolves normalized preset distances to px.
|
|
104
|
+
* - `clipDurationMs` sets window math; windows are clamped to it and windows
|
|
105
|
+
* that start at or after clip end are dropped.
|
|
106
|
+
* - Unknown presets and roles the preset does not allow are skipped (with a
|
|
107
|
+
* console warning) — forward compatibility with newer documents.
|
|
108
|
+
* - The reserved preset `"custom"` takes its curves from `animation.custom`
|
|
109
|
+
* (baked by a JS body, see `custom.ts`) instead of the catalog. Unusable
|
|
110
|
+
* baked curves are skipped the same way an unknown preset is.
|
|
111
|
+
* - A `stagger` config (with `options.staggerCount` ≥ 2) stretches the
|
|
112
|
+
* compiled window to the full stagger span: each unit animates for the
|
|
113
|
+
* authored `durationMs`, delayed `offsetMs` from the previous, so the span
|
|
114
|
+
* is `durationMs + maxDelay`. `"in"`/`"emphasis"` spans grow forward from
|
|
115
|
+
* the delay; `"out"` spans grow backward so the last unit still ends at
|
|
116
|
+
* `clipEnd - delayMs`. When the span does not fit the clip the per-step
|
|
117
|
+
* offset shrinks (never the per-unit duration) so every unit completes.
|
|
118
|
+
*/
|
|
119
|
+
export function compileClipAnimations(animations, clipDurationMs, canvas, options = {}) {
|
|
120
|
+
if (!animations || animations.length === 0)
|
|
121
|
+
return [];
|
|
122
|
+
const out = [];
|
|
123
|
+
for (const animation of animations) {
|
|
124
|
+
if (animation.enabled === false)
|
|
125
|
+
continue;
|
|
126
|
+
let curves;
|
|
127
|
+
let mask;
|
|
128
|
+
let baseEasing;
|
|
129
|
+
let fullClip = false;
|
|
130
|
+
let timeBase = "clip";
|
|
131
|
+
if (animation.preset === CUSTOM_ANIMATION_PRESET_ID) {
|
|
132
|
+
// A custom animation's curves are already baked (see `custom.ts`), so
|
|
133
|
+
// this path only checks them. Two deliberate differences from a preset:
|
|
134
|
+
// the curves are NOT time-reversed for `"out"` — the body is handed its
|
|
135
|
+
// `role` and authors the motion it wants — and the default segment
|
|
136
|
+
// easing is linear, because a body that sampled `f(t)` densely has
|
|
137
|
+
// already shaped its own values and a role easing on top would distort
|
|
138
|
+
// them. An explicit `animation.easing` or per-keyframe easing still wins.
|
|
139
|
+
const styleOnly = !animation.custom?.curves?.length && Boolean(animation.styleTracks?.length || animation.textAnimator);
|
|
140
|
+
const baked = styleOnly
|
|
141
|
+
? { ok: true, curves: [], timeBase: "clip" }
|
|
142
|
+
: normalizeCustomCurves(animation.custom?.curves, animation.custom?.timeBase);
|
|
143
|
+
if (!baked.ok) {
|
|
144
|
+
console.warn(`[timeline] custom animation "${animation.id}" has unusable curves (${baked.error}) — skipped`);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const resolvedMask = resolveCustomMask(baked.curves, animation.custom?.mask);
|
|
148
|
+
if (!resolvedMask.ok) {
|
|
149
|
+
console.warn(`[timeline] custom animation "${animation.id}": ${resolvedMask.error} — skipped`);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
curves = baked.curves;
|
|
153
|
+
mask = resolvedMask.mask;
|
|
154
|
+
baseEasing = "linear";
|
|
155
|
+
timeBase = baked.timeBase;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const preset = getAnimationPreset(animation.preset);
|
|
159
|
+
if (!preset) {
|
|
160
|
+
console.warn(`[timeline] unknown animation preset "${animation.preset}" — skipped`);
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (!preset.roles.includes(animation.role)) {
|
|
164
|
+
console.warn(`[timeline] preset "${animation.preset}" does not support role "${animation.role}" — skipped`);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const params = resolvePresetParams(preset, animation.params);
|
|
168
|
+
mask = preset.mask?.(params);
|
|
169
|
+
// `durationMs` is the animation's own window length — computed here
|
|
170
|
+
// (ahead of the delay/window math below, which needs it too) so a
|
|
171
|
+
// preset whose motion depends on the window (seeded noise's envelope,
|
|
172
|
+
// arc-length sample density) can size itself to it rather than to a
|
|
173
|
+
// fixed sample count.
|
|
174
|
+
const animDurationMs = Math.max(1, animation.durationMs);
|
|
175
|
+
curves = preset.curves(params, canvas, animation.role, animDurationMs);
|
|
176
|
+
if (animation.role === "out") {
|
|
177
|
+
curves = curves.map(reverseCurve);
|
|
178
|
+
}
|
|
179
|
+
baseEasing = preset.defaultEasing;
|
|
180
|
+
fullClip = preset.fullClip === true;
|
|
181
|
+
}
|
|
182
|
+
curves = applyEasing(curves, animation, animation.role, baseEasing);
|
|
183
|
+
const delayMs = Math.max(0, animation.delayMs ?? 0);
|
|
184
|
+
const durationMs = Math.max(1, animation.durationMs);
|
|
185
|
+
if (fullClip) {
|
|
186
|
+
// kenBurns: one-shot over the whole clip; duration/delay/stagger ignored.
|
|
187
|
+
out.push({
|
|
188
|
+
id: animation.id,
|
|
189
|
+
role: animation.role,
|
|
190
|
+
windowStartMs: 0,
|
|
191
|
+
windowEndMs: clipDurationMs,
|
|
192
|
+
loop: false,
|
|
193
|
+
holdBefore: false,
|
|
194
|
+
holdAfter: true,
|
|
195
|
+
curves
|
|
196
|
+
});
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const staggerConfig = effectiveStagger(animation.stagger, options.staggerUnit ?? "word", options.staggerCount);
|
|
200
|
+
const staggerCount = staggerConfig ? options.staggerCount : 0;
|
|
201
|
+
const staggerFrom = staggerConfig?.from ?? "start";
|
|
202
|
+
if (animation.role === "loop") {
|
|
203
|
+
// The window runs from the delay to clip end, cycling at `durationMs`.
|
|
204
|
+
// A negative delay is a phase offset (see `loopOriginMs`).
|
|
205
|
+
const loopOriginMs = animation.delayMs ?? 0;
|
|
206
|
+
const windowStartMs = Math.max(0, loopOriginMs);
|
|
207
|
+
if (windowStartMs >= clipDurationMs)
|
|
208
|
+
continue;
|
|
209
|
+
const compiled = {
|
|
210
|
+
id: animation.id,
|
|
211
|
+
role: "loop",
|
|
212
|
+
windowStartMs,
|
|
213
|
+
windowEndMs: clipDurationMs,
|
|
214
|
+
loop: true,
|
|
215
|
+
periodMs: durationMs,
|
|
216
|
+
loopOriginMs,
|
|
217
|
+
holdBefore: false,
|
|
218
|
+
holdAfter: false,
|
|
219
|
+
curves
|
|
220
|
+
};
|
|
221
|
+
if (timeBase === "source")
|
|
222
|
+
compiled.timeBase = timeBase;
|
|
223
|
+
if (staggerConfig) {
|
|
224
|
+
// Loops need no span stretch or clamp: the delay is a phase shift, so
|
|
225
|
+
// nothing can compress it.
|
|
226
|
+
compiled.stagger = {
|
|
227
|
+
unit: options.staggerUnit ?? "word",
|
|
228
|
+
count: staggerCount,
|
|
229
|
+
offsetMs: staggerConfig.offsetMs,
|
|
230
|
+
from: staggerFrom,
|
|
231
|
+
unitDurationMs: durationMs,
|
|
232
|
+
maxDelayMs: maxStaggerFactor(staggerFrom, staggerCount) * staggerConfig.offsetMs,
|
|
233
|
+
compressed: false
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
out.push(compiled);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
// Stretch the window to the full stagger span: each unit runs for
|
|
240
|
+
// `durationMs`, the span adds `maxDelay`. When the span does not fit the
|
|
241
|
+
// clip, shrink the per-step offset (keeping per-unit duration) so the
|
|
242
|
+
// last unit still completes inside the clip.
|
|
243
|
+
let staggerOffsetMs = 0;
|
|
244
|
+
let staggerMaxDelayMs = 0;
|
|
245
|
+
let staggerCompressed = false;
|
|
246
|
+
if (staggerConfig) {
|
|
247
|
+
const maxFactor = maxStaggerFactor(staggerFrom, staggerCount);
|
|
248
|
+
const availableMs = clipDurationMs - delayMs;
|
|
249
|
+
staggerOffsetMs = staggerConfig.offsetMs;
|
|
250
|
+
if (durationMs + maxFactor * staggerOffsetMs > availableMs) {
|
|
251
|
+
staggerOffsetMs = Math.max(0, (availableMs - durationMs) / maxFactor);
|
|
252
|
+
staggerCompressed = true;
|
|
253
|
+
}
|
|
254
|
+
staggerMaxDelayMs = maxFactor * staggerOffsetMs;
|
|
255
|
+
}
|
|
256
|
+
let windowStartMs;
|
|
257
|
+
let windowEndMs;
|
|
258
|
+
if (animation.role === "out") {
|
|
259
|
+
windowEndMs = clipDurationMs - delayMs;
|
|
260
|
+
windowStartMs = windowEndMs - durationMs - staggerMaxDelayMs;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
windowStartMs = delayMs;
|
|
264
|
+
windowEndMs = delayMs + durationMs + staggerMaxDelayMs;
|
|
265
|
+
}
|
|
266
|
+
// Clamp to the clip and drop degenerate windows.
|
|
267
|
+
windowEndMs = Math.min(windowEndMs, clipDurationMs);
|
|
268
|
+
windowStartMs = Math.max(0, windowStartMs);
|
|
269
|
+
if (windowStartMs >= clipDurationMs || windowEndMs <= windowStartMs) {
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
const compiled = {
|
|
273
|
+
id: animation.id,
|
|
274
|
+
role: animation.role,
|
|
275
|
+
windowStartMs,
|
|
276
|
+
windowEndMs,
|
|
277
|
+
loop: false,
|
|
278
|
+
holdBefore: animation.role === "in",
|
|
279
|
+
holdAfter: animation.role === "out",
|
|
280
|
+
curves
|
|
281
|
+
};
|
|
282
|
+
if (animation.preset === "typewriter" && animation.caret) {
|
|
283
|
+
compiled.caret = animation.caret;
|
|
284
|
+
}
|
|
285
|
+
if (timeBase === "source")
|
|
286
|
+
compiled.timeBase = timeBase;
|
|
287
|
+
if (mask)
|
|
288
|
+
compiled.mask = mask;
|
|
289
|
+
// A stagger squeezed to a zero offset stays compiled: its units move in
|
|
290
|
+
// sync, but glyph tracks still draw per unit and `compressed` reports it.
|
|
291
|
+
if (staggerConfig) {
|
|
292
|
+
compiled.stagger = {
|
|
293
|
+
unit: options.staggerUnit ?? "word",
|
|
294
|
+
count: staggerCount,
|
|
295
|
+
offsetMs: staggerOffsetMs,
|
|
296
|
+
from: staggerFrom,
|
|
297
|
+
unitDurationMs: durationMs,
|
|
298
|
+
maxDelayMs: staggerMaxDelayMs,
|
|
299
|
+
compressed: staggerCompressed
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
out.push(compiled);
|
|
303
|
+
}
|
|
304
|
+
const authored = new Map(animations.map((animation) => [animation.id, animation]));
|
|
305
|
+
for (const compiled of out) {
|
|
306
|
+
const glyphTracks = authored.get(compiled.id)?.styleTracks?.filter((track) => track.target.startsWith("glyph."));
|
|
307
|
+
if (glyphTracks?.length)
|
|
308
|
+
compiled.glyphTracks = glyphTracks;
|
|
309
|
+
}
|
|
310
|
+
return out;
|
|
311
|
+
}
|
|
312
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/animation/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AA0ErB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAwB,EACxB,KAAa;IAEb,MAA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AAC,CAAC;QACjH,IAAI,WAAW,EAAE,MAAM;YAAE,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom animations: motion authored as JavaScript instead of picked from the
|
|
3
|
+
* preset catalog.
|
|
4
|
+
*
|
|
5
|
+
* The body runs ONCE, host-side, and returns keyframes. Those keyframes are
|
|
6
|
+
* baked onto the clip and compiled exactly like a preset's, so the five render
|
|
7
|
+
* sites that sample animations — the WebGPU preview, the web export renderer,
|
|
8
|
+
* the text rasterizer, and the headless `nodetool.timeline` compositor — need
|
|
9
|
+
* no JS engine and cannot disagree about what a script means. Sampling an
|
|
10
|
+
* arbitrary `f(t)` densely is what makes that equivalent to evaluating the
|
|
11
|
+
* body per frame; the cost is that a script cannot react to playback state.
|
|
12
|
+
*
|
|
13
|
+
* This module is the whole contract: the input bag a body receives, the two
|
|
14
|
+
* output shapes it may return, and the normalization every consumer applies.
|
|
15
|
+
* Pure — no DOM, GPU, sandbox, or store — so the browser, the server bake, the
|
|
16
|
+
* validator, and the tests all read one implementation.
|
|
17
|
+
*/
|
|
18
|
+
import type { CompiledAnimationMask, PropertyCurve } from "./compile.js";
|
|
19
|
+
import { ANIMATED_PROPERTY_FOLD, type AnimatedProperty, type AnimationRole } from "./types.js";
|
|
20
|
+
/**
|
|
21
|
+
* Reserved `preset` id marking an animation whose curves come from
|
|
22
|
+
* `ClipAnimation.custom` rather than from the catalog.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CUSTOM_ANIMATION_PRESET_ID = "custom";
|
|
25
|
+
/** Curves accepted per animation. A script wanting more is doing too much. */
|
|
26
|
+
export declare const MAX_CUSTOM_CURVES = 16;
|
|
27
|
+
/**
|
|
28
|
+
* Keyframes accepted per curve. Well past what any easing needs at 60fps over
|
|
29
|
+
* a long clip, and low enough that a runaway loop in a body is rejected rather
|
|
30
|
+
* than saved into the document.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MAX_CUSTOM_KEYFRAMES = 4096;
|
|
33
|
+
/** Sample density suggested to a body that has no opinion of its own. */
|
|
34
|
+
export declare const DEFAULT_CUSTOM_SAMPLE_COUNT = 60;
|
|
35
|
+
/**
|
|
36
|
+
* What one animatable channel means to a caller writing curves by hand: the
|
|
37
|
+
* value that changes nothing, the range values are read in, and how several
|
|
38
|
+
* animations driving the channel combine.
|
|
39
|
+
*
|
|
40
|
+
* `identity` is null for a `replace` channel — those set the clip's value
|
|
41
|
+
* outright rather than composing with it, so there is nothing to leave alone.
|
|
42
|
+
*/
|
|
43
|
+
export interface AnimatedPropertyDoc {
|
|
44
|
+
property: AnimatedProperty;
|
|
45
|
+
fold: (typeof ANIMATED_PROPERTY_FOLD)[AnimatedProperty];
|
|
46
|
+
identity: number | null;
|
|
47
|
+
/** Unit and usable span, e.g. "0..1" or "canvas px". */
|
|
48
|
+
range: string;
|
|
49
|
+
describe: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Every animatable channel with its fold, identity and range — what
|
|
53
|
+
* `list_animation_presets` prints so an agent can write a curve without
|
|
54
|
+
* reading the engine. Keyed off {@link ANIMATED_PROPERTIES}, so a new channel
|
|
55
|
+
* cannot reach the document without an entry here.
|
|
56
|
+
*/
|
|
57
|
+
export declare const ANIMATED_PROPERTY_DOCS: readonly AnimatedPropertyDoc[];
|
|
58
|
+
/**
|
|
59
|
+
* The `custom` preset as the preset catalog describes a preset: what an author
|
|
60
|
+
* passes instead of `params`, which roles it takes, and the channels a curve
|
|
61
|
+
* may drive. `custom` is not in `ANIMATION_PRESETS` — its motion comes from
|
|
62
|
+
* the document rather than the catalog — so the tools that list presets append
|
|
63
|
+
* this.
|
|
64
|
+
*/
|
|
65
|
+
export declare const CUSTOM_ANIMATION_CONTRACT: {
|
|
66
|
+
readonly id: "custom";
|
|
67
|
+
readonly roles: readonly AnimationRole[];
|
|
68
|
+
readonly describe: string;
|
|
69
|
+
readonly inputs: {
|
|
70
|
+
readonly curves: string;
|
|
71
|
+
readonly code: string;
|
|
72
|
+
readonly timeBase: string;
|
|
73
|
+
readonly mask: string;
|
|
74
|
+
readonly durationMs: string;
|
|
75
|
+
};
|
|
76
|
+
readonly properties: readonly AnimatedPropertyDoc[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The bag a custom-animation body reads off `inputs`. Everything the compiler
|
|
80
|
+
* knows before the curves exist, so a body can shape its motion to the clip it
|
|
81
|
+
* is on: `canvasWidth`/`canvasHeight` turn a normalized distance into px the
|
|
82
|
+
* way a preset's `curves(params, canvas, role)` does.
|
|
83
|
+
*/
|
|
84
|
+
export interface CustomAnimationScriptInputs {
|
|
85
|
+
role: AnimationRole;
|
|
86
|
+
/** The animation's own window length in ms (its `durationMs`). */
|
|
87
|
+
durationMs: number;
|
|
88
|
+
/** The clip the animation sits on, in ms. */
|
|
89
|
+
clipDurationMs: number;
|
|
90
|
+
canvasWidth: number;
|
|
91
|
+
canvasHeight: number;
|
|
92
|
+
/** The animation's `params`, passed through untouched. */
|
|
93
|
+
params: Record<string, number | string | boolean>;
|
|
94
|
+
/** Stagger units the clip splits into (word count of a text clip), or 0. */
|
|
95
|
+
staggerCount: number;
|
|
96
|
+
/** Suggested `samples` density for a body sampling a continuous `f(t)`. */
|
|
97
|
+
sampleCount: number;
|
|
98
|
+
}
|
|
99
|
+
export interface BuildCustomAnimationInputsOptions {
|
|
100
|
+
role: AnimationRole;
|
|
101
|
+
durationMs: number;
|
|
102
|
+
clipDurationMs: number;
|
|
103
|
+
canvas: {
|
|
104
|
+
width: number;
|
|
105
|
+
height: number;
|
|
106
|
+
};
|
|
107
|
+
params?: Record<string, number | string | boolean>;
|
|
108
|
+
staggerCount?: number;
|
|
109
|
+
sampleCount?: number;
|
|
110
|
+
}
|
|
111
|
+
/** Build the `inputs` bag for a custom-animation body. */
|
|
112
|
+
export declare function buildCustomAnimationInputs(options: BuildCustomAnimationInputsOptions): CustomAnimationScriptInputs;
|
|
113
|
+
/**
|
|
114
|
+
* Clock a custom animation's keyframes are placed on. `"clip"` normalizes `t`
|
|
115
|
+
* over the animation window (the original behaviour); `"source"` places every
|
|
116
|
+
* keyframe at an absolute `sourceMs` in the media. See
|
|
117
|
+
* {@link CustomClipAnimation.timeBase}.
|
|
118
|
+
*/
|
|
119
|
+
export type CustomTimeBase = "clip" | "source";
|
|
120
|
+
/**
|
|
121
|
+
* Narrow a document's `custom.timeBase` to a base this build samples. Absent
|
|
122
|
+
* means `"clip"`; anything else is `null`, which the gate turns into a rejected
|
|
123
|
+
* animation rather than sampling a curve on a clock it does not understand.
|
|
124
|
+
*/
|
|
125
|
+
export declare function parseCustomTimeBase(raw: unknown): CustomTimeBase | null;
|
|
126
|
+
export type CustomCurvesResult = {
|
|
127
|
+
ok: true;
|
|
128
|
+
curves: PropertyCurve[];
|
|
129
|
+
/** The base the curves were normalized on (`"clip"` unless asked). */
|
|
130
|
+
timeBase: CustomTimeBase;
|
|
131
|
+
/**
|
|
132
|
+
* Easing strings the grammar does not cover, in document order and
|
|
133
|
+
* de-duplicated. Not a rejection: an easing from a newer build eases
|
|
134
|
+
* linearly rather than dropping the whole animation (I2). The validator
|
|
135
|
+
* turns these into `unknown_easing` warnings.
|
|
136
|
+
*/
|
|
137
|
+
unknownEasings?: string[];
|
|
138
|
+
} | {
|
|
139
|
+
ok: false;
|
|
140
|
+
error: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Check and normalize a baked curve list — the one gate between a script's
|
|
144
|
+
* output (or a document written by another client) and the sampler.
|
|
145
|
+
*
|
|
146
|
+
* `timeBase` is the animation's `custom.timeBase` (see
|
|
147
|
+
* {@link parseCustomTimeBase}); omit it for the clip-normalized curves that
|
|
148
|
+
* were the only kind. A source-anchored list is validated against `sourceMs`
|
|
149
|
+
* instead of `t`, and a base this build does not know is refused rather than
|
|
150
|
+
* sampled on the wrong clock.
|
|
151
|
+
*/
|
|
152
|
+
export declare function normalizeCustomCurves(raw: unknown, timeBase?: unknown): CustomCurvesResult;
|
|
153
|
+
/**
|
|
154
|
+
* Convert the `samples` output shape — one bag per point in time,
|
|
155
|
+
* `{t, opacity, offsetY, …}` — into per-property curves. This is how a body
|
|
156
|
+
* that computes a continuous `f(t)` writes its result: emit the function at N
|
|
157
|
+
* points and let the sampler interpolate between them.
|
|
158
|
+
*
|
|
159
|
+
* A property present on some samples and absent on others is an error rather
|
|
160
|
+
* than a hole: interpolating across the gap would silently invent motion the
|
|
161
|
+
* body never wrote.
|
|
162
|
+
*/
|
|
163
|
+
export declare function curvesFromSamples(raw: unknown): CustomCurvesResult;
|
|
164
|
+
/**
|
|
165
|
+
* Read a custom-animation body's return value. Accepts either output shape:
|
|
166
|
+
* `{curves}` for a body that authored keyframes directly, `{samples}` for one
|
|
167
|
+
* that sampled a function. A bag carrying both is a mistake worth naming.
|
|
168
|
+
*/
|
|
169
|
+
export declare function curvesFromScriptOutput(outputs: unknown): CustomCurvesResult;
|
|
170
|
+
export type CustomMaskResult = {
|
|
171
|
+
ok: true;
|
|
172
|
+
mask?: CompiledAnimationMask;
|
|
173
|
+
} | {
|
|
174
|
+
ok: false;
|
|
175
|
+
error: string;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Resolve the mask a custom animation needs. A `wipeProgress` curve without
|
|
179
|
+
* one is refused: direction and softness cannot be inferred, and defaulting
|
|
180
|
+
* them would render a wipe the author never described.
|
|
181
|
+
*/
|
|
182
|
+
export declare function resolveCustomMask(curves: readonly PropertyCurve[], raw: unknown): CustomMaskResult;
|
|
183
|
+
//# sourceMappingURL=custom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/animation/custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,qBAAqB,EAErB,aAAa,EACd,MAAM,cAAc,CAAC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