@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,18 +1,58 @@
1
1
  import {LitElement, html} from "lit";
2
- import {customElement} from "lit/decorators.js";
2
+ import {customElement, property} from "lit/decorators.js";
3
3
  import {Subscriber} from "@supersoniks/concorde/mixins";
4
4
  import {unsafeHTML} from "lit/directives/unsafe-html.js";
5
- const tagName = "sonic-value"; // For Astro.build
5
+
6
+ const tagName = "sonic-value";
7
+
8
+ /**
9
+ * Affiche une valeur du DataProvider (`key`).
10
+ * `format="00000"` pad numérique, ou `format="intl:fr-FR"` / `format="intl:fr-FR:currency:EUR"`.
11
+ */
6
12
  @customElement(tagName)
7
13
  export class SonicValue extends Subscriber(LitElement) {
14
+ @property({type: String}) format = "";
15
+
8
16
  connectedCallback(): void {
9
17
  this.setAttribute("subDataProvider", this.getAttribute("key"));
10
18
  super.connectedCallback();
11
19
  }
20
+
21
+ private formatted(): string {
22
+ const raw = this.props;
23
+ if (typeof raw === "object" || raw === undefined) return "";
24
+ const s = String(raw);
25
+ if (!this.format) return s;
26
+ if (this.format.startsWith("intl:")) {
27
+ const parts = this.format.slice(5).split(":");
28
+ const locale = parts[0] || "fr-FR";
29
+ const style = parts[1];
30
+ const currency = parts[2] || "EUR";
31
+ const n = Number(raw);
32
+ if (!Number.isFinite(n)) return s;
33
+ if (style === "currency") {
34
+ return new Intl.NumberFormat(locale, {style: "currency", currency}).format(n);
35
+ }
36
+ if (style === "percent") {
37
+ return new Intl.NumberFormat(locale, {style: "percent"}).format(n);
38
+ }
39
+ return new Intl.NumberFormat(locale).format(n);
40
+ }
41
+ // pad pattern like 00000
42
+ if (/^0+$/.test(this.format)) {
43
+ const n = Math.floor(Number(raw));
44
+ if (!Number.isFinite(n)) return s;
45
+ return String(n).padStart(this.format.length, "0");
46
+ }
47
+ return s;
48
+ }
49
+
12
50
  render() {
13
- if (typeof this.props === "object" || this.props === undefined)
51
+ if (typeof this.props === "object" || this.props === undefined) {
14
52
  return html`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`;
15
- return html`${unsafeHTML(this.props.toString())}<slot name="prefix"></slot><slot></slot
53
+ }
54
+ const text = this.format ? this.formatted() : this.props.toString();
55
+ return html`${unsafeHTML(text)}<slot name="prefix"></slot><slot></slot
16
56
  ><slot name="suffix"></slot>`;
17
57
  }
18
58
  }
@@ -45,6 +45,7 @@ export class WebGl2FallbackRuntime {
45
45
  private lastTime = 0;
46
46
  private disposed = false;
47
47
  private channelQueue: Promise<void> = Promise.resolve();
48
+ private elementResolver: ((key: string) => Element | null) | null = null;
48
49
 
49
50
  private constructor(canvas: HTMLCanvasElement, toy: ShaderToyRuntime) {
50
51
  this.canvas = canvas;
@@ -57,6 +58,11 @@ export class WebGl2FallbackRuntime {
57
58
  return new WebGl2FallbackRuntime(canvas, toy);
58
59
  }
59
60
 
61
+ setElementResolver(fn: ((key: string) => Element | null) | null) {
62
+ this.elementResolver = fn;
63
+ this.toy.setElementResolver(fn);
64
+ }
65
+
60
66
  /** WGSL ignoré — effet GLSL fixe (canaux / params OK). */
61
67
  async setShader(_userBody: string): Promise<void> {
62
68
  this.assertAlive();
@@ -77,6 +83,10 @@ export class WebGl2FallbackRuntime {
77
83
  this.assertAlive();
78
84
  const trimmed = url.trim();
79
85
  if (this.channelUrls[index] === trimmed) {
86
+ if (trimmed.startsWith("#")) {
87
+ this.toy.ensureElementTexture(trimmed);
88
+ return;
89
+ }
80
90
  // Même URL : s’assurer que la texture est bien chargée
81
91
  if (trimmed && !this.toy.getTextureSize(trimmed)) {
82
92
  await this.toy.ensureTextures([trimmed]);
@@ -85,8 +95,7 @@ export class WebGl2FallbackRuntime {
85
95
  }
86
96
  this.channelUrls[index] = trimmed;
87
97
  this.applySources();
88
- const urls = this.channelUrls.filter(Boolean);
89
- if (urls.length) await this.toy.ensureTextures(urls);
98
+ await this.ensureChannelAssets();
90
99
  }
91
100
 
92
101
  /** Applique les 4 canaux d’un coup (préféré au boot). */
@@ -100,8 +109,7 @@ export class WebGl2FallbackRuntime {
100
109
  urls[3].trim(),
101
110
  ];
102
111
  this.applySources();
103
- const list = this.channelUrls.filter(Boolean);
104
- if (list.length) await this.toy.ensureTextures(list);
112
+ await this.ensureChannelAssets();
105
113
  });
106
114
  return this.channelQueue;
107
115
  }
@@ -115,9 +123,17 @@ export class WebGl2FallbackRuntime {
115
123
  this.toy.resize(width, height);
116
124
  }
117
125
 
126
+ updateLiveChannels(resolveEl: (key: string) => Element | null) {
127
+ this.assertAlive();
128
+ this.toy.updateElementTextures(resolveEl);
129
+ }
130
+
118
131
  draw(state: WebGpuFrameState) {
119
132
  this.assertAlive();
120
133
  if (this.toy.isLost) return;
134
+ if (this.elementResolver) {
135
+ this.toy.updateElementTextures(this.elementResolver);
136
+ }
121
137
  const timeDelta =
122
138
  this.lastTime > 0 ? Math.max(0, state.time - this.lastTime) : 0;
123
139
  this.lastTime = state.time;
@@ -137,6 +153,14 @@ export class WebGl2FallbackRuntime {
137
153
  this.toy.dispose(loseContext);
138
154
  }
139
155
 
156
+ private async ensureChannelAssets() {
157
+ const urls = this.channelUrls.filter((u) => u && !u.startsWith("#"));
158
+ if (urls.length) await this.toy.ensureTextures(urls);
159
+ for (const key of this.channelUrls) {
160
+ if (key.startsWith("#")) this.toy.ensureElementTexture(key);
161
+ }
162
+ }
163
+
140
164
  private applySources() {
141
165
  const channels = new Map([
142
166
  [
@@ -1,11 +1,53 @@
1
1
  /// <reference types="@webgpu/types" />
2
2
 
3
+ import {
4
+ isFrameSource,
5
+ type SonicFrameSource,
6
+ } from "@supersoniks/concorde/core/utils/mediaRef";
7
+ import { shouldUploadElementFrame } from "../shader/gl-runtime";
3
8
  import { WebGpuCompileError } from "./types";
4
9
  import { buildWgslSource } from "./wgsl-prelude";
5
10
 
6
11
  const UNIFORM_BYTES = 64; // resolution+time+frame+mouse+params + pad
7
12
  const CHANNEL_COUNT = 4;
8
13
 
14
+ /** `true` si la texture existante peut être réécrite (même taille). */
15
+ export function channelTextureNeedsRecreate(
16
+ current: { width: number; height: number } | null | undefined,
17
+ nextW: number,
18
+ nextH: number,
19
+ ): boolean {
20
+ if (!current) return true;
21
+ return current.width !== nextW || current.height !== nextH;
22
+ }
23
+
24
+ function externalSourceSize(
25
+ src: TexImageSource,
26
+ ): { width: number; height: number } {
27
+ if (
28
+ typeof HTMLVideoElement !== "undefined" &&
29
+ src instanceof HTMLVideoElement
30
+ ) {
31
+ return { width: src.videoWidth || 1, height: src.videoHeight || 1 };
32
+ }
33
+ if (
34
+ typeof HTMLImageElement !== "undefined" &&
35
+ src instanceof HTMLImageElement
36
+ ) {
37
+ return {
38
+ width: src.naturalWidth || src.width || 1,
39
+ height: src.naturalHeight || src.height || 1,
40
+ };
41
+ }
42
+ if ("width" in src && "height" in src) {
43
+ return {
44
+ width: Math.max(1, Number(src.width) || 1),
45
+ height: Math.max(1, Number(src.height) || 1),
46
+ };
47
+ }
48
+ return { width: 1, height: 1 };
49
+ }
50
+
9
51
  /** Adapter WebGPU : high-performance → low-power → défaut. */
10
52
  export async function requestBestAdapter(
11
53
  gpu: GPU = navigator.gpu!,
@@ -77,6 +119,13 @@ export class WebGpuRuntime {
77
119
  null,
78
120
  ];
79
121
  private channelUrls: [string, string, string, string] = ["", "", "", ""];
122
+ private channelLastSeq = [0, 0, 0, 0];
123
+ private channelLastSrc: (string | undefined)[] = [
124
+ undefined,
125
+ undefined,
126
+ undefined,
127
+ undefined,
128
+ ];
80
129
  private placeholder: GPUTexture | null = null;
81
130
  private placeholderView: GPUTextureView | null = null;
82
131
  private bindGroup: GPUBindGroup | null = null;
@@ -185,10 +234,16 @@ export class WebGpuRuntime {
185
234
  async setChannel(index: 0 | 1 | 2 | 3, url: string): Promise<void> {
186
235
  this.assertAlive();
187
236
  const trimmed = url.trim();
237
+ if (trimmed.startsWith("#")) {
238
+ this.bindElementChannel(index, trimmed);
239
+ return;
240
+ }
188
241
  if (this.channelUrls[index] === trimmed && this.channelTextures[index]) {
189
242
  return;
190
243
  }
191
244
  this.channelUrls[index] = trimmed;
245
+ this.channelLastSeq[index] = 0;
246
+ this.channelLastSrc[index] = undefined;
192
247
  const token = ++this.channelLoadTokens[index];
193
248
  if (!trimmed) {
194
249
  this.destroyChannel(index);
@@ -197,24 +252,35 @@ export class WebGpuRuntime {
197
252
  }
198
253
  const img = await loadImage(trimmed);
199
254
  if (token !== this.channelLoadTokens[index] || this.disposed) return;
200
- const texture = this.device.createTexture({
201
- size: [img.width, img.height],
202
- format: "rgba8unorm",
203
- usage:
204
- GPUTextureUsage.TEXTURE_BINDING |
205
- GPUTextureUsage.COPY_DST |
206
- GPUTextureUsage.RENDER_ATTACHMENT,
207
- });
208
- this.device.queue.copyExternalImageToTexture(
209
- { source: img },
210
- { texture },
211
- [img.width, img.height],
212
- );
213
- this.destroyChannel(index);
214
- this.channelTextures[index] = texture;
215
- this.channelViews[index] = texture.createView();
216
- this.channelSizes[index] = { width: img.width, height: img.height };
217
- this.bindGroup = null;
255
+ this.uploadExternal(index, img, /* flipY */ false);
256
+ }
257
+
258
+ /**
259
+ * Upload live des canaux `#id` / FrameSource / video / canvas.
260
+ * Recrée la texture seulement si la taille change (pas de createTexture chaque frame).
261
+ */
262
+ updateLiveChannels(resolveEl: (key: string) => Element | null) {
263
+ this.assertAlive();
264
+ for (let i = 0; i < CHANNEL_COUNT; i++) {
265
+ const key = this.channelUrls[i];
266
+ if (!key.startsWith("#")) continue;
267
+ const el = resolveEl(key);
268
+ const decision = shouldUploadElementFrame(
269
+ el,
270
+ this.channelLastSeq[i],
271
+ this.channelLastSrc[i],
272
+ );
273
+ if (!decision.upload || !decision.texSource) continue;
274
+ this.uploadExternal(i, decision.texSource, /* flipY */ true);
275
+ if (isFrameSource(el)) {
276
+ this.channelLastSeq[i] = (el as SonicFrameSource).frameSeq;
277
+ } else {
278
+ this.channelLastSeq[i] = (this.channelLastSeq[i] || 0) + 1;
279
+ }
280
+ if (decision.nextSrc !== undefined) {
281
+ this.channelLastSrc[i] = decision.nextSrc;
282
+ }
283
+ }
218
284
  }
219
285
 
220
286
  getTextureSize(url: string): { width: number; height: number } | null {
@@ -311,6 +377,76 @@ export class WebGpuRuntime {
311
377
  }
312
378
  }
313
379
 
380
+ private bindElementChannel(index: 0 | 1 | 2 | 3, key: string) {
381
+ if (this.channelUrls[index] === key && this.channelTextures[index]) {
382
+ return;
383
+ }
384
+ this.channelUrls[index] = key;
385
+ this.channelLastSeq[index] = 0;
386
+ this.channelLastSrc[index] = undefined;
387
+ this.channelLoadTokens[index]++;
388
+ if (!this.channelTextures[index]) {
389
+ const texture = this.device.createTexture({
390
+ size: [1, 1],
391
+ format: "rgba8unorm",
392
+ usage:
393
+ GPUTextureUsage.TEXTURE_BINDING |
394
+ GPUTextureUsage.COPY_DST |
395
+ GPUTextureUsage.RENDER_ATTACHMENT,
396
+ });
397
+ this.device.queue.writeTexture(
398
+ { texture },
399
+ new Uint8Array([0, 0, 0, 255]),
400
+ { bytesPerRow: 4 },
401
+ [1, 1],
402
+ );
403
+ this.channelTextures[index] = texture;
404
+ this.channelViews[index] = texture.createView();
405
+ this.channelSizes[index] = { width: 1, height: 1 };
406
+ this.bindGroup = null;
407
+ }
408
+ }
409
+
410
+ private uploadExternal(
411
+ index: number,
412
+ source: TexImageSource,
413
+ flipY: boolean,
414
+ ) {
415
+ const { width, height } = externalSourceSize(source);
416
+ const w = Math.max(1, width);
417
+ const h = Math.max(1, height);
418
+ const existing = this.channelTextures[index];
419
+ if (
420
+ existing &&
421
+ !channelTextureNeedsRecreate(this.channelSizes[index], w, h)
422
+ ) {
423
+ this.device.queue.copyExternalImageToTexture(
424
+ { source, flipY },
425
+ { texture: existing },
426
+ [w, h],
427
+ );
428
+ return;
429
+ }
430
+ const texture = this.device.createTexture({
431
+ size: [w, h],
432
+ format: "rgba8unorm",
433
+ usage:
434
+ GPUTextureUsage.TEXTURE_BINDING |
435
+ GPUTextureUsage.COPY_DST |
436
+ GPUTextureUsage.RENDER_ATTACHMENT,
437
+ });
438
+ this.device.queue.copyExternalImageToTexture(
439
+ { source, flipY },
440
+ { texture },
441
+ [w, h],
442
+ );
443
+ this.destroyChannel(index);
444
+ this.channelTextures[index] = texture;
445
+ this.channelViews[index] = texture.createView();
446
+ this.channelSizes[index] = { width: w, height: h };
447
+ this.bindGroup = null;
448
+ }
449
+
314
450
  private writeUniforms(state: WebGpuFrameState) {
315
451
  const data = new ArrayBuffer(UNIFORM_BYTES);
316
452
  const f32 = new Float32Array(data);
@@ -1,4 +1,4 @@
1
- import { toMediaUrl } from "@supersoniks/concorde/core/utils/mediaRef";
1
+ import { toMediaUrl, mediaElementKey } from "@supersoniks/concorde/core/utils/mediaRef";
2
2
 
3
3
  export const LOG_PREFIX = "[sonic-webgpu]";
4
4
 
@@ -37,11 +37,17 @@ export function toNum(v: unknown, fallback: number): number {
37
37
  return fallback;
38
38
  }
39
39
 
40
+ /** string (url / #id) | MediaRef → url | { element }. */
40
41
  export function channelFormValue(value: unknown): string | undefined {
41
42
  if (value === null || value === "") return "";
42
43
  if (typeof value === "string") return value.trim();
43
44
  const url = toMediaUrl(value);
44
45
  if (url) return url;
45
- if (value && typeof value === "object") return undefined;
46
+ if (value && typeof value === "object") {
47
+ const el = (value as { element?: unknown }).element;
48
+ const key = mediaElementKey(el);
49
+ if (key) return key;
50
+ return undefined;
51
+ }
46
52
  return "";
47
53
  }
@@ -41,11 +41,22 @@ Simulation: `param0` = speed, `param1` = mouse attraction. WebGPU compute when a
41
41
  | `active-backend` | reflect |
42
42
  | `param0`…`param3` | floats (particles: speed / attraction) |
43
43
  | `targetX` / `targetY` | attractor 0–1 (DP, top-left origin) |
44
- | `channel0`…`channel3` | textures (image kernel) |
44
+ | `channel0`…`channel3` | textures (image kernel) : URL, `#id` live (`SonicFrameSource`), ou MediaRef `{ element }` |
45
45
  | `dataProvider` | params / channels / `targetX`·`Y` |
46
46
  | `frame-out` | `frameUrl` + `snapshot` |
47
47
  | `play` / `mouse` | loop / pointer |
48
48
 
49
+ ## Live bridge (`#id`)
50
+
51
+ Comme `sonic-shader` : `channel0="#plateau"` copie le canvas source chaque `frameSeq` (`copyExternalImageToTexture`). La texture GPU est **réutilisée** tant que la taille ne change pas (pas de `createTexture` / rebuild bind group chaque frame).
52
+
53
+ ```html
54
+ <sonic-3d id="plateau" play …></sonic-3d>
55
+ <sonic-webgpu channel0="#plateau" kernel="image" play shader="…"></sonic-webgpu>
56
+ ```
57
+
58
+ Demo: [Visual stack — 3D → WebGPU live](#docs/_misc/visual-stack.md/visual-stack).
59
+
49
60
  ## Markup particles
50
61
 
51
62
  <sonic-code language="html">
@@ -61,7 +72,7 @@ Simulation: `param0` = speed, `param1` = mouse attraction. WebGPU compute when a
61
72
 
62
73
  ## Chaining
63
74
 
64
- Same MediaRef / DP bridge as the rest of the stack. No live texture bus with `sonic-shader` (separate contexts).
75
+ Same MediaRef / DP bridge as the rest of the stack. Live textures entre composants : pont `#id` / `{ element }` (copie canvas), pas de contexte WebGPU partagé avec `sonic-shader`.
65
76
 
66
77
  ## CDN
67
78
 
@@ -1,6 +1,8 @@
1
1
  import { expect, describe, it, vi, beforeAll } from "vitest";
2
2
  import TestUtils from "@supersoniks/concorde/test-utils/TestUtils";
3
3
  import { buildWgslSource, DEFAULT_MAIN_IMAGE } from "./wgsl-prelude";
4
+ import { channelTextureNeedsRecreate } from "./gpu-runtime";
5
+ import { channelFormValue } from "./helpers";
4
6
  import "./webgpu";
5
7
  import { SonicWebGpu } from "./webgpu";
6
8
 
@@ -28,6 +30,30 @@ describe("buildWgslSource", () => {
28
30
  });
29
31
  });
30
32
 
33
+ describe("channelTextureNeedsRecreate", () => {
34
+ it("recrée si absent ou taille différente", () => {
35
+ expect(channelTextureNeedsRecreate(null, 64, 64)).toBe(true);
36
+ expect(channelTextureNeedsRecreate({ width: 32, height: 64 }, 64, 64)).toBe(
37
+ true,
38
+ );
39
+ expect(channelTextureNeedsRecreate({ width: 64, height: 64 }, 64, 64)).toBe(
40
+ false,
41
+ );
42
+ });
43
+ });
44
+
45
+ describe("channelFormValue", () => {
46
+ it("accepte url / #id / { element }", () => {
47
+ expect(channelFormValue("https://x/a.png")).toBe("https://x/a.png");
48
+ expect(channelFormValue("#plateau")).toBe("#plateau");
49
+ expect(channelFormValue({ element: "#plateau" })).toBe("#plateau");
50
+ expect(channelFormValue({ element: "scene" })).toBe("#scene");
51
+ expect(channelFormValue({ url: "https://x/a.png" })).toBe(
52
+ "https://x/a.png",
53
+ );
54
+ });
55
+ });
56
+
31
57
  describe("sonic-webgpu", () => {
32
58
  beforeAll(() => {
33
59
  if (typeof globalThis.ResizeObserver === "undefined") {
@@ -67,6 +93,7 @@ describe("sonic-webgpu", () => {
67
93
  param1: 0.22,
68
94
  channel0: { url: "https://example.test/a.png" },
69
95
  channel1: "https://example.test/b.png",
96
+ channel2: { element: "#plateau" },
70
97
  });
71
98
  const el = TestUtils.bootstrap(
72
99
  `<sonic-webgpu dataProvider="${id}"></sonic-webgpu>`,
@@ -78,6 +105,7 @@ describe("sonic-webgpu", () => {
78
105
  expect(el.param1).toBe(0.22);
79
106
  expect(el.channel0).toBe("https://example.test/a.png");
80
107
  expect(el.channel1).toBe("https://example.test/b.png");
108
+ expect(el.channel2).toBe("#plateau");
81
109
 
82
110
  pub.param0.set(0.99);
83
111
  await new Promise((r) => setTimeout(r, 0));
@@ -138,4 +166,13 @@ describe("sonic-webgpu", () => {
138
166
  expect(parseBackendPrefer("webgl2")).toBe("webgl2");
139
167
  expect(parseBackendPrefer("nope")).toBe("auto");
140
168
  });
169
+
170
+ it("expose getFrameCanvas + frameSeq (SonicFrameSource)", () => {
171
+ const el = TestUtils.bootstrap(
172
+ `<sonic-webgpu></sonic-webgpu>`,
173
+ true,
174
+ )[0] as SonicWebGpu;
175
+ expect(typeof el.getFrameCanvas).toBe("function");
176
+ expect(typeof el.frameSeq).toBe("number");
177
+ });
141
178
  });
@@ -3,6 +3,10 @@
3
3
  import { css, html, LitElement } from "lit";
4
4
  import { customElement, property, state } from "lit/decorators.js";
5
5
  import { PublisherManager } from "@supersoniks/concorde/utils";
6
+ import {
7
+ lookupLiveElement,
8
+ FrameConsumerRegistry,
9
+ } from "@supersoniks/concorde/core/utils/mediaRef";
6
10
  import { Canvas2dFallbackRuntime } from "./canvas2d-fallback";
7
11
  import { formBind } from "./form-bind";
8
12
  import { WebGl2FallbackRuntime } from "./gl-fallback";
@@ -150,6 +154,7 @@ export class SonicWebGpu extends LitElement {
150
154
  private resizeObserver: ResizeObserver | null = null;
151
155
  private intersectionObserver: IntersectionObserver | null = null;
152
156
  private rebuildToken = 0;
157
+ private frameConsumers = new FrameConsumerRegistry();
153
158
  ready = false;
154
159
  /** Évite deux boots concurrents (IO + rAF) qui disposent le fallback. */
155
160
  private boot: Promise<void> | null = null;
@@ -204,6 +209,7 @@ export class SonicWebGpu extends LitElement {
204
209
  this.removeEventListener("pointerenter", this.onPointerEnter);
205
210
  this.unbindFormProvider();
206
211
  this.revokeFrameUrl();
212
+ this.frameConsumers.clear();
207
213
  this.frameOutSeq++;
208
214
  this.frameOutBusy = false;
209
215
  this.resizeObserver?.disconnect();
@@ -404,6 +410,10 @@ export class SonicWebGpu extends LitElement {
404
410
  }
405
411
 
406
412
  this.runtime = runtime;
413
+ const maybeGl2 = this.runtime as unknown as {
414
+ setElementResolver?: (fn: (key: string) => Element | null) => void;
415
+ };
416
+ maybeGl2.setElementResolver?.((key) => this.lookupElement(key));
407
417
  const backend = runtime.backend as SonicWebGpuBackend;
408
418
  this.activeBackend = backend;
409
419
  let notice = "";
@@ -475,6 +485,21 @@ export class SonicWebGpu extends LitElement {
475
485
  return canvas;
476
486
  }
477
487
 
488
+ /** Résout `#id` dans getRootNode() puis document ; clés live `__sonic_frame_`. */
489
+ private lookupElement(key: string): Element | null {
490
+ if (!key.startsWith("#")) return null;
491
+ const live = lookupLiveElement(key);
492
+ if (live) return live;
493
+ const id = key.slice(1);
494
+ if (!id || id.startsWith("__sonic_frame_")) return null;
495
+ const root = this.getRootNode();
496
+ if (root instanceof Document || root instanceof ShadowRoot) {
497
+ const el = root.getElementById(id);
498
+ if (el) return el;
499
+ }
500
+ return typeof document !== "undefined" ? document.getElementById(id) : null;
501
+ }
502
+
478
503
  private releaseRuntime() {
479
504
  this.stopLoop();
480
505
  this.ready = false;
@@ -486,6 +511,14 @@ export class SonicWebGpu extends LitElement {
486
511
  this.canvasEl = null;
487
512
  }
488
513
 
514
+ /** Enregistre les producteurs live pour play-offscreen auto. */
515
+ private syncFrameConsumers() {
516
+ const keys = [this.channel0, this.channel1, this.channel2, this.channel3];
517
+ this.frameConsumers.sync(
518
+ keys.filter((k) => k.startsWith("#")).map((k) => this.lookupElement(k)),
519
+ );
520
+ }
521
+
489
522
  private async rebuild() {
490
523
  if (!this.runtime) return;
491
524
  const token = ++this.rebuildToken;
@@ -509,6 +542,7 @@ export class SonicWebGpu extends LitElement {
509
542
  ]);
510
543
  }
511
544
  if (token !== this.rebuildToken) return;
545
+ this.syncFrameConsumers();
512
546
  this.errorMessage = "";
513
547
  this.ready = true;
514
548
  this.syncSize();
@@ -589,6 +623,9 @@ export class SonicWebGpu extends LitElement {
589
623
  if (!this.startTime) this.startTime = now;
590
624
  const time = (now - this.startTime) / 1000;
591
625
  this.applyRemoteMouse();
626
+ if (this.runtime instanceof WebGpuRuntime) {
627
+ this.runtime.updateLiveChannels((key) => this.lookupElement(key));
628
+ }
592
629
  this.runtime.draw({
593
630
  width: w,
594
631
  height: h,
@@ -662,7 +699,8 @@ export type {
662
699
  } from "./types";
663
700
  export { parseBackendPrefer, parseKernel, WebGpuCompileError } from "./types";
664
701
  export { buildWgslSource, DEFAULT_MAIN_IMAGE } from "./wgsl-prelude";
665
- export { WebGpuRuntime } from "./gpu-runtime";
702
+ export { WebGpuRuntime, channelTextureNeedsRecreate } from "./gpu-runtime";
666
703
  export { WebGl2FallbackRuntime } from "./gl-fallback";
667
704
  export { Canvas2dFallbackRuntime } from "./canvas2d-fallback";
668
705
  export { ParticlesRuntime } from "./particles-runtime";
706
+ export { channelFormValue } from "./helpers";
@@ -0,0 +1,36 @@
1
+ import { css } from "lit";
2
+
3
+ export type Rounded = "" | "base" | "none" | "full" | "sm" | "md" | "lg" | "xl";
4
+
5
+ export const hostRounded = css`
6
+ :host {
7
+ --sc-_rounded: 0;
8
+ border-radius: var(--sc-_rounded);
9
+ }
10
+ :host([rounded]),
11
+ :host([rounded="base"]) {
12
+ --sc-_rounded: var(--sc-rounded);
13
+ overflow: hidden;
14
+ }
15
+ :host([rounded="sm"]) {
16
+ --sc-_rounded: var(--sc-rounded-sm);
17
+ }
18
+
19
+ :host([rounded="md"]) {
20
+ --sc-_rounded: var(--sc-rounded-md);
21
+ }
22
+
23
+ :host([rounded="lg"]) {
24
+ --sc-_rounded: var(--sc-rounded-lg);
25
+ }
26
+ :host([rounded="xl"]) {
27
+ --sc-_rounded: var(--sc-rounded-xl);
28
+ }
29
+
30
+ :host([rounded="full"]) {
31
+ --sc-_rounded: 50% !important;
32
+ }
33
+ :host([rounded="none"]) {
34
+ --sc-_rounded: 0 !important;
35
+ }
36
+ `;
@@ -1,5 +1,54 @@
1
1
  import { css } from "lit";
2
2
 
3
+ /** Icônes pour les composants à `status` (API messages, alert, toast). */
4
+ export const statusIcon = {
5
+ default: "info-empty",
6
+ info: "info-empty",
7
+ success: "check-circled-outline",
8
+ warning: "warning-circled-outline",
9
+ error: "warning-circled-outline",
10
+ };
11
+
12
+ export type StatusIconKey = keyof typeof statusIcon;
13
+
14
+ export function toStatus(value?: string): StatusIconKey | undefined {
15
+ if (!value) return undefined;
16
+ if (value === "danger") return "error";
17
+ return value in statusIcon ? (value as StatusIconKey) : undefined;
18
+ }
19
+
20
+ export function statusAriaRole(status?: StatusIconKey): "alert" | "status" {
21
+ return status === "error" ? "alert" : "status";
22
+ }
23
+
24
+ export function statusAriaLive(status?: StatusIconKey): "polite" | null {
25
+ return status === "error" ? null : "polite";
26
+ }
27
+
28
+ export const statusColor = css`
29
+ :host {
30
+ --sc-_color: var(--sc-base-content, #000);
31
+ color: var(--sc-_color);
32
+ }
33
+
34
+ :host([status="warning"]) {
35
+ --sc-_color: var(--sc-warning, var(--sc-base-content, #000));
36
+ }
37
+ :host([status="error"]) {
38
+ --sc-_color: var(--sc-danger, var(--sc-base-content, #000));
39
+ }
40
+ :host([status="info"]) {
41
+ --sc-_color: var(--sc-info, var(--sc-base-content, #000));
42
+ }
43
+ :host([status="success"]) {
44
+ --sc-_color: var(--sc-success, var(--sc-base-content, #000));
45
+ }
46
+
47
+ .inherit-color {
48
+ color: var(--sc-_color);
49
+ }
50
+ `;
51
+
3
52
  export const typeColor = css`
4
53
  :host {
5
54
  --sc-_color: inherit;