@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.
- package/.gitlab-ci.yml +0 -13
- package/build-infos.json +1 -1
- package/concorde-3d.bundle.js +201 -152
- package/concorde-3d.es.js +14688 -13906
- package/concorde-core.bundle.js +557 -622
- package/concorde-core.es.js +6025 -5575
- package/concorde-hugging-face-infer.bundle.js +1 -1
- package/concorde-hugging-face-infer.es.js +1 -1
- package/concorde-interactive.bundle.js +1162 -0
- package/concorde-interactive.es.js +10723 -0
- package/concorde-shader.bundle.js +31 -20
- package/concorde-shader.es.js +2773 -2547
- package/concorde-webgpu.bundle.js +43 -32
- package/concorde-webgpu.es.js +1819 -1553
- package/dist/concorde-3d.bundle.js +201 -152
- package/dist/concorde-3d.es.js +14688 -13906
- package/dist/concorde-core.bundle.js +557 -622
- package/dist/concorde-core.es.js +6025 -5575
- package/dist/concorde-hugging-face-infer.bundle.js +1 -1
- package/dist/concorde-hugging-face-infer.es.js +1 -1
- package/dist/concorde-interactive.bundle.js +1162 -0
- package/dist/concorde-interactive.es.js +10723 -0
- package/dist/concorde-shader.bundle.js +31 -20
- package/dist/concorde-shader.es.js +2773 -2547
- package/dist/concorde-webgpu.bundle.js +43 -32
- package/dist/concorde-webgpu.es.js +1819 -1553
- package/dist/docs-mock-api-sw.js +5 -1
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/dist/js/addons/interactive.js +6 -0
- package/dist/js/addons/interactive.js.map +1 -0
- package/dist/js/core/components/functional/3d/3d.js +90 -2
- package/dist/js/core/components/functional/3d/3d.js.map +1 -1
- package/dist/js/core/components/functional/3d/constants.js +1 -0
- package/dist/js/core/components/functional/3d/constants.js.map +1 -1
- package/dist/js/core/components/functional/3d/ensure.js +6 -3
- package/dist/js/core/components/functional/3d/ensure.js.map +1 -1
- package/dist/js/core/components/functional/3d/form-params.js +2 -0
- package/dist/js/core/components/functional/3d/form-params.js.map +1 -1
- package/dist/js/core/components/functional/3d/life.js +2 -1
- package/dist/js/core/components/functional/3d/life.js.map +1 -1
- package/dist/js/core/components/functional/3d/out-publish.js +3 -2
- package/dist/js/core/components/functional/3d/out-publish.js.map +1 -1
- package/dist/js/core/components/functional/3d/playback.js +6 -1
- package/dist/js/core/components/functional/3d/playback.js.map +1 -1
- package/dist/js/core/components/functional/3d/post-bind.js +207 -0
- package/dist/js/core/components/functional/3d/post-bind.js.map +1 -0
- package/dist/js/core/components/functional/3d/post-channels.js +39 -0
- package/dist/js/core/components/functional/3d/post-channels.js.map +1 -0
- package/dist/js/core/components/functional/3d/post-fx.js +495 -0
- package/dist/js/core/components/functional/3d/post-fx.js.map +1 -0
- package/dist/js/core/components/functional/3d/props.js +142 -0
- package/dist/js/core/components/functional/3d/props.js.map +1 -1
- package/dist/js/core/components/functional/3d/reload.js +2 -0
- package/dist/js/core/components/functional/3d/reload.js.map +1 -1
- package/dist/js/core/components/functional/3d/runtime.js +80 -3
- package/dist/js/core/components/functional/3d/runtime.js.map +1 -1
- package/dist/js/core/components/functional/3d/scene-runtime.js +1 -1
- package/dist/js/core/components/functional/3d/scene-runtime.js.map +1 -1
- package/dist/js/core/components/functional/3d/tune.js +21 -0
- package/dist/js/core/components/functional/3d/tune.js.map +1 -1
- package/dist/js/core/components/functional/3d/updated.js +13 -1
- package/dist/js/core/components/functional/3d/updated.js.map +1 -1
- package/dist/js/core/components/functional/if/if.js +65 -7
- package/dist/js/core/components/functional/if/if.js.map +1 -1
- package/dist/js/core/components/functional/interactive/action.js +96 -0
- package/dist/js/core/components/functional/interactive/action.js.map +1 -0
- package/dist/js/core/components/functional/interactive/gamepad.js +206 -0
- package/dist/js/core/components/functional/interactive/gamepad.js.map +1 -0
- package/dist/js/core/components/functional/interactive/gesture.js +148 -0
- package/dist/js/core/components/functional/interactive/gesture.js.map +1 -0
- package/dist/js/core/components/functional/interactive/helpers.js +82 -0
- package/dist/js/core/components/functional/interactive/helpers.js.map +1 -0
- package/dist/js/core/components/functional/interactive/index.js +20 -0
- package/dist/js/core/components/functional/interactive/index.js.map +1 -0
- package/dist/js/core/components/functional/interactive/keyboard.js +183 -0
- package/dist/js/core/components/functional/interactive/keyboard.js.map +1 -0
- package/dist/js/core/components/functional/interactive/matrix.js +201 -0
- package/dist/js/core/components/functional/interactive/matrix.js.map +1 -0
- package/dist/js/core/components/functional/interactive/registry.js +28 -0
- package/dist/js/core/components/functional/interactive/registry.js.map +1 -0
- package/dist/js/core/components/functional/interactive/store.js +264 -0
- package/dist/js/core/components/functional/interactive/store.js.map +1 -0
- package/dist/js/core/components/functional/interactive/ticker.js +182 -0
- package/dist/js/core/components/functional/interactive/ticker.js.map +1 -0
- package/dist/js/core/components/functional/shader/gl-runtime.js +128 -14
- package/dist/js/core/components/functional/shader/gl-runtime.js.map +1 -1
- package/dist/js/core/components/functional/shader/shader.js +154 -57
- package/dist/js/core/components/functional/shader/shader.js.map +1 -1
- package/dist/js/core/components/functional/shader/shadertoy-prelude.js +39 -5
- package/dist/js/core/components/functional/shader/shadertoy-prelude.js.map +1 -1
- package/dist/js/core/components/functional/shader/types.js +58 -7
- package/dist/js/core/components/functional/shader/types.js.map +1 -1
- package/dist/js/core/components/functional/value/value.js +49 -4
- package/dist/js/core/components/functional/value/value.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/gl-fallback.js +27 -6
- package/dist/js/core/components/functional/webgpu/gl-fallback.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/gpu-runtime.js +115 -13
- package/dist/js/core/components/functional/webgpu/gpu-runtime.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/helpers.js +8 -2
- package/dist/js/core/components/functional/webgpu/helpers.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/webgpu.js +34 -1
- package/dist/js/core/components/functional/webgpu/webgpu.js.map +1 -1
- package/dist/js/core/components/ui/_css/rounded.js +34 -0
- package/dist/js/core/components/ui/_css/rounded.js.map +1 -0
- package/dist/js/core/components/ui/_css/type.js +44 -0
- package/dist/js/core/components/ui/_css/type.js.map +1 -1
- package/dist/js/core/components/ui/_i18n/ui-aria-labels.js +95 -0
- package/dist/js/core/components/ui/_i18n/ui-aria-labels.js.map +1 -0
- package/dist/js/core/components/ui/alert/alert.js +72 -87
- package/dist/js/core/components/ui/alert/alert.js.map +1 -1
- package/dist/js/core/components/ui/alert-messages/alert-messages.js +1 -0
- package/dist/js/core/components/ui/alert-messages/alert-messages.js.map +1 -1
- package/dist/js/core/components/ui/badge/badge.js +29 -80
- package/dist/js/core/components/ui/badge/badge.js.map +1 -1
- package/dist/js/core/components/ui/button/button.js +8 -7
- package/dist/js/core/components/ui/button/button.js.map +1 -1
- package/dist/js/core/components/ui/card/card-header.js +7 -2
- package/dist/js/core/components/ui/card/card-header.js.map +1 -1
- package/dist/js/core/components/ui/divider/divider.js +1 -1
- package/dist/js/core/components/ui/divider/divider.js.map +1 -1
- package/dist/js/core/components/ui/form/checkbox/checkbox.js +4 -20
- package/dist/js/core/components/ui/form/checkbox/checkbox.js.map +1 -1
- package/dist/js/core/components/ui/form/fieldset/legend-description.js +1 -1
- package/dist/js/core/components/ui/form/fieldset/legend.js +1 -1
- package/dist/js/core/components/ui/form/input/input.js +12 -15
- package/dist/js/core/components/ui/form/input/input.js.map +1 -1
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js +363 -158
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js.map +1 -1
- package/dist/js/core/components/ui/form/radio/radio.js +1 -1
- package/dist/js/core/components/ui/form/select/select.js +3 -6
- package/dist/js/core/components/ui/form/select/select.js.map +1 -1
- package/dist/js/core/components/ui/form/textarea/textarea.js +1 -2
- package/dist/js/core/components/ui/form/textarea/textarea.js.map +1 -1
- package/dist/js/core/components/ui/image/image.js +9 -37
- package/dist/js/core/components/ui/image/image.js.map +1 -1
- package/dist/js/core/components/ui/link/link.js +25 -26
- package/dist/js/core/components/ui/link/link.js.map +1 -1
- package/dist/js/core/components/ui/modal/modal-close.js +3 -12
- package/dist/js/core/components/ui/modal/modal-close.js.map +1 -1
- package/dist/js/core/components/ui/modal/modal.js +18 -18
- package/dist/js/core/components/ui/modal/modal.js.map +1 -1
- package/dist/js/core/components/ui/pop/pop.js +131 -112
- package/dist/js/core/components/ui/pop/pop.js.map +1 -1
- package/dist/js/core/components/ui/table/table.js.map +1 -1
- package/dist/js/core/components/ui/theme/theme.js +1 -1
- package/dist/js/core/components/ui/toast/dismissed.js +9 -0
- package/dist/js/core/components/ui/toast/dismissed.js.map +1 -0
- package/dist/js/core/components/ui/toast/render-content.js +14 -0
- package/dist/js/core/components/ui/toast/render-content.js.map +1 -0
- package/dist/js/core/components/ui/toast/toast-item.js +150 -96
- package/dist/js/core/components/ui/toast/toast-item.js.map +1 -1
- package/dist/js/core/components/ui/toast/toast.js +41 -13
- package/dist/js/core/components/ui/toast/toast.js.map +1 -1
- package/dist/js/core/components/ui/tooltip/tooltip.js +144 -143
- package/dist/js/core/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js.map +1 -1
- package/dist/js/core/decorators/subscriber/derive.js +3 -1
- package/dist/js/core/decorators/subscriber/derive.js.map +1 -1
- package/dist/js/core/mixins/Fetcher.js.map +1 -1
- package/dist/js/core/mixins/FormCheckable.js +1 -8
- package/dist/js/core/mixins/FormCheckable.js.map +1 -1
- package/dist/js/core/mixins/FormElement.js +26 -53
- package/dist/js/core/mixins/FormElement.js.map +1 -1
- package/dist/js/core/utils/AncestorAttributeObserver.js +130 -55
- package/dist/js/core/utils/AncestorAttributeObserver.js.map +1 -1
- package/dist/js/core/utils/LocationHandler.js +1 -1
- package/dist/js/core/utils/LocationHandler.js.map +1 -1
- package/dist/js/core/utils/dismissed.js +23 -0
- package/dist/js/core/utils/dismissed.js.map +1 -0
- package/dist/js/core/utils/mediaRef.js +37 -0
- package/dist/js/core/utils/mediaRef.js.map +1 -1
- package/dist/js/core/utils/positioning.js +110 -0
- package/dist/js/core/utils/positioning.js.map +1 -0
- package/dist/js/directives.js +1 -2
- package/dist/js/directives.js.map +1 -1
- package/dist/types/addons/interactive.d.ts +6 -0
- package/dist/types/addons/interactive.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/3d.d.ts +26 -3
- package/dist/types/core/components/functional/3d/3d.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/constants.d.ts +1 -1
- package/dist/types/core/components/functional/3d/constants.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/ensure.d.ts +3 -0
- package/dist/types/core/components/functional/3d/ensure.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/form-params.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/life.d.ts +2 -0
- package/dist/types/core/components/functional/3d/life.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/out-publish.d.ts +1 -0
- package/dist/types/core/components/functional/3d/out-publish.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/playback.d.ts +9 -0
- package/dist/types/core/components/functional/3d/playback.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/post-bind.d.ts +52 -0
- package/dist/types/core/components/functional/3d/post-bind.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/post-channels.d.ts +40 -0
- package/dist/types/core/components/functional/3d/post-channels.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/post-fx.d.ts +73 -0
- package/dist/types/core/components/functional/3d/post-fx.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/props.d.ts +42 -0
- package/dist/types/core/components/functional/3d/props.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/reload.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/runtime.d.ts +16 -1
- package/dist/types/core/components/functional/3d/runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/scene-runtime.d.ts +1 -1
- package/dist/types/core/components/functional/3d/scene-runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/tune.d.ts +5 -0
- package/dist/types/core/components/functional/3d/tune.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/types.d.ts +9 -0
- package/dist/types/core/components/functional/3d/types.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/updated.d.ts.map +1 -1
- package/dist/types/core/components/functional/if/if.d.ts +14 -5
- package/dist/types/core/components/functional/if/if.d.ts.map +1 -1
- package/dist/types/core/components/functional/interactive/action.d.ts +22 -0
- package/dist/types/core/components/functional/interactive/action.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/gamepad.d.ts +37 -0
- package/dist/types/core/components/functional/interactive/gamepad.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/gesture.d.ts +26 -0
- package/dist/types/core/components/functional/interactive/gesture.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/helpers.d.ts +23 -0
- package/dist/types/core/components/functional/interactive/helpers.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/index.d.ts +20 -0
- package/dist/types/core/components/functional/interactive/index.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/keyboard.d.ts +37 -0
- package/dist/types/core/components/functional/interactive/keyboard.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/matrix.d.ts +31 -0
- package/dist/types/core/components/functional/interactive/matrix.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/registry.d.ts +23 -0
- package/dist/types/core/components/functional/interactive/registry.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/store.d.ts +46 -0
- package/dist/types/core/components/functional/interactive/store.d.ts.map +1 -0
- package/dist/types/core/components/functional/interactive/ticker.d.ts +33 -0
- package/dist/types/core/components/functional/interactive/ticker.d.ts.map +1 -0
- package/dist/types/core/components/functional/shader/gl-runtime.d.ts +33 -1
- package/dist/types/core/components/functional/shader/gl-runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/shader.d.ts +28 -7
- package/dist/types/core/components/functional/shader/shader.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/shadertoy-prelude.d.ts +16 -2
- package/dist/types/core/components/functional/shader/shadertoy-prelude.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/types.d.ts +29 -5
- package/dist/types/core/components/functional/shader/types.d.ts.map +1 -1
- package/dist/types/core/components/functional/value/value.d.ts +6 -0
- package/dist/types/core/components/functional/value/value.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/gl-fallback.d.ts +4 -0
- package/dist/types/core/components/functional/webgpu/gl-fallback.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/gpu-runtime.d.ts +14 -0
- package/dist/types/core/components/functional/webgpu/gpu-runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/helpers.d.ts +1 -0
- package/dist/types/core/components/functional/webgpu/helpers.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/webgpu.d.ts +7 -1
- package/dist/types/core/components/functional/webgpu/webgpu.d.ts.map +1 -1
- package/dist/types/core/components/ui/_css/rounded.d.ts +3 -0
- package/dist/types/core/components/ui/_css/rounded.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/type.d.ts +13 -0
- package/dist/types/core/components/ui/_css/type.d.ts.map +1 -1
- package/dist/types/core/components/ui/_i18n/ui-aria-labels.d.ts +83 -0
- package/dist/types/core/components/ui/_i18n/ui-aria-labels.d.ts.map +1 -0
- package/dist/types/core/components/ui/alert/alert.d.ts +14 -12
- package/dist/types/core/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts.map +1 -1
- package/dist/types/core/components/ui/badge/badge.d.ts +1 -1
- package/dist/types/core/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/types/core/components/ui/button/button.d.ts +13 -29
- package/dist/types/core/components/ui/button/button.d.ts.map +1 -1
- package/dist/types/core/components/ui/card/card-header.d.ts.map +1 -1
- package/dist/types/core/components/ui/divider/divider.d.ts +2 -1
- package/dist/types/core/components/ui/divider/divider.d.ts.map +1 -1
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts +25 -73
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts.map +1 -1
- package/dist/types/core/components/ui/form/input/input.d.ts +14 -29
- package/dist/types/core/components/ui/form/input/input.d.ts.map +1 -1
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +63 -65
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts.map +1 -1
- package/dist/types/core/components/ui/form/radio/radio.d.ts +1 -1
- package/dist/types/core/components/ui/form/select/select.d.ts +3 -5
- package/dist/types/core/components/ui/form/select/select.d.ts.map +1 -1
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts +12 -28
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts.map +1 -1
- package/dist/types/core/components/ui/image/image.d.ts +2 -1
- package/dist/types/core/components/ui/image/image.d.ts.map +1 -1
- package/dist/types/core/components/ui/link/link.d.ts +10 -9
- package/dist/types/core/components/ui/link/link.d.ts.map +1 -1
- package/dist/types/core/components/ui/modal/modal-close.d.ts +2 -2
- package/dist/types/core/components/ui/modal/modal-close.d.ts.map +1 -1
- package/dist/types/core/components/ui/pop/pop.d.ts +12 -4
- package/dist/types/core/components/ui/pop/pop.d.ts.map +1 -1
- package/dist/types/core/components/ui/table/table.d.ts +2 -1
- package/dist/types/core/components/ui/table/table.d.ts.map +1 -1
- package/dist/types/core/components/ui/toast/dismissed.d.ts +3 -0
- package/dist/types/core/components/ui/toast/dismissed.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/render-content.d.ts +7 -0
- package/dist/types/core/components/ui/toast/render-content.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/toast-item.d.ts +26 -9
- package/dist/types/core/components/ui/toast/toast-item.d.ts.map +1 -1
- package/dist/types/core/components/ui/toast/toast.d.ts +6 -3
- package/dist/types/core/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/types/core/components/ui/toast/types.d.ts +12 -2
- package/dist/types/core/components/ui/toast/types.d.ts.map +1 -1
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts +19 -11
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts +3 -4
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts.map +1 -1
- package/dist/types/core/decorators/subscriber/derive.d.ts.map +1 -1
- package/dist/types/core/mixins/FormCheckable.d.ts +10 -27
- package/dist/types/core/mixins/FormCheckable.d.ts.map +1 -1
- package/dist/types/core/mixins/FormElement.d.ts +21 -10
- package/dist/types/core/mixins/FormElement.d.ts.map +1 -1
- package/dist/types/core/mixins/FormInput.d.ts +11 -27
- package/dist/types/core/mixins/FormInput.d.ts.map +1 -1
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts +17 -9
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts.map +1 -1
- package/dist/types/core/utils/LocationHandler.d.ts +3 -2
- package/dist/types/core/utils/LocationHandler.d.ts.map +1 -1
- package/dist/types/core/utils/dismissed.d.ts +3 -0
- package/dist/types/core/utils/dismissed.d.ts.map +1 -0
- package/dist/types/core/utils/mediaRef.d.ts +15 -0
- package/dist/types/core/utils/mediaRef.d.ts.map +1 -1
- package/dist/types/core/utils/positioning.d.ts +44 -0
- package/dist/types/core/utils/positioning.d.ts.map +1 -0
- package/dist/types/directives.d.ts +1 -3
- package/dist/types/directives.d.ts.map +1 -1
- package/dist/types/mixins.d.ts +22 -55
- package/dist/types/mixins.d.ts.map +1 -1
- package/docs/assets/{index-FmK4JaIM.js → index-D8MVWqY6.js} +946 -687
- package/docs/assets/index-DiD0qYvE.css +1 -0
- package/docs/crawl/core/components/ui/form/input-autocomplete/input-autocomplete.html +17 -85
- package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +1 -1
- package/docs/crawl/hubs/form-components.html +13 -11
- package/docs/docs-mock-api-sw.js +5 -1
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +2 -2
- package/docs/llms-full.txt +12 -38
- package/docs/llms.txt +1 -1
- package/docs/src/core/components/functional/sdui/sdui.md +0 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -0
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +14 -118
- package/docs/src/docs/_getting-started/create-a-component.md +0 -0
- package/docs/src/docs/_misc/formelement-subscriber-removal.md +1 -1
- package/docs/src/docs/search/docs-search.json +195 -200
- package/docs/src/tsconfig.json +324 -0
- package/gitlab/job_tests.sh +25 -12
- package/index.html +3 -3
- package/package.json +217 -9
- package/public/docs-mock-api-sw.js +5 -1
- package/public/docs-mock-api-sw.js.map +2 -2
- package/scripts/build-addons.mjs +2 -2
- package/scripts/post-build.mjs +9 -0
- package/src/addons/interactive.ts +5 -0
- package/src/core/components/functional/3d/3d.md +34 -1
- package/src/core/components/functional/3d/3d.spec.ts +42 -0
- package/src/core/components/functional/3d/3d.ts +101 -3
- package/src/core/components/functional/3d/constants.ts +1 -0
- package/src/core/components/functional/3d/ensure.ts +11 -3
- package/src/core/components/functional/3d/form-params.ts +2 -0
- package/src/core/components/functional/3d/life.ts +4 -1
- package/src/core/components/functional/3d/out-publish.ts +4 -3
- package/src/core/components/functional/3d/playback.ts +13 -1
- package/src/core/components/functional/3d/post-bind.ts +262 -0
- package/src/core/components/functional/3d/post-channels.spec.ts +36 -0
- package/src/core/components/functional/3d/post-channels.ts +69 -0
- package/src/core/components/functional/3d/post-fx.ts +594 -0
- package/src/core/components/functional/3d/props.ts +45 -0
- package/src/core/components/functional/3d/reload.ts +2 -0
- package/src/core/components/functional/3d/runtime.ts +93 -4
- package/src/core/components/functional/3d/scene-runtime.ts +3 -0
- package/src/core/components/functional/3d/tune.ts +21 -0
- package/src/core/components/functional/3d/types.ts +9 -0
- package/src/core/components/functional/3d/updated.ts +17 -1
- package/src/core/components/functional/if/if.ts +54 -7
- package/src/core/components/functional/interactive/action.ts +84 -0
- package/src/core/components/functional/interactive/gamepad.ts +197 -0
- package/src/core/components/functional/interactive/gesture.ts +136 -0
- package/src/core/components/functional/interactive/helpers.spec.ts +50 -0
- package/src/core/components/functional/interactive/helpers.ts +97 -0
- package/src/core/components/functional/interactive/index.ts +25 -0
- package/src/core/components/functional/interactive/interactive.md +33 -0
- package/src/core/components/functional/interactive/keyboard.ts +171 -0
- package/src/core/components/functional/interactive/matrix.ts +185 -0
- package/src/core/components/functional/interactive/registry.ts +46 -0
- package/src/core/components/functional/interactive/store.ts +264 -0
- package/src/core/components/functional/interactive/ticker.ts +171 -0
- package/src/core/components/functional/list/list.ts +0 -0
- package/src/core/components/functional/shader/gl-runtime.ts +169 -12
- package/src/core/components/functional/shader/shader.md +27 -4
- package/src/core/components/functional/shader/shader.spec.ts +267 -0
- package/src/core/components/functional/shader/shader.ts +177 -55
- package/src/core/components/functional/shader/shadertoy-prelude.ts +49 -5
- package/src/core/components/functional/shader/types.ts +89 -12
- package/src/core/components/functional/subscriber/subscriber.ts +0 -0
- package/src/core/components/functional/value/value.ts +44 -4
- package/src/core/components/functional/webgpu/gl-fallback.ts +28 -4
- package/src/core/components/functional/webgpu/gpu-runtime.ts +154 -18
- package/src/core/components/functional/webgpu/helpers.ts +8 -2
- package/src/core/components/functional/webgpu/webgpu.md +13 -2
- package/src/core/components/functional/webgpu/webgpu.spec.ts +37 -0
- package/src/core/components/functional/webgpu/webgpu.ts +39 -1
- package/src/core/components/ui/_css/rounded.ts +36 -0
- package/src/core/components/ui/_css/type.ts +49 -0
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +104 -0
- package/src/core/components/ui/alert/alert.md +128 -72
- package/src/core/components/ui/alert/alert.spec.ts +145 -0
- package/src/core/components/ui/alert/alert.ts +86 -91
- package/src/core/components/ui/alert-messages/alert-messages.ts +1 -1
- package/src/core/components/ui/badge/badge.md +126 -78
- package/src/core/components/ui/badge/badge.ts +29 -81
- package/src/core/components/ui/button/button.md +1 -0
- package/src/core/components/ui/button/button.ts +12 -10
- package/src/core/components/ui/card/card-header.ts +7 -2
- package/src/core/components/ui/card/card.md +120 -65
- package/src/core/components/ui/divider/divider.ts +4 -9
- package/src/core/components/ui/form/checkbox/checkbox.md +1 -1
- package/src/core/components/ui/form/checkbox/checkbox.ts +4 -20
- package/src/core/components/ui/form/fieldset/legend-description.ts +1 -1
- package/src/core/components/ui/form/fieldset/legend.ts +1 -1
- package/src/core/components/ui/form/input/input.md +1 -1
- package/src/core/components/ui/form/input/input.ts +25 -27
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +14 -118
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +419 -187
- package/src/core/components/ui/form/radio/radio.ts +1 -1
- package/src/core/components/ui/form/select/select.ts +3 -6
- package/src/core/components/ui/form/textarea/textarea.md +1 -1
- package/src/core/components/ui/form/textarea/textarea.ts +1 -2
- package/src/core/components/ui/image/image.md +147 -53
- package/src/core/components/ui/image/image.ts +10 -44
- package/src/core/components/ui/link/link.md +2 -2
- package/src/core/components/ui/link/link.ts +42 -37
- package/src/core/components/ui/modal/modal-close.ts +8 -12
- package/src/core/components/ui/modal/modal.ts +18 -18
- package/src/core/components/ui/pop/pop.md +105 -1
- package/src/core/components/ui/pop/pop.ts +145 -141
- package/src/core/components/ui/table/table.ts +2 -8
- package/src/core/components/ui/theme/theme.ts +1 -1
- package/src/core/components/ui/toast/dismissed.ts +14 -0
- package/src/core/components/ui/toast/render-content.ts +13 -0
- package/src/core/components/ui/toast/toast-item.ts +179 -103
- package/src/core/components/ui/toast/toast.ts +58 -21
- package/src/core/components/ui/toast/types.ts +14 -2
- package/src/core/components/ui/tooltip/tooltip.ts +176 -154
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/decorators/subscriber/derive.ts +3 -3
- package/src/core/mixins/Fetcher.ts +1 -1
- package/src/core/mixins/FormCheckable.ts +1 -8
- package/src/core/mixins/FormElement.ts +74 -76
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/core/utils/DataBindObserver.ts +0 -0
- package/src/core/utils/LocationHandler.ts +12 -5
- package/src/core/utils/Objects.ts +0 -0
- package/src/core/utils/dismissed.ts +22 -0
- package/src/core/utils/mediaRef.spec.ts +25 -0
- package/src/core/utils/mediaRef.ts +45 -0
- package/src/core/utils/positioning.spec.ts +208 -0
- package/src/core/utils/positioning.ts +183 -0
- package/src/directives.ts +1 -3
- package/src/docs/_core-concept/dataFlow.md +1 -1
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/src/docs/_getting-started/concorde-outside.md +3 -3
- package/src/docs/_misc/formelement-subscriber-removal.md +115 -0
- package/src/docs/_misc/html-integration.md +2 -0
- package/src/docs/_misc/visual-stack.md +19 -1
- package/src/docs/code.ts +3 -1
- package/src/docs/components/docs-demo-sources.ts +88 -0
- package/src/docs/docs.ts +3 -0
- package/src/docs/example/docs-3d-post-depth-demo.ts +68 -0
- package/src/docs/example/docs-3d-webgpu-live-demo.ts +83 -0
- package/src/docs/example/docs-harris-webgpu-demo.ts +53 -55
- package/src/docs/example/docs-input-autocomplete-demos.ts +110 -0
- package/src/docs/mock-api/router.ts +17 -1
- package/src/docs/navigation/navigation.ts +4 -0
- package/src/docs/search/docs-search.json +922 -1762
- package/src/docs/tailwind/css/tailwind.css +13 -6
- package/src/tsconfig.json +162 -6
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +50 -3
- package/vite/config.js +23 -35
- package/vite.config.mts +5 -0
- package/vitest.setup.ts +49 -13
- package/docs/assets/index-BZiZXMU-.css +0 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
+
import { dispatch, type SonicActionMessage } from "./registry";
|
|
4
|
+
import { set } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
5
|
+
|
|
6
|
+
const tagName = "sonic-gamepad";
|
|
7
|
+
|
|
8
|
+
type RepeatCfg = Record<string, [number, number]>;
|
|
9
|
+
|
|
10
|
+
const STANDARD: Record<string, number | { axis: number; dir: 1 | -1 }> = {
|
|
11
|
+
"dpad-up": 12,
|
|
12
|
+
"dpad-down": 13,
|
|
13
|
+
"dpad-left": 14,
|
|
14
|
+
"dpad-right": 15,
|
|
15
|
+
a: 0,
|
|
16
|
+
b: 1,
|
|
17
|
+
x: 2,
|
|
18
|
+
y: 3,
|
|
19
|
+
start: 9,
|
|
20
|
+
select: 8,
|
|
21
|
+
"ls-x-": { axis: 0, dir: -1 },
|
|
22
|
+
"ls-x+": { axis: 0, dir: 1 },
|
|
23
|
+
"ls-y-": { axis: 1, dir: -1 },
|
|
24
|
+
"ls-y+": { axis: 1, dir: 1 },
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Manette → actions store. Raf uniquement si une pad est connectée.
|
|
29
|
+
*/
|
|
30
|
+
@customElement(tagName)
|
|
31
|
+
export class SonicGamepad extends LitElement {
|
|
32
|
+
static styles = css`
|
|
33
|
+
:host {
|
|
34
|
+
display: contents;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
@property({ type: String })
|
|
39
|
+
target = "";
|
|
40
|
+
|
|
41
|
+
@property({ type: Object })
|
|
42
|
+
keymap: Record<string, string | { type: string; payload?: unknown }> = {
|
|
43
|
+
"dpad-left": "left",
|
|
44
|
+
"dpad-right": "right",
|
|
45
|
+
"dpad-up": "rotate",
|
|
46
|
+
"dpad-down": "soft-drop",
|
|
47
|
+
a: "rotate",
|
|
48
|
+
b: "drop",
|
|
49
|
+
start: "pause",
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
@property({ type: Number })
|
|
53
|
+
deadzone = 0.25;
|
|
54
|
+
|
|
55
|
+
@property({ type: Object })
|
|
56
|
+
repeat: RepeatCfg = {};
|
|
57
|
+
|
|
58
|
+
@property({ type: String })
|
|
59
|
+
dataProvider = "";
|
|
60
|
+
|
|
61
|
+
@property({ type: Boolean, attribute: "dispatch-event" })
|
|
62
|
+
dispatchEventFlag = false;
|
|
63
|
+
|
|
64
|
+
@state() private connected = false;
|
|
65
|
+
|
|
66
|
+
private raf = 0;
|
|
67
|
+
private prev = new Map<string, boolean>();
|
|
68
|
+
private heldTimers = new Map<string, { timer?: number; interval?: number }>();
|
|
69
|
+
|
|
70
|
+
connectedCallback(): void {
|
|
71
|
+
super.connectedCallback();
|
|
72
|
+
window.addEventListener("gamepadconnected", this.onConnect);
|
|
73
|
+
window.addEventListener("gamepaddisconnected", this.onDisconnect);
|
|
74
|
+
this.scan();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
disconnectedCallback(): void {
|
|
78
|
+
window.removeEventListener("gamepadconnected", this.onConnect);
|
|
79
|
+
window.removeEventListener("gamepaddisconnected", this.onDisconnect);
|
|
80
|
+
this.stopLoop();
|
|
81
|
+
this.clearHolds();
|
|
82
|
+
super.disconnectedCallback();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private onConnect = () => this.scan();
|
|
86
|
+
private onDisconnect = () => this.scan();
|
|
87
|
+
|
|
88
|
+
private scan(): void {
|
|
89
|
+
const pads = navigator.getGamepads?.() ?? [];
|
|
90
|
+
const any = [...pads].some(Boolean);
|
|
91
|
+
this.connected = any;
|
|
92
|
+
this.publishStatus();
|
|
93
|
+
if (any) this.startLoop();
|
|
94
|
+
else this.stopLoop();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private publishStatus(): void {
|
|
98
|
+
if (!this.dataProvider) return;
|
|
99
|
+
const pads = navigator.getGamepads?.() ?? [];
|
|
100
|
+
const first = [...pads].find(Boolean);
|
|
101
|
+
set(this.dataProvider, {
|
|
102
|
+
connected: this.connected,
|
|
103
|
+
id: first?.id ?? null,
|
|
104
|
+
} as never);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private startLoop(): void {
|
|
108
|
+
if (this.raf) return;
|
|
109
|
+
const loop = () => {
|
|
110
|
+
this.raf = requestAnimationFrame(loop);
|
|
111
|
+
this.poll();
|
|
112
|
+
};
|
|
113
|
+
this.raf = requestAnimationFrame(loop);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private stopLoop(): void {
|
|
117
|
+
if (this.raf) cancelAnimationFrame(this.raf);
|
|
118
|
+
this.raf = 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private poll(): void {
|
|
122
|
+
const pads = navigator.getGamepads?.() ?? [];
|
|
123
|
+
const pad = [...pads].find(Boolean);
|
|
124
|
+
if (!pad) {
|
|
125
|
+
this.scan();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
for (const [name, mapped] of Object.entries(this.keymap || {})) {
|
|
129
|
+
const spec = STANDARD[name];
|
|
130
|
+
if (spec == null) continue;
|
|
131
|
+
let pressed = false;
|
|
132
|
+
if (typeof spec === "number") {
|
|
133
|
+
pressed = Boolean(pad.buttons[spec]?.pressed);
|
|
134
|
+
} else {
|
|
135
|
+
const axis = pad.axes[spec.axis] ?? 0;
|
|
136
|
+
pressed = spec.dir < 0 ? axis < -this.deadzone : axis > this.deadzone;
|
|
137
|
+
}
|
|
138
|
+
const was = this.prev.get(name) ?? false;
|
|
139
|
+
if (pressed && !was) {
|
|
140
|
+
this.fire(mapped);
|
|
141
|
+
this.startRepeat(name, mapped);
|
|
142
|
+
} else if (!pressed && was) {
|
|
143
|
+
this.stopRepeat(name);
|
|
144
|
+
}
|
|
145
|
+
this.prev.set(name, pressed);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private startRepeat(
|
|
150
|
+
name: string,
|
|
151
|
+
mapped: string | { type: string; payload?: unknown },
|
|
152
|
+
): void {
|
|
153
|
+
const action = typeof mapped === "string" ? { type: mapped } : mapped;
|
|
154
|
+
const rep = this.repeat?.[action.type];
|
|
155
|
+
if (!rep) return;
|
|
156
|
+
const [delay, interval] = rep;
|
|
157
|
+
const entry: { timer?: number; interval?: number } = {};
|
|
158
|
+
entry.timer = window.setTimeout(() => {
|
|
159
|
+
this.fire(mapped);
|
|
160
|
+
entry.interval = window.setInterval(() => this.fire(mapped), Math.max(16, interval));
|
|
161
|
+
}, Math.max(0, delay));
|
|
162
|
+
this.heldTimers.set(name, entry);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private stopRepeat(name: string): void {
|
|
166
|
+
const h = this.heldTimers.get(name);
|
|
167
|
+
if (!h) return;
|
|
168
|
+
if (h.timer) clearTimeout(h.timer);
|
|
169
|
+
if (h.interval) clearInterval(h.interval);
|
|
170
|
+
this.heldTimers.delete(name);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
private clearHolds(): void {
|
|
174
|
+
for (const name of [...this.heldTimers.keys()]) this.stopRepeat(name);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
private fire(mapped: string | { type: string; payload?: unknown }): void {
|
|
178
|
+
const action: SonicActionMessage =
|
|
179
|
+
typeof mapped === "string" ? { type: mapped } : { type: mapped.type, payload: mapped.payload };
|
|
180
|
+
if (this.target) dispatch(this.target, action);
|
|
181
|
+
if (this.dispatchEventFlag) {
|
|
182
|
+
this.dispatchEvent(
|
|
183
|
+
new CustomEvent("sonic-action", {
|
|
184
|
+
detail: action,
|
|
185
|
+
bubbles: true,
|
|
186
|
+
composed: true,
|
|
187
|
+
}),
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
render() {
|
|
193
|
+
return html``;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export default SonicGamepad;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { dispatch, type SonicActionMessage } from "./registry";
|
|
4
|
+
|
|
5
|
+
const tagName = "sonic-gesture";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Zone tactile : tap, double-tap, swipe, long-press (+ drag optionnel).
|
|
9
|
+
*/
|
|
10
|
+
@customElement(tagName)
|
|
11
|
+
export class SonicGesture extends LitElement {
|
|
12
|
+
static styles = css`
|
|
13
|
+
:host {
|
|
14
|
+
display: block;
|
|
15
|
+
touch-action: none;
|
|
16
|
+
user-select: none;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
@property({ type: String })
|
|
21
|
+
target = "";
|
|
22
|
+
|
|
23
|
+
@property({ type: Number, attribute: "swipe-threshold" })
|
|
24
|
+
swipeThreshold = 40;
|
|
25
|
+
|
|
26
|
+
@property({ type: Number, attribute: "long-press-ms" })
|
|
27
|
+
longPressMs = 450;
|
|
28
|
+
|
|
29
|
+
@property({ type: Number, attribute: "double-tap-ms" })
|
|
30
|
+
doubleTapMs = 280;
|
|
31
|
+
|
|
32
|
+
@property({ type: Boolean })
|
|
33
|
+
drag = false;
|
|
34
|
+
|
|
35
|
+
@property({ type: Boolean, attribute: "dispatch-event" })
|
|
36
|
+
dispatchEventFlag = false;
|
|
37
|
+
|
|
38
|
+
private startX = 0;
|
|
39
|
+
private startY = 0;
|
|
40
|
+
private startT = 0;
|
|
41
|
+
private longTimer: number | null = null;
|
|
42
|
+
private lastTap = 0;
|
|
43
|
+
private pointerId: number | null = null;
|
|
44
|
+
|
|
45
|
+
private onDown = (e: PointerEvent) => {
|
|
46
|
+
if (this.pointerId != null) return;
|
|
47
|
+
this.pointerId = e.pointerId;
|
|
48
|
+
this.setPointerCapture(e.pointerId);
|
|
49
|
+
this.startX = e.clientX;
|
|
50
|
+
this.startY = e.clientY;
|
|
51
|
+
this.startT = performance.now();
|
|
52
|
+
this.longTimer = window.setTimeout(() => {
|
|
53
|
+
this.emit({ type: "long-press" });
|
|
54
|
+
this.longTimer = null;
|
|
55
|
+
}, this.longPressMs);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
private onMove = (e: PointerEvent) => {
|
|
59
|
+
if (this.pointerId !== e.pointerId) return;
|
|
60
|
+
const dx = e.clientX - this.startX;
|
|
61
|
+
const dy = e.clientY - this.startY;
|
|
62
|
+
if (Math.hypot(dx, dy) > 10 && this.longTimer != null) {
|
|
63
|
+
clearTimeout(this.longTimer);
|
|
64
|
+
this.longTimer = null;
|
|
65
|
+
}
|
|
66
|
+
if (this.drag) {
|
|
67
|
+
const rect = this.getBoundingClientRect();
|
|
68
|
+
this.emit({
|
|
69
|
+
type: "drag",
|
|
70
|
+
payload: {
|
|
71
|
+
dx: rect.width ? dx / rect.width : 0,
|
|
72
|
+
dy: rect.height ? dy / rect.height : 0,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
private onUp = (e: PointerEvent) => {
|
|
79
|
+
if (this.pointerId !== e.pointerId) return;
|
|
80
|
+
if (this.longTimer != null) {
|
|
81
|
+
clearTimeout(this.longTimer);
|
|
82
|
+
this.longTimer = null;
|
|
83
|
+
}
|
|
84
|
+
const dx = e.clientX - this.startX;
|
|
85
|
+
const dy = e.clientY - this.startY;
|
|
86
|
+
const dist = Math.hypot(dx, dy);
|
|
87
|
+
const dt = performance.now() - this.startT;
|
|
88
|
+
this.pointerId = null;
|
|
89
|
+
if (dist >= this.swipeThreshold) {
|
|
90
|
+
const type =
|
|
91
|
+
Math.abs(dx) > Math.abs(dy)
|
|
92
|
+
? dx > 0
|
|
93
|
+
? "swipe-right"
|
|
94
|
+
: "swipe-left"
|
|
95
|
+
: dy > 0
|
|
96
|
+
? "swipe-down"
|
|
97
|
+
: "swipe-up";
|
|
98
|
+
this.emit({ type });
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (dt < this.longPressMs) {
|
|
102
|
+
const now = performance.now();
|
|
103
|
+
if (now - this.lastTap < this.doubleTapMs) {
|
|
104
|
+
this.emit({ type: "double-tap" });
|
|
105
|
+
this.lastTap = 0;
|
|
106
|
+
} else {
|
|
107
|
+
this.emit({ type: "tap" });
|
|
108
|
+
this.lastTap = now;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
private emit(action: SonicActionMessage): void {
|
|
114
|
+
if (this.target) dispatch(this.target, action);
|
|
115
|
+
if (this.dispatchEventFlag) {
|
|
116
|
+
this.dispatchEvent(
|
|
117
|
+
new CustomEvent("sonic-action", {
|
|
118
|
+
detail: action,
|
|
119
|
+
bubbles: true,
|
|
120
|
+
composed: true,
|
|
121
|
+
}),
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
render() {
|
|
127
|
+
return html`<slot
|
|
128
|
+
@pointerdown=${this.onDown}
|
|
129
|
+
@pointermove=${this.onMove}
|
|
130
|
+
@pointerup=${this.onUp}
|
|
131
|
+
@pointercancel=${this.onUp}
|
|
132
|
+
></slot>`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export default SonicGesture;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
clamp,
|
|
4
|
+
matrix,
|
|
5
|
+
rand,
|
|
6
|
+
randInt,
|
|
7
|
+
range,
|
|
8
|
+
rotate,
|
|
9
|
+
immutableSet,
|
|
10
|
+
} from "./helpers";
|
|
11
|
+
|
|
12
|
+
describe("interactive helpers", () => {
|
|
13
|
+
it("rand is deterministic for a seed sequence", () => {
|
|
14
|
+
const a = rand(1);
|
|
15
|
+
const b = rand(a.seed);
|
|
16
|
+
const a2 = rand(1);
|
|
17
|
+
expect(a.value).toBeGreaterThanOrEqual(0);
|
|
18
|
+
expect(a.value).toBeLessThan(1);
|
|
19
|
+
expect(a2.value).toBe(a.value);
|
|
20
|
+
expect(b.seed).not.toBe(a.seed);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("randInt stays in range", () => {
|
|
24
|
+
let seed = 42;
|
|
25
|
+
for (let i = 0; i < 20; i++) {
|
|
26
|
+
const r = randInt(seed, 7);
|
|
27
|
+
expect(r.value).toBeGreaterThanOrEqual(0);
|
|
28
|
+
expect(r.value).toBeLessThan(7);
|
|
29
|
+
seed = r.seed;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("matrix / rotate / set / clamp / range", () => {
|
|
34
|
+
expect(matrix(2, 3, 1)).toEqual([
|
|
35
|
+
[1, 1],
|
|
36
|
+
[1, 1],
|
|
37
|
+
[1, 1],
|
|
38
|
+
]);
|
|
39
|
+
expect(rotate([
|
|
40
|
+
[1, 2],
|
|
41
|
+
[3, 4],
|
|
42
|
+
])).toEqual([
|
|
43
|
+
[3, 1],
|
|
44
|
+
[4, 2],
|
|
45
|
+
]);
|
|
46
|
+
expect(immutableSet({ a: { b: 1 } }, "a.b", 2)).toEqual({ a: { b: 2 } });
|
|
47
|
+
expect(clamp(5, 0, 3)).toBe(3);
|
|
48
|
+
expect(range(3)).toEqual([0, 1, 2]);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers JSONata purs pour sonic-store (PRNG, matrix, set immuable…).
|
|
3
|
+
* `$random` / `$now` volontairement absents — rejouabilité.
|
|
4
|
+
*/
|
|
5
|
+
import type { Expression } from "jsonata";
|
|
6
|
+
|
|
7
|
+
/** mulberry32 → { value: 0..1, seed } */
|
|
8
|
+
export function rand(seed: unknown): { value: number; seed: number } {
|
|
9
|
+
let t = (Number(seed) >>> 0) + 0x6d2b79f5;
|
|
10
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
11
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
12
|
+
const next = t >>> 0;
|
|
13
|
+
return { value: ((next ^ (next >>> 14)) >>> 0) / 4294967296, seed: next };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function randInt(seed: unknown, n: unknown): { value: number; seed: number } {
|
|
17
|
+
const r = rand(seed);
|
|
18
|
+
const max = Math.max(1, Math.floor(Number(n) || 1));
|
|
19
|
+
return { value: Math.floor(r.value * max), seed: r.seed };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function clamp(value: unknown, min: unknown, max: unknown): number {
|
|
23
|
+
const v = Number(value);
|
|
24
|
+
const a = Number(min);
|
|
25
|
+
const b = Number(max);
|
|
26
|
+
return Math.min(b, Math.max(a, v));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function range(n: unknown): number[] {
|
|
30
|
+
const len = Math.max(0, Math.min(10_000, Math.floor(Number(n) || 0)));
|
|
31
|
+
return Array.from({ length: len }, (_, i) => i);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Set immuable par chemin dot (`a.b.0.c`). */
|
|
35
|
+
export function immutableSet(
|
|
36
|
+
obj: unknown,
|
|
37
|
+
path: unknown,
|
|
38
|
+
value: unknown,
|
|
39
|
+
): unknown {
|
|
40
|
+
const parts = String(path ?? "")
|
|
41
|
+
.split(".")
|
|
42
|
+
.filter(Boolean);
|
|
43
|
+
if (!parts.length) return value;
|
|
44
|
+
const clone = (v: unknown): unknown => {
|
|
45
|
+
if (Array.isArray(v)) return v.slice();
|
|
46
|
+
if (v && typeof v === "object") return { ...(v as Record<string, unknown>) };
|
|
47
|
+
return v;
|
|
48
|
+
};
|
|
49
|
+
const root = clone(obj ?? {});
|
|
50
|
+
let cur: any = root;
|
|
51
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
52
|
+
const key = parts[i];
|
|
53
|
+
const next = cur[key];
|
|
54
|
+
cur[key] = clone(next ?? (/^\d+$/.test(parts[i + 1]) ? [] : {}));
|
|
55
|
+
cur = cur[key];
|
|
56
|
+
}
|
|
57
|
+
cur[parts[parts.length - 1]] = value;
|
|
58
|
+
return root;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function matrix(w: unknown, h: unknown, fill: unknown = 0): number[][] {
|
|
62
|
+
const width = Math.max(0, Math.min(256, Math.floor(Number(w) || 0)));
|
|
63
|
+
const height = Math.max(0, Math.min(256, Math.floor(Number(h) || 0)));
|
|
64
|
+
const f = Number(fill) || 0;
|
|
65
|
+
return Array.from({ length: height }, () =>
|
|
66
|
+
Array.from({ length: width }, () => f),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Rotation 90° horaire d’une matrice 2D. */
|
|
71
|
+
export function rotate(mat: unknown): number[][] {
|
|
72
|
+
if (!Array.isArray(mat) || !mat.length) return [];
|
|
73
|
+
const rows = mat as unknown[][];
|
|
74
|
+
const h = rows.length;
|
|
75
|
+
const w = Array.isArray(rows[0]) ? rows[0].length : 0;
|
|
76
|
+
const out: number[][] = Array.from({ length: w }, () =>
|
|
77
|
+
Array.from({ length: h }, () => 0),
|
|
78
|
+
);
|
|
79
|
+
for (let y = 0; y < h; y++) {
|
|
80
|
+
const row = rows[y];
|
|
81
|
+
if (!Array.isArray(row)) continue;
|
|
82
|
+
for (let x = 0; x < w; x++) {
|
|
83
|
+
out[x][h - 1 - y] = Number(row[x]) || 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function registerInteractiveHelpers(expression: Expression): void {
|
|
90
|
+
expression.registerFunction("rand", rand);
|
|
91
|
+
expression.registerFunction("randInt", randInt);
|
|
92
|
+
expression.registerFunction("clamp", clamp);
|
|
93
|
+
expression.registerFunction("range", range);
|
|
94
|
+
expression.registerFunction("set", immutableSet);
|
|
95
|
+
expression.registerFunction("matrix", matrix);
|
|
96
|
+
expression.registerFunction("rotate", rotate);
|
|
97
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Addon interactivity déclarative (stores, inputs, matrix).
|
|
3
|
+
* Opt-in : `@supersoniks/concorde/interactive`
|
|
4
|
+
*/
|
|
5
|
+
export {
|
|
6
|
+
dispatch,
|
|
7
|
+
getStore,
|
|
8
|
+
listStoreIds,
|
|
9
|
+
type SonicActionMessage,
|
|
10
|
+
} from "./registry";
|
|
11
|
+
export { SonicStore } from "./store";
|
|
12
|
+
export { SonicKeyboard } from "./keyboard";
|
|
13
|
+
export { SonicGamepad } from "./gamepad";
|
|
14
|
+
export { SonicGesture } from "./gesture";
|
|
15
|
+
export { SonicAction } from "./action";
|
|
16
|
+
export { SonicTicker } from "./ticker";
|
|
17
|
+
export { SonicMatrix } from "./matrix";
|
|
18
|
+
|
|
19
|
+
import "./store";
|
|
20
|
+
import "./keyboard";
|
|
21
|
+
import "./gamepad";
|
|
22
|
+
import "./gesture";
|
|
23
|
+
import "./action";
|
|
24
|
+
import "./ticker";
|
|
25
|
+
import "./matrix";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Interactive (SDUI)
|
|
2
|
+
|
|
3
|
+
Addon opt-in `@supersoniks/concorde/interactive` for **declarative** playable UIs under a strict CSP (no `eval`, no inline script, no `on*` handlers).
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
| Tag | Role |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `sonic-store` | State + JSONata reducer (`$state`, `$action`, `$env`) |
|
|
10
|
+
| `sonic-keyboard` | Keymap → actions |
|
|
11
|
+
| `sonic-gamepad` | Standard gamepad → actions |
|
|
12
|
+
| `sonic-gesture` | Tap / swipe / long-press |
|
|
13
|
+
| `sonic-action` | Click / hold-repeat → action |
|
|
14
|
+
| `sonic-ticker` | Clock `tick` with `dt` |
|
|
15
|
+
| `sonic-matrix` | 2D grid canvas from DataProvider |
|
|
16
|
+
|
|
17
|
+
Also: `sonic-if` accepts `dataProvider` + `key` + `equals`/`not`/`truthy`/`gt`/`lt` for SDUI. `sonic-value` accepts `format="00000"` or `format="intl:fr-FR"`.
|
|
18
|
+
|
|
19
|
+
## Reducer purity
|
|
20
|
+
|
|
21
|
+
Injected: `$rand`, `$randInt`, `$clamp`, `$range`, `$set`, `$matrix`, `$rotate`.
|
|
22
|
+
`$random` and `$now` throw — use `$rand(seed)` and `$action.t`.
|
|
23
|
+
|
|
24
|
+
## CDN
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<script src="concorde-core.bundle.js"></script>
|
|
28
|
+
<script src="concorde-interactive.bundle.js"></script>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Out of scope (this pass)
|
|
32
|
+
|
|
33
|
+
Declarative sound, multiplayer, persistence.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { dispatch, type SonicActionMessage } from "./registry";
|
|
4
|
+
|
|
5
|
+
const tagName = "sonic-keyboard";
|
|
6
|
+
|
|
7
|
+
type KeymapValue = string | { type: string; payload?: unknown };
|
|
8
|
+
type Keymap = Record<string, KeymapValue>;
|
|
9
|
+
type RepeatCfg = Record<string, [number, number]>;
|
|
10
|
+
type HeldKey = { type: string; payload?: unknown; timer?: number; interval?: number };
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Source d’actions clavier → store (`target`).
|
|
14
|
+
* Opt-in `@supersoniks/concorde/interactive`.
|
|
15
|
+
*/
|
|
16
|
+
@customElement(tagName)
|
|
17
|
+
export class SonicKeyboard extends LitElement {
|
|
18
|
+
static styles = css`
|
|
19
|
+
:host {
|
|
20
|
+
display: contents;
|
|
21
|
+
}
|
|
22
|
+
:host([scope="focus"]) {
|
|
23
|
+
display: block;
|
|
24
|
+
outline: none;
|
|
25
|
+
}
|
|
26
|
+
:host([scope="focus"]:focus) {
|
|
27
|
+
outline: 2px solid var(--sc-primary, #3b82f6);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
@property({ type: String })
|
|
33
|
+
target = "";
|
|
34
|
+
|
|
35
|
+
@property({ type: Object })
|
|
36
|
+
keymap: Keymap = {};
|
|
37
|
+
|
|
38
|
+
/** `document` | `focus` */
|
|
39
|
+
@property({ type: String })
|
|
40
|
+
scope: "document" | "focus" = "document";
|
|
41
|
+
|
|
42
|
+
/** `{ "left": [delayMs, intervalMs] }` */
|
|
43
|
+
@property({ type: Object })
|
|
44
|
+
repeat: RepeatCfg = {};
|
|
45
|
+
|
|
46
|
+
@property({ type: Boolean })
|
|
47
|
+
keyup = false;
|
|
48
|
+
|
|
49
|
+
@property({ type: Boolean, attribute: "dispatch-event" })
|
|
50
|
+
dispatchEventFlag = false;
|
|
51
|
+
|
|
52
|
+
private held = new Map<string, HeldKey>();
|
|
53
|
+
|
|
54
|
+
connectedCallback(): void {
|
|
55
|
+
super.connectedCallback();
|
|
56
|
+
if (this.scope === "focus") {
|
|
57
|
+
if (!this.hasAttribute("tabindex")) this.tabIndex = 0;
|
|
58
|
+
}
|
|
59
|
+
this.bindTarget().addEventListener("keydown", this.onKeyDown);
|
|
60
|
+
this.bindTarget().addEventListener("keyup", this.onKeyUp);
|
|
61
|
+
window.addEventListener("blur", this.releaseAll);
|
|
62
|
+
document.addEventListener("visibilitychange", this.onVis);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
disconnectedCallback(): void {
|
|
66
|
+
this.bindTarget().removeEventListener("keydown", this.onKeyDown);
|
|
67
|
+
this.bindTarget().removeEventListener("keyup", this.onKeyUp);
|
|
68
|
+
window.removeEventListener("blur", this.releaseAll);
|
|
69
|
+
document.removeEventListener("visibilitychange", this.onVis);
|
|
70
|
+
this.releaseAll();
|
|
71
|
+
super.disconnectedCallback();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
protected updated(changed: Map<string | number | symbol, unknown>): void {
|
|
75
|
+
if (changed.has("scope")) {
|
|
76
|
+
// rebind would need disconnect/connect; keep simple: focus ring attrs
|
|
77
|
+
if (this.scope === "focus" && !this.hasAttribute("tabindex")) this.tabIndex = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private bindTarget(): EventTarget {
|
|
82
|
+
return this.scope === "focus" ? this : window;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private onVis = () => {
|
|
86
|
+
if (document.hidden) this.releaseAll();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
private onKeyDown = (ev: Event) => {
|
|
90
|
+
const e = ev as KeyboardEvent;
|
|
91
|
+
if (e.repeat) return; // handled via our DAS/ARR
|
|
92
|
+
if (this.isEditableTarget(e.target)) return;
|
|
93
|
+
const code = e.code || e.key;
|
|
94
|
+
const mapped = this.keymap?.[code] ?? this.keymap?.[e.key];
|
|
95
|
+
if (!mapped) return;
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
const action = this.toAction(mapped);
|
|
98
|
+
this.emit(action);
|
|
99
|
+
const rep = this.repeat?.[action.type];
|
|
100
|
+
if (rep) {
|
|
101
|
+
const [delay, interval] = rep;
|
|
102
|
+
const entry: HeldKey = {
|
|
103
|
+
type: action.type,
|
|
104
|
+
payload: action.payload,
|
|
105
|
+
timer: window.setTimeout(() => {
|
|
106
|
+
this.emit({ type: action.type, payload: action.payload });
|
|
107
|
+
entry.interval = window.setInterval(() => {
|
|
108
|
+
this.emit({ type: action.type, payload: action.payload });
|
|
109
|
+
}, Math.max(16, interval));
|
|
110
|
+
}, Math.max(0, delay)),
|
|
111
|
+
};
|
|
112
|
+
this.held.set(code, entry);
|
|
113
|
+
} else {
|
|
114
|
+
this.held.set(code, { type: action.type, payload: action.payload });
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
private onKeyUp = (ev: Event) => {
|
|
119
|
+
const e = ev as KeyboardEvent;
|
|
120
|
+
const code = e.code || e.key;
|
|
121
|
+
const held = this.held.get(code);
|
|
122
|
+
if (held) {
|
|
123
|
+
if (held.timer) clearTimeout(held.timer);
|
|
124
|
+
if (held.interval) clearInterval(held.interval);
|
|
125
|
+
this.held.delete(code);
|
|
126
|
+
if (this.keyup) {
|
|
127
|
+
this.emit({ type: `${held.type}:up`, payload: held.payload });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
private releaseAll = () => {
|
|
133
|
+
for (const [, held] of this.held) {
|
|
134
|
+
if (held.timer) clearTimeout(held.timer);
|
|
135
|
+
if (held.interval) clearInterval(held.interval);
|
|
136
|
+
}
|
|
137
|
+
this.held.clear();
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
private isEditableTarget(t: EventTarget | null): boolean {
|
|
141
|
+
if (!(t instanceof HTMLElement)) return false;
|
|
142
|
+
const tag = t.tagName;
|
|
143
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
|
|
144
|
+
if (t.isContentEditable) return true;
|
|
145
|
+
return Boolean(t.closest("input,textarea,select,[contenteditable=true]"));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private toAction(mapped: KeymapValue): SonicActionMessage {
|
|
149
|
+
if (typeof mapped === "string") return { type: mapped };
|
|
150
|
+
return { type: mapped.type, payload: mapped.payload };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private emit(action: SonicActionMessage): void {
|
|
154
|
+
if (this.target) dispatch(this.target, action);
|
|
155
|
+
if (this.dispatchEventFlag) {
|
|
156
|
+
this.dispatchEvent(
|
|
157
|
+
new CustomEvent("sonic-action", {
|
|
158
|
+
detail: action,
|
|
159
|
+
bubbles: true,
|
|
160
|
+
composed: true,
|
|
161
|
+
}),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
render() {
|
|
167
|
+
return this.scope === "focus" ? html`<slot></slot>` : html``;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export default SonicKeyboard;
|