@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +247 -0
- package/LICENSE +201 -201
- package/NOTICE +48 -0
- package/README.md +93 -72
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +79 -4
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -3
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/filters/chain.d.ts +1 -1
- package/dist/attributes/audio/filters/chain.js.map +1 -1
- package/dist/attributes/audio/filters/curve.d.ts +8 -8
- package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
- package/dist/attributes/audio/filters/curve.js +20 -19
- package/dist/attributes/audio/filters/curve.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
- package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/filters/index.d.ts +1 -1
- package/dist/attributes/audio/filters/index.d.ts.map +1 -1
- package/dist/attributes/audio/filters/index.js +1 -1
- package/dist/attributes/audio/filters/index.js.map +1 -1
- package/dist/attributes/audio/filters/registry.js.map +1 -1
- package/dist/attributes/audio/filters/union.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +17 -2
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +4 -2
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +15 -8
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +4 -2
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -4
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +3 -1
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +9 -2
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +15 -1
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +28 -120
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +16 -88
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +15 -8
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +2 -6
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +23 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +44 -10
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +81 -44
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +4 -10
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -13
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +2 -2
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -7
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-2RIYH36X.js +3 -0
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +7 -0
- package/dist/browser/chunks/chunk-DDJN3QII.js +15 -0
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +7 -0
- package/dist/browser/chunks/chunk-DHB4COFY.js +2 -0
- package/dist/browser/chunks/chunk-DHB4COFY.js.map +7 -0
- package/dist/browser/chunks/chunk-EJDPYDQI.js +5 -0
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +7 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
- package/dist/browser/chunks/chunk-XAWE4EAK.js +2 -0
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +2 -0
- package/dist/browser/experimental.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
- package/dist/browser/jsx-jsx-runtime.js +1 -1
- package/dist/browser/manifest.json +4 -2
- package/dist/browser/sdk.js +1 -1
- package/dist/component/api.d.ts +508 -0
- package/dist/component/api.d.ts.map +1 -0
- package/dist/component/api.js +4 -0
- package/dist/component/api.js.map +1 -0
- package/dist/component/builtins/audio.d.ts +26 -0
- package/dist/component/builtins/audio.d.ts.map +1 -0
- package/dist/component/builtins/audio.js +41 -0
- package/dist/component/builtins/audio.js.map +1 -0
- package/dist/component/builtins/canvas3d.d.ts +98 -0
- package/dist/component/builtins/canvas3d.d.ts.map +1 -0
- package/dist/component/builtins/canvas3d.js +21 -0
- package/dist/component/builtins/canvas3d.js.map +1 -0
- package/dist/component/builtins/composite.d.ts +56 -0
- package/dist/component/builtins/composite.d.ts.map +1 -0
- package/dist/component/builtins/composite.js +25 -0
- package/dist/component/builtins/composite.js.map +1 -0
- package/dist/component/builtins/geometry.d.ts +505 -0
- package/dist/component/builtins/geometry.d.ts.map +1 -0
- package/dist/component/builtins/geometry.js +107 -0
- package/dist/component/builtins/geometry.js.map +1 -0
- package/dist/component/builtins/layout.d.ts +88 -0
- package/dist/component/builtins/layout.d.ts.map +1 -0
- package/dist/component/builtins/layout.js +84 -0
- package/dist/component/builtins/layout.js.map +1 -0
- package/dist/component/builtins/media.d.ts +95 -0
- package/dist/component/builtins/media.d.ts.map +1 -0
- package/dist/component/builtins/media.js +149 -0
- package/dist/component/builtins/media.js.map +1 -0
- package/dist/component/builtins/providers.d.ts +23 -0
- package/dist/component/builtins/providers.d.ts.map +1 -0
- package/dist/component/builtins/providers.js +30 -0
- package/dist/component/builtins/providers.js.map +1 -0
- package/dist/component/builtins/text.d.ts +193 -0
- package/dist/component/builtins/text.d.ts.map +1 -0
- package/dist/component/builtins/text.js +113 -0
- package/dist/component/builtins/text.js.map +1 -0
- package/dist/component/builtins/three.d.ts +1085 -0
- package/dist/component/builtins/three.d.ts.map +1 -0
- package/dist/component/builtins/three.js +265 -0
- package/dist/component/builtins/three.js.map +1 -0
- package/dist/component/clip-of.d.ts +5 -0
- package/dist/component/clip-of.d.ts.map +1 -0
- package/dist/component/clip-of.js +33 -0
- package/dist/component/clip-of.js.map +1 -0
- package/dist/component/commands-for.d.ts +19 -0
- package/dist/component/commands-for.d.ts.map +1 -0
- package/dist/component/commands-for.js +5 -0
- package/dist/component/commands-for.js.map +1 -0
- package/dist/component/component-audio.d.ts +9 -0
- package/dist/component/component-audio.d.ts.map +1 -0
- package/dist/component/component-audio.js +18 -0
- package/dist/component/component-audio.js.map +1 -0
- package/dist/component/component2d.d.ts +9 -0
- package/dist/component/component2d.d.ts.map +1 -0
- package/dist/component/component2d.js +239 -0
- package/dist/component/component2d.js.map +1 -0
- package/dist/component/component3d.d.ts +9 -0
- package/dist/component/component3d.d.ts.map +1 -0
- package/dist/component/component3d.js +99 -0
- package/dist/component/component3d.js.map +1 -0
- package/dist/component/factory.d.ts +63 -0
- package/dist/component/factory.d.ts.map +1 -0
- package/dist/component/factory.js +313 -0
- package/dist/component/factory.js.map +1 -0
- package/dist/component/modules/aim.d.ts +30 -0
- package/dist/component/modules/aim.d.ts.map +1 -0
- package/dist/component/modules/aim.js +39 -0
- package/dist/component/modules/aim.js.map +1 -0
- package/dist/component/modules/corners.d.ts +13 -0
- package/dist/component/modules/corners.d.ts.map +1 -0
- package/dist/component/modules/corners.js +12 -0
- package/dist/component/modules/corners.js.map +1 -0
- package/dist/component/modules/flow.d.ts +26 -0
- package/dist/component/modules/flow.d.ts.map +1 -0
- package/dist/component/modules/flow.js +55 -0
- package/dist/component/modules/flow.js.map +1 -0
- package/dist/component/modules/material.d.ts +40 -0
- package/dist/component/modules/material.d.ts.map +1 -0
- package/dist/component/modules/material.js +75 -0
- package/dist/component/modules/material.js.map +1 -0
- package/dist/component/modules/paint.d.ts +71 -0
- package/dist/component/modules/paint.d.ts.map +1 -0
- package/dist/component/modules/paint.js +106 -0
- package/dist/component/modules/paint.js.map +1 -0
- package/dist/component/modules/shapes.d.ts +31 -0
- package/dist/component/modules/shapes.d.ts.map +1 -0
- package/dist/component/modules/shapes.js +43 -0
- package/dist/component/modules/shapes.js.map +1 -0
- package/dist/component/modules/text-layout.d.ts +26 -0
- package/dist/component/modules/text-layout.d.ts.map +1 -0
- package/dist/component/modules/text-layout.js +57 -0
- package/dist/component/modules/text-layout.js.map +1 -0
- package/dist/component/modules/text-style.d.ts +48 -0
- package/dist/component/modules/text-style.d.ts.map +1 -0
- package/dist/component/modules/text-style.js +63 -0
- package/dist/component/modules/text-style.js.map +1 -0
- package/dist/component/modules/three-entries.d.ts +23 -0
- package/dist/component/modules/three-entries.d.ts.map +1 -0
- package/dist/component/modules/three-entries.js +41 -0
- package/dist/component/modules/three-entries.js.map +1 -0
- package/dist/component/modules/view3d.d.ts +55 -0
- package/dist/component/modules/view3d.d.ts.map +1 -0
- package/dist/component/modules/view3d.js +160 -0
- package/dist/component/modules/view3d.js.map +1 -0
- package/dist/component/timeline.d.ts +22 -0
- package/dist/component/timeline.d.ts.map +1 -0
- package/dist/component/timeline.js +128 -0
- package/dist/component/timeline.js.map +1 -0
- package/dist/component/type-def.d.ts +26 -0
- package/dist/component/type-def.d.ts.map +1 -0
- package/dist/component/type-def.js +16 -0
- package/dist/component/type-def.js.map +1 -0
- package/dist/component/types.d.ts +91 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +88 -0
- package/dist/component/types.js.map +1 -0
- package/dist/component/views.d.ts +121 -0
- package/dist/component/views.d.ts.map +1 -0
- package/dist/component/views.js +413 -0
- package/dist/component/views.js.map +1 -0
- package/dist/component.d.ts +4 -5
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -5
- package/dist/component.js.map +1 -1
- package/dist/document/audio.d.ts +10 -2
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +45 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +15 -39
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +1 -1
- package/dist/document/command-traits.js +16 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +3 -3
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +3 -3
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +2 -0
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +2 -0
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -0
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +70 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +2 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/registry.d.ts +23 -11
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +46 -19
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +49 -0
- package/dist/document/settled-index.d.ts.map +1 -0
- package/dist/document/settled-index.js +247 -0
- package/dist/document/settled-index.js.map +1 -0
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +100 -19
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +290 -42
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +12 -12
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +2 -2
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +37 -31
- package/dist/document/validate.js.map +1 -1
- package/dist/document/withdraw.d.ts +28 -0
- package/dist/document/withdraw.d.ts.map +1 -0
- package/dist/document/withdraw.js +61 -0
- package/dist/document/withdraw.js.map +1 -0
- package/dist/experimental.d.ts +22 -0
- package/dist/experimental.d.ts.map +1 -0
- package/dist/experimental.js +20 -0
- package/dist/experimental.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +9 -1
- package/dist/jsx/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx/jsx-runtime.js +13 -3
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/nodes/2d/node-lifecycle.js.map +1 -1
- package/dist/nodes/2d/node-motion.js.map +1 -1
- package/dist/nodes/2d/node-render.d.ts +3 -3
- package/dist/nodes/2d/node-render.d.ts.map +1 -1
- package/dist/nodes/2d/node-render.js.map +1 -1
- package/dist/nodes/2d/node-transform.js.map +1 -1
- package/dist/nodes/2d/node2d.d.ts +115 -3
- package/dist/nodes/2d/node2d.d.ts.map +1 -1
- package/dist/nodes/2d/node2d.js +180 -28
- package/dist/nodes/2d/node2d.js.map +1 -1
- package/dist/nodes/2d/paint-node.d.ts +27 -0
- package/dist/nodes/2d/paint-node.d.ts.map +1 -1
- package/dist/nodes/2d/paint-node.js +42 -0
- package/dist/nodes/2d/paint-node.js.map +1 -1
- package/dist/nodes/audio/audio-bus.js.map +1 -1
- package/dist/nodes/audio/index.d.ts +2 -2
- package/dist/nodes/audio/index.d.ts.map +1 -1
- package/dist/nodes/audio/index.js +0 -2
- package/dist/nodes/audio/index.js.map +1 -1
- package/dist/nodes/audio/node-audio.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +4 -3
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +4 -1
- package/dist/nodes/audio/sound-node.js.map +1 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
- package/dist/nodes/geometry/bounds-shape-node.js +2 -2
- package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
- package/dist/nodes/geometry/box-path-node.d.ts +3 -3
- package/dist/nodes/geometry/box-path-node.js +2 -2
- package/dist/nodes/geometry/box-path-node.js.map +1 -1
- package/dist/nodes/geometry/ellipse-node.js.map +1 -1
- package/dist/nodes/geometry/group-bounds.d.ts +2 -2
- package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
- package/dist/nodes/geometry/group-bounds.js +1 -2
- package/dist/nodes/geometry/group-bounds.js.map +1 -1
- package/dist/nodes/geometry/path-node.d.ts.map +1 -1
- package/dist/nodes/geometry/path-node.js +6 -0
- package/dist/nodes/geometry/path-node.js.map +1 -1
- package/dist/nodes/geometry/polygon-node.js.map +1 -1
- package/dist/nodes/geometry/polygram-node.js.map +1 -1
- package/dist/nodes/geometry/rect-node.js.map +1 -1
- package/dist/nodes/geometry/shape-node.js.map +1 -1
- package/dist/nodes/geometry/shape-outline.d.ts +2 -2
- package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
- package/dist/nodes/geometry/shape-outline.js +2 -13
- package/dist/nodes/geometry/shape-outline.js.map +1 -1
- package/dist/nodes/index.d.ts +40 -33
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +17 -36
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/layout/camera-node.d.ts +9 -0
- package/dist/nodes/layout/camera-node.d.ts.map +1 -1
- package/dist/nodes/layout/camera-node.js +38 -3
- package/dist/nodes/layout/camera-node.js.map +1 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
- package/dist/nodes/layout/orbit-camera-node.js +1 -1
- package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
- package/dist/nodes/layout/rotated-box.js.map +1 -1
- package/dist/nodes/media/video-node.d.ts.map +1 -1
- package/dist/nodes/media/video-node.js +2 -0
- package/dist/nodes/media/video-node.js.map +1 -1
- package/dist/nodes/node/declare-paints.js.map +1 -1
- package/dist/nodes/node/node-editor-state.js.map +1 -1
- package/dist/nodes/node/node-reactive.js.map +1 -1
- package/dist/nodes/node/node-time.d.ts +3 -3
- package/dist/nodes/node/node-time.d.ts.map +1 -1
- package/dist/nodes/node/node-time.js +1 -1
- package/dist/nodes/node/node-time.js.map +1 -1
- package/dist/nodes/node/node-walk.js.map +1 -1
- package/dist/nodes/node/node.d.ts +12 -4
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +67 -27
- package/dist/nodes/node/node.js.map +1 -1
- package/dist/nodes/node/text-defaults.d.ts +10 -12
- package/dist/nodes/node/text-defaults.d.ts.map +1 -1
- package/dist/nodes/node/text-defaults.js +10 -12
- package/dist/nodes/node/text-defaults.js.map +1 -1
- package/dist/nodes/{scene → root}/canvas2d-node.d.ts +4 -3
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
- package/dist/nodes/{scene → root}/canvas2d-node.js +5 -2
- package/dist/nodes/root/canvas2d-node.js.map +1 -0
- package/dist/nodes/root/provider-node.d.ts.map +1 -0
- package/dist/nodes/root/provider-node.js.map +1 -0
- package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
- package/dist/nodes/root/theme-provider-node.js.map +1 -0
- package/dist/nodes/text/default-text-style-node.d.ts +5 -2
- package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
- package/dist/nodes/text/default-text-style-node.js +10 -4
- package/dist/nodes/text/default-text-style-node.js.map +1 -1
- package/dist/nodes/text/number-format.d.ts +1 -1
- package/dist/nodes/text/number-format.js +1 -1
- package/dist/nodes/text/number-format.js.map +1 -1
- package/dist/nodes/text/number-node.js.map +1 -1
- package/dist/nodes/text/number-pattern.js.map +1 -1
- package/dist/nodes/text/richtext-node.d.ts +0 -5
- package/dist/nodes/text/richtext-node.d.ts.map +1 -1
- package/dist/nodes/text/richtext-node.js +6 -72
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts +5 -22
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +13 -364
- package/dist/nodes/text/text-base.js.map +1 -1
- package/dist/nodes/text/text-layout.d.ts +87 -0
- package/dist/nodes/text/text-layout.d.ts.map +1 -0
- package/dist/nodes/text/text-layout.js +368 -0
- package/dist/nodes/text/text-layout.js.map +1 -0
- package/dist/nodes/text/text-node.js.map +1 -1
- package/dist/nodes/text/text-selection.js.map +1 -1
- package/dist/nodes/three/camera-nodes.d.ts +21 -3
- package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
- package/dist/nodes/three/camera-nodes.js +42 -1
- package/dist/nodes/three/camera-nodes.js.map +1 -1
- package/dist/nodes/three/canvas3d-node.d.ts +32 -7
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +50 -2
- package/dist/nodes/three/canvas3d-node.js.map +1 -1
- package/dist/nodes/three/drawable-nodes.d.ts +25 -11
- package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
- package/dist/nodes/three/drawable-nodes.js +43 -13
- package/dist/nodes/three/drawable-nodes.js.map +1 -1
- package/dist/nodes/three/environment-nodes.d.ts +9 -3
- package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
- package/dist/nodes/three/environment-nodes.js.map +1 -1
- package/dist/nodes/three/geometry-nodes.d.ts +2 -2
- package/dist/nodes/three/geometry-nodes.js +2 -2
- package/dist/nodes/three/geometry-nodes.js.map +1 -1
- package/dist/nodes/three/grid-geometry3d.js.map +1 -1
- package/dist/nodes/three/group3d.js.map +1 -1
- package/dist/nodes/three/light-nodes.d.ts.map +1 -1
- package/dist/nodes/three/light-nodes.js +3 -3
- package/dist/nodes/three/light-nodes.js.map +1 -1
- package/dist/nodes/three/mesh3d.js.map +1 -1
- package/dist/nodes/three/node3d.d.ts +48 -0
- package/dist/nodes/three/node3d.d.ts.map +1 -1
- package/dist/nodes/three/node3d.js +53 -3
- package/dist/nodes/three/node3d.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +2 -2
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/latex.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +2 -2
- package/dist/render/descriptors/text.js +2 -2
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +8 -4
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +18 -10
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -0
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +39 -6
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +9 -0
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +18 -1
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +27 -0
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +9 -4
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +27 -9
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +18 -0
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +97 -0
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +5 -0
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +2 -0
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +44 -3
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +124 -10
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +13 -5
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +10 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +31 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +63 -6
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +9 -7
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +12 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +1 -1
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +7 -3
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +50 -25
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +52 -42
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +2 -0
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +12 -0
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +14 -0
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +15 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +37 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/type.js.map +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/seekable.d.ts +1 -1
- package/dist/tween/seekable.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +7 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
- package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
- package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
- package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/provider-node.js +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
package/dist/assets/scope.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AssetCatalog } from "./catalog.js";
|
|
2
2
|
import type { LoaderFn } from "./record.js";
|
|
3
3
|
import type { FillResolved } from "../attributes/shape/fill/union.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { NodeEffect } from "../attributes/shape/effects/union.js";
|
|
5
5
|
import type { Node } from "../nodes/node/node.js";
|
|
6
6
|
/** Whether an asset has to be resident before layout measures, or only before a frame draws. */
|
|
7
7
|
export type AssetGate = "layout" | "render";
|
|
@@ -44,7 +44,7 @@ export interface AssetScope {
|
|
|
44
44
|
gate?: AssetGate;
|
|
45
45
|
}): void;
|
|
46
46
|
fill(fills: FillResolved | readonly FillResolved[]): void;
|
|
47
|
-
effects(effects: readonly
|
|
47
|
+
effects(effects: readonly NodeEffect[]): void;
|
|
48
48
|
/** A detached subtree this node draws (a `Tex.surface` node source), declared as part of this node. */
|
|
49
49
|
subtree(node: Node): void;
|
|
50
50
|
}
|
|
@@ -82,7 +82,7 @@ export declare class AssetDeclaration implements AssetScope {
|
|
|
82
82
|
gate?: AssetGate;
|
|
83
83
|
}): void;
|
|
84
84
|
fill(fills: FillResolved | readonly FillResolved[]): void;
|
|
85
|
-
effects(effects: readonly
|
|
85
|
+
effects(effects: readonly NodeEffect[]): void;
|
|
86
86
|
subtree(node: Node): void;
|
|
87
87
|
private readonly _options;
|
|
88
88
|
private readonly _decls;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/assets/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"scope.d.ts","s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CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,WAAW,CAAC,KAAqB,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO;QACX,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,KAAgC;YAAE,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,CAAC,OAA+B;QACnC,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,IAAU;QACd,IAAI,CAAC,SAAS,KAAK,IAAI,GAAG,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QACrC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;YAC5D,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAEgB,QAAQ,CAA0B;IAClC,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC/C,SAAS,CAAwB;CAC5C","sourcesContent":["import type { AssetCatalog } from \"./catalog\";\nimport type { LoaderFn } from \"./record\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { SceneEffect } from \"@/attributes/shape/effects/union\";\nimport type { Node } from \"@/nodes/node/node\";\nimport { declareFill } from \"@/attributes/shape/fill/registry\";\nimport { declareEffect } from \"@/attributes/shape/effects/registry\";\nimport { declareTree } from \"@/nodes/node/node-walk\";\n\n/** Whether an asset has to be resident before layout measures, or only before a frame draws. */\nexport type AssetGate = \"layout\" | \"render\";\n\nexport type AssetDecl =\n | { type: \"image\"; src: string }\n | { type: \"video\"; src: string; trimStart: number; trimEnd: number }\n | { type: \"font\"; family: string; weight: number }\n | { type: \"loader\"; key: string; load: LoaderFn; gate: AssetGate };\n\n/**\n * What a node's `declareAssets` states its needs into.\n *\n * A declaration must be a pure function of the props and context it reads — never\n * `layoutBounds`, never `time`, no writes — because the runtime re-runs it only\n * when something it read changes. Declarations dedupe by {@link assetKey}.\n */\nexport interface AssetScope {\n readonly catalog: AssetCatalog;\n image(src: string): void;\n video(src: string, trim?: { start?: number; end?: number }): void;\n /** Gates layout: text is measured against the face. */\n font(family: string, weight?: number | string): void;\n /** `gate` defaults to `\"render\"`; pass `\"layout\"` for a load measurement depends on. */\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void;\n fill(fills: FillResolved | readonly FillResolved[]): void;\n effects(effects: readonly SceneEffect[]): void;\n /** A detached subtree this node draws (a `Tex.surface` node source), declared as part of this node. */\n subtree(node: Node): void;\n}\n\n/**\n * Fonts key by family alone: `loadFont` registers every weight of a family at once\n * and a variable weight renders through `fontVariations`, so a weight in the key\n * would mint an entry per frame of a weight tween.\n */\nexport function assetKey(decl: AssetDecl): string {\n switch (decl.type) {\n case \"image\":\n case \"video\":\n return decl.src;\n case \"font\":\n return decl.family;\n case \"loader\":\n return decl.key;\n }\n}\n\n/** Anything unparseable lands on 400, which is what an unspecified weight means anyway. */\nexport function normalizeWeight(weight: number | string | undefined): number {\n if (typeof weight === \"number\") return Number.isFinite(weight) ? weight : 400;\n if (typeof weight === \"string\") return parseInt(weight, 10) || 400;\n return 400;\n}\n\nexport interface AssetDeclarationOptions {\n /** Binds a detached subtree (catalog, context, clock) before it declares. */\n bindSubtree?: (node: Node) => void;\n /** Replaces the default {@link declareTree} walk over a subtree. */\n onSubtree?: (node: Node, scope: AssetScope) => void;\n}\n\n/**\n * The {@link AssetScope} that collects: one declaration pass, keyed and validated.\n *\n * Unknown images and videos throw here, so a typo surfaces against the node that\n * declared it rather than as a picture that never paints.\n */\nexport class AssetDeclaration implements AssetScope {\n readonly catalog: AssetCatalog;\n\n constructor(catalog: AssetCatalog, options: AssetDeclarationOptions = {}) {\n this.catalog = catalog;\n this._options = options;\n }\n\n get declarations(): ReadonlyMap<string, AssetDecl> {\n return this._decls;\n }\n\n // An empty `src` is an unset media slot — it paints the checkerboard, not a\n // missing asset — so it declares nothing.\n image(src: string): void {\n if (!src || this._decls.has(src)) return;\n this.catalog.getImageMeta(src);\n this._decls.set(src, { type: \"image\", src });\n }\n\n video(src: string, trim?: { start?: number; end?: number }): void {\n if (!src || this._decls.has(src)) return;\n this.catalog.getVideoMeta(src);\n this._decls.set(src, {\n type: \"video\",\n src,\n trimStart: trim?.start ?? 0,\n trimEnd: trim?.end ?? this.catalog.getVideoDuration(src),\n });\n }\n\n font(family: string, weight?: number | string): void {\n if (!family || this._decls.has(family)) return;\n this._decls.set(family, { type: \"font\", family, weight: normalizeWeight(weight) });\n }\n\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void {\n const gate = options?.gate ?? \"render\";\n const existing = this._decls.get(key);\n if (existing === undefined) {\n this._decls.set(key, { type: \"loader\", key, load, gate });\n return;\n }\n if (existing.type !== \"loader\") return;\n if (existing.load !== load && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[assets] Loader \"${key}\" was declared with a different load function; the first is kept. ` +\n `Hoist the function so every declaration of the key hands over the same one.`,\n );\n }\n // Layout is the stricter gate, so it wins whichever declaration asked first.\n if (gate === \"layout\" && existing.gate !== \"layout\") {\n this._decls.set(key, { ...existing, gate });\n }\n }\n\n fill(fills: FillResolved | readonly FillResolved[]): void {\n if (!fills) return;\n if (!Array.isArray(fills)) {\n declareFill(fills as FillResolved, this);\n return;\n }\n for (const fill of fills as readonly FillResolved[]) declareFill(fill, this);\n }\n\n effects(effects: readonly SceneEffect[]): void {\n if (!effects) return;\n for (const effect of effects) declareEffect(effect, this);\n }\n\n subtree(node: Node): void {\n this._subtrees ??= new Set();\n if (this._subtrees.has(node)) return;\n this._subtrees.add(node);\n this._options.bindSubtree?.(node);\n if (this._options.onSubtree) this._options.onSubtree(node, this);\n else declareTree(node, this);\n }\n\n private readonly _options: AssetDeclarationOptions;\n private readonly _decls = new Map<string, AssetDecl>();\n private _subtrees: Set<Node> | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/assets/scope.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAgCrD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAe;IACpC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO;YACR,OAAO,IAAI,CAAC,GAAG,CAAC;QACpB,KAAK,MAAM;YACP,OAAO,IAAI,CAAC,MAAM,CAAC;QACvB,KAAK,QAAQ;YACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACxB,CAAC;AACL,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAAC,MAAmC;IAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAC9E,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;IACnE,OAAO,GAAG,CAAC;AACf,CAAC;AASD;;;;;GAKG;AACH,MAAM,OAAO,gBAAgB;IAChB,OAAO,CAAe;IAE/B,YAAY,OAAqB,EAAE,UAAmC,EAAE;QACpE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M,IAAI,OAAO;YAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,IAAU;QACd,IAAI,CAAC,SAAS,KAAK,IAAI,GAAG,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QACrC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;YAC5D,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACjC,CAAC;IAEgB,QAAQ,CAA0B;IAClC,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC/C,SAAS,CAAwB;CAC5C","sourcesContent":["import type { AssetCatalog } from \"./catalog\";\r\nimport type { LoaderFn } from \"./record\";\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport type { NodeEffect } from \"@/attributes/shape/effects/union\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { declareFill } from \"@/attributes/shape/fill/registry\";\r\nimport { declareEffect } from \"@/attributes/shape/effects/registry\";\r\nimport { declareTree } from \"@/nodes/node/node-walk\";\r\n\r\n/** Whether an asset has to be resident before layout measures, or only before a frame draws. */\r\nexport type AssetGate = \"layout\" | \"render\";\r\n\r\nexport type AssetDecl =\r\n | { type: \"image\"; src: string }\r\n | { type: \"video\"; src: string; trimStart: number; trimEnd: number }\r\n | { type: \"font\"; family: string; weight: number }\r\n | { type: \"loader\"; key: string; load: LoaderFn; gate: AssetGate };\r\n\r\n/**\r\n * What a node's `declareAssets` states its needs into.\r\n *\r\n * A declaration must be a pure function of the props and context it reads — never\r\n * `layoutBounds`, never `time`, no writes — because the runtime re-runs it only\r\n * when something it read changes. Declarations dedupe by {@link assetKey}.\r\n */\r\nexport interface AssetScope {\r\n readonly catalog: AssetCatalog;\r\n image(src: string): void;\r\n video(src: string, trim?: { start?: number; end?: number }): void;\r\n /** Gates layout: text is measured against the face. */\r\n font(family: string, weight?: number | string): void;\r\n /** `gate` defaults to `\"render\"`; pass `\"layout\"` for a load measurement depends on. */\r\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void;\r\n fill(fills: FillResolved | readonly FillResolved[]): void;\r\n effects(effects: readonly NodeEffect[]): void;\r\n /** A detached subtree this node draws (a `Tex.surface` node source), declared as part of this node. */\r\n subtree(node: Node): void;\r\n}\r\n\r\n/**\r\n * Fonts key by family alone: `loadFont` registers every weight of a family at once\r\n * and a variable weight renders through `fontVariations`, so a weight in the key\r\n * would mint an entry per frame of a weight tween.\r\n */\r\nexport function assetKey(decl: AssetDecl): string {\r\n switch (decl.type) {\r\n case \"image\":\r\n case \"video\":\r\n return decl.src;\r\n case \"font\":\r\n return decl.family;\r\n case \"loader\":\r\n return decl.key;\r\n }\r\n}\r\n\r\n/** Anything unparseable lands on 400, which is what an unspecified weight means anyway. */\r\nexport function normalizeWeight(weight: number | string | undefined): number {\r\n if (typeof weight === \"number\") return Number.isFinite(weight) ? weight : 400;\r\n if (typeof weight === \"string\") return parseInt(weight, 10) || 400;\r\n return 400;\r\n}\r\n\r\nexport interface AssetDeclarationOptions {\r\n /** Binds a detached subtree (catalog, context, clock) before it declares. */\r\n bindSubtree?: (node: Node) => void;\r\n /** Replaces the default {@link declareTree} walk over a subtree. */\r\n onSubtree?: (node: Node, scope: AssetScope) => void;\r\n}\r\n\r\n/**\r\n * The {@link AssetScope} that collects: one declaration pass, keyed and validated.\r\n *\r\n * Unknown images and videos throw here, so a typo surfaces against the node that\r\n * declared it rather than as a picture that never paints.\r\n */\r\nexport class AssetDeclaration implements AssetScope {\r\n readonly catalog: AssetCatalog;\r\n\r\n constructor(catalog: AssetCatalog, options: AssetDeclarationOptions = {}) {\r\n this.catalog = catalog;\r\n this._options = options;\r\n }\r\n\r\n get declarations(): ReadonlyMap<string, AssetDecl> {\r\n return this._decls;\r\n }\r\n\r\n // An empty `src` is an unset media slot — it paints the checkerboard, not a\r\n // missing asset — so it declares nothing.\r\n image(src: string): void {\r\n if (!src || this._decls.has(src)) return;\r\n this.catalog.getImageMeta(src);\r\n this._decls.set(src, { type: \"image\", src });\r\n }\r\n\r\n video(src: string, trim?: { start?: number; end?: number }): void {\r\n if (!src || this._decls.has(src)) return;\r\n this.catalog.getVideoMeta(src);\r\n this._decls.set(src, {\r\n type: \"video\",\r\n src,\r\n trimStart: trim?.start ?? 0,\r\n trimEnd: trim?.end ?? this.catalog.getVideoDuration(src),\r\n });\r\n }\r\n\r\n font(family: string, weight?: number | string): void {\r\n if (!family || this._decls.has(family)) return;\r\n this._decls.set(family, { type: \"font\", family, weight: normalizeWeight(weight) });\r\n }\r\n\r\n loader(key: string, load: LoaderFn, options?: { gate?: AssetGate }): void {\r\n const gate = options?.gate ?? \"render\";\r\n const existing = this._decls.get(key);\r\n if (existing === undefined) {\r\n this._decls.set(key, { type: \"loader\", key, load, gate });\r\n return;\r\n }\r\n if (existing.type !== \"loader\") return;\r\n if (existing.load !== load && process.env.NODE_ENV !== \"production\") {\r\n console.warn(\r\n `[assets] Loader \"${key}\" was declared with a different load function; the first is kept. ` +\r\n `Hoist the function so every declaration of the key hands over the same one.`,\r\n );\r\n }\r\n // Layout is the stricter gate, so it wins whichever declaration asked first.\r\n if (gate === \"layout\" && existing.gate !== \"layout\") {\r\n this._decls.set(key, { ...existing, gate });\r\n }\r\n }\r\n\r\n fill(fills: FillResolved | readonly FillResolved[]): void {\r\n if (!fills) return;\r\n if (!Array.isArray(fills)) {\r\n declareFill(fills as FillResolved, this);\r\n return;\r\n }\r\n for (const fill of fills as readonly FillResolved[]) declareFill(fill, this);\r\n }\r\n\r\n effects(effects: readonly NodeEffect[]): void {\r\n if (!effects) return;\r\n for (const effect of effects) declareEffect(effect, this);\r\n }\r\n\r\n subtree(node: Node): void {\r\n this._subtrees ??= new Set();\r\n if (this._subtrees.has(node)) return;\r\n this._subtrees.add(node);\r\n this._options.bindSubtree?.(node);\r\n if (this._options.onSubtree) this._options.onSubtree(node, this);\r\n else declareTree(node, this);\r\n }\r\n\r\n private readonly _options: AssetDeclarationOptions;\r\n private readonly _decls = new Map<string, AssetDecl>();\r\n private _subtrees: Set<Node> | undefined;\r\n}\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AudioFilterItem } from "./union.js";
|
|
2
2
|
import { Param } from "./curve.js";
|
|
3
3
|
/**
|
|
4
|
-
* Audio filters follow the same one-argument rule as
|
|
4
|
+
* Audio filters follow the same one-argument rule as node effects and media
|
|
5
5
|
* filters: every builder takes a single options object, and those with one
|
|
6
6
|
* dominant param also accept that param directly.
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAAE,MAAM,SAAS,CAAC;AAyDzC;;;;;;GAMG;AACH,SAAS,WAAW,CAAmB,GAAc,EAAE,GAAY;IAC/D,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,GAAY,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,EAAQ,CAAC,CAAC,CAAE,GAAS,CAAC;AACjG,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,gBAAgB;IACR;IAAnB,YAAmB,OAA0B,EAAE;QAA5B,SAAI,GAAJ,IAAI,CAAwB;IAAI,CAAC;IAE5C,MAAM,CAAC,MAAuB;QACpC,OAAO,IAAI,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,qCAAqC;IACrC,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AI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,gFAAgF;IAChF,IAAI,CAAC,OAAkC;QACrC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,6EAA6E;IAC7E,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QAChB,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,6FAA6F;IAC7F,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AASD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgC;IAClE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACrC,IAAI,OAAO,YAAY,gBAAgB;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC","sourcesContent":["import { AudioFilterItem } from \"./union\";\nimport { Param, isCurve } from \"./curve\";\n\n/**\n * Audio filters follow the same one-argument rule as
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,OAAO,EAAE,MAAM,SAAS,CAAC;AAyDzC;;;;;;GAMG;AACH,SAAS,WAAW,CAAmB,GAAc,EAAE,GAAY;IAC/D,OAA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OAAO,CAAC,IAAI,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC","sourcesContent":["import { AudioFilterItem } from \"./union\";\r\nimport { Param, isCurve } from \"./curve\";\r\n\r\n/**\r\n * Audio filters follow the same one-argument rule as node effects and media\r\n * filters: every builder takes a single options object, and those with one\r\n * dominant param also accept that param directly.\r\n *\r\n * The shorthand admits a whole {@link Param} — a constant `number` *or* a\r\n * {@link Curve} — so `AudioFilters.volume(fadeIn(0.5))` still works.\r\n */\r\n\r\n/** Gain / volume. Param shorthand sets `value`. */\r\nexport interface GainFilterOptions {\r\n /** 1 = unchanged, 0 = silent, >1 = louder. */\r\n value: Param;\r\n}\r\n\r\n/** High-pass filter. Param shorthand sets `frequency`. */\r\nexport interface HighPassFilterOptions {\r\n /** Rolls off content below this frequency, in Hz. */\r\n frequency: Param;\r\n /** Resonance at the cutoff (default 1). */\r\n q?: Param;\r\n}\r\n\r\n/** Low-pass filter. Param shorthand sets `frequency`. */\r\nexport interface LowPassFilterOptions {\r\n /** Rolls off content above this frequency, in Hz. */\r\n frequency: Param;\r\n /** Resonance at the cutoff (default 1). */\r\n q?: Param;\r\n}\r\n\r\n/** Amplitude wobble. Param shorthand sets `rate`. */\r\nexport interface TremoloFilterOptions {\r\n /** Wobble rate in Hz. */\r\n rate: Param;\r\n /** Modulation depth, 0–1 (default 0.5). */\r\n depth?: Param;\r\n}\r\n\r\n/** Playback-rate change (alters pitch). Param shorthand sets `value`. */\r\nexport interface SpeedFilterOptions {\r\n /** Playback-rate multiplier. */\r\n value: Param;\r\n}\r\n\r\n/** Delay line with feedback. Param shorthand sets `delay`. */\r\nexport interface EchoFilterOptions {\r\n /** Delay time in seconds. */\r\n delay: Param;\r\n /** Feedback amount, 0–<1 (default 0.4). */\r\n feedback?: Param;\r\n /** Wet mix, 0–1 (default 0.5). */\r\n mix?: Param;\r\n}\r\n\r\n/**\r\n * Normalise a `Param | Options` argument onto its dominant field.\r\n *\r\n * A {@link Curve} is an object, so the discriminator can't be a bare\r\n * `typeof === 'number'` — it must ask {@link isCurve} too, or an animated\r\n * shorthand would be mistaken for an options bag.\r\n */\r\nfunction scalarParam<O extends object>(arg: Param | O, key: keyof O): O {\r\n return typeof arg === \"number\" || isCurve(arg as Param) ? ({ [key]: arg } as O) : (arg as O);\r\n}\r\n\r\n/**\r\n * Immutable, chainable list of audio filters.\r\n *\r\n * Each builder method returns a new `AudioFilterChain` with the filter appended,\r\n * so chains are safe to share and branch. Filters apply in array order\r\n * (index 0 is closest to the source).\r\n *\r\n * Every numeric param accepts either a constant `number` or a time-varying\r\n * {@link Param} curve (see `ramp`/`fadeIn`/`fadeOut`), so any filter can animate:\r\n *\r\n * @example\r\n * const chain = AudioFilters.gain(1.5).lowpass(800).echo(0.3);\r\n * this.playSound('song.mp3', { filters: chain }); // assign directly\r\n * this.playSound('song.mp3', { filters: AudioFilters.volume(fadeIn(0.5).fadeOut(1)) }); // animated\r\n */\r\nexport class AudioFilterChain {\r\n constructor(public list: AudioFilterItem[] = []) { }\r\n\r\n private append(filter: AudioFilterItem): AudioFilterChain {\r\n return new AudioFilterChain([...this.list, filter]);\r\n }\r\n\r\n /** Append a gain (volume) filter. */\r\n gain(options: Param | GainFilterOptions) {\r\n const { value } = scalarParam(options, \"value\");\r\n return this.append({ type: 'gain', value });\r\n }\r\n\r\n /** Alias for {@link gain}; reads naturally for volume automation (`volume(fadeIn(0.5))`). */\r\n volume(options: Param | GainFilterOptions) {\r\n return this.gain(options);\r\n }\r\n\r\n /** Append a high-pass filter; rolls off content below `frequency` Hz. */\r\n highpass(options: Param | HighPassFilterOptions) {\r\n const { frequency, q } = scalarParam(options, \"frequency\");\r\n return this.append({ type: 'highpass', frequency, q });\r\n }\r\n\r\n /** Append a low-pass filter; rolls off content above `frequency` Hz. */\r\n lowpass(options: Param | LowPassFilterOptions) {\r\n const { frequency, q } = scalarParam(options, \"frequency\");\r\n return this.append({ type: 'lowpass', frequency, q });\r\n }\r\n\r\n /** Append a tremolo; `rate` Hz wobble at `depth` (0–1) modulation depth. */\r\n tremolo(options: Param | TremoloFilterOptions) {\r\n const { rate, depth } = scalarParam(options, \"rate\");\r\n return this.append({ type: 'tremolo', rate, depth: depth ?? 0.5 });\r\n }\r\n\r\n /** Append a speed change; the playback-rate multiplier (alters pitch). */\r\n speed(options: Param | SpeedFilterOptions) {\r\n const { value } = scalarParam(options, \"value\");\r\n return this.append({ type: 'speed', value });\r\n }\r\n\r\n /** Append an echo; `delay` seconds, `feedback` 0–<1, optional wet `mix` 0–1. */\r\n echo(options: Param | EchoFilterOptions) {\r\n const { delay, feedback, mix } = scalarParam(options, \"delay\");\r\n return this.append({ type: 'echo', delay, feedback: feedback ?? 0.4, mix });\r\n }\r\n\r\n /** Allows spreading the chain into an array: `[...AudioFilters.gain(2)]`. */\r\n *[Symbol.iterator]() {\r\n yield* this.list;\r\n }\r\n\r\n /** Serializes to the raw filter array so frameworks that call `toJSON` get a plain value. */\r\n toJSON() {\r\n return this.list;\r\n }\r\n}\r\n\r\n/**\r\n * Accepted shapes for a sound's `filters` prop — the loose, author-facing type.\r\n * Can be a single filter, a plain array, or an `AudioFilterChain` builder result.\r\n * Mirrors how `ImageFilter` is the author-facing union in the shape filter system.\r\n */\r\nexport type AudioFilter = AudioFilterItem[] | AudioFilterChain | AudioFilterItem;\r\n\r\n/**\r\n * Entry point for building audio-filter chains fluently.\r\n *\r\n * An empty {@link AudioFilterChain}, so `AudioFilters.gain(1.5)` *is*\r\n * `new AudioFilterChain().gain(1.5)` — every builder's signature and\r\n * documentation has one definition, on the class, which is what an editor shows\r\n * when you hover `AudioFilters.gain`. The chain is immutable, so sharing one\r\n * empty instance as the entry point is safe.\r\n *\r\n * @example\r\n * this.playSound('song.mp3', { filters: AudioFilters.gain(1.5).lowpass(800) });\r\n */\r\nexport const AudioFilters = new AudioFilterChain();\r\n\r\n/**\r\n * Normalises any `AudioFilter` value to a plain `AudioFilterItem[]`.\r\n * Used internally when reading props before scheduling or interpolation.\r\n */\r\nexport function resolveAudioFilters(filters: AudioFilter | undefined): AudioFilterItem[] {\r\n if (filters === undefined) return [];\r\n if (filters instanceof AudioFilterChain) return filters.list;\r\n if (Array.isArray(filters)) return filters;\r\n return [filters];\r\n}\r\n"]}
|
|
@@ -5,7 +5,7 @@ import type { AttributeOps } from "../../../attributes/shared/operators.js";
|
|
|
5
5
|
*
|
|
6
6
|
* A {@link Curve} is a portable, immutable list of {@link CurveSegment}s described
|
|
7
7
|
* in **relative** time (seconds from the clip's start, with the final segment
|
|
8
|
-
* anchored to the clip's end). It references no absolute
|
|
8
|
+
* anchored to the clip's end). It references no absolute clip time and no
|
|
9
9
|
* external signal, so the same curve can be applied to any clip of any length:
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
@@ -128,25 +128,25 @@ export declare const audioParamOps: AttributeOps<Param, Param>;
|
|
|
128
128
|
/** Param equality: numeric compare, or reference identity for curves. */
|
|
129
129
|
export declare function equalsParam(a: Param | undefined, b: Param | undefined): boolean;
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* Clip-time duration consumed by playing the source under a (possibly time-varying)
|
|
132
132
|
* speed curve: `∫₀^upper 1/speed(τ) dτ`.
|
|
133
133
|
*
|
|
134
134
|
* The speed curve is authored over the **full** `sourceLength` (its segment times
|
|
135
135
|
* are seconds from the clip's source start), so it is always resolved against
|
|
136
136
|
* `sourceLength`; `upper` is just the integration bound (defaults to the whole
|
|
137
|
-
* source). A slower instant (speed < 1) consumes *more*
|
|
137
|
+
* source). A slower instant (speed < 1) consumes *more* clip time. Sampled at
|
|
138
138
|
* {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a
|
|
139
139
|
* zero/negative speed can't blow up the integral.
|
|
140
140
|
*
|
|
141
|
-
* Use this in BOTH the core
|
|
141
|
+
* Use this in BOTH the core clip-duration math and the cross-scene end resolution
|
|
142
142
|
* so the timeline reserves exactly the span the renderer plays.
|
|
143
143
|
*/
|
|
144
|
-
export declare function
|
|
144
|
+
export declare function integrateSpeedToClipTime(speed: Curve, sourceLength: number, upper?: number, step?: number): number;
|
|
145
145
|
/**
|
|
146
|
-
* Inverse of {@link
|
|
147
|
-
* after `
|
|
146
|
+
* Inverse of {@link integrateSpeedToClipTime}: the source-time offset reached
|
|
147
|
+
* after `clipElapsed` seconds of clip time under the speed curve. This is what a
|
|
148
148
|
* mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.
|
|
149
149
|
* The curve is always resolved against the full `sourceLength`.
|
|
150
150
|
*/
|
|
151
|
-
export declare function
|
|
151
|
+
export declare function sourceTimeAtClipElapsed(speed: Curve, sourceLength: number, clipElapsed: number, step?: number): number;
|
|
152
152
|
//# sourceMappingURL=curve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAIlE;;;;;;;;;;;;;;GAcG;AAEH,oDAAoD;AACpD,MAAM,WAAW,YAAY;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,IAAI,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC5B,8CAA8C;IAC9C,SAAS,EAAE,MAAM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,EACpB,KAAK,GAAE,MAAqB,EAC5B,IAAI,SAAmB,GACxB,MAAM,CAUR;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,IAAI,SAAmB,GACxB,MAAM,CAiBR"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { linear } from "../../../tween/ease/constants.js";
|
|
2
|
+
import { easeKey } from "../../../tween/ease/describe.js";
|
|
2
3
|
import { lerpNumber } from "../../../tween/lerp.js";
|
|
3
4
|
const DEFAULT_EASE = linear();
|
|
4
5
|
/** Portable, immutable, fluent automation curve for one numeric param. */
|
|
@@ -57,10 +58,10 @@ export class Curve {
|
|
|
57
58
|
explicit += Math.max(0, s.duration);
|
|
58
59
|
}
|
|
59
60
|
if (autoFillCount > 1 && process.env.NODE_ENV !== "production") {
|
|
60
|
-
console.warn(`[
|
|
61
|
+
console.warn(`[motionscript] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`);
|
|
61
62
|
}
|
|
62
63
|
if (explicit > clip && process.env.NODE_ENV !== "production") {
|
|
63
|
-
console.warn(`[
|
|
64
|
+
console.warn(`[motionscript] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`);
|
|
64
65
|
}
|
|
65
66
|
const slack = Math.max(0, clip - explicit);
|
|
66
67
|
// Where does the slack go so the LAST segment always lands on the clip end?
|
|
@@ -164,7 +165,7 @@ export function paramKey(p) {
|
|
|
164
165
|
return "_";
|
|
165
166
|
if (!isCurve(p))
|
|
166
167
|
return String(p);
|
|
167
|
-
return "c[" + p.segments.map((s) => `${s.from ?? "_"},${s.to ?? "_"},${s.duration ?? "_"},${s.ease
|
|
168
|
+
return "c[" + p.segments.map((s) => `${s.from ?? "_"},${s.to ?? "_"},${s.duration ?? "_"},${s.ease ? easeKey(s.ease) : "lin"}`).join(";") + "]";
|
|
168
169
|
}
|
|
169
170
|
/**
|
|
170
171
|
* Interpolate between two params at progress `t`. Two numbers lerp; if either is
|
|
@@ -196,52 +197,52 @@ export function equalsParam(a, b) {
|
|
|
196
197
|
/** Default sampling step (seconds) for numeric speed integration. */
|
|
197
198
|
const INTEGRATION_STEP = 0.001;
|
|
198
199
|
/**
|
|
199
|
-
*
|
|
200
|
+
* Clip-time duration consumed by playing the source under a (possibly time-varying)
|
|
200
201
|
* speed curve: `∫₀^upper 1/speed(τ) dτ`.
|
|
201
202
|
*
|
|
202
203
|
* The speed curve is authored over the **full** `sourceLength` (its segment times
|
|
203
204
|
* are seconds from the clip's source start), so it is always resolved against
|
|
204
205
|
* `sourceLength`; `upper` is just the integration bound (defaults to the whole
|
|
205
|
-
* source). A slower instant (speed < 1) consumes *more*
|
|
206
|
+
* source). A slower instant (speed < 1) consumes *more* clip time. Sampled at
|
|
206
207
|
* {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a
|
|
207
208
|
* zero/negative speed can't blow up the integral.
|
|
208
209
|
*
|
|
209
|
-
* Use this in BOTH the core
|
|
210
|
+
* Use this in BOTH the core clip-duration math and the cross-scene end resolution
|
|
210
211
|
* so the timeline reserves exactly the span the renderer plays.
|
|
211
212
|
*/
|
|
212
|
-
export function
|
|
213
|
+
export function integrateSpeedToClipTime(speed, sourceLength, upper = sourceLength, step = INTEGRATION_STEP) {
|
|
213
214
|
const end = Math.min(upper, sourceLength);
|
|
214
215
|
if (end <= 0)
|
|
215
216
|
return 0;
|
|
216
|
-
let
|
|
217
|
+
let clipTime = 0;
|
|
217
218
|
for (let tau = 0; tau < end; tau += step) {
|
|
218
219
|
const dt = Math.min(step, end - tau);
|
|
219
220
|
const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));
|
|
220
|
-
|
|
221
|
+
clipTime += dt / v;
|
|
221
222
|
}
|
|
222
|
-
return
|
|
223
|
+
return clipTime;
|
|
223
224
|
}
|
|
224
225
|
/**
|
|
225
|
-
* Inverse of {@link
|
|
226
|
-
* after `
|
|
226
|
+
* Inverse of {@link integrateSpeedToClipTime}: the source-time offset reached
|
|
227
|
+
* after `clipElapsed` seconds of clip time under the speed curve. This is what a
|
|
227
228
|
* mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.
|
|
228
229
|
* The curve is always resolved against the full `sourceLength`.
|
|
229
230
|
*/
|
|
230
|
-
export function
|
|
231
|
-
if (
|
|
231
|
+
export function sourceTimeAtClipElapsed(speed, sourceLength, clipElapsed, step = INTEGRATION_STEP) {
|
|
232
|
+
if (clipElapsed <= 0)
|
|
232
233
|
return 0;
|
|
233
|
-
let
|
|
234
|
+
let played = 0;
|
|
234
235
|
let tau = 0;
|
|
235
236
|
while (tau < sourceLength) {
|
|
236
237
|
const dt = Math.min(step, sourceLength - tau);
|
|
237
238
|
const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
239
|
+
const clipStep = dt / v;
|
|
240
|
+
if (played + clipStep >= clipElapsed) {
|
|
240
241
|
// Linear interpolation within this step for sub-step accuracy.
|
|
241
|
-
const frac =
|
|
242
|
+
const frac = clipStep > 0 ? (clipElapsed - played) / clipStep : 0;
|
|
242
243
|
return tau + dt * frac;
|
|
243
244
|
}
|
|
244
|
-
|
|
245
|
+
played += clipStep;
|
|
245
246
|
tau += dt;
|
|
246
247
|
}
|
|
247
248
|
return sourceLength;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC;AAkD9B,0EAA0E;AAC1E,MAAM,OAAO,KAAK;IACc;IAA5B,YAA4B,WAAoC,EAAE;QAAtC,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,YAAY,GAAG,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QACxE,MAAM,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;QACzB,IAAI,KAAK,GAAG,SAAS,IAAI,YAAY,EAAE,CAAC;YACpC,+DAA+D;YAC/D,MAAM,IAAI,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACpE,OAAO,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,KAAK,IAAI,SAAS,CAAC;QACnB,GAAG,IAAI,EAAE,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC","sourcesContent":["import { EasingFunction } from \"@/tween/ease/type\";\nimport { linear } from \"@/tween/ease/constants\";\nimport { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\nconst DEFAULT_EASE = linear();\n\n/**\n * Time-varying automation for a single numeric filter param.\n *\n * A {@link Curve} is a portable, immutable list of {@link CurveSegment}s described\n * in **relative** time (seconds from the clip's start, with the final segment\n * anchored to the clip's end). It references no absolute scene time and no\n * external signal, so the same curve can be applied to any clip of any length:\n *\n * @example\n * const swell = ramp(0, 1, 0.5).hold().ramp(1, 0, 1); // up | auto-hold | down\n * AudioFilters.volume(swell).speed(swell); // reusable across params and clips\n *\n * Segments chain fluently (`ramp().hold().ramp()`) — that *is* sequencing; there\n * is intentionally no `seq`/`par`. Parallelism is just multiple filters in a chain.\n */\n\n/** A single automation segment in relative time. */\nexport interface CurveSegment {\n /**\n * Start value. `undefined` means \"continue from the previous segment's end\"\n * (or, for the first segment, the param's natural/current value — see\n * {@link fadeIn}, which leaves `from` resolved to 0 explicitly).\n */\n from?: number;\n /** End value. `undefined` for a hold (stays at the resolved `from`). */\n to?: number;\n /**\n * Length in **seconds**. `undefined` only for a bare {@link hold} that\n * auto-fills the remaining middle of the clip.\n */\n duration?: number;\n /** Segment easing; defaults to {@link linear}. */\n ease?: EasingFunction;\n}\n\n/** A segment resolved against a concrete clip duration: absolute relative-time keyframe pair. */\nexport interface ResolvedSegment {\n /** Segment start, seconds from clip start. */\n startTime: number;\n /** Segment end, seconds from clip start. */\n endTime: number;\n from: number;\n to: number;\n ease: EasingFunction;\n /** True when `ease` is the identity {@link linear} — lets the renderer use a cheap `linearRamp`. */\n isLinear: boolean;\n}\n\n/** Portable, immutable, fluent automation curve for one numeric param. */\nexport class Curve {\n constructor(public readonly segments: readonly CurveSegment[] = []) { }\n\n /** Append a ramp from `from` to `to` over `duration` seconds. */\n ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve([...this.segments, { from, to, duration, ease: opts?.ease }]);\n }\n\n /**\n * Append a hold. With `duration` it sustains for that many seconds; bare\n * `hold()` stretches to fill whatever time is left in the middle of the clip\n * (only one auto-fill hold is allowed per curve).\n */\n hold(duration?: number): Curve {\n return new Curve([...this.segments, { duration }]);\n }\n\n /** Append a fade from 0 up over `duration` seconds, anchored at the clip start. */\n fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve([...this.segments, { from: 0, to: 1, duration, ease: opts?.ease }]);\n }\n\n /** Append a fade down to 0 over `duration` seconds, anchored to the clip end. */\n fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve([...this.segments, { to: 0, duration, ease: opts?.ease }]);\n }\n\n /**\n * Resolve relative segments into absolute (clip-relative) keyframes once the\n * clip's duration is known.\n *\n * - Explicit segment durations are summed; a single bare `hold()` absorbs the\n * leftover `clipDuration - sumOfExplicit` so fade-in/hold/fade-out auto-sizes.\n * - The final segment's end lands exactly at `clipDuration` (end-anchor), which\n * is what makes `fadeOut` \"the last N seconds\" without naming an anchor.\n * - If explicit durations exceed `clipDuration`, the schedule is clamped to the\n * clip (later segments may be squeezed to zero) and a dev warning is logged.\n *\n * @param defaultValue value used for an unresolved first `from` (the param's natural value).\n */\n resolve(clipDuration: number, defaultValue: number): ResolvedSegment[] {\n const segs = this.segments;\n if (segs.length === 0) return [];\n\n // Guard a non-finite/negative clip length so a degenerate duration can never\n // propagate NaN/Infinity into resolved keyframes (and then into AudioParams).\n const clip = Number.isFinite(clipDuration) && clipDuration > 0 ? clipDuration : 0;\n\n // Sum explicit durations; find a single auto-fill hold (duration undefined).\n let explicit = 0;\n let autoFillCount = 0;\n for (const s of segs) {\n if (s.duration === undefined) autoFillCount++;\n else explicit += Math.max(0, s.duration);\n }\n if (autoFillCount > 1 && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[motion-script] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`,\n );\n }\n if (explicit > clip && process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[motion-script] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`,\n );\n }\n\n const slack = Math.max(0, clip - explicit);\n\n // Where does the slack go so the LAST segment always lands on the clip end?\n // - An explicit auto-fill hold() owns it (its index absorbs `slack`).\n // - Otherwise insert it implicitly just before the final segment, so a\n // trailing fadeOut/ramp is end-anchored (\"the last N seconds\") without the\n // author having to type hold(). With no slack, nothing is inserted.\n const autoFillIndex = autoFillCount > 0\n ? segs.findIndex((s) => s.duration === undefined)\n : (slack > 0 ? segs.length - 1 : -1);\n\n const out: ResolvedSegment[] = [];\n let cursor = 0;\n let prevValue = defaultValue;\n\n for (let i = 0; i < segs.length; i++) {\n const s = segs[i];\n\n // Insert the implicit end-anchoring gap before the final segment.\n if (autoFillCount === 0 && i === autoFillIndex && slack > 0) {\n const gapStart = Math.min(cursor, clip);\n const gapEnd = Math.min(cursor + slack, clip);\n out.push({ startTime: gapStart, endTime: gapEnd, from: prevValue, to: prevValue, ease: DEFAULT_EASE, isLinear: true });\n cursor += slack;\n }\n\n let dur: number;\n if (s.duration === undefined) {\n // Only the first auto-fill hold absorbs slack; any extras are zero.\n dur = i === autoFillIndex ? slack : 0;\n } else {\n dur = Math.max(0, s.duration);\n }\n\n const from = s.from ?? prevValue;\n // `to === undefined` is a hold: stay at `from`.\n const to = s.to ?? from;\n\n const startTime = Math.min(cursor, clip);\n const endTime = Math.min(cursor + dur, clip);\n const ease = s.ease ?? DEFAULT_EASE;\n out.push({ startTime, endTime, from, to, ease, isLinear: ease === DEFAULT_EASE });\n\n cursor += dur;\n prevValue = to;\n }\n\n return out;\n }\n\n /** Sample the curve's value at relative time `t` seconds (for a known clip duration). */\n sampleAt(t: number, clipDuration: number, defaultValue: number): number {\n const resolved = this.resolve(clipDuration, defaultValue);\n if (resolved.length === 0) return defaultValue;\n if (t <= resolved[0].startTime) return resolved[0].from;\n for (const seg of resolved) {\n if (t >= seg.startTime && t <= seg.endTime) {\n const span = seg.endTime - seg.startTime;\n const local = span > 0 ? (t - seg.startTime) / span : 1;\n return lerpNumber(seg.from, seg.to, seg.ease(local));\n }\n }\n return resolved[resolved.length - 1].to;\n }\n\n /** The curve's value at t=0 — its constant fallback for static contexts. */\n staticValue(defaultValue: number): number {\n const first = this.segments[0];\n return first?.from ?? defaultValue;\n }\n}\n\n// ─── Free-function constructors (each returns a one-segment Curve, so they chain) ─\n\n/** A ramp from `from` to `to` over `duration` seconds. */\nexport function ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve().ramp(from, to, duration, opts);\n}\n\n/** A hold; bare `hold()` auto-fills the middle of the clip. */\nexport function hold(duration?: number): Curve {\n return new Curve().hold(duration);\n}\n\n/** A fade from 0 up over `duration` seconds, anchored at the clip start. */\nexport function fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve().fadeIn(duration, opts);\n}\n\n/** A fade down to 0 over `duration` seconds, anchored to the clip end. */\nexport function fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\n return new Curve().fadeOut(duration, opts);\n}\n\n// ─── Param type & helpers ──────────────────────────────────────────────────────\n\n/** A filter param: a constant number, or a time-varying {@link Curve}. */\nexport type Param = number | Curve;\n\n/** Type guard: is this param a time-varying curve? */\nexport function isCurve(p: Param | undefined): p is Curve {\n return p instanceof Curve;\n}\n\n/**\n * The constant value of a param for static contexts (the number itself, or a\n * curve's t=0 value). Used wherever a single representative number is needed\n * (e.g. timeline math, equality fast paths).\n */\nexport function staticValue(p: Param, fallback = 0): number {\n return isCurve(p) ? p.staticValue(fallback) : p;\n}\n\n/**\n * Deterministic string key for a param, including a curve's full segment shape.\n * Used to detect when a filter param actually changed (so playback re-schedules\n * the source) — two curves with identical segments produce the same key.\n */\nexport function paramKey(p: Param | undefined): string {\n if (p === undefined) return \"_\";\n if (!isCurve(p)) return String(p);\n return \"c[\" + p.segments.map((s) =>\n `${s.from ?? \"_\"},${s.to ?? \"_\"},${s.duration ?? \"_\"},${s.ease?.name ?? \"lin\"}`,\n ).join(\";\") + \"]\";\n}\n\n/**\n * Interpolate between two params at progress `t`. Two numbers lerp; if either is\n * a curve, hard-cut at t=0.5 (curve↔curve interpolation is out of scope — this\n * only affects crossfades between two *different* filter chains, which is rare).\n */\nexport function lerpParam(from: Param, to: Param, t: number): Param {\n if (typeof from === \"number\" && typeof to === \"number\") return lerpNumber(from, to, t);\n return t < 0.5 ? from : to;\n}\n\n/** The audio-param attribute's op set: resolve is the identity, lerp hard-cuts\n * between curves (numbers lerp) — see {@link lerpParam}. */\nexport const audioParamOps: AttributeOps<Param, Param> = {\n resolve: (value) => value,\n lerp: lerpParam,\n};\n\n/** Param equality: numeric compare, or reference identity for curves. */\nexport function equalsParam(a: Param | undefined, b: Param | undefined): boolean {\n if (a === b) return true;\n if (typeof a === \"number\" && typeof b === \"number\") return a === b;\n // Curves: reference identity (portable curves are shared values, not rebuilt\n // per-frame). Structural equality is unnecessary for the equals() fast path.\n return false;\n}\n\n// ─── Speed integration (shared by core timeline math and the renderer) ──────────\n\n/** Default sampling step (seconds) for numeric speed integration. */\nconst INTEGRATION_STEP = 0.001;\n\n/**\n * Scene-time duration consumed by playing the source under a (possibly time-varying)\n * speed curve: `∫₀^upper 1/speed(τ) dτ`.\n *\n * The speed curve is authored over the **full** `sourceLength` (its segment times\n * are seconds from the clip's source start), so it is always resolved against\n * `sourceLength`; `upper` is just the integration bound (defaults to the whole\n * source). A slower instant (speed < 1) consumes *more* scene time. Sampled at\n * {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a\n * zero/negative speed can't blow up the integral.\n *\n * Use this in BOTH the core scene-duration math and the cross-scene end resolution\n * so the timeline reserves exactly the span the renderer plays.\n */\nexport function integrateSpeedToSceneTime(\n speed: Curve,\n sourceLength: number,\n upper: number = sourceLength,\n step = INTEGRATION_STEP,\n): number {\n const end = Math.min(upper, sourceLength);\n if (end <= 0) return 0;\n let sceneTime = 0;\n for (let tau = 0; tau < end; tau += step) {\n const dt = Math.min(step, end - tau);\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\n sceneTime += dt / v;\n }\n return sceneTime;\n}\n\n/**\n * Inverse of {@link integrateSpeedToSceneTime}: the source-time offset reached\n * after `sceneElapsed` seconds of scene time under the speed curve. This is what a\n * mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.\n * The curve is always resolved against the full `sourceLength`.\n */\nexport function sourceTimeAtSceneElapsed(\n speed: Curve,\n sourceLength: number,\n sceneElapsed: number,\n step = INTEGRATION_STEP,\n): number {\n if (sceneElapsed <= 0) return 0;\n let scene = 0;\n let tau = 0;\n while (tau < sourceLength) {\n const dt = Math.min(step, sourceLength - tau);\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\n const sceneStep = dt / v;\n if (scene + sceneStep >= sceneElapsed) {\n // Linear interpolation within this step for sub-step accuracy.\n const frac = sceneStep > 0 ? (sceneElapsed - scene) / sceneStep : 0;\n return tau + dt * frac;\n }\n scene += sceneStep;\n tau += dt;\n }\n return sourceLength;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC;AAkD9B,0EAA0E;AAC1E,MAAM,OAAO,KAAK;IACc;IAA5B,YAA4B,WAAoC,EAAE;QAAtC,aAAQ,GAAR,QAAQ,CAA8B;IAAI,CAAC;IAEvE,iEAAiE;IACjE,IAAI,CAAC,IAAY,EAAE,EAAU,EAAE,QAAgB,EAAE,IAAgC;QAC7E,OAAO,IAAI,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,QAAiB;QAClB,OAAO,IAAI,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,mFAAmF;IACnF,MAAM,CAAC,QAAgB,EAAE,IAAgC;QACrD,OAAO,IAAI,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,iFAAiF;IACjF,OAAO,CAAC,QAAgB,EAAE,IAAgC;QACtD,OAAO,IAAI,KAAK,CAAC,CAAC,G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,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QACxE,QAAQ,IAAI,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACnC,KAAY,EACZ,YAAoB,EACpB,WAAmB,EACnB,IAAI,GAAG,gBAAgB;IAEvB,IAAI,WAAW,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,GAAG,GAAG,YAAY,EAAE,CAAC;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,EAAE,GAAG,CAAC,CAAC;QACxB,IAAI,MAAM,GAAG,QAAQ,IAAI,WAAW,EAAE,CAAC;YACnC,+DAA+D;YAC/D,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,OAAO,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,MAAM,IAAI,QAAQ,CAAC;QACnB,GAAG,IAAI,EAAE,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC;AACxB,CAAC","sourcesContent":["import { EasingFunction } from \"@/tween/ease/type\";\r\nimport { linear } from \"@/tween/ease/constants\";\r\nimport { easeKey } from \"@/tween/ease/describe\";\r\nimport { lerpNumber } from \"@/tween/lerp\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\n\r\nconst DEFAULT_EASE = linear();\r\n\r\n/**\r\n * Time-varying automation for a single numeric filter param.\r\n *\r\n * A {@link Curve} is a portable, immutable list of {@link CurveSegment}s described\r\n * in **relative** time (seconds from the clip's start, with the final segment\r\n * anchored to the clip's end). It references no absolute clip time and no\r\n * external signal, so the same curve can be applied to any clip of any length:\r\n *\r\n * @example\r\n * const swell = ramp(0, 1, 0.5).hold().ramp(1, 0, 1); // up | auto-hold | down\r\n * AudioFilters.volume(swell).speed(swell); // reusable across params and clips\r\n *\r\n * Segments chain fluently (`ramp().hold().ramp()`) — that *is* sequencing; there\r\n * is intentionally no `seq`/`par`. Parallelism is just multiple filters in a chain.\r\n */\r\n\r\n/** A single automation segment in relative time. */\r\nexport interface CurveSegment {\r\n /**\r\n * Start value. `undefined` means \"continue from the previous segment's end\"\r\n * (or, for the first segment, the param's natural/current value — see\r\n * {@link fadeIn}, which leaves `from` resolved to 0 explicitly).\r\n */\r\n from?: number;\r\n /** End value. `undefined` for a hold (stays at the resolved `from`). */\r\n to?: number;\r\n /**\r\n * Length in **seconds**. `undefined` only for a bare {@link hold} that\r\n * auto-fills the remaining middle of the clip.\r\n */\r\n duration?: number;\r\n /** Segment easing; defaults to {@link linear}. */\r\n ease?: EasingFunction;\r\n}\r\n\r\n/** A segment resolved against a concrete clip duration: absolute relative-time keyframe pair. */\r\nexport interface ResolvedSegment {\r\n /** Segment start, seconds from clip start. */\r\n startTime: number;\r\n /** Segment end, seconds from clip start. */\r\n endTime: number;\r\n from: number;\r\n to: number;\r\n ease: EasingFunction;\r\n /** True when `ease` is the identity {@link linear} — lets the renderer use a cheap `linearRamp`. */\r\n isLinear: boolean;\r\n}\r\n\r\n/** Portable, immutable, fluent automation curve for one numeric param. */\r\nexport class Curve {\r\n constructor(public readonly segments: readonly CurveSegment[] = []) { }\r\n\r\n /** Append a ramp from `from` to `to` over `duration` seconds. */\r\n ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve([...this.segments, { from, to, duration, ease: opts?.ease }]);\r\n }\r\n\r\n /**\r\n * Append a hold. With `duration` it sustains for that many seconds; bare\r\n * `hold()` stretches to fill whatever time is left in the middle of the clip\r\n * (only one auto-fill hold is allowed per curve).\r\n */\r\n hold(duration?: number): Curve {\r\n return new Curve([...this.segments, { duration }]);\r\n }\r\n\r\n /** Append a fade from 0 up over `duration` seconds, anchored at the clip start. */\r\n fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve([...this.segments, { from: 0, to: 1, duration, ease: opts?.ease }]);\r\n }\r\n\r\n /** Append a fade down to 0 over `duration` seconds, anchored to the clip end. */\r\n fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve([...this.segments, { to: 0, duration, ease: opts?.ease }]);\r\n }\r\n\r\n /**\r\n * Resolve relative segments into absolute (clip-relative) keyframes once the\r\n * clip's duration is known.\r\n *\r\n * - Explicit segment durations are summed; a single bare `hold()` absorbs the\r\n * leftover `clipDuration - sumOfExplicit` so fade-in/hold/fade-out auto-sizes.\r\n * - The final segment's end lands exactly at `clipDuration` (end-anchor), which\r\n * is what makes `fadeOut` \"the last N seconds\" without naming an anchor.\r\n * - If explicit durations exceed `clipDuration`, the schedule is clamped to the\r\n * clip (later segments may be squeezed to zero) and a dev warning is logged.\r\n *\r\n * @param defaultValue value used for an unresolved first `from` (the param's natural value).\r\n */\r\n resolve(clipDuration: number, defaultValue: number): ResolvedSegment[] {\r\n const segs = this.segments;\r\n if (segs.length === 0) return [];\r\n\r\n // Guard a non-finite/negative clip length so a degenerate duration can never\r\n // propagate NaN/Infinity into resolved keyframes (and then into AudioParams).\r\n const clip = Number.isFinite(clipDuration) && clipDuration > 0 ? clipDuration : 0;\r\n\r\n // Sum explicit durations; find a single auto-fill hold (duration undefined).\r\n let explicit = 0;\r\n let autoFillCount = 0;\r\n for (const s of segs) {\r\n if (s.duration === undefined) autoFillCount++;\r\n else explicit += Math.max(0, s.duration);\r\n }\r\n if (autoFillCount > 1 && process.env.NODE_ENV !== \"production\") {\r\n console.warn(\r\n `[motionscript] Curve has ${autoFillCount} auto-fill hold()s; only the first absorbs leftover time, the rest are zero-length.`,\r\n );\r\n }\r\n if (explicit > clip && process.env.NODE_ENV !== \"production\") {\r\n console.warn(\r\n `[motionscript] Curve segments total ${explicit.toFixed(3)}s but the clip is only ${clip.toFixed(3)}s; clamping to the clip.`,\r\n );\r\n }\r\n\r\n const slack = Math.max(0, clip - explicit);\r\n\r\n // Where does the slack go so the LAST segment always lands on the clip end?\r\n // - An explicit auto-fill hold() owns it (its index absorbs `slack`).\r\n // - Otherwise insert it implicitly just before the final segment, so a\r\n // trailing fadeOut/ramp is end-anchored (\"the last N seconds\") without the\r\n // author having to type hold(). With no slack, nothing is inserted.\r\n const autoFillIndex = autoFillCount > 0\r\n ? segs.findIndex((s) => s.duration === undefined)\r\n : (slack > 0 ? segs.length - 1 : -1);\r\n\r\n const out: ResolvedSegment[] = [];\r\n let cursor = 0;\r\n let prevValue = defaultValue;\r\n\r\n for (let i = 0; i < segs.length; i++) {\r\n const s = segs[i];\r\n\r\n // Insert the implicit end-anchoring gap before the final segment.\r\n if (autoFillCount === 0 && i === autoFillIndex && slack > 0) {\r\n const gapStart = Math.min(cursor, clip);\r\n const gapEnd = Math.min(cursor + slack, clip);\r\n out.push({ startTime: gapStart, endTime: gapEnd, from: prevValue, to: prevValue, ease: DEFAULT_EASE, isLinear: true });\r\n cursor += slack;\r\n }\r\n\r\n let dur: number;\r\n if (s.duration === undefined) {\r\n // Only the first auto-fill hold absorbs slack; any extras are zero.\r\n dur = i === autoFillIndex ? slack : 0;\r\n } else {\r\n dur = Math.max(0, s.duration);\r\n }\r\n\r\n const from = s.from ?? prevValue;\r\n // `to === undefined` is a hold: stay at `from`.\r\n const to = s.to ?? from;\r\n\r\n const startTime = Math.min(cursor, clip);\r\n const endTime = Math.min(cursor + dur, clip);\r\n const ease = s.ease ?? DEFAULT_EASE;\r\n out.push({ startTime, endTime, from, to, ease, isLinear: ease === DEFAULT_EASE });\r\n\r\n cursor += dur;\r\n prevValue = to;\r\n }\r\n\r\n return out;\r\n }\r\n\r\n /** Sample the curve's value at relative time `t` seconds (for a known clip duration). */\r\n sampleAt(t: number, clipDuration: number, defaultValue: number): number {\r\n const resolved = this.resolve(clipDuration, defaultValue);\r\n if (resolved.length === 0) return defaultValue;\r\n if (t <= resolved[0].startTime) return resolved[0].from;\r\n for (const seg of resolved) {\r\n if (t >= seg.startTime && t <= seg.endTime) {\r\n const span = seg.endTime - seg.startTime;\r\n const local = span > 0 ? (t - seg.startTime) / span : 1;\r\n return lerpNumber(seg.from, seg.to, seg.ease(local));\r\n }\r\n }\r\n return resolved[resolved.length - 1].to;\r\n }\r\n\r\n /** The curve's value at t=0 — its constant fallback for static contexts. */\r\n staticValue(defaultValue: number): number {\r\n const first = this.segments[0];\r\n return first?.from ?? defaultValue;\r\n }\r\n}\r\n\r\n// ─── Free-function constructors (each returns a one-segment Curve, so they chain) ─\r\n\r\n/** A ramp from `from` to `to` over `duration` seconds. */\r\nexport function ramp(from: number, to: number, duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve().ramp(from, to, duration, opts);\r\n}\r\n\r\n/** A hold; bare `hold()` auto-fills the middle of the clip. */\r\nexport function hold(duration?: number): Curve {\r\n return new Curve().hold(duration);\r\n}\r\n\r\n/** A fade from 0 up over `duration` seconds, anchored at the clip start. */\r\nexport function fadeIn(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve().fadeIn(duration, opts);\r\n}\r\n\r\n/** A fade down to 0 over `duration` seconds, anchored to the clip end. */\r\nexport function fadeOut(duration: number, opts?: { ease?: EasingFunction }): Curve {\r\n return new Curve().fadeOut(duration, opts);\r\n}\r\n\r\n// ─── Param type & helpers ──────────────────────────────────────────────────────\r\n\r\n/** A filter param: a constant number, or a time-varying {@link Curve}. */\r\nexport type Param = number | Curve;\r\n\r\n/** Type guard: is this param a time-varying curve? */\r\nexport function isCurve(p: Param | undefined): p is Curve {\r\n return p instanceof Curve;\r\n}\r\n\r\n/**\r\n * The constant value of a param for static contexts (the number itself, or a\r\n * curve's t=0 value). Used wherever a single representative number is needed\r\n * (e.g. timeline math, equality fast paths).\r\n */\r\nexport function staticValue(p: Param, fallback = 0): number {\r\n return isCurve(p) ? p.staticValue(fallback) : p;\r\n}\r\n\r\n/**\r\n * Deterministic string key for a param, including a curve's full segment shape.\r\n * Used to detect when a filter param actually changed (so playback re-schedules\r\n * the source) — two curves with identical segments produce the same key.\r\n */\r\nexport function paramKey(p: Param | undefined): string {\r\n if (p === undefined) return \"_\";\r\n if (!isCurve(p)) return String(p);\r\n return \"c[\" + p.segments.map((s) =>\r\n `${s.from ?? \"_\"},${s.to ?? \"_\"},${s.duration ?? \"_\"},${s.ease ? easeKey(s.ease) : \"lin\"}`,\r\n ).join(\";\") + \"]\";\r\n}\r\n\r\n/**\r\n * Interpolate between two params at progress `t`. Two numbers lerp; if either is\r\n * a curve, hard-cut at t=0.5 (curve↔curve interpolation is out of scope — this\r\n * only affects crossfades between two *different* filter chains, which is rare).\r\n */\r\nexport function lerpParam(from: Param, to: Param, t: number): Param {\r\n if (typeof from === \"number\" && typeof to === \"number\") return lerpNumber(from, to, t);\r\n return t < 0.5 ? from : to;\r\n}\r\n\r\n/** The audio-param attribute's op set: resolve is the identity, lerp hard-cuts\r\n * between curves (numbers lerp) — see {@link lerpParam}. */\r\nexport const audioParamOps: AttributeOps<Param, Param> = {\r\n resolve: (value) => value,\r\n lerp: lerpParam,\r\n};\r\n\r\n/** Param equality: numeric compare, or reference identity for curves. */\r\nexport function equalsParam(a: Param | undefined, b: Param | undefined): boolean {\r\n if (a === b) return true;\r\n if (typeof a === \"number\" && typeof b === \"number\") return a === b;\r\n // Curves: reference identity (portable curves are shared values, not rebuilt\r\n // per-frame). Structural equality is unnecessary for the equals() fast path.\r\n return false;\r\n}\r\n\r\n// ─── Speed integration (shared by core timeline math and the renderer) ──────────\r\n\r\n/** Default sampling step (seconds) for numeric speed integration. */\r\nconst INTEGRATION_STEP = 0.001;\r\n\r\n/**\r\n * Clip-time duration consumed by playing the source under a (possibly time-varying)\r\n * speed curve: `∫₀^upper 1/speed(τ) dτ`.\r\n *\r\n * The speed curve is authored over the **full** `sourceLength` (its segment times\r\n * are seconds from the clip's source start), so it is always resolved against\r\n * `sourceLength`; `upper` is just the integration bound (defaults to the whole\r\n * source). A slower instant (speed < 1) consumes *more* clip time. Sampled at\r\n * {@link INTEGRATION_STEP}; speed is clamped to a tiny positive floor so a\r\n * zero/negative speed can't blow up the integral.\r\n *\r\n * Use this in BOTH the core clip-duration math and the cross-scene end resolution\r\n * so the timeline reserves exactly the span the renderer plays.\r\n */\r\nexport function integrateSpeedToClipTime(\r\n speed: Curve,\r\n sourceLength: number,\r\n upper: number = sourceLength,\r\n step = INTEGRATION_STEP,\r\n): number {\r\n const end = Math.min(upper, sourceLength);\r\n if (end <= 0) return 0;\r\n let clipTime = 0;\r\n for (let tau = 0; tau < end; tau += step) {\r\n const dt = Math.min(step, end - tau);\r\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\r\n clipTime += dt / v;\r\n }\r\n return clipTime;\r\n}\r\n\r\n/**\r\n * Inverse of {@link integrateSpeedToClipTime}: the source-time offset reached\r\n * after `clipElapsed` seconds of clip time under the speed curve. This is what a\r\n * mid-clip seek needs to compute the correct buffer offset for a speed-curved clip.\r\n * The curve is always resolved against the full `sourceLength`.\r\n */\r\nexport function sourceTimeAtClipElapsed(\r\n speed: Curve,\r\n sourceLength: number,\r\n clipElapsed: number,\r\n step = INTEGRATION_STEP,\r\n): number {\r\n if (clipElapsed <= 0) return 0;\r\n let played = 0;\r\n let tau = 0;\r\n while (tau < sourceLength) {\r\n const dt = Math.min(step, sourceLength - tau);\r\n const v = Math.max(1e-6, speed.sampleAt(tau + dt / 2, sourceLength, 1));\r\n const clipStep = dt / v;\r\n if (played + clipStep >= clipElapsed) {\r\n // Linear interpolation within this step for sub-step accuracy.\r\n const frac = clipStep > 0 ? (clipElapsed - played) / clipStep : 0;\r\n return tau + dt * frac;\r\n }\r\n played += clipStep;\r\n tau += dt;\r\n }\r\n return sourceLength;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"echo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/echo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAazD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;CACtH,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Adds a delayed, fading repeat of the signal (a feedback echo / simple delay). */\nexport interface EchoFilter {\n type: 'echo';\n /** Delay before the first repeat, in seconds. May be a time-varying curve. */\n delay: Param;\n /** Feedback amount, 0–<1. Each repeat is scaled by this; higher = more repeats. May be a time-varying curve. */\n feedback: Param;\n /** Wet/dry mix, 0–1. 0 = dry only, 1 = full wet. Default 0.5. May be a time-varying curve. */\n mix?: Param;\n}\n\nexport const echoFilter: AudioFilterData<EchoFilter> = {\n lerp: (from, to, t) => ({\n type: \"echo\",\n delay: lerpParam(from.delay, to.delay, t),\n feedback: lerpParam(from.feedback, to.feedback, t),\n mix: lerpParam(from.mix ?? 0.5, to.mix ?? 0.5, t),\n }),\n equals: (a, b) =>\n equalsParam(a.delay, b.delay) && equalsParam(a.feedback, b.feedback) && equalsParam(a.mix ?? 0.5, b.mix ?? 0.5),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"echo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/echo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAazD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;KACpD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;CACtH,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Adds a delayed, fading repeat of the signal (a feedback echo / simple delay). */\r\nexport interface EchoFilter {\r\n type: 'echo';\r\n /** Delay before the first repeat, in seconds. May be a time-varying curve. */\r\n delay: Param;\r\n /** Feedback amount, 0–<1. Each repeat is scaled by this; higher = more repeats. May be a time-varying curve. */\r\n feedback: Param;\r\n /** Wet/dry mix, 0–1. 0 = dry only, 1 = full wet. Default 0.5. May be a time-varying curve. */\r\n mix?: Param;\r\n}\r\n\r\nexport const echoFilter: AudioFilterData<EchoFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"echo\",\r\n delay: lerpParam(from.delay, to.delay, t),\r\n feedback: lerpParam(from.feedback, to.feedback, t),\r\n mix: lerpParam(from.mix ?? 0.5, to.mix ?? 0.5, t),\r\n }),\r\n equals: (a, b) =>\r\n equalsParam(a.delay, b.delay) && equalsParam(a.feedback, b.feedback) && equalsParam(a.mix ?? 0.5, b.mix ?? 0.5),\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gain.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/gain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AASzD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Scales the clip's amplitude by a linear factor. */\nexport interface GainFilter {\n type: 'gain';\n /** Linear gain multiplier. 1 = unchanged, 0 = silent, >1 = louder. May be a time-varying curve. */\n value: Param;\n}\n\nexport const gainFilter: AudioFilterData<GainFilter> = {\n lerp: (from, to, t) => ({ type: \"gain\", value: lerpParam(from.value, to.value, t) }),\n equals: (a, b) => equalsParam(a.value, b.value),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"gain.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/gain.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AASzD,MAAM,CAAC,MAAM,UAAU,GAAgC;IACnD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Scales the clip's amplitude by a linear factor. */\r\nexport interface GainFilter {\r\n type: 'gain';\r\n /** Linear gain multiplier. 1 = unchanged, 0 = silent, >1 = louder. May be a time-varying curve. */\r\n value: Param;\r\n}\r\n\r\nexport const gainFilter: AudioFilterData<GainFilter> = {\r\n lerp: (from, to, t) => ({ type: \"gain\", value: lerpParam(from.value, to.value, t) }),\r\n equals: (a, b) => equalsParam(a.value, b.value),\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/highpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,cAAc,GAAoC;IAC3D,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Attenuates frequencies below `frequency`, passing the highs through. */\nexport interface HighPassFilter {\n type: 'highpass';\n /** Cutoff frequency in Hz. Content below this is rolled off. May be a time-varying curve. */\n frequency: Param;\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\n q?: Param;\n}\n\nexport const highPassFilter: AudioFilterData<HighPassFilter> = {\n lerp: (from, to, t) => ({\n type: \"highpass\",\n frequency: lerpParam(from.frequency, to.frequency, t),\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\n }),\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"highpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/highpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,cAAc,GAAoC;IAC3D,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Attenuates frequencies below `frequency`, passing the highs through. */\r\nexport interface HighPassFilter {\r\n type: 'highpass';\r\n /** Cutoff frequency in Hz. Content below this is rolled off. May be a time-varying curve. */\r\n frequency: Param;\r\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\r\n q?: Param;\r\n}\r\n\r\nexport const highPassFilter: AudioFilterData<HighPassFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"highpass\",\r\n frequency: lerpParam(from.frequency, to.frequency, t),\r\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\r\n }),\r\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/lowpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Attenuates frequencies above `frequency`, passing the lows through. */\nexport interface LowPassFilter {\n type: 'lowpass';\n /** Cutoff frequency in Hz. Content above this is rolled off. May be a time-varying curve. */\n frequency: Param;\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\n q?: Param;\n}\n\nexport const lowPassFilter: AudioFilterData<LowPassFilter> = {\n lerp: (from, to, t) => ({\n type: \"lowpass\",\n frequency: lerpParam(from.frequency, to.frequency, t),\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\n }),\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"lowpass.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/lowpass.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;QACrD,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;CAC7F,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Attenuates frequencies above `frequency`, passing the lows through. */\r\nexport interface LowPassFilter {\r\n type: 'lowpass';\r\n /** Cutoff frequency in Hz. Content above this is rolled off. May be a time-varying curve. */\r\n frequency: Param;\r\n /** Resonance (Q) at the cutoff. Default 1. May be a time-varying curve. */\r\n q?: Param;\r\n}\r\n\r\nexport const lowPassFilter: AudioFilterData<LowPassFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"lowpass\",\r\n frequency: lerpParam(from.frequency, to.frequency, t),\r\n q: lerpParam(from.q ?? 1, to.q ?? 1, t),\r\n }),\r\n equals: (a, b) => equalsParam(a.frequency, b.frequency) && equalsParam(a.q ?? 1, b.q ?? 1),\r\n};\r\n"]}
|
|
@@ -5,9 +5,9 @@ import { Param } from "../curve.js";
|
|
|
5
5
|
* this alters both speed *and* pitch (the classic chipmunk / slow-mo effect) and
|
|
6
6
|
* the clip occupies less/more time on the timeline accordingly.
|
|
7
7
|
*
|
|
8
|
-
* `value` may be a time-varying curve; when it is, the clip's
|
|
8
|
+
* `value` may be a time-varying curve; when it is, the clip's clip-time length is
|
|
9
9
|
* the integral `∫ 1/speed(τ) dτ` rather than a simple division (see
|
|
10
|
-
* `
|
|
10
|
+
* `integrateSpeedToClipTime` in `../curve`).
|
|
11
11
|
*/
|
|
12
12
|
export interface SpeedFilter {
|
|
13
13
|
type: 'speed';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speed.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/speed.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBzD,MAAM,CAAC,MAAM,WAAW,GAAiC;IACrD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/**\n * Changes the clip's playback rate. Because Web Audio resamples on rate change,\n * this alters both speed *and* pitch (the classic chipmunk / slow-mo effect) and\n * the clip occupies less/more time on the timeline accordingly.\n *\n * `value` may be a time-varying curve; when it is, the clip's
|
|
1
|
+
{"version":3,"file":"speed.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/speed.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiBzD,MAAM,CAAC,MAAM,WAAW,GAAiC;IACrD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CAClD,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/**\r\n * Changes the clip's playback rate. Because Web Audio resamples on rate change,\r\n * this alters both speed *and* pitch (the classic chipmunk / slow-mo effect) and\r\n * the clip occupies less/more time on the timeline accordingly.\r\n *\r\n * `value` may be a time-varying curve; when it is, the clip's clip-time length is\r\n * the integral `∫ 1/speed(τ) dτ` rather than a simple division (see\r\n * `integrateSpeedToClipTime` in `../curve`).\r\n */\r\nexport interface SpeedFilter {\r\n type: 'speed';\r\n /** Playback-rate multiplier. 1 = unchanged, 2 = twice as fast, 0.5 = half speed. May be a time-varying curve. */\r\n value: Param;\r\n}\r\n\r\nexport const speedFilter: AudioFilterData<SpeedFilter> = {\r\n lerp: (from, to, t) => ({ type: \"speed\", value: lerpParam(from.value, to.value, t) }),\r\n equals: (a, b) => equalsParam(a.value, b.value),\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tremolo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/tremolo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACtC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;KAC5C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CACjF,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\nimport { Param, lerpParam, equalsParam } from \"../curve\";\n\n/** Modulates the clip's amplitude with a low-frequency oscillator for a wobble effect. */\nexport interface TremoloFilter {\n type: 'tremolo';\n /** Modulation rate in Hz (how fast the volume pulses). May be a time-varying curve. */\n rate: Param;\n /** Modulation depth, 0–1. 0 = no effect, 1 = full dips to silence. May be a time-varying curve. */\n depth: Param;\n}\n\nexport const tremoloFilter: AudioFilterData<TremoloFilter> = {\n lerp: (from, to, t) => ({\n type: \"tremolo\",\n rate: lerpParam(from.rate, to.rate, t),\n depth: lerpParam(from.depth, to.depth, t),\n }),\n equals: (a, b) => equalsParam(a.rate, b.rate) && equalsParam(a.depth, b.depth),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"tremolo.js","sourceRoot":"","sources":["../../../../../src/attributes/audio/filters/implementations/tremolo.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWzD,MAAM,CAAC,MAAM,aAAa,GAAmC;IACzD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACtC,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;KAC5C,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC;CACjF,CAAC","sourcesContent":["import type { AudioFilterData } from \"../registry\";\r\nimport { Param, lerpParam, equalsParam } from \"../curve\";\r\n\r\n/** Modulates the clip's amplitude with a low-frequency oscillator for a wobble effect. */\r\nexport interface TremoloFilter {\r\n type: 'tremolo';\r\n /** Modulation rate in Hz (how fast the volume pulses). May be a time-varying curve. */\r\n rate: Param;\r\n /** Modulation depth, 0–1. 0 = no effect, 1 = full dips to silence. May be a time-varying curve. */\r\n depth: Param;\r\n}\r\n\r\nexport const tremoloFilter: AudioFilterData<TremoloFilter> = {\r\n lerp: (from, to, t) => ({\r\n type: \"tremolo\",\r\n rate: lerpParam(from.rate, to.rate, t),\r\n depth: lerpParam(from.depth, to.depth, t),\r\n }),\r\n equals: (a, b) => equalsParam(a.rate, b.rate) && equalsParam(a.depth, b.depth),\r\n};\r\n"]}
|
|
@@ -11,7 +11,7 @@ export type { AudioFilter } from './chain.js';
|
|
|
11
11
|
/** Per-builder options. Each builder takes one of these, or its dominant `Param`. */
|
|
12
12
|
export type { GainFilterOptions, HighPassFilterOptions, LowPassFilterOptions, TremoloFilterOptions, SpeedFilterOptions, EchoFilterOptions, } from './chain.js';
|
|
13
13
|
/** Time-varying param curves: builders, the Curve type, and param helpers. */
|
|
14
|
-
export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam,
|
|
14
|
+
export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam, integrateSpeedToClipTime, sourceTimeAtClipElapsed, audioParamOps, } from './curve.js';
|
|
15
15
|
export type { Param, CurveSegment, ResolvedSegment } from './curve.js';
|
|
16
16
|
/** Union of all concrete audio-filter types accepted by sounds. */
|
|
17
17
|
export type { AudioFilterItem } from './union.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qFAAqF;AACrF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,qFAAqF;AACrF,YAAY,EACR,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GACpB,MAAM,SAAS,CAAC;AAEjB,8EAA8E;AAC9E,OAAO,EACH,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/index.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qFAAqF;AACrF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,qFAAqF;AACrF,YAAY,EACR,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GACpB,MAAM,SAAS,CAAC;AAEjB,8EAA8E;AAC9E,OAAO,EACH,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpE,mEAAmE;AACnE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,oDAAoD;AACpD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Chainable filter builder API, chain class, and loose author-facing union type. */
|
|
2
2
|
export { AudioFilters, AudioFilterChain, resolveAudioFilters } from './chain.js';
|
|
3
3
|
/** Time-varying param curves: builders, the Curve type, and param helpers. */
|
|
4
|
-
export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam,
|
|
4
|
+
export { Curve, ramp, hold, fadeIn, fadeOut, isCurve, staticValue, lerpParam, equalsParam, integrateSpeedToClipTime, sourceTimeAtClipElapsed, audioParamOps, } from './curve.js';
|
|
5
5
|
export { filtersKey } from './union.js';
|
|
6
6
|
/** Interpolation/equality registry and contract. */
|
|
7
7
|
export { AudioFilterRegistry, audioFiltersOps } from './registry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/index.ts"],"names":[],"mappings":"AAQA,qFAAqF;AACrF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAa9E,8EAA8E;AAC9E,OAAO,EACH,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/index.ts"],"names":[],"mappings":"AAQA,qFAAqF;AACrF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAa9E,8EAA8E;AAC9E,OAAO,EACH,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,SAAS,EACT,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,GAChB,MAAM,SAAS,CAAC;AAKjB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,oDAAoD;AACpD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/** Audio-filter data types for each built-in filter. */\r\nexport type { GainFilter } from './implementations/gain';\r\nexport type { HighPassFilter } from './implementations/highpass';\r\nexport type { LowPassFilter } from './implementations/lowpass';\r\nexport type { TremoloFilter } from './implementations/tremolo';\r\nexport type { SpeedFilter } from './implementations/speed';\r\nexport type { EchoFilter } from './implementations/echo';\r\n\r\n/** Chainable filter builder API, chain class, and loose author-facing union type. */\r\nexport { AudioFilters, AudioFilterChain, resolveAudioFilters } from './chain';\r\nexport type { AudioFilter } from './chain';\r\n\r\n/** Per-builder options. Each builder takes one of these, or its dominant `Param`. */\r\nexport type {\r\n GainFilterOptions,\r\n HighPassFilterOptions,\r\n LowPassFilterOptions,\r\n TremoloFilterOptions,\r\n SpeedFilterOptions,\r\n EchoFilterOptions,\r\n} from './chain';\r\n\r\n/** Time-varying param curves: builders, the Curve type, and param helpers. */\r\nexport {\r\n Curve,\r\n ramp,\r\n hold,\r\n fadeIn,\r\n fadeOut,\r\n isCurve,\r\n staticValue,\r\n lerpParam,\r\n equalsParam,\r\n integrateSpeedToClipTime,\r\n sourceTimeAtClipElapsed,\r\n audioParamOps,\r\n} from './curve';\r\nexport type { Param, CurveSegment, ResolvedSegment } from './curve';\r\n\r\n/** Union of all concrete audio-filter types accepted by sounds. */\r\nexport type { AudioFilterItem } from './union';\r\nexport { filtersKey } from './union';\r\n\r\n/** Interpolation/equality registry and contract. */\r\nexport { AudioFilterRegistry, audioFiltersOps } from './registry';\r\nexport type { AudioFilterData } from './registry';\r\n"]}
|