shaders 2.5.112 → 2.5.113

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.
@@ -1,2 +1,1578 @@
1
- import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-DAEzZxbM.js";
1
+ var DEFAULT_TRANSFORM = {
2
+ offsetX: 0,
3
+ offsetY: 0,
4
+ rotation: 0,
5
+ scale: 1,
6
+ anchorX: .5,
7
+ anchorY: .5,
8
+ edges: "transparent"
9
+ };
10
+ function toObjectLiteral(obj) {
11
+ return `{ ${Object.entries(obj).map(([key, value]) => {
12
+ return `${key}: ${typeof value === "string" ? `"${value}"` : value}`;
13
+ }).join(", ")} }`;
14
+ }
15
+ var shaderMetadata = {
16
+ "AngularBlur": {
17
+ "opacity": 1,
18
+ "blendMode": "normal",
19
+ "intensity": 20,
20
+ "center": {
21
+ "x": .5,
22
+ "y": .5
23
+ }
24
+ },
25
+ "Ascii": {
26
+ "opacity": 1,
27
+ "blendMode": "normal",
28
+ "characters": "@%#*+=-:.",
29
+ "cellSize": 30,
30
+ "fontFamily": "JetBrains Mono",
31
+ "spacing": 1,
32
+ "gamma": 1,
33
+ "alphaThreshold": 0,
34
+ "preserveAlpha": true
35
+ },
36
+ "Aurora": {
37
+ "opacity": 1,
38
+ "blendMode": "normal",
39
+ "colorA": "#a533f8",
40
+ "colorB": "#22ee88",
41
+ "colorC": "#1694e8",
42
+ "colorSpace": "linear",
43
+ "balance": 50,
44
+ "intensity": 80,
45
+ "curtainCount": 4,
46
+ "speed": 5,
47
+ "waviness": 50,
48
+ "rayDensity": 20,
49
+ "height": 120,
50
+ "center": {
51
+ "x": .5,
52
+ "y": 0
53
+ },
54
+ "seed": 0
55
+ },
56
+ "Beam": {
57
+ "opacity": 1,
58
+ "blendMode": "normal",
59
+ "startPosition": {
60
+ "x": .2,
61
+ "y": .5
62
+ },
63
+ "endPosition": {
64
+ "x": .8,
65
+ "y": .5
66
+ },
67
+ "startThickness": .2,
68
+ "endThickness": .2,
69
+ "startSoftness": .5,
70
+ "endSoftness": .5,
71
+ "insideColor": "#FF0000",
72
+ "outsideColor": "#0000FF",
73
+ "colorSpace": "linear"
74
+ },
75
+ "Blob": {
76
+ "opacity": 1,
77
+ "blendMode": "normal",
78
+ "colorA": "#ff6b35",
79
+ "colorB": "#e91e63",
80
+ "size": .5,
81
+ "deformation": .5,
82
+ "softness": .5,
83
+ "highlightIntensity": .5,
84
+ "highlightX": .3,
85
+ "highlightY": -.3,
86
+ "highlightZ": .4,
87
+ "highlightColor": "#ffe11a",
88
+ "speed": .5,
89
+ "seed": 1,
90
+ "center": {
91
+ "x": .5,
92
+ "y": .5
93
+ },
94
+ "colorSpace": "linear"
95
+ },
96
+ "Blur": {
97
+ "opacity": 1,
98
+ "blendMode": "normal",
99
+ "intensity": 50
100
+ },
101
+ "BrightnessContrast": {
102
+ "opacity": 1,
103
+ "blendMode": "normal",
104
+ "brightness": 0,
105
+ "contrast": 0
106
+ },
107
+ "Bulge": {
108
+ "opacity": 1,
109
+ "blendMode": "normal",
110
+ "center": {
111
+ "x": .5,
112
+ "y": .5
113
+ },
114
+ "strength": 1,
115
+ "radius": 1,
116
+ "falloff": .5,
117
+ "edges": "stretch"
118
+ },
119
+ "ChannelBlur": {
120
+ "opacity": 1,
121
+ "blendMode": "normal",
122
+ "redIntensity": 0,
123
+ "greenIntensity": 20,
124
+ "blueIntensity": 40
125
+ },
126
+ "Checkerboard": {
127
+ "opacity": 1,
128
+ "blendMode": "normal",
129
+ "colorA": "#cccccc",
130
+ "colorB": "#999999",
131
+ "cells": 8,
132
+ "softness": 0,
133
+ "colorSpace": "linear"
134
+ },
135
+ "ChromaFlow": {
136
+ "opacity": 1,
137
+ "blendMode": "normal",
138
+ "baseColor": "#0066ff",
139
+ "upColor": "#00ff00",
140
+ "downColor": "#ff0000",
141
+ "leftColor": "#0000ff",
142
+ "rightColor": "#ffff00",
143
+ "intensity": 1,
144
+ "radius": 3,
145
+ "momentum": 30
146
+ },
147
+ "ChromaticAberration": {
148
+ "opacity": 1,
149
+ "blendMode": "normal",
150
+ "strength": .2,
151
+ "angle": 0,
152
+ "redOffset": -1,
153
+ "greenOffset": 0,
154
+ "blueOffset": 1
155
+ },
156
+ "Circle": {
157
+ "opacity": 1,
158
+ "blendMode": "normal",
159
+ "color": "#ffffff",
160
+ "radius": 1,
161
+ "softness": 0,
162
+ "center": {
163
+ "x": .5,
164
+ "y": .5
165
+ },
166
+ "strokeThickness": 0,
167
+ "strokeColor": "#000000",
168
+ "strokePosition": "center",
169
+ "colorSpace": "linear"
170
+ },
171
+ "ConcentricSpin": {
172
+ "opacity": 1,
173
+ "blendMode": "normal",
174
+ "intensity": 20,
175
+ "rings": 8,
176
+ "smoothness": .03,
177
+ "seed": 0,
178
+ "speed": .1,
179
+ "speedRandomness": .5,
180
+ "edges": "mirror",
181
+ "center": {
182
+ "x": .5,
183
+ "y": .5
184
+ }
185
+ },
186
+ "ConicGradient": {
187
+ "opacity": 1,
188
+ "blendMode": "normal",
189
+ "colorA": "#FF0080",
190
+ "colorB": "#00BFFF",
191
+ "center": {
192
+ "x": .5,
193
+ "y": .5
194
+ },
195
+ "rotation": 0,
196
+ "repeat": 1,
197
+ "colorSpace": "oklch"
198
+ },
199
+ "ContourLines": {
200
+ "opacity": 1,
201
+ "blendMode": "normal",
202
+ "levels": 5,
203
+ "lineWidth": 2,
204
+ "softness": 0,
205
+ "gamma": .5,
206
+ "invert": false,
207
+ "source": "luminance",
208
+ "colorMode": "source",
209
+ "lineColor": "#000000",
210
+ "backgroundColor": "transparent"
211
+ },
212
+ "Crescent": {
213
+ "opacity": 1,
214
+ "blendMode": "normal",
215
+ "color": "#ffffff",
216
+ "center": {
217
+ "x": .5,
218
+ "y": .5
219
+ },
220
+ "radius": .3,
221
+ "innerRatio": .8,
222
+ "offset": .2,
223
+ "rotation": 0,
224
+ "softness": 0,
225
+ "strokeThickness": 0,
226
+ "strokeColor": "#000000",
227
+ "strokePosition": "center",
228
+ "colorSpace": "linear"
229
+ },
230
+ "Cross": {
231
+ "opacity": 1,
232
+ "blendMode": "normal",
233
+ "color": "#ffffff",
234
+ "center": {
235
+ "x": .5,
236
+ "y": .5
237
+ },
238
+ "radius": .35,
239
+ "thickness": .08,
240
+ "rounding": 0,
241
+ "rotation": 0,
242
+ "softness": 0,
243
+ "strokeThickness": 0,
244
+ "strokeColor": "#000000",
245
+ "strokePosition": "center",
246
+ "colorSpace": "linear"
247
+ },
248
+ "CRTScreen": {
249
+ "opacity": 1,
250
+ "blendMode": "normal",
251
+ "pixelSize": 128,
252
+ "colorShift": 1,
253
+ "scanlineIntensity": .3,
254
+ "scanlineFrequency": 200,
255
+ "brightness": 1,
256
+ "contrast": 1,
257
+ "vignetteIntensity": 1,
258
+ "vignetteRadius": .5
259
+ },
260
+ "Crystal": {
261
+ "opacity": 1,
262
+ "blendMode": "normal",
263
+ "center": {
264
+ "x": .5,
265
+ "y": .5
266
+ },
267
+ "scale": 1,
268
+ "cutout": false,
269
+ "refraction": .5,
270
+ "dispersion": .5,
271
+ "facets": 5,
272
+ "fresnel": .05,
273
+ "fresnelSoftness": 1,
274
+ "fresnelColor": "#ffffff",
275
+ "edgeSoftness": 0,
276
+ "innerZoom": 1.5,
277
+ "lightAngle": 270,
278
+ "highlights": .5,
279
+ "shadows": .3,
280
+ "brightness": 1.2,
281
+ "tintColor": "#e8e0ff",
282
+ "tintIntensity": 0,
283
+ "tintPreserveLuminosity": true,
284
+ "shape": "{\"type\":\"polygonSDF\",\"radius\":0.35,\"sides\":10}"
285
+ },
286
+ "CursorRipples": {
287
+ "opacity": 1,
288
+ "blendMode": "normal",
289
+ "intensity": 10,
290
+ "decay": 10,
291
+ "radius": .5,
292
+ "chromaticSplit": 1,
293
+ "edges": "stretch"
294
+ },
295
+ "CursorTrail": {
296
+ "opacity": 1,
297
+ "blendMode": "normal",
298
+ "colorA": "#00aaff",
299
+ "colorB": "#ff00aa",
300
+ "radius": .5,
301
+ "length": .5,
302
+ "shrink": 1,
303
+ "colorSpace": "linear"
304
+ },
305
+ "DiamondGradient": {
306
+ "opacity": 1,
307
+ "blendMode": "normal",
308
+ "colorA": "#4ffb4a",
309
+ "colorB": "#4f1238",
310
+ "center": {
311
+ "x": .5,
312
+ "y": .5
313
+ },
314
+ "size": .7,
315
+ "rotation": 0,
316
+ "repeat": 1,
317
+ "roundness": 0,
318
+ "colorSpace": "oklch"
319
+ },
320
+ "DiffuseBlur": {
321
+ "opacity": 1,
322
+ "blendMode": "normal",
323
+ "intensity": 30,
324
+ "edges": "stretch"
325
+ },
326
+ "Dither": {
327
+ "opacity": 1,
328
+ "blendMode": "normal",
329
+ "pattern": "bayer4",
330
+ "pixelSize": 4,
331
+ "threshold": .5,
332
+ "spread": 1,
333
+ "colorMode": "custom",
334
+ "colorA": "transparent",
335
+ "colorB": "#ffffff"
336
+ },
337
+ "DOMTexture": {
338
+ "opacity": 1,
339
+ "blendMode": "normal"
340
+ },
341
+ "DotGrid": {
342
+ "opacity": 1,
343
+ "blendMode": "normal",
344
+ "color": "#ffffff",
345
+ "density": 30,
346
+ "dotSize": .3,
347
+ "twinkle": 0
348
+ },
349
+ "DropShadow": {
350
+ "opacity": 1,
351
+ "blendMode": "normal",
352
+ "color": "#000000",
353
+ "distance": .1,
354
+ "angle": 135,
355
+ "blur": 5,
356
+ "intensity": .5,
357
+ "cutout": false
358
+ },
359
+ "Duotone": {
360
+ "opacity": 1,
361
+ "blendMode": "normal",
362
+ "colorA": "#ff0000",
363
+ "colorB": "#023af4",
364
+ "blend": .5,
365
+ "colorSpace": "linear"
366
+ },
367
+ "Ellipse": {
368
+ "opacity": 1,
369
+ "blendMode": "normal",
370
+ "color": "#ffffff",
371
+ "center": {
372
+ "x": .5,
373
+ "y": .5
374
+ },
375
+ "radiusX": .35,
376
+ "radiusY": .2,
377
+ "rotation": 0,
378
+ "softness": 0,
379
+ "strokeThickness": 0,
380
+ "strokeColor": "#000000",
381
+ "strokePosition": "center",
382
+ "colorSpace": "linear"
383
+ },
384
+ "Emboss": {
385
+ "opacity": 1,
386
+ "blendMode": "normal",
387
+ "center": {
388
+ "x": .5,
389
+ "y": .5
390
+ },
391
+ "scale": 1,
392
+ "depth": -.5,
393
+ "lightAngle": 260,
394
+ "lightIntensity": .6,
395
+ "shadowIntensity": .3,
396
+ "shape": "{\"type\":\"circleSDF\",\"radius\":0.35}"
397
+ },
398
+ "FallingLines": {
399
+ "opacity": 1,
400
+ "blendMode": "normal",
401
+ "colorA": "#ffffff",
402
+ "colorB": "#ffffff00",
403
+ "colorSpace": "linear",
404
+ "angle": 90,
405
+ "speed": .5,
406
+ "speedVariance": .3,
407
+ "density": 15,
408
+ "trailLength": .35,
409
+ "balance": .5,
410
+ "strokeWidth": .15,
411
+ "rounding": 1
412
+ },
413
+ "FilmGrain": {
414
+ "opacity": 1,
415
+ "blendMode": "normal",
416
+ "strength": .5,
417
+ "bias": 2,
418
+ "animated": false
419
+ },
420
+ "FloatingParticles": {
421
+ "opacity": 1,
422
+ "blendMode": "normal",
423
+ "randomness": .25,
424
+ "speed": .25,
425
+ "angle": 90,
426
+ "particleSize": 1,
427
+ "particleSoftness": 0,
428
+ "twinkle": .5,
429
+ "count": 5,
430
+ "particleColor": "#ffffff",
431
+ "speedVariance": .3,
432
+ "angleVariance": 30,
433
+ "particleDensity": 3
434
+ },
435
+ "Flower": {
436
+ "opacity": 1,
437
+ "blendMode": "normal",
438
+ "color": "#ffffff",
439
+ "center": {
440
+ "x": .5,
441
+ "y": .5
442
+ },
443
+ "radius": .4,
444
+ "sides": 5,
445
+ "innerRatio": .4,
446
+ "rotation": 0,
447
+ "softness": 0,
448
+ "strokeThickness": 0,
449
+ "strokeColor": "#000000",
450
+ "strokePosition": "center",
451
+ "colorSpace": "linear"
452
+ },
453
+ "FlowField": {
454
+ "opacity": 1,
455
+ "blendMode": "normal",
456
+ "strength": .15,
457
+ "detail": 2,
458
+ "speed": 0,
459
+ "evolutionSpeed": 0,
460
+ "edges": "mirror"
461
+ },
462
+ "FlowingGradient": {
463
+ "opacity": 1,
464
+ "blendMode": "normal",
465
+ "colorA": "#0a0015",
466
+ "colorB": "#6b17e6",
467
+ "colorC": "#ff4d6a",
468
+ "colorD": "#ff6b35",
469
+ "colorSpace": "oklch",
470
+ "speed": 1,
471
+ "distortion": .5,
472
+ "seed": 0
473
+ },
474
+ "FlutedGlass": {
475
+ "opacity": 1,
476
+ "blendMode": "normal",
477
+ "shape": "bars",
478
+ "angle": 0,
479
+ "frequency": 10,
480
+ "softness": .5,
481
+ "waveAmplitude": .06,
482
+ "waveFrequency": 1.5,
483
+ "speed": 0,
484
+ "refraction": 1.5,
485
+ "aberration": .2,
486
+ "lightAngle": 30,
487
+ "highlight": .2,
488
+ "highlightSoftness": .3,
489
+ "highlightColor": "#ffffff",
490
+ "edges": "mirror"
491
+ },
492
+ "Fog": {
493
+ "opacity": 1,
494
+ "blendMode": "normal",
495
+ "colorA": "#e0e0e0",
496
+ "colorB": "#888888",
497
+ "seed": 0,
498
+ "speed": 1,
499
+ "turbulence": 1,
500
+ "detail": 15,
501
+ "blending": .3,
502
+ "mouseInfluence": .1,
503
+ "mouseRadius": .1,
504
+ "colorSpace": "linear"
505
+ },
506
+ "Form3D": {
507
+ "opacity": 1,
508
+ "blendMode": "normal",
509
+ "shape3d": "{\"type\":\"ribbon\",\"angle\":0,\"twist\":50,\"width\":40,\"thickness\":20,\"seed\":0}",
510
+ "center": {
511
+ "x": .5,
512
+ "y": .5
513
+ },
514
+ "zoom": 50,
515
+ "glossiness": 50,
516
+ "lighting": 50,
517
+ "uvMode": "stretch",
518
+ "speed": 1
519
+ },
520
+ "Glass": {
521
+ "opacity": 1,
522
+ "blendMode": "normal",
523
+ "center": {
524
+ "x": .5,
525
+ "y": .5
526
+ },
527
+ "scale": 1,
528
+ "cutout": false,
529
+ "refraction": 1,
530
+ "edgeSoftness": .1,
531
+ "blur": 0,
532
+ "thickness": .2,
533
+ "aberration": .5,
534
+ "innerZoom": 1,
535
+ "lightAngle": 300,
536
+ "highlight": .05,
537
+ "highlightColor": "#ffffff",
538
+ "highlightSoftness": .5,
539
+ "fresnel": .1,
540
+ "fresnelSoftness": .1,
541
+ "fresnelColor": "#ffffff",
542
+ "tintColor": "#ffffff",
543
+ "tintIntensity": 0,
544
+ "tintPreserveLuminosity": true,
545
+ "shape": "{\"type\":\"circleSDF\",\"radius\":0.35}"
546
+ },
547
+ "GlassTiles": {
548
+ "opacity": 1,
549
+ "blendMode": "normal",
550
+ "intensity": 2,
551
+ "tileCount": 20,
552
+ "rotation": 0,
553
+ "roundness": 0
554
+ },
555
+ "Glitch": {
556
+ "opacity": 1,
557
+ "blendMode": "normal",
558
+ "intensity": .5,
559
+ "speed": 1,
560
+ "rgbShift": 5,
561
+ "blockDensity": 10,
562
+ "colorBarIntensity": .2,
563
+ "mirrorAmount": .3,
564
+ "scanlineIntensity": .2
565
+ },
566
+ "Glow": {
567
+ "opacity": 1,
568
+ "blendMode": "normal",
569
+ "intensity": 1,
570
+ "threshold": .5,
571
+ "size": 25
572
+ },
573
+ "Godrays": {
574
+ "opacity": 1,
575
+ "blendMode": "normal",
576
+ "center": {
577
+ "x": 0,
578
+ "y": 0
579
+ },
580
+ "density": .3,
581
+ "intensity": .8,
582
+ "spotty": 1,
583
+ "speed": .5,
584
+ "rayColor": "#4283fb",
585
+ "backgroundColor": "transparent"
586
+ },
587
+ "Grayscale": {
588
+ "opacity": 1,
589
+ "blendMode": "normal"
590
+ },
591
+ "Grid": {
592
+ "opacity": 1,
593
+ "blendMode": "normal",
594
+ "color": "#ffffff",
595
+ "cells": 10,
596
+ "thickness": 1,
597
+ "rotation": 0
598
+ },
599
+ "GridDistortion": {
600
+ "opacity": 1,
601
+ "blendMode": "normal",
602
+ "intensity": 1,
603
+ "decay": 3,
604
+ "radius": 1,
605
+ "gridSize": 20,
606
+ "edges": "stretch"
607
+ },
608
+ "Group": {
609
+ "opacity": 1,
610
+ "blendMode": "normal"
611
+ },
612
+ "Halftone": {
613
+ "opacity": 1,
614
+ "blendMode": "normal",
615
+ "style": "classic",
616
+ "frequency": 100,
617
+ "angle": 45,
618
+ "cyanAngle": 15,
619
+ "magentaAngle": 75,
620
+ "yellowAngle": 0,
621
+ "blackAngle": 45,
622
+ "misprint": 0,
623
+ "misprintAngle": 0,
624
+ "paperColor": "#ffffff",
625
+ "cyanColor": "#00ffff",
626
+ "magentaColor": "#ff00ff",
627
+ "yellowColor": "#ffff00",
628
+ "blackColor": "#000000"
629
+ },
630
+ "HexGrid": {
631
+ "opacity": 1,
632
+ "blendMode": "normal",
633
+ "colorA": "#000000",
634
+ "colorB": "#ffffff",
635
+ "cells": 8,
636
+ "thickness": 1,
637
+ "colorSpace": "linear"
638
+ },
639
+ "HueShift": {
640
+ "opacity": 1,
641
+ "blendMode": "normal",
642
+ "shift": 0
643
+ },
644
+ "ImageTexture": {
645
+ "opacity": 1,
646
+ "blendMode": "normal",
647
+ "url": "https://shaders.com/sample.jpg",
648
+ "objectFit": "cover"
649
+ },
650
+ "Invert": {
651
+ "opacity": 1,
652
+ "blendMode": "normal"
653
+ },
654
+ "Kaleidoscope": {
655
+ "opacity": 1,
656
+ "blendMode": "normal",
657
+ "center": {
658
+ "x": .5,
659
+ "y": .5
660
+ },
661
+ "segments": 6,
662
+ "angle": 0,
663
+ "edges": "mirror"
664
+ },
665
+ "LensFlare": {
666
+ "opacity": 1,
667
+ "blendMode": "normal",
668
+ "lightPosition": {
669
+ "x": .3,
670
+ "y": .3
671
+ },
672
+ "intensity": .5,
673
+ "ghostIntensity": .4,
674
+ "ghostSpread": .7,
675
+ "ghostChroma": .3,
676
+ "haloIntensity": .4,
677
+ "haloRadius": .6,
678
+ "haloChroma": .6,
679
+ "haloSoftness": .8,
680
+ "starburstIntensity": .3,
681
+ "starburstPoints": 6,
682
+ "streakIntensity": .15,
683
+ "streakLength": .5,
684
+ "glareIntensity": .2,
685
+ "glareSize": .5,
686
+ "edgeFade": .2,
687
+ "speed": .5
688
+ },
689
+ "LinearBlur": {
690
+ "opacity": 1,
691
+ "blendMode": "normal",
692
+ "intensity": 30,
693
+ "angle": 0
694
+ },
695
+ "LinearGradient": {
696
+ "opacity": 1,
697
+ "blendMode": "normal",
698
+ "colorA": "#1aff00",
699
+ "colorB": "#0000ff",
700
+ "start": {
701
+ "x": 0,
702
+ "y": .5
703
+ },
704
+ "end": {
705
+ "x": 1,
706
+ "y": .5
707
+ },
708
+ "angle": 0,
709
+ "edges": "stretch",
710
+ "colorSpace": "linear"
711
+ },
712
+ "Liquify": {
713
+ "opacity": 1,
714
+ "blendMode": "normal",
715
+ "intensity": 10,
716
+ "stiffness": 3,
717
+ "damping": 3,
718
+ "radius": 1,
719
+ "edges": "stretch"
720
+ },
721
+ "Mirror": {
722
+ "opacity": 1,
723
+ "blendMode": "normal",
724
+ "center": {
725
+ "x": .5,
726
+ "y": .5
727
+ },
728
+ "angle": 0,
729
+ "edges": "mirror"
730
+ },
731
+ "MultiPointGradient": {
732
+ "opacity": 1,
733
+ "blendMode": "normal",
734
+ "colorA": "#4776E6",
735
+ "positionA": {
736
+ "x": .2,
737
+ "y": .2
738
+ },
739
+ "colorB": "#C44DFF",
740
+ "positionB": {
741
+ "x": .8,
742
+ "y": .2
743
+ },
744
+ "colorC": "#1ABC9C",
745
+ "positionC": {
746
+ "x": .2,
747
+ "y": .8
748
+ },
749
+ "colorD": "#F8BBD9",
750
+ "positionD": {
751
+ "x": .8,
752
+ "y": .8
753
+ },
754
+ "colorE": "#FF8C42",
755
+ "positionE": {
756
+ "x": .5,
757
+ "y": .5
758
+ },
759
+ "smoothness": 2
760
+ },
761
+ "Neon": {
762
+ "opacity": 1,
763
+ "blendMode": "normal",
764
+ "center": {
765
+ "x": .5,
766
+ "y": .5
767
+ },
768
+ "scale": 1,
769
+ "color": "#00ddff",
770
+ "secondaryColor": "#ff00aa",
771
+ "secondaryBlend": .5,
772
+ "glowColor": "#00ddff",
773
+ "tubeThickness": .2,
774
+ "intensity": 1.5,
775
+ "hotCoreIntensity": .6,
776
+ "glowIntensity": .6,
777
+ "glowRadius": .25,
778
+ "lightAngle": 300,
779
+ "specularIntensity": .5,
780
+ "specularSize": .5,
781
+ "cornerSmoothing": .15,
782
+ "flickerSpeed": 0,
783
+ "flickerAmount": .2,
784
+ "flowSpeed": 0,
785
+ "flowAmount": .3,
786
+ "shape": "{\"type\":\"circleSDF\",\"radius\":0.35}"
787
+ },
788
+ "Paper": {
789
+ "opacity": 1,
790
+ "blendMode": "normal",
791
+ "roughness": .3,
792
+ "grainScale": 1,
793
+ "displacement": .15,
794
+ "seed": 0
795
+ },
796
+ "Perspective": {
797
+ "opacity": 1,
798
+ "blendMode": "normal",
799
+ "center": {
800
+ "x": .5,
801
+ "y": .5
802
+ },
803
+ "pan": 0,
804
+ "tilt": 0,
805
+ "fov": 60,
806
+ "zoom": 1,
807
+ "offset": {
808
+ "x": .5,
809
+ "y": .5
810
+ },
811
+ "edges": "transparent"
812
+ },
813
+ "Pixelate": {
814
+ "opacity": 1,
815
+ "blendMode": "normal",
816
+ "scale": 50,
817
+ "gap": 0,
818
+ "roundness": 0
819
+ },
820
+ "Plasma": {
821
+ "opacity": 1,
822
+ "blendMode": "normal",
823
+ "density": 2,
824
+ "speed": 2,
825
+ "intensity": 1.5,
826
+ "warp": .4,
827
+ "contrast": 1,
828
+ "balance": 50,
829
+ "colorA": "#7018be",
830
+ "colorB": "#000000",
831
+ "colorSpace": "linear"
832
+ },
833
+ "PolarCoordinates": {
834
+ "opacity": 1,
835
+ "blendMode": "normal",
836
+ "center": {
837
+ "x": .5,
838
+ "y": .5
839
+ },
840
+ "wrap": 1,
841
+ "radius": 1,
842
+ "intensity": 1,
843
+ "edges": "transparent"
844
+ },
845
+ "Polygon": {
846
+ "opacity": 1,
847
+ "blendMode": "normal",
848
+ "color": "#ffffff",
849
+ "center": {
850
+ "x": .5,
851
+ "y": .5
852
+ },
853
+ "radius": .4,
854
+ "sides": 6,
855
+ "rounding": 0,
856
+ "rotation": 0,
857
+ "softness": 0,
858
+ "strokeThickness": 0,
859
+ "strokeColor": "#000000",
860
+ "strokePosition": "center",
861
+ "colorSpace": "linear"
862
+ },
863
+ "Posterize": {
864
+ "opacity": 1,
865
+ "blendMode": "normal",
866
+ "intensity": 5
867
+ },
868
+ "ProgressiveBlur": {
869
+ "opacity": 1,
870
+ "blendMode": "normal",
871
+ "intensity": 50,
872
+ "angle": 0,
873
+ "center": {
874
+ "x": 0,
875
+ "y": .5
876
+ },
877
+ "falloff": 1
878
+ },
879
+ "RadialGradient": {
880
+ "opacity": 1,
881
+ "blendMode": "normal",
882
+ "colorA": "#ff0000",
883
+ "colorB": "#0000ff",
884
+ "center": {
885
+ "x": .5,
886
+ "y": .5
887
+ },
888
+ "radius": 1,
889
+ "repeat": 1,
890
+ "aspect": 1,
891
+ "skewAngle": 0,
892
+ "colorSpace": "linear"
893
+ },
894
+ "RectangularCoordinates": {
895
+ "opacity": 1,
896
+ "blendMode": "normal",
897
+ "center": {
898
+ "x": .5,
899
+ "y": .5
900
+ },
901
+ "scale": 1,
902
+ "intensity": 1,
903
+ "edges": "transparent"
904
+ },
905
+ "Ring": {
906
+ "opacity": 1,
907
+ "blendMode": "normal",
908
+ "color": "#ffffff",
909
+ "center": {
910
+ "x": .5,
911
+ "y": .5
912
+ },
913
+ "radius": .3,
914
+ "thickness": .07,
915
+ "softness": 0,
916
+ "strokeThickness": 0,
917
+ "strokeColor": "#000000",
918
+ "strokePosition": "center",
919
+ "colorSpace": "linear"
920
+ },
921
+ "Ripples": {
922
+ "opacity": 1,
923
+ "blendMode": "normal",
924
+ "center": {
925
+ "x": .5,
926
+ "y": .5
927
+ },
928
+ "colorA": "#ffffff",
929
+ "colorB": "#000000",
930
+ "speed": 1,
931
+ "frequency": 20,
932
+ "softness": 0,
933
+ "thickness": .5,
934
+ "phase": 0
935
+ },
936
+ "RoundedRect": {
937
+ "opacity": 1,
938
+ "blendMode": "normal",
939
+ "color": "#ffffff",
940
+ "center": {
941
+ "x": .5,
942
+ "y": .5
943
+ },
944
+ "width": .35,
945
+ "height": .25,
946
+ "rounding": .05,
947
+ "rotation": 0,
948
+ "softness": 0,
949
+ "strokeThickness": 0,
950
+ "strokeColor": "#000000",
951
+ "strokePosition": "center",
952
+ "colorSpace": "linear"
953
+ },
954
+ "Saturation": {
955
+ "opacity": 1,
956
+ "blendMode": "normal",
957
+ "intensity": 1
958
+ },
959
+ "Sharpness": {
960
+ "opacity": 1,
961
+ "blendMode": "normal",
962
+ "sharpness": 0
963
+ },
964
+ "Shatter": {
965
+ "opacity": 1,
966
+ "blendMode": "normal",
967
+ "crackWidth": 1,
968
+ "intensity": 4,
969
+ "radius": .4,
970
+ "decay": 1,
971
+ "seed": 2,
972
+ "chromaticSplit": 1,
973
+ "refractionStrength": 5,
974
+ "shardLighting": .1,
975
+ "edges": "mirror"
976
+ },
977
+ "SimplexNoise": {
978
+ "opacity": 1,
979
+ "blendMode": "normal",
980
+ "colorA": "#ffffff",
981
+ "colorB": "#000000",
982
+ "colorSpace": "linear",
983
+ "scale": 2,
984
+ "balance": 0,
985
+ "contrast": 0,
986
+ "seed": 0,
987
+ "speed": 1
988
+ },
989
+ "SineWave": {
990
+ "opacity": 1,
991
+ "blendMode": "normal",
992
+ "color": "#ffffff",
993
+ "amplitude": .15,
994
+ "frequency": 1,
995
+ "speed": 1,
996
+ "angle": 0,
997
+ "position": {
998
+ "x": .5,
999
+ "y": .5
1000
+ },
1001
+ "thickness": .2,
1002
+ "softness": .4
1003
+ },
1004
+ "Smoke": {
1005
+ "opacity": 1,
1006
+ "blendMode": "normal",
1007
+ "colorA": "#fc83f9",
1008
+ "colorB": "#c21c79",
1009
+ "emitFrom": {
1010
+ "x": .5,
1011
+ "y": 1
1012
+ },
1013
+ "direction": 0,
1014
+ "speed": 20,
1015
+ "spread": 60,
1016
+ "emitRadius": .08,
1017
+ "intensity": 1,
1018
+ "dissipation": .2,
1019
+ "detail": 25,
1020
+ "gravity": .5,
1021
+ "colorDecay": .4,
1022
+ "mouseInfluence": .1,
1023
+ "mouseRadius": .1,
1024
+ "colorSpace": "linear"
1025
+ },
1026
+ "SmokeFill": {
1027
+ "opacity": 1,
1028
+ "blendMode": "normal",
1029
+ "colorA": "#8cf3ff",
1030
+ "colorB": "#04a0d6",
1031
+ "center": {
1032
+ "x": .5,
1033
+ "y": .5
1034
+ },
1035
+ "scale": 1,
1036
+ "emitFrom": {
1037
+ "x": .5,
1038
+ "y": .5
1039
+ },
1040
+ "direction": 0,
1041
+ "speed": 10,
1042
+ "spread": 60,
1043
+ "emitRadius": .03,
1044
+ "intensity": 1,
1045
+ "dissipation": .3,
1046
+ "detail": 25,
1047
+ "gravity": .5,
1048
+ "colorDecay": .4,
1049
+ "mouseInfluence": .1,
1050
+ "mouseRadius": .1,
1051
+ "colorSpace": "linear",
1052
+ "shape": "{\"type\":\"circleSDF\",\"radius\":0.35}"
1053
+ },
1054
+ "Solarize": {
1055
+ "opacity": 1,
1056
+ "blendMode": "normal",
1057
+ "threshold": .5,
1058
+ "strength": 1
1059
+ },
1060
+ "SolidColor": {
1061
+ "opacity": 1,
1062
+ "blendMode": "normal",
1063
+ "color": "#5b18ca"
1064
+ },
1065
+ "Spherize": {
1066
+ "opacity": 1,
1067
+ "blendMode": "normal",
1068
+ "radius": 1,
1069
+ "depth": 1,
1070
+ "center": {
1071
+ "x": .5,
1072
+ "y": .5
1073
+ },
1074
+ "lightPosition": {
1075
+ "x": .3,
1076
+ "y": .3
1077
+ },
1078
+ "lightIntensity": .5,
1079
+ "lightSoftness": .5,
1080
+ "lightColor": "#ffffff"
1081
+ },
1082
+ "Spiral": {
1083
+ "opacity": 1,
1084
+ "blendMode": "normal",
1085
+ "colorA": "#000000",
1086
+ "colorB": "#ffffff",
1087
+ "strokeWidth": .5,
1088
+ "strokeFalloff": 0,
1089
+ "softness": 0,
1090
+ "speed": 1,
1091
+ "center": {
1092
+ "x": .5,
1093
+ "y": .5
1094
+ },
1095
+ "scale": 1,
1096
+ "colorSpace": "linear"
1097
+ },
1098
+ "Star": {
1099
+ "opacity": 1,
1100
+ "blendMode": "normal",
1101
+ "color": "#ffffff",
1102
+ "center": {
1103
+ "x": .5,
1104
+ "y": .5
1105
+ },
1106
+ "radius": .4,
1107
+ "sides": 5,
1108
+ "innerRatio": .4,
1109
+ "rotation": 0,
1110
+ "softness": 0,
1111
+ "strokeThickness": 0,
1112
+ "strokeColor": "#000000",
1113
+ "strokePosition": "center",
1114
+ "colorSpace": "linear"
1115
+ },
1116
+ "Strands": {
1117
+ "opacity": 1,
1118
+ "blendMode": "normal",
1119
+ "speed": .5,
1120
+ "amplitude": 1,
1121
+ "frequency": 1,
1122
+ "lineCount": 12,
1123
+ "lineWidth": .1,
1124
+ "waveColor": "#f1c907",
1125
+ "pinEdges": true,
1126
+ "start": {
1127
+ "x": 0,
1128
+ "y": .5
1129
+ },
1130
+ "end": {
1131
+ "x": 1,
1132
+ "y": .5
1133
+ }
1134
+ },
1135
+ "Stretch": {
1136
+ "opacity": 1,
1137
+ "blendMode": "normal",
1138
+ "center": {
1139
+ "x": .5,
1140
+ "y": .5
1141
+ },
1142
+ "strength": 1,
1143
+ "angle": 0,
1144
+ "falloff": 0,
1145
+ "edges": "stretch"
1146
+ },
1147
+ "Stripes": {
1148
+ "opacity": 1,
1149
+ "blendMode": "normal",
1150
+ "colorA": "#000000",
1151
+ "colorB": "#ffffff",
1152
+ "angle": 45,
1153
+ "density": 5,
1154
+ "balance": .5,
1155
+ "softness": 0,
1156
+ "speed": .2,
1157
+ "offset": 0,
1158
+ "colorSpace": "linear"
1159
+ },
1160
+ "StudioBackground": {
1161
+ "opacity": 1,
1162
+ "blendMode": "normal",
1163
+ "color": "#d8dbec",
1164
+ "keyColor": "#d5e4ea",
1165
+ "keyIntensity": 40,
1166
+ "keySoftness": 50,
1167
+ "fillColor": "#d5e4ea",
1168
+ "fillIntensity": 10,
1169
+ "fillSoftness": 70,
1170
+ "fillAngle": 70,
1171
+ "backColor": "#c8d4e8",
1172
+ "backIntensity": 20,
1173
+ "backSoftness": 80,
1174
+ "brightness": 20,
1175
+ "vignette": 0,
1176
+ "center": {
1177
+ "x": .5,
1178
+ "y": .8
1179
+ },
1180
+ "lightTarget": 100,
1181
+ "wallCurvature": 10,
1182
+ "ambientIntensity": 50,
1183
+ "ambientSpeed": 2,
1184
+ "seed": 0
1185
+ },
1186
+ "Swirl": {
1187
+ "opacity": 1,
1188
+ "blendMode": "normal",
1189
+ "colorA": "#1275d8",
1190
+ "colorB": "#e19136",
1191
+ "speed": 1,
1192
+ "detail": 1,
1193
+ "blend": 50,
1194
+ "colorSpace": "linear"
1195
+ },
1196
+ "TiltShift": {
1197
+ "opacity": 1,
1198
+ "blendMode": "normal",
1199
+ "intensity": 50,
1200
+ "width": .3,
1201
+ "falloff": .3,
1202
+ "angle": 0,
1203
+ "center": {
1204
+ "x": .5,
1205
+ "y": .5
1206
+ }
1207
+ },
1208
+ "Tint": {
1209
+ "opacity": 1,
1210
+ "blendMode": "normal",
1211
+ "color": "#ff8800",
1212
+ "amount": .5,
1213
+ "preserveLuminosity": true
1214
+ },
1215
+ "Trapezoid": {
1216
+ "opacity": 1,
1217
+ "blendMode": "normal",
1218
+ "color": "#ffffff",
1219
+ "center": {
1220
+ "x": .5,
1221
+ "y": .5
1222
+ },
1223
+ "bottomWidth": .35,
1224
+ "topWidth": .2,
1225
+ "height": .25,
1226
+ "rotation": 0,
1227
+ "softness": 0,
1228
+ "strokeThickness": 0,
1229
+ "strokeColor": "#000000",
1230
+ "strokePosition": "center",
1231
+ "colorSpace": "linear"
1232
+ },
1233
+ "Tritone": {
1234
+ "opacity": 1,
1235
+ "blendMode": "normal",
1236
+ "colorA": "#ce1bea",
1237
+ "colorB": "#2fff00",
1238
+ "colorC": "#ffff00",
1239
+ "blendMid": .5,
1240
+ "colorSpace": "linear"
1241
+ },
1242
+ "Truchet": {
1243
+ "opacity": 1,
1244
+ "blendMode": "normal",
1245
+ "colorA": "#000000",
1246
+ "colorB": "#ffffff",
1247
+ "cells": 10,
1248
+ "thickness": 2,
1249
+ "seed": 0,
1250
+ "colorSpace": "linear"
1251
+ },
1252
+ "Twirl": {
1253
+ "opacity": 1,
1254
+ "blendMode": "normal",
1255
+ "center": {
1256
+ "x": .5,
1257
+ "y": .5
1258
+ },
1259
+ "intensity": 1,
1260
+ "edges": "stretch"
1261
+ },
1262
+ "Vesica": {
1263
+ "opacity": 1,
1264
+ "blendMode": "normal",
1265
+ "color": "#ffffff",
1266
+ "center": {
1267
+ "x": .5,
1268
+ "y": .5
1269
+ },
1270
+ "radius": .35,
1271
+ "spread": .5,
1272
+ "rotation": 0,
1273
+ "softness": 0,
1274
+ "strokeThickness": 0,
1275
+ "strokeColor": "#000000",
1276
+ "strokePosition": "center",
1277
+ "colorSpace": "linear"
1278
+ },
1279
+ "VHS": {
1280
+ "opacity": 1,
1281
+ "blendMode": "normal",
1282
+ "wobble": 1,
1283
+ "scanlineNoise": .6,
1284
+ "smear": .2,
1285
+ "speed": 1
1286
+ },
1287
+ "Vibrance": {
1288
+ "opacity": 1,
1289
+ "blendMode": "normal",
1290
+ "intensity": 0
1291
+ },
1292
+ "VideoTexture": {
1293
+ "opacity": 1,
1294
+ "blendMode": "normal",
1295
+ "url": "https://shaders.com/sample.mp4",
1296
+ "objectFit": "cover",
1297
+ "loop": true
1298
+ },
1299
+ "Vignette": {
1300
+ "opacity": 1,
1301
+ "blendMode": "normal",
1302
+ "color": "#000000",
1303
+ "center": {
1304
+ "x": .5,
1305
+ "y": .5
1306
+ },
1307
+ "radius": .5,
1308
+ "falloff": .5,
1309
+ "intensity": 1
1310
+ },
1311
+ "Voronoi": {
1312
+ "opacity": 1,
1313
+ "blendMode": "normal",
1314
+ "colorA": "#3186cf",
1315
+ "colorB": "#fc02dd",
1316
+ "colorBorder": "#000000",
1317
+ "scale": 6,
1318
+ "speed": .5,
1319
+ "seed": 0,
1320
+ "edgeIntensity": .5,
1321
+ "edgeSoftness": .05,
1322
+ "colorSpace": "oklch"
1323
+ },
1324
+ "WaveDistortion": {
1325
+ "opacity": 1,
1326
+ "blendMode": "normal",
1327
+ "strength": .3,
1328
+ "frequency": 1,
1329
+ "speed": 1,
1330
+ "angle": 0,
1331
+ "waveType": "sine",
1332
+ "edges": "stretch"
1333
+ },
1334
+ "Weave": {
1335
+ "opacity": 1,
1336
+ "blendMode": "normal",
1337
+ "colorA": "#c4c4c4",
1338
+ "colorB": "#4d4d4d",
1339
+ "cells": 10,
1340
+ "gap": .25,
1341
+ "rotation": 0
1342
+ },
1343
+ "WebcamTexture": {
1344
+ "opacity": 1,
1345
+ "blendMode": "normal",
1346
+ "objectFit": "cover",
1347
+ "mirror": true
1348
+ },
1349
+ "ZoomBlur": {
1350
+ "opacity": 1,
1351
+ "blendMode": "normal",
1352
+ "intensity": 30,
1353
+ "center": {
1354
+ "x": .5,
1355
+ "y": .5
1356
+ }
1357
+ }
1358
+ };
1359
+ function isPropMapValue(value) {
1360
+ return typeof value === "object" && value !== null && "type" in value && value.type === "map";
1361
+ }
1362
+ function generatePropString(props, componentType, indent = " ") {
1363
+ return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
1364
+ if (key === "maskType" && value === "alpha") return false;
1365
+ if (key === "shape" && props.shapeSdfUrl) return false;
1366
+ if (key === "transform" && typeof value === "object") {
1367
+ if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
1368
+ }
1369
+ const componentDefaults = shaderMetadata[componentType] || {};
1370
+ if (componentDefaults.hasOwnProperty(key)) {
1371
+ const defaultValue = componentDefaults[key];
1372
+ if (value != null && defaultValue != null && typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
1373
+ return value !== defaultValue;
1374
+ }
1375
+ if (key === "opacity" && value === 1) return false;
1376
+ if (key === "blendMode" && value === "normal") return false;
1377
+ return true;
1378
+ }).map(([key, value]) => {
1379
+ if (key === "transform" && typeof value === "object") {
1380
+ const nonDefaultKeys = {};
1381
+ for (const k in value) if (value[k] !== DEFAULT_TRANSFORM[k]) nonDefaultKeys[k] = value[k];
1382
+ const keys = Object.keys(nonDefaultKeys).sort();
1383
+ if (keys.length > 1) return `${key}={{\n${indent} ${keys.map((k) => `${k}: ${typeof nonDefaultKeys[k] === "string" ? `"${nonDefaultKeys[k]}"` : nonDefaultKeys[k]}`).join(`,\n${indent} `)}\n${indent} }}`;
1384
+ else if (keys.length === 1) {
1385
+ const k = keys[0];
1386
+ const v = nonDefaultKeys[k];
1387
+ return `${key}={{ ${k}: ${typeof v === "string" ? `"${v}"` : v} }}`;
1388
+ }
1389
+ }
1390
+ if (isPropMapValue(value)) return `${key}={{\n${indent} ${Object.keys(value).map((k) => {
1391
+ const v = value[k];
1392
+ return `${k}: ${typeof v === "string" ? `"${v}"` : v}`;
1393
+ }).join(`,\n${indent} `)}\n${indent} }}`;
1394
+ if (typeof value === "string") {
1395
+ if (value.startsWith("{") && value.endsWith("}")) try {
1396
+ const parsed = JSON.parse(value);
1397
+ if (typeof parsed === "object" && parsed !== null) {
1398
+ const keys = Object.keys(parsed);
1399
+ if (keys.length > 1) return `${key}={{\n${indent} ${keys.map((k) => `${k}: ${typeof parsed[k] === "string" ? `"${parsed[k]}"` : parsed[k]}`).join(`,\n${indent} `)}\n${indent} }}`;
1400
+ return `${key}={${toObjectLiteral(parsed)}}`;
1401
+ }
1402
+ } catch {}
1403
+ return `${key}="${value}"`;
1404
+ } else if (value !== null && typeof value === "object") {
1405
+ const roundedValue = { ...value };
1406
+ if ("x" in roundedValue && typeof roundedValue.x === "number") roundedValue.x = Math.round(roundedValue.x * 100) / 100;
1407
+ if ("y" in roundedValue && typeof roundedValue.y === "number") roundedValue.y = Math.round(roundedValue.y * 100) / 100;
1408
+ const keys = Object.keys(roundedValue);
1409
+ if (keys.length > 1) return `${key}={{\n${indent} ${keys.map((k) => `${k}: ${typeof roundedValue[k] === "string" ? `"${roundedValue[k]}"` : roundedValue[k]}`).join(`,\n${indent} `)}\n${indent} }}`;
1410
+ return `${key}={${toObjectLiteral(roundedValue)}}`;
1411
+ } else return `${key}={${value}}`;
1412
+ }).join("\n" + indent + " ");
1413
+ }
1414
+ function isIdReferenced(id, allComponents) {
1415
+ const flatComponents = [];
1416
+ function flattenComponents(components) {
1417
+ for (const component of components) {
1418
+ flatComponents.push(component);
1419
+ if (component.children) flattenComponents(component.children);
1420
+ }
1421
+ }
1422
+ flattenComponents(allComponents);
1423
+ return flatComponents.some((component) => {
1424
+ if (component.props?.maskSource === id) return true;
1425
+ if (component.props) {
1426
+ for (const value of Object.values(component.props)) if (isPropMapValue(value) && value.source === id) return true;
1427
+ }
1428
+ return false;
1429
+ });
1430
+ }
1431
+ function generatePresetCode(preset, colorSpace) {
1432
+ const componentTypes = /* @__PURE__ */ new Set();
1433
+ function collectTypes(components) {
1434
+ for (const config of components) {
1435
+ componentTypes.add(config.type);
1436
+ if (config.children) collectTypes(config.children);
1437
+ }
1438
+ }
1439
+ collectTypes(preset.components);
1440
+ const generateComponentString = (config, indent = " ") => {
1441
+ const propString = config.props ? generatePropString(config.props, config.type, indent) : "";
1442
+ let idString = "";
1443
+ if (config.id) {
1444
+ if (isIdReferenced(config.id, preset.components)) idString = `id="${config.id}"`;
1445
+ }
1446
+ const attributes = [idString, propString].filter(Boolean).join("\n" + indent + " ");
1447
+ const sampleChildren = config.type === "DOMTexture" && (!config.children || config.children.length === 0) ? `${indent} <h1>Your HTML content here</h1>` : null;
1448
+ if (sampleChildren) if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}>\n${sampleChildren}\n${indent}</${config.type}>`;
1449
+ else return `${indent}<${config.type}>\n${sampleChildren}\n${indent}</${config.type}>`;
1450
+ else if (config.children && config.children.length > 0) {
1451
+ const childrenString = config.children.map((child) => generateComponentString(child, indent + " ")).join("\n");
1452
+ if (attributes) return `${indent}<${config.type}\n${indent} ${attributes}>\n${childrenString}\n${indent}</${config.type}>`;
1453
+ else return `${indent}<${config.type}>\n${childrenString}\n${indent}</${config.type}>`;
1454
+ } else if (attributes) return `${indent}<${config.type}\n${indent} ${attributes} />`;
1455
+ else return `${indent}<${config.type} />`;
1456
+ };
1457
+ const componentStrings = preset.components.map((config) => generateComponentString(config)).join("\n");
1458
+ const shaderProps = colorSpace && colorSpace !== "p3-linear" ? ` colorSpace="${colorSpace}"` : "";
1459
+ const allImports = ["Shader", ...Array.from(componentTypes).sort()];
1460
+ return `<script>
1461
+ ${allImports.length > 3 ? `import {\n ${allImports.join(",\n ")},\n } from 'shaders/svelte'` : `import { ${allImports.join(", ")} } from 'shaders/svelte'`}
1462
+ <\/script>
1463
+
1464
+ <Shader${shaderProps}>
1465
+ ${componentStrings}
1466
+ </Shader>`;
1467
+ }
1468
+ const availableComponents = [
1469
+ "AngularBlur",
1470
+ "Ascii",
1471
+ "Aurora",
1472
+ "Beam",
1473
+ "Blob",
1474
+ "Blur",
1475
+ "BrightnessContrast",
1476
+ "Bulge",
1477
+ "CRTScreen",
1478
+ "ChannelBlur",
1479
+ "Checkerboard",
1480
+ "ChromaFlow",
1481
+ "ChromaticAberration",
1482
+ "Circle",
1483
+ "ConcentricSpin",
1484
+ "ConicGradient",
1485
+ "ContourLines",
1486
+ "Crescent",
1487
+ "Cross",
1488
+ "Crystal",
1489
+ "CursorRipples",
1490
+ "CursorTrail",
1491
+ "DOMTexture",
1492
+ "DiamondGradient",
1493
+ "DiffuseBlur",
1494
+ "Dither",
1495
+ "DotGrid",
1496
+ "DropShadow",
1497
+ "Duotone",
1498
+ "Ellipse",
1499
+ "Emboss",
1500
+ "FallingLines",
1501
+ "FilmGrain",
1502
+ "FloatingParticles",
1503
+ "FlowField",
1504
+ "Flower",
1505
+ "FlowingGradient",
1506
+ "FlutedGlass",
1507
+ "Fog",
1508
+ "Form3D",
1509
+ "Glass",
1510
+ "GlassTiles",
1511
+ "Glitch",
1512
+ "Glow",
1513
+ "Godrays",
1514
+ "Grayscale",
1515
+ "Grid",
1516
+ "GridDistortion",
1517
+ "Group",
1518
+ "Halftone",
1519
+ "HexGrid",
1520
+ "HueShift",
1521
+ "ImageTexture",
1522
+ "Invert",
1523
+ "Kaleidoscope",
1524
+ "LensFlare",
1525
+ "LinearBlur",
1526
+ "LinearGradient",
1527
+ "Liquify",
1528
+ "Mirror",
1529
+ "MultiPointGradient",
1530
+ "Neon",
1531
+ "Paper",
1532
+ "Perspective",
1533
+ "Pixelate",
1534
+ "Plasma",
1535
+ "PolarCoordinates",
1536
+ "Polygon",
1537
+ "Posterize",
1538
+ "ProgressiveBlur",
1539
+ "RadialGradient",
1540
+ "RectangularCoordinates",
1541
+ "Ring",
1542
+ "Ripples",
1543
+ "RoundedRect",
1544
+ "Saturation",
1545
+ "Sharpness",
1546
+ "Shatter",
1547
+ "SimplexNoise",
1548
+ "SineWave",
1549
+ "Smoke",
1550
+ "SmokeFill",
1551
+ "Solarize",
1552
+ "SolidColor",
1553
+ "Spherize",
1554
+ "Spiral",
1555
+ "Star",
1556
+ "Strands",
1557
+ "Stretch",
1558
+ "Stripes",
1559
+ "StudioBackground",
1560
+ "Swirl",
1561
+ "TiltShift",
1562
+ "Tint",
1563
+ "Trapezoid",
1564
+ "Tritone",
1565
+ "Truchet",
1566
+ "Twirl",
1567
+ "VHS",
1568
+ "Vesica",
1569
+ "Vibrance",
1570
+ "VideoTexture",
1571
+ "Vignette",
1572
+ "Voronoi",
1573
+ "WaveDistortion",
1574
+ "Weave",
1575
+ "WebcamTexture",
1576
+ "ZoomBlur"
1577
+ ];
2
1578
  export { availableComponents, generatePresetCode };