shaders 2.5.117 → 2.5.119
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/dist/core/BarShift-2XBhva1A.js +141 -0
- package/dist/core/{Blur-DG7lJKPo.js → Blur-5_t3tR_g.js} +1 -1
- package/dist/core/BrickPattern-BfTsjp4I.js +175 -0
- package/dist/core/{ChannelBlur-BhcCkwcO.js → ChannelBlur-DWgS3nhn.js} +1 -1
- package/dist/core/Chevron-BKZjAXR_.js +142 -0
- package/dist/core/ColorWheel-BQUKQPM-.js +140 -0
- package/dist/core/{Crescent-DiioCL2k.js → Crescent-ppz7W7eM.js} +1 -1
- package/dist/core/{Cross-CxQTHuxC.js → Cross-BfNOtQ6s.js} +1 -1
- package/dist/core/{Crystal-B3iO7o_n.js → Crystal-QsQoy8fZ.js} +1 -1
- package/dist/core/{Ellipse-iwH-zEvD.js → Ellipse-sWhNvW9-.js} +1 -1
- package/dist/core/{Emboss-B4i61QDT.js → Emboss-DGaubb9x.js} +1 -1
- package/dist/core/{Flower-CdHVKJKu.js → Flower-BbRNrXIa.js} +1 -1
- package/dist/core/FractalNoise-Ccufnbw6.js +184 -0
- package/dist/core/{Glass-B19xsZLn.js → Glass-CXT1jdLw.js} +2 -2
- package/dist/core/{Glow-CsTZA75y.js → Glow-5PP4-rM9.js} +1 -1
- package/dist/core/Marble-DkHLcqFD.js +124 -0
- package/dist/core/{Neon-BeGABHrs.js → Neon-DQDB7hAE.js} +1 -1
- package/dist/core/{Polygon-_3DSqSBg.js → Polygon-C6_siOs0.js} +1 -1
- package/dist/core/{ProgressiveBlur-Dh8W2bZ3.js → ProgressiveBlur-BJwJ5mE0.js} +1 -1
- package/dist/core/{Ring-4J6h5Iof.js → Ring-CtnDtTY8.js} +1 -1
- package/dist/core/{RoundedRect-Dj-gqOc0.js → RoundedRect-tnt7Jr5b.js} +1 -1
- package/dist/core/{SmokeFill-rM9vUIm4.js → SmokeFill-DzEtYeKN.js} +1 -1
- package/dist/core/{Star-CJ4mkBZg.js → Star-0Flymgm9.js} +1 -1
- package/dist/core/SunBurst-D9X1-buZ.js +127 -0
- package/dist/core/{TiltShift-DSQ-CsXz.js → TiltShift-r4qzPb2k.js} +1 -1
- package/dist/core/{Trapezoid-P9gXhH9a.js → Trapezoid-JmybJMUr.js} +1 -1
- package/dist/core/{Vesica-DYov_i53.js → Vesica-D7iqgpJg.js} +1 -1
- package/dist/core/{VideoTexture-Cr1f0IOE.js → VideoTexture-D9XxE1Hw.js} +1 -1
- package/dist/core/{WebcamTexture-BQJpZvC5.js → WebcamTexture-9Td8qQWm.js} +1 -1
- package/dist/core/index.js +179 -121
- package/dist/core/registry.js +117 -110
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaderRegistry-CO5SCxc6.js +270 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/BarShift/index.d.ts +47 -0
- package/dist/core/shaders/BarShift/index.d.ts.map +1 -0
- package/dist/core/shaders/BarShift/index.js +6 -0
- package/dist/core/shaders/Beam/index.js +1 -1
- package/dist/core/shaders/Blob/index.js +1 -1
- package/dist/core/shaders/Blur/index.js +2 -2
- package/dist/core/shaders/BrickPattern/index.d.ts +79 -0
- package/dist/core/shaders/BrickPattern/index.d.ts.map +1 -0
- package/dist/core/shaders/BrickPattern/index.js +5 -0
- package/dist/core/shaders/BrightnessContrast/index.js +1 -1
- package/dist/core/shaders/Bulge/index.js +1 -1
- package/dist/core/shaders/CRTScreen/index.js +1 -1
- package/dist/core/shaders/ChannelBlur/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +1 -1
- package/dist/core/shaders/Chevron/index.d.ts +66 -0
- package/dist/core/shaders/Chevron/index.d.ts.map +1 -0
- package/dist/core/shaders/Chevron/index.js +5 -0
- package/dist/core/shaders/ChromaFlow/index.js +1 -1
- package/dist/core/shaders/ChromaticAberration/index.js +1 -1
- package/dist/core/shaders/Circle/index.js +1 -1
- package/dist/core/shaders/ColorWheel/index.d.ts +62 -0
- package/dist/core/shaders/ColorWheel/index.d.ts.map +1 -0
- package/dist/core/shaders/ColorWheel/index.js +5 -0
- package/dist/core/shaders/ConcentricSpin/index.js +1 -1
- package/dist/core/shaders/ConicGradient/index.js +1 -1
- package/dist/core/shaders/ContourLines/index.js +1 -1
- package/dist/core/shaders/Crescent/index.js +2 -2
- package/dist/core/shaders/Cross/index.js +2 -2
- package/dist/core/shaders/Crystal/index.js +2 -2
- package/dist/core/shaders/CursorRipples/index.js +1 -1
- package/dist/core/shaders/CursorTrail/index.js +1 -1
- package/dist/core/shaders/DOMTexture/index.js +1 -1
- package/dist/core/shaders/DiamondGradient/index.js +1 -1
- package/dist/core/shaders/DiffuseBlur/index.js +1 -1
- package/dist/core/shaders/Dither/index.js +1 -1
- package/dist/core/shaders/DotGrid/index.js +1 -1
- package/dist/core/shaders/DropShadow/index.js +1 -1
- package/dist/core/shaders/Duotone/index.js +1 -1
- package/dist/core/shaders/Ellipse/index.js +2 -2
- package/dist/core/shaders/Emboss/index.js +2 -2
- package/dist/core/shaders/FallingLines/index.js +1 -1
- package/dist/core/shaders/FilmGrain/index.js +1 -1
- package/dist/core/shaders/FloatingParticles/index.js +1 -1
- package/dist/core/shaders/FlowField/index.js +1 -1
- package/dist/core/shaders/Flower/index.js +2 -2
- package/dist/core/shaders/FlowingGradient/index.js +1 -1
- package/dist/core/shaders/FlutedGlass/index.js +1 -1
- package/dist/core/shaders/Fog/index.js +1 -1
- package/dist/core/shaders/Form3D/index.js +1 -1
- package/dist/core/shaders/FractalNoise/index.d.ts +67 -0
- package/dist/core/shaders/FractalNoise/index.d.ts.map +1 -0
- package/dist/core/shaders/FractalNoise/index.js +5 -0
- package/dist/core/shaders/Glass/index.js +3 -3
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Glitch/index.js +1 -1
- package/dist/core/shaders/Glow/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +1 -1
- package/dist/core/shaders/Grayscale/index.js +1 -1
- package/dist/core/shaders/Grid/index.js +1 -1
- package/dist/core/shaders/GridDistortion/index.js +1 -1
- package/dist/core/shaders/Group/index.js +1 -1
- package/dist/core/shaders/Halftone/index.js +1 -1
- package/dist/core/shaders/HexGrid/index.js +1 -1
- package/dist/core/shaders/HueShift/index.js +1 -1
- package/dist/core/shaders/ImageTexture/index.js +1 -1
- package/dist/core/shaders/Invert/index.js +1 -1
- package/dist/core/shaders/Kaleidoscope/index.js +1 -1
- package/dist/core/shaders/LensFlare/index.js +1 -1
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Marble/index.d.ts +61 -0
- package/dist/core/shaders/Marble/index.d.ts.map +1 -0
- package/dist/core/shaders/Marble/index.js +5 -0
- package/dist/core/shaders/Mirror/index.js +1 -1
- package/dist/core/shaders/MultiPointGradient/index.js +1 -1
- package/dist/core/shaders/Neon/index.js +2 -2
- package/dist/core/shaders/Paper/index.js +1 -1
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/Plasma/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Polygon/index.js +2 -2
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/Ring/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/RoundedRect/index.js +2 -2
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/Sharpness/index.js +1 -1
- package/dist/core/shaders/Shatter/index.js +1 -1
- package/dist/core/shaders/SimplexNoise/index.js +1 -1
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/Smoke/index.js +1 -1
- package/dist/core/shaders/SmokeFill/index.js +2 -2
- package/dist/core/shaders/Solarize/index.js +1 -1
- package/dist/core/shaders/SolidColor/index.js +1 -1
- package/dist/core/shaders/Spherize/index.js +1 -1
- package/dist/core/shaders/Spiral/index.js +1 -1
- package/dist/core/shaders/Star/index.js +2 -2
- package/dist/core/shaders/Strands/index.js +1 -1
- package/dist/core/shaders/Stretch/index.js +1 -1
- package/dist/core/shaders/Stripes/index.js +1 -1
- package/dist/core/shaders/StudioBackground/index.js +1 -1
- package/dist/core/shaders/SunBurst/index.d.ts +61 -0
- package/dist/core/shaders/SunBurst/index.d.ts.map +1 -0
- package/dist/core/shaders/SunBurst/index.js +4 -0
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tint/index.js +1 -1
- package/dist/core/shaders/Trapezoid/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Truchet/index.js +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/VHS/index.js +1 -1
- package/dist/core/shaders/Vesica/index.js +2 -2
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/VideoTexture/index.js +2 -2
- package/dist/core/shaders/Vignette/index.js +1 -1
- package/dist/core/shaders/Voronoi/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/Weave/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +2 -2
- package/dist/core/shaders/WorleyNoise/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/js/createShader.js +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +97 -0
- package/dist/react/BarShift.js +217 -0
- package/dist/react/BrickPattern.js +217 -0
- package/dist/react/Chevron.js +217 -0
- package/dist/react/ColorWheel.js +217 -0
- package/dist/react/FractalNoise.js +217 -0
- package/dist/react/Marble.js +217 -0
- package/dist/react/Preview.js +7 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/SunBurst.js +217 -0
- package/dist/react/bundle.js +268 -268
- package/dist/react/components/BarShift.d.ts +35 -0
- package/dist/react/components/BarShift.d.ts.map +1 -0
- package/dist/react/components/BrickPattern.d.ts +38 -0
- package/dist/react/components/BrickPattern.d.ts.map +1 -0
- package/dist/react/components/Chevron.d.ts +37 -0
- package/dist/react/components/Chevron.d.ts.map +1 -0
- package/dist/react/components/ColorWheel.d.ts +34 -0
- package/dist/react/components/ColorWheel.d.ts.map +1 -0
- package/dist/react/components/FractalNoise.d.ts +36 -0
- package/dist/react/components/FractalNoise.d.ts.map +1 -0
- package/dist/react/components/Marble.d.ts +35 -0
- package/dist/react/components/Marble.d.ts.map +1 -0
- package/dist/react/components/SunBurst.d.ts +36 -0
- package/dist/react/components/SunBurst.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +8 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +97 -0
- package/dist/registry.js +2160 -258
- package/dist/solid/components/BarShift.d.ts +32 -0
- package/dist/solid/components/BarShift.d.ts.map +1 -0
- package/dist/solid/components/BarShift.js +228 -0
- package/dist/solid/components/BrickPattern.d.ts +35 -0
- package/dist/solid/components/BrickPattern.d.ts.map +1 -0
- package/dist/solid/components/BrickPattern.js +228 -0
- package/dist/solid/components/Chevron.d.ts +34 -0
- package/dist/solid/components/Chevron.d.ts.map +1 -0
- package/dist/solid/components/Chevron.js +228 -0
- package/dist/solid/components/ColorWheel.d.ts +31 -0
- package/dist/solid/components/ColorWheel.d.ts.map +1 -0
- package/dist/solid/components/ColorWheel.js +228 -0
- package/dist/solid/components/FractalNoise.d.ts +33 -0
- package/dist/solid/components/FractalNoise.d.ts.map +1 -0
- package/dist/solid/components/FractalNoise.js +228 -0
- package/dist/solid/components/Marble.d.ts +32 -0
- package/dist/solid/components/Marble.d.ts.map +1 -0
- package/dist/solid/components/Marble.js +228 -0
- package/dist/solid/components/SunBurst.d.ts +33 -0
- package/dist/solid/components/SunBurst.d.ts.map +1 -0
- package/dist/solid/components/SunBurst.js +228 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +196 -182
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +7 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +230 -216
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +97 -0
- package/dist/svelte/components/BarShift.svelte.d.ts +22 -0
- package/dist/svelte/components/BrickPattern.svelte.d.ts +25 -0
- package/dist/svelte/components/Chevron.svelte.d.ts +24 -0
- package/dist/svelte/components/ColorWheel.svelte.d.ts +21 -0
- package/dist/svelte/components/FractalNoise.svelte.d.ts +23 -0
- package/dist/svelte/components/Marble.svelte.d.ts +22 -0
- package/dist/svelte/components/SunBurst.svelte.d.ts +23 -0
- package/dist/svelte/index.d.ts +7 -0
- package/dist/svelte/index.js +2049 -649
- package/dist/svelte/source/components/BarShift.svelte +328 -0
- package/dist/svelte/source/components/BrickPattern.svelte +331 -0
- package/dist/svelte/source/components/Chevron.svelte +330 -0
- package/dist/svelte/source/components/ColorWheel.svelte +327 -0
- package/dist/svelte/source/components/FractalNoise.svelte +329 -0
- package/dist/svelte/source/components/Marble.svelte +328 -0
- package/dist/svelte/source/components/SunBurst.svelte +329 -0
- package/dist/svelte/source/engine/Preview.svelte +14 -0
- package/dist/svelte/source/index.js +7 -0
- package/dist/svelte/utils/generatePresetCode.js +97 -0
- package/dist/vue/BarShift.js +3 -0
- package/dist/vue/BarShift.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/vue/BrickPattern.js +3 -0
- package/dist/vue/BrickPattern.vue_vue_type_script_setup_true_lang.js +223 -0
- package/dist/vue/Chevron.js +3 -0
- package/dist/vue/Chevron.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/vue/ColorWheel.js +3 -0
- package/dist/vue/ColorWheel.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/vue/FractalNoise.js +3 -0
- package/dist/vue/FractalNoise.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/vue/Marble.js +3 -0
- package/dist/vue/Marble.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/SunBurst.js +3 -0
- package/dist/vue/SunBurst.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/vue/components/BarShift.vue.d.ts +57 -0
- package/dist/vue/components/BarShift.vue.d.ts.map +1 -0
- package/dist/vue/components/BrickPattern.vue.d.ts +60 -0
- package/dist/vue/components/BrickPattern.vue.d.ts.map +1 -0
- package/dist/vue/components/Chevron.vue.d.ts +59 -0
- package/dist/vue/components/Chevron.vue.d.ts.map +1 -0
- package/dist/vue/components/ColorWheel.vue.d.ts +56 -0
- package/dist/vue/components/ColorWheel.vue.d.ts.map +1 -0
- package/dist/vue/components/FractalNoise.vue.d.ts +58 -0
- package/dist/vue/components/FractalNoise.vue.d.ts.map +1 -0
- package/dist/vue/components/Marble.vue.d.ts +57 -0
- package/dist/vue/components/Marble.vue.d.ts.map +1 -0
- package/dist/vue/components/SunBurst.vue.d.ts +58 -0
- package/dist/vue/components/SunBurst.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +7 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +8 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +97 -0
- package/package.json +142 -1
- package/dist/core/shaderRegistry-Ceu0nAxP.js +0 -256
- /package/dist/core/{Beam-mvF5Ri7_.js → Beam-B3BX08lR.js} +0 -0
- /package/dist/core/{Blob-CLHx5s6k.js → Blob-B7IFHhVB.js} +0 -0
- /package/dist/core/{BrightnessContrast-CJTOpQCn.js → BrightnessContrast-GppIqtkO.js} +0 -0
- /package/dist/core/{Bulge-wflTcWfI.js → Bulge-DMOATSEs.js} +0 -0
- /package/dist/core/{CRTScreen-CTwXU-NX.js → CRTScreen-corekL_R.js} +0 -0
- /package/dist/core/{Checkerboard-Db7Rb57F.js → Checkerboard-BVBGTvd-.js} +0 -0
- /package/dist/core/{ChromaFlow-DbiVz3hF.js → ChromaFlow-C0guw_LP.js} +0 -0
- /package/dist/core/{ChromaticAberration-Bg_I4XF-.js → ChromaticAberration-vygkvgz-.js} +0 -0
- /package/dist/core/{Circle-Bfi2e0Vm.js → Circle-BycqVCMt.js} +0 -0
- /package/dist/core/{ConcentricSpin-bAFd5_WI.js → ConcentricSpin-CO3Kx1I1.js} +0 -0
- /package/dist/core/{ConicGradient-Bcw4_25S.js → ConicGradient-DRvVwiSj.js} +0 -0
- /package/dist/core/{ContourLines-CcQWPKLx.js → ContourLines-s4waN3uU.js} +0 -0
- /package/dist/core/{CursorRipples-CsYAXG2E.js → CursorRipples-CLP7Sinv.js} +0 -0
- /package/dist/core/{CursorTrail-CUtEP_-P.js → CursorTrail-CshoSM5Y.js} +0 -0
- /package/dist/core/{DOMTexture-D-RkeyMs.js → DOMTexture-Ec0k6AnK.js} +0 -0
- /package/dist/core/{DiamondGradient-3b93bdrv.js → DiamondGradient-D6eyjZOn.js} +0 -0
- /package/dist/core/{DiffuseBlur-61Vuq571.js → DiffuseBlur-BjvXHmJx.js} +0 -0
- /package/dist/core/{Dither-Cv0Uci60.js → Dither-z6s-TFg7.js} +0 -0
- /package/dist/core/{DotGrid-C88Sux6D.js → DotGrid-BxAAGO4F.js} +0 -0
- /package/dist/core/{DropShadow-EZyCC_97.js → DropShadow-CR3cecIQ.js} +0 -0
- /package/dist/core/{Duotone-D4ads1T9.js → Duotone-PwTfBBtM.js} +0 -0
- /package/dist/core/{FallingLines-CQBvwLqn.js → FallingLines-DqIZ8wTH.js} +0 -0
- /package/dist/core/{FilmGrain-DSJiMtEp.js → FilmGrain-Dbw02Jz9.js} +0 -0
- /package/dist/core/{FloatingParticles-BAvsQDhF.js → FloatingParticles-C4sLwGyT.js} +0 -0
- /package/dist/core/{FlowField-D2xJ0Xr4.js → FlowField-D3CAHBBG.js} +0 -0
- /package/dist/core/{FlowingGradient-DVDnNpGd.js → FlowingGradient-BRQ_K-k3.js} +0 -0
- /package/dist/core/{FlutedGlass-trmBFfQr.js → FlutedGlass-CyFWN_SM.js} +0 -0
- /package/dist/core/{Fog-DrsxPyih.js → Fog-CLGVVVeo.js} +0 -0
- /package/dist/core/{Form3D-D1TtCjk8.js → Form3D-8tPyUgh4.js} +0 -0
- /package/dist/core/{GlassTiles-CMx4NyO-.js → GlassTiles-CXJHjEBe.js} +0 -0
- /package/dist/core/{Glitch-BdygvJKe.js → Glitch-Bg9W-KNm.js} +0 -0
- /package/dist/core/{Godrays-Mvz7ha2E.js → Godrays-DHXKsw5B.js} +0 -0
- /package/dist/core/{Grayscale-ChaVI3AW.js → Grayscale-DgXoUcmg.js} +0 -0
- /package/dist/core/{Grid-CsD21Eqg.js → Grid-DwyhjFAT.js} +0 -0
- /package/dist/core/{GridDistortion-BcDqBh9i.js → GridDistortion-DJ8S-96Y.js} +0 -0
- /package/dist/core/{Group-BqVJ4S7i.js → Group-DmgNNlDd.js} +0 -0
- /package/dist/core/{Halftone-3ImN5uQi.js → Halftone-x9boWkFW.js} +0 -0
- /package/dist/core/{HexGrid-BWwIHYEg.js → HexGrid-BUsgyF8P.js} +0 -0
- /package/dist/core/{HueShift-C1RxETwN.js → HueShift-D3_5D7jx.js} +0 -0
- /package/dist/core/{ImageTexture-DXhgMEOT.js → ImageTexture-6ZzBt79u.js} +0 -0
- /package/dist/core/{Invert-D3tc2UGp.js → Invert-kXxY97QJ.js} +0 -0
- /package/dist/core/{Kaleidoscope-D1HmcoOv.js → Kaleidoscope-D4jRcZCt.js} +0 -0
- /package/dist/core/{LensFlare-Be-Z9whi.js → LensFlare-D7vypE2Q.js} +0 -0
- /package/dist/core/{LinearBlur-xrHtMmWp.js → LinearBlur-2hspd2YP.js} +0 -0
- /package/dist/core/{LinearGradient-BiIad_hA.js → LinearGradient-glCc9IaB.js} +0 -0
- /package/dist/core/{Liquify-DkTxZZFW.js → Liquify-uZjs0wcu.js} +0 -0
- /package/dist/core/{Mirror-BDTE51kP.js → Mirror-Dv5fOEp6.js} +0 -0
- /package/dist/core/{MultiPointGradient-Bd-EGOI8.js → MultiPointGradient-Dvt1GUiv.js} +0 -0
- /package/dist/core/{Paper-BmeUPAFe.js → Paper-DNP2-hPM.js} +0 -0
- /package/dist/core/{Perspective-CqweSeFv.js → Perspective-CAIchX9p.js} +0 -0
- /package/dist/core/{Pixelate-DqZcUKFK.js → Pixelate-BbT3Rrf2.js} +0 -0
- /package/dist/core/{Plasma-DqKLBDYd.js → Plasma-D9rhkH2y.js} +0 -0
- /package/dist/core/{PolarCoordinates-CKT4CLT7.js → PolarCoordinates-2RBCk-fo.js} +0 -0
- /package/dist/core/{Posterize-CxYemXTn.js → Posterize-DNxTRgvF.js} +0 -0
- /package/dist/core/{RadialGradient-Dj3-DdO7.js → RadialGradient-CQIctl__.js} +0 -0
- /package/dist/core/{RectangularCoordinates-DxeLJ2nt.js → RectangularCoordinates-F2VzXmal.js} +0 -0
- /package/dist/core/{Ripples-CXeVzwUd.js → Ripples-B4H0VoZb.js} +0 -0
- /package/dist/core/{Saturation-n-aXJS81.js → Saturation-6FlxHXSi.js} +0 -0
- /package/dist/core/{Sharpness-7tm7b-Bu.js → Sharpness-C4cJlBuh.js} +0 -0
- /package/dist/core/{Shatter-CDza7dSw.js → Shatter-CnkycTRD.js} +0 -0
- /package/dist/core/{SimplexNoise-HQTocBLm.js → SimplexNoise-BnRaoxON.js} +0 -0
- /package/dist/core/{SineWave-S6nK8ZHR.js → SineWave-CZ4Fanvr.js} +0 -0
- /package/dist/core/{Smoke-DjlArYQW.js → Smoke-CXPjGG-b.js} +0 -0
- /package/dist/core/{Solarize-gNMmd47z.js → Solarize-CynVlxjT.js} +0 -0
- /package/dist/core/{SolidColor-a8bCIksn.js → SolidColor-dCAOGC_P.js} +0 -0
- /package/dist/core/{Spherize-BHmD2ajL.js → Spherize-C77QGVWj.js} +0 -0
- /package/dist/core/{Spiral-Bjsi8BMH.js → Spiral-eN65wa6O.js} +0 -0
- /package/dist/core/{Strands-C9fEwaiR.js → Strands-DnWJDGiO.js} +0 -0
- /package/dist/core/{Stretch-Cvht8B0L.js → Stretch-B5XGF1bF.js} +0 -0
- /package/dist/core/{Stripes-ChVSAeCO.js → Stripes-CNXJpFyr.js} +0 -0
- /package/dist/core/{StudioBackground-B8hilROB.js → StudioBackground-DtiE2mCf.js} +0 -0
- /package/dist/core/{Swirl-DZTPLx-W.js → Swirl-BV6pN94G.js} +0 -0
- /package/dist/core/{Tint-P7KwJAU5.js → Tint-CJ8FQdzA.js} +0 -0
- /package/dist/core/{Tritone-_9VR2bhu.js → Tritone-D_QvxjGc.js} +0 -0
- /package/dist/core/{Truchet-CbL5nYMj.js → Truchet-BJeZS_JQ.js} +0 -0
- /package/dist/core/{Twirl-C_97m32v.js → Twirl-8ayqS0n8.js} +0 -0
- /package/dist/core/{VHS-DbNjgUEX.js → VHS-Gbec95K_.js} +0 -0
- /package/dist/core/{Vibrance-IDvmP1Xw.js → Vibrance-COKHmh8r.js} +0 -0
- /package/dist/core/{Vignette-DmYVHciL.js → Vignette-Y_2yono-.js} +0 -0
- /package/dist/core/{Voronoi-kngFpTNB.js → Voronoi-DQ_f6k5D.js} +0 -0
- /package/dist/core/{WaveDistortion-DM-f_XCw.js → WaveDistortion-R5FfwKQN.js} +0 -0
- /package/dist/core/{Weave-DO0m0Dsh.js → Weave-DJ4s3Gwc.js} +0 -0
- /package/dist/core/{WorleyNoise-Derik4n-.js → WorleyNoise-CWytDfGH.js} +0 -0
- /package/dist/core/{ZoomBlur-BdLC9MCq.js → ZoomBlur-DWFQVFMK.js} +0 -0
- /package/dist/core/{browser-CsOpQ0L_.js → browser-BamVDhaZ.js} +0 -0
- /package/dist/core/{computeBlur-DCRhuYEi.js → computeBlur-CprKe0xa.js} +0 -0
- /package/dist/core/{sdf-DyC2H_qS.js → sdf-D_EAGXhN.js} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { BlendMode, PropDriver, TransformConfig } from '../../core';
|
|
3
|
+
import { ComponentProps } from '../../core/shaders/BarShift';
|
|
4
|
+
export type { ComponentProps };
|
|
5
|
+
/**
|
|
6
|
+
* Base props that all shader components have
|
|
7
|
+
*/
|
|
8
|
+
interface BaseShaderProps {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
blendMode?: BlendMode;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
maskSource?: string;
|
|
15
|
+
maskType?: string;
|
|
16
|
+
renderOrder?: number;
|
|
17
|
+
transform?: Partial<TransformConfig>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Component-specific props that merge base props with shader-specific props
|
|
21
|
+
* Note: ComponentProps are made optional since they have defaults from the shader definition
|
|
22
|
+
*/
|
|
23
|
+
type ShaderComponentProps = BaseShaderProps & Partial<Omit<ComponentProps, 'count' | 'angle' | 'intensity'>> & {
|
|
24
|
+
count?: ComponentProps['count'] | PropDriver;
|
|
25
|
+
angle?: ComponentProps['angle'] | PropDriver;
|
|
26
|
+
intensity?: ComponentProps['intensity'] | PropDriver;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The main Solid wrapper component for Shader shader nodes
|
|
30
|
+
*/
|
|
31
|
+
export default function ShaderComponent(props: ShaderComponentProps): JSX.Element;
|
|
32
|
+
//# sourceMappingURL=BarShift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarShift.d.ts","sourceRoot":"","sources":["../../src/components/BarShift.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0F,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5H,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGjF,YAAY,EAAE,cAAc,EAAE,CAAC;AAY/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC;AAOD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC,CAAC,GAAG;IAC7G,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAC7C,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAC7C,SAAS,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;CACtD,CAAC;AAmCF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA8NlE"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { createComponent, memo, template, setAttribute, insert, Portal, spread, mergeProps, use } from "solid-js/web";
|
|
2
|
+
import { splitProps, createUniqueId, createMemo, createSignal, onMount, onCleanup, createEffect } from "solid-js";
|
|
3
|
+
import { createUniformsMap } from "../../core/index.js";
|
|
4
|
+
import { setColorSpaceMode } from "../../core/utilities/transformations/index.js";
|
|
5
|
+
import { componentDefinition } from "../../core/shaders/BarShift/index.js";
|
|
6
|
+
import { useShaderContext, ShaderContext } from "../engine/Shader.js";
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span style=display:contents>`), _tmpl$2 = /* @__PURE__ */ template(`<canvas>`);
|
|
8
|
+
let _experimentalWarnedOnce = false;
|
|
9
|
+
if (componentDefinition.experimental && !_experimentalWarnedOnce) {
|
|
10
|
+
_experimentalWarnedOnce = true;
|
|
11
|
+
const _e = componentDefinition.experimental;
|
|
12
|
+
console.info(`%c⚠ [Shaders] ${componentDefinition.name} is experimental: ${_e.message}`, "color: #f59e0b; font-weight: bold");
|
|
13
|
+
}
|
|
14
|
+
function isPropDriver(value) {
|
|
15
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
16
|
+
}
|
|
17
|
+
const DEFAULT_TRANSFORM = {
|
|
18
|
+
offsetX: 0,
|
|
19
|
+
offsetY: 0,
|
|
20
|
+
rotation: 0,
|
|
21
|
+
scale: 1,
|
|
22
|
+
anchorX: 0.5,
|
|
23
|
+
anchorY: 0.5,
|
|
24
|
+
edges: "transparent"
|
|
25
|
+
};
|
|
26
|
+
const defaultProps = {
|
|
27
|
+
blendMode: "normal",
|
|
28
|
+
visible: true
|
|
29
|
+
// opacity intentionally has no default - handled by renderer
|
|
30
|
+
// transform intentionally has no default - handled by effectiveTransform
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
if (componentDefinition && componentDefinition.props) {
|
|
34
|
+
Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
35
|
+
const propConfig = config;
|
|
36
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) {
|
|
37
|
+
defaultProps[key] = propConfig.default;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.warn("Error extracting default props:", e);
|
|
43
|
+
}
|
|
44
|
+
function ShaderComponent(props) {
|
|
45
|
+
const [local, otherProps] = splitProps(props, ["children"]);
|
|
46
|
+
const context = useShaderContext();
|
|
47
|
+
const {
|
|
48
|
+
shaderParentId: parentId,
|
|
49
|
+
shaderNodeRegister: parentRegister,
|
|
50
|
+
shaderUniformUpdate: parentUniformUpdate,
|
|
51
|
+
shaderMetadataUpdate: parentMetadataUpdate,
|
|
52
|
+
shaderColorSpace
|
|
53
|
+
} = context;
|
|
54
|
+
const instanceId = (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || createUniqueId();
|
|
55
|
+
const effectiveProps = createMemo(() => {
|
|
56
|
+
let baseProps = {
|
|
57
|
+
...defaultProps
|
|
58
|
+
};
|
|
59
|
+
for (const [key, value] of Object.entries(otherProps)) {
|
|
60
|
+
if (value !== void 0 && !isPropDriver(value)) {
|
|
61
|
+
baseProps[key] = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return baseProps;
|
|
65
|
+
});
|
|
66
|
+
const effectiveTransform = createMemo(() => ({
|
|
67
|
+
...DEFAULT_TRANSFORM,
|
|
68
|
+
...props.transform
|
|
69
|
+
}));
|
|
70
|
+
const mapsFromProps = createMemo(() => {
|
|
71
|
+
const maps = {};
|
|
72
|
+
for (const [key, value] of Object.entries(otherProps)) {
|
|
73
|
+
if (isPropDriver(value)) maps[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
76
|
+
});
|
|
77
|
+
let uniformsMap = null;
|
|
78
|
+
const getUniformsMap = () => {
|
|
79
|
+
if (!uniformsMap) {
|
|
80
|
+
setColorSpaceMode(shaderColorSpace);
|
|
81
|
+
uniformsMap = createUniformsMap(componentDefinition, effectiveProps(), instanceId);
|
|
82
|
+
}
|
|
83
|
+
return uniformsMap;
|
|
84
|
+
};
|
|
85
|
+
const childContextValue = createMemo(() => ({
|
|
86
|
+
...context,
|
|
87
|
+
shaderParentId: instanceId
|
|
88
|
+
}));
|
|
89
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
90
|
+
let captureCanvasEl;
|
|
91
|
+
const [captureSize, setCaptureSize] = createSignal({
|
|
92
|
+
w: typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0,
|
|
93
|
+
h: typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0
|
|
94
|
+
});
|
|
95
|
+
if (isCapturesDOM) {
|
|
96
|
+
const onWinResize = () => {
|
|
97
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
98
|
+
setCaptureSize({
|
|
99
|
+
w: Math.round(window.innerWidth * d),
|
|
100
|
+
h: Math.round(window.innerHeight * d)
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
onMount(() => window.addEventListener("resize", onWinResize));
|
|
104
|
+
onCleanup(() => window.removeEventListener("resize", onWinResize));
|
|
105
|
+
}
|
|
106
|
+
let markerRef;
|
|
107
|
+
let detectedRenderOrder = void 0;
|
|
108
|
+
let isRegistered = false;
|
|
109
|
+
onMount(() => {
|
|
110
|
+
const uniforms = getUniformsMap();
|
|
111
|
+
if (!uniforms) return;
|
|
112
|
+
try {
|
|
113
|
+
const metadata = {
|
|
114
|
+
blendMode: props.blendMode || "normal",
|
|
115
|
+
opacity: props.opacity,
|
|
116
|
+
visible: props.visible === false ? false : true,
|
|
117
|
+
id: props.id,
|
|
118
|
+
mask: props.maskSource ? {
|
|
119
|
+
source: props.maskSource,
|
|
120
|
+
type: props.maskType || "alpha"
|
|
121
|
+
} : void 0,
|
|
122
|
+
maps: mapsFromProps(),
|
|
123
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
124
|
+
transform: effectiveTransform()
|
|
125
|
+
};
|
|
126
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniforms, componentDefinition, isCapturesDOM ? captureCanvasEl : void 0);
|
|
127
|
+
isRegistered = true;
|
|
128
|
+
if (props.renderOrder === void 0 && markerRef) {
|
|
129
|
+
const parent = markerRef.parentElement;
|
|
130
|
+
if (parent) {
|
|
131
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
132
|
+
const position = Array.from(siblings).indexOf(markerRef);
|
|
133
|
+
if (position >= 0) {
|
|
134
|
+
detectedRenderOrder = position;
|
|
135
|
+
parentMetadataUpdate(instanceId, {
|
|
136
|
+
renderOrder: position
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.error("Error registering shader node:", error);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
onCleanup(() => {
|
|
146
|
+
isRegistered = false;
|
|
147
|
+
parentRegister(instanceId, null, null, null, null);
|
|
148
|
+
});
|
|
149
|
+
createEffect(() => {
|
|
150
|
+
if (!isRegistered) return;
|
|
151
|
+
const uniforms = getUniformsMap();
|
|
152
|
+
if (!uniforms) return;
|
|
153
|
+
try {
|
|
154
|
+
const props_snapshot = effectiveProps();
|
|
155
|
+
Object.entries(uniforms).forEach(([propName, uniformData]) => {
|
|
156
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
157
|
+
const {
|
|
158
|
+
uniform
|
|
159
|
+
} = uniformData;
|
|
160
|
+
if ((uniform == null ? void 0 : uniform.value) !== void 0 && propName in props_snapshot) {
|
|
161
|
+
const newValue = props_snapshot[propName];
|
|
162
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error("Error updating uniforms:", error);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
createEffect(() => {
|
|
170
|
+
if (!isRegistered) return;
|
|
171
|
+
try {
|
|
172
|
+
const metadata = {
|
|
173
|
+
blendMode: props.blendMode || "normal",
|
|
174
|
+
opacity: props.opacity,
|
|
175
|
+
visible: props.visible === false ? false : true,
|
|
176
|
+
id: props.id,
|
|
177
|
+
mask: props.maskSource ? {
|
|
178
|
+
source: props.maskSource,
|
|
179
|
+
type: props.maskType || "alpha"
|
|
180
|
+
} : void 0,
|
|
181
|
+
maps: mapsFromProps(),
|
|
182
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
183
|
+
transform: effectiveTransform()
|
|
184
|
+
};
|
|
185
|
+
parentMetadataUpdate(instanceId, metadata);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
console.error("Error updating metadata:", error);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
const canUseDOM = typeof document !== "undefined" && typeof window !== "undefined";
|
|
191
|
+
return createComponent(ShaderContext.Provider, {
|
|
192
|
+
get value() {
|
|
193
|
+
return childContextValue();
|
|
194
|
+
},
|
|
195
|
+
get children() {
|
|
196
|
+
return [(() => {
|
|
197
|
+
var _el$ = _tmpl$();
|
|
198
|
+
var _ref$ = markerRef;
|
|
199
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : markerRef = _el$;
|
|
200
|
+
setAttribute(_el$, "data-shader-id", instanceId);
|
|
201
|
+
insert(_el$, () => (!isCapturesDOM || !canUseDOM) && local.children);
|
|
202
|
+
return _el$;
|
|
203
|
+
})(), memo(() => isCapturesDOM && canUseDOM && createComponent(Portal, {
|
|
204
|
+
get children() {
|
|
205
|
+
var _el$2 = _tmpl$2();
|
|
206
|
+
var _ref$2 = captureCanvasEl;
|
|
207
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$2) : captureCanvasEl = _el$2;
|
|
208
|
+
spread(_el$2, mergeProps({
|
|
209
|
+
"layoutsubtree": ""
|
|
210
|
+
}, {
|
|
211
|
+
get width() {
|
|
212
|
+
return captureSize().w;
|
|
213
|
+
},
|
|
214
|
+
get height() {
|
|
215
|
+
return captureSize().h;
|
|
216
|
+
},
|
|
217
|
+
"style": "position:fixed;inset:0;width:100vw;height:100vh;z-index:-9999"
|
|
218
|
+
}), false, true);
|
|
219
|
+
insert(_el$2, () => local.children);
|
|
220
|
+
return _el$2;
|
|
221
|
+
}
|
|
222
|
+
}))];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
export {
|
|
227
|
+
ShaderComponent as default
|
|
228
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { BlendMode, PropDriver, TransformConfig } from '../../core';
|
|
3
|
+
import { ComponentProps } from '../../core/shaders/BrickPattern';
|
|
4
|
+
export type { ComponentProps };
|
|
5
|
+
/**
|
|
6
|
+
* Base props that all shader components have
|
|
7
|
+
*/
|
|
8
|
+
interface BaseShaderProps {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
blendMode?: BlendMode;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
maskSource?: string;
|
|
15
|
+
maskType?: string;
|
|
16
|
+
renderOrder?: number;
|
|
17
|
+
transform?: Partial<TransformConfig>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Component-specific props that merge base props with shader-specific props
|
|
21
|
+
* Note: ComponentProps are made optional since they have defaults from the shader definition
|
|
22
|
+
*/
|
|
23
|
+
type ShaderComponentProps = BaseShaderProps & Partial<Omit<ComponentProps, 'cellsX' | 'cellsY' | 'mortar' | 'angle' | 'offset' | 'speedVariance'>> & {
|
|
24
|
+
cellsX?: ComponentProps['cellsX'] | PropDriver;
|
|
25
|
+
cellsY?: ComponentProps['cellsY'] | PropDriver;
|
|
26
|
+
mortar?: ComponentProps['mortar'] | PropDriver;
|
|
27
|
+
angle?: ComponentProps['angle'] | PropDriver;
|
|
28
|
+
offset?: ComponentProps['offset'] | PropDriver;
|
|
29
|
+
speedVariance?: ComponentProps['speedVariance'] | PropDriver;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The main Solid wrapper component for Shader shader nodes
|
|
33
|
+
*/
|
|
34
|
+
export default function ShaderComponent(props: ShaderComponentProps): JSX.Element;
|
|
35
|
+
//# sourceMappingURL=BrickPattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrickPattern.d.ts","sourceRoot":"","sources":["../../src/components/BrickPattern.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0F,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5H,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGrF,YAAY,EAAE,cAAc,EAAE,CAAC;AAY/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC;AAOD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,eAAe,CAAC,CAAC,GAAG;IACnJ,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;IAC/C,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;IAC/C,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;IAC/C,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;IAC/C,aAAa,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC9D,CAAC;AAmCF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA8NlE"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { createComponent, memo, template, setAttribute, insert, Portal, spread, mergeProps, use } from "solid-js/web";
|
|
2
|
+
import { splitProps, createUniqueId, createMemo, createSignal, onMount, onCleanup, createEffect } from "solid-js";
|
|
3
|
+
import { createUniformsMap } from "../../core/index.js";
|
|
4
|
+
import { setColorSpaceMode } from "../../core/utilities/transformations/index.js";
|
|
5
|
+
import { componentDefinition } from "../../core/shaders/BrickPattern/index.js";
|
|
6
|
+
import { useShaderContext, ShaderContext } from "../engine/Shader.js";
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span style=display:contents>`), _tmpl$2 = /* @__PURE__ */ template(`<canvas>`);
|
|
8
|
+
let _experimentalWarnedOnce = false;
|
|
9
|
+
if (componentDefinition.experimental && !_experimentalWarnedOnce) {
|
|
10
|
+
_experimentalWarnedOnce = true;
|
|
11
|
+
const _e = componentDefinition.experimental;
|
|
12
|
+
console.info(`%c⚠ [Shaders] ${componentDefinition.name} is experimental: ${_e.message}`, "color: #f59e0b; font-weight: bold");
|
|
13
|
+
}
|
|
14
|
+
function isPropDriver(value) {
|
|
15
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
16
|
+
}
|
|
17
|
+
const DEFAULT_TRANSFORM = {
|
|
18
|
+
offsetX: 0,
|
|
19
|
+
offsetY: 0,
|
|
20
|
+
rotation: 0,
|
|
21
|
+
scale: 1,
|
|
22
|
+
anchorX: 0.5,
|
|
23
|
+
anchorY: 0.5,
|
|
24
|
+
edges: "transparent"
|
|
25
|
+
};
|
|
26
|
+
const defaultProps = {
|
|
27
|
+
blendMode: "normal",
|
|
28
|
+
visible: true
|
|
29
|
+
// opacity intentionally has no default - handled by renderer
|
|
30
|
+
// transform intentionally has no default - handled by effectiveTransform
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
if (componentDefinition && componentDefinition.props) {
|
|
34
|
+
Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
35
|
+
const propConfig = config;
|
|
36
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) {
|
|
37
|
+
defaultProps[key] = propConfig.default;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.warn("Error extracting default props:", e);
|
|
43
|
+
}
|
|
44
|
+
function ShaderComponent(props) {
|
|
45
|
+
const [local, otherProps] = splitProps(props, ["children"]);
|
|
46
|
+
const context = useShaderContext();
|
|
47
|
+
const {
|
|
48
|
+
shaderParentId: parentId,
|
|
49
|
+
shaderNodeRegister: parentRegister,
|
|
50
|
+
shaderUniformUpdate: parentUniformUpdate,
|
|
51
|
+
shaderMetadataUpdate: parentMetadataUpdate,
|
|
52
|
+
shaderColorSpace
|
|
53
|
+
} = context;
|
|
54
|
+
const instanceId = (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || createUniqueId();
|
|
55
|
+
const effectiveProps = createMemo(() => {
|
|
56
|
+
let baseProps = {
|
|
57
|
+
...defaultProps
|
|
58
|
+
};
|
|
59
|
+
for (const [key, value] of Object.entries(otherProps)) {
|
|
60
|
+
if (value !== void 0 && !isPropDriver(value)) {
|
|
61
|
+
baseProps[key] = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return baseProps;
|
|
65
|
+
});
|
|
66
|
+
const effectiveTransform = createMemo(() => ({
|
|
67
|
+
...DEFAULT_TRANSFORM,
|
|
68
|
+
...props.transform
|
|
69
|
+
}));
|
|
70
|
+
const mapsFromProps = createMemo(() => {
|
|
71
|
+
const maps = {};
|
|
72
|
+
for (const [key, value] of Object.entries(otherProps)) {
|
|
73
|
+
if (isPropDriver(value)) maps[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
76
|
+
});
|
|
77
|
+
let uniformsMap = null;
|
|
78
|
+
const getUniformsMap = () => {
|
|
79
|
+
if (!uniformsMap) {
|
|
80
|
+
setColorSpaceMode(shaderColorSpace);
|
|
81
|
+
uniformsMap = createUniformsMap(componentDefinition, effectiveProps(), instanceId);
|
|
82
|
+
}
|
|
83
|
+
return uniformsMap;
|
|
84
|
+
};
|
|
85
|
+
const childContextValue = createMemo(() => ({
|
|
86
|
+
...context,
|
|
87
|
+
shaderParentId: instanceId
|
|
88
|
+
}));
|
|
89
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
90
|
+
let captureCanvasEl;
|
|
91
|
+
const [captureSize, setCaptureSize] = createSignal({
|
|
92
|
+
w: typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0,
|
|
93
|
+
h: typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0
|
|
94
|
+
});
|
|
95
|
+
if (isCapturesDOM) {
|
|
96
|
+
const onWinResize = () => {
|
|
97
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
98
|
+
setCaptureSize({
|
|
99
|
+
w: Math.round(window.innerWidth * d),
|
|
100
|
+
h: Math.round(window.innerHeight * d)
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
onMount(() => window.addEventListener("resize", onWinResize));
|
|
104
|
+
onCleanup(() => window.removeEventListener("resize", onWinResize));
|
|
105
|
+
}
|
|
106
|
+
let markerRef;
|
|
107
|
+
let detectedRenderOrder = void 0;
|
|
108
|
+
let isRegistered = false;
|
|
109
|
+
onMount(() => {
|
|
110
|
+
const uniforms = getUniformsMap();
|
|
111
|
+
if (!uniforms) return;
|
|
112
|
+
try {
|
|
113
|
+
const metadata = {
|
|
114
|
+
blendMode: props.blendMode || "normal",
|
|
115
|
+
opacity: props.opacity,
|
|
116
|
+
visible: props.visible === false ? false : true,
|
|
117
|
+
id: props.id,
|
|
118
|
+
mask: props.maskSource ? {
|
|
119
|
+
source: props.maskSource,
|
|
120
|
+
type: props.maskType || "alpha"
|
|
121
|
+
} : void 0,
|
|
122
|
+
maps: mapsFromProps(),
|
|
123
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
124
|
+
transform: effectiveTransform()
|
|
125
|
+
};
|
|
126
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniforms, componentDefinition, isCapturesDOM ? captureCanvasEl : void 0);
|
|
127
|
+
isRegistered = true;
|
|
128
|
+
if (props.renderOrder === void 0 && markerRef) {
|
|
129
|
+
const parent = markerRef.parentElement;
|
|
130
|
+
if (parent) {
|
|
131
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
132
|
+
const position = Array.from(siblings).indexOf(markerRef);
|
|
133
|
+
if (position >= 0) {
|
|
134
|
+
detectedRenderOrder = position;
|
|
135
|
+
parentMetadataUpdate(instanceId, {
|
|
136
|
+
renderOrder: position
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.error("Error registering shader node:", error);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
onCleanup(() => {
|
|
146
|
+
isRegistered = false;
|
|
147
|
+
parentRegister(instanceId, null, null, null, null);
|
|
148
|
+
});
|
|
149
|
+
createEffect(() => {
|
|
150
|
+
if (!isRegistered) return;
|
|
151
|
+
const uniforms = getUniformsMap();
|
|
152
|
+
if (!uniforms) return;
|
|
153
|
+
try {
|
|
154
|
+
const props_snapshot = effectiveProps();
|
|
155
|
+
Object.entries(uniforms).forEach(([propName, uniformData]) => {
|
|
156
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
157
|
+
const {
|
|
158
|
+
uniform
|
|
159
|
+
} = uniformData;
|
|
160
|
+
if ((uniform == null ? void 0 : uniform.value) !== void 0 && propName in props_snapshot) {
|
|
161
|
+
const newValue = props_snapshot[propName];
|
|
162
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error("Error updating uniforms:", error);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
createEffect(() => {
|
|
170
|
+
if (!isRegistered) return;
|
|
171
|
+
try {
|
|
172
|
+
const metadata = {
|
|
173
|
+
blendMode: props.blendMode || "normal",
|
|
174
|
+
opacity: props.opacity,
|
|
175
|
+
visible: props.visible === false ? false : true,
|
|
176
|
+
id: props.id,
|
|
177
|
+
mask: props.maskSource ? {
|
|
178
|
+
source: props.maskSource,
|
|
179
|
+
type: props.maskType || "alpha"
|
|
180
|
+
} : void 0,
|
|
181
|
+
maps: mapsFromProps(),
|
|
182
|
+
renderOrder: props.renderOrder ?? detectedRenderOrder,
|
|
183
|
+
transform: effectiveTransform()
|
|
184
|
+
};
|
|
185
|
+
parentMetadataUpdate(instanceId, metadata);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
console.error("Error updating metadata:", error);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
const canUseDOM = typeof document !== "undefined" && typeof window !== "undefined";
|
|
191
|
+
return createComponent(ShaderContext.Provider, {
|
|
192
|
+
get value() {
|
|
193
|
+
return childContextValue();
|
|
194
|
+
},
|
|
195
|
+
get children() {
|
|
196
|
+
return [(() => {
|
|
197
|
+
var _el$ = _tmpl$();
|
|
198
|
+
var _ref$ = markerRef;
|
|
199
|
+
typeof _ref$ === "function" ? use(_ref$, _el$) : markerRef = _el$;
|
|
200
|
+
setAttribute(_el$, "data-shader-id", instanceId);
|
|
201
|
+
insert(_el$, () => (!isCapturesDOM || !canUseDOM) && local.children);
|
|
202
|
+
return _el$;
|
|
203
|
+
})(), memo(() => isCapturesDOM && canUseDOM && createComponent(Portal, {
|
|
204
|
+
get children() {
|
|
205
|
+
var _el$2 = _tmpl$2();
|
|
206
|
+
var _ref$2 = captureCanvasEl;
|
|
207
|
+
typeof _ref$2 === "function" ? use(_ref$2, _el$2) : captureCanvasEl = _el$2;
|
|
208
|
+
spread(_el$2, mergeProps({
|
|
209
|
+
"layoutsubtree": ""
|
|
210
|
+
}, {
|
|
211
|
+
get width() {
|
|
212
|
+
return captureSize().w;
|
|
213
|
+
},
|
|
214
|
+
get height() {
|
|
215
|
+
return captureSize().h;
|
|
216
|
+
},
|
|
217
|
+
"style": "position:fixed;inset:0;width:100vw;height:100vh;z-index:-9999"
|
|
218
|
+
}), false, true);
|
|
219
|
+
insert(_el$2, () => local.children);
|
|
220
|
+
return _el$2;
|
|
221
|
+
}
|
|
222
|
+
}))];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
export {
|
|
227
|
+
ShaderComponent as default
|
|
228
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { BlendMode, PropDriver, TransformConfig } from '../../core';
|
|
3
|
+
import { ComponentProps } from '../../core/shaders/Chevron';
|
|
4
|
+
export type { ComponentProps };
|
|
5
|
+
/**
|
|
6
|
+
* Base props that all shader components have
|
|
7
|
+
*/
|
|
8
|
+
interface BaseShaderProps {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
blendMode?: BlendMode;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
id?: string;
|
|
14
|
+
maskSource?: string;
|
|
15
|
+
maskType?: string;
|
|
16
|
+
renderOrder?: number;
|
|
17
|
+
transform?: Partial<TransformConfig>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Component-specific props that merge base props with shader-specific props
|
|
21
|
+
* Note: ComponentProps are made optional since they have defaults from the shader definition
|
|
22
|
+
*/
|
|
23
|
+
type ShaderComponentProps = BaseShaderProps & Partial<Omit<ComponentProps, 'count' | 'angle' | 'balance' | 'softness' | 'offset'>> & {
|
|
24
|
+
count?: ComponentProps['count'] | PropDriver;
|
|
25
|
+
angle?: ComponentProps['angle'] | PropDriver;
|
|
26
|
+
balance?: ComponentProps['balance'] | PropDriver;
|
|
27
|
+
softness?: ComponentProps['softness'] | PropDriver;
|
|
28
|
+
offset?: ComponentProps['offset'] | PropDriver;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The main Solid wrapper component for Shader shader nodes
|
|
32
|
+
*/
|
|
33
|
+
export default function ShaderComponent(props: ShaderComponentProps): JSX.Element;
|
|
34
|
+
//# sourceMappingURL=Chevron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chevron.d.ts","sourceRoot":"","sources":["../../src/components/Chevron.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0F,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5H,OAAO,EAGH,KAAK,SAAS,EAId,KAAK,UAAU,EACf,KAAK,eAAe,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGhF,YAAY,EAAE,cAAc,EAAE,CAAC;AAY/B;;GAEG;AACH,UAAU,eAAe;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC;AAOD;;;GAGG;AACH,KAAK,oBAAoB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC,CAAC,GAAG;IACnI,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAC7C,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;IAC7C,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC;IACjD,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;IACnD,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC;CAChD,CAAC;AAmCF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,oBAAoB,eA8NlE"}
|