@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
package/dist/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,wEAAwE;AACxE,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,oCAAoC;AAEpC,gEAAgE;AAChE,UAAU;AACV,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,iFAAiF;AACjF,iFAAiF;AACjF,sDAAsD;AACtD,gEAAgE;AAChE,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,GACf,MAAM,aAAa,CAAC;AAKrB,iFAAiF;AACjF,4EAA4E;AAC5E,0EAA0E;AAC1E,0DAA0D;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA2BnD,gEAAgE;AAChE,qBAAqB;AACrB,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,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,8EAA8E;AAC9E,2CAA2C;AAC3C,EAAE;AACF,gFAAgF;AAChF,wEAAwE;AACxE,gFAAgF;AAChF,yCAAyC;AACzC,OAAO,EACH,OAAO,EACP,YAAY,EACZ,cAAc,EACd,SAAS,EACT,WAAW,EACX,eAAe,EACf,eAAe,EACf,WAAW,GACd,MAAM,UAAU,CAAC;AAGlB,gEAAgE;AAChE,qBAAqB;AACrB,gEAAgE;AAChE,OAAO,EACH,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAAS,EACZ,MAAM,UAAU,CAAC;AAOlB,gEAAgE;AAChE,2BAA2B;AAC3B,gEAAgE;AAChE,OAAO,EACH,QAAQ;AACR,yEAAyE;AACzE,0EAA0E;AAC1E,kEAAkE;AAClE,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,GACf,MAAM,eAAe,CAAC;AAMvB,gEAAgE;AAChE,YAAY;AACZ,gEAAgE;AAChE,OAAO,EACH,SAAS,EACT,KAAK,EACL,YAAY,EACZ,aAAa,EACb,UAAU,EACV,MAAM,EACN,aAAa,EACb,QAAQ,EACR,SAAS,GACZ,MAAM,SAAS,CAAC;AASjB,gEAAgE;AAChE,kEAAkE;AAClE,gEAAgE;AAChE,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,yBAAyB;AACzB,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,0CAA0C;AAC1C,OAAO,EACH,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,GACrB,MAAM,yBAAyB,CAAC","sourcesContent":["// The curated public surface published as `@motionscript/sdk` (packages/sdk) and,\n// via this file, as `@motionscript/core/sdk`. A deliberate SUBSET of core's own\n// root barrel (`../index.ts`): no `Engine`/`Session`/platform seams, no\n// `@internal`-tagged descriptor plumbing. Every export here is named, traced to\n// its real declaring sub-barrel — never a wildcard — so nothing internal leaks\n// by accident. Keep this in lockstep with `packages/sdk/src/index.ts`, which\n// mirrors this exact named surface.\n\n// =============================================================\n// Project\n//\n// A clip is **data**: a still is nodes and props, a composition is the same\n// nodes placed in time plus the commands that animate them, and an audio\n// document is that one tree over. A **project** is one list of tracks over those\n// clips, and it is what the runtime plays — a lone still or composition is sugar\n// for a project with one track (`asProjectDocument`).\n// =============================================================\nexport {\n isProjectDocument,\n asProjectDocument,\n documentDuration,\n commandSpan,\n hasTimeline,\n nodeSpan,\n effectiveSpan,\n untimed,\n ROOT_NODE_ID,\n} from '../document';\nexport type {\n ProjectDocument,\n Track,\n} from '../document';\n// `resolveProjectDocument`/`placeTracks` genuinely live in `../runtime` (session\n// resolution and track placement are runtime concerns) — deep-imported from\n// their concrete files rather than the runtime barrel, which also carries\n// `Engine`/`Session` and is never a source for this file.\nexport { resolveProjectDocument } from '../runtime/session';\nexport { placeTracks } from '../runtime/placement';\nexport type { TrackSpan } from '../runtime/placement';\nexport type {\n Theme,\n ColorTokens,\n Typography,\n TypographyPreset,\n} from '../project';\nexport type { NodeTime, AttachScope } from '../nodes';\nexport type { BoxBounds } from '../layout';\n\n// =============================================================\n// Assets\n//\n// The manifest a host builds a scene against — what images, video, audio and\n// fonts it references, resolved before render. An `Engine`'s manifest and\n// `@motionscript/headless`'s asset options both take this shape.\n// =============================================================\nexport type {\n ImageMeta,\n VideoMeta,\n AudioMeta,\n FontMeta,\n AssetMeta,\n AssetManifest,\n} from '../assets';\n\n// =============================================================\n// The scene document\n//\n// The data half of the model. Nodes are code — a class registered under a key,\n// which is also where a custom node joins the system — and everything else is\n// plain JSON: which nodes exist, what props they carry, and what happens to them\n// over time.\n// =============================================================\nexport {\n validateDocument,\n assertValidDocument,\n // The code half of the model, as one object an engine owns. Not a\n // singleton: what a document can name is a property of the registry\n // compiling it, so two engines in one process disagree freely.\n Registry,\n node,\n} from '../document';\n// The shader-pack vocabulary lives beside the rest of the fill/shader attribute\n// machinery, not in `../document`.\nexport {\n normalizeShaderPack,\n resolveShaderProperties,\n isKnownShaderProperty,\n} from '../attributes';\nexport type {\n RegistryOptions,\n NodeTypeMap,\n ShaderPackMap,\n NodeTypeRecord,\n NodeCommandEntry,\n SceneDocument,\n ClipDocument,\n StillDocument,\n CompositionDocument,\n AudioDocument,\n NodeSpec,\n TimedNodeSpec,\n NodeSpan,\n CommandSpec,\n EaseSpec,\n LoopSpec,\n LoopDirection,\n VariableSpec,\n ValidationIssue,\n ValidationResult,\n NodeConstructor,\n CommandFactory,\n CommandTypeEntry,\n VariableCommandFactory,\n VariableLerp,\n VariableTarget,\n} from '../document';\nexport type {\n Shader,\n FillShader,\n EffectShader,\n ShaderProperty,\n KnownShaderProperty,\n ShaderPropertyValues,\n} from '../attributes';\n\n// Expressions: the string form of a prop that follows a variable — `\"=4[g]+3\"`.\n// `expressionOps` carries recognition, parsing and compiling, so a host can lint,\n// complete or rewrite one without reimplementing the grammar.\nexport { expressionOps, ExpressionError } from '../document';\nexport type {\n ParsedExpression,\n ExpressionNode,\n ExpressionDialect,\n VariableResolver,\n} from '../document';\n\n// =============================================================\n// Node & Provider — the base scene-graph primitives\n//\n// `Node` is dimension-agnostic (tree, props, tweens, context, clock); `Node2D`\n// adds layout and 2D drawing, and is what a custom 2D node extends. `Node3D` and\n// its subclasses live in the 3D section below.\n// =============================================================\nexport {\n Node,\n Node2D,\n // A clip's root container: layout frame, background paint and camera in\n // one node. Every track builds into one sized to the viewport.\n Canvas2D,\n Provider,\n ThemeProvider,\n} from '../nodes';\nexport type {\n NodeProps,\n Node2DProps,\n // A slot a layout puts each child in beyond its box — see `Node2D._placementOf`.\n ChildPlacement,\n Canvas2DProps,\n NodeConfig,\n NodeChildren,\n NodeDimension,\n ProviderProps,\n ThemeProviderProps,\n} from '../nodes';\n\n// =============================================================\n// Nodes — Geometry\n// =============================================================\nexport {\n PaintNode,\n ShapeNode,\n Rect,\n Ellipse,\n Line,\n Path,\n // The document's `\"path\"`: its `data` is in the unit space of its own box,\n // where `Path` draws its `d` at face value.\n PathShape,\n Polygon,\n Polygram,\n LineGrid,\n GridPattern,\n BooleanGroup,\n MaskGroup,\n} from '../nodes';\nexport type {\n PaintProps,\n ShapeProps,\n RectProps,\n FlexSize,\n EllipseProps,\n LineProps,\n PathProps,\n PathShapeProps,\n PolygonProps,\n PolygramProps,\n LineGridProps,\n GridPatternProps,\n BooleanGroupProps,\n MaskGroupProps,\n} from '../nodes';\n// The operation/mode vocabularies behind `Boolean`/`Mask` are attribute types,\n// not node-prop types.\nexport type {\n BooleanOperation,\n MaskMode,\n MaskOptions,\n} from '../attributes';\n\n// =============================================================\n// Nodes — Layout\n// =============================================================\nexport {\n Camera,\n // The stage's 2.5D camera for one subtree: its children orbited in depth.\n OrbitCamera,\n RotatedBox,\n} from '../nodes';\nexport type {\n CameraProps,\n OrbitCameraProps,\n} from '../nodes';\n\n// =============================================================\n// Nodes — Text\n// =============================================================\nexport {\n TextBase,\n Text,\n RichText,\n NumberNode,\n DefaultTextStyle,\n TextSelection,\n} from '../nodes';\nexport type {\n TextBaseProps,\n TextProps,\n RichTextProps,\n NumberProps,\n NumberFormat,\n DefaultTextStyleProps,\n TextSelectionProps,\n TextRange,\n SelectionOverrides,\n} from '../nodes';\nexport { textOps } from '../attributes';\nexport type {\n TextStyle,\n TextAlign,\n VerticalAlign,\n TextDecoration,\n TextCase,\n TextSpan,\n TextRun,\n FontStyle,\n} from '../attributes';\n\n// =============================================================\n// Nodes — Media\n// =============================================================\nexport {\n Video,\n} from '../nodes';\nexport type {\n VideoProps,\n} from '../nodes';\n\n// =============================================================\n// Nodes — Audio\n// =============================================================\n// `SoundNode` plays a clip and `AudioBus` groups what feeds it — the third\n// scene graph, beside `Node2D` and `Node3D`. Levels are `Param`, so a fade is a\n// curve (`fadeIn`/`fadeOut`/`ramp`/`hold`) rather than a `to()`: sound is\n// scheduled once, ahead of time, not written once per frame.\nexport {\n NodeAudio,\n AudioBus,\n SoundNode,\n} from '../nodes';\nexport {\n Sound,\n AudioFilters,\n ramp,\n hold,\n fadeIn,\n fadeOut,\n isCurve,\n} from '../attributes';\nexport type {\n NodeAudioProps,\n AudioBusProps,\n SoundNodeProps,\n} from '../nodes';\nexport type {\n SoundProps,\n AudioRequest,\n // What a node's `declareAudio` is handed, and the clip it declares into it.\n AudioScope,\n AudioClip,\n AudioBusStop,\n AudioFilter,\n Param,\n Curve,\n} from '../attributes';\n\n// =============================================================\n// 3D — the Canvas3D node and the Graphics3D API\n// =============================================================\n// There is one 3D node; everything inside it is described with `Graphics3D`.\n// `Geo`/`Mat`/`Tex` build the geometry/material/texture descriptors, and the lerps\n// are what make a Vector3/Euler/Quaternion prop interpolate rather than snap.\n// `Surface2D` is the 2D→3D bridge: a child of `Canvas3D` whose 2D content is\n// rasterized offscreen and bound to a material by `Tex.surface(name)`.\nexport {\n Canvas3D,\n // The 3D scene graph. `Node3D` is the base; the rest are what you write.\n Node3D,\n Group3D,\n Mesh3D,\n Box3D, Sphere3D, Plane3D, Cylinder3D, Cone3D, Torus3D, TorusKnot3D,\n Circle3D, Ring3D, Capsule3D, Polyhedron3D, Extrude3D, Lathe3D, Tube3D,\n Instances3D, Points3D, Line3D, Sprite3D, Model3D,\n AmbientLight3D, HemisphereLight3D, DirectionalLight3D,\n PointLight3D, SpotLight3D, AreaLight3D,\n Camera3D,\n Fog3D, Environment3D,\n} from '../nodes';\nexport {\n Graphics3D,\n Scene3D,\n RenderContext3D,\n Geo,\n Mat,\n Tex,\n lerpVector3,\n lerpEuler3,\n slerpQuaternion,\n quaternionFromEuler,\n normalizeQuaternion,\n resolveVector3,\n evaluateParametric,\n evaluateRoundedBox,\n resolveSurfaceSource,\n resolveFill3D,\n segmentsOf,\n resolveCameraPlacement,\n resolveShadows3D,\n shadowCasts,\n shadowReceives,\n} from '../render3d';\nexport type {\n Canvas3DProps,\n Node3DProps, Group3DProps, Mesh3DProps, Material3DProps,\n Box3DProps, Sphere3DProps, Plane3DProps, Cylinder3DProps, Cone3DProps,\n Torus3DProps, TorusKnot3DProps, Circle3DProps, Ring3DProps, Capsule3DProps,\n Polyhedron3DProps, Extrude3DProps, Lathe3DProps, Tube3DProps,\n Instances3DProps, Points3DProps, Line3DProps, Sprite3DProps, Model3DProps,\n AmbientLight3DProps, HemisphereLight3DProps, DirectionalLight3DProps,\n PointLight3DProps, SpotLight3DProps, AreaLight3DProps,\n Camera3DProps,\n Fog3DProps, Environment3DProps,\n} from '../nodes';\nexport type {\n Node3DRenderState,\n Graphics3DOp,\n Scene3DOp,\n Vector3,\n Vector3Input,\n Euler3,\n EulerOrder,\n Quaternion,\n Transform3D,\n Shadow3D,\n ShadowOptions3D,\n Faces3D,\n Blend3D,\n Shading3D,\n Segments3D,\n Sweep3D,\n Bevel3D,\n Fill3D,\n Geometry3D,\n BufferGeometry3D,\n Material3D,\n MaterialCommon3D,\n MeshShorthand3D,\n Uniform3D,\n Texture3D,\n TextureOptions3D,\n SurfaceTexture3D,\n SurfaceSource3D,\n ResolvedSurfaceSource,\n LightData3D,\n CameraData3D,\n FogData3D,\n EnvironmentData3D,\n Shadows3D,\n ShadowSettings3D,\n ToneMapping3D,\n ToneSettings3D,\n PostEffect3D,\n LineMode3D,\n LineStroke3D,\n ModelAnimation3D,\n} from '../render3d';\n\n// =============================================================\n// Rendering — Graphics2D builder, RenderContext2D & asset declaration\n// =============================================================\nexport {\n Graphics2D,\n PathBuilder,\n Clip,\n toPathString,\n} from '../render';\nexport type {\n RenderContext2D,\n RenderPass2D,\n MeasureContext2D,\n TextBlockSource,\n // One recorded entry of `Graphics2D.ops()`.\n GraphicsOp,\n PathData,\n PathCommand,\n PathBounds,\n EllipseArc,\n} from '../render';\n// What a node's `declareAssets` declares into, and the async load a `loader` takes.\nexport type { AssetScope, LoaderFn } from '../assets';\n\n// =============================================================\n// Fill & Color\n// =============================================================\nexport {\n Fills,\n parseColor,\n resolveFill,\n fillOps,\n colorOps,\n} from '../attributes';\nexport type {\n Fill,\n FillChain,\n FillOptions,\n VideoFillOptions,\n // Placement of an image/video source inside the shape it paints:\n // `crop` -> `fit` -> `zoom` -> `anchor`, plus the raw-matrix escape hatch.\n MediaPlacementOptions,\n ImageFit,\n ImageCrop,\n ImageMatrix,\n FillResolved,\n // A custom SkSL shader as a fill. `coords` picks what `fragCoord` means;\n // uniforms are keyed by their declared name, and a `ShaderTexture` binds an\n // image to a `uniform shader` declaration.\n ShaderFillProp,\n ShaderFillResolved,\n ShaderFillCoords,\n ShaderTexture,\n SkSLUniformRecord,\n FractalNoiseBasis,\n // The colour type every fill, stroke, shadow and 3D material accepts —\n // a CSS string (incl. `oklch()`, theme tokens, `\"white/10\"`) or a\n // pre-normalized RGBA tuple.\n Color,\n NormalizedColor,\n BlendMode,\n FillSpace,\n} from '../attributes';\n\n// =============================================================\n// Shape Attributes — Stroke, Shadow, Corners\n// =============================================================\nexport {\n resolveStroke,\n strokeOps,\n resolveShadow,\n shadowOps,\n resolveCorners,\n cornerRadiusOps,\n cornerStyleOps,\n // Parsing, measuring, sampling, trimming and morphing a path, and the\n // anchor model (`VectorPath`) a pen tool edits.\n pathOps,\n} from '../attributes';\nexport type {\n PathSampler,\n PathAnchor,\n PathSubpath,\n VectorPath,\n Stroke,\n StrokeProp,\n StrokeAlign,\n StrokeCap,\n StrokeJoin,\n StrokeResolved,\n Shadow,\n ShadowProp,\n ShadowResolved,\n Corners,\n CornerStyle,\n CornerStyleResolved,\n CornerRadiusResolved,\n SceneEffect,\n} from '../attributes';\n\n// =============================================================\n// Layout Attributes — Vector2, Size, Insets, Alignment, Flow\n//\n// `flowOps` is the layout a container runs on its children, as plain data in\n// and boxes out — so a custom node can lay out what it draws the same way.\n// =============================================================\nexport {\n lerpVector2,\n sizeInputOps,\n insetsOps,\n alignmentOps,\n} from '../attributes';\n// `flowOps` itself is the layout package's, not the attribute layer's —\n// `../attributes`'s own `./layout` only carries Vector2/Size2D/Insets/Alignment.\nexport { flowOps } from '../layout';\nexport type {\n Vector2,\n Size2D,\n Insets,\n // What a `padding`-style prop accepts, before `insetsOps` resolves it.\n InsetsProps,\n InsetsResolved,\n AlignmentKey,\n Alignment,\n} from '../attributes';\nexport type {\n FlowMode,\n GapSize,\n FlowResolved,\n FlowProps,\n FlowSettings,\n LayoutItem,\n FlowSpace,\n FlowMeasure,\n FlowLine,\n // What an overriding `measure(constraints, scope)` is handed.\n SizeConstraints,\n} from '../layout';\n\n// =============================================================\n// 2.5D space — the stage's `space3D` camera\n//\n// `space3dOps` is the camera's own projection, for a host drawing over the\n// picture (a gizmo aiming the camera) rather than keeping a copy of it.\n// `SpaceCamera` is what a node returns from `_spaceCamera()` to open a 2.5D\n// space of its own.\n// =============================================================\nexport { space3dOps } from '../attributes/layout/space3d';\nexport type { LookAt, SpaceCamera, SpaceCameraProps, SpacePoint } from '../attributes/layout/space3d';\n\n// =============================================================\n// Effects & Media Adjustments\n// =============================================================\nexport {\n Effects,\n EffectChain,\n Adjustments,\n VideoAdjustments,\n AdjustmentChain,\n VideoAdjustmentChain,\n /** @deprecated Renamed to {@link Adjustments}. Removed in the next major. */\n ImageFilters,\n /** @deprecated Renamed to {@link VideoAdjustments}. Removed in the next major. */\n VideoFilters,\n} from '../attributes';\n\nexport type {\n /** The `effects` prop type — what a node actually accepts. */\n Effect,\n EffectMode,\n EffectAxis,\n EffectSurface,\n EffectOptions,\n /** What an image fill's `preset.adjustments` accepts — one, a list, or a chain. */\n ImageAdjustment,\n VideoAdjustment,\n /** The scene effects that also work as a media adjustment — see {@link Adjustments}. */\n EffectAdjustment,\n MediaAdjustment,\n VideoOnlyAdjustment,\n} from '../attributes';\n\n/**\n * Per-builder options. Every effect builder takes exactly one argument: one of\n * these, or the dominant scalar it wraps.\n */\nexport type {\n BlurOptions,\n DirectionalBlurOptions,\n GrayscaleOptions,\n PixelateOptions,\n BulgeOptions,\n MagnifyOptions,\n BloomOptions,\n VintageOptions,\n ChromaticAberrationOptions,\n InvertOptions,\n ScatterOptions,\n PosterizeOptions,\n MotionBlurOptions,\n ShaderEffectOptions,\n OutlineOptions,\n VignetteOptions,\n GrainOptions,\n SharpenOptions,\n EdgesOptions,\n ThresholdOptions,\n RadialBlurOptions,\n HalftoneOptions,\n DitherOptions,\n DuotoneOptions,\n CurvesOptions,\n ColorAdjustmentOptions,\n RgbShiftOptions,\n ScanlinesOptions,\n BlockDisplaceOptions,\n BitCrushOptions,\n AsciiOptions,\n StreakOptions,\n GlowOptions,\n GodRaysOptions,\n OilPaintOptions,\n TextureOptions,\n DisplaceOptions,\n WaveOptions,\n TwirlOptions,\n ProgressiveBlurOptions,\n KaleidoscopeOptions,\n TrailsOptions,\n GlassOptions,\n LutOptions,\n} from '../attributes';\n\n/**\n * Per-builder options for the filters that exist only as filters. Everything\n * else on {@link Adjustments} takes the matching effect options above, minus\n * `mode` — a filter is on the fill's own pixels, so there is no backdrop to\n * point it at.\n */\nexport type {\n BlurFilterOptions,\n GrayscaleFilterOptions,\n AlphaFilterOptions,\n ExposureFilterOptions,\n ColorMatrixFilterOptions,\n CurvesFilterOptions,\n ColorAdjustmentFilterOptions,\n PosterizeTimeFilterOptions,\n VideoEchoFilterOptions,\n} from '../attributes';\n\n/** Effect data types, for naming an effect value or building one by hand. */\nexport type {\n BlurEffect,\n DirectionalBlurEffect,\n GrayscaleEffect,\n PixelateEffect,\n BulgeEffect,\n MagnifyEffect,\n BloomEffect,\n VintageEffect,\n ChromaticAberrationEffect,\n InvertEffect,\n InvertChannel,\n ScatterEffect,\n PosterizeEffect,\n MotionBlurEffect,\n MotionBlurAlignment,\n ShaderEffect,\n SkSLUniform,\n SkSLUniformValue,\n OutlineEffect,\n OutlinePosition,\n VignetteEffect,\n GrainEffect,\n SharpenEffect,\n EdgesEffect,\n EdgeKernel,\n ThresholdEffect,\n RadialBlurEffect,\n RadialBlurStyle,\n HalftoneEffect,\n HalftoneShape,\n HalftoneSeparation,\n DitherEffect,\n DitherMatrix,\n DuotoneEffect,\n CurvesEffect,\n ColorAdjustmentEffect,\n RgbShiftEffect,\n ScanlinesEffect,\n BlockDisplaceEffect,\n BitCrushEffect,\n BitCrushPalette,\n AsciiEffect,\n AsciiCharset,\n StreakEffect,\n GlowEffect,\n GlowChannel,\n GlowLoopStyle,\n GlowOriginal,\n GlowTint,\n GodRaysEffect,\n OilPaintEffect,\n TextureEffect,\n DisplaceEffect,\n DisplaceChannel,\n WaveEffect,\n WaveShape,\n TwirlEffect,\n ProgressiveBlurEffect,\n ProgressiveBlurShape,\n KaleidoscopeEffect,\n TrailsEffect,\n GlassEffect,\n LutEffect,\n} from '../attributes';\n\n// =============================================================\n// Animation — interpolation\n//\n// There are no `sequence`/`parallel`/`wait` primitives: a command carries its\n// own placement, so sequencing is `at + duration`, running two together is a\n// shared `at`, and a wait is a gap between them.\n// =============================================================\nexport {\n lerpNumber,\n} from '../tween';\nexport type {\n AnimationTarget,\n Steppable,\n TweenStepper,\n LerpFunction,\n TweenOptions,\n} from '../tween';\n\n// An animation as a **value** rather than as control flow: a declared duration\n// plus `at(t)`, so a host can ask what it looks like at a time instead of\n// running it to one. That is what lets a host place one on a timeline, and what\n// makes a scene scrub in constant time rather than replay. `@command` marks the\n// methods on a node that return one, and is what the command registry — and a\n// host listing what a node can do — reads.\n//\n// One command shape, always: `node.to(a, 1)` is a single command, not a builder\n// you can append to. Two of them are sequenced by where they sit on the\n// timeline, which is what makes a scene's shape editable rather than implied by\n// the order of calls in a function body.\nexport {\n command,\n driveCommand,\n getCommandMeta,\n isCommand,\n makeCommand,\n commandSequence,\n commandParallel,\n loopCommand,\n} from '../tween';\nexport type { Command, CommandArgs, CommandMeta, CommandOptions } from '../tween';\n\n// =============================================================\n// Animation — Easing\n// =============================================================\nexport {\n linear,\n easeIn,\n easeOut,\n easeInOut\n} from '../tween';\nexport type {\n EasingFunction,\n EaseParams,\n StandardEase\n} from '../tween';\n\n// =============================================================\n// Node Property Decorators\n// =============================================================\nexport {\n property,\n // Attribute-typed variants: `@property` with the mapper/tween pair for a\n // known attribute already filled in, so a custom node declares a paint or\n // layout prop without importing the resolver/lerp pair behind it.\n fillProperty,\n strokeProperty,\n shadowProperty,\n effectsProperty,\n colorProperty,\n cornerRadiusProperty,\n cornerStyleProperty,\n pathProperty,\n insetsProperty,\n alignmentProperty,\n vector2Property,\n sizeProperty,\n textProperty,\n} from '../attributes';\nexport type {\n PropOptions,\n AttributePropOptions,\n} from '../attributes';\n\n// =============================================================\n// Utilities\n// =============================================================\nexport {\n createRef,\n clamp,\n generateList,\n createContext,\n ContextMap,\n Random,\n SeedGenerator,\n parseCSV,\n parseData,\n} from '../util';\nexport type {\n Reference,\n RefTarget,\n Context,\n DataRecord,\n ParseCSVOptions,\n} from '../util';\n\n// =============================================================\n// Editor selection — node boxes, hit testing, transient overrides\n// =============================================================\n// The geometry an editor needs to lay a selection gizmo over the canvas: where a\n// node's pixels landed, and which node is under a point. Both are pure functions\n// over a scene's node tree, so a host can use them directly; a player embedding\n// reaches the same thing through `useMotionPlayer` (`getNodeBox`, `pickNode`,\n// `setNodeOverride`). Points and boxes are in viewport space — origin at the\n// viewport centre, y-up.\n//\n// These genuinely live in `../runtime` (node hit-testing and the transient\n// override store are runtime concerns) — deep-imported from their concrete\n// files, never the runtime barrel itself.\nexport {\n nodeBox,\n pickNode,\n collectBoxes,\n parentPlanePointAt,\n} from '../runtime/node-picking';\nexport type {\n NodeBox,\n} from '../runtime/node-picking';\nexport type {\n NodeOverride,\n} from '../runtime/playback-controller';\nexport type {\n TreeState,\n} from '../project';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,wEAAwE;AACxE,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,oCAAoC;AAEpC,gEAAgE;AAChE,UAAU;AACV,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,iFAAiF;AACjF,iFAAiF;AACjF,sDAAsD;AACtD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S,GACZ,MAAM,SAAS,CAAC;AASjB,gEAAgE;AAChE,kEAAkE;AAClE,gEAAgE;AAChE,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,yBAAyB;AACzB,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,0CAA0C;AAC1C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhG,OAAO,EACH,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GAChB,MAAM,yBAAyB,CAAC","sourcesContent":["// The curated public surface published as `@motionscript/sdk` (packages/sdk) and,\r\n// via this file, as `@motionscript/core/sdk`. A deliberate SUBSET of core's own\r\n// root barrel (`../index.ts`): no `Engine`/`Session`/platform seams, no\r\n// `@internal`-tagged descriptor plumbing. Every export here is named, traced to\r\n// its real declaring sub-barrel — never a wildcard — so nothing internal leaks\r\n// by accident. Keep this in lockstep with `packages/sdk/src/index.ts`, which\r\n// mirrors this exact named surface.\r\n\r\n// =============================================================\r\n// Project\r\n//\r\n// A clip is **data**: a still is nodes and props, a composition is the same\r\n// nodes placed in time plus the commands that animate them, and an audio\r\n// document is that one tree over. A **project** is one list of tracks over those\r\n// clips, and it is what the runtime plays — a lone still or composition is sugar\r\n// for a project with one track (`asProjectDocument`).\r\n// =============================================================\r\nexport {\r\n isProjectDocument,\r\n asProjectDocument,\r\n documentDuration,\r\n commandSpan,\r\n hasTimeline,\r\n nodeSpan,\r\n effectiveSpan,\r\n untimed,\r\n ROOT_NODE_ID,\r\n} from '../document';\r\nexport type {\r\n ProjectDocument,\r\n Track,\r\n} from '../document';\r\n// `resolveProjectDocument`/`placeTracks` genuinely live in `../runtime` (session\r\n// resolution and track placement are runtime concerns) — deep-imported from\r\n// their concrete files rather than the runtime barrel, which also carries\r\n// `Engine`/`Session` and is never a source for this file.\r\nexport { resolveProjectDocument } from '../runtime/session';\r\nexport { placeTracks } from '../runtime/placement';\r\nexport type { TrackSpan } from '../runtime/placement';\r\nexport type {\r\n Theme,\r\n ColorTokens,\r\n Typography,\r\n TypographyPreset,\r\n} from '../project';\r\nexport type { NodeTime, AttachScope } from '../nodes';\r\nexport type { BoxBounds, Extents } from '../layout';\r\n\r\n// =============================================================\r\n// Assets\r\n//\r\n// The manifest a host builds a scene against — what images, video, audio and\r\n// fonts it references, resolved before render. An `Engine`'s manifest and\r\n// `@motionscript/headless`'s asset options both take this shape.\r\n// =============================================================\r\nexport type {\r\n ImageMeta,\r\n VideoMeta,\r\n AudioMeta,\r\n FontMeta,\r\n AssetMeta,\r\n AssetManifest,\r\n} from '../assets';\r\n\r\n// =============================================================\r\n// The clip document\r\n//\r\n// The data half of the model. Nodes are code — a class registered under a key,\r\n// which is also where a custom node joins the system — and everything else is\r\n// plain JSON: which nodes exist, what props they carry, and what happens to them\r\n// over time.\r\n// =============================================================\r\nexport {\r\n validateDocument,\r\n assertValidDocument,\r\n // The code half of the model, as one object an engine owns. Not a\r\n // singleton: what a document can name is a property of the registry\r\n // compiling it, so two engines in one process disagree freely.\r\n Registry,\r\n node,\r\n // A node built on a general one drops what it inherits and has no use for.\r\n withdraw,\r\n} from '../document';\r\n// The shader-pack vocabulary lives beside the rest of the fill/shader attribute\r\n// machinery, not in `../document`.\r\nexport {\r\n normalizeShaderPack,\r\n resolveShaderProperties,\r\n isKnownShaderProperty,\r\n} from '../attributes';\r\nexport type {\r\n RegistryOptions,\r\n NodeTypeMap,\r\n ShaderPackMap,\r\n NodeTypeRecord,\r\n NodeCommandEntry,\r\n VisualDocument,\r\n ClipDocument,\r\n StillDocument,\r\n CompositionDocument,\r\n AudioDocument,\r\n NodeSpec,\r\n TimedNodeSpec,\r\n NodeSpan,\r\n CommandSpec,\r\n EaseSpec,\r\n LoopSpec,\r\n LoopDirection,\r\n VariableSpec,\r\n ValidationIssue,\r\n ValidationResult,\r\n NodeConstructor,\r\n CommandFactory,\r\n CommandTypeEntry,\r\n VariableCommandFactory,\r\n VariableLerp,\r\n VariableTarget,\r\n} from '../document';\r\nexport type {\r\n Shader,\r\n FillShader,\r\n EffectShader,\r\n ShaderProperty,\r\n KnownShaderProperty,\r\n ShaderPropertyValues,\r\n} from '../attributes';\r\n\r\n// Expressions: the string form of a prop that follows a variable — `\"=4[g]+3\"`.\r\n// `expressionOps` carries recognition, parsing and compiling, so a host can lint,\r\n// complete or rewrite one without reimplementing the grammar.\r\nexport { expressionOps, ExpressionError } from '../document';\r\nexport type {\r\n ParsedExpression,\r\n ExpressionNode,\r\n ExpressionDialect,\r\n VariableResolver,\r\n} from '../document';\r\n\r\n// =============================================================\r\n// Node & Provider — the base scene-graph primitives\r\n//\r\n// `Node` is dimension-agnostic (tree, props, tweens, context, clock); `Node2D`\r\n// adds layout and 2D drawing, and is what a custom 2D node extends. `Node3D` and\r\n// its subclasses live in the 3D section below.\r\n// =============================================================\r\nexport {\r\n Node,\r\n Node2D,\r\n // A clip's root container: layout frame, background paint and camera in\r\n // one node. Every track builds into one sized to the viewport.\r\n Canvas2D,\r\n Provider,\r\n ThemeProvider,\r\n // Reaching another node by the id a `nodeRef` prop holds, and reading where it sits.\r\n findNode2D,\r\n frameIn,\r\n} from '../nodes';\r\nexport type {\r\n NodeProps,\r\n Node2DProps,\r\n // A slot a layout puts each child in beyond its box — see `Node2D._placementOf`.\r\n ChildPlacement,\r\n // A parent's own coordinates for its children's `x`/`y` — see `Node2D._planeOf`.\r\n ChildPlane,\r\n // A point an editor can drag to set a `Vector2` prop — see `Node2D._handles`.\r\n NodeHandle,\r\n Canvas2DProps,\r\n NodeConfig,\r\n NodeChildren,\r\n NodeDimension,\r\n ProviderProps,\r\n ThemeProviderProps,\r\n} from '../nodes';\r\n\r\n// =============================================================\r\n// Nodes — Geometry\r\n// =============================================================\r\nexport {\r\n PaintNode,\r\n ShapeNode,\r\n Rect,\r\n Ellipse,\r\n Path,\r\n // The document's `\"path\"`: its `data` is in the unit space of its own box,\r\n // where `Path` draws its `d` at face value.\r\n PathShape,\r\n Polygon,\r\n Polygram,\r\n BooleanGroup,\r\n MaskGroup,\r\n} from '../nodes';\r\nexport type {\r\n PaintProps,\r\n ShapeProps,\r\n RectProps,\r\n FlexSize,\r\n EllipseProps,\r\n PathProps,\r\n PathShapeProps,\r\n PolygonProps,\r\n PolygramProps,\r\n BooleanGroupProps,\r\n MaskGroupProps,\r\n} from '../nodes';\r\n// The operation/mode vocabularies behind `Boolean`/`Mask` are attribute types,\r\n// not node-prop types.\r\nexport type {\r\n BooleanOperation,\r\n MaskMode,\r\n MaskOptions,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// Nodes — Layout\r\n// =============================================================\r\nexport {\r\n Camera,\r\n // The stage's 2.5D camera for one subtree: its children orbited in depth.\r\n OrbitCamera,\r\n RotatedBox,\r\n} from '../nodes';\r\nexport type {\r\n CameraProps,\r\n OrbitCameraProps,\r\n} from '../nodes';\r\n\r\n// =============================================================\r\n// Nodes — Text\r\n// =============================================================\r\nexport {\r\n TextBase,\r\n Text,\r\n RichText,\r\n NumberNode,\r\n DefaultTextStyle,\r\n TextSelection,\r\n} from '../nodes';\r\nexport type {\r\n TextBaseProps,\r\n TextProps,\r\n RichTextProps,\r\n NumberProps,\r\n NumberFormat,\r\n DefaultTextStyleProps,\r\n TextSelectionProps,\r\n TextRange,\r\n SelectionOverrides,\r\n} from '../nodes';\r\nexport { textOps } from '../attributes';\r\nexport type {\r\n TextStyle,\r\n TextAlign,\r\n VerticalAlign,\r\n TextDecoration,\r\n TextCase,\r\n TextSpan,\r\n TextRun,\r\n FontStyle,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// Nodes — Media\r\n// =============================================================\r\nexport {\r\n Video,\r\n} from '../nodes';\r\nexport type {\r\n VideoProps,\r\n} from '../nodes';\r\n\r\n// =============================================================\r\n// Nodes — Audio\r\n// =============================================================\r\n// `SoundNode` plays a clip and `AudioBus` groups what feeds it — the third\r\n// scene graph, beside `Node2D` and `Node3D`. Levels are `Param`, so a fade is a\r\n// curve (`fadeIn`/`fadeOut`/`ramp`/`hold`) rather than a `to()`: sound is\r\n// scheduled once, ahead of time, not written once per frame.\r\nexport {\r\n NodeAudio,\r\n AudioBus,\r\n SoundNode,\r\n} from '../nodes';\r\nexport {\r\n Sound,\r\n AudioFilters,\r\n ramp,\r\n hold,\r\n fadeIn,\r\n fadeOut,\r\n isCurve,\r\n} from '../attributes';\r\nexport type {\r\n NodeAudioProps,\r\n AudioBusProps,\r\n SoundNodeProps,\r\n} from '../nodes';\r\nexport type {\r\n SoundProps,\r\n AudioRequest,\r\n // What a node's `declareAudio` is handed, and the clip it declares into it.\r\n AudioScope,\r\n AudioClip,\r\n AudioBusStop,\r\n AudioFilter,\r\n Param,\r\n Curve,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// 3D — the Canvas3D node and the Graphics3D API\r\n// =============================================================\r\n// There is one 3D node; everything inside it is described with `Graphics3D`.\r\n// `Geo`/`Mat`/`Tex` build the geometry/material/texture descriptors, and the lerps\r\n// are what make a Vector3/Euler/Quaternion prop interpolate rather than snap.\r\n// `Surface2D` is the 2D→3D bridge: a child of `Canvas3D` whose 2D content is\r\n// rasterized offscreen and bound to a material by `Tex.surface(name)`.\r\nexport {\r\n Canvas3D,\r\n // The 3D scene graph. `Node3D` is the base; the rest are what you write.\r\n Node3D,\r\n Group3D,\r\n Mesh3D,\r\n Box3D, Sphere3D, Plane3D, Cylinder3D, Cone3D, Torus3D, TorusKnot3D,\r\n Circle3D, Ring3D, Capsule3D, Polyhedron3D, Extrude3D, Lathe3D, Tube3D,\r\n Instances3D, Points3D, Line3D, Sprite3D, Model3D,\r\n AmbientLight3D, HemisphereLight3D, DirectionalLight3D,\r\n PointLight3D, SpotLight3D, AreaLight3D,\r\n Camera3D,\r\n Fog3D, Environment3D,\r\n} from '../nodes';\r\nexport {\r\n Graphics3D,\r\n Scene3D,\r\n RenderContext3D,\r\n Geo,\r\n Mat,\r\n Tex,\r\n lerpVector3,\r\n lerpEuler3,\r\n slerpQuaternion,\r\n quaternionFromEuler,\r\n normalizeQuaternion,\r\n resolveVector3,\r\n evaluateParametric,\r\n evaluateRoundedBox,\r\n resolveSurfaceSource,\r\n resolveFill3D,\r\n segmentsOf,\r\n resolveCameraPlacement,\r\n resolveShadows3D,\r\n shadowCasts,\r\n shadowReceives,\r\n} from '../render3d';\r\nexport type {\r\n Canvas3DProps,\r\n // A 3D parent's own coordinates for its children's position: see `Node3D._spaceOf`.\r\n ChildSpace3D,\r\n Node3DProps, Group3DProps, Mesh3DProps, Material3DProps,\r\n Box3DProps, Sphere3DProps, Plane3DProps, Cylinder3DProps, Cone3DProps,\r\n Torus3DProps, TorusKnot3DProps, Circle3DProps, Ring3DProps, Capsule3DProps,\r\n Polyhedron3DProps, Extrude3DProps, Lathe3DProps, Tube3DProps,\r\n Instances3DProps, Points3DProps, Line3DProps, Sprite3DProps, Model3DProps,\r\n AmbientLight3DProps, HemisphereLight3DProps, DirectionalLight3DProps,\r\n PointLight3DProps, SpotLight3DProps, AreaLight3DProps,\r\n Camera3DProps,\r\n Fog3DProps, Environment3DProps,\r\n} from '../nodes';\r\nexport type {\r\n Node3DRenderState,\r\n Graphics3DOp,\r\n Scene3DOp,\r\n Vector3,\r\n Vector3Input,\r\n Euler3,\r\n EulerOrder,\r\n Quaternion,\r\n Transform3D,\r\n Shadow3D,\r\n ShadowOptions3D,\r\n Faces3D,\r\n Blend3D,\r\n Shading3D,\r\n Segments3D,\r\n Sweep3D,\r\n Bevel3D,\r\n Fill3D,\r\n Geometry3D,\r\n BufferGeometry3D,\r\n Material3D,\r\n MaterialCommon3D,\r\n MeshShorthand3D,\r\n // What `Mesh3D.materialShorthand()` returns: a mesh node of your own overrides it.\r\n MaterialShorthand3D,\r\n Uniform3D,\r\n Texture3D,\r\n TextureOptions3D,\r\n SurfaceTexture3D,\r\n SurfaceSource3D,\r\n ResolvedSurfaceSource,\r\n LightData3D,\r\n CameraData3D,\r\n FogData3D,\r\n EnvironmentData3D,\r\n Shadows3D,\r\n ShadowSettings3D,\r\n ToneMapping3D,\r\n ToneSettings3D,\r\n PostEffect3D,\r\n LineMode3D,\r\n LineStroke3D,\r\n ModelAnimation3D,\r\n} from '../render3d';\r\n\r\n// =============================================================\r\n// Rendering — Graphics2D builder, RenderContext2D & asset declaration\r\n// =============================================================\r\nexport {\r\n Graphics2D,\r\n PathBuilder,\r\n Clip,\r\n toPathString,\r\n} from '../render';\r\nexport type {\r\n RenderContext2D,\r\n RenderPass2D,\r\n MeasureContext2D,\r\n TextBlockSource,\r\n // One recorded entry of `Graphics2D.ops()`.\r\n GraphicsOp,\r\n PathData,\r\n PathCommand,\r\n PathBounds,\r\n EllipseArc,\r\n} from '../render';\r\n// What a node's `declareAssets` declares into, and the async load a `loader` takes.\r\nexport type { AssetScope, LoaderFn } from '../assets';\r\n\r\n// =============================================================\r\n// Fill & Color\r\n// =============================================================\r\nexport {\r\n Fills,\r\n parseColor,\r\n resolveFill,\r\n fillOps,\r\n colorOps,\r\n} from '../attributes';\r\nexport type {\r\n Fill,\r\n FillChain,\r\n FillOptions,\r\n VideoFillOptions,\r\n // Placement of an image/video source inside the shape it paints:\r\n // `crop` -> `fit` -> `zoom` -> `anchor`, plus the raw-matrix escape hatch.\r\n MediaPlacementOptions,\r\n ImageFit,\r\n ImageCrop,\r\n ImageMatrix,\r\n FillResolved,\r\n // A custom SkSL shader as a fill. `coords` picks what `fragCoord` means;\r\n // uniforms are keyed by their declared name, and a `ShaderTexture` binds an\r\n // image to a `uniform shader` declaration.\r\n ShaderFillProp,\r\n ShaderFillResolved,\r\n ShaderFillCoords,\r\n ShaderTexture,\r\n SkSLUniformRecord,\r\n FractalNoiseBasis,\r\n // The colour type every fill, stroke, shadow and 3D material accepts —\r\n // a CSS string (incl. `oklch()`, theme tokens, `\"white/10\"`) or a\r\n // pre-normalized RGBA tuple.\r\n Color,\r\n NormalizedColor,\r\n BlendMode,\r\n FillSpace,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// Shape Attributes — Stroke, Shadow, Corners\r\n// =============================================================\r\nexport {\r\n resolveStroke,\r\n strokeOps,\r\n resolveShadow,\r\n shadowOps,\r\n resolveCorners,\r\n cornerRadiusOps,\r\n cornerStyleOps,\r\n // Parsing, measuring, sampling, trimming and morphing a path, and the\r\n // anchor model (`VectorPath`) a pen tool edits.\r\n pathOps,\r\n} from '../attributes';\r\nexport type {\r\n PathSampler,\r\n PathAnchor,\r\n PathSubpath,\r\n VectorPath,\r\n Stroke,\r\n StrokeProp,\r\n StrokeAlign,\r\n StrokeCap,\r\n StrokeMarker,\r\n StrokeEnd,\r\n StrokeJoin,\r\n StrokeResolved,\r\n Shadow,\r\n ShadowProp,\r\n ShadowResolved,\r\n Corners,\r\n CornerStyle,\r\n CornerStyleResolved,\r\n CornerRadiusResolved,\r\n NodeEffect,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// Layout Attributes — Vector2, Size, Insets, Alignment, Flow\r\n//\r\n// `flowOps` is the layout a container runs on its children, as plain data in\r\n// and boxes out — so a custom node can lay out what it draws the same way.\r\n// =============================================================\r\nexport {\r\n lerpVector2,\r\n sizeInputOps,\r\n insetsOps,\r\n alignmentOps,\r\n} from '../attributes';\r\n// `flowOps` itself is the layout package's, not the attribute layer's —\r\n// `../attributes`'s own `./layout` only carries Vector2/Size2D/Insets/Alignment.\r\nexport { flowOps } from '../layout';\r\nexport type {\r\n Vector2,\r\n Size2D,\r\n Insets,\r\n // What a `padding`-style prop accepts, before `insetsOps` resolves it.\r\n InsetsProps,\r\n InsetsResolved,\r\n AlignmentKey,\r\n Alignment,\r\n} from '../attributes';\r\nexport type {\r\n FlowMode,\r\n GapSize,\r\n FlowResolved,\r\n FlowProps,\r\n FlowSettings,\r\n LayoutItem,\r\n FlowSpace,\r\n FlowMeasure,\r\n FlowLine,\r\n // What an overriding `measure(constraints, scope)` is handed.\r\n SizeConstraints,\r\n} from '../layout';\r\n\r\n// =============================================================\r\n// 2.5D space — the stage's `space3D` camera\r\n//\r\n// `space3dOps` is the camera's own projection, for a host drawing over the\r\n// picture (a gizmo aiming the camera) rather than keeping a copy of it.\r\n// `SpaceCamera` is what a node returns from `_spaceCamera()` to open a 2.5D\r\n// space of its own.\r\n// =============================================================\r\nexport { space3dOps } from '../attributes/layout/space3d';\r\nexport type { LookAt, SpaceCamera, SpaceCameraProps, SpacePoint } from '../attributes/layout/space3d';\r\n\r\n// =============================================================\r\n// Effects & Media Adjustments\r\n// =============================================================\r\nexport {\r\n Effects,\r\n EffectChain,\r\n Adjustments,\r\n VideoAdjustments,\r\n AdjustmentChain,\r\n VideoAdjustmentChain,\r\n /** @deprecated Renamed to {@link Adjustments}. Removed in the next major. */\r\n ImageFilters,\r\n /** @deprecated Renamed to {@link VideoAdjustments}. Removed in the next major. */\r\n VideoFilters,\r\n} from '../attributes';\r\n\r\nexport type {\r\n /** The `effects` prop type — what a node actually accepts. */\r\n Effect,\r\n EffectMode,\r\n EffectAxis,\r\n EffectSurface,\r\n EffectOptions,\r\n /** What an image fill's `preset.adjustments` accepts — one, a list, or a chain. */\r\n ImageAdjustment,\r\n VideoAdjustment,\r\n /** The node effects that also work as a media adjustment — see {@link Adjustments}. */\r\n EffectAdjustment,\r\n MediaAdjustment,\r\n VideoOnlyAdjustment,\r\n} from '../attributes';\r\n\r\n/**\r\n * Per-builder options. Every effect builder takes exactly one argument: one of\r\n * these, or the dominant scalar it wraps.\r\n */\r\nexport type {\r\n BlurOptions,\r\n DirectionalBlurOptions,\r\n GrayscaleOptions,\r\n PixelateOptions,\r\n BulgeOptions,\r\n MagnifyOptions,\r\n BloomOptions,\r\n VintageOptions,\r\n ChromaticAberrationOptions,\r\n InvertOptions,\r\n ScatterOptions,\r\n PosterizeOptions,\r\n MotionBlurOptions,\r\n ShaderEffectOptions,\r\n OutlineOptions,\r\n VignetteOptions,\r\n GrainOptions,\r\n SharpenOptions,\r\n EdgesOptions,\r\n ThresholdOptions,\r\n RadialBlurOptions,\r\n HalftoneOptions,\r\n DitherOptions,\r\n DuotoneOptions,\r\n CurvesOptions,\r\n ColorAdjustmentOptions,\r\n RgbShiftOptions,\r\n ScanlinesOptions,\r\n BlockDisplaceOptions,\r\n BitCrushOptions,\r\n AsciiOptions,\r\n StreakOptions,\r\n GlowOptions,\r\n OilPaintOptions,\r\n WaveOptions,\r\n TwirlOptions,\r\n ProgressiveBlurOptions,\r\n KaleidoscopeOptions,\r\n GlassOptions,\r\n LutOptions,\r\n} from '../attributes';\r\n\r\n/**\r\n * Per-builder options for the filters that exist only as filters. Everything\r\n * else on {@link Adjustments} takes the matching effect options above, minus\r\n * `mode` — a filter is on the fill's own pixels, so there is no backdrop to\r\n * point it at.\r\n */\r\nexport type {\r\n BlurFilterOptions,\r\n GrayscaleFilterOptions,\r\n AlphaFilterOptions,\r\n ExposureFilterOptions,\r\n ColorMatrixFilterOptions,\r\n CurvesFilterOptions,\r\n ColorAdjustmentFilterOptions,\r\n PosterizeTimeFilterOptions,\r\n VideoEchoFilterOptions,\r\n} from '../attributes';\r\n\r\n/** Effect data types, for naming an effect value or building one by hand. */\r\nexport type {\r\n BlurEffect,\r\n DirectionalBlurEffect,\r\n GrayscaleEffect,\r\n PixelateEffect,\r\n BulgeEffect,\r\n MagnifyEffect,\r\n BloomEffect,\r\n VintageEffect,\r\n ChromaticAberrationEffect,\r\n InvertEffect,\r\n InvertChannel,\r\n ScatterEffect,\r\n PosterizeEffect,\r\n MotionBlurEffect,\r\n MotionBlurAlignment,\r\n ShaderEffect,\r\n SkSLUniform,\r\n SkSLUniformValue,\r\n OutlineEffect,\r\n OutlinePosition,\r\n VignetteEffect,\r\n GrainEffect,\r\n SharpenEffect,\r\n EdgesEffect,\r\n EdgeKernel,\r\n ThresholdEffect,\r\n RadialBlurEffect,\r\n RadialBlurStyle,\r\n HalftoneEffect,\r\n HalftoneShape,\r\n HalftoneSeparation,\r\n DitherEffect,\r\n DitherMatrix,\r\n DuotoneEffect,\r\n CurvesEffect,\r\n ColorAdjustmentEffect,\r\n RgbShiftEffect,\r\n ScanlinesEffect,\r\n BlockDisplaceEffect,\r\n BitCrushEffect,\r\n BitCrushPalette,\r\n AsciiEffect,\r\n AsciiCharset,\r\n StreakEffect,\r\n GlowEffect,\r\n GlowChannel,\r\n GlowLoopStyle,\r\n GlowOriginal,\r\n GlowTint,\r\n OilPaintEffect,\r\n WaveEffect,\r\n WaveShape,\r\n TwirlEffect,\r\n ProgressiveBlurEffect,\r\n ProgressiveBlurShape,\r\n KaleidoscopeEffect,\r\n GlassEffect,\r\n LutEffect,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// Animation — interpolation\r\n//\r\n// There are no `sequence`/`parallel`/`wait` primitives: a command carries its\r\n// own placement, so sequencing is `at + duration`, running two together is a\r\n// shared `at`, and a wait is a gap between them.\r\n// =============================================================\r\nexport {\r\n lerpNumber,\r\n} from '../tween';\r\nexport type {\r\n AnimationTarget,\r\n Steppable,\r\n TweenStepper,\r\n LerpFunction,\r\n TweenOptions,\r\n} from '../tween';\r\n\r\n// An animation as a **value** rather than as control flow: a declared duration\r\n// plus `at(t)`, so a host can ask what it looks like at a time instead of\r\n// running it to one. That is what lets a host place one on a timeline, and what\r\n// makes a scene scrub in constant time rather than replay. `@command` marks the\r\n// methods on a node that return one, and is what the command registry — and a\r\n// host listing what a node can do — reads.\r\n//\r\n// One command shape, always: `node.to(a, 1)` is a single command, not a builder\r\n// you can append to. Two of them are sequenced by where they sit on the\r\n// timeline, which is what makes a scene's shape editable rather than implied by\r\n// the order of calls in a function body.\r\nexport {\r\n command,\r\n driveCommand,\r\n getCommandMeta,\r\n isCommand,\r\n makeCommand,\r\n commandSequence,\r\n commandParallel,\r\n loopCommand,\r\n} from '../tween';\r\nexport type { Command, CommandArgs, CommandMeta, CommandOptions } from '../tween';\r\n\r\n// =============================================================\r\n// Animation — Easing\r\n// =============================================================\r\nexport {\r\n linear,\r\n easeIn,\r\n easeOut,\r\n easeInOut\r\n} from '../tween';\r\nexport type {\r\n EasingFunction,\r\n EaseParams,\r\n StandardEase\r\n} from '../tween';\r\n\r\n// =============================================================\r\n// Node Property Decorators\r\n// =============================================================\r\nexport {\r\n property,\r\n // Attribute-typed variants: `@property` with the mapper/tween pair for a\r\n // known attribute already filled in, so a custom node declares a paint or\r\n // layout prop without importing the resolver/lerp pair behind it.\r\n fillProperty,\r\n strokeProperty,\r\n shadowProperty,\r\n effectsProperty,\r\n colorProperty,\r\n cornerRadiusProperty,\r\n cornerStyleProperty,\r\n pathProperty,\r\n insetsProperty,\r\n alignmentProperty,\r\n vector2Property,\r\n sizeProperty,\r\n textProperty,\r\n} from '../attributes';\r\nexport type {\r\n PropOptions,\r\n AttributePropOptions,\r\n} from '../attributes';\r\n\r\n// =============================================================\r\n// Utilities\r\n// =============================================================\r\nexport {\r\n createRef,\r\n clamp,\r\n generateList,\r\n createContext,\r\n ContextMap,\r\n Random,\r\n SeedGenerator,\r\n parseCSV,\r\n parseData,\r\n} from '../util';\r\nexport type {\r\n Reference,\r\n RefTarget,\r\n Context,\r\n DataRecord,\r\n ParseCSVOptions,\r\n} from '../util';\r\n\r\n// =============================================================\r\n// Editor selection — node boxes, hit testing, transient overrides\r\n// =============================================================\r\n// The geometry an editor needs to lay a selection gizmo over the canvas: where a\r\n// node's pixels landed, and which node is under a point. Both are pure functions\r\n// over a scene's node tree, so a host can use them directly; a player embedding\r\n// reaches the same thing through `useMotionPlayer` (`getNodeBox`, `pickNode`,\r\n// `setNodeOverride`). Points and boxes are in viewport space — origin at the\r\n// viewport centre, y-up.\r\n//\r\n// These genuinely live in `../runtime` (node hit-testing and the transient\r\n// override store are runtime concerns) — deep-imported from their concrete\r\n// files, never the runtime barrel itself.\r\nexport { nodeTypeIsA, parentIssue, placementIssues, siblingIssue } from '../document/placement';\r\nexport type { PlacementIssue, PlacementOptions } from '../document/placement';\r\n\r\nexport {\r\n nodeBox,\r\n pickNode,\r\n collectBoxes,\r\n parentPlanePointAt,\r\n childPlanePointAt,\r\n reparentPlacementAt,\r\n nodeHandlesAt,\r\n handleValueAt,\r\n} from '../runtime/node-picking';\r\nexport type {\r\n NodeBox,\r\n ReparentPlacement,\r\n} from '../runtime/node-picking';\r\nexport type {\r\n NodeOverride,\r\n} from '../runtime/playback-controller';\r\nexport type {\r\n TreeState,\r\n} from '../project';\r\n/** @deprecated Kept until 1.0; see `../renamed-scene-names`. */\r\nexport type { SceneDocument, SceneEffect } from '../renamed-scene-names';\r\n"]}
|
|
@@ -38,6 +38,8 @@ export interface CommandMeta {
|
|
|
38
38
|
* (`data`/`duration`/`easing`, not `index` or `wobble`).
|
|
39
39
|
*/
|
|
40
40
|
args?: readonly CommandArg[];
|
|
41
|
+
/** Withdrawn by a subclass: unpublished, still dispatched. See `withdraw`. */
|
|
42
|
+
withdrawn?: boolean;
|
|
41
43
|
}
|
|
42
44
|
export interface CommandOptions {
|
|
43
45
|
/** Publishes the method under another key, for a name the method cannot take (a prop, an inherited method). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-decorator.d.ts","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAErF;;;;;;;;;;;;;;;GAeG;AAEH,kLAAkL;AAClL,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IACxD,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,oBAAoB,CAAC;AAEvD,4EAA4E;AAC5E,eAAO,MAAM,YAAY,eAAwB,CAAC;AAElD,MAAM,WAAW,WAAW;IACxB,sGAAsG;IACtG,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"command-decorator.d.ts","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAErF;;;;;;;;;;;;;;;GAeG;AAEH,kLAAkL;AAClL,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IACxD,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,oBAAoB,CAAC;AAEvD,4EAA4E;AAC5E,eAAO,MAAM,YAAY,eAAwB,CAAC;AAElD,MAAM,WAAW,WAAW;IACxB,sGAAsG;IACtG,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC3B,+GAA+G;IAC/G,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CAE9D;AAED,+BAA+B;AAC/B,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE,cAAc,IAC3B,QAAQ,MAAM,EAAE,aAAa,MAAM,GAAG,MAAM,KAAG,IAAI,CAevE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-decorator.js","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mCAAmC,CAAC;AA4BrF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"command-decorator.js","sourceRoot":"","sources":["../../src/tween/command-decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,mCAAmC,CAAC;AA4BrF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AA2BlD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC3C,OAAO,WAAW,CAAc,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED,+BAA+B;AAC/B,MAAM,UAAU,OAAO,CAAC,OAAwB;IAC5C,OAAO,UAAU,MAAc,EAAE,WAA4B;QACzD,MAAM,MAAM,GAAG,WAAqB,CAAC;QACrC,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,MAAM,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC;YAC7D,MAAkC,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;QAC3D,CAAC;QACD,MAAM,IAAI,GAAI,MAAkC,CAAC,YAAY,CAAkB,CAAC;QAChF,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;YAAE,OAAO;QAC1C,IAAI,CAAC,IAAI,CAAC;YACN,GAAG;YACH,MAAM;YACN,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC","sourcesContent":["import { mostDerived, type PropertyEditor } from \"@/attributes/properties/decorator\";\r\n\r\n/**\r\n * Marks a method as a command: a named, parameterised animation a host can\r\n * offer, place on a timeline and store by name. Metadata only.\r\n *\r\n * ```ts\r\n * @command({ args: [\"index\"] })\r\n * showSeries({ data, duration = 1, easing }: CommandArgs<{ index: number }>): Command<ChartProps> {\r\n * …\r\n * }\r\n * ```\r\n *\r\n * `args` maps a stored command's `params` object onto `data`'s keys — see\r\n * {@link CommandMeta.args}. Every command takes one {@link CommandArgs}\r\n * argument rather than positional params, so a manifest can read its shape\r\n * off `T` directly.\r\n */\r\n\r\n/** One argument a command takes, in the same vocabulary a property uses ({@link PropertyEditor}) — a range, an enum, a unit. A bare string is a name with nothing else to say. */\r\nexport interface CommandArgDescriptor extends PropertyEditor {\r\n /** The key under a `CommandSpec`'s `params` this is read from. */\r\n key: string;\r\n default?: unknown;\r\n}\r\n\r\nexport type CommandArg = string | CommandArgDescriptor;\r\n\r\n/** Symbol under which `@command` metadata is stored on class prototypes. */\r\nexport const COMMAND_META = Symbol(\"commandMeta\");\r\n\r\nexport interface CommandMeta {\r\n /** The key a host stores and dispatches on: the method name unless `@command({ key })` renamed it. */\r\n key: string;\r\n /** The decorated method, which dispatching {@link key} calls. */\r\n method: string;\r\n /** Display name; built-ins leave this unset and localize by {@link key} instead. */\r\n name?: string;\r\n /**\r\n * Keys of `params` that become `data`'s fields, in a document. Written here\r\n * rather than derived from the method's own parameter names, which a\r\n * minifier mangles and which don't match the document vocabulary anyway\r\n * (`data`/`duration`/`easing`, not `index` or `wobble`).\r\n */\r\n args?: readonly CommandArg[];\r\n /** Withdrawn by a subclass: unpublished, still dispatched. See `withdraw`. */\r\n withdrawn?: boolean;\r\n}\r\n\r\nexport interface CommandOptions {\r\n /** Publishes the method under another key, for a name the method cannot take (a prop, an inherited method). */\r\n key?: string;\r\n name?: string;\r\n args?: readonly CommandArg[];\r\n}\r\n\r\n/**\r\n * Every `@command` on an instance's class, inherited included, base → subclass.\r\n * A subclass that redeclares a key replaces the inherited declaration — method,\r\n * name and args — at the position the base gave it.\r\n */\r\nexport function getCommandMeta(instance: object): CommandMeta[] {\r\n return mostDerived<CommandMeta>(instance, COMMAND_META);\r\n}\r\n\r\n/** See the module docblock. */\r\nexport function command(options?: CommandOptions) {\r\n return function (target: object, propertyKey: string | symbol): void {\r\n const method = propertyKey as string;\r\n const key = options?.key ?? method;\r\n if (!Object.prototype.hasOwnProperty.call(target, COMMAND_META)) {\r\n (target as Record<symbol, unknown>)[COMMAND_META] = [];\r\n }\r\n const list = (target as Record<symbol, unknown>)[COMMAND_META] as CommandMeta[];\r\n if (list.some(m => m.key === key)) return;\r\n list.push({\r\n key,\r\n method,\r\n ...(options?.name ? { name: options.name } : {}),\r\n ...(options?.args ? { args: options.args } : {}),\r\n });\r\n };\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/tween/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AAmCxE,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,CAAU;IAChC,OAAO,OAAQ,CAAa,EAAE,EAAE,KAAK,UAAU;WACxC,OAAQ,CAAa,EAAE,QAAQ,KAAK,QAAQ,CAAC;AACxD,CAAC;AAOD,sIAAsI;AACtI,MAAM,UAAU,WAAW,CACvB,MAAwB,EACxB,EAA6B,EAC7B,QAAgB,EAChB,MAAuB;IAEvB,MAAM,KAAK,GAAG,CAAC,CAAS,EAAc,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,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K,CAAC;QACjB,CAAC;QAED,QAAQ;YACJ,IAAI,OAAO,GAAG,CAAC,CAAC;YAChB,OAAO;gBACH,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE;oBAChB,OAAO,GAAG,CAAC,CAAC;oBACZ,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnC,CAAC;gBACD,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;oBAC7B,OAAO,IAAI,EAAE,CAAC;oBACd,MAAM,IAAI,GAAG,OAAO,IAAI,QAAQ,CAAC;oBACjC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,CAAC;gBAChB,CAAC;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\nimport { EasingFunction } from \"./ease/type\";\nimport { loopPasses, loopPhase, loopSpan, type LoopSpec } from \"./loop\";\nimport { LerpFunction } from \"./lerp\";\nimport { Steppable, TweenStepper } from \"./stepper\";\n\n/**\n * A named animation, as a value: `at(t)` is a pure function of normalized time,\n * so a host can ask what frame N looks like without replaying frames 0..N-1.\n *\n * `at` is only pure once *built* — a factory reads the node's current props to\n * fix its start value, so a host evaluating out of order must build commands in\n * timeline order, leaving each node in the state the previous command left it.\n */\nexport interface Command<P = Record<string, unknown>> extends Steppable {\n readonly duration: number;\n at(t: number): Partial<P>;\n}\n\n/**\n * The single argument a `@command()` method takes: its own params under `data`,\n * plus shared timing. One object (not positional args) so a manifest can read a\n * command's shape off `T` directly.\n *\n * `duration`/`data` are optional for a command with a synchronous mode\n * (`restore`, `addChildAt`) or nothing to carry (`restore`).\n *\n * `R` differs from `T` when `data` is loose author input (`Fill`) but `lerp`\n * operates on its resolved form (`FillResolved[]`).\n */\nexport interface CommandArgs<T = Record<string, unknown>, R = T> {\n data?: T;\n duration?: number;\n easing?: EasingFunction;\n lerp?: LerpFunction<R>;\n}\n\n/** True when `x` is a {@link Command} rather than a plain object. */\nexport function isCommand(x: unknown): x is Command {\n return typeof (x as Command)?.at === \"function\"\n && typeof (x as Command)?.duration === \"number\";\n}\n\n/** What a {@link Command} writes its evaluated props onto. */\nexport interface CommandTarget<P> {\n set(props: Partial<P>): void;\n}\n\n/** Build a {@link Command} from a pure `t → props` function. `easing` is applied inside, so `at` itself takes raw normalized time. */\nexport function makeCommand<P>(\n target: CommandTarget<P>,\n at: (t: number) => Partial<P>,\n duration: number,\n easing?: EasingFunction,\n): Command<P> {\n const value = (t: number): Partial<P> => at(easing ? easing(clamp01(t)) : clamp01(t));\n return fromValue(target, duration, value);\n}\n\n/**\n * A {@link Command} whose product is a side effect rather than props — for state\n * a `set()` can't reach (a private field, an array element).\n *\n * `apply` must be a pure function of `t`: it can run for any `t`, any number of\n * times, in any order. Accumulating (`x += …`) instead of assigning from `t`\n * looks right forwards and drifts the instant anything scrubs.\n */\nexport function driveCommand(\n duration: number,\n apply: (t: number) => void,\n easing?: EasingFunction,\n): Command<Record<string, never>> {\n const sink: CommandTarget<Record<string, never>> = { set: () => { } };\n return makeCommand(sink, (t) => {\n apply(t);\n return {};\n }, duration, easing);\n}\n\n/**\n * Repeat `command`, as one seekable {@link Command} that lasts for every pass.\n *\n * Wrapping rather than a parameter on each command is what makes this work for\n * every command there is: the inner one is asked for the frame at a pass-local\n * `t`, so it never learns it is being repeated, and its easing applies per pass\n * — which is what \"three bounces\" means, rather than one ease stretched over\n * three of them.\n *\n * `fill` is the seconds an unlimited loop (`count: null`) may cover; it defaults\n * to a single pass, since a command built outside a timeline has no clip to fill.\n * A stamp (`duration === 0`) is returned untouched: there is no pass to repeat.\n */\nexport function loopCommand<P>(command: Command<P>, loop: LoopSpec, fill?: number): Command<P> {\n const one = command.duration;\n if (one <= 0 || loopPasses(loop) <= 1) return command;\n const duration = loopSpan(loop, one, fill);\n const value = (t: number): Partial<P> => command.at(loopPhase(loop, clamp01(t) * duration, one));\n\n return {\n duration,\n at: value,\n _stepper(): TweenStepper {\n let elapsed = 0;\n return {\n seek: (e: number) => {\n elapsed = e;\n value(e / duration);\n },\n advance: (dt: number): boolean => {\n elapsed += dt;\n const done = elapsed >= duration;\n value(done ? 1 : elapsed / duration);\n return done;\n },\n };\n },\n };\n}\n\n/**\n * Run `commands` one after another as a single seekable {@link Command}.\n *\n * A finished child holds at `at(1)` rather than being dropped, so a prop\n * written early keeps its value once its step ends.\n */\nexport function commandSequence<P>(\n target: CommandTarget<P>,\n ...commands: Command<P>[]\n): Command<P> {\n const duration = commands.reduce((sum, c) => sum + c.duration, 0);\n\n return fromValue(target, duration, (t) => {\n const elapsed = t * duration;\n const props: Partial<P> = {};\n let cursor = 0;\n for (const command of commands) {\n if (elapsed < cursor) break;\n const local = command.duration > 0 ? (elapsed - cursor) / command.duration : 1;\n Object.assign(props, command.at(clamp01(local)));\n cursor += command.duration;\n }\n return props;\n });\n}\n\n/** Run `commands` together as one {@link Command}, ending when the longest does. Later commands win on a shared prop. */\nexport function commandParallel<P>(\n target: CommandTarget<P>,\n ...commands: Command<P>[]\n): Command<P> {\n const duration = commands.reduce((max, c) => Math.max(max, c.duration), 0);\n\n return fromValue(target, duration, (t) => {\n const elapsed = t * duration;\n const props: Partial<P> = {};\n for (const command of commands) {\n const local = command.duration > 0 ? elapsed / command.duration : 1;\n Object.assign(props, command.at(clamp01(local)));\n }\n return props;\n });\n}\n\n/** Wrap a pure `t → props` function into the full {@link Command} surface. */\nfunction fromValue<P>(\n target: CommandTarget<P>,\n duration: number,\n value: (t: number) => Partial<P>,\n): Command<P> {\n const progress = (elapsed: number): number => (duration > 0 ? elapsed / duration : 1);\n\n return {\n duration,\n // Writes as well as returns. A host evaluating a timeline calls `at(t)`\n // and discards what comes back — `ToCommand` has always applied its step\n // as a side effect, and a `Command` built from a `t → props` function\n // that only *described* its frame was silently inert everywhere a\n // document is seeked, while behaving correctly under `_stepper`.\n at(t: number): Partial<P> {\n const props = value(t);\n target.set(props);\n return props;\n },\n\n _stepper(): TweenStepper {\n let elapsed = 0;\n return {\n seek: (e: number) => {\n elapsed = e;\n target.set(value(progress(e)));\n },\n advance: (dt: number): boolean => {\n elapsed += dt;\n const done = elapsed >= duration;\n target.set(value(done ? 1 : progress(elapsed)));\n return done;\n },\n };\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/tween/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AAmCxE,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,CAAU;IAChC,OAAO,OAAQ,CAAa,EAAE,EAAE,KAAK,UAAU;WACxC,OAAQ,CAAa,EAAE,QAAQ,KAAK,QAAQ,CAAC;AACxD,CAAC;AAOD,sIAAsI;AACtI,MAAM,UAAU,WAAW,CACvB,MAAwB,EACxB,EAA6B,EAC7B,QAAgB,EAChB,MAAuB;IAEvB,MAAM,KAAK,GAAG,CAAC,CAAS,EAAc,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACtF,OAAO,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CACxB,QAAgB,EAChB,KAA0B,EAC1B,MAAuB;IAEvB,MAAM,IAAI,GAAyC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IACtE,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE;Q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C,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,CAAC;gBAChB,CAAC;aACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\r\nimport { EasingFunction } from \"./ease/type\";\r\nimport { loopPasses, loopPhase, loopSpan, type LoopSpec } from \"./loop\";\r\nimport { LerpFunction } from \"./lerp\";\r\nimport { Steppable, TweenStepper } from \"./stepper\";\r\n\r\n/**\r\n * A named animation, as a value: `at(t)` is a pure function of normalized time,\r\n * so a host can ask what frame N looks like without replaying frames 0..N-1.\r\n *\r\n * `at` is only pure once *built* — a factory reads the node's current props to\r\n * fix its start value, so a host evaluating out of order must build commands in\r\n * timeline order, leaving each node in the state the previous command left it.\r\n */\r\nexport interface Command<P = Record<string, unknown>> extends Steppable {\r\n readonly duration: number;\r\n at(t: number): Partial<P>;\r\n}\r\n\r\n/**\r\n * The single argument a `@command()` method takes: its own params under `data`,\r\n * plus shared timing. One object (not positional args) so a manifest can read a\r\n * command's shape off `T` directly.\r\n *\r\n * `duration`/`data` are optional for a command with a synchronous mode\r\n * (`restore`, `addChildAt`) or nothing to carry (`restore`).\r\n *\r\n * `R` differs from `T` when `data` is loose author input (`Fill`) but `lerp`\r\n * operates on its resolved form (`FillResolved[]`).\r\n */\r\nexport interface CommandArgs<T = Record<string, unknown>, R = T> {\r\n data?: T;\r\n duration?: number;\r\n easing?: EasingFunction;\r\n lerp?: LerpFunction<R>;\r\n}\r\n\r\n/** True when `x` is a {@link Command} rather than a plain object. */\r\nexport function isCommand(x: unknown): x is Command {\r\n return typeof (x as Command)?.at === \"function\"\r\n && typeof (x as Command)?.duration === \"number\";\r\n}\r\n\r\n/** What a {@link Command} writes its evaluated props onto. */\r\nexport interface CommandTarget<P> {\r\n set(props: Partial<P>): void;\r\n}\r\n\r\n/** Build a {@link Command} from a pure `t → props` function. `easing` is applied inside, so `at` itself takes raw normalized time. */\r\nexport function makeCommand<P>(\r\n target: CommandTarget<P>,\r\n at: (t: number) => Partial<P>,\r\n duration: number,\r\n easing?: EasingFunction,\r\n): Command<P> {\r\n const value = (t: number): Partial<P> => at(easing ? easing(clamp01(t)) : clamp01(t));\r\n return fromValue(target, duration, value);\r\n}\r\n\r\n/**\r\n * A {@link Command} whose product is a side effect rather than props — for state\r\n * a `set()` can't reach (a private field, an array element).\r\n *\r\n * `apply` must be a pure function of `t`: it can run for any `t`, any number of\r\n * times, in any order. Accumulating (`x += …`) instead of assigning from `t`\r\n * looks right forwards and drifts the instant anything scrubs.\r\n */\r\nexport function driveCommand(\r\n duration: number,\r\n apply: (t: number) => void,\r\n easing?: EasingFunction,\r\n): Command<Record<string, never>> {\r\n const sink: CommandTarget<Record<string, never>> = { set: () => { } };\r\n return makeCommand(sink, (t) => {\r\n apply(t);\r\n return {};\r\n }, duration, easing);\r\n}\r\n\r\n/**\r\n * Repeat `command`, as one seekable {@link Command} that lasts for every pass.\r\n *\r\n * Wrapping rather than a parameter on each command is what makes this work for\r\n * every command there is: the inner one is asked for the frame at a pass-local\r\n * `t`, so it never learns it is being repeated, and its easing applies per pass\r\n * — which is what \"three bounces\" means, rather than one ease stretched over\r\n * three of them.\r\n *\r\n * `fill` is the seconds an unlimited loop (`count: null`) may cover; it defaults\r\n * to a single pass, since a command built outside a timeline has no clip to fill.\r\n * A stamp (`duration === 0`) is returned untouched: there is no pass to repeat.\r\n */\r\nexport function loopCommand<P>(command: Command<P>, loop: LoopSpec, fill?: number): Command<P> {\r\n const one = command.duration;\r\n if (one <= 0 || loopPasses(loop) <= 1) return command;\r\n const duration = loopSpan(loop, one, fill);\r\n const value = (t: number): Partial<P> => command.at(loopPhase(loop, clamp01(t) * duration, one));\r\n\r\n return {\r\n duration,\r\n at: value,\r\n _stepper(): TweenStepper {\r\n let elapsed = 0;\r\n return {\r\n seek: (e: number) => {\r\n elapsed = e;\r\n value(e / duration);\r\n },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n const done = elapsed >= duration;\r\n value(done ? 1 : elapsed / duration);\r\n return done;\r\n },\r\n };\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Run `commands` one after another as a single seekable {@link Command}.\r\n *\r\n * A finished child holds at `at(1)` rather than being dropped, so a prop\r\n * written early keeps its value once its step ends.\r\n */\r\nexport function commandSequence<P>(\r\n target: CommandTarget<P>,\r\n ...commands: Command<P>[]\r\n): Command<P> {\r\n const duration = commands.reduce((sum, c) => sum + c.duration, 0);\r\n\r\n return fromValue(target, duration, (t) => {\r\n const elapsed = t * duration;\r\n const props: Partial<P> = {};\r\n let cursor = 0;\r\n for (const command of commands) {\r\n if (elapsed < cursor) break;\r\n const local = command.duration > 0 ? (elapsed - cursor) / command.duration : 1;\r\n Object.assign(props, command.at(clamp01(local)));\r\n cursor += command.duration;\r\n }\r\n return props;\r\n });\r\n}\r\n\r\n/** Run `commands` together as one {@link Command}, ending when the longest does. Later commands win on a shared prop. */\r\nexport function commandParallel<P>(\r\n target: CommandTarget<P>,\r\n ...commands: Command<P>[]\r\n): Command<P> {\r\n const duration = commands.reduce((max, c) => Math.max(max, c.duration), 0);\r\n\r\n return fromValue(target, duration, (t) => {\r\n const elapsed = t * duration;\r\n const props: Partial<P> = {};\r\n for (const command of commands) {\r\n const local = command.duration > 0 ? elapsed / command.duration : 1;\r\n Object.assign(props, command.at(clamp01(local)));\r\n }\r\n return props;\r\n });\r\n}\r\n\r\n/** Wrap a pure `t → props` function into the full {@link Command} surface. */\r\nfunction fromValue<P>(\r\n target: CommandTarget<P>,\r\n duration: number,\r\n value: (t: number) => Partial<P>,\r\n): Command<P> {\r\n const progress = (elapsed: number): number => (duration > 0 ? elapsed / duration : 1);\r\n\r\n return {\r\n duration,\r\n // Writes as well as returns. A host evaluating a timeline calls `at(t)`\r\n // and discards what comes back — `ToCommand` has always applied its step\r\n // as a side effect, and a `Command` built from a `t → props` function\r\n // that only *described* its frame was silently inert everywhere a\r\n // document is seeked, while behaving correctly under `_stepper`.\r\n at(t: number): Partial<P> {\r\n const props = value(t);\r\n target.set(props);\r\n return props;\r\n },\r\n\r\n _stepper(): TweenStepper {\r\n let elapsed = 0;\r\n return {\r\n seek: (e: number) => {\r\n elapsed = e;\r\n target.set(value(progress(e)));\r\n },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n const done = elapsed >= duration;\r\n target.set(value(done ? 1 : progress(elapsed)));\r\n return done;\r\n },\r\n };\r\n },\r\n };\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGxC,MAAM,MAAM,YAAY,GAClB,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAC7C,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtD,4DAA4D;AAC5D,eAAO,MAAM,YAAY,EAAE,YAAqB,CAAC;AAEjD,MAAM,WAAW,UAAU;IACvB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAmDnD,eAAO,MAAM,MAAM,QAAO,cAAwD,CAAC;AAEnF,eAAO,MAAM,MAAM,GAAI,SAAS,UAAU,KAAG,cAG5C,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,SAAS,UAAU,KAAG,cAG7C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,SAAS,UAAU,KAAG,cAiB/C,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { clamp01 } from "../../util/clamp.js";
|
|
2
|
+
import { describeEase } from "./describe.js";
|
|
2
3
|
/** Default ease family used when no `type` is specified. */
|
|
3
4
|
export const DEFAULT_EASE = 'quad';
|
|
4
5
|
const PI = Math.PI;
|
|
@@ -47,14 +48,16 @@ const inMath = {
|
|
|
47
48
|
return 1 - bounceOut(1 - t);
|
|
48
49
|
},
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
/** A key-ready description of a standard ease: its direction, family and every tuning value. */
|
|
52
|
+
const describeConfig = (direction, config) => `${direction}:${config.type}:${config.overshoot ?? '_'}:${config.amplitude ?? '_'}:${config.period ?? '_'}`;
|
|
53
|
+
export const linear = () => describeEase((t) => clamp01(t), 'lin');
|
|
51
54
|
export const easeIn = (params) => {
|
|
52
55
|
const config = parseConfig(params);
|
|
53
|
-
return (t) => inMath[config.type](clamp01(t), config);
|
|
56
|
+
return describeEase((t) => inMath[config.type](clamp01(t), config), describeConfig('in', config));
|
|
54
57
|
};
|
|
55
58
|
export const easeOut = (params) => {
|
|
56
59
|
const config = parseConfig(params);
|
|
57
|
-
return (t) => 1 - inMath[config.type](1 - clamp01(t), config);
|
|
60
|
+
return describeEase((t) => 1 - inMath[config.type](1 - clamp01(t), config), describeConfig('out', config));
|
|
58
61
|
};
|
|
59
62
|
export const easeInOut = (params) => {
|
|
60
63
|
const config = parseConfig(params);
|
|
@@ -67,11 +70,11 @@ export const easeInOut = (params) => {
|
|
|
67
70
|
: config.type === 'elastic'
|
|
68
71
|
? { ...config, period: config.period ?? 0.45 }
|
|
69
72
|
: config;
|
|
70
|
-
return (t) => {
|
|
73
|
+
return describeEase((t) => {
|
|
71
74
|
t = clamp01(t);
|
|
72
75
|
return t < 0.5
|
|
73
76
|
? inMath[inOutConfig.type](2 * t, inOutConfig) / 2
|
|
74
77
|
: 1 - inMath[inOutConfig.type](2 * (1 - t), inOutConfig) / 2;
|
|
75
|
-
};
|
|
78
|
+
}, describeConfig('inOut', config));
|
|
76
79
|
};
|
|
77
80
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tween/ease/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tween/ease/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM1C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAiB,MAAM,CAAC;AAejD,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;AAInB,MAAM,WAAW,GAAG,CAAC,MAAmB,EAAkB,EAAE;IACxD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxD,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC;AAC5D,CAAC,CAAC;AAEF,4EAA4E;AAC5E,uEAAuE;AACvE,+BAA+B;AAC/B,MAAM,MAAM,GAAoE;IAC5E,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,EAAE,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C,MAAM,CAAC,IAAI,KAAK,SAAS;YACvB,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;YAC9C,CAAC,CAAC,MAAM,CAAC;IACjB,OAAO,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE;QACtB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACf,OAAO,CAAC,GAAG,GAAG;YACV,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC;YAClD,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IACrE,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["import { clamp01 } from \"@/util/clamp\";\r\nimport { EasingFunction } from \"./type\";\r\nimport { describeEase } from \"./describe\";\r\n\r\nexport type StandardEase =\r\n | 'sine' | 'quad' | 'cubic' | 'quart' | 'quint'\r\n | 'expo' | 'circ' | 'back' | 'elastic' | 'bounce';\r\n\r\n/** Default ease family used when no `type` is specified. */\r\nexport const DEFAULT_EASE: StandardEase = 'quad';\r\n\r\nexport interface EaseConfig {\r\n /** Standard ease family (default: 'quad'). */\r\n type?: StandardEase;\r\n /** Used by 'back' (default: 1.70158). */\r\n overshoot?: number;\r\n /** Used by 'elastic' (default: 1). */\r\n amplitude?: number;\r\n /** Used by 'elastic' (default: 0.3). */\r\n period?: number;\r\n}\r\n\r\nexport type EaseParams = StandardEase | EaseConfig;\r\n\r\nconst PI = Math.PI;\r\n\r\ntype ResolvedConfig = EaseConfig & { type: StandardEase };\r\n\r\nconst parseConfig = (params?: EaseParams): ResolvedConfig => {\r\n if (params === undefined) return { type: DEFAULT_EASE };\r\n if (typeof params === 'string') return { type: params };\r\n return { ...params, type: params.type ?? DEFAULT_EASE };\r\n};\r\n\r\n// \"Ease in\" curve for each standard family, parameterized by an EaseConfig.\r\n// easeOut/easeInOut are derived from this via reflection, matching the\r\n// classic Penner construction.\r\nconst inMath: Record<StandardEase, (t: number, config: EaseConfig) => number> = {\r\n sine: (t) => 1 - Math.cos((t * PI) / 2),\r\n quad: (t) => t * t,\r\n cubic: (t) => t * t * t,\r\n quart: (t) => t * t * t * t,\r\n quint: (t) => t * t * t * t * t,\r\n expo: (t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1))),\r\n circ: (t) => 1 - Math.sqrt(1 - t * t),\r\n back: (t, config) => {\r\n const s = config.overshoot ?? 1.70158;\r\n return t * t * ((s + 1) * t - s);\r\n },\r\n elastic: (t, config) => {\r\n if (t === 0 || t === 1) return t;\r\n const a = config.amplitude ?? 1;\r\n const p = config.period ?? 0.3;\r\n const s = (p / (2 * PI)) * Math.asin(1 / a);\r\n return -(a * Math.pow(2, 10 * (t - 1)) * Math.sin(((t - 1 - s) * 2 * PI) / p));\r\n },\r\n bounce: (t) => {\r\n const bounceOut = (x: number) => {\r\n const n1 = 7.5625;\r\n const d1 = 2.75;\r\n if (x < 1 / d1) return n1 * x * x;\r\n if (x < 2 / d1) return n1 * (x -= 1.5 / d1) * x + 0.75;\r\n if (x < 2.5 / d1) return n1 * (x -= 2.25 / d1) * x + 0.9375;\r\n return n1 * (x -= 2.625 / d1) * x + 0.984375;\r\n };\r\n return 1 - bounceOut(1 - t);\r\n },\r\n};\r\n\r\n/** A key-ready description of a standard ease: its direction, family and every tuning value. */\r\nconst describeConfig = (direction: 'in' | 'out' | 'inOut', config: ResolvedConfig): string =>\r\n `${direction}:${config.type}:${config.overshoot ?? '_'}:${config.amplitude ?? '_'}:${config.period ?? '_'}`;\r\n\r\nexport const linear = (): EasingFunction => describeEase((t) => clamp01(t), 'lin');\r\n\r\nexport const easeIn = (params?: EaseParams): EasingFunction => {\r\n const config = parseConfig(params);\r\n return describeEase((t) => inMath[config.type](clamp01(t), config), describeConfig('in', config));\r\n};\r\n\r\nexport const easeOut = (params?: EaseParams): EasingFunction => {\r\n const config = parseConfig(params);\r\n return describeEase((t) => 1 - inMath[config.type](1 - clamp01(t), config), describeConfig('out', config));\r\n};\r\n\r\nexport const easeInOut = (params?: EaseParams): EasingFunction => {\r\n const config = parseConfig(params);\r\n // 'back' and 'elastic' need different default tuning at the midpoint than\r\n // their easeIn/easeOut counterparts (the classic Penner in-out variants\r\n // scale overshoot and default period differently), so resolve those here\r\n // rather than reusing the easeIn/easeOut defaults verbatim.\r\n const inOutConfig: ResolvedConfig = config.type === 'back'\r\n ? { ...config, overshoot: (config.overshoot ?? 1.70158) * 1.525 }\r\n : config.type === 'elastic'\r\n ? { ...config, period: config.period ?? 0.45 }\r\n : config;\r\n return describeEase((t) => {\r\n t = clamp01(t);\r\n return t < 0.5\r\n ? inMath[inOutConfig.type](2 * t, inOutConfig) / 2\r\n : 1 - inMath[inOutConfig.type](2 * (1 - t), inOutConfig) / 2;\r\n }, describeConfig('inOut', config));\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/curve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/curve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG7C;;;;;;;;;;GAUG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,yEAAyE;IACzE,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB,qEAAqE;IACrE,EAAE,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,WAAW,CAAC;IAChB,EAAE,EAAE,WAAW,CAAC;IAChB,EAAE,EAAE,WAAW,CAAC;IAChB,EAAE,EAAE,WAAW,CAAC;CACnB;AAID,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,gBAAgB,EAAE,CAuB/E;AAQD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAU1E;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,EAAE,CAEjE;AAQD,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,cAAc,CAmBvE"}
|
package/dist/tween/ease/curve.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describeEase } from "./describe.js";
|
|
1
2
|
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
2
3
|
/** The curve as Bézier segments, every auto handle and every clamp resolved. */
|
|
3
4
|
export function curveSegments(points) {
|
|
@@ -60,8 +61,8 @@ function isFinitePoint(value) {
|
|
|
60
61
|
export function curveEase(points) {
|
|
61
62
|
const segments = curveSegments(points);
|
|
62
63
|
if (segments.length === 0)
|
|
63
|
-
return (x) => x;
|
|
64
|
-
return (x) => {
|
|
64
|
+
return describeEase((x) => x, 'lin');
|
|
65
|
+
return describeEase((x) => {
|
|
65
66
|
if (x <= 0)
|
|
66
67
|
return segments[0].p0.y;
|
|
67
68
|
const last = segments[segments.length - 1];
|
|
@@ -76,6 +77,6 @@ export function curveEase(points) {
|
|
|
76
77
|
}
|
|
77
78
|
const t = curveSegmentT(segment, x);
|
|
78
79
|
return bezier(segment.p0.y, segment.c1.y, segment.c2.y, segment.p3.y, t);
|
|
79
|
-
};
|
|
80
|
+
}, `curve:${JSON.stringify(points)}`);
|
|
80
81
|
}
|
|
81
82
|
//# sourceMappingURL=curve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../src/tween/ease/curve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../../src/tween/ease/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsC1C,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvG,gFAAgF;AAChF,MAAM,UAAU,aAAa,CAAC,MAA6B;IACvD,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAElC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG;YACb,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE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GAAG,SAAS,CAAC;gBACpB,MAAM;YACV,CAAC;QACL,CAAC;QACD,MAAM,CAAC,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,EAAE,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import type { EasingFunction } from \"./type\";\r\nimport { describeEase } from \"./describe\";\r\n\r\n/**\r\n * A hand-drawn timing function: a chain of cubic Bézier segments from (0, 0)\r\n * to (1, 1), where x is progress through the duration and y how far along the\r\n * animation is. This is what an `EaseSpec` of `kind: \"custom\"` carries inline\r\n * in its `args`, so a drawn curve travels with the document rather than\r\n * needing a host to register a function under a key. Two things keep the\r\n * drawing a function of x, and both are enforced here rather than trusted: a\r\n * control point is clamped into its own segment's x span, and an absent handle\r\n * resolves to the Catmull-Rom tangent. y is deliberately not clamped to [0, 1]\r\n * — overshooting the target and settling back is a real move.\r\n */\r\n\r\n/** A point in curve space, or a handle offset within it. */\r\nexport interface CurveVector {\r\n x: number;\r\n y: number;\r\n}\r\n\r\n/** One control point of a custom easing curve. */\r\nexport interface CurvePoint {\r\n x: number;\r\n y: number;\r\n /** The handle steering the segment leaving this point. Absent = auto. */\r\n out?: CurveVector;\r\n /** The handle steering the segment arriving at it. Absent = auto. */\r\n in?: CurveVector;\r\n}\r\n\r\n/** One cubic Bézier segment of the curve, in absolute curve space. */\r\nexport interface EaseCurveSegment {\r\n p0: CurveVector;\r\n c1: CurveVector;\r\n c2: CurveVector;\r\n p3: CurveVector;\r\n}\r\n\r\nconst clamp = (value: number, min: number, max: number): number => Math.min(max, Math.max(min, value));\r\n\r\n/** The curve as Bézier segments, every auto handle and every clamp resolved. */\r\nexport function curveSegments(points: readonly CurvePoint[]): EaseCurveSegment[] {\r\n const segments: EaseCurveSegment[] = [];\r\n for (let i = 0; i < points.length - 1; i++) {\r\n const p0 = points[i];\r\n const p3 = points[i + 1];\r\n const before = points[i - 1] ?? p0;\r\n const after = points[i + 2] ?? p3;\r\n\r\n const c1 = p0.out\r\n ? { x: p0.x + p0.out.x, y: p0.y + p0.out.y }\r\n : { x: p0.x + (p3.x - before.x) / 6, y: p0.y + (p3.y - before.y) / 6 };\r\n const c2 = p3.in\r\n ? { x: p3.x + p3.in.x, y: p3.y + p3.in.y }\r\n : { x: p3.x - (after.x - p0.x) / 6, y: p3.y - (after.y - p0.y) / 6 };\r\n\r\n segments.push({\r\n p0: { x: p0.x, y: p0.y },\r\n c1: { x: clamp(c1.x, p0.x, p3.x), y: c1.y },\r\n c2: { x: clamp(c2.x, p0.x, p3.x), y: c2.y },\r\n p3: { x: p3.x, y: p3.y },\r\n });\r\n }\r\n return segments;\r\n}\r\n\r\n/** A cubic Bézier evaluated on one axis. */\r\nfunction bezier(a: number, b: number, c: number, d: number, t: number): number {\r\n const mt = 1 - t;\r\n return mt * mt * mt * a + 3 * mt * mt * t * b + 3 * mt * t * t * c + t * t * t * d;\r\n}\r\n\r\n/**\r\n * The curve parameter at which a segment reaches `x`. Bisection rather than\r\n * Newton: x is monotonic along the segment, so halving converges, where Newton\r\n * needs a derivative that goes to zero exactly at the flat ends an ease-in-out\r\n * is made of.\r\n */\r\nexport function curveSegmentT(segment: EaseCurveSegment, x: number): number {\r\n let low = 0;\r\n let high = 1;\r\n for (let i = 0; i < 30; i++) {\r\n const mid = (low + high) / 2;\r\n const at = bezier(segment.p0.x, segment.c1.x, segment.c2.x, segment.p3.x, mid);\r\n if (at < x) low = mid;\r\n else high = mid;\r\n }\r\n return (low + high) / 2;\r\n}\r\n\r\n/** Whether `value` is a drawable curve: two or more finite points. */\r\nexport function isEaseCurve(value: unknown): value is CurvePoint[] {\r\n return Array.isArray(value) && value.length >= 2 && value.every(isFinitePoint);\r\n}\r\n\r\nfunction isFinitePoint(value: unknown): value is CurveVector {\r\n if (typeof value !== \"object\" || value === null) return false;\r\n const { x, y } = value as Partial<CurveVector>;\r\n return typeof x === \"number\" && Number.isFinite(x) && typeof y === \"number\" && Number.isFinite(y);\r\n}\r\n\r\n/** The easing a curve runs as: progress in, eased progress out. */\r\nexport function curveEase(points: readonly CurvePoint[]): EasingFunction {\r\n const segments = curveSegments(points);\r\n if (segments.length === 0) return describeEase((x) => x, 'lin');\r\n\r\n return describeEase((x) => {\r\n if (x <= 0) return segments[0].p0.y;\r\n const last = segments[segments.length - 1];\r\n if (x >= 1) return last.p3.y;\r\n\r\n let segment = last;\r\n for (const candidate of segments) {\r\n if (x <= candidate.p3.x) {\r\n segment = candidate;\r\n break;\r\n }\r\n }\r\n const t = curveSegmentT(segment, x);\r\n return bezier(segment.p0.y, segment.c1.y, segment.c2.y, segment.p3.y, t);\r\n }, `curve:${JSON.stringify(points)}`);\r\n}\r\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EasingFunction } from "./type.js";
|
|
2
|
+
/** Record what `ease` is, and hand it back. @internal */
|
|
3
|
+
export declare function describeEase<F extends EasingFunction>(ease: F, description: string): F;
|
|
4
|
+
/**
|
|
5
|
+
* A string that is equal for two easings exactly when they are the same ease.
|
|
6
|
+
*
|
|
7
|
+
* An engine easing keys by its description, so building the same one twice (a
|
|
8
|
+
* document rebuilt from the same row) gives the same key. A function the engine
|
|
9
|
+
* did not build keys by its own identity: a different function is always a
|
|
10
|
+
* different key, which may over-report a change but never hides one.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function easeKey(ease: EasingFunction): string;
|
|
15
|
+
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../../src/tween/ease/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAa7C,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAGtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CASpD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Descriptions of engine-built easings, by function.
|
|
3
|
+
*
|
|
4
|
+
* Every engine easing is an anonymous closure, so `fn.name` is `""` and cannot
|
|
5
|
+
* tell two of them apart. A constructor that knows what it built records a short,
|
|
6
|
+
* deterministic description here, which is what a cache key can be built from.
|
|
7
|
+
*/
|
|
8
|
+
const descriptions = new WeakMap();
|
|
9
|
+
const identities = new WeakMap();
|
|
10
|
+
let identityCounter = 0;
|
|
11
|
+
/** Record what `ease` is, and hand it back. @internal */
|
|
12
|
+
export function describeEase(ease, description) {
|
|
13
|
+
descriptions.set(ease, description);
|
|
14
|
+
return ease;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A string that is equal for two easings exactly when they are the same ease.
|
|
18
|
+
*
|
|
19
|
+
* An engine easing keys by its description, so building the same one twice (a
|
|
20
|
+
* document rebuilt from the same row) gives the same key. A function the engine
|
|
21
|
+
* did not build keys by its own identity: a different function is always a
|
|
22
|
+
* different key, which may over-report a change but never hides one.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export function easeKey(ease) {
|
|
27
|
+
const described = descriptions.get(ease);
|
|
28
|
+
if (described !== undefined)
|
|
29
|
+
return described;
|
|
30
|
+
let id = identities.get(ease);
|
|
31
|
+
if (id === undefined) {
|
|
32
|
+
id = `fn#${identityCounter++}`;
|
|
33
|
+
identities.set(ease, id);
|
|
34
|
+
}
|
|
35
|
+
return id;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=describe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../src/tween/ease/describe.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAA0B,CAAC;AAC3D,MAAM,UAAU,GAAG,IAAI,OAAO,EAA0B,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,yDAAyD;AACzD,MAAM,UAAU,YAAY,CAA2B,IAAO,EAAE,WAAmB;IAC/E,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,OAAO,CAAC,IAAoB;IACxC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9C,IAAI,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACnB,EAAE,GAAG,MAAM,eAAe,EAAE,EAAE,CAAC;QAC/B,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC","sourcesContent":["import type { EasingFunction } from \"./type\";\r\n\r\n/**\r\n * Descriptions of engine-built easings, by function.\r\n *\r\n * Every engine easing is an anonymous closure, so `fn.name` is `\"\"` and cannot\r\n * tell two of them apart. A constructor that knows what it built records a short,\r\n * deterministic description here, which is what a cache key can be built from.\r\n */\r\nconst descriptions = new WeakMap<EasingFunction, string>();\r\nconst identities = new WeakMap<EasingFunction, string>();\r\nlet identityCounter = 0;\r\n\r\n/** Record what `ease` is, and hand it back. @internal */\r\nexport function describeEase<F extends EasingFunction>(ease: F, description: string): F {\r\n descriptions.set(ease, description);\r\n return ease;\r\n}\r\n\r\n/**\r\n * A string that is equal for two easings exactly when they are the same ease.\r\n *\r\n * An engine easing keys by its description, so building the same one twice (a\r\n * document rebuilt from the same row) gives the same key. A function the engine\r\n * did not build keys by its own identity: a different function is always a\r\n * different key, which may over-report a change but never hides one.\r\n *\r\n * @internal\r\n */\r\nexport function easeKey(ease: EasingFunction): string {\r\n const described = descriptions.get(ease);\r\n if (described !== undefined) return described;\r\n let id = identities.get(ease);\r\n if (id === undefined) {\r\n id = `fn#${identityCounter++}`;\r\n identities.set(ease, id);\r\n }\r\n return id;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/tween/ease/type.ts"],"names":[],"mappings":"","sourcesContent":["export type EasingFunction = (t: number) => number;\n\n"]}
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/tween/ease/type.ts"],"names":[],"mappings":"","sourcesContent":["export type EasingFunction = (t: number) => number;\r\n\r\n"]}
|
package/dist/tween/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tween/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AAEpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC","sourcesContent":["export * from './ease/type';\nexport * from './ease/constants';\nexport * from './ease/curve';\n\nexport * from './to-command';\nexport * from './command';\nexport * from './loop';\nexport * from './command-decorator';\n\nexport * from './prepare';\nexport * from './stepper';\nexport * from './lerp';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tween/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AAEpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC","sourcesContent":["export * from './ease/type';\r\nexport * from './ease/constants';\r\nexport * from './ease/curve';\r\n\r\nexport * from './to-command';\r\nexport * from './command';\r\nexport * from './loop';\r\nexport * from './command-decorator';\r\n\r\nexport * from './prepare';\r\nexport * from './stepper';\r\nexport * from './lerp';\r\n"]}
|
package/dist/tween/inert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/tween/inert.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAI,MAAc,EAAE,QAAgB;IAC5D,KAAK,MAAM,CAAC;IACZ,OAAO;QACH,QAAQ;QACR,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAe;QAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;KACzC,CAAC;AACN,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAAgB;IACzC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO;QACH,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;YAC7B,OAAO,IAAI,EAAE,CAAC;YACd,OAAO,OAAO,IAAI,QAAQ,CAAC;QAC/B,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { TweenStepper } from \"./stepper\";\nimport type { Command } from \"./command\";\n\n/**\n * An animation that occupies its duration and writes nothing.\n *\n * What a command on an **unmounted** node becomes. A node that is not in the\n * tree has no box, no surface and no timeline, so a tween on it has nothing to\n * be a tween *of* — but it still has a duration, and the timeline slot it was\n * placed in is entitled to have that duration pass. Returning a real command of\n * the right length keeps the scene's timing intact where throwing would abort\n * the pass and where returning nothing would silently shorten it.\n *\n * The failure this turns into a no-op is a real one — animating a node the\n * author forgot to `add` — and it reads as \"nothing moved\", which is what the\n * author sees on screen anyway.\n */\nexport function inertCommand<P>(target: object, duration: number): Command<P> {\n void target;\n return {\n duration,\n at: () => ({}) as Partial<P>,\n _stepper: () => inertStepper(duration),\n };\n}\n\n/** The {@link TweenStepper} half of {@link inertCommand}: runs its clock, writes nothing. */\nexport function inertStepper(duration: number): TweenStepper {\n let elapsed = 0;\n return {\n seek: (e: number) => { elapsed = e; },\n advance: (dt: number): boolean => {\n elapsed += dt;\n return elapsed >= duration;\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inert.js","sourceRoot":"","sources":["../../src/tween/inert.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAAI,MAAc,EAAE,QAAgB;IAC5D,KAAK,MAAM,CAAC;IACZ,OAAO;QACH,QAAQ;QACR,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAe;QAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;KACzC,CAAC;AACN,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,YAAY,CAAC,QAAgB;IACzC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,OAAO;QACH,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,EAAU,EAAW,EAAE;YAC7B,OAAO,IAAI,EAAE,CAAC;YACd,OAAO,OAAO,IAAI,QAAQ,CAAC;QAC/B,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import { TweenStepper } from \"./stepper\";\r\nimport type { Command } from \"./command\";\r\n\r\n/**\r\n * An animation that occupies its duration and writes nothing.\r\n *\r\n * What a command on an **unmounted** node becomes. A node that is not in the\r\n * tree has no box, no surface and no timeline, so a tween on it has nothing to\r\n * be a tween *of* — but it still has a duration, and the timeline slot it was\r\n * placed in is entitled to have that duration pass. Returning a real command of\r\n * the right length keeps the scene's timing intact where throwing would abort\r\n * the pass and where returning nothing would silently shorten it.\r\n *\r\n * The failure this turns into a no-op is a real one — animating a node the\r\n * author forgot to `add` — and it reads as \"nothing moved\", which is what the\r\n * author sees on screen anyway.\r\n */\r\nexport function inertCommand<P>(target: object, duration: number): Command<P> {\r\n void target;\r\n return {\r\n duration,\r\n at: () => ({}) as Partial<P>,\r\n _stepper: () => inertStepper(duration),\r\n };\r\n}\r\n\r\n/** The {@link TweenStepper} half of {@link inertCommand}: runs its clock, writes nothing. */\r\nexport function inertStepper(duration: number): TweenStepper {\r\n let elapsed = 0;\r\n return {\r\n seek: (e: number) => { elapsed = e; },\r\n advance: (dt: number): boolean => {\r\n elapsed += dt;\r\n return elapsed >= duration;\r\n },\r\n };\r\n}\r\n"]}
|
package/dist/tween/lerp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lerp.js","sourceRoot":"","sources":["../../src/tween/lerp.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC1D,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC/D,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { EasingFunction } from \"./ease/type\";\n\n/**\n * Linearly interpolates between two numbers.\n *\n * @param from - Start value at `t = 0`.\n * @param to - End value at `t = 1`.\n * @param t - Normalized progress in [0, 1]. Values outside this range\n * extrapolate beyond the endpoints.\n * @returns The interpolated value: `from + (to - from) * t`.\n */\nexport function lerpNumber(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n\n/**\n * Interpolates a CSS-style perspective distance (viewer-to-plane, in px, where\n * `0` means \"no perspective\" — a parallel projection).\n *\n * Perspective enters the projection matrix as its reciprocal — a point at depth\n * `z` lands at `x / (1 - z/perspective)` — so `1/perspective` (not the raw\n * distance) is the quantity that varies smoothly with the visual strength of\n * the effect. Lerping the raw px value linearly sweeps through the small\n * positive numbers next to `0` on the way between \"off\" and any finite\n * distance, and `1/perspective` diverges there: a `0 → 800` tween would flash\n * through a wildly exaggerated, near-degenerate projection right at the start\n * before settling down to the mild depth `800` actually asks for. Lerping the\n * reciprocal instead — with `0` standing in for a reciprocal of `0`, matching\n * the renderer's own convention (see `isProjective`/`invP` in `matrix2d.ts`) —\n * keeps that quantity monotonic and bounded between the two endpoints, so the\n * effect builds or settles smoothly instead of spiking.\n */\nexport function lerpPerspective(from: number, to: number, t: number): number {\n const invFrom = from !== 0 ? 1 / from : 0;\n const invTo = to !== 0 ? 1 / to : 0;\n const inv = invFrom + (invTo - invFrom) * t;\n return inv !== 0 ? 1 / inv : 0;\n}\n\nexport type LerpFunction<T> = (from: T, to: T, t: number) => T;\nexport type TweenOptions<T> = { ease?: EasingFunction, lerp?: LerpFunction<T> };"]}
|
|
1
|
+
{"version":3,"file":"lerp.js","sourceRoot":"","sources":["../../src/tween/lerp.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC1D,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,EAAU,EAAE,CAAS;IAC/D,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { EasingFunction } from \"./ease/type\";\r\n\r\n/**\r\n * Linearly interpolates between two numbers.\r\n *\r\n * @param from - Start value at `t = 0`.\r\n * @param to - End value at `t = 1`.\r\n * @param t - Normalized progress in [0, 1]. Values outside this range\r\n * extrapolate beyond the endpoints.\r\n * @returns The interpolated value: `from + (to - from) * t`.\r\n */\r\nexport function lerpNumber(from: number, to: number, t: number): number {\r\n return from + (to - from) * t;\r\n}\r\n\r\n/**\r\n * Interpolates a CSS-style perspective distance (viewer-to-plane, in px, where\r\n * `0` means \"no perspective\" — a parallel projection).\r\n *\r\n * Perspective enters the projection matrix as its reciprocal — a point at depth\r\n * `z` lands at `x / (1 - z/perspective)` — so `1/perspective` (not the raw\r\n * distance) is the quantity that varies smoothly with the visual strength of\r\n * the effect. Lerping the raw px value linearly sweeps through the small\r\n * positive numbers next to `0` on the way between \"off\" and any finite\r\n * distance, and `1/perspective` diverges there: a `0 → 800` tween would flash\r\n * through a wildly exaggerated, near-degenerate projection right at the start\r\n * before settling down to the mild depth `800` actually asks for. Lerping the\r\n * reciprocal instead — with `0` standing in for a reciprocal of `0`, matching\r\n * the renderer's own convention (see `isProjective`/`invP` in `matrix2d.ts`) —\r\n * keeps that quantity monotonic and bounded between the two endpoints, so the\r\n * effect builds or settles smoothly instead of spiking.\r\n */\r\nexport function lerpPerspective(from: number, to: number, t: number): number {\r\n const invFrom = from !== 0 ? 1 / from : 0;\r\n const invTo = to !== 0 ? 1 / to : 0;\r\n const inv = invFrom + (invTo - invFrom) * t;\r\n return inv !== 0 ? 1 / inv : 0;\r\n}\r\n\r\nexport type LerpFunction<T> = (from: T, to: T, t: number) => T;\r\nexport type TweenOptions<T> = { ease?: EasingFunction, lerp?: LerpFunction<T> };"]}
|
package/dist/tween/loop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/tween/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA6BvC,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAC,IAAc;IACrC,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;AACpF,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,WAAW,CAAC,IAA0B;IAClD,OAAO,IAAI,KAAK,SAA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AAC;QACrD,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;AACL,CAAC","sourcesContent":["/**\n * Repetition, as data: how many times a command runs and which way each pass\n * goes.\n *\n * A loop is a **placement** property, the same kind of thing as `at` and\n * `duration` — it says when the command is running, never what it does. That is\n * why it lives out here rather than in any one command's args: the wrapper goes\n * *around* a built `Command`, so `to`, `fillTo`, `countTo` and a custom\n * `@command()` nobody has written yet all loop by the same code, with nothing to\n * forward and nothing to forget.\n *\n * And it stays seekable. A looped command is still a pure function of its own\n * normalized time — `at(t)` maps `t` onto a pass and asks the inner command for\n * that pass's frame — so scrubbing into the fourth repetition costs the same as\n * scrubbing into the first, which is the whole reason commands are values here.\n */\n\nimport { clamp01 } from \"@/util/clamp\";\n\n/**\n * Which way a pass runs.\n *\n * `alternate` is the reason this is three values rather than a boolean: a\n * bounce — out and back — is one command with two passes, not two commands whose\n * `at`s have to be kept in step by hand.\n */\nexport type LoopDirection = \"normal\" | \"reverse\" | \"alternate\";\n\n/**\n * How a command repeats. Absent on a command is \"runs once\".\n */\nexport interface LoopSpec {\n /** Absent is `\"normal\"`. */\n direction?: LoopDirection;\n /**\n * How many times to repeat **after** the first pass: `0` is no repeat (the\n * same as no loop at all), `3` plays four passes, and `null` repeats for as\n * long as there is clip left to fill.\n *\n * Repeats rather than total passes so that the value reads as what the word\n * says — \"repeat twice\" is `2` — and so that the no-op is `0` rather than a\n * `1` that looks like it should do something.\n */\n count: number | null;\n}\n\n/** Total passes: repeats plus the first one, or `Infinity` for an unlimited loop. */\nexport function loopPasses(loop: LoopSpec): number {\n return loop.count === null ? Infinity : Math.max(0, Math.floor(loop.count)) + 1;\n}\n\n/** Whether a loop changes anything: an unlimited one always does, a counted one only past zero. */\nexport function loopRepeats(loop: LoopSpec | undefined): loop is LoopSpec {\n return loop !== undefined && (loop.count === null || loop.count >= 1);\n}\n\n/**\n * Seconds a looped command occupies.\n *\n * `fill` is what an unlimited loop is given to cover — the clip's remaining time,\n * where a timeline places one. An unlimited loop does not *define* a length the\n * way a counted one does: a background that turns forever should fill the scene\n * it is in, not stretch it, so `documentDuration` counts one pass of it and this\n * stretches it to whatever that came to.\n */\nexport function loopSpan(loop: LoopSpec, duration: number, fill = duration): number {\n if (duration <= 0) return duration;\n if (loop.count === null) return Math.max(duration, fill);\n return duration * loopPasses(loop);\n}\n\n/**\n * Where in one pass `elapsed` lands, as normalized time for the inner command.\n *\n * Past the last pass of a counted loop it holds at that pass's end rather than\n * wrapping to the start — the same rule a finished command follows everywhere\n * else, and what keeps the value a loop leaves behind the value the next command\n * tweens from.\n */\nexport function loopPhase(loop: LoopSpec, elapsed: number, duration: number): number {\n if (duration <= 0) return 1;\n const passes = loopPasses(loop);\n const capped = Math.min(Math.max(elapsed, 0) / duration, passes);\n // `passes - 1` holds the final pass at its end instead of rolling over to a\n // pass that does not exist. `Infinity - 1` is still `Infinity`, so an\n // unlimited loop is never capped.\n const index = Math.min(Math.floor(capped), passes - 1);\n const t = clamp01(capped - index);\n switch (loop.direction ?? \"normal\") {\n case \"reverse\": return 1 - t;\n case \"alternate\": return index % 2 === 0 ? t : 1 - t;\n default: return t;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/tween/loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA6BvC,qFAAqF;AACrF,MAAM,UAAU,UAAU,CAAC,IAAc;IACrC,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;AACpF,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,WAAW,CAAC,IAA0B;IAClD,OAAO,IAAI,KAAK,SAAS,IAAI,CAAC,IA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CAAC,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;AACL,CAAC","sourcesContent":["/**\r\n * Repetition, as data: how many times a command runs and which way each pass\r\n * goes.\r\n *\r\n * A loop is a **placement** property, the same kind of thing as `at` and\r\n * `duration` — it says when the command is running, never what it does. That is\r\n * why it lives out here rather than in any one command's args: the wrapper goes\r\n * *around* a built `Command`, so `to`, `fillTo`, `countTo` and a custom\r\n * `@command()` nobody has written yet all loop by the same code, with nothing to\r\n * forward and nothing to forget.\r\n *\r\n * And it stays seekable. A looped command is still a pure function of its own\r\n * normalized time — `at(t)` maps `t` onto a pass and asks the inner command for\r\n * that pass's frame — so scrubbing into the fourth repetition costs the same as\r\n * scrubbing into the first, which is the whole reason commands are values here.\r\n */\r\n\r\nimport { clamp01 } from \"@/util/clamp\";\r\n\r\n/**\r\n * Which way a pass runs.\r\n *\r\n * `alternate` is the reason this is three values rather than a boolean: a\r\n * bounce — out and back — is one command with two passes, not two commands whose\r\n * `at`s have to be kept in step by hand.\r\n */\r\nexport type LoopDirection = \"normal\" | \"reverse\" | \"alternate\";\r\n\r\n/**\r\n * How a command repeats. Absent on a command is \"runs once\".\r\n */\r\nexport interface LoopSpec {\r\n /** Absent is `\"normal\"`. */\r\n direction?: LoopDirection;\r\n /**\r\n * How many times to repeat **after** the first pass: `0` is no repeat (the\r\n * same as no loop at all), `3` plays four passes, and `null` repeats for as\r\n * long as there is clip left to fill.\r\n *\r\n * Repeats rather than total passes so that the value reads as what the word\r\n * says — \"repeat twice\" is `2` — and so that the no-op is `0` rather than a\r\n * `1` that looks like it should do something.\r\n */\r\n count: number | null;\r\n}\r\n\r\n/** Total passes: repeats plus the first one, or `Infinity` for an unlimited loop. */\r\nexport function loopPasses(loop: LoopSpec): number {\r\n return loop.count === null ? Infinity : Math.max(0, Math.floor(loop.count)) + 1;\r\n}\r\n\r\n/** Whether a loop changes anything: an unlimited one always does, a counted one only past zero. */\r\nexport function loopRepeats(loop: LoopSpec | undefined): loop is LoopSpec {\r\n return loop !== undefined && (loop.count === null || loop.count >= 1);\r\n}\r\n\r\n/**\r\n * Seconds a looped command occupies.\r\n *\r\n * `fill` is what an unlimited loop is given to cover — the clip's remaining time,\r\n * where a timeline places one. An unlimited loop does not *define* a length the\r\n * way a counted one does: a background that turns forever should fill the scene\r\n * it is in, not stretch it, so `documentDuration` counts one pass of it and this\r\n * stretches it to whatever that came to.\r\n */\r\nexport function loopSpan(loop: LoopSpec, duration: number, fill = duration): number {\r\n if (duration <= 0) return duration;\r\n if (loop.count === null) return Math.max(duration, fill);\r\n return duration * loopPasses(loop);\r\n}\r\n\r\n/**\r\n * Where in one pass `elapsed` lands, as normalized time for the inner command.\r\n *\r\n * Past the last pass of a counted loop it holds at that pass's end rather than\r\n * wrapping to the start — the same rule a finished command follows everywhere\r\n * else, and what keeps the value a loop leaves behind the value the next command\r\n * tweens from.\r\n */\r\nexport function loopPhase(loop: LoopSpec, elapsed: number, duration: number): number {\r\n if (duration <= 0) return 1;\r\n const passes = loopPasses(loop);\r\n const capped = Math.min(Math.max(elapsed, 0) / duration, passes);\r\n // `passes - 1` holds the final pass at its end instead of rolling over to a\r\n // pass that does not exist. `Infinity - 1` is still `Infinity`, so an\r\n // unlimited loop is never capped.\r\n const index = Math.min(Math.floor(capped), passes - 1);\r\n const t = clamp01(capped - index);\r\n switch (loop.direction ?? \"normal\") {\r\n case \"reverse\": return 1 - t;\r\n case \"alternate\": return index % 2 === 0 ? t : 1 - t;\r\n default: return t;\r\n }\r\n}\r\n"]}
|