shaders 2.3.57 → 2.3.60
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/{AngularBlur-BNL2_pBD.js → AngularBlur-m_DWR-a1.js} +1 -1
- package/dist/core/{Aurora-DtnRdRC-.js → Aurora-CYCPE1wp.js} +2 -2
- package/dist/core/{Beam-qJlv6CVV.js → Beam-COjEb2JI.js} +2 -2
- package/dist/core/{Blob-DGRz-vGs.js → Blob-jHnoxt2N.js} +2 -2
- package/dist/core/{Bulge-54fwrqfj.js → Bulge-CsNj4Jew.js} +1 -1
- package/dist/core/{Checkerboard-DwFfxCnj.js → Checkerboard-DwiW08iJ.js} +2 -2
- package/dist/core/{ChromaFlow-EXxrLXaR.js → ChromaFlow-DfP9ZDg0.js} +1 -1
- package/dist/core/{ChromaticAberration-CNR09GFf.js → ChromaticAberration-VL5tfOeo.js} +1 -1
- package/dist/core/{Circle-zhbK6F5c.js → Circle-CUYMdgd5.js} +2 -2
- package/dist/core/{ConcentricSpin-CDjyEIxy.js → ConcentricSpin-DBqXmCjg.js} +1 -1
- package/dist/core/{ContourLines-zyy6CCUx.js → ContourLines-D2KRIOBw.js} +1 -1
- package/dist/core/{CursorRipples-CmE0GhQh.js → CursorRipples-JWrDL_dU.js} +1 -1
- package/dist/core/{CursorTrail--yjKF5x6.js → CursorTrail-D2_14ZEz.js} +2 -2
- package/dist/core/{DiffuseBlur-CfZ3V94k.js → DiffuseBlur-siJmc-84.js} +1 -1
- package/dist/core/{Dither-Cro5_SzL.js → Dither-GoyNQ4_v.js} +1 -1
- package/dist/core/{DotGrid-BOS1G6mL.js → DotGrid-B8bSufr6.js} +1 -1
- package/dist/core/{Duotone-bPh-N4wz.js → Duotone-CRiDL3YN.js} +2 -2
- package/dist/core/{FloatingParticles-DzTtE8CB.js → FloatingParticles-CtrWM2rw.js} +1 -1
- package/dist/core/{FlowField-Cuy2JAYR.js → FlowField-B-sNApu9.js} +1 -1
- package/dist/core/{Godrays-CbslvOsk.js → Godrays-BV94FCDI.js} +1 -1
- package/dist/core/{Grid-CGHXquxS.js → Grid-Czxa6-My.js} +1 -1
- package/dist/core/{GridDistortion-B3b17eue.js → GridDistortion-CKhOZRpM.js} +1 -1
- package/dist/core/{Halftone-iU8wtr1b.js → Halftone-YTJAc3Ie.js} +1 -1
- package/dist/core/{Kaleidoscope-BL6E3BVU.js → Kaleidoscope-BDTIWTFC.js} +1 -1
- package/dist/core/{LensFlare-B-SuRYrs.js → LensFlare-CxyJBEvr.js} +1 -1
- package/dist/core/{LinearBlur-C022H2bm.js → LinearBlur-BtsleV0J.js} +1 -1
- package/dist/core/{LinearGradient-Bw4cgU2M.js → LinearGradient-BP91wtXm.js} +2 -2
- package/dist/core/{Liquify-C6s_nyRi.js → Liquify-2u2lkBhB.js} +1 -1
- package/dist/core/{Mirror-uDxrbYeY.js → Mirror-BonA1elw.js} +1 -1
- package/dist/core/{Perspective-C2l3C8d0.js → Perspective-Cwpv4683.js} +1 -1
- package/dist/core/{Plasma-B4lUXy1l.js → Plasma-BU4ujuLB.js} +2 -2
- package/dist/core/{PolarCoordinates-CxxFpdz2.js → PolarCoordinates-6BZYZFoj.js} +1 -1
- package/dist/core/{ProgressiveBlur-BnWdDciO.js → ProgressiveBlur-Y8YqC7HM.js} +1 -1
- package/dist/core/{RadialGradient-RBdy6zz7.js → RadialGradient-DauSwpwY.js} +2 -2
- package/dist/core/{RectangularCoordinates-CuKEfncN.js → RectangularCoordinates-C5585uvf.js} +1 -1
- package/dist/core/{Ripples-DPp17BSt.js → Ripples-QWGujQgy.js} +2 -2
- package/dist/core/{Shatter-CABbAt_A.js → Shatter-DRSn9uGZ.js} +1 -1
- package/dist/core/{SimplexNoise-B6NBzB1e.js → SimplexNoise-W0fx_Y5Q.js} +2 -2
- package/dist/core/{SineWave-6gxiNlvQ.js → SineWave-C-r5bVGK.js} +1 -1
- package/dist/core/{SolidColor-DEXByN1S.js → SolidColor-BY2tBGcO.js} +1 -1
- package/dist/core/{Spherize-DRGaSHzl.js → Spherize-DF4iTTzb.js} +1 -1
- package/dist/core/{Spiral-DT16M2Ky.js → Spiral-DWBdkW7Y.js} +2 -2
- package/dist/core/{Strands-CQBNeiNL.js → Strands-BFVI3C04.js} +1 -1
- package/dist/core/{Stretch-DFVmX2dB.js → Stretch-CB92XLiC.js} +1 -1
- package/dist/core/{Stripes-80nKu5P2.js → Stripes-CTmvjI0U.js} +2 -2
- package/dist/core/{StudioBackground-81057m29.js → StudioBackground-DXHPEKcb.js} +1 -1
- package/dist/core/{Swirl-C0caKRGI.js → Swirl-DVaTB8HY.js} +2 -2
- package/dist/core/{TiltShift-CNn3Yo34.js → TiltShift-CMTVpEBO.js} +1 -1
- package/dist/core/{Tint-CfVQjPxR.js → Tint-COD37j4D.js} +1 -1
- package/dist/core/{Tritone-CM5ZgDQ5.js → Tritone-BETUi-og.js} +2 -2
- package/dist/core/{Twirl-Bc95ho0B.js → Twirl-BUlMUymT.js} +1 -1
- package/dist/core/{WaveDistortion-w4LX_3ES.js → WaveDistortion-DzwdX6Wj.js} +1 -1
- package/dist/core/{ZoomBlur-D2DwyQKZ.js → ZoomBlur-BE1vT38D.js} +1 -1
- package/dist/core/colorMixing-D_wMclqL.js +196 -0
- package/dist/core/index.js +4 -3
- package/dist/core/registry.js +55 -55
- package/dist/core/renderer.d.ts +2 -1
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +2 -2
- package/dist/core/shaders/Aurora/index.js +3 -3
- package/dist/core/shaders/Beam/index.js +3 -3
- package/dist/core/shaders/Blob/index.js +3 -3
- package/dist/core/shaders/Bulge/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +3 -3
- package/dist/core/shaders/ChromaFlow/index.js +2 -2
- package/dist/core/shaders/ChromaticAberration/index.js +2 -2
- package/dist/core/shaders/Circle/index.js +3 -3
- package/dist/core/shaders/ConcentricSpin/index.js +2 -2
- package/dist/core/shaders/ContourLines/index.js +2 -2
- package/dist/core/shaders/CursorRipples/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +3 -3
- package/dist/core/shaders/DiffuseBlur/index.js +2 -2
- package/dist/core/shaders/Dither/index.js +2 -2
- package/dist/core/shaders/DotGrid/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +3 -3
- package/dist/core/shaders/FloatingParticles/index.js +2 -2
- package/dist/core/shaders/FlowField/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +2 -2
- package/dist/core/shaders/Kaleidoscope/index.js +2 -2
- package/dist/core/shaders/LensFlare/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +2 -2
- package/dist/core/shaders/LinearGradient/index.js +3 -3
- package/dist/core/shaders/Liquify/index.js +2 -2
- package/dist/core/shaders/Mirror/index.js +2 -2
- package/dist/core/shaders/Perspective/index.js +2 -2
- package/dist/core/shaders/Plasma/index.js +3 -3
- package/dist/core/shaders/PolarCoordinates/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +3 -3
- package/dist/core/shaders/RectangularCoordinates/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +3 -3
- package/dist/core/shaders/Shatter/index.js +2 -2
- package/dist/core/shaders/SimplexNoise/index.js +3 -3
- package/dist/core/shaders/SineWave/index.js +2 -2
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +2 -2
- package/dist/core/shaders/Spiral/index.js +3 -3
- package/dist/core/shaders/Strands/index.js +2 -2
- package/dist/core/shaders/Stretch/index.js +2 -2
- package/dist/core/shaders/Stripes/index.js +3 -3
- package/dist/core/shaders/StudioBackground/index.js +2 -2
- package/dist/core/shaders/Swirl/index.js +3 -3
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tint/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +3 -3
- package/dist/core/shaders/Twirl/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +2 -2
- package/dist/core/shaders/ZoomBlur/index.js +2 -2
- package/dist/core/telemetry/collector.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +1 -0
- package/dist/core/telemetry/types.d.ts +1 -0
- package/dist/core/telemetry/types.d.ts.map +1 -1
- package/dist/core/{transformations-CC_c-QAT.js → transformations-B5lM6fYX.js} +26 -4
- package/dist/core/utilities/colorMixing.d.ts +2 -1
- package/dist/core/utilities/colorMixing.d.ts.map +1 -1
- package/dist/core/utilities/transformations/index.js +2 -0
- package/dist/core/utilities/transformations.d.ts +5 -2
- package/dist/core/utilities/transformations.d.ts.map +1 -1
- package/dist/react/Shader.js +27 -4
- package/dist/react/engine/Shader.d.ts +1 -0
- package/dist/react/engine/Shader.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.d.ts +1 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +3 -2
- package/dist/react/utils/generatePresetCode.template.d.ts +1 -1
- package/dist/react/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/registry.js +336 -0
- 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 +25 -5
- package/dist/solid/utils/generatePresetCode.d.ts +1 -1
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +3 -2
- package/dist/solid/utils/generatePresetCode.template.d.ts +1 -1
- package/dist/solid/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/svelte/engine/Shader.svelte.d.ts +1 -0
- package/dist/svelte/{generatePresetCode-CO9fAymD.js → generatePresetCode-EA1bmNOJ.js} +3 -2
- package/dist/svelte/index.js +25 -5
- package/dist/svelte/utils/generatePresetCode.d.ts +1 -1
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/svelte/utils/generatePresetCode.template.d.ts +1 -1
- package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +23 -6
- package/dist/vue/engine/Shader.vue.d.ts +4 -0
- package/dist/vue/engine/Shader.vue.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.d.ts +1 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +3 -2
- package/dist/vue/utils/generatePresetCode.template.d.ts +1 -1
- package/dist/vue/utils/generatePresetCode.template.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/core/colorMixing-DZpckBhm.js +0 -68
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-Byel9eTg.js";
|
|
3
|
-
import { n as componentDefinition, t as LinearBlur_default } from "../../LinearBlur-
|
|
3
|
+
import { n as componentDefinition, t as LinearBlur_default } from "../../LinearBlur-BtsleV0J.js";
|
|
4
4
|
export { componentDefinition, LinearBlur_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
2
|
-
import "../../colorMixing-
|
|
3
|
-
import { n as componentDefinition, t as LinearGradient_default } from "../../LinearGradient-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
3
|
+
import { n as componentDefinition, t as LinearGradient_default } from "../../LinearGradient-BP91wtXm.js";
|
|
4
4
|
export { componentDefinition, LinearGradient_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Liquify_default } from "../../Liquify-
|
|
4
|
+
import { n as componentDefinition, t as Liquify_default } from "../../Liquify-2u2lkBhB.js";
|
|
5
5
|
export { componentDefinition, Liquify_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Mirror_default } from "../../Mirror-
|
|
4
|
+
import { n as componentDefinition, t as Mirror_default } from "../../Mirror-BonA1elw.js";
|
|
5
5
|
export { componentDefinition, Mirror_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Perspective_default } from "../../Perspective-
|
|
4
|
+
import { n as componentDefinition, t as Perspective_default } from "../../Perspective-Cwpv4683.js";
|
|
5
5
|
export { componentDefinition, Perspective_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as Plasma_default } from "../../Plasma-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as Plasma_default } from "../../Plasma-BU4ujuLB.js";
|
|
5
5
|
export { componentDefinition, Plasma_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as PolarCoordinates_default } from "../../PolarCoordinates-
|
|
4
|
+
import { n as componentDefinition, t as PolarCoordinates_default } from "../../PolarCoordinates-6BZYZFoj.js";
|
|
5
5
|
export { componentDefinition, PolarCoordinates_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-Byel9eTg.js";
|
|
3
|
-
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-
|
|
3
|
+
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-Y8YqC7HM.js";
|
|
4
4
|
export { componentDefinition, ProgressiveBlur_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
2
|
-
import "../../colorMixing-
|
|
3
|
-
import { n as componentDefinition, t as RadialGradient_default } from "../../RadialGradient-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
3
|
+
import { n as componentDefinition, t as RadialGradient_default } from "../../RadialGradient-DauSwpwY.js";
|
|
4
4
|
export { componentDefinition, RadialGradient_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as RectangularCoordinates_default } from "../../RectangularCoordinates-
|
|
4
|
+
import { n as componentDefinition, t as RectangularCoordinates_default } from "../../RectangularCoordinates-C5585uvf.js";
|
|
5
5
|
export { componentDefinition, RectangularCoordinates_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as Ripples_default } from "../../Ripples-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as Ripples_default } from "../../Ripples-QWGujQgy.js";
|
|
5
5
|
export { componentDefinition, Ripples_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Shatter_default } from "../../Shatter-
|
|
4
|
+
import { n as componentDefinition, t as Shatter_default } from "../../Shatter-DRSn9uGZ.js";
|
|
5
5
|
export { componentDefinition, Shatter_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-W0fx_Y5Q.js";
|
|
5
5
|
export { componentDefinition, SimplexNoise_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import { n as componentDefinition, t as SineWave_default } from "../../SineWave-
|
|
3
|
+
import { n as componentDefinition, t as SineWave_default } from "../../SineWave-C-r5bVGK.js";
|
|
4
4
|
export { componentDefinition, SineWave_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../transformations-
|
|
2
|
-
import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
|
+
import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-BY2tBGcO.js";
|
|
3
3
|
export { componentDefinition, SolidColor_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-Byel9eTg.js";
|
|
3
|
-
import { n as componentDefinition, t as Spherize_default } from "../../Spherize-
|
|
3
|
+
import { n as componentDefinition, t as Spherize_default } from "../../Spherize-DF4iTTzb.js";
|
|
4
4
|
export { componentDefinition, Spherize_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as Spiral_default } from "../../Spiral-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as Spiral_default } from "../../Spiral-DWBdkW7Y.js";
|
|
5
5
|
export { componentDefinition, Spiral_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import { n as componentDefinition, t as Strands_default } from "../../Strands-
|
|
3
|
+
import { n as componentDefinition, t as Strands_default } from "../../Strands-BFVI3C04.js";
|
|
4
4
|
export { componentDefinition, Strands_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Stretch_default } from "../../Stretch-
|
|
4
|
+
import { n as componentDefinition, t as Stretch_default } from "../../Stretch-CB92XLiC.js";
|
|
5
5
|
export { componentDefinition, Stretch_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as Stripes_default } from "../../Stripes-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as Stripes_default } from "../../Stripes-CTmvjI0U.js";
|
|
5
5
|
export { componentDefinition, Stripes_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import { n as componentDefinition, t as StudioBackground_default } from "../../StudioBackground-
|
|
3
|
+
import { n as componentDefinition, t as StudioBackground_default } from "../../StudioBackground-DXHPEKcb.js";
|
|
4
4
|
export { componentDefinition, StudioBackground_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-DVaTB8HY.js";
|
|
5
5
|
export { componentDefinition, Swirl_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-Byel9eTg.js";
|
|
3
|
-
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-
|
|
3
|
+
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-CMTVpEBO.js";
|
|
4
4
|
export { componentDefinition, TiltShift_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../transformations-
|
|
2
|
-
import { n as componentDefinition, t as Tint_default } from "../../Tint-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
|
+
import { n as componentDefinition, t as Tint_default } from "../../Tint-COD37j4D.js";
|
|
3
3
|
export { componentDefinition, Tint_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-Byel9eTg.js";
|
|
3
|
-
import "../../colorMixing-
|
|
4
|
-
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-
|
|
3
|
+
import "../../colorMixing-D_wMclqL.js";
|
|
4
|
+
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-BETUi-og.js";
|
|
5
5
|
export { componentDefinition, Tritone_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../alpha-Byel9eTg.js";
|
|
4
|
-
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-
|
|
4
|
+
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-BUlMUymT.js";
|
|
5
5
|
export { componentDefinition, Twirl_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
|
-
import "../../transformations-
|
|
2
|
+
import "../../transformations-B5lM6fYX.js";
|
|
3
3
|
import "../../time-BZqyVJXt.js";
|
|
4
4
|
import "../../alpha-Byel9eTg.js";
|
|
5
|
-
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-
|
|
5
|
+
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-DzwdX6Wj.js";
|
|
6
6
|
export { componentDefinition, WaveDistortion_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../transformations-
|
|
1
|
+
import "../../transformations-B5lM6fYX.js";
|
|
2
2
|
import "../../alpha-Byel9eTg.js";
|
|
3
|
-
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-
|
|
3
|
+
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-BE1vT38D.js";
|
|
4
4
|
export { componentDefinition, ZoomBlur_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/telemetry/collector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../src/telemetry/collector.ts"],"names":[],"mappings":"AAOA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,YAAY,CAAyB;IAC7C,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,OAAO,CAAiB;gBAEpB,QAAQ,EAAE,GAAG;IAKlB,IAAI,IAAI,IAAI;IAQb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4C5B,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,oBAAoB;IA0C5B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,iBAAiB;YAwBX,aAAa;IAqB3B,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,mBAAmB;CAQ5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,YAAY,CAAA;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,WAAW,EAAE,eAAe,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE;QACT,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telemetry/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,YAAY,CAAA;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,WAAW,EAAE,eAAe,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE;QACT,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,OAAO,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -4593,9 +4593,15 @@ var getReusableVector2 = () => {
|
|
|
4593
4593
|
if (!reusableVector2) reusableVector2 = new Vector2();
|
|
4594
4594
|
return reusableVector2;
|
|
4595
4595
|
};
|
|
4596
|
+
var colorSpaceMode = "p3-linear";
|
|
4597
|
+
const setColorSpaceMode = (mode) => {
|
|
4598
|
+
colorSpaceMode = mode;
|
|
4599
|
+
};
|
|
4600
|
+
const transformBoolean = (value) => value ? 1 : -1;
|
|
4596
4601
|
const transformColor = (value) => {
|
|
4597
4602
|
const threeColor = new Color(value);
|
|
4598
|
-
const
|
|
4603
|
+
const targetSpace = colorSpaceMode === "srgb" ? "srgb-linear" : "p3-linear";
|
|
4604
|
+
const coords = threeColor.to(targetSpace).coords;
|
|
4599
4605
|
const r = coords[0], g$1 = coords[1], b$2 = coords[2], a$1 = threeColor.alpha;
|
|
4600
4606
|
return {
|
|
4601
4607
|
node: vec4(r, g$1, b$2, a$1),
|
|
@@ -4604,7 +4610,8 @@ const transformColor = (value) => {
|
|
|
4604
4610
|
};
|
|
4605
4611
|
const transformColorUpdate = (value) => {
|
|
4606
4612
|
const threeColor = new Color(value);
|
|
4607
|
-
const
|
|
4613
|
+
const targetSpace = colorSpaceMode === "srgb" ? "srgb-linear" : "p3-linear";
|
|
4614
|
+
const coords = threeColor.to(targetSpace).coords;
|
|
4608
4615
|
return getReusableVector4().set(coords[0], coords[1], coords[2], threeColor.alpha);
|
|
4609
4616
|
};
|
|
4610
4617
|
const transformPosition = (value) => {
|
|
@@ -4747,13 +4754,28 @@ const colorSpaceOptions = [
|
|
|
4747
4754
|
{
|
|
4748
4755
|
label: "OKLAB",
|
|
4749
4756
|
value: "oklab"
|
|
4757
|
+
},
|
|
4758
|
+
{
|
|
4759
|
+
label: "HSL",
|
|
4760
|
+
value: "hsl"
|
|
4761
|
+
},
|
|
4762
|
+
{
|
|
4763
|
+
label: "HSV",
|
|
4764
|
+
value: "hsv"
|
|
4765
|
+
},
|
|
4766
|
+
{
|
|
4767
|
+
label: "LCH",
|
|
4768
|
+
value: "lch"
|
|
4750
4769
|
}
|
|
4751
4770
|
];
|
|
4752
4771
|
const transformColorSpace = (value) => {
|
|
4753
4772
|
const mode = {
|
|
4754
4773
|
"linear": 0,
|
|
4755
4774
|
"oklch": 1,
|
|
4756
|
-
"oklab": 2
|
|
4775
|
+
"oklab": 2,
|
|
4776
|
+
"hsl": 3,
|
|
4777
|
+
"hsv": 4,
|
|
4778
|
+
"lch": 5
|
|
4757
4779
|
}[value.toLowerCase()];
|
|
4758
4780
|
if (mode === void 0) {
|
|
4759
4781
|
console.warn(`Invalid color space mode: ${value}. Defaulting to 'linear'.`);
|
|
@@ -4761,4 +4783,4 @@ const transformColorSpace = (value) => {
|
|
|
4761
4783
|
}
|
|
4762
4784
|
return mode;
|
|
4763
4785
|
};
|
|
4764
|
-
export {
|
|
4786
|
+
export { transformColor as a, transformEdges as c, transformBoolean as i, transformPosition as l, setColorSpaceMode as n, transformColorSpace as o, transformAngle as r, transformColorUpdate as s, colorSpaceOptions as t, transformPositionUpdate as u };
|
|
@@ -6,7 +6,8 @@ import { Node } from 'three/webgpu';
|
|
|
6
6
|
* @param colorA - First color (vec4 with RGBA in P3-linear)
|
|
7
7
|
* @param colorB - Second color (vec4 with RGBA in P3-linear)
|
|
8
8
|
* @param t - Interpolation factor (0 = colorA, 1 = colorB)
|
|
9
|
-
* @param colorSpaceMode - Color space mode
|
|
9
|
+
* @param colorSpaceMode - Color space mode:
|
|
10
|
+
* 0 = linear RGB, 1 = OKLCh, 2 = OKLAB, 3 = HSL, 4 = HSV, 5 = LCH
|
|
10
11
|
* @returns Mixed color as vec4 in P3-linear
|
|
11
12
|
*/
|
|
12
13
|
export declare const mixColors: (colorA: Node, colorB: Node, t: Node, colorSpaceMode: Node) => Node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorMixing.d.ts","sourceRoot":"","sources":["../../src/utilities/colorMixing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"colorMixing.d.ts","sourceRoot":"","sources":["../../src/utilities/colorMixing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;AAmZtC;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,WACV,IAAI,UACJ,IAAI,KACT,IAAI,kBACS,IAAI,KACrB,IA4FF,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as transformColor, c as transformEdges, i as transformBoolean, l as transformPosition, n as setColorSpaceMode, o as transformColorSpace, r as transformAngle, s as transformColorUpdate, t as colorSpaceOptions, u as transformPositionUpdate } from "../../transformations-B5lM6fYX.js";
|
|
2
|
+
export { colorSpaceOptions, setColorSpaceMode, transformAngle, transformBoolean, transformColor, transformColorSpace, transformColorUpdate, transformEdges, transformPosition, transformPositionUpdate };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Vector2, Vector4 } from 'three';
|
|
2
2
|
|
|
3
|
+
export declare const setColorSpaceMode: (mode: "p3-linear" | "srgb") => void;
|
|
3
4
|
/**
|
|
4
5
|
* Convert a true/false boolean into an integer 1/-1 representation
|
|
5
6
|
* @param value
|
|
@@ -7,6 +8,7 @@ import { Vector2, Vector4 } from 'three';
|
|
|
7
8
|
export declare const transformBoolean: (value: boolean) => 1 | -1;
|
|
8
9
|
/**
|
|
9
10
|
* Convert a hex color or HTML color code into both TSL node and Three.js Vector4
|
|
11
|
+
* Uses the globally configured color space mode (p3-linear or srgb)
|
|
10
12
|
* @param value
|
|
11
13
|
* @returns Object with node (TSL vec4 for shader composition) and data (Vector4 for uniform updates)
|
|
12
14
|
*/
|
|
@@ -17,6 +19,7 @@ export declare const transformColor: (value: string) => {
|
|
|
17
19
|
/**
|
|
18
20
|
* Update-optimized color transform that reuses a single Vector4 instance.
|
|
19
21
|
* ONLY use for uniform updates - the returned vector is reused and will be overwritten.
|
|
22
|
+
* Uses the globally configured color space mode (p3-linear or srgb)
|
|
20
23
|
* @param value - Color string (hex, rgb, etc.)
|
|
21
24
|
* @returns Reusable Vector4 with color data (do NOT store reference long-term)
|
|
22
25
|
*/
|
|
@@ -76,8 +79,8 @@ export declare const colorSpaceOptions: {
|
|
|
76
79
|
* Transform color space interpolation mode strings into numeric values for shader use.
|
|
77
80
|
* Controls how colors are mixed/interpolated in gradient effects.
|
|
78
81
|
*
|
|
79
|
-
* @param value - Color space string ('linear', 'oklch', or '
|
|
80
|
-
* @returns Numeric mode value (0 = linear RGB, 1 = OKLCh, 2 = OKLAB)
|
|
82
|
+
* @param value - Color space string ('linear', 'oklch', 'oklab', 'hsl', 'hsv', or 'lch')
|
|
83
|
+
* @returns Numeric mode value (0 = linear RGB, 1 = OKLCh, 2 = OKLAB, 3 = HSL, 4 = HSV, 5 = LCH)
|
|
81
84
|
*/
|
|
82
85
|
export declare const transformColorSpace: (value: string) => number;
|
|
83
86
|
//# sourceMappingURL=transformations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/utilities/transformations.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"transformations.d.ts","sourceRoot":"","sources":["../../src/utilities/transformations.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,OAAO,CAAA;AA4BtC,eAAO,MAAM,iBAAiB,SAAU,WAAW,GAAG,MAAM,SAE3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,OAAO,WAAkB,CAAA;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM;UAMV,GAAG;;CAGpC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UAAW,MAAM,KAAG,OAKpD,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,UAAW;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,GAAG,MAAM;UA4DzD,GAAG;;CAGnC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,UAAW;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,GAAG,MAAM,KAAG,OAiDlG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,GAAG,MAAM,KAAG,MAyEvD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,MAe9C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;GAO7B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,MAiBnD,CAAA"}
|
package/dist/react/Shader.js
CHANGED
|
@@ -2,9 +2,10 @@ import { createContext, useEffect, useMemo, useRef } from "react";
|
|
|
2
2
|
import { shaderRenderer } from "../core/index.js";
|
|
3
3
|
import { vec4 } from "three/tsl";
|
|
4
4
|
import { TelemetryCollector, isExternalUser, shouldCollectTelemetry } from "../core/telemetry/index.js";
|
|
5
|
+
import { setColorSpaceMode } from "../core/utilities/transformations/index.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
const ShaderContext = createContext(null);
|
|
7
|
-
const Shader = ({ children, disableTelemetry = false, style = {}, className = "",...rest }) => {
|
|
8
|
+
const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear", style = {}, className = "",...rest }) => {
|
|
8
9
|
const containerRef = useRef(null);
|
|
9
10
|
const canvasRef = useRef(null);
|
|
10
11
|
const rootId = useMemo(() => "shader-root-" + Math.random().toString(36).substring(7), []);
|
|
@@ -12,6 +13,7 @@ const Shader = ({ children, disableTelemetry = false, style = {}, className = ""
|
|
|
12
13
|
if (rendererRef.current === null) rendererRef.current = shaderRenderer();
|
|
13
14
|
const telemetryCollectorRef = useRef(null);
|
|
14
15
|
const telemetryStartTimeoutRef = useRef(null);
|
|
16
|
+
const shouldSendTelemetryRef = useRef(null);
|
|
15
17
|
const nodeRegister = useMemo(() => {
|
|
16
18
|
return (id, fragmentNodeFunc, parentId, metadata, uniforms = null, componentDefinition = null) => {
|
|
17
19
|
if (fragmentNodeFunc === null) {
|
|
@@ -89,11 +91,15 @@ const Shader = ({ children, disableTelemetry = false, style = {}, className = ""
|
|
|
89
91
|
isInitializingRef.current = true;
|
|
90
92
|
try {
|
|
91
93
|
const renderer = rendererRef.current;
|
|
92
|
-
if (!renderer.isInitialized()) await renderer.initialize({
|
|
94
|
+
if (!renderer.isInitialized()) await renderer.initialize({
|
|
95
|
+
canvas,
|
|
96
|
+
colorSpace
|
|
97
|
+
});
|
|
93
98
|
renderer.registerNode(rootId, ({ childNode }) => childNode || vec4(0, 0, 0, 0), null, null, {});
|
|
94
99
|
isInitializedRef.current = true;
|
|
95
100
|
isInitializingRef.current = false;
|
|
96
|
-
if (isExternalUser() && shouldCollectTelemetry(disableTelemetry)
|
|
101
|
+
if (shouldSendTelemetryRef.current === null) shouldSendTelemetryRef.current = isExternalUser() && shouldCollectTelemetry(disableTelemetry);
|
|
102
|
+
if (shouldSendTelemetryRef.current && !telemetryCollectorRef.current) startTelemetryWhenReady();
|
|
97
103
|
} catch (err) {
|
|
98
104
|
console.error("[Shader] Initialization failed:", err);
|
|
99
105
|
isInitializingRef.current = false;
|
|
@@ -111,7 +117,7 @@ const Shader = ({ children, disableTelemetry = false, style = {}, className = ""
|
|
|
111
117
|
if (isCurrentlyVisible && !wasVisibleRef.current) {
|
|
112
118
|
if (rendererRef.current.isInitialized()) {
|
|
113
119
|
rendererRef.current.startAnimation();
|
|
114
|
-
if (
|
|
120
|
+
if (shouldSendTelemetryRef.current && !telemetryCollectorRef.current && !telemetryStartTimeoutRef.current) startTelemetryWhenReady();
|
|
115
121
|
} else initializeRenderer().catch(console.error);
|
|
116
122
|
wasVisibleRef.current = true;
|
|
117
123
|
} else if (!isCurrentlyVisible && wasVisibleRef.current) {
|
|
@@ -155,6 +161,23 @@ const Shader = ({ children, disableTelemetry = false, style = {}, className = ""
|
|
|
155
161
|
isInitializingRef.current = false;
|
|
156
162
|
};
|
|
157
163
|
}, []);
|
|
164
|
+
const isFirstRenderRef = useRef(true);
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (isFirstRenderRef.current) {
|
|
167
|
+
isFirstRenderRef.current = false;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (rendererRef.current && isInitializedRef.current) {
|
|
171
|
+
setColorSpaceMode(colorSpace);
|
|
172
|
+
try {
|
|
173
|
+
rendererRef.current.cleanup();
|
|
174
|
+
isInitializedRef.current = false;
|
|
175
|
+
initializeRenderer().catch(console.error);
|
|
176
|
+
} catch (err) {
|
|
177
|
+
console.error("[Shader] Error updating colorSpace:", err);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}, [colorSpace]);
|
|
158
181
|
return /* @__PURE__ */ jsx(ShaderContext.Provider, {
|
|
159
182
|
value: contextValue,
|
|
160
183
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -10,6 +10,7 @@ export declare const ShaderContext: React.Context<ShaderContextValue | null>;
|
|
|
10
10
|
interface ShaderProps {
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
disableTelemetry?: boolean;
|
|
13
|
+
colorSpace?: 'p3-linear' | 'srgb';
|
|
13
14
|
style?: React.CSSProperties;
|
|
14
15
|
className?: string;
|
|
15
16
|
[key: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shader.d.ts","sourceRoot":"","sources":["../../src/engine/Shader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Shader.d.ts","sourceRoot":"","sources":["../../src/engine/Shader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAOvE,MAAM,WAAW,kBAAkB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,mBAAmB,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAClJ,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/E,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;CACjE;AAED,eAAO,MAAM,aAAa,0CAAiD,CAAC;AAE5E,UAAU,WAAW;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2SxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -7,7 +7,7 @@ interface ComponentConfig {
|
|
|
7
7
|
interface PresetConfig {
|
|
8
8
|
components: ComponentConfig[];
|
|
9
9
|
}
|
|
10
|
-
export declare function generatePresetCode(preset: PresetConfig): string;
|
|
10
|
+
export declare function generatePresetCode(preset: PresetConfig, colorSpace?: 'p3-linear' | 'srgb'): string;
|
|
11
11
|
export declare const availableComponents: string[];
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=generatePresetCode.d.ts.map
|
|
@@ -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;AAy4BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,
|
|
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;AAy4BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CA4ClG;AAGD,eAAO,MAAM,mBAAmB,UA4E/B,CAAA"}
|
|
@@ -841,7 +841,7 @@ function isIdUsedAsMaskSource(id, allComponents) {
|
|
|
841
841
|
flattenComponents(allComponents);
|
|
842
842
|
return flatComponents.some((component) => component.props?.maskSource === id);
|
|
843
843
|
}
|
|
844
|
-
function generatePresetCode(preset) {
|
|
844
|
+
function generatePresetCode(preset, colorSpace) {
|
|
845
845
|
const generateComponentString = (config, indent = " ") => {
|
|
846
846
|
const propString = config.props ? generatePropString(config.props, config.type, indent) : "";
|
|
847
847
|
let idString = "";
|
|
@@ -856,7 +856,8 @@ function generatePresetCode(preset) {
|
|
|
856
856
|
} else if (attributes) return `${indent}<${config.type}\n${indent} ${attributes} />`;
|
|
857
857
|
else return `${indent}<${config.type} />`;
|
|
858
858
|
};
|
|
859
|
-
|
|
859
|
+
const componentStrings = preset.components.map((config) => generateComponentString(config)).join("\n");
|
|
860
|
+
return `<Shader${colorSpace && colorSpace !== "p3-linear" ? ` colorSpace="${colorSpace}"` : ""}>\n${componentStrings}\n</Shader>`;
|
|
860
861
|
}
|
|
861
862
|
const availableComponents = [
|
|
862
863
|
"AngularBlur",
|
|
@@ -7,7 +7,7 @@ interface ComponentConfig {
|
|
|
7
7
|
interface PresetConfig {
|
|
8
8
|
components: ComponentConfig[];
|
|
9
9
|
}
|
|
10
|
-
export declare function generatePresetCode(preset: PresetConfig): string;
|
|
10
|
+
export declare function generatePresetCode(preset: PresetConfig, colorSpace?: 'p3-linear' | 'srgb'): string;
|
|
11
11
|
export declare const availableComponents: any[];
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=generatePresetCode.template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.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;AA4HD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.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;AA4HD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,CA4ClG;AAGD,eAAO,MAAM,mBAAmB,OAG/B,CAAA"}
|