shaders 2.2.24 → 2.2.25

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 (193) hide show
  1. package/dist/core/AngularBlur-Dl2gwk68.js +64 -0
  2. package/dist/core/Ascii-Dha_QpT3.js +286 -0
  3. package/dist/core/Beam-CTN9Ni43.js +139 -0
  4. package/dist/core/Blob-CxFDZovO.js +218 -0
  5. package/dist/core/Blur-Y2FsmFk_.js +77 -0
  6. package/dist/core/Bulge-Cb-t0xqI.js +132 -0
  7. package/dist/core/CRTScreen-CtERsenz.js +112 -0
  8. package/dist/core/ChannelBlur-CvM6GJgZ.js +118 -0
  9. package/dist/core/Checkerboard-CgB-egNY.js +83 -0
  10. package/dist/core/ChromaFlow-vRCwhQpN.js +222 -0
  11. package/dist/core/ChromaticAberration-FTquTQIL.js +88 -0
  12. package/dist/core/Circle-Daziv5d7.js +67 -0
  13. package/dist/core/CursorTrail-Bsz9e6Fn.js +145 -0
  14. package/dist/core/DiffuseBlur-Cj2PtRNd.js +83 -0
  15. package/dist/core/Dither-D2Nf4p3w.js +66 -0
  16. package/dist/core/DotGrid-CzOwquo4.js +75 -0
  17. package/dist/core/Duotone-XuTN9tI7.js +65 -0
  18. package/dist/core/FilmGrain-D3-nbi12.js +28 -0
  19. package/dist/core/FloatingParticles-D9Nnu1qg.js +217 -0
  20. package/dist/core/GlassTiles-CnjCvajI.js +69 -0
  21. package/dist/core/Glow-BluFc9be.js +75 -0
  22. package/dist/core/Godrays-ChLh_vGl.js +144 -0
  23. package/dist/core/Grayscale-DRny75A9.js +20 -0
  24. package/dist/core/Grid-DgyDa4H1.js +58 -0
  25. package/dist/core/GridDistortion-BAspCYvp.js +188 -0
  26. package/dist/core/Group-Dul7PUBl.js +14 -0
  27. package/dist/core/Halftone-Ifv5F_FT.js +65 -0
  28. package/dist/core/HueShift-De8ukMWs.js +31 -0
  29. package/dist/core/ImageTexture-DvYcQgJB.js +143 -0
  30. package/dist/core/Invert-Fz0NtIJc.js +21 -0
  31. package/dist/core/LinearBlur-LmhnQoA4.js +62 -0
  32. package/dist/core/LinearGradient-xbloQjzt.js +133 -0
  33. package/dist/core/Liquify-DMe1V5-O.js +175 -0
  34. package/dist/core/Pixelate-Cv8537Pj.js +37 -0
  35. package/dist/core/PolarCoordinates-DDvDhBE-.js +112 -0
  36. package/dist/core/Posterize-3m3xkWOz.js +29 -0
  37. package/dist/core/ProgressiveBlur-EGkevObV.js +121 -0
  38. package/dist/core/RadialGradient-B7ZZB_VJ.js +71 -0
  39. package/dist/core/RectangularCoordinates-muWR8mZS.js +101 -0
  40. package/dist/core/Ripples-8XaZaXQF.js +117 -0
  41. package/dist/core/Saturation-CYFI1jzN.js +30 -0
  42. package/dist/core/SimplexNoise-DJUe0wz_.js +99 -0
  43. package/dist/core/SineWave-Dl3nFO1W.js +120 -0
  44. package/dist/core/SolidColor-CWGq_Bjq.js +21 -0
  45. package/dist/core/Spherize-C-jZEUsN.js +128 -0
  46. package/dist/core/Spiral-BSB_R39p.js +132 -0
  47. package/dist/core/Strands-0stO5BMy.js +161 -0
  48. package/dist/core/Stretch-B645paha.js +133 -0
  49. package/dist/core/Swirl-CVnbawit.js +173 -0
  50. package/dist/core/TiltShift-0CxNRI6L.js +134 -0
  51. package/dist/core/Tritone-Daa-I5UD.js +76 -0
  52. package/dist/core/Twirl-2CJVZEtk.js +96 -0
  53. package/dist/core/Vibrance-DRtecEvb.js +30 -0
  54. package/dist/core/WaveDistortion-BscXN2rs.js +173 -0
  55. package/dist/core/ZoomBlur-CAqK0Kju.js +62 -0
  56. package/dist/core/colorMixing-BXiTAqJU.js +69 -0
  57. package/dist/core/edges-Bn_OIa_h.js +26 -0
  58. package/dist/core/index.js +2257 -1606
  59. package/dist/core/shaders/AngularBlur/index.js +3 -7
  60. package/dist/core/shaders/Ascii/index.js +2 -6
  61. package/dist/core/shaders/Beam/index.js +4 -8
  62. package/dist/core/shaders/Blob/index.js +5 -9
  63. package/dist/core/shaders/Blur/index.js +2 -6
  64. package/dist/core/shaders/Bulge/index.js +4 -8
  65. package/dist/core/shaders/CRTScreen/index.js +2 -6
  66. package/dist/core/shaders/ChannelBlur/index.js +2 -6
  67. package/dist/core/shaders/Checkerboard/index.js +4 -8
  68. package/dist/core/shaders/ChromaFlow/index.js +3 -7
  69. package/dist/core/shaders/ChromaticAberration/index.js +3 -7
  70. package/dist/core/shaders/Circle/index.js +3 -7
  71. package/dist/core/shaders/CursorTrail/index.js +4 -8
  72. package/dist/core/shaders/DiffuseBlur/index.js +4 -8
  73. package/dist/core/shaders/Dither/index.js +3 -7
  74. package/dist/core/shaders/DotGrid/index.js +3 -7
  75. package/dist/core/shaders/Duotone/index.js +4 -8
  76. package/dist/core/shaders/FilmGrain/index.js +2 -6
  77. package/dist/core/shaders/FloatingParticles/index.js +3 -7
  78. package/dist/core/shaders/GlassTiles/index.js +2 -6
  79. package/dist/core/shaders/Glow/index.js +2 -6
  80. package/dist/core/shaders/Godrays/index.js +3 -7
  81. package/dist/core/shaders/Grayscale/index.js +2 -8
  82. package/dist/core/shaders/Grid/index.js +3 -7
  83. package/dist/core/shaders/GridDistortion/index.js +4 -8
  84. package/dist/core/shaders/Group/index.js +2 -6
  85. package/dist/core/shaders/Halftone/index.js +3 -7
  86. package/dist/core/shaders/HueShift/index.js +2 -8
  87. package/dist/core/shaders/ImageTexture/index.js +2 -6
  88. package/dist/core/shaders/Invert/index.js +2 -6
  89. package/dist/core/shaders/LinearBlur/index.js +3 -7
  90. package/dist/core/shaders/LinearGradient/index.js +4 -8
  91. package/dist/core/shaders/Liquify/index.js +4 -8
  92. package/dist/core/shaders/Pixelate/index.js +2 -6
  93. package/dist/core/shaders/PolarCoordinates/index.js +4 -8
  94. package/dist/core/shaders/Posterize/index.js +2 -7
  95. package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
  96. package/dist/core/shaders/RadialGradient/index.js +4 -8
  97. package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
  98. package/dist/core/shaders/Ripples/index.js +5 -9
  99. package/dist/core/shaders/Saturation/index.js +2 -8
  100. package/dist/core/shaders/SimplexNoise/index.js +5 -9
  101. package/dist/core/shaders/SineWave/index.js +3 -7
  102. package/dist/core/shaders/SolidColor/index.js +3 -7
  103. package/dist/core/shaders/Spherize/index.js +3 -7
  104. package/dist/core/shaders/Spiral/index.js +4 -8
  105. package/dist/core/shaders/Strands/index.js +4 -8
  106. package/dist/core/shaders/Stretch/index.js +4 -8
  107. package/dist/core/shaders/Swirl/index.js +5 -9
  108. package/dist/core/shaders/TiltShift/index.js +3 -7
  109. package/dist/core/shaders/Tritone/index.js +4 -8
  110. package/dist/core/shaders/Twirl/index.js +4 -8
  111. package/dist/core/shaders/Vibrance/index.js +2 -8
  112. package/dist/core/shaders/WaveDistortion/index.js +4 -8
  113. package/dist/core/shaders/ZoomBlur/index.js +3 -7
  114. package/dist/core/telemetry/index.js +189 -157
  115. package/dist/core/time-CTJvRUZ4.js +10 -0
  116. package/dist/core/transformations-DxfQXZWi.js +4715 -0
  117. package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
  118. package/dist/react/index.js +7645 -104827
  119. package/dist/react/utils/generatePresetCode.js +2 -5
  120. package/dist/solid/index.js +6670 -102727
  121. package/dist/solid/utils/generatePresetCode.js +583 -554
  122. package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
  123. package/dist/svelte/index.js +6175 -102645
  124. package/dist/svelte/utils/generatePresetCode.js +2 -5
  125. package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
  126. package/dist/vue/index.js +6929 -103706
  127. package/dist/vue/utils/generatePresetCode.js +2 -5
  128. package/package.json +4 -1
  129. package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
  130. package/dist/core/Ascii-BT0-K_vw.js +0 -196
  131. package/dist/core/Beam-BAKql1AP.js +0 -116
  132. package/dist/core/Blob-CVSxhHJG.js +0 -169
  133. package/dist/core/Blur-C1TTBHCX.js +0 -64
  134. package/dist/core/Bulge-DV8tX-cw.js +0 -103
  135. package/dist/core/CRTScreen-VTJQoOeq.js +0 -91
  136. package/dist/core/ChannelBlur-BLZ9kBNA.js +0 -89
  137. package/dist/core/Checkerboard-DQ4Df3vm.js +0 -75
  138. package/dist/core/ChromaFlow-BggN1_Av.js +0 -134
  139. package/dist/core/ChromaticAberration-DlTaHNcp.js +0 -82
  140. package/dist/core/Circle-B9ObWlq5.js +0 -62
  141. package/dist/core/ColorAdjustment-FeXXpypd.js +0 -14
  142. package/dist/core/CursorTrail-C7QdUj8O.js +0 -105
  143. package/dist/core/DiffuseBlur-Mx6LBsqz.js +0 -69
  144. package/dist/core/Dither-CeIdV_9C.js +0 -61
  145. package/dist/core/DotGrid-D6xUvYrt.js +0 -61
  146. package/dist/core/Duotone-C2Pqt2gR.js +0 -66
  147. package/dist/core/FilmGrain-CJ9n_fgk.js +0 -28
  148. package/dist/core/FloatingParticles-iGtMs44K.js +0 -160
  149. package/dist/core/GlassTiles-D_lVyag2.js +0 -52
  150. package/dist/core/Glow-B0jj-6OC.js +0 -66
  151. package/dist/core/Godrays-DjLVuZa4.js +0 -105
  152. package/dist/core/Grayscale-BbsdDa_X.js +0 -21
  153. package/dist/core/Grid-ByjU-_ua.js +0 -50
  154. package/dist/core/GridDistortion-C_eIlhkW.js +0 -147
  155. package/dist/core/Group-CyaDLGpI.js +0 -17
  156. package/dist/core/Halftone-BvuAe_k-.js +0 -55
  157. package/dist/core/HueShift-B_qE9c08.js +0 -32
  158. package/dist/core/ImageTexture-h00TFC1l.js +0 -105
  159. package/dist/core/Invert-BEDDB0sm.js +0 -20
  160. package/dist/core/LinearBlur-CLKxuyeT.js +0 -56
  161. package/dist/core/LinearGradient-BPo8TX_M.js +0 -111
  162. package/dist/core/Liquify-DGkfeixZ.js +0 -139
  163. package/dist/core/Pixelate-Bzy_7LnJ.js +0 -38
  164. package/dist/core/PolarCoordinates-BUumPeTv.js +0 -103
  165. package/dist/core/Posterize-ggKIJlmm.js +0 -46
  166. package/dist/core/ProgressiveBlur-D6_6T7SS.js +0 -102
  167. package/dist/core/RadialGradient-DEY9fRqa.js +0 -71
  168. package/dist/core/RectangularCoordinates-CZ-cFrCh.js +0 -92
  169. package/dist/core/Ripples-BwNlcsnV.js +0 -106
  170. package/dist/core/Saturation-Dl3gCWuZ.js +0 -31
  171. package/dist/core/SimplexNoise-BhE_WyGt.js +0 -94
  172. package/dist/core/SineWave-Db_Y0Mcv.js +0 -107
  173. package/dist/core/SolidColor-CerOp4EQ.js +0 -22
  174. package/dist/core/Spherize-Dh8E5XwG.js +0 -103
  175. package/dist/core/Spiral-BvygQEfP.js +0 -115
  176. package/dist/core/Strands-maaPn4On.js +0 -125
  177. package/dist/core/Stretch-CnA0-nSz.js +0 -103
  178. package/dist/core/Swirl-CQBUahTB.js +0 -148
  179. package/dist/core/TSLBase-Bt7Z4hv_.js +0 -8053
  180. package/dist/core/TiltShift-qFj0oFzN.js +0 -114
  181. package/dist/core/Tritone-AiixmTg8.js +0 -75
  182. package/dist/core/Twirl-ooHQcV89.js +0 -82
  183. package/dist/core/Vibrance-C2FRlLkK.js +0 -31
  184. package/dist/core/WaveDistortion-CN8MjKlm.js +0 -132
  185. package/dist/core/ZoomBlur-CxWGx8PH.js +0 -56
  186. package/dist/core/colorMixing--dhzx0ch.js +0 -21
  187. package/dist/core/edges-CDzKsauJ.js +0 -15
  188. package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
  189. package/dist/core/time-DbRMw6Jm.js +0 -10
  190. package/dist/core/transformations-CsrIJXh-.js +0 -3992
  191. package/dist/react/generatePresetCode-CVj6IV8Y.js +0 -646
  192. package/dist/svelte/generatePresetCode-CVj6IV8Y.js +0 -646
  193. package/dist/vue/generatePresetCode-DCaIsDhE.js +0 -652
@@ -1,5 +1,2 @@
1
- import { n as a, t as o } from "../generatePresetCode-CVj6IV8Y.js";
2
- export {
3
- o as availableComponents,
4
- a as generatePresetCode
5
- };
1
+ import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-CymgoDq_.js";
2
+ export { availableComponents, generatePresetCode };
@@ -0,0 +1,649 @@
1
+ function camelToKebab(str) {
2
+ return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3
+ }
4
+ var shaderMetadata = {
5
+ "AngularBlur": {
6
+ "opacity": 1,
7
+ "blendMode": "normal",
8
+ "intensity": 20,
9
+ "center": {
10
+ "x": .5,
11
+ "y": .5
12
+ }
13
+ },
14
+ "Ascii": {
15
+ "opacity": 1,
16
+ "blendMode": "normal",
17
+ "characters": "@%#*+=-:.",
18
+ "cellSize": 30,
19
+ "fontFamily": "JetBrains Mono",
20
+ "spacing": 1
21
+ },
22
+ "Beam": {
23
+ "opacity": 1,
24
+ "blendMode": "normal",
25
+ "startPosition": {
26
+ "x": .2,
27
+ "y": .5
28
+ },
29
+ "endPosition": {
30
+ "x": .8,
31
+ "y": .5
32
+ },
33
+ "startThickness": .2,
34
+ "endThickness": .2,
35
+ "startSoftness": .5,
36
+ "endSoftness": .5,
37
+ "insideColor": "#FF0000",
38
+ "outsideColor": "#0000FF",
39
+ "colorSpace": "linear"
40
+ },
41
+ "Blob": {
42
+ "opacity": 1,
43
+ "blendMode": "normal",
44
+ "colorA": "#ff6b35",
45
+ "colorB": "#e91e63",
46
+ "size": .5,
47
+ "deformation": .5,
48
+ "softness": .5,
49
+ "highlightIntensity": .5,
50
+ "highlightX": .3,
51
+ "highlightY": -.3,
52
+ "highlightZ": .4,
53
+ "highlightColor": "#ffe11a",
54
+ "speed": .5,
55
+ "seed": 1,
56
+ "center": {
57
+ "x": .5,
58
+ "y": .5
59
+ },
60
+ "colorSpace": "linear"
61
+ },
62
+ "Blur": {
63
+ "opacity": 1,
64
+ "blendMode": "normal",
65
+ "intensity": 50
66
+ },
67
+ "Bulge": {
68
+ "opacity": 1,
69
+ "blendMode": "normal",
70
+ "center": {
71
+ "x": .5,
72
+ "y": .5
73
+ },
74
+ "strength": 1,
75
+ "radius": 1,
76
+ "falloff": .5,
77
+ "edges": "stretch"
78
+ },
79
+ "ChannelBlur": {
80
+ "opacity": 1,
81
+ "blendMode": "normal",
82
+ "redIntensity": 0,
83
+ "greenIntensity": 20,
84
+ "blueIntensity": 40
85
+ },
86
+ "Checkerboard": {
87
+ "opacity": 1,
88
+ "blendMode": "normal",
89
+ "colorA": "#cccccc",
90
+ "colorB": "#999999",
91
+ "cells": 8,
92
+ "softness": 0,
93
+ "colorSpace": "linear"
94
+ },
95
+ "ChromaFlow": {
96
+ "opacity": 1,
97
+ "blendMode": "normal",
98
+ "baseColor": "#0066ff",
99
+ "upColor": "#00ff00",
100
+ "downColor": "#ff0000",
101
+ "leftColor": "#0000ff",
102
+ "rightColor": "#ffff00",
103
+ "intensity": 1,
104
+ "radius": 2,
105
+ "momentum": 30
106
+ },
107
+ "ChromaticAberration": {
108
+ "opacity": 1,
109
+ "blendMode": "normal",
110
+ "strength": .2,
111
+ "angle": 0,
112
+ "redOffset": -1,
113
+ "greenOffset": 0,
114
+ "blueOffset": 1
115
+ },
116
+ "Circle": {
117
+ "opacity": 1,
118
+ "blendMode": "normal",
119
+ "color": "#ffffff",
120
+ "radius": 1,
121
+ "softness": 0,
122
+ "center": {
123
+ "x": .5,
124
+ "y": .5
125
+ }
126
+ },
127
+ "CRTScreen": {
128
+ "opacity": 1,
129
+ "blendMode": "normal",
130
+ "pixelSize": 128,
131
+ "colorShift": 1,
132
+ "scanlineIntensity": .3,
133
+ "scanlineFrequency": 200,
134
+ "brightness": 1.1,
135
+ "contrast": 1.2
136
+ },
137
+ "CursorTrail": {
138
+ "opacity": 1,
139
+ "blendMode": "normal",
140
+ "colorA": "#00aaff",
141
+ "colorB": "#ff00aa",
142
+ "radius": .5,
143
+ "length": .5,
144
+ "shrink": 1,
145
+ "colorSpace": "linear"
146
+ },
147
+ "DiffuseBlur": {
148
+ "opacity": 1,
149
+ "blendMode": "normal",
150
+ "intensity": 30,
151
+ "edges": "stretch"
152
+ },
153
+ "Dither": {
154
+ "opacity": 1,
155
+ "blendMode": "normal",
156
+ "pixelSize": 4,
157
+ "threshold": .5,
158
+ "colorA": "transparent",
159
+ "colorB": "#ffffff"
160
+ },
161
+ "DotGrid": {
162
+ "opacity": 1,
163
+ "blendMode": "normal",
164
+ "color": "#ffffff",
165
+ "density": 100,
166
+ "dotSize": .3,
167
+ "twinkle": 0
168
+ },
169
+ "Duotone": {
170
+ "opacity": 1,
171
+ "blendMode": "normal",
172
+ "colorA": "#ff0000",
173
+ "colorB": "#023af4",
174
+ "blend": .5,
175
+ "colorSpace": "linear"
176
+ },
177
+ "FilmGrain": {
178
+ "opacity": 1,
179
+ "blendMode": "normal",
180
+ "strength": .5
181
+ },
182
+ "FloatingParticles": {
183
+ "opacity": 1,
184
+ "blendMode": "normal",
185
+ "randomness": .25,
186
+ "speed": .25,
187
+ "angle": 90,
188
+ "particleSize": 1,
189
+ "particleSoftness": 0,
190
+ "twinkle": .5,
191
+ "count": 5,
192
+ "particleColor": "#ffffff",
193
+ "speedVariance": .3,
194
+ "angleVariance": 30,
195
+ "particleDensity": 3
196
+ },
197
+ "GlassTiles": {
198
+ "opacity": 1,
199
+ "blendMode": "normal",
200
+ "intensity": 1,
201
+ "tileCount": 100
202
+ },
203
+ "Glow": {
204
+ "opacity": 1,
205
+ "blendMode": "normal",
206
+ "intensity": 1,
207
+ "threshold": .5,
208
+ "size": 10
209
+ },
210
+ "Godrays": {
211
+ "opacity": 1,
212
+ "blendMode": "normal",
213
+ "center": {
214
+ "x": 0,
215
+ "y": 0
216
+ },
217
+ "density": .3,
218
+ "intensity": .8,
219
+ "spotty": 1,
220
+ "speed": .5,
221
+ "rayColor": "#4283fb",
222
+ "backgroundColor": "transparent"
223
+ },
224
+ "Grayscale": {
225
+ "opacity": 1,
226
+ "blendMode": "normal"
227
+ },
228
+ "Grid": {
229
+ "opacity": 1,
230
+ "blendMode": "normal",
231
+ "color": "#ffffff",
232
+ "cells": 10,
233
+ "thickness": 1
234
+ },
235
+ "GridDistortion": {
236
+ "opacity": 1,
237
+ "blendMode": "normal",
238
+ "intensity": 1,
239
+ "swirl": 0,
240
+ "decay": 3,
241
+ "radius": 1,
242
+ "gridSize": 20,
243
+ "edges": "stretch"
244
+ },
245
+ "Group": {
246
+ "opacity": 1,
247
+ "blendMode": "normal"
248
+ },
249
+ "Halftone": {
250
+ "opacity": 1,
251
+ "blendMode": "normal",
252
+ "frequency": 100,
253
+ "angle": 45,
254
+ "smoothness": .1
255
+ },
256
+ "HueShift": {
257
+ "opacity": 1,
258
+ "blendMode": "normal",
259
+ "shift": 0
260
+ },
261
+ "ImageTexture": {
262
+ "opacity": 1,
263
+ "blendMode": "normal",
264
+ "url": "https://shaders.com/sample.jpg",
265
+ "objectFit": "cover"
266
+ },
267
+ "Invert": {
268
+ "opacity": 1,
269
+ "blendMode": "normal"
270
+ },
271
+ "LinearBlur": {
272
+ "opacity": 1,
273
+ "blendMode": "normal",
274
+ "intensity": 30,
275
+ "angle": 0
276
+ },
277
+ "LinearGradient": {
278
+ "opacity": 1,
279
+ "blendMode": "normal",
280
+ "colorA": "#1aff00",
281
+ "colorB": "#0000ff",
282
+ "start": {
283
+ "x": 0,
284
+ "y": .5
285
+ },
286
+ "end": {
287
+ "x": 1,
288
+ "y": .5
289
+ },
290
+ "angle": 0,
291
+ "edges": "stretch",
292
+ "colorSpace": "linear"
293
+ },
294
+ "Liquify": {
295
+ "opacity": 1,
296
+ "blendMode": "normal",
297
+ "intensity": 1,
298
+ "swirl": 0,
299
+ "decay": 3,
300
+ "radius": 1,
301
+ "edges": "stretch"
302
+ },
303
+ "Pixelate": {
304
+ "opacity": 1,
305
+ "blendMode": "normal",
306
+ "scale": 50
307
+ },
308
+ "PolarCoordinates": {
309
+ "opacity": 1,
310
+ "blendMode": "normal",
311
+ "center": {
312
+ "x": .5,
313
+ "y": .5
314
+ },
315
+ "wrap": 1,
316
+ "radius": 1,
317
+ "intensity": 1,
318
+ "edges": "transparent"
319
+ },
320
+ "Posterize": {
321
+ "opacity": 1,
322
+ "blendMode": "normal",
323
+ "intensity": 5
324
+ },
325
+ "ProgressiveBlur": {
326
+ "opacity": 1,
327
+ "blendMode": "normal",
328
+ "intensity": 50,
329
+ "angle": 0,
330
+ "center": {
331
+ "x": 0,
332
+ "y": .5
333
+ },
334
+ "falloff": 1
335
+ },
336
+ "RadialGradient": {
337
+ "opacity": 1,
338
+ "blendMode": "normal",
339
+ "colorA": "#ff0000",
340
+ "colorB": "#0000ff",
341
+ "center": {
342
+ "x": .5,
343
+ "y": .5
344
+ },
345
+ "radius": 1,
346
+ "colorSpace": "linear"
347
+ },
348
+ "RectangularCoordinates": {
349
+ "opacity": 1,
350
+ "blendMode": "normal",
351
+ "center": {
352
+ "x": .5,
353
+ "y": .5
354
+ },
355
+ "scale": 1,
356
+ "intensity": 1,
357
+ "edges": "transparent"
358
+ },
359
+ "Ripples": {
360
+ "opacity": 1,
361
+ "blendMode": "normal",
362
+ "center": {
363
+ "x": .5,
364
+ "y": .5
365
+ },
366
+ "colorA": "#ffffff",
367
+ "colorB": "#000000",
368
+ "speed": 1,
369
+ "frequency": 20,
370
+ "softness": 0,
371
+ "thickness": .5,
372
+ "phase": 0
373
+ },
374
+ "Saturation": {
375
+ "opacity": 1,
376
+ "blendMode": "normal",
377
+ "intensity": 1
378
+ },
379
+ "SimplexNoise": {
380
+ "opacity": 1,
381
+ "blendMode": "normal",
382
+ "colorA": "#ffffff",
383
+ "colorB": "#000000",
384
+ "scale": 2,
385
+ "balance": 0,
386
+ "contrast": 0,
387
+ "seed": 0,
388
+ "speed": 1
389
+ },
390
+ "SineWave": {
391
+ "opacity": 1,
392
+ "blendMode": "normal",
393
+ "color": "#ffffff",
394
+ "amplitude": .15,
395
+ "frequency": 1,
396
+ "speed": 1,
397
+ "angle": 0,
398
+ "position": {
399
+ "x": .5,
400
+ "y": .5
401
+ },
402
+ "thickness": .2,
403
+ "softness": .4
404
+ },
405
+ "SolidColor": {
406
+ "opacity": 1,
407
+ "blendMode": "normal",
408
+ "color": "#5b18ca"
409
+ },
410
+ "Spherize": {
411
+ "opacity": 1,
412
+ "blendMode": "normal",
413
+ "radius": 1,
414
+ "depth": 1,
415
+ "center": {
416
+ "x": .5,
417
+ "y": .5
418
+ },
419
+ "lightPosition": {
420
+ "x": .3,
421
+ "y": .3
422
+ },
423
+ "lightIntensity": .5,
424
+ "lightSoftness": .5,
425
+ "lightColor": "#ffffff"
426
+ },
427
+ "Spiral": {
428
+ "opacity": 1,
429
+ "blendMode": "normal",
430
+ "colorA": "#000000",
431
+ "colorB": "#ffffff",
432
+ "strokeWidth": .5,
433
+ "strokeFalloff": 0,
434
+ "softness": 0,
435
+ "speed": 1,
436
+ "center": {
437
+ "x": .5,
438
+ "y": .5
439
+ },
440
+ "scale": 1,
441
+ "colorSpace": "linear"
442
+ },
443
+ "Strands": {
444
+ "opacity": 1,
445
+ "blendMode": "normal",
446
+ "speed": .5,
447
+ "amplitude": 1,
448
+ "frequency": 1,
449
+ "lineCount": 12,
450
+ "lineWidth": .1,
451
+ "waveColor": "#f1c907",
452
+ "pinEdges": true,
453
+ "start": {
454
+ "x": 0,
455
+ "y": .5
456
+ },
457
+ "end": {
458
+ "x": 1,
459
+ "y": .5
460
+ }
461
+ },
462
+ "Stretch": {
463
+ "opacity": 1,
464
+ "blendMode": "normal",
465
+ "center": {
466
+ "x": .5,
467
+ "y": .5
468
+ },
469
+ "strength": 1,
470
+ "angle": 0,
471
+ "falloff": 0,
472
+ "edges": "stretch"
473
+ },
474
+ "Swirl": {
475
+ "opacity": 1,
476
+ "blendMode": "normal",
477
+ "colorA": "#1275d8",
478
+ "colorB": "#e19136",
479
+ "speed": 1,
480
+ "detail": 1,
481
+ "blend": 50,
482
+ "coarseX": 50,
483
+ "coarseY": 50,
484
+ "mediumX": 50,
485
+ "mediumY": 50,
486
+ "fineX": 50,
487
+ "fineY": 50,
488
+ "colorSpace": "linear"
489
+ },
490
+ "TiltShift": {
491
+ "opacity": 1,
492
+ "blendMode": "normal",
493
+ "intensity": 50,
494
+ "width": .3,
495
+ "falloff": .3,
496
+ "angle": 0,
497
+ "center": {
498
+ "x": .5,
499
+ "y": .5
500
+ }
501
+ },
502
+ "Tritone": {
503
+ "opacity": 1,
504
+ "blendMode": "normal",
505
+ "colorA": "#ce1bea",
506
+ "colorB": "#2fff00",
507
+ "colorC": "#ffff00",
508
+ "blendMid": .5,
509
+ "colorSpace": "linear"
510
+ },
511
+ "Twirl": {
512
+ "opacity": 1,
513
+ "blendMode": "normal",
514
+ "center": {
515
+ "x": .5,
516
+ "y": .5
517
+ },
518
+ "intensity": 1,
519
+ "edges": "stretch"
520
+ },
521
+ "Vibrance": {
522
+ "opacity": 1,
523
+ "blendMode": "normal",
524
+ "intensity": 0
525
+ },
526
+ "WaveDistortion": {
527
+ "opacity": 1,
528
+ "blendMode": "normal",
529
+ "strength": .3,
530
+ "frequency": 1,
531
+ "speed": 1,
532
+ "angle": 0,
533
+ "waveType": "sine",
534
+ "edges": "stretch"
535
+ },
536
+ "ZoomBlur": {
537
+ "opacity": 1,
538
+ "blendMode": "normal",
539
+ "intensity": 30,
540
+ "center": {
541
+ "x": .5,
542
+ "y": .5
543
+ }
544
+ }
545
+ };
546
+ function generatePropString(props, componentType, indent = " ") {
547
+ return Object.entries(props).filter(([key, value]) => {
548
+ const componentDefaults = shaderMetadata[componentType] || {};
549
+ if (componentDefaults.hasOwnProperty(key)) {
550
+ const defaultValue = componentDefaults[key];
551
+ if (typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
552
+ return value !== defaultValue;
553
+ }
554
+ if (key === "opacity" && value === 1) return false;
555
+ if (key === "blendMode" && value === "normal") return false;
556
+ return true;
557
+ }).map(([key, value]) => {
558
+ const kebabKey = camelToKebab(key);
559
+ if (typeof value === "string") return `${kebabKey}="${value}"`;
560
+ else if (typeof value === "object") return `:${kebabKey}="${JSON.stringify(value).replace(/"/g, "'").replace(/'/g, "'")}"`;
561
+ else return `:${kebabKey}="${value}"`;
562
+ }).join("\n" + indent + " ");
563
+ }
564
+ function isIdUsedAsMaskSource(id, allComponents) {
565
+ const flatComponents = [];
566
+ function flattenComponents(components) {
567
+ for (const component of components) {
568
+ flatComponents.push(component);
569
+ if (component.children) flattenComponents(component.children);
570
+ }
571
+ }
572
+ flattenComponents(allComponents);
573
+ return flatComponents.some((component) => component.props?.maskSource === id);
574
+ }
575
+ function generatePresetCode(preset) {
576
+ const generateComponentString = (config, indent = " ") => {
577
+ const propString = config.props ? generatePropString(config.props, config.type, indent) : "";
578
+ let idString = "";
579
+ if (config.id) {
580
+ if (isIdUsedAsMaskSource(config.id, preset.components)) idString = `id="${config.id}"`;
581
+ }
582
+ const attributes = [idString, propString].filter(Boolean).join("\n" + indent + " ");
583
+ if (config.children && config.children.length > 0) {
584
+ const childrenString = config.children.map((child) => generateComponentString(child, indent + " ")).join("\n");
585
+ if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}>\n${childrenString}\n${indent}</${config.type}>`;
586
+ else return `${indent}<${config.type}>\n${childrenString}\n${indent}</${config.type}>`;
587
+ } else if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}/>`;
588
+ else return `${indent}<${config.type}/>`;
589
+ };
590
+ return `<Shader>\n${preset.components.map((config) => generateComponentString(config)).join("\n")}\n</Shader>`;
591
+ }
592
+ const availableComponents = [
593
+ "AngularBlur",
594
+ "Ascii",
595
+ "Beam",
596
+ "Blob",
597
+ "Blur",
598
+ "Bulge",
599
+ "CRTScreen",
600
+ "ChannelBlur",
601
+ "Checkerboard",
602
+ "ChromaFlow",
603
+ "ChromaticAberration",
604
+ "Circle",
605
+ "CursorTrail",
606
+ "DiffuseBlur",
607
+ "Dither",
608
+ "DotGrid",
609
+ "Duotone",
610
+ "FilmGrain",
611
+ "FloatingParticles",
612
+ "GlassTiles",
613
+ "Glow",
614
+ "Godrays",
615
+ "Grayscale",
616
+ "Grid",
617
+ "GridDistortion",
618
+ "Group",
619
+ "Halftone",
620
+ "HueShift",
621
+ "ImageTexture",
622
+ "Invert",
623
+ "LinearBlur",
624
+ "LinearGradient",
625
+ "Liquify",
626
+ "Pixelate",
627
+ "PolarCoordinates",
628
+ "Posterize",
629
+ "ProgressiveBlur",
630
+ "RadialGradient",
631
+ "RectangularCoordinates",
632
+ "Ripples",
633
+ "Saturation",
634
+ "SimplexNoise",
635
+ "SineWave",
636
+ "SolidColor",
637
+ "Spherize",
638
+ "Spiral",
639
+ "Strands",
640
+ "Stretch",
641
+ "Swirl",
642
+ "TiltShift",
643
+ "Tritone",
644
+ "Twirl",
645
+ "Vibrance",
646
+ "WaveDistortion",
647
+ "ZoomBlur"
648
+ ];
649
+ export { generatePresetCode as n, availableComponents as t };