@paper-design/shaders-react 0.0.77 → 0.0.79

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.
@@ -4,6 +4,9 @@
4
4
  * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5
5
 
6
6
  function colorPropsAreEqual(prevProps, nextProps) {
7
+ if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {
8
+ return false;
9
+ }
7
10
  for (const key in prevProps) {
8
11
  if (key === "colors") {
9
12
  const prevIsArray = Array.isArray(prevProps.colors);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/color-props-are-equal.ts"],
4
- "sourcesContent": ["interface PropsWithColors {\n colors?: string[];\n [key: string]: unknown;\n}\n\nexport function colorPropsAreEqual(prevProps: PropsWithColors, nextProps: PropsWithColors): boolean {\n for (const key in prevProps) {\n if (key === 'colors') {\n const prevIsArray = Array.isArray(prevProps.colors);\n const nextIsArray = Array.isArray(nextProps.colors);\n\n if (!prevIsArray || !nextIsArray) {\n if (Object.is(prevProps.colors, nextProps.colors) === false) {\n return false;\n }\n\n continue;\n }\n\n if (prevProps.colors?.length !== nextProps.colors?.length) {\n return false;\n }\n\n if (!prevProps.colors?.every((color, index) => color === nextProps.colors?.[index])) {\n return false;\n }\n\n continue;\n }\n\n if (Object.is(prevProps[key], nextProps[key]) === false) {\n return false;\n }\n }\n\n return true;\n}\n"],
5
- "mappings": ";;;;;AAKO,SAAS,mBAAmB,WAA4B,WAAqC;AAClG,aAAW,OAAO,WAAW;AAC3B,QAAI,QAAQ,UAAU;AACpB,YAAM,cAAc,MAAM,QAAQ,UAAU,MAAM;AAClD,YAAM,cAAc,MAAM,QAAQ,UAAU,MAAM;AAElD,UAAI,CAAC,eAAe,CAAC,aAAa;AAChC,YAAI,OAAO,GAAG,UAAU,QAAQ,UAAU,MAAM,MAAM,OAAO;AAC3D,iBAAO;AAAA,QACT;AAEA;AAAA,MACF;AAEA,UAAI,UAAU,QAAQ,WAAW,UAAU,QAAQ,QAAQ;AACzD,eAAO;AAAA,MACT;AAEA,UAAI,CAAC,UAAU,QAAQ,MAAM,CAAC,OAAO,UAAU,UAAU,UAAU,SAAS,KAAK,CAAC,GAAG;AACnF,eAAO;AAAA,MACT;AAEA;AAAA,IACF;AAEA,QAAI,OAAO,GAAG,UAAU,GAAG,GAAG,UAAU,GAAG,CAAC,MAAM,OAAO;AACvD,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["interface PropsWithColors {\n colors?: string[];\n [key: string]: unknown;\n}\n\nexport function colorPropsAreEqual(prevProps: PropsWithColors, nextProps: PropsWithColors): boolean {\n if (Object.keys(prevProps).length !== Object.keys(nextProps).length) {\n return false;\n }\n\n for (const key in prevProps) {\n if (key === 'colors') {\n const prevIsArray = Array.isArray(prevProps.colors);\n const nextIsArray = Array.isArray(nextProps.colors);\n\n if (!prevIsArray || !nextIsArray) {\n if (Object.is(prevProps.colors, nextProps.colors) === false) {\n return false;\n }\n\n continue;\n }\n\n if (prevProps.colors?.length !== nextProps.colors?.length) {\n return false;\n }\n\n if (!prevProps.colors?.every((color, index) => color === nextProps.colors?.[index])) {\n return false;\n }\n\n continue;\n }\n\n if (Object.is(prevProps[key], nextProps[key]) === false) {\n return false;\n }\n }\n\n return true;\n}\n"],
5
+ "mappings": ";;;;;AAKO,SAAS,mBAAmB,WAA4B,WAAqC;AAClG,MAAI,OAAO,KAAK,SAAS,EAAE,WAAW,OAAO,KAAK,SAAS,EAAE,QAAQ;AACnE,WAAO;AAAA,EACT;AAEA,aAAW,OAAO,WAAW;AAC3B,QAAI,QAAQ,UAAU;AACpB,YAAM,cAAc,MAAM,QAAQ,UAAU,MAAM;AAClD,YAAM,cAAc,MAAM,QAAQ,UAAU,MAAM;AAElD,UAAI,CAAC,eAAe,CAAC,aAAa;AAChC,YAAI,OAAO,GAAG,UAAU,QAAQ,UAAU,MAAM,MAAM,OAAO;AAC3D,iBAAO;AAAA,QACT;AAEA;AAAA,MACF;AAEA,UAAI,UAAU,QAAQ,WAAW,UAAU,QAAQ,QAAQ;AACzD,eAAO;AAAA,MACT;AAEA,UAAI,CAAC,UAAU,QAAQ,MAAM,CAAC,OAAO,UAAU,UAAU,UAAU,SAAS,KAAK,CAAC,GAAG;AACnF,eAAO;AAAA,MACT;AAEA;AAAA,IACF;AAEA,QAAI,OAAO,GAAG,UAAU,GAAG,GAAG,UAAU,GAAG,CAAC,MAAM,OAAO;AACvD,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -72,6 +72,9 @@ export type { WaterUniforms, WaterParams } from '@paper-design/shaders';
72
72
  export { ImageDithering, imageDitheringPresets } from './shaders/image-dithering.js';
73
73
  export type { ImageDitheringProps } from './shaders/image-dithering.js';
74
74
  export type { ImageDitheringUniforms, ImageDitheringParams } from '@paper-design/shaders';
75
+ export { LensDistortion, lensDistortionPresets } from './shaders/lens-distortion.js';
76
+ export type { LensDistortionProps } from './shaders/lens-distortion.js';
77
+ export type { LensDistortionUniforms, LensDistortionParams } from '@paper-design/shaders';
75
78
  export { Heatmap, heatmapPresets } from './shaders/heatmap.js';
76
79
  export type { HeatmapProps } from './shaders/heatmap.js';
77
80
  export type { HeatmapUniforms, HeatmapParams } from '@paper-design/shaders';
@@ -89,4 +92,4 @@ export type { GemSmokeProps } from './shaders/gem-smoke.js';
89
92
  export type { GemSmokeUniforms, GemSmokeParams } from '@paper-design/shaders';
90
93
  export { isPaperShaderElement, getShaderColorFromString } from '@paper-design/shaders';
91
94
  export type { PaperShaderElement, ShaderFit, ShaderSizingParams, ShaderSizingUniforms } from '@paper-design/shaders';
92
- export { colorPanelsMeta, dotOrbitMeta, godRaysMeta, grainGradientMeta, meshGradientMeta, metaballsMeta, pulsingBorderMeta, simplexNoiseMeta, smokeRingMeta, swirlMeta, voronoiMeta, warpMeta, heatmapMeta, staticMeshGradientMeta, staticRadialGradientMeta, } from '@paper-design/shaders';
95
+ export { colorPanelsMeta, dotOrbitMeta, godRaysMeta, grainGradientMeta, meshGradientMeta, metaballsMeta, pulsingBorderMeta, simplexNoiseMeta, smokeRingMeta, swirlMeta, voronoiMeta, warpMeta, heatmapMeta, lensDistortionMeta, staticMeshGradientMeta, staticRadialGradientMeta, } from '@paper-design/shaders';
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ import {} from "./shaders/fluted-glass.js";
31
31
  import {} from "@paper-design/shaders";
32
32
  import { Water, waterPresets } from "./shaders/water.js";
33
33
  import { ImageDithering, imageDitheringPresets } from "./shaders/image-dithering.js";
34
+ import { LensDistortion, lensDistortionPresets } from "./shaders/lens-distortion.js";
34
35
  import { Heatmap, heatmapPresets } from "./shaders/heatmap.js";
35
36
  import { LiquidMetal, liquidMetalPresets } from "./shaders/liquid-metal.js";
36
37
  import { HalftoneDots, halftoneDotsPresets } from "./shaders/halftone-dots.js";
@@ -51,6 +52,7 @@ import {
51
52
  voronoiMeta,
52
53
  warpMeta,
53
54
  heatmapMeta,
55
+ lensDistortionMeta,
54
56
  staticMeshGradientMeta,
55
57
  staticRadialGradientMeta
56
58
  } from "@paper-design/shaders";
@@ -67,6 +69,7 @@ export {
67
69
  HalftoneDots,
68
70
  Heatmap,
69
71
  ImageDithering,
72
+ LensDistortion,
70
73
  LiquidMetal,
71
74
  MeshGradient,
72
75
  Metaballs,
@@ -104,6 +107,8 @@ export {
104
107
  heatmapPresets,
105
108
  imageDitheringPresets,
106
109
  isPaperShaderElement,
110
+ lensDistortionMeta,
111
+ lensDistortionPresets,
107
112
  liquidMetalPresets,
108
113
  meshGradientMeta,
109
114
  meshGradientPresets,
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["'use client';\n\nexport { ShaderMount } from './shader-mount.js';\nexport type { ShaderMountProps, ShaderComponentProps } from './shader-mount.js';\n\nexport { MeshGradient, meshGradientPresets } from './shaders/mesh-gradient.js';\nexport type { MeshGradientProps } from './shaders/mesh-gradient.js';\nexport type { MeshGradientUniforms, MeshGradientParams } from '@paper-design/shaders';\n\nexport { SmokeRing, smokeRingPresets } from './shaders/smoke-ring.js';\nexport type { SmokeRingProps } from './shaders/smoke-ring.js';\nexport type { SmokeRingUniforms, SmokeRingParams } from '@paper-design/shaders';\n\nexport { NeuroNoise, neuroNoisePresets } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseProps } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseUniforms, NeuroNoiseParams } from '@paper-design/shaders';\n\nexport { DotOrbit, dotOrbitPresets } from './shaders/dot-orbit.js';\nexport type { DotOrbitProps } from './shaders/dot-orbit.js';\nexport type { DotOrbitUniforms, DotOrbitParams } from '@paper-design/shaders';\n\nexport { DotGrid, dotGridPresets } from './shaders/dot-grid.js';\nexport type { DotGridProps } from './shaders/dot-grid.js';\nexport type { DotGridUniforms, DotGridParams } from '@paper-design/shaders';\n\nexport { SimplexNoise, simplexNoisePresets } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseProps } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseUniforms, SimplexNoiseParams } from '@paper-design/shaders';\n\nexport { Metaballs, metaballsPresets } from './shaders/metaballs.js';\nexport type { MetaballsProps } from './shaders/metaballs.js';\nexport type { MetaballsUniforms, MetaballsParams } from '@paper-design/shaders';\n\nexport { Waves, wavesPresets } from './shaders/waves.js';\nexport type { WavesProps } from './shaders/waves.js';\nexport type { WavesUniforms, WavesParams } from '@paper-design/shaders';\n\nexport { PerlinNoise, perlinNoisePresets } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseProps } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseUniforms, PerlinNoiseParams } from '@paper-design/shaders';\n\nexport { Voronoi, voronoiPresets } from './shaders/voronoi.js';\nexport type { VoronoiProps } from './shaders/voronoi.js';\nexport type { VoronoiUniforms, VoronoiParams } from '@paper-design/shaders';\n\nexport { Warp, warpPresets } from './shaders/warp.js';\nexport type { WarpProps } from './shaders/warp.js';\nexport type { WarpUniforms, WarpParams, WarpPattern } from '@paper-design/shaders';\n\nexport { GodRays, godRaysPresets } from './shaders/god-rays.js';\nexport type { GodRaysProps } from './shaders/god-rays.js';\nexport type { GodRaysUniforms, GodRaysParams } from '@paper-design/shaders';\n\nexport { Spiral, spiralPresets } from './shaders/spiral.js';\nexport type { SpiralProps } from './shaders/spiral.js';\nexport type { SpiralUniforms, SpiralParams } from '@paper-design/shaders';\n\nexport { Swirl, swirlPresets } from './shaders/swirl.js';\nexport type { SwirlProps } from './shaders/swirl.js';\nexport type { SwirlUniforms, SwirlParams } from '@paper-design/shaders';\n\nexport { Dithering, ditheringPresets } from './shaders/dithering.js';\nexport type { DitheringProps } from './shaders/dithering.js';\nexport type { DitheringUniforms, DitheringParams } from '@paper-design/shaders';\n\nexport { GrainGradient, grainGradientPresets } from './shaders/grain-gradient.js';\nexport type { GrainGradientProps } from './shaders/grain-gradient.js';\nexport type { GrainGradientUniforms, GrainGradientParams } from '@paper-design/shaders';\n\nexport { PulsingBorder, pulsingBorderPresets } from './shaders/pulsing-border.js';\nexport type { PulsingBorderProps } from './shaders/pulsing-border.js';\nexport type { PulsingBorderUniforms, PulsingBorderParams } from '@paper-design/shaders';\n\nexport { ColorPanels, colorPanelsPresets } from './shaders/color-panels.js';\nexport type { ColorPanelsProps } from './shaders/color-panels.js';\nexport type { ColorPanelsUniforms, ColorPanelsParams } from '@paper-design/shaders';\n\nexport { StaticMeshGradient, staticMeshGradientPresets } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientProps } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientUniforms, StaticMeshGradientParams } from '@paper-design/shaders';\n\nexport { StaticRadialGradient, staticRadialGradientPresets } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientProps } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientUniforms, StaticRadialGradientParams } from '@paper-design/shaders';\n\nexport { PaperTexture, paperTexturePresets } from './shaders/paper-texture.js';\nexport type { PaperTextureProps } from './shaders/paper-texture.js';\nexport type { PaperTextureUniforms, PaperTextureParams } from '@paper-design/shaders';\n\nexport { FlutedGlass, flutedGlassPresets } from './shaders/fluted-glass.js';\nexport { type FlutedGlassProps } from './shaders/fluted-glass.js';\nexport { type FlutedGlassUniforms, type FlutedGlassParams } from '@paper-design/shaders';\n\nexport { Water, waterPresets } from './shaders/water.js';\nexport type { WaterProps } from './shaders/water.js';\nexport type { WaterUniforms, WaterParams } from '@paper-design/shaders';\n\nexport { ImageDithering, imageDitheringPresets } from './shaders/image-dithering.js';\nexport type { ImageDitheringProps } from './shaders/image-dithering.js';\nexport type { ImageDitheringUniforms, ImageDitheringParams } from '@paper-design/shaders';\n\nexport { Heatmap, heatmapPresets } from './shaders/heatmap.js';\nexport type { HeatmapProps } from './shaders/heatmap.js';\nexport type { HeatmapUniforms, HeatmapParams } from '@paper-design/shaders';\n\nexport { LiquidMetal, liquidMetalPresets } from './shaders/liquid-metal.js';\nexport type { LiquidMetalProps } from './shaders/liquid-metal.js';\nexport type { LiquidMetalUniforms, LiquidMetalParams } from '@paper-design/shaders';\n\nexport { HalftoneDots, halftoneDotsPresets } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsProps } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsUniforms, HalftoneDotsParams } from '@paper-design/shaders';\n\nexport { HalftoneCmyk, halftoneCmykPresets } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykProps } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykUniforms, HalftoneCmykParams } from '@paper-design/shaders';\n\nexport { GemSmoke, gemSmokePresets } from './shaders/gem-smoke.js';\nexport type { GemSmokeProps } from './shaders/gem-smoke.js';\nexport type { GemSmokeUniforms, GemSmokeParams } from '@paper-design/shaders';\n\nexport { isPaperShaderElement, getShaderColorFromString } from '@paper-design/shaders';\nexport type { PaperShaderElement, ShaderFit, ShaderSizingParams, ShaderSizingUniforms } from '@paper-design/shaders';\n\nexport {\n colorPanelsMeta,\n dotOrbitMeta,\n godRaysMeta,\n grainGradientMeta,\n meshGradientMeta,\n metaballsMeta,\n pulsingBorderMeta,\n simplexNoiseMeta,\n smokeRingMeta,\n swirlMeta,\n voronoiMeta,\n warpMeta,\n heatmapMeta,\n staticMeshGradientMeta,\n staticRadialGradientMeta,\n} from '@paper-design/shaders';\n"],
5
- "mappings": ";;;;;;AAEA,SAAS,mBAAmB;AAG5B,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,YAAY,yBAAyB;AAI9C,SAAS,UAAU,uBAAuB;AAI1C,SAAS,SAAS,sBAAsB;AAIxC,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,OAAO,oBAAoB;AAIpC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,MAAM,mBAAmB;AAIlC,SAAS,SAAS,sBAAsB;AAIxC,SAAS,QAAQ,qBAAqB;AAItC,SAAS,OAAO,oBAAoB;AAIpC,SAAS,WAAW,wBAAwB;AAI5C,SAAS,eAAe,4BAA4B;AAIpD,SAAS,eAAe,4BAA4B;AAIpD,SAAS,aAAa,0BAA0B;AAIhD,SAAS,oBAAoB,iCAAiC;AAI9D,SAAS,sBAAsB,mCAAmC;AAIlE,SAAS,cAAc,2BAA2B;AAIlD,SAAS,aAAa,0BAA0B;AAChD,eAAsC;AACtC,eAAiE;AAEjE,SAAS,OAAO,oBAAoB;AAIpC,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,UAAU,uBAAuB;AAI1C,SAAS,sBAAsB,gCAAgC;AAG/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
4
+ "sourcesContent": ["'use client';\n\nexport { ShaderMount } from './shader-mount.js';\nexport type { ShaderMountProps, ShaderComponentProps } from './shader-mount.js';\n\nexport { MeshGradient, meshGradientPresets } from './shaders/mesh-gradient.js';\nexport type { MeshGradientProps } from './shaders/mesh-gradient.js';\nexport type { MeshGradientUniforms, MeshGradientParams } from '@paper-design/shaders';\n\nexport { SmokeRing, smokeRingPresets } from './shaders/smoke-ring.js';\nexport type { SmokeRingProps } from './shaders/smoke-ring.js';\nexport type { SmokeRingUniforms, SmokeRingParams } from '@paper-design/shaders';\n\nexport { NeuroNoise, neuroNoisePresets } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseProps } from './shaders/neuro-noise.js';\nexport type { NeuroNoiseUniforms, NeuroNoiseParams } from '@paper-design/shaders';\n\nexport { DotOrbit, dotOrbitPresets } from './shaders/dot-orbit.js';\nexport type { DotOrbitProps } from './shaders/dot-orbit.js';\nexport type { DotOrbitUniforms, DotOrbitParams } from '@paper-design/shaders';\n\nexport { DotGrid, dotGridPresets } from './shaders/dot-grid.js';\nexport type { DotGridProps } from './shaders/dot-grid.js';\nexport type { DotGridUniforms, DotGridParams } from '@paper-design/shaders';\n\nexport { SimplexNoise, simplexNoisePresets } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseProps } from './shaders/simplex-noise.js';\nexport type { SimplexNoiseUniforms, SimplexNoiseParams } from '@paper-design/shaders';\n\nexport { Metaballs, metaballsPresets } from './shaders/metaballs.js';\nexport type { MetaballsProps } from './shaders/metaballs.js';\nexport type { MetaballsUniforms, MetaballsParams } from '@paper-design/shaders';\n\nexport { Waves, wavesPresets } from './shaders/waves.js';\nexport type { WavesProps } from './shaders/waves.js';\nexport type { WavesUniforms, WavesParams } from '@paper-design/shaders';\n\nexport { PerlinNoise, perlinNoisePresets } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseProps } from './shaders/perlin-noise.js';\nexport type { PerlinNoiseUniforms, PerlinNoiseParams } from '@paper-design/shaders';\n\nexport { Voronoi, voronoiPresets } from './shaders/voronoi.js';\nexport type { VoronoiProps } from './shaders/voronoi.js';\nexport type { VoronoiUniforms, VoronoiParams } from '@paper-design/shaders';\n\nexport { Warp, warpPresets } from './shaders/warp.js';\nexport type { WarpProps } from './shaders/warp.js';\nexport type { WarpUniforms, WarpParams, WarpPattern } from '@paper-design/shaders';\n\nexport { GodRays, godRaysPresets } from './shaders/god-rays.js';\nexport type { GodRaysProps } from './shaders/god-rays.js';\nexport type { GodRaysUniforms, GodRaysParams } from '@paper-design/shaders';\n\nexport { Spiral, spiralPresets } from './shaders/spiral.js';\nexport type { SpiralProps } from './shaders/spiral.js';\nexport type { SpiralUniforms, SpiralParams } from '@paper-design/shaders';\n\nexport { Swirl, swirlPresets } from './shaders/swirl.js';\nexport type { SwirlProps } from './shaders/swirl.js';\nexport type { SwirlUniforms, SwirlParams } from '@paper-design/shaders';\n\nexport { Dithering, ditheringPresets } from './shaders/dithering.js';\nexport type { DitheringProps } from './shaders/dithering.js';\nexport type { DitheringUniforms, DitheringParams } from '@paper-design/shaders';\n\nexport { GrainGradient, grainGradientPresets } from './shaders/grain-gradient.js';\nexport type { GrainGradientProps } from './shaders/grain-gradient.js';\nexport type { GrainGradientUniforms, GrainGradientParams } from '@paper-design/shaders';\n\nexport { PulsingBorder, pulsingBorderPresets } from './shaders/pulsing-border.js';\nexport type { PulsingBorderProps } from './shaders/pulsing-border.js';\nexport type { PulsingBorderUniforms, PulsingBorderParams } from '@paper-design/shaders';\n\nexport { ColorPanels, colorPanelsPresets } from './shaders/color-panels.js';\nexport type { ColorPanelsProps } from './shaders/color-panels.js';\nexport type { ColorPanelsUniforms, ColorPanelsParams } from '@paper-design/shaders';\n\nexport { StaticMeshGradient, staticMeshGradientPresets } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientProps } from './shaders/static-mesh-gradient.js';\nexport type { StaticMeshGradientUniforms, StaticMeshGradientParams } from '@paper-design/shaders';\n\nexport { StaticRadialGradient, staticRadialGradientPresets } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientProps } from './shaders/static-radial-gradient.js';\nexport type { StaticRadialGradientUniforms, StaticRadialGradientParams } from '@paper-design/shaders';\n\nexport { PaperTexture, paperTexturePresets } from './shaders/paper-texture.js';\nexport type { PaperTextureProps } from './shaders/paper-texture.js';\nexport type { PaperTextureUniforms, PaperTextureParams } from '@paper-design/shaders';\n\nexport { FlutedGlass, flutedGlassPresets } from './shaders/fluted-glass.js';\nexport { type FlutedGlassProps } from './shaders/fluted-glass.js';\nexport { type FlutedGlassUniforms, type FlutedGlassParams } from '@paper-design/shaders';\n\nexport { Water, waterPresets } from './shaders/water.js';\nexport type { WaterProps } from './shaders/water.js';\nexport type { WaterUniforms, WaterParams } from '@paper-design/shaders';\n\nexport { ImageDithering, imageDitheringPresets } from './shaders/image-dithering.js';\nexport type { ImageDitheringProps } from './shaders/image-dithering.js';\nexport type { ImageDitheringUniforms, ImageDitheringParams } from '@paper-design/shaders';\n\nexport { LensDistortion, lensDistortionPresets } from './shaders/lens-distortion.js';\nexport type { LensDistortionProps } from './shaders/lens-distortion.js';\nexport type { LensDistortionUniforms, LensDistortionParams } from '@paper-design/shaders';\n\nexport { Heatmap, heatmapPresets } from './shaders/heatmap.js';\nexport type { HeatmapProps } from './shaders/heatmap.js';\nexport type { HeatmapUniforms, HeatmapParams } from '@paper-design/shaders';\n\nexport { LiquidMetal, liquidMetalPresets } from './shaders/liquid-metal.js';\nexport type { LiquidMetalProps } from './shaders/liquid-metal.js';\nexport type { LiquidMetalUniforms, LiquidMetalParams } from '@paper-design/shaders';\n\nexport { HalftoneDots, halftoneDotsPresets } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsProps } from './shaders/halftone-dots.js';\nexport type { HalftoneDotsUniforms, HalftoneDotsParams } from '@paper-design/shaders';\n\nexport { HalftoneCmyk, halftoneCmykPresets } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykProps } from './shaders/halftone-cmyk.js';\nexport type { HalftoneCmykUniforms, HalftoneCmykParams } from '@paper-design/shaders';\n\nexport { GemSmoke, gemSmokePresets } from './shaders/gem-smoke.js';\nexport type { GemSmokeProps } from './shaders/gem-smoke.js';\nexport type { GemSmokeUniforms, GemSmokeParams } from '@paper-design/shaders';\n\nexport { isPaperShaderElement, getShaderColorFromString } from '@paper-design/shaders';\nexport type { PaperShaderElement, ShaderFit, ShaderSizingParams, ShaderSizingUniforms } from '@paper-design/shaders';\n\nexport {\n colorPanelsMeta,\n dotOrbitMeta,\n godRaysMeta,\n grainGradientMeta,\n meshGradientMeta,\n metaballsMeta,\n pulsingBorderMeta,\n simplexNoiseMeta,\n smokeRingMeta,\n swirlMeta,\n voronoiMeta,\n warpMeta,\n heatmapMeta,\n lensDistortionMeta,\n staticMeshGradientMeta,\n staticRadialGradientMeta,\n} from '@paper-design/shaders';\n"],
5
+ "mappings": ";;;;;;AAEA,SAAS,mBAAmB;AAG5B,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,YAAY,yBAAyB;AAI9C,SAAS,UAAU,uBAAuB;AAI1C,SAAS,SAAS,sBAAsB;AAIxC,SAAS,cAAc,2BAA2B;AAIlD,SAAS,WAAW,wBAAwB;AAI5C,SAAS,OAAO,oBAAoB;AAIpC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,MAAM,mBAAmB;AAIlC,SAAS,SAAS,sBAAsB;AAIxC,SAAS,QAAQ,qBAAqB;AAItC,SAAS,OAAO,oBAAoB;AAIpC,SAAS,WAAW,wBAAwB;AAI5C,SAAS,eAAe,4BAA4B;AAIpD,SAAS,eAAe,4BAA4B;AAIpD,SAAS,aAAa,0BAA0B;AAIhD,SAAS,oBAAoB,iCAAiC;AAI9D,SAAS,sBAAsB,mCAAmC;AAIlE,SAAS,cAAc,2BAA2B;AAIlD,SAAS,aAAa,0BAA0B;AAChD,eAAsC;AACtC,eAAiE;AAEjE,SAAS,OAAO,oBAAoB;AAIpC,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,gBAAgB,6BAA6B;AAItD,SAAS,SAAS,sBAAsB;AAIxC,SAAS,aAAa,0BAA0B;AAIhD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,cAAc,2BAA2B;AAIlD,SAAS,UAAU,uBAAuB;AAI1C,SAAS,sBAAsB,gCAAgC;AAG/D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -58,8 +58,11 @@ async function processUniforms(uniformsProp) {
58
58
  });
59
59
  imageLoadPromises.push(imagePromise);
60
60
  } else if (value instanceof HTMLImageElement) {
61
- setMinImageSize(value);
62
- processedUniforms[key] = value;
61
+ const imagePromise = value.decode().then(() => {
62
+ setMinImageSize(value);
63
+ processedUniforms[key] = value;
64
+ });
65
+ imageLoadPromises.push(imagePromise);
63
66
  } else {
64
67
  processedUniforms[key] = value;
65
68
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/shader-mount.tsx"],
4
- "sourcesContent": ["'use client';\n\nimport { useEffect, useRef, forwardRef, useState } from 'react';\nimport {\n ShaderMount as ShaderMountVanilla,\n emptyPixel,\n type PaperShaderElement,\n type ShaderMotionParams,\n type ShaderMountUniforms,\n} from '@paper-design/shaders';\nimport { useMergeRefs } from './use-merge-refs.js';\nimport { setMinImageSize } from './set-min-image-size.js';\n\n/**\n * React Shader Mount can also accept strings as uniform values, which will assumed to be URLs and loaded as images\n *\n * We accept undefined as a convenience for server rendering, when some things may be undefined\n * We just skip setting the uniform if it's undefined. This allows the shader mount to still take up space during server rendering\n */\ninterface ShaderMountUniformsReact {\n [key: string]: string | boolean | number | number[] | number[][] | HTMLImageElement | undefined;\n}\n\nexport interface ShaderMountProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'>, ShaderMotionParams {\n ref?: React.Ref<PaperShaderElement>;\n fragmentShader: string;\n uniforms: ShaderMountUniformsReact;\n mipmaps?: string[];\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\nexport interface ShaderComponentProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'> {\n ref?: React.Ref<PaperShaderElement>;\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\n/** Parse the provided uniforms, turning URL strings into loaded images */\nasync function processUniforms(uniformsProp: ShaderMountUniformsReact): Promise<ShaderMountUniforms> {\n const processedUniforms = {} as ShaderMountUniforms;\n const imageLoadPromises: Promise<void>[] = [];\n\n const isValidUrl = (url: string): boolean => {\n try {\n // Handle absolute paths\n if (url.startsWith('/')) return true;\n // Check if it's a valid URL\n new URL(url);\n return true;\n } catch {\n return false;\n }\n };\n\n const isExternalUrl = (url: string): boolean => {\n try {\n if (url.startsWith('/')) return false;\n const urlObject = new URL(url, window.location.origin);\n return urlObject.origin !== window.location.origin;\n } catch {\n return false;\n }\n };\n\n Object.entries(uniformsProp).forEach(([key, value]) => {\n if (typeof value === 'string') {\n // Use a transparent pixel for empty strings\n const url = value || emptyPixel;\n\n // Make sure the provided string is a valid URL or just skip trying to set this uniform entirely\n if (!isValidUrl(url)) {\n console.warn(`Uniform \"${key}\" has invalid URL \"${url}\". Skipping image loading.`);\n return;\n }\n\n const imagePromise = new Promise<void>((resolve, reject) => {\n const img = new Image();\n if (isExternalUrl(url)) {\n img.crossOrigin = 'anonymous';\n }\n img.onload = () => {\n setMinImageSize(img);\n processedUniforms[key] = img;\n resolve();\n };\n img.onerror = () => {\n console.error(`Could not set uniforms. Failed to load image at ${url}`);\n reject();\n };\n img.src = url;\n });\n\n imageLoadPromises.push(imagePromise);\n } else if (value instanceof HTMLImageElement) {\n setMinImageSize(value);\n processedUniforms[key] = value;\n } else {\n processedUniforms[key] = value;\n }\n });\n\n await Promise.all(imageLoadPromises);\n return processedUniforms;\n}\n\n/**\n * A React component that mounts a shader and updates its uniforms as the component's props change\n * If you pass a string as a uniform value, it will be assumed to be a URL and attempted to be loaded as an image\n */\nexport const ShaderMount: React.FC<ShaderMountProps> = forwardRef<PaperShaderElement, ShaderMountProps>(\n function ShaderMountImpl(\n {\n fragmentShader,\n uniforms: uniformsProp,\n webGlContextAttributes,\n speed = 0,\n frame = 0,\n width,\n height,\n minPixelRatio,\n maxPixelCount,\n mipmaps,\n style,\n ...divProps\n },\n forwardedRef\n ) {\n const [isInitialized, setIsInitialized] = useState(false);\n const divRef = useRef<PaperShaderElement>(null);\n const shaderMountRef: React.RefObject<ShaderMountVanilla | null> = useRef<ShaderMountVanilla>(null);\n const webGlContextAttributesRef = useRef(webGlContextAttributes);\n\n // Initialize the ShaderMountVanilla\n useEffect(() => {\n const initShader = async () => {\n const uniforms = await processUniforms(uniformsProp);\n\n if (divRef.current && !shaderMountRef.current) {\n shaderMountRef.current = new ShaderMountVanilla(\n divRef.current,\n fragmentShader,\n uniforms,\n webGlContextAttributesRef.current,\n speed,\n frame,\n minPixelRatio,\n maxPixelCount,\n mipmaps\n );\n\n setIsInitialized(true);\n }\n };\n\n initShader();\n\n return () => {\n shaderMountRef.current?.dispose();\n shaderMountRef.current = null;\n };\n }, [fragmentShader]);\n\n // Uniforms\n useEffect(() => {\n let isStale = false;\n\n const updateUniforms = async () => {\n const uniforms = await processUniforms(uniformsProp);\n\n if (!isStale) {\n // We only use the freshest uniforms otherwise we can get into race conditions\n // if some uniforms (images!) take longer to load in subsequent effect runs.\n shaderMountRef.current?.setUniforms(uniforms);\n }\n };\n\n updateUniforms();\n\n return () => {\n isStale = true;\n };\n }, [uniformsProp, isInitialized]);\n\n // Speed\n useEffect(() => {\n shaderMountRef.current?.setSpeed(speed);\n }, [speed, isInitialized]);\n\n // Max Pixel Count\n useEffect(() => {\n shaderMountRef.current?.setMaxPixelCount(maxPixelCount);\n }, [maxPixelCount, isInitialized]);\n\n // Min Pixel Ratio\n useEffect(() => {\n shaderMountRef.current?.setMinPixelRatio(minPixelRatio);\n }, [minPixelRatio, isInitialized]);\n\n // Frame\n useEffect(() => {\n shaderMountRef.current?.setFrame(frame);\n }, [frame, isInitialized]);\n\n const mergedRef = useMergeRefs([divRef, forwardedRef]) as unknown as React.RefObject<HTMLDivElement>;\n return (\n <div\n ref={mergedRef}\n style={\n width !== undefined || height !== undefined\n ? {\n width: typeof width === 'string' && isNaN(+width) === false ? +width : width,\n height: typeof height === 'string' && isNaN(+height) === false ? +height : height,\n ...style,\n }\n : style\n }\n {...divProps}\n />\n );\n }\n);\n\nShaderMount.displayName = 'ShaderMount';\n"],
5
- "mappings": ";;;;;;AAEA,SAAS,WAAW,QAAQ,YAAY,gBAAgB;AACxD;AAAA,EACE,eAAe;AAAA,EACf;AAAA,OAIK;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AA+M1B;AAvKN,eAAe,gBAAgB,cAAsE;AACnG,QAAM,oBAAoB,CAAC;AAC3B,QAAM,oBAAqC,CAAC;AAE5C,QAAM,aAAa,CAAC,QAAyB;AAC3C,QAAI;AAEF,UAAI,IAAI,WAAW,GAAG,EAAG,QAAO;AAEhC,UAAI,IAAI,GAAG;AACX,aAAO;AAAA,IACT,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,gBAAgB,CAAC,QAAyB;AAC9C,QAAI;AACF,UAAI,IAAI,WAAW,GAAG,EAAG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a,CAAC,QAAQ,YAAY,CAAC;AACrD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,QACL,OACE,UAAU,UAAa,WAAW,SAC9B;AAAA,UACE,OAAO,OAAO,UAAU,YAAY,MAAM,CAAC,KAAK,MAAM,QAAQ,CAAC,QAAQ;AAAA,UACvE,QAAQ,OAAO,WAAW,YAAY,MAAM,CAAC,MAAM,MAAM,QAAQ,CAAC,SAAS;AAAA,UAC3E,GAAG;AAAA,QACL,IACA;AAAA,QAEL,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;",
4
+ "sourcesContent": ["'use client';\n\nimport { useEffect, useRef, forwardRef, useState } from 'react';\nimport {\n ShaderMount as ShaderMountVanilla,\n emptyPixel,\n type PaperShaderElement,\n type ShaderMotionParams,\n type ShaderMountUniforms,\n} from '@paper-design/shaders';\nimport { useMergeRefs } from './use-merge-refs.js';\nimport { setMinImageSize } from './set-min-image-size.js';\n\n/**\n * React Shader Mount can also accept strings as uniform values, which will assumed to be URLs and loaded as images\n *\n * We accept undefined as a convenience for server rendering, when some things may be undefined\n * We just skip setting the uniform if it's undefined. This allows the shader mount to still take up space during server rendering\n */\ninterface ShaderMountUniformsReact {\n [key: string]: string | boolean | number | number[] | number[][] | HTMLImageElement | undefined;\n}\n\nexport interface ShaderMountProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'>, ShaderMotionParams {\n ref?: React.Ref<PaperShaderElement>;\n fragmentShader: string;\n uniforms: ShaderMountUniformsReact;\n mipmaps?: string[];\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\nexport interface ShaderComponentProps extends Omit<React.ComponentProps<'div'>, 'color' | 'ref'> {\n ref?: React.Ref<PaperShaderElement>;\n minPixelRatio?: number;\n maxPixelCount?: number;\n webGlContextAttributes?: WebGLContextAttributes;\n\n /** Inline CSS width style */\n width?: string | number;\n /** Inline CSS height style */\n height?: string | number;\n}\n\n/** Parse the provided uniforms, turning URL strings into loaded images */\nasync function processUniforms(uniformsProp: ShaderMountUniformsReact): Promise<ShaderMountUniforms> {\n const processedUniforms = {} as ShaderMountUniforms;\n const imageLoadPromises: Promise<void>[] = [];\n\n const isValidUrl = (url: string): boolean => {\n try {\n // Handle absolute paths\n if (url.startsWith('/')) return true;\n // Check if it's a valid URL\n new URL(url);\n return true;\n } catch {\n return false;\n }\n };\n\n const isExternalUrl = (url: string): boolean => {\n try {\n if (url.startsWith('/')) return false;\n const urlObject = new URL(url, window.location.origin);\n return urlObject.origin !== window.location.origin;\n } catch {\n return false;\n }\n };\n\n Object.entries(uniformsProp).forEach(([key, value]) => {\n if (typeof value === 'string') {\n // Use a transparent pixel for empty strings\n const url = value || emptyPixel;\n\n // Make sure the provided string is a valid URL or just skip trying to set this uniform entirely\n if (!isValidUrl(url)) {\n console.warn(`Uniform \"${key}\" has invalid URL \"${url}\". Skipping image loading.`);\n return;\n }\n\n const imagePromise = new Promise<void>((resolve, reject) => {\n const img = new Image();\n if (isExternalUrl(url)) {\n img.crossOrigin = 'anonymous';\n }\n img.onload = () => {\n setMinImageSize(img);\n processedUniforms[key] = img;\n resolve();\n };\n img.onerror = () => {\n console.error(`Could not set uniforms. Failed to load image at ${url}`);\n reject();\n };\n img.src = url;\n });\n\n imageLoadPromises.push(imagePromise);\n } else if (value instanceof HTMLImageElement) {\n const imagePromise = value.decode().then(() => {\n setMinImageSize(value);\n processedUniforms[key] = value;\n });\n imageLoadPromises.push(imagePromise);\n } else {\n processedUniforms[key] = value;\n }\n });\n\n await Promise.all(imageLoadPromises);\n return processedUniforms;\n}\n\n/**\n * A React component that mounts a shader and updates its uniforms as the component's props change\n * If you pass a string as a uniform value, it will be assumed to be a URL and attempted to be loaded as an image\n */\nexport const ShaderMount: React.FC<ShaderMountProps> = forwardRef<PaperShaderElement, ShaderMountProps>(\n function ShaderMountImpl(\n {\n fragmentShader,\n uniforms: uniformsProp,\n webGlContextAttributes,\n speed = 0,\n frame = 0,\n width,\n height,\n minPixelRatio,\n maxPixelCount,\n mipmaps,\n style,\n ...divProps\n },\n forwardedRef\n ) {\n const [isInitialized, setIsInitialized] = useState(false);\n const divRef = useRef<PaperShaderElement>(null);\n const shaderMountRef: React.RefObject<ShaderMountVanilla | null> = useRef<ShaderMountVanilla>(null);\n const webGlContextAttributesRef = useRef(webGlContextAttributes);\n\n // Initialize the ShaderMountVanilla\n useEffect(() => {\n const initShader = async () => {\n const uniforms = await processUniforms(uniformsProp);\n\n if (divRef.current && !shaderMountRef.current) {\n shaderMountRef.current = new ShaderMountVanilla(\n divRef.current,\n fragmentShader,\n uniforms,\n webGlContextAttributesRef.current,\n speed,\n frame,\n minPixelRatio,\n maxPixelCount,\n mipmaps\n );\n\n setIsInitialized(true);\n }\n };\n\n initShader();\n\n return () => {\n shaderMountRef.current?.dispose();\n shaderMountRef.current = null;\n };\n }, [fragmentShader]);\n\n // Uniforms\n useEffect(() => {\n let isStale = false;\n\n const updateUniforms = async () => {\n const uniforms = await processUniforms(uniformsProp);\n\n if (!isStale) {\n // We only use the freshest uniforms otherwise we can get into race conditions\n // if some uniforms (images!) take longer to load in subsequent effect runs.\n shaderMountRef.current?.setUniforms(uniforms);\n }\n };\n\n updateUniforms();\n\n return () => {\n isStale = true;\n };\n }, [uniformsProp, isInitialized]);\n\n // Speed\n useEffect(() => {\n shaderMountRef.current?.setSpeed(speed);\n }, [speed, isInitialized]);\n\n // Max Pixel Count\n useEffect(() => {\n shaderMountRef.current?.setMaxPixelCount(maxPixelCount);\n }, [maxPixelCount, isInitialized]);\n\n // Min Pixel Ratio\n useEffect(() => {\n shaderMountRef.current?.setMinPixelRatio(minPixelRatio);\n }, [minPixelRatio, isInitialized]);\n\n // Frame\n useEffect(() => {\n shaderMountRef.current?.setFrame(frame);\n }, [frame, isInitialized]);\n\n const mergedRef = useMergeRefs([divRef, forwardedRef]) as unknown as React.RefObject<HTMLDivElement>;\n return (\n <div\n ref={mergedRef}\n style={\n width !== undefined || height !== undefined\n ? {\n width: typeof width === 'string' && isNaN(+width) === false ? +width : width,\n height: typeof height === 'string' && isNaN(+height) === false ? +height : height,\n ...style,\n }\n : style\n }\n {...divProps}\n />\n );\n }\n);\n\nShaderMount.displayName = 'ShaderMount';\n"],
5
+ "mappings": ";;;;;;AAEA,SAAS,WAAW,QAAQ,YAAY,gBAAgB;AACxD;AAAA,EACE,eAAe;AAAA,EACf;AAAA,OAIK;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAkN1B;AA1KN,eAAe,gBAAgB,cAAsE;AACnG,QAAM,oBAAoB,CAAC;AAC3B,QAAM,oBAAqC,CAAC;AAE5C,QAAM,aAAa,CAAC,QAAyB;AAC3C,QAAI;AAEF,UAAI,IAAI,WAAW,GAAG,EAAG,QAAO;AAEhC,UAAI,IAAI,GAAG;AACX,aAAO;AAAA,IACT,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,gBAAgB,CAAC,QAAyB;AAC9C,QAAI;AACF,UAAI,IAAI,WAAW,GAAG,EAAG,QAAO;AAChC,YAAM,YAAY,IAAI,IAAI,KAAK,OAAO,SAAS,MAAM;AACrD,aAAO,UAAU,WAAW,OAAO,SAAS;AAAA,IAC9C,QAAQ;AACN,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,QAAQ,YAAY,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACrD,QAAI,OAAO,UAAU,UAAU;AAE7B,YAAM,MAAM,SAAS;AAGrB,UAAI,CAAC,WAAW,GAAG,GAAG;AACpB,gBAAQ,KAAK,YAAY,GAAG,sBAAsB,GAAG,4BAA4B;AACjF;AAAA,MACF;AAEA,YAAM,eAAe,IAAI,QAAc,CAAC,SAAS,WAAW;AAC1D,cAAM,MAAM,IAAI,MAAM;AACtB,YAAI,cAAc,GAAG,GAAG;AACtB,cAAI,cAAc;AA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
1
+ import { type ShaderComponentProps } from '../shader-mount.js';
2
+ import { type LensDistortionParams, type ImageShaderPreset } from '@paper-design/shaders';
3
+ export interface LensDistortionProps extends ShaderComponentProps, LensDistortionParams {
4
+ }
5
+ type LensDistortionPreset = ImageShaderPreset<LensDistortionParams>;
6
+ export declare const defaultPreset: LensDistortionPreset;
7
+ export declare const fisheyePreset: LensDistortionPreset;
8
+ export declare const duotonePreset: LensDistortionPreset;
9
+ export declare const smokePreset: LensDistortionPreset;
10
+ export declare const lensDistortionPresets: LensDistortionPreset[];
11
+ export declare const LensDistortion: React.FC<LensDistortionProps>;
12
+ export {};
@@ -0,0 +1,231 @@
1
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
+ * Paper Shaders *
3
+ * https://github.com/paper-design/shaders *
4
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * */
5
+
6
+ import { memo } from "react";
7
+ import { ShaderMount } from "../shader-mount.js";
8
+ import { colorPropsAreEqual } from "../color-props-are-equal.js";
9
+ import {
10
+ lensDistortionFragmentShader,
11
+ ShaderFitOptions,
12
+ defaultObjectSizing
13
+ } from "@paper-design/shaders";
14
+ import { jsx } from "react/jsx-runtime";
15
+ const defaultPreset = {
16
+ name: "Default",
17
+ params: {
18
+ ...defaultObjectSizing,
19
+ scale: 1,
20
+ fit: "contain",
21
+ speed: 0,
22
+ frame: 0,
23
+ spread: 0.6,
24
+ bias: 1,
25
+ angle: 0,
26
+ perspective: 0.1,
27
+ count: 35,
28
+ dispersion: 1,
29
+ dispersionShift: 0,
30
+ dispersionColor: 0.6,
31
+ focusCenter: 0.8,
32
+ focusEdges: 1,
33
+ swirl: 0.35,
34
+ noise: 0,
35
+ noiseFrequency: 0.25,
36
+ noiseOffset: 0,
37
+ lensBulge: 0,
38
+ lensCircle: 0,
39
+ grainMixer: 0,
40
+ grainOverlay: 0,
41
+ imageX: 0,
42
+ imageY: 0
43
+ }
44
+ };
45
+ const fisheyePreset = {
46
+ name: "Fisheye",
47
+ params: {
48
+ ...defaultObjectSizing,
49
+ scale: 1,
50
+ fit: "contain",
51
+ speed: 0,
52
+ frame: 0,
53
+ spread: 0.7,
54
+ bias: 1,
55
+ angle: 0,
56
+ perspective: 0.75,
57
+ count: 15,
58
+ dispersion: 1,
59
+ dispersionShift: 0,
60
+ dispersionColor: 0.7,
61
+ focusCenter: 0.9,
62
+ focusEdges: 1,
63
+ swirl: 1,
64
+ noise: 0,
65
+ noiseFrequency: 0.25,
66
+ noiseOffset: 0,
67
+ lensBulge: 0.95,
68
+ lensCircle: 1,
69
+ grainMixer: 0.5,
70
+ grainOverlay: 0,
71
+ imageX: 0,
72
+ imageY: 0
73
+ }
74
+ };
75
+ const duotonePreset = {
76
+ name: "Duotone",
77
+ params: {
78
+ ...defaultObjectSizing,
79
+ fit: "contain",
80
+ speed: 0,
81
+ frame: 0,
82
+ spread: 0.1,
83
+ bias: 0,
84
+ angle: 0,
85
+ perspective: 0,
86
+ count: 2,
87
+ dispersion: 1,
88
+ dispersionShift: 0,
89
+ dispersionColor: 0.1,
90
+ focusCenter: 0,
91
+ focusEdges: 0,
92
+ swirl: 0,
93
+ noise: 0,
94
+ noiseFrequency: 0.25,
95
+ noiseOffset: 0,
96
+ lensBulge: 0,
97
+ lensCircle: 0,
98
+ grainMixer: 0.1,
99
+ grainOverlay: 0.3,
100
+ imageX: 0,
101
+ imageY: 0
102
+ }
103
+ };
104
+ const smokePreset = {
105
+ name: "Smoke",
106
+ params: {
107
+ ...defaultObjectSizing,
108
+ scale: 1,
109
+ fit: "contain",
110
+ speed: 0,
111
+ frame: 0,
112
+ spread: 0.65,
113
+ bias: -1,
114
+ angle: 0,
115
+ perspective: 0.4,
116
+ count: 50,
117
+ dispersion: 0,
118
+ dispersionShift: 0,
119
+ dispersionColor: 0.31,
120
+ focusCenter: 0,
121
+ focusEdges: 0.6,
122
+ swirl: 0,
123
+ noise: 1,
124
+ noiseFrequency: 0.35,
125
+ noiseOffset: 9,
126
+ lensBulge: 0,
127
+ lensCircle: 0,
128
+ grainMixer: 0,
129
+ grainOverlay: 0,
130
+ imageX: 0,
131
+ imageY: 0
132
+ }
133
+ };
134
+ const lensDistortionPresets = [
135
+ defaultPreset,
136
+ fisheyePreset,
137
+ duotonePreset,
138
+ smokePreset
139
+ ];
140
+ const LensDistortion = memo(function LensDistortionImpl({
141
+ // Own props
142
+ speed = defaultPreset.params.speed,
143
+ frame = defaultPreset.params.frame,
144
+ image = "",
145
+ spread = defaultPreset.params.spread,
146
+ bias = defaultPreset.params.bias,
147
+ angle = defaultPreset.params.angle,
148
+ perspective = defaultPreset.params.perspective,
149
+ count = defaultPreset.params.count,
150
+ dispersion = defaultPreset.params.dispersion,
151
+ dispersionShift = defaultPreset.params.dispersionShift,
152
+ dispersionColor = defaultPreset.params.dispersionColor,
153
+ focusCenter = defaultPreset.params.focusCenter,
154
+ focusEdges = defaultPreset.params.focusEdges,
155
+ swirl = defaultPreset.params.swirl,
156
+ noise = defaultPreset.params.noise,
157
+ noiseFrequency = defaultPreset.params.noiseFrequency,
158
+ noiseOffset = defaultPreset.params.noiseOffset,
159
+ lensBulge = defaultPreset.params.lensBulge,
160
+ lensCircle = defaultPreset.params.lensCircle,
161
+ grainMixer = defaultPreset.params.grainMixer,
162
+ grainOverlay = defaultPreset.params.grainOverlay,
163
+ imageX = defaultPreset.params.imageX,
164
+ imageY = defaultPreset.params.imageY,
165
+ // Sizing props
166
+ fit = defaultPreset.params.fit,
167
+ scale = defaultPreset.params.scale,
168
+ rotation = defaultPreset.params.rotation,
169
+ originX = defaultPreset.params.originX,
170
+ originY = defaultPreset.params.originY,
171
+ offsetX = defaultPreset.params.offsetX,
172
+ offsetY = defaultPreset.params.offsetY,
173
+ worldWidth = defaultPreset.params.worldWidth,
174
+ worldHeight = defaultPreset.params.worldHeight,
175
+ ...props
176
+ }) {
177
+ const uniforms = {
178
+ // Own uniforms
179
+ u_image: image,
180
+ u_spread: spread,
181
+ u_bias: bias,
182
+ u_angle: angle,
183
+ u_perspective: perspective,
184
+ u_count: count,
185
+ u_dispersion: dispersion,
186
+ u_dispersionShift: dispersionShift,
187
+ u_dispersionColor: dispersionColor,
188
+ u_focusCenter: focusCenter,
189
+ u_focusEdges: focusEdges,
190
+ u_swirl: swirl,
191
+ u_noise: noise,
192
+ u_noiseFrequency: noiseFrequency,
193
+ u_noiseOffset: noiseOffset,
194
+ u_lensBulge: lensBulge,
195
+ u_lensCircle: lensCircle,
196
+ u_grainMixer: grainMixer,
197
+ u_grainOverlay: grainOverlay,
198
+ u_imageX: imageX,
199
+ u_imageY: imageY,
200
+ // Sizing uniforms
201
+ u_fit: ShaderFitOptions[fit],
202
+ u_rotation: rotation,
203
+ u_scale: scale,
204
+ u_offsetX: offsetX,
205
+ u_offsetY: offsetY,
206
+ u_originX: originX,
207
+ u_originY: originY,
208
+ u_worldWidth: worldWidth,
209
+ u_worldHeight: worldHeight
210
+ };
211
+ return /* @__PURE__ */ jsx(
212
+ ShaderMount,
213
+ {
214
+ ...props,
215
+ speed,
216
+ frame,
217
+ fragmentShader: lensDistortionFragmentShader,
218
+ mipmaps: ["u_image"],
219
+ uniforms
220
+ }
221
+ );
222
+ }, colorPropsAreEqual);
223
+ export {
224
+ LensDistortion,
225
+ defaultPreset,
226
+ duotonePreset,
227
+ fisheyePreset,
228
+ lensDistortionPresets,
229
+ smokePreset
230
+ };
231
+ //# sourceMappingURL=lens-distortion.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/shaders/lens-distortion.tsx"],
4
+ "sourcesContent": ["import { memo } from 'react';\nimport { ShaderMount, type ShaderComponentProps } from '../shader-mount.js';\nimport { colorPropsAreEqual } from '../color-props-are-equal.js';\nimport {\n lensDistortionFragmentShader,\n ShaderFitOptions,\n type LensDistortionUniforms,\n type LensDistortionParams,\n defaultObjectSizing,\n type ImageShaderPreset,\n} from '@paper-design/shaders';\n\nexport interface LensDistortionProps extends ShaderComponentProps, LensDistortionParams {}\n\ntype LensDistortionPreset = ImageShaderPreset<LensDistortionParams>;\n\nexport const defaultPreset: LensDistortionPreset = {\n name: 'Default',\n params: {\n ...defaultObjectSizing,\n scale: 1,\n fit: 'contain',\n speed: 0,\n frame: 0,\n spread: 0.6,\n bias: 1,\n angle: 0,\n perspective: 0.1,\n count: 35,\n dispersion: 1,\n dispersionShift: 0,\n dispersionColor: 0.6,\n focusCenter: 0.8,\n focusEdges: 1,\n swirl: 0.35,\n noise: 0,\n noiseFrequency: 0.25,\n noiseOffset: 0,\n lensBulge: 0,\n lensCircle: 0,\n grainMixer: 0,\n grainOverlay: 0,\n imageX: 0,\n imageY: 0,\n },\n} as const;\n\nexport const fisheyePreset: LensDistortionPreset = {\n name: 'Fisheye',\n params: {\n ...defaultObjectSizing,\n scale: 1,\n fit: 'contain',\n speed: 0,\n frame: 0,\n spread: 0.7,\n bias: 1,\n angle: 0,\n perspective: 0.75,\n count: 15,\n dispersion: 1,\n dispersionShift: 0,\n dispersionColor: 0.7,\n focusCenter: 0.9,\n focusEdges: 1,\n swirl: 1,\n noise: 0,\n noiseFrequency: 0.25,\n noiseOffset: 0,\n lensBulge: 0.95,\n lensCircle: 1,\n grainMixer: 0.5,\n grainOverlay: 0,\n imageX: 0,\n imageY: 0,\n },\n} as const;\n\nexport const duotonePreset: LensDistortionPreset = {\n name: 'Duotone',\n params: {\n ...defaultObjectSizing,\n fit: 'contain',\n speed: 0,\n frame: 0,\n spread: 0.1,\n bias: 0,\n angle: 0,\n perspective: 0,\n count: 2,\n dispersion: 1,\n dispersionShift: 0,\n dispersionColor: 0.1,\n focusCenter: 0,\n focusEdges: 0,\n swirl: 0,\n noise: 0,\n noiseFrequency: 0.25,\n noiseOffset: 0,\n lensBulge: 0,\n lensCircle: 0,\n grainMixer: 0.1,\n grainOverlay: 0.3,\n imageX: 0,\n imageY: 0,\n },\n} as const;\n\nexport const smokePreset: LensDistortionPreset = {\n name: 'Smoke',\n params: {\n ...defaultObjectSizing,\n scale: 1,\n fit: 'contain',\n speed: 0,\n frame: 0,\n spread: 0.65,\n bias: -1,\n angle: 0,\n perspective: 0.4,\n count: 50,\n dispersion: 0,\n dispersionShift: 0,\n dispersionColor: 0.31,\n focusCenter: 0,\n focusEdges: 0.6,\n swirl: 0,\n noise: 1,\n noiseFrequency: 0.35,\n noiseOffset: 9,\n lensBulge: 0,\n lensCircle: 0,\n grainMixer: 0,\n grainOverlay: 0,\n imageX: 0,\n imageY: 0,\n },\n} as const;\n\nexport const lensDistortionPresets: LensDistortionPreset[] = [\n defaultPreset,\n fisheyePreset,\n duotonePreset,\n smokePreset,\n];\n\nexport const LensDistortion: React.FC<LensDistortionProps> = memo(function LensDistortionImpl({\n // Own props\n speed = defaultPreset.params.speed,\n frame = defaultPreset.params.frame,\n image = '',\n spread = defaultPreset.params.spread,\n bias = defaultPreset.params.bias,\n angle = defaultPreset.params.angle,\n perspective = defaultPreset.params.perspective,\n count = defaultPreset.params.count,\n dispersion = defaultPreset.params.dispersion,\n dispersionShift = defaultPreset.params.dispersionShift,\n dispersionColor = defaultPreset.params.dispersionColor,\n focusCenter = defaultPreset.params.focusCenter,\n focusEdges = defaultPreset.params.focusEdges,\n swirl = defaultPreset.params.swirl,\n noise = defaultPreset.params.noise,\n noiseFrequency = defaultPreset.params.noiseFrequency,\n noiseOffset = defaultPreset.params.noiseOffset,\n lensBulge = defaultPreset.params.lensBulge,\n lensCircle = defaultPreset.params.lensCircle,\n grainMixer = defaultPreset.params.grainMixer,\n grainOverlay = defaultPreset.params.grainOverlay,\n imageX = defaultPreset.params.imageX,\n imageY = defaultPreset.params.imageY,\n\n // Sizing props\n fit = defaultPreset.params.fit,\n scale = defaultPreset.params.scale,\n rotation = defaultPreset.params.rotation,\n originX = defaultPreset.params.originX,\n originY = defaultPreset.params.originY,\n offsetX = defaultPreset.params.offsetX,\n offsetY = defaultPreset.params.offsetY,\n worldWidth = defaultPreset.params.worldWidth,\n worldHeight = defaultPreset.params.worldHeight,\n ...props\n}: LensDistortionProps) {\n const uniforms = {\n // Own uniforms\n u_image: image,\n u_spread: spread,\n u_bias: bias,\n u_angle: angle,\n u_perspective: perspective,\n u_count: count,\n u_dispersion: dispersion,\n u_dispersionShift: dispersionShift,\n u_dispersionColor: dispersionColor,\n u_focusCenter: focusCenter,\n u_focusEdges: focusEdges,\n u_swirl: swirl,\n u_noise: noise,\n u_noiseFrequency: noiseFrequency,\n u_noiseOffset: noiseOffset,\n u_lensBulge: lensBulge,\n u_lensCircle: lensCircle,\n u_grainMixer: grainMixer,\n u_grainOverlay: grainOverlay,\n u_imageX: imageX,\n u_imageY: imageY,\n\n // Sizing uniforms\n u_fit: ShaderFitOptions[fit],\n u_rotation: rotation,\n u_scale: scale,\n u_offsetX: offsetX,\n u_offsetY: offsetY,\n u_originX: originX,\n u_originY: originY,\n u_worldWidth: worldWidth,\n u_worldHeight: worldHeight,\n } satisfies LensDistortionUniforms;\n\n return (\n <ShaderMount\n {...props}\n speed={speed}\n frame={frame}\n fragmentShader={lensDistortionFragmentShader}\n mipmaps={['u_image']}\n uniforms={uniforms}\n />\n );\n}, colorPropsAreEqual);\n"],
5
+ "mappings": ";;;;;AAAA,SAAS,YAAY;AACrB,SAAS,mBAA8C;AACvD,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,OAEK;AAmNH;AA7MG,MAAM,gBAAsC;AAAA,EACjD,MAAM;AAAA,EACN,QAAQ;AAAA,IACN,GAAG;AAAA,IACH,OAAO;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,WAAW;AAAA,IACX,YA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Ac,OAAO;AAAA,EAC3B,QAAQ,cAAc,OAAO;AAAA,EAC7B,WAAW,cAAc,OAAO;AAAA,EAChC,UAAU,cAAc,OAAO;AAAA,EAC/B,UAAU,cAAc,OAAO;AAAA,EAC/B,UAAU,cAAc,OAAO;AAAA,EAC/B,UAAU,cAAc,OAAO;AAAA,EAC/B,aAAa,cAAc,OAAO;AAAA,EAClC,cAAc,cAAc,OAAO;AAAA,EACnC,GAAG;AACL,GAAwB;AACtB,QAAM,WAAW;AAAA;AAAA,IAEf,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,SAAS;AAAA,IACT,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,cAAc;AAAA,IACd,SAAS;AAAA,IACT,SAAS;AAAA,IACT,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,UAAU;AAAA,IACV,UAAU;AAAA;AAAA,IAGV,OAAO,iBAAiB,GAAG;AAAA,IAC3B,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,IACd,eAAe;AAAA,EACjB;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,SAAS,CAAC,SAAS;AAAA,MACnB;AAAA;AAAA,EACF;AAEJ,GAAG,kBAAkB;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paper-design/shaders-react",
3
- "version": "0.0.77",
3
+ "version": "0.0.79",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  "type-check": "tsc --project tsconfig.json"
27
27
  },
28
28
  "dependencies": {
29
- "@paper-design/shaders": "0.0.77"
29
+ "@paper-design/shaders": "0.0.79"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "19.1.0"