shaders 2.5.114 → 2.5.116

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 (204) hide show
  1. package/dist/core/{AngularBlur-BgZWbEjj.js → AngularBlur-C1oRJ8Y9.js} +1 -1
  2. package/dist/core/{Aurora-KcUDr49P.js → Aurora-D5Pjk4ve.js} +1 -1
  3. package/dist/core/{Beam-CAnoOWgt.js → Beam-mvF5Ri7_.js} +1 -1
  4. package/dist/core/{Blob-CuRSRXmA.js → Blob-CLHx5s6k.js} +1 -1
  5. package/dist/core/{Bulge-6gRUYqZS.js → Bulge-wflTcWfI.js} +1 -1
  6. package/dist/core/{Checkerboard-ucave4-a.js → Checkerboard-Db7Rb57F.js} +1 -1
  7. package/dist/core/{ChromaFlow-DxQaUqPL.js → ChromaFlow-DbiVz3hF.js} +1 -1
  8. package/dist/core/{ChromaticAberration-DsMj-vBw.js → ChromaticAberration-Bg_I4XF-.js} +1 -1
  9. package/dist/core/{Circle-QgCuVo44.js → Circle-Bfi2e0Vm.js} +1 -1
  10. package/dist/core/{ConcentricSpin-Fegtvhl6.js → ConcentricSpin-bAFd5_WI.js} +1 -1
  11. package/dist/core/{ConicGradient-CQAPYlQg.js → ConicGradient-Bcw4_25S.js} +1 -1
  12. package/dist/core/{ContourLines-tDBvQOvb.js → ContourLines-CcQWPKLx.js} +1 -1
  13. package/dist/core/{Crescent-BkRt-XWy.js → Crescent-DiioCL2k.js} +1 -1
  14. package/dist/core/{Cross-kkY7feuC.js → Cross-CxQTHuxC.js} +1 -1
  15. package/dist/core/{Crystal-COGiLVvV.js → Crystal-B3iO7o_n.js} +1 -1
  16. package/dist/core/{CursorRipples-BqtHgpEq.js → CursorRipples-CsYAXG2E.js} +1 -1
  17. package/dist/core/{CursorTrail-CgRMXbTG.js → CursorTrail-CUtEP_-P.js} +1 -1
  18. package/dist/core/{DiamondGradient-BC3ugP8a.js → DiamondGradient-3b93bdrv.js} +1 -1
  19. package/dist/core/{DiffuseBlur-B-Vki4ab.js → DiffuseBlur-61Vuq571.js} +1 -1
  20. package/dist/core/{Dither-CDfDotR6.js → Dither-Cv0Uci60.js} +1 -1
  21. package/dist/core/{DotGrid-T9YbgC3V.js → DotGrid-C88Sux6D.js} +1 -1
  22. package/dist/core/{DropShadow-B7FzTp4H.js → DropShadow-EZyCC_97.js} +1 -1
  23. package/dist/core/{Duotone-CqQ0NMxS.js → Duotone-D4ads1T9.js} +1 -1
  24. package/dist/core/{Ellipse-CXxGqTYI.js → Ellipse-iwH-zEvD.js} +1 -1
  25. package/dist/core/{Emboss-LU-6cckT.js → Emboss-B4i61QDT.js} +1 -1
  26. package/dist/core/{FallingLines-CArEXajJ.js → FallingLines-CQBvwLqn.js} +1 -1
  27. package/dist/core/{FloatingParticles-DpYA0_TE.js → FloatingParticles-BAvsQDhF.js} +1 -1
  28. package/dist/core/{FlowField-CTWyjeXm.js → FlowField-D2xJ0Xr4.js} +1 -1
  29. package/dist/core/{Flower-MAwlZEv8.js → Flower-CdHVKJKu.js} +1 -1
  30. package/dist/core/{FlowingGradient-C0Zoyfd6.js → FlowingGradient-DVDnNpGd.js} +1 -1
  31. package/dist/core/{FlutedGlass-B4FlyBOn.js → FlutedGlass-trmBFfQr.js} +1 -1
  32. package/dist/core/{Fog-CIdU2Wn-.js → Fog-DrsxPyih.js} +1 -1
  33. package/dist/core/{Form3D-CqmOXXGj.js → Form3D-D1TtCjk8.js} +1 -1
  34. package/dist/core/{Glass-BCOkQbvW.js → Glass-B19xsZLn.js} +1 -1
  35. package/dist/core/{Godrays-w3ruw4NO.js → Godrays-Mvz7ha2E.js} +1 -1
  36. package/dist/core/{Grid-CKbLS5tU.js → Grid-CsD21Eqg.js} +1 -1
  37. package/dist/core/{GridDistortion-CVpebl48.js → GridDistortion-BcDqBh9i.js} +1 -1
  38. package/dist/core/{Halftone-BGQeBAgG.js → Halftone-3ImN5uQi.js} +1 -1
  39. package/dist/core/{HexGrid-BFrnZEZT.js → HexGrid-BWwIHYEg.js} +1 -1
  40. package/dist/core/{Kaleidoscope-B0_OCrob.js → Kaleidoscope-D1HmcoOv.js} +1 -1
  41. package/dist/core/{LensFlare-B8x1fOKu.js → LensFlare-Be-Z9whi.js} +1 -1
  42. package/dist/core/{LinearBlur-CshzmjfO.js → LinearBlur-xrHtMmWp.js} +1 -1
  43. package/dist/core/{LinearGradient-Bzwquw_Q.js → LinearGradient-BiIad_hA.js} +1 -1
  44. package/dist/core/{Liquify-ZMAyGUIb.js → Liquify-DkTxZZFW.js} +1 -1
  45. package/dist/core/{Mirror-Gb0fugtF.js → Mirror-BDTE51kP.js} +1 -1
  46. package/dist/core/{MultiPointGradient-D0QQwizn.js → MultiPointGradient-Bd-EGOI8.js} +1 -1
  47. package/dist/core/{Neon-eN4HlILk.js → Neon-BeGABHrs.js} +1 -1
  48. package/dist/core/{Perspective-SBZzprC5.js → Perspective-CqweSeFv.js} +1 -1
  49. package/dist/core/{Plasma-COq8mAw2.js → Plasma-DqKLBDYd.js} +1 -1
  50. package/dist/core/{PolarCoordinates-Ckvb1eG0.js → PolarCoordinates-CKT4CLT7.js} +1 -1
  51. package/dist/core/{Polygon-BP5eKEiz.js → Polygon-_3DSqSBg.js} +1 -1
  52. package/dist/core/{ProgressiveBlur-CNacb2Qx.js → ProgressiveBlur-Dh8W2bZ3.js} +1 -1
  53. package/dist/core/{RadialGradient-SASVv2vb.js → RadialGradient-Dj3-DdO7.js} +1 -1
  54. package/dist/core/{RectangularCoordinates-r0fTwVuL.js → RectangularCoordinates-DxeLJ2nt.js} +1 -1
  55. package/dist/core/{Ring-CdJlzjRV.js → Ring-4J6h5Iof.js} +1 -1
  56. package/dist/core/{Ripples-BRZPZszq.js → Ripples-CXeVzwUd.js} +1 -1
  57. package/dist/core/{RoundedRect-lzzi_1J7.js → RoundedRect-Dj-gqOc0.js} +1 -1
  58. package/dist/core/{Shatter-CC3EFcP9.js → Shatter-CDza7dSw.js} +1 -1
  59. package/dist/core/{SimplexNoise-0-rfeziU.js → SimplexNoise-HQTocBLm.js} +1 -1
  60. package/dist/core/{SineWave--i6bSrad.js → SineWave-S6nK8ZHR.js} +1 -1
  61. package/dist/core/{Smoke-BgPHDWDR.js → Smoke-DjlArYQW.js} +1 -1
  62. package/dist/core/{SmokeFill-Dtctgt2S.js → SmokeFill-rM9vUIm4.js} +1 -1
  63. package/dist/core/{SolidColor-D9ikFFu3.js → SolidColor-a8bCIksn.js} +1 -1
  64. package/dist/core/{Spherize-ZBorEEOU.js → Spherize-BHmD2ajL.js} +1 -1
  65. package/dist/core/{Spiral-sg-i02xw.js → Spiral-Bjsi8BMH.js} +1 -1
  66. package/dist/core/{Star-BcqCHzHG.js → Star-CJ4mkBZg.js} +1 -1
  67. package/dist/core/{Strands-XLpth60o.js → Strands-C9fEwaiR.js} +1 -1
  68. package/dist/core/{Stretch-CJUUU-I1.js → Stretch-Cvht8B0L.js} +1 -1
  69. package/dist/core/{Stripes-DEOXYnmy.js → Stripes-ChVSAeCO.js} +1 -1
  70. package/dist/core/{StudioBackground-B5dpTR_X.js → StudioBackground-B8hilROB.js} +1 -1
  71. package/dist/core/{Swirl-WqPvBF7u.js → Swirl-DZTPLx-W.js} +1 -1
  72. package/dist/core/{TiltShift-CYb6OQoU.js → TiltShift-DSQ-CsXz.js} +1 -1
  73. package/dist/core/{Tint-C-bJpwd0.js → Tint-P7KwJAU5.js} +1 -1
  74. package/dist/core/{Trapezoid-BvTEGdW_.js → Trapezoid-P9gXhH9a.js} +1 -1
  75. package/dist/core/{Tritone-LX-qUAGy.js → Tritone-_9VR2bhu.js} +1 -1
  76. package/dist/core/{Truchet-DE4lgYRb.js → Truchet-CbL5nYMj.js} +1 -1
  77. package/dist/core/{Twirl-CgRyZdT1.js → Twirl-C_97m32v.js} +1 -1
  78. package/dist/core/{Vesica-DqJMyqmy.js → Vesica-DYov_i53.js} +1 -1
  79. package/dist/core/{Vignette-CA12P9VO.js → Vignette-DmYVHciL.js} +1 -1
  80. package/dist/core/{Voronoi-DXeJ3xOf.js → Voronoi-kngFpTNB.js} +1 -1
  81. package/dist/core/{WaveDistortion-iyTUI1lj.js → WaveDistortion-DM-f_XCw.js} +1 -1
  82. package/dist/core/{Weave-Bn2CfeE4.js → Weave-DO0m0Dsh.js} +1 -1
  83. package/dist/core/{ZoomBlur-DOzP_sOK.js → ZoomBlur-DLaH226M.js} +1 -1
  84. package/dist/core/index.js +85 -85
  85. package/dist/core/registry.js +85 -85
  86. package/dist/core/{shaderRegistry-SmtG2mTo.js → shaderRegistry-BPtUQU-N.js} +83 -83
  87. package/dist/core/shaders/AngularBlur/index.js +2 -2
  88. package/dist/core/shaders/Aurora/index.js +2 -2
  89. package/dist/core/shaders/Beam/index.js +2 -2
  90. package/dist/core/shaders/Blob/index.js +2 -2
  91. package/dist/core/shaders/Bulge/index.js +2 -2
  92. package/dist/core/shaders/Checkerboard/index.js +2 -2
  93. package/dist/core/shaders/ChromaFlow/index.js +2 -2
  94. package/dist/core/shaders/ChromaticAberration/index.js +2 -2
  95. package/dist/core/shaders/Circle/index.js +2 -2
  96. package/dist/core/shaders/ConcentricSpin/index.js +2 -2
  97. package/dist/core/shaders/ConicGradient/index.js +2 -2
  98. package/dist/core/shaders/ContourLines/index.js +2 -2
  99. package/dist/core/shaders/Crescent/index.js +2 -2
  100. package/dist/core/shaders/Cross/index.js +2 -2
  101. package/dist/core/shaders/Crystal/index.js +2 -2
  102. package/dist/core/shaders/CursorRipples/index.js +2 -2
  103. package/dist/core/shaders/CursorTrail/index.js +2 -2
  104. package/dist/core/shaders/DiamondGradient/index.js +2 -2
  105. package/dist/core/shaders/DiffuseBlur/index.js +2 -2
  106. package/dist/core/shaders/Dither/index.js +2 -2
  107. package/dist/core/shaders/DotGrid/index.js +2 -2
  108. package/dist/core/shaders/DropShadow/index.js +2 -2
  109. package/dist/core/shaders/Duotone/index.js +2 -2
  110. package/dist/core/shaders/Ellipse/index.js +2 -2
  111. package/dist/core/shaders/Emboss/index.js +2 -2
  112. package/dist/core/shaders/FallingLines/index.js +2 -2
  113. package/dist/core/shaders/FloatingParticles/index.js +2 -2
  114. package/dist/core/shaders/FlowField/index.js +2 -2
  115. package/dist/core/shaders/Flower/index.js +2 -2
  116. package/dist/core/shaders/FlowingGradient/index.js +2 -2
  117. package/dist/core/shaders/FlutedGlass/index.js +2 -2
  118. package/dist/core/shaders/Fog/index.js +2 -2
  119. package/dist/core/shaders/Form3D/index.js +2 -2
  120. package/dist/core/shaders/Glass/index.js +2 -2
  121. package/dist/core/shaders/Godrays/index.js +2 -2
  122. package/dist/core/shaders/Grid/index.js +2 -2
  123. package/dist/core/shaders/GridDistortion/index.js +2 -2
  124. package/dist/core/shaders/Halftone/index.js +2 -2
  125. package/dist/core/shaders/HexGrid/index.js +2 -2
  126. package/dist/core/shaders/Kaleidoscope/index.js +2 -2
  127. package/dist/core/shaders/LensFlare/index.js +2 -2
  128. package/dist/core/shaders/LinearBlur/index.js +2 -2
  129. package/dist/core/shaders/LinearGradient/index.js +2 -2
  130. package/dist/core/shaders/Liquify/index.js +2 -2
  131. package/dist/core/shaders/Mirror/index.js +2 -2
  132. package/dist/core/shaders/MultiPointGradient/index.js +2 -2
  133. package/dist/core/shaders/Neon/index.js +2 -2
  134. package/dist/core/shaders/Perspective/index.js +2 -2
  135. package/dist/core/shaders/Plasma/index.js +2 -2
  136. package/dist/core/shaders/PolarCoordinates/index.js +2 -2
  137. package/dist/core/shaders/Polygon/index.js +2 -2
  138. package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
  139. package/dist/core/shaders/RadialGradient/index.js +2 -2
  140. package/dist/core/shaders/RectangularCoordinates/index.js +2 -2
  141. package/dist/core/shaders/Ring/index.js +2 -2
  142. package/dist/core/shaders/Ripples/index.js +2 -2
  143. package/dist/core/shaders/RoundedRect/index.js +2 -2
  144. package/dist/core/shaders/Shatter/index.js +2 -2
  145. package/dist/core/shaders/SimplexNoise/index.js +2 -2
  146. package/dist/core/shaders/SineWave/index.js +2 -2
  147. package/dist/core/shaders/Smoke/index.js +2 -2
  148. package/dist/core/shaders/SmokeFill/index.js +2 -2
  149. package/dist/core/shaders/SolidColor/index.js +2 -2
  150. package/dist/core/shaders/Spherize/index.js +2 -2
  151. package/dist/core/shaders/Spiral/index.js +2 -2
  152. package/dist/core/shaders/Star/index.js +2 -2
  153. package/dist/core/shaders/Strands/index.js +2 -2
  154. package/dist/core/shaders/Stretch/index.js +2 -2
  155. package/dist/core/shaders/Stripes/index.js +2 -2
  156. package/dist/core/shaders/StudioBackground/index.js +2 -2
  157. package/dist/core/shaders/Swirl/index.js +2 -2
  158. package/dist/core/shaders/TiltShift/index.js +2 -2
  159. package/dist/core/shaders/Tint/index.js +2 -2
  160. package/dist/core/shaders/Trapezoid/index.js +2 -2
  161. package/dist/core/shaders/Tritone/index.js +2 -2
  162. package/dist/core/shaders/Truchet/index.js +2 -2
  163. package/dist/core/shaders/Twirl/index.js +2 -2
  164. package/dist/core/shaders/Vesica/index.js +2 -2
  165. package/dist/core/shaders/Vignette/index.js +2 -2
  166. package/dist/core/shaders/Voronoi/index.js +2 -2
  167. package/dist/core/shaders/WaveDistortion/index.js +2 -2
  168. package/dist/core/shaders/Weave/index.js +2 -2
  169. package/dist/core/shaders/ZoomBlur/index.js +2 -2
  170. package/dist/core/{transformations-B5lM6fYX.js → transformations-CJcUeZIC.js} +23 -8
  171. package/dist/core/utilities/transformations/index.js +1 -1
  172. package/dist/core/utilities/transformations.d.ts.map +1 -1
  173. package/dist/js/createPreview.d.ts +7 -3
  174. package/dist/js/createPreview.d.ts.map +1 -1
  175. package/dist/js/createPreview.js +110 -4
  176. package/dist/js/createShader.js +1 -1
  177. package/dist/js/types.d.ts +32 -0
  178. package/dist/js/types.d.ts.map +1 -1
  179. package/dist/js/utils/generatePresetCode.js +1 -1
  180. package/dist/react/Preview.js +113 -9
  181. package/dist/react/Shader.js +1 -1
  182. package/dist/react/bundle.js +196 -196
  183. package/dist/react/engine/Preview.d.ts +29 -0
  184. package/dist/react/engine/Preview.d.ts.map +1 -1
  185. package/dist/react/utils/generatePresetCode.d.ts.map +1 -1
  186. package/dist/react/utils/generatePresetCode.js +1 -1
  187. package/dist/react/utils/generatePresetCode.template.d.ts.map +1 -1
  188. package/dist/solid/engine/Preview.d.ts +18 -0
  189. package/dist/solid/engine/Preview.d.ts.map +1 -1
  190. package/dist/solid/engine/Preview.js +69 -2
  191. package/dist/solid/engine/Shader.js +1 -1
  192. package/dist/solid/utils/generatePresetCode.d.ts.map +1 -1
  193. package/dist/solid/utils/generatePresetCode.js +1 -1
  194. package/dist/solid/utils/generatePresetCode.template.d.ts.map +1 -1
  195. package/dist/svelte/engine/Preview.svelte.d.ts +18 -0
  196. package/dist/svelte/index.js +124 -13
  197. package/dist/svelte/source/engine/Preview.svelte +134 -10
  198. package/dist/svelte/utils/generatePresetCode.js +1 -1
  199. package/dist/vue/Preview.vue_vue_type_script_setup_true_lang.js +111 -8
  200. package/dist/vue/Shader.vue_vue_type_script_setup_true_lang.js +1 -1
  201. package/dist/vue/utils/generatePresetCode.d.ts.map +1 -1
  202. package/dist/vue/utils/generatePresetCode.js +1 -1
  203. package/dist/vue/utils/generatePresetCode.template.d.ts.map +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;kBAKc;IACd,GAAG,CAAC,EAAE;QACJ,MAAM,EAAE,SAAS,CAAA;QACjB,OAAO,EAAE,UAAU,CAAA;KACpB,CAAA;CACF;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;IAC7D;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7C,mFAAmF;IACnF,KAAK,IAAI,IAAI,CAAA;IACb,kDAAkD;IAClD,MAAM,IAAI,IAAI,CAAA;IACd,OAAO,IAAI,IAAI,CAAA;CAChB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;kBAKc;IACd,GAAG,CAAC,EAAE;QACJ,MAAM,EAAE,SAAS,CAAA;QACjB,OAAO,EAAE,UAAU,CAAA;KACpB,CAAA;CACF;AAED,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,aAAa,EAAE,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,iGAAiG;IACjG,gBAAgB,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC/D;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;IAC7D;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7C,mFAAmF;IACnF,KAAK,IAAI,IAAI,CAAA;IACb,kDAAkD;IAClD,MAAM,IAAI,IAAI,CAAA;IACd,OAAO,IAAI,IAAI,CAAA;CAChB"}
@@ -1374,7 +1374,7 @@ function formatValue(value, indent) {
1374
1374
  }
1375
1375
  function shouldIncludeProp(key, value, componentType, props) {
1376
1376
  if (key === "maskType" && value === "alpha") return false;
1377
- if (key === "shape" && props.shapeSdfUrl) return false;
1377
+ if ((key === "shape" || key === "shapeType") && props.shapeSdfUrl) return false;
1378
1378
  if (key === "transform" && typeof value === "object") {
1379
1379
  if (Object.keys(DEFAULT_TRANSFORM).every((k) => value[k] === DEFAULT_TRANSFORM[k])) return false;
1380
1380
  }
@@ -19,6 +19,94 @@ function decodePreviewDefinition(encoded, key) {
19
19
  throw new Error("Failed to decode shader definition: invalid data or incorrect key");
20
20
  }
21
21
  }
22
+ var RESERVED_IDENTIFIERS = new Set([
23
+ "break",
24
+ "case",
25
+ "catch",
26
+ "class",
27
+ "const",
28
+ "continue",
29
+ "default",
30
+ "delete",
31
+ "do",
32
+ "else",
33
+ "export",
34
+ "extends",
35
+ "finally",
36
+ "for",
37
+ "function",
38
+ "if",
39
+ "import",
40
+ "in",
41
+ "instanceof",
42
+ "new",
43
+ "return",
44
+ "super",
45
+ "switch",
46
+ "this",
47
+ "throw",
48
+ "try",
49
+ "typeof",
50
+ "var",
51
+ "void",
52
+ "while",
53
+ "with",
54
+ "yield"
55
+ ]);
56
+ function slugifyIdentifier(label, fallback) {
57
+ const cleaned = label.replace(/[^A-Za-z0-9]+/g, " ").trim();
58
+ if (!cleaned) return fallback;
59
+ const camel = cleaned.split(/\s+/).map((part, i) => i === 0 ? part.charAt(0).toLowerCase() + part.slice(1) : part.charAt(0).toUpperCase() + part.slice(1)).join("");
60
+ const safe = /^[A-Za-z_$]/.test(camel) ? camel : `_${camel}`;
61
+ return RESERVED_IDENTIFIERS.has(safe) ? `_${safe}` : safe;
62
+ }
63
+ function buildKeyPropIdentifierMap(keyProps) {
64
+ const used = new Set(["style"]);
65
+ const map = /* @__PURE__ */ new Map();
66
+ if (!keyProps?.length) return map;
67
+ keyProps.forEach((kp, i) => {
68
+ if (!kp.targets?.length) return;
69
+ const base = slugifyIdentifier(kp.label, `keyProp${i}`);
70
+ let ident = base;
71
+ let suffix = 1;
72
+ while (used.has(ident)) {
73
+ suffix++;
74
+ ident = `${base}${suffix}`;
75
+ }
76
+ used.add(ident);
77
+ map.set(ident, kp);
78
+ });
79
+ return map;
80
+ }
81
+ function findInTree(id, list) {
82
+ for (const c of list) {
83
+ if (c.id === id) return c;
84
+ if (c.children?.length) {
85
+ const hit = findInTree(id, c.children);
86
+ if (hit) return hit;
87
+ }
88
+ }
89
+ return null;
90
+ }
91
+ function applyConfiguration(definition, configuration, keyProps) {
92
+ if (!configuration || !keyProps?.length) return definition;
93
+ const entries = Object.entries(configuration);
94
+ if (entries.length === 0) return definition;
95
+ const identMap = buildKeyPropIdentifierMap(keyProps);
96
+ const cloned = JSON.parse(JSON.stringify(definition.components));
97
+ for (const [ident, value] of entries) {
98
+ const kp = identMap.get(ident);
99
+ if (!kp) continue;
100
+ for (const t of kp.targets ?? []) {
101
+ const comp = findInTree(t.component_id, cloned);
102
+ if (comp?.props && t.prop in comp.props) comp.props[t.prop] = value;
103
+ }
104
+ }
105
+ return {
106
+ ...definition,
107
+ components: cloned
108
+ };
109
+ }
22
110
  var componentMap = {
23
111
  AngularBlur: lazy(() => import("./AngularBlur.js")),
24
112
  Ascii: lazy(() => import("./Ascii.js")),
@@ -158,23 +246,31 @@ function RenderComponent({ component }) {
158
246
  children: children?.map((child, index) => /* @__PURE__ */ jsx(RenderComponent, { component: child }, child.id || index))
159
247
  });
160
248
  }
161
- const Preview = ({ shader, presetId, apiBaseUrl = "https://shaders.com", obfuscationKey = DEFAULT_KEY, watermarkText = "Unlock your Shaders Pro license", watermarkLink = "https://shaders.com/dashboard?pricing=true", style, className,...rest }) => {
249
+ const Preview = ({ shader, presetId, apiBaseUrl = "https://shaders.com", obfuscationKey = DEFAULT_KEY, watermarkText = "Unlock your Shaders Pro license", watermarkLink = "https://shaders.com/dashboard?pricing=true", style, className, configuration, version,...rest }) => {
162
250
  const [fetchedDefinition, setFetchedDefinition] = useState(null);
251
+ const [fetchedKeyProps, setFetchedKeyProps] = useState(null);
163
252
  const fetchAndDecode = (url) => {
164
253
  setFetchedDefinition(null);
254
+ setFetchedKeyProps(null);
165
255
  fetch(url).then((res) => {
166
256
  if (!res.ok) throw new Error(`Failed to fetch: ${res.status}`);
167
257
  return res.json();
168
258
  }).then((data) => {
169
259
  const item = data.preset || data.shader;
170
- if (item?.definition && typeof item.definition === "string") setFetchedDefinition(decodePreviewDefinition(item.definition, obfuscationKey));
260
+ if (item?.definition && typeof item.definition === "string") {
261
+ setFetchedDefinition(decodePreviewDefinition(item.definition, obfuscationKey));
262
+ setFetchedKeyProps(Array.isArray(item.key_props) ? item.key_props : null);
263
+ }
171
264
  }).catch((err) => {
172
265
  console.error("[Shaders Preview] Failed to fetch preview:", err);
173
266
  });
174
267
  };
175
268
  useEffect(() => {
176
269
  if (shader) fetchAndDecode(`${apiBaseUrl}/api/preview/shader/${shader}`);
177
- else if (!presetId) setFetchedDefinition(null);
270
+ else if (!presetId) {
271
+ setFetchedDefinition(null);
272
+ setFetchedKeyProps(null);
273
+ }
178
274
  }, [
179
275
  shader,
180
276
  presetId,
@@ -182,18 +278,26 @@ const Preview = ({ shader, presetId, apiBaseUrl = "https://shaders.com", obfusca
182
278
  obfuscationKey
183
279
  ]);
184
280
  useEffect(() => {
185
- if (presetId) fetchAndDecode(`${apiBaseUrl}/api/preview/preset/${presetId}`);
186
- else if (!shader) setFetchedDefinition(null);
281
+ if (presetId) fetchAndDecode(`${apiBaseUrl}/api/preview/preset/${presetId}${version ? `?version=${encodeURIComponent(version)}` : ""}`);
282
+ else if (!shader) {
283
+ setFetchedDefinition(null);
284
+ setFetchedKeyProps(null);
285
+ }
187
286
  }, [
188
287
  presetId,
189
288
  shader,
190
289
  apiBaseUrl,
191
- obfuscationKey
290
+ obfuscationKey,
291
+ version
192
292
  ]);
193
293
  const definition = useMemo(() => {
194
- if (fetchedDefinition) return fetchedDefinition;
195
- return null;
196
- }, [fetchedDefinition]);
294
+ if (!fetchedDefinition) return null;
295
+ return applyConfiguration(fetchedDefinition, configuration, fetchedKeyProps);
296
+ }, [
297
+ fetchedDefinition,
298
+ fetchedKeyProps,
299
+ configuration
300
+ ]);
197
301
  const hasWarnedRef = useRef(false);
198
302
  useEffect(() => {
199
303
  if (!hasWarnedRef.current && definition) {
@@ -89,7 +89,7 @@ const Shader = ({ children, disableTelemetry = false, colorSpace = "p3-linear",
89
89
  return;
90
90
  }
91
91
  if (rendererRef.current.getPerformanceStats().fps > 0) {
92
- telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.114", disableTelemetry, isPreview);
92
+ telemetryCollectorRef.current = startTelemetry(rendererRef.current, "2.5.116", disableTelemetry, isPreview);
93
93
  if (telemetryCollectorRef.current) telemetryCollectorRef.current.start();
94
94
  telemetryStartTimeoutRef.current = null;
95
95
  } else telemetryStartTimeoutRef.current = window.setTimeout(checkRendering, 500);