@motionscript/core 0.1.0 → 0.1.1-alpha.1
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 +16 -0
- package/dist/assets/asset-index.d.ts +1 -8
- package/dist/assets/asset-index.d.ts.map +1 -1
- package/dist/assets/asset-index.js +1 -8
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +10 -72
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +3 -29
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts +8 -20
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -20
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +9 -51
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +13 -78
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/record.d.ts +2 -18
- package/dist/assets/record.d.ts.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -18
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +2 -11
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +2 -12
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
- package/dist/attributes/audio/effects/chain.js +1 -7
- package/dist/attributes/audio/effects/chain.js.map +1 -1
- package/dist/attributes/audio/effects/registry.d.ts +3 -18
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
- package/dist/attributes/audio/effects/registry.js +4 -23
- package/dist/attributes/audio/effects/registry.js.map +1 -1
- package/dist/attributes/audio/ramp.d.ts +5 -38
- package/dist/attributes/audio/ramp.d.ts.map +1 -1
- package/dist/attributes/audio/ramp.js +3 -28
- package/dist/attributes/audio/ramp.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +10 -80
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +1 -4
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +2 -12
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +2 -11
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +2 -26
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +1 -9
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +1 -8
- package/dist/attributes/audio/transition.d.ts.map +1 -1
- package/dist/attributes/audio/transition.js.map +1 -1
- package/dist/attributes/layout/alignment.d.ts +6 -38
- package/dist/attributes/layout/alignment.d.ts.map +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +2 -27
- package/dist/attributes/layout/insets.d.ts.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +29 -114
- package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
- package/dist/attributes/layout/matrix2d.js +26 -110
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +3 -25
- package/dist/attributes/layout/size.d.ts.map +1 -1
- package/dist/attributes/layout/size.js +2 -18
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.d.ts +16 -79
- package/dist/attributes/layout/space3d.d.ts.map +1 -1
- package/dist/attributes/layout/space3d.js +17 -81
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/layout/transform3d.d.ts +2 -23
- package/dist/attributes/layout/transform3d.d.ts.map +1 -1
- package/dist/attributes/layout/transform3d.js +1 -7
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/world-transform.d.ts +2 -16
- package/dist/attributes/layout/world-transform.d.ts.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +13 -73
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +9 -40
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +6 -45
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +6 -37
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +11 -83
- package/dist/attributes/render3d/orbit.d.ts.map +1 -1
- package/dist/attributes/render3d/orbit.js +10 -73
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
- package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js +2 -12
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.d.ts +2 -21
- package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corners.js +2 -12
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js +3 -26
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +36 -328
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +24 -242
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
- package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js +6 -33
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +1 -6
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +1 -7
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +0 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +0 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +1 -9
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +0 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +0 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +2 -8
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +0 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +2 -9
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +0 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +1 -5
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +6 -41
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +7 -45
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +6 -30
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
- package/dist/attributes/shape/effects/spec.js +3 -9
- package/dist/attributes/shape/effects/spec.js.map +1 -1
- package/dist/attributes/shape/fill/blend.d.ts +1 -17
- package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
- package/dist/attributes/shape/fill/blend.js +2 -15
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.d.ts +17 -125
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +22 -109
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.d.ts +10 -35
- package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
- package/dist/attributes/shape/fill/coerce.js +12 -47
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +15 -91
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.js +2 -13
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
- package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.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 +5 -28
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
- package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js +2 -8
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +6 -23
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
- package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +5 -17
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
- package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +12 -50
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +2 -13
- package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
- package/dist/attributes/shape/fill/lerp.js +2 -9
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
- package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js +8 -35
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +2 -26
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +5 -40
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.d.ts +6 -30
- package/dist/attributes/shape/fill/union.d.ts.map +1 -1
- package/dist/attributes/shape/fill/union.js +1 -9
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +15 -168
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +8 -132
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
- package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
- package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -6
- package/dist/attributes/shape/filters/index.d.ts.map +1 -1
- package/dist/attributes/shape/filters/index.js +0 -2
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +5 -35
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +7 -50
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +10 -51
- 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 +18 -106
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +15 -124
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.d.ts +6 -54
- package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
- package/dist/attributes/shape/path/bezier.js +10 -98
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.d.ts +1 -11
- package/dist/attributes/shape/path/index.d.ts.map +1 -1
- package/dist/attributes/shape/path/index.js +1 -11
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.d.ts +5 -41
- package/dist/attributes/shape/path/measure.d.ts.map +1 -1
- package/dist/attributes/shape/path/measure.js +8 -57
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts +4 -41
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +17 -117
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.d.ts +5 -19
- package/dist/attributes/shape/path/ops.d.ts.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.d.ts +10 -67
- package/dist/attributes/shape/path/types.d.ts.map +1 -1
- package/dist/attributes/shape/path/types.js +0 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.d.ts +9 -63
- package/dist/attributes/shape/path/walk.d.ts.map +1 -1
- package/dist/attributes/shape/path/walk.js +21 -100
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +2 -14
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/language.js +1 -8
- package/dist/attributes/shape/shaders/language.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.d.ts +13 -78
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +1 -10
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -28
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
- package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js +0 -3
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +0 -6
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.d.ts +1 -8
- package/dist/attributes/shared/operators.d.ts.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.d.ts +1 -11
- package/dist/attributes/text/index.d.ts.map +1 -1
- package/dist/attributes/text/index.js +1 -11
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +4 -30
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +7 -23
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.d.ts +5 -28
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-5GLXFSCC.js +13 -0
- package/dist/browser/chunks/chunk-5GLXFSCC.js.map +7 -0
- package/dist/browser/chunks/{chunk-CCGVIR4F.js → chunk-5TDMGUXQ.js} +3 -3
- package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
- package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
- package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js +6 -0
- package/dist/browser/chunks/chunk-MNMIIGNE.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +3 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +3 -10
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/geometry/geometry.d.ts +15 -62
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
- package/dist/components/builtins/geometry/geometry.js.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
- package/dist/components/builtins/geometry/shape-outline.js +29 -168
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
- package/dist/components/builtins/layout/layout.d.ts +1 -14
- package/dist/components/builtins/layout/layout.d.ts.map +1 -1
- package/dist/components/builtins/layout/layout.js.map +1 -1
- package/dist/components/builtins/media/media.d.ts +11 -51
- package/dist/components/builtins/media/media.d.ts.map +1 -1
- package/dist/components/builtins/media/media.js +3 -7
- package/dist/components/builtins/media/media.js.map +1 -1
- package/dist/components/builtins/text/number-format.d.ts +14 -47
- package/dist/components/builtins/text/number-format.d.ts.map +1 -1
- package/dist/components/builtins/text/number-format.js +19 -69
- package/dist/components/builtins/text/number-format.js.map +1 -1
- package/dist/components/builtins/text/number-pattern.d.ts +3 -37
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
- package/dist/components/builtins/text/number-pattern.js +6 -48
- package/dist/components/builtins/text/number-pattern.js.map +1 -1
- package/dist/components/builtins/text/text-defaults.d.ts +7 -25
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
- package/dist/components/builtins/text/text-defaults.js +7 -25
- package/dist/components/builtins/text/text-defaults.js.map +1 -1
- package/dist/components/builtins/text/text-layout.d.ts +2 -11
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
- package/dist/components/builtins/text/text-layout.js +7 -22
- package/dist/components/builtins/text/text-layout.js.map +1 -1
- package/dist/components/builtins/text/text.d.ts +8 -46
- package/dist/components/builtins/text/text.d.ts.map +1 -1
- package/dist/components/builtins/text/text.js.map +1 -1
- package/dist/components/builtins/three/canvas3d.d.ts +6 -51
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
- package/dist/components/builtins/three/canvas3d.js.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
- package/dist/components/builtins/three/grid-geometry3d.js +8 -46
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
- package/dist/components/builtins/three/three.d.ts +22 -117
- package/dist/components/builtins/three/three.d.ts.map +1 -1
- package/dist/components/builtins/three/three.js +5 -17
- package/dist/components/builtins/three/three.js.map +1 -1
- package/dist/components/factory/api.d.ts.map +1 -1
- package/dist/components/factory/api.js.map +1 -1
- package/dist/components/factory/style.d.ts +38 -0
- package/dist/components/factory/style.d.ts.map +1 -0
- package/dist/components/factory/style.js +104 -0
- package/dist/components/factory/style.js.map +1 -0
- package/dist/components/factory/types.d.ts +9 -0
- package/dist/components/factory/types.d.ts.map +1 -1
- package/dist/components/factory/types.js +11 -0
- package/dist/components/factory/types.js.map +1 -1
- package/dist/components/factory/views.d.ts.map +1 -1
- package/dist/components/factory/views.js +0 -2
- package/dist/components/factory/views.js.map +1 -1
- package/dist/components/trees/2d/group-bounds.d.ts +12 -41
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
- package/dist/components/trees/2d/group-bounds.js +3 -22
- package/dist/components/trees/2d/group-bounds.js.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
- package/dist/components/trees/2d/node-lifecycle.js +35 -127
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
- package/dist/components/trees/2d/node-motion.d.ts +4 -36
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
- package/dist/components/trees/2d/node-motion.js +3 -31
- package/dist/components/trees/2d/node-motion.js.map +1 -1
- package/dist/components/trees/2d/node-render.d.ts +3 -20
- package/dist/components/trees/2d/node-render.d.ts.map +1 -1
- package/dist/components/trees/2d/node-render.js +4 -23
- package/dist/components/trees/2d/node-render.js.map +1 -1
- package/dist/components/trees/2d/node-space.d.ts +4 -23
- package/dist/components/trees/2d/node-space.d.ts.map +1 -1
- package/dist/components/trees/2d/node-space.js +3 -17
- package/dist/components/trees/2d/node-space.js.map +1 -1
- package/dist/components/trees/2d/node-transform.d.ts +4 -33
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
- package/dist/components/trees/2d/node-transform.js +4 -33
- package/dist/components/trees/2d/node-transform.js.map +1 -1
- package/dist/components/trees/2d/node2d.d.ts +112 -622
- package/dist/components/trees/2d/node2d.d.ts.map +1 -1
- package/dist/components/trees/2d/node2d.js +131 -605
- package/dist/components/trees/2d/node2d.js.map +1 -1
- package/dist/components/trees/audio/node-audio.d.ts +17 -65
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
- package/dist/components/trees/audio/node-audio.js +18 -68
- package/dist/components/trees/audio/node-audio.js.map +1 -1
- package/dist/components/trees/node/node-editor-state.d.ts +5 -45
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
- package/dist/components/trees/node/node-editor-state.js +1 -13
- package/dist/components/trees/node/node-editor-state.js.map +1 -1
- package/dist/components/trees/node/node-reactive.d.ts +6 -53
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
- package/dist/components/trees/node/node-reactive.js +4 -33
- package/dist/components/trees/node/node-reactive.js.map +1 -1
- package/dist/components/trees/node/node-time.d.ts +2 -15
- package/dist/components/trees/node/node-time.d.ts.map +1 -1
- package/dist/components/trees/node/node-time.js.map +1 -1
- package/dist/components/trees/node/node-walk.d.ts +7 -32
- package/dist/components/trees/node/node-walk.d.ts.map +1 -1
- package/dist/components/trees/node/node-walk.js +7 -32
- package/dist/components/trees/node/node-walk.js.map +1 -1
- package/dist/components/trees/node/node.d.ts +43 -248
- package/dist/components/trees/node/node.d.ts.map +1 -1
- package/dist/components/trees/node/node.js +51 -229
- package/dist/components/trees/node/node.js.map +1 -1
- package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
- package/dist/components/trees/root/canvas2d-node.js +7 -47
- package/dist/components/trees/root/canvas2d-node.js.map +1 -1
- package/dist/components/trees/three/node3d.d.ts +24 -112
- package/dist/components/trees/three/node3d.d.ts.map +1 -1
- package/dist/components/trees/three/node3d.js +22 -104
- package/dist/components/trees/three/node3d.js.map +1 -1
- package/dist/document/audio.d.ts +9 -21
- package/dist/document/audio.d.ts.map +1 -1
- package/dist/document/audio.js +13 -28
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts +3 -9
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +43 -89
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -37
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +22 -39
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +9 -43
- package/dist/document/deny-globals.d.ts.map +1 -1
- package/dist/document/deny-globals.js +18 -58
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.d.ts +6 -16
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +5 -11
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +5 -13
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js +0 -2
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts +2 -2
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -18
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.d.ts +11 -41
- package/dist/document/expression/index.d.ts.map +1 -1
- package/dist/document/expression/index.js +11 -41
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.d.ts +3 -12
- package/dist/document/expression/ops.d.ts.map +1 -1
- package/dist/document/expression/ops.js +4 -20
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts +4 -14
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +34 -55
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +2 -8
- package/dist/document/expression/refs.d.ts.map +1 -1
- package/dist/document/expression/refs.js +2 -6
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.d.ts +18 -63
- package/dist/document/expression/types.d.ts.map +1 -1
- package/dist/document/expression/types.js +4 -15
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts +6 -20
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +18 -44
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.js +2 -3
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +7 -22
- package/dist/document/migrate.d.ts.map +1 -1
- package/dist/document/migrate.js +44 -15
- package/dist/document/migrate.js.map +1 -1
- package/dist/document/missing-node.d.ts +4 -11
- package/dist/document/missing-node.d.ts.map +1 -1
- package/dist/document/missing-node.js +2 -5
- package/dist/document/missing-node.js.map +1 -1
- package/dist/document/node-decorator.d.ts +12 -53
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +16 -57
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +25 -62
- 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 +18 -41
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js +4 -11
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +19 -52
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +2 -6
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +10 -20
- package/dist/document/prop-evolution.d.ts.map +1 -1
- package/dist/document/prop-evolution.js +3 -7
- package/dist/document/prop-evolution.js.map +1 -1
- package/dist/document/registry.d.ts +80 -318
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +43 -147
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +11 -23
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +15 -34
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +6 -15
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +12 -21
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +56 -263
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +71 -275
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +90 -264
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +13 -30
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +10 -40
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +72 -137
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +4 -7
- package/dist/document/vocabulary.d.ts.map +1 -1
- package/dist/document/vocabulary.js +0 -1
- package/dist/document/vocabulary.js.map +1 -1
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/bounds.d.ts +1 -11
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/flex.d.ts +6 -20
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +7 -28
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/ops.d.ts +2 -11
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +2 -22
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.d.ts +11 -55
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +7 -43
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js +4 -29
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +5 -31
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/stepped-clock.d.ts +1 -16
- package/dist/platform/stepped-clock.d.ts.map +1 -1
- package/dist/platform/stepped-clock.js +1 -16
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +8 -68
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +8 -60
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +11 -45
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +10 -37
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.d.ts +4 -14
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/tree.d.ts +6 -35
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js +1 -8
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.d.ts +2 -13
- package/dist/props/host.d.ts.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/layout.d.ts +1 -12
- package/dist/props/layout.d.ts.map +1 -1
- package/dist/props/layout.js +1 -12
- package/dist/props/layout.js.map +1 -1
- package/dist/props/observer.d.ts +1 -7
- package/dist/props/observer.d.ts.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.d.ts +6 -19
- package/dist/props/slot.d.ts.map +1 -1
- package/dist/props/slot.js +5 -14
- package/dist/props/slot.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +8 -68
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +8 -69
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.d.ts +2 -16
- package/dist/render/clip-contains.d.ts.map +1 -1
- package/dist/render/clip-contains.js +21 -82
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +7 -25
- package/dist/render/clip.d.ts.map +1 -1
- package/dist/render/clip.js +5 -17
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.d.ts.map +1 -1
- package/dist/render/descriptors/ellipse.js +0 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/line.d.ts.map +1 -1
- package/dist/render/descriptors/line.js +0 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.d.ts +4 -32
- package/dist/render/descriptors/path-builder.d.ts.map +1 -1
- package/dist/render/descriptors/path-builder.js +3 -25
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.d.ts +1 -11
- package/dist/render/descriptors/path.d.ts.map +1 -1
- package/dist/render/descriptors/path.js +0 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.d.ts.map +1 -1
- package/dist/render/descriptors/polygon.js +0 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.d.ts.map +1 -1
- package/dist/render/descriptors/polygram.js +0 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.d.ts.map +1 -1
- package/dist/render/descriptors/rect.js +0 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.d.ts.map +1 -1
- package/dist/render/descriptors/richtext.js +0 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +17 -77
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js +13 -47
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +15 -94
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +8 -50
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +5 -16
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js +1 -17
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +24 -116
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +23 -108
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/measure-context.d.ts +5 -29
- package/dist/render/measure-context.d.ts.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.d.ts +2 -20
- package/dist/render/null-render-context.d.ts.map +1 -1
- package/dist/render/null-render-context.js +2 -20
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +52 -208
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.d.ts +2 -19
- package/dist/render/surface.d.ts.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.d.ts +1 -17
- package/dist/render/text-defaults.d.ts.map +1 -1
- package/dist/render/text-defaults.js +6 -40
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.d.ts +12 -55
- package/dist/render/text-layout.d.ts.map +1 -1
- package/dist/render/text-layout.js +2 -16
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts +10 -32
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +2 -12
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.d.ts +8 -35
- package/dist/render3d/builders.d.ts.map +1 -1
- package/dist/render3d/builders.js +8 -35
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +10 -57
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +4 -26
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +7 -45
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +15 -85
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +18 -106
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js +2 -20
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +29 -133
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +23 -110
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -16
- package/dist/render3d/index.d.ts.map +1 -1
- package/dist/render3d/index.js +1 -16
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts.map +1 -1
- package/dist/render3d/inert.js +1 -14
- package/dist/render3d/inert.js.map +1 -1
- package/dist/render3d/light.d.ts +3 -26
- package/dist/render3d/light.d.ts.map +1 -1
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +13 -87
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js +2 -16
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.d.ts +14 -68
- package/dist/render3d/matrix4.d.ts.map +1 -1
- package/dist/render3d/matrix4.js +11 -60
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.d.ts +13 -51
- package/dist/render3d/render-context3d.d.ts.map +1 -1
- package/dist/render3d/render-context3d.js +9 -21
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.d.ts +9 -53
- package/dist/render3d/resources.d.ts.map +1 -1
- package/dist/render3d/resources.js +8 -48
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.d.ts +7 -21
- package/dist/render3d/rounded-box.d.ts.map +1 -1
- package/dist/render3d/rounded-box.js +7 -46
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +20 -78
- 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 -53
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +12 -59
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.d.ts +2 -25
- package/dist/render3d/segments.d.ts.map +1 -1
- package/dist/render3d/segments.js +1 -11
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +25 -112
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +3 -27
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.d.ts +2 -19
- package/dist/render3d/tracking.d.ts.map +1 -1
- package/dist/render3d/tracking.js +2 -19
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +14 -60
- package/dist/render3d/transform.d.ts.map +1 -1
- package/dist/render3d/transform.js +0 -2
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +6 -48
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +4 -38
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +3 -27
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -33
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +34 -20
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +127 -31
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +14 -53
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js +6 -27
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts +7 -26
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +6 -18
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -2
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -2
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.d.ts +3 -9
- package/dist/runtime/builtin-context.d.ts.map +1 -1
- package/dist/runtime/builtin-context.js +3 -9
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +12 -39
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +21 -45
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +26 -68
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +47 -81
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +31 -85
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +16 -49
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +4 -15
- package/dist/runtime/frame-time.d.ts.map +1 -1
- package/dist/runtime/frame-time.js +5 -12
- package/dist/runtime/frame-time.js.map +1 -1
- package/dist/runtime/index.d.ts +0 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +0 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +59 -139
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +87 -157
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +39 -96
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +98 -141
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts +8 -17
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +7 -16
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +78 -207
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +111 -226
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.d.ts +6 -14
- package/dist/runtime/playback.d.ts.map +1 -1
- package/dist/runtime/playback.js +6 -14
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/project-assets.d.ts +6 -14
- package/dist/runtime/project-assets.d.ts.map +1 -1
- package/dist/runtime/project-assets.js +7 -16
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +22 -45
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +26 -46
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.d.ts +4 -10
- package/dist/runtime/settle.d.ts.map +1 -1
- package/dist/runtime/settle.js +4 -10
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +15 -37
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +27 -44
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +18 -47
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +13 -27
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -7
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +30 -138
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +6 -26
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +1 -6
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +6 -53
- package/dist/tween/command.d.ts.map +1 -1
- package/dist/tween/command.js +5 -40
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/curve.d.ts +2 -17
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +1 -6
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +0 -11
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +0 -23
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +2 -18
- package/dist/tween/ease/spec.d.ts.map +1 -1
- package/dist/tween/ease/spec.js.map +1 -1
- package/dist/tween/inert.d.ts +1 -14
- package/dist/tween/inert.d.ts.map +1 -1
- package/dist/tween/inert.js +1 -14
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.d.ts +2 -26
- package/dist/tween/lerp.d.ts.map +1 -1
- package/dist/tween/lerp.js +2 -26
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.d.ts +9 -50
- package/dist/tween/loop.d.ts.map +1 -1
- package/dist/tween/loop.js +6 -31
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +2 -30
- package/dist/tween/prepare.d.ts.map +1 -1
- package/dist/tween/prepare.js +2 -30
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/stepper.d.ts +4 -25
- package/dist/tween/stepper.d.ts.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.d.ts +1 -8
- package/dist/tween/to-command.d.ts.map +1 -1
- package/dist/tween/to-command.js +2 -25
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/context.d.ts +4 -29
- package/dist/util/context.d.ts.map +1 -1
- package/dist/util/context.js +3 -15
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.d.ts +4 -29
- package/dist/util/csv.d.ts.map +1 -1
- package/dist/util/csv.js +3 -22
- package/dist/util/csv.js.map +1 -1
- package/dist/util/metrics.d.ts +2 -26
- package/dist/util/metrics.d.ts.map +1 -1
- package/dist/util/metrics.js +2 -26
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.d.ts +20 -87
- package/dist/util/random.d.ts.map +1 -1
- package/dist/util/random.js +20 -87
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.d.ts +6 -35
- package/dist/util/reference.d.ts.map +1 -1
- package/dist/util/reference.js +1 -4
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.d.ts +6 -27
- package/dist/util/scheduler.d.ts.map +1 -1
- package/dist/util/scheduler.js +8 -35
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
- package/dist/browser/chunks/chunk-CCGVIR4F.js.map +0 -7
- package/dist/browser/chunks/chunk-N4WSN5WY.js +0 -13
- package/dist/browser/chunks/chunk-N4WSN5WY.js.map +0 -7
- package/dist/browser/chunks/chunk-WZSI3GSK.js +0 -6
- package/dist/browser/chunks/chunk-WZSI3GSK.js.map +0 -7
- package/dist/renamed-scene-names.d.ts +0 -17
- package/dist/renamed-scene-names.d.ts.map +0 -1
- package/dist/renamed-scene-names.js +0 -9
- package/dist/renamed-scene-names.js.map +0 -1
- package/dist/runtime/precompisition.d.ts +0 -24
- package/dist/runtime/precompisition.d.ts.map +0 -1
- package/dist/runtime/precompisition.js +0 -7
- package/dist/runtime/precompisition.js.map +0 -1
|
@@ -6,17 +6,20 @@ import { DENIED_GLOBALS } from "./deny-globals.js";
|
|
|
6
6
|
import { getNodeDescriptor } from "./node-decorator.js";
|
|
7
7
|
import { applyPropEvolution, propEvolutionOf } from "./prop-evolution.js";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* name comes first; the two after it are the package's earlier unscoped names,
|
|
12
|
-
* kept so a script authored under either still compiles.
|
|
9
|
+
* Resolve to the host's sdk barrel. The published name comes first; the two after it are earlier unscoped
|
|
10
|
+
* names, kept so older scripts still compile.
|
|
13
11
|
*/
|
|
14
12
|
const SDK_SPECIFIERS = ["@motionscript/sdk", "motionscript", "motion-script"];
|
|
15
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* An instance, not module-scope tables: what a document can name is a property of the engine opening it, so
|
|
15
|
+
* two engines in one process disagree freely.
|
|
16
|
+
*
|
|
17
|
+
* Commands are per node type (a method on a class); only those that must resolve without a node
|
|
18
|
+
* (variable-scoped, generic prop writers) sit in a table of their own.
|
|
19
|
+
*/
|
|
16
20
|
export class Registry {
|
|
17
21
|
/** Ceiling, so an import cannot evict a workspace's own shaders by volume. */
|
|
18
22
|
static MAX_SHADERS = 512;
|
|
19
|
-
/** See {@link RegistryOptions.strict}. */
|
|
20
23
|
strict;
|
|
21
24
|
constructor(options = {}) {
|
|
22
25
|
this._dynamicNodes = options.dynamicNodes;
|
|
@@ -84,17 +87,9 @@ export class Registry {
|
|
|
84
87
|
return this;
|
|
85
88
|
}
|
|
86
89
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* whose `key` supplies the registry key, exactly as {@link addNode}
|
|
91
|
-
* already reads it off a statically-imported one. There is no separate
|
|
92
|
-
* `key` parameter: one way to name a dynamic node's key, not two that
|
|
93
|
-
* could disagree.
|
|
94
|
-
*
|
|
95
|
-
* Requires `dynamicNodes` to have been passed to the constructor — see
|
|
96
|
-
* {@link DynamicNodeConfig}. `core` never compiles anything itself; this
|
|
97
|
-
* only calls the host-supplied `compile` and links its result.
|
|
90
|
+
* The script must `export default` a component whose `key` supplies the registry key, as {@link addNode} reads
|
|
91
|
+
* it: one way to name a dynamic node's key. Requires `dynamicNodes`; `core` only calls the host-supplied
|
|
92
|
+
* `compile` and links the result.
|
|
98
93
|
*/
|
|
99
94
|
async addNodeFromSource(source, options) {
|
|
100
95
|
if (!this._dynamicNodes) {
|
|
@@ -105,41 +100,25 @@ export class Registry {
|
|
|
105
100
|
this.addNode(ctor, options);
|
|
106
101
|
return ctor;
|
|
107
102
|
}
|
|
108
|
-
/** Everything registered under `key`, or `undefined`. */
|
|
109
103
|
node(key) {
|
|
110
104
|
return this._nodes.get(key);
|
|
111
105
|
}
|
|
112
|
-
/** Whether a document naming `key` can be compiled against this registry. */
|
|
113
106
|
hasNode(key) {
|
|
114
107
|
return this._nodes.has(key);
|
|
115
108
|
}
|
|
116
|
-
/** Every registered node key, for a host offering a palette. Sorted, so the order is stable. */
|
|
117
109
|
nodeKeys() {
|
|
118
110
|
return [...this._nodes.keys()].sort();
|
|
119
111
|
}
|
|
120
|
-
/** What `key` declares about itself, or `undefined` if it is not registered. */
|
|
121
112
|
describe(key) {
|
|
122
113
|
return this._nodes.get(key)?.descriptor;
|
|
123
114
|
}
|
|
124
115
|
/**
|
|
125
|
-
*
|
|
116
|
+
* The props pass through the type's evolution first (`migrateNodeProps`).
|
|
126
117
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* expression out of a constructor: an expression-bound prop is left out of
|
|
132
|
-
* what is passed here and written afterwards with `set()`. Constructors read
|
|
133
|
-
* their raw props to decide things like a default size, and a `() => number`
|
|
134
|
-
* is not an answer to that question. The spec's `id` outranks both, so
|
|
135
|
-
* {@link Node.id} is the document's own identity rather than a per-instance
|
|
136
|
-
* UUID — without it a host could never resolve a node it addressed by id.
|
|
137
|
-
*
|
|
138
|
-
* `key` rides along the same way, and only when the row carries one:
|
|
139
|
-
* `applyEditorStates` keys the whole editor-state record on {@link Node.key},
|
|
140
|
-
* so a row whose key never reached the node is a node a host cannot hide or
|
|
141
|
-
* lock — and overwriting one passed in `props` with an absent row-level key
|
|
142
|
-
* would take that away from a caller who had it working.
|
|
118
|
+
* `props` overrides the spec's own so the timeline can leave expression-bound props out of the constructor,
|
|
119
|
+
* which reads raw props for defaults like size, and `set()` them after. The spec's `id` outranks both, so
|
|
120
|
+
* {@link Node.id} is the document's identity. `key` rides along only when the row has one: `applyEditorStates`
|
|
121
|
+
* keys on {@link Node.key}, and an absent row key must not overwrite one passed in `props`.
|
|
143
122
|
*/
|
|
144
123
|
instantiate(spec, props) {
|
|
145
124
|
const record = this._nodes.get(spec.type);
|
|
@@ -155,11 +134,7 @@ export class Registry {
|
|
|
155
134
|
...(spec.key !== undefined && { key: spec.key }),
|
|
156
135
|
});
|
|
157
136
|
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Register a command that resolves **without** a node — see
|
|
161
|
-
* {@link CommandTypeEntry}. Same uniqueness rule as {@link addNode}.
|
|
162
|
-
*/
|
|
137
|
+
/** Same uniqueness rule as {@link addNode}. */
|
|
163
138
|
addCommand(key, factory, options) {
|
|
164
139
|
if (this._claimed(key, factory))
|
|
165
140
|
return this;
|
|
@@ -174,12 +149,8 @@ export class Registry {
|
|
|
174
149
|
return this;
|
|
175
150
|
}
|
|
176
151
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* The seam a host reaches for to add its own — a spring, a wiggle, a
|
|
180
|
-
* sample-and-hold — without touching the timeline. `CommandSpec.targetId`
|
|
181
|
-
* names the variable, and the {@link Command} that comes back must be a pure
|
|
182
|
-
* function of `t` like any other.
|
|
152
|
+
* A host's seam for its own variable commands (a spring, a wiggle); the returned {@link Command} must be a
|
|
153
|
+
* pure function of `t`.
|
|
183
154
|
*/
|
|
184
155
|
addVariableCommand(key, factory) {
|
|
185
156
|
if (this._claimed(key, factory))
|
|
@@ -187,17 +158,12 @@ export class Registry {
|
|
|
187
158
|
this._commands.set(key, { key, scope: "variable", factory });
|
|
188
159
|
return this;
|
|
189
160
|
}
|
|
190
|
-
/** The node-less command registered under `key`, or `undefined`. */
|
|
191
161
|
command(key) {
|
|
192
162
|
return this._commands.get(key);
|
|
193
163
|
}
|
|
194
164
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* Dispatches by **calling the named method**, never by testing the target
|
|
199
|
-
* against a class: a forked component is a different class carrying the same
|
|
200
|
-
* source, and an `instanceof` against the original is false for it.
|
|
165
|
+
* Dispatches by calling the named method, never by testing against a class: a forked component is a different
|
|
166
|
+
* class carrying the same source, so `instanceof` against the original is false.
|
|
201
167
|
*/
|
|
202
168
|
nodeCommand(nodeTypeKey, commandKey) {
|
|
203
169
|
const record = this._nodes.get(nodeTypeKey);
|
|
@@ -218,10 +184,8 @@ export class Registry {
|
|
|
218
184
|
};
|
|
219
185
|
}
|
|
220
186
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* the method it runs is one the type lacks. What a host offers a
|
|
224
|
-
* node is its table and the node-less commands it takes.
|
|
187
|
+
* A node takes what its own table publishes, plus node-less commands that act on a node (`to`, `fillTo`)
|
|
188
|
+
* unless the method they run is one the type lacks.
|
|
225
189
|
*/
|
|
226
190
|
takesCommand(nodeTypeKey, commandKey) {
|
|
227
191
|
const record = this._nodes.get(nodeTypeKey);
|
|
@@ -236,25 +200,13 @@ export class Registry {
|
|
|
236
200
|
return true;
|
|
237
201
|
return typeof record.ctor.prototype[global.method] === "function";
|
|
238
202
|
}
|
|
239
|
-
/**
|
|
240
|
-
* Every command key available. With a node type, that type's own table;
|
|
241
|
-
* without one, the node-less commands. Sorted, so the order is stable.
|
|
242
|
-
*/
|
|
243
203
|
commandKeys(nodeTypeKey) {
|
|
244
204
|
const keys = nodeTypeKey === undefined
|
|
245
205
|
? this._commands.keys()
|
|
246
206
|
: this._nodes.get(nodeTypeKey)?.commands.keys() ?? [];
|
|
247
207
|
return [...keys].sort();
|
|
248
208
|
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Register an interpolation under a document key.
|
|
252
|
-
*
|
|
253
|
-
* The **code** half of a variable, exactly as a node class is the code half
|
|
254
|
-
* of a node: `{"lerp": "color"}` in a document is a string, and something
|
|
255
|
-
* has to turn it into the function that blends two colours. Same uniqueness
|
|
256
|
-
* rule as {@link addNode}.
|
|
257
|
-
*/
|
|
209
|
+
/** Same uniqueness rule as {@link addNode}. */
|
|
258
210
|
addLerp(key, lerp) {
|
|
259
211
|
const existing = this._lerps.get(key);
|
|
260
212
|
if (existing && existing !== lerp) {
|
|
@@ -263,21 +215,15 @@ export class Registry {
|
|
|
263
215
|
this._lerps.set(key, lerp);
|
|
264
216
|
return this;
|
|
265
217
|
}
|
|
266
|
-
/** The lerp registered under `key`, or `undefined`. */
|
|
267
218
|
lerp(key) {
|
|
268
219
|
return this._lerps.get(key);
|
|
269
220
|
}
|
|
270
|
-
/** Every registered lerp key. Sorted, so the order is stable. */
|
|
271
221
|
lerpKeys() {
|
|
272
222
|
return [...this._lerps.keys()].sort();
|
|
273
223
|
}
|
|
274
224
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* A numeric variable with no declared lerp interpolates; anything else snaps
|
|
278
|
-
* at the end. That is less a fallback than the only honest default —
|
|
279
|
-
* guessing a structural lerp off one sample would blend two objects that
|
|
280
|
-
* merely share an `x` key into something neither of them is.
|
|
225
|
+
* A numeric variable with no declared lerp interpolates; anything else snaps at the end. Guessing a structural
|
|
226
|
+
* lerp off one sample would blend objects that merely share an `x` key.
|
|
281
227
|
*/
|
|
282
228
|
requireLerp(key, value, where) {
|
|
283
229
|
const resolved = key ?? (typeof value === "number" ? "number" : "step");
|
|
@@ -288,11 +234,7 @@ export class Registry {
|
|
|
288
234
|
}
|
|
289
235
|
return lerp;
|
|
290
236
|
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Register a custom ease under a document key, referenced as
|
|
294
|
-
* `{ kind: "custom", args: key }`. Same uniqueness rule as {@link addNode}.
|
|
295
|
-
*/
|
|
237
|
+
/** Referenced as `{ kind: "custom", args: key }`. Same uniqueness rule as {@link addNode}. */
|
|
296
238
|
addEase(key, ease) {
|
|
297
239
|
const existing = this._eases.get(key);
|
|
298
240
|
if (existing && existing !== ease) {
|
|
@@ -301,33 +243,19 @@ export class Registry {
|
|
|
301
243
|
this._eases.set(key, ease);
|
|
302
244
|
return this;
|
|
303
245
|
}
|
|
304
|
-
/** The ease registered under `key`, or `undefined`. */
|
|
305
246
|
ease(key) {
|
|
306
247
|
return this._eases.get(key);
|
|
307
248
|
}
|
|
308
|
-
/** Every registered ease key. Sorted, so the order is stable. */
|
|
309
249
|
easeKeys() {
|
|
310
250
|
return [...this._eases.keys()].sort();
|
|
311
251
|
}
|
|
312
|
-
// ─── Shaders ─────────────────────────────────────────────────────────────
|
|
313
252
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* The key is an argument rather than a field of the pack — the same shape
|
|
317
|
-
* {@link addNode} has — so one file can be registered under whatever name a
|
|
318
|
-
* project wants and stays portable between them. A pack's own `id`, when it
|
|
319
|
-
* has one, is provenance.
|
|
253
|
+
* The key is an argument, not a pack field (as in {@link addNode}), so a file stays portable between projects;
|
|
254
|
+
* a pack's own `id` is provenance. The pack is normalised on the way in.
|
|
320
255
|
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* file* imported twice, which produces two structurally identical objects,
|
|
325
|
-
* and throwing on that would make the uniqueness rule fire on the one case
|
|
326
|
-
* it is meant to tolerate.
|
|
327
|
-
*
|
|
328
|
-
* Pass `{ replace: true }` to overwrite a key with a genuinely different
|
|
329
|
-
* pack — the same opt-in `addNode` takes, for the same reason: a live-edited
|
|
330
|
-
* shader re-registering under its existing key.
|
|
256
|
+
* Re-registering an equal pack is a no-op: the same file imported twice yields two equal objects, and throwing
|
|
257
|
+
* there would defeat the uniqueness rule. `replace: true` overwrites with a different pack, for a live-edited
|
|
258
|
+
* shader.
|
|
331
259
|
*/
|
|
332
260
|
addShader(key, pack, options) {
|
|
333
261
|
const normalized = normalizeShaderPack(pack);
|
|
@@ -349,31 +277,24 @@ export class Registry {
|
|
|
349
277
|
this._shaders.set(key, normalized);
|
|
350
278
|
return normalized;
|
|
351
279
|
}
|
|
352
|
-
/** The pack registered under `key`, or `undefined`. */
|
|
353
280
|
shader(key) {
|
|
354
281
|
return this._shaders.get(key);
|
|
355
282
|
}
|
|
356
283
|
/**
|
|
357
|
-
* The
|
|
358
|
-
*
|
|
359
|
-
* The typed accessors are what actually deliver the compile error the union
|
|
360
|
-
* promises: {@link shader} hands back `Shader`, and a call site that never
|
|
361
|
-
* narrows could still pass an effect pack to `Fills.shader`.
|
|
284
|
+
* The typed accessors deliver the compile error the union promises: {@link shader} returns `Shader`, and an
|
|
285
|
+
* unnarrowed call site could pass an effect pack to `Fills.shader`.
|
|
362
286
|
*/
|
|
363
287
|
fillShader(key) {
|
|
364
288
|
const pack = this._shaders.get(key);
|
|
365
289
|
return pack?.scope === "fill" ? pack : undefined;
|
|
366
290
|
}
|
|
367
|
-
/** The pack registered under `key`, if it is an **effect** shader. */
|
|
368
291
|
effectShader(key) {
|
|
369
292
|
const pack = this._shaders.get(key);
|
|
370
293
|
return pack?.scope === "effect" ? pack : undefined;
|
|
371
294
|
}
|
|
372
|
-
/** Every registered shader key, for a host offering a picker. Sorted. */
|
|
373
295
|
shaderKeys() {
|
|
374
296
|
return [...this._shaders.keys()].sort();
|
|
375
297
|
}
|
|
376
|
-
// ─── Internals ───────────────────────────────────────────────────────────
|
|
377
298
|
_nodes = new Map();
|
|
378
299
|
_commands = new Map();
|
|
379
300
|
_lerps = new Map();
|
|
@@ -381,16 +302,9 @@ export class Registry {
|
|
|
381
302
|
_shaders = new Map();
|
|
382
303
|
_dynamicNodes;
|
|
383
304
|
/**
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
* `new Function` in-realm, never a blob module or a worker — see
|
|
388
|
-
* {@link DynamicNodeConfig} and `deny-globals.ts` for why. `require()` is
|
|
389
|
-
* locked to exactly `"@motionscript/sdk"` (plus the earlier unscoped `"motionscript"` and `"motion-script"`
|
|
390
|
-
* spellings, so a script written under either name still compiles) and
|
|
391
|
-
* the host's `modules`, own keys only so `require("constructor")` cannot
|
|
392
|
-
* reach `Object`. No relative
|
|
393
|
-
* imports, since a dynamic node is one script, not a package.
|
|
305
|
+
* `new Function` in-realm, never a blob module or a worker (see {@link DynamicNodeConfig} and
|
|
306
|
+
* `deny-globals.ts`). `require()` is locked to the sdk specifiers and the host's `modules`, own keys only so
|
|
307
|
+
* `require("constructor")` cannot reach `Object`. No relative imports: a dynamic node is one script.
|
|
394
308
|
*/
|
|
395
309
|
_evalNodeModule(js) {
|
|
396
310
|
const { sdk, modules } = this._dynamicNodes;
|
|
@@ -416,7 +330,7 @@ export class Registry {
|
|
|
416
330
|
}
|
|
417
331
|
return ctor;
|
|
418
332
|
}
|
|
419
|
-
/**
|
|
333
|
+
/** See {@link addNode} for why. */
|
|
420
334
|
_claimed(key, factory) {
|
|
421
335
|
const existing = this._commands.get(key);
|
|
422
336
|
if (!existing)
|
|
@@ -425,13 +339,7 @@ export class Registry {
|
|
|
425
339
|
return true;
|
|
426
340
|
throw new Error(`Command type "${key}" is already registered to a different factory. Keys must be unique.`);
|
|
427
341
|
}
|
|
428
|
-
/**
|
|
429
|
-
* A class's editable properties, read off its `property` declarations.
|
|
430
|
-
*
|
|
431
|
-
* The whole prototype chain, so a component publishes the box its tree's
|
|
432
|
-
* base declares as well as its own entries — a host editing one edits every
|
|
433
|
-
* control it actually has.
|
|
434
|
-
*/
|
|
342
|
+
/** The whole prototype chain, so a component publishes the box its tree's base declares too. */
|
|
435
343
|
_describeProperties(ctor) {
|
|
436
344
|
const out = {};
|
|
437
345
|
for (const meta of getPropertyMeta(Object.create(ctor.prototype))) {
|
|
@@ -444,7 +352,6 @@ export class Registry {
|
|
|
444
352
|
}
|
|
445
353
|
return out;
|
|
446
354
|
}
|
|
447
|
-
/** A component's `renamed` and `deprecated`, where a host reading the descriptor sees them. */
|
|
448
355
|
_describeEvolution(ctor, descriptor) {
|
|
449
356
|
const evolution = propEvolutionOf(ctor);
|
|
450
357
|
if (!evolution)
|
|
@@ -457,28 +364,18 @@ export class Registry {
|
|
|
457
364
|
const renamed = Object.keys(evolution.renamed).length > 0 ? { renamed: { ...evolution.renamed } } : {};
|
|
458
365
|
return { ...descriptor, ...renamed, properties };
|
|
459
366
|
}
|
|
460
|
-
/**
|
|
461
|
-
* A type's dimension, read off the prototype without constructing one.
|
|
462
|
-
*
|
|
463
|
-
* `Node.dimension` is a getter rather than a field for exactly this reason —
|
|
464
|
-
* it answers from the prototype, before any field initializer has run.
|
|
465
|
-
*/
|
|
367
|
+
/** `Node.dimension` is a getter so it answers from the prototype, before any field initializer has run. */
|
|
466
368
|
_describeDimension(ctor) {
|
|
467
369
|
const dimension = Object.create(ctor.prototype).dimension;
|
|
468
370
|
return typeof dimension === "string" ? dimension : undefined;
|
|
469
371
|
}
|
|
470
|
-
/** The trees a type takes children from, off the prototype as its dimension is. */
|
|
471
372
|
_describeHolds(ctor) {
|
|
472
373
|
const trees = Object.create(ctor.prototype)._childTrees;
|
|
473
374
|
return Array.isArray(trees) ? [...trees] : undefined;
|
|
474
375
|
}
|
|
475
376
|
/**
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* A function default is a *reactive binding*, not a value, so it says nothing
|
|
480
|
-
* about the control; those declare their kind or take "unknown", which a host
|
|
481
|
-
* draws as read-only rather than guessing.
|
|
377
|
+
* A function default is a reactive binding, not a value, so it says nothing about the control; those declare a
|
|
378
|
+
* kind or take "unknown", which a host draws read-only.
|
|
482
379
|
*/
|
|
483
380
|
_inferKind(value) {
|
|
484
381
|
switch (typeof value) {
|
|
@@ -494,7 +391,6 @@ export class Registry {
|
|
|
494
391
|
default: return "unknown";
|
|
495
392
|
}
|
|
496
393
|
}
|
|
497
|
-
/** A command's arguments as descriptors, whichever shorthand they were written in. */
|
|
498
394
|
_describeArgs(args) {
|
|
499
395
|
return (args ?? []).map((arg) => typeof arg === "string" ? { key: arg, kind: "unknown" } : { kind: "unknown", ...arg });
|
|
500
396
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/document/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAuB,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,cAAc,EAA8C,MAAM,2BAA2B,CAAC;AACvG,OAAO,EACH,mBAAmB,GAItB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIvE;;;;;GAKG;AACH,MAAM,cAAc,GAAsB,CAAC,mBAAmB,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;AAmQjG,+BAA+B;AAC/B,MAAM,OAAO,QAAQ;IACjB,8EAA8E;IAC9E,MAAM,CAAU,WAAW,GAAG,GAAG,CAAC;IAElC,0CAA0C;IACjC,MAAM,CAAU;IAEzB,YAAY,UAA2B,EAAE;QACrC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KA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/node/node\";\nimport type { Command, CommandArgs } from \"@/tween/command\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\nimport { getPropertyMeta, type PropertyEditor } from \"@/attributes/properties/decorator\";\nimport { getCommandMeta, type CommandArg, type CommandArgDescriptor } from \"@/tween/command-decorator\";\nimport {\n normalizeShaderPack,\n type EffectShader,\n type FillShader,\n type Shader,\n} from \"@/attributes/shape/shaders/pack\";\nimport { installBuiltins } from \"./builtins\";\nimport { DENIED_GLOBALS } from \"./deny-globals\";\nimport { getNodeDescriptor } from \"./node-decorator\";\nimport { applyPropEvolution, propEvolutionOf } from \"./prop-evolution\";\nimport type { NodePropertyDescriptor, NodeTypeDescriptor } from \"./node-descriptor\";\nimport type { NodeSpec } from \"./types\";\n\n/**\n * The specifiers a dynamic node's `require()` resolves to the host's sdk\n * barrel. The published\n * name comes first; the two after it are the package's earlier unscoped names,\n * kept so a script authored under either still compiles.\n */\nconst SDK_SPECIFIERS: readonly string[] = [\"@motionscript/sdk\", \"motionscript\", \"motion-script\"];\n\n/**\n * The **code** half of the document model, as one object an engine owns.\n *\n * A document names a node type, a command, a lerp and a shader with a string.\n * Something has to turn `\"rect\"` into a class and `\"fillTo\"` into an animation,\n * and that something is deliberately a registry rather than a table in the\n * database: node types are code — a class with `property` declarations, a\n * `renderSelf`, and `command()` methods — and code is versioned with the\n * library, not with the document.\n *\n * **It is an instance, not a module.** Every table here used to be a\n * module-scope `Map` behind a dozen free functions, which made a registration\n * a fact about the *process*: two engines in one process shared one vocabulary,\n * a declared class was registered by the mere act of being imported, whichever\n * host loaded first won a contested key, and a test had to remember to call a\n * `clearRegistries()` that reached into three modules. A registry is now a value\n * with an owner — an `Engine`'s own, reached through `registerNode`/`registerShader`\n * rather than a public `registry` field — so what a document can name is a\n * property of the engine opening it, and two engines disagree about it freely.\n *\n * ```ts\n * const registry = new Registry({ nodes: [Blob], shaders: { swirl: SWIRL } });\n * registry.commandKeys(\"blob\"); // [\"fadeTo\", \"moveTo\", …, \"wobbleTo\"]\n * ```\n *\n * **Commands are per node type, and that is the point.** They used to share one\n * flat table with the node types, which made a command key a global claim: the\n * first package to register `reveal` owned the word, and a second node type\n * wanting it — with different arguments — could not have it. Nothing about a\n * command is global, though: it is a method on a class, dispatched against an\n * instance the document already names. Only the handful that must resolve\n * *without* a node — the variable-scoped ones and the generic prop writers — sit\n * in a table of their own.\n */\n\n/** Constructs a node from its authored props. Every built-in node class matches this. */\nexport type NodeConstructor = new (props?: Record<string, unknown>) => Node;\n\n/** Node types a registry makes available, by the key a document names them with. */\nexport type NodeTypeMap = Record<string, NodeConstructor>;\n\n/** Shader packs a registry makes available, by document key. A pack is plain JSON. */\nexport type ShaderPackMap = Record<string, unknown>;\n\n/**\n * Builds the {@link Command} a `CommandSpec` stands for.\n *\n * Called **once per compile**, in timeline order, with `target` already in the\n * state the previous command left it — that is what fixes the command's `from`\n * value and makes the returned `Command.at(t)` pure thereafter. See\n * `tween/command.ts` and `document/timeline.ts`.\n *\n * @param target The node the command acts on (the scene root for `targetId: null`).\n * @param args The spec's `args`, verbatim.\n * @param duration Seconds, already defaulted by the caller.\n * @param easing Resolved from the spec's `EaseSpec`, or `undefined`.\n */\nexport type CommandFactory = (\n target: Node,\n args: Record<string, unknown>,\n duration: number,\n easing?: EasingFunction,\n) => Command<Record<string, unknown>>;\n\n/**\n * The variable a variable command writes.\n *\n * A handle rather than the cell itself, so a command cannot subscribe to it,\n * rebind it, or hold it past the build that made it — the three ways a command\n * could stop being a pure function of `t`.\n */\nexport interface VariableTarget {\n /** The id an expression names with `[id]`. */\n readonly id: string;\n /** What it holds right now. */\n get(): unknown;\n set(value: unknown): void;\n /**\n * The lerp its `VariableSpec.lerp` resolved to. A command is free to use a\n * different one when its args ask for it — `variableTo` does.\n */\n readonly lerp: VariableLerp;\n}\n\n/**\n * Builds the {@link Command} a variable-scoped `CommandSpec` stands for.\n *\n * Same contract as {@link CommandFactory} — called once per compile, in timeline\n * order, against a variable already holding what its predecessors left — with a\n * {@link VariableTarget} in place of a node.\n */\nexport type VariableCommandFactory = (\n target: VariableTarget,\n args: Record<string, unknown>,\n duration: number,\n easing?: EasingFunction,\n) => Command<Record<string, unknown>>;\n\n/**\n * How a variable's value interpolates between two states.\n *\n * The same shape every `property` tween already has, widened to `unknown`\n * because a variable's type is a fact of the document rather than of a class:\n * one holds a number, the next a colour string, the next a whole fill object.\n */\nexport type VariableLerp = (from: unknown, to: unknown, t: number) => unknown;\n\n/**\n * One command that resolves without a node.\n *\n * `scope` says which table `CommandSpec.targetId` is looked up in, and is what\n * lets a variable command reuse the same field a node command uses instead of\n * inventing a second one every host's timeline would then have to special-case.\n */\nexport type CommandTypeEntry =\n | {\n key: string;\n scope: \"node\";\n factory: CommandFactory;\n /**\n * Its leading parameters, as {@link NodeCommandEntry.args} describes a\n * node command's — declared by the paint commands, which read one key\n * each. Absent for `to`/`set`, whose args *are* the props diff.\n */\n args?: readonly CommandArgDescriptor[];\n /**\n * This command **writes props declaratively**, so an expression in its\n * args compiles to a binding rather than being passed through as a\n * string. `set` is the only built-in that does.\n *\n * A flag rather than a name check, because the distinction is real: `to`\n * tweens *towards* a value and a formula is not a value, so binding one\n * as a tween destination would interpolate towards `NaN` and look like a\n * renderer bug. A command opting in is saying its args reach `set()`.\n */\n binds?: boolean;\n /**\n * The method it runs on its target, where it runs one: the paint\n * commands call the node's own `fillTo`, `strokeTo`, …. A node type\n * without it, or one that withdrew it, does not take the command\n * ({@link Registry.takesCommand}).\n */\n method?: string;\n }\n | {\n key: string;\n scope: \"variable\";\n factory: VariableCommandFactory;\n };\n\n/**\n * One node type's own command table.\n *\n * Built from the class's `command()` methods — the **whole** prototype chain,\n * not just its own — because the table is per type. A `Card` extending `Rect`\n * answers to `fadeTo` for the same reason it answers to `.fadeTo()`: it has the\n * method. There is nothing here for two node types to collide over, so\n * inherited entries can simply be copied into each.\n */\nexport interface NodeTypeRecord {\n /** The document key, matching `NodeSpec.type`. */\n key: string;\n /** The class to construct. */\n ctor: NodeConstructor;\n /** Its commands, by the key a document names them with. */\n commands: ReadonlyMap<string, NodeCommandEntry>;\n /**\n * What the type declares about itself — see {@link NodeTypeDescriptor}.\n *\n * Always present, so a host reads one shape whether the type was registered\n * with a bare key, a full descriptor, or a component.\n */\n descriptor: NodeTypeDescriptor;\n}\n\n/** One command on one node type. */\nexport interface NodeCommandEntry {\n /** The method to call. */\n method: string;\n /**\n * Its leading parameters, from `command({ args })`, always as descriptors.\n *\n * A bare name normalises to `{ key, kind: \"unknown\" }`, so a host reads one\n * shape whether the method bothered to describe its arguments or not.\n */\n args: readonly CommandArgDescriptor[];\n /** Present and true for an entrance (`CommandMeta.entrance`), so a host can offer one when the node is added. */\n entrance?: true;\n}\n\n/**\n * How a registry compiles and links a node authored as a TS source string\n * that default-exports a component, via {@link Registry.addNodeFromSource}.\n *\n * Entirely host-supplied — `core` has no compiler dependency and cannot\n * import the published `@motionscript/sdk` barrel itself (that package\n * depends on `core`, so the reverse direction would be circular).\n */\nexport interface DynamicNodeConfig {\n /**\n * What `require(\"@motionscript/sdk\")` resolves to inside a compiled\n * script — the host's own already-loaded sdk barrel instance. Must be the\n * same module instance the rest of the app uses, or `instanceof` silently\n * fails against it. The earlier unscoped specifiers, `\"motionscript\"` and\n * the dashed `\"motion-script\"`, resolve to the same object, so a node\n * script authored under either name keeps compiling unmodified.\n */\n sdk: Record<string, unknown>;\n /**\n * Further modules a script may `require`, by exact specifier — what a\n * forked component imports beyond the sdk barrel:\n * `@motionscript/sdk/component`, its package's kit. Consulted after the\n * two above, so neither can be shadowed. Each value has to be the host's\n * own loaded instance, for the same `instanceof` reason as `sdk`.\n */\n modules?: Readonly<Record<string, unknown>>;\n /**\n * TS source → JS text (CommonJS). Host-injected, never bundled —\n * `core` has no compiler dependency of its own.\n */\n compile: (source: string) => Promise<string>;\n}\n\n/** What a registry is seeded with, on top of the builtin vocabulary. */\nexport interface RegistryOptions {\n /**\n * Custom node types — components, or explicit keys.\n *\n * An array reads each class's `node()` declaration; a record names the key\n * outright, which is also an assertion that the two agree (a rename on\n * either side throws here rather than surfacing as an unknown type at\n * render).\n */\n nodes?: NodeTypeMap | readonly NodeConstructor[];\n /** Shader packs, by document key. Plain JSON — normalised on the way in. */\n shaders?: ShaderPackMap;\n /** Extra variable interpolations, on top of `number`/`vector2`/`vector3`/`color`/`step`. */\n lerps?: Record<string, VariableLerp>;\n /** Custom eases, referenced from a document as `{ kind: \"custom\", args: key }`. */\n eases?: Record<string, EasingFunction>;\n /** Enables {@link Registry.addNodeFromSource} — see {@link DynamicNodeConfig}. */\n dynamicNodes?: DynamicNodeConfig;\n /**\n * Fail a track's build on a node type or command this registry lacks, as\n * builds did before placeholders. Off, the build stands an inert\n * placeholder in for the node, skips the command, and records each in\n * `buildErrors`. For a render whose output nobody inspects.\n */\n strict?: boolean;\n /**\n * Leave out everything the library itself ships. Only useful to a test\n * asserting on the seeding, or a host building a deliberately tiny\n * vocabulary — a document naming `\"rect\"` will not compile without it.\n */\n builtins?: boolean;\n}\n\n/** See the module docblock. */\nexport class Registry {\n /** Ceiling, so an import cannot evict a workspace's own shaders by volume. */\n static readonly MAX_SHADERS = 512;\n\n /** See {@link RegistryOptions.strict}. */\n readonly strict: boolean;\n\n constructor(options: RegistryOptions = {}) {\n this._dynamicNodes = options.dynamicNodes;\n this.strict = options.strict === true;\n if (options.builtins !== false) installBuiltins(this);\n if (Array.isArray(options.nodes)) {\n for (const ctor of options.nodes) this.addNode(ctor);\n } else {\n for (const [key, ctor] of Object.entries(options.nodes ?? {})) this.addNode(key, ctor);\n }\n for (const [key, lerp] of Object.entries(options.lerps ?? {})) this.addLerp(key, lerp);\n for (const [key, ease] of Object.entries(options.eases ?? {})) this.addEase(key, ease);\n for (const [key, pack] of Object.entries(options.shaders ?? {})) this.addShader(key, pack);\n }\n\n // ─── Node types ──────────────────────────────────────────────────────────\n\n /**\n * Register a node class, with its commands and whatever else it declares.\n *\n * Takes a component (or a class carrying a `node()` declaration) on its own, or a bare key / full\n * {@link NodeTypeDescriptor} plus the class. The descriptor is the code half\n * of what a component package used to restate in a `manifest.json` —\n * carried, never interpreted, so a host has one place to ask and no second\n * file to disagree with the class.\n *\n * The commands come off the class, so `command()` is the only place a\n * node's animations are written down. Nothing is constructed to read them:\n * `command` records onto the prototype, so an object *over* the prototype\n * reaches the whole chain without running a constructor that may expect\n * props, build children, or touch a clock.\n *\n * Re-registering the same class under the same key is a no-op, so a hot\n * reload or a duplicated dependency is harmless. Re-registering a\n * *different* class throws: two classes answering to one key means a\n * document renders differently depending on registration order, which is not\n * a failure anyone would find by looking at the document.\n *\n * Pass `{ replace: true }` to opt out of that throw — the one case it's\n * wrong for is a node whose source has genuinely been edited and\n * recompiled (see {@link addNodeFromSource}), where re-registering under\n * the same key with a new class is the whole point. The default stays a\n * throw; this is deliberately not the common path.\n */\n addNode(ctor: NodeConstructor, options?: { replace?: boolean }): this;\n addNode(type: string | NodeTypeDescriptor, ctor: NodeConstructor, options?: { replace?: boolean }): this;\n addNode(\n type: string | NodeTypeDescriptor | NodeConstructor,\n ctorOrOptions?: NodeConstructor | { replace?: boolean },\n maybeOptions?: { replace?: boolean },\n ): this {\n const isTwoArgForm = typeof ctorOrOptions === \"function\";\n // A component (`component2d(...)`) registers as the node class it generated.\n const given = (isTwoArgForm ? ctorOrOptions : type) as NodeConstructor & { node?: NodeConstructor };\n const cls = typeof given.node === \"function\" ? given.node : given;\n const options = isTwoArgForm ? maybeOptions : ctorOrOptions as { replace?: boolean } | undefined;\n const declared = isTwoArgForm ? type as string | NodeTypeDescriptor : getNodeDescriptor(cls);\n if (declared === undefined) {\n throw new Error(\n `${cls.name || \"The class\"} is no component, so it has no document key. ` +\n `Make it with component2d({ key }), or register it explicitly: addNode(\"myKey\", TheClass).`,\n );\n }\n const descriptor: NodeTypeDescriptor = typeof declared === \"string\" ? { key: declared } : declared;\n const key = descriptor.key;\n\n const existing = this._nodes.get(key);\n if (existing) {\n if (existing.ctor === cls) return this;\n if (!options?.replace) {\n throw new Error(\n `Node type \"${key}\" is already registered to a different class ` +\n `(${existing.ctor.name} vs ${cls.name}). Keys must be unique — a document ` +\n `naming this type would otherwise resolve differently depending on registration order.`,\n );\n }\n }\n\n const commands = new Map<string, NodeCommandEntry>();\n for (const meta of getCommandMeta(Object.create(cls.prototype) as object)) {\n commands.set(meta.key, {\n method: meta.method,\n args: this._describeArgs(meta.args),\n ...(meta.entrance ? { entrance: true as const } : {}),\n });\n }\n\n this._nodes.set(key, {\n key,\n ctor: cls,\n commands,\n // Derived, never declared: see `NodeTypeDescriptor.properties`.\n descriptor: this._describeEvolution(cls, {\n ...descriptor,\n dimension: this._describeDimension(cls),\n holds: this._describeHolds(cls),\n properties: this._describeProperties(cls),\n }),\n });\n return this;\n }\n\n /**\n * Compile a TS source string into a live node type and register it.\n *\n * The script must `export default` a component (`component2d({ key, … })`),\n * whose `key` supplies the registry key, exactly as {@link addNode}\n * already reads it off a statically-imported one. There is no separate\n * `key` parameter: one way to name a dynamic node's key, not two that\n * could disagree.\n *\n * Requires `dynamicNodes` to have been passed to the constructor — see\n * {@link DynamicNodeConfig}. `core` never compiles anything itself; this\n * only calls the host-supplied `compile` and links its result.\n */\n async addNodeFromSource(source: string, options?: { replace?: boolean }): Promise<NodeConstructor> {\n if (!this._dynamicNodes) {\n throw new Error(\n \"addNodeFromSource needs `dynamicNodes: { sdk, compile }` on the Registry constructor.\",\n );\n }\n const js = await this._dynamicNodes.compile(source);\n const ctor = this._evalNodeModule(js);\n this.addNode(ctor, options);\n return ctor;\n }\n\n /** Everything registered under `key`, or `undefined`. */\n node(key: string): NodeTypeRecord | undefined {\n return this._nodes.get(key);\n }\n\n /** Whether a document naming `key` can be compiled against this registry. */\n hasNode(key: string): boolean {\n return this._nodes.has(key);\n }\n\n /** Every registered node key, for a host offering a palette. Sorted, so the order is stable. */\n nodeKeys(): string[] {\n return [...this._nodes.keys()].sort();\n }\n\n /** What `key` declares about itself, or `undefined` if it is not registered. */\n describe(key: string): NodeTypeDescriptor | undefined {\n return this._nodes.get(key)?.descriptor;\n }\n\n /**\n * Build a node from its spec. Throws on an unknown type.\n *\n * The props pass through the type's own evolution first (`migrateNodeProps`),\n * so a row written before a prop was renamed still sets it.\n *\n * `props` overrides the spec's own, which is how the timeline keeps an\n * expression out of a constructor: an expression-bound prop is left out of\n * what is passed here and written afterwards with `set()`. Constructors read\n * their raw props to decide things like a default size, and a `() => number`\n * is not an answer to that question. The spec's `id` outranks both, so\n * {@link Node.id} is the document's own identity rather than a per-instance\n * UUID — without it a host could never resolve a node it addressed by id.\n *\n * `key` rides along the same way, and only when the row carries one:\n * `applyEditorStates` keys the whole editor-state record on {@link Node.key},\n * so a row whose key never reached the node is a node a host cannot hide or\n * lock — and overwriting one passed in `props` with an absent row-level key\n * would take that away from a caller who had it working.\n */\n instantiate(spec: NodeSpec, props?: Record<string, unknown>): Node {\n const record = this._nodes.get(spec.type);\n if (!record) {\n throw new Error(\n `Unknown node type \"${spec.type}\" (node ${spec.id}). ` +\n `This registry knows: ${this.nodeKeys().join(\", \") || \"nothing\"}.`,\n );\n }\n const evolution = propEvolutionOf(record.ctor);\n const given = props ?? spec.props;\n return new record.ctor({\n ...(evolution ? applyPropEvolution(evolution, given).props : given),\n id: spec.id,\n ...(spec.key !== undefined && { key: spec.key }),\n });\n }\n\n // ─── Commands ────────────────────────────────────────────────────────────\n\n /**\n * Register a command that resolves **without** a node — see\n * {@link CommandTypeEntry}. Same uniqueness rule as {@link addNode}.\n */\n addCommand(\n key: string,\n factory: CommandFactory,\n options?: { binds?: boolean; args?: readonly CommandArg[]; method?: string },\n ): this {\n if (this._claimed(key, factory)) return this;\n this._commands.set(key, {\n key,\n scope: \"node\",\n factory,\n ...(options?.args ? { args: this._describeArgs(options.args) } : {}),\n binds: options?.binds,\n ...(options?.method ? { method: options.method } : {}),\n });\n return this;\n }\n\n /**\n * Register a command that writes a **variable** rather than a node.\n *\n * The seam a host reaches for to add its own — a spring, a wiggle, a\n * sample-and-hold — without touching the timeline. `CommandSpec.targetId`\n * names the variable, and the {@link Command} that comes back must be a pure\n * function of `t` like any other.\n */\n addVariableCommand(key: string, factory: VariableCommandFactory): this {\n if (this._claimed(key, factory)) return this;\n this._commands.set(key, { key, scope: \"variable\", factory });\n return this;\n }\n\n /** The node-less command registered under `key`, or `undefined`. */\n command(key: string): CommandTypeEntry | undefined {\n return this._commands.get(key);\n }\n\n /**\n * A factory for `commandKey` on `nodeTypeKey`, or `undefined` if that type\n * does not publish it.\n *\n * Dispatches by **calling the named method**, never by testing the target\n * against a class: a forked component is a different class carrying the same\n * source, and an `instanceof` against the original is false for it.\n */\n nodeCommand(nodeTypeKey: string, commandKey: string): CommandFactory | undefined {\n const record = this._nodes.get(nodeTypeKey);\n const entry = record?.commands.get(commandKey);\n if (!entry) return undefined;\n return (target, args, duration, easing) => {\n const fn = (target as unknown as Record<string, unknown>)[entry.method];\n if (typeof fn !== \"function\") {\n throw new Error(\n `Command \"${commandKey}\" needs a \"${entry.method}\" method on ` +\n `${target.constructor.name}, which has none.`,\n );\n }\n const data: Record<string, unknown> = {};\n for (const arg of entry.args) data[arg.key] = args[arg.key];\n return (fn as (args: CommandArgs) => Command<Record<string, unknown>>)\n .call(target, { data, duration, easing });\n };\n }\n\n /**\n * Whether a node of `nodeTypeKey` takes `commandKey`: one its own table\n * publishes, or a node-less one that acts on a node (`to`, `fillTo`) unless\n * the method it runs is one the type lacks. What a host offers a\n * node is its table and the node-less commands it takes.\n */\n takesCommand(nodeTypeKey: string, commandKey: string): boolean {\n const record = this._nodes.get(nodeTypeKey);\n if (!record) return false;\n if (record.commands.has(commandKey)) return true;\n const global = this._commands.get(commandKey);\n if (global?.scope !== \"node\") return false;\n if (global.method === undefined) return true;\n return typeof (record.ctor.prototype as Record<string, unknown>)[global.method] === \"function\";\n }\n\n /**\n * Every command key available. With a node type, that type's own table;\n * without one, the node-less commands. Sorted, so the order is stable.\n */\n commandKeys(nodeTypeKey?: string): string[] {\n const keys = nodeTypeKey === undefined\n ? this._commands.keys()\n : this._nodes.get(nodeTypeKey)?.commands.keys() ?? [];\n return [...keys].sort();\n }\n\n // ─── Variable lerps ──────────────────────────────────────────────────────\n\n /**\n * Register an interpolation under a document key.\n *\n * The **code** half of a variable, exactly as a node class is the code half\n * of a node: `{\"lerp\": \"color\"}` in a document is a string, and something\n * has to turn it into the function that blends two colours. Same uniqueness\n * rule as {@link addNode}.\n */\n addLerp(key: string, lerp: VariableLerp): this {\n const existing = this._lerps.get(key);\n if (existing && existing !== lerp) {\n throw new Error(\n `Variable lerp \"${key}\" is already registered to a different function. Keys must be unique.`,\n );\n }\n this._lerps.set(key, lerp);\n return this;\n }\n\n /** The lerp registered under `key`, or `undefined`. */\n lerp(key: string): VariableLerp | undefined {\n return this._lerps.get(key);\n }\n\n /** Every registered lerp key. Sorted, so the order is stable. */\n lerpKeys(): string[] {\n return [...this._lerps.keys()].sort();\n }\n\n /**\n * The lerp a `VariableSpec` resolves to, defaulting from its value.\n *\n * A numeric variable with no declared lerp interpolates; anything else snaps\n * at the end. That is less a fallback than the only honest default —\n * guessing a structural lerp off one sample would blend two objects that\n * merely share an `x` key into something neither of them is.\n */\n requireLerp(key: string | undefined, value: unknown, where: string): VariableLerp {\n const resolved = key ?? (typeof value === \"number\" ? \"number\" : \"step\");\n const lerp = this._lerps.get(resolved);\n if (!lerp) {\n throw new Error(\n `Unknown variable lerp \"${resolved}\" (${where}). ` +\n `Registered: ${this.lerpKeys().join(\", \") || \"none\"}.`,\n );\n }\n return lerp;\n }\n\n // ─── Custom eases ────────────────────────────────────────────────────────\n\n /**\n * Register a custom ease under a document key, referenced as\n * `{ kind: \"custom\", args: key }`. Same uniqueness rule as {@link addNode}.\n */\n addEase(key: string, ease: EasingFunction): this {\n const existing = this._eases.get(key);\n if (existing && existing !== ease) {\n throw new Error(\n `Ease \"${key}\" is already registered to a different function. Keys must be unique.`,\n );\n }\n this._eases.set(key, ease);\n return this;\n }\n\n /** The ease registered under `key`, or `undefined`. */\n ease(key: string): EasingFunction | undefined {\n return this._eases.get(key);\n }\n\n /** Every registered ease key. Sorted, so the order is stable. */\n easeKeys(): string[] {\n return [...this._eases.keys()].sort();\n }\n\n // ─── Shaders ─────────────────────────────────────────────────────────────\n\n /**\n * Register a shader pack under a document key.\n *\n * The key is an argument rather than a field of the pack — the same shape\n * {@link addNode} has — so one file can be registered under whatever name a\n * project wants and stays portable between them. A pack's own `id`, when it\n * has one, is provenance.\n *\n * The pack is normalised on the way in, so what comes back out of\n * {@link shader} is always the current shape whatever the file looked like.\n * Re-registering an equal pack is a no-op — the common case is the *same\n * file* imported twice, which produces two structurally identical objects,\n * and throwing on that would make the uniqueness rule fire on the one case\n * it is meant to tolerate.\n *\n * Pass `{ replace: true }` to overwrite a key with a genuinely different\n * pack — the same opt-in `addNode` takes, for the same reason: a live-edited\n * shader re-registering under its existing key.\n */\n addShader(key: string, pack: unknown, options?: { replace?: boolean }): Shader {\n const normalized = normalizeShaderPack(pack);\n const existing = this._shaders.get(key);\n if (existing) {\n if (\n existing.scope === normalized.scope\n && existing.source === normalized.source\n && existing.name === normalized.name\n ) return existing;\n if (!options?.replace) {\n throw new Error(\n `Shader \"${key}\" is already registered to a different pack ` +\n `(\"${existing.name}\" vs \"${normalized.name}\"). Keys must be unique — a document ` +\n `naming this shader would otherwise resolve differently depending on registration order.`,\n );\n }\n } else if (this._shaders.size >= Registry.MAX_SHADERS) {\n throw new Error(\n `Cannot register shader \"${key}\": the ${Registry.MAX_SHADERS}-shader ceiling is reached.`,\n );\n }\n this._shaders.set(key, normalized);\n return normalized;\n }\n\n /** The pack registered under `key`, or `undefined`. */\n shader(key: string): Shader | undefined {\n return this._shaders.get(key);\n }\n\n /**\n * The pack registered under `key`, if it is a **fill** shader.\n *\n * The typed accessors are what actually deliver the compile error the union\n * promises: {@link shader} hands back `Shader`, and a call site that never\n * narrows could still pass an effect pack to `Fills.shader`.\n */\n fillShader(key: string): FillShader | undefined {\n const pack = this._shaders.get(key);\n return pack?.scope === \"fill\" ? pack : undefined;\n }\n\n /** The pack registered under `key`, if it is an **effect** shader. */\n effectShader(key: string): EffectShader | undefined {\n const pack = this._shaders.get(key);\n return pack?.scope === \"effect\" ? pack : undefined;\n }\n\n /** Every registered shader key, for a host offering a picker. Sorted. */\n shaderKeys(): string[] {\n return [...this._shaders.keys()].sort();\n }\n\n // ─── Internals ───────────────────────────────────────────────────────────\n\n private readonly _nodes = new Map<string, NodeTypeRecord>();\n private readonly _commands = new Map<string, CommandTypeEntry>();\n private readonly _lerps = new Map<string, VariableLerp>();\n private readonly _eases = new Map<string, EasingFunction>();\n private readonly _shaders = new Map<string, Shader>();\n private readonly _dynamicNodes?: DynamicNodeConfig;\n\n /**\n * Evaluates one compiled (CommonJS) dynamic-node module in the current\n * realm and returns its default export.\n *\n * `new Function` in-realm, never a blob module or a worker — see\n * {@link DynamicNodeConfig} and `deny-globals.ts` for why. `require()` is\n * locked to exactly `\"@motionscript/sdk\"` (plus the earlier unscoped `\"motionscript\"` and `\"motion-script\"`\n * spellings, so a script written under either name still compiles) and\n * the host's `modules`, own keys only so `require(\"constructor\")` cannot\n * reach `Object`. No relative\n * imports, since a dynamic node is one script, not a package.\n */\n private _evalNodeModule(js: string): NodeConstructor {\n const { sdk, modules } = this._dynamicNodes!;\n const require = (specifier: string): unknown => {\n if (SDK_SPECIFIERS.includes(specifier)) return sdk;\n if (modules && Object.hasOwn(modules, specifier)) return modules[specifier];\n const available = [\"@motionscript/sdk\", ...Object.keys(modules ?? {})];\n throw new Error(\n `\"${specifier}\" isn't available to a custom node. It can require ` +\n `${available.map((s) => `\"${s}\"`).join(\", \")}; a host supplies more through \\`dynamicNodes.modules\\`.`,\n );\n };\n const mod = { exports: {} as Record<string, unknown> };\n // The script runs one function in from the parameters that deny the\n // globals, so its own top-level `const frames` shadows a denied name\n // instead of redeclaring a parameter. A body that closes that function\n // early is still inside the outer one, which denies the same names.\n const factory = new Function(\n \"exports\", \"require\", \"module\", ...DENIED_GLOBALS,\n `\"use strict\";\\nreturn function () {\\n${js}\\n};`,\n );\n factory(mod.exports, require, mod)();\n\n const ctor = mod.exports.default as (NodeConstructor & { node?: NodeConstructor }) | undefined;\n if (typeof ctor !== \"function\" || getNodeDescriptor(typeof ctor.node === \"function\" ? ctor.node : ctor) === undefined) {\n throw new Error(\"This script must `export default` a component: `component2d({ key: \\\"…\\\", … })`.\");\n }\n return ctor;\n }\n\n /** One key, one factory — see {@link addNode} for why. */\n private _claimed(key: string, factory: CommandFactory | VariableCommandFactory): boolean {\n const existing = this._commands.get(key);\n if (!existing) return false;\n if (existing.factory === factory) return true;\n throw new Error(\n `Command type \"${key}\" is already registered to a different factory. Keys must be unique.`,\n );\n }\n\n /**\n * A class's editable properties, read off its `property` declarations.\n *\n * The whole prototype chain, so a component publishes the box its tree's\n * base declares as well as its own entries — a host editing one edits every\n * control it actually has.\n */\n private _describeProperties(ctor: NodeConstructor): Record<string, NodePropertyDescriptor> {\n const out: Record<string, NodePropertyDescriptor> = {};\n for (const meta of getPropertyMeta(Object.create(ctor.prototype) as object)) {\n const editor: PropertyEditor = meta.editor ?? {};\n out[meta.key] = {\n ...editor,\n kind: editor.kind ?? this._inferKind(meta.default),\n ...(meta.default !== undefined ? { default: meta.default } : {}),\n };\n }\n return out;\n }\n\n /** A component's `renamed` and `deprecated`, where a host reading the descriptor sees them. */\n private _describeEvolution(ctor: NodeConstructor, descriptor: NodeTypeDescriptor): NodeTypeDescriptor {\n const evolution = propEvolutionOf(ctor);\n if (!evolution) return descriptor;\n const properties = { ...descriptor.properties };\n for (const [key, message] of Object.entries(evolution.deprecated)) {\n if (properties[key]) properties[key] = { ...properties[key], deprecated: message };\n }\n const renamed = Object.keys(evolution.renamed).length > 0 ? { renamed: { ...evolution.renamed } } : {};\n return { ...descriptor, ...renamed, properties };\n }\n\n /**\n * A type's dimension, read off the prototype without constructing one.\n *\n * `Node.dimension` is a getter rather than a field for exactly this reason —\n * it answers from the prototype, before any field initializer has run.\n */\n private _describeDimension(ctor: NodeConstructor): NodeDimension | undefined {\n const dimension = (Object.create(ctor.prototype) as Node).dimension;\n return typeof dimension === \"string\" ? dimension : undefined;\n }\n\n /** The trees a type takes children from, off the prototype as its dimension is. */\n private _describeHolds(ctor: NodeConstructor): readonly NodeDimension[] | undefined {\n const trees = (Object.create(ctor.prototype) as Partial<Node>)._childTrees;\n return Array.isArray(trees) ? [...trees] : undefined;\n }\n\n /**\n * The control a value's own type implies. Only ever a fallback: a typed\n * property states its kind, and a plain `property` may too.\n *\n * A function default is a *reactive binding*, not a value, so it says nothing\n * about the control; those declare their kind or take \"unknown\", which a host\n * draws as read-only rather than guessing.\n */\n private _inferKind(value: unknown): string {\n switch (typeof value) {\n case \"number\": return \"number\";\n case \"string\": return \"text\";\n case \"boolean\": return \"boolean\";\n case \"object\":\n if (value === null) return \"unknown\";\n return Array.isArray(value) && value.every(v => typeof v === \"number\")\n ? \"vector\"\n : \"object\";\n default: return \"unknown\";\n }\n }\n\n /** A command's arguments as descriptors, whichever shorthand they were written in. */\n private _describeArgs(args: readonly CommandArg[] | undefined): CommandArgDescriptor[] {\n return (args ?? []).map((arg) =>\n typeof arg === \"string\" ? { key: arg, kind: \"unknown\" } : { kind: \"unknown\", ...arg });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/document/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAuB,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,cAAc,EAA8C,MAAM,2BAA2B,CAAC;AACvG,OAAO,EACH,mBAAmB,GAItB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIvE;;;GAGG;AACH,MAAM,cAAc,GAAsB,C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AAC;IAEO,cAAc,CAAC,IAAqB;QACxC,MAAM,KAAK,GAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAmB,CAAC,WAAW,CAAC;QAC3E,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzD,CAAC;IAED;;;OAGG;IACK,UAAU,CAAC,KAAc;QAC7B,QAAQ,OAAO,KAAK,EAAE,CAAC;YACnB,KAAK,QAAQ,CAAC,CAAC,OAAO,QAAQ,CAAC;YAC/B,KAAK,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC;YAC7B,KAAK,SAAS,CAAC,CAAC,OAAO,SAAS,CAAC;YACjC,KAAK,QAAQ;gBACT,IAAI,KAAK,KAAK,IAAI;oBAAE,OAAO,SAAS,CAAC;gBACrC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;oBAClE,CAAC,CAAC,QAAQ;oBACV,CAAC,CAAC,QAAQ,CAAC;YACnB,OAAO,CAAC,CAAC,OAAO,SAAS,CAAC;QAC9B,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,IAAuC;QACzD,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC5B,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;IAC/F,CAAC","sourcesContent":["import type { Node, NodeDimension } from \"@/components/trees/node/node\";\nimport type { Command, CommandArgs } from \"@/tween/command\";\nimport type { EasingFunction } from \"@/tween/ease/type\";\nimport { getPropertyMeta, type PropertyEditor } from \"@/attributes/properties/decorator\";\nimport { getCommandMeta, type CommandArg, type CommandArgDescriptor } from \"@/tween/command-decorator\";\nimport {\n normalizeShaderPack,\n type EffectShader,\n type FillShader,\n type Shader,\n} from \"@/attributes/shape/shaders/pack\";\nimport { installBuiltins } from \"./builtins\";\nimport { DENIED_GLOBALS } from \"./deny-globals\";\nimport { getNodeDescriptor } from \"./node-decorator\";\nimport { applyPropEvolution, propEvolutionOf } from \"./prop-evolution\";\nimport type { NodePropertyDescriptor, NodeTypeDescriptor } from \"./node-descriptor\";\nimport type { NodeSpec } from \"./types\";\n\n/**\n * Resolve to the host's sdk barrel. The published name comes first; the two after it are earlier unscoped\n * names, kept so older scripts still compile.\n */\nconst SDK_SPECIFIERS: readonly string[] = [\"@motionscript/sdk\", \"motionscript\", \"motion-script\"];\n\nexport type NodeConstructor = new (props?: Record<string, unknown>) => Node;\n\nexport type NodeTypeMap = Record<string, NodeConstructor>;\n\nexport type ShaderPackMap = Record<string, unknown>;\n\n/**\n * Called once per compile, in timeline order, with `target` already in the state the previous command left:\n * that fixes the command's `from` and makes `Command.at(t)` pure thereafter.\n */\nexport type CommandFactory = (\n target: Node,\n args: Record<string, unknown>,\n duration: number,\n easing?: EasingFunction,\n) => Command<Record<string, unknown>>;\n\n/**\n * A handle, not the cell, so a command cannot subscribe to it, rebind it or hold it past the build: each would\n * stop it being a pure function of `t`.\n */\nexport interface VariableTarget {\n readonly id: string;\n get(): unknown;\n set(value: unknown): void;\n /** A command may use a different lerp when its args ask (`variableTo` does). */\n readonly lerp: VariableLerp;\n}\n\n/** Same contract as {@link CommandFactory}, against a variable instead of a node. */\nexport type VariableCommandFactory = (\n target: VariableTarget,\n args: Record<string, unknown>,\n duration: number,\n easing?: EasingFunction,\n) => Command<Record<string, unknown>>;\n\n/** Widened to `unknown`: a variable's type is a fact of the document, not of a class. */\nexport type VariableLerp = (from: unknown, to: unknown, t: number) => unknown;\n\n/**\n * `scope` picks the table `CommandSpec.targetId` is looked up in, so a variable command reuses the field a\n * node command uses.\n */\nexport type CommandTypeEntry =\n | {\n key: string;\n scope: \"node\";\n factory: CommandFactory;\n /**\n * Declared by the paint commands, one key each. Absent for `to`/`set`, whose args are the props diff.\n */\n args?: readonly CommandArgDescriptor[];\n /**\n * Args are a props diff that reaches `set()`, so an expression compiles to a binding. A flag, not a name\n * check: `to` tweens towards a value, and binding a formula there would interpolate towards `NaN`.\n */\n binds?: boolean;\n /**\n * The method it runs on its target (the paint commands call the node's own `fillTo`). A type without it, or\n * one that withdrew it, does not take the command ({@link Registry.takesCommand}).\n */\n method?: string;\n }\n | {\n key: string;\n scope: \"variable\";\n factory: VariableCommandFactory;\n };\n\n/**\n * Built from the whole prototype chain, so a `Card` extending `Rect` answers to `fadeTo` as it does to\n * `.fadeTo()`. Inherited entries are copied into each type, so nothing collides.\n */\nexport interface NodeTypeRecord {\n key: string;\n ctor: NodeConstructor;\n commands: ReadonlyMap<string, NodeCommandEntry>;\n /** Always present, however the type was registered. */\n descriptor: NodeTypeDescriptor;\n}\n\nexport interface NodeCommandEntry {\n method: string;\n /** A bare name normalises to `{ key, kind: \"unknown\" }`. */\n args: readonly CommandArgDescriptor[];\n /**\n * Present and true for an entrance (`CommandMeta.entrance`), so a host can offer one when the node is added.\n */\n entrance?: true;\n}\n\n/**\n * Host-supplied: `core` has no compiler dependency and cannot import the `@motionscript/sdk` barrel (that\n * package depends on `core`).\n */\nexport interface DynamicNodeConfig {\n /**\n * Must be the host's already-loaded sdk instance, or `instanceof` silently fails against it. The earlier\n * unscoped specifiers resolve to the same object.\n */\n sdk: Record<string, unknown>;\n /**\n * Consulted after the sdk specifiers, so they cannot be shadowed. Each must be the host's loaded instance, for\n * the same `instanceof` reason.\n */\n modules?: Readonly<Record<string, unknown>>;\n /** Host-injected, never bundled. */\n compile: (source: string) => Promise<string>;\n}\n\nexport interface RegistryOptions {\n /**\n * A record names the key outright, which asserts the class agrees: a rename on either side throws here rather\n * than surfacing as an unknown type at render.\n */\n nodes?: NodeTypeMap | readonly NodeConstructor[];\n shaders?: ShaderPackMap;\n lerps?: Record<string, VariableLerp>;\n eases?: Record<string, EasingFunction>;\n dynamicNodes?: DynamicNodeConfig;\n /**\n * Fail the build on an unknown node type or command, instead of standing in a placeholder and recording it in\n * `buildErrors`.\n */\n strict?: boolean;\n /**\n * Only for a test asserting on the seeding, or a deliberately tiny vocabulary: a document naming `\"rect\"` will\n * not compile without it.\n */\n builtins?: boolean;\n}\n\n/**\n * An instance, not module-scope tables: what a document can name is a property of the engine opening it, so\n * two engines in one process disagree freely.\n *\n * Commands are per node type (a method on a class); only those that must resolve without a node\n * (variable-scoped, generic prop writers) sit in a table of their own.\n */\nexport class Registry {\n /** Ceiling, so an import cannot evict a workspace's own shaders by volume. */\n static readonly MAX_SHADERS = 512;\n\n readonly strict: boolean;\n\n constructor(options: RegistryOptions = {}) {\n this._dynamicNodes = options.dynamicNodes;\n this.strict = options.strict === true;\n if (options.builtins !== false) installBuiltins(this);\n if (Array.isArray(options.nodes)) {\n for (const ctor of options.nodes) this.addNode(ctor);\n } else {\n for (const [key, ctor] of Object.entries(options.nodes ?? {})) this.addNode(key, ctor);\n }\n for (const [key, lerp] of Object.entries(options.lerps ?? {})) this.addLerp(key, lerp);\n for (const [key, ease] of Object.entries(options.eases ?? {})) this.addEase(key, ease);\n for (const [key, pack] of Object.entries(options.shaders ?? {})) this.addShader(key, pack);\n }\n\n /**\n * Register a node class with its commands and descriptor. Commands come off the class's `command()` methods,\n * read through an object over the prototype so no constructor runs (it may expect props, build children or\n * touch a clock).\n *\n * Re-registering the same class under a key is a no-op (hot reload, a duplicated dependency); a different\n * class throws, since a document would render differently by registration order. `replace: true` opts out, for\n * a recompiled node (see {@link addNodeFromSource}).\n */\n addNode(ctor: NodeConstructor, options?: { replace?: boolean }): this;\n addNode(type: string | NodeTypeDescriptor, ctor: NodeConstructor, options?: { replace?: boolean }): this;\n addNode(\n type: string | NodeTypeDescriptor | NodeConstructor,\n ctorOrOptions?: NodeConstructor | { replace?: boolean },\n maybeOptions?: { replace?: boolean },\n ): this {\n const isTwoArgForm = typeof ctorOrOptions === \"function\";\n // A component (`component2d(...)`) registers as the node class it generated.\n const given = (isTwoArgForm ? ctorOrOptions : type) as NodeConstructor & { node?: NodeConstructor };\n const cls = typeof given.node === \"function\" ? given.node : given;\n const options = isTwoArgForm ? maybeOptions : ctorOrOptions as { replace?: boolean } | undefined;\n const declared = isTwoArgForm ? type as string | NodeTypeDescriptor : getNodeDescriptor(cls);\n if (declared === undefined) {\n throw new Error(\n `${cls.name || \"The class\"} is no component, so it has no document key. ` +\n `Make it with component2d({ key }), or register it explicitly: addNode(\"myKey\", TheClass).`,\n );\n }\n const descriptor: NodeTypeDescriptor = typeof declared === \"string\" ? { key: declared } : declared;\n const key = descriptor.key;\n\n const existing = this._nodes.get(key);\n if (existing) {\n if (existing.ctor === cls) return this;\n if (!options?.replace) {\n throw new Error(\n `Node type \"${key}\" is already registered to a different class ` +\n `(${existing.ctor.name} vs ${cls.name}). Keys must be unique — a document ` +\n `naming this type would otherwise resolve differently depending on registration order.`,\n );\n }\n }\n\n const commands = new Map<string, NodeCommandEntry>();\n for (const meta of getCommandMeta(Object.create(cls.prototype) as object)) {\n commands.set(meta.key, {\n method: meta.method,\n args: this._describeArgs(meta.args),\n ...(meta.entrance ? { entrance: true as const } : {}),\n });\n }\n\n this._nodes.set(key, {\n key,\n ctor: cls,\n commands,\n // Derived, never declared: see `NodeTypeDescriptor.properties`.\n descriptor: this._describeEvolution(cls, {\n ...descriptor,\n dimension: this._describeDimension(cls),\n holds: this._describeHolds(cls),\n properties: this._describeProperties(cls),\n }),\n });\n return this;\n }\n\n /**\n * The script must `export default` a component whose `key` supplies the registry key, as {@link addNode} reads\n * it: one way to name a dynamic node's key. Requires `dynamicNodes`; `core` only calls the host-supplied\n * `compile` and links the result.\n */\n async addNodeFromSource(source: string, options?: { replace?: boolean }): Promise<NodeConstructor> {\n if (!this._dynamicNodes) {\n throw new Error(\n \"addNodeFromSource needs `dynamicNodes: { sdk, compile }` on the Registry constructor.\",\n );\n }\n const js = await this._dynamicNodes.compile(source);\n const ctor = this._evalNodeModule(js);\n this.addNode(ctor, options);\n return ctor;\n }\n\n node(key: string): NodeTypeRecord | undefined {\n return this._nodes.get(key);\n }\n\n hasNode(key: string): boolean {\n return this._nodes.has(key);\n }\n\n nodeKeys(): string[] {\n return [...this._nodes.keys()].sort();\n }\n\n describe(key: string): NodeTypeDescriptor | undefined {\n return this._nodes.get(key)?.descriptor;\n }\n\n /**\n * The props pass through the type's evolution first (`migrateNodeProps`).\n *\n * `props` overrides the spec's own so the timeline can leave expression-bound props out of the constructor,\n * which reads raw props for defaults like size, and `set()` them after. The spec's `id` outranks both, so\n * {@link Node.id} is the document's identity. `key` rides along only when the row has one: `applyEditorStates`\n * keys on {@link Node.key}, and an absent row key must not overwrite one passed in `props`.\n */\n instantiate(spec: NodeSpec, props?: Record<string, unknown>): Node {\n const record = this._nodes.get(spec.type);\n if (!record) {\n throw new Error(\n `Unknown node type \"${spec.type}\" (node ${spec.id}). ` +\n `This registry knows: ${this.nodeKeys().join(\", \") || \"nothing\"}.`,\n );\n }\n const evolution = propEvolutionOf(record.ctor);\n const given = props ?? spec.props;\n return new record.ctor({\n ...(evolution ? applyPropEvolution(evolution, given).props : given),\n id: spec.id,\n ...(spec.key !== undefined && { key: spec.key }),\n });\n }\n\n /** Same uniqueness rule as {@link addNode}. */\n addCommand(\n key: string,\n factory: CommandFactory,\n options?: { binds?: boolean; args?: readonly CommandArg[]; method?: string },\n ): this {\n if (this._claimed(key, factory)) return this;\n this._commands.set(key, {\n key,\n scope: \"node\",\n factory,\n ...(options?.args ? { args: this._describeArgs(options.args) } : {}),\n binds: options?.binds,\n ...(options?.method ? { method: options.method } : {}),\n });\n return this;\n }\n\n /**\n * A host's seam for its own variable commands (a spring, a wiggle); the returned {@link Command} must be a\n * pure function of `t`.\n */\n addVariableCommand(key: string, factory: VariableCommandFactory): this {\n if (this._claimed(key, factory)) return this;\n this._commands.set(key, { key, scope: \"variable\", factory });\n return this;\n }\n\n command(key: string): CommandTypeEntry | undefined {\n return this._commands.get(key);\n }\n\n /**\n * Dispatches by calling the named method, never by testing against a class: a forked component is a different\n * class carrying the same source, so `instanceof` against the original is false.\n */\n nodeCommand(nodeTypeKey: string, commandKey: string): CommandFactory | undefined {\n const record = this._nodes.get(nodeTypeKey);\n const entry = record?.commands.get(commandKey);\n if (!entry) return undefined;\n return (target, args, duration, easing) => {\n const fn = (target as unknown as Record<string, unknown>)[entry.method];\n if (typeof fn !== \"function\") {\n throw new Error(\n `Command \"${commandKey}\" needs a \"${entry.method}\" method on ` +\n `${target.constructor.name}, which has none.`,\n );\n }\n const data: Record<string, unknown> = {};\n for (const arg of entry.args) data[arg.key] = args[arg.key];\n return (fn as (args: CommandArgs) => Command<Record<string, unknown>>)\n .call(target, { data, duration, easing });\n };\n }\n\n /**\n * A node takes what its own table publishes, plus node-less commands that act on a node (`to`, `fillTo`)\n * unless the method they run is one the type lacks.\n */\n takesCommand(nodeTypeKey: string, commandKey: string): boolean {\n const record = this._nodes.get(nodeTypeKey);\n if (!record) return false;\n if (record.commands.has(commandKey)) return true;\n const global = this._commands.get(commandKey);\n if (global?.scope !== \"node\") return false;\n if (global.method === undefined) return true;\n return typeof (record.ctor.prototype as Record<string, unknown>)[global.method] === \"function\";\n }\n\n commandKeys(nodeTypeKey?: string): string[] {\n const keys = nodeTypeKey === undefined\n ? this._commands.keys()\n : this._nodes.get(nodeTypeKey)?.commands.keys() ?? [];\n return [...keys].sort();\n }\n\n /** Same uniqueness rule as {@link addNode}. */\n addLerp(key: string, lerp: VariableLerp): this {\n const existing = this._lerps.get(key);\n if (existing && existing !== lerp) {\n throw new Error(\n `Variable lerp \"${key}\" is already registered to a different function. Keys must be unique.`,\n );\n }\n this._lerps.set(key, lerp);\n return this;\n }\n\n lerp(key: string): VariableLerp | undefined {\n return this._lerps.get(key);\n }\n\n lerpKeys(): string[] {\n return [...this._lerps.keys()].sort();\n }\n\n /**\n * A numeric variable with no declared lerp interpolates; anything else snaps at the end. Guessing a structural\n * lerp off one sample would blend objects that merely share an `x` key.\n */\n requireLerp(key: string | undefined, value: unknown, where: string): VariableLerp {\n const resolved = key ?? (typeof value === \"number\" ? \"number\" : \"step\");\n const lerp = this._lerps.get(resolved);\n if (!lerp) {\n throw new Error(\n `Unknown variable lerp \"${resolved}\" (${where}). ` +\n `Registered: ${this.lerpKeys().join(\", \") || \"none\"}.`,\n );\n }\n return lerp;\n }\n\n /** Referenced as `{ kind: \"custom\", args: key }`. Same uniqueness rule as {@link addNode}. */\n addEase(key: string, ease: EasingFunction): this {\n const existing = this._eases.get(key);\n if (existing && existing !== ease) {\n throw new Error(\n `Ease \"${key}\" is already registered to a different function. Keys must be unique.`,\n );\n }\n this._eases.set(key, ease);\n return this;\n }\n\n ease(key: string): EasingFunction | undefined {\n return this._eases.get(key);\n }\n\n easeKeys(): string[] {\n return [...this._eases.keys()].sort();\n }\n\n /**\n * The key is an argument, not a pack field (as in {@link addNode}), so a file stays portable between projects;\n * a pack's own `id` is provenance. The pack is normalised on the way in.\n *\n * Re-registering an equal pack is a no-op: the same file imported twice yields two equal objects, and throwing\n * there would defeat the uniqueness rule. `replace: true` overwrites with a different pack, for a live-edited\n * shader.\n */\n addShader(key: string, pack: unknown, options?: { replace?: boolean }): Shader {\n const normalized = normalizeShaderPack(pack);\n const existing = this._shaders.get(key);\n if (existing) {\n if (\n existing.scope === normalized.scope\n && existing.source === normalized.source\n && existing.name === normalized.name\n ) return existing;\n if (!options?.replace) {\n throw new Error(\n `Shader \"${key}\" is already registered to a different pack ` +\n `(\"${existing.name}\" vs \"${normalized.name}\"). Keys must be unique — a document ` +\n `naming this shader would otherwise resolve differently depending on registration order.`,\n );\n }\n } else if (this._shaders.size >= Registry.MAX_SHADERS) {\n throw new Error(\n `Cannot register shader \"${key}\": the ${Registry.MAX_SHADERS}-shader ceiling is reached.`,\n );\n }\n this._shaders.set(key, normalized);\n return normalized;\n }\n\n shader(key: string): Shader | undefined {\n return this._shaders.get(key);\n }\n\n /**\n * The typed accessors deliver the compile error the union promises: {@link shader} returns `Shader`, and an\n * unnarrowed call site could pass an effect pack to `Fills.shader`.\n */\n fillShader(key: string): FillShader | undefined {\n const pack = this._shaders.get(key);\n return pack?.scope === \"fill\" ? pack : undefined;\n }\n\n effectShader(key: string): EffectShader | undefined {\n const pack = this._shaders.get(key);\n return pack?.scope === \"effect\" ? pack : undefined;\n }\n\n shaderKeys(): string[] {\n return [...this._shaders.keys()].sort();\n }\n\n private readonly _nodes = new Map<string, NodeTypeRecord>();\n private readonly _commands = new Map<string, CommandTypeEntry>();\n private readonly _lerps = new Map<string, VariableLerp>();\n private readonly _eases = new Map<string, EasingFunction>();\n private readonly _shaders = new Map<string, Shader>();\n private readonly _dynamicNodes?: DynamicNodeConfig;\n\n /**\n * `new Function` in-realm, never a blob module or a worker (see {@link DynamicNodeConfig} and\n * `deny-globals.ts`). `require()` is locked to the sdk specifiers and the host's `modules`, own keys only so\n * `require(\"constructor\")` cannot reach `Object`. No relative imports: a dynamic node is one script.\n */\n private _evalNodeModule(js: string): NodeConstructor {\n const { sdk, modules } = this._dynamicNodes!;\n const require = (specifier: string): unknown => {\n if (SDK_SPECIFIERS.includes(specifier)) return sdk;\n if (modules && Object.hasOwn(modules, specifier)) return modules[specifier];\n const available = [\"@motionscript/sdk\", ...Object.keys(modules ?? {})];\n throw new Error(\n `\"${specifier}\" isn't available to a custom node. It can require ` +\n `${available.map((s) => `\"${s}\"`).join(\", \")}; a host supplies more through \\`dynamicNodes.modules\\`.`,\n );\n };\n const mod = { exports: {} as Record<string, unknown> };\n // The script runs one function in from the parameters that deny the\n // globals, so its own top-level `const frames` shadows a denied name\n // instead of redeclaring a parameter. A body that closes that function\n // early is still inside the outer one, which denies the same names.\n const factory = new Function(\n \"exports\", \"require\", \"module\", ...DENIED_GLOBALS,\n `\"use strict\";\\nreturn function () {\\n${js}\\n};`,\n );\n factory(mod.exports, require, mod)();\n\n const ctor = mod.exports.default as (NodeConstructor & { node?: NodeConstructor }) | undefined;\n if (typeof ctor !== \"function\" || getNodeDescriptor(typeof ctor.node === \"function\" ? ctor.node : ctor) === undefined) {\n throw new Error(\"This script must `export default` a component: `component2d({ key: \\\"…\\\", … })`.\");\n }\n return ctor;\n }\n\n /** See {@link addNode} for why. */\n private _claimed(key: string, factory: CommandFactory | VariableCommandFactory): boolean {\n const existing = this._commands.get(key);\n if (!existing) return false;\n if (existing.factory === factory) return true;\n throw new Error(\n `Command type \"${key}\" is already registered to a different factory. Keys must be unique.`,\n );\n }\n\n /** The whole prototype chain, so a component publishes the box its tree's base declares too. */\n private _describeProperties(ctor: NodeConstructor): Record<string, NodePropertyDescriptor> {\n const out: Record<string, NodePropertyDescriptor> = {};\n for (const meta of getPropertyMeta(Object.create(ctor.prototype) as object)) {\n const editor: PropertyEditor = meta.editor ?? {};\n out[meta.key] = {\n ...editor,\n kind: editor.kind ?? this._inferKind(meta.default),\n ...(meta.default !== undefined ? { default: meta.default } : {}),\n };\n }\n return out;\n }\n\n private _describeEvolution(ctor: NodeConstructor, descriptor: NodeTypeDescriptor): NodeTypeDescriptor {\n const evolution = propEvolutionOf(ctor);\n if (!evolution) return descriptor;\n const properties = { ...descriptor.properties };\n for (const [key, message] of Object.entries(evolution.deprecated)) {\n if (properties[key]) properties[key] = { ...properties[key], deprecated: message };\n }\n const renamed = Object.keys(evolution.renamed).length > 0 ? { renamed: { ...evolution.renamed } } : {};\n return { ...descriptor, ...renamed, properties };\n }\n\n /** `Node.dimension` is a getter so it answers from the prototype, before any field initializer has run. */\n private _describeDimension(ctor: NodeConstructor): NodeDimension | undefined {\n const dimension = (Object.create(ctor.prototype) as Node).dimension;\n return typeof dimension === \"string\" ? dimension : undefined;\n }\n\n private _describeHolds(ctor: NodeConstructor): readonly NodeDimension[] | undefined {\n const trees = (Object.create(ctor.prototype) as Partial<Node>)._childTrees;\n return Array.isArray(trees) ? [...trees] : undefined;\n }\n\n /**\n * A function default is a reactive binding, not a value, so it says nothing about the control; those declare a\n * kind or take \"unknown\", which a host draws read-only.\n */\n private _inferKind(value: unknown): string {\n switch (typeof value) {\n case \"number\": return \"number\";\n case \"string\": return \"text\";\n case \"boolean\": return \"boolean\";\n case \"object\":\n if (value === null) return \"unknown\";\n return Array.isArray(value) && value.every(v => typeof v === \"number\")\n ? \"vector\"\n : \"object\";\n default: return \"unknown\";\n }\n }\n\n private _describeArgs(args: readonly CommandArg[] | undefined): CommandArgDescriptor[] {\n return (args ?? []).map((arg) =>\n typeof arg === \"string\" ? { key: arg, kind: \"unknown\" } : { kind: \"unknown\", ...arg });\n }\n}\n"]}
|