@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +220 -0
- package/LICENSE +201 -201
- package/NOTICE +48 -0
- package/README.md +93 -72
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +79 -4
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -3
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/filters/chain.d.ts +1 -1
- package/dist/attributes/audio/filters/chain.js.map +1 -1
- package/dist/attributes/audio/filters/curve.d.ts +8 -8
- package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
- package/dist/attributes/audio/filters/curve.js +20 -19
- package/dist/attributes/audio/filters/curve.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
- package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/filters/index.d.ts +1 -1
- package/dist/attributes/audio/filters/index.d.ts.map +1 -1
- package/dist/attributes/audio/filters/index.js +1 -1
- package/dist/attributes/audio/filters/index.js.map +1 -1
- package/dist/attributes/audio/filters/registry.js.map +1 -1
- package/dist/attributes/audio/filters/union.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +17 -2
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +4 -2
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +15 -8
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +4 -2
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -4
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +3 -1
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +9 -2
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +15 -1
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +28 -120
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +16 -88
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +15 -8
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +2 -6
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +23 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +44 -10
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +81 -44
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +4 -10
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -13
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +2 -2
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -7
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
- package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
- package/dist/browser/jsx-jsx-runtime.js +1 -1
- package/dist/browser/manifest.json +3 -2
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/document/audio.d.ts +1 -1
- package/dist/document/audio.js +4 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +8 -14
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +1 -1
- package/dist/document/command-traits.js +13 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +2 -0
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +2 -0
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +19 -0
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +70 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +2 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/registry.d.ts +17 -0
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +29 -2
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +73 -18
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +192 -40
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +12 -12
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +2 -2
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +37 -31
- package/dist/document/validate.js.map +1 -1
- package/dist/document/withdraw.d.ts +28 -0
- package/dist/document/withdraw.d.ts.map +1 -0
- package/dist/document/withdraw.js +61 -0
- package/dist/document/withdraw.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +9 -1
- package/dist/jsx/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx/jsx-runtime.js +13 -3
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/nodes/2d/node-lifecycle.js.map +1 -1
- package/dist/nodes/2d/node-motion.js.map +1 -1
- package/dist/nodes/2d/node-render.d.ts +3 -3
- package/dist/nodes/2d/node-render.d.ts.map +1 -1
- package/dist/nodes/2d/node-render.js.map +1 -1
- package/dist/nodes/2d/node-transform.js.map +1 -1
- package/dist/nodes/2d/node2d.d.ts +115 -3
- package/dist/nodes/2d/node2d.d.ts.map +1 -1
- package/dist/nodes/2d/node2d.js +180 -28
- package/dist/nodes/2d/node2d.js.map +1 -1
- package/dist/nodes/2d/paint-node.d.ts +27 -0
- package/dist/nodes/2d/paint-node.d.ts.map +1 -1
- package/dist/nodes/2d/paint-node.js +42 -0
- package/dist/nodes/2d/paint-node.js.map +1 -1
- package/dist/nodes/audio/audio-bus.js.map +1 -1
- package/dist/nodes/audio/index.js.map +1 -1
- package/dist/nodes/audio/node-audio.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +2 -2
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +1 -1
- package/dist/nodes/audio/sound-node.js.map +1 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
- package/dist/nodes/geometry/bounds-shape-node.js +2 -2
- package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
- package/dist/nodes/geometry/box-path-node.d.ts +3 -3
- package/dist/nodes/geometry/box-path-node.js +2 -2
- package/dist/nodes/geometry/box-path-node.js.map +1 -1
- package/dist/nodes/geometry/ellipse-node.js.map +1 -1
- package/dist/nodes/geometry/group-bounds.d.ts +2 -2
- package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
- package/dist/nodes/geometry/group-bounds.js +1 -2
- package/dist/nodes/geometry/group-bounds.js.map +1 -1
- package/dist/nodes/geometry/path-node.d.ts.map +1 -1
- package/dist/nodes/geometry/path-node.js +6 -0
- package/dist/nodes/geometry/path-node.js.map +1 -1
- package/dist/nodes/geometry/polygon-node.js.map +1 -1
- package/dist/nodes/geometry/polygram-node.js.map +1 -1
- package/dist/nodes/geometry/rect-node.js.map +1 -1
- package/dist/nodes/geometry/shape-node.js.map +1 -1
- package/dist/nodes/geometry/shape-outline.d.ts +2 -2
- package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
- package/dist/nodes/geometry/shape-outline.js +2 -13
- package/dist/nodes/geometry/shape-outline.js.map +1 -1
- package/dist/nodes/index.d.ts +3 -8
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +3 -8
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/layout/camera-node.d.ts +9 -0
- package/dist/nodes/layout/camera-node.d.ts.map +1 -1
- package/dist/nodes/layout/camera-node.js +38 -3
- package/dist/nodes/layout/camera-node.js.map +1 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
- package/dist/nodes/layout/orbit-camera-node.js +1 -1
- package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
- package/dist/nodes/layout/rotated-box.js.map +1 -1
- package/dist/nodes/media/video-node.d.ts.map +1 -1
- package/dist/nodes/media/video-node.js +2 -0
- package/dist/nodes/media/video-node.js.map +1 -1
- package/dist/nodes/node/declare-paints.js.map +1 -1
- package/dist/nodes/node/node-editor-state.js.map +1 -1
- package/dist/nodes/node/node-reactive.js.map +1 -1
- package/dist/nodes/node/node-time.d.ts +3 -3
- package/dist/nodes/node/node-time.d.ts.map +1 -1
- package/dist/nodes/node/node-time.js +1 -1
- package/dist/nodes/node/node-time.js.map +1 -1
- package/dist/nodes/node/node-walk.js.map +1 -1
- package/dist/nodes/node/node.d.ts +5 -3
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +44 -19
- package/dist/nodes/node/node.js.map +1 -1
- package/dist/nodes/node/text-defaults.d.ts +10 -12
- package/dist/nodes/node/text-defaults.d.ts.map +1 -1
- package/dist/nodes/node/text-defaults.js +10 -12
- package/dist/nodes/node/text-defaults.js.map +1 -1
- package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
- package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
- package/dist/nodes/root/canvas2d-node.js.map +1 -0
- package/dist/nodes/root/provider-node.d.ts.map +1 -0
- package/dist/nodes/root/provider-node.js.map +1 -0
- package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
- package/dist/nodes/root/theme-provider-node.js.map +1 -0
- package/dist/nodes/text/default-text-style-node.d.ts +5 -2
- package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
- package/dist/nodes/text/default-text-style-node.js +10 -4
- package/dist/nodes/text/default-text-style-node.js.map +1 -1
- package/dist/nodes/text/number-format.d.ts +1 -1
- package/dist/nodes/text/number-format.js +1 -1
- package/dist/nodes/text/number-format.js.map +1 -1
- package/dist/nodes/text/number-node.js.map +1 -1
- package/dist/nodes/text/number-pattern.js.map +1 -1
- package/dist/nodes/text/richtext-node.js +1 -1
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +1 -1
- package/dist/nodes/text/text-base.js.map +1 -1
- package/dist/nodes/text/text-node.js.map +1 -1
- package/dist/nodes/text/text-selection.js.map +1 -1
- package/dist/nodes/three/camera-nodes.d.ts +21 -3
- package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
- package/dist/nodes/three/camera-nodes.js +42 -1
- package/dist/nodes/three/camera-nodes.js.map +1 -1
- package/dist/nodes/three/canvas3d-node.d.ts +29 -6
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +44 -2
- package/dist/nodes/three/canvas3d-node.js.map +1 -1
- package/dist/nodes/three/drawable-nodes.d.ts +25 -11
- package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
- package/dist/nodes/three/drawable-nodes.js +43 -13
- package/dist/nodes/three/drawable-nodes.js.map +1 -1
- package/dist/nodes/three/environment-nodes.d.ts +9 -3
- package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
- package/dist/nodes/three/environment-nodes.js.map +1 -1
- package/dist/nodes/three/geometry-nodes.d.ts +2 -2
- package/dist/nodes/three/geometry-nodes.js +2 -2
- package/dist/nodes/three/geometry-nodes.js.map +1 -1
- package/dist/nodes/three/grid-geometry3d.js.map +1 -1
- package/dist/nodes/three/group3d.js.map +1 -1
- package/dist/nodes/three/light-nodes.d.ts.map +1 -1
- package/dist/nodes/three/light-nodes.js +3 -3
- package/dist/nodes/three/light-nodes.js.map +1 -1
- package/dist/nodes/three/mesh3d.js.map +1 -1
- package/dist/nodes/three/node3d.d.ts +48 -0
- package/dist/nodes/three/node3d.d.ts.map +1 -1
- package/dist/nodes/three/node3d.js +53 -3
- package/dist/nodes/three/node3d.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +2 -2
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/latex.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +2 -2
- package/dist/render/descriptors/text.js +2 -2
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +8 -4
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +18 -10
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -0
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +39 -6
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +9 -0
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +18 -1
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +27 -0
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +5 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +10 -6
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +9 -0
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +19 -0
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +5 -0
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +2 -0
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +44 -3
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +118 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -1
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +5 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +31 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +63 -6
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +9 -7
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +12 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +1 -1
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +19 -15
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +11 -6
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +2 -0
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +15 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +37 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/type.js.map +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/seekable.d.ts +1 -1
- package/dist/tween/seekable.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +2 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
- package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
- package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
- package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/provider-node.js +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/runtime/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAwB,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAoBxD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,OAAO;IAMK;IALZ,QAAQ,CAAS;IACjB,GAAG,CAAS;IAErB,4DAA4D;IAC5D,YACqB,MAAc,EAC/B,OAAoB;QADH,WAAM,GAAN,MAAM,CAAQ;QAG/B,IAAI,CAAC,QAAQ,GAAG,sBAAsB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC1E,IAAI,CAAC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QAAQ,CAAC,CAAC;IACrC,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { Size2D } from \"@/attributes/layout/size\";\nimport { AssetManifest } from \"@/assets/manifest\";\nimport { ManifestAssetCatalog } from \"@/assets/catalog\";\nimport { setTheme } from \"@/attributes/shape/fill/color/parser\";\nimport { asProjectDocument, type ProjectDocument } from \"@/document/project\";\nimport type { SceneDocument } from \"@/document/types\";\nimport { assertValidProjectDocument } from \"@/document/validate\";\nimport { ExportStillRequest, ExportVideoRequest, ExportedStill } from \"@/platform/exporter\";\nimport { Engine, EngineRenderContext } from \"./engine\";\nimport { Playback } from \"./playback\";\nimport { PlaybackController } from \"./playback-controller\";\nimport { AssetTimelineResult } from \"./asset-timeline\";\nimport { StorageAdapter } from \"@/platform/storage-adapter\";\nimport { SteppedClock } from \"@/platform/stepped-clock\";\n\n/** What to open: a project, or a lone still or composition as the one track of a project around it. */\nexport interface SessionSource {\n document: ProjectDocument | SceneDocument;\n /** The output's size and rate. A lone scene document carries neither; these also win over a project's own. */\n viewport?: Size2D;\n fps?: number;\n}\n\nexport interface OpenOptions extends SessionSource {\n /**\n * Where pixels land. A canvas in a browser, a size headlessly — the platform's\n * render context narrows it. Omit to open without mounting, for a session that\n * only ever exports.\n */\n target?: unknown;\n onPrecompProgress?: (result: AssetTimelineResult) => void;\n}\n\n/**\n * One document, bound to one engine and one surface.\n *\n * Cheap relative to its engine — it holds a surface and a playhead, while the\n * caches it draws on belong to the engine — so many sessions over one engine is\n * the intended shape: a preview, a filmstrip of thumbnails, an export.\n *\n * The theme is still applied through a process-global registry (`setTheme`), so\n * it is re-applied immediately before anything draws; concurrent sessions with\n * different themes would contend. Isolating that means threading a context\n * through every colour parse, which is its own change.\n */\nexport class Session {\n readonly viewport: Size2D;\n readonly fps: number;\n\n /** @internal — created by `Engine.open`, never directly. */\n constructor(\n private readonly engine: Engine,\n options: OpenOptions,\n ) {\n this._project = resolveProjectDocument(options.document, options, engine);\n this.viewport = this._project.viewport!;\n this.fps = this._project.fps!;\n\n this._catalog = new ManifestAssetCatalog(engine.manifest);\n this._unsubscribe = engine._onManifestChange((manifest: AssetManifest) => {\n this._catalog = new ManifestAssetCatalog(manifest);\n this._storage.setCatalog(this._catalog);\n });\n\n const deps = { catalog: this._catalog, viewport: this.viewport, fps: this.fps };\n this._storage = engine.platform.createStorageAdapter(deps);\n this._renderContext = engine.platform.createRenderContext(this._storage);\n const measurer = engine.platform.createMeasureContext(this._storage);\n const audioDevice = engine.platform.createAudioSink();\n const masterClock = engine.platform.createTicker(this.fps, audioDevice);\n\n // Before the first measuring pass, which resolves theme tokens.\n this.applyGlobals();\n\n if (options.target !== undefined) this._renderContext.mount(options.target);\n\n // A platform answering `null` means \"no *realtime* transport here\", not\n // \"nothing works\": seeking, picking and drawing are the same headlessly,\n // so a stepped clock stands in and only `playback` reports the absence.\n this._controller = new PlaybackController({\n project: this._project,\n registry: engine._registry,\n renderContext: this._renderContext,\n measurer,\n storageAdapter: this._storage,\n masterClock: masterClock ?? new SteppedClock(),\n audioDevice,\n assets: this._catalog,\n onPrecompProgress: options.onPrecompProgress,\n });\n this._playback = masterClock === null ? null : new Playback(this._controller);\n }\n\n /** The project this session plays, its fps and viewport resolved. */\n get document(): ProjectDocument {\n return this._project;\n }\n\n /** Realtime transport, or `null` when this engine has no clock. */\n get playback(): Playback | null {\n return this._playback;\n }\n\n /**\n * The editor-facing surface: node picking, node boxes, text layout, prop\n * overrides, tree state, build errors.\n *\n * Exposed rather than proxied: `Session` covers the *document* — what is\n * open, where it draws, how it encodes — and the controller covers\n * inspecting and manipulating a live frame, a different job with a surface\n * of its own. Always present, including headlessly (see `SteppedClock`).\n */\n get controller(): PlaybackController {\n return this._controller;\n }\n\n /** Where this session draws. A host reads it to resize or re-frame the view. */\n get surface(): EngineRenderContext {\n return this._renderContext;\n }\n\n get duration(): number {\n return this._controller.totalDuration;\n }\n\n get totalFrames(): number {\n return this._controller.totalFrames;\n }\n\n /** Move the playhead, in seconds. Resolves once the frame is drawn. */\n async seek(seconds: number): Promise<void> {\n await this.seekFrame(Math.round(seconds * this.fps));\n }\n\n async seekFrame(frame: number): Promise<void> {\n this.applyGlobals();\n await this._controller.seek(frame);\n }\n\n /**\n * Swap what is playing, keeping the surface, audio device and clock. The new\n * document is diffed against the playing one and each built tree patched in\n * place; a track is rebuilt only when its change cannot be patched, and a\n * theme change rebuilds every track. Documents are compared by content with\n * identity as the fast path, so treat them as immutable.\n *\n * The output's size and rate cannot change under a live surface; a document\n * that asks for different ones needs a session of its own.\n */\n replace(document: ProjectDocument | SceneDocument): void {\n const next = resolveProjectDocument(document, {}, this);\n if (next.fps !== this.fps || next.viewport!.width !== this.viewport.width\n || next.viewport!.height !== this.viewport.height) {\n throw new Error(\n `Cannot replace a ${this.viewport.width}×${this.viewport.height} @ ${this.fps}fps document with a ` +\n `${next.viewport!.width}×${next.viewport!.height} @ ${next.fps}fps one — open a new session.`,\n );\n }\n this._project = next;\n this.applyGlobals();\n this._controller.setProject(next);\n }\n\n /** Encode one frame. */\n image(options: Partial<Omit<ExportStillRequest, \"project\" | \"registry\">> = {}): Promise<ExportedStill> {\n this.applyGlobals();\n return this.engine.exporter.exportStill({\n ...options,\n frame: options.frame ?? { kind: \"last\" },\n project: this._project,\n registry: this.engine._registry,\n manifest: options.manifest ?? this.engine.manifest,\n });\n }\n\n /** Encode the whole timeline. */\n export(options: Omit<ExportVideoRequest, \"project\" | \"registry\"> = {}): Promise<Uint8Array | void> {\n this.applyGlobals();\n return this.engine.exporter.exportVideo({\n ...options,\n project: this._project,\n registry: this.engine._registry,\n manifest: options.manifest ?? this.engine.manifest,\n });\n }\n\n dispose(): void {\n this._unsubscribe();\n this._controller.dispose();\n this._renderContext.dispose();\n }\n\n /** Called before anything that measures or paints, because another session may have written it since. */\n private applyGlobals(): void {\n setTheme(this._project.theme);\n }\n\n private _project: ProjectDocument;\n private _catalog: ManifestAssetCatalog;\n private readonly _storage: StorageAdapter;\n private readonly _renderContext: EngineRenderContext;\n private readonly _controller: PlaybackController;\n private readonly _playback: Playback | null;\n private readonly _unsubscribe: () => void;\n}\n\n/**\n * The project a document plays as, its output settings resolved: `override`\n * first, then the document's own, then `fallback`. Validated once, here, so\n * nothing downstream has to — every host that renders a document goes through\n * this, so they cannot disagree about which size wins.\n */\nexport function resolveProjectDocument(\n document: ProjectDocument | SceneDocument,\n override: { viewport?: Size2D; fps?: number },\n fallback: { viewport: Size2D; fps: number },\n): ProjectDocument {\n const project = asProjectDocument(document);\n const resolved: ProjectDocument = {\n ...project,\n viewport: override.viewport ?? project.viewport ?? fallback.viewport,\n fps: override.fps ?? project.fps ?? fallback.fps,\n };\n assertValidProjectDocument(resolved);\n return resolved;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/runtime/session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAwB,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAoBxD;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,OAAO;IAMK;IALZ,QAAQ,CAAS;IACjB,GAAG,CAAS;IAErB,4DAA4D;IAC5D,YACqB,MAAc,EAC/B,OAAoB;QADH,WAAM,GAAN,MAAM,CAAQ;QAG/B,IAAI,CAAC,SAAS,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;QAClE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AAC,CAAC;IAC5C,MAAM,QAAQ,GAAoB;QAC9B,GAAG,OAAO;QACV,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ;QACpE,GAAG,EAAE,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG;KACnD,CAAC;IACF,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import { Size2D } from \"@/attributes/layout/size\";\r\nimport { AssetManifest } from \"@/assets/manifest\";\r\nimport { ManifestAssetCatalog } from \"@/assets/catalog\";\r\nimport { setTheme } from \"@/attributes/shape/fill/color/parser\";\r\nimport { asProjectDocument, type ProjectDocument } from \"@/document/project\";\r\nimport type { VisualDocument } from \"@/document/types\";\r\nimport { assertValidProjectDocument } from \"@/document/validate\";\r\nimport { ExportStillRequest, ExportVideoRequest, ExportedStill } from \"@/platform/exporter\";\r\nimport { Engine, EngineRenderContext } from \"./engine\";\r\nimport { Playback } from \"./playback\";\r\nimport { clipTimeToFrame } from \"./frame-time\";\r\nimport { PlaybackController } from \"./playback-controller\";\r\nimport { AssetTimelineResult } from \"./asset-timeline\";\r\nimport { StorageAdapter } from \"@/platform/storage-adapter\";\r\nimport { SteppedClock } from \"@/platform/stepped-clock\";\r\n\r\n/** What to open: a project, or a lone still or composition as the one track of a project around it. */\r\nexport interface SessionSource {\r\n document: ProjectDocument | VisualDocument;\r\n /** The output's size and rate. A lone clip document carries neither; these also win over a project's own. */\r\n viewport?: Size2D;\r\n fps?: number;\r\n}\r\n\r\nexport interface OpenOptions extends SessionSource {\r\n /**\r\n * Where pixels land. A canvas in a browser, a size headlessly — the platform's\r\n * render context narrows it. Omit to open without mounting, for a session that\r\n * only ever exports.\r\n */\r\n target?: unknown;\r\n onPrecompProgress?: (result: AssetTimelineResult) => void;\r\n}\r\n\r\n/**\r\n * One document, bound to one engine and one surface.\r\n *\r\n * Cheap relative to its engine — it holds a surface and a playhead, while the\r\n * caches it draws on belong to the engine — so many sessions over one engine is\r\n * the intended shape: a preview, a filmstrip of thumbnails, an export.\r\n *\r\n * The theme is still applied through a process-global registry (`setTheme`), so\r\n * it is re-applied immediately before anything draws; concurrent sessions with\r\n * different themes would contend. Isolating that means threading a context\r\n * through every colour parse, which is its own change.\r\n */\r\nexport class Session {\r\n readonly viewport: Size2D;\r\n readonly fps: number;\r\n\r\n /** @internal — created by `Engine.open`, never directly. */\r\n constructor(\r\n private readonly engine: Engine,\r\n options: OpenOptions,\r\n ) {\r\n this._override = { viewport: options.viewport, fps: options.fps };\r\n this._project = resolveProjectDocument(options.document, options, engine);\r\n this.viewport = this._project.viewport!;\r\n this.fps = this._project.fps!;\r\n\r\n this._catalog = new ManifestAssetCatalog(engine.manifest);\r\n // One catalog for the session's life, reconciled in place: the controller,\r\n // its clip store and every node's `assets` hold this object, so a new one\r\n // would reach only the storage adapter.\r\n this._unsubscribe = engine._onManifestChange((manifest: AssetManifest) => {\r\n this._catalog.reconcile(manifest);\r\n this._storage.setCatalog(this._catalog);\r\n this._controller.reconcileCatalog();\r\n });\r\n\r\n const deps = { catalog: this._catalog, viewport: this.viewport, fps: this.fps };\r\n this._storage = engine.platform.createStorageAdapter(deps);\r\n this._renderContext = engine.platform.createRenderContext(this._storage);\r\n const measurer = engine.platform.createMeasureContext(this._storage);\r\n const audioDevice = engine.platform.createAudioSink();\r\n const masterClock = engine.platform.createTicker(this.fps, audioDevice);\r\n\r\n // Before the first measuring pass, which resolves theme tokens.\r\n this.applyGlobals();\r\n\r\n if (options.target !== undefined) this._renderContext.mount(options.target);\r\n\r\n // A platform answering `null` means \"no *realtime* transport here\", not\r\n // \"nothing works\": seeking, picking and drawing are the same headlessly,\r\n // so a stepped clock stands in and only `playback` reports the absence.\r\n this._controller = new PlaybackController({\r\n project: this._project,\r\n registry: engine._registry,\r\n renderContext: this._renderContext,\r\n measurer,\r\n storageAdapter: this._storage,\r\n masterClock: masterClock ?? new SteppedClock(),\r\n audioDevice,\r\n assets: this._catalog,\r\n onPrecompProgress: options.onPrecompProgress,\r\n });\r\n this._playback = masterClock === null ? null : new Playback(this._controller);\r\n }\r\n\r\n /** The project this session plays, its fps and viewport resolved. */\r\n get document(): ProjectDocument {\r\n return this._project;\r\n }\r\n\r\n /** Realtime transport, or `null` when this engine has no clock. */\r\n get playback(): Playback | null {\r\n return this._playback;\r\n }\r\n\r\n /**\r\n * The editor-facing surface: node picking, node boxes, text layout, prop\r\n * overrides, tree state, build errors.\r\n *\r\n * Exposed rather than proxied: `Session` covers the *document* — what is\r\n * open, where it draws, how it encodes — and the controller covers\r\n * inspecting and manipulating a live frame, a different job with a surface\r\n * of its own. Always present, including headlessly (see `SteppedClock`).\r\n */\r\n get controller(): PlaybackController {\r\n return this._controller;\r\n }\r\n\r\n /** Where this session draws. A host reads it to resize or re-frame the view. */\r\n get surface(): EngineRenderContext {\r\n return this._renderContext;\r\n }\r\n\r\n get duration(): number {\r\n return this._controller.totalDuration;\r\n }\r\n\r\n get totalFrames(): number {\r\n return this._controller.totalFrames;\r\n }\r\n\r\n /** Move the playhead, in seconds. Resolves once the frame is drawn. */\r\n async seek(seconds: number): Promise<void> {\r\n await this.seekFrame(Math.round(clipTimeToFrame(seconds, this.fps)));\r\n }\r\n\r\n async seekFrame(frame: number): Promise<void> {\r\n this.applyGlobals();\r\n await this._controller.seek(frame);\r\n }\r\n\r\n /**\r\n * Swap what is playing, keeping the surface, audio device and clock. The new\r\n * document is diffed against the playing one and each built tree patched in\r\n * place; a track is rebuilt only when its change cannot be patched, and a\r\n * theme change rebuilds every track. Documents are compared by content with\r\n * identity as the fast path, so treat them as immutable.\r\n *\r\n * The output's size and rate cannot change under a live surface; a document\r\n * that asks for different ones needs a session of its own.\r\n */\r\n replace(document: ProjectDocument | VisualDocument): void {\r\n const next = resolveProjectDocument(document, this._override, this);\r\n if (next.fps !== this.fps || next.viewport!.width !== this.viewport.width\r\n || next.viewport!.height !== this.viewport.height) {\r\n throw new Error(\r\n `Cannot replace a ${this.viewport.width}×${this.viewport.height} @ ${this.fps}fps document with a ` +\r\n `${next.viewport!.width}×${next.viewport!.height} @ ${next.fps}fps one — open a new session.`,\r\n );\r\n }\r\n this._project = next;\r\n this.applyGlobals();\r\n this._controller.setProject(next);\r\n }\r\n\r\n /** Encode one frame. */\r\n image(options: Partial<Omit<ExportStillRequest, \"project\" | \"registry\">> = {}): Promise<ExportedStill> {\r\n this.applyGlobals();\r\n return this.engine.exporter.exportStill({\r\n ...options,\r\n frame: options.frame ?? { kind: \"last\" },\r\n project: this._project,\r\n registry: this.engine._registry,\r\n manifest: options.manifest ?? this.engine.manifest,\r\n });\r\n }\r\n\r\n /** Encode the timeline, or the `frames` of it a request names. */\r\n export(options: Omit<ExportVideoRequest, \"project\" | \"registry\"> = {}): Promise<Uint8Array | void> {\r\n this.applyGlobals();\r\n return this.engine.exporter.exportVideo({\r\n ...options,\r\n project: this._project,\r\n registry: this.engine._registry,\r\n manifest: options.manifest ?? this.engine.manifest,\r\n });\r\n }\r\n\r\n dispose(): void {\r\n this._unsubscribe();\r\n this._controller.dispose();\r\n this._renderContext.dispose();\r\n }\r\n\r\n /** Called before anything that measures or paints, because another session may have written it since. */\r\n private applyGlobals(): void {\r\n setTheme(this._project.theme);\r\n }\r\n\r\n /** The output settings this session was opened with, which win over any document it plays. */\r\n private readonly _override: { viewport?: Size2D; fps?: number };\r\n private _project: ProjectDocument;\r\n private readonly _catalog: ManifestAssetCatalog;\r\n private readonly _storage: StorageAdapter;\r\n private readonly _renderContext: EngineRenderContext;\r\n private readonly _controller: PlaybackController;\r\n private readonly _playback: Playback | null;\r\n private readonly _unsubscribe: () => void;\r\n}\r\n\r\n/**\r\n * The project a document plays as, its output settings resolved: `override`\r\n * first, then the document's own, then `fallback`. Validated once, here, so\r\n * nothing downstream has to — every host that renders a document goes through\r\n * this, so they cannot disagree about which size wins.\r\n */\r\nexport function resolveProjectDocument(\r\n document: ProjectDocument | VisualDocument,\r\n override: { viewport?: Size2D; fps?: number },\r\n fallback: { viewport: Size2D; fps: number },\r\n): ProjectDocument {\r\n const project = asProjectDocument(document);\r\n const resolved: ProjectDocument = {\r\n ...project,\r\n viewport: override.viewport ?? project.viewport ?? fallback.viewport,\r\n fps: override.fps ?? project.fps ?? fallback.fps,\r\n };\r\n assertValidProjectDocument(resolved);\r\n return resolved;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settle.js","sourceRoot":"","sources":["../../src/runtime/settle.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,MAAkB,EAClB,OAAmD,EACnD,SAAwB;IAExB,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC;QAC9C,IAAI,CAAC,SAAS,EAAE;YAAE,OAAO,YAAY,CAAC;QACtC,MAAM,EAAE,CAAC;QACT,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAC;QAC9B,IAAI,CAAC,SAAS,EAAE;YAAE,OAAO,YAAY,CAAC;IAC1C,CAAC;IACD,OAAO,WAAW,CAAC;AACvB,CAAC","sourcesContent":["import type { StorageAdapter } from \"@/platform/storage-adapter\";\n\n/**\n * Renders a blocking frame is allowed before it gives up on being exact.\n *\n * Bounded because a broken asset must degrade a frame rather than hang an\n * export; four covers the longest real chain (three runtime → its resources →\n * a video frame → an exact image level discovered by that frame's draw).\n */\nexport const SETTLE_PASSES = 4;\n\nexport type SettleOutcome = \"settled\" | \"exhausted\" | \"superseded\";\n\n/**\n * Render, settle what the render asked for, and render again until nothing is\n * pending.\n *\n * `isCurrent` is checked before every render and after every await, so a seek\n * overtaken by a newer one stops drawing a frame nobody wants.\n */\nexport async function renderSettled(\n render: () => void,\n adapter: Pick<StorageAdapter, \"warmPendingDecodes\">,\n isCurrent: () => boolean,\n): Promise<SettleOutcome> {\n for (let pass = 0; pass < SETTLE_PASSES; pass++) {\n if (!isCurrent()) return \"superseded\";\n render();\n const warmed = await adapter.warmPendingDecodes();\n if (!warmed) return \"settled\";\n if (!isCurrent()) return \"superseded\";\n }\n return \"exhausted\";\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settle.js","sourceRoot":"","sources":["../../src/runtime/settle.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAI/B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,MAAkB,EAClB,OAAmD,EACnD,SAAwB;IAExB,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC;QAC9C,IAAI,CAAC,SAAS,EAAE;YAAE,OAAO,YAAY,CAAC;QACtC,MAAM,EAAE,CAAC;QACT,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAC;QAC9B,IAAI,CAAC,SAAS,EAAE;YAAE,OAAO,YAAY,CAAC;IAC1C,CAAC;IACD,OAAO,WAAW,CAAC;AACvB,CAAC","sourcesContent":["import type { StorageAdapter } from \"@/platform/storage-adapter\";\r\n\r\n/**\r\n * Renders a blocking frame is allowed before it gives up on being exact.\r\n *\r\n * Bounded because a broken asset must degrade a frame rather than hang an\r\n * export; four covers the longest real chain (three runtime → its resources →\r\n * a video frame → an exact image level discovered by that frame's draw).\r\n */\r\nexport const SETTLE_PASSES = 4;\r\n\r\nexport type SettleOutcome = \"settled\" | \"exhausted\" | \"superseded\";\r\n\r\n/**\r\n * Render, settle what the render asked for, and render again until nothing is\r\n * pending.\r\n *\r\n * `isCurrent` is checked before every render and after every await, so a seek\r\n * overtaken by a newer one stops drawing a frame nobody wants.\r\n */\r\nexport async function renderSettled(\r\n render: () => void,\r\n adapter: Pick<StorageAdapter, \"warmPendingDecodes\">,\r\n isCurrent: () => boolean,\r\n): Promise<SettleOutcome> {\r\n for (let pass = 0; pass < SETTLE_PASSES; pass++) {\r\n if (!isCurrent()) return \"superseded\";\r\n render();\r\n const warmed = await adapter.warmPendingDecodes();\r\n if (!warmed) return \"settled\";\r\n if (!isCurrent()) return \"superseded\";\r\n }\r\n return \"exhausted\";\r\n}\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProjectDocument } from "../document/project.js";
|
|
2
2
|
import type { NodeEditorStates } from "../nodes/node/node-editor-state.js";
|
|
3
|
-
import type { Canvas2D } from "../nodes/
|
|
3
|
+
import type { Canvas2D } from "../nodes/root/canvas2d-node.js";
|
|
4
4
|
import type { MeasureContext2D } from "../render/measure-context.js";
|
|
5
5
|
import type { RenderPass2D } from "../render/render-context2d.js";
|
|
6
6
|
import type { ClipInstance, RuntimeScope } from "./clip-instance.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-evaluator.d.ts","sourceRoot":"","sources":["../../src/runtime/state-evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAS,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"state-evaluator.d.ts","sourceRoot":"","sources":["../../src/runtime/state-evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAS,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,E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AAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,eAAe,CAAgB;IACvC,gFAAgF;IAChF,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuC;IAErE,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,OAAO;IAIf,2FAA2F;IAC3F,OAAO,CAAC,QAAQ;IAMhB,uFAAuF;IACvF,OAAO,CAAC,KAAK;IAIb;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAUpB;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;CAiBpB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isAudioDocument } from "../document/types.js";
|
|
2
2
|
import { ClipStore } from "./clip-store.js";
|
|
3
|
-
import {
|
|
3
|
+
import { clipFrameToTime } from "./frame-time.js";
|
|
4
|
+
import { frameTime, placeTracks, spansCovering } from "./placement.js";
|
|
4
5
|
/**
|
|
5
6
|
* Puts a project's tracks into the state for a frame, then lays out and draws
|
|
6
7
|
* the ones covering it, back to front.
|
|
@@ -203,10 +204,10 @@ export class StateEvaluator {
|
|
|
203
204
|
*/
|
|
204
205
|
_evaluate(slot, localFrame) {
|
|
205
206
|
const instance = slot.instance;
|
|
206
|
-
const dt = 1
|
|
207
|
+
const dt = clipFrameToTime(1, this._scope.fps);
|
|
207
208
|
// Clamped so a frame held past the end shows where the track stops — a
|
|
208
209
|
// track can cut its clip short, and the clip goes on past the cut.
|
|
209
|
-
const time =
|
|
210
|
+
const time = frameTime(localFrame, this._scope.fps, slot.track.duration);
|
|
210
211
|
instance.attach(time, this._editorStates.get(slot.track.id));
|
|
211
212
|
const previous = Math.max(0, time - dt);
|
|
212
213
|
instance.evaluateAt(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C,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,SAAS,CAAC,CAAkB,EAAE,CAAkB;IACrD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IACnE,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { ProjectDocument, Track } from \"@/document/project\";\nimport { isAudioDocument } from \"@/document/types\";\nimport type { NodeEditorStates } from \"@/nodes/node/node-editor-state\";\nimport type { Canvas2D } from \"@/nodes/scene/canvas2d-node\";\nimport type { MeasureContext2D } from \"@/render/measure-context\";\nimport type { RenderPass2D } from \"@/render/render-context2d\";\nimport type { ClipInstance, RuntimeScope } from \"./clip-instance\";\nimport { ClipStore } from \"./clip-store\";\nimport { placeTracks, spansCovering, type TrackSpan } from \"./placement\";\n\n/** One track, and the tree it was last evaluated on. */\ninterface Slot {\n track: Track;\n span: TrackSpan;\n instance: ClipInstance | null;\n /** The store's generation for the track when {@link instance} was last evaluated. */\n generation: number;\n}\n\n/**\n * Puts a project's tracks into the state for a frame, then lays out and draws\n * the ones covering it, back to front.\n *\n * Trees come from a {@link ClipStore}: a track's is built the first time it\n * covers a frame — or taken as discovery left it — and thereafter only asked for\n * times, so a seek costs the same in either direction and however far. The store\n * owns them; anything it does to one (a refinement, a patch, a rebuild) moves\n * its generation, and this evaluates again. Nothing isolates overlapping\n * tracks: they composite by draw order alone, which is what lets a translucent\n * track show the one beneath it.\n */\nexport class StateEvaluator {\n /** Without `store`, the evaluator builds into one of its own. */\n constructor(project: ProjectDocument, private readonly _scope: RuntimeScope, store?: ClipStore) {\n this._owned = store === undefined;\n this._store = store ?? new ClipStore(project, _scope, { assets: false, audio: false });\n this._slots = this._slotsFor(project.tracks, new Map());\n this._currentTrackId = firstVisual(this._slots)?.track.id ?? null;\n }\n\n /** The frame on screen. {@link invalidate} drops the memo, not the position. */\n get currentFrame(): number {\n return this._currentFrame;\n }\n\n /**\n * The topmost visual track on screen — or, over a hole, the last one there\n * was. An audio clip is a canvas drawing nothing, so it is never what an\n * editor picks from.\n */\n get currentTrackId(): string | null {\n return this._currentTrackId;\n }\n\n /** {@link currentTrackId}'s tree, once built. */\n get currentCanvas(): Canvas2D | null {\n return this.currentInstance?.canvas ?? null;\n }\n\n /** {@link currentTrackId}'s clip instance, once built. */\n get currentInstance(): ClipInstance | null {\n const slot = this._slotOf(this._currentTrackId);\n if (!slot?.instance) return null;\n return slot.instance === this._store.instanceOf(slot.track.id) ? slot.instance : null;\n }\n\n /** Every track on screen, back to front. Empty over a hole. */\n get activeTrackIds(): string[] {\n return this._active.map(slot => slot.track.id);\n }\n\n /** Put every track covering `frame` into its state, building any that never has been. */\n stateAt(frame: number): void {\n if (this._disposed) return;\n const target = Math.max(0, Math.floor(frame));\n const active = this._slotsToDraw(target);\n\n // Evaluation is idempotent, so a repeat would only cost. Compared by slot\n // rather than by count: a swap can change which tracks are on screen\n // without changing how many.\n if (!this._stale && target === this._currentFrame && sameSlots(active, this._active)\n && active.every(slot => this._settled(slot))) {\n return;\n }\n\n this._active = active;\n const topmost = firstVisual([...active].reverse());\n if (topmost) this._currentTrackId = topmost.track.id;\n\n for (const slot of active) slot.instance = this._store.ensureBuilt(slot.track.id);\n for (const slot of active) {\n if (!slot.instance) continue;\n this._evaluate(slot, target - slot.span.startFrame);\n slot.generation = this._store.generationOf(slot.track.id);\n }\n\n this._currentFrame = target;\n this._stale = false;\n }\n\n layout(measurer: MeasureContext2D = this._scope.measurer): void {\n for (const slot of this._active) this._live(slot)?.layout(measurer);\n }\n\n render(pass: RenderPass2D): void {\n for (const slot of this._active) this._live(slot)?.render(pass);\n }\n\n /** Evaluate the current frame afresh on the next {@link stateAt}. */\n invalidate(): void {\n this._stale = true;\n }\n\n /**\n * Throw a track's tree away so the next {@link stateAt} builds it fresh.\n *\n * The way back to what the document says for a node nothing animates: the\n * timeline restores only what its commands write, so a value written straight\n * onto a live prop — an editor's override — survives re-evaluation.\n */\n rebuild(trackId: string | null = this._currentTrackId): void {\n if (trackId === null) return;\n this._store.rebuild(trackId);\n this._stale = true;\n }\n\n /**\n * Take a new document. The store decides what each track keeps — see\n * {@link ClipStore.setProject}; a store shared with a precomp has already\n * taken it, and taking it twice is a no-op.\n */\n setProject(next: ProjectDocument): void {\n if (this._disposed) return;\n this._store.setProject(next);\n const prior = new Map(this._slots.map(slot => [slot.track.id, slot]));\n this._slots = this._slotsFor(next.tracks, prior);\n\n const kept = new Set(this._slots);\n for (const id of this._editorStates.keys()) {\n if (!this._slotOf(id)) this._editorStates.delete(id);\n }\n\n // Keep drawing what survived until the next evaluation: a repaint can land\n // in between, and an emptied set would paint a blank frame over an edit.\n this._active = this._active.filter(slot => kept.has(slot));\n if (!this._slotOf(this._currentTrackId)) {\n this._currentTrackId = firstVisual(this._slots)?.track.id ?? null;\n }\n this._stale = true;\n }\n\n /** Hidden/locked state for one track's nodes — editor state, not authored, so it rides beside the document. */\n setEditorStates(trackId: string, states: NodeEditorStates | undefined): void {\n if (states) this._editorStates.set(trackId, states);\n else this._editorStates.delete(trackId);\n this._stale = true;\n }\n\n dispose(): void {\n this._disposed = true;\n this._active = [];\n for (const slot of this._slots) slot.instance = null;\n if (this._owned) this._store.dispose();\n }\n\n private readonly _store: ClipStore;\n private readonly _owned: boolean;\n private _slots: Slot[];\n private _active: Slot[] = [];\n private _currentFrame = 0;\n private _currentTrackId: string | null;\n /** Kept apart from the frame, so \"evaluate again\" never reads as \"frame -1\". */\n private _stale = false;\n private _disposed = false;\n private readonly _editorStates = new Map<string, NodeEditorStates>();\n\n private _slotsFor(tracks: readonly Track[], prior: ReadonlyMap<string, Slot>): Slot[] {\n const spans = placeTracks(tracks, this._scope.fps);\n return tracks.map((track, i) => {\n const old = prior.get(track.id);\n if (old) {\n old.track = track;\n old.span = spans[i];\n return old;\n }\n return { track, span: spans[i], instance: null, generation: -1 };\n });\n }\n\n private _slotOf(trackId: string | null): Slot | undefined {\n return trackId === null ? undefined : this._slots.find(slot => slot.track.id === trackId);\n }\n\n /** Whether `slot` still holds the tree the store has, in the state it was evaluated to. */\n private _settled(slot: Slot): boolean {\n const id = slot.track.id;\n if (!slot.instance) return this._store.failed(id);\n return slot.instance === this._store.instanceOf(id) && slot.generation === this._store.generationOf(id);\n }\n\n /** `slot`'s tree while the store still holds it — a released one must not be drawn. */\n private _live(slot: Slot): ClipInstance | null {\n return slot.instance && slot.instance === this._store.instanceOf(slot.track.id) ? slot.instance : null;\n }\n\n /**\n * The slots to draw at `frame`, holding the final stack past the end of the\n * project — a frame parked beyond the last one keeps showing the picture —\n * while a gap in the middle is a real hole and draws nothing.\n */\n private _slotsToDraw(frame: number): Slot[] {\n const spans = this._slots.map(slot => slot.span);\n let covering = spansCovering(spans, frame);\n if (covering.length === 0) {\n const last = Math.max(-1, ...spans.map(span => span.endFrame));\n if (frame > last && last >= 0) covering = spansCovering(spans, last);\n }\n return covering.map(span => this._slots[span.index]);\n }\n\n /**\n * Put `slot` into the state for `localFrame`.\n *\n * The track runs on its own clock, so where it sits never changes what it\n * draws. The frame before is evaluated too and stamped as motion history:\n * motion is a property of the frame, not of the seek that reached it.\n */\n private _evaluate(slot: Slot, localFrame: number): void {\n const instance = slot.instance!;\n const dt = 1 / this._scope.fps;\n // Clamped so a frame held past the end shows where the track stops — a\n // track can cut its clip short, and the clip goes on past the cut.\n const time = Math.min(localFrame * dt, slot.track.duration);\n instance.attach(time, this._editorStates.get(slot.track.id));\n\n const previous = Math.max(0, time - dt);\n instance.evaluateAt(previous);\n instance.layout();\n instance.primeMotion(previous);\n\n instance.evaluateAt(time);\n instance.layout();\n instance.sample();\n }\n}\n\nfunction firstVisual(slots: readonly Slot[]): Slot | undefined {\n return slots.find(slot => !isAudioDocument(slot.track.clip));\n}\n\nfunction sameSlots(a: readonly Slot[], b: readonly Slot[]): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"state-evaluator.js","sourceRoot":"","sources":["../../src/runtime/state-evaluator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAWpF;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,cAAc;IAEgC;IADvD,iEAAiE;IACjE,YAAY,OAAwB,EAAmB,MAAoB,EAAE,KAAiB;QAAvC,WAAM,GAAN,MAAM,CAAc;QACvE,IAAI,CAAC,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QACvF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC;IACtE,CAAC;IAED,gFAAgF;IAChF,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAA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CAAC,CAAC;QAE/B,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1B,QAAQ,CAAC,MAAM,EAAE,CAAC;QAClB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;CACJ;AAED,SAAS,WAAW,CAAC,KAAsB;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,SAAS,CAAC,CAAkB,EAAE,CAAkB;IACrD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IACnE,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import type { ProjectDocument, Track } from \"@/document/project\";\r\nimport { isAudioDocument } from \"@/document/types\";\r\nimport type { NodeEditorStates } from \"@/nodes/node/node-editor-state\";\r\nimport type { Canvas2D } from \"@/nodes/root/canvas2d-node\";\r\nimport type { MeasureContext2D } from \"@/render/measure-context\";\r\nimport type { RenderPass2D } from \"@/render/render-context2d\";\r\nimport type { ClipInstance, RuntimeScope } from \"./clip-instance\";\r\nimport { ClipStore } from \"./clip-store\";\r\nimport { clipFrameToTime } from \"./frame-time\";\r\nimport { frameTime, placeTracks, spansCovering, type TrackSpan } from \"./placement\";\r\n\r\n/** One track, and the tree it was last evaluated on. */\r\ninterface Slot {\r\n track: Track;\r\n span: TrackSpan;\r\n instance: ClipInstance | null;\r\n /** The store's generation for the track when {@link instance} was last evaluated. */\r\n generation: number;\r\n}\r\n\r\n/**\r\n * Puts a project's tracks into the state for a frame, then lays out and draws\r\n * the ones covering it, back to front.\r\n *\r\n * Trees come from a {@link ClipStore}: a track's is built the first time it\r\n * covers a frame — or taken as discovery left it — and thereafter only asked for\r\n * times, so a seek costs the same in either direction and however far. The store\r\n * owns them; anything it does to one (a refinement, a patch, a rebuild) moves\r\n * its generation, and this evaluates again. Nothing isolates overlapping\r\n * tracks: they composite by draw order alone, which is what lets a translucent\r\n * track show the one beneath it.\r\n */\r\nexport class StateEvaluator {\r\n /** Without `store`, the evaluator builds into one of its own. */\r\n constructor(project: ProjectDocument, private readonly _scope: RuntimeScope, store?: ClipStore) {\r\n this._owned = store === undefined;\r\n this._store = store ?? new ClipStore(project, _scope, { assets: false, audio: false });\r\n this._slots = this._slotsFor(project.tracks, new Map());\r\n this._currentTrackId = firstVisual(this._slots)?.track.id ?? null;\r\n }\r\n\r\n /** The frame on screen. {@link invalidate} drops the memo, not the position. */\r\n get currentFrame(): number {\r\n return this._currentFrame;\r\n }\r\n\r\n /**\r\n * The topmost visual track on screen — or, over a hole, the last one there\r\n * was. An audio clip is a canvas drawing nothing, so it is never what an\r\n * editor picks from.\r\n */\r\n get currentTrackId(): string | null {\r\n return this._currentTrackId;\r\n }\r\n\r\n /** {@link currentTrackId}'s tree, once built. */\r\n get currentCanvas(): Canvas2D | null {\r\n return this.currentInstance?.canvas ?? null;\r\n }\r\n\r\n /** {@link currentTrackId}'s clip instance, once built. */\r\n get currentInstance(): ClipInstance | null {\r\n const slot = this._slotOf(this._currentTrackId);\r\n if (!slot?.instance) return null;\r\n return slot.instance === this._store.instanceOf(slot.track.id) ? slot.instance : null;\r\n }\r\n\r\n /** Every track on screen, back to front. Empty over a hole. */\r\n get activeTrackIds(): string[] {\r\n return this._active.map(slot => slot.track.id);\r\n }\r\n\r\n /** Put every track covering `frame` into its state, building any that never has been. */\r\n stateAt(frame: number): void {\r\n if (this._disposed) return;\r\n const target = Math.max(0, Math.floor(frame));\r\n const active = this._slotsToDraw(target);\r\n\r\n // Evaluation is idempotent, so a repeat would only cost. Compared by slot\r\n // rather than by count: a swap can change which tracks are on screen\r\n // without changing how many.\r\n if (!this._stale && target === this._currentFrame && sameSlots(active, this._active)\r\n && active.every(slot => this._settled(slot))) {\r\n return;\r\n }\r\n\r\n this._active = active;\r\n const topmost = firstVisual([...active].reverse());\r\n if (topmost) this._currentTrackId = topmost.track.id;\r\n\r\n for (const slot of active) slot.instance = this._store.ensureBuilt(slot.track.id);\r\n for (const slot of active) {\r\n if (!slot.instance) continue;\r\n this._evaluate(slot, target - slot.span.startFrame);\r\n slot.generation = this._store.generationOf(slot.track.id);\r\n }\r\n\r\n this._currentFrame = target;\r\n this._stale = false;\r\n }\r\n\r\n layout(measurer: MeasureContext2D = this._scope.measurer): void {\r\n for (const slot of this._active) this._live(slot)?.layout(measurer);\r\n }\r\n\r\n render(pass: RenderPass2D): void {\r\n for (const slot of this._active) this._live(slot)?.render(pass);\r\n }\r\n\r\n /** Evaluate the current frame afresh on the next {@link stateAt}. */\r\n invalidate(): void {\r\n this._stale = true;\r\n }\r\n\r\n /**\r\n * Throw a track's tree away so the next {@link stateAt} builds it fresh.\r\n *\r\n * The way back to what the document says for a node nothing animates: the\r\n * timeline restores only what its commands write, so a value written straight\r\n * onto a live prop — an editor's override — survives re-evaluation.\r\n */\r\n rebuild(trackId: string | null = this._currentTrackId): void {\r\n if (trackId === null) return;\r\n this._store.rebuild(trackId);\r\n this._stale = true;\r\n }\r\n\r\n /**\r\n * Take a new document. The store decides what each track keeps — see\r\n * {@link ClipStore.setProject}; a store shared with a precomp has already\r\n * taken it, and taking it twice is a no-op.\r\n */\r\n setProject(next: ProjectDocument): void {\r\n if (this._disposed) return;\r\n this._store.setProject(next);\r\n const prior = new Map(this._slots.map(slot => [slot.track.id, slot]));\r\n this._slots = this._slotsFor(next.tracks, prior);\r\n\r\n const kept = new Set(this._slots);\r\n for (const id of this._editorStates.keys()) {\r\n if (!this._slotOf(id)) this._editorStates.delete(id);\r\n }\r\n\r\n // Keep drawing what survived until the next evaluation: a repaint can land\r\n // in between, and an emptied set would paint a blank frame over an edit.\r\n this._active = this._active.filter(slot => kept.has(slot));\r\n if (!this._slotOf(this._currentTrackId)) {\r\n this._currentTrackId = firstVisual(this._slots)?.track.id ?? null;\r\n }\r\n this._stale = true;\r\n }\r\n\r\n /** Hidden/locked state for one track's nodes — editor state, not authored, so it rides beside the document. */\r\n setEditorStates(trackId: string, states: NodeEditorStates | undefined): void {\r\n if (states) this._editorStates.set(trackId, states);\r\n else this._editorStates.delete(trackId);\r\n this._stale = true;\r\n }\r\n\r\n dispose(): void {\r\n this._disposed = true;\r\n this._active = [];\r\n for (const slot of this._slots) slot.instance = null;\r\n if (this._owned) this._store.dispose();\r\n }\r\n\r\n private readonly _store: ClipStore;\r\n private readonly _owned: boolean;\r\n private _slots: Slot[];\r\n private _active: Slot[] = [];\r\n private _currentFrame = 0;\r\n private _currentTrackId: string | null;\r\n /** Kept apart from the frame, so \"evaluate again\" never reads as \"frame -1\". */\r\n private _stale = false;\r\n private _disposed = false;\r\n private readonly _editorStates = new Map<string, NodeEditorStates>();\r\n\r\n private _slotsFor(tracks: readonly Track[], prior: ReadonlyMap<string, Slot>): Slot[] {\r\n const spans = placeTracks(tracks, this._scope.fps);\r\n return tracks.map((track, i) => {\r\n const old = prior.get(track.id);\r\n if (old) {\r\n old.track = track;\r\n old.span = spans[i];\r\n return old;\r\n }\r\n return { track, span: spans[i], instance: null, generation: -1 };\r\n });\r\n }\r\n\r\n private _slotOf(trackId: string | null): Slot | undefined {\r\n return trackId === null ? undefined : this._slots.find(slot => slot.track.id === trackId);\r\n }\r\n\r\n /** Whether `slot` still holds the tree the store has, in the state it was evaluated to. */\r\n private _settled(slot: Slot): boolean {\r\n const id = slot.track.id;\r\n if (!slot.instance) return this._store.failed(id);\r\n return slot.instance === this._store.instanceOf(id) && slot.generation === this._store.generationOf(id);\r\n }\r\n\r\n /** `slot`'s tree while the store still holds it — a released one must not be drawn. */\r\n private _live(slot: Slot): ClipInstance | null {\r\n return slot.instance && slot.instance === this._store.instanceOf(slot.track.id) ? slot.instance : null;\r\n }\r\n\r\n /**\r\n * The slots to draw at `frame`, holding the final stack past the end of the\r\n * project — a frame parked beyond the last one keeps showing the picture —\r\n * while a gap in the middle is a real hole and draws nothing.\r\n */\r\n private _slotsToDraw(frame: number): Slot[] {\r\n const spans = this._slots.map(slot => slot.span);\r\n let covering = spansCovering(spans, frame);\r\n if (covering.length === 0) {\r\n const last = Math.max(-1, ...spans.map(span => span.endFrame));\r\n if (frame > last && last >= 0) covering = spansCovering(spans, last);\r\n }\r\n return covering.map(span => this._slots[span.index]);\r\n }\r\n\r\n /**\r\n * Put `slot` into the state for `localFrame`.\r\n *\r\n * The track runs on its own clock, so where it sits never changes what it\r\n * draws. The frame before is evaluated too and stamped as motion history:\r\n * motion is a property of the frame, not of the seek that reached it.\r\n */\r\n private _evaluate(slot: Slot, localFrame: number): void {\r\n const instance = slot.instance!;\r\n const dt = clipFrameToTime(1, this._scope.fps);\r\n // Clamped so a frame held past the end shows where the track stops — a\r\n // track can cut its clip short, and the clip goes on past the cut.\r\n const time = frameTime(localFrame, this._scope.fps, slot.track.duration);\r\n instance.attach(time, this._editorStates.get(slot.track.id));\r\n\r\n const previous = Math.max(0, time - dt);\r\n instance.evaluateAt(previous);\r\n instance.layout();\r\n instance.primeMotion(previous);\r\n\r\n instance.evaluateAt(time);\r\n instance.layout();\r\n instance.sample();\r\n }\r\n}\r\n\r\nfunction firstVisual(slots: readonly Slot[]): Slot | undefined {\r\n return slots.find(slot => !isAudioDocument(slot.track.clip));\r\n}\r\n\r\nfunction sameSlots(a: readonly Slot[], b: readonly Slot[]): boolean {\r\n if (a.length !== b.length) return false;\r\n for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;\r\n return true;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-geometry.js","sourceRoot":"","sources":["../../src/runtime/text-geometry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EA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,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { Node2D } from \"@/nodes/2d/node2d\";\nimport { Text } from \"@/nodes/text/text-node\";\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { applyToPoint } from \"@/attributes/layout/matrix2d\";\nimport { caretCount, type TextBlockSource } from \"@/render/text-layout\";\nimport { renderMatrix } from \"./node-picking\";\n\n/**\n * Where a Text node's caret slots landed on screen — the measurement a host\n * needs to draw its own text cursor and selection over the rendered glyphs.\n *\n * **Space.** Viewport space, exactly as {@link NodeBox}: origin at the viewport\n * centre, y-up, viewport units, camera folded in. A caret and the selection box\n * around it therefore come out of the same walk and cannot disagree.\n *\n * **Why the host draws it.** Anything approximating glyph positions outside the\n * shaper — a DOM input laid over the canvas, say — drifts from the render the\n * moment the font, the line height or the wrapping does, and CSS `line-height`\n * and Skia's height multiplier are not the same quantity to begin with. Handing\n * over the real slots means the rendered text stays the thing being edited.\n */\nexport interface NodeTextLayout {\n /** Structural path of the node measured, as {@link NodeBox.path}. */\n path: string;\n /** The string the slots describe. */\n text: string;\n /**\n * Every caret slot, in offset order: `carets[i]` sits before character `i`,\n * and the last sits after the final character — so there are `text.length + 1`\n * of them, and a caret offset is always a valid index.\n *\n * Each is a *segment*, not a point, because a rotated node's cursor is a\n * rotated line: draw from `top` to `bottom`.\n */\n carets: TextCaret[];\n /**\n * Line ranges over caret offsets, for Home/End and vertical arrow keys. A\n * hard line break belongs to neither line, so `lines[n].end` and\n * `lines[n + 1].start` differ by one where the break is.\n */\n lines: { start: number; end: number }[];\n}\n\n/** One caret slot: the line an editor would draw for a cursor at this offset. */\nexport interface TextCaret {\n /** Character offset this slot sits before. */\n offset: number;\n /** Top and bottom of the cursor, viewport space. */\n top: Vector2;\n bottom: Vector2;\n}\n\n/** One line's worth of a selected range, as a quad in viewport space. */\nexport interface TextRangeQuad {\n topLeft: Vector2;\n topRight: Vector2;\n bottomRight: Vector2;\n bottomLeft: Vector2;\n}\n\n/**\n * Measure `node`'s caret slots in viewport space, or `null` when it has none to\n * report — not a {@link Text}, nothing shaped yet, or a shape the caret model\n * doesn't cover (see {@link RenderContext2D.layoutTextBlock}).\n *\n * The block-local layout comes from the backend, because that is where glyphs\n * are actually positioned; everything below is the same mapping\n * {@link nodeBox} applies to a node's corners.\n */\nexport function nodeTextLayout(\n node: Node2D,\n path: string,\n source: TextBlockSource,\n): NodeTextLayout | null {\n if (!(node instanceof Text)) return null;\n const block = source.layoutTextBlock(node._textState());\n if (!block) return null;\n\n const m = renderMatrix(node);\n // The block is laid out about the node's own origin — which is also where\n // `_localBounds` centres the box, and what `verticalAlign` offsets it from —\n // so a block-local offset is a node-local one, unshifted. Block coordinates are already canvas (y-down), which is\n // the space the matrix works in, so unlike `worldAnchors` (which takes y-up\n // corner offsets) only the *result* is flipped back to y-up viewport space.\n const at = (x: number, y: number): Vector2 => {\n const p = applyToPoint(m, { x, y });\n return { x: p.x, y: -p.y };\n };\n\n const carets: TextCaret[] = new Array(caretCount(block));\n const lines: { start: number; end: number }[] = [];\n for (const line of block.lines) {\n lines.push({ start: line.start, end: line.end });\n for (let i = 0; i < line.carets.length; i++) {\n const x = line.carets[i];\n carets[line.start + i] = {\n offset: line.start + i,\n top: at(x, line.top),\n bottom: at(x, line.bottom),\n };\n }\n }\n\n return { path, text: node.text, carets, lines };\n}\n\n/**\n * The caret offset nearest `point` (viewport space) — what a click or a drag\n * over the rendered text should place the cursor at.\n *\n * Nearest *slot*, by distance to the caret segment rather than to its midpoint:\n * a click below a short first line should land on that line's nearest slot, and\n * midpoints would pull it toward whichever line's centre happened to be closer.\n * Segment distance also keeps this correct for rotated and scaled text without\n * needing a separate case, since the slots arrive already transformed.\n */\nexport function caretOffsetAt(layout: NodeTextLayout, point: Vector2): number {\n let best = 0;\n let bestDistance = Infinity;\n for (const caret of layout.carets) {\n const d = distanceToSegment(point, caret.top, caret.bottom);\n if (d < bestDistance) {\n bestDistance = d;\n best = caret.offset;\n }\n }\n return best;\n}\n\n/**\n * The quads covering `[start, end)`, one per line the range touches — what a\n * host fills to draw a selection highlight.\n *\n * Per line rather than one box for the whole range, because a range spanning a\n * line break covers two disjoint areas and a single enclosing box would paint\n * over the gap between them.\n */\nexport function caretRangeQuads(\n layout: NodeTextLayout,\n start: number,\n end: number,\n): TextRangeQuad[] {\n const from = Math.max(0, Math.min(start, end));\n const to = Math.min(layout.carets.length - 1, Math.max(start, end));\n const quads: TextRangeQuad[] = [];\n for (const line of layout.lines) {\n const a = Math.max(from, line.start);\n const b = Math.min(to, line.end);\n if (a >= b) continue; // empty on this line\n const left = layout.carets[a];\n const right = layout.carets[b];\n quads.push({\n topLeft: left.top,\n topRight: right.top,\n bottomRight: right.bottom,\n bottomLeft: left.bottom,\n });\n }\n return quads;\n}\n\n/** Distance from `p` to the segment `a`–`b`. */\nfunction distanceToSegment(p: Vector2, a: Vector2, b: Vector2): number {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const lengthSq = dx * dx + dy * dy;\n // A degenerate segment (a zero-height line box) is just a point.\n const t = lengthSq === 0\n ? 0\n : Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy) / lengthSq));\n return Math.hypot(p.x - (a.x + t * dx), p.y - (a.y + t * dy));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"text-geometry.js","source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K,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IACjF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import { Node2D } from \"@/nodes/2d/node2d\";\r\nimport { Text } from \"@/nodes/text/text-node\";\r\nimport { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport { applyToPoint } from \"@/attributes/layout/matrix2d\";\r\nimport { caretCount, type TextBlockSource } from \"@/render/text-layout\";\r\nimport { renderMatrix } from \"./node-picking\";\r\n\r\n/**\r\n * Where a Text node's caret slots landed on screen — the measurement a host\r\n * needs to draw its own text cursor and selection over the rendered glyphs.\r\n *\r\n * **Space.** Viewport space, exactly as {@link NodeBox}: origin at the viewport\r\n * centre, y-up, viewport units, camera folded in. A caret and the selection box\r\n * around it therefore come out of the same walk and cannot disagree.\r\n *\r\n * **Why the host draws it.** Anything approximating glyph positions outside the\r\n * shaper — a DOM input laid over the canvas, say — drifts from the render the\r\n * moment the font, the line height or the wrapping does, and CSS `line-height`\r\n * and Skia's height multiplier are not the same quantity to begin with. Handing\r\n * over the real slots means the rendered text stays the thing being edited.\r\n */\r\nexport interface NodeTextLayout {\r\n /** Structural path of the node measured, as {@link NodeBox.path}. */\r\n path: string;\r\n /** The string the slots describe. */\r\n text: string;\r\n /**\r\n * Every caret slot, in offset order: `carets[i]` sits before character `i`,\r\n * and the last sits after the final character — so there are `text.length + 1`\r\n * of them, and a caret offset is always a valid index.\r\n *\r\n * Each is a *segment*, not a point, because a rotated node's cursor is a\r\n * rotated line: draw from `top` to `bottom`.\r\n */\r\n carets: TextCaret[];\r\n /**\r\n * Line ranges over caret offsets, for Home/End and vertical arrow keys. A\r\n * hard line break belongs to neither line, so `lines[n].end` and\r\n * `lines[n + 1].start` differ by one where the break is.\r\n */\r\n lines: { start: number; end: number }[];\r\n}\r\n\r\n/** One caret slot: the line an editor would draw for a cursor at this offset. */\r\nexport interface TextCaret {\r\n /** Character offset this slot sits before. */\r\n offset: number;\r\n /** Top and bottom of the cursor, viewport space. */\r\n top: Vector2;\r\n bottom: Vector2;\r\n}\r\n\r\n/** One line's worth of a selected range, as a quad in viewport space. */\r\nexport interface TextRangeQuad {\r\n topLeft: Vector2;\r\n topRight: Vector2;\r\n bottomRight: Vector2;\r\n bottomLeft: Vector2;\r\n}\r\n\r\n/**\r\n * Measure `node`'s caret slots in viewport space, or `null` when it has none to\r\n * report — not a {@link Text}, nothing shaped yet, or a shape the caret model\r\n * doesn't cover (see {@link RenderContext2D.layoutTextBlock}).\r\n *\r\n * The block-local layout comes from the backend, because that is where glyphs\r\n * are actually positioned; everything below is the same mapping\r\n * {@link nodeBox} applies to a node's corners.\r\n */\r\nexport function nodeTextLayout(\r\n node: Node2D,\r\n path: string,\r\n source: TextBlockSource,\r\n): NodeTextLayout | null {\r\n if (!(node instanceof Text)) return null;\r\n const block = source.layoutTextBlock(node._textState());\r\n if (!block) return null;\r\n\r\n const m = renderMatrix(node);\r\n // The block is laid out about the node's own origin — which is also where\r\n // `_localBounds` centres the box, and what `verticalAlign` offsets it from —\r\n // so a block-local offset is a node-local one, unshifted. Block coordinates are already canvas (y-down), which is\r\n // the space the matrix works in, so unlike `worldAnchors` (which takes y-up\r\n // corner offsets) only the *result* is flipped back to y-up viewport space.\r\n const at = (x: number, y: number): Vector2 => {\r\n const p = applyToPoint(m, { x, y });\r\n return { x: p.x, y: -p.y };\r\n };\r\n\r\n const carets: TextCaret[] = new Array(caretCount(block));\r\n const lines: { start: number; end: number }[] = [];\r\n for (const line of block.lines) {\r\n lines.push({ start: line.start, end: line.end });\r\n for (let i = 0; i < line.carets.length; i++) {\r\n const x = line.carets[i];\r\n carets[line.start + i] = {\r\n offset: line.start + i,\r\n top: at(x, line.top),\r\n bottom: at(x, line.bottom),\r\n };\r\n }\r\n }\r\n\r\n return { path, text: node.text, carets, lines };\r\n}\r\n\r\n/**\r\n * The caret offset nearest `point` (viewport space) — what a click or a drag\r\n * over the rendered text should place the cursor at.\r\n *\r\n * Nearest *slot*, by distance to the caret segment rather than to its midpoint:\r\n * a click below a short first line should land on that line's nearest slot, and\r\n * midpoints would pull it toward whichever line's centre happened to be closer.\r\n * Segment distance also keeps this correct for rotated and scaled text without\r\n * needing a separate case, since the slots arrive already transformed.\r\n */\r\nexport function caretOffsetAt(layout: NodeTextLayout, point: Vector2): number {\r\n let best = 0;\r\n let bestDistance = Infinity;\r\n for (const caret of layout.carets) {\r\n const d = distanceToSegment(point, caret.top, caret.bottom);\r\n if (d < bestDistance) {\r\n bestDistance = d;\r\n best = caret.offset;\r\n }\r\n }\r\n return best;\r\n}\r\n\r\n/**\r\n * The quads covering `[start, end)`, one per line the range touches — what a\r\n * host fills to draw a selection highlight.\r\n *\r\n * Per line rather than one box for the whole range, because a range spanning a\r\n * line break covers two disjoint areas and a single enclosing box would paint\r\n * over the gap between them.\r\n */\r\nexport function caretRangeQuads(\r\n layout: NodeTextLayout,\r\n start: number,\r\n end: number,\r\n): TextRangeQuad[] {\r\n const from = Math.max(0, Math.min(start, end));\r\n const to = Math.min(layout.carets.length - 1, Math.max(start, end));\r\n const quads: TextRangeQuad[] = [];\r\n for (const line of layout.lines) {\r\n const a = Math.max(from, line.start);\r\n const b = Math.min(to, line.end);\r\n if (a >= b) continue; // empty on this line\r\n const left = layout.carets[a];\r\n const right = layout.carets[b];\r\n quads.push({\r\n topLeft: left.top,\r\n topRight: right.top,\r\n bottomRight: right.bottom,\r\n bottomLeft: left.bottom,\r\n });\r\n }\r\n return quads;\r\n}\r\n\r\n/** Distance from `p` to the segment `a`–`b`. */\r\nfunction distanceToSegment(p: Vector2, a: Vector2, b: Vector2): number {\r\n const dx = b.x - a.x;\r\n const dy = b.y - a.y;\r\n const lengthSq = dx * dx + dy * dy;\r\n // A degenerate segment (a zero-height line box) is just a point.\r\n const t = lengthSq === 0\r\n ? 0\r\n : Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy) / lengthSq));\r\n return Math.hypot(p.x - (a.x + t * dx), p.y - (a.y + t * dy));\r\n}\r\n"]}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -5,18 +5,18 @@ export { placeTracks } from '../runtime/placement.js';
|
|
|
5
5
|
export type { TrackSpan } from '../runtime/placement.js';
|
|
6
6
|
export type { Theme, ColorTokens, Typography, TypographyPreset, } from '../project/index.js';
|
|
7
7
|
export type { NodeTime, AttachScope } from '../nodes/index.js';
|
|
8
|
-
export type { BoxBounds } from '../layout/index.js';
|
|
8
|
+
export type { BoxBounds, Extents } from '../layout/index.js';
|
|
9
9
|
export type { ImageMeta, VideoMeta, AudioMeta, FontMeta, AssetMeta, AssetManifest, } from '../assets/index.js';
|
|
10
|
-
export { validateDocument, assertValidDocument, Registry, node, } from '../document/index.js';
|
|
10
|
+
export { validateDocument, assertValidDocument, Registry, node, withdraw, } from '../document/index.js';
|
|
11
11
|
export { normalizeShaderPack, resolveShaderProperties, isKnownShaderProperty, } from '../attributes/index.js';
|
|
12
|
-
export type { RegistryOptions, NodeTypeMap, ShaderPackMap, NodeTypeRecord, NodeCommandEntry,
|
|
12
|
+
export type { RegistryOptions, NodeTypeMap, ShaderPackMap, NodeTypeRecord, NodeCommandEntry, VisualDocument, ClipDocument, StillDocument, CompositionDocument, AudioDocument, NodeSpec, TimedNodeSpec, NodeSpan, CommandSpec, EaseSpec, LoopSpec, LoopDirection, VariableSpec, ValidationIssue, ValidationResult, NodeConstructor, CommandFactory, CommandTypeEntry, VariableCommandFactory, VariableLerp, VariableTarget, } from '../document/index.js';
|
|
13
13
|
export type { Shader, FillShader, EffectShader, ShaderProperty, KnownShaderProperty, ShaderPropertyValues, } from '../attributes/index.js';
|
|
14
14
|
export { expressionOps, ExpressionError } from '../document/index.js';
|
|
15
15
|
export type { ParsedExpression, ExpressionNode, ExpressionDialect, VariableResolver, } from '../document/index.js';
|
|
16
|
-
export { Node, Node2D, Canvas2D, Provider, ThemeProvider, } from '../nodes/index.js';
|
|
17
|
-
export type { NodeProps, Node2DProps, ChildPlacement, Canvas2DProps, NodeConfig, NodeChildren, NodeDimension, ProviderProps, ThemeProviderProps, } from '../nodes/index.js';
|
|
18
|
-
export { PaintNode, ShapeNode, Rect, Ellipse,
|
|
19
|
-
export type { PaintProps, ShapeProps, RectProps, FlexSize, EllipseProps,
|
|
16
|
+
export { Node, Node2D, Canvas2D, Provider, ThemeProvider, findNode2D, frameIn, } from '../nodes/index.js';
|
|
17
|
+
export type { NodeProps, Node2DProps, ChildPlacement, ChildPlane, NodeHandle, Canvas2DProps, NodeConfig, NodeChildren, NodeDimension, ProviderProps, ThemeProviderProps, } from '../nodes/index.js';
|
|
18
|
+
export { PaintNode, ShapeNode, Rect, Ellipse, Path, PathShape, Polygon, Polygram, BooleanGroup, MaskGroup, } from '../nodes/index.js';
|
|
19
|
+
export type { PaintProps, ShapeProps, RectProps, FlexSize, EllipseProps, PathProps, PathShapeProps, PolygonProps, PolygramProps, BooleanGroupProps, MaskGroupProps, } from '../nodes/index.js';
|
|
20
20
|
export type { BooleanOperation, MaskMode, MaskOptions, } from '../attributes/index.js';
|
|
21
21
|
export { Camera, OrbitCamera, RotatedBox, } from '../nodes/index.js';
|
|
22
22
|
export type { CameraProps, OrbitCameraProps, } from '../nodes/index.js';
|
|
@@ -32,15 +32,15 @@ export type { NodeAudioProps, AudioBusProps, SoundNodeProps, } from '../nodes/in
|
|
|
32
32
|
export type { SoundProps, AudioRequest, AudioScope, AudioClip, AudioBusStop, AudioFilter, Param, Curve, } from '../attributes/index.js';
|
|
33
33
|
export { Canvas3D, Node3D, Group3D, Mesh3D, Box3D, Sphere3D, Plane3D, Cylinder3D, Cone3D, Torus3D, TorusKnot3D, Circle3D, Ring3D, Capsule3D, Polyhedron3D, Extrude3D, Lathe3D, Tube3D, Instances3D, Points3D, Line3D, Sprite3D, Model3D, AmbientLight3D, HemisphereLight3D, DirectionalLight3D, PointLight3D, SpotLight3D, AreaLight3D, Camera3D, Fog3D, Environment3D, } from '../nodes/index.js';
|
|
34
34
|
export { Graphics3D, Scene3D, RenderContext3D, Geo, Mat, Tex, lerpVector3, lerpEuler3, slerpQuaternion, quaternionFromEuler, normalizeQuaternion, resolveVector3, evaluateParametric, evaluateRoundedBox, resolveSurfaceSource, resolveFill3D, segmentsOf, resolveCameraPlacement, resolveShadows3D, shadowCasts, shadowReceives, } from '../render3d/index.js';
|
|
35
|
-
export type { Canvas3DProps, Node3DProps, Group3DProps, Mesh3DProps, Material3DProps, Box3DProps, Sphere3DProps, Plane3DProps, Cylinder3DProps, Cone3DProps, Torus3DProps, TorusKnot3DProps, Circle3DProps, Ring3DProps, Capsule3DProps, Polyhedron3DProps, Extrude3DProps, Lathe3DProps, Tube3DProps, Instances3DProps, Points3DProps, Line3DProps, Sprite3DProps, Model3DProps, AmbientLight3DProps, HemisphereLight3DProps, DirectionalLight3DProps, PointLight3DProps, SpotLight3DProps, AreaLight3DProps, Camera3DProps, Fog3DProps, Environment3DProps, } from '../nodes/index.js';
|
|
36
|
-
export type { Node3DRenderState, Graphics3DOp, Scene3DOp, Vector3, Vector3Input, Euler3, EulerOrder, Quaternion, Transform3D, Shadow3D, ShadowOptions3D, Faces3D, Blend3D, Shading3D, Segments3D, Sweep3D, Bevel3D, Fill3D, Geometry3D, BufferGeometry3D, Material3D, MaterialCommon3D, MeshShorthand3D, Uniform3D, Texture3D, TextureOptions3D, SurfaceTexture3D, SurfaceSource3D, ResolvedSurfaceSource, LightData3D, CameraData3D, FogData3D, EnvironmentData3D, Shadows3D, ShadowSettings3D, ToneMapping3D, ToneSettings3D, PostEffect3D, LineMode3D, LineStroke3D, ModelAnimation3D, } from '../render3d/index.js';
|
|
35
|
+
export type { Canvas3DProps, ChildSpace3D, Node3DProps, Group3DProps, Mesh3DProps, Material3DProps, Box3DProps, Sphere3DProps, Plane3DProps, Cylinder3DProps, Cone3DProps, Torus3DProps, TorusKnot3DProps, Circle3DProps, Ring3DProps, Capsule3DProps, Polyhedron3DProps, Extrude3DProps, Lathe3DProps, Tube3DProps, Instances3DProps, Points3DProps, Line3DProps, Sprite3DProps, Model3DProps, AmbientLight3DProps, HemisphereLight3DProps, DirectionalLight3DProps, PointLight3DProps, SpotLight3DProps, AreaLight3DProps, Camera3DProps, Fog3DProps, Environment3DProps, } from '../nodes/index.js';
|
|
36
|
+
export type { Node3DRenderState, Graphics3DOp, Scene3DOp, Vector3, Vector3Input, Euler3, EulerOrder, Quaternion, Transform3D, Shadow3D, ShadowOptions3D, Faces3D, Blend3D, Shading3D, Segments3D, Sweep3D, Bevel3D, Fill3D, Geometry3D, BufferGeometry3D, Material3D, MaterialCommon3D, MeshShorthand3D, MaterialShorthand3D, Uniform3D, Texture3D, TextureOptions3D, SurfaceTexture3D, SurfaceSource3D, ResolvedSurfaceSource, LightData3D, CameraData3D, FogData3D, EnvironmentData3D, Shadows3D, ShadowSettings3D, ToneMapping3D, ToneSettings3D, PostEffect3D, LineMode3D, LineStroke3D, ModelAnimation3D, } from '../render3d/index.js';
|
|
37
37
|
export { Graphics2D, PathBuilder, Clip, toPathString, } from '../render/index.js';
|
|
38
38
|
export type { RenderContext2D, RenderPass2D, MeasureContext2D, TextBlockSource, GraphicsOp, PathData, PathCommand, PathBounds, EllipseArc, } from '../render/index.js';
|
|
39
39
|
export type { AssetScope, LoaderFn } from '../assets/index.js';
|
|
40
40
|
export { Fills, parseColor, resolveFill, fillOps, colorOps, } from '../attributes/index.js';
|
|
41
41
|
export type { Fill, FillChain, FillOptions, VideoFillOptions, MediaPlacementOptions, ImageFit, ImageCrop, ImageMatrix, FillResolved, ShaderFillProp, ShaderFillResolved, ShaderFillCoords, ShaderTexture, SkSLUniformRecord, FractalNoiseBasis, Color, NormalizedColor, BlendMode, FillSpace, } from '../attributes/index.js';
|
|
42
42
|
export { resolveStroke, strokeOps, resolveShadow, shadowOps, resolveCorners, cornerRadiusOps, cornerStyleOps, pathOps, } from '../attributes/index.js';
|
|
43
|
-
export type { PathSampler, PathAnchor, PathSubpath, VectorPath, Stroke, StrokeProp, StrokeAlign, StrokeCap, StrokeJoin, StrokeResolved, Shadow, ShadowProp, ShadowResolved, Corners, CornerStyle, CornerStyleResolved, CornerRadiusResolved,
|
|
43
|
+
export type { PathSampler, PathAnchor, PathSubpath, VectorPath, Stroke, StrokeProp, StrokeAlign, StrokeCap, StrokeMarker, StrokeEnd, StrokeJoin, StrokeResolved, Shadow, ShadowProp, ShadowResolved, Corners, CornerStyle, CornerStyleResolved, CornerRadiusResolved, NodeEffect, } from '../attributes/index.js';
|
|
44
44
|
export { lerpVector2, sizeInputOps, insetsOps, alignmentOps, } from '../attributes/index.js';
|
|
45
45
|
export { flowOps } from '../layout/index.js';
|
|
46
46
|
export type { Vector2, Size2D, Insets, InsetsProps, InsetsResolved, AlignmentKey, Alignment, } from '../attributes/index.js';
|
|
@@ -57,13 +57,13 @@ export type {
|
|
|
57
57
|
Effect, EffectMode, EffectAxis, EffectSurface, EffectOptions,
|
|
58
58
|
/** What an image fill's `preset.adjustments` accepts — one, a list, or a chain. */
|
|
59
59
|
ImageAdjustment, VideoAdjustment,
|
|
60
|
-
/** The
|
|
60
|
+
/** The node effects that also work as a media adjustment — see {@link Adjustments}. */
|
|
61
61
|
EffectAdjustment, MediaAdjustment, VideoOnlyAdjustment, } from '../attributes/index.js';
|
|
62
62
|
/**
|
|
63
63
|
* Per-builder options. Every effect builder takes exactly one argument: one of
|
|
64
64
|
* these, or the dominant scalar it wraps.
|
|
65
65
|
*/
|
|
66
|
-
export type { BlurOptions, DirectionalBlurOptions, GrayscaleOptions, PixelateOptions, BulgeOptions, MagnifyOptions, BloomOptions, VintageOptions, ChromaticAberrationOptions, InvertOptions, ScatterOptions, PosterizeOptions, MotionBlurOptions, ShaderEffectOptions, OutlineOptions, VignetteOptions, GrainOptions, SharpenOptions, EdgesOptions, ThresholdOptions, RadialBlurOptions, HalftoneOptions, DitherOptions, DuotoneOptions, CurvesOptions, ColorAdjustmentOptions, RgbShiftOptions, ScanlinesOptions, BlockDisplaceOptions, BitCrushOptions, AsciiOptions, StreakOptions, GlowOptions,
|
|
66
|
+
export type { BlurOptions, DirectionalBlurOptions, GrayscaleOptions, PixelateOptions, BulgeOptions, MagnifyOptions, BloomOptions, VintageOptions, ChromaticAberrationOptions, InvertOptions, ScatterOptions, PosterizeOptions, MotionBlurOptions, ShaderEffectOptions, OutlineOptions, VignetteOptions, GrainOptions, SharpenOptions, EdgesOptions, ThresholdOptions, RadialBlurOptions, HalftoneOptions, DitherOptions, DuotoneOptions, CurvesOptions, ColorAdjustmentOptions, RgbShiftOptions, ScanlinesOptions, BlockDisplaceOptions, BitCrushOptions, AsciiOptions, StreakOptions, GlowOptions, OilPaintOptions, WaveOptions, TwirlOptions, ProgressiveBlurOptions, KaleidoscopeOptions, GlassOptions, LutOptions, } from '../attributes/index.js';
|
|
67
67
|
/**
|
|
68
68
|
* Per-builder options for the filters that exist only as filters. Everything
|
|
69
69
|
* else on {@link Adjustments} takes the matching effect options above, minus
|
|
@@ -72,7 +72,7 @@ export type { BlurOptions, DirectionalBlurOptions, GrayscaleOptions, PixelateOpt
|
|
|
72
72
|
*/
|
|
73
73
|
export type { BlurFilterOptions, GrayscaleFilterOptions, AlphaFilterOptions, ExposureFilterOptions, ColorMatrixFilterOptions, CurvesFilterOptions, ColorAdjustmentFilterOptions, PosterizeTimeFilterOptions, VideoEchoFilterOptions, } from '../attributes/index.js';
|
|
74
74
|
/** Effect data types, for naming an effect value or building one by hand. */
|
|
75
|
-
export type { BlurEffect, DirectionalBlurEffect, GrayscaleEffect, PixelateEffect, BulgeEffect, MagnifyEffect, BloomEffect, VintageEffect, ChromaticAberrationEffect, InvertEffect, InvertChannel, ScatterEffect, PosterizeEffect, MotionBlurEffect, MotionBlurAlignment, ShaderEffect, SkSLUniform, SkSLUniformValue, OutlineEffect, OutlinePosition, VignetteEffect, GrainEffect, SharpenEffect, EdgesEffect, EdgeKernel, ThresholdEffect, RadialBlurEffect, RadialBlurStyle, HalftoneEffect, HalftoneShape, HalftoneSeparation, DitherEffect, DitherMatrix, DuotoneEffect, CurvesEffect, ColorAdjustmentEffect, RgbShiftEffect, ScanlinesEffect, BlockDisplaceEffect, BitCrushEffect, BitCrushPalette, AsciiEffect, AsciiCharset, StreakEffect, GlowEffect, GlowChannel, GlowLoopStyle, GlowOriginal, GlowTint,
|
|
75
|
+
export type { BlurEffect, DirectionalBlurEffect, GrayscaleEffect, PixelateEffect, BulgeEffect, MagnifyEffect, BloomEffect, VintageEffect, ChromaticAberrationEffect, InvertEffect, InvertChannel, ScatterEffect, PosterizeEffect, MotionBlurEffect, MotionBlurAlignment, ShaderEffect, SkSLUniform, SkSLUniformValue, OutlineEffect, OutlinePosition, VignetteEffect, GrainEffect, SharpenEffect, EdgesEffect, EdgeKernel, ThresholdEffect, RadialBlurEffect, RadialBlurStyle, HalftoneEffect, HalftoneShape, HalftoneSeparation, DitherEffect, DitherMatrix, DuotoneEffect, CurvesEffect, ColorAdjustmentEffect, RgbShiftEffect, ScanlinesEffect, BlockDisplaceEffect, BitCrushEffect, BitCrushPalette, AsciiEffect, AsciiCharset, StreakEffect, GlowEffect, GlowChannel, GlowLoopStyle, GlowOriginal, GlowTint, OilPaintEffect, WaveEffect, WaveShape, TwirlEffect, ProgressiveBlurEffect, ProgressiveBlurShape, KaleidoscopeEffect, GlassEffect, LutEffect, } from '../attributes/index.js';
|
|
76
76
|
export { lerpNumber, } from '../tween/index.js';
|
|
77
77
|
export type { AnimationTarget, Steppable, TweenStepper, LerpFunction, TweenOptions, } from '../tween/index.js';
|
|
78
78
|
export { command, driveCommand, getCommandMeta, isCommand, makeCommand, commandSequence, commandParallel, loopCommand, } from '../tween/index.js';
|
|
@@ -83,8 +83,12 @@ export { property, fillProperty, strokeProperty, shadowProperty, effectsProperty
|
|
|
83
83
|
export type { PropOptions, AttributePropOptions, } from '../attributes/index.js';
|
|
84
84
|
export { createRef, clamp, generateList, createContext, ContextMap, Random, SeedGenerator, parseCSV, parseData, } from '../util/index.js';
|
|
85
85
|
export type { Reference, RefTarget, Context, DataRecord, ParseCSVOptions, } from '../util/index.js';
|
|
86
|
-
export {
|
|
87
|
-
export type {
|
|
86
|
+
export { nodeTypeIsA, parentIssue, placementIssues, siblingIssue } from '../document/placement.js';
|
|
87
|
+
export type { PlacementIssue, PlacementOptions } from '../document/placement.js';
|
|
88
|
+
export { nodeBox, pickNode, collectBoxes, parentPlanePointAt, childPlanePointAt, reparentPlacementAt, nodeHandlesAt, handleValueAt, } from '../runtime/node-picking.js';
|
|
89
|
+
export type { NodeBox, ReparentPlacement, } from '../runtime/node-picking.js';
|
|
88
90
|
export type { NodeOverride, } from '../runtime/playback-controller.js';
|
|
89
91
|
export type { TreeState, } from '../project/index.js';
|
|
92
|
+
/** @deprecated Kept until 1.0; see `../renamed-scene-names`. */
|
|
93
|
+
export type { SceneDocument, SceneEffect } from '../renamed-scene-names.js';
|
|
90
94
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,GACf,MAAM,aAAa,CAAC;AACrB,Y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AE9E,OAAO,EACH,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,aAAa,GAChB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,OAAO,EACP,iBAAiB,GACpB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,YAAY,GACf,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACR,SAAS,GACZ,MAAM,YAAY,CAAC;AACpB,gEAAgE;AAChE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/sdk/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { isProjectDocument, asProjectDocument, documentDuration, commandSpan, ha
|
|
|
22
22
|
export { resolveProjectDocument } from '../runtime/session.js';
|
|
23
23
|
export { placeTracks } from '../runtime/placement.js';
|
|
24
24
|
// =============================================================
|
|
25
|
-
// The
|
|
25
|
+
// The clip document
|
|
26
26
|
//
|
|
27
27
|
// The data half of the model. Nodes are code — a class registered under a key,
|
|
28
28
|
// which is also where a custom node joins the system — and everything else is
|
|
@@ -33,7 +33,9 @@ export { validateDocument, assertValidDocument,
|
|
|
33
33
|
// The code half of the model, as one object an engine owns. Not a
|
|
34
34
|
// singleton: what a document can name is a property of the registry
|
|
35
35
|
// compiling it, so two engines in one process disagree freely.
|
|
36
|
-
Registry, node,
|
|
36
|
+
Registry, node,
|
|
37
|
+
// A node built on a general one drops what it inherits and has no use for.
|
|
38
|
+
withdraw, } from '../document/index.js';
|
|
37
39
|
// The shader-pack vocabulary lives beside the rest of the fill/shader attribute
|
|
38
40
|
// machinery, not in `../document`.
|
|
39
41
|
export { normalizeShaderPack, resolveShaderProperties, isKnownShaderProperty, } from '../attributes/index.js';
|
|
@@ -51,14 +53,16 @@ export { expressionOps, ExpressionError } from '../document/index.js';
|
|
|
51
53
|
export { Node, Node2D,
|
|
52
54
|
// A clip's root container: layout frame, background paint and camera in
|
|
53
55
|
// one node. Every track builds into one sized to the viewport.
|
|
54
|
-
Canvas2D, Provider, ThemeProvider,
|
|
56
|
+
Canvas2D, Provider, ThemeProvider,
|
|
57
|
+
// Reaching another node by the id a `nodeRef` prop holds, and reading where it sits.
|
|
58
|
+
findNode2D, frameIn, } from '../nodes/index.js';
|
|
55
59
|
// =============================================================
|
|
56
60
|
// Nodes — Geometry
|
|
57
61
|
// =============================================================
|
|
58
|
-
export { PaintNode, ShapeNode, Rect, Ellipse,
|
|
62
|
+
export { PaintNode, ShapeNode, Rect, Ellipse, Path,
|
|
59
63
|
// The document's `"path"`: its `data` is in the unit space of its own box,
|
|
60
64
|
// where `Path` draws its `d` at face value.
|
|
61
|
-
PathShape, Polygon, Polygram,
|
|
65
|
+
PathShape, Polygon, Polygram, BooleanGroup, MaskGroup, } from '../nodes/index.js';
|
|
62
66
|
// =============================================================
|
|
63
67
|
// Nodes — Layout
|
|
64
68
|
// =============================================================
|
|
@@ -186,5 +190,6 @@ export { createRef, clamp, generateList, createContext, ContextMap, Random, Seed
|
|
|
186
190
|
// These genuinely live in `../runtime` (node hit-testing and the transient
|
|
187
191
|
// override store are runtime concerns) — deep-imported from their concrete
|
|
188
192
|
// files, never the runtime barrel itself.
|
|
189
|
-
export {
|
|
193
|
+
export { nodeTypeIsA, parentIssue, placementIssues, siblingIssue } from '../document/placement.js';
|
|
194
|
+
export { nodeBox, pickNode, collectBoxes, parentPlanePointAt, childPlanePointAt, reparentPlacementAt, nodeHandlesAt, handleValueAt, } from '../runtime/node-picking.js';
|
|
190
195
|
//# sourceMappingURL=index.js.map
|