shaders 2.2.46 → 2.2.48
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/FlowField-BJFGOUZL.js +103 -0
- package/dist/core/Kaleidoscope-Dr-ja0XH.js +97 -0
- package/dist/core/Mirror-CnCw4TpZ.js +84 -0
- package/dist/core/registry.js +90 -84
- package/dist/core/shaderRegistry.d.ts.map +1 -1
- package/dist/core/shaders/FlowField/index.d.ts +36 -0
- package/dist/core/shaders/FlowField/index.d.ts.map +1 -0
- package/dist/core/shaders/FlowField/index.js +5 -0
- package/dist/core/shaders/GlassTiles/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.d.ts +36 -0
- package/dist/core/shaders/Kaleidoscope/index.d.ts.map +1 -0
- package/dist/core/shaders/Kaleidoscope/index.js +4 -0
- package/dist/core/shaders/LinearBlur/index.js +1 -1
- package/dist/core/shaders/LinearGradient/index.js +1 -1
- package/dist/core/shaders/Liquify/index.js +1 -1
- package/dist/core/shaders/Mirror/index.d.ts +29 -0
- package/dist/core/shaders/Mirror/index.d.ts.map +1 -0
- package/dist/core/shaders/Mirror/index.js +4 -0
- package/dist/core/shaders/Perspective/index.js +1 -1
- package/dist/core/shaders/Pixelate/index.js +1 -1
- package/dist/core/shaders/PolarCoordinates/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/Ripples/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/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/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/Tritone/index.js +1 -1
- package/dist/core/shaders/Twirl/index.js +1 -1
- package/dist/core/shaders/Vibrance/index.js +1 -1
- package/dist/core/shaders/WaveDistortion/index.js +1 -1
- package/dist/core/shaders/WebcamTexture/index.js +1 -1
- package/dist/core/shaders/ZoomBlur/index.js +1 -1
- package/dist/react/FlowField.js +144 -0
- package/dist/react/Kaleidoscope.js +144 -0
- package/dist/react/Mirror.js +144 -0
- package/dist/react/components/FlowField.d.ts +31 -0
- package/dist/react/components/FlowField.d.ts.map +1 -0
- package/dist/react/components/Kaleidoscope.d.ts +31 -0
- package/dist/react/components/Kaleidoscope.d.ts.map +1 -0
- package/dist/react/components/Mirror.d.ts +31 -0
- package/dist/react/components/Mirror.d.ts.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +4 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +15 -0
- package/dist/registry.js +386 -0
- package/dist/solid/components/FlowField.d.ts +28 -0
- package/dist/solid/components/FlowField.d.ts.map +1 -0
- package/dist/solid/components/FlowField.js +148 -0
- package/dist/solid/components/Kaleidoscope.d.ts +28 -0
- package/dist/solid/components/Kaleidoscope.d.ts.map +1 -0
- package/dist/solid/components/Kaleidoscope.js +148 -0
- package/dist/solid/components/Mirror.d.ts +28 -0
- package/dist/solid/components/Mirror.d.ts.map +1 -0
- package/dist/solid/components/Mirror.js +148 -0
- package/dist/solid/index.d.ts +3 -0
- package/dist/solid/index.d.ts.map +1 -1
- package/dist/solid/index.js +92 -86
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +15 -0
- package/dist/svelte/components/FlowField.svelte.d.ts +19 -0
- package/dist/svelte/components/Kaleidoscope.svelte.d.ts +19 -0
- package/dist/svelte/components/Mirror.svelte.d.ts +19 -0
- package/dist/svelte/{generatePresetCode-CtXcoyI0.js → generatePresetCode-BD0Ac86C.js} +15 -0
- package/dist/svelte/index.d.ts +3 -0
- package/dist/svelte/index.js +419 -86
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/FlowField.js +3 -0
- package/dist/vue/FlowField.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Kaleidoscope.js +3 -0
- package/dist/vue/Kaleidoscope.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/vue/Mirror.js +3 -0
- package/dist/vue/Mirror.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/vue/components/FlowField.vue.d.ts +57 -0
- package/dist/vue/components/FlowField.vue.d.ts.map +1 -0
- package/dist/vue/components/Kaleidoscope.vue.d.ts +57 -0
- package/dist/vue/components/Kaleidoscope.vue.d.ts.map +1 -0
- package/dist/vue/components/Mirror.vue.d.ts +57 -0
- package/dist/vue/components/Mirror.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +3 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +4 -1
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +15 -0
- package/package.json +25 -1
- /package/dist/core/{GlassTiles-C6LLjlnB.js → GlassTiles-DzYvo92U.js} +0 -0
- /package/dist/core/{Glow-C2avDr73.js → Glow-C4JrnNxe.js} +0 -0
- /package/dist/core/{Godrays-RVh5ylQ-.js → Godrays-CPWOcLmc.js} +0 -0
- /package/dist/core/{Grayscale-BH3tLDGN.js → Grayscale-BFS-Abdh.js} +0 -0
- /package/dist/core/{Grid-CdslWvoH.js → Grid-CsIIl3LT.js} +0 -0
- /package/dist/core/{GridDistortion-fimECOse.js → GridDistortion-Cq3hRKXK.js} +0 -0
- /package/dist/core/{Group-ByGv48Lm.js → Group-DHokCeZ1.js} +0 -0
- /package/dist/core/{Halftone-Cb5yrPnj.js → Halftone-BQsMiTyE.js} +0 -0
- /package/dist/core/{HueShift-DQ2WgImx.js → HueShift-BTjEGl3Z.js} +0 -0
- /package/dist/core/{ImageTexture-DKFb8ze3.js → ImageTexture-CY8Q8h_o.js} +0 -0
- /package/dist/core/{Invert-w9duGaUu.js → Invert-B8vSeK8d.js} +0 -0
- /package/dist/core/{LinearBlur-CfMT259a.js → LinearBlur-DgT4B0nH.js} +0 -0
- /package/dist/core/{LinearGradient-Cn7w-umQ.js → LinearGradient-DTifAwSC.js} +0 -0
- /package/dist/core/{Liquify-BCkIt0A1.js → Liquify-_eLJRjd7.js} +0 -0
- /package/dist/core/{Perspective-CJOFHxEC.js → Perspective-BpgcHA7E.js} +0 -0
- /package/dist/core/{Pixelate-BhNAxBsT.js → Pixelate-Bt2jxIDd.js} +0 -0
- /package/dist/core/{PolarCoordinates-DLs3K__1.js → PolarCoordinates-BJ8-cfC7.js} +0 -0
- /package/dist/core/{Posterize-XoAqPWv2.js → Posterize-Bs-iNEVB.js} +0 -0
- /package/dist/core/{ProgressiveBlur-BIZSnUjp.js → ProgressiveBlur-DELpd9wJ.js} +0 -0
- /package/dist/core/{RadialGradient-sQgXXXQk.js → RadialGradient-DQ4JGS5G.js} +0 -0
- /package/dist/core/{RectangularCoordinates-CyarkXn0.js → RectangularCoordinates-DXSP_gdW.js} +0 -0
- /package/dist/core/{Ripples-Djjw66Bn.js → Ripples-DwDKIvtQ.js} +0 -0
- /package/dist/core/{Saturation-DLHW_GP6.js → Saturation-ekyl1D9y.js} +0 -0
- /package/dist/core/{Sharpness-DkGuV_dy.js → Sharpness-DlWZ-yPe.js} +0 -0
- /package/dist/core/{Shatter-DVgj2Ea3.js → Shatter-BeD72o80.js} +0 -0
- /package/dist/core/{SimplexNoise-BXtLTcAr.js → SimplexNoise-DIo9v2-R.js} +0 -0
- /package/dist/core/{SineWave-BxqFasFh.js → SineWave-DFNnXFYQ.js} +0 -0
- /package/dist/core/{SolidColor-DFkDBFq3.js → SolidColor-B4eYGf_i.js} +0 -0
- /package/dist/core/{Spherize-DIJ4c_EG.js → Spherize-BIVrRcZG.js} +0 -0
- /package/dist/core/{Spiral-BBtmU1Fv.js → Spiral-CqjRxq1I.js} +0 -0
- /package/dist/core/{Strands-D6UOhX0L.js → Strands-B-a2SQB2.js} +0 -0
- /package/dist/core/{Stretch-DLpz8Ofm.js → Stretch-CZv3u-3X.js} +0 -0
- /package/dist/core/{Stripes-Bre3Z2m_.js → Stripes-CXUFg1Gt.js} +0 -0
- /package/dist/core/{Swirl-CfsYsr4X.js → Swirl-BcEmYjJs.js} +0 -0
- /package/dist/core/{TiltShift-BPpXBzBg.js → TiltShift-679S-uVs.js} +0 -0
- /package/dist/core/{Tint-BazvezVn.js → Tint-DS7IJWfS.js} +0 -0
- /package/dist/core/{Tritone-w0h2ebDB.js → Tritone-m_0hwkvN.js} +0 -0
- /package/dist/core/{Twirl-dmfYS2Eo.js → Twirl-DcuGsZAB.js} +0 -0
- /package/dist/core/{Vibrance-BpWyAK9W.js → Vibrance-BafFCMLv.js} +0 -0
- /package/dist/core/{WaveDistortion-hWdvaZmT.js → WaveDistortion-CQkMSDMg.js} +0 -0
- /package/dist/core/{WebcamTexture-D4Uv7Plz.js → WebcamTexture-C5oIVQlF.js} +0 -0
- /package/dist/core/{ZoomBlur-DCI4uHOL.js → ZoomBlur-pFDohu2G.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../colorMixing-CZPFmiT4.js";
|
|
3
|
-
import { n as componentDefinition, t as LinearGradient_default } from "../../LinearGradient-
|
|
3
|
+
import { n as componentDefinition, t as LinearGradient_default } from "../../LinearGradient-DTifAwSC.js";
|
|
4
4
|
export { componentDefinition, LinearGradient_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as Liquify_default } from "../../Liquify-
|
|
3
|
+
import { n as componentDefinition, t as Liquify_default } from "../../Liquify-_eLJRjd7.js";
|
|
4
4
|
export { componentDefinition, Liquify_default as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentDefinition } from '../../types';
|
|
2
|
+
import { transformPosition, transformEdges } from '../../utilities/transformations';
|
|
3
|
+
|
|
4
|
+
export interface ComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* The point the mirror line passes through
|
|
7
|
+
*
|
|
8
|
+
* Accepts `{ x, y }` objects with values from 0 to 1, or CSS positions like `top center`.
|
|
9
|
+
* @default {"x":0.5,"y":0.5}
|
|
10
|
+
*/
|
|
11
|
+
center: Parameters<typeof transformPosition>[0];
|
|
12
|
+
/**
|
|
13
|
+
* The angle of the mirror line in degrees
|
|
14
|
+
*
|
|
15
|
+
* Accepts a number between 0 and 360.
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
angle: number;
|
|
19
|
+
/**
|
|
20
|
+
* How to handle edges when distortion pushes content out of bounds
|
|
21
|
+
*
|
|
22
|
+
* Accepts one of: `"stretch"`, `"transparent"`, `"mirror"`, `"wrap"`.
|
|
23
|
+
* @default "mirror"
|
|
24
|
+
*/
|
|
25
|
+
edges: Parameters<typeof transformEdges>[0];
|
|
26
|
+
}
|
|
27
|
+
export declare const componentDefinition: ComponentDefinition<ComponentProps>;
|
|
28
|
+
export default componentDefinition;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shaders/Mirror/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,iBAAiB,CAAA;AAIvE,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAC,MAAM,qCAAqC,CAAA;AAGrF,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CAAC,cAAc,CA+FnE,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as Perspective_default } from "../../Perspective-
|
|
3
|
+
import { n as componentDefinition, t as Perspective_default } from "../../Perspective-BpgcHA7E.js";
|
|
4
4
|
export { componentDefinition, Perspective_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Pixelate_default } from "../../Pixelate-
|
|
1
|
+
import { n as componentDefinition, t as Pixelate_default } from "../../Pixelate-Bt2jxIDd.js";
|
|
2
2
|
export { componentDefinition, Pixelate_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as PolarCoordinates_default } from "../../PolarCoordinates-
|
|
3
|
+
import { n as componentDefinition, t as PolarCoordinates_default } from "../../PolarCoordinates-BJ8-cfC7.js";
|
|
4
4
|
export { componentDefinition, PolarCoordinates_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-Bs-iNEVB.js";
|
|
2
2
|
export { componentDefinition, Posterize_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-
|
|
2
|
+
import { n as componentDefinition, t as ProgressiveBlur_default } from "../../ProgressiveBlur-DELpd9wJ.js";
|
|
3
3
|
export { componentDefinition, ProgressiveBlur_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../colorMixing-CZPFmiT4.js";
|
|
3
|
-
import { n as componentDefinition, t as RadialGradient_default } from "../../RadialGradient-
|
|
3
|
+
import { n as componentDefinition, t as RadialGradient_default } from "../../RadialGradient-DQ4JGS5G.js";
|
|
4
4
|
export { componentDefinition, RadialGradient_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as RectangularCoordinates_default } from "../../RectangularCoordinates-
|
|
3
|
+
import { n as componentDefinition, t as RectangularCoordinates_default } from "../../RectangularCoordinates-DXSP_gdW.js";
|
|
4
4
|
export { componentDefinition, RectangularCoordinates_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
3
|
import "../../colorMixing-CZPFmiT4.js";
|
|
4
|
-
import { n as componentDefinition, t as Ripples_default } from "../../Ripples-
|
|
4
|
+
import { n as componentDefinition, t as Ripples_default } from "../../Ripples-DwDKIvtQ.js";
|
|
5
5
|
export { componentDefinition, Ripples_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-ekyl1D9y.js";
|
|
2
2
|
export { componentDefinition, Saturation_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as Sharpness_default } from "../../Sharpness-
|
|
1
|
+
import { n as componentDefinition, t as Sharpness_default } from "../../Sharpness-DlWZ-yPe.js";
|
|
2
2
|
export { componentDefinition, Sharpness_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as Shatter_default } from "../../Shatter-
|
|
3
|
+
import { n as componentDefinition, t as Shatter_default } from "../../Shatter-BeD72o80.js";
|
|
4
4
|
export { componentDefinition, Shatter_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
3
|
import "../../colorMixing-CZPFmiT4.js";
|
|
4
|
-
import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-
|
|
4
|
+
import { n as componentDefinition, t as SimplexNoise_default } from "../../SimplexNoise-DIo9v2-R.js";
|
|
5
5
|
export { componentDefinition, SimplexNoise_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.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-DFNnXFYQ.js";
|
|
4
4
|
export { componentDefinition, SineWave_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-
|
|
2
|
+
import { n as componentDefinition, t as SolidColor_default } from "../../SolidColor-B4eYGf_i.js";
|
|
3
3
|
export { componentDefinition, SolidColor_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as Spherize_default } from "../../Spherize-
|
|
2
|
+
import { n as componentDefinition, t as Spherize_default } from "../../Spherize-BIVrRcZG.js";
|
|
3
3
|
export { componentDefinition, Spherize_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
3
|
import "../../colorMixing-CZPFmiT4.js";
|
|
4
|
-
import { n as componentDefinition, t as Spiral_default } from "../../Spiral-
|
|
4
|
+
import { n as componentDefinition, t as Spiral_default } from "../../Spiral-CqjRxq1I.js";
|
|
5
5
|
export { componentDefinition, Spiral_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.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-B-a2SQB2.js";
|
|
4
4
|
export { componentDefinition, Strands_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as Stretch_default } from "../../Stretch-
|
|
3
|
+
import { n as componentDefinition, t as Stretch_default } from "../../Stretch-CZv3u-3X.js";
|
|
4
4
|
export { componentDefinition, Stretch_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
3
|
import "../../colorMixing-CZPFmiT4.js";
|
|
4
|
-
import { n as componentDefinition, t as Stripes_default } from "../../Stripes-
|
|
4
|
+
import { n as componentDefinition, t as Stripes_default } from "../../Stripes-CXUFg1Gt.js";
|
|
5
5
|
export { componentDefinition, Stripes_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../time-BZqyVJXt.js";
|
|
3
3
|
import "../../colorMixing-CZPFmiT4.js";
|
|
4
|
-
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-
|
|
4
|
+
import { n as componentDefinition, t as Swirl_default } from "../../Swirl-BcEmYjJs.js";
|
|
5
5
|
export { componentDefinition, Swirl_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-
|
|
2
|
+
import { n as componentDefinition, t as TiltShift_default } from "../../TiltShift-679S-uVs.js";
|
|
3
3
|
export { componentDefinition, TiltShift_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as Tint_default } from "../../Tint-
|
|
2
|
+
import { n as componentDefinition, t as Tint_default } from "../../Tint-DS7IJWfS.js";
|
|
3
3
|
export { componentDefinition, Tint_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
2
|
import "../../colorMixing-CZPFmiT4.js";
|
|
3
|
-
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-
|
|
3
|
+
import { n as componentDefinition, t as Tritone_default } from "../../Tritone-m_0hwkvN.js";
|
|
4
4
|
export { componentDefinition, Tritone_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
|
-
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-
|
|
3
|
+
import { n as componentDefinition, t as Twirl_default } from "../../Twirl-DcuGsZAB.js";
|
|
4
4
|
export { componentDefinition, Twirl_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-BafFCMLv.js";
|
|
2
2
|
export { componentDefinition, Vibrance_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../edges-Bd7GP4s2.js";
|
|
2
2
|
import "../../transformations-YbhRK-rd.js";
|
|
3
3
|
import "../../time-BZqyVJXt.js";
|
|
4
|
-
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-
|
|
4
|
+
import { n as componentDefinition, t as WaveDistortion_default } from "../../WaveDistortion-CQkMSDMg.js";
|
|
5
5
|
export { componentDefinition, WaveDistortion_default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as componentDefinition, t as WebcamTexture_default } from "../../WebcamTexture-
|
|
1
|
+
import { n as componentDefinition, t as WebcamTexture_default } from "../../WebcamTexture-C5oIVQlF.js";
|
|
2
2
|
export { componentDefinition, WebcamTexture_default as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../../transformations-YbhRK-rd.js";
|
|
2
|
-
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-
|
|
2
|
+
import { n as componentDefinition, t as ZoomBlur_default } from "../../ZoomBlur-pFDohu2G.js";
|
|
3
3
|
export { componentDefinition, ZoomBlur_default as default };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ShaderContext } from "./Shader.js";
|
|
2
|
+
import { useContext, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { createUniformsMap } from "../core/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { componentDefinition } from "../core/shaders/FlowField/index.js";
|
|
6
|
+
function computeEffectiveProps(props, defaultProps$1) {
|
|
7
|
+
let baseProps = { ...defaultProps$1 };
|
|
8
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && value !== void 0) baseProps[key] = value;
|
|
9
|
+
return baseProps;
|
|
10
|
+
}
|
|
11
|
+
var DEFAULT_TRANSFORM = {
|
|
12
|
+
offsetX: 0,
|
|
13
|
+
offsetY: 0,
|
|
14
|
+
rotation: 0,
|
|
15
|
+
scale: 1,
|
|
16
|
+
anchorX: .5,
|
|
17
|
+
anchorY: .5,
|
|
18
|
+
edges: "transparent"
|
|
19
|
+
};
|
|
20
|
+
var defaultProps = {
|
|
21
|
+
blendMode: "normal",
|
|
22
|
+
renderOrder: 0,
|
|
23
|
+
visible: true
|
|
24
|
+
};
|
|
25
|
+
try {
|
|
26
|
+
if (componentDefinition && componentDefinition.props) Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
27
|
+
const propConfig = config;
|
|
28
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) defaultProps[key] = propConfig.default;
|
|
29
|
+
});
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.warn("Error extracting default props:", e);
|
|
32
|
+
}
|
|
33
|
+
const ShaderComponent = (props) => {
|
|
34
|
+
const context = useContext(ShaderContext);
|
|
35
|
+
if (!context) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
36
|
+
const { shaderParentId: parentId, shaderNodeRegister: parentRegister, shaderUniformUpdate: parentUniformUpdate, shaderMetadataUpdate: parentMetadataUpdate } = context;
|
|
37
|
+
const instanceId = useMemo(() => {
|
|
38
|
+
return props.id || `${componentDefinition.name.toLowerCase()}_${Math.random().toString(36).substring(7)}`;
|
|
39
|
+
}, [props.id]);
|
|
40
|
+
const effectiveProps = useMemo(() => {
|
|
41
|
+
return computeEffectiveProps(props, defaultProps);
|
|
42
|
+
}, [props]);
|
|
43
|
+
const effectiveTransform = useMemo(() => ({
|
|
44
|
+
...DEFAULT_TRANSFORM,
|
|
45
|
+
...props.transform
|
|
46
|
+
}), [props.transform]);
|
|
47
|
+
const uniformsRef = useRef(null);
|
|
48
|
+
if (uniformsRef.current === null) uniformsRef.current = createUniformsMap(componentDefinition, effectiveProps, instanceId);
|
|
49
|
+
const childContextValue = useMemo(() => {
|
|
50
|
+
return {
|
|
51
|
+
...context,
|
|
52
|
+
shaderParentId: instanceId
|
|
53
|
+
};
|
|
54
|
+
}, [context, instanceId]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!uniformsRef.current) return;
|
|
57
|
+
try {
|
|
58
|
+
const metadata = {
|
|
59
|
+
blendMode: props.blendMode || "normal",
|
|
60
|
+
opacity: props.opacity,
|
|
61
|
+
visible: props.visible === false ? false : true,
|
|
62
|
+
id: props.id,
|
|
63
|
+
mask: props.maskSource ? {
|
|
64
|
+
source: props.maskSource,
|
|
65
|
+
type: props.maskType || "alpha"
|
|
66
|
+
} : void 0,
|
|
67
|
+
renderOrder: props.renderOrder || 0,
|
|
68
|
+
transform: effectiveTransform
|
|
69
|
+
};
|
|
70
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniformsRef.current, componentDefinition);
|
|
71
|
+
return () => {
|
|
72
|
+
parentRegister(instanceId, null, null, null, null);
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error("Error registering shader node:", error);
|
|
76
|
+
return () => {};
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
instanceId,
|
|
80
|
+
parentId,
|
|
81
|
+
parentRegister
|
|
82
|
+
]);
|
|
83
|
+
const prevPropsRef = useRef({});
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!uniformsRef.current) return;
|
|
86
|
+
try {
|
|
87
|
+
Object.entries(uniformsRef.current).forEach(([propName, uniformData]) => {
|
|
88
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
89
|
+
const { uniform, transform } = uniformData;
|
|
90
|
+
if (uniform?.value !== void 0 && propName in effectiveProps) {
|
|
91
|
+
const newValue = effectiveProps[propName];
|
|
92
|
+
if (newValue !== prevPropsRef.current[propName]) {
|
|
93
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
94
|
+
prevPropsRef.current[propName] = newValue;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error("Error updating uniforms:", error);
|
|
100
|
+
}
|
|
101
|
+
}, [
|
|
102
|
+
effectiveProps,
|
|
103
|
+
instanceId,
|
|
104
|
+
parentUniformUpdate
|
|
105
|
+
]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
try {
|
|
108
|
+
parentMetadataUpdate(instanceId, {
|
|
109
|
+
blendMode: props.blendMode || "normal",
|
|
110
|
+
opacity: props.opacity,
|
|
111
|
+
visible: props.visible === false ? false : true,
|
|
112
|
+
id: props.id,
|
|
113
|
+
mask: props.maskSource ? {
|
|
114
|
+
source: props.maskSource,
|
|
115
|
+
type: props.maskType || "alpha"
|
|
116
|
+
} : void 0,
|
|
117
|
+
renderOrder: props.renderOrder || 0,
|
|
118
|
+
transform: effectiveTransform
|
|
119
|
+
});
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.error("Error updating metadata:", error);
|
|
122
|
+
}
|
|
123
|
+
}, [
|
|
124
|
+
props.blendMode,
|
|
125
|
+
props.opacity,
|
|
126
|
+
props.visible,
|
|
127
|
+
props.maskSource,
|
|
128
|
+
props.maskType,
|
|
129
|
+
props.renderOrder,
|
|
130
|
+
props.id,
|
|
131
|
+
effectiveTransform,
|
|
132
|
+
instanceId,
|
|
133
|
+
parentMetadataUpdate
|
|
134
|
+
]);
|
|
135
|
+
if (props.ref && typeof props.ref === "function") try {
|
|
136
|
+
props.ref(null);
|
|
137
|
+
} catch (e) {}
|
|
138
|
+
return /* @__PURE__ */ jsx(ShaderContext.Provider, {
|
|
139
|
+
value: childContextValue,
|
|
140
|
+
children: props.children
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
var FlowField_default = ShaderComponent;
|
|
144
|
+
export { FlowField_default as default };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ShaderContext } from "./Shader.js";
|
|
2
|
+
import { useContext, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { createUniformsMap } from "../core/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { componentDefinition } from "../core/shaders/Kaleidoscope/index.js";
|
|
6
|
+
function computeEffectiveProps(props, defaultProps$1) {
|
|
7
|
+
let baseProps = { ...defaultProps$1 };
|
|
8
|
+
for (const [key, value] of Object.entries(props)) if (key !== "children" && key !== "ref" && value !== void 0) baseProps[key] = value;
|
|
9
|
+
return baseProps;
|
|
10
|
+
}
|
|
11
|
+
var DEFAULT_TRANSFORM = {
|
|
12
|
+
offsetX: 0,
|
|
13
|
+
offsetY: 0,
|
|
14
|
+
rotation: 0,
|
|
15
|
+
scale: 1,
|
|
16
|
+
anchorX: .5,
|
|
17
|
+
anchorY: .5,
|
|
18
|
+
edges: "transparent"
|
|
19
|
+
};
|
|
20
|
+
var defaultProps = {
|
|
21
|
+
blendMode: "normal",
|
|
22
|
+
renderOrder: 0,
|
|
23
|
+
visible: true
|
|
24
|
+
};
|
|
25
|
+
try {
|
|
26
|
+
if (componentDefinition && componentDefinition.props) Object.entries(componentDefinition.props).forEach(([key, config]) => {
|
|
27
|
+
const propConfig = config;
|
|
28
|
+
if (propConfig && typeof propConfig === "object" && "default" in propConfig) defaultProps[key] = propConfig.default;
|
|
29
|
+
});
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.warn("Error extracting default props:", e);
|
|
32
|
+
}
|
|
33
|
+
const ShaderComponent = (props) => {
|
|
34
|
+
const context = useContext(ShaderContext);
|
|
35
|
+
if (!context) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
|
|
36
|
+
const { shaderParentId: parentId, shaderNodeRegister: parentRegister, shaderUniformUpdate: parentUniformUpdate, shaderMetadataUpdate: parentMetadataUpdate } = context;
|
|
37
|
+
const instanceId = useMemo(() => {
|
|
38
|
+
return props.id || `${componentDefinition.name.toLowerCase()}_${Math.random().toString(36).substring(7)}`;
|
|
39
|
+
}, [props.id]);
|
|
40
|
+
const effectiveProps = useMemo(() => {
|
|
41
|
+
return computeEffectiveProps(props, defaultProps);
|
|
42
|
+
}, [props]);
|
|
43
|
+
const effectiveTransform = useMemo(() => ({
|
|
44
|
+
...DEFAULT_TRANSFORM,
|
|
45
|
+
...props.transform
|
|
46
|
+
}), [props.transform]);
|
|
47
|
+
const uniformsRef = useRef(null);
|
|
48
|
+
if (uniformsRef.current === null) uniformsRef.current = createUniformsMap(componentDefinition, effectiveProps, instanceId);
|
|
49
|
+
const childContextValue = useMemo(() => {
|
|
50
|
+
return {
|
|
51
|
+
...context,
|
|
52
|
+
shaderParentId: instanceId
|
|
53
|
+
};
|
|
54
|
+
}, [context, instanceId]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!uniformsRef.current) return;
|
|
57
|
+
try {
|
|
58
|
+
const metadata = {
|
|
59
|
+
blendMode: props.blendMode || "normal",
|
|
60
|
+
opacity: props.opacity,
|
|
61
|
+
visible: props.visible === false ? false : true,
|
|
62
|
+
id: props.id,
|
|
63
|
+
mask: props.maskSource ? {
|
|
64
|
+
source: props.maskSource,
|
|
65
|
+
type: props.maskType || "alpha"
|
|
66
|
+
} : void 0,
|
|
67
|
+
renderOrder: props.renderOrder || 0,
|
|
68
|
+
transform: effectiveTransform
|
|
69
|
+
};
|
|
70
|
+
parentRegister(instanceId, componentDefinition.fragmentNode, parentId, metadata, uniformsRef.current, componentDefinition);
|
|
71
|
+
return () => {
|
|
72
|
+
parentRegister(instanceId, null, null, null, null);
|
|
73
|
+
};
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error("Error registering shader node:", error);
|
|
76
|
+
return () => {};
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
instanceId,
|
|
80
|
+
parentId,
|
|
81
|
+
parentRegister
|
|
82
|
+
]);
|
|
83
|
+
const prevPropsRef = useRef({});
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!uniformsRef.current) return;
|
|
86
|
+
try {
|
|
87
|
+
Object.entries(uniformsRef.current).forEach(([propName, uniformData]) => {
|
|
88
|
+
if (!uniformData || typeof uniformData !== "object") return;
|
|
89
|
+
const { uniform, transform } = uniformData;
|
|
90
|
+
if (uniform?.value !== void 0 && propName in effectiveProps) {
|
|
91
|
+
const newValue = effectiveProps[propName];
|
|
92
|
+
if (newValue !== prevPropsRef.current[propName]) {
|
|
93
|
+
parentUniformUpdate(instanceId, propName, newValue);
|
|
94
|
+
prevPropsRef.current[propName] = newValue;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error("Error updating uniforms:", error);
|
|
100
|
+
}
|
|
101
|
+
}, [
|
|
102
|
+
effectiveProps,
|
|
103
|
+
instanceId,
|
|
104
|
+
parentUniformUpdate
|
|
105
|
+
]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
try {
|
|
108
|
+
parentMetadataUpdate(instanceId, {
|
|
109
|
+
blendMode: props.blendMode || "normal",
|
|
110
|
+
opacity: props.opacity,
|
|
111
|
+
visible: props.visible === false ? false : true,
|
|
112
|
+
id: props.id,
|
|
113
|
+
mask: props.maskSource ? {
|
|
114
|
+
source: props.maskSource,
|
|
115
|
+
type: props.maskType || "alpha"
|
|
116
|
+
} : void 0,
|
|
117
|
+
renderOrder: props.renderOrder || 0,
|
|
118
|
+
transform: effectiveTransform
|
|
119
|
+
});
|
|
120
|
+
} catch (error) {
|
|
121
|
+
console.error("Error updating metadata:", error);
|
|
122
|
+
}
|
|
123
|
+
}, [
|
|
124
|
+
props.blendMode,
|
|
125
|
+
props.opacity,
|
|
126
|
+
props.visible,
|
|
127
|
+
props.maskSource,
|
|
128
|
+
props.maskType,
|
|
129
|
+
props.renderOrder,
|
|
130
|
+
props.id,
|
|
131
|
+
effectiveTransform,
|
|
132
|
+
instanceId,
|
|
133
|
+
parentMetadataUpdate
|
|
134
|
+
]);
|
|
135
|
+
if (props.ref && typeof props.ref === "function") try {
|
|
136
|
+
props.ref(null);
|
|
137
|
+
} catch (e) {}
|
|
138
|
+
return /* @__PURE__ */ jsx(ShaderContext.Provider, {
|
|
139
|
+
value: childContextValue,
|
|
140
|
+
children: props.children
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
var Kaleidoscope_default = ShaderComponent;
|
|
144
|
+
export { Kaleidoscope_default as default };
|