@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
@@ -85,7 +85,9 @@ Le viewer lit `asset` ou `src` depuis le DP — la source (fetch, upload, HF) n
85
85
  | `fit` | Fit bbox après load (défaut true) |
86
86
  | `pick` | Survol highlight + clic → event `pick` + `hit*` ; double-clic = fit |
87
87
  | `play` / `play-on-hover` | Boucle RAF |
88
- | `release-offscreen` | Dispose renderer hors viewport (défaut true) |
88
+ | `play-offscreen` | Garde RAF / runtime hors viewport (pont live `#id`) |
89
+ | `release-offscreen` | Dispose renderer hors viewport (défaut true) sauf si `play-offscreen` / consommateur live |
90
+ | `damping` | Inertie OrbitControls (défaut `0.08`, `0` = off) |
89
91
  | `dpr-max` | Cap devicePixelRatio (défaut 2) |
90
92
  | `dataProvider` / `out-data-provider` | Entrée / sortie |
91
93
  | `out-interval` | Throttle publication ms (défaut 80) |
@@ -126,3 +128,34 @@ No shared WebGL context between `sonic-3d` and `sonic-shader`.
126
128
  ```
127
129
 
128
130
  Demo: [Visual stack — 3D → shader live](#docs/_misc/visual-stack.md/visual-stack).
131
+
132
+ Un `sonic-shader` / `sonic-webgpu` qui pointe `#id` s’enregistre via `registerFrameConsumer` : le 3D **continue hors viewport** (pas de dispose). Option explicite : `play-offscreen`.
133
+
134
+ ### Arrêt net
135
+
136
+ `el.stopMotion()` coupe `autoRotate` et l’inertie OrbitControls. Quand la caméra est immobile depuis ~8 frames : event `rest` + champ out `moving: 0|1`. Attribut `damping` (défaut `0.08`, `0` = off).
137
+
138
+ ## Post FX (in-viewer)
139
+
140
+ When `post-image` is set, the scene renders to an offscreen target with a **depth texture**, then ShaderToy-style passes run inside the same Three context (`post-buffer-a`…`post-image`). Same GLSL as `sonic-shader` (`mainImage`, `iChannel0–3`, `uParam0–3`, `sonicLinearDepth`).
141
+
142
+ | Channel token | Source |
143
+ |---------------|--------|
144
+ | `scene` (default ch0) | Color render target |
145
+ | `depth` | Depth texture from the scene pass |
146
+ | `buffer-a`…`d` | Ping-pong buffers |
147
+ | URL / `#id` | External texture (same as shader live bridge) |
148
+
149
+ ```html
150
+ <sonic-3d
151
+ post-image="…GLSL…"
152
+ post-image-ch0="scene"
153
+ post-image-ch1="depth"
154
+ param0="0.5"
155
+ post-scale="1"
156
+ ></sonic-3d>
157
+ ```
158
+
159
+ Demo: [Visual stack — post depth edges](#docs/_misc/visual-stack.md/visual-stack).
160
+
161
+ Pick / orbit still use scene geometry; `frame-out` captures the **final** canvas after post.
@@ -169,3 +169,45 @@ describe("orbit.wheelAffectsZoom", () => {
169
169
  expect(orbit.wheelAffectsZoom(atMaxZoom, 1)).toBe(true);
170
170
  });
171
171
  });
172
+
173
+ describe("wantsOffscreenPlay / frame consumers", () => {
174
+ it("playOffscreen ou consumers → true", async () => {
175
+ const { wantsOffscreenPlay } = await import("./playback");
176
+ expect(wantsOffscreenPlay({ playOffscreen: false, frameConsumerCount: 0 })).toBe(
177
+ false,
178
+ );
179
+ expect(wantsOffscreenPlay({ playOffscreen: true, frameConsumerCount: 0 })).toBe(
180
+ true,
181
+ );
182
+ expect(wantsOffscreenPlay({ playOffscreen: false, frameConsumerCount: 1 })).toBe(
183
+ true,
184
+ );
185
+ });
186
+
187
+ it("registerFrameConsumer incrémente le compteur", async () => {
188
+ const el = TestUtils.bootstrap(
189
+ `<sonic-3d style="width:64px;height:64px"></sonic-3d>`,
190
+ true,
191
+ )[0] as Sonic3d;
192
+ await el.updateComplete;
193
+ expect(el.frameConsumerCount).toBe(0);
194
+ const token = {};
195
+ el.registerFrameConsumer(token);
196
+ expect(el.frameConsumerCount).toBe(1);
197
+ expect(el.playOffscreen).toBe(false);
198
+ el.unregisterFrameConsumer(token);
199
+ expect(el.frameConsumerCount).toBe(0);
200
+ });
201
+
202
+ it("stopMotion coupe autoRotate", async () => {
203
+ const el = TestUtils.bootstrap(
204
+ `<sonic-3d auto-rotate style="width:64px;height:64px"></sonic-3d>`,
205
+ true,
206
+ )[0] as Sonic3d;
207
+ await el.updateComplete;
208
+ expect(el.autoRotate).toBe(true);
209
+ el.stopMotion();
210
+ expect(el.autoRotate).toBe(false);
211
+ expect(el.moving).toBe(0);
212
+ });
213
+ });
@@ -1,9 +1,11 @@
1
1
  import { html } from "lit";
2
2
  import { customElement, state } from "lit/decorators.js";
3
3
  import { PublisherManager } from "@supersoniks/concorde/utils";
4
+ import { ensure } from "./ensure";
4
5
  import { formBind, type FormOrbit } from "./form-bind";
5
6
  import { life } from "./life";
6
7
  import { outPublish } from "./out-publish";
8
+ import { postBind } from "./post-bind";
7
9
  import type { SceneHit } from "./pick";
8
10
  import { playback } from "./playback";
9
11
  import { pointer } from "./pointer";
@@ -13,6 +15,8 @@ import { sonic3dStyles } from "./styles";
13
15
  import { propUpdate } from "./updated";
14
16
  import { wire } from "./wire";
15
17
 
18
+ /** Frames sans mouvement avant `rest` / `moving=0`. */
19
+ const REST_STILL_FRAMES = 8;
16
20
  /**
17
21
  * Viewer 3D Concorde (Three.js) — glTF/GLB, caméra orbit/perspective/ortho,
18
22
  * outputs dataProvider paresseux. Opt-in : `@supersoniks/concorde/3d`.
@@ -21,7 +25,7 @@ import { wire } from "./wire";
21
25
  export class Sonic3d extends Sonic3dProps {
22
26
  static styles = sonic3dStyles;
23
27
 
24
- @state() private errorMessage = "";
28
+ @state() errorMessage = "";
25
29
 
26
30
  /** État runtime partagé avec les helpers (lu ici pour noUnusedLocals). */
27
31
  runtime: SceneRuntime | null = null;
@@ -48,7 +52,20 @@ export class Sonic3d extends Sonic3dProps {
48
52
  snapshotSeq = 0;
49
53
  /** Contrat SonicFrameSource — incrémenté après chaque render. */
50
54
  frameSeq = 0;
55
+ lastDrawAt = 0;
51
56
  lastFormOrbit: FormOrbit | null = null;
57
+ /** Consommateurs live (`registerFrameConsumer`). */
58
+ private frameConsumers = new Set<object>();
59
+ /** 1 si caméra en mouvement, 0 sinon (publié en out). */
60
+ moving = 0;
61
+ private stillFrames = 0;
62
+ private lastMotionYaw = NaN;
63
+ private lastMotionPitch = NaN;
64
+ private lastMotionDist = NaN;
65
+
66
+ get frameConsumerCount() {
67
+ return this.frameConsumers.size;
68
+ }
52
69
 
53
70
  onFormMutation = () => {
54
71
  const data = (this.formPublisher?.get() ?? {}) as Record<string, unknown>;
@@ -137,9 +154,87 @@ export class Sonic3d extends Sonic3dProps {
137
154
  private drawFrame(now: number) {
138
155
  if (!this.runtime || !this.ready) return;
139
156
  this.frame++;
157
+ const time = (now - this.startTime) / 1000;
158
+ const timeDelta = Math.max(0, (now - this.lastDrawAt) / 1000);
159
+ this.lastDrawAt = now;
160
+ postBind.syncFrame(this as never, time, timeDelta, this.frame);
140
161
  this.runtime.render();
141
162
  this.frameSeq++;
142
- outPublish.maybePublish(this as never, now, (now - this.startTime) / 1000);
163
+ this.trackMotion(time);
164
+ outPublish.maybePublish(this as never, now, time);
165
+ }
166
+
167
+ /**
168
+ * Enregistre un consommateur live (`sonic-shader` / `sonic-webgpu` via `#id`).
169
+ * Garde le RAF hors viewport tant qu’il reste au moins un token.
170
+ */
171
+ registerFrameConsumer(token: object = {}) {
172
+ this.frameConsumers.add(token);
173
+ ensure.syncVisibility(this as never);
174
+ }
175
+
176
+ unregisterFrameConsumer(token: object = {}) {
177
+ this.frameConsumers.delete(token);
178
+ ensure.syncVisibility(this as never);
179
+ }
180
+
181
+ /**
182
+ * Coupe `autoRotate` + inertie OrbitControls.
183
+ * Émet `rest` si la caméra était en mouvement.
184
+ */
185
+ stopMotion() {
186
+ this.autoRotate = false;
187
+ this.runtime?.stopMotion();
188
+ this.stillFrames = REST_STILL_FRAMES;
189
+ if (this.moving !== 0) {
190
+ this.moving = 0;
191
+ this.dispatchEvent(
192
+ new CustomEvent("rest", {
193
+ detail: { moving: 0 },
194
+ bubbles: true,
195
+ composed: true,
196
+ }),
197
+ );
198
+ }
199
+ this.syncPlayback();
200
+ }
201
+
202
+ private trackMotion(time: number) {
203
+ if (!this.runtime) return;
204
+ const snap = this.runtime.snapshot({
205
+ time,
206
+ frame: this.frame,
207
+ hovering: this.hovering ? 1 : 0,
208
+ pointerX: this.pointerX,
209
+ pointerY: this.pointerY,
210
+ hit: this.lastHit,
211
+ });
212
+ const eps = 1e-5;
213
+ const still =
214
+ Number.isFinite(this.lastMotionYaw) &&
215
+ Math.abs(snap.yaw - this.lastMotionYaw) < eps &&
216
+ Math.abs(snap.pitch - this.lastMotionPitch) < eps &&
217
+ Math.abs(snap.distance - this.lastMotionDist) < eps &&
218
+ !this.autoRotate;
219
+ this.lastMotionYaw = snap.yaw;
220
+ this.lastMotionPitch = snap.pitch;
221
+ this.lastMotionDist = snap.distance;
222
+ if (still) {
223
+ this.stillFrames++;
224
+ if (this.stillFrames >= REST_STILL_FRAMES && this.moving !== 0) {
225
+ this.moving = 0;
226
+ this.dispatchEvent(
227
+ new CustomEvent("rest", {
228
+ detail: { moving: 0, yaw: snap.yaw, pitch: snap.pitch },
229
+ bubbles: true,
230
+ composed: true,
231
+ }),
232
+ );
233
+ }
234
+ } else {
235
+ this.stillFrames = 0;
236
+ this.moving = 1;
237
+ }
143
238
  }
144
239
 
145
240
  /** Contrat SonicFrameSource — canvas Three (preserveDrawingBuffer). */
@@ -170,12 +265,15 @@ export type {
170
265
  Sonic3dConfig,
171
266
  Sonic3dOutput,
172
267
  } from "./types";
173
- export type { SonicMediaRef, SonicFrameSource } from "@supersoniks/concorde/core/utils/mediaRef";
268
+ export type { SonicMediaRef, SonicFrameSource, SonicFrameConsumerHost } from "@supersoniks/concorde/core/utils/mediaRef";
174
269
  export {
175
270
  toMediaUrl,
176
271
  cloneMediaRef,
177
272
  isFrameSource,
273
+ isFrameConsumerHost,
274
+ FrameConsumerRegistry,
178
275
  } from "@supersoniks/concorde/core/utils/mediaRef";
276
+ export { wantsOffscreenPlay } from "./playback";
179
277
  export { frameCapture } from "./frame-capture";
180
278
  export { frameSource } from "./frame-source";
181
279
 
@@ -95,6 +95,7 @@ export const OUT_CONSUMER_KEYS = [
95
95
  "snapshot",
96
96
  /** Pont live → sonic-shader (`{ element }`), publié une fois au ready. */
97
97
  "frameSource",
98
+ "moving",
98
99
  ] as const;
99
100
 
100
101
  export type Sonic3dFormControlKey = (typeof FORM_CONTROL_KEYS)[number];
@@ -1,6 +1,6 @@
1
1
  import type { Sonic3dCameraMode } from "./constants";
2
2
  import { parse } from "./parse";
3
- import { playback } from "./playback";
3
+ import { playback, wantsOffscreenPlay } from "./playback";
4
4
  import { reload } from "./reload";
5
5
  import { SceneRuntime } from "./scene-runtime";
6
6
 
@@ -16,10 +16,13 @@ export type EnsureHost = {
16
16
  maxDistance: number;
17
17
  minPolar: number;
18
18
  maxPolar: number;
19
+ damping: number;
19
20
  loadToken: number;
20
21
  ready: boolean;
21
22
  inView: boolean;
22
23
  releaseOffscreen: boolean;
24
+ playOffscreen: boolean;
25
+ frameConsumerCount: number;
23
26
  getBoundingClientRect: () => DOMRect;
24
27
  clientWidth: number;
25
28
  clientHeight: number;
@@ -52,6 +55,7 @@ async function ensureRuntime(host: EnsureHost) {
52
55
  minPolar: reload.degToRad(host.minPolar),
53
56
  maxPolar: reload.degToRad(host.maxPolar),
54
57
  });
58
+ host.runtime.setDamping(host.damping);
55
59
  reload.applyOrbitLimits(host as never);
56
60
  syncSize(host);
57
61
  await reload.run(host as never);
@@ -71,11 +75,15 @@ function releaseRuntime(host: EnsureHost) {
71
75
  }
72
76
 
73
77
  function syncVisibility(host: EnsureHost) {
74
- if (!host.inView && host.releaseOffscreen) {
78
+ const keepOffscreen = wantsOffscreenPlay(host);
79
+ if (!host.inView && host.releaseOffscreen && !keepOffscreen) {
75
80
  releaseRuntime(host);
76
81
  return;
77
82
  }
78
- if (host.inView && (!host.runtime || host.runtime.isLost)) {
83
+ if (
84
+ (!host.runtime || host.runtime.isLost) &&
85
+ (host.inView || keepOffscreen || !host.releaseOffscreen)
86
+ ) {
79
87
  void ensureRuntime(host);
80
88
  return;
81
89
  }
@@ -2,6 +2,7 @@ import { ORBIT_CHANGE_EPSILON } from "./constants";
2
2
  import { formFields } from "./form-fields";
3
3
  import { parse } from "./parse";
4
4
  import { playback } from "./playback";
5
+ import { postBind } from "./post-bind";
5
6
  import { reload } from "./reload";
6
7
  import type { SceneRuntime } from "./runtime";
7
8
  import type { Sonic3dAsset, Sonic3dCameraMode } from "./types";
@@ -91,6 +92,7 @@ function applyFormParams(host: FormBindHost, data: Record<string, unknown>) {
91
92
 
92
93
  formFields.pushToRuntime(host, data);
93
94
  applyFormOrbit(host, data);
95
+ postBind.applyFormPost(host as never, data);
94
96
  if (needReload) void reload.run(host as never);
95
97
  }
96
98
 
@@ -1,6 +1,7 @@
1
1
  import { PublisherManager } from "@supersoniks/concorde/utils";
2
2
  import { ensure } from "./ensure";
3
3
  import { formBind } from "./form-bind";
4
+ import { wantsOffscreenPlay } from "./playback";
4
5
  import type { SceneRuntime } from "./runtime";
5
6
 
6
7
  /** Host Lit pour cycle de vie / observers / bind DP. */
@@ -9,6 +10,8 @@ export type LifeHost = {
9
10
  dataProvider: string;
10
11
  outDataProvider: string;
11
12
  releaseOffscreen: boolean;
13
+ playOffscreen: boolean;
14
+ frameConsumerCount: number;
12
15
  inView: boolean;
13
16
  runtime: SceneRuntime | null;
14
17
  camera: string;
@@ -86,7 +89,7 @@ function firstUpdated(host: LifeHost) {
86
89
  bindFormProvider(host);
87
90
  bindOutPublisher(host);
88
91
  requestAnimationFrame(() => {
89
- if (host.inView || !host.releaseOffscreen) {
92
+ if (host.inView || !host.releaseOffscreen || wantsOffscreenPlay(host)) {
90
93
  void ensure.ensureRuntime(host as never);
91
94
  }
92
95
  });
@@ -33,6 +33,7 @@ export type OutPublishHost = {
33
33
  pointerY: number;
34
34
  lastHit: SceneHit | null;
35
35
  fov: number;
36
+ moving: number;
36
37
  formPublisher: OutPublisherLike | null;
37
38
  bindOutPublisher: () => void;
38
39
  dispatchEvent: (event: Event) => boolean;
@@ -64,7 +65,7 @@ function shouldSkipFormControlOutWrite(
64
65
  }
65
66
 
66
67
  function buildOutput(host: OutPublishHost, time: number): Sonic3dOutput {
67
- return (
68
+ const base =
68
69
  host.runtime?.snapshot({
69
70
  time,
70
71
  frame: host.frame,
@@ -91,8 +92,8 @@ function buildOutput(host: OutPublishHost, time: number): Sonic3dOutput {
91
92
  distance: 0,
92
93
  yaw: 0,
93
94
  pitch: 0,
94
- }
95
- );
95
+ };
96
+ return { ...base, moving: host.moving };
96
97
  }
97
98
 
98
99
  function writePayload(host: OutPublishHost, payload: Sonic3dOutput) {
@@ -8,10 +8,21 @@ export type PlaybackHost = {
8
8
  playOnHover: boolean;
9
9
  hovering: boolean;
10
10
  autoRotate: boolean;
11
+ playOffscreen: boolean;
12
+ /** Nombre de consommateurs live (`registerFrameConsumer`). */
13
+ frameConsumerCount: number;
11
14
  raf: number;
12
15
  drawFrame: (now: number) => void;
13
16
  };
14
17
 
18
+ /** Hors écran : jouer si `play-offscreen` ou au moins un consommateur live. */
19
+ export function wantsOffscreenPlay(host: {
20
+ playOffscreen: boolean;
21
+ frameConsumerCount: number;
22
+ }): boolean {
23
+ return !!host.playOffscreen || host.frameConsumerCount > 0;
24
+ }
25
+
15
26
  function prefersReducedMotion(): boolean {
16
27
  return (
17
28
  typeof matchMedia === "function" &&
@@ -22,7 +33,7 @@ function prefersReducedMotion(): boolean {
22
33
  function shouldAnimate(host: PlaybackHost): boolean {
23
34
  if (!host.play) return false;
24
35
  if (!host.ready) return false;
25
- if (!host.inView) return false;
36
+ if (!host.inView && !wantsOffscreenPlay(host)) return false;
26
37
  if (!host.runtime) return false;
27
38
  if (prefersReducedMotion()) return false;
28
39
  if (host.playOnHover) return host.hovering;
@@ -64,6 +75,7 @@ function syncPlayback(host: PlaybackHost, loop: () => void) {
64
75
  export const playback = {
65
76
  prefersReducedMotion,
66
77
  shouldAnimate,
78
+ wantsOffscreenPlay,
67
79
  syncAutoRotate,
68
80
  syncPlayback,
69
81
  stopLoop,
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Construit la config PostFx depuis les props Lit / form DP.
3
+ */
4
+ import { lookupLiveElement } from "@supersoniks/concorde/core/utils/mediaRef";
5
+ import {
6
+ clampPostScale,
7
+ parsePostChannelSource,
8
+ type PostChannels,
9
+ type PostPassId,
10
+ type PostSources,
11
+ } from "./post-channels";
12
+ import type { PostFxConfig } from "./post-fx";
13
+ import type { SceneRuntime } from "./runtime";
14
+
15
+ export type PostBindHost = {
16
+ postImage: string;
17
+ postBufferA: string;
18
+ postBufferB: string;
19
+ postBufferC: string;
20
+ postBufferD: string;
21
+ postCommon: string;
22
+ postImageCh0: string;
23
+ postImageCh1: string;
24
+ postImageCh2: string;
25
+ postImageCh3: string;
26
+ postBufferACh0: string;
27
+ postBufferACh1: string;
28
+ postBufferACh2: string;
29
+ postBufferACh3: string;
30
+ postBufferBCh0: string;
31
+ postBufferBCh1: string;
32
+ postBufferBCh2: string;
33
+ postBufferBCh3: string;
34
+ postBufferCCh0: string;
35
+ postBufferCCh1: string;
36
+ postBufferCCh2: string;
37
+ postBufferCCh3: string;
38
+ postBufferDCh0: string;
39
+ postBufferDCh1: string;
40
+ postBufferDCh2: string;
41
+ postBufferDCh3: string;
42
+ postScale: number;
43
+ param0: number;
44
+ param1: number;
45
+ param2: number;
46
+ param3: number;
47
+ runtime: SceneRuntime | null;
48
+ errorMessage: string;
49
+ getRootNode: () => Node;
50
+ dispatchEvent: (event: Event) => boolean;
51
+ };
52
+
53
+ const POST_PROP_KEYS = [
54
+ "postImage",
55
+ "postBufferA",
56
+ "postBufferB",
57
+ "postBufferC",
58
+ "postBufferD",
59
+ "postCommon",
60
+ "postImageCh0",
61
+ "postImageCh1",
62
+ "postImageCh2",
63
+ "postImageCh3",
64
+ "postBufferACh0",
65
+ "postBufferACh1",
66
+ "postBufferACh2",
67
+ "postBufferACh3",
68
+ "postBufferBCh0",
69
+ "postBufferBCh1",
70
+ "postBufferBCh2",
71
+ "postBufferBCh3",
72
+ "postBufferCCh0",
73
+ "postBufferCCh1",
74
+ "postBufferCCh2",
75
+ "postBufferCCh3",
76
+ "postBufferDCh0",
77
+ "postBufferDCh1",
78
+ "postBufferDCh2",
79
+ "postBufferDCh3",
80
+ "postScale",
81
+ ] as const;
82
+
83
+ function buildChannels(host: PostBindHost, pass: PostPassId): PostChannels {
84
+ const fallbacks = ["", "", "", ""];
85
+ // image defaults ch0=scene via parse empty+slot0
86
+ let overrides: string[] = ["", "", "", ""];
87
+ if (pass === "image") {
88
+ overrides = [
89
+ host.postImageCh0,
90
+ host.postImageCh1,
91
+ host.postImageCh2,
92
+ host.postImageCh3,
93
+ ];
94
+ } else if (pass === "bufferA") {
95
+ overrides = [
96
+ host.postBufferACh0,
97
+ host.postBufferACh1,
98
+ host.postBufferACh2,
99
+ host.postBufferACh3,
100
+ ];
101
+ } else if (pass === "bufferB") {
102
+ overrides = [
103
+ host.postBufferBCh0,
104
+ host.postBufferBCh1,
105
+ host.postBufferBCh2,
106
+ host.postBufferBCh3,
107
+ ];
108
+ } else if (pass === "bufferC") {
109
+ overrides = [
110
+ host.postBufferCCh0,
111
+ host.postBufferCCh1,
112
+ host.postBufferCCh2,
113
+ host.postBufferCCh3,
114
+ ];
115
+ } else {
116
+ overrides = [
117
+ host.postBufferDCh0,
118
+ host.postBufferDCh1,
119
+ host.postBufferDCh2,
120
+ host.postBufferDCh3,
121
+ ];
122
+ }
123
+ return [0, 1, 2, 3].map((i) =>
124
+ parsePostChannelSource(
125
+ overrides[i],
126
+ fallbacks[i],
127
+ i as 0 | 1 | 2 | 3,
128
+ ),
129
+ ) as PostChannels;
130
+ }
131
+
132
+ function buildConfig(host: PostBindHost): PostFxConfig | null {
133
+ if (!host.postImage.trim()) return null;
134
+ const sources: PostSources = {
135
+ common: host.postCommon,
136
+ image: host.postImage,
137
+ bufferA: host.postBufferA,
138
+ bufferB: host.postBufferB,
139
+ bufferC: host.postBufferC,
140
+ bufferD: host.postBufferD,
141
+ };
142
+ const channels = new Map<PostPassId, PostChannels>();
143
+ for (const pass of [
144
+ "bufferA",
145
+ "bufferB",
146
+ "bufferC",
147
+ "bufferD",
148
+ "image",
149
+ ] as PostPassId[]) {
150
+ channels.set(pass, buildChannels(host, pass));
151
+ }
152
+ return {
153
+ sources,
154
+ channels,
155
+ scale: clampPostScale(host.postScale),
156
+ };
157
+ }
158
+
159
+ function lookupElement(host: PostBindHost, key: string): Element | null {
160
+ if (!key.startsWith("#")) return null;
161
+ const live = lookupLiveElement(key);
162
+ if (live) return live;
163
+ const id = key.slice(1);
164
+ if (!id || id.startsWith("__sonic_frame_")) return null;
165
+ const root = host.getRootNode();
166
+ if (root instanceof Document || root instanceof ShadowRoot) {
167
+ const el = root.getElementById(id);
168
+ if (el) return el;
169
+ }
170
+ return typeof document !== "undefined" ? document.getElementById(id) : null;
171
+ }
172
+
173
+ function applyConfig(host: PostBindHost) {
174
+ if (!host.runtime) return;
175
+ host.runtime.setPostElementResolver((key) => lookupElement(host, key));
176
+ try {
177
+ host.runtime.setPostConfig(buildConfig(host));
178
+ if (host.errorMessage.startsWith("Post FX")) host.errorMessage = "";
179
+ } catch (err) {
180
+ const message = err instanceof Error ? err.message : String(err);
181
+ host.errorMessage = `Post FX: ${message}`;
182
+ const pass =
183
+ err && typeof err === "object" && "pass" in err
184
+ ? String((err as { pass: string }).pass)
185
+ : "image";
186
+ const infoLog =
187
+ err && typeof err === "object" && "infoLog" in err
188
+ ? String((err as { infoLog: string }).infoLog)
189
+ : "";
190
+ host.dispatchEvent(
191
+ new CustomEvent("error", {
192
+ detail: { message, pass, infoLog },
193
+ bubbles: true,
194
+ composed: true,
195
+ }),
196
+ );
197
+ try {
198
+ host.runtime.setPostConfig(null);
199
+ } catch {
200
+ /* ignore */
201
+ }
202
+ }
203
+ }
204
+
205
+ function syncFrame(
206
+ host: PostBindHost,
207
+ time: number,
208
+ timeDelta: number,
209
+ frame: number,
210
+ mouse: [number, number, number, number] = [0, 0, 0, 0],
211
+ ) {
212
+ host.runtime?.setPostFrame({
213
+ time,
214
+ timeDelta,
215
+ frame,
216
+ mouse,
217
+ params: [host.param0, host.param1, host.param2, host.param3],
218
+ });
219
+ }
220
+
221
+ function propsChanged(
222
+ changed: Map<string | number | symbol, unknown>,
223
+ ): boolean {
224
+ return POST_PROP_KEYS.some((k) => changed.has(k));
225
+ }
226
+
227
+ /** Applique param0…3 + post* depuis un DP form. */
228
+ function applyFormPost(host: PostBindHost, data: Record<string, unknown>) {
229
+ let touched = false;
230
+ for (const k of ["param0", "param1", "param2", "param3"] as const) {
231
+ if (k in data && typeof data[k] === "number") {
232
+ host[k] = data[k] as number;
233
+ touched = true;
234
+ } else if (k in data && typeof data[k] === "string") {
235
+ const n = Number(data[k]);
236
+ if (Number.isFinite(n)) {
237
+ host[k] = n;
238
+ touched = true;
239
+ }
240
+ }
241
+ }
242
+ for (const k of POST_PROP_KEYS) {
243
+ if (!(k in data)) continue;
244
+ const v = data[k];
245
+ if (k === "postScale" && (typeof v === "number" || typeof v === "string")) {
246
+ host.postScale = clampPostScale(Number(v));
247
+ touched = true;
248
+ } else if (typeof v === "string") {
249
+ (host as unknown as Record<string, string>)[k] = v;
250
+ touched = true;
251
+ }
252
+ }
253
+ if (touched) applyConfig(host);
254
+ }
255
+
256
+ export const postBind = {
257
+ applyConfig,
258
+ syncFrame,
259
+ propsChanged,
260
+ applyFormPost,
261
+ POST_PROP_KEYS,
262
+ } as const;