@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"line-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/line-node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAItE,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAS7D,MAAM,OAAO,IAAK,SAAQ,SAAoB;IAM1C,YAAY,KAAkC;QAC1C,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEkB,aAAa;QAC5B,OAAO,IAAI,UAAU,EAAE,CAAC,IAAI,CAAC;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SAChB,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH;;;;;;;;;;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,KAAa;IACxD,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,IAAI,GAAG,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC;IACzE,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI;YAAE,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO;QACH,CAAC,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,CAAC,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC;QAC9B,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC;KAClC,CAAC;AACN,CAAC;AAED,8EAA8E;AAC9E,SAAS,eAAe,CAAC,OAAkC;IACvD,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG;YAAE,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["import { Graphics2D } from \"@/render/graphics2d\";\nimport { nearPolyline, pointInPolygon } from \"@/render/clip-contains\";\nimport { StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\n\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { NodeConfig } from \"@/nodes/2d/node2d\";\nimport { BoxBounds } from \"@/layout/bounds\";\nexport interface LineProps extends ShapeProps {\n points: Vector2[];\n radius: number;\n closed: boolean;\n\n}\nexport class Line extends ShapeNode<LineProps> {\n\n @property({ default: [] }) declare points: Vector2[];\n @property({ default: 0 }) declare radius: number;\n @property({ default: false }) declare closed: boolean;\n\n constructor(props: NodeConfig<Line, LineProps>) {\n super(props);\n }\n\n protected override shapeGraphics(): Graphics2D {\n return new Graphics2D().line({\n points: this.points,\n radius: this.radius,\n closed: this.closed,\n start: this.start,\n end: this.end,\n });\n }\n\n /**\n * A line is the one shape a box cannot describe. It declares no `clipSelf()`\n * **and** has no `measure()` override, so `points` never reach the layout\n * engine: the layout rect is whatever sizing hands it, with no relation to\n * where the line is drawn. Under the default `'fill'` it is the parent's whole\n * content box, so a box test would select the line from anywhere in that\n * parent; under `'hug'` there is nothing to hug and it collapses to 0×0, so a\n * box test would select it from nowhere at all.\n *\n * Test the polyline directly instead: distance to the nearest segment, within\n * `tolerance` plus half the stroke. That needs no layout size, which is\n * exactly why it is right in both cases.\n *\n * `radius` (vertex rounding) is ignored — it only pulls the path *inward* at\n * joints, so testing the un-rounded polyline over-estimates slightly, which\n * is the forgiving direction for a grab test.\n */\n /**\n * A line's ink is its `points`, which never reach the layout engine — so the\n * layout rect describes it in neither size nor position. Left alone, an editor\n * selecting a line gets its parent's whole box (the default `'fill'`) or a\n * degenerate point (`'hug'`), and in both cases a box that is nowhere near the\n * line.\n *\n * Report the points' own extent instead, grown by half the stroke so the box\n * contains the drawn ink and an axis-aligned line still has thickness. That\n * growth is *conservative*: it is applied on all four sides, while a diagonal\n * stroke with butt caps only spreads perpendicular to itself, so the box can\n * overshoot by up to half the weight on each axis. Over-covering is the safe\n * direction — the failure that matters is ink sitting outside the gizmo — and\n * the exact hull would have to fold in caps, joins and the miter limit. The\n * grab region is unaffected: {@link hitTestSelf} below measures the real\n * distance to each segment. The\n * result is deliberately **off-centre** when the points are: `points: [(0,0),\n * (100,40)]` draws from the node's centre up and to the right, so its box is\n * centred at `(50, 20)`, not on the node. That is exactly what a `measure()`\n * override could not express — and why this is a separate seam.\n */\n override _localBounds(): BoxBounds {\n const reach = maxStrokeWeight(this.stroke as StrokeResolved[]) / 2;\n return pointsBounds(this.points, reach) ?? super._localBounds();\n }\n\n protected override hitTestSelf(local: Vector2, tolerance: number): boolean {\n const pts = this.points;\n if (pts.length === 0) return false;\n const reach = tolerance + maxStrokeWeight(this.stroke as StrokeResolved[]) / 2;\n if (pts.length === 1) return Math.hypot(local.x - pts[0].x, local.y - pts[0].y) <= reach;\n // A closed line encloses a fillable region, so a click inside it counts —\n // matching what the fill actually paints.\n if (this.closed && pts.length >= 3 && pointInPolygon(local, pts)) return true;\n return nearPolyline(local, pts, this.closed, reach);\n }\n}\n\n/**\n * Axis-aligned extent of `points`, grown by half the widest stroke so the box\n * contains the ink rather than just the centreline. Returns `null` for a line\n * with nothing to draw.\n */\nfunction pointsBounds(pts: readonly Vector2[], reach: number): BoxBounds | null {\n if (pts.length === 0) return null;\n let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;\n for (const p of pts) {\n if (p.x < minX) minX = p.x;\n if (p.x > maxX) maxX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.y > maxY) maxY = p.y;\n }\n return {\n x: (minX + maxX) / 2,\n y: (minY + maxY) / 2,\n width: maxX - minX + reach * 2,\n height: maxY - minY + reach * 2,\n };\n}\n\n/** Widest stroke layer, so the grab band matches the thickest thing drawn. */\nfunction maxStrokeWeight(strokes: readonly StrokeResolved[]): number {\n let max = 0;\n for (const s of strokes) if (s.weight > max) max = s.weight;\n return max;\n}\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { RenderContext2D } from "../../render/render-context2d.js";
|
|
2
|
-
import { BoxBounds } from "../../layout/bounds.js";
|
|
3
|
-
import { Camera } from "../layout/camera-node.js";
|
|
4
|
-
import { ShapeNode, ShapeProps } from "./shape-node.js";
|
|
5
|
-
/**
|
|
6
|
-
* Base for backgrounds that fill whatever region is currently visible, rather
|
|
7
|
-
* than a fixed rect. Placed inside a {@link Camera}, the node resolves the
|
|
8
|
-
* world region the camera can currently see (from its `zoom`/`origin`/`heading`)
|
|
9
|
-
* and hands those bounds to {@link renderPattern}, so the subclass only ever
|
|
10
|
-
* generates geometry for what's on screen — no oversized static node sized for
|
|
11
|
-
* the worst-case pan/zoom.
|
|
12
|
-
*
|
|
13
|
-
* With no ancestor `Camera` the node falls back to its own layout rect, so the
|
|
14
|
-
* same pattern doubles as an ordinary full-bleed background.
|
|
15
|
-
*
|
|
16
|
-
* The pattern node is itself a camera child, laid out stack-style at the
|
|
17
|
-
* camera's centre, so its local draw space shares the world origin its siblings
|
|
18
|
-
* use. The visible region is therefore expressed directly in that space: centred
|
|
19
|
-
* on the camera's `origin`, sized to the inverse of the camera transform.
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class ViewportPattern<P extends ShapeProps = ShapeProps> extends ShapeNode<P> {
|
|
22
|
-
/**
|
|
23
|
-
* Fill `bounds` (in this node's local draw space) with the pattern. Called
|
|
24
|
-
* once per render with the currently-visible region. The `centerBounds` for
|
|
25
|
-
* path ops drawn here is `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2,
|
|
26
|
-
* bounds.y + h/2]`.
|
|
27
|
-
*/
|
|
28
|
-
protected abstract renderPattern(draw: RenderContext2D, bounds: BoxBounds): void;
|
|
29
|
-
protected renderSelf(draw: RenderContext2D): void;
|
|
30
|
-
/**
|
|
31
|
-
* The region this node should cover, in its own local draw space. Inside a
|
|
32
|
-
* camera this is the world rect the camera currently sees; otherwise it's the
|
|
33
|
-
* node's own layout rect (a normal background).
|
|
34
|
-
*/
|
|
35
|
-
protected visibleBounds(): BoxBounds;
|
|
36
|
-
/** Nearest ancestor {@link Camera}, or `null` when rendered outside one. */
|
|
37
|
-
protected findCamera(): Camera | null;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=viewport-pattern-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-pattern-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/viewport-pattern-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,eAAe,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAEzF;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI;IAEhF,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI;IAWjD;;;;OAIG;IACH,SAAS,CAAC,aAAa,IAAI,SAAS;IAuCpC,4EAA4E;IAC5E,SAAS,CAAC,UAAU,IAAI,MAAM,GAAG,IAAI;CAMxC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Clip } from "../../render/clip.js";
|
|
2
|
-
import { Camera } from "../layout/camera-node.js";
|
|
3
|
-
import { ShapeNode } from "./shape-node.js";
|
|
4
|
-
/**
|
|
5
|
-
* Base for backgrounds that fill whatever region is currently visible, rather
|
|
6
|
-
* than a fixed rect. Placed inside a {@link Camera}, the node resolves the
|
|
7
|
-
* world region the camera can currently see (from its `zoom`/`origin`/`heading`)
|
|
8
|
-
* and hands those bounds to {@link renderPattern}, so the subclass only ever
|
|
9
|
-
* generates geometry for what's on screen — no oversized static node sized for
|
|
10
|
-
* the worst-case pan/zoom.
|
|
11
|
-
*
|
|
12
|
-
* With no ancestor `Camera` the node falls back to its own layout rect, so the
|
|
13
|
-
* same pattern doubles as an ordinary full-bleed background.
|
|
14
|
-
*
|
|
15
|
-
* The pattern node is itself a camera child, laid out stack-style at the
|
|
16
|
-
* camera's centre, so its local draw space shares the world origin its siblings
|
|
17
|
-
* use. The visible region is therefore expressed directly in that space: centred
|
|
18
|
-
* on the camera's `origin`, sized to the inverse of the camera transform.
|
|
19
|
-
*/
|
|
20
|
-
export class ViewportPattern extends ShapeNode {
|
|
21
|
-
renderSelf(draw) {
|
|
22
|
-
const bounds = this.visibleBounds();
|
|
23
|
-
// Clip to the visible region so geometry overscanned past the edge (so
|
|
24
|
-
// thick lines slide out instead of popping) trims cleanly. When inside a
|
|
25
|
-
// camera the viewport already clips, but this keeps edge strokes clean
|
|
26
|
-
// and bounds the work in the no-camera fallback too.
|
|
27
|
-
draw.beginClip(new Clip().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height }));
|
|
28
|
-
this.renderPattern(draw, bounds);
|
|
29
|
-
draw.endClip();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* The region this node should cover, in its own local draw space. Inside a
|
|
33
|
-
* camera this is the world rect the camera currently sees; otherwise it's the
|
|
34
|
-
* node's own layout rect (a normal background).
|
|
35
|
-
*/
|
|
36
|
-
visibleBounds() {
|
|
37
|
-
const camera = this.findCamera();
|
|
38
|
-
if (!camera) {
|
|
39
|
-
// No camera — fill our own cell, centred on this node's origin.
|
|
40
|
-
const w = this.layoutBounds?.width ?? 0;
|
|
41
|
-
const h = this.layoutBounds?.height ?? 0;
|
|
42
|
-
return { x: 0, y: 0, width: w, height: h };
|
|
43
|
-
}
|
|
44
|
-
const vw = camera.measuredWidth;
|
|
45
|
-
const vh = camera.measuredHeight;
|
|
46
|
-
const zoom = camera.zoom || 1;
|
|
47
|
-
const heading = camera.heading;
|
|
48
|
-
// Inverse of the camera scale: a viewport `vw×vh` shows `vw/zoom × vh/zoom`
|
|
49
|
-
// of the world.
|
|
50
|
-
const hw = vw / 2 / zoom;
|
|
51
|
-
const hh = vh / 2 / zoom;
|
|
52
|
-
// With a heading the visible world rect is rotated; take its axis-aligned
|
|
53
|
-
// bounding box so the pattern covers the rotated viewport's full extent.
|
|
54
|
-
let bw = hw;
|
|
55
|
-
let bh = hh;
|
|
56
|
-
if (heading !== 0) {
|
|
57
|
-
const rad = (heading * Math.PI) / 180;
|
|
58
|
-
const cos = Math.abs(Math.cos(rad));
|
|
59
|
-
const sin = Math.abs(Math.sin(rad));
|
|
60
|
-
bw = hw * cos + hh * sin;
|
|
61
|
-
bh = hw * sin + hh * cos;
|
|
62
|
-
}
|
|
63
|
-
// The visible region centres on the camera's `lookAt`, returned in y-UP
|
|
64
|
-
// world space (matching the descriptor convention; the renderer applies
|
|
65
|
-
// the single y-up→canvas flip when the pattern's shapes are drawn). A
|
|
66
|
-
// y-down consumer would have wanted -lookAt.y; we hand back the y-up value.
|
|
67
|
-
const lookAt = camera.lookAt;
|
|
68
|
-
return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };
|
|
69
|
-
}
|
|
70
|
-
/** Nearest ancestor {@link Camera}, or `null` when rendered outside one. */
|
|
71
|
-
findCamera() {
|
|
72
|
-
for (let n = this.parent; n; n = n.parent) {
|
|
73
|
-
if (n instanceof Camera)
|
|
74
|
-
return n;
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=viewport-pattern-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-pattern-node.js","sourceRoot":"","sources":["../../../src/nodes/geometry/viewport-pattern-node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAA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ACJ","sourcesContent":["import { RenderContext2D } from \"@/render/render-context2d\";\nimport { Clip } from \"@/render/clip\";\nimport { BoxBounds } from \"@/layout/bounds\";\nimport { Camera } from \"../layout/camera-node\";\nimport { ShapeNode, ShapeProps } from \"./shape-node\";\n\n/**\n * Base for backgrounds that fill whatever region is currently visible, rather\n * than a fixed rect. Placed inside a {@link Camera}, the node resolves the\n * world region the camera can currently see (from its `zoom`/`origin`/`heading`)\n * and hands those bounds to {@link renderPattern}, so the subclass only ever\n * generates geometry for what's on screen — no oversized static node sized for\n * the worst-case pan/zoom.\n *\n * With no ancestor `Camera` the node falls back to its own layout rect, so the\n * same pattern doubles as an ordinary full-bleed background.\n *\n * The pattern node is itself a camera child, laid out stack-style at the\n * camera's centre, so its local draw space shares the world origin its siblings\n * use. The visible region is therefore expressed directly in that space: centred\n * on the camera's `origin`, sized to the inverse of the camera transform.\n */\nexport abstract class ViewportPattern<P extends ShapeProps = ShapeProps> extends ShapeNode<P> {\n\n /**\n * Fill `bounds` (in this node's local draw space) with the pattern. Called\n * once per render with the currently-visible region. The `centerBounds` for\n * path ops drawn here is `[bounds.x - w/2, bounds.y - h/2, bounds.x + w/2,\n * bounds.y + h/2]`.\n */\n protected abstract renderPattern(draw: RenderContext2D, bounds: BoxBounds): void;\n\n protected renderSelf(draw: RenderContext2D): void {\n const bounds = this.visibleBounds();\n // Clip to the visible region so geometry overscanned past the edge (so\n // thick lines slide out instead of popping) trims cleanly. When inside a\n // camera the viewport already clips, but this keeps edge strokes clean\n // and bounds the work in the no-camera fallback too.\n draw.beginClip(new Clip().rect({ x: bounds.x, y: bounds.y, width: bounds.width, height: bounds.height }));\n this.renderPattern(draw, bounds);\n draw.endClip();\n }\n\n /**\n * The region this node should cover, in its own local draw space. Inside a\n * camera this is the world rect the camera currently sees; otherwise it's the\n * node's own layout rect (a normal background).\n */\n protected visibleBounds(): BoxBounds {\n const camera = this.findCamera();\n if (!camera) {\n // No camera — fill our own cell, centred on this node's origin.\n const w = this.layoutBounds?.width ?? 0;\n const h = this.layoutBounds?.height ?? 0;\n return { x: 0, y: 0, width: w, height: h };\n }\n\n const vw = camera.measuredWidth;\n const vh = camera.measuredHeight;\n const zoom = camera.zoom || 1;\n const heading = camera.heading;\n\n // Inverse of the camera scale: a viewport `vw×vh` shows `vw/zoom × vh/zoom`\n // of the world.\n const hw = vw / 2 / zoom;\n const hh = vh / 2 / zoom;\n\n // With a heading the visible world rect is rotated; take its axis-aligned\n // bounding box so the pattern covers the rotated viewport's full extent.\n let bw = hw;\n let bh = hh;\n if (heading !== 0) {\n const rad = (heading * Math.PI) / 180;\n const cos = Math.abs(Math.cos(rad));\n const sin = Math.abs(Math.sin(rad));\n bw = hw * cos + hh * sin;\n bh = hw * sin + hh * cos;\n }\n\n // The visible region centres on the camera's `lookAt`, returned in y-UP\n // world space (matching the descriptor convention; the renderer applies\n // the single y-up→canvas flip when the pattern's shapes are drawn). A\n // y-down consumer would have wanted -lookAt.y; we hand back the y-up value.\n const lookAt = camera.lookAt;\n return { x: lookAt.x, y: lookAt.y, width: bw * 2, height: bh * 2 };\n }\n\n /** Nearest ancestor {@link Camera}, or `null` when rendered outside one. */\n protected findCamera(): Camera | null {\n for (let n = this.parent; n; n = n.parent) {\n if (n instanceof Camera) return n;\n }\n return null;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canvas2d-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/scene/canvas2d-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,EAAc,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAoB,KAAK,YAAY,EAAE,MAA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;sCAMT;AAGD;IADC,OAAO,EAAE;yCAMT","sourcesContent":["import { RenderContext2D, RenderPass2D } from \"@/render/render-context2d\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport { type Command, type CommandArgs } from \"@/tween/command\";\nimport { command } from \"@/tween/command-decorator\";\nimport { lerpLookAt, type LookAt, type SpaceCamera } from \"@/attributes/layout/space3d\";\nimport { NO_PROJECTION_3D, type Projection3D } from \"@/attributes/layout/matrix2d\";\nimport { Alignment } from \"@/attributes/layout/alignment\";\nimport type { FlowMode, FlowProps, FlowSettings, GapSize } from \"@/layout/types\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { Fill } from \"@/attributes/shape/fill/chain\";\nimport type { AssetScope } from \"@/assets/scope\";\nimport { CameraScope, Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\nimport { spaceRootFrame } from \"@/nodes/2d/node-space\";\nimport type { Node } from \"@/nodes/node/node\";\nimport { NodeAudio } from \"@/nodes/audio/node-audio\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { alignmentProperty, fillProperty, flowProperty } from \"@/attributes/properties/typed\";\n\n/** @internal */\nexport interface Canvas2DProps extends Node2DProps, FlowProps {\n /**\n * Background fill layer(s). Each item can be a CSS color string, a fill\n * prop object, an already-resolved fill, or a {@link FillChain} from the\n * `Fills` builder. Painted behind the scene's children.\n */\n fill: Fill;\n /**\n * Overlay layer(s) — same loose values as {@link fill}, but painted *over*\n * the fill **and** the children (clipped to the viewport). Use for textures\n * laid across the whole scene, e.g. a VHS-grain image or video.\n */\n overlay: Fill;\n /** Camera magnification factor. Values > 1 zoom in; < 1 zoom out. */\n zoom: number;\n /**\n * World-space point that maps to the centre of the viewport. In a\n * {@link space3D} it is also what the camera orbits, and `z` puts it in\n * depth — the same sense as a node's `depth`, so a negative `z` flies in.\n */\n lookAt: LookAt;\n /** Rotation of the camera view in degrees (clockwise). */\n heading: number;\n /**\n * Place the children in one 3D space seen through this camera, rather than\n * each projecting through a perspective of its own. Their `depth` and tilt\n * are then positions and turns in that space, and siblings paint far to\n * near. A switch rather than something read off the camera's numbers, so\n * turning it on can never jump a tween.\n *\n * While it is on, `perspective` is the camera's distance from {@link lookAt}\n * at `dolly: 0` — CSS's convention, so that plane draws 1:1 and `0` is a\n * parallel projection — and the stage's own tilt and depth are unused.\n */\n space3D: boolean;\n /** Degrees about the vertical axis through {@link lookAt}. 0 is head-on; positive moves the camera to the right. Same as `Camera3D`. */\n orbit: number;\n /** Degrees above the layers. Positive looks down on them. Same as `Camera3D`. */\n elevation: number;\n /** Px the camera has moved in toward {@link lookAt}. Inert with no perspective, as depth is. */\n dolly: number;\n}\n\n/**\n * The single root container every {@link Scene} builds into.\n *\n * A `Canvas2D` is a plain {@link Node2D} that doubles as the scene's layout frame\n * and camera. It lays its children out (flex `horizontal`/`vertical` or\n * `freeform`, with `gap`, `align`, `padding`) and paints a scene-wide background\n * (`fill`) and `overlay` — *and* views those laid-out children through a viewport\n * transform (`zoom`, `lookAt`, `heading`).\n *\n * Unlike a {@link Rect} it is **not a shape**: it has no stroke, shadow, corner,\n * or `start`/`end` props. It carries only the scene-wide concerns — background\n * paint, child layout, and camera — so `stage.fill`, `stage.flow`, etc. read\n * the root directly without exposing per-shape geometry the scene root never has.\n *\n * Its layout props are the arrangement {@link Node2D} lays its children out by,\n * the same as a {@link Rect}'s — see {@link flowArrangement}.\n */\n/** @internal */\nexport class Canvas2D extends Node2D<Canvas2DProps> {\n\n // ---- Background paint -------------------------------------------------\n // Author-facing paint props. Like Rect, the declared type is the loose\n // `Fill` so assignment (`this.fill = 'red'`) and reads share one type; the\n // @property accessor stores the *resolved* value via the mapper.\n @fillProperty()\n declare fill: Fill;\n @fillProperty()\n declare overlay: Fill;\n\n // ---- Layout container -------------------------------------------------\n @flowProperty() declare flow: FlowMode;\n @property({ default: 0 }) declare readonly gap: GapSize;\n @property({ default: false }) declare readonly wrap: boolean;\n // `undefined` means \"follow `gap`\", not \"missing\" — see FlowProps.crossGap.\n @property({ default: undefined }) declare readonly crossGap: number | undefined;\n @property({ default: 1 }) declare readonly columns: number;\n // Declared loose as `Alignment` (covers `this.align = 'center'`); the\n // accessor stores the resolved per-axis `Vector2` pivot. See Rect.\n @alignmentProperty()\n declare align: Alignment;\n\n // ---- Camera -----------------------------------------------------------\n /** Camera magnification factor (default: 1). */\n @property({ default: 1 }) declare zoom: number;\n /** World-space focus point (default: {x:0, y:0}). */\n @property({ default: { x: 0, y: 0 }, tween: lerpLookAt }) declare lookAt: LookAt;\n /** Camera view rotation in degrees (default: 0). */\n @property({ default: 0 }) declare heading: number;\n @property({ default: false }) declare space3D: boolean;\n @property({ default: 0 }) declare orbit: number;\n @property({ default: 0 }) declare elevation: number;\n @property({ default: 0 }) declare dolly: number;\n\n constructor(props: NodeConfig<Canvas2D, Canvas2DProps>) {\n super(props);\n }\n\n // ---- Camera motion commands -------------------------------------------\n // Mirror the Camera node's viewport commands.\n\n /** Animate `zoom`. Values > 1 zoom in; < 1 zoom out. */\n @command({ args: [{ key: \"zoom\", kind: \"number\", min: 0.01, step: 0.1, unit: \"×\" }] })\n zoomTo(args: CommandArgs<{ zoom: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /** Pan — animate `lookAt`, the world-space point mapped to the viewport center. `z` moves it in depth. */\n @command({ args: [{ key: \"lookAt\", kind: \"vector2\", properties: { x: { kind: \"number\" }, y: { kind: \"number\" }, z: { kind: \"number\" } } }] })\n panTo(args: CommandArgs<{ lookAt: LookAt }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /**\n * Swing the camera round {@link lookAt}. The argument names are the ones the\n * 3D components' `orbitTo` takes, less `zoom`: here that is the lens, not a\n * distance, and it has a command of its own.\n */\n @command({ args: [{ key: \"orbit\", kind: \"number\", step: 1, unit: \"°\" }, { key: \"elevation\", kind: \"number\", step: 1, unit: \"°\" }] })\n orbitTo(args: CommandArgs<{ orbit?: number; elevation?: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /** Move the camera in toward {@link lookAt} (positive) or back out. */\n @command({ args: [{ key: \"dolly\", kind: \"number\", step: 10 }] })\n dollyTo(args: CommandArgs<{ dolly: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n /** Animate the view rotation (`heading`), in degrees clockwise. */\n @command({ args: [{ key: \"heading\", kind: \"number\", step: 1, unit: \"°\" }] })\n headingTo(args: CommandArgs<{ heading: number }> & { duration: number }): Command<Canvas2DProps> {\n return this.to({ data: args.data as Partial<Canvas2DProps>, duration: args.duration, easing: args.easing });\n }\n\n @command()\n fillTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\n const from = this.fill as FillResolved[];\n const target = fillOps.resolve(args.data as Fill);\n const lerp = args.lerp ?? fillOps.lerp;\n return this.command<Canvas2DProps>(t => ({ fill: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\n }\n\n @command()\n overlayTo(args: CommandArgs<Fill, FillResolved[]> & { duration: number }): Command<Canvas2DProps> {\n const from = this.overlay as FillResolved[];\n const target = fillOps.resolve(args.data as Fill);\n const lerp = args.lerp ?? fillOps.lerp;\n return this.command<Canvas2DProps>(t => ({ overlay: lerp(from, target, t) }) as Partial<Canvas2DProps>, args.duration, args.easing);\n }\n\n // ---- Layout -----------------------------------------------------------\n\n protected override flowArrangement(): FlowSettings {\n return this;\n }\n\n // ---- Drawing ----------------------------------------------------------\n\n // The viewport-sized background box behind the children.\n private shapeGraphics(): Graphics2D {\n return new Graphics2D().rect({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n });\n }\n\n protected override renderSelf(draw: RenderContext2D): void {\n const fill = this.fill as FillResolved[];\n if (fill.length === 0) return;\n draw.draw(this.shapeGraphics().fill(fill));\n }\n\n // Overlay over fill + children, clipped to the viewport silhouette.\n protected override renderOverlay(ctx: RenderContext2D): void {\n const overlay = this.overlay as FillResolved[];\n if (overlay.length === 0) return;\n ctx.draw(this.shapeGraphics().fill(overlay));\n }\n\n /**\n * Accept audio children as well as 2D ones.\n *\n * The scene root is where the two trees meet, mirroring `Canvas3D` — and for\n * the same reason it is *this* node: a composition already carries both\n * halves of a clip, so a voiceover belongs in the document that shows the\n * picture it is narrating rather than in a second document beside it.\n *\n * Nothing partitions them by hand. `Node2D.children` already filters to its\n * own kind, so layout and render skip the audio subtree for free, and the\n * audio declaration walk reads the unfiltered list.\n */\n protected override acceptsChild(child: Node): boolean {\n return child.dimension === \"2d\" || child.dimension === \"audio\";\n }\n\n /** This node's children in the audio tree. */\n get childrenAudio(): NodeAudio[] {\n return this._allChildren.filter((c): c is NodeAudio => c instanceof NodeAudio);\n }\n\n // The world container, not a shape, so it declares its own `fill`/`overlay`.\n override declareAssets(assets: AssetScope): void {\n super.declareAssets(assets);\n assets.fill(this.fill as FillResolved[]);\n assets.fill(this.overlay as FillResolved[]);\n }\n\n // The viewport outline — used for `clip` and as the area backdrop effects\n // are confined to.\n protected override clipSelf(): Clip {\n return new Clip().rect({\n width: this.layoutBounds.width,\n height: this.layoutBounds.height,\n });\n }\n\n // ---- Rendering --------------------------------------------------------\n\n // Children are laid out by the flow engine; here we view that laid-out\n // world through the camera viewport transform, the same way the Camera node\n // does. When the camera is at rest (zoom 1, no heading, origin at 0) this is\n // the identity, so a plain layout root pays nothing extra.\n // Non-null exactly when renderChildren below opens a camera, so a consumer\n // reproducing the render transform (node picking) inserts the same scope in\n // the same place — and skips it on the at-rest fast path, where the renderer\n // pushes nothing at all.\n override _cameraScope(): CameraScope | null {\n if (this.space3D) return null;\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) return null;\n return { lookAt: this.lookAt, zoom: this.zoom, heading: this.heading };\n }\n\n override _spaceCamera(): SpaceCamera | null {\n if (!this.space3D) return null;\n const rect = this.layoutBounds;\n return {\n perspective: this.perspective,\n orbit: this.orbit,\n elevation: this.elevation,\n dolly: this.dolly,\n lookAt: this.lookAt,\n zoom: this.zoom,\n heading: this.heading,\n viewportX: rect?.x ?? 0,\n viewportY: -(rect?.y ?? 0),\n };\n }\n\n // In a space the stage's own tilt and depth would turn the whole scene as\n // one flat card; its `perspective` is the camera's instead.\n protected override _projection(): Projection3D {\n return this.space3D ? NO_PROJECTION_3D : super._projection();\n }\n\n protected override renderChildren(ctx: RenderPass2D): void {\n const camera = this._spaceCamera();\n if (camera) {\n this._renderInSpace(ctx, spaceRootFrame(this, camera));\n return;\n }\n if (this.zoom === 1 && this.heading === 0 && this.lookAt.x === 0 && this.lookAt.y === 0) {\n super.renderChildren(ctx);\n return;\n }\n\n const rect = this.layoutBounds;\n const w = rect?.width ?? 0;\n const h = rect?.height ?? 0;\n const cx = rect?.x ?? 0;\n const cy = rect?.y ?? 0;\n\n ctx.beginCamera(\n { x: cx, y: -cy, width: w, height: h },\n this.lookAt,\n this.zoom,\n this.heading,\n );\n\n for (const child of this._children) if (child instanceof Node2D) child.render(ctx);\n\n ctx.endCamera();\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/scene/provider-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,aAAa,CAAC,CAAC,CAAE,SAAQ,WAAW;IACjD,mEAAmE;IACnE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,iEAAiE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AM,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACpE,CAAC;CACJ;AAzBsD;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;yCAAuC;AACrB;IAAlD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;uCAA4B","sourcesContent":["import { Node2D, NodeConfig, Node2DProps } from \"@/nodes/2d/node2d\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { Context, ContextMap } from \"@/util/context\";\n\nexport interface ProviderProps<T> extends Node2DProps {\n /** The context token this provider supplies to its descendants. */\n context: Context<T>;\n /** The value to provide. Omitted → the token's default value. */\n value: T;\n}\n\n/**\n * Generic context provider — the JSX-facing counterpart to {@link createContext}.\n * Wraps its children and supplies a token's value to everything below it;\n * descendants read it with `node.useContext(token)`. Nesting providers for the\n * same token shadows nearest-ancestor-wins.\n *\n * @example Inline use\n * ```tsx\n * const Money = createContext<number>(0, \"money\");\n * <Provider context={Money} value={500}>\n * <MyNode /> // useContext(Money) === 500\n * </Provider>\n * ```\n *\n * @example Reusable, pre-bound provider — extend and fix the token\n * ```tsx\n * class MoneyProvider extends Provider<number> {\n * protected override resolveContext() { return Money; }\n * }\n * <MoneyProvider value={500}>…</MoneyProvider>\n * ```\n *\n * It's a layout-transparent container: it has no paint of its own and\n * stack-centers its children (the base {@link Node2D} layout), so dropping a\n * provider into a tree changes inheritance, not appearance.\n */\nexport class Provider<T = unknown> extends Node2D<ProviderProps<T>> {\n @property({ default: undefined }) declare readonly context?: Context<T>;\n @property({ default: undefined }) declare readonly value?: T;\n\n constructor(props: NodeConfig<Provider<T>, ProviderProps<T>>) {\n super(props);\n }\n\n /** The token to provide. Override in a subclass to bind a fixed token so\n * authors don't re-pass `context` on every use. */\n protected resolveContext(): Context<T> | undefined {\n return this.context;\n }\n\n /** The value to provide. Override alongside {@link resolveContext} for a\n * provider that computes its value rather than taking it as a prop. */\n protected resolveValue(): T | undefined {\n return this.value;\n }\n\n protected override provideContext(parent: ContextMap): ContextMap {\n const ctx = this.resolveContext();\n if (!ctx) return parent;\n const v = this.resolveValue();\n return parent.with(ctx, v !== undefined ? v : ctx.defaultValue);\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/scene/theme-provider-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACnD;wCACoC;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B;uCACmC;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,kFAAkF;IAClF,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,MAAM,CAAC,kBAAkB,CAAC;IACzD,SAAmD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnF,SAAmD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClF,SAAmD,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;gBAE9D,KAAK,EAAE,UAAU,CAAC,aAAa,EAAE,kBAAkB,CAAC;cAI7C,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU;CAOpE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider-node.js","sourceRo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import { property } from \"@/attributes/properties/decorator\";\nimport { ContextMap } from \"@/util/context\";\nimport { ThemeToken, DataToken, SeedToken } from \"@/runtime/builtin-context\";\n\nexport interface ThemeProviderProps extends Node2DProps {\n /** Named values (e.g. colors) merged onto any ancestor theme, read via\n * `node.useContext(ThemeToken)`. */\n theme: Record<string, unknown>;\n /** Arbitrary data merged onto any ancestor data bag, read via\n * `node.useContext(DataToken)`. */\n data: Record<string, unknown>;\n /** A default seed passed down the tree, read via `node.useContext(SeedToken)`. */\n seed: string | number;\n}\n\n/**\n * Provides theme / data / seed to its descendants. A convenience wrapper over\n * the same context machinery as {@link Provider}: it sets three built-in tokens\n * at once and **merges** `theme`/`data` onto any ancestor provider's values\n * (nested `ThemeProvider`s accumulate; nearest wins per key), while `seed`\n * overrides the inherited seed.\n *\n * Layout-transparent like {@link Provider} — it carries context, not appearance.\n */\nexport class ThemeProvider extends Node2D<ThemeProviderProps> {\n @property({ default: undefined }) declare readonly theme?: Record<string, unknown>;\n @property({ default: undefined }) declare readonly data?: Record<string, unknown>;\n @property({ default: undefined }) declare readonly seed?: string | number;\n\n constructor(props: NodeConfig<ThemeProvider, ThemeProviderProps>) {\n super(props);\n }\n\n protected override provideContext(parent: ContextMap): ContextMap {\n let next = parent;\n if (this.theme) next = next.with(ThemeToken, { ...parent.get(ThemeToken), ...this.theme });\n if (this.data) next = next.with(DataToken, { ...parent.get(DataToken), ...this.data });\n if (this.seed !== undefined) next = next.with(SeedToken, this.seed);\n return next;\n }\n}\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|