@motionscript/core 0.1.0-alpha.6 → 0.1.0-alpha.8
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 +34 -0
- package/NOTICE +15 -14
- package/README.md +5 -7
- package/dist/assets/errors.js +4 -5
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +7 -5
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/scope.d.ts +1 -1
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/effects/chain.d.ts +73 -0
- package/dist/attributes/audio/effects/chain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/chain.js +67 -0
- package/dist/attributes/audio/effects/chain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts +14 -0
- package/dist/attributes/audio/effects/implementations/echo.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/echo.js +11 -0
- package/dist/attributes/audio/effects/implementations/echo.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts +10 -0
- package/dist/attributes/audio/effects/implementations/gain.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/gain.js +6 -0
- package/dist/attributes/audio/effects/implementations/gain.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/highpass.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/highpass.js +10 -0
- package/dist/attributes/audio/effects/implementations/highpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/lowpass.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/lowpass.js +10 -0
- package/dist/attributes/audio/effects/implementations/lowpass.js.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts +12 -0
- package/dist/attributes/audio/effects/implementations/tremolo.d.ts.map +1 -0
- package/dist/attributes/audio/effects/implementations/tremolo.js +10 -0
- package/dist/attributes/audio/effects/implementations/tremolo.js.map +1 -0
- package/dist/attributes/audio/effects/index.d.ts +12 -0
- package/dist/attributes/audio/effects/index.d.ts.map +1 -0
- package/dist/attributes/audio/effects/index.js +4 -0
- package/dist/attributes/audio/effects/index.js.map +1 -0
- package/dist/attributes/audio/effects/registry.d.ts +36 -0
- package/dist/attributes/audio/effects/registry.d.ts.map +1 -0
- package/dist/attributes/audio/effects/registry.js +80 -0
- package/dist/attributes/audio/effects/registry.js.map +1 -0
- package/dist/attributes/audio/effects/union.d.ts +14 -0
- package/dist/attributes/audio/effects/union.d.ts.map +1 -0
- package/dist/attributes/audio/effects/union.js +24 -0
- package/dist/attributes/audio/effects/union.js.map +1 -0
- package/dist/attributes/audio/ramp.d.ts +103 -0
- package/dist/attributes/audio/ramp.d.ts.map +1 -0
- package/dist/attributes/audio/ramp.js +246 -0
- package/dist/attributes/audio/ramp.js.map +1 -0
- package/dist/attributes/audio/request.d.ts +24 -13
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js +4 -3
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +24 -31
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +42 -28
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +15 -12
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -10
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/audio/transition.d.ts +33 -0
- package/dist/attributes/audio/transition.d.ts.map +1 -0
- package/dist/attributes/audio/transition.js +48 -0
- package/dist/attributes/audio/transition.js.map +1 -0
- package/dist/attributes/index.d.ts +7 -8
- package/dist/attributes/index.d.ts.map +1 -1
- package/dist/attributes/index.js +6 -9
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/insets.d.ts +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.d.ts +2 -2
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.d.ts +1 -1
- package/dist/attributes/layout/size.js +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/space3d.js +1 -1
- package/dist/attributes/layout/space3d.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +44 -11
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js +37 -9
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.d.ts +1 -1
- package/dist/attributes/properties/inputs.js +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +24 -145
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +16 -112
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.d.ts +2 -3
- package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js +2 -3
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +96 -409
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +93 -283
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.d.ts +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.d.ts +45 -13
- package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js +29 -23
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js +17 -15
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts +46 -10
- package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js +21 -19
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.d.ts +32 -7
- package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js +17 -11
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.d.ts +16 -3
- package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js +13 -5
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.d.ts +28 -9
- package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js +15 -14
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +21 -5
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +15 -10
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +96 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.js +29 -26
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +20 -6
- package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js +26 -23
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +26 -5
- package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js +15 -10
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.d.ts +58 -11
- package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js +26 -20
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +47 -15
- package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js +24 -29
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.d.ts +26 -7
- package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js +17 -16
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.d.ts +29 -7
- package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js +17 -14
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +76 -19
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js +28 -22
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.d.ts +149 -42
- package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js +74 -72
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.d.ts +43 -11
- package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js +21 -18
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js +13 -5
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js +20 -16
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js +15 -10
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +57 -18
- package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js +25 -22
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +34 -7
- package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js +20 -16
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.d.ts +27 -9
- package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js +17 -14
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +54 -19
- package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js +42 -20
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +17 -3
- package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js +13 -9
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.d.ts +28 -8
- package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js +18 -17
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts +25 -6
- package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js +16 -14
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.d.ts +14 -3
- package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js +13 -9
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +91 -26
- package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js +27 -28
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +49 -10
- package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js +19 -20
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +36 -6
- package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js +16 -15
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts +52 -11
- package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js +21 -18
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.d.ts +23 -9
- package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js +15 -12
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts +90 -34
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +42 -26
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts +23 -5
- package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js +16 -11
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.d.ts +40 -9
- package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js +19 -16
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js +17 -11
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.d.ts +35 -8
- package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js +17 -16
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.d.ts +37 -7
- package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js +19 -18
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.d.ts +24 -5
- package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js +15 -10
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.d.ts +61 -14
- package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js +26 -23
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +4 -2
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +11 -0
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +113 -102
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/spec.d.ts +229 -0
- package/dist/attributes/shape/effects/spec.d.ts.map +1 -0
- package/dist/attributes/shape/effects/spec.js +178 -0
- package/dist/attributes/shape/effects/spec.js.map +1 -0
- package/dist/attributes/shape/fill/chain.d.ts +7 -9
- package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
- package/dist/attributes/shape/fill/chain.js +9 -11
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
- package/dist/attributes/shape/fill/color/parser.js +1 -1
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.d.ts +28 -27
- package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js +20 -14
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.d.ts +1 -1
- package/dist/attributes/shape/fill/index.d.ts.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.d.ts +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/registry.d.ts +1 -2
- package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
- package/dist/attributes/shape/fill/registry.js +1 -2
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +3 -7
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +2 -6
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +2 -2
- 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/registry.d.ts +1 -1
- package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -6
- 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/ops.d.ts +1 -2
- 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/shaders/index.d.ts +2 -0
- package/dist/attributes/shape/shaders/index.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/index.js +2 -0
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/language.d.ts +26 -0
- package/dist/attributes/shape/shaders/language.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/language.js +20 -0
- package/dist/attributes/shape/shaders/language.js.map +1 -0
- package/dist/attributes/shape/shaders/pack.d.ts +25 -11
- package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/pack.js +9 -4
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.d.ts +4 -5
- package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js +3 -6
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shaders/uniforms.d.ts +41 -0
- package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -0
- package/dist/attributes/shape/shaders/uniforms.js +0 -0
- package/dist/attributes/shape/shaders/uniforms.js.map +1 -0
- package/dist/attributes/shared/operators.d.ts +2 -2
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/types.d.ts +2 -3
- package/dist/attributes/text/types.d.ts.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-AOT33LMS.js +13 -0
- package/dist/browser/chunks/chunk-AOT33LMS.js.map +7 -0
- package/dist/browser/chunks/chunk-GKM6UZJR.js +6 -0
- package/dist/browser/chunks/chunk-GKM6UZJR.js.map +7 -0
- package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
- package/dist/browser/chunks/{chunk-DHB4COFY.js.map → chunk-LKUYVFU3.js.map} +4 -4
- package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
- package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +4 -4
- package/dist/browser/experimental.js +1 -1
- package/dist/browser/experimental.js.map +4 -4
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/manifest.json +2 -4
- package/dist/browser/sdk.js +1 -1
- package/dist/component.d.ts +10 -18
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/dist/component.js.map +1 -1
- package/dist/components/builtins/audio/audio.d.ts +62 -0
- package/dist/components/builtins/audio/audio.d.ts.map +1 -0
- package/dist/components/builtins/audio/audio.js +38 -0
- package/dist/components/builtins/audio/audio.js.map +1 -0
- package/dist/components/builtins/geometry/composite.d.ts +93 -0
- package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
- package/dist/components/builtins/geometry/composite.js +25 -0
- package/dist/components/builtins/geometry/composite.js.map +1 -0
- package/dist/components/builtins/geometry/geometry.d.ts +921 -0
- package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
- package/dist/components/builtins/geometry/geometry.js +107 -0
- package/dist/components/builtins/geometry/geometry.js.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
- package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
- package/dist/components/builtins/geometry/shape-outline.js +470 -0
- package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
- package/dist/components/builtins/layout/layout.d.ts +186 -0
- package/dist/components/builtins/layout/layout.d.ts.map +1 -0
- package/dist/components/builtins/layout/layout.js +84 -0
- package/dist/components/builtins/layout/layout.js.map +1 -0
- package/dist/components/builtins/media/media.d.ts +240 -0
- package/dist/components/builtins/media/media.d.ts.map +1 -0
- package/dist/components/builtins/media/media.js +143 -0
- package/dist/components/builtins/media/media.js.map +1 -0
- package/dist/components/builtins/providers/providers.d.ts +47 -0
- package/dist/components/builtins/providers/providers.d.ts.map +1 -0
- package/dist/components/builtins/providers/providers.js +30 -0
- package/dist/components/builtins/providers/providers.js.map +1 -0
- package/dist/components/builtins/text/number-format.d.ts +66 -0
- package/dist/components/builtins/text/number-format.d.ts.map +1 -0
- package/dist/components/builtins/text/number-format.js +227 -0
- package/dist/components/builtins/text/number-format.js.map +1 -0
- package/dist/components/builtins/text/number-pattern.d.ts +51 -0
- package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
- package/dist/components/builtins/text/number-pattern.js +77 -0
- package/dist/components/builtins/text/number-pattern.js.map +1 -0
- package/dist/components/builtins/text/text-defaults.d.ts +32 -0
- package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
- package/dist/components/builtins/text/text-defaults.js +37 -0
- package/dist/components/builtins/text/text-defaults.js.map +1 -0
- package/dist/components/builtins/text/text-layout.d.ts +82 -0
- package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
- package/dist/components/builtins/text/text-layout.js +331 -0
- package/dist/components/builtins/text/text-layout.js.map +1 -0
- package/dist/components/builtins/text/text.d.ts +409 -0
- package/dist/components/builtins/text/text.d.ts.map +1 -0
- package/dist/components/builtins/text/text.js +116 -0
- package/dist/components/builtins/text/text.js.map +1 -0
- package/dist/components/builtins/three/canvas3d.d.ts +245 -0
- package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
- package/dist/components/builtins/three/canvas3d.js +21 -0
- package/dist/components/builtins/three/canvas3d.js.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
- package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
- package/dist/components/builtins/three/grid-geometry3d.js +114 -0
- package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
- package/dist/components/builtins/three/three.d.ts +1889 -0
- package/dist/components/builtins/three/three.d.ts.map +1 -0
- package/dist/components/builtins/three/three.js +305 -0
- package/dist/components/builtins/three/three.js.map +1 -0
- package/dist/components/factory/api.d.ts +543 -0
- package/dist/components/factory/api.d.ts.map +1 -0
- package/dist/components/factory/api.js +4 -0
- package/dist/components/factory/api.js.map +1 -0
- package/dist/components/factory/clip-of.d.ts +5 -0
- package/dist/components/factory/clip-of.d.ts.map +1 -0
- package/dist/components/factory/clip-of.js +33 -0
- package/dist/components/factory/clip-of.js.map +1 -0
- package/dist/components/factory/commands-for.d.ts +19 -0
- package/dist/components/factory/commands-for.d.ts.map +1 -0
- package/dist/components/factory/commands-for.js +5 -0
- package/dist/components/factory/commands-for.js.map +1 -0
- package/dist/components/factory/component-audio.d.ts +9 -0
- package/dist/components/factory/component-audio.d.ts.map +1 -0
- package/dist/components/factory/component-audio.js +18 -0
- package/dist/components/factory/component-audio.js.map +1 -0
- package/dist/components/factory/component2d.d.ts +8 -0
- package/dist/components/factory/component2d.d.ts.map +1 -0
- package/dist/components/factory/component2d.js +240 -0
- package/dist/components/factory/component2d.js.map +1 -0
- package/dist/components/factory/component3d.d.ts +9 -0
- package/dist/components/factory/component3d.d.ts.map +1 -0
- package/dist/components/factory/component3d.js +107 -0
- package/dist/components/factory/component3d.js.map +1 -0
- package/dist/components/factory/factory.d.ts +66 -0
- package/dist/components/factory/factory.d.ts.map +1 -0
- package/dist/components/factory/factory.js +347 -0
- package/dist/components/factory/factory.js.map +1 -0
- package/dist/components/factory/timeline.d.ts +22 -0
- package/dist/components/factory/timeline.d.ts.map +1 -0
- package/dist/components/factory/timeline.js +128 -0
- package/dist/components/factory/timeline.js.map +1 -0
- package/dist/components/factory/type-def.d.ts +26 -0
- package/dist/components/factory/type-def.d.ts.map +1 -0
- package/dist/components/factory/type-def.js +16 -0
- package/dist/components/factory/type-def.js.map +1 -0
- package/dist/components/factory/types.d.ts +91 -0
- package/dist/components/factory/types.d.ts.map +1 -0
- package/dist/components/factory/types.js +88 -0
- package/dist/components/factory/types.js.map +1 -0
- package/dist/components/factory/views.d.ts +121 -0
- package/dist/components/factory/views.d.ts.map +1 -0
- package/dist/components/factory/views.js +413 -0
- package/dist/components/factory/views.js.map +1 -0
- package/dist/components/modules/aim.d.ts +30 -0
- package/dist/components/modules/aim.d.ts.map +1 -0
- package/dist/components/modules/aim.js +39 -0
- package/dist/components/modules/aim.js.map +1 -0
- package/dist/components/modules/corners.d.ts +13 -0
- package/dist/components/modules/corners.d.ts.map +1 -0
- package/dist/components/modules/corners.js +12 -0
- package/dist/components/modules/corners.js.map +1 -0
- package/dist/components/modules/flow.d.ts +26 -0
- package/dist/components/modules/flow.d.ts.map +1 -0
- package/dist/components/modules/flow.js +57 -0
- package/dist/components/modules/flow.js.map +1 -0
- package/dist/components/modules/material.d.ts +40 -0
- package/dist/components/modules/material.d.ts.map +1 -0
- package/dist/components/modules/material.js +75 -0
- package/dist/components/modules/material.js.map +1 -0
- package/dist/components/modules/paint.d.ts +71 -0
- package/dist/components/modules/paint.d.ts.map +1 -0
- package/dist/components/modules/paint.js +106 -0
- package/dist/components/modules/paint.js.map +1 -0
- package/dist/components/modules/shapes.d.ts +31 -0
- package/dist/components/modules/shapes.d.ts.map +1 -0
- package/dist/components/modules/shapes.js +43 -0
- package/dist/components/modules/shapes.js.map +1 -0
- package/dist/components/modules/text-layout.d.ts +26 -0
- package/dist/components/modules/text-layout.d.ts.map +1 -0
- package/dist/components/modules/text-layout.js +57 -0
- package/dist/components/modules/text-layout.js.map +1 -0
- package/dist/components/modules/text-style.d.ts +48 -0
- package/dist/components/modules/text-style.d.ts.map +1 -0
- package/dist/components/modules/text-style.js +63 -0
- package/dist/components/modules/text-style.js.map +1 -0
- package/dist/components/modules/three-entries.d.ts +23 -0
- package/dist/components/modules/three-entries.d.ts.map +1 -0
- package/dist/components/modules/three-entries.js +41 -0
- package/dist/components/modules/three-entries.js.map +1 -0
- package/dist/components/modules/view3d.d.ts +59 -0
- package/dist/components/modules/view3d.d.ts.map +1 -0
- package/dist/components/modules/view3d.js +171 -0
- package/dist/components/modules/view3d.js.map +1 -0
- package/dist/components/trees/2d/group-bounds.d.ts +56 -0
- package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
- package/dist/components/trees/2d/group-bounds.js +87 -0
- package/dist/components/trees/2d/group-bounds.js.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
- package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
- package/dist/components/trees/2d/node-lifecycle.js +264 -0
- package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
- package/dist/components/trees/2d/node-motion.d.ts +56 -0
- package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
- package/dist/components/trees/2d/node-motion.js +86 -0
- package/dist/components/trees/2d/node-motion.js.map +1 -0
- package/dist/components/trees/2d/node-render.d.ts +36 -0
- package/dist/components/trees/2d/node-render.d.ts.map +1 -0
- package/dist/components/trees/2d/node-render.js +67 -0
- package/dist/components/trees/2d/node-render.js.map +1 -0
- package/dist/components/trees/2d/node-space.d.ts +63 -0
- package/dist/components/trees/2d/node-space.d.ts.map +1 -0
- package/dist/components/trees/2d/node-space.js +131 -0
- package/dist/components/trees/2d/node-space.js.map +1 -0
- package/dist/components/trees/2d/node-transform.d.ts +55 -0
- package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
- package/dist/components/trees/2d/node-transform.js +73 -0
- package/dist/components/trees/2d/node-transform.js.map +1 -0
- package/dist/components/trees/2d/node2d.d.ts +1020 -0
- package/dist/components/trees/2d/node2d.d.ts.map +1 -0
- package/dist/components/trees/2d/node2d.js +1481 -0
- package/dist/components/trees/2d/node2d.js.map +1 -0
- package/dist/components/trees/audio/index.d.ts +2 -0
- package/dist/components/trees/audio/index.d.ts.map +1 -0
- package/dist/components/trees/audio/index.js +2 -0
- package/dist/components/trees/audio/index.js.map +1 -0
- package/dist/components/trees/audio/node-audio.d.ts +116 -0
- package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
- package/dist/components/trees/audio/node-audio.js +171 -0
- package/dist/components/trees/audio/node-audio.js.map +1 -0
- package/dist/components/trees/index.d.ts +10 -0
- package/dist/components/trees/index.d.ts.map +1 -0
- package/dist/components/trees/index.js +14 -0
- package/dist/components/trees/index.js.map +1 -0
- package/dist/components/trees/node/node-editor-state.d.ts +53 -0
- package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
- package/dist/components/trees/node/node-editor-state.js +23 -0
- package/dist/components/trees/node/node-editor-state.js.map +1 -0
- package/dist/components/trees/node/node-reactive.d.ts +89 -0
- package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
- package/dist/components/trees/node/node-reactive.js +135 -0
- package/dist/components/trees/node/node-reactive.js.map +1 -0
- package/dist/components/trees/node/node-time.d.ts +39 -0
- package/dist/components/trees/node/node-time.d.ts.map +1 -0
- package/dist/components/trees/node/node-time.js +14 -0
- package/dist/components/trees/node/node-time.js.map +1 -0
- package/dist/components/trees/node/node-walk.d.ts +46 -0
- package/dist/components/trees/node/node-walk.d.ts.map +1 -0
- package/dist/components/trees/node/node-walk.js +74 -0
- package/dist/components/trees/node/node-walk.js.map +1 -0
- package/dist/components/trees/node/node.d.ts +401 -0
- package/dist/components/trees/node/node.d.ts.map +1 -0
- package/dist/components/trees/node/node.js +680 -0
- package/dist/components/trees/node/node.js.map +1 -0
- package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
- package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
- package/dist/components/trees/root/canvas2d-node.js +216 -0
- package/dist/components/trees/root/canvas2d-node.js.map +1 -0
- package/dist/components/trees/three/node3d.d.ts +222 -0
- package/dist/components/trees/three/node3d.d.ts.map +1 -0
- package/dist/components/trees/three/node3d.js +289 -0
- package/dist/components/trees/three/node3d.js.map +1 -0
- package/dist/document/builtins.js +13 -13
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +14 -4
- package/dist/document/command-traits.d.ts.map +1 -1
- package/dist/document/command-traits.js +35 -7
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.d.ts +2 -2
- package/dist/document/deny-globals.js +2 -2
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/expression/index.d.ts +1 -1
- package/dist/document/expression/index.js +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/index.d.ts +9 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +5 -2
- package/dist/document/index.js.map +1 -1
- package/dist/document/migrate.d.ts +70 -0
- package/dist/document/migrate.d.ts.map +1 -0
- package/dist/document/migrate.js +202 -0
- package/dist/document/migrate.js.map +1 -0
- package/dist/document/missing-node.d.ts +27 -0
- package/dist/document/missing-node.d.ts.map +1 -0
- package/dist/document/missing-node.js +48 -0
- package/dist/document/missing-node.js.map +1 -0
- package/dist/document/node-decorator.d.ts +14 -10
- package/dist/document/node-decorator.d.ts.map +1 -1
- package/dist/document/node-decorator.js +14 -10
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +7 -3
- 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 +2 -1
- package/dist/document/placement.d.ts.map +1 -1
- package/dist/document/placement.js.map +1 -1
- package/dist/document/project.d.ts +2 -0
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js +1 -0
- package/dist/document/project.js.map +1 -1
- package/dist/document/prop-evolution.d.ts +51 -0
- package/dist/document/prop-evolution.d.ts.map +1 -0
- package/dist/document/prop-evolution.js +83 -0
- package/dist/document/prop-evolution.js.map +1 -0
- package/dist/document/registry.d.ts +39 -25
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +41 -21
- package/dist/document/registry.js.map +1 -1
- package/dist/document/settled-index.d.ts +2 -0
- package/dist/document/settled-index.d.ts.map +1 -1
- package/dist/document/settled-index.js +5 -5
- package/dist/document/settled-index.js.map +1 -1
- package/dist/document/timeline-patch.d.ts +4 -0
- package/dist/document/timeline-patch.d.ts.map +1 -1
- package/dist/document/timeline-patch.js +28 -3
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +48 -4
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +174 -44
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +18 -32
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +18 -6
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +158 -21
- package/dist/document/validate.js.map +1 -1
- package/dist/document/vocabulary.d.ts +28 -0
- package/dist/document/vocabulary.d.ts.map +1 -0
- package/dist/document/vocabulary.js +42 -0
- package/dist/document/vocabulary.js.map +1 -0
- package/dist/experimental.d.ts +79 -19
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +31 -17
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/types.d.ts +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -0
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/props/host.d.ts +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/slot.d.ts +1 -1
- package/dist/props/slot.js +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +1 -1
- package/dist/renamed-scene-names.d.ts.map +1 -1
- package/dist/renamed-scene-names.js +1 -1
- package/dist/renamed-scene-names.js.map +1 -1
- package/dist/render/canvas-render-context2d.d.ts +9 -0
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js +10 -0
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.d.ts +1 -1
- package/dist/render/clip.js +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +13 -7
- package/dist/render/descriptors/text.d.ts.map +1 -1
- package/dist/render/descriptors/text.js +9 -3
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +1 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/render-context2d.d.ts +3 -3
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/render-issue.d.ts +39 -0
- package/dist/render/render-issue.d.ts.map +1 -0
- package/dist/render/render-issue.js +29 -0
- package/dist/render/render-issue.js.map +1 -0
- package/dist/render/surface.d.ts +2 -2
- package/dist/render/surface.js.map +1 -1
- package/dist/render3d/builders.d.ts +1 -1
- package/dist/render3d/builders.js +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +13 -19
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +67 -24
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +1 -1
- package/dist/render3d/scene3d.js +1 -1
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/texture.d.ts +2 -2
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/vector3.d.ts +2 -2
- package/dist/render3d/vector3.js +2 -2
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/runtime/asset-refine.d.ts +1 -1
- package/dist/runtime/asset-refine.d.ts.map +1 -1
- package/dist/runtime/asset-refine.js +3 -2
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.d.ts +10 -0
- package/dist/runtime/asset-timeline.d.ts.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.d.ts.map +1 -1
- package/dist/runtime/asset-update.js +8 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.d.ts +0 -11
- package/dist/runtime/audio-index.d.ts.map +1 -1
- package/dist/runtime/audio-index.js +0 -25
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +6 -4
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +8 -4
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +2 -3
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +34 -37
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +8 -6
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +4 -3
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +2 -2
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +3 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -2
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +1 -1
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +2 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +15 -5
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/session.d.ts +7 -3
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +11 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +2 -2
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.d.ts +2 -2
- package/dist/runtime/text-geometry.d.ts.map +1 -1
- package/dist/runtime/text-geometry.js +4 -5
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +50 -44
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +35 -29
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +14 -9
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js +3 -2
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.d.ts +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +2 -0
- package/dist/tween/ease/describe.d.ts.map +1 -1
- package/dist/tween/ease/describe.js +4 -0
- package/dist/tween/ease/describe.js.map +1 -1
- package/dist/tween/ease/spec.d.ts +31 -0
- package/dist/tween/ease/spec.d.ts.map +1 -0
- package/dist/tween/ease/spec.js +51 -0
- package/dist/tween/ease/spec.js.map +1 -0
- package/dist/tween/index.d.ts +3 -1
- package/dist/tween/index.d.ts.map +1 -1
- package/dist/tween/index.js +2 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/loop.d.ts +1 -1
- package/dist/tween/loop.js +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/util/reference.d.ts +6 -6
- package/dist/util/reference.js.map +1 -1
- package/package.json +3 -11
- package/dist/browser/chunks/chunk-2RIYH36X.js +0 -3
- package/dist/browser/chunks/chunk-2RIYH36X.js.map +0 -7
- package/dist/browser/chunks/chunk-DDJN3QII.js +0 -15
- package/dist/browser/chunks/chunk-DDJN3QII.js.map +0 -7
- package/dist/browser/chunks/chunk-DHB4COFY.js +0 -2
- package/dist/browser/chunks/chunk-EJDPYDQI.js +0 -5
- package/dist/browser/chunks/chunk-EJDPYDQI.js.map +0 -7
- package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
- package/dist/browser/chunks/chunk-XAWE4EAK.js +0 -2
- package/dist/browser/chunks/chunk-XAWE4EAK.js.map +0 -7
- package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
- package/dist/browser/jsx-jsx-dev-runtime.js.map +0 -7
- package/dist/browser/jsx-jsx-runtime.js +0 -2
- package/dist/browser/jsx-jsx-runtime.js.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../../src/attributes/shape/path/ops.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EACH,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EACpE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,GACrD,MAAM,WAAW,CAAC;AAoEnB,MAAM,CAAC,MAAM,OAAO,GAA+C;IAC/D,6DAA6D;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IACzB,IAAI;IAEJ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IAEP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,OAAO;IAEP,IAAI;IACJ,IAAI;IACJ,SAAS;IAET,IAAI;IACJ,MAAM;IAEN,WAAW;IACX,cAAc;IACd,YAAY;IACZ,GAAG;IACH,SAAS;IACT,MAAM;IACN,OAAO;IAEP,SAAS;IACT,QAAQ;IACR,OAAO;IACP,KAAK;CACR,CAAC","sourcesContent":["/**\r\n * Every path-geometry operation, on one object.\r\n *\r\n * `pathOps` was already the path attribute's `resolve`/`lerp` pair; it now\r\n * carries the rest, which is the repo's existing shape for an attribute whose\r\n * operations go past interpolation — `insetsOps` is `AttributeOps & InsetsOps`,\r\n * `alignmentOps` is `AttributeOps & AlignmentOps`, `cornerRadiusOps` the same.\r\n * Every `Types.path` entry is untouched by the addition.\r\n *\r\n * Behind it is **one** pen walk. There were seven — one each in `bounds`,\r\n * `length`, `dash`, `sampler`, `subpath`, `morph` and the editor's vector model\r\n * — and they disagreed about where `Z` leaves the cursor, which control point an\r\n * `S`/`T` reflects, and what an arc is. The pipeline is now:\r\n *\r\n * PathData ── commands ──▶ PathCommand[] ── contours ──▶ PathContour[]\r\n * │\r\n * bounds · size · length · sampler · dash · trim ◀─────┤\r\n * cubics ── morph ◀──────────┤\r\n * anchors ── editing ◀────────┘\r\n *\r\n * `cubics` and `anchors` are the only two places geometry is flattened to a\r\n * single curve type, because a morph needs one segment kind to pair up and\r\n * nobody can drag an arc's handles. Everything that measures keeps the arc.\r\n *\r\n * Each method is the module function of the same name, so a call site and its\r\n * implementation are one grep apart.\r\n */\r\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\r\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\r\n\r\nimport { bounds, commands, contours, size } from \"./walk\";\r\nimport { dash, dashScale, length, sampler, trim } from \"./measure\";\r\nimport { cubics, lerp, plan, sample } from \"./morph\";\r\nimport {\r\n anchorBounds, anchorCommands, anchors, endFit, fitToBox, fromAnchors,\r\n isEmpty, map, normalize, pointOn, split, translate,\r\n} from \"./anchors\";\r\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\r\nimport type { Extents } from \"@/layout/bounds\";\r\nimport { PathContour, CubicSubpath, VectorPath, PathSampler, MorphPlan, PathNormalization, PathAnchor } from \"./types\";\r\n\r\n\r\n/** The path attribute's operations beyond `resolve`/`lerp`. */\r\nexport interface PathOps {\r\n // ── Reading ────────────────────────────────────────────────────────────\r\n /** Parse. A `PathCommand[]` passes through by reference; nullish gives `[]`. */\r\n commands(d: PathData | null | undefined): PathCommand[];\r\n /** The normal form: absolute, shorthands expanded, grouped into contours. */\r\n contours(d: PathData | null | undefined): PathContour[];\r\n /** All-cubic form. Lossy for arcs — one of the two flattening boundaries. */\r\n cubics(d: PathData | null | undefined): CubicSubpath[];\r\n /** The editable anchor model. Lossy for arcs — the other boundary. */\r\n anchors(d: PathData | null | undefined): VectorPath;\r\n\r\n // ── Measuring ──────────────────────────────────────────────────────────\r\n /** Tight box: each segment's own extrema, not its control hull. */\r\n bounds(d: PathData | null | undefined): Extents | null;\r\n /** {@link bounds} as a size; `0 x 0` for an empty path. */\r\n size(d: PathData | null | undefined): { width: number; height: number };\r\n /** Total arc length. An arc is measured along the arc, not across its chord. */\r\n length(d: PathData | null | undefined): number;\r\n /** Point and unit tangent at a distance along the path. */\r\n sampler(d: PathData): PathSampler;\r\n\r\n // ── Rewriting ──────────────────────────────────────────────────────────\r\n /** The portion between two arc-length fractions. Works on strings. */\r\n trim(d: PathData, start: number, end: number): PathData;\r\n /** Only the \"on\" runs of a dash pattern, fit as the renderer fits it, as a `d` string. */\r\n dash(d: PathData | null | undefined, pattern: number[], offset?: number): string;\r\n /** How far a pattern is stretched to fit one contour of a path — see `dash`. */\r\n dashScale(pattern: number[], contour: { length: number; closed: boolean }, total: number): number | null;\r\n\r\n // ── Morphing ───────────────────────────────────────────────────────────\r\n /** A reusable correspondence between two paths. Expensive; `lerp` caches one. */\r\n plan(from: PathCommand[], to: PathCommand[]): MorphPlan;\r\n /** Sample a plan at `t`. Cheap. */\r\n sample(plan: MorphPlan, t: number): PathCommand[];\r\n\r\n // ── The anchor model ───────────────────────────────────────────────────\r\n /** Anchors back to a `d` string. Emits only `M`/`L`/`C`/`Z`. */\r\n fromAnchors(path: VectorPath): string;\r\n /** Anchors to commands, with a transform folded into the same pass. */\r\n anchorCommands(path: VectorPath, transform?: (p: Vector2) => Vector2): PathCommand[];\r\n /** Tight box of an anchor path. */\r\n anchorBounds(path: VectorPath): Extents | null;\r\n /** Every point and handle mapped. */\r\n map(path: VectorPath, fn: (p: Vector2) => Vector2): VectorPath;\r\n translate(path: VectorPath, delta: Vector2): VectorPath;\r\n /** The turn-and-scale about `start` carrying `end` onto `to` — a `map` fn. */\r\n endFit(start: Vector2, end: Vector2, to: Vector2): (p: Vector2) => Vector2;\r\n isEmpty(path: VectorPath): boolean;\r\n\r\n // ── The unit box ───────────────────────────────────────────────────────\r\n /** Re-quote against the geometry's own bounds. */\r\n normalize(path: VectorPath): PathNormalization;\r\n /** Re-quote against a stated box — the general form of {@link PathOps.normalize}. */\r\n fitToBox(path: VectorPath, box: Extents): PathNormalization;\r\n /** A point on the segment between two anchors, for hit-testing an insert. */\r\n pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2;\r\n /** De Casteljau split, so inserting an anchor does not move the curve. */\r\n split(from: PathAnchor, to: PathAnchor, t: number): { from: PathAnchor; middle: PathAnchor; to: PathAnchor };\r\n}\r\n\r\n\r\nexport const pathOps: AttributeOps<PathData, PathData> & PathOps = {\r\n // An SVG path string or command list needs no normalization.\r\n resolve: (value) => value,\r\n lerp,\r\n\r\n commands,\r\n contours,\r\n cubics,\r\n anchors,\r\n\r\n bounds,\r\n size,\r\n length,\r\n sampler,\r\n\r\n trim,\r\n dash,\r\n dashScale,\r\n\r\n plan,\r\n sample,\r\n\r\n fromAnchors,\r\n anchorCommands,\r\n anchorBounds,\r\n map,\r\n translate,\r\n endFit,\r\n isEmpty,\r\n\r\n normalize,\r\n fitToBox,\r\n pointOn,\r\n split,\r\n};\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC","sourcesContent":["export * from \"./pack\";\r\nexport * from \"./resolve\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC","sourcesContent":["export * from \"./language\";\r\nexport * from \"./pack\";\r\nexport * from \"./resolve\";\r\nexport * from \"./uniforms\";\r\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The language a custom shader is written in: WGSL, the only one the renderer
|
|
3
|
+
* runs. A fill defines `fn fill(in: FillIn) -> vec4f`, an effect
|
|
4
|
+
* `fn effect(in: EffectIn) -> vec4f`; uniforms are the members of
|
|
5
|
+
* `struct Params`, read as `u.<name>`.
|
|
6
|
+
*/
|
|
7
|
+
export type ShaderLanguage = "wgsl";
|
|
8
|
+
/** Whether a shader fill, shader effect or shader pack is WGSL: its `language` is absent or `"wgsl"`. */
|
|
9
|
+
export declare function isWgslShader(shader: {
|
|
10
|
+
language?: string;
|
|
11
|
+
}): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The version of the WGSL contract a shader is written against: `FillIn` /
|
|
14
|
+
* `EffectIn`, the helpers, and uniforms bound to `struct Params` by name
|
|
15
|
+
* (packages/renderer/DESIGN.md §6.3). Bumped only by a change that would draw
|
|
16
|
+
* an existing shader differently. A WGSL fill or effect resolves with
|
|
17
|
+
* `contract` set (stamped with this when absent), so a stored document says
|
|
18
|
+
* what it was written for and a renderer can tell a newer one apart.
|
|
19
|
+
*/
|
|
20
|
+
export declare const WGSL_CONTRACT = 1;
|
|
21
|
+
/** The contract a shader states, or the current one for a WGSL shader that states none; `undefined` for any other language. */
|
|
22
|
+
export declare function shaderContractOf(shader: {
|
|
23
|
+
language?: string;
|
|
24
|
+
contract?: number;
|
|
25
|
+
}): number | undefined;
|
|
26
|
+
//# sourceMappingURL=language.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/language.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,yGAAyG;AACzG,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAEnE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,+HAA+H;AAC/H,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAGrG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Whether a shader fill, shader effect or shader pack is WGSL: its `language` is absent or `"wgsl"`. */
|
|
2
|
+
export function isWgslShader(shader) {
|
|
3
|
+
return shader.language === undefined || shader.language === "wgsl";
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The version of the WGSL contract a shader is written against: `FillIn` /
|
|
7
|
+
* `EffectIn`, the helpers, and uniforms bound to `struct Params` by name
|
|
8
|
+
* (packages/renderer/DESIGN.md §6.3). Bumped only by a change that would draw
|
|
9
|
+
* an existing shader differently. A WGSL fill or effect resolves with
|
|
10
|
+
* `contract` set (stamped with this when absent), so a stored document says
|
|
11
|
+
* what it was written for and a renderer can tell a newer one apart.
|
|
12
|
+
*/
|
|
13
|
+
export const WGSL_CONTRACT = 1;
|
|
14
|
+
/** The contract a shader states, or the current one for a WGSL shader that states none; `undefined` for any other language. */
|
|
15
|
+
export function shaderContractOf(shader) {
|
|
16
|
+
if (!isWgslShader(shader))
|
|
17
|
+
return undefined;
|
|
18
|
+
return shader.contract ?? WGSL_CONTRACT;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=language.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/language.ts"],"names":[],"mappings":"AAQA,yGAAyG;AACzG,MAAM,UAAU,YAAY,CAAC,MAA6B;IACtD,OAAO,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC;AACvE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,+HAA+H;AAC/H,MAAM,UAAU,gBAAgB,CAAC,MAAgD;IAC7E,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5C,OAAO,MAAM,CAAC,QAAQ,IAAI,aAAa,CAAC;AAC5C,CAAC","sourcesContent":["/**\r\n * The language a custom shader is written in: WGSL, the only one the renderer\r\n * runs. A fill defines `fn fill(in: FillIn) -> vec4f`, an effect\r\n * `fn effect(in: EffectIn) -> vec4f`; uniforms are the members of\r\n * `struct Params`, read as `u.<name>`.\r\n */\r\nexport type ShaderLanguage = \"wgsl\";\r\n\r\n/** Whether a shader fill, shader effect or shader pack is WGSL: its `language` is absent or `\"wgsl\"`. */\r\nexport function isWgslShader(shader: { language?: string }): boolean {\r\n return shader.language === undefined || shader.language === \"wgsl\";\r\n}\r\n\r\n/**\r\n * The version of the WGSL contract a shader is written against: `FillIn` /\r\n * `EffectIn`, the helpers, and uniforms bound to `struct Params` by name\r\n * (packages/renderer/DESIGN.md §6.3). Bumped only by a change that would draw\r\n * an existing shader differently. A WGSL fill or effect resolves with\r\n * `contract` set (stamped with this when absent), so a stored document says\r\n * what it was written for and a renderer can tell a newer one apart.\r\n */\r\nexport const WGSL_CONTRACT = 1;\r\n\r\n/** The contract a shader states, or the current one for a WGSL shader that states none; `undefined` for any other language. */\r\nexport function shaderContractOf(shader: { language?: string; contract?: number }): number | undefined {\r\n if (!isWgslShader(shader)) return undefined;\r\n return shader.contract ?? WGSL_CONTRACT;\r\n}\r\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ShaderUniformRecord } from "./uniforms.js";
|
|
2
|
+
import type { ShaderLanguage } from "./language.js";
|
|
2
3
|
/**
|
|
3
4
|
* A **shader pack**: a program, plus what a host may edit about it.
|
|
4
5
|
*
|
|
@@ -9,9 +10,9 @@ import type { ShaderFillCoords, SkSLUniformRecord } from "../sksl-uniforms.js";
|
|
|
9
10
|
* to offer a slider had to keep that table itself, beside a program it did not
|
|
10
11
|
* own.
|
|
11
12
|
*
|
|
12
|
-
* **Two scopes, one shape.** A fill paints inside a shape's path and
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* **Two scopes, one shape.** A fill paints inside a shape's path and may sample
|
|
14
|
+
* textures; an effect paints over a layer and may sample what is beneath it.
|
|
15
|
+
* Those are the only two differences, and making them arms of a union rather
|
|
15
16
|
* than optional fields on one type is what makes `Fills.shader(anEffectShader)`
|
|
16
17
|
* a compile error instead of a program that fails at the first frame.
|
|
17
18
|
*/
|
|
@@ -32,25 +33,38 @@ export interface ShaderBase {
|
|
|
32
33
|
id?: string;
|
|
33
34
|
name: string;
|
|
34
35
|
description?: string;
|
|
35
|
-
/**
|
|
36
|
+
/** The language `source` is written in; normalising a pack stamps WGSL when absent. */
|
|
37
|
+
language?: ShaderLanguage;
|
|
38
|
+
/**
|
|
39
|
+
* The program. In WGSL, a fill defines `fn fill(in: FillIn) -> vec4f` and an
|
|
40
|
+
* effect `fn effect(in: EffectIn) -> vec4f`, and the uniforms are the
|
|
41
|
+
* members of `struct Params` (types, layout and all); `properties` name
|
|
42
|
+
* those members in their `inputs`.
|
|
43
|
+
*/
|
|
36
44
|
source: string;
|
|
37
45
|
/** Uniform values the properties do not cover, by name. */
|
|
38
|
-
uniforms?:
|
|
46
|
+
uniforms?: ShaderUniformRecord;
|
|
39
47
|
/** The editable values, by property id. */
|
|
40
48
|
properties: Record<string, ShaderProperty>;
|
|
41
49
|
}
|
|
42
50
|
/** A shader that paints inside a shape's path. */
|
|
43
51
|
export interface FillShader extends ShaderBase {
|
|
44
52
|
scope: "fill";
|
|
45
|
-
/**
|
|
46
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The images the program samples, by name. In WGSL, `sample_texture(uv)`
|
|
55
|
+
* samples the first; the fill that applies the pack supplies each `src`.
|
|
56
|
+
*/
|
|
57
|
+
textures?: readonly {
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
}[];
|
|
47
61
|
}
|
|
48
62
|
/** A shader that paints over a layer. */
|
|
49
63
|
export interface EffectShader extends ShaderBase {
|
|
50
64
|
scope: "effect";
|
|
51
65
|
/**
|
|
52
|
-
* Whether the
|
|
53
|
-
*
|
|
66
|
+
* Whether the program is meant to run on the backdrop path, where
|
|
67
|
+
* `sample_src` reads what is beneath the node rather than its own layer.
|
|
54
68
|
*
|
|
55
69
|
* A fact about the **program**, which is why it lives here rather than on
|
|
56
70
|
* the effect instance: the instance keeps `mode`, the cross-cutting field
|
|
@@ -102,7 +116,7 @@ export interface HueProperty extends ShaderPropertyBase {
|
|
|
102
116
|
kind: "hue";
|
|
103
117
|
default: number;
|
|
104
118
|
}
|
|
105
|
-
/** Written to its uniform as 1 or 0
|
|
119
|
+
/** Written to its uniform as 1 or 0, since a `bool` cannot be a uniform member in WGSL. */
|
|
106
120
|
export interface BooleanProperty extends ShaderPropertyBase {
|
|
107
121
|
kind: "boolean";
|
|
108
122
|
default: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;AAE/C,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,C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OAAO,CAAC;IAClB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAMD,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,QAAQ,IAAI,mBAAmB,CAE/F;AAED,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAsD1D"}
|
|
@@ -37,23 +37,28 @@ export function normalizeShaderPack(input) {
|
|
|
37
37
|
throw new Error(`Shader pack "${String(raw.name ?? "?")}" source is ${source.length} characters, ` +
|
|
38
38
|
`over the ${MAX_SHADER_SOURCE} ceiling.`);
|
|
39
39
|
}
|
|
40
|
+
if (raw.language !== undefined && raw.language !== "wgsl") {
|
|
41
|
+
throw new Error(`Shader pack "${String(raw.name ?? "?")}" is written in ${JSON.stringify(raw.language)}; ` +
|
|
42
|
+
`only WGSL is supported. Port it to WGSL.`);
|
|
43
|
+
}
|
|
40
44
|
const base = {
|
|
41
45
|
...(typeof raw.$kind === "string" ? { $kind: raw.$kind } : {}),
|
|
42
46
|
...(typeof raw.id === "string" ? { id: raw.id } : {}),
|
|
43
47
|
name: typeof raw.name === "string" && raw.name !== "" ? raw.name : "Shader",
|
|
44
48
|
...(typeof raw.description === "string" ? { description: raw.description } : {}),
|
|
49
|
+
language: "wgsl",
|
|
45
50
|
source,
|
|
46
51
|
...(isRecord(raw.uniforms) ? { uniforms: raw.uniforms } : {}),
|
|
47
52
|
properties: normalizeProperties(raw.properties, String(raw.name ?? "?")),
|
|
48
53
|
};
|
|
49
54
|
if (scope === "fill") {
|
|
50
|
-
const
|
|
55
|
+
const textures = Array.isArray(raw.textures)
|
|
56
|
+
? raw.textures.filter((t) => isRecord(t) && typeof t.name === "string").map((t) => ({ name: t.name, ...(typeof t.description === "string" ? { description: t.description } : {}) }))
|
|
57
|
+
: [];
|
|
51
58
|
return {
|
|
52
59
|
...base,
|
|
53
60
|
scope: "fill",
|
|
54
|
-
...(
|
|
55
|
-
? { coords }
|
|
56
|
-
: {}),
|
|
61
|
+
...(textures.length ? { textures } : {}),
|
|
57
62
|
};
|
|
58
63
|
}
|
|
59
64
|
return { ...base, scope: "effect", ...(raw.backdrop === true ? { backdrop: true } : {}) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAqKA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IACxB,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;CAC5E,CAAC,CAAC;AAEH,gEAAgE;AAChE,MAAM,UAAU,qBAAqB,CAAC,QAAwB;IAC1D,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACxB,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACX,qDAAqD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI;YAC9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Q,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,6EAA6E;AAC7E,SAAS,IAAI,CAAC,OAAe;IACzB,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAChC,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG;QAAE,MAAM,CAAC,KAAK,EAAE,CAAC;IACtC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import type { ShaderFillCoords, SkSLUniformRecord } from \"../sksl-uniforms\";\r\n\r\n/**\r\n * A **shader pack**: a program, plus what a host may edit about it.\r\n *\r\n * The interchange format for a shader — authored as JSON, imported as a value,\r\n * handed to `Fills.shader` or `Effects.shader`. It exists because a bare source\r\n * string says nothing about which of its uniforms are meant to be touched, what\r\n * they are called in a panel, or what range they take, so every host that wanted\r\n * to offer a slider had to keep that table itself, beside a program it did not\r\n * own.\r\n *\r\n * **Two scopes, one shape.** A fill paints inside a shape's path and takes a\r\n * `coords` matrix; an effect paints over a layer and may sample what is beneath\r\n * it. Those are the only two differences, and making them arms of a union rather\r\n * than optional fields on one type is what makes `Fills.shader(anEffectShader)`\r\n * a compile error instead of a program that fails at the first frame.\r\n */\r\nexport type Shader = FillShader | EffectShader;\r\n\r\n/** What both scopes carry. */\r\nexport interface ShaderBase {\r\n /**\r\n * Format tag, so a file that is not one of these can be told apart from one\r\n * that is merely from a newer version.\r\n */\r\n $kind?: string;\r\n /**\r\n * Provenance, when the pack came from a library row. **Not** how it is\r\n * registered — `Registry.addShader` takes the key separately, exactly as\r\n * `Registry.addNode` does, so the same file can be registered under whatever\r\n * name a project wants and the file itself stays portable.\r\n */\r\n id?: string;\r\n name: string;\r\n description?: string;\r\n /** SkSL source. */\r\n source: string;\r\n /** Uniform values the properties do not cover, by name. */\r\n uniforms?: SkSLUniformRecord;\r\n /** The editable values, by property id. */\r\n properties: Record<string, ShaderProperty>;\r\n}\r\n\r\n/** A shader that paints inside a shape's path. */\r\nexport interface FillShader extends ShaderBase {\r\n scope: \"fill\";\r\n /** How the shape's box maps onto the coordinates `main` receives. */\r\n coords?: ShaderFillCoords;\r\n}\r\n\r\n/** A shader that paints over a layer. */\r\nexport interface EffectShader extends ShaderBase {\r\n scope: \"effect\";\r\n /**\r\n * Whether the source declares `uniform shader u_backdrop` and so has to run\r\n * on the backdrop path.\r\n *\r\n * A fact about the **program**, which is why it lives here rather than on\r\n * the effect instance: the instance keeps `mode`, the cross-cutting field\r\n * five generic consumers read without knowing what type they hold. The\r\n * builder maps this to `mode: \"backdrop\"` as the default and a caller may\r\n * still override it.\r\n */\r\n backdrop?: boolean;\r\n}\r\n\r\n/** One editable value. */\r\nexport type ShaderProperty = KnownShaderProperty | UnknownShaderProperty;\r\n\r\nexport type KnownShaderProperty =\r\n | NumberProperty\r\n | SliderProperty\r\n | AngleProperty\r\n | HueProperty\r\n | BooleanProperty\r\n | ColorProperty\r\n | VectorProperty\r\n | PointProperty;\r\n\r\ninterface ShaderPropertyBase {\r\n /** What a panel calls it. Falls back to the property id. */\r\n name?: string;\r\n /**\r\n * The uniform each of this property's components writes.\r\n *\r\n * The composite mechanism, and the reason a property is not just a uniform\r\n * under another name: one editable value may span several uniforms. A\r\n * scalar names one component, `value`; a point may name `value` for a\r\n * `float2`, or `x` and `y` for two separate floats.\r\n */\r\n inputs: Record<string, string>;\r\n}\r\n\r\n/** A scalar, drawn as a number input. */\r\nexport interface NumberProperty extends ShaderPropertyBase {\r\n kind: \"number\";\r\n default: number;\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n}\r\n\r\n/** A scalar with a bounded range, drawn as a slider. */\r\nexport interface SliderProperty extends ShaderPropertyBase {\r\n kind: \"slider\";\r\n default: number;\r\n min: number;\r\n max: number;\r\n step?: number;\r\n}\r\n\r\n/** Degrees, matching every other angle in the library. */\r\nexport interface AngleProperty extends ShaderPropertyBase {\r\n kind: \"angle\";\r\n default: number;\r\n}\r\n\r\n/** Degrees around the colour wheel. */\r\nexport interface HueProperty extends ShaderPropertyBase {\r\n kind: \"hue\";\r\n default: number;\r\n}\r\n\r\n/** Written to its uniform as 1 or 0 — SkSL has no bool uniform worth relying on. */\r\nexport interface BooleanProperty extends ShaderPropertyBase {\r\n kind: \"boolean\";\r\n default: boolean;\r\n}\r\n\r\n/** RGBA in 0–1. A CSS string is accepted and parsed, so theme tokens work. */\r\nexport interface ColorProperty extends ShaderPropertyBase {\r\n kind: \"color\";\r\n default: string | readonly number[];\r\n}\r\n\r\n/** A fixed-width run of floats. */\r\nexport interface VectorProperty extends ShaderPropertyBase {\r\n kind: \"vector\";\r\n default: readonly number[];\r\n}\r\n\r\n/** Two floats, as one `float2` or as separate `x`/`y` uniforms. */\r\nexport interface PointProperty extends ShaderPropertyBase {\r\n kind: \"point\";\r\n default: readonly number[] | { x: number; y: number };\r\n}\r\n\r\n/**\r\n * A property whose kind this version of the vocabulary does not name.\r\n *\r\n * Open at the edges on purpose: a pack written against a newer version should\r\n * draw the controls a host knows and say so about the rest, instead of\r\n * failing to load at all.\r\n *\r\n * An unknown property is still *resolved* — its `default` is written to its\r\n * `inputs` unchanged — so a shader whose panel a host cannot fully draw still\r\n * renders correctly.\r\n */\r\nexport interface UnknownShaderProperty extends ShaderPropertyBase {\r\n kind: string;\r\n default?: unknown;\r\n [option: string]: unknown;\r\n}\r\n\r\nconst KNOWN_KINDS = new Set([\r\n \"number\", \"slider\", \"angle\", \"hue\", \"boolean\", \"color\", \"vector\", \"point\",\r\n]);\r\n\r\n/** Whether `property` is one this version knows how to draw. */\r\nexport function isKnownShaderProperty(property: ShaderProperty): property is KnownShaderProperty {\r\n return KNOWN_KINDS.has(property.kind);\r\n}\r\n\r\n/** Ceiling on properties in one pack, so a malformed import cannot exhaust a host. */\r\nexport const MAX_SHADER_PROPERTIES = 64;\r\n\r\n/** Ceiling on source length, matching what a compile cache can reasonably hold. */\r\nexport const MAX_SHADER_SOURCE = 64_000;\r\n\r\n/**\r\n * Validate and normalise an authored pack.\r\n *\r\n * **Throws** when the pack is structurally not one — no source, no usable\r\n * scope — because there is nothing to render and a silent empty shader is a\r\n * blank frame with no explanation. **Warns and drops** an individual malformed\r\n * property, because the rest of the shader still works and a panel missing one\r\n * control is a better answer than a scene that will not build. That split is the\r\n * same one `normalizeUniforms` makes.\r\n */\r\nexport function normalizeShaderPack(input: unknown): Shader {\r\n if (typeof input !== \"object\" || input === null) {\r\n throw new Error(\"A shader pack must be an object.\");\r\n }\r\n const raw = input as Record<string, unknown>;\r\n\r\n const scope = raw.scope;\r\n if (scope !== \"fill\" && scope !== \"effect\") {\r\n throw new Error(\r\n `A shader pack needs scope \"fill\" or \"effect\", got ${JSON.stringify(scope)}. ` +\r\n `The two are written against different contracts — a fill has no backdrop to ` +\r\n `sample and an effect has no shape box to map coordinates onto.`,\r\n );\r\n }\r\n\r\n const source = typeof raw.source === \"string\" ? raw.source.trim() : \"\";\r\n if (source === \"\") throw new Error(`Shader pack \"${String(raw.name ?? \"?\")}\" has no source.`);\r\n if (source.length > MAX_SHADER_SOURCE) {\r\n throw new Error(\r\n `Shader pack \"${String(raw.name ?? \"?\")}\" source is ${source.length} characters, ` +\r\n `over the ${MAX_SHADER_SOURCE} ceiling.`,\r\n );\r\n }\r\n\r\n const base: ShaderBase = {\r\n ...(typeof raw.$kind === \"string\" ? { $kind: raw.$kind } : {}),\r\n ...(typeof raw.id === \"string\" ? { id: raw.id } : {}),\r\n name: typeof raw.name === \"string\" && raw.name !== \"\" ? raw.name : \"Shader\",\r\n ...(typeof raw.description === \"string\" ? { description: raw.description } : {}),\r\n source,\r\n ...(isRecord(raw.uniforms) ? { uniforms: raw.uniforms as SkSLUniformRecord } : {}),\r\n properties: normalizeProperties(raw.properties, String(raw.name ?? \"?\")),\r\n };\r\n\r\n if (scope === \"fill\") {\r\n const coords = raw.coords;\r\n return {\r\n ...base,\r\n scope: \"fill\",\r\n ...(coords === \"normalized\" || coords === \"centered\" || coords === \"local\"\r\n ? { coords }\r\n : {}),\r\n };\r\n }\r\n return { ...base, scope: \"effect\", ...(raw.backdrop === true ? { backdrop: true } : {}) };\r\n}\r\n\r\nfunction normalizeProperties(input: unknown, where: string): Record<string, ShaderProperty> {\r\n if (!isRecord(input)) return {};\r\n const out: Record<string, ShaderProperty> = {};\r\n const claimed = new Map<string, string>();\r\n\r\n for (const [id, value] of Object.entries(input)) {\r\n if (Object.keys(out).length >= MAX_SHADER_PROPERTIES) {\r\n warn(`shader \"${where}\" declares more than ${MAX_SHADER_PROPERTIES} properties; the rest are ignored.`);\r\n break;\r\n }\r\n if (!isRecord(value) || typeof value.kind !== \"string\") {\r\n warn(`shader \"${where}\" property \"${id}\" has no kind; ignored.`);\r\n continue;\r\n }\r\n const inputs = value.inputs;\r\n if (!isRecord(inputs) || Object.keys(inputs).length === 0) {\r\n warn(`shader \"${where}\" property \"${id}\" names no uniform in \"inputs\"; ignored.`);\r\n continue;\r\n }\r\n let conflict = false;\r\n for (const uniform of Object.values(inputs)) {\r\n if (typeof uniform !== \"string\") {\r\n warn(`shader \"${where}\" property \"${id}\" has a non-string uniform name; ignored.`);\r\n conflict = true;\r\n break;\r\n }\r\n const prior = claimed.get(uniform);\r\n if (prior !== undefined) {\r\n // Two properties writing one uniform means the panel has two\r\n // controls for one value and whichever resolves last silently wins.\r\n warn(`shader \"${where}\" properties \"${prior}\" and \"${id}\" both write uniform \"${uniform}\"; \"${id}\" ignored.`);\r\n conflict = true;\r\n break;\r\n }\r\n claimed.set(uniform, id);\r\n }\r\n if (conflict) continue;\r\n\r\n out[id] = value as unknown as ShaderProperty;\r\n }\r\n return out;\r\n}\r\n\r\nfunction isRecord(value: unknown): value is Record<string, unknown> {\r\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\r\n}\r\n\r\nconst warned = new Set<string>();\r\n\r\n/** Warn once per message — a pack may be normalised on every scene build. */\r\nfunction warn(message: string): void {\r\n if (warned.has(message)) return;\r\n if (warned.size > 256) warned.clear();\r\n warned.add(message);\r\n console.warn(`[shader] ${message}`);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/pack.ts"],"names":[],"mappings":"AAgLA,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IACxB,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO;CAC5E,CAAC,CAAC;AAEH,gEAAgE;AAChE,MAAM,UAAU,qBAAqB,CAAC,QAAwB;IAC1D,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACxB,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACX,qDAAqD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI;YAC9E,8EAA8E;YAC9E,gEAAgE,CACnE,CAAC;IACN,CAAC;IAED,MAAM,M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\r\n\r\n/**\r\n * A **shader pack**: a program, plus what a host may edit about it.\r\n *\r\n * The interchange format for a shader — authored as JSON, imported as a value,\r\n * handed to `Fills.shader` or `Effects.shader`. It exists because a bare source\r\n * string says nothing about which of its uniforms are meant to be touched, what\r\n * they are called in a panel, or what range they take, so every host that wanted\r\n * to offer a slider had to keep that table itself, beside a program it did not\r\n * own.\r\n *\r\n * **Two scopes, one shape.** A fill paints inside a shape's path and may sample\r\n * textures; an effect paints over a layer and may sample what is beneath it.\r\n * Those are the only two differences, and making them arms of a union rather\r\n * than optional fields on one type is what makes `Fills.shader(anEffectShader)`\r\n * a compile error instead of a program that fails at the first frame.\r\n */\r\nexport type Shader = FillShader | EffectShader;\r\n\r\n/** What both scopes carry. */\r\nexport interface ShaderBase {\r\n /**\r\n * Format tag, so a file that is not one of these can be told apart from one\r\n * that is merely from a newer version.\r\n */\r\n $kind?: string;\r\n /**\r\n * Provenance, when the pack came from a library row. **Not** how it is\r\n * registered — `Registry.addShader` takes the key separately, exactly as\r\n * `Registry.addNode` does, so the same file can be registered under whatever\r\n * name a project wants and the file itself stays portable.\r\n */\r\n id?: string;\r\n name: string;\r\n description?: string;\r\n /** The language `source` is written in; normalising a pack stamps WGSL when absent. */\r\n language?: ShaderLanguage;\r\n /**\r\n * The program. In WGSL, a fill defines `fn fill(in: FillIn) -> vec4f` and an\r\n * effect `fn effect(in: EffectIn) -> vec4f`, and the uniforms are the\r\n * members of `struct Params` (types, layout and all); `properties` name\r\n * those members in their `inputs`.\r\n */\r\n source: string;\r\n /** Uniform values the properties do not cover, by name. */\r\n uniforms?: ShaderUniformRecord;\r\n /** The editable values, by property id. */\r\n properties: Record<string, ShaderProperty>;\r\n}\r\n\r\n/** A shader that paints inside a shape's path. */\r\nexport interface FillShader extends ShaderBase {\r\n scope: \"fill\";\r\n /**\r\n * The images the program samples, by name. In WGSL, `sample_texture(uv)`\r\n * samples the first; the fill that applies the pack supplies each `src`.\r\n */\r\n textures?: readonly { name: string; description?: string }[];\r\n}\r\n\r\n/** A shader that paints over a layer. */\r\nexport interface EffectShader extends ShaderBase {\r\n scope: \"effect\";\r\n /**\r\n * Whether the program is meant to run on the backdrop path, where\r\n * `sample_src` reads what is beneath the node rather than its own layer.\r\n *\r\n * A fact about the **program**, which is why it lives here rather than on\r\n * the effect instance: the instance keeps `mode`, the cross-cutting field\r\n * five generic consumers read without knowing what type they hold. The\r\n * builder maps this to `mode: \"backdrop\"` as the default and a caller may\r\n * still override it.\r\n */\r\n backdrop?: boolean;\r\n}\r\n\r\n/** One editable value. */\r\nexport type ShaderProperty = KnownShaderProperty | UnknownShaderProperty;\r\n\r\nexport type KnownShaderProperty =\r\n | NumberProperty\r\n | SliderProperty\r\n | AngleProperty\r\n | HueProperty\r\n | BooleanProperty\r\n | ColorProperty\r\n | VectorProperty\r\n | PointProperty;\r\n\r\ninterface ShaderPropertyBase {\r\n /** What a panel calls it. Falls back to the property id. */\r\n name?: string;\r\n /**\r\n * The uniform each of this property's components writes.\r\n *\r\n * The composite mechanism, and the reason a property is not just a uniform\r\n * under another name: one editable value may span several uniforms. A\r\n * scalar names one component, `value`; a point may name `value` for a\r\n * `float2`, or `x` and `y` for two separate floats.\r\n */\r\n inputs: Record<string, string>;\r\n}\r\n\r\n/** A scalar, drawn as a number input. */\r\nexport interface NumberProperty extends ShaderPropertyBase {\r\n kind: \"number\";\r\n default: number;\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n}\r\n\r\n/** A scalar with a bounded range, drawn as a slider. */\r\nexport interface SliderProperty extends ShaderPropertyBase {\r\n kind: \"slider\";\r\n default: number;\r\n min: number;\r\n max: number;\r\n step?: number;\r\n}\r\n\r\n/** Degrees, matching every other angle in the library. */\r\nexport interface AngleProperty extends ShaderPropertyBase {\r\n kind: \"angle\";\r\n default: number;\r\n}\r\n\r\n/** Degrees around the colour wheel. */\r\nexport interface HueProperty extends ShaderPropertyBase {\r\n kind: \"hue\";\r\n default: number;\r\n}\r\n\r\n/** Written to its uniform as 1 or 0, since a `bool` cannot be a uniform member in WGSL. */\r\nexport interface BooleanProperty extends ShaderPropertyBase {\r\n kind: \"boolean\";\r\n default: boolean;\r\n}\r\n\r\n/** RGBA in 0–1. A CSS string is accepted and parsed, so theme tokens work. */\r\nexport interface ColorProperty extends ShaderPropertyBase {\r\n kind: \"color\";\r\n default: string | readonly number[];\r\n}\r\n\r\n/** A fixed-width run of floats. */\r\nexport interface VectorProperty extends ShaderPropertyBase {\r\n kind: \"vector\";\r\n default: readonly number[];\r\n}\r\n\r\n/** Two floats, as one `float2` or as separate `x`/`y` uniforms. */\r\nexport interface PointProperty extends ShaderPropertyBase {\r\n kind: \"point\";\r\n default: readonly number[] | { x: number; y: number };\r\n}\r\n\r\n/**\r\n * A property whose kind this version of the vocabulary does not name.\r\n *\r\n * Open at the edges on purpose: a pack written against a newer version should\r\n * draw the controls a host knows and say so about the rest, instead of\r\n * failing to load at all.\r\n *\r\n * An unknown property is still *resolved* — its `default` is written to its\r\n * `inputs` unchanged — so a shader whose panel a host cannot fully draw still\r\n * renders correctly.\r\n */\r\nexport interface UnknownShaderProperty extends ShaderPropertyBase {\r\n kind: string;\r\n default?: unknown;\r\n [option: string]: unknown;\r\n}\r\n\r\nconst KNOWN_KINDS = new Set([\r\n \"number\", \"slider\", \"angle\", \"hue\", \"boolean\", \"color\", \"vector\", \"point\",\r\n]);\r\n\r\n/** Whether `property` is one this version knows how to draw. */\r\nexport function isKnownShaderProperty(property: ShaderProperty): property is KnownShaderProperty {\r\n return KNOWN_KINDS.has(property.kind);\r\n}\r\n\r\n/** Ceiling on properties in one pack, so a malformed import cannot exhaust a host. */\r\nexport const MAX_SHADER_PROPERTIES = 64;\r\n\r\n/** Ceiling on source length, matching what a compile cache can reasonably hold. */\r\nexport const MAX_SHADER_SOURCE = 64_000;\r\n\r\n/**\r\n * Validate and normalise an authored pack.\r\n *\r\n * **Throws** when the pack is structurally not one — no source, no usable\r\n * scope — because there is nothing to render and a silent empty shader is a\r\n * blank frame with no explanation. **Warns and drops** an individual malformed\r\n * property, because the rest of the shader still works and a panel missing one\r\n * control is a better answer than a scene that will not build. That split is the\r\n * same one `normalizeUniforms` makes.\r\n */\r\nexport function normalizeShaderPack(input: unknown): Shader {\r\n if (typeof input !== \"object\" || input === null) {\r\n throw new Error(\"A shader pack must be an object.\");\r\n }\r\n const raw = input as Record<string, unknown>;\r\n\r\n const scope = raw.scope;\r\n if (scope !== \"fill\" && scope !== \"effect\") {\r\n throw new Error(\r\n `A shader pack needs scope \"fill\" or \"effect\", got ${JSON.stringify(scope)}. ` +\r\n `The two are written against different contracts — a fill has no backdrop to ` +\r\n `sample and an effect has no shape box to map coordinates onto.`,\r\n );\r\n }\r\n\r\n const source = typeof raw.source === \"string\" ? raw.source.trim() : \"\";\r\n if (source === \"\") throw new Error(`Shader pack \"${String(raw.name ?? \"?\")}\" has no source.`);\r\n if (source.length > MAX_SHADER_SOURCE) {\r\n throw new Error(\r\n `Shader pack \"${String(raw.name ?? \"?\")}\" source is ${source.length} characters, ` +\r\n `over the ${MAX_SHADER_SOURCE} ceiling.`,\r\n );\r\n }\r\n\r\n if (raw.language !== undefined && raw.language !== \"wgsl\") {\r\n throw new Error(\r\n `Shader pack \"${String(raw.name ?? \"?\")}\" is written in ${JSON.stringify(raw.language)}; ` +\r\n `only WGSL is supported. Port it to WGSL.`,\r\n );\r\n }\r\n\r\n const base: ShaderBase = {\r\n ...(typeof raw.$kind === \"string\" ? { $kind: raw.$kind } : {}),\r\n ...(typeof raw.id === \"string\" ? { id: raw.id } : {}),\r\n name: typeof raw.name === \"string\" && raw.name !== \"\" ? raw.name : \"Shader\",\r\n ...(typeof raw.description === \"string\" ? { description: raw.description } : {}),\r\n language: \"wgsl\",\r\n source,\r\n ...(isRecord(raw.uniforms) ? { uniforms: raw.uniforms as ShaderUniformRecord } : {}),\r\n properties: normalizeProperties(raw.properties, String(raw.name ?? \"?\")),\r\n };\r\n\r\n if (scope === \"fill\") {\r\n const textures = Array.isArray(raw.textures)\r\n ? (raw.textures as unknown[]).filter((t): t is { name: string; description?: string } =>\r\n isRecord(t) && typeof t.name === \"string\").map((t) => ({ name: t.name, ...(typeof t.description === \"string\" ? { description: t.description } : {}) }))\r\n : [];\r\n return {\r\n ...base,\r\n scope: \"fill\",\r\n ...(textures.length ? { textures } : {}),\r\n };\r\n }\r\n return { ...base, scope: \"effect\", ...(raw.backdrop === true ? { backdrop: true } : {}) };\r\n}\r\n\r\nfunction normalizeProperties(input: unknown, where: string): Record<string, ShaderProperty> {\r\n if (!isRecord(input)) return {};\r\n const out: Record<string, ShaderProperty> = {};\r\n const claimed = new Map<string, string>();\r\n\r\n for (const [id, value] of Object.entries(input)) {\r\n if (Object.keys(out).length >= MAX_SHADER_PROPERTIES) {\r\n warn(`shader \"${where}\" declares more than ${MAX_SHADER_PROPERTIES} properties; the rest are ignored.`);\r\n break;\r\n }\r\n if (!isRecord(value) || typeof value.kind !== \"string\") {\r\n warn(`shader \"${where}\" property \"${id}\" has no kind; ignored.`);\r\n continue;\r\n }\r\n const inputs = value.inputs;\r\n if (!isRecord(inputs) || Object.keys(inputs).length === 0) {\r\n warn(`shader \"${where}\" property \"${id}\" names no uniform in \"inputs\"; ignored.`);\r\n continue;\r\n }\r\n let conflict = false;\r\n for (const uniform of Object.values(inputs)) {\r\n if (typeof uniform !== \"string\") {\r\n warn(`shader \"${where}\" property \"${id}\" has a non-string uniform name; ignored.`);\r\n conflict = true;\r\n break;\r\n }\r\n const prior = claimed.get(uniform);\r\n if (prior !== undefined) {\r\n // Two properties writing one uniform means the panel has two\r\n // controls for one value and whichever resolves last silently wins.\r\n warn(`shader \"${where}\" properties \"${prior}\" and \"${id}\" both write uniform \"${uniform}\"; \"${id}\" ignored.`);\r\n conflict = true;\r\n break;\r\n }\r\n claimed.set(uniform, id);\r\n }\r\n if (conflict) continue;\r\n\r\n out[id] = value as unknown as ShaderProperty;\r\n }\r\n return out;\r\n}\r\n\r\nfunction isRecord(value: unknown): value is Record<string, unknown> {\r\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\r\n}\r\n\r\nconst warned = new Set<string>();\r\n\r\n/** Warn once per message — a pack may be normalised on every scene build. */\r\nfunction warn(message: string): void {\r\n if (warned.has(message)) return;\r\n if (warned.size > 256) warned.clear();\r\n warned.add(message);\r\n console.warn(`[shader] ${message}`);\r\n}\r\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ShaderUniformRecord } from "./uniforms.js";
|
|
2
2
|
import type { Shader } from "./pack.js";
|
|
3
3
|
/** Overrides for a pack's properties, by property id. */
|
|
4
4
|
export type ShaderPropertyValues = Record<string, unknown>;
|
|
@@ -10,9 +10,8 @@ export type ShaderPropertyValues = Record<string, unknown>;
|
|
|
10
10
|
* is where that value has to end up. One property may feed several uniforms —
|
|
11
11
|
* see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.
|
|
12
12
|
*
|
|
13
|
-
* The pack's own `uniforms` are merged in first and the properties win
|
|
14
|
-
*
|
|
15
|
-
* built-in: the more specific statement of the same value takes it.
|
|
13
|
+
* The pack's own `uniforms` are merged in first and the properties win: the
|
|
14
|
+
* more specific statement of the same value takes it.
|
|
16
15
|
*/
|
|
17
|
-
export declare function resolveShaderProperties(pack: Shader, overrides?: ShaderPropertyValues):
|
|
16
|
+
export declare function resolveShaderProperties(pack: Shader, overrides?: ShaderPropertyValues): ShaderUniformRecord;
|
|
18
17
|
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAErD,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAM3D;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,oBAAoB,GACjC,mBAAmB,CAyBrB"}
|
|
@@ -10,9 +10,8 @@ const COLOR_COMPONENTS = ["r", "g", "b", "a"];
|
|
|
10
10
|
* is where that value has to end up. One property may feed several uniforms —
|
|
11
11
|
* see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.
|
|
12
12
|
*
|
|
13
|
-
* The pack's own `uniforms` are merged in first and the properties win
|
|
14
|
-
*
|
|
15
|
-
* built-in: the more specific statement of the same value takes it.
|
|
13
|
+
* The pack's own `uniforms` are merged in first and the properties win: the
|
|
14
|
+
* more specific statement of the same value takes it.
|
|
16
15
|
*/
|
|
17
16
|
export function resolveShaderProperties(pack, overrides) {
|
|
18
17
|
const out = { ...(pack.uniforms ?? {}) };
|
|
@@ -74,9 +73,7 @@ function toUniformValue(property, value, id, where) {
|
|
|
74
73
|
case "angle":
|
|
75
74
|
case "hue":
|
|
76
75
|
return asFinite(value, id, where);
|
|
77
|
-
//
|
|
78
|
-
// int uniform does not survive CanvasKit at all — see `writeUniforms`.
|
|
79
|
-
// A float of 1 or 0 is what a shader can actually branch on.
|
|
76
|
+
// A `bool` cannot be a uniform member in WGSL; a float of 1 or 0 is what a shader can branch on.
|
|
80
77
|
case "boolean":
|
|
81
78
|
return value ? 1 : 0;
|
|
82
79
|
case "color":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD,8EAA8E;AAC9E,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,G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,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;AACxC,CAAC","sourcesContent":["import { parseColor } from \"../fill/color/parser\";\r\nimport type { SkSLUniformRecord, SkSLUniformValue } from \"../sksl-uniforms\";\r\nimport type { Shader, ShaderProperty } from \"./pack\";\r\n\r\n/** Overrides for a pack's properties, by property id. */\r\nexport type ShaderPropertyValues = Record<string, unknown>;\r\n\r\n/** Component names a multi-part property may map, in the order they index. */\r\nconst COMPONENTS = [\"x\", \"y\", \"z\", \"w\"] as const;\r\nconst COLOR_COMPONENTS = [\"r\", \"g\", \"b\", \"a\"] as const;\r\n\r\n/**\r\n * Turn a pack's properties, plus any overrides, into the uniform record the\r\n * renderer writes.\r\n *\r\n * This is the whole job of a property: it is an *editable* value, and a uniform\r\n * is where that value has to end up. One property may feed several uniforms —\r\n * see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.\r\n *\r\n * The pack's own `uniforms` are merged in first and the properties win, matching\r\n * the precedence `writeUniforms` already uses for an author value over a\r\n * built-in: the more specific statement of the same value takes it.\r\n */\r\nexport function resolveShaderProperties(\r\n pack: Shader,\r\n overrides?: ShaderPropertyValues,\r\n): SkSLUniformRecord {\r\n const out: SkSLUniformRecord = { ...(pack.uniforms ?? {}) };\r\n\r\n for (const [id, property] of Object.entries(pack.properties)) {\r\n const supplied = overrides && id in overrides ? overrides[id] : property.default;\r\n const parts = componentsOf(property, supplied, id, pack.name);\r\n if (!parts) continue;\r\n for (const [component, uniform] of Object.entries(property.inputs)) {\r\n const value = parts[component];\r\n if (value === undefined) {\r\n warn(`shader \"${pack.name}\" property \"${id}\" has no \"${component}\" to write to \"${uniform}\".`);\r\n continue;\r\n }\r\n out[uniform] = value;\r\n }\r\n }\r\n\r\n if (overrides) {\r\n for (const id of Object.keys(overrides)) {\r\n if (id in pack.properties) continue;\r\n warn(`shader \"${pack.name}\" has no property \"${id}\"; the override is ignored.`);\r\n }\r\n }\r\n\r\n return out;\r\n}\r\n\r\n/**\r\n * Split one property's value across the components its `inputs` name.\r\n *\r\n * A property naming only `value` passes its whole value through, which is the\r\n * common case and the reason a scalar needs no ceremony. One naming `x`/`y` (or\r\n * `r`/`g`/`b`/`a`) indexes into the value, which is what lets a `point` drive two\r\n * separate `float` uniforms in a source that never declared a `float2`.\r\n */\r\nfunction componentsOf(\r\n property: ShaderProperty,\r\n value: unknown,\r\n id: string,\r\n where: string,\r\n): Record<string, SkSLUniformValue> | undefined {\r\n const flat = toUniformValue(property, value, id, where);\r\n if (flat === undefined) return undefined;\r\n\r\n const names = Object.keys(property.inputs);\r\n if (names.length === 1 && names[0] === \"value\") return { value: flat };\r\n\r\n const parts = typeof flat === \"number\" ? [flat] : flat;\r\n const out: Record<string, SkSLUniformValue> = { value: flat };\r\n for (const [index, name] of COMPONENTS.entries()) {\r\n if (parts[index] !== undefined) out[name] = parts[index];\r\n }\r\n for (const [index, name] of COLOR_COMPONENTS.entries()) {\r\n if (parts[index] !== undefined) out[name] = parts[index];\r\n }\r\n return out;\r\n}\r\n\r\n/** One property's value as floats, by its kind. */\r\nfunction toUniformValue(\r\n property: ShaderProperty,\r\n value: unknown,\r\n id: string,\r\n where: string,\r\n): SkSLUniformValue | undefined {\r\n switch (property.kind) {\r\n case \"number\":\r\n case \"slider\":\r\n case \"angle\":\r\n case \"hue\":\r\n return asFinite(value, id, where);\r\n\r\n // SkSL's `bool` uniform is not worth relying on across backends, and an\r\n // int uniform does not survive CanvasKit at all — see `writeUniforms`.\r\n // A float of 1 or 0 is what a shader can actually branch on.\r\n case \"boolean\":\r\n return value ? 1 : 0;\r\n\r\n case \"color\":\r\n return asColor(value, id, where);\r\n\r\n case \"vector\":\r\n case \"point\":\r\n return asFloats(value, id, where);\r\n\r\n // An unknown kind still resolves: its value reaches its uniforms\r\n // untouched, so a shader a host cannot fully draw still renders.\r\n default:\r\n return typeof value === \"number\" || Array.isArray(value)\r\n ? (value as SkSLUniformValue)\r\n : undefined;\r\n }\r\n}\r\n\r\nfunction asFinite(value: unknown, id: string, where: string): number | undefined {\r\n if (typeof value === \"number\" && Number.isFinite(value)) return value;\r\n warn(`shader \"${where}\" property \"${id}\" expects a number, got ${JSON.stringify(value)}.`);\r\n return undefined;\r\n}\r\n\r\n/**\r\n * A colour as four floats in 0–1.\r\n *\r\n * A CSS string is parsed rather than refused, so a theme token, an `oklch()` and\r\n * the `\"white/10\"` opacity suffix all reach a shader — `parseColor` is the one\r\n * place any of those are understood, and a shader pack has no reason to be the\r\n * exception.\r\n */\r\nfunction asColor(value: unknown, id: string, where: string): number[] | undefined {\r\n if (typeof value === \"string\") {\r\n const [r, g, b, a] = parseColor(value);\r\n return [r, g, b, a];\r\n }\r\n return asFloats(value, id, where);\r\n}\r\n\r\nfunction asFloats(value: unknown, id: string, where: string): number[] | undefined {\r\n if (Array.isArray(value) && value.every((v) => typeof v === \"number\" && Number.isFinite(v))) {\r\n return value as number[];\r\n }\r\n if (typeof value === \"object\" && value !== null) {\r\n const point = value as { x?: unknown; y?: unknown };\r\n if (typeof point.x === \"number\" && typeof point.y === \"number\") return [point.x, point.y];\r\n }\r\n warn(`shader \"${where}\" property \"${id}\" expects numbers, got ${JSON.stringify(value)}.`);\r\n return undefined;\r\n}\r\n\r\nconst warned = new Set<string>();\r\n\r\nfunction warn(message: string): void {\r\n if (warned.has(message)) return;\r\n if (warned.size > 256) warned.clear();\r\n warned.add(message);\r\n console.warn(`[shader] ${message}`);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOlD,8EAA8E;AAC9E,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AACjD,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,GAAG,EA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} from \"../fill/color/parser\";\r\nimport type { ShaderUniformRecord, ShaderUniformValue } from \"./uniforms\";\r\nimport type { Shader, ShaderProperty } from \"./pack\";\r\n\r\n/** Overrides for a pack's properties, by property id. */\r\nexport type ShaderPropertyValues = Record<string, unknown>;\r\n\r\n/** Component names a multi-part property may map, in the order they index. */\r\nconst COMPONENTS = [\"x\", \"y\", \"z\", \"w\"] as const;\r\nconst COLOR_COMPONENTS = [\"r\", \"g\", \"b\", \"a\"] as const;\r\n\r\n/**\r\n * Turn a pack's properties, plus any overrides, into the uniform record the\r\n * renderer writes.\r\n *\r\n * This is the whole job of a property: it is an *editable* value, and a uniform\r\n * is where that value has to end up. One property may feed several uniforms —\r\n * see `ShaderPropertyBase.inputs` — which is why this cannot be a rename.\r\n *\r\n * The pack's own `uniforms` are merged in first and the properties win: the\r\n * more specific statement of the same value takes it.\r\n */\r\nexport function resolveShaderProperties(\r\n pack: Shader,\r\n overrides?: ShaderPropertyValues,\r\n): ShaderUniformRecord {\r\n const out: ShaderUniformRecord = { ...(pack.uniforms ?? {}) };\r\n\r\n for (const [id, property] of Object.entries(pack.properties)) {\r\n const supplied = overrides && id in overrides ? overrides[id] : property.default;\r\n const parts = componentsOf(property, supplied, id, pack.name);\r\n if (!parts) continue;\r\n for (const [component, uniform] of Object.entries(property.inputs)) {\r\n const value = parts[component];\r\n if (value === undefined) {\r\n warn(`shader \"${pack.name}\" property \"${id}\" has no \"${component}\" to write to \"${uniform}\".`);\r\n continue;\r\n }\r\n out[uniform] = value;\r\n }\r\n }\r\n\r\n if (overrides) {\r\n for (const id of Object.keys(overrides)) {\r\n if (id in pack.properties) continue;\r\n warn(`shader \"${pack.name}\" has no property \"${id}\"; the override is ignored.`);\r\n }\r\n }\r\n\r\n return out;\r\n}\r\n\r\n/**\r\n * Split one property's value across the components its `inputs` name.\r\n *\r\n * A property naming only `value` passes its whole value through, which is the\r\n * common case and the reason a scalar needs no ceremony. One naming `x`/`y` (or\r\n * `r`/`g`/`b`/`a`) indexes into the value, which is what lets a `point` drive two\r\n * separate `float` uniforms in a source that never declared a `float2`.\r\n */\r\nfunction componentsOf(\r\n property: ShaderProperty,\r\n value: unknown,\r\n id: string,\r\n where: string,\r\n): Record<string, ShaderUniformValue> | undefined {\r\n const flat = toUniformValue(property, value, id, where);\r\n if (flat === undefined) return undefined;\r\n\r\n const names = Object.keys(property.inputs);\r\n if (names.length === 1 && names[0] === \"value\") return { value: flat };\r\n\r\n const parts = typeof flat === \"number\" ? [flat] : flat;\r\n const out: Record<string, ShaderUniformValue> = { value: flat };\r\n for (const [index, name] of COMPONENTS.entries()) {\r\n if (parts[index] !== undefined) out[name] = parts[index];\r\n }\r\n for (const [index, name] of COLOR_COMPONENTS.entries()) {\r\n if (parts[index] !== undefined) out[name] = parts[index];\r\n }\r\n return out;\r\n}\r\n\r\n/** One property's value as floats, by its kind. */\r\nfunction toUniformValue(\r\n property: ShaderProperty,\r\n value: unknown,\r\n id: string,\r\n where: string,\r\n): ShaderUniformValue | undefined {\r\n switch (property.kind) {\r\n case \"number\":\r\n case \"slider\":\r\n case \"angle\":\r\n case \"hue\":\r\n return asFinite(value, id, where);\r\n\r\n // A `bool` cannot be a uniform member in WGSL; a float of 1 or 0 is what a shader can branch on.\r\n case \"boolean\":\r\n return value ? 1 : 0;\r\n\r\n case \"color\":\r\n return asColor(value, id, where);\r\n\r\n case \"vector\":\r\n case \"point\":\r\n return asFloats(value, id, where);\r\n\r\n // An unknown kind still resolves: its value reaches its uniforms\r\n // untouched, so a shader a host cannot fully draw still renders.\r\n default:\r\n return typeof value === \"number\" || Array.isArray(value)\r\n ? (value as ShaderUniformValue)\r\n : undefined;\r\n }\r\n}\r\n\r\nfunction asFinite(value: unknown, id: string, where: string): number | undefined {\r\n if (typeof value === \"number\" && Number.isFinite(value)) return value;\r\n warn(`shader \"${where}\" property \"${id}\" expects a number, got ${JSON.stringify(value)}.`);\r\n return undefined;\r\n}\r\n\r\n/**\r\n * A colour as four floats in 0–1.\r\n *\r\n * A CSS string is parsed rather than refused, so a theme token, an `oklch()` and\r\n * the `\"white/10\"` opacity suffix all reach a shader — `parseColor` is the one\r\n * place any of those are understood, and a shader pack has no reason to be the\r\n * exception.\r\n */\r\nfunction asColor(value: unknown, id: string, where: string): number[] | undefined {\r\n if (typeof value === \"string\") {\r\n const [r, g, b, a] = parseColor(value);\r\n return [r, g, b, a];\r\n }\r\n return asFloats(value, id, where);\r\n}\r\n\r\nfunction asFloats(value: unknown, id: string, where: string): number[] | undefined {\r\n if (Array.isArray(value) && value.every((v) => typeof v === \"number\" && Number.isFinite(v))) {\r\n return value as number[];\r\n }\r\n if (typeof value === \"object\" && value !== null) {\r\n const point = value as { x?: unknown; y?: unknown };\r\n if (typeof point.x === \"number\" && typeof point.y === \"number\") return [point.x, point.y];\r\n }\r\n warn(`shader \"${where}\" property \"${id}\" expects numbers, got ${JSON.stringify(value)}.`);\r\n return undefined;\r\n}\r\n\r\nconst warned = new Set<string>();\r\n\r\nfunction warn(message: string): void {\r\n if (warned.has(message)) return;\r\n if (warned.size > 256) warned.clear();\r\n warned.add(message);\r\n console.warn(`[shader] ${message}`);\r\n}\r\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uniform values shared by the `shader` fill and the `shader` effect: the
|
|
3
|
+
* authoring shapes, their canonical record, and how two records interpolate
|
|
4
|
+
* and compare. The renderer binds the record to the program's `struct Params`
|
|
5
|
+
* by name.
|
|
6
|
+
*/
|
|
7
|
+
/** A single uniform value: a float, or a flat array for a vector/matrix/array uniform. */
|
|
8
|
+
export type ShaderUniformValue = number | number[];
|
|
9
|
+
/** A named uniform, in the positional `[{name, value}]` form older shader effects were written with. */
|
|
10
|
+
export interface ShaderUniform {
|
|
11
|
+
name: string;
|
|
12
|
+
value: ShaderUniformValue;
|
|
13
|
+
}
|
|
14
|
+
/** Uniform values keyed by the name they are declared under in the shader. */
|
|
15
|
+
export type ShaderUniformRecord = Record<string, ShaderUniformValue>;
|
|
16
|
+
/**
|
|
17
|
+
* Normalise either authoring shape to a canonical record.
|
|
18
|
+
*
|
|
19
|
+
* Accepts the record form and the positional `[{name, value}]` array older
|
|
20
|
+
* shader effects were written with. Keys are **sorted**, which makes the resolved fill canonical: two
|
|
21
|
+
* authors writing the same uniforms in a different order produce the same object,
|
|
22
|
+
* so `equals` and any structural diff agree with the renderer (which reads by
|
|
23
|
+
* name and never sees the order at all).
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeUniforms(input: ShaderUniformRecord | readonly ShaderUniform[] | undefined): ShaderUniformRecord;
|
|
26
|
+
/** Component-wise lerp. Mismatched shapes snap, since there is no in-between arity. */
|
|
27
|
+
export declare function lerpUniformValue(a: ShaderUniformValue, b: ShaderUniformValue, t: number): ShaderUniformValue;
|
|
28
|
+
export declare function uniformValuesEqual(a: ShaderUniformValue, b: ShaderUniformValue): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Interpolate two uniform records over the **union** of their keys.
|
|
31
|
+
*
|
|
32
|
+
* A key present on one side only holds at the value it has rather than
|
|
33
|
+
* interpolating from zero: the shader still declares it, so dropping it would
|
|
34
|
+
* write zeros mid-tween and read as the uniform snapping to black/none. This is
|
|
35
|
+
* also what makes the self-pair `lerpFillArray` builds for an unmatched fill
|
|
36
|
+
* layer a no-op on the uniforms.
|
|
37
|
+
*/
|
|
38
|
+
export declare function lerpUniformRecord(a: ShaderUniformRecord, b: ShaderUniformRecord, t: number): ShaderUniformRecord;
|
|
39
|
+
/** Compare by key *set*, not insertion order. */
|
|
40
|
+
export declare function uniformRecordsEqual(a: ShaderUniformRecord, b: ShaderUniformRecord): boolean;
|
|
41
|
+
//# sourceMappingURL=uniforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniforms.d.ts","sourceRoot":"","sources":["../../../../src/attributes/shape/shaders/uniforms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,0FAA0F;AAC1F,MAAM,MAAM,kBAAkB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M,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC/D,IAAI,IAAI,IAAI,GAAG;YAAE,SAAS;QAC1B,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACnB,IAAI,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;aAClC,IAAI,EAAE,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;;YACvC,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,mBAAmB,CAAC,CAAsB,EAAE,CAAsB;IAC9E,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,KAAK,KAAK,SAAS,IAAI,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/**\n * Uniform values shared by the `shader` fill and the `shader` effect: the\n * authoring shapes, their canonical record, and how two records interpolate\n * and compare. The renderer binds the record to the program's `struct Params`\n * by name.\n */\n\nimport { lerpNumber } from '@/tween/lerp';\n\n/** A single uniform value: a float, or a flat array for a vector/matrix/array uniform. */\nexport type ShaderUniformValue = number | number[];\n\n/** A named uniform, in the positional `[{name, value}]` form older shader effects were written with. */\nexport interface ShaderUniform {\n name: string;\n value: ShaderUniformValue;\n}\n\n/** Uniform values keyed by the name they are declared under in the shader. */\nexport type ShaderUniformRecord = Record<string, ShaderUniformValue>;\n\n// ---------------------------------------------------------------------------\n// Diagnostics\n// ---------------------------------------------------------------------------\n\n/**\n * Warnings already emitted, keyed by scope + message.\n *\n * Normalising runs on every resolve, so an unguarded warn is thousands of\n * identical lines in an export. Cleared past a ceiling so a pathological scene\n * can't grow this without bound.\n */\nconst warned = new Set<string>();\n\nfunction warnOnce(scope: string, message: string): void {\n const key = `${scope}\u0000${message}`;\n if (warned.has(key)) return;\n if (warned.size > 512) warned.clear();\n warned.add(key);\n console.warn(`[shader] ${message}`);\n}\n\n// ---------------------------------------------------------------------------\n// Authoring shapes → canonical record\n// ---------------------------------------------------------------------------\n\n/** Flatten a value to the float list it contributes, or null if it isn't numeric. */\nfunction flattenValue(name: string, value: unknown): ShaderUniformValue | null {\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n warnOnce('normalize', `uniform \"${name}\" is ${value}; ignoring it.`);\n return null;\n }\n return value;\n }\n if (!Array.isArray(value)) {\n warnOnce('normalize', `uniform \"${name}\" is not a number or number array; ignoring it.`);\n return null;\n }\n // `[[r,g,b,a], …]` is how an author naturally writes a colour array uniform,\n // and the renderer takes the whole thing as one flat float run either way.\n const flat = (value as unknown[]).flat(Infinity) as unknown[];\n const out: number[] = [];\n for (const entry of flat) {\n if (typeof entry !== 'number' || !Number.isFinite(entry)) {\n warnOnce('normalize', `uniform \"${name}\" contains a non-finite entry; ignoring it.`);\n return null;\n }\n out.push(entry);\n }\n return out;\n}\n\n/**\n * Normalise either authoring shape to a canonical record.\n *\n * Accepts the record form and the positional `[{name, value}]` array older\n * shader effects were written with. Keys are **sorted**, which makes the resolved fill canonical: two\n * authors writing the same uniforms in a different order produce the same object,\n * so `equals` and any structural diff agree with the renderer (which reads by\n * name and never sees the order at all).\n */\nexport function normalizeUniforms(\n input: ShaderUniformRecord | readonly ShaderUniform[] | undefined,\n): ShaderUniformRecord {\n if (!input) return {};\n const pairs: Array<[string, unknown]> = Array.isArray(input)\n ? (input as readonly ShaderUniform[]).map((u) => [u.name, u.value])\n : Object.entries(input as ShaderUniformRecord);\n\n const out: ShaderUniformRecord = {};\n for (const [name, value] of pairs.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))) {\n const flat = flattenValue(name, value);\n if (flat !== null) out[name] = flat;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Interpolation and equality\n// ---------------------------------------------------------------------------\n\n/** Component-wise lerp. Mismatched shapes snap, since there is no in-between arity. */\nexport function lerpUniformValue(a: ShaderUniformValue, b: ShaderUniformValue, t: number): ShaderUniformValue {\n if (typeof a === 'number' && typeof b === 'number') return lerpNumber(a, b, t);\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length);\n return Array.from({ length: len }, (_, i) => lerpNumber(a[i] ?? 0, b[i] ?? 0, t));\n }\n return t < 0.5 ? a : b;\n}\n\nexport function uniformValuesEqual(a: ShaderUniformValue, b: ShaderUniformValue): boolean {\n if (typeof a === 'number' && typeof b === 'number') return a === b;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((v, i) => v === b[i]);\n }\n return false;\n}\n\n/**\n * Interpolate two uniform records over the **union** of their keys.\n *\n * A key present on one side only holds at the value it has rather than\n * interpolating from zero: the shader still declares it, so dropping it would\n * write zeros mid-tween and read as the uniform snapping to black/none. This is\n * also what makes the self-pair `lerpFillArray` builds for an unmatched fill\n * layer a no-op on the uniforms.\n */\nexport function lerpUniformRecord(\n a: ShaderUniformRecord,\n b: ShaderUniformRecord,\n t: number,\n): ShaderUniformRecord {\n const out: ShaderUniformRecord = {};\n for (const name of [...Object.keys(a), ...Object.keys(b)].sort()) {\n if (name in out) continue;\n const from = a[name];\n const to = b[name];\n if (from === undefined) out[name] = to;\n else if (to === undefined) out[name] = from;\n else out[name] = lerpUniformValue(from, to, t);\n }\n return out;\n}\n\n/** Compare by key *set*, not insertion order. */\nexport function uniformRecordsEqual(a: ShaderUniformRecord, b: ShaderUniformRecord): boolean {\n const aKeys = Object.keys(a);\n if (aKeys.length !== Object.keys(b).length) return false;\n return aKeys.every((name) => {\n const other = b[name];\n return other !== undefined && uniformValuesEqual(a[name], other);\n });\n}\n"]}
|
|
@@ -4,9 +4,9 @@ import type { RectCornerRadius, CornerRadiusResolved } from "../../attributes/sh
|
|
|
4
4
|
* The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose
|
|
5
5
|
* author input (a CSS string, a shorthand object, a previously-resolved value)
|
|
6
6
|
* into the strict `TResolved` a renderer reads, and `lerp` interpolates between
|
|
7
|
-
* two resolved values. This is the same pair
|
|
7
|
+
* two resolved values. This is the same pair `property`'s `mapper`/`tween`
|
|
8
8
|
* options take — see `attributes/properties/typed.ts`, which builds each
|
|
9
|
-
*
|
|
9
|
+
* `xProperty()` directly from one of these.
|
|
10
10
|
*/
|
|
11
11
|
export interface AttributeOps<TInput, TResolved> {
|
|
12
12
|
resolve(value: TInput, previous?: TResolved): TResolved;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"","sourcesContent":["import type { LerpFunction } from \"@/tween/lerp\";\r\nimport type { RectCornerRadius, CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\r\n\r\n/**\r\n * The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose\r\n * author input (a CSS string, a shorthand object, a previously-resolved value)\r\n * into the strict `TResolved` a renderer reads, and `lerp` interpolates between\r\n * two resolved values. This is the same pair
|
|
1
|
+
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"","sourcesContent":["import type { LerpFunction } from \"@/tween/lerp\";\r\nimport type { RectCornerRadius, CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\r\n\r\n/**\r\n * The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose\r\n * author input (a CSS string, a shorthand object, a previously-resolved value)\r\n * into the strict `TResolved` a renderer reads, and `lerp` interpolates between\r\n * two resolved values. This is the same pair `property`'s `mapper`/`tween`\r\n * options take — see `attributes/properties/typed.ts`, which builds each\r\n * `xProperty()` directly from one of these.\r\n */\r\nexport interface AttributeOps<TInput, TResolved> {\r\n resolve(value: TInput, previous?: TResolved): TResolved;\r\n lerp: LerpFunction<TResolved>;\r\n}\r\n\r\n/** An attribute whose resolved value can collapse to one value shared by every component. */\r\nexport interface HasUniformCheck<TInput, T> {\r\n isUniformInput(value: TInput): boolean;\r\n isUniform(value: T): boolean;\r\n}\r\n\r\n/** An attribute whose resolved value can be entirely zero. */\r\nexport interface HasZeroCheck<TResolved> {\r\n isZero(value: TResolved): boolean;\r\n}\r\n\r\n/** The corner-radius attribute's full op set — see `shape/corners/corner-radius.ts`. */\r\nexport type CornerRadiusOps = AttributeOps<RectCornerRadius, CornerRadiusResolved>\r\n & HasUniformCheck<RectCornerRadius, CornerRadiusResolved>\r\n & HasZeroCheck<CornerRadiusResolved>;\r\n"]}
|
|
@@ -49,9 +49,8 @@ export interface ResolvedTextSpan {
|
|
|
49
49
|
stroke: StrokeResolved[];
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* A stretch of a `Text` node's string set apart from the rest
|
|
53
|
-
* the string
|
|
54
|
-
* end)` are offsets into the string; an absent field is the node's own.
|
|
52
|
+
* A stretch of a `Text` node's string set apart from the rest. `[start, end)`
|
|
53
|
+
* are offsets into the string; an absent field is the node's own.
|
|
55
54
|
*/
|
|
56
55
|
export interface TextRun {
|
|
57
56
|
start: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/attributes/text/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE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