@motionscript/core 0.1.0-alpha.0 → 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 +282 -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 +93 -11
- 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 +32 -4
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +9 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +11 -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.d.ts +1 -0
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +1 -0
- 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 +17 -6
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +26 -14
- 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.d.ts +9 -1
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +12 -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 +3 -3
- 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.d.ts.map +1 -1
- package/dist/document/command-traits.js +17 -3
- 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 +34 -16
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +51 -12
- 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 +188 -32
- 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.d.ts +3 -2
- package/dist/nodes/audio/node-audio.d.ts.map +1 -1
- package/dist/nodes/audio/node-audio.js +8 -5
- 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 +2 -2
- 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 +5 -3
- 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 +10 -3
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -0
- 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 +5 -5
- 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.d.ts +2 -2
- package/dist/render3d/resources.js +2 -2
- 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.d.ts +2 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +8 -2
- 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 +33 -3
- 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 +27 -22
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +23 -9
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +12 -4
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +10 -22
- 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 +12 -1
- package/dist/tween/seekable.d.ts.map +1 -1
- package/dist/tween/seekable.js +15 -0
- 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-P3XQCHDW.js +0 -16
- package/dist/browser/chunks/chunk-P3XQCHDW.js.map +0 -7
- package/dist/browser/chunks/chunk-VJQMKHGQ.js +0 -3
- package/dist/browser/chunks/chunk-VJQMKHGQ.js.map +0 -7
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/provider-node.js +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/media/video-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe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AAC,MAAM,CAAkC;IAChD,OAAO,CAAC,SAAS,CAAc;gBAEnB,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC;IAIhD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,QAAQ;IAgBhB;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB;IAe1B,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAkBhB,4DAA4D;IAC5D,OAAO,CAAC,SAAS;IAiCR,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAahD;;;;OAIG;IACM,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IA6C9C,iEAAiE;IACjE,OAAO,CAAC,aAAa;IAOrB,kDAAkD;IAClD,OAAO,CAAC,QAAQ;IAOhB;;;;;;;OAOG;IACH,OAAO,CAAC,SAAS;cAWE,aAAa,IAAI,UAAU;IAI9C;;;;;;;;;;;;;;;;OAgBG;cACgB,aAAa,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;cAkBzC,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAgBjD,OAAO,IAAI,IAAI;CAK3B"}
|
|
@@ -160,7 +160,7 @@ export class Video extends Rect {
|
|
|
160
160
|
const src = this.src;
|
|
161
161
|
if (!src || this.muted)
|
|
162
162
|
return;
|
|
163
|
-
const bus = this._busPath();
|
|
163
|
+
const bus = this._busPath(audio);
|
|
164
164
|
if (this.segments.length > 0) {
|
|
165
165
|
const clipEnd = this.trimEnd ?? audio.catalog.getMediaDuration(src);
|
|
166
166
|
for (const segment of this.segments) {
|
|
@@ -179,6 +179,7 @@ export class Video extends Rect {
|
|
|
179
179
|
trimEnd: to,
|
|
180
180
|
filters: this._soundFilters(speed),
|
|
181
181
|
bus,
|
|
182
|
+
optional: true,
|
|
182
183
|
});
|
|
183
184
|
}
|
|
184
185
|
return;
|
|
@@ -197,6 +198,7 @@ export class Video extends Rect {
|
|
|
197
198
|
trimEnd: this.trimEnd ?? (loop ? undefined : audio.catalog.getMediaDuration(src)),
|
|
198
199
|
filters: this._soundFilters(this.speed ?? 1),
|
|
199
200
|
bus,
|
|
201
|
+
optional: true,
|
|
200
202
|
});
|
|
201
203
|
}
|
|
202
204
|
/** `speed` as a filter ahead of the node's own audio filters. */
|
|
@@ -208,11 +210,11 @@ export class Video extends Rect {
|
|
|
208
210
|
return filters;
|
|
209
211
|
}
|
|
210
212
|
/** The bus chain {@link VideoProps.bus} names. */
|
|
211
|
-
_busPath() {
|
|
213
|
+
_busPath(audio) {
|
|
212
214
|
if (!this.bus)
|
|
213
215
|
return undefined;
|
|
214
216
|
const target = findBusById(this, this.bus);
|
|
215
|
-
return target ? busPathTo(target) : undefined;
|
|
217
|
+
return target ? busPathTo(target, audio) : undefined;
|
|
216
218
|
}
|
|
217
219
|
/**
|
|
218
220
|
* The node's box, as the rect state every pass declares.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-node.js","sourceRoot":"","sources":["../../../src/nodes/media/video-node.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAmB,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAMtE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAoC,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAChH,OAAO,EAAE,IAAI,EAAa,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKjF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAe,mBAAmB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAsGlG;;;;;;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Q,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;uCAA2C","sourcesContent":["import { RenderContext2D } from \"@/render/render-context2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { VideoAdjustment, resolveChainAdjustments } from \"@/attributes/shape/filters/chain\";\nimport { lerpFilterArray } from \"@/attributes/shape/filters/registry\";\nimport { MediaAdjustment, VideoOnlyAdjustment } from \"@/attributes/shape/filters/union\";\nimport { ImageCrop, ImageFit, ImageMatrix } from \"@/attributes/shape/fill/implementations/image\";\nimport { Alignment } from \"@/attributes/layout/alignment\";\nimport { InsetsResolved } from \"@/attributes/layout/insets\";\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { alignmentProperty, insetsProperty } from \"@/attributes/properties/typed\";\nimport { VideoFillProp, VideoFillResolved, sourceTimeFor } from \"@/attributes/shape/fill/implementations/video\";\nimport { Rect, RectProps } from \"../geometry/rect-node\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { resolveFill, UNSET_MEDIA_FILL } from \"@/attributes/shape/fill/registry\";\nimport { FillProp, FillResolved } from \"@/attributes/shape/fill/union\";\nimport type { AudioBusStop } from \"@/attributes/audio/request\";\nimport type { AudioScope } from \"@/attributes/audio/schedule\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport { busPathTo, findBusById } from \"@/nodes/audio/node-audio\";\nimport { AudioFilterItem } from \"@/attributes/audio/filters/union\";\nimport { AudioFilter, resolveAudioFilters, AudioFilters } from \"@/attributes/audio/filters/chain\";\n\nexport interface VideoProps extends RectProps {\n src?: string;\n /** How the (cropped) frame is scaled into the node's bounds. Default 'fill'. */\n fit?: ImageFit;\n /** Window onto the source frame, in fractions of its own size, applied before `fit`. */\n crop?: ImageCrop;\n /** Magnification on top of the fitted scale. `1` (default) is the fitted size. */\n zoom?: number;\n /** The point held fixed as `zoom` scales; also the alignment when it doesn't cover. */\n anchor?: Alignment;\n /** Raw frame→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\n matrix?: ImageMatrix;\n /** Visual filters applied to the rendered frame (blur, color, posterizeTime, echo, …). */\n filters?: VideoAdjustment;\n /** Whether playback advances with the node's clock (drives both picture and sound). Default true. */\n playing?: boolean;\n /**\n * Explicit source time to show, in seconds. Omit it (the default) and the\n * picture is timed from the moment this node appeared; set it to drive the\n * playhead yourself, and set it to `null` to hand the playhead back to the\n * clock (`set()` merges a partial, so `undefined` won't clear it).\n */\n timestamp?: number | null;\n trimStart?: number;\n trimEnd?: number;\n /** Playback-rate multiplier for both picture and audio. Default 1. */\n speed?: number;\n loop?: 'forward' | 'reverse' | 'none';\n /** Length of one loop cycle, in seconds. Defaults to the trimmed clip length. */\n duration?: number;\n /** Audio volume in [0, 1]. Default 1. */\n volume?: number;\n /** Silence the video's audio track without affecting the picture. Default false. */\n muted?: boolean;\n /** Audio filters applied to the video's sound track (gain, eq, echo, …). */\n audioFilters?: AudioFilter;\n /**\n * The node id of an `AudioBus` in this clip to route the video's sound into.\n *\n * A `Video` is a `Node2D`, so it cannot be parented under a bus the way a\n * `SoundNode` is — its audio is welded to its picture, which has to stay in\n * the visual tree. Naming one instead is what lets a video's dialogue sit on\n * the same bus as everything else, so ducking the whole group is still one\n * edit — and it is the *same* id a `SoundNode` under that bus writes as its\n * `parentId`, rather than a second vocabulary for \"which bus\". An id matching\n * no bus routes straight to the master, the same as no bus at all.\n */\n bus?: string;\n /**\n * An explicit **playback schedule**: the stretches of this node's own clock\n * during which the clip advances, and where in the source each one starts.\n *\n * Omit it (the default) and playback is what it has always been — the clip\n * runs from the moment the node appears, at `speed`, until it or the node\n * runs out. Give it, and `playing`/`timestamp` are both superseded: the\n * picture takes its source time from whichever segment covers the current\n * `elapsed`, and the sound is scheduled one clip per segment.\n *\n * It exists because a **pause** cannot be expressed any other way. `playing:\n * false` holds the clip's *first* frame, because with playback derived\n * linearly from the clock there is nothing else it could hold; and the sound\n * runs on the node's own clock regardless, so a picture frozen by any means\n * would drift away from it. A schedule states the one thing both halves need\n * and neither could infer — that a paused stretch consumes no source — so\n * they cannot come apart.\n *\n * Still a pure function of the clock, which is the property everything else\n * here is built on: frame *N* is identical however the playhead reached it,\n * so a scrub, a playthrough and an export agree.\n */\n segments?: readonly VideoSegment[];\n\n}\n\n/**\n * One stretch of a {@link Video}'s own clock during which its source advances —\n * see {@link VideoProps.segments}.\n *\n * Trim and loop are applied *on top* of this, by the same code that applies them\n * to unscheduled playback, so a schedule says when the clip is running and the\n * clip's own props go on saying which part of the file it is running through.\n */\nexport interface VideoSegment {\n /** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */\n at: number;\n /** Source in-point for it, in seconds. */\n from: number;\n /**\n * How long it runs, in seconds of the node's clock.\n *\n * `Infinity` for a clip left running — the same open sentinel\n * `AudioRequest.endAt` uses — which resolves against the clip's length.\n */\n duration: number;\n /** Playback rate through it. Defaults to the node's own `speed`. */\n speed?: number;\n /** Linear gain for its sound. Defaults to the node's own `volume`. */\n volume?: number;\n}\n\n/**\n * A video. Layout and child positioning are inherited wholesale from\n * {@link Rect} — a Video lays out its children exactly like a Rect, just with a\n * *playing* video painted in place of the rect's fill. The\n * frame is drawn through a `video` fill, which resolves the source time to show\n * from this node's clock as it paints.\n *\n * It is the one media class left, and the reason it is a class where a still\n * picture is now just an `image` fill: a Video plays its own audio track,\n * declared as a clip of the same file trimmed/sped/looped to match the picture.\n * Set `muted` to drop the sound while keeping the picture; `playing: false`\n * freezes both.\n */\nexport class Video extends Rect<VideoProps> {\n\n @property() declare src?: string;\n @property() declare fit?: ImageFit;\n @insetsProperty() declare crop: ImageCrop;\n @property({ default: 1 }) declare zoom: number;\n @alignmentProperty() declare anchor: Alignment;\n @property() declare matrix?: ImageMatrix;\n @property({ default: [], tween: lerpFilterArray, mapper: resolveChainAdjustments })\n declare filters?: (MediaAdjustment | VideoOnlyAdjustment)[];\n\n @property({ default: true }) declare playing: boolean;\n @property() declare timestamp?: number | null;\n @property() declare trimStart?: number;\n @property() declare trimEnd?: number;\n @property() declare speed?: number;\n @property() declare loop?: 'forward' | 'reverse' | 'none';\n @property() declare duration?: number;\n\n @property({ default: 1 }) declare volume: number;\n @property({ default: false }) declare muted: boolean;\n @property({ default: [], mapper: resolveAudioFilters })\n declare audioFilters?: AudioFilterItem[];\n @property({ default: undefined }) declare bus?: string;\n\n /**\n * The playback schedule — see {@link VideoProps.segments}.\n *\n * Not tweenable, and not a mistake: there is no halfway between two\n * schedules. What moves over time is the playhead *within* one, which is\n * what the schedule describes.\n */\n @property({ default: [] }) declare segments: readonly VideoSegment[];\n\n /**\n * The `video` fill state `renderSelf` paints — so the picture reuses the\n * exact playback model authors get from `Fills.video(...)`, rather than\n * re-deriving timestamps here. The fill carries no timestamp of its own: it\n * resolves one as it paints, from this node's clock. Rebuilt from props when\n * the source or any playback knob changes (see {@link videoKey}).\n */\n private _video: VideoFillResolved | null = null;\n private _videoKey: string = \"\";\n\n constructor(props: NodeConfig<Video, VideoProps>) {\n super(props as NodeConfig<Rect, RectProps>);\n }\n\n /**\n * Seconds of source the schedule has consumed by `elapsed`, or `null` when\n * there is no schedule.\n *\n * The whole of what a schedule *means*: a playing stretch consumes its own\n * length times its rate, a paused one consumes nothing, and the answer is\n * accumulated from the front every time rather than remembered — which is\n * what keeps it identical at every seek. The lists here are short (one entry\n * per play command), and the walk stops at the first segment that has not\n * started, so this is cheaper than the cached fill it feeds.\n */\n private playedAt(elapsed: number): number | null {\n const segments = this.segments;\n if (!segments || segments.length === 0) return null;\n\n let played = 0;\n for (const segment of segments) {\n if (elapsed <= segment.at) break;\n const speed = segment.speed ?? this.speed ?? 1;\n // `Infinity` on the last segment resolves to \"everything left\",\n // which `Math.min` gives without a branch: the clip is clamped\n // against its own trim by `sourceTimeFor` a moment later.\n played += Math.min(elapsed - segment.at, segment.duration) * speed;\n }\n return played;\n }\n\n /**\n * The source time the schedule puts the picture at, or `undefined` to leave\n * the fill deriving one for itself.\n *\n * The offset each segment starts from is folded in as `from - trimStart`, so\n * a schedule whose first segment enters the clip part-way through does what\n * it says while trim and loop still mean what they mean. That is why this\n * hands back a source time rather than a `playStart`: an offset can express\n * \"start later\", and only an explicit time can express \"and stop here\".\n */\n private scheduledTimestamp(): number | undefined {\n const played = this.playedAt(this.time.elapsed);\n if (played === null) return undefined;\n const start = this.trimStart ?? 0;\n const first = this.segments[0];\n const entry = first ? first.from - start : 0;\n return sourceTimeFor(\n played + entry,\n start,\n this.trimEnd ?? Infinity,\n this.loop,\n this.duration,\n );\n }\n\n /** Identity of the props that define the video fill; a change rebuilds it. */\n private videoKey(): string {\n // `crop`/`anchor` read back resolved (an object), so they are flattened\n // here rather than stringified — a tweened crop changes every frame and\n // must invalidate the cached fill, or the picture would freeze mid-tween.\n const crop = this.crop as InsetsResolved;\n const anchor = this.anchor as unknown as Vector2;\n return [\n this.src ?? '', this.fit ?? '', this.zoom, this.playing ? 1 : 0,\n crop.left, crop.right, crop.top, crop.bottom, anchor.x, anchor.y,\n this.timestamp ?? '', this.trimStart ?? '', this.trimEnd ?? '',\n this.speed ?? '', this.loop ?? '', this.duration ?? '',\n // The schedule's answer changes every frame while the clip runs, so\n // it belongs in the key for the same reason a tweened crop does: a\n // fill cached across it would freeze the picture mid-playback.\n this.scheduledTimestamp() ?? '',\n ].join('|');\n }\n\n /** (Re)build the resolved video fill from current props. */\n private syncVideo(): void {\n if (!this.src) {\n this._video = null;\n this._videoKey = \"\";\n return;\n }\n const key = this.videoKey();\n if (key === this._videoKey && this._video) return;\n this._videoKey = key;\n const prop: VideoFillProp = {\n type: 'video',\n src: this.src,\n fit: this.fit,\n crop: this.crop,\n zoom: this.zoom,\n anchor: this.anchor,\n matrix: this.matrix,\n filters: this.filters,\n playing: this.playing,\n // A schedule supersedes both: what it resolves *is* the playhead,\n // and it already carries whether the clip is running. An authored\n // `timestamp` still wins over it, since that is the author driving\n // the playhead by hand and this is the document driving it by chain.\n timestamp: this.timestamp ?? this.scheduledTimestamp(),\n trimStart: this.trimStart,\n trimEnd: this.trimEnd,\n speed: this.speed,\n loop: this.loop,\n duration: this.duration,\n };\n this._video = resolveFill(prop as FillProp) as VideoFillResolved;\n }\n\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets);\n if (!this.src) return;\n // Not `syncVideo()`: its timestamp reads the clock, and what loads never depends on the playhead.\n assets.fill(resolveFill({\n type: 'video',\n src: this.src,\n filters: this.filters,\n trimStart: this.trimStart,\n trimEnd: this.trimEnd,\n } as FillProp) as VideoFillResolved);\n }\n\n /**\n * The sound track: one clip, or one per segment when a schedule drives\n * playback — cut from the source where the picture reads, so a pause is\n * silent rather than sound running on under a frozen frame.\n */\n override declareAudio(audio: AudioScope): void {\n const src = this.src;\n if (!src || this.muted) return;\n const bus = this._busPath();\n\n if (this.segments.length > 0) {\n const clipEnd = this.trimEnd ?? audio.catalog.getMediaDuration(src);\n for (const segment of this.segments) {\n const speed = segment.speed ?? this.speed ?? 1;\n const from = segment.from;\n const to = Math.min(clipEnd, from + segment.duration * speed);\n // A zero-length request is one the mixer schedules and immediately stops.\n if (!(to > from)) continue;\n audio.clip({\n src,\n // A segment's `at` is on the node's own clock, which starts as it enters.\n at: audio.span.start + segment.at,\n volume: segment.volume ?? this.volume,\n trimStart: from,\n trimEnd: to,\n filters: this._soundFilters(speed),\n bus,\n });\n }\n return;\n }\n\n // With a schedule `playing` says nothing; without one, paused is silent.\n if (!this.playing) return;\n const loop = (this.loop ?? 'none') !== 'none';\n audio.clip({\n src,\n volume: this.volume,\n loop,\n trimStart: this.trimStart,\n // Resolved against the video's own length, so an unlooped clip ends\n // with its picture rather than running on as an open bed.\n trimEnd: this.trimEnd ?? (loop ? undefined : audio.catalog.getMediaDuration(src)),\n filters: this._soundFilters(this.speed ?? 1),\n bus,\n });\n }\n\n /** `speed` as a filter ahead of the node's own audio filters. */\n private _soundFilters(speed: number): AudioFilterItem[] {\n const filters: AudioFilterItem[] = [];\n if (speed !== 1) filters.push(...resolveAudioFilters(AudioFilters.speed(speed)));\n filters.push(...this.audioFilters!);\n return filters;\n }\n\n /** The bus chain {@link VideoProps.bus} names. */\n private _busPath(): AudioBusStop[] | undefined {\n if (!this.bus) return undefined;\n const target = findBusById(this, this.bus);\n return target ? busPathTo(target) : undefined;\n }\n\n\n /**\n * The node's box, as the rect state every pass declares.\n *\n * Split out of {@link shapeGraphics} because the overlay has to declare the\n * same rectangle **twice** inside one mask scope — once as the mask, once as\n * the content — and a `Graphics2D` is a list of ops rather than a shape that\n * can be restated.\n */\n private rectState() {\n return {\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n cornerRadius: this.cornerRadius,\n cornerStyle: this.cornerStyle,\n start: this.start,\n end: this.end,\n };\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().rect(this.rectState());\n }\n\n /**\n * The overlay, **clipped to the picture's own alpha** rather than to the\n * node's box.\n *\n * {@link ShapeNode} fills the silhouette, which for a media node is its rect\n * — and on a cut-out PNG that is the wrong shape by a wide margin: a wash\n * meant to tint the subject floods the transparent surround, so the whole\n * box turns colour. Not a subtle error.\n *\n * So the picture is declared as an **alpha mask** and the overlay as the\n * content inside it. `MaskMode.alpha` is the mask machinery's default and is\n * exactly this operation, so the renderer had nothing new to learn.\n *\n * A media node with no source paints no overlay at all: there is nothing\n * drawn to lay anything over, and falling back to the box would reintroduce\n * the bug precisely where it is most visible.\n */\n protected override renderOverlay(ctx: RenderContext2D): void {\n const overlay = this.overlay as FillResolved[];\n if (overlay.length === 0) return;\n const picture = (this.syncVideo(), this._video);\n if (!picture) return;\n\n ctx.draw(\n new Graphics2D()\n .mask()\n .rect(this.rectState())\n .fill([picture as unknown as FillProp])\n .applyMask()\n .rect(this.rectState())\n .fill(overlay as unknown as FillProp[])\n .endMask(),\n );\n }\n\n protected override renderSelf(draw: RenderContext2D): void {\n this.syncVideo();\n // Paint the video fill first (so it sits behind any user-supplied `fill`\n // layers — a tint or vignette over the frame), styled as the rect's fill.\n // Stroke is deferred to renderStroke (drawn after children + overlay), so\n // an overlay texture lands over the video and under the frame.\n // No clip chosen: the same empty slot an image node draws, and the same\n // pattern. An *image* fill rather than a video\n // one, because what it paints is identical and one placeholder is one\n // thing to keep in step.\n const fills: FillProp[] = [(this._video ?? UNSET_MEDIA_FILL) as FillProp];\n fills.push(...(this.fill as unknown as FillProp[]));\n\n draw.draw(this.shapeGraphics().shadow(this.shadow).fill(fills));\n }\n\n override dispose(): void {\n this._video = null;\n this._videoKey = \"\";\n super.dispose();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"video-node.js","sourceRoot":"","sources":["../../../src/nodes/media/video-node.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAmB,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAMtE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAoC,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAChH,OAAO,EAAE,IAAI,EAAa,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKjF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAe,mBAAmB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAsGlG;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,KAAM,SAAQ,IAAgB;IAkCvC;;;;;;OAMG;IACK,MAAM,GAA6B,IAAI,CAAC;IACxC,SAAS,GAAW,EAAE,CAAC;IAE/B,YAAY,KAAoC;QAC5C,KAAK,CAAC,KAAoC,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;;OAUG;IACK,QAAQ,CAAC,OAAe;QAC5B,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AAC;QACnB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AArTuB;IAAnB,QAAQ,EAAE;kCAAsB;AACb;IAAnB,QAAQ,EAAE;kCAAwB;AACT;IAAzB,cAAc,EAAE;mCAAyB;AACR;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;mCAAsB;AAClB;IAA5B,iBAAiB,EAAE;qCAA2B;AAC3B;IAAnB,QAAQ,EAAE;qCAA8B;AAEjC;IADP,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC;sCACvB;AAEvB;IAApC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCAA0B;AAClC;IAAnB,QAAQ,EAAE;wCAAmC;AAC1B;IAAnB,QAAQ,EAAE;wCAA4B;AACnB;IAAnB,QAAQ,EAAE;sCAA0B;AACjB;IAAnB,QAAQ,EAAE;oCAAwB;AACf;IAAnB,QAAQ,EAAE;mCAA+C;AACtC;IAAnB,QAAQ,EAAE;uCAA2B;AAEJ;IAAjC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;qCAAwB;AACX;IAArC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;oCAAwB;AAE7C;IADP,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;2CACd;AACC;IAAzC,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;kCAAsB;AASpB;IAAlC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;uCAA2C","sourcesContent":["import { RenderContext2D } from \"@/render/render-context2d\";\r\nimport { Graphics2D } from \"@/render/graphics2d\";\r\nimport { VideoAdjustment, resolveChainAdjustments } from \"@/attributes/shape/filters/chain\";\r\nimport { lerpFilterArray } from \"@/attributes/shape/filters/registry\";\r\nimport { MediaAdjustment, VideoOnlyAdjustment } from \"@/attributes/shape/filters/union\";\r\nimport { ImageCrop, ImageFit, ImageMatrix } from \"@/attributes/shape/fill/implementations/image\";\r\nimport { Alignment } from \"@/attributes/layout/alignment\";\r\nimport { InsetsResolved } from \"@/attributes/layout/insets\";\r\nimport { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { alignmentProperty, insetsProperty } from \"@/attributes/properties/typed\";\r\nimport { VideoFillProp, VideoFillResolved, sourceTimeFor } from \"@/attributes/shape/fill/implementations/video\";\r\nimport { Rect, RectProps } from \"../geometry/rect-node\";\r\nimport { property } from \"@/attributes/properties/decorator\";\r\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\r\nimport { resolveFill, UNSET_MEDIA_FILL } from \"@/attributes/shape/fill/registry\";\r\nimport { FillProp, FillResolved } from \"@/attributes/shape/fill/union\";\r\nimport type { AudioBusStop } from \"@/attributes/audio/request\";\r\nimport type { AudioScope } from \"@/attributes/audio/schedule\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport { busPathTo, findBusById } from \"@/nodes/audio/node-audio\";\r\nimport { AudioFilterItem } from \"@/attributes/audio/filters/union\";\r\nimport { AudioFilter, resolveAudioFilters, AudioFilters } from \"@/attributes/audio/filters/chain\";\r\n\r\nexport interface VideoProps extends RectProps {\r\n src?: string;\r\n /** How the (cropped) frame is scaled into the node's bounds. Default 'fill'. */\r\n fit?: ImageFit;\r\n /** Window onto the source frame, in fractions of its own size, applied before `fit`. */\r\n crop?: ImageCrop;\r\n /** Magnification on top of the fitted scale. `1` (default) is the fitted size. */\r\n zoom?: number;\r\n /** The point held fixed as `zoom` scales; also the alignment when it doesn't cover. */\r\n anchor?: Alignment;\r\n /** Raw frame→shape matrix; bypasses `crop`/`fit`/`zoom`/`anchor` and the bounds. */\r\n matrix?: ImageMatrix;\r\n /** Visual filters applied to the rendered frame (blur, color, posterizeTime, echo, …). */\r\n filters?: VideoAdjustment;\r\n /** Whether playback advances with the node's clock (drives both picture and sound). Default true. */\r\n playing?: boolean;\r\n /**\r\n * Explicit source time to show, in seconds. Omit it (the default) and the\r\n * picture is timed from the moment this node appeared; set it to drive the\r\n * playhead yourself, and set it to `null` to hand the playhead back to the\r\n * clock (`set()` merges a partial, so `undefined` won't clear it).\r\n */\r\n timestamp?: number | null;\r\n trimStart?: number;\r\n trimEnd?: number;\r\n /** Playback-rate multiplier for both picture and audio. Default 1. */\r\n speed?: number;\r\n loop?: 'forward' | 'reverse' | 'none';\r\n /** Length of one loop cycle, in seconds. Defaults to the trimmed clip length. */\r\n duration?: number;\r\n /** Audio volume in [0, 1]. Default 1. */\r\n volume?: number;\r\n /** Silence the video's audio track without affecting the picture. Default false. */\r\n muted?: boolean;\r\n /** Audio filters applied to the video's sound track (gain, eq, echo, …). */\r\n audioFilters?: AudioFilter;\r\n /**\r\n * The node id of an `AudioBus` in this clip to route the video's sound into.\r\n *\r\n * A `Video` is a `Node2D`, so it cannot be parented under a bus the way a\r\n * `SoundNode` is — its audio is welded to its picture, which has to stay in\r\n * the visual tree. Naming one instead is what lets a video's dialogue sit on\r\n * the same bus as everything else, so ducking the whole group is still one\r\n * edit — and it is the *same* id a `SoundNode` under that bus writes as its\r\n * `parentId`, rather than a second vocabulary for \"which bus\". An id matching\r\n * no bus routes straight to the master, the same as no bus at all.\r\n */\r\n bus?: string;\r\n /**\r\n * An explicit **playback schedule**: the stretches of this node's own clock\r\n * during which the clip advances, and where in the source each one starts.\r\n *\r\n * Omit it (the default) and playback is what it has always been — the clip\r\n * runs from the moment the node appears, at `speed`, until it or the node\r\n * runs out. Give it, and `playing`/`timestamp` are both superseded: the\r\n * picture takes its source time from whichever segment covers the current\r\n * `elapsed`, and the sound is scheduled one clip per segment.\r\n *\r\n * It exists because a **pause** cannot be expressed any other way. `playing:\r\n * false` holds the clip's *first* frame, because with playback derived\r\n * linearly from the clock there is nothing else it could hold; and the sound\r\n * runs on the node's own clock regardless, so a picture frozen by any means\r\n * would drift away from it. A schedule states the one thing both halves need\r\n * and neither could infer — that a paused stretch consumes no source — so\r\n * they cannot come apart.\r\n *\r\n * Still a pure function of the clock, which is the property everything else\r\n * here is built on: frame *N* is identical however the playhead reached it,\r\n * so a scrub, a playthrough and an export agree.\r\n */\r\n segments?: readonly VideoSegment[];\r\n\r\n}\r\n\r\n/**\r\n * One stretch of a {@link Video}'s own clock during which its source advances —\r\n * see {@link VideoProps.segments}.\r\n *\r\n * Trim and loop are applied *on top* of this, by the same code that applies them\r\n * to unscheduled playback, so a schedule says when the clip is running and the\r\n * clip's own props go on saying which part of the file it is running through.\r\n */\r\nexport interface VideoSegment {\r\n /** Second on the node's own clock (`NodeTime.elapsed`) this segment begins. */\r\n at: number;\r\n /** Source in-point for it, in seconds. */\r\n from: number;\r\n /**\r\n * How long it runs, in seconds of the node's clock.\r\n *\r\n * `Infinity` for a clip left running — the same open sentinel\r\n * `AudioRequest.endAt` uses — which resolves against the clip's length.\r\n */\r\n duration: number;\r\n /** Playback rate through it. Defaults to the node's own `speed`. */\r\n speed?: number;\r\n /** Linear gain for its sound. Defaults to the node's own `volume`. */\r\n volume?: number;\r\n}\r\n\r\n/**\r\n * A video. Layout and child positioning are inherited wholesale from\r\n * {@link Rect} — a Video lays out its children exactly like a Rect, just with a\r\n * *playing* video painted in place of the rect's fill. The\r\n * frame is drawn through a `video` fill, which resolves the source time to show\r\n * from this node's clock as it paints.\r\n *\r\n * It is the one media class left, and the reason it is a class where a still\r\n * picture is now just an `image` fill: a Video plays its own audio track,\r\n * declared as a clip of the same file trimmed/sped/looped to match the picture.\r\n * Set `muted` to drop the sound while keeping the picture; `playing: false`\r\n * freezes both.\r\n */\r\nexport class Video extends Rect<VideoProps> {\r\n\r\n @property() declare src?: string;\r\n @property() declare fit?: ImageFit;\r\n @insetsProperty() declare crop: ImageCrop;\r\n @property({ default: 1 }) declare zoom: number;\r\n @alignmentProperty() declare anchor: Alignment;\r\n @property() declare matrix?: ImageMatrix;\r\n @property({ default: [], tween: lerpFilterArray, mapper: resolveChainAdjustments })\r\n declare filters?: (MediaAdjustment | VideoOnlyAdjustment)[];\r\n\r\n @property({ default: true }) declare playing: boolean;\r\n @property() declare timestamp?: number | null;\r\n @property() declare trimStart?: number;\r\n @property() declare trimEnd?: number;\r\n @property() declare speed?: number;\r\n @property() declare loop?: 'forward' | 'reverse' | 'none';\r\n @property() declare duration?: number;\r\n\r\n @property({ default: 1 }) declare volume: number;\r\n @property({ default: false }) declare muted: boolean;\r\n @property({ default: [], mapper: resolveAudioFilters })\r\n declare audioFilters?: AudioFilterItem[];\r\n @property({ default: undefined }) declare bus?: string;\r\n\r\n /**\r\n * The playback schedule — see {@link VideoProps.segments}.\r\n *\r\n * Not tweenable, and not a mistake: there is no halfway between two\r\n * schedules. What moves over time is the playhead *within* one, which is\r\n * what the schedule describes.\r\n */\r\n @property({ default: [] }) declare segments: readonly VideoSegment[];\r\n\r\n /**\r\n * The `video` fill state `renderSelf` paints — so the picture reuses the\r\n * exact playback model authors get from `Fills.video(...)`, rather than\r\n * re-deriving timestamps here. The fill carries no timestamp of its own: it\r\n * resolves one as it paints, from this node's clock. Rebuilt from props when\r\n * the source or any playback knob changes (see {@link videoKey}).\r\n */\r\n private _video: VideoFillResolved | null = null;\r\n private _videoKey: string = \"\";\r\n\r\n constructor(props: NodeConfig<Video, VideoProps>) {\r\n super(props as NodeConfig<Rect, RectProps>);\r\n }\r\n\r\n /**\r\n * Seconds of source the schedule has consumed by `elapsed`, or `null` when\r\n * there is no schedule.\r\n *\r\n * The whole of what a schedule *means*: a playing stretch consumes its own\r\n * length times its rate, a paused one consumes nothing, and the answer is\r\n * accumulated from the front every time rather than remembered — which is\r\n * what keeps it identical at every seek. The lists here are short (one entry\r\n * per play command), and the walk stops at the first segment that has not\r\n * started, so this is cheaper than the cached fill it feeds.\r\n */\r\n private playedAt(elapsed: number): number | null {\r\n const segments = this.segments;\r\n if (!segments || segments.length === 0) return null;\r\n\r\n let played = 0;\r\n for (const segment of segments) {\r\n if (elapsed <= segment.at) break;\r\n const speed = segment.speed ?? this.speed ?? 1;\r\n // `Infinity` on the last segment resolves to \"everything left\",\r\n // which `Math.min` gives without a branch: the clip is clamped\r\n // against its own trim by `sourceTimeFor` a moment later.\r\n played += Math.min(elapsed - segment.at, segment.duration) * speed;\r\n }\r\n return played;\r\n }\r\n\r\n /**\r\n * The source time the schedule puts the picture at, or `undefined` to leave\r\n * the fill deriving one for itself.\r\n *\r\n * The offset each segment starts from is folded in as `from - trimStart`, so\r\n * a schedule whose first segment enters the clip part-way through does what\r\n * it says while trim and loop still mean what they mean. That is why this\r\n * hands back a source time rather than a `playStart`: an offset can express\r\n * \"start later\", and only an explicit time can express \"and stop here\".\r\n */\r\n private scheduledTimestamp(): number | undefined {\r\n const played = this.playedAt(this.time.elapsed);\r\n if (played === null) return undefined;\r\n const start = this.trimStart ?? 0;\r\n const first = this.segments[0];\r\n const entry = first ? first.from - start : 0;\r\n return sourceTimeFor(\r\n played + entry,\r\n start,\r\n this.trimEnd ?? Infinity,\r\n this.loop,\r\n this.duration,\r\n );\r\n }\r\n\r\n /** Identity of the props that define the video fill; a change rebuilds it. */\r\n private videoKey(): string {\r\n // `crop`/`anchor` read back resolved (an object), so they are flattened\r\n // here rather than stringified — a tweened crop changes every frame and\r\n // must invalidate the cached fill, or the picture would freeze mid-tween.\r\n const crop = this.crop as InsetsResolved;\r\n const anchor = this.anchor as unknown as Vector2;\r\n return [\r\n this.src ?? '', this.fit ?? '', this.zoom, this.playing ? 1 : 0,\r\n crop.left, crop.right, crop.top, crop.bottom, anchor.x, anchor.y,\r\n this.timestamp ?? '', this.trimStart ?? '', this.trimEnd ?? '',\r\n this.speed ?? '', this.loop ?? '', this.duration ?? '',\r\n // The schedule's answer changes every frame while the clip runs, so\r\n // it belongs in the key for the same reason a tweened crop does: a\r\n // fill cached across it would freeze the picture mid-playback.\r\n this.scheduledTimestamp() ?? '',\r\n ].join('|');\r\n }\r\n\r\n /** (Re)build the resolved video fill from current props. */\r\n private syncVideo(): void {\r\n if (!this.src) {\r\n this._video = null;\r\n this._videoKey = \"\";\r\n return;\r\n }\r\n const key = this.videoKey();\r\n if (key === this._videoKey && this._video) return;\r\n this._videoKey = key;\r\n const prop: VideoFillProp = {\r\n type: 'video',\r\n src: this.src,\r\n fit: this.fit,\r\n crop: this.crop,\r\n zoom: this.zoom,\r\n anchor: this.anchor,\r\n matrix: this.matrix,\r\n filters: this.filters,\r\n playing: this.playing,\r\n // A schedule supersedes both: what it resolves *is* the playhead,\r\n // and it already carries whether the clip is running. An authored\r\n // `timestamp` still wins over it, since that is the author driving\r\n // the playhead by hand and this is the document driving it by chain.\r\n timestamp: this.timestamp ?? this.scheduledTimestamp(),\r\n trimStart: this.trimStart,\r\n trimEnd: this.trimEnd,\r\n speed: this.speed,\r\n loop: this.loop,\r\n duration: this.duration,\r\n };\r\n this._video = resolveFill(prop as FillProp) as VideoFillResolved;\r\n }\r\n\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n if (!this.src) return;\r\n // Not `syncVideo()`: its timestamp reads the clock, and what loads never depends on the playhead.\r\n assets.fill(resolveFill({\r\n type: 'video',\r\n src: this.src,\r\n filters: this.filters,\r\n trimStart: this.trimStart,\r\n trimEnd: this.trimEnd,\r\n } as FillProp) as VideoFillResolved);\r\n }\r\n\r\n /**\r\n * The sound track: one clip, or one per segment when a schedule drives\r\n * playback — cut from the source where the picture reads, so a pause is\r\n * silent rather than sound running on under a frozen frame.\r\n */\r\n override declareAudio(audio: AudioScope): void {\r\n const src = this.src;\r\n if (!src || this.muted) return;\r\n const bus = this._busPath(audio);\r\n\r\n if (this.segments.length > 0) {\r\n const clipEnd = this.trimEnd ?? audio.catalog.getMediaDuration(src);\r\n for (const segment of this.segments) {\r\n const speed = segment.speed ?? this.speed ?? 1;\r\n const from = segment.from;\r\n const to = Math.min(clipEnd, from + segment.duration * speed);\r\n // A zero-length request is one the mixer schedules and immediately stops.\r\n if (!(to > from)) continue;\r\n audio.clip({\r\n src,\r\n // A segment's `at` is on the node's own clock, which starts as it enters.\r\n at: audio.span.start + segment.at,\r\n volume: segment.volume ?? this.volume,\r\n trimStart: from,\r\n trimEnd: to,\r\n filters: this._soundFilters(speed),\r\n bus,\r\n optional: true,\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // With a schedule `playing` says nothing; without one, paused is silent.\r\n if (!this.playing) return;\r\n const loop = (this.loop ?? 'none') !== 'none';\r\n audio.clip({\r\n src,\r\n volume: this.volume,\r\n loop,\r\n trimStart: this.trimStart,\r\n // Resolved against the video's own length, so an unlooped clip ends\r\n // with its picture rather than running on as an open bed.\r\n trimEnd: this.trimEnd ?? (loop ? undefined : audio.catalog.getMediaDuration(src)),\r\n filters: this._soundFilters(this.speed ?? 1),\r\n bus,\r\n optional: true,\r\n });\r\n }\r\n\r\n /** `speed` as a filter ahead of the node's own audio filters. */\r\n private _soundFilters(speed: number): AudioFilterItem[] {\r\n const filters: AudioFilterItem[] = [];\r\n if (speed !== 1) filters.push(...resolveAudioFilters(AudioFilters.speed(speed)));\r\n filters.push(...this.audioFilters!);\r\n return filters;\r\n }\r\n\r\n /** The bus chain {@link VideoProps.bus} names. */\r\n private _busPath(audio: AudioScope): AudioBusStop[] | undefined {\r\n if (!this.bus) return undefined;\r\n const target = findBusById(this, this.bus);\r\n return target ? busPathTo(target, audio) : undefined;\r\n }\r\n\r\n\r\n /**\r\n * The node's box, as the rect state every pass declares.\r\n *\r\n * Split out of {@link shapeGraphics} because the overlay has to declare the\r\n * same rectangle **twice** inside one mask scope — once as the mask, once as\r\n * the content — and a `Graphics2D` is a list of ops rather than a shape that\r\n * can be restated.\r\n */\r\n private rectState() {\r\n return {\r\n width: this.layoutBounds.width,\r\n height: this.layoutBounds.height,\r\n cornerRadius: this.cornerRadius,\r\n cornerStyle: this.cornerStyle,\r\n start: this.start,\r\n end: this.end,\r\n };\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D {\r\n return new Graphics2D().rect(this.rectState());\r\n }\r\n\r\n /**\r\n * The overlay, **clipped to the picture's own alpha** rather than to the\r\n * node's box.\r\n *\r\n * {@link ShapeNode} fills the silhouette, which for a media node is its rect\r\n * — and on a cut-out PNG that is the wrong shape by a wide margin: a wash\r\n * meant to tint the subject floods the transparent surround, so the whole\r\n * box turns colour. Not a subtle error.\r\n *\r\n * So the picture is declared as an **alpha mask** and the overlay as the\r\n * content inside it. `MaskMode.alpha` is the mask machinery's default and is\r\n * exactly this operation, so the renderer had nothing new to learn.\r\n *\r\n * A media node with no source paints no overlay at all: there is nothing\r\n * drawn to lay anything over, and falling back to the box would reintroduce\r\n * the bug precisely where it is most visible.\r\n */\r\n protected override renderOverlay(ctx: RenderContext2D): void {\r\n const overlay = this.overlay as FillResolved[];\r\n if (overlay.length === 0) return;\r\n const picture = (this.syncVideo(), this._video);\r\n if (!picture) return;\r\n\r\n ctx.draw(\r\n new Graphics2D()\r\n .mask()\r\n .rect(this.rectState())\r\n .fill([picture as unknown as FillProp])\r\n .applyMask()\r\n .rect(this.rectState())\r\n .fill(overlay as unknown as FillProp[])\r\n .endMask(),\r\n );\r\n }\r\n\r\n protected override renderSelf(draw: RenderContext2D): void {\r\n this.syncVideo();\r\n // Paint the video fill first (so it sits behind any user-supplied `fill`\r\n // layers — a tint or vignette over the frame), styled as the rect's fill.\r\n // Stroke is deferred to renderStroke (drawn after children + overlay), so\r\n // an overlay texture lands over the video and under the frame.\r\n // No clip chosen: the same empty slot an image node draws, and the same\r\n // pattern. An *image* fill rather than a video\r\n // one, because what it paints is identical and one placeholder is one\r\n // thing to keep in step.\r\n const fills: FillProp[] = [(this._video ?? UNSET_MEDIA_FILL) as FillProp];\r\n fills.push(...(this.fill as unknown as FillProp[]));\r\n\r\n draw.draw(this.shapeGraphics().shadow(this.shadow).fill(fills));\r\n }\r\n\r\n override dispose(): void {\r\n this._video = null;\r\n this._videoKey = \"\";\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declare-paints.js","sourceRoot":"","sources":["../../../src/nodes/node/declare-paints.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,MAAkB,EAAE,KAAmB;IACjF,MAAM,OAAO,GAAG,CAAC,OAA8C,EAAQ,EAAE;QACvE,KAAK,MAAM,MAAM,IAAI,OAAO,IAAI,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9D,CAAC,CAAA;IAED,4EAA4E;IAC5E,MAAM,IAAI,GAAG,IAKZ,CAAA;IACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;IAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;IAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAEhE,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,KAAK,IAAI,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC1D,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,OAAO,IAAI,EAAE;QAAE,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9D,CAAC","sourcesContent":["import type { AssetScope } from \"@/assets/scope\"\nimport type { FillResolved } from \"@/attributes/shape/fill/union\"\nimport type { ShadowResolved } from \"@/attributes/shape/shadow/shadow\"\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\"\n\n/** The paints a node computes rather than stores, which no convention can find. */\nexport interface ExtraPaints {\n fills?: readonly FillResolved[][]\n strokes?: readonly StrokeResolved[][]\n}\n\n/**\n * Declare the assets of a node's paint props.\n *\n * `PaintNode` does this for the slots it owns. The chart and diagram internals\n * extend `Node` directly — they draw a raw `Graphics` and want none of a shape's\n * clip or layout — and so inherit no such declaration while still carrying\n * `fill`/`stroke`/`shadow` props of their own; an undeclared asset there is an\n * `AssetNotLoadedError` the moment the renderer reaches for it.\n */\nexport function declarePaints(node: object, assets: AssetScope, extra?: ExtraPaints): void {\n const stroked = (strokes: readonly StrokeResolved[] | undefined): void => {\n for (const stroke of strokes ?? []) assets.fill(stroke.fill)\n }\n\n // Conventional prop names, each already resolved by its `@property` mapper.\n const held = node as {\n fill?: FillResolved[]\n overlay?: FillResolved[]\n stroke?: StrokeResolved[]\n shadow?: ShadowResolved[]\n }\n assets.fill(held.fill ?? [])\n assets.fill(held.overlay ?? [])\n stroked(held.stroke)\n for (const shadow of held.shadow ?? []) assets.fill(shadow.fill)\n\n for (const fills of extra?.fills ?? []) assets.fill(fills)\n for (const strokes of extra?.strokes ?? []) stroked(strokes)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"declare-paints.js","sourceRoot":"","sources":["../../../src/nodes/node/declare-paints.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,MAAkB,EAAE,KAAmB;IACjF,MAAM,OAAO,GAAG,CAAC,OAA8C,EAAQ,EAAE;QACvE,KAAK,MAAM,MAAM,IAAI,OAAO,IAAI,EAAE;YAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9D,CAAC,CAAA;IAED,4EAA4E;IAC5E,MAAM,IAAI,GAAG,IAKZ,CAAA;IACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;IAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;IAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAEhE,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,KAAK,IAAI,EAAE;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC1D,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,OAAO,IAAI,EAAE;QAAE,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9D,CAAC","sourcesContent":["import type { AssetScope } from \"@/assets/scope\"\r\nimport type { FillResolved } from \"@/attributes/shape/fill/union\"\r\nimport type { ShadowResolved } from \"@/attributes/shape/shadow/shadow\"\r\nimport type { StrokeResolved } from \"@/attributes/shape/stroke/stroke\"\r\n\r\n/** The paints a node computes rather than stores, which no convention can find. */\r\nexport interface ExtraPaints {\r\n fills?: readonly FillResolved[][]\r\n strokes?: readonly StrokeResolved[][]\r\n}\r\n\r\n/**\r\n * Declare the assets of a node's paint props.\r\n *\r\n * `PaintNode` does this for the slots it owns. The chart and diagram internals\r\n * extend `Node` directly — they draw a raw `Graphics` and want none of a shape's\r\n * clip or layout — and so inherit no such declaration while still carrying\r\n * `fill`/`stroke`/`shadow` props of their own; an undeclared asset there is an\r\n * `AssetNotLoadedError` the moment the renderer reaches for it.\r\n */\r\nexport function declarePaints(node: object, assets: AssetScope, extra?: ExtraPaints): void {\r\n const stroked = (strokes: readonly StrokeResolved[] | undefined): void => {\r\n for (const stroke of strokes ?? []) assets.fill(stroke.fill)\r\n }\r\n\r\n // Conventional prop names, each already resolved by its `@property` mapper.\r\n const held = node as {\r\n fill?: FillResolved[]\r\n overlay?: FillResolved[]\r\n stroke?: StrokeResolved[]\r\n shadow?: ShadowResolved[]\r\n }\r\n assets.fill(held.fill ?? [])\r\n assets.fill(held.overlay ?? [])\r\n stroked(held.stroke)\r\n for (const shadow of held.shadow ?? []) assets.fill(shadow.fill)\r\n\r\n for (const fills of extra?.fills ?? []) assets.fill(fills)\r\n for (const strokes of extra?.strokes ?? []) stroked(strokes)\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-editor-state.js","sourceRoot":"","sources":["../../../src/nodes/node/node-editor-state.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAU,EAAE,MAAoC;IAC9E,MAAM,IAAI,GAAG,CAAC,IAAU,EAAQ,EAAE;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;QACrE,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { Node } from \"./node\";\n\n/**\n * What an editor says about one node, as against what the document says.\n *\n * Neither of these is a prop. They are not authored values, they do not tween,\n * they are not part of the scene's meaning — an exported frame is the same\n * whether or not the person who made it had a layer folded away. They are the\n * editor's view of the tree, so they arrive on the side and are applied over it.\n */\nexport interface NodeEditorState {\n /**\n * Hide the node and everything under it: no paint, no pick, and no layout\n * slot — a hidden child of a row gives up its cell and its gap, the way\n * `display: none` does rather than `visibility: hidden`.\n *\n * The node **stays in the tree**. Dropping it instead would renumber every\n * later sibling's structural path, which is what a host's boxes, its\n * lifespans and its picking are all keyed on.\n */\n hidden?: boolean;\n /**\n * Take the node out of reach of the pointer while leaving the picture\n * untouched — Figma's padlock.\n *\n * Not the opposite of {@link hidden} and not a weaker form of it. A locked\n * node still draws, still lays out, and still confines its children; what it\n * declines is being the *answer* to a pick. Its children stay pickable,\n * because locking a group is about the group.\n */\n locked?: boolean;\n}\n\n/**\n * Editor state for a whole tree, keyed by {@link Node.key}.\n *\n * A record rather than a list: the walk that applies it asks once per node, and\n * a host with a thousand-node scene should not pay a scan for each.\n */\nexport type NodeEditorStates = Record<string, NodeEditorState>;\n\n/**\n * Push `states` onto the tree under `root`.\n *\n * Resolved onto the nodes rather than consulted from them, so `render` and the\n * pick walk read a local field instead of probing a record they would first have\n * to reach the scene to find. Called once per frame from `ClipInstance.attach`, which\n * is after the tree is built and before it is laid out — a node that appeared\n * this frame therefore gets its state on the same frame it appears.\n *\n * A node with no `key`, or a key the record does not mention, is reset rather\n * than left alone: the record is the whole truth about editor state, so a key\n * dropped from it is a node unhidden.\n */\nexport function applyEditorStates(root: Node, states: NodeEditorStates | undefined): void {\n const walk = (node: Node): void => {\n const state = node.key !== undefined ? states?.[node.key] : undefined;\n node._setEditorState(state?.hidden === true, state?.locked === true);\n for (const child of node._allChildren) walk(child);\n };\n walk(root);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"node-editor-state.js","sourceRoot":"","sources":["../../../src/nodes/node/node-editor-state.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAU,EAAE,MAAoC;IAC9E,MAAM,IAAI,GAAG,CAAC,IAAU,EAAQ,EAAE;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACtE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;QACrE,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY;YAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { Node } from \"./node\";\r\n\r\n/**\r\n * What an editor says about one node, as against what the document says.\r\n *\r\n * Neither of these is a prop. They are not authored values, they do not tween,\r\n * they are not part of the scene's meaning — an exported frame is the same\r\n * whether or not the person who made it had a layer folded away. They are the\r\n * editor's view of the tree, so they arrive on the side and are applied over it.\r\n */\r\nexport interface NodeEditorState {\r\n /**\r\n * Hide the node and everything under it: no paint, no pick, and no layout\r\n * slot — a hidden child of a row gives up its cell and its gap, the way\r\n * `display: none` does rather than `visibility: hidden`.\r\n *\r\n * The node **stays in the tree**. Dropping it instead would renumber every\r\n * later sibling's structural path, which is what a host's boxes, its\r\n * lifespans and its picking are all keyed on.\r\n */\r\n hidden?: boolean;\r\n /**\r\n * Take the node out of reach of the pointer while leaving the picture\r\n * untouched — Figma's padlock.\r\n *\r\n * Not the opposite of {@link hidden} and not a weaker form of it. A locked\r\n * node still draws, still lays out, and still confines its children; what it\r\n * declines is being the *answer* to a pick. Its children stay pickable,\r\n * because locking a group is about the group.\r\n */\r\n locked?: boolean;\r\n}\r\n\r\n/**\r\n * Editor state for a whole tree, keyed by {@link Node.key}.\r\n *\r\n * A record rather than a list: the walk that applies it asks once per node, and\r\n * a host with a thousand-node scene should not pay a scan for each.\r\n */\r\nexport type NodeEditorStates = Record<string, NodeEditorState>;\r\n\r\n/**\r\n * Push `states` onto the tree under `root`.\r\n *\r\n * Resolved onto the nodes rather than consulted from them, so `render` and the\r\n * pick walk read a local field instead of probing a record they would first have\r\n * to reach the scene to find. Called once per frame from `ClipInstance.attach`, which\r\n * is after the tree is built and before it is laid out — a node that appeared\r\n * this frame therefore gets its state on the same frame it appears.\r\n *\r\n * A node with no `key`, or a key the record does not mention, is reset rather\r\n * than left alone: the record is the whole truth about editor state, so a key\r\n * dropped from it is a node unhidden.\r\n */\r\nexport function applyEditorStates(root: Node, states: NodeEditorStates | undefined): void {\r\n const walk = (node: Node): void => {\r\n const state = node.key !== undefined ? states?.[node.key] : undefined;\r\n node._setEditorState(state?.hidden === true, state?.locked === true);\r\n for (const child of node._allChildren) walk(child);\r\n };\r\n walk(root);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-reactive.js","sourceRoot":"","sources":["../../../src/nodes/node/node-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AA2B7D;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,UAAU,YAAY,CAAM,IAAkB,EAAE,KAAa,EAAE,OAA+B;IAChG,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAM,SAA2B,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACjB,CAAC,KAAK,CAAC,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,KAAqB,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,MAAuC,CAAC,CAAC;IAC9F,CAAC;IACD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE;QAC/B,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;QACrB,GAAG,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE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AAkB,EAClB,KAA4B,EAC5B,QAAgB,EAChB,MAAuB;IAEvB,IAAI,OAAO,GAAwB,IAAI,CAAC;IAExC,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;QAChC,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,oEAAoE;YACpE,4DAA4D;YAC5D,MAAM,MAAM,GAA4B,EAAE,CAAC;YAC3C,IAAI,KAAK,EAAE,CAAC;gBACR,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;oBAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;gBAC7B,CAAC;YACL,CAAC;YACD,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;QAC3B,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;YAAE,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC,EAAE,MAAM,CAAC,CAAC;AACf,CAAC","sourcesContent":["import { PropSlot, PropSnapshot } from \"@/props/slot\";\nimport { ensureCells, PropHost, TweenFn } from \"@/props/host\";\nimport { EasingFunction } from \"@/tween/ease/type\";\nimport { driveCommand, type Command } from \"@/tween/command\";\nimport { TweenStepper } from \"@/tween/stepper\";\nimport { PropOptions } from \"@/attributes/properties/decorator\";\n\n/**\n * Companion implementation of {@link Node2D}'s property machinery and its\n * save/restore state stack. The bodies live here as free functions over a\n * narrow {@link ReactiveHost} so `node.ts` keeps only thin delegators (and the\n * hot-path `set`/`_writeProp`, which stay inline on the class). Mirrors the\n * existing `getPropSlot(host, name)` pattern in `props/host.ts`.\n */\n\n/**\n * The slice of a {@link Node2D} these helpers touch: the {@link PropHost} maps\n * plus the internal write/tween seams. `_writeProp` and `_prepareStep` remain\n * methods on `Node2D`; the helpers call back through them so subclass behaviour\n * and the inline hot path are preserved.\n */\n/** @internal */\nexport interface ReactiveHost extends PropHost {\n readonly id: string;\n _writeProp(field: string, value: unknown): void;\n _prepareStep(to: Record<string, unknown>, duration: number, easing?: EasingFunction): TweenStepper;\n /** LIFO stack of save() snapshot layers; owned as an instance field on Node2D. */\n _stateStack: Map<string, PropSnapshot<any>>[];\n}\n\n/**\n * Create the {@link PropSlot} + accessor for a freshly-declared prop and register\n * its tween/mapper metadata. Extracted from `Node2D._registerProp`; defines the\n * getter/setter on `host` so writes route through `host._writeProp`\n * (mapper-aware, binding-aware).\n */\n/** @internal */\nexport function registerProp<Int>(host: ReactiveHost, field: string, options?: PropOptions<any, Int>): void {\n const slot = new PropSlot<Int>(undefined as unknown as Int, host, field);\n const cells = ensureCells(host);\n cells.slots.set(field, slot);\n if (options?.tween) {\n (cells.tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\n }\n if (options?.mapper) {\n (cells.mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\n }\n Object.defineProperty(host, field, {\n get: () => slot.get(),\n set: (value: any) => host._writeProp(field, value),\n enumerable: true,\n configurable: true,\n });\n}\n\n/**\n * Apply (or re-apply) a prop's initial value plus optional tween/mapper. A first\n * call creates the cell via {@link registerProp}; a subsequent call for the same\n * field reuses the cell and only refines its tween/mapper (so a subclass can\n * override a parent default without losing the cell or its bindings), then\n * writes the value. Extracted from `Node2D.applyProp`.\n */\n/** @internal */\nexport function applyProp<Ext, Int = Ext>(\n host: ReactiveHost,\n field: string,\n initial: Ext | (() => Ext) | undefined,\n options?: PropOptions<Ext, Int>,\n): void {\n const existing = host.__cells?.slots.get(field);\n if (!existing) {\n registerProp<Int>(host, field, options);\n } else if (options) {\n // Allow subclasses to refine tween/mapper on an inherited field.\n if (options.tween) {\n (ensureCells(host).tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\n }\n if (options.mapper) {\n (ensureCells(host).mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\n }\n }\n host._writeProp(field, initial);\n}\n\n/** Snapshot every registered prop's current value/binding into a plain object. */\n/** @internal */\nexport function collectProperties(host: ReactiveHost): Record<string, any> {\n const result: Record<string, any> = {};\n if (host.__cells) {\n for (const key of host.__cells.slots.keys()) {\n result[key] = (host as any)[key];\n }\n }\n return result;\n}\n\n// ---- State stack (save / restore) -----------------------------------------\n\n/**\n * Every declared prop of a node, captured as the value **or binding** its slot\n * holds — see {@link Node2D.captureProps}, which is the public way to make one.\n *\n * Keyed by prop name. Opaque on purpose: what a slot holds is the *mapped*,\n * internal form, and reading it out to write back through `set` is exactly the\n * round-trip a layer exists to avoid.\n */\nexport type PropLayer = Map<string, PropSnapshot<any>>;\n\n/** Snapshot every prop slot (value or binding) into a fresh layer. */\n/** @internal */\nexport function captureLayer(host: ReactiveHost): PropLayer {\n const layer: PropLayer = new Map();\n const slots = host.__cells?.slots;\n if (!slots) return layer;\n for (const [key, slot] of slots) {\n layer.set(key, slot.snapshot());\n }\n return layer;\n}\n\n/** Push a snapshot of every prop slot (value or binding) onto the stack. */\n/** @internal */\nexport function saveState(host: ReactiveHost): void {\n if (!host.__cells) return;\n host._stateStack.push(captureLayer(host));\n}\n\n/** Pop the top snapshot layer, or `undefined` if the stack is empty. */\n/** @internal */\nexport function popState(host: ReactiveHost): PropLayer | undefined {\n return host._stateStack.pop();\n}\n\n/** Instantly reapply a snapshot layer to every captured slot. */\n/** @internal */\nexport function applySnapshotLayer(host: ReactiveHost, layer: PropLayer): void {\n const slots = host.__cells?.slots;\n if (!slots) return;\n for (const [key, snap] of layer) {\n slots.get(key)?.restoreFrom(snap);\n }\n}\n\n/**\n * Animated restore: tween the numeric / custom-tweenable props toward their\n * saved resolved values, then reapply the full snapshot so bindings are\n * restored (not frozen at the tween's landing value) and non-tweened props snap.\n *\n * A {@link Command} rather than a generator: `_prepareStep`'s stepper already\n * drives the tween as a pure function of elapsed time, so `driveCommand` wraps\n * it directly and fires the snapshot reapply exactly at `t === 1` — the same\n * \"commit at the end, restore what came before below it\" shape\n * `packages/components/code`'s `runTransition` uses.\n *\n * `_prepareStep` is called **lazily, on the command's first evaluation**, not\n * when this function runs — it snapshots each prop's `from` off the *live*\n * node, and a generator's body (what this replaces) never ran a line until the\n * caller's first `.next()` either. Building it eagerly would snapshot whatever\n * the node happened to hold at `restore()`-call time instead of at first-drive\n * time, which can differ if the caller does more to the node in between.\n */\n/** @internal */\nexport function restoreAnimated(\n host: ReactiveHost,\n layer: PropLayer | undefined,\n duration: number,\n easing?: EasingFunction,\n): Command<Record<string, never>> {\n let stepper: TweenStepper | null = null;\n\n return driveCommand(duration, (t) => {\n if (!stepper) {\n // `to()` reads each snapshot's resolved `value` (correct even for a\n // bound slot), so the node animates back to where it *was*.\n const target: Record<string, unknown> = {};\n if (layer) {\n for (const [key, snap] of layer) {\n target[key] = snap.value;\n }\n }\n stepper = host._prepareStep(target, duration);\n }\n stepper.seek(t * duration);\n if (layer && t >= 1) applySnapshotLayer(host, layer);\n }, easing);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"node-reactive.js","sourceRoot":"","sources":["../../../src/nodes/node/node-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAgB,MAAM,iBAAiB,CAAC;AA2B7D;;;;;GAKG;AACH,gBAAgB;AAChB,MAAM,UAAU,YAAY,CAAM,IAAkB,EAAE,KAAa,EAAE,OAA+B;IAChG,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAM,SAA2B,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACj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cesContent":["import { PropSlot, PropSnapshot } from \"@/props/slot\";\r\nimport { ensureCells, PropHost, TweenFn } from \"@/props/host\";\r\nimport { EasingFunction } from \"@/tween/ease/type\";\r\nimport { driveCommand, type Command } from \"@/tween/command\";\r\nimport { TweenStepper } from \"@/tween/stepper\";\r\nimport { PropOptions } from \"@/attributes/properties/decorator\";\r\n\r\n/**\r\n * Companion implementation of {@link Node2D}'s property machinery and its\r\n * save/restore state stack. The bodies live here as free functions over a\r\n * narrow {@link ReactiveHost} so `node.ts` keeps only thin delegators (and the\r\n * hot-path `set`/`_writeProp`, which stay inline on the class). Mirrors the\r\n * existing `getPropSlot(host, name)` pattern in `props/host.ts`.\r\n */\r\n\r\n/**\r\n * The slice of a {@link Node2D} these helpers touch: the {@link PropHost} maps\r\n * plus the internal write/tween seams. `_writeProp` and `_prepareStep` remain\r\n * methods on `Node2D`; the helpers call back through them so subclass behaviour\r\n * and the inline hot path are preserved.\r\n */\r\n/** @internal */\r\nexport interface ReactiveHost extends PropHost {\r\n readonly id: string;\r\n _writeProp(field: string, value: unknown): void;\r\n _prepareStep(to: Record<string, unknown>, duration: number, easing?: EasingFunction): TweenStepper;\r\n /** LIFO stack of save() snapshot layers; owned as an instance field on Node2D. */\r\n _stateStack: Map<string, PropSnapshot<any>>[];\r\n}\r\n\r\n/**\r\n * Create the {@link PropSlot} + accessor for a freshly-declared prop and register\r\n * its tween/mapper metadata. Extracted from `Node2D._registerProp`; defines the\r\n * getter/setter on `host` so writes route through `host._writeProp`\r\n * (mapper-aware, binding-aware).\r\n */\r\n/** @internal */\r\nexport function registerProp<Int>(host: ReactiveHost, field: string, options?: PropOptions<any, Int>): void {\r\n const slot = new PropSlot<Int>(undefined as unknown as Int, host, field);\r\n const cells = ensureCells(host);\r\n cells.slots.set(field, slot);\r\n if (options?.tween) {\r\n (cells.tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\r\n }\r\n if (options?.mapper) {\r\n (cells.mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\r\n }\r\n Object.defineProperty(host, field, {\r\n get: () => slot.get(),\r\n set: (value: any) => host._writeProp(field, value),\r\n enumerable: true,\r\n configurable: true,\r\n });\r\n}\r\n\r\n/**\r\n * Apply (or re-apply) a prop's initial value plus optional tween/mapper. A first\r\n * call creates the cell via {@link registerProp}; a subsequent call for the same\r\n * field reuses the cell and only refines its tween/mapper (so a subclass can\r\n * override a parent default without losing the cell or its bindings), then\r\n * writes the value. Extracted from `Node2D.applyProp`.\r\n */\r\n/** @internal */\r\nexport function applyProp<Ext, Int = Ext>(\r\n host: ReactiveHost,\r\n field: string,\r\n initial: Ext | (() => Ext) | undefined,\r\n options?: PropOptions<Ext, Int>,\r\n): void {\r\n const existing = host.__cells?.slots.get(field);\r\n if (!existing) {\r\n registerProp<Int>(host, field, options);\r\n } else if (options) {\r\n // Allow subclasses to refine tween/mapper on an inherited field.\r\n if (options.tween) {\r\n (ensureCells(host).tweens ??= new Map()).set(field, options.tween as TweenFn<any>);\r\n }\r\n if (options.mapper) {\r\n (ensureCells(host).mappers ??= new Map()).set(field, options.mapper as (ext: any, prev?: any) => any);\r\n }\r\n }\r\n host._writeProp(field, initial);\r\n}\r\n\r\n/** Snapshot every registered prop's current value/binding into a plain object. */\r\n/** @internal */\r\nexport function collectProperties(host: ReactiveHost): Record<string, any> {\r\n const result: Record<string, any> = {};\r\n if (host.__cells) {\r\n for (const key of host.__cells.slots.keys()) {\r\n result[key] = (host as any)[key];\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n// ---- State stack (save / restore) -----------------------------------------\r\n\r\n/**\r\n * Every declared prop of a node, captured as the value **or binding** its slot\r\n * holds — see {@link Node2D.captureProps}, which is the public way to make one.\r\n *\r\n * Keyed by prop name. Opaque on purpose: what a slot holds is the *mapped*,\r\n * internal form, and reading it out to write back through `set` is exactly the\r\n * round-trip a layer exists to avoid.\r\n */\r\nexport type PropLayer = Map<string, PropSnapshot<any>>;\r\n\r\n/** Snapshot every prop slot (value or binding) into a fresh layer. */\r\n/** @internal */\r\nexport function captureLayer(host: ReactiveHost): PropLayer {\r\n const layer: PropLayer = new Map();\r\n const slots = host.__cells?.slots;\r\n if (!slots) return layer;\r\n for (const [key, slot] of slots) {\r\n layer.set(key, slot.snapshot());\r\n }\r\n return layer;\r\n}\r\n\r\n/** Push a snapshot of every prop slot (value or binding) onto the stack. */\r\n/** @internal */\r\nexport function saveState(host: ReactiveHost): void {\r\n if (!host.__cells) return;\r\n host._stateStack.push(captureLayer(host));\r\n}\r\n\r\n/** Pop the top snapshot layer, or `undefined` if the stack is empty. */\r\n/** @internal */\r\nexport function popState(host: ReactiveHost): PropLayer | undefined {\r\n return host._stateStack.pop();\r\n}\r\n\r\n/** Instantly reapply a snapshot layer to every captured slot. */\r\n/** @internal */\r\nexport function applySnapshotLayer(host: ReactiveHost, layer: PropLayer): void {\r\n const slots = host.__cells?.slots;\r\n if (!slots) return;\r\n for (const [key, snap] of layer) {\r\n slots.get(key)?.restoreFrom(snap);\r\n }\r\n}\r\n\r\n/**\r\n * Animated restore: tween the numeric / custom-tweenable props toward their\r\n * saved resolved values, then reapply the full snapshot so bindings are\r\n * restored (not frozen at the tween's landing value) and non-tweened props snap.\r\n *\r\n * A {@link Command} rather than a generator: `_prepareStep`'s stepper already\r\n * drives the tween as a pure function of elapsed time, so `driveCommand` wraps\r\n * it directly and fires the snapshot reapply exactly at `t === 1` — the same\r\n * \"commit at the end, restore what came before below it\" shape\r\n * `packages/components/code`'s `runTransition` uses.\r\n *\r\n * `_prepareStep` is called **lazily, on the command's first evaluation**, not\r\n * when this function runs — it snapshots each prop's `from` off the *live*\r\n * node, and a generator's body (what this replaces) never ran a line until the\r\n * caller's first `.next()` either. Building it eagerly would snapshot whatever\r\n * the node happened to hold at `restore()`-call time instead of at first-drive\r\n * time, which can differ if the caller does more to the node in between.\r\n */\r\n/** @internal */\r\nexport function restoreAnimated(\r\n host: ReactiveHost,\r\n layer: PropLayer | undefined,\r\n duration: number,\r\n easing?: EasingFunction,\r\n): Command<Record<string, never>> {\r\n let stepper: TweenStepper | null = null;\r\n\r\n return driveCommand(duration, (t) => {\r\n if (!stepper) {\r\n // `to()` reads each snapshot's resolved `value` (correct even for a\r\n // bound slot), so the node animates back to where it *was*.\r\n const target: Record<string, unknown> = {};\r\n if (layer) {\r\n for (const [key, snap] of layer) {\r\n target[key] = snap.value;\r\n }\r\n }\r\n stepper = host._prepareStep(target, duration);\r\n }\r\n stepper.seek(t * duration);\r\n if (layer && t >= 1) applySnapshotLayer(host, layer);\r\n }, easing);\r\n}\r\n"]}
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* and added then reads `elapsed === 0` on its first frame.
|
|
13
13
|
*/
|
|
14
14
|
export interface NodeTime {
|
|
15
|
-
/** Seconds since the
|
|
15
|
+
/** Seconds since the clip started. */
|
|
16
16
|
readonly total: number;
|
|
17
|
-
/** The
|
|
17
|
+
/** The clip time at which this node was first advanced. */
|
|
18
18
|
readonly creation: number;
|
|
19
19
|
/** How long this node has existed: `total - creation`. */
|
|
20
20
|
readonly elapsed: number;
|
|
@@ -34,6 +34,6 @@ export interface MutableNodeTime {
|
|
|
34
34
|
}
|
|
35
35
|
/** The zeroed holder a node keeps for its lifetime. @internal */
|
|
36
36
|
export declare function createNodeTime(): MutableNodeTime;
|
|
37
|
-
/** Advance `time` to `total`
|
|
37
|
+
/** Advance `time` to `total` clip-seconds, seeding `creation` on first tick. @internal */
|
|
38
38
|
export declare function advanceNodeTime(time: MutableNodeTime, total: number): void;
|
|
39
39
|
//# sourceMappingURL=node-time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-time.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACrB,
|
|
1
|
+
{"version":3,"file":"node-time.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,QAAQ;IACrB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,cAAc,IAAI,eAAe,CAEhD;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAO1E"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export function createNodeTime() {
|
|
3
3
|
return { total: 0, creation: 0, elapsed: 0, started: false };
|
|
4
4
|
}
|
|
5
|
-
/** Advance `time` to `total`
|
|
5
|
+
/** Advance `time` to `total` clip-seconds, seeding `creation` on first tick. @internal */
|
|
6
6
|
export function advanceNodeTime(time, total) {
|
|
7
7
|
if (!time.started) {
|
|
8
8
|
time.creation = total;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-time.js","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAoCA,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC1B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjE,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"node-time.js","sourceRoot":"","sources":["../../../src/nodes/node/node-time.ts"],"names":[],"mappings":"AAoCA,iEAAiE;AACjE,MAAM,UAAU,cAAc;IAC1B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjE,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,eAAe,CAAC,IAAqB,EAAE,KAAa;IAChE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IACD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACnB,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;AACzC,CAAC","sourcesContent":["/**\r\n * A node's place on the scene's clock, read via `node.time`.\r\n *\r\n * Advanced once per frame by `Node.attach`, and consumed by motion sampling,\r\n * the render context's `elapsed`, and anything a node's own `tick()` derives\r\n * from time.\r\n *\r\n * `creation` is seeded on the node's **first** advance rather than at\r\n * construction, so `elapsed` measures how long a node has been *in the scene* —\r\n * which is what an entrance animation, a video's playhead and a per-node\r\n * dissolve all actually mean. A node built during the generator's third second\r\n * and added then reads `elapsed === 0` on its first frame.\r\n */\r\nexport interface NodeTime {\r\n /** Seconds since the clip started. */\r\n readonly total: number;\r\n /** The clip time at which this node was first advanced. */\r\n readonly creation: number;\r\n /** How long this node has existed: `total - creation`. */\r\n readonly elapsed: number;\r\n}\r\n\r\n/**\r\n * The writable form the runtime advances. Nodes hand out {@link NodeTime}, which\r\n * is the same shape with every field read-only.\r\n *\r\n * @internal\r\n */\r\nexport interface MutableNodeTime {\r\n total: number;\r\n creation: number;\r\n elapsed: number;\r\n /** Whether {@link advanceNodeTime} has seeded `creation` yet. */\r\n started: boolean;\r\n}\r\n\r\n/** The zeroed holder a node keeps for its lifetime. @internal */\r\nexport function createNodeTime(): MutableNodeTime {\r\n return { total: 0, creation: 0, elapsed: 0, started: false };\r\n}\r\n\r\n/** Advance `time` to `total` clip-seconds, seeding `creation` on first tick. @internal */\r\nexport function advanceNodeTime(time: MutableNodeTime, total: number): void {\r\n if (!time.started) {\r\n time.creation = total;\r\n time.started = true;\r\n }\r\n time.total = total;\r\n time.elapsed = total - time.creation;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-walk.js","sourceRoot":"","sources":["../../../src/nodes/node/node-walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,KAAyC;IAC9E,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,IAAY,EAAE,KAAyC;IACpF,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IAC1B,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACjG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,IAAU;IAC9C,IAAwD,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,IAAU;IACjC,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,UAAU,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU,EAAE,EAAU;IAClD,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { nodePath } from \"@/project/tree\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport type { Node } from \"./node\";\n\n/**\n * The subtree traversals the runtime drives, as free functions over a {@link Node}:\n * what is left on `Node` is what a node *is*, and what is here is what the engine\n * *does to* one. Every walk stops at an unmounted node — see {@link Node.mounted}.\n *\n * @internal\n */\n\n/**\n * Declare one node's own assets — never its children's, so each node's\n * declarations stay attributable to it.\n */\nexport function declareNode(node: Node, scope: AssetScope): void {\n node.declareAssets(scope);\n}\n\n/** {@link declareNode} over `root` and every mounted descendant, in every dimension. */\nexport function declareTree(root: Node, scope: AssetScope): void {\n if (!root.mounted) return;\n declareNode(root, scope);\n const children = root._allChildren;\n for (let i = 0; i < children.length; i++) declareTree(children[i], scope);\n}\n\n/**\n * Visit `root` and every mounted descendant with its structural path.\n *\n * Indexed over every dimension's children, so a path does not shift when a sibling\n * of another dimension comes or goes the way a filtered `children` index would.\n */\nexport function forEachOwner(root: Node, visit: (node: Node, path: string) => void): void {\n visitOwners(root, \"\", visit);\n}\n\nfunction visitOwners(node: Node, path: string, visit: (node: Node, path: string) => void): void {\n if (!node.mounted) return;\n visit(node, path);\n const children = node._allChildren;\n for (let i = 0; i < children.length; i++) visitOwners(children[i], nodePath(path, i), visit);\n}\n\n/**\n * Bind `node` with `host`'s catalog, context and clock without adopting it — what a\n * runtime passes as `AssetDeclaration`'s `bindSubtree` for a `Tex.surface` source.\n */\nexport function bindDetached(host: Node, node: Node): void {\n (host as unknown as { attachDetached(node: Node): void }).attachDetached(node);\n}\n\n/**\n * Sample every node's derived render state (currently motion) for this frame.\n *\n * Normally done by `attach` as it advances the clock; this is the seam for the\n * priming path, which needs the same state seeded without moving time (see\n * `StateEvaluator.resetSlot`).\n */\nexport function sampleTree(node: Node): void {\n node._sample();\n for (const child of node.children) sampleTree(child);\n}\n\n/**\n * Record the subtree's current positions as the motion history's previous frame,\n * stamped `at`, deriving no velocity.\n *\n * The driven path calls this with the props evaluated one frame back, so the\n * {@link sampleTree} that follows measures against the timeline rather than\n * against wherever the playhead happened to be.\n */\nexport function primeMotionTree(node: Node, at: number): void {\n node._primeMotion(at);\n for (const child of node.children) primeMotionTree(child, at);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"node-walk.js","sourceRoot":"","sources":["../../../src/nodes/node/node-walk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAiB;IACrD,IAAI,CAAC,IAAI,CAAC,OA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Y,CAAC,EAAE,CAAC,CAAC;IACtB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;QAAE,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { nodePath } from \"@/project/tree\";\r\nimport type { AssetScope } from \"@/assets/scope\";\r\nimport type { Node } from \"./node\";\r\n\r\n/**\r\n * The subtree traversals the runtime drives, as free functions over a {@link Node}:\r\n * what is left on `Node` is what a node *is*, and what is here is what the engine\r\n * *does to* one. Every walk stops at an unmounted node — see {@link Node.mounted}.\r\n *\r\n * @internal\r\n */\r\n\r\n/**\r\n * Declare one node's own assets — never its children's, so each node's\r\n * declarations stay attributable to it.\r\n */\r\nexport function declareNode(node: Node, scope: AssetScope): void {\r\n node.declareAssets(scope);\r\n}\r\n\r\n/** {@link declareNode} over `root` and every mounted descendant, in every dimension. */\r\nexport function declareTree(root: Node, scope: AssetScope): void {\r\n if (!root.mounted) return;\r\n declareNode(root, scope);\r\n const children = root._allChildren;\r\n for (let i = 0; i < children.length; i++) declareTree(children[i], scope);\r\n}\r\n\r\n/**\r\n * Visit `root` and every mounted descendant with its structural path.\r\n *\r\n * Indexed over every dimension's children, so a path does not shift when a sibling\r\n * of another dimension comes or goes the way a filtered `children` index would.\r\n */\r\nexport function forEachOwner(root: Node, visit: (node: Node, path: string) => void): void {\r\n visitOwners(root, \"\", visit);\r\n}\r\n\r\nfunction visitOwners(node: Node, path: string, visit: (node: Node, path: string) => void): void {\r\n if (!node.mounted) return;\r\n visit(node, path);\r\n const children = node._allChildren;\r\n for (let i = 0; i < children.length; i++) visitOwners(children[i], nodePath(path, i), visit);\r\n}\r\n\r\n/**\r\n * Bind `node` with `host`'s catalog, context and clock without adopting it — what a\r\n * runtime passes as `AssetDeclaration`'s `bindSubtree` for a `Tex.surface` source.\r\n */\r\nexport function bindDetached(host: Node, node: Node): void {\r\n (host as unknown as { attachDetached(node: Node): void }).attachDetached(node);\r\n}\r\n\r\n/**\r\n * Sample every node's derived render state (currently motion) for this frame.\r\n *\r\n * Normally done by `attach` as it advances the clock; this is the seam for the\r\n * priming path, which needs the same state seeded without moving time (see\r\n * `StateEvaluator.resetSlot`).\r\n */\r\nexport function sampleTree(node: Node): void {\r\n node._sample();\r\n for (const child of node.children) sampleTree(child);\r\n}\r\n\r\n/**\r\n * Record the subtree's current positions as the motion history's previous frame,\r\n * stamped `at`, deriving no velocity.\r\n *\r\n * The driven path calls this with the props evaluated one frame back, so the\r\n * {@link sampleTree} that follows measures against the timeline rather than\r\n * against wherever the playhead happened to be.\r\n */\r\nexport function primeMotionTree(node: Node, at: number): void {\r\n node._primeMotion(at);\r\n for (const child of node.children) primeMotionTree(child, at);\r\n}\r\n"]}
|
|
@@ -37,7 +37,7 @@ export interface AttachScope {
|
|
|
37
37
|
assets: AssetCatalog;
|
|
38
38
|
/** The token map the parent provides to this node. */
|
|
39
39
|
context: ContextMap;
|
|
40
|
-
/**
|
|
40
|
+
/** Clip-relative time, in seconds. */
|
|
41
41
|
time: number;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
@@ -252,6 +252,8 @@ export declare abstract class Node<P extends NodeProps = NodeProps> implements P
|
|
|
252
252
|
* expands `to` in place and then delegates here.
|
|
253
253
|
*/
|
|
254
254
|
_prepareStep(to: Partial<P>, duration: number, easing?: EasingFunction): TweenStepper;
|
|
255
|
+
/** What a node constructed without `field` holds: its declared default, through the mapper. */
|
|
256
|
+
private _unsetValue;
|
|
255
257
|
/** @internal LIFO stack of save() snapshot layers. Underscore-internal so the prop companion can read it; not authoring surface. */
|
|
256
258
|
_stateStack: PropLayer[];
|
|
257
259
|
/**
|
|
@@ -297,7 +299,7 @@ export declare abstract class Node<P extends NodeProps = NodeProps> implements P
|
|
|
297
299
|
/** This node's place on the scene clock. See {@link NodeTime}. */
|
|
298
300
|
get time(): NodeTime;
|
|
299
301
|
/**
|
|
300
|
-
* Advance **this node's** clock to `total`
|
|
302
|
+
* Advance **this node's** clock to `total` clip-seconds, tick it, and
|
|
301
303
|
* sample its derived render state.
|
|
302
304
|
*
|
|
303
305
|
* Per-node, not per-subtree: {@link attach} already recurses, so a recursive
|
|
@@ -410,7 +412,7 @@ export declare abstract class Node<P extends NodeProps = NodeProps> implements P
|
|
|
410
412
|
* Insert `child` at `index` among this node's children.
|
|
411
413
|
*
|
|
412
414
|
* On {@link Node} rather than {@link Node2D} because it is tree machinery —
|
|
413
|
-
* `
|
|
415
|
+
* `ClipTimeline.syncPresence` reaches for it on whatever a spec's
|
|
414
416
|
* `parentId` names, which since audio joined the graph is not always a 2D
|
|
415
417
|
* node. `Node2D` overrides it for the animated insert, which measures the
|
|
416
418
|
* child off-tree and so needs a laid-out one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAe,KAAK,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAGlG,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAmB,WAAW,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/nodes/node/node.ts"],"names":[],"mappings":"AAAA,OAAO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wF;IACxF,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAUjC,+DAA+D;IAC/D,KAAK,IAAI,IAAI;IASb;;;;;;;;OAQG;IAEH,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;QAAE,KAAK,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAMpG,kEAAkE;IAClE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAO1D;;;OAGG;IACH,cAAc,IAAI,QAAQ,CAAC,IAAI,CAAC;IAIhC,0HAA0H;IAC1H,iBAAiB,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI;IAK3C,OAAO,CAAC,UAAU,CAA+B;IAEjD,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,YAAY;IAWpB,OAAO,IAAI,IAAI;CAalB"}
|
package/dist/nodes/node/node.js
CHANGED
|
@@ -21,6 +21,13 @@ const HOSTS_OF = {
|
|
|
21
21
|
"3d": "Put 3D nodes inside a <Canvas3D>, which is the one node that holds both.",
|
|
22
22
|
audio: "Put audio nodes under an <AudioBus>, or directly on the scene root.",
|
|
23
23
|
};
|
|
24
|
+
/** A withdrawn prop's options: every write, a tween's included, maps to the value its default maps to. */
|
|
25
|
+
function heldAtDefault(meta) {
|
|
26
|
+
const mapper = meta.options?.mapper;
|
|
27
|
+
const declared = typeof meta.default === "function" ? meta.default() : meta.default;
|
|
28
|
+
const held = declared === undefined || !mapper ? declared : mapper(declared, undefined);
|
|
29
|
+
return { ...meta.options, mapper: () => held };
|
|
30
|
+
}
|
|
24
31
|
/**
|
|
25
32
|
* The dimension-agnostic base of the scene graph: tree, identity, reactive
|
|
26
33
|
* properties, commands, context, clock, asset declaration, teardown. Nothing
|
|
@@ -91,6 +98,10 @@ export class Node {
|
|
|
91
98
|
}
|
|
92
99
|
// Apply all @property()-decorated fields, reading initial values from props.
|
|
93
100
|
for (const meta of getPropertyMeta(this)) {
|
|
101
|
+
if (meta.withdrawn) {
|
|
102
|
+
this.applyProp(meta.key, meta.default, heldAtDefault(meta));
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
94
105
|
const propsVal = props ? props[meta.key] : undefined;
|
|
95
106
|
const initial = propsVal !== undefined ? propsVal : meta.default;
|
|
96
107
|
this.applyProp(meta.key, initial, meta.options);
|
|
@@ -211,7 +222,21 @@ export class Node {
|
|
|
211
222
|
const mapper = this.__cells?.mappers?.get(field);
|
|
212
223
|
if (typeof value === "function") {
|
|
213
224
|
const extFn = value;
|
|
214
|
-
|
|
225
|
+
if (mapper) {
|
|
226
|
+
// A binding that reads `undefined` — a node reference to a node that is
|
|
227
|
+
// not there — leaves the prop as a node built without it, and never
|
|
228
|
+
// reaches the mapper, which holds the shape the prop's readers go through.
|
|
229
|
+
let unset;
|
|
230
|
+
slot.bind(() => {
|
|
231
|
+
const read = extFn();
|
|
232
|
+
return read === undefined
|
|
233
|
+
? (unset ??= { value: this._unsetValue(field, mapper) }).value
|
|
234
|
+
: mapper(read, slot.get());
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
slot.bind(extFn);
|
|
239
|
+
}
|
|
215
240
|
}
|
|
216
241
|
else {
|
|
217
242
|
slot.set(mapper ? mapper(value, slot.get()) : value);
|
|
@@ -293,8 +318,10 @@ export class Node {
|
|
|
293
318
|
_prepareStep(to, duration, easing) {
|
|
294
319
|
if (!this._mounted)
|
|
295
320
|
return inertStepper(duration);
|
|
296
|
-
//
|
|
297
|
-
//
|
|
321
|
+
// A tween runs in stored space, so the destination is mapped once, here,
|
|
322
|
+
// and every step after it is a stored value written to the slot as it is.
|
|
323
|
+
// Writing a step through the setter would map it a second time, which only
|
|
324
|
+
// an idempotent mapper survives.
|
|
298
325
|
const numCells = [];
|
|
299
326
|
const numFrom = [];
|
|
300
327
|
const numEnd = [];
|
|
@@ -305,7 +332,6 @@ export class Node {
|
|
|
305
332
|
if (!slot)
|
|
306
333
|
continue;
|
|
307
334
|
const extVal = to[key];
|
|
308
|
-
// Map external → internal so the tween operates in stored space.
|
|
309
335
|
const mapper = this.__cells?.mappers?.get(key);
|
|
310
336
|
const targetVal = mapper ? mapper(extVal, this[key]) : extVal;
|
|
311
337
|
const tweenFn = this.__cells?.tweens?.get(key);
|
|
@@ -316,19 +342,12 @@ export class Node {
|
|
|
316
342
|
});
|
|
317
343
|
}
|
|
318
344
|
else if (typeof targetVal === 'number') {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
customLerps.push((t) => { this[key] = from + (targetVal - from) * t; });
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
numCells.push(slot);
|
|
326
|
-
numFrom.push(this[key]);
|
|
327
|
-
numEnd.push(targetVal);
|
|
328
|
-
}
|
|
345
|
+
numCells.push(slot);
|
|
346
|
+
numFrom.push(this[key]);
|
|
347
|
+
numEnd.push(targetVal);
|
|
329
348
|
}
|
|
330
349
|
else if (typeof targetVal === 'string') {
|
|
331
|
-
stringSnaps.push([
|
|
350
|
+
stringSnaps.push([slot, targetVal]);
|
|
332
351
|
}
|
|
333
352
|
}
|
|
334
353
|
const lerp = prepareNumericCellTween(numCells, numFrom, numEnd);
|
|
@@ -346,8 +365,8 @@ export class Node {
|
|
|
346
365
|
// that end — leaving it out meant `seek(duration)` and running to
|
|
347
366
|
// `duration` produced different nodes, and only the second was right.
|
|
348
367
|
if (hasSnaps && t >= 1)
|
|
349
|
-
for (const [
|
|
350
|
-
|
|
368
|
+
for (const [slot, val] of stringSnaps)
|
|
369
|
+
slot.set(val);
|
|
351
370
|
};
|
|
352
371
|
let elapsed = 0;
|
|
353
372
|
return {
|
|
@@ -369,6 +388,12 @@ export class Node {
|
|
|
369
388
|
},
|
|
370
389
|
};
|
|
371
390
|
}
|
|
391
|
+
/** What a node constructed without `field` holds: its declared default, through the mapper. */
|
|
392
|
+
_unsetValue(field, mapper) {
|
|
393
|
+
const declared = getPropertyMeta(this).find((meta) => meta.key === field)?.default;
|
|
394
|
+
const initial = typeof declared === "function" ? declared() : declared;
|
|
395
|
+
return initial === undefined ? undefined : mapper(initial, undefined);
|
|
396
|
+
}
|
|
372
397
|
// ---- State stack (save / restore) -------------------------------------
|
|
373
398
|
// A per-node LIFO stack of property snapshots, mirroring Motion Canvas's
|
|
374
399
|
// node.save()/restore(). `save()` pushes a snapshot of every declared prop;
|
|
@@ -420,7 +445,7 @@ export class Node {
|
|
|
420
445
|
return this._time;
|
|
421
446
|
}
|
|
422
447
|
/**
|
|
423
|
-
* Advance **this node's** clock to `total`
|
|
448
|
+
* Advance **this node's** clock to `total` clip-seconds, tick it, and
|
|
424
449
|
* sample its derived render state.
|
|
425
450
|
*
|
|
426
451
|
* Per-node, not per-subtree: {@link attach} already recurses, so a recursive
|
|
@@ -615,7 +640,7 @@ export class Node {
|
|
|
615
640
|
* Insert `child` at `index` among this node's children.
|
|
616
641
|
*
|
|
617
642
|
* On {@link Node} rather than {@link Node2D} because it is tree machinery —
|
|
618
|
-
* `
|
|
643
|
+
* `ClipTimeline.syncPresence` reaches for it on whatever a spec's
|
|
619
644
|
* `parentId` names, which since audio joined the graph is not always a 2D
|
|
620
645
|
* node. `Node2D` overrides it for the animated insert, which measures the
|
|
621
646
|
* child off-tree and so needs a laid-out one.
|