shaders 2.5.80 → 2.5.82
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/FlowingGradient-DVproCI1.js +145 -0
- package/dist/core/Liquify-mhzPd19o.js +228 -0
- package/dist/core/{VideoTexture-DDnc6aVv.js → VideoTexture-Dbsbgb1Y.js} +1 -1
- package/dist/core/{WebcamTexture-rb0dLKSc.js → WebcamTexture-xvb8MuFz.js} +1 -1
- package/dist/core/index.js +77 -61
- package/dist/core/registry.js +62 -61
- package/dist/core/renderer.d.ts +1 -0
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaderRegistry-C0Tmid5z.js +220 -0
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/FlowingGradient/index.d.ts +62 -0
- package/dist/core/shaders/FlowingGradient/index.d.ts.map +1 -0
- package/dist/core/shaders/FlowingGradient/index.js +5 -0
- package/dist/core/shaders/Form3D/index.js +1 -1
- package/dist/core/shaders/Glass/index.js +1 -1
- 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 +1 -1
- 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/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.d.ts +13 -7
- package/dist/core/shaders/Liquify/index.d.ts.map +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Mirror/index.js +1 -1
- package/dist/core/shaders/Neon/index.js +1 -1
- 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 +1 -1
- package/dist/core/shaders/Posterize/index.js +1 -1
- package/dist/core/shaders/ProgressiveBlur/index.js +1 -1
- 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 +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/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/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/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/Swirl/index.js +1 -1
- package/dist/core/shaders/TiltShift/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/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/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 +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +2 -2
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/js/createShader.d.ts.map +1 -1
- package/dist/js/createShader.js +2 -1
- package/dist/js/types.d.ts +1 -0
- package/dist/js/types.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/js/utils/generatePresetCode.js +16 -2
- package/dist/react/FlowingGradient.js +180 -0
- package/dist/react/Preview.js +1 -0
- package/dist/react/Shader.js +10 -2
- package/dist/react/components/FlowingGradient.d.ts +34 -0
- package/dist/react/components/FlowingGradient.d.ts.map +1 -0
- package/dist/react/components/Liquify.d.ts +4 -2
- package/dist/react/components/Liquify.d.ts.map +1 -1
- package/dist/react/engine/Preview.d.ts.map +1 -1
- package/dist/react/engine/Shader.d.ts +1 -0
- package/dist/react/engine/Shader.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 +16 -2
- package/dist/registry.js +292 -20
- package/dist/solid/components/FlowingGradient.d.ts +31 -0
- package/dist/solid/components/FlowingGradient.d.ts.map +1 -0
- package/dist/solid/components/FlowingGradient.js +183 -0
- package/dist/solid/components/Liquify.d.ts +4 -2
- package/dist/solid/components/Liquify.d.ts.map +1 -1
- package/dist/solid/engine/Preview.d.ts.map +1 -1
- package/dist/solid/engine/Preview.js +64 -62
- package/dist/solid/engine/Shader.d.ts +1 -0
- package/dist/solid/engine/Shader.d.ts.map +1 -1
- package/dist/solid/engine/Shader.js +6 -2
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +124 -122
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +16 -2
- package/dist/svelte/components/FlowingGradient.svelte.d.ts +21 -0
- package/dist/svelte/components/Liquify.svelte.d.ts +2 -1
- package/dist/svelte/engine/Shader.svelte.d.ts +1 -0
- package/dist/svelte/{generatePresetCode-BN1puRG_.js → generatePresetCode-B9QYLcji.js} +16 -2
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +450 -301
- package/dist/svelte/source/components/FlowingGradient.svelte +288 -0
- package/dist/svelte/source/components/Liquify.svelte +1 -0
- package/dist/svelte/source/engine/Preview.svelte +2 -0
- package/dist/svelte/source/engine/Shader.svelte +3 -1
- package/dist/svelte/source/index.js +1 -0
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/FlowingGradient.js +3 -0
- package/dist/vue/FlowingGradient.vue_vue_type_script_setup_true_lang.js +173 -0
- package/dist/vue/Liquify.vue_vue_type_script_setup_true_lang.js +3 -2
- 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 +5 -2
- package/dist/vue/components/FlowingGradient.vue.d.ts +56 -0
- package/dist/vue/components/FlowingGradient.vue.d.ts.map +1 -0
- package/dist/vue/components/Liquify.vue.d.ts +2 -1
- package/dist/vue/components/Liquify.vue.d.ts.map +1 -1
- package/dist/vue/engine/Shader.vue.d.ts +6 -2
- package/dist/vue/engine/Shader.vue.d.ts.map +1 -1
- 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 +16 -2
- package/package.json +9 -1
- package/dist/core/Liquify-Cy6ck3_k.js +0 -157
- package/dist/core/shaderRegistry-9huRXSRI.js +0 -218
- /package/dist/core/{Form3D-D3MoN95S.js → Form3D-DhezVuyN.js} +0 -0
- /package/dist/core/{Glass-CRaFJ-8c.js → Glass-D7wAPADg.js} +0 -0
- /package/dist/core/{GlassTiles-C3PKMWgp.js → GlassTiles-ClrOIpCg.js} +0 -0
- /package/dist/core/{Glitch-MyIU0Bad.js → Glitch-DmWytiRl.js} +0 -0
- /package/dist/core/{Glow-1ee_R1fA.js → Glow-Dm4dfZ_m.js} +0 -0
- /package/dist/core/{Godrays-CvcPIegU.js → Godrays-CYILZUHg.js} +0 -0
- /package/dist/core/{Grayscale-8MPw9PHN.js → Grayscale-CPR_l4G2.js} +0 -0
- /package/dist/core/{Grid-D64zkkku.js → Grid-CCQZ3GhD.js} +0 -0
- /package/dist/core/{GridDistortion-B7PGORW3.js → GridDistortion-oGT8NaWa.js} +0 -0
- /package/dist/core/{Group-DoOcKuhW.js → Group-CC317vlL.js} +0 -0
- /package/dist/core/{Halftone-Co7P2SWy.js → Halftone-BZk1Hjz_.js} +0 -0
- /package/dist/core/{HueShift-Bvd9VTak.js → HueShift-CuE3YTBE.js} +0 -0
- /package/dist/core/{ImageTexture-BJ1udc62.js → ImageTexture-DWUSKXX0.js} +0 -0
- /package/dist/core/{Invert-5VR-fNRw.js → Invert-C9RiDYP_.js} +0 -0
- /package/dist/core/{Kaleidoscope-B0McCEhc.js → Kaleidoscope-DtVlQWKG.js} +0 -0
- /package/dist/core/{LensFlare-DXgpPyJK.js → LensFlare-AVpiDD1O.js} +0 -0
- /package/dist/core/{LinearBlur-CBl0B23J.js → LinearBlur-AR65FcZh.js} +0 -0
- /package/dist/core/{LinearGradient-C0FT7-Lc.js → LinearGradient-DXCXjS-K.js} +0 -0
- /package/dist/core/{Mirror-DfZBEOUf.js → Mirror-CSc5mJi1.js} +0 -0
- /package/dist/core/{Neon-E8whPM6C.js → Neon-By5OgQ24.js} +0 -0
- /package/dist/core/{Paper-DJwBbPxA.js → Paper-DfUka0dt.js} +0 -0
- /package/dist/core/{Perspective-BdHcCgqZ.js → Perspective-uPiPmWy_.js} +0 -0
- /package/dist/core/{Pixelate-B9x2E0k-.js → Pixelate-DRkAW4Lo.js} +0 -0
- /package/dist/core/{Plasma-CMXrHMJv.js → Plasma-ELzbK-Us.js} +0 -0
- /package/dist/core/{PolarCoordinates-tZbl0VOq.js → PolarCoordinates-CalS_TB6.js} +0 -0
- /package/dist/core/{Polygon-B4ab2iAo.js → Polygon-MN_gj5R6.js} +0 -0
- /package/dist/core/{Posterize-Big6cECo.js → Posterize-C4vtRmtA.js} +0 -0
- /package/dist/core/{ProgressiveBlur-D0ZlHOw4.js → ProgressiveBlur-CLYhfOvQ.js} +0 -0
- /package/dist/core/{RadialGradient-C1Uu5_bL.js → RadialGradient-DtD8HWdM.js} +0 -0
- /package/dist/core/{RectangularCoordinates-BB7_S4gH.js → RectangularCoordinates-B96mflF5.js} +0 -0
- /package/dist/core/{Ring-DVW66Ug0.js → Ring-76XLaaus.js} +0 -0
- /package/dist/core/{Ripples-DeRyNukC.js → Ripples-Cevf-Hvg.js} +0 -0
- /package/dist/core/{RoundedRect-B9y33WS5.js → RoundedRect-D6q6xf_O.js} +0 -0
- /package/dist/core/{Saturation-NrGhLp0a.js → Saturation-CcDwPh2v.js} +0 -0
- /package/dist/core/{Sharpness-DAC9Qnh0.js → Sharpness-D_dXfDEo.js} +0 -0
- /package/dist/core/{Shatter-ZIaXf4fs.js → Shatter-NfZzVt54.js} +0 -0
- /package/dist/core/{SimplexNoise-mSsE7oXX.js → SimplexNoise-aipzNV5j.js} +0 -0
- /package/dist/core/{SineWave-BAhTQVXp.js → SineWave-CVeYx3n-.js} +0 -0
- /package/dist/core/{SolidColor-BQnId3qy.js → SolidColor-BdbBnLxX.js} +0 -0
- /package/dist/core/{Spherize-YvHlKrZy.js → Spherize-BRGwLGeu.js} +0 -0
- /package/dist/core/{Spiral-DUDZyQjj.js → Spiral-BkTBXb7z.js} +0 -0
- /package/dist/core/{Star-DB4dmzyz.js → Star-DN6qziUO.js} +0 -0
- /package/dist/core/{Strands-CF49kt1s.js → Strands-Cjsw-cPu.js} +0 -0
- /package/dist/core/{Stretch-Dkhera5t.js → Stretch-9cta3Z1W.js} +0 -0
- /package/dist/core/{Stripes-BOROXiAH.js → Stripes-C0sCGCz_.js} +0 -0
- /package/dist/core/{StudioBackground-DNmf8LGj.js → StudioBackground-BYv_-8df.js} +0 -0
- /package/dist/core/{Swirl-C5RQIA6E.js → Swirl-DXjIXfy7.js} +0 -0
- /package/dist/core/{TiltShift-BgscLSg_.js → TiltShift-56lcZ4cJ.js} +0 -0
- /package/dist/core/{Tint-CvKUJTtg.js → Tint-8_WIy9_e.js} +0 -0
- /package/dist/core/{Trapezoid-Co8cWZTK.js → Trapezoid-C-HfI0fp.js} +0 -0
- /package/dist/core/{Tritone-Ss5m7yFO.js → Tritone-nyJyybHI.js} +0 -0
- /package/dist/core/{Twirl-CF_9ObSp.js → Twirl-BzSEz4xK.js} +0 -0
- /package/dist/core/{Vesica-C7tcbHbW.js → Vesica-DXWePxDj.js} +0 -0
- /package/dist/core/{Vibrance-DVWcESAa.js → Vibrance-BETLN3Ie.js} +0 -0
- /package/dist/core/{WaveDistortion-Caj3cQz7.js → WaveDistortion-C-j597Jm.js} +0 -0
- /package/dist/core/{ZoomBlur-DUrSxwl0.js → ZoomBlur-DFw0J9x3.js} +0 -0
- /package/dist/core/{browser-daS5XZwr.js → browser-CqdrcD5J.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as Mirror_default } from "../../Mirror-
|
|
4
|
+
import { n as componentDefinition, t as Mirror_default } from "../../Mirror-CSc5mJi1.js";
|
|
5
5
|
export { componentDefinition, Mirror_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../sdf-BDsv-WBk.js";
|
|
3
|
-
import { n as componentDefinition, t as Neon_default } from "../../Neon-
|
|
3
|
+
import { n as componentDefinition, t as Neon_default } from "../../Neon-By5OgQ24.js";
|
|
4
4
|
export { componentDefinition, Neon_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Paper_default } from "../../Paper-
|
|
1
|
+
import { n as componentDefinition, t as Paper_default } from "../../Paper-DfUka0dt.js";
|
|
2
2
|
export { componentDefinition, Paper_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as Perspective_default } from "../../Perspective-
|
|
4
|
+
import { n as componentDefinition, t as Perspective_default } from "../../Perspective-uPiPmWy_.js";
|
|
5
5
|
export { componentDefinition, Perspective_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../alpha-C4ptedXe.js";
|
|
2
|
-
import { n as componentDefinition, t as Pixelate_default } from "../../Pixelate-
|
|
2
|
+
import { n as componentDefinition, t as Pixelate_default } from "../../Pixelate-DRkAW4Lo.js";
|
|
3
3
|
export { componentDefinition, Pixelate_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../time-DUqSFWvT.js";
|
|
4
|
-
import { n as componentDefinition, t as Plasma_default } from "../../Plasma-
|
|
4
|
+
import { n as componentDefinition, t as Plasma_default } from "../../Plasma-ELzbK-Us.js";
|
|
5
5
|
export { componentDefinition, Plasma_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as PolarCoordinates_default } from "../../PolarCoordinates-
|
|
4
|
+
import { n as componentDefinition, t as PolarCoordinates_default } from "../../PolarCoordinates-CalS_TB6.js";
|
|
5
5
|
export { componentDefinition, PolarCoordinates_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../sdf-BDsv-WBk.js";
|
|
4
|
-
import { n as componentDefinition, t as Polygon_default } from "../../Polygon-
|
|
4
|
+
import { n as componentDefinition, t as Polygon_default } from "../../Polygon-MN_gj5R6.js";
|
|
5
5
|
export { componentDefinition, Polygon_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Posterize_default } from "../../Posterize-
|
|
1
|
+
import { n as componentDefinition, t as Posterize_default } from "../../Posterize-C4vtRmtA.js";
|
|
2
2
|
export { componentDefinition, Posterize_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-
|
|
3
|
+
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-CLYhfOvQ.js";
|
|
4
4
|
export { componentDefinition, ProgressiveBlur_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
|
-
import { n as componentDefinition, t as RadialGradient_default } from "../../RadialGradient-
|
|
3
|
+
import { n as componentDefinition, t as RadialGradient_default } from "../../RadialGradient-DtD8HWdM.js";
|
|
4
4
|
export { componentDefinition, RadialGradient_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as RectangularCoordinates_default } from "../../RectangularCoordinates-
|
|
4
|
+
import { n as componentDefinition, t as RectangularCoordinates_default } from "../../RectangularCoordinates-B96mflF5.js";
|
|
5
5
|
export { componentDefinition, RectangularCoordinates_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../sdf-BDsv-WBk.js";
|
|
4
|
-
import { n as componentDefinition, t as Ring_default } from "../../Ring-
|
|
4
|
+
import { n as componentDefinition, t as Ring_default } from "../../Ring-76XLaaus.js";
|
|
5
5
|
export { componentDefinition, Ring_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../time-DUqSFWvT.js";
|
|
4
|
-
import { n as componentDefinition, t as Ripples_default } from "../../Ripples-
|
|
4
|
+
import { n as componentDefinition, t as Ripples_default } from "../../Ripples-Cevf-Hvg.js";
|
|
5
5
|
export { componentDefinition, Ripples_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../sdf-BDsv-WBk.js";
|
|
4
|
-
import { n as componentDefinition, t as RoundedRect_default } from "../../RoundedRect-
|
|
4
|
+
import { n as componentDefinition, t as RoundedRect_default } from "../../RoundedRect-D6q6xf_O.js";
|
|
5
5
|
export { componentDefinition, RoundedRect_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Saturation_default } from "../../Saturation-
|
|
1
|
+
import { n as componentDefinition, t as Saturation_default } from "../../Saturation-CcDwPh2v.js";
|
|
2
2
|
export { componentDefinition, Saturation_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../alpha-C4ptedXe.js";
|
|
2
|
-
import { n as componentDefinition, t as Sharpness_default } from "../../Sharpness-
|
|
2
|
+
import { n as componentDefinition, t as Sharpness_default } from "../../Sharpness-D_dXfDEo.js";
|
|
3
3
|
export { componentDefinition, Sharpness_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as Shatter_default } from "../../Shatter-
|
|
4
|
+
import { n as componentDefinition, t as Shatter_default } from "../../Shatter-NfZzVt54.js";
|
|
5
5
|
export { componentDefinition, Shatter_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../time-DUqSFWvT.js";
|
|
4
|
-
import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-
|
|
4
|
+
import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-aipzNV5j.js";
|
|
5
5
|
export { componentDefinition, SimplexNoise_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-DUqSFWvT.js";
|
|
3
|
-
import { n as componentDefinition, t as SineWave_default } from "../../SineWave-
|
|
3
|
+
import { n as componentDefinition, t as SineWave_default } from "../../SineWave-CVeYx3n-.js";
|
|
4
4
|
export { componentDefinition, SineWave_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-
|
|
2
|
+
import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-BdbBnLxX.js";
|
|
3
3
|
export { componentDefinition, SolidColor_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import { n as componentDefinition, t as Spherize_default } from "../../Spherize-
|
|
3
|
+
import { n as componentDefinition, t as Spherize_default } from "../../Spherize-BRGwLGeu.js";
|
|
4
4
|
export { componentDefinition, Spherize_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../time-DUqSFWvT.js";
|
|
4
|
-
import { n as componentDefinition, t as Spiral_default } from "../../Spiral-
|
|
4
|
+
import { n as componentDefinition, t as Spiral_default } from "../../Spiral-BkTBXb7z.js";
|
|
5
5
|
export { componentDefinition, Spiral_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../sdf-BDsv-WBk.js";
|
|
4
|
-
import { n as componentDefinition, t as Star_default } from "../../Star-
|
|
4
|
+
import { n as componentDefinition, t as Star_default } from "../../Star-DN6qziUO.js";
|
|
5
5
|
export { componentDefinition, Star_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-DUqSFWvT.js";
|
|
3
|
-
import { n as componentDefinition, t as Strands_default } from "../../Strands-
|
|
3
|
+
import { n as componentDefinition, t as Strands_default } from "../../Strands-Cjsw-cPu.js";
|
|
4
4
|
export { componentDefinition, Strands_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as Stretch_default } from "../../Stretch-
|
|
4
|
+
import { n as componentDefinition, t as Stretch_default } from "../../Stretch-9cta3Z1W.js";
|
|
5
5
|
export { componentDefinition, Stretch_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../time-DUqSFWvT.js";
|
|
4
|
-
import { n as componentDefinition, t as Stripes_default } from "../../Stripes-
|
|
4
|
+
import { n as componentDefinition, t as Stripes_default } from "../../Stripes-C0sCGCz_.js";
|
|
5
5
|
export { componentDefinition, Stripes_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-DUqSFWvT.js";
|
|
3
|
-
import { n as componentDefinition, t as StudioBackground_default } from "../../StudioBackground-
|
|
3
|
+
import { n as componentDefinition, t as StudioBackground_default } from "../../StudioBackground-BYv_-8df.js";
|
|
4
4
|
export { componentDefinition, StudioBackground_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../time-DUqSFWvT.js";
|
|
4
|
-
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-
|
|
4
|
+
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-DXjIXfy7.js";
|
|
5
5
|
export { componentDefinition, Swirl_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-
|
|
3
|
+
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-56lcZ4cJ.js";
|
|
4
4
|
export { componentDefinition, TiltShift_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
|
-
import { n as componentDefinition, t as Tint_default } from "../../Tint-
|
|
2
|
+
import { n as componentDefinition, t as Tint_default } from "../../Tint-8_WIy9_e.js";
|
|
3
3
|
export { componentDefinition, Tint_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../sdf-BDsv-WBk.js";
|
|
4
|
-
import { n as componentDefinition, t as Trapezoid_default } from "../../Trapezoid-
|
|
4
|
+
import { n as componentDefinition, t as Trapezoid_default } from "../../Trapezoid-C-HfI0fp.js";
|
|
5
5
|
export { componentDefinition, Trapezoid_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
3
|
import "../../colorMixing-BPpDnR5I.js";
|
|
4
|
-
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-
|
|
4
|
+
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-nyJyybHI.js";
|
|
5
5
|
export { componentDefinition, Tritone_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-CfGcQniB.js";
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
|
-
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-
|
|
4
|
+
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-BzSEz4xK.js";
|
|
5
5
|
export { componentDefinition, Twirl_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../colorMixing-BPpDnR5I.js";
|
|
3
3
|
import "../../sdf-BDsv-WBk.js";
|
|
4
|
-
import { n as componentDefinition, t as Vesica_default } from "../../Vesica-
|
|
4
|
+
import { n as componentDefinition, t as Vesica_default } from "../../Vesica-DXWePxDj.js";
|
|
5
5
|
export { componentDefinition, Vesica_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Vibrance_default } from "../../Vibrance-
|
|
1
|
+
import { n as componentDefinition, t as Vibrance_default } from "../../Vibrance-BETLN3Ie.js";
|
|
2
2
|
export { componentDefinition, Vibrance_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../browser-
|
|
2
|
-
import { n as componentDefinition, t as VideoTexture_default } from "../../VideoTexture-
|
|
1
|
+
import "../../browser-CqdrcD5J.js";
|
|
2
|
+
import { n as componentDefinition, t as VideoTexture_default } from "../../VideoTexture-Dbsbgb1Y.js";
|
|
3
3
|
export { componentDefinition, VideoTexture_default as default };
|
|
@@ -2,5 +2,5 @@ import "../../edges-CfGcQniB.js";
|
|
|
2
2
|
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-C4ptedXe.js";
|
|
4
4
|
import "../../time-DUqSFWvT.js";
|
|
5
|
-
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-
|
|
5
|
+
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-C-j597Jm.js";
|
|
6
6
|
export { componentDefinition, WaveDistortion_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../browser-
|
|
2
|
-
import { n as componentDefinition, t as WebcamTexture_default } from "../../WebcamTexture-
|
|
1
|
+
import "../../browser-CqdrcD5J.js";
|
|
2
|
+
import { n as componentDefinition, t as WebcamTexture_default } from "../../WebcamTexture-xvb8MuFz.js";
|
|
3
3
|
export { componentDefinition, WebcamTexture_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-C4ptedXe.js";
|
|
3
|
-
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-
|
|
3
|
+
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-DFw0J9x3.js";
|
|
4
4
|
export { componentDefinition, ZoomBlur_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createShader.d.ts","sourceRoot":"","sources":["../src/createShader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAa5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"createShader.d.ts","sourceRoot":"","sources":["../src/createShader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAa5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,cAAc,CAAC,CA0OzB"}
|
package/dist/js/createShader.js
CHANGED
|
@@ -12,6 +12,7 @@ var METADATA_PROPS = new Set([
|
|
|
12
12
|
]);
|
|
13
13
|
async function createShader(canvas, preset, options) {
|
|
14
14
|
const renderer = shaderRenderer();
|
|
15
|
+
if (options?.onReady) renderer.setOnReady(options.onReady);
|
|
15
16
|
const componentRegistry = /* @__PURE__ */ new Map();
|
|
16
17
|
getAllShaders().forEach((shader) => {
|
|
17
18
|
componentRegistry.set(shader.definition.name, shader.definition);
|
|
@@ -40,7 +41,7 @@ async function createShader(canvas, preset, options) {
|
|
|
40
41
|
if (isExternalUser() && shouldCollectTelemetry(options?.disableTelemetry || false, options?.isPreview || false)) {
|
|
41
42
|
const checkRendering = () => {
|
|
42
43
|
if (renderer.getPerformanceStats().fps > 0) {
|
|
43
|
-
telemetryCollector = startTelemetry(renderer, "2.5.
|
|
44
|
+
telemetryCollector = startTelemetry(renderer, "2.5.82", options?.disableTelemetry || false, false);
|
|
44
45
|
if (telemetryCollector) telemetryCollector.start();
|
|
45
46
|
telemetryStartTimeout = null;
|
|
46
47
|
} else telemetryStartTimeout = setTimeout(checkRendering, 500);
|
package/dist/js/types.d.ts
CHANGED
package/dist/js/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;IAC7D;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7C,OAAO,IAAI,IAAI,CAAA;CAChB"}
|
|
@@ -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;AAwtCD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CAoBlG;AAGD,eAAO,MAAM,mBAAmB,UA6F/B,CAAA"}
|
|
@@ -384,6 +384,18 @@ var shaderMetadata = {
|
|
|
384
384
|
"evolutionSpeed": 0,
|
|
385
385
|
"edges": "mirror"
|
|
386
386
|
},
|
|
387
|
+
"FlowingGradient": {
|
|
388
|
+
"opacity": 1,
|
|
389
|
+
"blendMode": "normal",
|
|
390
|
+
"colorA": "#0a0015",
|
|
391
|
+
"colorB": "#6b17e6",
|
|
392
|
+
"colorC": "#ff4d6a",
|
|
393
|
+
"colorD": "#ff6b35",
|
|
394
|
+
"colorSpace": "oklch",
|
|
395
|
+
"speed": 1,
|
|
396
|
+
"distortion": .5,
|
|
397
|
+
"seed": 0
|
|
398
|
+
},
|
|
387
399
|
"Form3D": {
|
|
388
400
|
"opacity": 1,
|
|
389
401
|
"blendMode": "normal",
|
|
@@ -572,8 +584,9 @@ var shaderMetadata = {
|
|
|
572
584
|
"Liquify": {
|
|
573
585
|
"opacity": 1,
|
|
574
586
|
"blendMode": "normal",
|
|
575
|
-
"intensity":
|
|
576
|
-
"
|
|
587
|
+
"intensity": 10,
|
|
588
|
+
"stiffness": 3,
|
|
589
|
+
"damping": 3,
|
|
577
590
|
"radius": 1,
|
|
578
591
|
"edges": "stretch"
|
|
579
592
|
},
|
|
@@ -1185,6 +1198,7 @@ const availableComponents = [
|
|
|
1185
1198
|
"FloatingParticles",
|
|
1186
1199
|
"FlowField",
|
|
1187
1200
|
"Flower",
|
|
1201
|
+
"FlowingGradient",
|
|
1188
1202
|
"Form3D",
|
|
1189
1203
|
"Glass",
|
|
1190
1204
|
"GlassTiles",
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { ShaderContext } from "./Shader.js";
|
|
2
|
+
import { useContext, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { createUniformsMap } from "../core/index.js";
|
|
4
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { componentDefinition } from "../core/shaders/FlowingGradient/index.js";
|
|
7
|
+
function isPropDriver(value) {
|
|
8
|
+
return typeof value === "object" && value !== null && "type" in value && (value.type === "map" || value.type === "mouse" || value.type === "mouse-position" || value.type === "auto-animate");
|
|
9
|
+
}
|
|
10
|
+
function computeEffectiveProps(props, defaultProps$1) {
|
|
11
|
+
let baseProps = { ...defaultProps$1 };
|
|
12
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && value !== void 0 && !isPropDriver(value)) baseProps[key] = value;
|
|
13
|
+
return baseProps;
|
|
14
|
+
}
|
|
15
|
+
var MARKER_STYLE = { display: "contents" };
|
|
16
|
+
var DEFAULT_TRANSFORM = {
|
|
17
|
+
offsetX: 0,
|
|
18
|
+
offsetY: 0,
|
|
19
|
+
rotation: 0,
|
|
20
|
+
scale: 1,
|
|
21
|
+
anchorX: .5,
|
|
22
|
+
anchorY: .5,
|
|
23
|
+
edges: "transparent"
|
|
24
|
+
};
|
|
25
|
+
var defaultProps = {
|
|
26
|
+
blendMode: "normal",
|
|
27
|
+
visible: true
|
|
28
|
+
};
|
|
29
|
+
try {
|
|
30
|
+
if (componentDefinition && componentDefinition.props) Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
31
|
+
const propConfig = config;
|
|
32
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) defaultProps[key] = propConfig.default;
|
|
33
|
+
});
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.warn("Error extracting default props:", e);
|
|
36
|
+
}
|
|
37
|
+
const ShaderComponent = (props) => {
|
|
38
|
+
const context = useContext(ShaderContext);
|
|
39
|
+
if (!context) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
40
|
+
const { shaderParentId: parentId, shaderNodeRegister: parentRegister, shaderUniformUpdate: parentUniformUpdate, shaderMetadataUpdate: parentMetadataUpdate, shaderColorSpace } = context;
|
|
41
|
+
const instanceId = useMemo(() => {
|
|
42
|
+
return (props.id ? props.id.replace(/[^a-zA-Z0-9_]/g, "_") : null) || Math.random().toString(36).substring(2, 10);
|
|
43
|
+
}, [props.id]);
|
|
44
|
+
const effectiveProps = useMemo(() => {
|
|
45
|
+
return computeEffectiveProps(props, defaultProps);
|
|
46
|
+
}, [props]);
|
|
47
|
+
const effectiveTransform = useMemo(() => ({
|
|
48
|
+
...DEFAULT_TRANSFORM,
|
|
49
|
+
...props.transform
|
|
50
|
+
}), [props.transform]);
|
|
51
|
+
const markerRef = useRef(null);
|
|
52
|
+
const detectedOrderRef = useRef(void 0);
|
|
53
|
+
const uniformsRef = useRef(null);
|
|
54
|
+
if (uniformsRef.current === null) {
|
|
55
|
+
setColorSpaceMode(shaderColorSpace);
|
|
56
|
+
uniformsRef.current = createUniformsMap(componentDefinition, effectiveProps, instanceId);
|
|
57
|
+
}
|
|
58
|
+
const childContextValue = useMemo(() => {
|
|
59
|
+
return {
|
|
60
|
+
...context,
|
|
61
|
+
shaderParentId: instanceId
|
|
62
|
+
};
|
|
63
|
+
}, [context, instanceId]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (!uniformsRef.current) return;
|
|
66
|
+
try {
|
|
67
|
+
const metadata = {
|
|
68
|
+
blendMode: props.blendMode || "normal",
|
|
69
|
+
opacity: props.opacity,
|
|
70
|
+
visible: props.visible === false ? false : true,
|
|
71
|
+
id: props.id,
|
|
72
|
+
mask: props.maskSource ? {
|
|
73
|
+
source: props.maskSource,
|
|
74
|
+
type: props.maskType || "alpha"
|
|
75
|
+
} : void 0,
|
|
76
|
+
maps: mapsFromProps,
|
|
77
|
+
renderOrder: props.renderOrder ?? detectedOrderRef.current,
|
|
78
|
+
transform: effectiveTransform
|
|
79
|
+
};
|
|
80
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniformsRef.current, componentDefinition);
|
|
81
|
+
return () => {
|
|
82
|
+
parentRegister(instanceId, null, null, null, null);
|
|
83
|
+
};
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error("Error registering shader node:", error);
|
|
86
|
+
return () => {};
|
|
87
|
+
}
|
|
88
|
+
}, [
|
|
89
|
+
instanceId,
|
|
90
|
+
parentId,
|
|
91
|
+
parentRegister
|
|
92
|
+
]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (props.renderOrder === void 0 && markerRef.current) {
|
|
95
|
+
const parent = markerRef.current.parentElement;
|
|
96
|
+
if (parent) {
|
|
97
|
+
const siblings = parent.querySelectorAll(":scope > [data-shader-id]");
|
|
98
|
+
const position = Array.from(siblings).indexOf(markerRef.current);
|
|
99
|
+
if (position >= 0) {
|
|
100
|
+
detectedOrderRef.current = position;
|
|
101
|
+
parentMetadataUpdate(instanceId, { renderOrder: position });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}, []);
|
|
106
|
+
const prevPropsRef = useRef({});
|
|
107
|
+
const mapsFromProps = useMemo(() => {
|
|
108
|
+
const maps = {};
|
|
109
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && isPropDriver(value)) maps[key] = value;
|
|
110
|
+
return Object.keys(maps).length > 0 ? maps : void 0;
|
|
111
|
+
}, [props]);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (!uniformsRef.current) return;
|
|
114
|
+
try {
|
|
115
|
+
Object.entries(uniformsRef.current).forEach(([propName, uniformData]) => {
|
|
116
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
117
|
+
const { uniform } = uniformData;
|
|
118
|
+
if (uniform?.value !== void 0 && propName in effectiveProps) {
|
|
119
|
+
const newValue = effectiveProps[propName];
|
|
120
|
+
if (isPropDriver(newValue)) return;
|
|
121
|
+
if (newValue !== prevPropsRef.current[propName]) {
|
|
122
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
123
|
+
prevPropsRef.current[propName] = newValue;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
} catch (error) {
|
|
128
|
+
console.error("Error updating uniforms:", error);
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
effectiveProps,
|
|
132
|
+
instanceId,
|
|
133
|
+
parentUniformUpdate
|
|
134
|
+
]);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
try {
|
|
137
|
+
parentMetadataUpdate(instanceId, {
|
|
138
|
+
blendMode: props.blendMode || "normal",
|
|
139
|
+
opacity: props.opacity,
|
|
140
|
+
visible: props.visible === false ? false : true,
|
|
141
|
+
id: props.id,
|
|
142
|
+
mask: props.maskSource ? {
|
|
143
|
+
source: props.maskSource,
|
|
144
|
+
type: props.maskType || "alpha"
|
|
145
|
+
} : void 0,
|
|
146
|
+
maps: mapsFromProps,
|
|
147
|
+
renderOrder: props.renderOrder ?? detectedOrderRef.current,
|
|
148
|
+
transform: effectiveTransform
|
|
149
|
+
});
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.error("Error updating metadata:", error);
|
|
152
|
+
}
|
|
153
|
+
}, [
|
|
154
|
+
props.blendMode,
|
|
155
|
+
props.opacity,
|
|
156
|
+
props.visible,
|
|
157
|
+
props.maskSource,
|
|
158
|
+
props.maskType,
|
|
159
|
+
props.renderOrder,
|
|
160
|
+
props.id,
|
|
161
|
+
mapsFromProps,
|
|
162
|
+
effectiveTransform,
|
|
163
|
+
instanceId,
|
|
164
|
+
parentMetadataUpdate
|
|
165
|
+
]);
|
|
166
|
+
if (props.ref && typeof props.ref === "function") try {
|
|
167
|
+
props.ref(null);
|
|
168
|
+
} catch (e) {}
|
|
169
|
+
return /* @__PURE__ */ jsx(ShaderContext.Provider, {
|
|
170
|
+
value: childContextValue,
|
|
171
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
172
|
+
ref: markerRef,
|
|
173
|
+
style: MARKER_STYLE,
|
|
174
|
+
"data-shader-id": instanceId,
|
|
175
|
+
children: props.children
|
|
176
|
+
})
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
var FlowingGradient_default = ShaderComponent;
|
|
180
|
+
export { ShaderComponent, FlowingGradient_default as default };
|
package/dist/react/Preview.js
CHANGED
|
@@ -51,6 +51,7 @@ var componentMap = {
|
|
|
51
51
|
FloatingParticles: lazy(() => import("./FloatingParticles.js")),
|
|
52
52
|
FlowField: lazy(() => import("./FlowField.js")),
|
|
53
53
|
Flower: lazy(() => import("./Flower.js")),
|
|
54
|
+
FlowingGradient: lazy(() => import("./FlowingGradient.js")),
|
|
54
55
|
Form3D: lazy(() => import("./Form3D.js")),
|
|
55
56
|
Glass: lazy(() => import("./Glass.js")),
|
|
56
57
|
GlassTiles: lazy(() => import("./GlassTiles.js")),
|
package/dist/react/Shader.js
CHANGED
|
@@ -5,12 +5,20 @@ import { vec4 } from "three/tsl";
|
|
|
5
5
|
import { isExternalUser, shouldCollectTelemetry, startTelemetry } from "../core/telemetry/index.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
const ShaderContext = createContext(null);
|
|
8
|
-
const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear", isPreview = false, style = {}, className = "",...rest }) => {
|
|
8
|
+
const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear", isPreview = false, onReady, style = {}, className = "",...rest }) => {
|
|
9
9
|
const containerRef = useRef(null);
|
|
10
10
|
const canvasRef = useRef(null);
|
|
11
11
|
const rootId = useMemo(() => "shader-root-" + Math.random().toString(36).substring(7), []);
|
|
12
12
|
const rendererRef = useRef(null);
|
|
13
13
|
if (rendererRef.current === null) rendererRef.current = shaderRenderer();
|
|
14
|
+
const onReadyRef = useRef(onReady);
|
|
15
|
+
onReadyRef.current = onReady;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
rendererRef.current.setOnReady(() => onReadyRef.current?.());
|
|
18
|
+
return () => {
|
|
19
|
+
rendererRef.current.setOnReady(null);
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
14
22
|
const telemetryCollectorRef = useRef(null);
|
|
15
23
|
const telemetryStartTimeoutRef = useRef(null);
|
|
16
24
|
const shouldSendTelemetryRef = useRef(null);
|
|
@@ -80,7 +88,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
|
|
|
80
88
|
return;
|
|
81
89
|
}
|
|
82
90
|
if (rendererRef.current.getPerformanceStats().fps > 0) {
|
|
83
|
-
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.
|
|
91
|
+
telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.82", disableTelemetry, isPreview);
|
|
84
92
|
if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
|
|
85
93
|
telemetryStartTimeoutRef.current = null;
|
|
86
94
|
} else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);
|