@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
@@ -1,7 +1,7 @@
1
1
  import { css, html, LitElement } from "lit";
2
2
  import { customElement, property, state } from "lit/decorators.js";
3
3
  import HTML from "@supersoniks/concorde/core/utils/HTML";
4
- import { revokeMediaUrls, toMediaUrl, mediaElementKey, lookupLiveElement } from "@supersoniks/concorde/core/utils/mediaRef";
4
+ import { revokeMediaUrls, toMediaUrl, mediaElementKey, lookupLiveElement, FrameConsumerRegistry } from "@supersoniks/concorde/core/utils/mediaRef";
5
5
  import { PublisherManager } from "@supersoniks/concorde/utils";
6
6
  import {
7
7
  parseChannelSource,
@@ -9,6 +9,8 @@ import {
9
9
  } from "./gl-runtime";
10
10
  import {
11
11
  PassChannels,
12
+ ReleaseOffscreen,
13
+ ShaderBufferFormat,
12
14
  ShaderCompileError,
13
15
  ShaderExtractItem,
14
16
  ShaderExtractOutput,
@@ -18,17 +20,61 @@ import {
18
20
  ShaderRoi,
19
21
  ShaderSources,
20
22
  SonicShaderOutput,
23
+ channelsUseSelf,
21
24
  findPeaks,
22
25
  meanRgba,
26
+ parseBufferFormat,
23
27
  parseExtractPass,
24
28
  parseHoverParam,
29
+ parseReleaseOffscreen,
25
30
  roiToPixels,
31
+ rgbaToUint8,
32
+ shouldReleaseWhenOffscreen,
26
33
  } from "./types";
27
34
 
28
35
  const tagName = "sonic-shader";
29
36
 
30
37
  const MAX_PATCH_PX = 128;
31
38
 
39
+ /** Clés qui forcent une recompilation / recreate FBO. */
40
+ const PROGRAM_KEYS = [
41
+ "image",
42
+ "bufferA",
43
+ "bufferB",
44
+ "bufferC",
45
+ "bufferD",
46
+ "common",
47
+ "bufferFormat",
48
+ ] as const;
49
+
50
+ /** Clés qui ne font que re-lier les textures (pas de rebuild). */
51
+ const CHANNEL_KEYS = [
52
+ "channel0",
53
+ "channel1",
54
+ "channel2",
55
+ "channel3",
56
+ "imageCh0",
57
+ "imageCh1",
58
+ "imageCh2",
59
+ "imageCh3",
60
+ "bufferACh0",
61
+ "bufferACh1",
62
+ "bufferACh2",
63
+ "bufferACh3",
64
+ "bufferBCh0",
65
+ "bufferBCh1",
66
+ "bufferBCh2",
67
+ "bufferBCh3",
68
+ "bufferCCh0",
69
+ "bufferCCh1",
70
+ "bufferCCh2",
71
+ "bufferCCh3",
72
+ "bufferDCh0",
73
+ "bufferDCh1",
74
+ "bufferDCh2",
75
+ "bufferDCh3",
76
+ ] as const;
77
+
32
78
  /**
33
79
  * Champs méta publiés vers le out-dataProvider.
34
80
  * `param0…3` sont exclus du gate « consommateur » : un `sonic-input name="param0"`
@@ -294,12 +340,32 @@ export class SonicShader extends LitElement {
294
340
  /** Vitesse d’easing hover on/off (1/s, défaut 10). */
295
341
  @property({ type: Number, attribute: "hover-speed" }) hoverSpeed = 10;
296
342
  /**
297
- * Libère le contexte WebGL hors viewport (défaut true).
298
- * Les navigateurs limitent ~8–16 contextes.
343
+ * Hors viewport : libère textures/FBO (garde le contexte).
344
+ * `auto` (défaut) : ne libère pas si une passe lit `self`.
345
+ * `true` / `false` forcent le comportement.
299
346
  */
300
- @property({ type: Boolean, attribute: "release-offscreen" })
301
- releaseOffscreen = true;
347
+ @property({
348
+ attribute: "release-offscreen",
349
+ converter: {
350
+ fromAttribute: (value: string | null) => parseReleaseOffscreen(value),
351
+ toAttribute: (value: ReleaseOffscreen) => {
352
+ if (value === "auto") return "auto";
353
+ if (value === false) return "false";
354
+ return "";
355
+ },
356
+ },
357
+ })
358
+ releaseOffscreen: ReleaseOffscreen = "auto";
302
359
  @property({ type: Number, attribute: "dpr-max" }) dprMax = 2;
360
+ /**
361
+ * Format des buffers A–D : `rgba8` (défaut) | `rgba16f` | `rgba32f`.
362
+ * Attribut reflété `active-buffer-format` = format réellement utilisé.
363
+ */
364
+ @property({ attribute: "buffer-format" })
365
+ bufferFormat: ShaderBufferFormat | string = "rgba8";
366
+ /** Format actif après repli éventuel (lecture seule, reflect). */
367
+ @property({ attribute: "active-buffer-format", reflect: true })
368
+ activeBufferFormat: ShaderBufferFormat = "rgba8";
303
369
 
304
370
  /** Generic float uniforms `uParam0`…`uParam3` (no shader rebuild). */
305
371
  @property({ type: Number, attribute: "param0" }) param0 = 0;
@@ -399,6 +465,9 @@ export class SonicShader extends LitElement {
399
465
  private resizeObserver: ResizeObserver | null = null;
400
466
  private intersectionObserver: IntersectionObserver | null = null;
401
467
  private rebuildToken = 0;
468
+ /** Annule un `rebindChannels` en vol si rebuild / release intervient. */
469
+ private rebindToken = 0;
470
+ private frameConsumers = new FrameConsumerRegistry();
402
471
  private ready = false;
403
472
  private formPublisher: ReturnType<typeof PublisherManager.get> | null = null;
404
473
  private outPublisher: ReturnType<typeof PublisherManager.get> | null = null;
@@ -479,9 +548,11 @@ export class SonicShader extends LitElement {
479
548
  }
480
549
  this.pendingRevokeUrls = [];
481
550
  this.stopLoop();
551
+ this.frameConsumers.clear();
482
552
  this.resizeObserver?.disconnect();
483
553
  this.intersectionObserver?.disconnect();
484
554
  this.rebuildToken++;
555
+ this.rebindToken++;
485
556
  this.ready = false;
486
557
  this.releasing = true;
487
558
  this.runtime?.dispose(true); // libère le slot navigateur
@@ -505,7 +576,7 @@ export class SonicShader extends LitElement {
505
576
  this.bindOutPublisher();
506
577
  this.bindExtractPublisher();
507
578
  requestAnimationFrame(() => {
508
- if (this.inView || !this.releaseOffscreen) {
579
+ if (this.inView || !this.wantsReleaseOffscreen()) {
509
580
  void this.ensureRuntime();
510
581
  }
511
582
  });
@@ -513,44 +584,19 @@ export class SonicShader extends LitElement {
513
584
 
514
585
  protected updated(changed: Map<string, unknown>) {
515
586
  if (!this.runtime) return;
516
- const shaderKeys = [
517
- "image",
518
- "bufferA",
519
- "bufferB",
520
- "bufferC",
521
- "bufferD",
522
- "common",
523
- "channel0",
524
- "channel1",
525
- "channel2",
526
- "channel3",
527
- "imageCh0",
528
- "imageCh1",
529
- "imageCh2",
530
- "imageCh3",
531
- "bufferACh0",
532
- "bufferACh1",
533
- "bufferACh2",
534
- "bufferACh3",
535
- "bufferBCh0",
536
- "bufferBCh1",
537
- "bufferBCh2",
538
- "bufferBCh3",
539
- "bufferCCh0",
540
- "bufferCCh1",
541
- "bufferCCh2",
542
- "bufferCCh3",
543
- "bufferDCh0",
544
- "bufferDCh1",
545
- "bufferDCh2",
546
- "bufferDCh3",
547
- ];
548
- if (shaderKeys.some((k) => changed.has(k))) {
587
+ const programChanged = PROGRAM_KEYS.some((k) => changed.has(k));
588
+ const channelChanged = CHANNEL_KEYS.some((k) => changed.has(k));
589
+ if (programChanged) {
549
590
  void this.rebuild();
591
+ } else if (channelChanged) {
592
+ void this.rebindChannels();
550
593
  }
551
594
  if (changed.has("play")) {
552
595
  this.syncPlayback();
553
596
  }
597
+ if (changed.has("releaseOffscreen") || channelChanged) {
598
+ this.syncVisibility();
599
+ }
554
600
  if (
555
601
  changed.has("dataProvider") ||
556
602
  changed.has("outDataProvider") ||
@@ -696,6 +742,7 @@ export class SonicShader extends LitElement {
696
742
  */
697
743
  private releaseRuntime() {
698
744
  this.rebuildToken++;
745
+ this.rebindToken++;
699
746
  this.stopLoop();
700
747
  this.ready = false;
701
748
  this.releasing = true;
@@ -752,6 +799,7 @@ export class SonicShader extends LitElement {
752
799
  e.preventDefault();
753
800
  if (this.releasing) return;
754
801
  this.rebuildToken++;
802
+ this.rebindToken++;
755
803
  this.stopLoop();
756
804
  this.ready = false;
757
805
  this.runtime = null;
@@ -766,7 +814,8 @@ export class SonicShader extends LitElement {
766
814
  if (this.runtime && !this.runtime.isLost) return;
767
815
  this.runtime = null;
768
816
  await this.updateComplete;
769
- if (!this.isConnected || (!this.inView && this.releaseOffscreen)) return;
817
+ if (!this.isConnected || (!this.inView && this.wantsReleaseOffscreen()))
818
+ return;
770
819
 
771
820
  const canvas = this.getCanvas();
772
821
  if (!canvas) return;
@@ -775,6 +824,9 @@ export class SonicShader extends LitElement {
775
824
  this.errorMessage = "";
776
825
  this.runtime = new ShaderToyRuntime(canvas);
777
826
  this.runtime.setElementResolver((key) => this.lookupElement(key));
827
+ this.activeBufferFormat = this.runtime.setBufferFormat(
828
+ parseBufferFormat(this.bufferFormat),
829
+ );
778
830
  this.bindContextEvents();
779
831
  this.syncSize();
780
832
  await this.rebuild();
@@ -784,7 +836,7 @@ export class SonicShader extends LitElement {
784
836
  }
785
837
 
786
838
  private syncVisibility() {
787
- if (!this.inView && this.releaseOffscreen) {
839
+ if (!this.inView && this.wantsReleaseOffscreen()) {
788
840
  this.releaseRuntime();
789
841
  return;
790
842
  }
@@ -871,8 +923,72 @@ export class SonicShader extends LitElement {
871
923
  return [...new Set(keys)];
872
924
  }
873
925
 
926
+ /** Enregistre les producteurs live (`sonic-3d`…) pour play-offscreen auto. */
927
+ private syncFrameConsumers(channels: Map<ShaderPassId, PassChannels>) {
928
+ const els = this.collectElementKeys(channels).map((k) =>
929
+ this.lookupElement(k),
930
+ );
931
+ this.frameConsumers.sync(els);
932
+ }
933
+
934
+ /** Map canaux courante (tous les passes). */
935
+ private collectPassChannels(): Map<ShaderPassId, PassChannels> {
936
+ const channels = new Map<ShaderPassId, PassChannels>();
937
+ for (const pass of [
938
+ "bufferA",
939
+ "bufferB",
940
+ "bufferC",
941
+ "bufferD",
942
+ "image",
943
+ ] as ShaderPassId[]) {
944
+ channels.set(pass, this.buildChannels(pass));
945
+ }
946
+ return channels;
947
+ }
948
+
949
+ /** `true` si hors viewport on doit libérer textures/FBO. */
950
+ private wantsReleaseOffscreen(): boolean {
951
+ return shouldReleaseWhenOffscreen(
952
+ this.releaseOffscreen,
953
+ channelsUseSelf(this.collectPassChannels().values()),
954
+ );
955
+ }
956
+
957
+ /**
958
+ * Re-lie les canaux sans recompiler ni vider les FBO (Vague A Lot 2).
959
+ */
960
+ private async rebindChannels() {
961
+ if (!this.runtime || this.runtime.isLost || !this.image.trim()) return;
962
+ if (!this.ready) {
963
+ void this.rebuild();
964
+ return;
965
+ }
966
+ const token = ++this.rebindToken;
967
+ const channels = this.collectPassChannels();
968
+ try {
969
+ const urls = this.collectUrls(channels);
970
+ await this.runtime.ensureTextures(urls);
971
+ for (const key of this.collectElementKeys(channels)) {
972
+ this.runtime.ensureElementTexture(key);
973
+ }
974
+ if (token !== this.rebindToken || !this.runtime || this.runtime.isLost) {
975
+ return;
976
+ }
977
+ this.syncFrameConsumers(channels);
978
+ const aspectHint =
979
+ this.channel0.startsWith("#") ? "" : this.channel0 || urls[0];
980
+ this.applyAspectRatio(aspectHint);
981
+ this.runtime.setPassChannels(channels);
982
+ this.syncSize();
983
+ } catch (err) {
984
+ if (token !== this.rebindToken) return;
985
+ this.emitError(err);
986
+ }
987
+ }
988
+
874
989
  private async rebuild() {
875
990
  if (!this.runtime || this.runtime.isLost || !this.image.trim()) return;
991
+ this.rebindToken++;
876
992
  const token = ++this.rebuildToken;
877
993
  this.errorMessage = "";
878
994
  const sources: ShaderSources = {
@@ -883,18 +999,12 @@ export class SonicShader extends LitElement {
883
999
  bufferC: this.bufferC,
884
1000
  bufferD: this.bufferD,
885
1001
  };
886
- const channels = new Map<ShaderPassId, PassChannels>();
887
- for (const pass of [
888
- "bufferA",
889
- "bufferB",
890
- "bufferC",
891
- "bufferD",
892
- "image",
893
- ] as ShaderPassId[]) {
894
- channels.set(pass, this.buildChannels(pass));
895
- }
1002
+ const channels = this.collectPassChannels();
896
1003
  try {
897
1004
  this.syncSize();
1005
+ this.activeBufferFormat = this.runtime.setBufferFormat(
1006
+ parseBufferFormat(this.bufferFormat),
1007
+ );
898
1008
  const urls = this.collectUrls(channels);
899
1009
  await this.runtime.ensureTextures(urls);
900
1010
  for (const key of this.collectElementKeys(channels)) {
@@ -903,6 +1013,7 @@ export class SonicShader extends LitElement {
903
1013
  if (token !== this.rebuildToken || !this.runtime || this.runtime.isLost) {
904
1014
  return;
905
1015
  }
1016
+ this.syncFrameConsumers(channels);
906
1017
  const aspectHint =
907
1018
  this.channel0.startsWith("#") ? "" : this.channel0 || urls[0];
908
1019
  this.applyAspectRatio(aspectHint);
@@ -1312,8 +1423,8 @@ export class SonicShader extends LitElement {
1312
1423
  : this.runtime.readBufferRect(pass, px.x, px.y, px.w, px.h);
1313
1424
  if (!rect) continue;
1314
1425
  // Copie : le buffer WebGL peut être réutilisé / invalidé ensuite
1315
- const rgba = new Uint8Array(rect.data);
1316
- const mean = meanRgba(rgba);
1426
+ const rgba = rgbaToUint8(rect.data);
1427
+ const mean = meanRgba(rect.data);
1317
1428
  const item: ShaderExtractItem = {
1318
1429
  id: roi.id || `${source}-${px.x}-${px.y}`,
1319
1430
  x: this.round3(rect.x / bufW),
@@ -1410,7 +1521,11 @@ export class SonicShader extends LitElement {
1410
1521
  if (typeof score === "number") item.score = this.round3(score);
1411
1522
  if (this.extractBitmaps) {
1412
1523
  const token = this.rebuildToken;
1413
- const url = await rgbaToBlobUrl(rect.data, rect.width, rect.height);
1524
+ const url = await rgbaToBlobUrl(
1525
+ rgbaToUint8(rect.data),
1526
+ rect.width,
1527
+ rect.height,
1528
+ );
1414
1529
  if (token !== this.rebuildToken || !this.isConnected) {
1415
1530
  if (url) revokeMediaUrls([url]);
1416
1531
  return null;
@@ -1581,10 +1696,12 @@ export class SonicShader extends LitElement {
1581
1696
  }
1582
1697
  }
1583
1698
 
1584
- export { parseChannelSource, ShaderToyRuntime, shouldUploadElementFrame } from "./gl-runtime";
1699
+ export { parseChannelSource, ShaderToyRuntime, shouldUploadElementFrame, resolveBufferGlFormat, resetBufferFormatWarnFlag } from "./gl-runtime";
1585
1700
  export { buildFragmentSource } from "./shadertoy-prelude";
1586
1701
  export type {
1587
1702
  ChannelSource,
1703
+ ReleaseOffscreen,
1704
+ ShaderBufferFormat,
1588
1705
  ShaderExtractItem,
1589
1706
  ShaderExtractOutput,
1590
1707
  ShaderExtractPass,
@@ -1609,11 +1726,16 @@ export {
1609
1726
  mediaElementKey,
1610
1727
  } from "@supersoniks/concorde/core/utils/mediaRef";
1611
1728
  export {
1729
+ channelsUseSelf,
1612
1730
  findPeaks,
1613
1731
  meanRgba,
1732
+ parseBufferFormat,
1614
1733
  parseExtractPass,
1615
1734
  parseHoverParam,
1735
+ parseReleaseOffscreen,
1616
1736
  roiToPixels,
1737
+ rgbaToUint8,
1738
+ shouldReleaseWhenOffscreen,
1617
1739
  ShaderCompileError,
1618
1740
  } from "./types";
1619
1741
 
@@ -1,6 +1,14 @@
1
- /** ShaderToy-compatible GLSL ES 3.0 prelude (fragment). User code is inserted before main(). */
2
- export const SHADERTOY_FRAGMENT_PRELUDE = `#version 300 es
3
- precision highp float;
1
+ /**
2
+ * ShaderToy-compatible GLSL ES 3.0 prelude (fragment body, sans `#version`).
3
+ * - `sonic-shader` préfixe `#version 300 es` via `buildFragmentSource`.
4
+ * - `sonic-3d` post passe le corps à Three `RawShaderMaterial` (GLSL3).
5
+ */
6
+
7
+ export const GLSL_VERSION_300 = `#version 300 es
8
+ `;
9
+
10
+ /** Corps des uniforms / out (sans version). */
11
+ export const SHADERTOY_FRAGMENT_BODY = `precision highp float;
4
12
  precision highp int;
5
13
  precision mediump sampler2D;
6
14
 
@@ -22,11 +30,26 @@ uniform float uParam0;
22
30
  uniform float uParam1;
23
31
  uniform float uParam2;
24
32
  uniform float uParam3;
33
+ /** Near / far caméra (0 dans sonic-shader standalone). */
34
+ uniform float uNear;
35
+ uniform float uFar;
25
36
 
26
37
  out vec4 sonicFragColor;
27
38
 
39
+ /** Profondeur linéaire monde depuis une DepthTexture (0–1). */
40
+ float sonicLinearDepth(float d) {
41
+ float z = d * 2.0 - 1.0;
42
+ float n = max(uNear, 1e-4);
43
+ float f = max(uFar, n + 1e-4);
44
+ return (2.0 * n * f) / (f + n - z * (f - n));
45
+ }
46
+
28
47
  `;
29
48
 
49
+ /** @deprecated Préférer SHADERTOY_FRAGMENT_BODY + buildFragmentSource. */
50
+ export const SHADERTOY_FRAGMENT_PRELUDE =
51
+ GLSL_VERSION_300 + SHADERTOY_FRAGMENT_BODY;
52
+
30
53
  export const SHADERTOY_FRAGMENT_EPILOGUE = `
31
54
  void main() {
32
55
  mainImage(sonicFragColor, gl_FragCoord.xy);
@@ -41,12 +64,33 @@ void main() {
41
64
  }
42
65
  `;
43
66
 
44
- export function buildFragmentSource(common: string, userCode: string): string {
67
+ /** Vertex Three RawShaderMaterial GLSL3 (fullscreen triangle via PlaneGeometry 2×2). */
68
+ export const THREE_FULLSCREEN_VERTEX = `precision highp float;
69
+ in vec3 position;
70
+ void main() {
71
+ gl_Position = vec4(position.xy, 0.0, 1.0);
72
+ }
73
+ `;
74
+
75
+ export function buildFragmentBody(common: string, userCode: string): string {
45
76
  return (
46
- SHADERTOY_FRAGMENT_PRELUDE +
77
+ SHADERTOY_FRAGMENT_BODY +
47
78
  (common ? common + "\n" : "") +
48
79
  userCode +
49
80
  "\n" +
50
81
  SHADERTOY_FRAGMENT_EPILOGUE
51
82
  );
52
83
  }
84
+
85
+ /** Source fragment WebGL2 native (`sonic-shader`). */
86
+ export function buildFragmentSource(common: string, userCode: string): string {
87
+ return GLSL_VERSION_300 + buildFragmentBody(common, userCode);
88
+ }
89
+
90
+ /** Source fragment pour Three RawShaderMaterial (GLSL3, sans #version). */
91
+ export function buildThreeFragmentSource(
92
+ common: string,
93
+ userCode: string,
94
+ ): string {
95
+ return buildFragmentBody(common, userCode);
96
+ }
@@ -5,6 +5,57 @@ export type ShaderPassId =
5
5
  | "bufferC"
6
6
  | "bufferD";
7
7
 
8
+ /** Format interne des buffers A–D (Image = toujours le canvas RGBA8). */
9
+ export type ShaderBufferFormat = "rgba8" | "rgba16f" | "rgba32f";
10
+
11
+ export function parseBufferFormat(
12
+ value: string | null | undefined,
13
+ ): ShaderBufferFormat {
14
+ const s = (value ?? "").trim().toLowerCase();
15
+ if (s === "rgba16f" || s === "rgba16" || s === "half") return "rgba16f";
16
+ if (s === "rgba32f" || s === "rgba32" || s === "float") return "rgba32f";
17
+ return "rgba8";
18
+ }
19
+
20
+ /**
21
+ * Hors viewport : libérer textures/FBO ?
22
+ * - `true` / `false` — forcé
23
+ * - `auto` (défaut) — libère sauf si une passe lit `self` (état conservé)
24
+ */
25
+ export type ReleaseOffscreen = boolean | "auto";
26
+
27
+ export function parseReleaseOffscreen(
28
+ value: string | null | undefined,
29
+ ): ReleaseOffscreen {
30
+ if (value == null) return "auto";
31
+ const s = value.trim().toLowerCase();
32
+ if (s === "auto") return "auto";
33
+ if (s === "false" || s === "0") return false;
34
+ // attribut booléen présent (`""`) ou `"true"`
35
+ return true;
36
+ }
37
+
38
+ /** Au moins un canal `self` (feedback frame précédente). */
39
+ export function channelsUseSelf(
40
+ channels: Iterable<readonly ChannelSource[]>,
41
+ ): boolean {
42
+ for (const chs of channels) {
43
+ for (const c of chs) {
44
+ if (c.kind === "self") return true;
45
+ }
46
+ }
47
+ return false;
48
+ }
49
+
50
+ export function shouldReleaseWhenOffscreen(
51
+ mode: ReleaseOffscreen,
52
+ usesSelf: boolean,
53
+ ): boolean {
54
+ if (mode === false) return false;
55
+ if (mode === true) return true;
56
+ return !usesSelf;
57
+ }
58
+
8
59
  export type ChannelSource =
9
60
  | { kind: "url"; url: string }
10
61
  | { kind: "buffer"; buffer: Exclude<ShaderPassId, "image"> }
@@ -161,10 +212,18 @@ export type SonicShaderConfig = {
161
212
  dprMax?: number;
162
213
 
163
214
  /**
164
- * Hors viewport : libère textures/FBO (défaut `true`), sans loseContext.
215
+ * Format des buffers A–D : `rgba8` (défaut) \| `rgba16f` \| `rgba32f`.
216
+ * Requis pour des valeurs signées / hors [0,1] (ex. tenseur Harris).
217
+ * Repli auto en `rgba8` si `EXT_color_buffer_float` manque.
218
+ */
219
+ bufferFormat?: ShaderBufferFormat;
220
+
221
+ /**
222
+ * Hors viewport : libère textures/FBO, sans loseContext.
223
+ * `auto` (défaut) : ne libère pas si une passe lit `self`.
165
224
  * Le slot navigateur est libéré au disconnect.
166
225
  */
167
- releaseOffscreen?: boolean;
226
+ releaseOffscreen?: ReleaseOffscreen;
168
227
  };
169
228
 
170
229
  /** Parse `hover-param` → slot ou `null` si désactivé / invalide. */
@@ -274,7 +333,8 @@ export type ReadRectResult = {
274
333
  y: number;
275
334
  width: number;
276
335
  height: number;
277
- data: Uint8Array;
336
+ /** `Uint8Array` (RGBA8) ou `Float32Array` (buffers flottants). */
337
+ data: Uint8Array | Float32Array;
278
338
  };
279
339
 
280
340
  /** Parse `extract-source` / `extract-mask` → pass id ou null. */
@@ -295,9 +355,10 @@ export function parseExtractPass(
295
355
  /**
296
356
  * NMS simple sur canal R (RGBA row-major, origine bas-gauche comme WebGL).
297
357
  * Retourne peaks triés par score décroissant.
358
+ * Accepte Uint8 (0–255) ou Float32 (scores déjà dans ~[0,1]).
298
359
  */
299
360
  export function findPeaks(
300
- data: Uint8Array,
361
+ data: Uint8Array | Float32Array,
301
362
  width: number,
302
363
  height: number,
303
364
  options: FindPeaksOptions = {},
@@ -308,13 +369,15 @@ export function findPeaks(
308
369
  if (maxCount === 0 || width < 1 || height < 1 || data.length < width * height * 4) {
309
370
  return [];
310
371
  }
311
- const thr8 = threshold * 255;
372
+ const isFloat = data instanceof Float32Array;
373
+ const thr = isFloat ? threshold : threshold * 255;
374
+ const toScore = (v: number) => (isFloat ? v : v / 255);
312
375
  const candidates: ShaderPeak[] = [];
313
376
  for (let y = 1; y < height - 1; y++) {
314
377
  for (let x = 1; x < width - 1; x++) {
315
378
  const i = (y * width + x) * 4;
316
379
  const v = data[i];
317
- if (v < thr8) continue;
380
+ if (v < thr) continue;
318
381
  // Local max 3×3
319
382
  let isMax = true;
320
383
  for (let dy = -1; dy <= 1 && isMax; dy++) {
@@ -327,7 +390,7 @@ export function findPeaks(
327
390
  }
328
391
  }
329
392
  }
330
- if (isMax) candidates.push({ x, y, score: v / 255 });
393
+ if (isMax) candidates.push({ x, y, score: toScore(v) });
331
394
  }
332
395
  }
333
396
  candidates.sort((a, b) => b.score - a.score);
@@ -403,7 +466,7 @@ export function roiToPixels(
403
466
  return { x: px, y: py, w: pw, h: ph };
404
467
  }
405
468
 
406
- export function meanRgba(data: Uint8Array): {
469
+ export function meanRgba(data: Uint8Array | Float32Array): {
407
470
  r: number;
408
471
  g: number;
409
472
  b: number;
@@ -412,6 +475,7 @@ export function meanRgba(data: Uint8Array): {
412
475
  } {
413
476
  const n = Math.floor(data.length / 4);
414
477
  if (n < 1) return { r: 0, g: 0, b: 0, a: 0, luma: 0 };
478
+ const isFloat = data instanceof Float32Array;
415
479
  let r = 0;
416
480
  let g = 0;
417
481
  let b = 0;
@@ -423,10 +487,11 @@ export function meanRgba(data: Uint8Array): {
423
487
  b += data[o + 2];
424
488
  a += data[o + 3];
425
489
  }
426
- r /= n * 255;
427
- g /= n * 255;
428
- b /= n * 255;
429
- a /= n * 255;
490
+ const scale = isFloat ? n : n * 255;
491
+ r /= scale;
492
+ g /= scale;
493
+ b /= scale;
494
+ a /= scale;
430
495
  return {
431
496
  r,
432
497
  g,
@@ -436,6 +501,18 @@ export function meanRgba(data: Uint8Array): {
436
501
  };
437
502
  }
438
503
 
504
+ /** Convertit un buffer RGBA (byte ou float 0–1) en Uint8 pour canvas / blob. */
505
+ export function rgbaToUint8(
506
+ data: Uint8Array | Float32Array,
507
+ ): Uint8Array {
508
+ if (data instanceof Uint8Array) return data;
509
+ const out = new Uint8Array(data.length);
510
+ for (let i = 0; i < data.length; i++) {
511
+ out[i] = Math.max(0, Math.min(255, Math.round(data[i] * 255)));
512
+ }
513
+ return out;
514
+ }
515
+
439
516
  export class ShaderCompileError extends Error {
440
517
  constructor(
441
518
  message: string,