@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.5
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 +220 -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-FUZVFT3W.js +18 -0
- package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.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/component.js +1 -1
- package/dist/browser/component.js.map +1 -1
- 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 +3 -2
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/document/audio.d.ts +1 -1
- package/dist/document/audio.js +4 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +8 -14
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +1 -1
- package/dist/document/command-traits.js +13 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- 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.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 +19 -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 +17 -0
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +29 -2
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +73 -18
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +192 -40
- 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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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.js.map +1 -1
- package/dist/nodes/audio/node-audio.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +2 -2
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +1 -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 +3 -8
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +3 -8
- 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 +5 -3
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +44 -19
- 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 +2 -2
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
- package/dist/nodes/{scene → root}/canvas2d-node.js +2 -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.js +1 -1
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +1 -1
- package/dist/nodes/text/text-base.js.map +1 -1
- 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 +29 -6
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +44 -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 +5 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +10 -6
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +9 -0
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +19 -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 +118 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -1
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +5 -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.js.map +1 -1
- package/dist/sdk/index.d.ts +19 -15
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +11 -6
- 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.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 +2 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAUpD;;;;;;GAMG;AACH,MAAM,gBAAgB,GAA+F;IACjH,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,UAAU;CACnB,CAAC;AAEF,gGAAgG;AAChG,MAAM,OAAO,mBAAmB;IACpB,MAAM,CAAC,QAAQ,GAAG,IAAI,GAAG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,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACnD,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;;AAGL,0FAA0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAiD;IACzE,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,mBAAmB,CAAC,SAAS;CACtC,CAAC","sourcesContent":["import { AudioFilterItem } from \"@/attributes/audio/filters/union\";\nimport { type AudioFilter, resolveAudioFilters } from \"@/attributes/audio/filters/chain\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\nimport { gainFilter } from \"./implementations/gain\";\nimport { highPassFilter } from \"./implementations/highpass\";\nimport { lowPassFilter } from \"./implementations/lowpass\";\nimport { tremoloFilter } from \"./implementations/tremolo\";\nimport { speedFilter } from \"./implementations/speed\";\nimport { echoFilter } from \"./implementations/echo\";\n\n/** Interpolation and equality contract every registered audio filter must implement. */\nexport interface AudioFilterData<T extends AudioFilterItem> {\n /** Return a new filter linearly interpolated between `from` and `to` at progress `t` (0–1). */\n lerp(from: T, to: T, t: number): T;\n /** Return true when both filters are audibly identical (used to skip redundant work). */\n equals(a: T, b: T): boolean;\n}\n\n/**\n * Every built-in filter's handler, keyed by its `type` — a filter missing here\n * is a type error. Seeded into the registry rather than registered by each\n * filter's own module: core is `sideEffects: false`, so a module imported only\n * to run a `register` call is one a bundler may drop, and the filter it held\n * would then hard-cut instead of interpolating, with nothing raised.\n */\nconst BUILT_IN_FILTERS: { [K in AudioFilterItem[\"type\"]]: AudioFilterData<Extract<AudioFilterItem, { type: K }>> } = {\n gain: gainFilter,\n highpass: highPassFilter,\n lowpass: lowPassFilter,\n tremolo: tremoloFilter,\n speed: speedFilter,\n echo: echoFilter,\n};\n\n/** Central registry that maps audio-filter type strings to their `AudioFilterData` handlers. */\nexport class AudioFilterRegistry {\n private static registry = new Map<string, AudioFilterData<AudioFilterItem>>(\n Object.entries(BUILT_IN_FILTERS) as [string, AudioFilterData<AudioFilterItem>][],\n );\n\n /**\n * Register a filter type.\n * Throws if the same `type` key is registered more than once to catch accidental double-imports.\n */\n static register<T extends AudioFilterItem>(type: string, data: AudioFilterData<T>): void {\n if (this.registry.has(type)) {\n throw new Error(`Audio filter \"${type}\" is already registered`);\n }\n this.registry.set(type, data as AudioFilterData<AudioFilterItem>);\n }\n\n /** Look up the `AudioFilterData` for a given type key, or `undefined` if not registered. */\n static get(type: string): AudioFilterData<AudioFilterItem> | undefined {\n return this.registry.get(type);\n }\n\n /** Return true when a filter type has been registered. */\n static has(type: string): boolean {\n return this.registry.has(type);\n }\n\n /**\n * Interpolate between two individual filters at progress `t`.\n * Falls back to a hard cut at t = 0.5 when the types differ or are unregistered.\n */\n static lerp(from: AudioFilterItem, to: AudioFilterItem, t: number): AudioFilterItem {\n if (from.type !== to.type) return t < 0.5 ? from : to;\n const data = this.registry.get(from.type);\n return data ? data.lerp(from, to, t) : (t < 0.5 ? from : to);\n }\n\n /**\n * Interpolate between two filter arrays of potentially different lengths.\n * Indices present in only one array are kept as-is; matched indices are lerped pairwise.\n */\n static lerpArray(from: AudioFilterItem[], to: AudioFilterItem[], t: number): AudioFilterItem[] {\n const maxLen = Math.max(from.length, to.length);\n const result: AudioFilterItem[] = [];\n for (let i = 0; i < maxLen; i++) {\n const a = from[i];\n const b = to[i];\n if (a && b) {\n result.push(AudioFilterRegistry.lerp(a, b, t));\n } else if (a) {\n result.push(a);\n } else if (b) {\n result.push(b);\n }\n }\n return result;\n }\n}\n\n/** The audio-filter-chain attribute's op set — the `filters` prop's resolve/lerp pair. */\nexport const audioFiltersOps: AttributeOps<AudioFilter, AudioFilterItem[]> = {\n resolve: resolveAudioFilters,\n lerp: AudioFilterRegistry.lerpArray,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAUpD;;;;;;GAMG;AACH,MAAM,gBAAgB,GAA+F;IACjH,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,UAAU;CACnB,CAAC;AAEF,gGAAgG;AAChG,MAAM,OAAO,mBAAmB;IACpB,MAAM,CAAC,QAAQ,GAAG,IAAI,GAAG,CAC7B,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAi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AM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAsB,EAAE,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACT,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACnD,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,CAAC,EAAE,CAAC;gBACX,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;;AAGL,0FAA0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAiD;IACzE,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,mBAAmB,CAAC,SAAS;CACtC,CAAC","sourcesContent":["import { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { type AudioFilter, resolveAudioFilters } from \"@/attributes/audio/filters/chain\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\nimport { gainFilter } from \"./implementations/gain\";\r\nimport { highPassFilter } from \"./implementations/highpass\";\r\nimport { lowPassFilter } from \"./implementations/lowpass\";\r\nimport { tremoloFilter } from \"./implementations/tremolo\";\r\nimport { speedFilter } from \"./implementations/speed\";\r\nimport { echoFilter } from \"./implementations/echo\";\r\n\r\n/** Interpolation and equality contract every registered audio filter must implement. */\r\nexport interface AudioFilterData<T extends AudioFilterItem> {\r\n /** Return a new filter linearly interpolated between `from` and `to` at progress `t` (0–1). */\r\n lerp(from: T, to: T, t: number): T;\r\n /** Return true when both filters are audibly identical (used to skip redundant work). */\r\n equals(a: T, b: T): boolean;\r\n}\r\n\r\n/**\r\n * Every built-in filter's handler, keyed by its `type` — a filter missing here\r\n * is a type error. Seeded into the registry rather than registered by each\r\n * filter's own module: core is `sideEffects: false`, so a module imported only\r\n * to run a `register` call is one a bundler may drop, and the filter it held\r\n * would then hard-cut instead of interpolating, with nothing raised.\r\n */\r\nconst BUILT_IN_FILTERS: { [K in AudioFilterItem[\"type\"]]: AudioFilterData<Extract<AudioFilterItem, { type: K }>> } = {\r\n gain: gainFilter,\r\n highpass: highPassFilter,\r\n lowpass: lowPassFilter,\r\n tremolo: tremoloFilter,\r\n speed: speedFilter,\r\n echo: echoFilter,\r\n};\r\n\r\n/** Central registry that maps audio-filter type strings to their `AudioFilterData` handlers. */\r\nexport class AudioFilterRegistry {\r\n private static registry = new Map<string, AudioFilterData<AudioFilterItem>>(\r\n Object.entries(BUILT_IN_FILTERS) as [string, AudioFilterData<AudioFilterItem>][],\r\n );\r\n\r\n /**\r\n * Register a filter type.\r\n * Throws if the same `type` key is registered more than once to catch accidental double-imports.\r\n */\r\n static register<T extends AudioFilterItem>(type: string, data: AudioFilterData<T>): void {\r\n if (this.registry.has(type)) {\r\n throw new Error(`Audio filter \"${type}\" is already registered`);\r\n }\r\n this.registry.set(type, data as AudioFilterData<AudioFilterItem>);\r\n }\r\n\r\n /** Look up the `AudioFilterData` for a given type key, or `undefined` if not registered. */\r\n static get(type: string): AudioFilterData<AudioFilterItem> | undefined {\r\n return this.registry.get(type);\r\n }\r\n\r\n /** Return true when a filter type has been registered. */\r\n static has(type: string): boolean {\r\n return this.registry.has(type);\r\n }\r\n\r\n /**\r\n * Interpolate between two individual filters at progress `t`.\r\n * Falls back to a hard cut at t = 0.5 when the types differ or are unregistered.\r\n */\r\n static lerp(from: AudioFilterItem, to: AudioFilterItem, t: number): AudioFilterItem {\r\n if (from.type !== to.type) return t < 0.5 ? from : to;\r\n const data = this.registry.get(from.type);\r\n return data ? data.lerp(from, to, t) : (t < 0.5 ? from : to);\r\n }\r\n\r\n /**\r\n * Interpolate between two filter arrays of potentially different lengths.\r\n * Indices present in only one array are kept as-is; matched indices are lerped pairwise.\r\n */\r\n static lerpArray(from: AudioFilterItem[], to: AudioFilterItem[], t: number): AudioFilterItem[] {\r\n const maxLen = Math.max(from.length, to.length);\r\n const result: AudioFilterItem[] = [];\r\n for (let i = 0; i < maxLen; i++) {\r\n const a = from[i];\r\n const b = to[i];\r\n if (a && b) {\r\n result.push(AudioFilterRegistry.lerp(a, b, t));\r\n } else if (a) {\r\n result.push(a);\r\n } else if (b) {\r\n result.push(b);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n\r\n/** The audio-filter-chain attribute's op set — the `filters` prop's resolve/lerp pair. */\r\nexport const audioFiltersOps: AttributeOps<AudioFilter, AudioFilterItem[]> = {\r\n resolve: resolveAudioFilters,\r\n lerp: AudioFilterRegistry.lerpArray,\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/union.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnC;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAA+C;IACtE,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAChD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACrB,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YACb,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACR,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,KAAK,UAAU,CAAC;YAChB,KAAK,SAAS;gBACV,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,KAAK,SAAS;gBACV,OAAO,WAAW,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,KAAK,MAAM;gBACP,OAAO,QAAQ,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACtF,CAAC;IACL,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC","sourcesContent":["import type { GainFilter } from \"./implementations/gain\";\nimport type { HighPassFilter } from \"./implementations/highpass\";\nimport type { LowPassFilter } from \"./implementations/lowpass\";\nimport type { TremoloFilter } from \"./implementations/tremolo\";\nimport type { SpeedFilter } from \"./implementations/speed\";\nimport type { EchoFilter } from \"./implementations/echo\";\nimport { paramKey } from \"./curve\";\n\n/** Discriminated union of every concrete audio-filter type a sound clip can carry. */\nexport type AudioFilterItem =\n | GainFilter\n | HighPassFilter\n | LowPassFilter\n | TremoloFilter\n | SpeedFilter\n | EchoFilter;\n\n/**\n * Deterministic string key for a filter chain, including time-varying curve params.\n *\n * Playback identity must change when filters change so the audio device tears down\n * the old source and rebuilds the graph (otherwise an edited volume/filter keeps\n * playing the stale source until the next stop/start). Keyed via {@link paramKey}\n * so two chains with identical curves collapse to the same string.\n */\nexport function filtersKey(filters: readonly AudioFilterItem[] | undefined): string {\n if (!filters || filters.length === 0) return \"\";\n return filters.map((f) => {\n switch (f.type) {\n case \"gain\":\n case \"speed\":\n return `${f.type}:${paramKey(f.value)}`;\n case \"highpass\":\n case \"lowpass\":\n return `${f.type}:${paramKey(f.frequency)}:${paramKey(f.q)}`;\n case \"tremolo\":\n return `tremolo:${paramKey(f.rate)}:${paramKey(f.depth)}`;\n case \"echo\":\n return `echo:${paramKey(f.delay)}:${paramKey(f.feedback)}:${paramKey(f.mix)}`;\n }\n }).join(\"|\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../../src/attributes/audio/filters/union.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAWnC;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,OAA+C;IACtE,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAChD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACrB,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YACb,KAAK,MAAM,CAAC;YACZ,KAAK,OAAO;gBACR,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5C,KAAK,UAAU,CAAC;YAChB,KAAK,SAAS;gBACV,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,KAAK,SAAS;gBACV,OAAO,WAAW,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9D,KAAK,MAAM;gBACP,OAAO,QAAQ,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACtF,CAAC;IACL,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC","sourcesContent":["import type { GainFilter } from \"./implementations/gain\";\r\nimport type { HighPassFilter } from \"./implementations/highpass\";\r\nimport type { LowPassFilter } from \"./implementations/lowpass\";\r\nimport type { TremoloFilter } from \"./implementations/tremolo\";\r\nimport type { SpeedFilter } from \"./implementations/speed\";\r\nimport type { EchoFilter } from \"./implementations/echo\";\r\nimport { paramKey } from \"./curve\";\r\n\r\n/** Discriminated union of every concrete audio-filter type a sound clip can carry. */\r\nexport type AudioFilterItem =\r\n | GainFilter\r\n | HighPassFilter\r\n | LowPassFilter\r\n | TremoloFilter\r\n | SpeedFilter\r\n | EchoFilter;\r\n\r\n/**\r\n * Deterministic string key for a filter chain, including time-varying curve params.\r\n *\r\n * Playback identity must change when filters change so the audio device tears down\r\n * the old source and rebuilds the graph (otherwise an edited volume/filter keeps\r\n * playing the stale source until the next stop/start). Keyed via {@link paramKey}\r\n * so two chains with identical curves collapse to the same string.\r\n */\r\nexport function filtersKey(filters: readonly AudioFilterItem[] | undefined): string {\r\n if (!filters || filters.length === 0) return \"\";\r\n return filters.map((f) => {\r\n switch (f.type) {\r\n case \"gain\":\r\n case \"speed\":\r\n return `${f.type}:${paramKey(f.value)}`;\r\n case \"highpass\":\r\n case \"lowpass\":\r\n return `${f.type}:${paramKey(f.frequency)}:${paramKey(f.q)}`;\r\n case \"tremolo\":\r\n return `tremolo:${paramKey(f.rate)}:${paramKey(f.depth)}`;\r\n case \"echo\":\r\n return `echo:${paramKey(f.delay)}:${paramKey(f.feedback)}:${paramKey(f.mix)}`;\r\n }\r\n }).join(\"|\");\r\n}\r\n"]}
|
|
@@ -47,10 +47,10 @@ export interface AudioRequest {
|
|
|
47
47
|
id: string;
|
|
48
48
|
/** The asset path or URL. ('src' is standard for media) */
|
|
49
49
|
src: string;
|
|
50
|
-
/** The
|
|
50
|
+
/** The clip timestamp when the audio should START playing. */
|
|
51
51
|
startAt: number;
|
|
52
52
|
/**
|
|
53
|
-
* The
|
|
53
|
+
* The clip timestamp when the audio should STOP playing.
|
|
54
54
|
*
|
|
55
55
|
* Always a number, and **`Infinity` is the open/unbounded sentinel** — never
|
|
56
56
|
* `null` or `undefined`. An unstopped clip carries `Infinity` until
|
|
@@ -77,6 +77,14 @@ export interface AudioRequest {
|
|
|
77
77
|
mediaDuration?: number;
|
|
78
78
|
/** Offset in seconds to skip ahead in the audio file. Default: 0 */
|
|
79
79
|
trimStart: number;
|
|
80
|
+
/**
|
|
81
|
+
* Out-point inside the source, in seconds, carried **only by a looping
|
|
82
|
+
* request that has one** (`trimEnd` greater than {@link trimStart}). A device
|
|
83
|
+
* loops the region `[trimStart, trimEnd)` rather than the whole buffer; for a
|
|
84
|
+
* request that does not loop, {@link endAt} already ends playback at the
|
|
85
|
+
* out-point and this is absent.
|
|
86
|
+
*/
|
|
87
|
+
trimEnd?: number;
|
|
80
88
|
volume: number;
|
|
81
89
|
loop: boolean;
|
|
82
90
|
/** Audio filters applied in array order (index 0 closest to the source). */
|
|
@@ -96,5 +104,12 @@ export interface AudioRequest {
|
|
|
96
104
|
* timeline draw the waveform on that node's bar. Never affects playback.
|
|
97
105
|
*/
|
|
98
106
|
ownerId?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The sound of something that is also a picture — a video's own track. A
|
|
109
|
+
* source only such requests want is silence when it holds no audio, where
|
|
110
|
+
* for a request without this it is a failure to report. Never part of the
|
|
111
|
+
* request's identity: it changes nothing a device plays.
|
|
112
|
+
*/
|
|
113
|
+
optional?: boolean;
|
|
99
114
|
}
|
|
100
115
|
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,4FAA4F;IAC5F,MAAM,EAAE,KAAK,CAAC;IACd,oCAAoC;IACpC,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAErD;AAED,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;IAIZ
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,4FAA4F;IAC5F,MAAM,EAAE,KAAK,CAAC;IACd,oCAAoC;IACpC,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,w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AU,UAAU,CAAC,IAAkB;IACzC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACtJ,CAAC","sourcesContent":["import { filtersKey, type AudioFilterItem } from \"@/attributes/audio/filters/union\";\nimport { paramKey, type Param } from \"@/attributes/audio/filters/curve\";\n\n/**\n * One bus a clip's signal passes through on its way to the master.\n *\n * A flattened snapshot of an {@link AudioBus} node, not a reference to it: core\n * describes what the graph should be and a platform builds it, so what crosses\n * that seam has to be plain data.\n *\n * {@link id} is what makes it a *bus* rather than per-clip processing — two\n * clips naming the same id share one live chain, so a reverb on a bus is a\n * single tail fed by both, which is not the same sound as that reverb applied\n * to each clip separately.\n */\nexport interface AudioBusStop {\n id: string;\n /** Linear gain. A {@link Param}, so a bus fade is a curve rather than a per-frame write. */\n volume: Param;\n /** -1 hard left … +1 hard right. */\n pan: Param;\n mute: boolean;\n /** Applied in array order, index 0 closest to the source. */\n filters?: AudioFilterItem[];\n /**\n * When the bus is present, in the same seconds as the request carrying the\n * stop: what a curve in {@link volume} or {@link filters} runs over, as a\n * clip's curves run over the clip. Not the clip's span, because one bus\n * feeds many clips and its fade has to mean one thing to all of them.\n */\n startAt: number;\n endAt: number;\n}\n\n/**\n * Everything about a stop that changes what passes through it, as a string — so\n * a device can tell an edited bus from the one it already built.\n */\nexport function busStopKey(stop: AudioBusStop): string {\n return `${stop.id}:${paramKey(stop.volume)}:${paramKey(stop.pan)}:${stop.mute ? 1 : 0}:${filtersKey(stop.filters)}:${stop.startAt}:${stop.endAt}`;\n}\n\nexport interface AudioParams {\n src: string;\n volume?: number;\n loop?: boolean;\n trimStart?: number; // in seconds\n trimEnd?: number; // in seconds\n filters?: AudioFilterItem[];\n}\n\nexport interface AudioRequest {\n id: string;\n /** The asset path or URL. ('src' is standard for media) */\n src: string;\n\n // --- Timeline Synchronization (
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/attributes/audio/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAc,MAAM,kCAAkC,CAAC;AAiCxE;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAkB;IACzC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACtJ,CAAC","sourcesContent":["import { filtersKey, type AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { paramKey, type Param } from \"@/attributes/audio/filters/curve\";\r\n\r\n/**\r\n * One bus a clip's signal passes through on its way to the master.\r\n *\r\n * A flattened snapshot of an {@link AudioBus} node, not a reference to it: core\r\n * describes what the graph should be and a platform builds it, so what crosses\r\n * that seam has to be plain data.\r\n *\r\n * {@link id} is what makes it a *bus* rather than per-clip processing — two\r\n * clips naming the same id share one live chain, so a reverb on a bus is a\r\n * single tail fed by both, which is not the same sound as that reverb applied\r\n * to each clip separately.\r\n */\r\nexport interface AudioBusStop {\r\n id: string;\r\n /** Linear gain. A {@link Param}, so a bus fade is a curve rather than a per-frame write. */\r\n volume: Param;\r\n /** -1 hard left … +1 hard right. */\r\n pan: Param;\r\n mute: boolean;\r\n /** Applied in array order, index 0 closest to the source. */\r\n filters?: AudioFilterItem[];\r\n /**\r\n * When the bus is present, in the same seconds as the request carrying the\r\n * stop: what a curve in {@link volume} or {@link filters} runs over, as a\r\n * clip's curves run over the clip. Not the clip's span, because one bus\r\n * feeds many clips and its fade has to mean one thing to all of them.\r\n */\r\n startAt: number;\r\n endAt: number;\r\n}\r\n\r\n/**\r\n * Everything about a stop that changes what passes through it, as a string — so\r\n * a device can tell an edited bus from the one it already built.\r\n */\r\nexport function busStopKey(stop: AudioBusStop): string {\r\n return `${stop.id}:${paramKey(stop.volume)}:${paramKey(stop.pan)}:${stop.mute ? 1 : 0}:${filtersKey(stop.filters)}:${stop.startAt}:${stop.endAt}`;\r\n}\r\n\r\nexport interface AudioParams {\r\n src: string;\r\n volume?: number;\r\n loop?: boolean;\r\n trimStart?: number; // in seconds\r\n trimEnd?: number; // in seconds\r\n filters?: AudioFilterItem[];\r\n}\r\n\r\nexport interface AudioRequest {\r\n id: string;\r\n /** The asset path or URL. ('src' is standard for media) */\r\n src: string;\r\n\r\n // --- Timeline Synchronization (Clip Time) ---\r\n\r\n /** The clip timestamp when the audio should START playing. */\r\n startAt: number; // in seconds\r\n\r\n /**\r\n * The clip timestamp when the audio should STOP playing.\r\n *\r\n * Always a number, and **`Infinity` is the open/unbounded sentinel** — never\r\n * `null` or `undefined`. An unstopped clip carries `Infinity` until\r\n * {@link open} resolution pins it to the project end.\r\n *\r\n * So test it with `Number.isFinite(endAt)`. A `?? Infinity` or `!== null`\r\n * guard is dead code that reads as if the field were nullable.\r\n */\r\n endAt: number; // in seconds\r\n\r\n /**\r\n * True when this request was started and left running at its scene's end —\r\n * neither explicitly stopped nor finite-trimmed. Open requests\r\n * are exempt from the per-scene audio clamp and instead **continue across scene\r\n * boundaries**: `assembleTimeline` shifts them to absolute time and resolves\r\n * `endAt = min(startAt + mediaDuration, projectTotalDuration)` (a looped open\r\n * request runs to the project end). Bounded requests are unaffected.\r\n */\r\n open?: boolean;\r\n\r\n /**\r\n * Source media length in seconds, carried on **open** requests so the\r\n * cross-scene end can be resolved at assembly time without re-reading the\r\n * asset catalog. Ignored for bounded requests.\r\n */\r\n mediaDuration?: number;\r\n\r\n // --- Media Trimming (Local Audio Time) ---\r\n\r\n /** Offset in seconds to skip ahead in the audio file. Default: 0 */\r\n trimStart: number;\r\n\r\n /**\r\n * Out-point inside the source, in seconds, carried **only by a looping\r\n * request that has one** (`trimEnd` greater than {@link trimStart}). A device\r\n * loops the region `[trimStart, trimEnd)` rather than the whole buffer; for a\r\n * request that does not loop, {@link endAt} already ends playback at the\r\n * out-point and this is absent.\r\n */\r\n trimEnd?: number;\r\n\r\n // --- Playback Settings ---\r\n\r\n volume: number; // Default: 1.0\r\n loop: boolean; // Default: false\r\n\r\n // --- Processing ---\r\n\r\n /** Audio filters applied in array order (index 0 closest to the source). */\r\n filters?: AudioFilterItem[];\r\n\r\n /**\r\n * The buses this clip feeds, **source-adjacent first** — the same ordering\r\n * convention {@link filters} uses, so the whole chain reads in signal order:\r\n * the clip's own filters, then each stop in turn, then the master.\r\n *\r\n * Absent means the clip goes straight to the master, which is what every\r\n * request did before buses existed.\r\n */\r\n bus?: readonly AudioBusStop[];\r\n\r\n // --- Timeline attribution (display only) ---\r\n\r\n /**\r\n * The owner key of the node that declared this request: its document row's\r\n * id, plus the path below that row for a node a composite built. Lets a\r\n * timeline draw the waveform on that node's bar. Never affects playback.\r\n */\r\n ownerId?: string;\r\n\r\n /**\r\n * The sound of something that is also a picture — a video's own track. A\r\n * source only such requests want is silence when it holds no audio, where\r\n * for a request without this it is a failure to report. Never part of the\r\n * request's identity: it changes nothing a device plays.\r\n */\r\n optional?: boolean;\r\n}"]}
|
|
@@ -20,6 +20,8 @@ export interface AudioClip {
|
|
|
20
20
|
filters?: AudioFilter;
|
|
21
21
|
/** Source-adjacent first — see {@link AudioRequest.bus}. */
|
|
22
22
|
bus?: readonly AudioBusStop[];
|
|
23
|
+
/** Sound nobody asked for by name — see {@link AudioRequest.optional}. */
|
|
24
|
+
optional?: boolean;
|
|
23
25
|
}
|
|
24
26
|
/** What a node's `declareAudio` is handed. */
|
|
25
27
|
export interface AudioScope {
|
|
@@ -36,7 +38,7 @@ export interface AudioScope {
|
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* The product of every scalar `speed` filter. A curve contributes 1 here — its
|
|
39
|
-
* effect on length needs integrating, which {@link
|
|
41
|
+
* effect on length needs integrating, which {@link clipDurationFor} does.
|
|
40
42
|
*/
|
|
41
43
|
export declare function effectiveSpeed(filters: readonly AudioFilterItem[]): number;
|
|
42
44
|
/**
|
|
@@ -44,7 +46,7 @@ export declare function effectiveSpeed(filters: readonly AudioFilterItem[]): num
|
|
|
44
46
|
* Must match the renderer's `playbackRate` schedule, or the request ends before
|
|
45
47
|
* or after the sound does.
|
|
46
48
|
*/
|
|
47
|
-
export declare function
|
|
49
|
+
export declare function clipDurationFor(filters: readonly AudioFilterItem[], length: number): number;
|
|
48
50
|
/**
|
|
49
51
|
* The request `clip` schedules.
|
|
50
52
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,oDAAoD;AACpD,MAAM,WAAW,SAAS;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qFAAqF;IACrF,KAAK,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C;CACtB;AAED,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,oGAAoG;IACpG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;CAC3C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAM1E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM3F;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,YAAY,CA8C3G"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveAudioFilters } from "./filters/chain.js";
|
|
2
|
-
import {
|
|
2
|
+
import { integrateSpeedToClipTime, isCurve } from "./filters/curve.js";
|
|
3
3
|
/**
|
|
4
4
|
* The product of every scalar `speed` filter. A curve contributes 1 here — its
|
|
5
|
-
* effect on length needs integrating, which {@link
|
|
5
|
+
* effect on length needs integrating, which {@link clipDurationFor} does.
|
|
6
6
|
*/
|
|
7
7
|
export function effectiveSpeed(filters) {
|
|
8
8
|
let speed = 1;
|
|
@@ -17,11 +17,11 @@ export function effectiveSpeed(filters) {
|
|
|
17
17
|
* Must match the renderer's `playbackRate` schedule, or the request ends before
|
|
18
18
|
* or after the sound does.
|
|
19
19
|
*/
|
|
20
|
-
export function
|
|
20
|
+
export function clipDurationFor(filters, length) {
|
|
21
21
|
const scalar = effectiveSpeed(filters);
|
|
22
22
|
for (const f of filters) {
|
|
23
23
|
if (f.type === "speed" && isCurve(f.value))
|
|
24
|
-
return
|
|
24
|
+
return integrateSpeedToClipTime(f.value, length) / scalar;
|
|
25
25
|
}
|
|
26
26
|
return length / scalar;
|
|
27
27
|
}
|
|
@@ -55,17 +55,24 @@ export function requestOf(clip, catalog, ownerKey, n) {
|
|
|
55
55
|
request.filters = filters;
|
|
56
56
|
if (clip.bus)
|
|
57
57
|
request.bus = clip.bus;
|
|
58
|
+
if (clip.optional)
|
|
59
|
+
request.optional = true;
|
|
60
|
+
// A loop repeats the trimmed region, so a `trimEnd` bounds one pass and says
|
|
61
|
+
// nothing about when the clip stops: only a cut (`until`) ends it, and with
|
|
62
|
+
// none it runs open to the project end like any other bed.
|
|
63
|
+
if (loop && trimEnd > trimStart && Number.isFinite(trimEnd))
|
|
64
|
+
request.trimEnd = trimEnd;
|
|
58
65
|
if (loop && Number.isFinite(until)) {
|
|
59
66
|
request.endAt = until;
|
|
60
67
|
}
|
|
61
|
-
else if (Number.isFinite(trimEnd)) {
|
|
62
|
-
request.endAt = Math.min(until, at + sceneDurationFor(filters, Math.max(0, trimEnd - trimStart)));
|
|
63
|
-
}
|
|
64
68
|
else if (loop) {
|
|
65
69
|
request.open = true;
|
|
66
70
|
}
|
|
71
|
+
else if (Number.isFinite(trimEnd)) {
|
|
72
|
+
request.endAt = Math.min(until, at + clipDurationFor(filters, Math.max(0, trimEnd - trimStart)));
|
|
73
|
+
}
|
|
67
74
|
else {
|
|
68
|
-
const natural =
|
|
75
|
+
const natural = clipDurationFor(filters, Math.max(0, mediaDuration - trimStart));
|
|
69
76
|
if (Number.isFinite(until)) {
|
|
70
77
|
request.endAt = Math.min(until, at + natural);
|
|
71
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../../src/attributes/audio/schedule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iBAAiB,CA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;IACxB,CAAC;SAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;SAAM,CAAC;QACJ,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC,CAAC;QACjF,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YACpB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC;QACpC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import type { AssetCatalog } from \"@/assets/catalog\";\r\nimport type { NodeSpan } from \"@/document/types\";\r\nimport type { Node } from \"@/nodes/node/node\";\r\nimport { resolveAudioFilters, type AudioFilter } from \"./filters/chain\";\r\nimport { integrateSpeedToClipTime, isCurve } from \"./filters/curve\";\r\nimport type { AudioFilterItem } from \"./filters/union\";\r\nimport type { AudioBusStop, AudioRequest } from \"./request\";\r\n\r\n/** One clip a node plays, in its clip's seconds. */\r\nexport interface AudioClip {\r\n src: string;\r\n /** When it starts. Defaults to when its owner enters the tree. */\r\n at?: number;\r\n /** When it is cut, however much of it is left. Defaults to when its owner leaves. */\r\n until?: number;\r\n /** In-point inside the source, in seconds. */\r\n trimStart?: number;\r\n /** Out-point inside the source. Absent plays to the source's end. */\r\n trimEnd?: number;\r\n loop?: boolean;\r\n volume?: number;\r\n filters?: AudioFilter;\r\n /** Source-adjacent first — see {@link AudioRequest.bus}. */\r\n bus?: readonly AudioBusStop[];\r\n /** Sound nobody asked for by name — see {@link AudioRequest.optional}. */\r\n optional?: boolean;\r\n}\r\n\r\n/** What a node's `declareAudio` is handed. */\r\nexport interface AudioScope {\r\n readonly catalog: AssetCatalog;\r\n /** When the node is in the tree, in clip seconds. `end` is `Infinity` for one that never leaves. */\r\n readonly span: Readonly<NodeSpan>;\r\n clip(clip: AudioClip): void;\r\n /**\r\n * When `node` is in the tree, in clip seconds: the span a bus stop carries.\r\n *\r\n * @internal\r\n */\r\n _spanOf(node: Node): Readonly<NodeSpan>;\r\n}\r\n\r\n/**\r\n * The product of every scalar `speed` filter. A curve contributes 1 here — its\r\n * effect on length needs integrating, which {@link clipDurationFor} does.\r\n */\r\nexport function effectiveSpeed(filters: readonly AudioFilterItem[]): number {\r\n let speed = 1;\r\n for (const f of filters) {\r\n if (f.type === \"speed\" && !isCurve(f.value) && f.value > 0) speed *= f.value;\r\n }\r\n return speed;\r\n}\r\n\r\n/**\r\n * Clip seconds consumed by playing `length` seconds of source through `filters`.\r\n * Must match the renderer's `playbackRate` schedule, or the request ends before\r\n * or after the sound does.\r\n */\r\nexport function clipDurationFor(filters: readonly AudioFilterItem[], length: number): number {\r\n const scalar = effectiveSpeed(filters);\r\n for (const f of filters) {\r\n if (f.type === \"speed\" && isCurve(f.value)) return integrateSpeedToClipTime(f.value, length) / scalar;\r\n }\r\n return length / scalar;\r\n}\r\n\r\n/**\r\n * The request `clip` schedules.\r\n *\r\n * Bounded when it has an end — a trim, or an `until` — and **open** otherwise, so\r\n * a bed nothing cuts continues across later tracks; see `AudioRequest.open`.\r\n */\r\nexport function requestOf(clip: AudioClip, catalog: AssetCatalog, ownerKey: string, n: number): AudioRequest {\r\n const at = clip.at ?? 0;\r\n const until = clip.until ?? Infinity;\r\n const trimStart = clip.trimStart ?? 0;\r\n const trimEnd = clip.trimEnd ?? Infinity;\r\n const loop = clip.loop ?? false;\r\n const filters = resolveAudioFilters(clip.filters);\r\n // Read even when the length goes unused: a missing file throws here, as a\r\n // build error, rather than playing silence.\r\n const mediaDuration = catalog.getMediaDuration(clip.src);\r\n\r\n const request: AudioRequest = {\r\n id: `${ownerKey}|${clip.src}|${at}|${n}`,\r\n src: clip.src,\r\n startAt: at,\r\n endAt: Infinity,\r\n trimStart,\r\n volume: clip.volume ?? 1,\r\n loop,\r\n ownerId: ownerKey,\r\n };\r\n if (filters.length > 0) request.filters = filters;\r\n if (clip.bus) request.bus = clip.bus;\r\n if (clip.optional) request.optional = true;\r\n\r\n // A loop repeats the trimmed region, so a `trimEnd` bounds one pass and says\r\n // nothing about when the clip stops: only a cut (`until`) ends it, and with\r\n // none it runs open to the project end like any other bed.\r\n if (loop && trimEnd > trimStart && Number.isFinite(trimEnd)) request.trimEnd = trimEnd;\r\n\r\n if (loop && Number.isFinite(until)) {\r\n request.endAt = until;\r\n } else if (loop) {\r\n request.open = true;\r\n } else if (Number.isFinite(trimEnd)) {\r\n request.endAt = Math.min(until, at + clipDurationFor(filters, Math.max(0, trimEnd - trimStart)));\r\n } else {\r\n const natural = clipDurationFor(filters, Math.max(0, mediaDuration - trimStart));\r\n if (Number.isFinite(until)) {\r\n request.endAt = Math.min(until, at + natural);\r\n } else {\r\n request.open = true;\r\n request.mediaDuration = natural;\r\n }\r\n }\r\n return request;\r\n}\r\n"]}
|
|
@@ -49,9 +49,11 @@ export declare class Sound {
|
|
|
49
49
|
constructor(props: SoundProps);
|
|
50
50
|
/** See `schedule.effectiveSpeed`. */
|
|
51
51
|
effectiveSpeed(): number;
|
|
52
|
-
/** See `schedule.
|
|
52
|
+
/** See `schedule.clipDurationFor`. */
|
|
53
|
+
clipDurationFor(trimmedSourceLength: number): number;
|
|
54
|
+
/** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */
|
|
53
55
|
sceneDurationFor(trimmedSourceLength: number): number;
|
|
54
|
-
/**
|
|
56
|
+
/** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */
|
|
55
57
|
get clipDuration(): number | undefined;
|
|
56
58
|
}
|
|
57
59
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../../../src/attributes/audio/sound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAuB,MAAM,kCAAkC,CAAC;AAGpF,UAAU,cAAc;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAChB,CAAC,cAAc,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,GACjF,CAAC,cAAc,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE3F,wFAAwF;AACxF,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,qBAAa,KAAK;IACd,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,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CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,EAAE,CAAC;gBAEf,KAAK,EAAE,UAAU;IAU7B,qCAAqC;IACrC,cAAc,IAAI,MAAM;IAIxB,sCAAsC;IACtC,eAAe,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM;IAIpD,sEAAsE;IACtE,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM;IAIrD,qFAAqF;IACrF,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAIrC;CACJ"}
|
|
@@ -24,14 +24,18 @@ export class Sound {
|
|
|
24
24
|
effectiveSpeed() {
|
|
25
25
|
return schedule.effectiveSpeed(this.filters);
|
|
26
26
|
}
|
|
27
|
-
/** See `schedule.
|
|
27
|
+
/** See `schedule.clipDurationFor`. */
|
|
28
|
+
clipDurationFor(trimmedSourceLength) {
|
|
29
|
+
return schedule.clipDurationFor(this.filters, trimmedSourceLength);
|
|
30
|
+
}
|
|
31
|
+
/** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */
|
|
28
32
|
sceneDurationFor(trimmedSourceLength) {
|
|
29
|
-
return
|
|
33
|
+
return this.clipDurationFor(trimmedSourceLength);
|
|
30
34
|
}
|
|
31
|
-
/**
|
|
35
|
+
/** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */
|
|
32
36
|
get clipDuration() {
|
|
33
37
|
return this.trimEnd !== Infinity
|
|
34
|
-
? this.
|
|
38
|
+
? this.clipDurationFor(this.trimEnd - this.trimStart)
|
|
35
39
|
: undefined;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sound.js","sourceRoot":"","sources":["../../../src/attributes/audio/sound.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,KAAK,Q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C,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC;QAChC,6DAA6D;QAC7D,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,qCAAqC;IACrC,cAAc;QACV,OAAO,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,sCAAsC;IACtC,eAAe,CAAC,mBAA2B;QACvC,OAAO,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;IACvE,CAAC;IAED,sEAAsE;IACtE,gBAAgB,CAAC,mBAA2B;QACxC,OAAO,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACrD,CAAC;IAED,qFAAqF;IACrF,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;YAC5B,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;YACrD,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { AudioFilter, resolveAudioFilters } from \"@/attributes/audio/filters/chain\";\r\nimport * as schedule from \"@/attributes/audio/schedule\";\r\n\r\ninterface SoundPropsBase {\r\n src: string;\r\n volume?: number;\r\n loop?: boolean;\r\n /** Audio filters applied to the clip (gain, eq, tremolo, speed, echo). */\r\n filters?: AudioFilter;\r\n}\r\n\r\n/**\r\n * Author-facing sound props. Two mutually-exclusive ways to bound the clip:\r\n *\r\n * - `{ trimStart?, trimEnd? }` — explicit in/out points into the source file.\r\n * - `{ duration? }` — syntax sugar for a clip that runs `duration` seconds from\r\n * the start (equivalent to `trimStart: 0, trimEnd: duration`).\r\n *\r\n * When neither `trimEnd` nor `duration` is given, the clip runs to the source's\r\n * full length (resolved from the asset catalog). `trimStart` defaults to 0.\r\n */\r\nexport type SoundProps =\r\n | (SoundPropsBase & { trimStart?: number; trimEnd?: number; duration?: undefined })\r\n | (SoundPropsBase & { duration?: number; trimStart?: undefined; trimEnd?: undefined });\r\n\r\n/** Canonical, fully-resolved sound props. `trimEnd` is resolved against the catalog. */\r\nexport interface ResolvedSoundProps {\r\n src: string;\r\n volume?: number;\r\n loop?: boolean;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n filters?: AudioFilterItem[];\r\n}\r\n\r\n/**\r\n * A clip's resolved props, and how long it runs. What a node plays is declared\r\n * through `declareAudio`; this is only the arithmetic over one clip.\r\n */\r\nexport class Sound {\r\n readonly src: string;\r\n volume: number;\r\n loop: boolean;\r\n trimStart: number;\r\n trimEnd: number;\r\n filters: AudioFilterItem[];\r\n\r\n constructor(props: SoundProps) {\r\n this.src = props.src;\r\n this.volume = props.volume ?? 1;\r\n this.loop = props.loop ?? false;\r\n // `duration` is sugar for `trimStart: 0, trimEnd: duration`.\r\n this.trimStart = props.trimStart ?? 0;\r\n this.trimEnd = props.trimEnd ?? props.duration ?? Infinity;\r\n this.filters = resolveAudioFilters(props.filters);\r\n }\r\n\r\n /** See `schedule.effectiveSpeed`. */\r\n effectiveSpeed(): number {\r\n return schedule.effectiveSpeed(this.filters);\r\n }\r\n\r\n /** See `schedule.clipDurationFor`. */\r\n clipDurationFor(trimmedSourceLength: number): number {\r\n return schedule.clipDurationFor(this.filters, trimmedSourceLength);\r\n }\r\n\r\n /** @deprecated Renamed to {@link clipDurationFor}; kept until 1.0. */\r\n sceneDurationFor(trimmedSourceLength: number): number {\r\n return this.clipDurationFor(trimmedSourceLength);\r\n }\r\n\r\n /** Clip seconds, speed profile applied; `undefined` when nothing bounds the clip. */\r\n get clipDuration(): number | undefined {\r\n return this.trimEnd !== Infinity\r\n ? this.clipDurationFor(this.trimEnd - this.trimStart)\r\n : undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,8EAA8E;AAC9E,kFAAkF;AAClF,iFAAiF;AACjF,kFAAkF;AAClF,8CAA8C;AAC9C,OAAO,EACH,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EACtD,kBAAkB,EAAE,mBAAmB,EACvC,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,GACrE,MAAM,uBAAuB,CAAC;AAI/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAc,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAe,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAC5E,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EACvD,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAChE,YAAY,GACf,MAAM,oBAAoB,CAAC;AAE5B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './shape/corners';\nexport * from './shape/effects';\nexport * from './shape/fill';\n// The renderer-facing half of the SkSL plumbing. Surfaced for the same reason\n// `resolveVideoTimestamp` is: the marshalling rules are part of the shader fill's\n// contract, so the backend consumes core's definition rather than reimplementing\n// it. Named rather than wildcard because `SkSLUniform`/`SkSLUniformValue` already\n// reach the barrel through `./shape/effects`.\nexport {\n normalizeUniforms, lerpUniformValue, lerpUniformRecord,\n uniformValuesEqual, uniformRecordsEqual,\n describeUniforms, writeUniforms, coordsMatrix, parseShaderChildren,\n} from './shape/sksl-uniforms';\nexport type {\n SkSLUniformRecord, UniformReflect, UniformSlot, UniformBounds, ShaderChildDecl,\n} from './shape/sksl-uniforms';\nexport * from './shape/filters';\nexport * from './shape/path';\nexport * from './shape/shadow';\nexport * from './shape/stroke';\nexport { Sound, SoundProps } from './audio/sound';\nexport type { AudioBusStop, AudioRequest } from './audio/request';\nexport { busStopKey } from './audio/request';\nexport type { AudioClip, AudioScope } from './audio/schedule';\nexport * from './audio/filters';\nexport * from './layout';\nexport * from './mask/boolean';\nexport * from './mask/mask';\nexport * from './text';\nexport { property, getPropertyMeta, PropOptions } from './properties/decorator';\nexport type { PropertyMeta } from './properties/decorator';\nexport {\n fillProperty, strokeProperty, shadowProperty, effectsProperty, colorProperty,\n cornerRadiusProperty, cornerStyleProperty, pathProperty,\n insetsProperty, alignmentProperty, vector2Property, sizeProperty,\n textProperty,\n} from './properties/typed';\nexport type { AttributePropOptions } from './properties/typed';\nexport * from \"./shape/shaders\";\n\nexport * from './shared/operators';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attributes/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,8EAA8E;AAC9E,kFAAkF;AAClF,iFAAiF;AACjF,kFAAkF;AAClF,8CAA8C;AAC9C,OAAO,EACH,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EACtD,kBAAkB,EAAE,mBAAmB,EACvC,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,GACrE,MAAM,uBAAuB,CAAC;AAI/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAc,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAe,MAAM,wBAAwB,CAAC;AAEhF,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAC5E,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EACvD,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAChE,YAAY,GACf,MAAM,oBAAoB,CAAC;AAE5B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './shape/corners';\r\nexport * from './shape/effects';\r\nexport * from './shape/fill';\r\n// The renderer-facing half of the SkSL plumbing. Surfaced for the same reason\r\n// `resolveVideoTimestamp` is: the marshalling rules are part of the shader fill's\r\n// contract, so the backend consumes core's definition rather than reimplementing\r\n// it. Named rather than wildcard because `SkSLUniform`/`SkSLUniformValue` already\r\n// reach the barrel through `./shape/effects`.\r\nexport {\r\n normalizeUniforms, lerpUniformValue, lerpUniformRecord,\r\n uniformValuesEqual, uniformRecordsEqual,\r\n describeUniforms, writeUniforms, coordsMatrix, parseShaderChildren,\r\n} from './shape/sksl-uniforms';\r\nexport type {\r\n SkSLUniformRecord, UniformReflect, UniformSlot, UniformBounds, ShaderChildDecl,\r\n} from './shape/sksl-uniforms';\r\nexport * from './shape/filters';\r\nexport * from './shape/path';\r\nexport * from './shape/shadow';\r\nexport * from './shape/stroke';\r\nexport { Sound, SoundProps } from './audio/sound';\r\nexport type { AudioBusStop, AudioRequest } from './audio/request';\r\nexport { busStopKey } from './audio/request';\r\nexport type { AudioClip, AudioScope } from './audio/schedule';\r\nexport * from './audio/filters';\r\nexport * from './layout';\r\nexport * from './mask/boolean';\r\nexport * from './mask/mask';\r\nexport * from './text';\r\nexport { property, getPropertyMeta, PropOptions } from './properties/decorator';\r\nexport type { PropertyMeta } from './properties/decorator';\r\nexport {\r\n fillProperty, strokeProperty, shadowProperty, effectsProperty, colorProperty,\r\n cornerRadiusProperty, cornerStyleProperty, pathProperty,\r\n insetsProperty, alignmentProperty, vector2Property, sizeProperty,\r\n textProperty,\r\n} from './properties/typed';\r\nexport type { AttributePropOptions } from './properties/typed';\r\nexport * from \"./shape/shaders\";\r\n\r\nexport * from './shared/operators';\r\n"]}
|
|
@@ -17,7 +17,7 @@ const ALIGNMENT_KEYS = Object.keys(ALIGNMENTS);
|
|
|
17
17
|
// below can reach it without going through a `this`-bound method call.
|
|
18
18
|
function resolveOne(value) {
|
|
19
19
|
if (typeof value === "string") {
|
|
20
|
-
const named = ALIGNMENTS[value];
|
|
20
|
+
const named = Object.hasOwn(ALIGNMENTS, value) ? ALIGNMENTS[value] : undefined;
|
|
21
21
|
if (!named) {
|
|
22
22
|
throw new Error(`Unknown alignment value: '${value}'`);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alignment.js","sourceRoot":"","sources":["../../../src/attributes/layout/alignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,WAAW,EAAE,MAAM,WAAW,CAAC;AAkCjD,MAAM,UAAU,GAAkC;IAC9C,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IACxB,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC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C,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;YACpD,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxD,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import { Vector2, lerpVector2 } from \"./vector2\";\r\nimport { BoxBounds } from \"@/layout/bounds\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\n\r\n/**\r\n * Named positions inside a box: the nine alignment keys (`center`, `topLeft`, …).\r\n * Each maps to a per-axis point in `[-1, 1]`: x is -1 (left) … +1 (right), y is\r\n * -1 (bottom) … +1 (top) — the y-up convention used throughout layout.\r\n */\r\nexport type AlignmentKey =\r\n | \"center\"\r\n | \"topLeft\"\r\n | \"topRight\"\r\n | \"bottomLeft\"\r\n | \"bottomRight\"\r\n | \"topCenter\"\r\n | \"bottomCenter\"\r\n | \"centerLeft\"\r\n | \"centerRight\";\r\n\r\n/**\r\n * A normalised point inside a box — the single value type behind every \"which\r\n * point of this thing\" prop: `Node2D.pivot` (what it rotates about), a container's\r\n * `align` (where children sit), a gradient's `center` (where it emits from) and\r\n * an image fill's `anchor` (which point of the source meets the box).\r\n *\r\n * Those props keep distinct names because they position *different things*; what\r\n * they share is this type, this `[-1, 1]` y-up space, and this vocabulary — so a\r\n * value read off one can be handed to another and mean the same place.\r\n *\r\n * Accepts a named position (`'center'`) or an explicit {@link Vector2}.\r\n */\r\nexport type Alignment = AlignmentKey | Vector2;\r\n\r\nconst ALIGNMENTS: Record<AlignmentKey, Vector2> = {\r\n topLeft: { x: -1, y: 1 },\r\n topCenter: { x: 0, y: 1 },\r\n topRight: { x: 1, y: 1 },\r\n centerLeft: { x: -1, y: 0 },\r\n center: { x: 0, y: 0 },\r\n centerRight: { x: 1, y: 0 },\r\n bottomLeft: { x: -1, y: -1 },\r\n bottomCenter: { x: 0, y: -1 },\r\n bottomRight: { x: 1, y: -1 },\r\n};\r\n\r\n/** The nine named alignment keys in reading order: top row left to right, then\r\n * the middle row, then the bottom row. */\r\nconst ALIGNMENT_KEYS: readonly AlignmentKey[] = Object.keys(ALIGNMENTS) as AlignmentKey[];\r\n\r\n// `resolve`'s own logic, pulled out only so the alignment-positioning helpers\r\n// below can reach it without going through a `this`-bound method call.\r\nfunction resolveOne(value: Alignment): Vector2 {\r\n if (typeof value === \"string\") {\r\n const named = Object.hasOwn(ALIGNMENTS, value) ? ALIGNMENTS[value] : undefined;\r\n if (!named) {\r\n throw new Error(`Unknown alignment value: '${value}'`);\r\n }\r\n return { ...named };\r\n }\r\n return { x: value.x, y: value.y };\r\n}\r\n\r\n/**\r\n * The alignment attribute's op set: `pivot`, `align`, `center` and `anchor` all\r\n * use `resolve`/`lerp`. The rest is the shared alignment-*positioning* math for\r\n * `Node2D` — used by both the constructor (reactive binding form) and a `to()`\r\n * step (one-shot form): a named alignment (`'topRight'`, `'centerLeft'`, …)\r\n * resolves to a normalised pivot `a` in `[-1, 1]` (y-up), and landing that\r\n * alignment on a target scene-space point means the node's centre sits at\r\n * `target - a·(size/2)` — the inverse of the offset from centre to the\r\n * alignment. Kept here rather than duplicated between `Node2D`'s constructor\r\n * and `_prepareStep`.\r\n */\r\n\r\nexport type AlignmentOps = {\r\n /** The nine named keys in reading order, top-left to bottom-right. */\r\n readonly keys: readonly AlignmentKey[];\r\n /** Whether `value` is one of the nine named keys — the strings `resolve` accepts. */\r\n isKey(value: unknown): value is AlignmentKey;\r\n /** Validate a node's alignment-positioning props: at most one named alignment, and an\r\n * alignment cannot be combined with an explicit `pivot` (the alignment derives one). */\r\n validateProps(props: Record<string, unknown>): void;\r\n /** The first named alignment key present in `props`, or `undefined` if none. */\r\n findKey(props: Record<string, unknown>): AlignmentKey | undefined;\r\n /** Resolve a named alignment + the centre offset that lands it on `target`, given a\r\n * concrete layout rect. Used by the one-shot `to()` path: returns the pivot to\r\n * apply plus the absolute `x`/`y` the node's centre must move to. */\r\n resolveTargetOnce(alignmentKey: AlignmentKey, rect: BoxBounds, target: Vector2): { pivot: Vector2; x: number; y: number };\r\n /** Reactive binding form used by the constructor: given a (possibly dynamic) target\r\n * accessor and a live layout-rect accessor, returns the pivot to write plus `x`/`y`\r\n * binding callbacks that re-evaluate whenever the target or the node's layout changes. */\r\n bindTarget(alignmentKey: AlignmentKey, getTarget: () => Vector2, getRect: () => BoxBounds): { pivot: Vector2; x: () => number; y: () => number };\r\n}\r\nexport const alignmentOps: AttributeOps<Alignment, Vector2> & AlignmentOps = {\r\n resolve: resolveOne,\r\n lerp: lerpVector2,\r\n keys: ALIGNMENT_KEYS,\r\n\r\n isKey(value): value is AlignmentKey {\r\n return typeof value === \"string\" && Object.hasOwn(ALIGNMENTS, value);\r\n },\r\n\r\n validateProps(props) {\r\n const present = ALIGNMENT_KEYS.filter(k => props[k] !== undefined);\r\n if (present.length > 1) {\r\n throw new Error(`Cannot set multiple alignment props at once: ${present.join(', ')}`);\r\n }\r\n if (present.length === 1 && props['pivot'] !== undefined) {\r\n throw new Error(`Cannot set both alignment prop '${present[0]}' and 'pivot' at the same time`);\r\n }\r\n },\r\n\r\n findKey(props) {\r\n return ALIGNMENT_KEYS.find(k => props[k] !== undefined);\r\n },\r\n\r\n resolveTargetOnce(alignmentKey, rect, target) {\r\n const a = resolveOne(alignmentKey);\r\n return {\r\n pivot: a,\r\n x: target.x - a.x * (rect.width / 2),\r\n y: target.y - a.y * (rect.height / 2),\r\n };\r\n },\r\n\r\n bindTarget(alignmentKey, getTarget, getRect) {\r\n const a = resolveOne(alignmentKey);\r\n return {\r\n pivot: a,\r\n x: () => getTarget().x - a.x * (getRect().width / 2),\r\n y: () => getTarget().y - a.y * (getRect().height / 2),\r\n };\r\n },\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attributes/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACO,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAC7E,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,SAAS,EAC9E,gBAAgB,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAuC,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAU,SAAS,EAAa,YAAY,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAW,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAA2B,YAAY,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export {\n Matrix2D, identity, translation, multiply, applyToPoint, invert, isProjective,\n cameraMatrix, nodeLocalMatrix, nodeProjectedMatrix, hasProjection3D, facesAway,\n NO_PROJECTION_3D,\n} from './matrix2d';\nexport type { Projection3D } from './matrix2d';\nexport type { NodeTransform3D } from './transform3d';\nexport { space3dOps, lerpLookAt } from './space3d';\nexport type { LookAt, SpaceCamera, SpaceCameraProps, SpacePoint } from './space3d';\nexport { Insets, InsetsProps, InsetsResolved, insetsOps } from './insets';\nexport { Size2D, size2DOps, SizeInput, sizeInputOps } from './size';\nexport { Vector2, lerpVector2, vector2Ops } from './vector2';\nexport { WorldTransform } from './world-transform';\nexport { Alignment, AlignmentKey, alignmentOps } from './alignment';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attributes/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACO,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAC7E,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,SAAS,EAC9E,gBAAgB,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAuC,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAU,SAAS,EAAa,YAAY,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAW,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAA2B,YAAY,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export {\r\n Matrix2D, identity, translation, multiply, applyToPoint, invert, isProjective,\r\n cameraMatrix, nodeLocalMatrix, nodeProjectedMatrix, hasProjection3D, facesAway,\r\n NO_PROJECTION_3D,\r\n} from './matrix2d';\r\nexport type { Projection3D } from './matrix2d';\r\nexport type { NodeTransform3D } from './transform3d';\r\nexport { space3dOps, lerpLookAt } from './space3d';\r\nexport type { LookAt, SpaceCamera, SpaceCameraProps, SpacePoint } from './space3d';\r\nexport { Insets, InsetsProps, InsetsResolved, insetsOps } from './insets';\r\nexport { Size2D, size2DOps, SizeInput, sizeInputOps } from './size';\r\nexport { Vector2, lerpVector2, vector2Ops } from './vector2';\r\nexport { WorldTransform } from './world-transform';\r\nexport { Alignment, AlignmentKey, alignmentOps } from './alignment';\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insets.js","sourceRoot":"","sources":["../../../src/attributes/layout/insets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwD1C,MAAM,CAAC,MAAM,SAAS,GAA0D;IAC5E,OAAO,EAAE,CAAC,KAAkB,EAAE,QAAyB,EAAkB,EAAE;QACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;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CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7B,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;KAChC,CAAC;IACF,UAAU,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3C,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK;QACxC,MAAM,EAAE,WAAW,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM;KAC7C,CAAC;CACL,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\nimport type { BoxBounds } from \"@/layout/bounds\";\nimport { Size2D } from \"./size\";\n\n/** Fully resolved per-side edge insets. */\nexport interface InsetsResolved {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\n\nexport type InsetsProps = number | Partial<InsetsResolved> & {\n horizontal?: number;\n vertical?: number;\n};\n\n/**\n * Accepted shapes for a four-sided inset prop.\n *\n * The type is named for the shape (four edge insets), not for one use of it:\n * `Node2D.padding` insets a layout box in pixels, an image fill's `crop` insets a\n * source in fractions. Same value, same shorthands, same tween — different roles,\n * and each prop names its own.\n *\n * Mirrors {@link Fill}: the loose author-facing {@link InsetsProps} (a number or\n * per-side/symmetric object) plus the strict {@link InsetsResolved} — a read-back\n * resolved value structurally satisfies `InsetsProps`, so it passes through\n * `insetsOps.resolve` idempotently and can be assigned straight back.\n *\n * node.padding = 3 // uniform\n * node.padding = { horizontal: 8, top: 4 } // mixed\n * node.padding = otherNode.padding // resolved passes through\n */\nexport type Insets = InsetsProps | InsetsResolved;\n\n\n/**\n * The insets attribute's op set — used by `@insetsProperty` and anywhere else a\n * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.\n *\n * `insetBounds` computes the inner content area produced by subtracting a\n * resolved inset from an outer size — pure, works for any width/height pair,\n * with `x`/`y` carrying the offset of the inner-area center relative to the\n * outer-area center. `outsetSize` is its inverse: adds padding back onto\n * an inner size to get the outer size that contains it.\n */\n\nexport interface InsetsOps {\n\n insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;\n outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;\n}\n\nexport const insetsOps: AttributeOps<InsetsProps, InsetsResolved> & InsetsOps = {\n resolve: (value: InsetsProps, previous?: InsetsResolved): InsetsResolved => {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n // Fallback resolution order: Specific side -> Symmetric shortcut -> Previous fallback -> Default 0\n return {\n left: value.left ?? value.horizontal ?? previous?.left ?? 0,\n right: value.right ?? value.horizontal ?? previous?.right ?? 0,\n top: value.top ?? value.vertical ?? previous?.top ?? 0,\n bottom: value.bottom ?? value.vertical ?? previous?.bottom ?? 0,\n };\n },\n lerp: (from: InsetsResolved, to: InsetsResolved, t: number): InsetsResolved => {\n return {\n left: lerpNumber(from.left, to.left, t),\n right: lerpNumber(from.right, to.right, t),\n top: lerpNumber(from.top, to.top, t),\n bottom: lerpNumber(from.bottom, to.bottom, t),\n };\n },\n insetBounds: (outerWidth, outerHeight, pad) => ({\n width: Math.max(0, outerWidth - pad.left - pad.right),\n height: Math.max(0, outerHeight - pad.top - pad.bottom),\n x: (pad.left - pad.right) / 2,\n y: (pad.top - pad.bottom) / 2,\n }),\n outsetSize: (innerWidth, innerHeight, pad) => ({\n width: innerWidth + pad.left + pad.right,\n height: innerHeight + pad.top + pad.bottom,\n }),\n};\n"]}
|
|
1
|
+
{"version":3,"file":"insets.js","sourceRoot":"","sources":["../../../src/attributes/layout/insets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwD1C,MAAM,CAAC,MAAM,SAAS,GAA0D;IAC5E,OAAO,EAAE,CAAC,KAAkB,EAAE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CAAC,EAAE,UAAU,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC;QACrD,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;QACvD,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7B,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC;KAChC,CAAC;IACF,UAAU,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3C,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK;QACxC,MAAM,EAAE,WAAW,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM;KAC7C,CAAC;CACL,CAAC","sourcesContent":["import { lerpNumber } from \"@/tween/lerp\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\nimport type { BoxBounds } from \"@/layout/bounds\";\r\nimport { Size2D } from \"./size\";\r\n\r\n/** Fully resolved per-side edge insets. */\r\nexport interface InsetsResolved {\r\n left: number;\r\n right: number;\r\n top: number;\r\n bottom: number;\r\n}\r\n\r\n\r\nexport type InsetsProps = number | Partial<InsetsResolved> & {\r\n horizontal?: number;\r\n vertical?: number;\r\n};\r\n\r\n/**\r\n * Accepted shapes for a four-sided inset prop.\r\n *\r\n * The type is named for the shape (four edge insets), not for one use of it:\r\n * `Node2D.padding` insets a layout box in pixels, an image fill's `crop` insets a\r\n * source in fractions. Same value, same shorthands, same tween — different roles,\r\n * and each prop names its own.\r\n *\r\n * Mirrors {@link Fill}: the loose author-facing {@link InsetsProps} (a number or\r\n * per-side/symmetric object) plus the strict {@link InsetsResolved} — a read-back\r\n * resolved value structurally satisfies `InsetsProps`, so it passes through\r\n * `insetsOps.resolve` idempotently and can be assigned straight back.\r\n *\r\n * node.padding = 3 // uniform\r\n * node.padding = { horizontal: 8, top: 4 } // mixed\r\n * node.padding = otherNode.padding // resolved passes through\r\n */\r\nexport type Insets = InsetsProps | InsetsResolved;\r\n\r\n\r\n/**\r\n * The insets attribute's op set — used by `@insetsProperty` and anywhere else a\r\n * four-sided inset (padding, an image fill's `crop`, …) resolves and tweens.\r\n *\r\n * `insetBounds` computes the inner content area produced by subtracting a\r\n * resolved inset from an outer size — pure, works for any width/height pair,\r\n * with `x`/`y` carrying the offset of the inner-area center relative to the\r\n * outer-area center. `outsetSize` is its inverse: adds padding back onto\r\n * an inner size to get the outer size that contains it.\r\n */\r\n\r\nexport interface InsetsOps {\r\n\r\n insetBounds(outerWidth: number, outerHeight: number, pad: InsetsResolved): BoxBounds;\r\n outsetSize(innerWidth: number, innerHeight: number, pad: InsetsResolved): Size2D;\r\n}\r\n\r\nexport const insetsOps: AttributeOps<InsetsProps, InsetsResolved> & InsetsOps = {\r\n resolve: (value: InsetsProps, previous?: InsetsResolved): InsetsResolved => {\r\n if (typeof value === \"number\") {\r\n return { left: value, right: value, top: value, bottom: value };\r\n }\r\n\r\n // Fallback resolution order: Specific side -> Symmetric shortcut -> Previous fallback -> Default 0\r\n return {\r\n left: value.left ?? value.horizontal ?? previous?.left ?? 0,\r\n right: value.right ?? value.horizontal ?? previous?.right ?? 0,\r\n top: value.top ?? value.vertical ?? previous?.top ?? 0,\r\n bottom: value.bottom ?? value.vertical ?? previous?.bottom ?? 0,\r\n };\r\n },\r\n lerp: (from: InsetsResolved, to: InsetsResolved, t: number): InsetsResolved => {\r\n return {\r\n left: lerpNumber(from.left, to.left, t),\r\n right: lerpNumber(from.right, to.right, t),\r\n top: lerpNumber(from.top, to.top, t),\r\n bottom: lerpNumber(from.bottom, to.bottom, t),\r\n };\r\n },\r\n insetBounds: (outerWidth, outerHeight, pad) => ({\r\n width: Math.max(0, outerWidth - pad.left - pad.right),\r\n height: Math.max(0, outerHeight - pad.top - pad.bottom),\r\n x: (pad.left - pad.right) / 2,\r\n y: (pad.top - pad.bottom) / 2,\r\n }),\r\n outsetSize: (innerWidth, innerHeight, pad) => ({\r\n width: innerWidth + pad.left + pad.right,\r\n height: innerHeight + pad.top + pad.bottom,\r\n }),\r\n};\r\n"]}
|