shaders 3.1.456 → 3.1.457
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/cli.js +2 -2
- package/dist/core/{Aurora-A5yag1_A.js → Aurora-CJ7evt-F.js} +1 -1
- package/dist/core/{Beam-CgpfMTUq.js → Beam-KKNLzfKR.js} +1 -1
- package/dist/core/{BlockNoise-Csb39Mqw.js → BlockNoise-DQUBYM1N.js} +1 -1
- package/dist/core/{BlueNoise-CnSe6lOE.js → BlueNoise-BN1q4V6k.js} +1 -1
- package/dist/core/{BrickPattern-DomddM0C.js → BrickPattern-CIejlS9-.js} +3 -3
- package/dist/core/{Checkerboard-Ynfnt3oJ.js → Checkerboard-BFFF9ajX.js} +2 -2
- package/dist/core/{Chevron-CEwNP2vt.js → Chevron-BHbGhnrT.js} +1 -1
- package/dist/core/{ColorWheel-BCReEdLZ.js → ColorWheel-BOfvt3mc.js} +1 -1
- package/dist/core/{ConicGradient-C3zzgyV4.js → ConicGradient-1RKI-gOR.js} +1 -1
- package/dist/core/{CurlNoise-CFAQHy-5.js → CurlNoise-FmbuZEYt.js} +1 -1
- package/dist/core/{DiamondGradient-BkrLPdAd.js → DiamondGradient-CjnjxWEM.js} +1 -1
- package/dist/core/{DotGrid-CJJXTOk6.js → DotGrid-CbxlW08N.js} +3 -3
- package/dist/core/{ErosionNoise-BjD0wAyD.js → ErosionNoise-DdHtOQl4.js} +1 -1
- package/dist/core/{FallingLines-C1YT49dj.js → FallingLines-1q5WgiKa.js} +1 -1
- package/dist/core/{FlowingGradient-ClUwpsZJ.js → FlowingGradient-DMZ1E9ix.js} +1 -1
- package/dist/core/{FractalNoise-CgR9wvoG.js → FractalNoise-DPhwf7-X.js} +2 -2
- package/dist/core/{GaborNoise-BHDznYFh.js → GaborNoise-GkEvNPeg.js} +1 -1
- package/dist/core/{Godrays-Bh6Idg3p.js → Godrays-pfr82Onh.js} +1 -1
- package/dist/core/{Grid-BneV9T3T.js → Grid-CQRC0rPf.js} +3 -3
- package/dist/core/{HexGrid-LGx240mZ.js → HexGrid-DsEQNWJB.js} +3 -3
- package/dist/core/{IsometricCubes-BQFwe-5s.js → IsometricCubes-BBK6Ec0q.js} +3 -3
- package/dist/core/{LensFlare-B4F0dq7O.js → LensFlare-DLjQYsbx.js} +1 -1
- package/dist/core/{LinearGradient-DOWwm0bP.js → LinearGradient--54vTgc2.js} +1 -1
- package/dist/core/{Marble-CSOGQ6C0.js → Marble-DixQe_Tu.js} +1 -1
- package/dist/core/MeshGradient-Ca3pe_wB.js +1722 -0
- package/dist/core/{MultiPointGradient-NJZfFGVb.js → MultiPointGradient-CtFBgPK6.js} +1 -1
- package/dist/core/{ObjectTracker-DlVNN9LJ.js → ObjectTracker-DQbxNZtb.js} +1 -1
- package/dist/core/{PerlinNoise-sjc342lu.js → PerlinNoise-B3PkQS1F.js} +1 -1
- package/dist/core/{Plasma-DBzZcfQN.js → Plasma-DdEQKNa7.js} +2 -2
- package/dist/core/{RadialGradient-C1Fb8TaL.js → RadialGradient-CiFbgiiX.js} +1 -1
- package/dist/core/{SimplexNoise-bCC60yB9.js → SimplexNoise-CD-iTgJm.js} +1 -1
- package/dist/core/{Stripes-B_SkTR2m.js → Stripes-C_i7QbEn.js} +2 -2
- package/dist/core/{StudioBackground-CUsUWJ2L.js → StudioBackground-CZipQCG_.js} +1 -1
- package/dist/core/{SunBurst-DiqSzz5A.js → SunBurst-BKj7bLZn.js} +1 -1
- package/dist/core/{Text-Cb6QJNWo.js → Text-2KkuVHxV.js} +1 -1
- package/dist/core/{TriangularGrid-C3DBCmaj.js → TriangularGrid-DfrUVI8m.js} +3 -3
- package/dist/core/{Truchet-yjZm8xe3.js → Truchet-B3__IHji.js} +3 -3
- package/dist/core/{Voronoi-5QA-0zme.js → Voronoi-DsHYdzB3.js} +1 -1
- package/dist/core/{WaveletNoise-B8MeveW8.js → WaveletNoise-pL_M8jha.js} +1 -1
- package/dist/core/{Weave-DpwAU5Rn.js → Weave-kQlWbHa6.js} +3 -3
- package/dist/core/{WorleyNoise-CjRMr7xP.js → WorleyNoise-Cju8qU_5.js} +2 -2
- package/dist/core/{aa-C8WSqiNB.js → aa-zeNRf4Lz.js} +1 -1
- package/dist/core/{cells-CM9mfnTr.js → cells-C72CLFsJ.js} +1 -1
- package/dist/core/{fields-CC0756V2.js → fields-DgMkoZ6o.js} +1 -1
- package/dist/core/{geom-90G-d_hc.js → geom-B_TNdMNk.js} +1 -1
- package/dist/core/index.js +113 -112
- package/dist/core/registry.js +113 -112
- package/dist/core/{shaderRegistry-IG9k35Qx.js → shaderRegistry-BIDNV71c.js} +194 -192
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/Aurora/index.js +2 -2
- package/dist/core/shaders/Beam/index.js +2 -2
- package/dist/core/shaders/BlockNoise/index.js +3 -3
- package/dist/core/shaders/BlueNoise/index.js +3 -3
- package/dist/core/shaders/BrickPattern/index.js +4 -4
- package/dist/core/shaders/Checkerboard/index.js +3 -3
- package/dist/core/shaders/Chevron/index.js +2 -2
- package/dist/core/shaders/ColorWheel/index.js +2 -2
- package/dist/core/shaders/ConicGradient/index.js +2 -2
- package/dist/core/shaders/CurlNoise/index.js +3 -3
- package/dist/core/shaders/DiamondGradient/index.js +2 -2
- package/dist/core/shaders/DotGrid/index.js +4 -4
- package/dist/core/shaders/ErosionNoise/index.js +3 -3
- package/dist/core/shaders/FallingLines/index.js +2 -2
- package/dist/core/shaders/FlowingGradient/index.js +2 -2
- package/dist/core/shaders/FractalNoise/index.js +3 -3
- package/dist/core/shaders/GaborNoise/index.js +3 -3
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +4 -4
- package/dist/core/shaders/HexGrid/index.js +4 -4
- package/dist/core/shaders/IsometricCubes/index.js +4 -4
- package/dist/core/shaders/LensFlare/index.js +2 -2
- package/dist/core/shaders/LinearGradient/index.js +2 -2
- package/dist/core/shaders/Marble/index.js +2 -2
- package/dist/core/shaders/MeshGradient/index.d.ts +87 -0
- package/dist/core/shaders/MeshGradient/index.d.ts.map +1 -0
- package/dist/core/shaders/MeshGradient/index.js +15 -0
- package/dist/core/shaders/Mirror/index.js +1 -1
- package/dist/core/shaders/MultiPointGradient/index.js +2 -2
- package/dist/core/shaders/NoiseDissolve/index.js +1 -1
- package/dist/core/shaders/ObjectTracker/index.js +2 -2
- package/dist/core/shaders/PagePeel/index.js +1 -1
- package/dist/core/shaders/Paper/index.js +1 -1
- package/dist/core/shaders/Parallelogram/index.js +1 -1
- package/dist/core/shaders/ParticleField/index.js +1 -1
- package/dist/core/shaders/ParticleFlow/index.js +1 -1
- package/dist/core/shaders/Particles/index.js +1 -1
- package/dist/core/shaders/PerlinNoise/index.js +3 -3
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/PixelSort/index.js +1 -1
- package/dist/core/shaders/PixelThrow/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/Plasma/index.js +3 -3
- package/dist/core/shaders/Plastic/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/index.js +1 -1
- package/dist/core/shaders/Polygon/index.js +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/Prism/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- package/dist/core/shaders/RadialGradient/index.js +2 -2
- package/dist/core/shaders/RadialWipe/index.js +1 -1
- package/dist/core/shaders/RandomBars/index.js +1 -1
- package/dist/core/shaders/ReactionDiffusion/index.js +1 -1
- package/dist/core/shaders/RectangularCoordinates/index.js +1 -1
- package/dist/core/shaders/ReflectivePlane/index.js +1 -1
- package/dist/core/shaders/Repeater/index.js +1 -1
- package/dist/core/shaders/Ring/index.js +1 -1
- package/dist/core/shaders/RippleWipe/index.js +1 -1
- package/dist/core/shaders/Ripples/index.js +1 -1
- package/dist/core/shaders/RoundedRect/index.js +1 -1
- package/dist/core/shaders/Saturation/index.js +1 -1
- package/dist/core/shaders/Scratches/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 +3 -3
- package/dist/core/shaders/SineWave/index.js +1 -1
- package/dist/core/shaders/SliceWipe/index.js +1 -1
- package/dist/core/shaders/Smoke/index.js +1 -1
- package/dist/core/shaders/SmokeFill/index.js +1 -1
- package/dist/core/shaders/SmokeFlow/index.js +1 -1
- 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 +1 -1
- package/dist/core/shaders/Stone/index.js +1 -1
- 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 +3 -3
- package/dist/core/shaders/StudioBackground/index.js +2 -2
- package/dist/core/shaders/SunBurst/index.js +2 -2
- package/dist/core/shaders/Surface3D/index.js +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/core/shaders/Teardrop/index.js +1 -1
- package/dist/core/shaders/Text/index.js +2 -2
- package/dist/core/shaders/TiltShift/index.js +1 -1
- package/dist/core/shaders/TimeTrail/index.js +1 -1
- package/dist/core/shaders/Tint/index.js +1 -1
- package/dist/core/shaders/Trapezoid/index.js +1 -1
- package/dist/core/shaders/TriangularGrid/index.js +4 -4
- package/dist/core/shaders/Tritone/index.js +1 -1
- package/dist/core/shaders/Truchet/index.js +4 -4
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/VHS/index.js +1 -1
- package/dist/core/shaders/VenetianBlinds/index.js +1 -1
- package/dist/core/shaders/Vesica/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/VideoTexture/index.js +1 -1
- package/dist/core/shaders/Vignette/index.js +1 -1
- package/dist/core/shaders/Voronoi/index.js +2 -2
- package/dist/core/shaders/Water/index.js +1 -1
- package/dist/core/shaders/Watercolor/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/WaveletNoise/index.js +3 -3
- package/dist/core/shaders/Weave/index.js +4 -4
- package/dist/core/shaders/WebcamTexture/index.js +1 -1
- package/dist/core/shaders/Wool/index.js +1 -1
- package/dist/core/shaders/WorleyNoise/index.js +3 -3
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/js/bundle.js +55 -55
- package/dist/js/createShader.js +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +38 -0
- package/dist/react/MeshGradient.js +226 -0
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +1 -1
- package/dist/react/bundle.js +140 -140
- package/dist/react/components/MeshGradient.d.ts +41 -0
- package/dist/react/components/MeshGradient.d.ts.map +1 -0
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +38 -0
- package/dist/registry.js +418 -0
- package/dist/solid/components/MeshGradient.d.ts +38 -0
- package/dist/solid/components/MeshGradient.d.ts.map +1 -0
- package/dist/solid/components/MeshGradient.js +232 -0
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +219 -217
- package/dist/solid/engine/Shader.js +1 -1
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +174 -172
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +38 -0
- package/dist/svelte/components/MeshGradient.svelte.d.ts +28 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +2663 -2456
- package/dist/svelte/source/components/MeshGradient.svelte +352 -0
- package/dist/svelte/source/engine/Preview.svelte +2 -0
- package/dist/svelte/source/index.js +1 -0
- package/dist/svelte/utils/generatePresetCode.js +38 -0
- package/dist/vue/MeshGradient.js +3 -0
- package/dist/vue/MeshGradient.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/vue/components/MeshGradient.vue.d.ts +63 -0
- package/dist/vue/components/MeshGradient.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +2 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +38 -0
- package/package.json +9 -1
- /package/dist/core/{Mirror-B_2eQT6d.js → Mirror-DObS_qYr.js} +0 -0
- /package/dist/core/{NoiseDissolve-B-fFjiGJ.js → NoiseDissolve-CB-Xj99z.js} +0 -0
- /package/dist/core/{PagePeel-BZOvdHFV.js → PagePeel-DOapA4QF.js} +0 -0
- /package/dist/core/{Paper-w8M4w_Sm.js → Paper-CVx1rZ1-.js} +0 -0
- /package/dist/core/{Parallelogram-a6zB6mY9.js → Parallelogram-BUR2Mg0g.js} +0 -0
- /package/dist/core/{ParticleField-UGf3Daat.js → ParticleField-rfpfY_wr.js} +0 -0
- /package/dist/core/{ParticleFlow-C7vEbMS3.js → ParticleFlow-DnZTqxMa.js} +0 -0
- /package/dist/core/{Particles-CumYpD-5.js → Particles-wfjtqAvF.js} +0 -0
- /package/dist/core/{Perspective-S94umCQn.js → Perspective-Bp1nozq3.js} +0 -0
- /package/dist/core/{PixelSort-C7tv3A5u.js → PixelSort-DF5Mm0uT.js} +0 -0
- /package/dist/core/{PixelThrow-2WPijuDY.js → PixelThrow-ANJ0F294.js} +0 -0
- /package/dist/core/{Pixelate-BLdO8qAT.js → Pixelate-Bl29QKdg.js} +0 -0
- /package/dist/core/{Plastic-C0Sl_sV1.js → Plastic-RGRWPbc0.js} +0 -0
- /package/dist/core/{PolarCoordinates-DZNOyHmN.js → PolarCoordinates-kNqucXuj.js} +0 -0
- /package/dist/core/{Polygon-BM3xGxOC.js → Polygon-Cg1Yb-TF.js} +0 -0
- /package/dist/core/{Posterize-BJl7Irml.js → Posterize-Bjfq_Et8.js} +0 -0
- /package/dist/core/{Prism-CaJyExNA.js → Prism-CGeOs8pX.js} +0 -0
- /package/dist/core/{ProgressiveBlur-B1Ur87dm.js → ProgressiveBlur-DHvM4Y4m.js} +0 -0
- /package/dist/core/{RadialWipe-CA5xWWPN.js → RadialWipe-BRvtJQN-.js} +0 -0
- /package/dist/core/{RandomBars-B66TF6V8.js → RandomBars-BFJiR8ml.js} +0 -0
- /package/dist/core/{ReactionDiffusion-cYvl6ks9.js → ReactionDiffusion-COFwdqMo.js} +0 -0
- /package/dist/core/{RectangularCoordinates-BEOFurXt.js → RectangularCoordinates-s25JfGDt.js} +0 -0
- /package/dist/core/{ReflectivePlane-wERmyiKx.js → ReflectivePlane-DP8vG4-U.js} +0 -0
- /package/dist/core/{Repeater-Cy8up7cj.js → Repeater-B6_lpYav.js} +0 -0
- /package/dist/core/{Ring-Cogdtn-0.js → Ring-CEaC7ILp.js} +0 -0
- /package/dist/core/{RippleWipe-fJwyE4vj.js → RippleWipe-UrrIoCor.js} +0 -0
- /package/dist/core/{Ripples-BSHfhVG1.js → Ripples-Cdha1qtk.js} +0 -0
- /package/dist/core/{RoundedRect-D3intNNI.js → RoundedRect-CLsMHcTd.js} +0 -0
- /package/dist/core/{Saturation-D42Bfc5P.js → Saturation-Bpjxowys.js} +0 -0
- /package/dist/core/{Scratches-CChXWpPg.js → Scratches-RZkkhOMp.js} +0 -0
- /package/dist/core/{Sharpness-Dyh6312-.js → Sharpness-fFikIkE3.js} +0 -0
- /package/dist/core/{Shatter-Qc5aMkWj.js → Shatter-C_v-Y_F_.js} +0 -0
- /package/dist/core/{SineWave-CnPtZLSs.js → SineWave-D4hvW_8O.js} +0 -0
- /package/dist/core/{SliceWipe-Byb46V6I.js → SliceWipe-pGIB0xIc.js} +0 -0
- /package/dist/core/{Smoke-5x6IAk2_.js → Smoke-NgL8_Wlw.js} +0 -0
- /package/dist/core/{SmokeFill-DOQpTlCv.js → SmokeFill-Cd-U58Bx.js} +0 -0
- /package/dist/core/{SmokeFlow-B4fdM2M-.js → SmokeFlow-BhjNSfcC.js} +0 -0
- /package/dist/core/{Solarize-BB0bXhP0.js → Solarize-DD2cjiZ7.js} +0 -0
- /package/dist/core/{SolidColor-D-6N9JmI.js → SolidColor-CmSX4SHb.js} +0 -0
- /package/dist/core/{Spherize-aWpru70e.js → Spherize-Cpbor3M3.js} +0 -0
- /package/dist/core/{Spiral-Dbm2j7mM.js → Spiral-BLM63kmf.js} +0 -0
- /package/dist/core/{Star-XtB9FBhQ.js → Star-UzeNW_jo.js} +0 -0
- /package/dist/core/{Stone-xSVm7jNc.js → Stone-B6MARs4o.js} +0 -0
- /package/dist/core/{Strands-BFaZBnNo.js → Strands-DR_owki5.js} +0 -0
- /package/dist/core/{Stretch-BKg0gjm4.js → Stretch-Zhc5gz72.js} +0 -0
- /package/dist/core/{Surface3D-Dd_T3xvt.js → Surface3D-BlexrpDJ.js} +0 -0
- /package/dist/core/{Swirl-DBxZ6Wud.js → Swirl-CKMRfpSx.js} +0 -0
- /package/dist/core/{Teardrop-CnhwMyQx.js → Teardrop-Dcfd14iX.js} +0 -0
- /package/dist/core/{TiltShift-DqEFOoJG.js → TiltShift-Yfz7yOnT.js} +0 -0
- /package/dist/core/{TimeTrail-G_JamlY8.js → TimeTrail-3YRaIap8.js} +0 -0
- /package/dist/core/{Tint-Dj1rSoJ0.js → Tint-6e9QqUg4.js} +0 -0
- /package/dist/core/{Trapezoid-D2PMU9G3.js → Trapezoid-CTww_GcP.js} +0 -0
- /package/dist/core/{Tritone-DfULv51I.js → Tritone-DmtMlvKc.js} +0 -0
- /package/dist/core/{Twirl-DfRsql00.js → Twirl-ECiB1asy.js} +0 -0
- /package/dist/core/{VHS-CGffLHVk.js → VHS-BIaAlx98.js} +0 -0
- /package/dist/core/{VenetianBlinds-CCucT73e.js → VenetianBlinds-DWnvvXJC.js} +0 -0
- /package/dist/core/{Vesica-BIGpXjWv.js → Vesica-iFL8Vjcf.js} +0 -0
- /package/dist/core/{Vibrance-CtlvCONz.js → Vibrance-CDeIsI81.js} +0 -0
- /package/dist/core/{VideoTexture-DW6bQduh.js → VideoTexture-UIOWDMK6.js} +0 -0
- /package/dist/core/{Vignette-Dz3pPnPR.js → Vignette-F2HgCda5.js} +0 -0
- /package/dist/core/{Water-CGBvuzXj.js → Water-T5GXFBCm.js} +0 -0
- /package/dist/core/{Watercolor-CGOpgWt8.js → Watercolor-yog8LZOs.js} +0 -0
- /package/dist/core/{WaveDistortion-CRQzZDLP.js → WaveDistortion-BWVqDVI3.js} +0 -0
- /package/dist/core/{WebcamTexture-DauLQjCl.js → WebcamTexture-Barzo30S.js} +0 -0
- /package/dist/core/{Wool-CuhWR2jo.js → Wool-CYzG-VrW.js} +0 -0
- /package/dist/core/{ZoomBlur-DgG9JA7a.js → ZoomBlur-DqJUm1uw.js} +0 -0
- /package/dist/core/{fonts-ScBvKolx.js → fonts-DPf2-jCd.js} +0 -0
package/dist/js/createShader.js
CHANGED
|
@@ -184,7 +184,7 @@ async function createShader(canvas, preset, options) {
|
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
if (renderer.getPerformanceStats().fps > 0) {
|
|
187
|
-
state.telemetryCollector = startTelemetry(renderer, "3.1.
|
|
187
|
+
state.telemetryCollector = startTelemetry(renderer, "3.1.457", options?.disableTelemetry || false, false);
|
|
188
188
|
if (state.telemetryCollector) state.telemetryCollector.start();
|
|
189
189
|
state.telemetryStartTimeout = null;
|
|
190
190
|
} else state.telemetryStartTimeout = setTimeout(checkRendering, 500);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AA6+FD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAwBpM;AAGD,eAAO,MAAM,mBAAmB,UAmM/B,CAAA"}
|
|
@@ -1551,6 +1551,43 @@ var shaderMetadata = {
|
|
|
1551
1551
|
"seed": 0,
|
|
1552
1552
|
"colorSpace": "linear"
|
|
1553
1553
|
},
|
|
1554
|
+
"MeshGradient": {
|
|
1555
|
+
"opacity": 1,
|
|
1556
|
+
"blendMode": "normal",
|
|
1557
|
+
"colorA": "#1a0533",
|
|
1558
|
+
"colorB": "#ffdf8e",
|
|
1559
|
+
"stops": [
|
|
1560
|
+
{
|
|
1561
|
+
"color": "#1a0533",
|
|
1562
|
+
"position": 0
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
"color": "#6d2fd1",
|
|
1566
|
+
"position": .26
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
"color": "#e04b9e",
|
|
1570
|
+
"position": .52
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
"color": "#ff8c42",
|
|
1574
|
+
"position": .76
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
"color": "#ffdf8e",
|
|
1578
|
+
"position": 1
|
|
1579
|
+
}
|
|
1580
|
+
],
|
|
1581
|
+
"colorSpace": "oklab",
|
|
1582
|
+
"count": 5,
|
|
1583
|
+
"smoothness": 2,
|
|
1584
|
+
"variation": .35,
|
|
1585
|
+
"swirl": .3,
|
|
1586
|
+
"drift": .5,
|
|
1587
|
+
"wrapping": 0,
|
|
1588
|
+
"speed": 1,
|
|
1589
|
+
"seed": 0
|
|
1590
|
+
},
|
|
1554
1591
|
"Mirror": {
|
|
1555
1592
|
"opacity": 1,
|
|
1556
1593
|
"blendMode": "normal",
|
|
@@ -3030,6 +3067,7 @@ const availableComponents = [
|
|
|
3030
3067
|
"Liquify",
|
|
3031
3068
|
"MagneticFilings",
|
|
3032
3069
|
"Marble",
|
|
3070
|
+
"MeshGradient",
|
|
3033
3071
|
"Mirror",
|
|
3034
3072
|
"MultiPointGradient",
|
|
3035
3073
|
"Neon",
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { ShaderContext } from "./Shader.js";
|
|
2
|
+
import { useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { createGpuUniformsMap, resolveBoundingBox } from "../core/index.js";
|
|
5
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { componentDefinition } from "../core/shaders/MeshGradient/index.js";
|
|
8
|
+
function isPropDriver(value) {
|
|
9
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
10
|
+
}
|
|
11
|
+
function computeEffectiveProps(props, defaultProps$1) {
|
|
12
|
+
let baseProps = { ...defaultProps$1 };
|
|
13
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && value !== void 0 && !isPropDriver(value)) baseProps[key] = value;
|
|
14
|
+
return baseProps;
|
|
15
|
+
}
|
|
16
|
+
var MARKER_STYLE = { display: "contents" };
|
|
17
|
+
var DEFAULT_TRANSFORM = {
|
|
18
|
+
offsetX: 0,
|
|
19
|
+
offsetY: 0,
|
|
20
|
+
rotation: 0,
|
|
21
|
+
scale: 1,
|
|
22
|
+
anchorX: .5,
|
|
23
|
+
anchorY: .5,
|
|
24
|
+
edges: "transparent"
|
|
25
|
+
};
|
|
26
|
+
var defaultProps = {
|
|
27
|
+
blendMode: "normal",
|
|
28
|
+
visible: true
|
|
29
|
+
};
|
|
30
|
+
try {
|
|
31
|
+
if (componentDefinition && componentDefinition.props) Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
32
|
+
const propConfig = config;
|
|
33
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) defaultProps[key] = propConfig.default;
|
|
34
|
+
});
|
|
35
|
+
} catch (e) {
|
|
36
|
+
console.warn("Error extracting default props:", e);
|
|
37
|
+
}
|
|
38
|
+
const ShaderComponent = (props) => {
|
|
39
|
+
const context = useContext(ShaderContext);
|
|
40
|
+
if (!context) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
41
|
+
const { shaderParentId: parentId, shaderNodeRegister: parentRegister, shaderUniformUpdate: parentUniformUpdate, shaderMetadataUpdate: parentMetadataUpdate, shaderColorSpace } = context;
|
|
42
|
+
const reactId = useId();
|
|
43
|
+
const instanceId = useMemo(() => {
|
|
44
|
+
return (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || reactId.replace(/[^a-zA-Z0-9_]/g, "");
|
|
45
|
+
}, [props.id, reactId]);
|
|
46
|
+
const effectiveProps = useMemo(() => {
|
|
47
|
+
return computeEffectiveProps(props, defaultProps);
|
|
48
|
+
}, [props]);
|
|
49
|
+
const effectiveTransform = useMemo(() => ({
|
|
50
|
+
...DEFAULT_TRANSFORM,
|
|
51
|
+
...props.transform
|
|
52
|
+
}), [props.transform]);
|
|
53
|
+
const effectiveBoundingBox = useMemo(() => resolveBoundingBox(props.boundingBox), [props.boundingBox]);
|
|
54
|
+
const markerRef = useRef(null);
|
|
55
|
+
const isCapturesDOM = !!componentDefinition.capturesDOM;
|
|
56
|
+
const captureCanvasRef = useRef(null);
|
|
57
|
+
const [domMounted, setDomMounted] = useState(false);
|
|
58
|
+
const [captureSize, setCaptureSize] = useState(() => ({
|
|
59
|
+
w: typeof window !== "undefined" ? Math.round(window.innerWidth * Math.min(window.devicePixelRatio, 2)) : 0,
|
|
60
|
+
h: typeof window !== "undefined" ? Math.round(window.innerHeight * Math.min(window.devicePixelRatio, 2)) : 0
|
|
61
|
+
}));
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (!isCapturesDOM) return;
|
|
64
|
+
setDomMounted(true);
|
|
65
|
+
const onResize = () => {
|
|
66
|
+
const d = Math.min(window.devicePixelRatio, 2);
|
|
67
|
+
setCaptureSize({
|
|
68
|
+
w: Math.round(window.innerWidth * d),
|
|
69
|
+
h: Math.round(window.innerHeight * d)
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
window.addEventListener("resize", onResize);
|
|
73
|
+
return () => window.removeEventListener("resize", onResize);
|
|
74
|
+
}, [isCapturesDOM]);
|
|
75
|
+
const detectedOrderRef = useRef(void 0);
|
|
76
|
+
const uniformsRef = useRef(null);
|
|
77
|
+
if (uniformsRef.current === null) {
|
|
78
|
+
setColorSpaceMode(shaderColorSpace);
|
|
79
|
+
uniformsRef.current = createGpuUniformsMap(componentDefinition, effectiveProps, instanceId);
|
|
80
|
+
}
|
|
81
|
+
const childContextValue = useMemo(() => {
|
|
82
|
+
return {
|
|
83
|
+
...context,
|
|
84
|
+
shaderParentId: instanceId
|
|
85
|
+
};
|
|
86
|
+
}, [context, instanceId]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!uniformsRef.current) return;
|
|
89
|
+
try {
|
|
90
|
+
const metadata = {
|
|
91
|
+
blendMode: props.blendMode || "normal",
|
|
92
|
+
opacity: props.opacity,
|
|
93
|
+
visible: props.visible === false ? false : true,
|
|
94
|
+
id: props.id,
|
|
95
|
+
mask: props.maskSource ? {
|
|
96
|
+
source: props.maskSource,
|
|
97
|
+
type: props.maskType || "alpha"
|
|
98
|
+
} : void 0,
|
|
99
|
+
maps: mapsFromProps,
|
|
100
|
+
renderOrder: props.renderOrder ?? detectedOrderRef.current,
|
|
101
|
+
transform: effectiveTransform,
|
|
102
|
+
boundingBox: effectiveBoundingBox,
|
|
103
|
+
flow: props.flow,
|
|
104
|
+
absolute: props.absolute
|
|
105
|
+
};
|
|
106
|
+
parentRegister(instanceId, componentDefinition.fragment, parentId, metadata, uniformsRef.current, componentDefinition, isCapturesDOM ? captureCanvasRef.current ?? void 0 : void 0);
|
|
107
|
+
return () => {
|
|
108
|
+
parentRegister(instanceId, null, null, null, null);
|
|
109
|
+
};
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error("Error registering shader node:", error);
|
|
112
|
+
return () => {};
|
|
113
|
+
}
|
|
114
|
+
}, [
|
|
115
|
+
instanceId,
|
|
116
|
+
parentId,
|
|
117
|
+
parentRegister,
|
|
118
|
+
domMounted
|
|
119
|
+
]);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (props.renderOrder === void 0 && markerRef.current) {
|
|
122
|
+
const parent = markerRef.current.parentElement;
|
|
123
|
+
if (parent) {
|
|
124
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
125
|
+
const position = Array.from(siblings).indexOf(markerRef.current);
|
|
126
|
+
if (position >= 0) {
|
|
127
|
+
detectedOrderRef.current = position;
|
|
128
|
+
parentMetadataUpdate(instanceId, { renderOrder: position });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, []);
|
|
133
|
+
const prevPropsRef = useRef({});
|
|
134
|
+
const mapsFromProps = useMemo(() => {
|
|
135
|
+
const maps = {};
|
|
136
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && isPropDriver(value)) maps[key] = value;
|
|
137
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
138
|
+
}, [props]);
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
if (!uniformsRef.current) return;
|
|
141
|
+
try {
|
|
142
|
+
Object.entries(uniformsRef.current).forEach(([propName, uniformData]) => {
|
|
143
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
144
|
+
if (uniformData.value !== void 0 && propName in effectiveProps) {
|
|
145
|
+
const newValue = effectiveProps[propName];
|
|
146
|
+
if (isPropDriver(newValue)) return;
|
|
147
|
+
if (newValue !== prevPropsRef.current[propName]) {
|
|
148
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
149
|
+
prevPropsRef.current[propName] = newValue;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
} catch (error) {
|
|
154
|
+
console.error("Error updating uniforms:", error);
|
|
155
|
+
}
|
|
156
|
+
}, [
|
|
157
|
+
effectiveProps,
|
|
158
|
+
instanceId,
|
|
159
|
+
parentUniformUpdate
|
|
160
|
+
]);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
try {
|
|
163
|
+
parentMetadataUpdate(instanceId, {
|
|
164
|
+
blendMode: props.blendMode || "normal",
|
|
165
|
+
opacity: props.opacity,
|
|
166
|
+
visible: props.visible === false ? false : true,
|
|
167
|
+
id: props.id,
|
|
168
|
+
mask: props.maskSource ? {
|
|
169
|
+
source: props.maskSource,
|
|
170
|
+
type: props.maskType || "alpha"
|
|
171
|
+
} : void 0,
|
|
172
|
+
maps: mapsFromProps,
|
|
173
|
+
renderOrder: props.renderOrder ?? detectedOrderRef.current,
|
|
174
|
+
transform: effectiveTransform,
|
|
175
|
+
boundingBox: effectiveBoundingBox,
|
|
176
|
+
flow: props.flow,
|
|
177
|
+
absolute: props.absolute
|
|
178
|
+
});
|
|
179
|
+
} catch (error) {
|
|
180
|
+
console.error("Error updating metadata:", error);
|
|
181
|
+
}
|
|
182
|
+
}, [
|
|
183
|
+
props.blendMode,
|
|
184
|
+
props.opacity,
|
|
185
|
+
props.visible,
|
|
186
|
+
props.maskSource,
|
|
187
|
+
props.maskType,
|
|
188
|
+
props.renderOrder,
|
|
189
|
+
props.id,
|
|
190
|
+
mapsFromProps,
|
|
191
|
+
effectiveTransform,
|
|
192
|
+
effectiveBoundingBox,
|
|
193
|
+
props.flow,
|
|
194
|
+
props.absolute,
|
|
195
|
+
instanceId,
|
|
196
|
+
parentMetadataUpdate
|
|
197
|
+
]);
|
|
198
|
+
if (props.ref && typeof props.ref === "function") try {
|
|
199
|
+
props.ref(null);
|
|
200
|
+
} catch (e) {}
|
|
201
|
+
const captureCanvas = isCapturesDOM && domMounted ? createPortal(/* @__PURE__ */ jsx("canvas", {
|
|
202
|
+
ref: captureCanvasRef,
|
|
203
|
+
"layoutsubtree": "",
|
|
204
|
+
width: captureSize.w,
|
|
205
|
+
height: captureSize.h,
|
|
206
|
+
style: {
|
|
207
|
+
position: "fixed",
|
|
208
|
+
inset: 0,
|
|
209
|
+
width: "100vw",
|
|
210
|
+
height: "100vh",
|
|
211
|
+
zIndex: -9999
|
|
212
|
+
},
|
|
213
|
+
children: props.children
|
|
214
|
+
}), document.body) : null;
|
|
215
|
+
return /* @__PURE__ */ jsxs(ShaderContext.Provider, {
|
|
216
|
+
value: childContextValue,
|
|
217
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
218
|
+
ref: markerRef,
|
|
219
|
+
style: MARKER_STYLE,
|
|
220
|
+
"data-shader-id": instanceId,
|
|
221
|
+
children: !isCapturesDOM && props.children
|
|
222
|
+
}), captureCanvas]
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
var MeshGradient_default = ShaderComponent;
|
|
226
|
+
export { ShaderComponent, MeshGradient_default as default };
|
package/dist/react/Preview.js
CHANGED
|
@@ -217,6 +217,7 @@ var componentMap = {
|
|
|
217
217
|
Liquify: lazy(() => import("./Liquify.js")),
|
|
218
218
|
MagneticFilings: lazy(() => import("./MagneticFilings.js")),
|
|
219
219
|
Marble: lazy(() => import("./Marble.js")),
|
|
220
|
+
MeshGradient: lazy(() => import("./MeshGradient.js")),
|
|
220
221
|
Mirror: lazy(() => import("./Mirror.js")),
|
|
221
222
|
MultiPointGradient: lazy(() => import("./MultiPointGradient.js")),
|
|
222
223
|
Neon: lazy(() => import("./Neon.js")),
|
package/dist/react/Shader.js
CHANGED
|
@@ -93,7 +93,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
if (rendererRef.current.getPerformanceStats().fps > 0) {
|
|
96
|
-
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "3.1.
|
|
96
|
+
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "3.1.457", disableTelemetry, isPreview);
|
|
97
97
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
98
98
|
telemetryStartTimeoutRef.current = null;
|
|
99
99
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|