@supersoniks/concorde 4.9.98-visual-stack.0 → 4.9.98-visual-stack.2

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 (476) hide show
  1. package/.gitlab-ci.yml +0 -13
  2. package/build-infos.json +1 -1
  3. package/concorde-3d.bundle.js +201 -152
  4. package/concorde-3d.es.js +14688 -13906
  5. package/concorde-core.bundle.js +557 -622
  6. package/concorde-core.es.js +6025 -5575
  7. package/concorde-hugging-face-infer.bundle.js +1 -1
  8. package/concorde-hugging-face-infer.es.js +1 -1
  9. package/concorde-interactive.bundle.js +1162 -0
  10. package/concorde-interactive.es.js +10723 -0
  11. package/concorde-shader.bundle.js +31 -20
  12. package/concorde-shader.es.js +2773 -2547
  13. package/concorde-webgpu.bundle.js +43 -32
  14. package/concorde-webgpu.es.js +1819 -1553
  15. package/dist/concorde-3d.bundle.js +201 -152
  16. package/dist/concorde-3d.es.js +14688 -13906
  17. package/dist/concorde-core.bundle.js +557 -622
  18. package/dist/concorde-core.es.js +6025 -5575
  19. package/dist/concorde-hugging-face-infer.bundle.js +1 -1
  20. package/dist/concorde-hugging-face-infer.es.js +1 -1
  21. package/dist/concorde-interactive.bundle.js +1162 -0
  22. package/dist/concorde-interactive.es.js +10723 -0
  23. package/dist/concorde-shader.bundle.js +31 -20
  24. package/dist/concorde-shader.es.js +2773 -2547
  25. package/dist/concorde-webgpu.bundle.js +43 -32
  26. package/dist/concorde-webgpu.es.js +1819 -1553
  27. package/dist/docs-mock-api-sw.js +5 -1
  28. package/dist/docs-mock-api-sw.js.map +2 -2
  29. package/dist/js/addons/interactive.js +6 -0
  30. package/dist/js/addons/interactive.js.map +1 -0
  31. package/dist/js/core/components/functional/3d/3d.js +90 -2
  32. package/dist/js/core/components/functional/3d/3d.js.map +1 -1
  33. package/dist/js/core/components/functional/3d/constants.js +1 -0
  34. package/dist/js/core/components/functional/3d/constants.js.map +1 -1
  35. package/dist/js/core/components/functional/3d/ensure.js +6 -3
  36. package/dist/js/core/components/functional/3d/ensure.js.map +1 -1
  37. package/dist/js/core/components/functional/3d/form-params.js +2 -0
  38. package/dist/js/core/components/functional/3d/form-params.js.map +1 -1
  39. package/dist/js/core/components/functional/3d/life.js +2 -1
  40. package/dist/js/core/components/functional/3d/life.js.map +1 -1
  41. package/dist/js/core/components/functional/3d/out-publish.js +3 -2
  42. package/dist/js/core/components/functional/3d/out-publish.js.map +1 -1
  43. package/dist/js/core/components/functional/3d/playback.js +6 -1
  44. package/dist/js/core/components/functional/3d/playback.js.map +1 -1
  45. package/dist/js/core/components/functional/3d/post-bind.js +207 -0
  46. package/dist/js/core/components/functional/3d/post-bind.js.map +1 -0
  47. package/dist/js/core/components/functional/3d/post-channels.js +39 -0
  48. package/dist/js/core/components/functional/3d/post-channels.js.map +1 -0
  49. package/dist/js/core/components/functional/3d/post-fx.js +495 -0
  50. package/dist/js/core/components/functional/3d/post-fx.js.map +1 -0
  51. package/dist/js/core/components/functional/3d/props.js +142 -0
  52. package/dist/js/core/components/functional/3d/props.js.map +1 -1
  53. package/dist/js/core/components/functional/3d/reload.js +2 -0
  54. package/dist/js/core/components/functional/3d/reload.js.map +1 -1
  55. package/dist/js/core/components/functional/3d/runtime.js +80 -3
  56. package/dist/js/core/components/functional/3d/runtime.js.map +1 -1
  57. package/dist/js/core/components/functional/3d/scene-runtime.js +1 -1
  58. package/dist/js/core/components/functional/3d/scene-runtime.js.map +1 -1
  59. package/dist/js/core/components/functional/3d/tune.js +21 -0
  60. package/dist/js/core/components/functional/3d/tune.js.map +1 -1
  61. package/dist/js/core/components/functional/3d/updated.js +13 -1
  62. package/dist/js/core/components/functional/3d/updated.js.map +1 -1
  63. package/dist/js/core/components/functional/if/if.js +65 -7
  64. package/dist/js/core/components/functional/if/if.js.map +1 -1
  65. package/dist/js/core/components/functional/interactive/action.js +96 -0
  66. package/dist/js/core/components/functional/interactive/action.js.map +1 -0
  67. package/dist/js/core/components/functional/interactive/gamepad.js +206 -0
  68. package/dist/js/core/components/functional/interactive/gamepad.js.map +1 -0
  69. package/dist/js/core/components/functional/interactive/gesture.js +148 -0
  70. package/dist/js/core/components/functional/interactive/gesture.js.map +1 -0
  71. package/dist/js/core/components/functional/interactive/helpers.js +82 -0
  72. package/dist/js/core/components/functional/interactive/helpers.js.map +1 -0
  73. package/dist/js/core/components/functional/interactive/index.js +20 -0
  74. package/dist/js/core/components/functional/interactive/index.js.map +1 -0
  75. package/dist/js/core/components/functional/interactive/keyboard.js +183 -0
  76. package/dist/js/core/components/functional/interactive/keyboard.js.map +1 -0
  77. package/dist/js/core/components/functional/interactive/matrix.js +201 -0
  78. package/dist/js/core/components/functional/interactive/matrix.js.map +1 -0
  79. package/dist/js/core/components/functional/interactive/registry.js +28 -0
  80. package/dist/js/core/components/functional/interactive/registry.js.map +1 -0
  81. package/dist/js/core/components/functional/interactive/store.js +264 -0
  82. package/dist/js/core/components/functional/interactive/store.js.map +1 -0
  83. package/dist/js/core/components/functional/interactive/ticker.js +182 -0
  84. package/dist/js/core/components/functional/interactive/ticker.js.map +1 -0
  85. package/dist/js/core/components/functional/shader/gl-runtime.js +128 -14
  86. package/dist/js/core/components/functional/shader/gl-runtime.js.map +1 -1
  87. package/dist/js/core/components/functional/shader/shader.js +154 -57
  88. package/dist/js/core/components/functional/shader/shader.js.map +1 -1
  89. package/dist/js/core/components/functional/shader/shadertoy-prelude.js +39 -5
  90. package/dist/js/core/components/functional/shader/shadertoy-prelude.js.map +1 -1
  91. package/dist/js/core/components/functional/shader/types.js +58 -7
  92. package/dist/js/core/components/functional/shader/types.js.map +1 -1
  93. package/dist/js/core/components/functional/value/value.js +49 -4
  94. package/dist/js/core/components/functional/value/value.js.map +1 -1
  95. package/dist/js/core/components/functional/webgpu/gl-fallback.js +27 -6
  96. package/dist/js/core/components/functional/webgpu/gl-fallback.js.map +1 -1
  97. package/dist/js/core/components/functional/webgpu/gpu-runtime.js +115 -13
  98. package/dist/js/core/components/functional/webgpu/gpu-runtime.js.map +1 -1
  99. package/dist/js/core/components/functional/webgpu/helpers.js +8 -2
  100. package/dist/js/core/components/functional/webgpu/helpers.js.map +1 -1
  101. package/dist/js/core/components/functional/webgpu/webgpu.js +34 -1
  102. package/dist/js/core/components/functional/webgpu/webgpu.js.map +1 -1
  103. package/dist/js/core/components/ui/_css/rounded.js +34 -0
  104. package/dist/js/core/components/ui/_css/rounded.js.map +1 -0
  105. package/dist/js/core/components/ui/_css/type.js +44 -0
  106. package/dist/js/core/components/ui/_css/type.js.map +1 -1
  107. package/dist/js/core/components/ui/_i18n/ui-aria-labels.js +95 -0
  108. package/dist/js/core/components/ui/_i18n/ui-aria-labels.js.map +1 -0
  109. package/dist/js/core/components/ui/alert/alert.js +72 -87
  110. package/dist/js/core/components/ui/alert/alert.js.map +1 -1
  111. package/dist/js/core/components/ui/alert-messages/alert-messages.js +1 -0
  112. package/dist/js/core/components/ui/alert-messages/alert-messages.js.map +1 -1
  113. package/dist/js/core/components/ui/badge/badge.js +29 -80
  114. package/dist/js/core/components/ui/badge/badge.js.map +1 -1
  115. package/dist/js/core/components/ui/button/button.js +8 -7
  116. package/dist/js/core/components/ui/button/button.js.map +1 -1
  117. package/dist/js/core/components/ui/card/card-header.js +7 -2
  118. package/dist/js/core/components/ui/card/card-header.js.map +1 -1
  119. package/dist/js/core/components/ui/divider/divider.js +1 -1
  120. package/dist/js/core/components/ui/divider/divider.js.map +1 -1
  121. package/dist/js/core/components/ui/form/checkbox/checkbox.js +4 -20
  122. package/dist/js/core/components/ui/form/checkbox/checkbox.js.map +1 -1
  123. package/dist/js/core/components/ui/form/fieldset/legend-description.js +1 -1
  124. package/dist/js/core/components/ui/form/fieldset/legend.js +1 -1
  125. package/dist/js/core/components/ui/form/input/input.js +12 -15
  126. package/dist/js/core/components/ui/form/input/input.js.map +1 -1
  127. package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js +363 -158
  128. package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js.map +1 -1
  129. package/dist/js/core/components/ui/form/radio/radio.js +1 -1
  130. package/dist/js/core/components/ui/form/select/select.js +3 -6
  131. package/dist/js/core/components/ui/form/select/select.js.map +1 -1
  132. package/dist/js/core/components/ui/form/textarea/textarea.js +1 -2
  133. package/dist/js/core/components/ui/form/textarea/textarea.js.map +1 -1
  134. package/dist/js/core/components/ui/image/image.js +9 -37
  135. package/dist/js/core/components/ui/image/image.js.map +1 -1
  136. package/dist/js/core/components/ui/link/link.js +25 -26
  137. package/dist/js/core/components/ui/link/link.js.map +1 -1
  138. package/dist/js/core/components/ui/modal/modal-close.js +3 -12
  139. package/dist/js/core/components/ui/modal/modal-close.js.map +1 -1
  140. package/dist/js/core/components/ui/modal/modal.js +18 -18
  141. package/dist/js/core/components/ui/modal/modal.js.map +1 -1
  142. package/dist/js/core/components/ui/pop/pop.js +131 -112
  143. package/dist/js/core/components/ui/pop/pop.js.map +1 -1
  144. package/dist/js/core/components/ui/table/table.js.map +1 -1
  145. package/dist/js/core/components/ui/theme/theme.js +1 -1
  146. package/dist/js/core/components/ui/toast/dismissed.js +9 -0
  147. package/dist/js/core/components/ui/toast/dismissed.js.map +1 -0
  148. package/dist/js/core/components/ui/toast/render-content.js +14 -0
  149. package/dist/js/core/components/ui/toast/render-content.js.map +1 -0
  150. package/dist/js/core/components/ui/toast/toast-item.js +150 -96
  151. package/dist/js/core/components/ui/toast/toast-item.js.map +1 -1
  152. package/dist/js/core/components/ui/toast/toast.js +41 -13
  153. package/dist/js/core/components/ui/toast/toast.js.map +1 -1
  154. package/dist/js/core/components/ui/tooltip/tooltip.js +144 -143
  155. package/dist/js/core/components/ui/tooltip/tooltip.js.map +1 -1
  156. package/dist/js/core/decorators/subscriber/ancestorAttribute.js.map +1 -1
  157. package/dist/js/core/decorators/subscriber/derive.js +3 -1
  158. package/dist/js/core/decorators/subscriber/derive.js.map +1 -1
  159. package/dist/js/core/mixins/Fetcher.js.map +1 -1
  160. package/dist/js/core/mixins/FormCheckable.js +1 -8
  161. package/dist/js/core/mixins/FormCheckable.js.map +1 -1
  162. package/dist/js/core/mixins/FormElement.js +26 -53
  163. package/dist/js/core/mixins/FormElement.js.map +1 -1
  164. package/dist/js/core/utils/AncestorAttributeObserver.js +130 -55
  165. package/dist/js/core/utils/AncestorAttributeObserver.js.map +1 -1
  166. package/dist/js/core/utils/LocationHandler.js +1 -1
  167. package/dist/js/core/utils/LocationHandler.js.map +1 -1
  168. package/dist/js/core/utils/dismissed.js +23 -0
  169. package/dist/js/core/utils/dismissed.js.map +1 -0
  170. package/dist/js/core/utils/mediaRef.js +37 -0
  171. package/dist/js/core/utils/mediaRef.js.map +1 -1
  172. package/dist/js/core/utils/positioning.js +110 -0
  173. package/dist/js/core/utils/positioning.js.map +1 -0
  174. package/dist/js/directives.js +1 -2
  175. package/dist/js/directives.js.map +1 -1
  176. package/dist/types/addons/interactive.d.ts +6 -0
  177. package/dist/types/addons/interactive.d.ts.map +1 -0
  178. package/dist/types/core/components/functional/3d/3d.d.ts +26 -3
  179. package/dist/types/core/components/functional/3d/3d.d.ts.map +1 -1
  180. package/dist/types/core/components/functional/3d/constants.d.ts +1 -1
  181. package/dist/types/core/components/functional/3d/constants.d.ts.map +1 -1
  182. package/dist/types/core/components/functional/3d/ensure.d.ts +3 -0
  183. package/dist/types/core/components/functional/3d/ensure.d.ts.map +1 -1
  184. package/dist/types/core/components/functional/3d/form-params.d.ts.map +1 -1
  185. package/dist/types/core/components/functional/3d/life.d.ts +2 -0
  186. package/dist/types/core/components/functional/3d/life.d.ts.map +1 -1
  187. package/dist/types/core/components/functional/3d/out-publish.d.ts +1 -0
  188. package/dist/types/core/components/functional/3d/out-publish.d.ts.map +1 -1
  189. package/dist/types/core/components/functional/3d/playback.d.ts +9 -0
  190. package/dist/types/core/components/functional/3d/playback.d.ts.map +1 -1
  191. package/dist/types/core/components/functional/3d/post-bind.d.ts +52 -0
  192. package/dist/types/core/components/functional/3d/post-bind.d.ts.map +1 -0
  193. package/dist/types/core/components/functional/3d/post-channels.d.ts +40 -0
  194. package/dist/types/core/components/functional/3d/post-channels.d.ts.map +1 -0
  195. package/dist/types/core/components/functional/3d/post-fx.d.ts +73 -0
  196. package/dist/types/core/components/functional/3d/post-fx.d.ts.map +1 -0
  197. package/dist/types/core/components/functional/3d/props.d.ts +42 -0
  198. package/dist/types/core/components/functional/3d/props.d.ts.map +1 -1
  199. package/dist/types/core/components/functional/3d/reload.d.ts.map +1 -1
  200. package/dist/types/core/components/functional/3d/runtime.d.ts +16 -1
  201. package/dist/types/core/components/functional/3d/runtime.d.ts.map +1 -1
  202. package/dist/types/core/components/functional/3d/scene-runtime.d.ts +1 -1
  203. package/dist/types/core/components/functional/3d/scene-runtime.d.ts.map +1 -1
  204. package/dist/types/core/components/functional/3d/tune.d.ts +5 -0
  205. package/dist/types/core/components/functional/3d/tune.d.ts.map +1 -1
  206. package/dist/types/core/components/functional/3d/types.d.ts +9 -0
  207. package/dist/types/core/components/functional/3d/types.d.ts.map +1 -1
  208. package/dist/types/core/components/functional/3d/updated.d.ts.map +1 -1
  209. package/dist/types/core/components/functional/if/if.d.ts +14 -5
  210. package/dist/types/core/components/functional/if/if.d.ts.map +1 -1
  211. package/dist/types/core/components/functional/interactive/action.d.ts +22 -0
  212. package/dist/types/core/components/functional/interactive/action.d.ts.map +1 -0
  213. package/dist/types/core/components/functional/interactive/gamepad.d.ts +37 -0
  214. package/dist/types/core/components/functional/interactive/gamepad.d.ts.map +1 -0
  215. package/dist/types/core/components/functional/interactive/gesture.d.ts +26 -0
  216. package/dist/types/core/components/functional/interactive/gesture.d.ts.map +1 -0
  217. package/dist/types/core/components/functional/interactive/helpers.d.ts +23 -0
  218. package/dist/types/core/components/functional/interactive/helpers.d.ts.map +1 -0
  219. package/dist/types/core/components/functional/interactive/index.d.ts +20 -0
  220. package/dist/types/core/components/functional/interactive/index.d.ts.map +1 -0
  221. package/dist/types/core/components/functional/interactive/keyboard.d.ts +37 -0
  222. package/dist/types/core/components/functional/interactive/keyboard.d.ts.map +1 -0
  223. package/dist/types/core/components/functional/interactive/matrix.d.ts +31 -0
  224. package/dist/types/core/components/functional/interactive/matrix.d.ts.map +1 -0
  225. package/dist/types/core/components/functional/interactive/registry.d.ts +23 -0
  226. package/dist/types/core/components/functional/interactive/registry.d.ts.map +1 -0
  227. package/dist/types/core/components/functional/interactive/store.d.ts +46 -0
  228. package/dist/types/core/components/functional/interactive/store.d.ts.map +1 -0
  229. package/dist/types/core/components/functional/interactive/ticker.d.ts +33 -0
  230. package/dist/types/core/components/functional/interactive/ticker.d.ts.map +1 -0
  231. package/dist/types/core/components/functional/shader/gl-runtime.d.ts +33 -1
  232. package/dist/types/core/components/functional/shader/gl-runtime.d.ts.map +1 -1
  233. package/dist/types/core/components/functional/shader/shader.d.ts +28 -7
  234. package/dist/types/core/components/functional/shader/shader.d.ts.map +1 -1
  235. package/dist/types/core/components/functional/shader/shadertoy-prelude.d.ts +16 -2
  236. package/dist/types/core/components/functional/shader/shadertoy-prelude.d.ts.map +1 -1
  237. package/dist/types/core/components/functional/shader/types.d.ts +29 -5
  238. package/dist/types/core/components/functional/shader/types.d.ts.map +1 -1
  239. package/dist/types/core/components/functional/value/value.d.ts +6 -0
  240. package/dist/types/core/components/functional/value/value.d.ts.map +1 -1
  241. package/dist/types/core/components/functional/webgpu/gl-fallback.d.ts +4 -0
  242. package/dist/types/core/components/functional/webgpu/gl-fallback.d.ts.map +1 -1
  243. package/dist/types/core/components/functional/webgpu/gpu-runtime.d.ts +14 -0
  244. package/dist/types/core/components/functional/webgpu/gpu-runtime.d.ts.map +1 -1
  245. package/dist/types/core/components/functional/webgpu/helpers.d.ts +1 -0
  246. package/dist/types/core/components/functional/webgpu/helpers.d.ts.map +1 -1
  247. package/dist/types/core/components/functional/webgpu/webgpu.d.ts +7 -1
  248. package/dist/types/core/components/functional/webgpu/webgpu.d.ts.map +1 -1
  249. package/dist/types/core/components/ui/_css/rounded.d.ts +3 -0
  250. package/dist/types/core/components/ui/_css/rounded.d.ts.map +1 -0
  251. package/dist/types/core/components/ui/_css/type.d.ts +13 -0
  252. package/dist/types/core/components/ui/_css/type.d.ts.map +1 -1
  253. package/dist/types/core/components/ui/_i18n/ui-aria-labels.d.ts +83 -0
  254. package/dist/types/core/components/ui/_i18n/ui-aria-labels.d.ts.map +1 -0
  255. package/dist/types/core/components/ui/alert/alert.d.ts +14 -12
  256. package/dist/types/core/components/ui/alert/alert.d.ts.map +1 -1
  257. package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts.map +1 -1
  258. package/dist/types/core/components/ui/badge/badge.d.ts +1 -1
  259. package/dist/types/core/components/ui/badge/badge.d.ts.map +1 -1
  260. package/dist/types/core/components/ui/button/button.d.ts +13 -29
  261. package/dist/types/core/components/ui/button/button.d.ts.map +1 -1
  262. package/dist/types/core/components/ui/card/card-header.d.ts.map +1 -1
  263. package/dist/types/core/components/ui/divider/divider.d.ts +2 -1
  264. package/dist/types/core/components/ui/divider/divider.d.ts.map +1 -1
  265. package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts +25 -73
  266. package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts.map +1 -1
  267. package/dist/types/core/components/ui/form/input/input.d.ts +14 -29
  268. package/dist/types/core/components/ui/form/input/input.d.ts.map +1 -1
  269. package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +63 -65
  270. package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts.map +1 -1
  271. package/dist/types/core/components/ui/form/radio/radio.d.ts +1 -1
  272. package/dist/types/core/components/ui/form/select/select.d.ts +3 -5
  273. package/dist/types/core/components/ui/form/select/select.d.ts.map +1 -1
  274. package/dist/types/core/components/ui/form/textarea/textarea.d.ts +12 -28
  275. package/dist/types/core/components/ui/form/textarea/textarea.d.ts.map +1 -1
  276. package/dist/types/core/components/ui/image/image.d.ts +2 -1
  277. package/dist/types/core/components/ui/image/image.d.ts.map +1 -1
  278. package/dist/types/core/components/ui/link/link.d.ts +10 -9
  279. package/dist/types/core/components/ui/link/link.d.ts.map +1 -1
  280. package/dist/types/core/components/ui/modal/modal-close.d.ts +2 -2
  281. package/dist/types/core/components/ui/modal/modal-close.d.ts.map +1 -1
  282. package/dist/types/core/components/ui/pop/pop.d.ts +12 -4
  283. package/dist/types/core/components/ui/pop/pop.d.ts.map +1 -1
  284. package/dist/types/core/components/ui/table/table.d.ts +2 -1
  285. package/dist/types/core/components/ui/table/table.d.ts.map +1 -1
  286. package/dist/types/core/components/ui/toast/dismissed.d.ts +3 -0
  287. package/dist/types/core/components/ui/toast/dismissed.d.ts.map +1 -0
  288. package/dist/types/core/components/ui/toast/render-content.d.ts +7 -0
  289. package/dist/types/core/components/ui/toast/render-content.d.ts.map +1 -0
  290. package/dist/types/core/components/ui/toast/toast-item.d.ts +26 -9
  291. package/dist/types/core/components/ui/toast/toast-item.d.ts.map +1 -1
  292. package/dist/types/core/components/ui/toast/toast.d.ts +6 -3
  293. package/dist/types/core/components/ui/toast/toast.d.ts.map +1 -1
  294. package/dist/types/core/components/ui/toast/types.d.ts +12 -2
  295. package/dist/types/core/components/ui/toast/types.d.ts.map +1 -1
  296. package/dist/types/core/components/ui/tooltip/tooltip.d.ts +19 -11
  297. package/dist/types/core/components/ui/tooltip/tooltip.d.ts.map +1 -1
  298. package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts +3 -4
  299. package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts.map +1 -1
  300. package/dist/types/core/decorators/subscriber/derive.d.ts.map +1 -1
  301. package/dist/types/core/mixins/FormCheckable.d.ts +10 -27
  302. package/dist/types/core/mixins/FormCheckable.d.ts.map +1 -1
  303. package/dist/types/core/mixins/FormElement.d.ts +21 -10
  304. package/dist/types/core/mixins/FormElement.d.ts.map +1 -1
  305. package/dist/types/core/mixins/FormInput.d.ts +11 -27
  306. package/dist/types/core/mixins/FormInput.d.ts.map +1 -1
  307. package/dist/types/core/utils/AncestorAttributeObserver.d.ts +17 -9
  308. package/dist/types/core/utils/AncestorAttributeObserver.d.ts.map +1 -1
  309. package/dist/types/core/utils/LocationHandler.d.ts +3 -2
  310. package/dist/types/core/utils/LocationHandler.d.ts.map +1 -1
  311. package/dist/types/core/utils/dismissed.d.ts +3 -0
  312. package/dist/types/core/utils/dismissed.d.ts.map +1 -0
  313. package/dist/types/core/utils/mediaRef.d.ts +15 -0
  314. package/dist/types/core/utils/mediaRef.d.ts.map +1 -1
  315. package/dist/types/core/utils/positioning.d.ts +44 -0
  316. package/dist/types/core/utils/positioning.d.ts.map +1 -0
  317. package/dist/types/directives.d.ts +1 -3
  318. package/dist/types/directives.d.ts.map +1 -1
  319. package/dist/types/mixins.d.ts +22 -55
  320. package/dist/types/mixins.d.ts.map +1 -1
  321. package/docs/assets/{index-FmK4JaIM.js → index-D8MVWqY6.js} +946 -687
  322. package/docs/assets/index-DiD0qYvE.css +1 -0
  323. package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +17 -85
  324. package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +1 -1
  325. package/docs/crawl/hubs/form-components.html +13 -11
  326. package/docs/docs-mock-api-sw.js +5 -1
  327. package/docs/docs-mock-api-sw.js.map +2 -2
  328. package/docs/index.html +2 -2
  329. package/docs/llms-full.txt +12 -38
  330. package/docs/llms.txt +1 -1
  331. package/docs/src/core/components/functional/sdui/sdui.md +0 -0
  332. package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -0
  333. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +14 -118
  334. package/docs/src/docs/_getting-started/create-a-component.md +0 -0
  335. package/docs/src/docs/_misc/formelement-subscriber-removal.md +1 -1
  336. package/docs/src/docs/search/docs-search.json +195 -200
  337. package/docs/src/tsconfig.json +324 -0
  338. package/gitlab/job_tests.sh +25 -12
  339. package/index.html +3 -3
  340. package/package.json +217 -9
  341. package/public/docs-mock-api-sw.js +5 -1
  342. package/public/docs-mock-api-sw.js.map +2 -2
  343. package/scripts/build-addons.mjs +2 -2
  344. package/scripts/post-build.mjs +9 -0
  345. package/src/addons/interactive.ts +5 -0
  346. package/src/core/components/functional/3d/3d.md +34 -1
  347. package/src/core/components/functional/3d/3d.spec.ts +42 -0
  348. package/src/core/components/functional/3d/3d.ts +101 -3
  349. package/src/core/components/functional/3d/constants.ts +1 -0
  350. package/src/core/components/functional/3d/ensure.ts +11 -3
  351. package/src/core/components/functional/3d/form-params.ts +2 -0
  352. package/src/core/components/functional/3d/life.ts +4 -1
  353. package/src/core/components/functional/3d/out-publish.ts +4 -3
  354. package/src/core/components/functional/3d/playback.ts +13 -1
  355. package/src/core/components/functional/3d/post-bind.ts +262 -0
  356. package/src/core/components/functional/3d/post-channels.spec.ts +36 -0
  357. package/src/core/components/functional/3d/post-channels.ts +69 -0
  358. package/src/core/components/functional/3d/post-fx.ts +594 -0
  359. package/src/core/components/functional/3d/props.ts +45 -0
  360. package/src/core/components/functional/3d/reload.ts +2 -0
  361. package/src/core/components/functional/3d/runtime.ts +93 -4
  362. package/src/core/components/functional/3d/scene-runtime.ts +3 -0
  363. package/src/core/components/functional/3d/tune.ts +21 -0
  364. package/src/core/components/functional/3d/types.ts +9 -0
  365. package/src/core/components/functional/3d/updated.ts +17 -1
  366. package/src/core/components/functional/if/if.ts +54 -7
  367. package/src/core/components/functional/interactive/action.ts +84 -0
  368. package/src/core/components/functional/interactive/gamepad.ts +197 -0
  369. package/src/core/components/functional/interactive/gesture.ts +136 -0
  370. package/src/core/components/functional/interactive/helpers.spec.ts +50 -0
  371. package/src/core/components/functional/interactive/helpers.ts +97 -0
  372. package/src/core/components/functional/interactive/index.ts +25 -0
  373. package/src/core/components/functional/interactive/interactive.md +33 -0
  374. package/src/core/components/functional/interactive/keyboard.ts +171 -0
  375. package/src/core/components/functional/interactive/matrix.ts +185 -0
  376. package/src/core/components/functional/interactive/registry.ts +46 -0
  377. package/src/core/components/functional/interactive/store.ts +264 -0
  378. package/src/core/components/functional/interactive/ticker.ts +171 -0
  379. package/src/core/components/functional/list/list.ts +0 -0
  380. package/src/core/components/functional/shader/gl-runtime.ts +169 -12
  381. package/src/core/components/functional/shader/shader.md +27 -4
  382. package/src/core/components/functional/shader/shader.spec.ts +267 -0
  383. package/src/core/components/functional/shader/shader.ts +177 -55
  384. package/src/core/components/functional/shader/shadertoy-prelude.ts +49 -5
  385. package/src/core/components/functional/shader/types.ts +89 -12
  386. package/src/core/components/functional/subscriber/subscriber.ts +0 -0
  387. package/src/core/components/functional/value/value.ts +44 -4
  388. package/src/core/components/functional/webgpu/gl-fallback.ts +28 -4
  389. package/src/core/components/functional/webgpu/gpu-runtime.ts +154 -18
  390. package/src/core/components/functional/webgpu/helpers.ts +8 -2
  391. package/src/core/components/functional/webgpu/webgpu.md +13 -2
  392. package/src/core/components/functional/webgpu/webgpu.spec.ts +37 -0
  393. package/src/core/components/functional/webgpu/webgpu.ts +39 -1
  394. package/src/core/components/ui/_css/rounded.ts +36 -0
  395. package/src/core/components/ui/_css/type.ts +49 -0
  396. package/src/core/components/ui/_i18n/ui-aria-labels.ts +104 -0
  397. package/src/core/components/ui/alert/alert.md +128 -72
  398. package/src/core/components/ui/alert/alert.spec.ts +145 -0
  399. package/src/core/components/ui/alert/alert.ts +86 -91
  400. package/src/core/components/ui/alert-messages/alert-messages.ts +1 -1
  401. package/src/core/components/ui/badge/badge.md +126 -78
  402. package/src/core/components/ui/badge/badge.ts +29 -81
  403. package/src/core/components/ui/button/button.md +1 -0
  404. package/src/core/components/ui/button/button.ts +12 -10
  405. package/src/core/components/ui/card/card-header.ts +7 -2
  406. package/src/core/components/ui/card/card.md +120 -65
  407. package/src/core/components/ui/divider/divider.ts +4 -9
  408. package/src/core/components/ui/form/checkbox/checkbox.md +1 -1
  409. package/src/core/components/ui/form/checkbox/checkbox.ts +4 -20
  410. package/src/core/components/ui/form/fieldset/legend-description.ts +1 -1
  411. package/src/core/components/ui/form/fieldset/legend.ts +1 -1
  412. package/src/core/components/ui/form/input/input.md +1 -1
  413. package/src/core/components/ui/form/input/input.ts +25 -27
  414. package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +14 -118
  415. package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +419 -187
  416. package/src/core/components/ui/form/radio/radio.ts +1 -1
  417. package/src/core/components/ui/form/select/select.ts +3 -6
  418. package/src/core/components/ui/form/textarea/textarea.md +1 -1
  419. package/src/core/components/ui/form/textarea/textarea.ts +1 -2
  420. package/src/core/components/ui/image/image.md +147 -53
  421. package/src/core/components/ui/image/image.ts +10 -44
  422. package/src/core/components/ui/link/link.md +2 -2
  423. package/src/core/components/ui/link/link.ts +42 -37
  424. package/src/core/components/ui/modal/modal-close.ts +8 -12
  425. package/src/core/components/ui/modal/modal.ts +18 -18
  426. package/src/core/components/ui/pop/pop.md +105 -1
  427. package/src/core/components/ui/pop/pop.ts +145 -141
  428. package/src/core/components/ui/table/table.ts +2 -8
  429. package/src/core/components/ui/theme/theme.ts +1 -1
  430. package/src/core/components/ui/toast/dismissed.ts +14 -0
  431. package/src/core/components/ui/toast/render-content.ts +13 -0
  432. package/src/core/components/ui/toast/toast-item.ts +179 -103
  433. package/src/core/components/ui/toast/toast.ts +58 -21
  434. package/src/core/components/ui/toast/types.ts +14 -2
  435. package/src/core/components/ui/tooltip/tooltip.ts +176 -154
  436. package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
  437. package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
  438. package/src/core/decorators/subscriber/derive.ts +3 -3
  439. package/src/core/mixins/Fetcher.ts +1 -1
  440. package/src/core/mixins/FormCheckable.ts +1 -8
  441. package/src/core/mixins/FormElement.ts +74 -76
  442. package/src/core/mixins/Subscriber.ts +0 -0
  443. package/src/core/utils/AncestorAttributeObserver.ts +183 -70
  444. package/src/core/utils/DataBindObserver.ts +0 -0
  445. package/src/core/utils/LocationHandler.ts +12 -5
  446. package/src/core/utils/Objects.ts +0 -0
  447. package/src/core/utils/dismissed.ts +22 -0
  448. package/src/core/utils/mediaRef.spec.ts +25 -0
  449. package/src/core/utils/mediaRef.ts +45 -0
  450. package/src/core/utils/positioning.spec.ts +208 -0
  451. package/src/core/utils/positioning.ts +183 -0
  452. package/src/directives.ts +1 -3
  453. package/src/docs/_core-concept/dataFlow.md +1 -1
  454. package/src/docs/_decorators/ancestor-attribute.md +3 -2
  455. package/src/docs/_getting-started/concorde-outside.md +3 -3
  456. package/src/docs/_misc/formelement-subscriber-removal.md +115 -0
  457. package/src/docs/_misc/html-integration.md +2 -0
  458. package/src/docs/_misc/visual-stack.md +19 -1
  459. package/src/docs/code.ts +3 -1
  460. package/src/docs/components/docs-demo-sources.ts +88 -0
  461. package/src/docs/docs.ts +3 -0
  462. package/src/docs/example/docs-3d-post-depth-demo.ts +68 -0
  463. package/src/docs/example/docs-3d-webgpu-live-demo.ts +83 -0
  464. package/src/docs/example/docs-harris-webgpu-demo.ts +53 -55
  465. package/src/docs/example/docs-input-autocomplete-demos.ts +110 -0
  466. package/src/docs/mock-api/router.ts +17 -1
  467. package/src/docs/navigation/navigation.ts +4 -0
  468. package/src/docs/search/docs-search.json +922 -1762
  469. package/src/docs/tailwind/css/tailwind.css +13 -6
  470. package/src/tsconfig.json +162 -6
  471. package/src/tsconfig.tsbuildinfo +1 -1
  472. package/tailwind.config.js +50 -3
  473. package/vite/config.js +23 -35
  474. package/vite.config.mts +5 -0
  475. package/vitest.setup.ts +49 -13
  476. package/docs/assets/index-BZiZXMU-.css +0 -1
@@ -0,0 +1,36 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ clampPostScale,
4
+ parsePostChannelSource,
5
+ } from "./post-channels";
6
+
7
+ describe("parsePostChannelSource", () => {
8
+ it("défaut ch0 = scene", () => {
9
+ expect(parsePostChannelSource("", "", 0)).toEqual({ kind: "scene" });
10
+ expect(parsePostChannelSource("", "", 1)).toEqual({ kind: "none" });
11
+ });
12
+
13
+ it("depth / buffers / url / #id", () => {
14
+ expect(parsePostChannelSource("depth", "", 0)).toEqual({ kind: "depth" });
15
+ expect(parsePostChannelSource("buffer-a", "", 0)).toEqual({
16
+ kind: "buffer",
17
+ buffer: "bufferA",
18
+ });
19
+ expect(parsePostChannelSource("/tex.png", "", 0)).toEqual({
20
+ kind: "url",
21
+ url: "/tex.png",
22
+ });
23
+ expect(parsePostChannelSource("#ref", "", 0)).toEqual({
24
+ kind: "element",
25
+ key: "#ref",
26
+ });
27
+ });
28
+ });
29
+
30
+ describe("clampPostScale", () => {
31
+ it("borne 0.25–1", () => {
32
+ expect(clampPostScale(2)).toBe(1);
33
+ expect(clampPostScale(0.1)).toBe(0.25);
34
+ expect(clampPostScale(0.5)).toBe(0.5);
35
+ });
36
+ });
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Routage des canaux post-* (sonic-3d) : scene | depth | buffers | url | #id.
3
+ */
4
+
5
+ export type PostPassId =
6
+ | "image"
7
+ | "bufferA"
8
+ | "bufferB"
9
+ | "bufferC"
10
+ | "bufferD";
11
+
12
+ export type PostChannelSource =
13
+ | { kind: "scene" }
14
+ | { kind: "depth" }
15
+ | { kind: "buffer"; buffer: Exclude<PostPassId, "image"> }
16
+ | { kind: "self" }
17
+ | { kind: "none" }
18
+ | { kind: "url"; url: string }
19
+ | { kind: "element"; key: string };
20
+
21
+ export type PostChannels = [
22
+ PostChannelSource,
23
+ PostChannelSource,
24
+ PostChannelSource,
25
+ PostChannelSource,
26
+ ];
27
+
28
+ export type PostSources = {
29
+ common: string;
30
+ image: string;
31
+ bufferA: string;
32
+ bufferB: string;
33
+ bufferC: string;
34
+ bufferD: string;
35
+ };
36
+
37
+ /** Parse un slot canal post (défaut `scene` pour ch0 si vide). */
38
+ export function parsePostChannelSource(
39
+ value: string | undefined | null,
40
+ fallback: string,
41
+ slot: 0 | 1 | 2 | 3,
42
+ ): PostChannelSource {
43
+ const v = (value ?? "").trim() || (fallback ?? "").trim();
44
+ if (!v) return slot === 0 ? { kind: "scene" } : { kind: "none" };
45
+ if (v.startsWith("#")) return { kind: "element", key: v };
46
+ const lower = v.toLowerCase();
47
+ if (lower === "scene") return { kind: "scene" };
48
+ if (lower === "depth") return { kind: "depth" };
49
+ if (lower === "self") return { kind: "self" };
50
+ if (lower === "none" || lower === "null") return { kind: "none" };
51
+ if (lower === "buffer-a" || lower === "buffera" || lower === "a") {
52
+ return { kind: "buffer", buffer: "bufferA" };
53
+ }
54
+ if (lower === "buffer-b" || lower === "bufferb" || lower === "b") {
55
+ return { kind: "buffer", buffer: "bufferB" };
56
+ }
57
+ if (lower === "buffer-c" || lower === "bufferc" || lower === "c") {
58
+ return { kind: "buffer", buffer: "bufferC" };
59
+ }
60
+ if (lower === "buffer-d" || lower === "bufferd" || lower === "d") {
61
+ return { kind: "buffer", buffer: "bufferD" };
62
+ }
63
+ return { kind: "url", url: v };
64
+ }
65
+
66
+ export function clampPostScale(v: number): number {
67
+ if (!Number.isFinite(v)) return 1;
68
+ return Math.min(1, Math.max(0.25, v));
69
+ }
@@ -0,0 +1,594 @@
1
+ /**
2
+ * Post-traitement ShaderToy dans le contexte Three de sonic-3d
3
+ * (RenderTarget scène + DepthTexture → passes A–D → image).
4
+ */
5
+ import * as THREE from "three";
6
+ import {
7
+ isFrameSource,
8
+ } from "@supersoniks/concorde/core/utils/mediaRef";
9
+ import {
10
+ buildThreeFragmentSource,
11
+ THREE_FULLSCREEN_VERTEX,
12
+ } from "../shader/shadertoy-prelude";
13
+ import {
14
+ clampPostScale,
15
+ type PostChannelSource,
16
+ type PostChannels,
17
+ type PostPassId,
18
+ type PostSources,
19
+ } from "./post-channels";
20
+
21
+ export type PostFxUniforms = {
22
+ time: number;
23
+ timeDelta: number;
24
+ frame: number;
25
+ mouse: [number, number, number, number];
26
+ params: [number, number, number, number];
27
+ near: number;
28
+ far: number;
29
+ };
30
+
31
+ export type PostFxConfig = {
32
+ sources: PostSources;
33
+ channels: Map<PostPassId, PostChannels>;
34
+ scale: number;
35
+ };
36
+
37
+ export class PostFxCompileError extends Error {
38
+ pass: string;
39
+ infoLog: string;
40
+ constructor(message: string, pass: string, infoLog = "") {
41
+ super(message);
42
+ this.name = "PostFxCompileError";
43
+ this.pass = pass;
44
+ this.infoLog = infoLog;
45
+ }
46
+ }
47
+
48
+ type PingPong = {
49
+ targets: [THREE.WebGLRenderTarget, THREE.WebGLRenderTarget];
50
+ index: number;
51
+ };
52
+
53
+ type PassMat = {
54
+ material: THREE.RawShaderMaterial;
55
+ uniforms: {
56
+ iResolution: { value: THREE.Vector3 };
57
+ iTime: { value: number };
58
+ iTimeDelta: { value: number };
59
+ iFrameRate: { value: number };
60
+ iFrame: { value: number };
61
+ iChannelTime: { value: Float32Array };
62
+ iChannelResolution: { value: Float32Array };
63
+ iMouse: { value: THREE.Vector4 };
64
+ iDate: { value: THREE.Vector4 };
65
+ iSampleRate: { value: number };
66
+ iChannel0: { value: THREE.Texture | null };
67
+ iChannel1: { value: THREE.Texture | null };
68
+ iChannel2: { value: THREE.Texture | null };
69
+ iChannel3: { value: THREE.Texture | null };
70
+ uParam0: { value: number };
71
+ uParam1: { value: number };
72
+ uParam2: { value: number };
73
+ uParam3: { value: number };
74
+ uNear: { value: number };
75
+ uFar: { value: number };
76
+ };
77
+ };
78
+
79
+ const PASS_ORDER: PostPassId[] = [
80
+ "bufferA",
81
+ "bufferB",
82
+ "bufferC",
83
+ "bufferD",
84
+ "image",
85
+ ];
86
+
87
+ const BLACK = (() => {
88
+ const d = new Uint8Array([0, 0, 0, 255]);
89
+ const t = new THREE.DataTexture(d, 1, 1);
90
+ t.needsUpdate = true;
91
+ t.colorSpace = THREE.NoColorSpace;
92
+ return t;
93
+ })();
94
+
95
+ function makeRT(
96
+ w: number,
97
+ h: number,
98
+ withDepth: boolean,
99
+ ): THREE.WebGLRenderTarget {
100
+ if (withDepth) {
101
+ const depth = new THREE.DepthTexture(w, h);
102
+ depth.format = THREE.DepthFormat;
103
+ depth.type = THREE.UnsignedIntType;
104
+ // LinearFilter sur DepthTexture → sampling invalide / noir sur plusieurs GPU.
105
+ depth.minFilter = THREE.NearestFilter;
106
+ depth.magFilter = THREE.NearestFilter;
107
+ const rt = new THREE.WebGLRenderTarget(w, h, {
108
+ minFilter: THREE.LinearFilter,
109
+ magFilter: THREE.LinearFilter,
110
+ format: THREE.RGBAFormat,
111
+ type: THREE.UnsignedByteType,
112
+ depthTexture: depth,
113
+ });
114
+ rt.texture.colorSpace = THREE.NoColorSpace;
115
+ rt.texture.generateMipmaps = false;
116
+ return rt;
117
+ }
118
+ const rt = new THREE.WebGLRenderTarget(w, h, {
119
+ minFilter: THREE.LinearFilter,
120
+ magFilter: THREE.LinearFilter,
121
+ format: THREE.RGBAFormat,
122
+ type: THREE.UnsignedByteType,
123
+ depthBuffer: false,
124
+ stencilBuffer: false,
125
+ });
126
+ rt.texture.colorSpace = THREE.NoColorSpace;
127
+ rt.texture.generateMipmaps = false;
128
+ return rt;
129
+ }
130
+
131
+ function makePingPong(w: number, h: number): PingPong {
132
+ return {
133
+ targets: [makeRT(w, h, false), makeRT(w, h, false)],
134
+ index: 0,
135
+ };
136
+ }
137
+
138
+ function disposeRT(rt: THREE.WebGLRenderTarget) {
139
+ rt.depthTexture?.dispose();
140
+ rt.dispose();
141
+ }
142
+
143
+ /**
144
+ * Pipeline post FX attaché à un WebGLRenderer Three.
145
+ */
146
+ export class PostFxPipeline {
147
+ private renderer: THREE.WebGLRenderer;
148
+ private sceneRT: THREE.WebGLRenderTarget | null = null;
149
+ private buffers = new Map<Exclude<PostPassId, "image">, PingPong>();
150
+ private passes = new Map<PostPassId, PassMat>();
151
+ private channels = new Map<PostPassId, PostChannels>();
152
+ private activePasses: PostPassId[] = [];
153
+ private quadScene = new THREE.Scene();
154
+ private quadCam = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);
155
+ private quadMesh: THREE.Mesh;
156
+ private width = 0;
157
+ private height = 0;
158
+ private scale = 1;
159
+ private urlTextures = new Map<string, THREE.Texture>();
160
+ private loader = new THREE.TextureLoader();
161
+ private elementResolver: ((key: string) => Element | null) | null = null;
162
+ private elementTextures = new Map<string, THREE.CanvasTexture>();
163
+ private elementLastSeq = new Map<string, number>();
164
+ private enabled = false;
165
+
166
+ constructor(renderer: THREE.WebGLRenderer) {
167
+ this.renderer = renderer;
168
+ const geo = new THREE.PlaneGeometry(2, 2);
169
+ this.quadMesh = new THREE.Mesh(geo, new THREE.MeshBasicMaterial());
170
+ this.quadScene.add(this.quadMesh);
171
+ // PlaneGeometry face +Z ; ortho à z=0 regarde -Z → face arrière culée → noir.
172
+ this.quadCam.position.set(0, 0, 1);
173
+ this.quadCam.lookAt(0, 0, 0);
174
+ }
175
+
176
+ get isEnabled() {
177
+ return this.enabled;
178
+ }
179
+
180
+ setElementResolver(fn: ((key: string) => Element | null) | null) {
181
+ this.elementResolver = fn;
182
+ }
183
+
184
+ /**
185
+ * Compile / (re)configure. `image` vide → désactive (rendu direct).
186
+ * Lève `PostFxCompileError` si une passe échoue.
187
+ */
188
+ setConfig(config: PostFxConfig | null) {
189
+ this.clearPasses();
190
+ if (!config?.sources.image.trim()) {
191
+ this.enabled = false;
192
+ this.disposeTargets();
193
+ return;
194
+ }
195
+ this.scale = clampPostScale(config.scale);
196
+ this.channels = config.channels;
197
+ const sources = config.sources;
198
+ for (const pass of PASS_ORDER) {
199
+ const code =
200
+ pass === "image"
201
+ ? sources.image
202
+ : pass === "bufferA"
203
+ ? sources.bufferA
204
+ : pass === "bufferB"
205
+ ? sources.bufferB
206
+ : pass === "bufferC"
207
+ ? sources.bufferC
208
+ : sources.bufferD;
209
+ if (!code.trim()) continue;
210
+ try {
211
+ this.passes.set(pass, this.compilePass(sources.common, code, pass));
212
+ this.activePasses.push(pass);
213
+ } catch (err) {
214
+ this.clearPasses();
215
+ this.enabled = false;
216
+ this.disposeTargets();
217
+ if (err instanceof PostFxCompileError) throw err;
218
+ throw new PostFxCompileError(
219
+ err instanceof Error ? err.message : String(err),
220
+ pass,
221
+ );
222
+ }
223
+ }
224
+ this.enabled = this.activePasses.includes("image");
225
+ if (!this.enabled) {
226
+ this.clearPasses();
227
+ this.disposeTargets();
228
+ } else if (this.width > 0 && this.height > 0) {
229
+ this.ensureTargets(this.width, this.height);
230
+ }
231
+ }
232
+
233
+ resize(pixelW: number, pixelH: number) {
234
+ const w = Math.max(1, Math.round(pixelW * this.scale));
235
+ const h = Math.max(1, Math.round(pixelH * this.scale));
236
+ if (w === this.width && h === this.height && this.sceneRT) return;
237
+ if (this.enabled) this.ensureTargets(w, h);
238
+ else {
239
+ this.width = w;
240
+ this.height = h;
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Rend la scène 3D dans le RT, puis les passes post vers le canvas.
246
+ */
247
+ render(
248
+ scene: THREE.Scene,
249
+ camera: THREE.Camera,
250
+ frame: PostFxUniforms,
251
+ ) {
252
+ if (this.enabled && !this.sceneRT) {
253
+ const size = new THREE.Vector2();
254
+ this.renderer.getDrawingBufferSize(size);
255
+ if (size.x >= 1 && size.y >= 1) this.ensureTargets(size.x, size.y);
256
+ }
257
+ if (!this.enabled || !this.sceneRT || this.width < 1 || this.height < 1) {
258
+ this.renderer.setRenderTarget(null);
259
+ this.renderer.render(scene, camera);
260
+ return;
261
+ }
262
+ this.renderer.setRenderTarget(this.sceneRT);
263
+ this.renderer.clear();
264
+ this.renderer.render(scene, camera);
265
+
266
+ this.updateElementTextures();
267
+
268
+ for (const pass of this.activePasses) {
269
+ if (pass === "image") continue;
270
+ this.drawPass(pass, frame, false);
271
+ }
272
+ this.drawPass("image", frame, true);
273
+ }
274
+
275
+ dispose() {
276
+ this.clearPasses();
277
+ this.disposeTargets();
278
+ for (const t of this.urlTextures.values()) t.dispose();
279
+ this.urlTextures.clear();
280
+ for (const t of this.elementTextures.values()) t.dispose();
281
+ this.elementTextures.clear();
282
+ this.quadMesh.geometry.dispose();
283
+ (this.quadMesh.material as THREE.Material).dispose();
284
+ }
285
+
286
+ private compilePass(
287
+ common: string,
288
+ userCode: string,
289
+ pass: PostPassId,
290
+ ): PassMat {
291
+ const fragmentShader = buildThreeFragmentSource(common, userCode);
292
+ const uniforms: PassMat["uniforms"] = {
293
+ iResolution: { value: new THREE.Vector3(1, 1, 1) },
294
+ iTime: { value: 0 },
295
+ iTimeDelta: { value: 0 },
296
+ iFrameRate: { value: 60 },
297
+ iFrame: { value: 0 },
298
+ iChannelTime: { value: new Float32Array(4) },
299
+ iChannelResolution: { value: new Float32Array(12) },
300
+ iMouse: { value: new THREE.Vector4() },
301
+ iDate: { value: new THREE.Vector4() },
302
+ iSampleRate: { value: 44100 },
303
+ iChannel0: { value: BLACK },
304
+ iChannel1: { value: BLACK },
305
+ iChannel2: { value: BLACK },
306
+ iChannel3: { value: BLACK },
307
+ uParam0: { value: 0 },
308
+ uParam1: { value: 0 },
309
+ uParam2: { value: 0 },
310
+ uParam3: { value: 0 },
311
+ uNear: { value: 0 },
312
+ uFar: { value: 0 },
313
+ };
314
+ const material = new THREE.RawShaderMaterial({
315
+ glslVersion: THREE.GLSL3,
316
+ vertexShader: THREE_FULLSCREEN_VERTEX,
317
+ fragmentShader,
318
+ uniforms,
319
+ depthTest: false,
320
+ depthWrite: false,
321
+ toneMapped: false,
322
+ side: THREE.DoubleSide,
323
+ });
324
+ const log = this.validateGlsl(fragmentShader, pass);
325
+ if (log) {
326
+ material.dispose();
327
+ throw new PostFxCompileError(`Compile error (${pass}): ${log}`, pass, log);
328
+ }
329
+ return { material, uniforms };
330
+ }
331
+
332
+ private validateGlsl(fragmentBody: string, pass: PostPassId): string | null {
333
+ void pass;
334
+ const gl = this.renderer.getContext();
335
+ if (!gl) return null;
336
+ const vs = gl.createShader(gl.VERTEX_SHADER);
337
+ const fs = gl.createShader(gl.FRAGMENT_SHADER);
338
+ if (!vs || !fs) return "Unable to create shader";
339
+ gl.shaderSource(vs, `#version 300 es\n${THREE_FULLSCREEN_VERTEX}`);
340
+ gl.shaderSource(fs, `#version 300 es\n${fragmentBody}`);
341
+ gl.compileShader(vs);
342
+ gl.compileShader(fs);
343
+ let log = "";
344
+ if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) {
345
+ log += gl.getShaderInfoLog(vs) || "vertex compile failed";
346
+ }
347
+ if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) {
348
+ log += gl.getShaderInfoLog(fs) || "fragment compile failed";
349
+ }
350
+ gl.deleteShader(vs);
351
+ gl.deleteShader(fs);
352
+ const trimmed = log.trim();
353
+ return trimmed || null;
354
+ }
355
+
356
+ private ensureTargets(w: number, h: number) {
357
+ const ww = Math.max(1, Math.round(w));
358
+ const hh = Math.max(1, Math.round(h));
359
+ this.disposeTargets();
360
+ this.sceneRT = makeRT(ww, hh, true);
361
+ for (const pass of this.activePasses) {
362
+ if (pass === "image") continue;
363
+ this.buffers.set(pass, makePingPong(ww, hh));
364
+ }
365
+ // disposeTargets remettait width/height à 0 → iResolution nul → écran noir.
366
+ this.width = ww;
367
+ this.height = hh;
368
+ }
369
+
370
+ private disposeTargets() {
371
+ if (this.sceneRT) {
372
+ disposeRT(this.sceneRT);
373
+ this.sceneRT = null;
374
+ }
375
+ for (const pp of this.buffers.values()) {
376
+ disposeRT(pp.targets[0]);
377
+ disposeRT(pp.targets[1]);
378
+ }
379
+ this.buffers.clear();
380
+ }
381
+
382
+ private clearPasses() {
383
+ for (const p of this.passes.values()) p.material.dispose();
384
+ this.passes.clear();
385
+ this.activePasses = [];
386
+ }
387
+
388
+ private drawPass(
389
+ pass: PostPassId,
390
+ frame: PostFxUniforms,
391
+ toScreen: boolean,
392
+ ) {
393
+ const pm = this.passes.get(pass);
394
+ if (!pm) return;
395
+ const channels =
396
+ this.channels.get(pass) ||
397
+ ([
398
+ { kind: "scene" },
399
+ { kind: "none" },
400
+ { kind: "none" },
401
+ { kind: "none" },
402
+ ] as PostChannels);
403
+
404
+ const res = pm.uniforms.iChannelResolution.value;
405
+ for (let i = 0; i < 4; i++) {
406
+ const tex = this.resolveChannel(pass, channels[i]);
407
+ const u = pm.uniforms[
408
+ `iChannel${i}` as "iChannel0" | "iChannel1" | "iChannel2" | "iChannel3"
409
+ ];
410
+ u.value = tex;
411
+ const img = tex.image as { width?: number; height?: number } | undefined;
412
+ const tw =
413
+ (tex as THREE.Texture & { source?: { data?: { width?: number } } })
414
+ .image?.width ||
415
+ img?.width ||
416
+ this.width ||
417
+ 1;
418
+ const th =
419
+ (tex as THREE.Texture & { source?: { data?: { height?: number } } })
420
+ .image?.height ||
421
+ img?.height ||
422
+ this.height ||
423
+ 1;
424
+ // RenderTargets expose width/height on the target, not texture.image
425
+ let rw = tw;
426
+ let rh = th;
427
+ if (tex === this.sceneRT?.texture) {
428
+ rw = this.width;
429
+ rh = this.height;
430
+ } else if (tex === this.sceneRT?.depthTexture) {
431
+ rw = this.width;
432
+ rh = this.height;
433
+ } else {
434
+ for (const [id, pp] of this.buffers) {
435
+ void id;
436
+ if (tex === pp.targets[0].texture || tex === pp.targets[1].texture) {
437
+ rw = this.width;
438
+ rh = this.height;
439
+ break;
440
+ }
441
+ }
442
+ }
443
+ res[i * 3] = rw;
444
+ res[i * 3 + 1] = rh;
445
+ res[i * 3 + 2] = 1;
446
+ }
447
+
448
+ pm.uniforms.iResolution.value.set(this.width, this.height, 1);
449
+ pm.uniforms.iTime.value = frame.time;
450
+ pm.uniforms.iTimeDelta.value = frame.timeDelta;
451
+ pm.uniforms.iFrameRate.value =
452
+ frame.timeDelta > 0 ? 1 / frame.timeDelta : 60;
453
+ pm.uniforms.iFrame.value = frame.frame;
454
+ pm.uniforms.iMouse.value.set(
455
+ frame.mouse[0],
456
+ frame.mouse[1],
457
+ frame.mouse[2],
458
+ frame.mouse[3],
459
+ );
460
+ const d = new Date();
461
+ pm.uniforms.iDate.value.set(
462
+ d.getFullYear(),
463
+ d.getMonth(),
464
+ d.getDate(),
465
+ d.getHours() * 3600 +
466
+ d.getMinutes() * 60 +
467
+ d.getSeconds() +
468
+ d.getMilliseconds() * 0.001,
469
+ );
470
+ pm.uniforms.uParam0.value = frame.params[0];
471
+ pm.uniforms.uParam1.value = frame.params[1];
472
+ pm.uniforms.uParam2.value = frame.params[2];
473
+ pm.uniforms.uParam3.value = frame.params[3];
474
+ pm.uniforms.uNear.value = frame.near;
475
+ pm.uniforms.uFar.value = frame.far;
476
+
477
+ this.quadMesh.material = pm.material;
478
+
479
+ if (toScreen) {
480
+ this.renderer.setRenderTarget(null);
481
+ } else {
482
+ const pp = this.buffers.get(pass as Exclude<PostPassId, "image">);
483
+ if (!pp) return;
484
+ const write = 1 - pp.index;
485
+ this.renderer.setRenderTarget(pp.targets[write]);
486
+ this.renderer.clear();
487
+ }
488
+ this.renderer.render(this.quadScene, this.quadCam);
489
+ if (!toScreen) {
490
+ const pp = this.buffers.get(pass as Exclude<PostPassId, "image">);
491
+ if (pp) pp.index = 1 - pp.index;
492
+ }
493
+ }
494
+
495
+ private resolveChannel(
496
+ pass: PostPassId,
497
+ source: PostChannelSource,
498
+ ): THREE.Texture {
499
+ if (source.kind === "none") return BLACK;
500
+ if (source.kind === "scene") {
501
+ return this.sceneRT?.texture ?? BLACK;
502
+ }
503
+ if (source.kind === "depth") {
504
+ return this.sceneRT?.depthTexture ?? BLACK;
505
+ }
506
+ if (source.kind === "url") {
507
+ return this.getUrlTexture(source.url);
508
+ }
509
+ if (source.kind === "element") {
510
+ return this.getElementTexture(source.key) ?? BLACK;
511
+ }
512
+ const bufferId =
513
+ source.kind === "self"
514
+ ? pass === "image"
515
+ ? null
516
+ : pass
517
+ : source.buffer;
518
+ if (!bufferId) return BLACK;
519
+ const pp = this.buffers.get(bufferId);
520
+ if (!pp) return BLACK;
521
+ return pp.targets[pp.index].texture;
522
+ }
523
+
524
+ private getUrlTexture(url: string): THREE.Texture {
525
+ let t = this.urlTextures.get(url);
526
+ if (t) return t;
527
+ t = this.loader.load(url);
528
+ t.colorSpace = THREE.NoColorSpace;
529
+ t.flipY = true;
530
+ this.urlTextures.set(url, t);
531
+ return t;
532
+ }
533
+
534
+ private getElementTexture(key: string): THREE.Texture | null {
535
+ const el = this.elementResolver?.(key) ?? null;
536
+ if (!el) return null;
537
+ let canvas: HTMLCanvasElement | null = null;
538
+ let seq = -1;
539
+ if (isFrameSource(el)) {
540
+ canvas = el.getFrameCanvas();
541
+ seq = el.frameSeq;
542
+ } else if (el instanceof HTMLCanvasElement) {
543
+ canvas = el;
544
+ seq = (this.elementLastSeq.get(key) ?? 0) + 1;
545
+ } else if (el instanceof HTMLVideoElement) {
546
+ if (el.readyState < 2) return this.elementTextures.get(key) ?? null;
547
+ // CanvasTexture from video via temporary — use VideoTexture
548
+ let vt = this.elementTextures.get(key) as THREE.VideoTexture | undefined;
549
+ if (!vt) {
550
+ vt = new THREE.VideoTexture(el);
551
+ vt.colorSpace = THREE.NoColorSpace;
552
+ this.elementTextures.set(key, vt as unknown as THREE.CanvasTexture);
553
+ }
554
+ vt.needsUpdate = true;
555
+ return vt;
556
+ } else if (el instanceof HTMLImageElement) {
557
+ let it = this.urlTextures.get(key);
558
+ if (!it && el.complete && el.naturalWidth > 0) {
559
+ it = new THREE.Texture(el);
560
+ it.needsUpdate = true;
561
+ it.colorSpace = THREE.NoColorSpace;
562
+ it.flipY = true;
563
+ this.urlTextures.set(key, it);
564
+ }
565
+ return it ?? null;
566
+ }
567
+ if (!canvas || canvas.width < 1) return this.elementTextures.get(key) ?? null;
568
+ let ct = this.elementTextures.get(key);
569
+ if (!ct) {
570
+ ct = new THREE.CanvasTexture(canvas);
571
+ ct.colorSpace = THREE.NoColorSpace;
572
+ ct.flipY = false;
573
+ this.elementTextures.set(key, ct);
574
+ } else if (ct.image !== canvas) {
575
+ ct.image = canvas;
576
+ }
577
+ const last = this.elementLastSeq.get(key);
578
+ if (last !== seq) {
579
+ ct.needsUpdate = true;
580
+ this.elementLastSeq.set(key, seq);
581
+ }
582
+ return ct;
583
+ }
584
+
585
+ private updateElementTextures() {
586
+ for (const [key, tex] of this.elementTextures) {
587
+ if (tex instanceof THREE.VideoTexture) {
588
+ tex.needsUpdate = true;
589
+ continue;
590
+ }
591
+ void this.getElementTexture(key);
592
+ }
593
+ }
594
+ }