shaders 2.2.31 → 2.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/GlassTiles-BaAwsNxl.js +84 -0
- package/dist/core/Swirl-BfD35doJ.js +96 -0
- package/dist/core/index.js +2 -2
- package/dist/core/shaders/GlassTiles/index.d.ts +18 -4
- package/dist/core/shaders/GlassTiles/index.d.ts.map +1 -1
- package/dist/core/shaders/GlassTiles/index.js +1 -1
- package/dist/core/shaders/Swirl/index.d.ts +1 -43
- package/dist/core/shaders/Swirl/index.d.ts.map +1 -1
- package/dist/core/shaders/Swirl/index.js +1 -1
- package/dist/react/{generatePresetCode-CCibXbtZ.js → generatePresetCode-Ci4D5lDy.js} +41 -12
- package/dist/react/index.js +1 -1
- package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/react/utils/generatePresetCode.js +1 -1
- package/dist/react/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/registry.js +60 -148
- package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/solid/utils/generatePresetCode.js +56 -10
- package/dist/solid/utils/generatePresetCode.template.d.ts.map +1 -1
- package/dist/svelte/{generatePresetCode-CymgoDq_.js → generatePresetCode-hILbcEw8.js} +41 -12
- package/dist/svelte/index.js +1 -1
- package/dist/svelte/utils/generatePresetCode.js +1 -1
- package/dist/vue/{generatePresetCode-CRJmU8iF.js → generatePresetCode-DfkHaBG4.js} +36 -12
- package/dist/vue/index.js +5 -9
- package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
- package/dist/vue/utils/generatePresetCode.js +1 -1
- package/dist/vue/utils/generatePresetCode.template.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/core/GlassTiles-uW7j91uC.js +0 -55
- package/dist/core/Swirl-KUjGnUAM.js +0 -171
package/dist/registry.js
CHANGED
|
@@ -2581,26 +2581,48 @@ export const shaderRegistry = [
|
|
|
2581
2581
|
"requiresChild": true,
|
|
2582
2582
|
"props": {
|
|
2583
2583
|
"intensity": {
|
|
2584
|
-
"default":
|
|
2584
|
+
"default": 2,
|
|
2585
2585
|
"description": "The intensity of the glass tiles effect",
|
|
2586
2586
|
"ui": {
|
|
2587
2587
|
"type": "range",
|
|
2588
2588
|
"min": 0,
|
|
2589
|
-
"max":
|
|
2589
|
+
"max": 10,
|
|
2590
2590
|
"step": 0.1,
|
|
2591
2591
|
"label": "Intensity"
|
|
2592
2592
|
}
|
|
2593
2593
|
},
|
|
2594
2594
|
"tileCount": {
|
|
2595
|
-
"default":
|
|
2595
|
+
"default": 20,
|
|
2596
2596
|
"description": "Number of tiles across the shortest dimension",
|
|
2597
2597
|
"ui": {
|
|
2598
2598
|
"type": "range",
|
|
2599
|
-
"min":
|
|
2600
|
-
"max":
|
|
2599
|
+
"min": 5,
|
|
2600
|
+
"max": 50,
|
|
2601
2601
|
"step": 1,
|
|
2602
2602
|
"label": "Tile Count"
|
|
2603
2603
|
}
|
|
2604
|
+
},
|
|
2605
|
+
"rotation": {
|
|
2606
|
+
"default": 0,
|
|
2607
|
+
"description": "Rotation angle of the tile grid in degrees",
|
|
2608
|
+
"ui": {
|
|
2609
|
+
"type": "range",
|
|
2610
|
+
"min": 0,
|
|
2611
|
+
"max": 360,
|
|
2612
|
+
"step": 1,
|
|
2613
|
+
"label": "Rotation"
|
|
2614
|
+
}
|
|
2615
|
+
},
|
|
2616
|
+
"roundness": {
|
|
2617
|
+
"default": 0,
|
|
2618
|
+
"description": "Makes tiles more circular instead of square",
|
|
2619
|
+
"ui": {
|
|
2620
|
+
"type": "range",
|
|
2621
|
+
"min": 0,
|
|
2622
|
+
"max": 1,
|
|
2623
|
+
"step": 0.01,
|
|
2624
|
+
"label": "Roundness"
|
|
2625
|
+
}
|
|
2604
2626
|
}
|
|
2605
2627
|
}
|
|
2606
2628
|
},
|
|
@@ -2609,23 +2631,45 @@ export const shaderRegistry = [
|
|
|
2609
2631
|
"ui": {
|
|
2610
2632
|
"type": "range",
|
|
2611
2633
|
"min": 0,
|
|
2612
|
-
"max":
|
|
2634
|
+
"max": 10,
|
|
2613
2635
|
"step": 0.1,
|
|
2614
2636
|
"label": "Intensity"
|
|
2615
2637
|
},
|
|
2616
|
-
"default":
|
|
2638
|
+
"default": 2,
|
|
2617
2639
|
"description": "The intensity of the glass tiles effect"
|
|
2618
2640
|
},
|
|
2619
2641
|
"tileCount": {
|
|
2620
2642
|
"ui": {
|
|
2621
2643
|
"type": "range",
|
|
2622
|
-
"min":
|
|
2623
|
-
"max":
|
|
2644
|
+
"min": 5,
|
|
2645
|
+
"max": 50,
|
|
2624
2646
|
"step": 1,
|
|
2625
2647
|
"label": "Tile Count"
|
|
2626
2648
|
},
|
|
2627
|
-
"default":
|
|
2649
|
+
"default": 20,
|
|
2628
2650
|
"description": "Number of tiles across the shortest dimension"
|
|
2651
|
+
},
|
|
2652
|
+
"rotation": {
|
|
2653
|
+
"ui": {
|
|
2654
|
+
"type": "range",
|
|
2655
|
+
"min": 0,
|
|
2656
|
+
"max": 360,
|
|
2657
|
+
"step": 1,
|
|
2658
|
+
"label": "Rotation"
|
|
2659
|
+
},
|
|
2660
|
+
"default": 0,
|
|
2661
|
+
"description": "Rotation angle of the tile grid in degrees"
|
|
2662
|
+
},
|
|
2663
|
+
"roundness": {
|
|
2664
|
+
"ui": {
|
|
2665
|
+
"type": "range",
|
|
2666
|
+
"min": 0,
|
|
2667
|
+
"max": 1,
|
|
2668
|
+
"step": 0.01,
|
|
2669
|
+
"label": "Roundness"
|
|
2670
|
+
},
|
|
2671
|
+
"default": 0,
|
|
2672
|
+
"description": "Makes tiles more circular instead of square"
|
|
2629
2673
|
}
|
|
2630
2674
|
}
|
|
2631
2675
|
},
|
|
@@ -5784,7 +5828,7 @@ export const shaderRegistry = [
|
|
|
5784
5828
|
"description": "Primary gradient color",
|
|
5785
5829
|
"ui": {
|
|
5786
5830
|
"type": "color",
|
|
5787
|
-
"label": "
|
|
5831
|
+
"label": "Color A"
|
|
5788
5832
|
}
|
|
5789
5833
|
},
|
|
5790
5834
|
"colorB": {
|
|
@@ -5792,7 +5836,7 @@ export const shaderRegistry = [
|
|
|
5792
5836
|
"description": "Secondary gradient color",
|
|
5793
5837
|
"ui": {
|
|
5794
5838
|
"type": "color",
|
|
5795
|
-
"label": "
|
|
5839
|
+
"label": "Color B"
|
|
5796
5840
|
}
|
|
5797
5841
|
},
|
|
5798
5842
|
"speed": {
|
|
@@ -5812,7 +5856,7 @@ export const shaderRegistry = [
|
|
|
5812
5856
|
"ui": {
|
|
5813
5857
|
"type": "range",
|
|
5814
5858
|
"min": 0,
|
|
5815
|
-
"max":
|
|
5859
|
+
"max": 5,
|
|
5816
5860
|
"step": 0.1,
|
|
5817
5861
|
"label": "Detail"
|
|
5818
5862
|
}
|
|
@@ -5828,72 +5872,6 @@ export const shaderRegistry = [
|
|
|
5828
5872
|
"label": "Blend"
|
|
5829
5873
|
}
|
|
5830
5874
|
},
|
|
5831
|
-
"coarseX": {
|
|
5832
|
-
"default": 50,
|
|
5833
|
-
"description": "Horizontal frequency for coarse/base layer",
|
|
5834
|
-
"ui": {
|
|
5835
|
-
"type": "range",
|
|
5836
|
-
"min": 0,
|
|
5837
|
-
"max": 100,
|
|
5838
|
-
"step": 1,
|
|
5839
|
-
"label": "Coarse X"
|
|
5840
|
-
}
|
|
5841
|
-
},
|
|
5842
|
-
"coarseY": {
|
|
5843
|
-
"default": 50,
|
|
5844
|
-
"description": "Vertical frequency for coarse/base layer",
|
|
5845
|
-
"ui": {
|
|
5846
|
-
"type": "range",
|
|
5847
|
-
"min": 0,
|
|
5848
|
-
"max": 100,
|
|
5849
|
-
"step": 1,
|
|
5850
|
-
"label": "Coarse Y"
|
|
5851
|
-
}
|
|
5852
|
-
},
|
|
5853
|
-
"mediumX": {
|
|
5854
|
-
"default": 50,
|
|
5855
|
-
"description": "Horizontal frequency for medium detail layer",
|
|
5856
|
-
"ui": {
|
|
5857
|
-
"type": "range",
|
|
5858
|
-
"min": 0,
|
|
5859
|
-
"max": 100,
|
|
5860
|
-
"step": 1,
|
|
5861
|
-
"label": "Medium X"
|
|
5862
|
-
}
|
|
5863
|
-
},
|
|
5864
|
-
"mediumY": {
|
|
5865
|
-
"default": 50,
|
|
5866
|
-
"description": "Vertical frequency for medium detail layer",
|
|
5867
|
-
"ui": {
|
|
5868
|
-
"type": "range",
|
|
5869
|
-
"min": 0,
|
|
5870
|
-
"max": 100,
|
|
5871
|
-
"step": 1,
|
|
5872
|
-
"label": "Medium Y"
|
|
5873
|
-
}
|
|
5874
|
-
},
|
|
5875
|
-
"fineX": {
|
|
5876
|
-
"default": 50,
|
|
5877
|
-
"description": "Horizontal frequency for fine detail layer",
|
|
5878
|
-
"ui": {
|
|
5879
|
-
"type": "range",
|
|
5880
|
-
"min": 0,
|
|
5881
|
-
"max": 100,
|
|
5882
|
-
"step": 1,
|
|
5883
|
-
"label": "Fine X"
|
|
5884
|
-
}
|
|
5885
|
-
},
|
|
5886
|
-
"fineY": {
|
|
5887
|
-
"default": 50,
|
|
5888
|
-
"description": "Vertical frequency for fine detail layer",
|
|
5889
|
-
"ui": {
|
|
5890
|
-
"type": "range",
|
|
5891
|
-
"min": 0,
|
|
5892
|
-
"max": 100,
|
|
5893
|
-
"step": 1,
|
|
5894
|
-
"label": "Fine Y"
|
|
5895
|
-
}
|
|
5896
|
-
},
|
|
5897
5875
|
"colorSpace": {
|
|
5898
5876
|
"default": "linear",
|
|
5899
5877
|
"description": "Color space for color interpolation",
|
|
@@ -5922,7 +5900,7 @@ export const shaderRegistry = [
|
|
|
5922
5900
|
"colorA": {
|
|
5923
5901
|
"ui": {
|
|
5924
5902
|
"type": "color",
|
|
5925
|
-
"label": "
|
|
5903
|
+
"label": "Color A"
|
|
5926
5904
|
},
|
|
5927
5905
|
"default": "#1275d8",
|
|
5928
5906
|
"description": "Primary gradient color"
|
|
@@ -5930,7 +5908,7 @@ export const shaderRegistry = [
|
|
|
5930
5908
|
"colorB": {
|
|
5931
5909
|
"ui": {
|
|
5932
5910
|
"type": "color",
|
|
5933
|
-
"label": "
|
|
5911
|
+
"label": "Color B"
|
|
5934
5912
|
},
|
|
5935
5913
|
"default": "#e19136",
|
|
5936
5914
|
"description": "Secondary gradient color"
|
|
@@ -5950,7 +5928,7 @@ export const shaderRegistry = [
|
|
|
5950
5928
|
"ui": {
|
|
5951
5929
|
"type": "range",
|
|
5952
5930
|
"min": 0,
|
|
5953
|
-
"max":
|
|
5931
|
+
"max": 5,
|
|
5954
5932
|
"step": 0.1,
|
|
5955
5933
|
"label": "Detail"
|
|
5956
5934
|
},
|
|
@@ -5968,72 +5946,6 @@ export const shaderRegistry = [
|
|
|
5968
5946
|
"default": 50,
|
|
5969
5947
|
"description": "Skew color balance toward A (lower values) or B (higher values)"
|
|
5970
5948
|
},
|
|
5971
|
-
"coarseX": {
|
|
5972
|
-
"ui": {
|
|
5973
|
-
"type": "range",
|
|
5974
|
-
"min": 0,
|
|
5975
|
-
"max": 100,
|
|
5976
|
-
"step": 1,
|
|
5977
|
-
"label": "Coarse X"
|
|
5978
|
-
},
|
|
5979
|
-
"default": 50,
|
|
5980
|
-
"description": "Horizontal frequency for coarse/base layer"
|
|
5981
|
-
},
|
|
5982
|
-
"coarseY": {
|
|
5983
|
-
"ui": {
|
|
5984
|
-
"type": "range",
|
|
5985
|
-
"min": 0,
|
|
5986
|
-
"max": 100,
|
|
5987
|
-
"step": 1,
|
|
5988
|
-
"label": "Coarse Y"
|
|
5989
|
-
},
|
|
5990
|
-
"default": 50,
|
|
5991
|
-
"description": "Vertical frequency for coarse/base layer"
|
|
5992
|
-
},
|
|
5993
|
-
"mediumX": {
|
|
5994
|
-
"ui": {
|
|
5995
|
-
"type": "range",
|
|
5996
|
-
"min": 0,
|
|
5997
|
-
"max": 100,
|
|
5998
|
-
"step": 1,
|
|
5999
|
-
"label": "Medium X"
|
|
6000
|
-
},
|
|
6001
|
-
"default": 50,
|
|
6002
|
-
"description": "Horizontal frequency for medium detail layer"
|
|
6003
|
-
},
|
|
6004
|
-
"mediumY": {
|
|
6005
|
-
"ui": {
|
|
6006
|
-
"type": "range",
|
|
6007
|
-
"min": 0,
|
|
6008
|
-
"max": 100,
|
|
6009
|
-
"step": 1,
|
|
6010
|
-
"label": "Medium Y"
|
|
6011
|
-
},
|
|
6012
|
-
"default": 50,
|
|
6013
|
-
"description": "Vertical frequency for medium detail layer"
|
|
6014
|
-
},
|
|
6015
|
-
"fineX": {
|
|
6016
|
-
"ui": {
|
|
6017
|
-
"type": "range",
|
|
6018
|
-
"min": 0,
|
|
6019
|
-
"max": 100,
|
|
6020
|
-
"step": 1,
|
|
6021
|
-
"label": "Fine X"
|
|
6022
|
-
},
|
|
6023
|
-
"default": 50,
|
|
6024
|
-
"description": "Horizontal frequency for fine detail layer"
|
|
6025
|
-
},
|
|
6026
|
-
"fineY": {
|
|
6027
|
-
"ui": {
|
|
6028
|
-
"type": "range",
|
|
6029
|
-
"min": 0,
|
|
6030
|
-
"max": 100,
|
|
6031
|
-
"step": 1,
|
|
6032
|
-
"label": "Fine Y"
|
|
6033
|
-
},
|
|
6034
|
-
"default": 50,
|
|
6035
|
-
"description": "Vertical frequency for fine detail layer"
|
|
6036
|
-
},
|
|
6037
5949
|
"colorSpace": {
|
|
6038
5950
|
"ui": {
|
|
6039
5951
|
"type": "select",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAupBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,UAyD/B,CAAA"}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
const DEFAULT_TRANSFORM = {
|
|
2
|
+
offsetX: 0,
|
|
3
|
+
offsetY: 0,
|
|
4
|
+
rotation: 0,
|
|
5
|
+
scale: 1,
|
|
6
|
+
anchorX: 0.5,
|
|
7
|
+
anchorY: 0.5,
|
|
8
|
+
edges: "transparent"
|
|
9
|
+
};
|
|
10
|
+
function toObjectLiteral(obj) {
|
|
11
|
+
const entries = Object.entries(obj).map(([key, value]) => {
|
|
12
|
+
const valueStr = typeof value === "string" ? `"${value}"` : value;
|
|
13
|
+
return `${key}: ${valueStr}`;
|
|
14
|
+
});
|
|
15
|
+
return `{ ${entries.join(", ")} }`;
|
|
16
|
+
}
|
|
1
17
|
const shaderMetadata = {
|
|
2
18
|
"AngularBlur": {
|
|
3
19
|
"opacity": 1,
|
|
@@ -194,8 +210,10 @@ const shaderMetadata = {
|
|
|
194
210
|
"GlassTiles": {
|
|
195
211
|
"opacity": 1,
|
|
196
212
|
"blendMode": "normal",
|
|
197
|
-
"intensity":
|
|
198
|
-
"tileCount":
|
|
213
|
+
"intensity": 2,
|
|
214
|
+
"tileCount": 20,
|
|
215
|
+
"rotation": 0,
|
|
216
|
+
"roundness": 0
|
|
199
217
|
},
|
|
200
218
|
"Glow": {
|
|
201
219
|
"opacity": 1,
|
|
@@ -476,12 +494,6 @@ const shaderMetadata = {
|
|
|
476
494
|
"speed": 1,
|
|
477
495
|
"detail": 1,
|
|
478
496
|
"blend": 50,
|
|
479
|
-
"coarseX": 50,
|
|
480
|
-
"coarseY": 50,
|
|
481
|
-
"mediumX": 50,
|
|
482
|
-
"mediumY": 50,
|
|
483
|
-
"fineX": 50,
|
|
484
|
-
"fineY": 50,
|
|
485
497
|
"colorSpace": "linear"
|
|
486
498
|
},
|
|
487
499
|
"TiltShift": {
|
|
@@ -541,7 +553,14 @@ const shaderMetadata = {
|
|
|
541
553
|
}
|
|
542
554
|
};
|
|
543
555
|
function generatePropString(props, componentType, indent = " ") {
|
|
544
|
-
return Object.entries(props).filter(([key, value]) => {
|
|
556
|
+
return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
|
|
557
|
+
if (key === "maskType" && value === "alpha") return false;
|
|
558
|
+
if (key === "transform" && typeof value === "object") {
|
|
559
|
+
const allDefaults = Object.keys(DEFAULT_TRANSFORM).every(
|
|
560
|
+
(k) => value[k] === DEFAULT_TRANSFORM[k]
|
|
561
|
+
);
|
|
562
|
+
if (allDefaults) return false;
|
|
563
|
+
}
|
|
545
564
|
const componentDefaults = shaderMetadata[componentType] || {};
|
|
546
565
|
if (componentDefaults.hasOwnProperty(key)) {
|
|
547
566
|
const defaultValue = componentDefaults[key];
|
|
@@ -554,10 +573,37 @@ function generatePropString(props, componentType, indent = " ") {
|
|
|
554
573
|
if (key === "blendMode" && value === "normal") return false;
|
|
555
574
|
return true;
|
|
556
575
|
}).map(([key, value]) => {
|
|
576
|
+
if (key === "transform" && typeof value === "object") {
|
|
577
|
+
const nonDefaultKeys = {};
|
|
578
|
+
for (const k in value) {
|
|
579
|
+
if (value[k] !== DEFAULT_TRANSFORM[k]) {
|
|
580
|
+
nonDefaultKeys[k] = value[k];
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
const keys = Object.keys(nonDefaultKeys).sort();
|
|
584
|
+
if (keys.length > 1) {
|
|
585
|
+
const entries = keys.map((k) => `${k}: ${typeof nonDefaultKeys[k] === "string" ? `"${nonDefaultKeys[k]}"` : nonDefaultKeys[k]}`);
|
|
586
|
+
return `${key}={{
|
|
587
|
+
${indent} ${entries.join(`,
|
|
588
|
+
${indent} `)}
|
|
589
|
+
${indent} }}`;
|
|
590
|
+
} else if (keys.length === 1) {
|
|
591
|
+
const k = keys[0];
|
|
592
|
+
const v = nonDefaultKeys[k];
|
|
593
|
+
return `${key}={{ ${k}: ${typeof v === "string" ? `"${v}"` : v} }}`;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
557
596
|
if (typeof value === "string") {
|
|
558
597
|
return `${key}=${JSON.stringify(value)}`;
|
|
559
598
|
} else if (value !== null && typeof value === "object") {
|
|
560
|
-
|
|
599
|
+
const roundedValue = { ...value };
|
|
600
|
+
if ("x" in roundedValue && typeof roundedValue.x === "number") {
|
|
601
|
+
roundedValue.x = Math.round(roundedValue.x * 100) / 100;
|
|
602
|
+
}
|
|
603
|
+
if ("y" in roundedValue && typeof roundedValue.y === "number") {
|
|
604
|
+
roundedValue.y = Math.round(roundedValue.y * 100) / 100;
|
|
605
|
+
}
|
|
606
|
+
return `${key}={${toObjectLiteral(roundedValue)}}`;
|
|
561
607
|
} else {
|
|
562
608
|
return `${key}={${value}}`;
|
|
563
609
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AA8HD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,OAG/B,CAAA"}
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
}
|
|
1
15
|
var shaderMetadata = {
|
|
2
16
|
"AngularBlur": {
|
|
3
17
|
"opacity": 1,
|
|
@@ -194,8 +208,10 @@ var shaderMetadata = {
|
|
|
194
208
|
"GlassTiles": {
|
|
195
209
|
"opacity": 1,
|
|
196
210
|
"blendMode": "normal",
|
|
197
|
-
"intensity":
|
|
198
|
-
"tileCount":
|
|
211
|
+
"intensity": 2,
|
|
212
|
+
"tileCount": 20,
|
|
213
|
+
"rotation": 0,
|
|
214
|
+
"roundness": 0
|
|
199
215
|
},
|
|
200
216
|
"Glow": {
|
|
201
217
|
"opacity": 1,
|
|
@@ -476,12 +492,6 @@ var shaderMetadata = {
|
|
|
476
492
|
"speed": 1,
|
|
477
493
|
"detail": 1,
|
|
478
494
|
"blend": 50,
|
|
479
|
-
"coarseX": 50,
|
|
480
|
-
"coarseY": 50,
|
|
481
|
-
"mediumX": 50,
|
|
482
|
-
"mediumY": 50,
|
|
483
|
-
"fineX": 50,
|
|
484
|
-
"fineY": 50,
|
|
485
495
|
"colorSpace": "linear"
|
|
486
496
|
},
|
|
487
497
|
"TiltShift": {
|
|
@@ -541,20 +551,39 @@ var shaderMetadata = {
|
|
|
541
551
|
}
|
|
542
552
|
};
|
|
543
553
|
function generatePropString(props, componentType, indent = " ") {
|
|
544
|
-
return Object.entries(props).filter(([key, value]) => {
|
|
554
|
+
return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
|
|
555
|
+
if (key === "maskType" && value === "alpha") return false;
|
|
556
|
+
if (key === "transform" && typeof value === "object") {
|
|
557
|
+
if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
|
|
558
|
+
}
|
|
545
559
|
const componentDefaults = shaderMetadata[componentType] || {};
|
|
546
560
|
if (componentDefaults.hasOwnProperty(key)) {
|
|
547
561
|
const defaultValue = componentDefaults[key];
|
|
548
|
-
if (typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
|
|
562
|
+
if (value != null && defaultValue != null && typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
|
|
549
563
|
return value !== defaultValue;
|
|
550
564
|
}
|
|
551
565
|
if (key === "opacity" && value === 1) return false;
|
|
552
566
|
if (key === "blendMode" && value === "normal") return false;
|
|
553
567
|
return true;
|
|
554
568
|
}).map(([key, value]) => {
|
|
569
|
+
if (key === "transform" && typeof value === "object") {
|
|
570
|
+
const nonDefaultKeys = {};
|
|
571
|
+
for (const k in value) if (value[k] !== DEFAULT_TRANSFORM[k]) nonDefaultKeys[k] = value[k];
|
|
572
|
+
const keys = Object.keys(nonDefaultKeys).sort();
|
|
573
|
+
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} }}`;
|
|
574
|
+
else if (keys.length === 1) {
|
|
575
|
+
const k = keys[0];
|
|
576
|
+
const v = nonDefaultKeys[k];
|
|
577
|
+
return `${key}={{ ${k}: ${typeof v === "string" ? `"${v}"` : v} }}`;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
555
580
|
if (typeof value === "string") return `${key}="${value}"`;
|
|
556
|
-
else if (typeof value === "object")
|
|
557
|
-
|
|
581
|
+
else if (value !== null && typeof value === "object") {
|
|
582
|
+
const roundedValue = { ...value };
|
|
583
|
+
if ("x" in roundedValue && typeof roundedValue.x === "number") roundedValue.x = Math.round(roundedValue.x * 100) / 100;
|
|
584
|
+
if ("y" in roundedValue && typeof roundedValue.y === "number") roundedValue.y = Math.round(roundedValue.y * 100) / 100;
|
|
585
|
+
return `${key}={${toObjectLiteral(roundedValue)}}`;
|
|
586
|
+
} else return `${key}={${value}}`;
|
|
558
587
|
}).join("\n" + indent + " ");
|
|
559
588
|
}
|
|
560
589
|
function isIdUsedAsMaskSource(id, allComponents) {
|
package/dist/svelte/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as generatePresetCode } from "./generatePresetCode-
|
|
1
|
+
import { n as generatePresetCode } from "./generatePresetCode-hILbcEw8.js";
|
|
2
2
|
import "svelte/internal/disclose-version";
|
|
3
3
|
import * as $ from "svelte/internal/client";
|
|
4
4
|
import { getContext, onDestroy, onMount, setContext } from "svelte";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-
|
|
1
|
+
import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-hILbcEw8.js";
|
|
2
2
|
export { availableComponents, generatePresetCode };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
function camelToKebab(str) {
|
|
2
2
|
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3
3
|
}
|
|
4
|
+
var DEFAULT_TRANSFORM = {
|
|
5
|
+
offsetX: 0,
|
|
6
|
+
offsetY: 0,
|
|
7
|
+
rotation: 0,
|
|
8
|
+
scale: 1,
|
|
9
|
+
anchorX: .5,
|
|
10
|
+
anchorY: .5,
|
|
11
|
+
edges: "transparent"
|
|
12
|
+
};
|
|
4
13
|
var shaderMetadata = {
|
|
5
14
|
"AngularBlur": {
|
|
6
15
|
"opacity": 1,
|
|
@@ -197,8 +206,10 @@ var shaderMetadata = {
|
|
|
197
206
|
"GlassTiles": {
|
|
198
207
|
"opacity": 1,
|
|
199
208
|
"blendMode": "normal",
|
|
200
|
-
"intensity":
|
|
201
|
-
"tileCount":
|
|
209
|
+
"intensity": 2,
|
|
210
|
+
"tileCount": 20,
|
|
211
|
+
"rotation": 0,
|
|
212
|
+
"roundness": 0
|
|
202
213
|
},
|
|
203
214
|
"Glow": {
|
|
204
215
|
"opacity": 1,
|
|
@@ -479,12 +490,6 @@ var shaderMetadata = {
|
|
|
479
490
|
"speed": 1,
|
|
480
491
|
"detail": 1,
|
|
481
492
|
"blend": 50,
|
|
482
|
-
"coarseX": 50,
|
|
483
|
-
"coarseY": 50,
|
|
484
|
-
"mediumX": 50,
|
|
485
|
-
"mediumY": 50,
|
|
486
|
-
"fineX": 50,
|
|
487
|
-
"fineY": 50,
|
|
488
493
|
"colorSpace": "linear"
|
|
489
494
|
},
|
|
490
495
|
"TiltShift": {
|
|
@@ -544,11 +549,15 @@ var shaderMetadata = {
|
|
|
544
549
|
}
|
|
545
550
|
};
|
|
546
551
|
function generatePropString(props, componentType, indent = " ") {
|
|
547
|
-
return Object.entries(props).filter(([key, value]) => {
|
|
552
|
+
return Object.entries(props).sort(([a], [b]) => a.localeCompare(b)).filter(([key, value]) => {
|
|
553
|
+
if (key === "maskType" && value === "alpha") return false;
|
|
554
|
+
if (key === "transform" && typeof value === "object") {
|
|
555
|
+
if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
|
|
556
|
+
}
|
|
548
557
|
const componentDefaults = shaderMetadata[componentType] || {};
|
|
549
558
|
if (componentDefaults.hasOwnProperty(key)) {
|
|
550
559
|
const defaultValue = componentDefaults[key];
|
|
551
|
-
if (typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
|
|
560
|
+
if (value != null && defaultValue != null && typeof value === "object" && typeof defaultValue === "object") return JSON.stringify(value) !== JSON.stringify(defaultValue);
|
|
552
561
|
return value !== defaultValue;
|
|
553
562
|
}
|
|
554
563
|
if (key === "opacity" && value === 1) return false;
|
|
@@ -556,9 +565,24 @@ function generatePropString(props, componentType, indent = " ") {
|
|
|
556
565
|
return true;
|
|
557
566
|
}).map(([key, value]) => {
|
|
558
567
|
const kebabKey = camelToKebab(key);
|
|
568
|
+
if (key === "transform" && typeof value === "object") {
|
|
569
|
+
const nonDefaultKeys = {};
|
|
570
|
+
for (const k in value) if (value[k] !== DEFAULT_TRANSFORM[k]) nonDefaultKeys[k] = value[k];
|
|
571
|
+
const keys = Object.keys(nonDefaultKeys).sort();
|
|
572
|
+
if (keys.length > 1) return `:${kebabKey}="{\n${indent} ${keys.map((k) => `'${k}':${typeof nonDefaultKeys[k] === "string" ? `'${nonDefaultKeys[k]}'` : nonDefaultKeys[k]}`).join(`,\n${indent} `)}\n${indent} }"`;
|
|
573
|
+
else if (keys.length === 1) {
|
|
574
|
+
const k = keys[0];
|
|
575
|
+
const v = nonDefaultKeys[k];
|
|
576
|
+
return `:${kebabKey}="{'${k}':${typeof v === "string" ? `'${v}'` : v}}"`;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
559
579
|
if (typeof value === "string") return `${kebabKey}="${value}"`;
|
|
560
|
-
else if (typeof value === "object")
|
|
561
|
-
|
|
580
|
+
else if (value !== null && typeof value === "object") {
|
|
581
|
+
const roundedValue = { ...value };
|
|
582
|
+
if ("x" in roundedValue && typeof roundedValue.x === "number") roundedValue.x = Math.round(roundedValue.x * 100) / 100;
|
|
583
|
+
if ("y" in roundedValue && typeof roundedValue.y === "number") roundedValue.y = Math.round(roundedValue.y * 100) / 100;
|
|
584
|
+
return `:${kebabKey}="${JSON.stringify(roundedValue).replace(/"/g, "'")}"`;
|
|
585
|
+
} else return `:${kebabKey}="${value}"`;
|
|
562
586
|
}).join("\n" + indent + " ");
|
|
563
587
|
}
|
|
564
588
|
function isIdUsedAsMaskSource(id, allComponents) {
|
package/dist/vue/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as generatePresetCode } from "./generatePresetCode-
|
|
1
|
+
import { n as generatePresetCode } from "./generatePresetCode-DfkHaBG4.js";
|
|
2
2
|
import { computed, createElementBlock, createElementVNode, defineComponent, effectScope, inject, mergeDefaults, mergeProps, onBeforeUnmount, onMounted, openBlock, provide, ref, renderSlot, toValue, watch } from "vue";
|
|
3
3
|
import { createUniformsMap, shaderRenderer } from "../core/index.js";
|
|
4
4
|
import { componentDefinition } from "../core/shaders/AngularBlur/index.js";
|
|
@@ -2429,7 +2429,9 @@ var GlassTiles_default = /* @__PURE__ */ defineComponent({
|
|
|
2429
2429
|
renderOrder: {},
|
|
2430
2430
|
transform: {},
|
|
2431
2431
|
intensity: {},
|
|
2432
|
-
tileCount: {}
|
|
2432
|
+
tileCount: {},
|
|
2433
|
+
rotation: {},
|
|
2434
|
+
roundness: {}
|
|
2433
2435
|
}, {
|
|
2434
2436
|
blendMode: "normal",
|
|
2435
2437
|
renderOrder: 0,
|
|
@@ -6000,13 +6002,7 @@ var Swirl_default = /* @__PURE__ */ defineComponent({
|
|
|
6000
6002
|
speed: {},
|
|
6001
6003
|
detail: {},
|
|
6002
6004
|
blend: {},
|
|
6003
|
-
|
|
6004
|
-
coarseY: {},
|
|
6005
|
-
colorSpace: {},
|
|
6006
|
-
mediumX: {},
|
|
6007
|
-
mediumY: {},
|
|
6008
|
-
fineX: {},
|
|
6009
|
-
fineY: {}
|
|
6005
|
+
colorSpace: {}
|
|
6010
6006
|
}, {
|
|
6011
6007
|
blendMode: "normal",
|
|
6012
6008
|
renderOrder: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAkpBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,UAyD/B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-
|
|
1
|
+
import { n as generatePresetCode, t as availableComponents } from "../generatePresetCode-DfkHaBG4.js";
|
|
2
2
|
export { availableComponents, generatePresetCode };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;
|
|
1
|
+
{"version":3,"file":"generatePresetCode.template.d.ts","sourceRoot":"","sources":["../../src/utils/generatePresetCode.template.ts"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,UAAU,YAAY;IACpB,UAAU,EAAE,eAAe,EAAE,CAAA;CAC9B;AAyHD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAyC/D;AAGD,eAAO,MAAM,mBAAmB,OAG/B,CAAA"}
|
package/package.json
CHANGED