shaders 2.2.23 → 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 (213) 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 -1604
  59. package/dist/core/shaderRegistry.d.ts.map +1 -1
  60. package/dist/core/shaders/AngularBlur/index.js +3 -7
  61. package/dist/core/shaders/Ascii/index.js +2 -6
  62. package/dist/core/shaders/Beam/index.d.ts +71 -0
  63. package/dist/core/shaders/Beam/index.d.ts.map +1 -0
  64. package/dist/core/shaders/Beam/index.js +4 -0
  65. package/dist/core/shaders/Blob/index.js +5 -9
  66. package/dist/core/shaders/Blur/index.js +2 -6
  67. package/dist/core/shaders/Bulge/index.js +4 -8
  68. package/dist/core/shaders/CRTScreen/index.js +2 -6
  69. package/dist/core/shaders/ChannelBlur/index.js +2 -6
  70. package/dist/core/shaders/Checkerboard/index.js +4 -8
  71. package/dist/core/shaders/ChromaFlow/index.js +3 -7
  72. package/dist/core/shaders/ChromaticAberration/index.js +3 -7
  73. package/dist/core/shaders/Circle/index.js +3 -7
  74. package/dist/core/shaders/CursorTrail/index.js +4 -8
  75. package/dist/core/shaders/DiffuseBlur/index.js +4 -8
  76. package/dist/core/shaders/Dither/index.js +3 -7
  77. package/dist/core/shaders/DotGrid/index.js +3 -7
  78. package/dist/core/shaders/Duotone/index.js +4 -8
  79. package/dist/core/shaders/FilmGrain/index.js +2 -6
  80. package/dist/core/shaders/FloatingParticles/index.js +3 -7
  81. package/dist/core/shaders/GlassTiles/index.js +2 -6
  82. package/dist/core/shaders/Glow/index.js +2 -6
  83. package/dist/core/shaders/Godrays/index.js +3 -7
  84. package/dist/core/shaders/Grayscale/index.js +2 -8
  85. package/dist/core/shaders/Grid/index.js +3 -7
  86. package/dist/core/shaders/GridDistortion/index.js +4 -8
  87. package/dist/core/shaders/Group/index.js +2 -6
  88. package/dist/core/shaders/Halftone/index.js +3 -7
  89. package/dist/core/shaders/HueShift/index.js +2 -8
  90. package/dist/core/shaders/ImageTexture/index.js +2 -6
  91. package/dist/core/shaders/Invert/index.js +2 -6
  92. package/dist/core/shaders/LinearBlur/index.js +3 -7
  93. package/dist/core/shaders/LinearGradient/index.js +4 -8
  94. package/dist/core/shaders/Liquify/index.js +4 -8
  95. package/dist/core/shaders/Pixelate/index.js +2 -6
  96. package/dist/core/shaders/PolarCoordinates/index.js +4 -8
  97. package/dist/core/shaders/Posterize/index.js +2 -7
  98. package/dist/core/shaders/ProgressiveBlur/index.js +3 -7
  99. package/dist/core/shaders/RadialGradient/index.js +4 -8
  100. package/dist/core/shaders/RectangularCoordinates/index.js +4 -8
  101. package/dist/core/shaders/Ripples/index.js +5 -9
  102. package/dist/core/shaders/Saturation/index.js +2 -8
  103. package/dist/core/shaders/SimplexNoise/index.js +5 -9
  104. package/dist/core/shaders/SineWave/index.js +3 -7
  105. package/dist/core/shaders/SolidColor/index.js +3 -7
  106. package/dist/core/shaders/Spherize/index.js +3 -7
  107. package/dist/core/shaders/Spiral/index.js +4 -8
  108. package/dist/core/shaders/Strands/index.js +4 -8
  109. package/dist/core/shaders/Stretch/index.js +4 -8
  110. package/dist/core/shaders/Swirl/index.js +5 -9
  111. package/dist/core/shaders/TiltShift/index.js +3 -7
  112. package/dist/core/shaders/Tritone/index.js +4 -8
  113. package/dist/core/shaders/Twirl/index.js +4 -8
  114. package/dist/core/shaders/Vibrance/index.js +2 -8
  115. package/dist/core/shaders/WaveDistortion/index.js +4 -8
  116. package/dist/core/shaders/ZoomBlur/index.js +3 -7
  117. package/dist/core/telemetry/index.js +189 -157
  118. package/dist/core/time-CTJvRUZ4.js +10 -0
  119. package/dist/core/transformations-DxfQXZWi.js +4715 -0
  120. package/dist/react/components/Beam.d.ts +31 -0
  121. package/dist/react/components/Beam.d.ts.map +1 -0
  122. package/dist/react/generatePresetCode-CCibXbtZ.js +645 -0
  123. package/dist/react/index.d.ts +1 -0
  124. package/dist/react/index.d.ts.map +1 -1
  125. package/dist/react/index.js +7649 -104600
  126. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  127. package/dist/react/utils/generatePresetCode.js +2 -5
  128. package/dist/registry.js +224 -0
  129. package/dist/solid/components/Beam.d.ts +28 -0
  130. package/dist/solid/components/Beam.d.ts.map +1 -0
  131. package/dist/solid/index.d.ts +1 -0
  132. package/dist/solid/index.d.ts.map +1 -1
  133. package/dist/solid/index.js +6691 -102524
  134. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  135. package/dist/solid/utils/generatePresetCode.js +586 -537
  136. package/dist/svelte/components/Beam.svelte.d.ts +19 -0
  137. package/dist/svelte/generatePresetCode-CymgoDq_.js +645 -0
  138. package/dist/svelte/index.d.ts +1 -0
  139. package/dist/svelte/index.js +6175 -102455
  140. package/dist/svelte/utils/generatePresetCode.js +2 -5
  141. package/dist/vue/components/Beam.vue.d.ts +57 -0
  142. package/dist/vue/components/Beam.vue.d.ts.map +1 -0
  143. package/dist/vue/generatePresetCode-CRJmU8iF.js +649 -0
  144. package/dist/vue/index.d.ts +1 -0
  145. package/dist/vue/index.d.ts.map +1 -1
  146. package/dist/vue/index.js +6929 -103492
  147. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  148. package/dist/vue/utils/generatePresetCode.js +2 -5
  149. package/package.json +12 -1
  150. package/dist/core/AngularBlur-ClvtyURQ.js +0 -56
  151. package/dist/core/Ascii-BT0-K_vw.js +0 -196
  152. package/dist/core/Blob-BlQ_1T_8.js +0 -169
  153. package/dist/core/Blur-421AjWLH.js +0 -64
  154. package/dist/core/Bulge-CZRVoR6C.js +0 -103
  155. package/dist/core/CRTScreen-C_U9g_IR.js +0 -91
  156. package/dist/core/ChannelBlur-5pzcB6Zv.js +0 -89
  157. package/dist/core/Checkerboard-CrQkqXhD.js +0 -75
  158. package/dist/core/ChromaFlow-CNrQdL8f.js +0 -134
  159. package/dist/core/ChromaticAberration-D9H7O17Y.js +0 -82
  160. package/dist/core/Circle-DnLaDn8V.js +0 -62
  161. package/dist/core/ColorAdjustment-CKwpE_4M.js +0 -14
  162. package/dist/core/CursorTrail-NY6n97VG.js +0 -105
  163. package/dist/core/DiffuseBlur-C_n01ABk.js +0 -69
  164. package/dist/core/Dither-4s-c4zh4.js +0 -61
  165. package/dist/core/DotGrid-BYl8XdMi.js +0 -61
  166. package/dist/core/Duotone-DbewOoB4.js +0 -66
  167. package/dist/core/FilmGrain-zA_-knOw.js +0 -28
  168. package/dist/core/FloatingParticles-BhVnqMsE.js +0 -160
  169. package/dist/core/GlassTiles-CFI57glh.js +0 -52
  170. package/dist/core/Glow-CQgl3IoS.js +0 -66
  171. package/dist/core/Godrays-BHMix_Bh.js +0 -105
  172. package/dist/core/Grayscale-CAEFLteL.js +0 -21
  173. package/dist/core/Grid-DlM-rVbZ.js +0 -50
  174. package/dist/core/GridDistortion-ZOZphSAT.js +0 -147
  175. package/dist/core/Group-BQAs3RiH.js +0 -17
  176. package/dist/core/Halftone-ci4ga-_J.js +0 -55
  177. package/dist/core/HueShift-CyxzPcJV.js +0 -32
  178. package/dist/core/ImageTexture-CdAGsPuH.js +0 -105
  179. package/dist/core/Invert-iPsiIqNZ.js +0 -20
  180. package/dist/core/LinearBlur-BEaaoIk-.js +0 -56
  181. package/dist/core/LinearGradient-DR_7RxLX.js +0 -111
  182. package/dist/core/Liquify-Bi02_ugh.js +0 -139
  183. package/dist/core/Pixelate-CSsdT1rr.js +0 -38
  184. package/dist/core/PolarCoordinates-D626ml58.js +0 -103
  185. package/dist/core/Posterize-DhZkMaC7.js +0 -46
  186. package/dist/core/ProgressiveBlur-CGtCfLF8.js +0 -102
  187. package/dist/core/RadialGradient-C0_WzmbH.js +0 -71
  188. package/dist/core/RectangularCoordinates-DfXw7fhI.js +0 -92
  189. package/dist/core/Ripples-DkemN3eh.js +0 -106
  190. package/dist/core/Saturation-Dup81Pnq.js +0 -31
  191. package/dist/core/SimplexNoise-BYEiCjDj.js +0 -94
  192. package/dist/core/SineWave-C6MRPtsy.js +0 -107
  193. package/dist/core/SolidColor-BZHRczgb.js +0 -22
  194. package/dist/core/Spherize-DOAnDx2l.js +0 -103
  195. package/dist/core/Spiral-BMjnWXh1.js +0 -115
  196. package/dist/core/Strands-BOVsuJLe.js +0 -125
  197. package/dist/core/Stretch-D6bHc6yp.js +0 -103
  198. package/dist/core/Swirl-BFoc0ImG.js +0 -148
  199. package/dist/core/TSLBase-BFMvTOak.js +0 -8053
  200. package/dist/core/TiltShift-BiNvvhzj.js +0 -114
  201. package/dist/core/Tritone-gdx2AA0m.js +0 -75
  202. package/dist/core/Twirl-BsV8YbqC.js +0 -82
  203. package/dist/core/Vibrance-C182fbSw.js +0 -31
  204. package/dist/core/WaveDistortion-CmaS2zDB.js +0 -132
  205. package/dist/core/ZoomBlur-DLf5xQ16.js +0 -56
  206. package/dist/core/colorMixing--dhzx0ch.js +0 -21
  207. package/dist/core/edges-CDzKsauJ.js +0 -15
  208. package/dist/core/three.tsl-Btj1hLsf.js +0 -43845
  209. package/dist/core/time-DbRMw6Jm.js +0 -10
  210. package/dist/core/transformations-CsrIJXh-.js +0 -3992
  211. package/dist/react/generatePresetCode-DaS7jkcT.js +0 -626
  212. package/dist/svelte/generatePresetCode-DaS7jkcT.js +0 -626
  213. package/dist/vue/generatePresetCode-Cd1B-Y9j.js +0 -632
@@ -1,5 +1,2 @@
1
- import { n as a, t as o } from "../generatePresetCode-DaS7jkcT.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,57 @@
1
+ import { BlendMode, TransformConfig } from '../../core';
2
+ import { ComponentProps } from '../../core/shaders/Beam';
3
+
4
+ /**
5
+ * Define component props including blend mode, opacity, visibility, masking, and transformation
6
+ */
7
+ interface ExtendedComponentProps extends Partial<ComponentProps> {
8
+ blendMode?: BlendMode;
9
+ opacity?: number;
10
+ visible?: boolean;
11
+ id?: string;
12
+ maskSource?: string;
13
+ maskType?: string;
14
+ renderOrder?: number;
15
+ transform?: Partial<TransformConfig>;
16
+ }
17
+ declare function __VLS_template(): {
18
+ default?(_: {}): any;
19
+ };
20
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
21
+ blendMode: string;
22
+ renderOrder: number;
23
+ visible: boolean;
24
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ExtendedComponentProps>, {
25
+ blendMode: string;
26
+ renderOrder: number;
27
+ visible: boolean;
28
+ }>>> & Readonly<{}>, {
29
+ blendMode: BlendMode;
30
+ visible: boolean;
31
+ renderOrder: number;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
34
+ export default _default;
35
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
+ type __VLS_TypePropsToRuntimeProps<T> = {
37
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
38
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
39
+ } : {
40
+ type: import('vue').PropType<T[K]>;
41
+ required: true;
42
+ };
43
+ };
44
+ type __VLS_WithDefaults<P, D> = {
45
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
46
+ default: D[K];
47
+ }> : P[K];
48
+ };
49
+ type __VLS_Prettify<T> = {
50
+ [K in keyof T]: T[K];
51
+ } & {};
52
+ type __VLS_WithTemplateSlots<T, S> = T & {
53
+ new (): {
54
+ $slots: S;
55
+ };
56
+ };
57
+ //# sourceMappingURL=Beam.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Beam.vue.d.ts","sourceRoot":"","sources":["../../src/components/Beam.vue"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EAId,KAAK,eAAe,EACrB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,mBAAmB,CAAA;AAI1E;;GAEG;AACH,UAAU,sBAAuB,SAAQ,OAAO,CAAC,cAAc,CAAC;IAC9D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACtC;AAgOD,iBAAS,cAAc;qBA0BM,GAAG;EAG/B;AAQD,QAAA,MAAM,eAAe;;;;;;;;;eA7QP,SAAS;aAEX,OAAO;iBAIH,MAAM;4EA6QpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -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 };