shaders 2.2.43 → 2.2.44

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.
Files changed (274) hide show
  1. package/dist/core/index.d.ts +0 -2
  2. package/dist/core/index.d.ts.map +1 -1
  3. package/dist/core/index.js +8 -170
  4. package/dist/core/registry.d.ts +10 -0
  5. package/dist/core/registry.d.ts.map +1 -0
  6. package/dist/core/registry.js +166 -0
  7. package/dist/react/AngularBlur.js +144 -0
  8. package/dist/react/Ascii.js +144 -0
  9. package/dist/react/Beam.js +144 -0
  10. package/dist/react/Blob.js +144 -0
  11. package/dist/react/Blur.js +144 -0
  12. package/dist/react/BrightnessContrast.js +144 -0
  13. package/dist/react/Bulge.js +144 -0
  14. package/dist/react/CRTScreen.js +144 -0
  15. package/dist/react/ChannelBlur.js +144 -0
  16. package/dist/react/Checkerboard.js +144 -0
  17. package/dist/react/ChromaFlow.js +144 -0
  18. package/dist/react/ChromaticAberration.js +144 -0
  19. package/dist/react/Circle.js +144 -0
  20. package/dist/react/CursorTrail.js +144 -0
  21. package/dist/react/DiffuseBlur.js +144 -0
  22. package/dist/react/Dither.js +144 -0
  23. package/dist/react/DotGrid.js +144 -0
  24. package/dist/react/Duotone.js +144 -0
  25. package/dist/react/FilmGrain.js +144 -0
  26. package/dist/react/FloatingParticles.js +144 -0
  27. package/dist/react/GlassTiles.js +144 -0
  28. package/dist/react/Glow.js +144 -0
  29. package/dist/react/Godrays.js +144 -0
  30. package/dist/react/Grayscale.js +144 -0
  31. package/dist/react/Grid.js +144 -0
  32. package/dist/react/GridDistortion.js +144 -0
  33. package/dist/react/Group.js +144 -0
  34. package/dist/react/Halftone.js +144 -0
  35. package/dist/react/HueShift.js +144 -0
  36. package/dist/react/ImageTexture.js +144 -0
  37. package/dist/react/Invert.js +144 -0
  38. package/dist/react/LinearBlur.js +144 -0
  39. package/dist/react/LinearGradient.js +144 -0
  40. package/dist/react/Liquify.js +144 -0
  41. package/dist/react/Perspective.js +144 -0
  42. package/dist/react/Pixelate.js +144 -0
  43. package/dist/react/PolarCoordinates.js +144 -0
  44. package/dist/react/Posterize.js +144 -0
  45. package/dist/react/ProgressiveBlur.js +144 -0
  46. package/dist/react/RadialGradient.js +144 -0
  47. package/dist/react/RectangularCoordinates.js +144 -0
  48. package/dist/react/Ripples.js +144 -0
  49. package/dist/react/Saturation.js +144 -0
  50. package/dist/react/Shader.js +166 -0
  51. package/dist/react/Sharpness.js +144 -0
  52. package/dist/react/Shatter.js +144 -0
  53. package/dist/react/SimplexNoise.js +144 -0
  54. package/dist/react/SineWave.js +144 -0
  55. package/dist/react/SolidColor.js +144 -0
  56. package/dist/react/Spherize.js +144 -0
  57. package/dist/react/Spiral.js +144 -0
  58. package/dist/react/Strands.js +144 -0
  59. package/dist/react/Stretch.js +144 -0
  60. package/dist/react/Stripes.js +144 -0
  61. package/dist/react/Swirl.js +144 -0
  62. package/dist/react/TiltShift.js +144 -0
  63. package/dist/react/Tint.js +144 -0
  64. package/dist/react/Tritone.js +144 -0
  65. package/dist/react/Twirl.js +144 -0
  66. package/dist/react/Vibrance.js +144 -0
  67. package/dist/react/WaveDistortion.js +144 -0
  68. package/dist/react/WebcamTexture.js +144 -0
  69. package/dist/react/ZoomBlur.js +144 -0
  70. package/dist/react/index.js +64 -8784
  71. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  72. package/dist/react/utils/generatePresetCode.js +392 -1
  73. package/dist/solid/components/AngularBlur.js +148 -0
  74. package/dist/solid/components/Ascii.js +148 -0
  75. package/dist/solid/components/Beam.js +148 -0
  76. package/dist/solid/components/Blob.js +148 -0
  77. package/dist/solid/components/Blur.js +148 -0
  78. package/dist/solid/components/BrightnessContrast.js +148 -0
  79. package/dist/solid/components/Bulge.js +148 -0
  80. package/dist/solid/components/CRTScreen.js +148 -0
  81. package/dist/solid/components/ChannelBlur.js +148 -0
  82. package/dist/solid/components/Checkerboard.js +148 -0
  83. package/dist/solid/components/ChromaFlow.js +148 -0
  84. package/dist/solid/components/ChromaticAberration.js +148 -0
  85. package/dist/solid/components/Circle.js +148 -0
  86. package/dist/solid/components/CursorTrail.js +148 -0
  87. package/dist/solid/components/DiffuseBlur.js +148 -0
  88. package/dist/solid/components/Dither.js +148 -0
  89. package/dist/solid/components/DotGrid.js +148 -0
  90. package/dist/solid/components/Duotone.js +148 -0
  91. package/dist/solid/components/FilmGrain.js +148 -0
  92. package/dist/solid/components/FloatingParticles.js +148 -0
  93. package/dist/solid/components/GlassTiles.js +148 -0
  94. package/dist/solid/components/Glow.js +148 -0
  95. package/dist/solid/components/Godrays.js +148 -0
  96. package/dist/solid/components/Grayscale.js +148 -0
  97. package/dist/solid/components/Grid.js +148 -0
  98. package/dist/solid/components/GridDistortion.js +148 -0
  99. package/dist/solid/components/Group.js +148 -0
  100. package/dist/solid/components/Halftone.js +148 -0
  101. package/dist/solid/components/HueShift.js +148 -0
  102. package/dist/solid/components/ImageTexture.js +148 -0
  103. package/dist/solid/components/Invert.js +148 -0
  104. package/dist/solid/components/LinearBlur.js +148 -0
  105. package/dist/solid/components/LinearGradient.js +148 -0
  106. package/dist/solid/components/Liquify.js +148 -0
  107. package/dist/solid/components/Perspective.js +148 -0
  108. package/dist/solid/components/Pixelate.js +148 -0
  109. package/dist/solid/components/PolarCoordinates.js +148 -0
  110. package/dist/solid/components/Posterize.js +148 -0
  111. package/dist/solid/components/ProgressiveBlur.js +148 -0
  112. package/dist/solid/components/RadialGradient.js +148 -0
  113. package/dist/solid/components/RectangularCoordinates.js +148 -0
  114. package/dist/solid/components/Ripples.js +148 -0
  115. package/dist/solid/components/Saturation.js +148 -0
  116. package/dist/solid/components/Sharpness.js +148 -0
  117. package/dist/solid/components/Shatter.js +148 -0
  118. package/dist/solid/components/SimplexNoise.js +148 -0
  119. package/dist/solid/components/SineWave.js +148 -0
  120. package/dist/solid/components/SolidColor.js +148 -0
  121. package/dist/solid/components/Spherize.js +148 -0
  122. package/dist/solid/components/Spiral.js +148 -0
  123. package/dist/solid/components/Strands.js +148 -0
  124. package/dist/solid/components/Stretch.js +148 -0
  125. package/dist/solid/components/Stripes.js +148 -0
  126. package/dist/solid/components/Swirl.js +148 -0
  127. package/dist/solid/components/TiltShift.js +148 -0
  128. package/dist/solid/components/Tint.js +148 -0
  129. package/dist/solid/components/Tritone.js +148 -0
  130. package/dist/solid/components/Twirl.js +148 -0
  131. package/dist/solid/components/Vibrance.js +148 -0
  132. package/dist/solid/components/WaveDistortion.js +148 -0
  133. package/dist/solid/components/WebcamTexture.js +148 -0
  134. package/dist/solid/components/ZoomBlur.js +148 -0
  135. package/dist/solid/engine/Shader.js +189 -0
  136. package/dist/solid/index.js +126 -8989
  137. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  138. package/dist/solid/utils/generatePresetCode.js +62 -417
  139. package/dist/svelte/generatePresetCode-CtXcoyI0.js +393 -0
  140. package/dist/svelte/index.js +1 -1
  141. package/dist/svelte/utils/generatePresetCode.js +1 -1
  142. package/dist/vue/AngularBlur.js +3 -0
  143. package/dist/vue/AngularBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  144. package/dist/vue/Ascii.js +3 -0
  145. package/dist/vue/Ascii.vue_vue_type_script_setup_true_lang.js +127 -0
  146. package/dist/vue/Beam.js +3 -0
  147. package/dist/vue/Beam.vue_vue_type_script_setup_true_lang.js +132 -0
  148. package/dist/vue/Blob.js +3 -0
  149. package/dist/vue/Blob.vue_vue_type_script_setup_true_lang.js +137 -0
  150. package/dist/vue/Blur.js +3 -0
  151. package/dist/vue/Blur.vue_vue_type_script_setup_true_lang.js +124 -0
  152. package/dist/vue/BrightnessContrast.js +3 -0
  153. package/dist/vue/BrightnessContrast.vue_vue_type_script_setup_true_lang.js +125 -0
  154. package/dist/vue/Bulge.js +3 -0
  155. package/dist/vue/Bulge.vue_vue_type_script_setup_true_lang.js +128 -0
  156. package/dist/vue/CRTScreen.js +3 -0
  157. package/dist/vue/CRTScreen.vue_vue_type_script_setup_true_lang.js +129 -0
  158. package/dist/vue/ChannelBlur.js +3 -0
  159. package/dist/vue/ChannelBlur.vue_vue_type_script_setup_true_lang.js +126 -0
  160. package/dist/vue/Checkerboard.js +3 -0
  161. package/dist/vue/Checkerboard.vue_vue_type_script_setup_true_lang.js +128 -0
  162. package/dist/vue/ChromaFlow.js +3 -0
  163. package/dist/vue/ChromaFlow.vue_vue_type_script_setup_true_lang.js +131 -0
  164. package/dist/vue/ChromaticAberration.js +3 -0
  165. package/dist/vue/ChromaticAberration.vue_vue_type_script_setup_true_lang.js +128 -0
  166. package/dist/vue/Circle.js +3 -0
  167. package/dist/vue/Circle.vue_vue_type_script_setup_true_lang.js +127 -0
  168. package/dist/vue/CursorTrail.js +3 -0
  169. package/dist/vue/CursorTrail.vue_vue_type_script_setup_true_lang.js +129 -0
  170. package/dist/vue/DiffuseBlur.js +3 -0
  171. package/dist/vue/DiffuseBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  172. package/dist/vue/Dither.js +3 -0
  173. package/dist/vue/Dither.vue_vue_type_script_setup_true_lang.js +127 -0
  174. package/dist/vue/DotGrid.js +3 -0
  175. package/dist/vue/DotGrid.vue_vue_type_script_setup_true_lang.js +127 -0
  176. package/dist/vue/Duotone.js +3 -0
  177. package/dist/vue/Duotone.vue_vue_type_script_setup_true_lang.js +127 -0
  178. package/dist/vue/FilmGrain.js +3 -0
  179. package/dist/vue/FilmGrain.vue_vue_type_script_setup_true_lang.js +124 -0
  180. package/dist/vue/FloatingParticles.js +3 -0
  181. package/dist/vue/FloatingParticles.vue_vue_type_script_setup_true_lang.js +134 -0
  182. package/dist/vue/GlassTiles.js +3 -0
  183. package/dist/vue/GlassTiles.vue_vue_type_script_setup_true_lang.js +127 -0
  184. package/dist/vue/Glow.js +3 -0
  185. package/dist/vue/Glow.vue_vue_type_script_setup_true_lang.js +126 -0
  186. package/dist/vue/Godrays.js +3 -0
  187. package/dist/vue/Godrays.vue_vue_type_script_setup_true_lang.js +130 -0
  188. package/dist/vue/Grayscale.js +3 -0
  189. package/dist/vue/Grayscale.vue_vue_type_script_setup_true_lang.js +123 -0
  190. package/dist/vue/Grid.js +3 -0
  191. package/dist/vue/Grid.vue_vue_type_script_setup_true_lang.js +126 -0
  192. package/dist/vue/GridDistortion.js +3 -0
  193. package/dist/vue/GridDistortion.vue_vue_type_script_setup_true_lang.js +129 -0
  194. package/dist/vue/Group.js +3 -0
  195. package/dist/vue/Group.vue_vue_type_script_setup_true_lang.js +123 -0
  196. package/dist/vue/Halftone.js +3 -0
  197. package/dist/vue/Halftone.vue_vue_type_script_setup_true_lang.js +126 -0
  198. package/dist/vue/HueShift.js +3 -0
  199. package/dist/vue/HueShift.vue_vue_type_script_setup_true_lang.js +124 -0
  200. package/dist/vue/ImageTexture.js +3 -0
  201. package/dist/vue/ImageTexture.vue_vue_type_script_setup_true_lang.js +125 -0
  202. package/dist/vue/Invert.js +3 -0
  203. package/dist/vue/Invert.vue_vue_type_script_setup_true_lang.js +123 -0
  204. package/dist/vue/LinearBlur.js +3 -0
  205. package/dist/vue/LinearBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  206. package/dist/vue/LinearGradient.js +3 -0
  207. package/dist/vue/LinearGradient.vue_vue_type_script_setup_true_lang.js +130 -0
  208. package/dist/vue/Liquify.js +3 -0
  209. package/dist/vue/Liquify.vue_vue_type_script_setup_true_lang.js +128 -0
  210. package/dist/vue/Perspective.js +3 -0
  211. package/dist/vue/Perspective.vue_vue_type_script_setup_true_lang.js +130 -0
  212. package/dist/vue/Pixelate.js +3 -0
  213. package/dist/vue/Pixelate.vue_vue_type_script_setup_true_lang.js +124 -0
  214. package/dist/vue/PolarCoordinates.js +3 -0
  215. package/dist/vue/PolarCoordinates.vue_vue_type_script_setup_true_lang.js +128 -0
  216. package/dist/vue/Posterize.js +3 -0
  217. package/dist/vue/Posterize.vue_vue_type_script_setup_true_lang.js +124 -0
  218. package/dist/vue/ProgressiveBlur.js +3 -0
  219. package/dist/vue/ProgressiveBlur.vue_vue_type_script_setup_true_lang.js +127 -0
  220. package/dist/vue/RadialGradient.js +3 -0
  221. package/dist/vue/RadialGradient.vue_vue_type_script_setup_true_lang.js +128 -0
  222. package/dist/vue/RectangularCoordinates.js +3 -0
  223. package/dist/vue/RectangularCoordinates.vue_vue_type_script_setup_true_lang.js +127 -0
  224. package/dist/vue/Ripples.js +3 -0
  225. package/dist/vue/Ripples.vue_vue_type_script_setup_true_lang.js +131 -0
  226. package/dist/vue/Saturation.js +3 -0
  227. package/dist/vue/Saturation.vue_vue_type_script_setup_true_lang.js +124 -0
  228. package/dist/vue/Shader.js +3 -0
  229. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +153 -0
  230. package/dist/vue/Sharpness.js +3 -0
  231. package/dist/vue/Sharpness.vue_vue_type_script_setup_true_lang.js +124 -0
  232. package/dist/vue/Shatter.js +3 -0
  233. package/dist/vue/Shatter.vue_vue_type_script_setup_true_lang.js +132 -0
  234. package/dist/vue/SimplexNoise.js +3 -0
  235. package/dist/vue/SimplexNoise.vue_vue_type_script_setup_true_lang.js +130 -0
  236. package/dist/vue/SineWave.js +3 -0
  237. package/dist/vue/SineWave.vue_vue_type_script_setup_true_lang.js +131 -0
  238. package/dist/vue/SolidColor.js +3 -0
  239. package/dist/vue/SolidColor.vue_vue_type_script_setup_true_lang.js +124 -0
  240. package/dist/vue/Spherize.js +3 -0
  241. package/dist/vue/Spherize.vue_vue_type_script_setup_true_lang.js +130 -0
  242. package/dist/vue/Spiral.js +3 -0
  243. package/dist/vue/Spiral.vue_vue_type_script_setup_true_lang.js +132 -0
  244. package/dist/vue/Strands.js +3 -0
  245. package/dist/vue/Strands.vue_vue_type_script_setup_true_lang.js +132 -0
  246. package/dist/vue/Stretch.js +3 -0
  247. package/dist/vue/Stretch.vue_vue_type_script_setup_true_lang.js +128 -0
  248. package/dist/vue/Stripes.js +3 -0
  249. package/dist/vue/Stripes.vue_vue_type_script_setup_true_lang.js +132 -0
  250. package/dist/vue/Swirl.js +3 -0
  251. package/dist/vue/Swirl.vue_vue_type_script_setup_true_lang.js +129 -0
  252. package/dist/vue/TiltShift.js +3 -0
  253. package/dist/vue/TiltShift.vue_vue_type_script_setup_true_lang.js +128 -0
  254. package/dist/vue/Tint.js +3 -0
  255. package/dist/vue/Tint.vue_vue_type_script_setup_true_lang.js +126 -0
  256. package/dist/vue/Tritone.js +3 -0
  257. package/dist/vue/Tritone.vue_vue_type_script_setup_true_lang.js +128 -0
  258. package/dist/vue/Twirl.js +3 -0
  259. package/dist/vue/Twirl.vue_vue_type_script_setup_true_lang.js +126 -0
  260. package/dist/vue/Vibrance.js +3 -0
  261. package/dist/vue/Vibrance.vue_vue_type_script_setup_true_lang.js +124 -0
  262. package/dist/vue/WaveDistortion.js +3 -0
  263. package/dist/vue/WaveDistortion.vue_vue_type_script_setup_true_lang.js +129 -0
  264. package/dist/vue/WebcamTexture.js +3 -0
  265. package/dist/vue/WebcamTexture.vue_vue_type_script_setup_true_lang.js +125 -0
  266. package/dist/vue/ZoomBlur.js +3 -0
  267. package/dist/vue/ZoomBlur.vue_vue_type_script_setup_true_lang.js +125 -0
  268. package/dist/vue/index.js +64 -7870
  269. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  270. package/dist/vue/utils/generatePresetCode.js +391 -1
  271. package/package.json +1 -1
  272. package/dist/react/generatePresetCode-D0yiVxb4.js +0 -748
  273. package/dist/svelte/generatePresetCode-DUGaV_ym.js +0 -748
  274. package/dist/vue/generatePresetCode-CShQ8TLw.js +0 -747
@@ -16,6 +16,4 @@ export { edgeMask } from './helpers/edgeMask';
16
16
  export type { UniformsMap, PropConfig, NodeMetadata, MaskConfig, TransformConfig } from './types';
17
17
  export type { BlendMode } from './blendModes';
18
18
  export type { PerformanceStats } from './performanceTracker';
19
- export { shaderRegistry, getAllShaders, getShaderByName, getShadersByCategory, getShaderCategories } from './shaderRegistry';
20
- export type { ShaderRegistryEntry } from './shaderRegistry';
21
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG3C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAG1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,YAAY,EAAC,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAC/F,YAAY,EAAC,SAAS,EAAC,MAAM,cAAc,CAAA;AAC3C,YAAY,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AAG1D,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAG3C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAG1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,YAAY,EAAC,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAC,MAAM,SAAS,CAAA;AAC/F,YAAY,EAAC,SAAS,EAAC,MAAM,cAAc,CAAA;AAC3C,YAAY,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAA"}
@@ -1,69 +1,6 @@
1
1
  import { t as applyEdgeHandling } from "./edges-Bd7GP4s2.js";
2
2
  import { a as transformColorUpdate, c as transformPositionUpdate, r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
3
3
  import { t as createAnimatedTime } from "./time-BZqyVJXt.js";
4
- import { n as componentDefinition } from "./AngularBlur-CuwAjUOA.js";
5
- import { n as componentDefinition$1 } from "./Ascii-Dxk6VaBp.js";
6
- import "./colorMixing-CZPFmiT4.js";
7
- import { n as componentDefinition$2 } from "./Beam-CbG4MkLo.js";
8
- import { n as componentDefinition$3 } from "./Blob-Ck1tVOL_.js";
9
- import { n as componentDefinition$4 } from "./Blur-k37gOaRA.js";
10
- import { n as componentDefinition$5 } from "./BrightnessContrast-CaErceqR.js";
11
- import { n as componentDefinition$6 } from "./Bulge-BVcWo6On.js";
12
- import { n as componentDefinition$7 } from "./ChannelBlur-CQoP7Igg.js";
13
- import { n as componentDefinition$8 } from "./Checkerboard-D_hGvoO7.js";
14
- import { n as componentDefinition$9 } from "./ChromaFlow-DizYQSgf.js";
15
- import { n as componentDefinition$10 } from "./ChromaticAberration-Bk_DMYJm.js";
16
- import { n as componentDefinition$11 } from "./Circle-BlVzkeyl.js";
17
- import { n as componentDefinition$12 } from "./CRTScreen-CcAYeqoI.js";
18
- import { n as componentDefinition$13 } from "./CursorTrail-CxXWV7KH.js";
19
- import { n as componentDefinition$14 } from "./DiffuseBlur-BTSRl65K.js";
20
- import { n as componentDefinition$15 } from "./Dither-C1KyBYuE.js";
21
- import { n as componentDefinition$16 } from "./DotGrid-ll8XCA0p.js";
22
- import { n as componentDefinition$17 } from "./Duotone-d2gQJr4M.js";
23
- import { n as componentDefinition$18 } from "./FilmGrain-3h6TIe1T.js";
24
- import { n as componentDefinition$19 } from "./FloatingParticles-D95-rj4h.js";
25
- import { n as componentDefinition$20 } from "./GlassTiles-DqT67iqr.js";
26
- import { n as componentDefinition$21 } from "./Glow-BYNKuw0E.js";
27
- import { n as componentDefinition$22 } from "./Godrays-DCk1c8sQ.js";
28
- import { n as componentDefinition$23 } from "./Grayscale-BH3tLDGN.js";
29
- import { n as componentDefinition$24 } from "./Grid-CdslWvoH.js";
30
- import { n as componentDefinition$25 } from "./GridDistortion-D-iiGELF.js";
31
- import { n as componentDefinition$26 } from "./Group-ByGv48Lm.js";
32
- import { n as componentDefinition$27 } from "./Halftone-CV0aFuRG.js";
33
- import { n as componentDefinition$28 } from "./HueShift-DQ2WgImx.js";
34
- import { n as componentDefinition$29 } from "./ImageTexture-DKFb8ze3.js";
35
- import { n as componentDefinition$30 } from "./Invert-w9duGaUu.js";
36
- import { n as componentDefinition$31 } from "./LinearBlur-CTXjolzL.js";
37
- import { n as componentDefinition$32 } from "./LinearGradient-CZo6e7r8.js";
38
- import { n as componentDefinition$33 } from "./Liquify-BbfDBMNZ.js";
39
- import { n as componentDefinition$34 } from "./Perspective-CSP2Hb16.js";
40
- import { n as componentDefinition$35 } from "./Pixelate-BAoi-CSx.js";
41
- import { n as componentDefinition$36 } from "./PolarCoordinates-BwN9HhFK.js";
42
- import { n as componentDefinition$37 } from "./Posterize-XoAqPWv2.js";
43
- import { n as componentDefinition$38 } from "./ProgressiveBlur-RuAm_BKx.js";
44
- import { n as componentDefinition$39 } from "./RadialGradient-BfFuRbIl.js";
45
- import { n as componentDefinition$40 } from "./RectangularCoordinates-CiW3J4UT.js";
46
- import { n as componentDefinition$41 } from "./Ripples-DKBIp3Qq.js";
47
- import { n as componentDefinition$42 } from "./Saturation-DVVlpikK.js";
48
- import { n as componentDefinition$43 } from "./Sharpness-cw57bW0s.js";
49
- import { n as componentDefinition$44 } from "./Shatter-COjV2jLy.js";
50
- import { n as componentDefinition$45 } from "./SimplexNoise-Ce79jgYM.js";
51
- import { n as componentDefinition$46 } from "./SineWave-Cv2gOU8a.js";
52
- import { n as componentDefinition$47 } from "./SolidColor-DFkDBFq3.js";
53
- import { n as componentDefinition$48 } from "./Spherize-R-s4pX9t.js";
54
- import { n as componentDefinition$49 } from "./Spiral-W4dALX1z.js";
55
- import { n as componentDefinition$50 } from "./Strands-DtN5POfO.js";
56
- import { n as componentDefinition$51 } from "./Stretch-BzvP_hdu.js";
57
- import { n as componentDefinition$52 } from "./Stripes-BbNFX05u.js";
58
- import { n as componentDefinition$53 } from "./Swirl-CfsYsr4X.js";
59
- import { n as componentDefinition$54 } from "./TiltShift-B6gbm7Z8.js";
60
- import { n as componentDefinition$55 } from "./Tint-CpnitsHw.js";
61
- import { n as componentDefinition$56 } from "./Tritone-DzvSKVfR.js";
62
- import { n as componentDefinition$57 } from "./Twirl-BXH4uAd6.js";
63
- import { n as componentDefinition$58 } from "./Vibrance-ByN9bRgU.js";
64
- import { n as componentDefinition$59 } from "./WaveDistortion-BA1PyqYH.js";
65
- import { n as componentDefinition$60 } from "./WebcamTexture-D4Uv7Plz.js";
66
- import { n as componentDefinition$61 } from "./ZoomBlur-CIkkDBIo.js";
67
4
  import { Material, Mesh, MeshBasicNodeMaterial, OrthographicCamera, PlaneGeometry, SRGBColorSpace, Scene, WebGPURenderer } from "three/webgpu";
68
5
  import { WebGLRenderer } from "three";
69
6
  import { PI, abs, add, atan, convertToTexture, cos, div, dot, float, fract, max, min, mix, mul, pow, screenUV, sin, smoothstep, sqrt, step, sub, time, uniform, uv, vec2, vec3, vec4 } from "three/tsl";
@@ -1090,7 +1027,7 @@ function shaderRenderer() {
1090
1027
  }
1091
1028
  }
1092
1029
  };
1093
- const registerNode = (id, fragmentNodeFunc, parentId, metadata, uniforms = {}, componentDefinition$62) => {
1030
+ const registerNode = (id, fragmentNodeFunc, parentId, metadata, uniforms = {}, componentDefinition) => {
1094
1031
  if (fragmentNodeFunc === null) {
1095
1032
  const queueIndex = pendingRegistrationQueue.findIndex((item) => item.id === id);
1096
1033
  if (queueIndex !== -1) {
@@ -1108,7 +1045,7 @@ function shaderRenderer() {
1108
1045
  parentId,
1109
1046
  metadata,
1110
1047
  uniforms,
1111
- componentDefinition: componentDefinition$62
1048
+ componentDefinition
1112
1049
  };
1113
1050
  else pendingRegistrationQueue.push({
1114
1051
  id,
@@ -1116,7 +1053,7 @@ function shaderRenderer() {
1116
1053
  parentId,
1117
1054
  metadata,
1118
1055
  uniforms,
1119
- componentDefinition: componentDefinition$62
1056
+ componentDefinition
1120
1057
  });
1121
1058
  return;
1122
1059
  }
@@ -1149,11 +1086,11 @@ function shaderRenderer() {
1149
1086
  }
1150
1087
  const nodeInfo = {
1151
1088
  id,
1152
- componentName: componentDefinition$62?.name || "Unknown",
1089
+ componentName: componentDefinition?.name || "Unknown",
1153
1090
  fragmentNodeFunc,
1154
1091
  parentId,
1155
- requiresRTT: componentDefinition$62?.requiresRTT || false,
1156
- requiresChild: componentDefinition$62?.requiresChild || false,
1092
+ requiresRTT: componentDefinition?.requiresRTT || false,
1093
+ requiresChild: componentDefinition?.requiresChild || false,
1157
1094
  opacityUniform,
1158
1095
  metadata: {
1159
1096
  blendMode: metadata?.blendMode || "normal",
@@ -1469,7 +1406,7 @@ function shaderRenderer() {
1469
1406
  if (pendingRegistrationQueue.length === 0) return;
1470
1407
  const queue = [...pendingRegistrationQueue];
1471
1408
  pendingRegistrationQueue = [];
1472
- for (const { id, fragmentNodeFunc, parentId, metadata, uniforms, componentDefinition: componentDefinition$62 } of queue) if (fragmentNodeFunc) registerNode(id, fragmentNodeFunc, parentId, metadata, uniforms, componentDefinition$62);
1409
+ for (const { id, fragmentNodeFunc, parentId, metadata, uniforms, componentDefinition } of queue) if (fragmentNodeFunc) registerNode(id, fragmentNodeFunc, parentId, metadata, uniforms, componentDefinition);
1473
1410
  };
1474
1411
  const initialize = async ({ canvas, enablePerformanceTracking: enableTracking = false }) => {
1475
1412
  if (isInitialized || isInitializing) return;
@@ -1761,103 +1698,4 @@ const edgeMask = (options = {}) => {
1761
1698
  const ovalDistance = ovalX.mul(ovalX).add(ovalY.mul(ovalY)).sqrt();
1762
1699
  return float(1).sub(smoothstep(float(1).sub(float(inset)), float(1).sub(float(inset)).add(float(softness)), ovalDistance.mul(float(1).add(float(softness)))));
1763
1700
  };
1764
- var createShaderRegistry = () => {
1765
- const registry = {};
1766
- const shaderDefinitions = {
1767
- AngularBlur: componentDefinition,
1768
- Ascii: componentDefinition$1,
1769
- Beam: componentDefinition$2,
1770
- Blob: componentDefinition$3,
1771
- Blur: componentDefinition$4,
1772
- BrightnessContrast: componentDefinition$5,
1773
- Bulge: componentDefinition$6,
1774
- ChannelBlur: componentDefinition$7,
1775
- Checkerboard: componentDefinition$8,
1776
- ChromaFlow: componentDefinition$9,
1777
- ChromaticAberration: componentDefinition$10,
1778
- Circle: componentDefinition$11,
1779
- CRTScreen: componentDefinition$12,
1780
- CursorTrail: componentDefinition$13,
1781
- DiffuseBlur: componentDefinition$14,
1782
- Dither: componentDefinition$15,
1783
- DotGrid: componentDefinition$16,
1784
- Duotone: componentDefinition$17,
1785
- FilmGrain: componentDefinition$18,
1786
- FloatingParticles: componentDefinition$19,
1787
- GlassTiles: componentDefinition$20,
1788
- Glow: componentDefinition$21,
1789
- Godrays: componentDefinition$22,
1790
- Grayscale: componentDefinition$23,
1791
- Grid: componentDefinition$24,
1792
- GridDistortion: componentDefinition$25,
1793
- Group: componentDefinition$26,
1794
- Halftone: componentDefinition$27,
1795
- HueShift: componentDefinition$28,
1796
- ImageTexture: componentDefinition$29,
1797
- Invert: componentDefinition$30,
1798
- LinearBlur: componentDefinition$31,
1799
- LinearGradient: componentDefinition$32,
1800
- Liquify: componentDefinition$33,
1801
- Perspective: componentDefinition$34,
1802
- Pixelate: componentDefinition$35,
1803
- PolarCoordinates: componentDefinition$36,
1804
- Posterize: componentDefinition$37,
1805
- ProgressiveBlur: componentDefinition$38,
1806
- RadialGradient: componentDefinition$39,
1807
- RectangularCoordinates: componentDefinition$40,
1808
- Ripples: componentDefinition$41,
1809
- Saturation: componentDefinition$42,
1810
- Sharpness: componentDefinition$43,
1811
- Shatter: componentDefinition$44,
1812
- SimplexNoise: componentDefinition$45,
1813
- SineWave: componentDefinition$46,
1814
- SolidColor: componentDefinition$47,
1815
- Spherize: componentDefinition$48,
1816
- Spiral: componentDefinition$49,
1817
- Strands: componentDefinition$50,
1818
- Stretch: componentDefinition$51,
1819
- Stripes: componentDefinition$52,
1820
- Swirl: componentDefinition$53,
1821
- TiltShift: componentDefinition$54,
1822
- Tint: componentDefinition$55,
1823
- Tritone: componentDefinition$56,
1824
- Twirl: componentDefinition$57,
1825
- Vibrance: componentDefinition$58,
1826
- WaveDistortion: componentDefinition$59,
1827
- WebcamTexture: componentDefinition$60,
1828
- ZoomBlur: componentDefinition$61
1829
- };
1830
- Object.entries(shaderDefinitions).forEach(([fileName, def]) => {
1831
- const propsMetadata = {};
1832
- if (def.props) Object.entries(def.props).forEach(([propName, propConfig]) => {
1833
- if (propConfig.ui) propsMetadata[propName] = {
1834
- ui: propConfig.ui,
1835
- default: propConfig.default,
1836
- description: propConfig.description
1837
- };
1838
- });
1839
- registry[def.name] = {
1840
- name: def.name,
1841
- fileName,
1842
- category: def.category || "Uncategorized",
1843
- definition: def,
1844
- propsMetadata
1845
- };
1846
- });
1847
- return registry;
1848
- };
1849
- const shaderRegistry = createShaderRegistry();
1850
- function getAllShaders() {
1851
- return Object.values(shaderRegistry);
1852
- }
1853
- function getShaderByName(name) {
1854
- return shaderRegistry[name];
1855
- }
1856
- function getShadersByCategory(category) {
1857
- return Object.values(shaderRegistry).filter((shader) => shader.category === category);
1858
- }
1859
- function getShaderCategories() {
1860
- const categories = new Set(Object.values(shaderRegistry).map((shader) => shader.category));
1861
- return Array.from(categories).sort();
1862
- }
1863
- export { createAnimatedTime, createUniformsMap, distort, edgeMask, getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, glow, grain, resolveMaskDependencies, shaderRegistry, shaderRenderer, updateUniformValue };
1701
+ export { createAnimatedTime, createUniformsMap, distort, edgeMask, glow, grain, resolveMaskDependencies, shaderRenderer, updateUniformValue };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shader Registry - imports all shader definitions
3
+ *
4
+ * Import from 'shaders-core/registry' to access the full shader registry.
5
+ * Note: This will bundle all shader definitions into your app.
6
+ * Only import this if you need dynamic access to all shaders.
7
+ */
8
+ export { shaderRegistry, getAllShaders, getShaderByName, getShadersByCategory, getShaderCategories } from './shaderRegistry';
9
+ export type { ShaderRegistryEntry } from './shaderRegistry';
10
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,kBAAkB,CAAA;AAEzB,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,166 @@
1
+ import "./edges-Bd7GP4s2.js";
2
+ import "./transformations-YbhRK-rd.js";
3
+ import "./time-BZqyVJXt.js";
4
+ import { n as componentDefinition } from "./AngularBlur-CuwAjUOA.js";
5
+ import { n as componentDefinition$1 } from "./Ascii-Dxk6VaBp.js";
6
+ import "./colorMixing-CZPFmiT4.js";
7
+ import { n as componentDefinition$2 } from "./Beam-CbG4MkLo.js";
8
+ import { n as componentDefinition$3 } from "./Blob-Ck1tVOL_.js";
9
+ import { n as componentDefinition$4 } from "./Blur-k37gOaRA.js";
10
+ import { n as componentDefinition$5 } from "./BrightnessContrast-CaErceqR.js";
11
+ import { n as componentDefinition$6 } from "./Bulge-BVcWo6On.js";
12
+ import { n as componentDefinition$7 } from "./ChannelBlur-CQoP7Igg.js";
13
+ import { n as componentDefinition$8 } from "./Checkerboard-D_hGvoO7.js";
14
+ import { n as componentDefinition$9 } from "./ChromaFlow-DizYQSgf.js";
15
+ import { n as componentDefinition$10 } from "./ChromaticAberration-Bk_DMYJm.js";
16
+ import { n as componentDefinition$11 } from "./Circle-BlVzkeyl.js";
17
+ import { n as componentDefinition$12 } from "./CRTScreen-CcAYeqoI.js";
18
+ import { n as componentDefinition$13 } from "./CursorTrail-CxXWV7KH.js";
19
+ import { n as componentDefinition$14 } from "./DiffuseBlur-BTSRl65K.js";
20
+ import { n as componentDefinition$15 } from "./Dither-C1KyBYuE.js";
21
+ import { n as componentDefinition$16 } from "./DotGrid-ll8XCA0p.js";
22
+ import { n as componentDefinition$17 } from "./Duotone-d2gQJr4M.js";
23
+ import { n as componentDefinition$18 } from "./FilmGrain-3h6TIe1T.js";
24
+ import { n as componentDefinition$19 } from "./FloatingParticles-D95-rj4h.js";
25
+ import { n as componentDefinition$20 } from "./GlassTiles-DqT67iqr.js";
26
+ import { n as componentDefinition$21 } from "./Glow-BYNKuw0E.js";
27
+ import { n as componentDefinition$22 } from "./Godrays-DCk1c8sQ.js";
28
+ import { n as componentDefinition$23 } from "./Grayscale-BH3tLDGN.js";
29
+ import { n as componentDefinition$24 } from "./Grid-CdslWvoH.js";
30
+ import { n as componentDefinition$25 } from "./GridDistortion-D-iiGELF.js";
31
+ import { n as componentDefinition$26 } from "./Group-ByGv48Lm.js";
32
+ import { n as componentDefinition$27 } from "./Halftone-CV0aFuRG.js";
33
+ import { n as componentDefinition$28 } from "./HueShift-DQ2WgImx.js";
34
+ import { n as componentDefinition$29 } from "./ImageTexture-DKFb8ze3.js";
35
+ import { n as componentDefinition$30 } from "./Invert-w9duGaUu.js";
36
+ import { n as componentDefinition$31 } from "./LinearBlur-CTXjolzL.js";
37
+ import { n as componentDefinition$32 } from "./LinearGradient-CZo6e7r8.js";
38
+ import { n as componentDefinition$33 } from "./Liquify-BbfDBMNZ.js";
39
+ import { n as componentDefinition$34 } from "./Perspective-CSP2Hb16.js";
40
+ import { n as componentDefinition$35 } from "./Pixelate-BAoi-CSx.js";
41
+ import { n as componentDefinition$36 } from "./PolarCoordinates-BwN9HhFK.js";
42
+ import { n as componentDefinition$37 } from "./Posterize-XoAqPWv2.js";
43
+ import { n as componentDefinition$38 } from "./ProgressiveBlur-RuAm_BKx.js";
44
+ import { n as componentDefinition$39 } from "./RadialGradient-BfFuRbIl.js";
45
+ import { n as componentDefinition$40 } from "./RectangularCoordinates-CiW3J4UT.js";
46
+ import { n as componentDefinition$41 } from "./Ripples-DKBIp3Qq.js";
47
+ import { n as componentDefinition$42 } from "./Saturation-DVVlpikK.js";
48
+ import { n as componentDefinition$43 } from "./Sharpness-cw57bW0s.js";
49
+ import { n as componentDefinition$44 } from "./Shatter-COjV2jLy.js";
50
+ import { n as componentDefinition$45 } from "./SimplexNoise-Ce79jgYM.js";
51
+ import { n as componentDefinition$46 } from "./SineWave-Cv2gOU8a.js";
52
+ import { n as componentDefinition$47 } from "./SolidColor-DFkDBFq3.js";
53
+ import { n as componentDefinition$48 } from "./Spherize-R-s4pX9t.js";
54
+ import { n as componentDefinition$49 } from "./Spiral-W4dALX1z.js";
55
+ import { n as componentDefinition$50 } from "./Strands-DtN5POfO.js";
56
+ import { n as componentDefinition$51 } from "./Stretch-BzvP_hdu.js";
57
+ import { n as componentDefinition$52 } from "./Stripes-BbNFX05u.js";
58
+ import { n as componentDefinition$53 } from "./Swirl-CfsYsr4X.js";
59
+ import { n as componentDefinition$54 } from "./TiltShift-B6gbm7Z8.js";
60
+ import { n as componentDefinition$55 } from "./Tint-CpnitsHw.js";
61
+ import { n as componentDefinition$56 } from "./Tritone-DzvSKVfR.js";
62
+ import { n as componentDefinition$57 } from "./Twirl-BXH4uAd6.js";
63
+ import { n as componentDefinition$58 } from "./Vibrance-ByN9bRgU.js";
64
+ import { n as componentDefinition$59 } from "./WaveDistortion-BA1PyqYH.js";
65
+ import { n as componentDefinition$60 } from "./WebcamTexture-D4Uv7Plz.js";
66
+ import { n as componentDefinition$61 } from "./ZoomBlur-CIkkDBIo.js";
67
+ var createShaderRegistry = () => {
68
+ const registry = {};
69
+ const shaderDefinitions = {
70
+ AngularBlur: componentDefinition,
71
+ Ascii: componentDefinition$1,
72
+ Beam: componentDefinition$2,
73
+ Blob: componentDefinition$3,
74
+ Blur: componentDefinition$4,
75
+ BrightnessContrast: componentDefinition$5,
76
+ Bulge: componentDefinition$6,
77
+ ChannelBlur: componentDefinition$7,
78
+ Checkerboard: componentDefinition$8,
79
+ ChromaFlow: componentDefinition$9,
80
+ ChromaticAberration: componentDefinition$10,
81
+ Circle: componentDefinition$11,
82
+ CRTScreen: componentDefinition$12,
83
+ CursorTrail: componentDefinition$13,
84
+ DiffuseBlur: componentDefinition$14,
85
+ Dither: componentDefinition$15,
86
+ DotGrid: componentDefinition$16,
87
+ Duotone: componentDefinition$17,
88
+ FilmGrain: componentDefinition$18,
89
+ FloatingParticles: componentDefinition$19,
90
+ GlassTiles: componentDefinition$20,
91
+ Glow: componentDefinition$21,
92
+ Godrays: componentDefinition$22,
93
+ Grayscale: componentDefinition$23,
94
+ Grid: componentDefinition$24,
95
+ GridDistortion: componentDefinition$25,
96
+ Group: componentDefinition$26,
97
+ Halftone: componentDefinition$27,
98
+ HueShift: componentDefinition$28,
99
+ ImageTexture: componentDefinition$29,
100
+ Invert: componentDefinition$30,
101
+ LinearBlur: componentDefinition$31,
102
+ LinearGradient: componentDefinition$32,
103
+ Liquify: componentDefinition$33,
104
+ Perspective: componentDefinition$34,
105
+ Pixelate: componentDefinition$35,
106
+ PolarCoordinates: componentDefinition$36,
107
+ Posterize: componentDefinition$37,
108
+ ProgressiveBlur: componentDefinition$38,
109
+ RadialGradient: componentDefinition$39,
110
+ RectangularCoordinates: componentDefinition$40,
111
+ Ripples: componentDefinition$41,
112
+ Saturation: componentDefinition$42,
113
+ Sharpness: componentDefinition$43,
114
+ Shatter: componentDefinition$44,
115
+ SimplexNoise: componentDefinition$45,
116
+ SineWave: componentDefinition$46,
117
+ SolidColor: componentDefinition$47,
118
+ Spherize: componentDefinition$48,
119
+ Spiral: componentDefinition$49,
120
+ Strands: componentDefinition$50,
121
+ Stretch: componentDefinition$51,
122
+ Stripes: componentDefinition$52,
123
+ Swirl: componentDefinition$53,
124
+ TiltShift: componentDefinition$54,
125
+ Tint: componentDefinition$55,
126
+ Tritone: componentDefinition$56,
127
+ Twirl: componentDefinition$57,
128
+ Vibrance: componentDefinition$58,
129
+ WaveDistortion: componentDefinition$59,
130
+ WebcamTexture: componentDefinition$60,
131
+ ZoomBlur: componentDefinition$61
132
+ };
133
+ Object.entries(shaderDefinitions).forEach(([fileName, def]) => {
134
+ const propsMetadata = {};
135
+ if (def.props) Object.entries(def.props).forEach(([propName, propConfig]) => {
136
+ if (propConfig.ui) propsMetadata[propName] = {
137
+ ui: propConfig.ui,
138
+ default: propConfig.default,
139
+ description: propConfig.description
140
+ };
141
+ });
142
+ registry[def.name] = {
143
+ name: def.name,
144
+ fileName,
145
+ category: def.category || "Uncategorized",
146
+ definition: def,
147
+ propsMetadata
148
+ };
149
+ });
150
+ return registry;
151
+ };
152
+ const shaderRegistry = createShaderRegistry();
153
+ function getAllShaders() {
154
+ return Object.values(shaderRegistry);
155
+ }
156
+ function getShaderByName(name) {
157
+ return shaderRegistry[name];
158
+ }
159
+ function getShadersByCategory(category) {
160
+ return Object.values(shaderRegistry).filter((shader) => shader.category === category);
161
+ }
162
+ function getShaderCategories() {
163
+ const categories = new Set(Object.values(shaderRegistry).map((shader) => shader.category));
164
+ return Array.from(categories).sort();
165
+ }
166
+ export { getAllShaders, getShaderByName, getShaderCategories, getShadersByCategory, shaderRegistry };
@@ -0,0 +1,144 @@
1
+ import { OmbreContext } from "./Shader.js";
2
+ import { useContext, useEffect, useMemo, useRef } from "react";
3
+ import { createUniformsMap } from "../core/index.js";
4
+ import { componentDefinition } from "../core/shaders/AngularBlur/index.js";
5
+ import { jsx } from "react/jsx-runtime";
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 OmbreComponent = (props) => {
34
+ const context = useContext(OmbreContext);
35
+ if (!context) throw new Error("Shader components must be used inside an <Shader> component or another shader component");
36
+ const { ombreParentId: parentId, ombreNodeRegister: parentRegister, ombreUniformUpdate: parentUniformUpdate, ombreMetadataUpdate: 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
+ ombreParentId: 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(OmbreContext.Provider, {
139
+ value: childContextValue,
140
+ children: props.children
141
+ });
142
+ };
143
+ var AngularBlur_default = OmbreComponent;
144
+ export { AngularBlur_default as default };