@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,16 +1,16 @@
|
|
|
1
1
|
import type { Node } from "../nodes/node/node.js";
|
|
2
|
-
import type { Canvas2D } from "../nodes/
|
|
2
|
+
import type { Canvas2D } from "../nodes/root/canvas2d-node.js";
|
|
3
3
|
import { PropSlot } from "../props/slot.js";
|
|
4
4
|
import type { Registry } from "./registry.js";
|
|
5
5
|
import { type TimelinePatch } from "./timeline-patch.js";
|
|
6
|
-
import type { CommandSpec,
|
|
6
|
+
import type { CommandSpec, VisualDocument, VariableSpec } from "./types.js";
|
|
7
7
|
/**
|
|
8
|
-
* A compiled
|
|
8
|
+
* A compiled clip document: the thing that answers "what does this look like
|
|
9
9
|
* at `t`" without having rendered `t - 1`.
|
|
10
10
|
*
|
|
11
|
-
* This is the whole reason the document model exists. A generator
|
|
11
|
+
* This is the whole reason the document model exists. A generator could
|
|
12
12
|
* only be *advanced*, so a backward seek meant tearing the tree down and
|
|
13
|
-
* replaying from frame 0, and a
|
|
13
|
+
* replaying from frame 0, and a clip's duration was unknowable without running
|
|
14
14
|
* it to the end. A timeline is built once and evaluated in any order, at any
|
|
15
15
|
* time, as many times as you like — which is what makes scrubbing cheap, export
|
|
16
16
|
* parallelizable, and a frame reproducible.
|
|
@@ -45,13 +45,13 @@ import type { CommandSpec, SceneDocument, VariableSpec } from "./types.js";
|
|
|
45
45
|
* to restore, because nothing overwrote it.
|
|
46
46
|
*
|
|
47
47
|
* A reference spelled with a dot (`"=[card.x]+20"`) reads another node's prop
|
|
48
|
-
* instead, through the same machinery — see `
|
|
48
|
+
* instead, through the same machinery — see `ClipTimeline._resolveVariable`
|
|
49
49
|
* for why that one resolves at read time rather than at compile time.
|
|
50
50
|
*/
|
|
51
51
|
/** A placed command as the runtime outside the timeline sees it. */
|
|
52
52
|
export interface PlacedCommandInfo {
|
|
53
53
|
readonly spec: CommandSpec;
|
|
54
|
-
/** Seconds from
|
|
54
|
+
/** Seconds from clip start. */
|
|
55
55
|
readonly start: number;
|
|
56
56
|
/** Seconds. Zero is a stamp — it applies in full from `start` onward. */
|
|
57
57
|
readonly duration: number;
|
|
@@ -60,12 +60,12 @@ export interface PlacedCommandInfo {
|
|
|
60
60
|
readonly readsLayout: boolean;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* The
|
|
63
|
+
* The clip document, compiled and evaluable, over the one canvas it builds
|
|
64
64
|
* into — its live nodes, presence and baselines all belong to that tree.
|
|
65
65
|
*/
|
|
66
|
-
export declare class
|
|
66
|
+
export declare class ClipTimeline {
|
|
67
67
|
private readonly canvas;
|
|
68
|
-
constructor(doc:
|
|
68
|
+
constructor(doc: VisualDocument, registry: Registry, canvas: Canvas2D);
|
|
69
69
|
/** How long the scene runs. Read by the runtime after {@link build}. */
|
|
70
70
|
get duration(): number;
|
|
71
71
|
/** Instantiate the tree into the canvas. Once per timeline: the nodes it makes belong to that canvas. */
|
|
@@ -112,13 +112,20 @@ export declare class SceneTimeline {
|
|
|
112
112
|
syncPresence(seconds: number): boolean;
|
|
113
113
|
/** The node a row built, mounted or not; the canvas for the root. */
|
|
114
114
|
liveNode(id: string): Node | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* What a row holds before any command has acted on it: its props as it
|
|
117
|
+
* arrived, or as built for one that has not arrived yet. The same at every
|
|
118
|
+
* time, which is what tells it from the node's live props. A bound prop is
|
|
119
|
+
* read through its binding, so it answers for the tree as it stands.
|
|
120
|
+
*/
|
|
121
|
+
baselineProps(id: string): Record<string, unknown> | undefined;
|
|
115
122
|
presenceSlot(id: string): PropSlot<boolean> | undefined;
|
|
116
123
|
variableSlot(id: string): PropSlot<unknown> | undefined;
|
|
117
124
|
/**
|
|
118
125
|
* How to bring this built timeline to `next` in place, or `null` when only a
|
|
119
126
|
* fresh build is sound. An audio document must be lowered by the caller first.
|
|
120
127
|
*/
|
|
121
|
-
planUpdate(next:
|
|
128
|
+
planUpdate(next: VisualDocument): TimelinePatch | null;
|
|
122
129
|
/**
|
|
123
130
|
* Apply a {@link planUpdate} result. The canvas must be attached at time 0
|
|
124
131
|
* first, as for {@link build}; `prepare` samples and lays out like the step
|
|
@@ -160,12 +167,28 @@ export declare class SceneTimeline {
|
|
|
160
167
|
private _animated;
|
|
161
168
|
/** Only the variables some command writes to. Same reasoning. */
|
|
162
169
|
private _animatedVars;
|
|
170
|
+
/**
|
|
171
|
+
* Slots on a part a node built for itself that some command writes, restored
|
|
172
|
+
* alongside {@link _animated}. A part is no document row, so its baseline is
|
|
173
|
+
* the slot's state the first time a command wrote it — see {@link _notePartWrite}.
|
|
174
|
+
*/
|
|
175
|
+
private _animatedParts;
|
|
176
|
+
private readonly _partBaselines;
|
|
163
177
|
/** Children each parent built for itself, which the document must not disturb. */
|
|
164
178
|
private readonly _baseChildCount;
|
|
165
179
|
/** Node ids currently in the tree, so presence only churns when it changes. */
|
|
166
180
|
private readonly _present;
|
|
167
181
|
/** Node ids whose baseline was taken while mounted — see {@link _compileCommands}. */
|
|
168
182
|
private _baselined;
|
|
183
|
+
/**
|
|
184
|
+
* Rows present at time 0 that a lifecycle command (`removeChildAt`,
|
|
185
|
+
* `reparent`) took out of the parent their row names, as compile left them.
|
|
186
|
+
* Presence only moves a row across its own span, so nothing else would put
|
|
187
|
+
* one back before its command starts.
|
|
188
|
+
*/
|
|
189
|
+
private _displaced;
|
|
190
|
+
/** Rows that arrived, or were built, while an ancestor was out of the tree and wait for it — see {@link _baselineArrival}. */
|
|
191
|
+
private readonly _unmounted;
|
|
169
192
|
private _presence;
|
|
170
193
|
/** The rows the last {@link syncPresence} brought in, in document order. */
|
|
171
194
|
private _arrived;
|
|
@@ -236,11 +259,32 @@ export declare class SceneTimeline {
|
|
|
236
259
|
* {@link _settleWindows}.
|
|
237
260
|
*/
|
|
238
261
|
private _compileCommands;
|
|
262
|
+
/** The present rows whose node is no longer under the parent its row names. */
|
|
263
|
+
private _collectDisplaced;
|
|
264
|
+
/**
|
|
265
|
+
* Put displaced rows back where {@link syncPresence} would have inserted them.
|
|
266
|
+
* Returns whether any moved.
|
|
267
|
+
*/
|
|
268
|
+
private _restoreDisplaced;
|
|
269
|
+
/** The node a row's `parentId` names: the canvas for the root, `undefined` while that row is unbuilt. */
|
|
270
|
+
private _declaredParent;
|
|
271
|
+
/**
|
|
272
|
+
* Take the baseline of a row that has just arrived, if it is mounted.
|
|
273
|
+
*
|
|
274
|
+
* A baseline is the node as it stands once attached: an unmounted node's cells
|
|
275
|
+
* hold pre-attach values, without what it inherits from its ancestors. A row
|
|
276
|
+
* can arrive while an ancestor is still out of the tree (a child entering
|
|
277
|
+
* before its parent), so its baseline waits in {@link _unmounted} until
|
|
278
|
+
* {@link _baselineMounted} finds it mounted.
|
|
279
|
+
*/
|
|
280
|
+
private _baselineArrival;
|
|
281
|
+
/** Baseline the rows that arrived unmounted and have since been mounted by an ancestor arriving. */
|
|
282
|
+
private _baselineMounted;
|
|
239
283
|
/**
|
|
240
284
|
* Build one command against the tree as it stands and run it to its end —
|
|
241
285
|
* which is what leaves its target where the next command's `from` must start.
|
|
242
|
-
* Undone wholesale by {@link _restoreBaselines}.
|
|
243
|
-
*
|
|
286
|
+
* Undone wholesale by {@link _restoreBaselines}. Throws when its target names
|
|
287
|
+
* no row, for a node-scoped command of any kind.
|
|
244
288
|
*
|
|
245
289
|
* The running-to-`at(1)` cannot be skipped: `node.to({ x: 100 })` reads `x`
|
|
246
290
|
* when the command is *constructed*, so a chain built against the untouched
|
|
@@ -268,14 +312,23 @@ export declare class SceneTimeline {
|
|
|
268
312
|
* playhead reached it, which is the one thing the whole design forbids.
|
|
269
313
|
*
|
|
270
314
|
* `writes` is already recorded (see {@link WriteRecorder}) and a slot carries
|
|
271
|
-
* its owner, so this needs no declaration from the command. A slot
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* rebuilt with its parent.
|
|
315
|
+
* its owner, so this needs no declaration from the command. A variable's slot
|
|
316
|
+
* arrives as {@link PlacedCommand.owner}. A slot on a part a node built for
|
|
317
|
+
* itself has no row to be restored through, so it is restored on its own, to
|
|
318
|
+
* the state {@link _notePartWrite} saw before any command wrote it.
|
|
276
319
|
*/
|
|
277
320
|
private _touch;
|
|
278
321
|
private _touchOwner;
|
|
322
|
+
/**
|
|
323
|
+
* Save a part's slot the first time a command is about to write it.
|
|
324
|
+
*
|
|
325
|
+
* Called by the observer *before* the write lands, while a command is built:
|
|
326
|
+
* every earlier command has run to its end by then, but none of them wrote
|
|
327
|
+
* this slot, so what it holds is what the part was built with (plus whatever
|
|
328
|
+
* the command's own factory primed, which is part of the command, not of the
|
|
329
|
+
* part).
|
|
330
|
+
*/
|
|
331
|
+
private readonly _notePartWrite;
|
|
279
332
|
/**
|
|
280
333
|
* Compile the expressions in a binding command's args.
|
|
281
334
|
*
|
|
@@ -296,6 +349,8 @@ export declare class SceneTimeline {
|
|
|
296
349
|
* a document that half-renders is worse than one that refuses to.
|
|
297
350
|
*/
|
|
298
351
|
private _assertNoExpressions;
|
|
352
|
+
/** The live node a node-scoped command targets; one error, naming the `targetId`, when no row has it. */
|
|
353
|
+
private _targetOrThrow;
|
|
299
354
|
/** Resolve a command's `targetId` to a live node, or `null` if it names nothing. */
|
|
300
355
|
private _targetOf;
|
|
301
356
|
private _evaluateObserved;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/document/timeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/document/timeline.ts"],"names":[],"mappings":"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"}
|
|
@@ -94,10 +94,10 @@ function presenceOf(doc) {
|
|
|
94
94
|
return spans;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
|
-
* The
|
|
97
|
+
* The clip document, compiled and evaluable, over the one canvas it builds
|
|
98
98
|
* into — its live nodes, presence and baselines all belong to that tree.
|
|
99
99
|
*/
|
|
100
|
-
export class
|
|
100
|
+
export class ClipTimeline {
|
|
101
101
|
canvas;
|
|
102
102
|
constructor(doc, registry, canvas) {
|
|
103
103
|
this.canvas = canvas;
|
|
@@ -162,6 +162,12 @@ export class SceneTimeline {
|
|
|
162
162
|
captureInitial(entry);
|
|
163
163
|
captureInitial(this._root);
|
|
164
164
|
this._baselined = new Set(this._present);
|
|
165
|
+
for (const id of this._present) {
|
|
166
|
+
if (this._live.get(id)?.node.mounted === false) {
|
|
167
|
+
this._baselined.delete(id);
|
|
168
|
+
this._unmounted.add(id);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
165
171
|
}
|
|
166
172
|
/**
|
|
167
173
|
* Build every command against the laid-out tree, then put the tree back.
|
|
@@ -177,7 +183,8 @@ export class SceneTimeline {
|
|
|
177
183
|
compile(settle = () => { }) {
|
|
178
184
|
this._compileCommands(settle);
|
|
179
185
|
this._restoreBaselines();
|
|
180
|
-
|
|
186
|
+
const moved = this.syncPresence(0);
|
|
187
|
+
if (this._restoreDisplaced(this._collectDisplaced()) || moved)
|
|
181
188
|
settle();
|
|
182
189
|
}
|
|
183
190
|
/** What a variable holds at the last evaluated time. For a host's inspector. */
|
|
@@ -294,6 +301,22 @@ export class SceneTimeline {
|
|
|
294
301
|
liveNode(id) {
|
|
295
302
|
return id === ROOT_NODE_ID ? this.canvas : this._live.get(id)?.node;
|
|
296
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* What a row holds before any command has acted on it: its props as it
|
|
306
|
+
* arrived, or as built for one that has not arrived yet. The same at every
|
|
307
|
+
* time, which is what tells it from the node's live props. A bound prop is
|
|
308
|
+
* read through its binding, so it answers for the tree as it stands.
|
|
309
|
+
*/
|
|
310
|
+
baselineProps(id) {
|
|
311
|
+
const entry = id === ROOT_NODE_ID ? this._root : this._live.get(id);
|
|
312
|
+
if (!entry)
|
|
313
|
+
return undefined;
|
|
314
|
+
const layer = entry.baseline === NO_LAYER ? entry.initial : entry.baseline;
|
|
315
|
+
const props = {};
|
|
316
|
+
for (const [key, snap] of layer)
|
|
317
|
+
props[key] = snap.fn ? snap.fn() : snap.value;
|
|
318
|
+
return props;
|
|
319
|
+
}
|
|
297
320
|
presenceSlot(id) {
|
|
298
321
|
return id === ROOT_NODE_ID ? this._root?.presence : this._live.get(id)?.presence;
|
|
299
322
|
}
|
|
@@ -316,7 +339,7 @@ export class SceneTimeline {
|
|
|
316
339
|
*/
|
|
317
340
|
applyUpdate(patch, settle, prepare) {
|
|
318
341
|
if (!this._root)
|
|
319
|
-
throw new Error("
|
|
342
|
+
throw new Error("ClipTimeline.applyUpdate needs a built timeline.");
|
|
320
343
|
if (patch.prev !== this._docIndex) {
|
|
321
344
|
throw new Error("This patch was planned against a different version of the document.");
|
|
322
345
|
}
|
|
@@ -329,8 +352,13 @@ export class SceneTimeline {
|
|
|
329
352
|
const fresh = this._updateStructure(patch);
|
|
330
353
|
for (const entry of fresh) {
|
|
331
354
|
captureInitial(entry);
|
|
332
|
-
|
|
333
|
-
|
|
355
|
+
const id = entry.spec.id;
|
|
356
|
+
if (!this._present.has(id))
|
|
357
|
+
continue;
|
|
358
|
+
if (entry.node.mounted)
|
|
359
|
+
this._baselined.add(id);
|
|
360
|
+
else
|
|
361
|
+
this._unmounted.add(id);
|
|
334
362
|
}
|
|
335
363
|
if (patch.diff.rootChanged) {
|
|
336
364
|
const host = this.canvas;
|
|
@@ -354,6 +382,7 @@ export class SceneTimeline {
|
|
|
354
382
|
const touched = new Set();
|
|
355
383
|
this._animated = [];
|
|
356
384
|
this._animatedVars = [];
|
|
385
|
+
this._animatedParts = [];
|
|
357
386
|
if (!isStillDocument(this._doc)) {
|
|
358
387
|
for (const spec of patch.next.ordered) {
|
|
359
388
|
let entry = rebuilt.get(spec.id);
|
|
@@ -370,7 +399,8 @@ export class SceneTimeline {
|
|
|
370
399
|
}
|
|
371
400
|
this._placed = placed;
|
|
372
401
|
this._restoreBaselines();
|
|
373
|
-
|
|
402
|
+
const moved = this.syncPresence(0);
|
|
403
|
+
if (this._restoreDisplaced(this._collectDisplaced()) || moved)
|
|
374
404
|
settle();
|
|
375
405
|
}
|
|
376
406
|
_doc;
|
|
@@ -407,12 +437,28 @@ export class SceneTimeline {
|
|
|
407
437
|
_animated = [];
|
|
408
438
|
/** Only the variables some command writes to. Same reasoning. */
|
|
409
439
|
_animatedVars = [];
|
|
440
|
+
/**
|
|
441
|
+
* Slots on a part a node built for itself that some command writes, restored
|
|
442
|
+
* alongside {@link _animated}. A part is no document row, so its baseline is
|
|
443
|
+
* the slot's state the first time a command wrote it — see {@link _notePartWrite}.
|
|
444
|
+
*/
|
|
445
|
+
_animatedParts = [];
|
|
446
|
+
_partBaselines = new WeakMap();
|
|
410
447
|
/** Children each parent built for itself, which the document must not disturb. */
|
|
411
448
|
_baseChildCount = new Map();
|
|
412
449
|
/** Node ids currently in the tree, so presence only churns when it changes. */
|
|
413
450
|
_present = new Set();
|
|
414
451
|
/** Node ids whose baseline was taken while mounted — see {@link _compileCommands}. */
|
|
415
452
|
_baselined = new Set();
|
|
453
|
+
/**
|
|
454
|
+
* Rows present at time 0 that a lifecycle command (`removeChildAt`,
|
|
455
|
+
* `reparent`) took out of the parent their row names, as compile left them.
|
|
456
|
+
* Presence only moves a row across its own span, so nothing else would put
|
|
457
|
+
* one back before its command starts.
|
|
458
|
+
*/
|
|
459
|
+
_displaced = [];
|
|
460
|
+
/** Rows that arrived, or were built, while an ancestor was out of the tree and wait for it — see {@link _baselineArrival}. */
|
|
461
|
+
_unmounted = new Set();
|
|
416
462
|
_presence = null;
|
|
417
463
|
/** The rows the last {@link syncPresence} brought in, in document order. */
|
|
418
464
|
_arrived = [];
|
|
@@ -525,6 +571,9 @@ export class SceneTimeline {
|
|
|
525
571
|
* how the playhead got here.
|
|
526
572
|
*/
|
|
527
573
|
_restoreBaselines() {
|
|
574
|
+
// Structure before props: a node put back is attached, and the baseline is
|
|
575
|
+
// what it holds once attached.
|
|
576
|
+
this._restoreDisplaced(this._displaced);
|
|
528
577
|
// Variables first, so a prop bound to one recomputes against the restored
|
|
529
578
|
// value rather than a stale one.
|
|
530
579
|
for (const entry of this._animatedVars)
|
|
@@ -536,6 +585,8 @@ export class SceneTimeline {
|
|
|
536
585
|
host._stateStack.length = entry.baseStackDepth;
|
|
537
586
|
}
|
|
538
587
|
}
|
|
588
|
+
for (const slot of this._animatedParts)
|
|
589
|
+
slot.restoreFrom(this._partBaselines.get(slot));
|
|
539
590
|
}
|
|
540
591
|
/**
|
|
541
592
|
* Build every command, in timeline order, against a node already holding
|
|
@@ -562,28 +613,95 @@ export class SceneTimeline {
|
|
|
562
613
|
// Every node present but not yet baselined arrived in this sync:
|
|
563
614
|
// one that left and came back was baselined the first time.
|
|
564
615
|
for (const row of this._arrived) {
|
|
565
|
-
if (this._baselined.has(row.id))
|
|
566
|
-
|
|
567
|
-
const arrived = this._live.get(row.id);
|
|
568
|
-
if (arrived)
|
|
569
|
-
captureBaseline(arrived);
|
|
570
|
-
this._baselined.add(row.id);
|
|
616
|
+
if (!this._baselined.has(row.id))
|
|
617
|
+
this._baselineArrival(row.id);
|
|
571
618
|
}
|
|
619
|
+
this._baselineMounted();
|
|
572
620
|
if (settles[i])
|
|
573
621
|
settle();
|
|
574
622
|
}
|
|
575
623
|
const placed = this._buildPlaced(spec);
|
|
576
|
-
if (!placed)
|
|
577
|
-
continue;
|
|
578
624
|
this._placed.push(placed);
|
|
579
625
|
this._touch(placed, touched);
|
|
580
626
|
}
|
|
581
627
|
}
|
|
628
|
+
/** The present rows whose node is no longer under the parent its row names. */
|
|
629
|
+
_collectDisplaced() {
|
|
630
|
+
const out = [];
|
|
631
|
+
for (const id of this._present) {
|
|
632
|
+
const entry = this._live.get(id);
|
|
633
|
+
const parent = entry && this._declaredParent(id);
|
|
634
|
+
if (entry && parent && entry.node.parent !== parent)
|
|
635
|
+
out.push(entry);
|
|
636
|
+
}
|
|
637
|
+
out.sort((a, b) => this._presenceIndex().row(a.spec.id).slot - this._presenceIndex().row(b.spec.id).slot);
|
|
638
|
+
return (this._displaced = out);
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Put displaced rows back where {@link syncPresence} would have inserted them.
|
|
642
|
+
* Returns whether any moved.
|
|
643
|
+
*/
|
|
644
|
+
_restoreDisplaced(entries) {
|
|
645
|
+
let moved = false;
|
|
646
|
+
for (const entry of entries) {
|
|
647
|
+
const id = entry.spec.id;
|
|
648
|
+
const row = this._presenceIndex().row(id);
|
|
649
|
+
const parent = this._declaredParent(id);
|
|
650
|
+
if (!row || !parent || !this._present.has(id) || entry.node.parent === parent)
|
|
651
|
+
continue;
|
|
652
|
+
entry.node.parent?.remove(entry.node);
|
|
653
|
+
const base = this._baseChildCount.get(row.siblings.parentId) ?? 0;
|
|
654
|
+
parent.addChildAt({ data: { child: entry.node, index: base + row.siblings.before(row.slot) } });
|
|
655
|
+
moved = true;
|
|
656
|
+
}
|
|
657
|
+
return moved;
|
|
658
|
+
}
|
|
659
|
+
/** The node a row's `parentId` names: the canvas for the root, `undefined` while that row is unbuilt. */
|
|
660
|
+
_declaredParent(id) {
|
|
661
|
+
const parentId = this._presenceIndex().row(id)?.siblings.parentId;
|
|
662
|
+
if (parentId === undefined)
|
|
663
|
+
return undefined;
|
|
664
|
+
return parentId === ROOT_NODE_ID ? this.canvas : this._live.get(parentId)?.node;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Take the baseline of a row that has just arrived, if it is mounted.
|
|
668
|
+
*
|
|
669
|
+
* A baseline is the node as it stands once attached: an unmounted node's cells
|
|
670
|
+
* hold pre-attach values, without what it inherits from its ancestors. A row
|
|
671
|
+
* can arrive while an ancestor is still out of the tree (a child entering
|
|
672
|
+
* before its parent), so its baseline waits in {@link _unmounted} until
|
|
673
|
+
* {@link _baselineMounted} finds it mounted.
|
|
674
|
+
*/
|
|
675
|
+
_baselineArrival(id) {
|
|
676
|
+
const entry = this._live.get(id);
|
|
677
|
+
if (entry && !entry.node.mounted) {
|
|
678
|
+
this._unmounted.add(id);
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
if (entry)
|
|
682
|
+
captureBaseline(entry);
|
|
683
|
+
this._baselined.add(id);
|
|
684
|
+
this._unmounted.delete(id);
|
|
685
|
+
}
|
|
686
|
+
/** Baseline the rows that arrived unmounted and have since been mounted by an ancestor arriving. */
|
|
687
|
+
_baselineMounted() {
|
|
688
|
+
for (const id of this._unmounted) {
|
|
689
|
+
const entry = this._live.get(id);
|
|
690
|
+
if (!entry) {
|
|
691
|
+
this._unmounted.delete(id);
|
|
692
|
+
}
|
|
693
|
+
else if (entry.node.mounted) {
|
|
694
|
+
captureBaseline(entry);
|
|
695
|
+
this._baselined.add(id);
|
|
696
|
+
this._unmounted.delete(id);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
582
700
|
/**
|
|
583
701
|
* Build one command against the tree as it stands and run it to its end —
|
|
584
702
|
* which is what leaves its target where the next command's `from` must start.
|
|
585
|
-
* Undone wholesale by {@link _restoreBaselines}.
|
|
586
|
-
*
|
|
703
|
+
* Undone wholesale by {@link _restoreBaselines}. Throws when its target names
|
|
704
|
+
* no row, for a node-scoped command of any kind.
|
|
587
705
|
*
|
|
588
706
|
* The running-to-`at(1)` cannot be skipped: `node.to({ x: 100 })` reads `x`
|
|
589
707
|
* when the command is *constructed*, so a chain built against the untouched
|
|
@@ -599,20 +717,19 @@ export class SceneTimeline {
|
|
|
599
717
|
// cannot collide with another type's command of the same name.
|
|
600
718
|
let entry = this._registry.command(spec.type);
|
|
601
719
|
if (!entry) {
|
|
602
|
-
const
|
|
603
|
-
const
|
|
604
|
-
const factory = typeKey ? this._registry.nodeCommand(typeKey, spec.type) : undefined;
|
|
720
|
+
const typeKey = this._targetOrThrow(spec).entry.spec.type;
|
|
721
|
+
const factory = this._registry.nodeCommand(typeKey, spec.type);
|
|
605
722
|
if (!factory) {
|
|
606
|
-
throw new Error(`Node type "${typeKey
|
|
723
|
+
throw new Error(`Node type "${typeKey}" has no command "${spec.type}" ` +
|
|
607
724
|
`(command ${spec.id}). It publishes: ` +
|
|
608
|
-
`${
|
|
725
|
+
`${this._registry.commandKeys(typeKey).join(", ") || "none"}.` +
|
|
609
726
|
(LEGACY_COMMAND_HINTS[spec.type] ? ` ${LEGACY_COMMAND_HINTS[spec.type]}` : ""));
|
|
610
727
|
}
|
|
611
728
|
entry = { key: spec.type, scope: "node", factory };
|
|
612
729
|
}
|
|
613
730
|
const duration = spec.duration ?? 0;
|
|
614
731
|
const easing = resolveEase(spec.easing, this._registry);
|
|
615
|
-
const recorder = new WriteRecorder();
|
|
732
|
+
const recorder = new WriteRecorder(this._notePartWrite);
|
|
616
733
|
// Applied inside `buildToEnd`, so the `at(1)` that leaves the target where
|
|
617
734
|
// the next command's `from` starts is the *loop's* end — which for an odd
|
|
618
735
|
// number of `alternate` passes is back where it began. A looped command
|
|
@@ -631,9 +748,7 @@ export class SceneTimeline {
|
|
|
631
748
|
const command = observeSlots(recorder, () => buildToEnd(() => repeat(factory(variable.target, spec.args, duration, easing))));
|
|
632
749
|
return { spec, start: spec.at, duration: loop ? command.duration : duration, command, writes: recorder.writes, readsLayout: recorder.readsLayout, owner: variable };
|
|
633
750
|
}
|
|
634
|
-
const target = this.
|
|
635
|
-
if (!target)
|
|
636
|
-
return null;
|
|
751
|
+
const target = this._targetOrThrow(spec);
|
|
637
752
|
const args = entry.binds ? this._bindArgs(spec.args) : (this._assertNoExpressions(spec), spec.args);
|
|
638
753
|
const { factory } = entry;
|
|
639
754
|
const command = observeSlots(recorder, () => buildToEnd(() => repeat(factory(target.node, args, duration, easing))));
|
|
@@ -661,11 +776,10 @@ export class SceneTimeline {
|
|
|
661
776
|
* playhead reached it, which is the one thing the whole design forbids.
|
|
662
777
|
*
|
|
663
778
|
* `writes` is already recorded (see {@link WriteRecorder}) and a slot carries
|
|
664
|
-
* its owner, so this needs no declaration from the command. A slot
|
|
665
|
-
*
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
* rebuilt with its parent.
|
|
779
|
+
* its owner, so this needs no declaration from the command. A variable's slot
|
|
780
|
+
* arrives as {@link PlacedCommand.owner}. A slot on a part a node built for
|
|
781
|
+
* itself has no row to be restored through, so it is restored on its own, to
|
|
782
|
+
* the state {@link _notePartWrite} saw before any command wrote it.
|
|
669
783
|
*/
|
|
670
784
|
_touch(placed, touched) {
|
|
671
785
|
this._touchOwner(placed.owner, touched);
|
|
@@ -674,8 +788,13 @@ export class SceneTimeline {
|
|
|
674
788
|
if (host === null)
|
|
675
789
|
continue;
|
|
676
790
|
const entry = host.id === ROOT_NODE_ID ? this._root : this._live.get(host.id);
|
|
677
|
-
if (entry)
|
|
791
|
+
if (entry) {
|
|
678
792
|
this._touchOwner(entry, touched);
|
|
793
|
+
}
|
|
794
|
+
else if (this._partBaselines.has(slot) && !touched.has(slot)) {
|
|
795
|
+
touched.add(slot);
|
|
796
|
+
this._animatedParts.push(slot);
|
|
797
|
+
}
|
|
679
798
|
}
|
|
680
799
|
}
|
|
681
800
|
_touchOwner(owner, touched) {
|
|
@@ -687,6 +806,23 @@ export class SceneTimeline {
|
|
|
687
806
|
else
|
|
688
807
|
this._animated.push(owner);
|
|
689
808
|
}
|
|
809
|
+
/**
|
|
810
|
+
* Save a part's slot the first time a command is about to write it.
|
|
811
|
+
*
|
|
812
|
+
* Called by the observer *before* the write lands, while a command is built:
|
|
813
|
+
* every earlier command has run to its end by then, but none of them wrote
|
|
814
|
+
* this slot, so what it holds is what the part was built with (plus whatever
|
|
815
|
+
* the command's own factory primed, which is part of the command, not of the
|
|
816
|
+
* part).
|
|
817
|
+
*/
|
|
818
|
+
_notePartWrite = (slot) => {
|
|
819
|
+
const host = slot._host;
|
|
820
|
+
if (host === null || this._partBaselines.has(slot))
|
|
821
|
+
return;
|
|
822
|
+
if (host.id === ROOT_NODE_ID || this._live.has(host.id))
|
|
823
|
+
return;
|
|
824
|
+
this._partBaselines.set(slot, slot.snapshot());
|
|
825
|
+
};
|
|
690
826
|
/**
|
|
691
827
|
* Compile the expressions in a binding command's args.
|
|
692
828
|
*
|
|
@@ -719,6 +855,15 @@ export class SceneTimeline {
|
|
|
719
855
|
`Bind the prop where the node is authored (or with a "set" command) and animate the variable ` +
|
|
720
856
|
`with "variableTo" instead.`);
|
|
721
857
|
}
|
|
858
|
+
/** The live node a node-scoped command targets; one error, naming the `targetId`, when no row has it. */
|
|
859
|
+
_targetOrThrow(spec) {
|
|
860
|
+
const target = this._targetOf(spec);
|
|
861
|
+
if (!target) {
|
|
862
|
+
throw new Error(`Command ${spec.id} ("${spec.type}") targets node "${spec.targetId}", ` +
|
|
863
|
+
`which this document does not declare.`);
|
|
864
|
+
}
|
|
865
|
+
return target;
|
|
866
|
+
}
|
|
722
867
|
/** Resolve a command's `targetId` to a live node, or `null` if it names nothing. */
|
|
723
868
|
_targetOf(spec) {
|
|
724
869
|
if (spec.targetId === null) {
|
|
@@ -862,6 +1007,7 @@ export class SceneTimeline {
|
|
|
862
1007
|
this._live.delete(id);
|
|
863
1008
|
this._baseChildCount.delete(id);
|
|
864
1009
|
this._baselined.delete(id);
|
|
1010
|
+
this._unmounted.delete(id);
|
|
865
1011
|
}
|
|
866
1012
|
for (const id of patch.reinstantiate) {
|
|
867
1013
|
const entry = this._live.get(id);
|
|
@@ -881,6 +1027,7 @@ export class SceneTimeline {
|
|
|
881
1027
|
entry.spec = spec;
|
|
882
1028
|
entry.node = node;
|
|
883
1029
|
this._baselined.delete(spec.id);
|
|
1030
|
+
this._unmounted.delete(spec.id);
|
|
884
1031
|
}
|
|
885
1032
|
else {
|
|
886
1033
|
entry = {
|
|
@@ -960,12 +1107,11 @@ export class SceneTimeline {
|
|
|
960
1107
|
const step = steps[i];
|
|
961
1108
|
if (settles[i])
|
|
962
1109
|
pending = true;
|
|
963
|
-
this.syncPresence(step.at)
|
|
1110
|
+
if (this.syncPresence(step.at))
|
|
1111
|
+
this._baselineMounted();
|
|
964
1112
|
if (step.capture !== undefined) {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
captureBaseline(entry);
|
|
968
|
-
this._baselined.add(step.capture);
|
|
1113
|
+
this._baselined.delete(step.capture);
|
|
1114
|
+
this._baselineArrival(step.capture);
|
|
969
1115
|
continue;
|
|
970
1116
|
}
|
|
971
1117
|
// After this `at`'s captures, as compile baselines arrivals before it settles.
|
|
@@ -979,9 +1125,7 @@ export class SceneTimeline {
|
|
|
979
1125
|
old.command.at(1);
|
|
980
1126
|
continue;
|
|
981
1127
|
}
|
|
982
|
-
|
|
983
|
-
if (placed)
|
|
984
|
-
rebuilt.set(spec.id, placed);
|
|
1128
|
+
rebuilt.set(spec.id, this._buildPlaced(spec));
|
|
985
1129
|
}
|
|
986
1130
|
return rebuilt;
|
|
987
1131
|
}
|
|
@@ -999,13 +1143,21 @@ const LEGACY_COMMAND_HINTS = {
|
|
|
999
1143
|
const NO_LAYER = new Map();
|
|
1000
1144
|
/** Records what building one command wrote, and whether it read a laid-out box. */
|
|
1001
1145
|
class WriteRecorder {
|
|
1146
|
+
firstWrite;
|
|
1002
1147
|
writes = new Set();
|
|
1003
1148
|
readsLayout = false;
|
|
1149
|
+
/** `firstWrite` runs the first time a slot is written, before the write lands. */
|
|
1150
|
+
constructor(firstWrite) {
|
|
1151
|
+
this.firstWrite = firstWrite;
|
|
1152
|
+
}
|
|
1004
1153
|
read(slot) {
|
|
1005
1154
|
if (slot._name === LAYOUT_SLOT)
|
|
1006
1155
|
this.readsLayout = true;
|
|
1007
1156
|
}
|
|
1008
1157
|
write(slot) {
|
|
1158
|
+
if (this.writes.has(slot))
|
|
1159
|
+
return;
|
|
1160
|
+
this.firstWrite(slot);
|
|
1009
1161
|
this.writes.add(slot);
|
|
1010
1162
|
}
|
|
1011
1163
|
}
|