@supersoniks/concorde 4.9.98-visual-stack.1 → 4.9.98-visual-stack.3
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 +1 -1
- package/concorde-3d.es.js +2 -2
- 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 +1 -1
- package/concorde-shader.es.js +2 -2
- package/concorde-webgpu.bundle.js +1 -1
- package/concorde-webgpu.es.js +2 -2
- package/dist/concorde-3d.bundle.js +1 -1
- package/dist/concorde-3d.es.js +2 -2
- 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 +1 -1
- package/dist/concorde-shader.es.js +2 -2
- package/dist/concorde-webgpu.bundle.js +1 -1
- package/dist/concorde-webgpu.es.js +2 -2
- 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/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/value/value.js +49 -4
- package/dist/js/core/components/functional/value/value.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/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/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/value/value.d.ts +6 -0
- package/dist/types/core/components/functional/value/value.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/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 +182 -10
- 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/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 +270 -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/subscriber/subscriber.ts +0 -0
- package/src/core/components/functional/value/value.ts +44 -4
- 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 +5 -1
- 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/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/cdn-addons.md +1 -0
- 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/code.ts +3 -1
- package/src/docs/components/docs-demo-sources.ts +60 -0
- package/src/docs/docs.ts +1 -0
- 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 +8 -0
- package/src/docs/search/docs-search.json +956 -243
- package/src/docs/tailwind/css/tailwind.css +13 -6
- package/src/tsconfig.json +135 -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,171 @@
|
|
|
1
|
+
import { LitElement, css, html } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
import { get } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
4
|
+
import { dispatch, type SonicActionMessage } from "./registry";
|
|
5
|
+
|
|
6
|
+
const tagName = "sonic-ticker";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Horloge déclarative : émet `tick` avec `dt` vers un store.
|
|
10
|
+
*/
|
|
11
|
+
@customElement(tagName)
|
|
12
|
+
export class SonicTicker extends LitElement {
|
|
13
|
+
static styles = css`
|
|
14
|
+
:host {
|
|
15
|
+
display: contents;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
@property({ type: String })
|
|
20
|
+
target = "";
|
|
21
|
+
|
|
22
|
+
@property({ type: Number })
|
|
23
|
+
interval = 500;
|
|
24
|
+
|
|
25
|
+
/** Chemin dans le DP du store pour l’intervalle (ex. `speed`). */
|
|
26
|
+
@property({ type: String, attribute: "interval-key" })
|
|
27
|
+
intervalKey = "";
|
|
28
|
+
|
|
29
|
+
/** Chemin booléen pause (ex. `running`). */
|
|
30
|
+
@property({ type: String, attribute: "running-key" })
|
|
31
|
+
runningKey = "";
|
|
32
|
+
|
|
33
|
+
/** `interval` | `raf` */
|
|
34
|
+
@property({ type: String })
|
|
35
|
+
mode: "interval" | "raf" = "interval";
|
|
36
|
+
|
|
37
|
+
@property({ type: Boolean, attribute: "dispatch-event" })
|
|
38
|
+
dispatchEventFlag = false;
|
|
39
|
+
|
|
40
|
+
private timer: number | null = null;
|
|
41
|
+
private raf = 0;
|
|
42
|
+
private last = 0;
|
|
43
|
+
private acc = 0;
|
|
44
|
+
|
|
45
|
+
connectedCallback(): void {
|
|
46
|
+
super.connectedCallback();
|
|
47
|
+
document.addEventListener("visibilitychange", this.onVis);
|
|
48
|
+
this.restart();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
disconnectedCallback(): void {
|
|
52
|
+
document.removeEventListener("visibilitychange", this.onVis);
|
|
53
|
+
this.stop();
|
|
54
|
+
super.disconnectedCallback();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
protected updated(changed: Map<string | number | symbol, unknown>): void {
|
|
58
|
+
if (
|
|
59
|
+
changed.has("interval") ||
|
|
60
|
+
changed.has("mode") ||
|
|
61
|
+
changed.has("target") ||
|
|
62
|
+
changed.has("intervalKey") ||
|
|
63
|
+
changed.has("runningKey")
|
|
64
|
+
) {
|
|
65
|
+
this.restart();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private onVis = () => {
|
|
70
|
+
if (document.hidden) this.stop();
|
|
71
|
+
else this.restart();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
private stop(): void {
|
|
75
|
+
if (this.timer != null) {
|
|
76
|
+
clearInterval(this.timer);
|
|
77
|
+
this.timer = null;
|
|
78
|
+
}
|
|
79
|
+
if (this.raf) {
|
|
80
|
+
cancelAnimationFrame(this.raf);
|
|
81
|
+
this.raf = 0;
|
|
82
|
+
}
|
|
83
|
+
this.acc = 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private restart(): void {
|
|
87
|
+
this.stop();
|
|
88
|
+
if (!this.target || document.hidden) return;
|
|
89
|
+
this.last = performance.now();
|
|
90
|
+
if (this.mode === "raf") {
|
|
91
|
+
const loop = (now: number) => {
|
|
92
|
+
this.raf = requestAnimationFrame(loop);
|
|
93
|
+
if (!this.isRunning()) {
|
|
94
|
+
this.last = now;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const raw = Math.min(100, now - this.last);
|
|
98
|
+
this.last = now;
|
|
99
|
+
this.acc += raw;
|
|
100
|
+
const ms = this.currentInterval();
|
|
101
|
+
while (this.acc >= ms) {
|
|
102
|
+
this.acc -= ms;
|
|
103
|
+
this.emit(ms);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
this.raf = requestAnimationFrame(loop);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.timer = window.setInterval(() => {
|
|
110
|
+
if (!this.isRunning()) return;
|
|
111
|
+
const now = performance.now();
|
|
112
|
+
const dt = Math.min(1000, now - this.last);
|
|
113
|
+
this.last = now;
|
|
114
|
+
this.emit(dt);
|
|
115
|
+
}, this.currentInterval());
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private currentInterval(): number {
|
|
119
|
+
let ms = this.interval;
|
|
120
|
+
if (this.intervalKey && this.target) {
|
|
121
|
+
try {
|
|
122
|
+
const state = get(this.target) as Record<string, unknown> | undefined;
|
|
123
|
+
const v = this.path(state, this.intervalKey);
|
|
124
|
+
if (typeof v === "number" && Number.isFinite(v)) ms = v;
|
|
125
|
+
} catch {
|
|
126
|
+
/* keep */
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return Math.max(16, ms);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private isRunning(): boolean {
|
|
133
|
+
if (!this.runningKey || !this.target) return true;
|
|
134
|
+
try {
|
|
135
|
+
const state = get(this.target) as Record<string, unknown> | undefined;
|
|
136
|
+
return Boolean(this.path(state, this.runningKey));
|
|
137
|
+
} catch {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private path(obj: unknown, path: string): unknown {
|
|
143
|
+
if (!obj || typeof obj !== "object") return undefined;
|
|
144
|
+
let cur: any = obj;
|
|
145
|
+
for (const p of path.split(".").filter(Boolean)) {
|
|
146
|
+
if (cur == null) return undefined;
|
|
147
|
+
cur = cur[p];
|
|
148
|
+
}
|
|
149
|
+
return cur;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
private emit(dt: number): void {
|
|
153
|
+
const action: SonicActionMessage = { type: "tick", payload: { dt }, dt };
|
|
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 html``;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export default SonicTicker;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,18 +1,58 @@
|
|
|
1
1
|
import {LitElement, html} from "lit";
|
|
2
|
-
import {customElement} from "lit/decorators.js";
|
|
2
|
+
import {customElement, property} from "lit/decorators.js";
|
|
3
3
|
import {Subscriber} from "@supersoniks/concorde/mixins";
|
|
4
4
|
import {unsafeHTML} from "lit/directives/unsafe-html.js";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
const tagName = "sonic-value";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Affiche une valeur du DataProvider (`key`).
|
|
10
|
+
* `format="00000"` pad numérique, ou `format="intl:fr-FR"` / `format="intl:fr-FR:currency:EUR"`.
|
|
11
|
+
*/
|
|
6
12
|
@customElement(tagName)
|
|
7
13
|
export class SonicValue extends Subscriber(LitElement) {
|
|
14
|
+
@property({type: String}) format = "";
|
|
15
|
+
|
|
8
16
|
connectedCallback(): void {
|
|
9
17
|
this.setAttribute("subDataProvider", this.getAttribute("key"));
|
|
10
18
|
super.connectedCallback();
|
|
11
19
|
}
|
|
20
|
+
|
|
21
|
+
private formatted(): string {
|
|
22
|
+
const raw = this.props;
|
|
23
|
+
if (typeof raw === "object" || raw === undefined) return "";
|
|
24
|
+
const s = String(raw);
|
|
25
|
+
if (!this.format) return s;
|
|
26
|
+
if (this.format.startsWith("intl:")) {
|
|
27
|
+
const parts = this.format.slice(5).split(":");
|
|
28
|
+
const locale = parts[0] || "fr-FR";
|
|
29
|
+
const style = parts[1];
|
|
30
|
+
const currency = parts[2] || "EUR";
|
|
31
|
+
const n = Number(raw);
|
|
32
|
+
if (!Number.isFinite(n)) return s;
|
|
33
|
+
if (style === "currency") {
|
|
34
|
+
return new Intl.NumberFormat(locale, {style: "currency", currency}).format(n);
|
|
35
|
+
}
|
|
36
|
+
if (style === "percent") {
|
|
37
|
+
return new Intl.NumberFormat(locale, {style: "percent"}).format(n);
|
|
38
|
+
}
|
|
39
|
+
return new Intl.NumberFormat(locale).format(n);
|
|
40
|
+
}
|
|
41
|
+
// pad pattern like 00000
|
|
42
|
+
if (/^0+$/.test(this.format)) {
|
|
43
|
+
const n = Math.floor(Number(raw));
|
|
44
|
+
if (!Number.isFinite(n)) return s;
|
|
45
|
+
return String(n).padStart(this.format.length, "0");
|
|
46
|
+
}
|
|
47
|
+
return s;
|
|
48
|
+
}
|
|
49
|
+
|
|
12
50
|
render() {
|
|
13
|
-
if (typeof this.props === "object" || this.props === undefined)
|
|
51
|
+
if (typeof this.props === "object" || this.props === undefined) {
|
|
14
52
|
return html`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`;
|
|
15
|
-
|
|
53
|
+
}
|
|
54
|
+
const text = this.format ? this.formatted() : this.props.toString();
|
|
55
|
+
return html`${unsafeHTML(text)}<slot name="prefix"></slot><slot></slot
|
|
16
56
|
><slot name="suffix"></slot>`;
|
|
17
57
|
}
|
|
18
58
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export type Rounded = "" | "base" | "none" | "full" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
|
|
5
|
+
export const hostRounded = css`
|
|
6
|
+
:host {
|
|
7
|
+
--sc-_rounded: 0;
|
|
8
|
+
border-radius: var(--sc-_rounded);
|
|
9
|
+
}
|
|
10
|
+
:host([rounded]),
|
|
11
|
+
:host([rounded="base"]) {
|
|
12
|
+
--sc-_rounded: var(--sc-rounded);
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
}
|
|
15
|
+
:host([rounded="sm"]) {
|
|
16
|
+
--sc-_rounded: var(--sc-rounded-sm);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([rounded="md"]) {
|
|
20
|
+
--sc-_rounded: var(--sc-rounded-md);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host([rounded="lg"]) {
|
|
24
|
+
--sc-_rounded: var(--sc-rounded-lg);
|
|
25
|
+
}
|
|
26
|
+
:host([rounded="xl"]) {
|
|
27
|
+
--sc-_rounded: var(--sc-rounded-xl);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([rounded="full"]) {
|
|
31
|
+
--sc-_rounded: 50% !important;
|
|
32
|
+
}
|
|
33
|
+
:host([rounded="none"]) {
|
|
34
|
+
--sc-_rounded: 0 !important;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
|
|
3
|
+
/** Icônes pour les composants à `status` (API messages, alert, toast). */
|
|
4
|
+
export const statusIcon = {
|
|
5
|
+
default: "info-empty",
|
|
6
|
+
info: "info-empty",
|
|
7
|
+
success: "check-circled-outline",
|
|
8
|
+
warning: "warning-circled-outline",
|
|
9
|
+
error: "warning-circled-outline",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type StatusIconKey = keyof typeof statusIcon;
|
|
13
|
+
|
|
14
|
+
export function toStatus(value?: string): StatusIconKey | undefined {
|
|
15
|
+
if (!value) return undefined;
|
|
16
|
+
if (value === "danger") return "error";
|
|
17
|
+
return value in statusIcon ? (value as StatusIconKey) : undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function statusAriaRole(status?: StatusIconKey): "alert" | "status" {
|
|
21
|
+
return status === "error" ? "alert" : "status";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function statusAriaLive(status?: StatusIconKey): "polite" | null {
|
|
25
|
+
return status === "error" ? null : "polite";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const statusColor = css`
|
|
29
|
+
:host {
|
|
30
|
+
--sc-_color: var(--sc-base-content, #000);
|
|
31
|
+
color: var(--sc-_color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([status="warning"]) {
|
|
35
|
+
--sc-_color: var(--sc-warning, var(--sc-base-content, #000));
|
|
36
|
+
}
|
|
37
|
+
:host([status="error"]) {
|
|
38
|
+
--sc-_color: var(--sc-danger, var(--sc-base-content, #000));
|
|
39
|
+
}
|
|
40
|
+
:host([status="info"]) {
|
|
41
|
+
--sc-_color: var(--sc-info, var(--sc-base-content, #000));
|
|
42
|
+
}
|
|
43
|
+
:host([status="success"]) {
|
|
44
|
+
--sc-_color: var(--sc-success, var(--sc-base-content, #000));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.inherit-color {
|
|
48
|
+
color: var(--sc-_color);
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
|
|
3
52
|
export const typeColor = css`
|
|
4
53
|
:host {
|
|
5
54
|
--sc-_color: inherit;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import HTML from "@supersoniks/concorde/core/utils/HTML";
|
|
2
|
+
|
|
3
|
+
/** Langues supportées pour les libellés ARIA UI (anglais par défaut). */
|
|
4
|
+
export type UiLang = "en" | "fr" | "de" | "nl" | "es" | "it";
|
|
5
|
+
|
|
6
|
+
export type UiLabelDict = Partial<Record<UiLang, string>> & { en: string };
|
|
7
|
+
|
|
8
|
+
const supported = new Set<string>(["en", "fr", "de", "nl", "es", "it"]);
|
|
9
|
+
|
|
10
|
+
/** Lit la langue courante à chaque appel (pas d'état par composant). */
|
|
11
|
+
export function resolveUiLabel(dict: UiLabelDict, lang?: string): string {
|
|
12
|
+
const code = (lang ?? HTML.getLanguage() ?? "en").split("-")[0].toLowerCase();
|
|
13
|
+
if (supported.has(code) && dict[code as UiLang]) {
|
|
14
|
+
return dict[code as UiLang]!;
|
|
15
|
+
}
|
|
16
|
+
return dict.en;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const uiAriaLabels = {
|
|
20
|
+
closeWindow: {
|
|
21
|
+
en: "Close window",
|
|
22
|
+
fr: "Fermer la fenêtre",
|
|
23
|
+
de: "Fenster schließen",
|
|
24
|
+
nl: "Venster sluiten",
|
|
25
|
+
es: "Cerrar ventana",
|
|
26
|
+
it: "Chiudi finestra",
|
|
27
|
+
},
|
|
28
|
+
closeAlert: {
|
|
29
|
+
en: "Close",
|
|
30
|
+
fr: "Fermer",
|
|
31
|
+
de: "Schließen",
|
|
32
|
+
nl: "Sluiten",
|
|
33
|
+
es: "Cerrar",
|
|
34
|
+
it: "Chiudi",
|
|
35
|
+
},
|
|
36
|
+
showPassword: {
|
|
37
|
+
en: "Show password",
|
|
38
|
+
fr: "Afficher le mot de passe",
|
|
39
|
+
de: "Passwort anzeigen",
|
|
40
|
+
nl: "Wachtwoord tonen",
|
|
41
|
+
es: "Mostrar contraseña",
|
|
42
|
+
it: "Mostra password",
|
|
43
|
+
},
|
|
44
|
+
hidePassword: {
|
|
45
|
+
en: "Hide password",
|
|
46
|
+
fr: "Masquer le mot de passe",
|
|
47
|
+
de: "Passwort ausblenden",
|
|
48
|
+
nl: "Wachtwoord verbergen",
|
|
49
|
+
es: "Ocultar contraseña",
|
|
50
|
+
it: "Nascondi password",
|
|
51
|
+
},
|
|
52
|
+
closeToast: {
|
|
53
|
+
en: "Close notification",
|
|
54
|
+
fr: "Fermer la notification",
|
|
55
|
+
de: "Benachrichtigung schließen",
|
|
56
|
+
nl: "Melding sluiten",
|
|
57
|
+
es: "Cerrar notificación",
|
|
58
|
+
it: "Chiudi notifica",
|
|
59
|
+
},
|
|
60
|
+
closeToastError: {
|
|
61
|
+
en: "Close error message",
|
|
62
|
+
fr: "Fermer le message d'erreur",
|
|
63
|
+
de: "Fehlermeldung schließen",
|
|
64
|
+
nl: "Foutmelding sluiten",
|
|
65
|
+
es: "Cerrar mensaje de error",
|
|
66
|
+
it: "Chiudi messaggio di errore",
|
|
67
|
+
},
|
|
68
|
+
closeToastWarning: {
|
|
69
|
+
en: "Close warning",
|
|
70
|
+
fr: "Fermer l'avertissement",
|
|
71
|
+
de: "Warnung schließen",
|
|
72
|
+
nl: "Waarschuwing sluiten",
|
|
73
|
+
es: "Cerrar advertencia",
|
|
74
|
+
it: "Chiudi avviso",
|
|
75
|
+
},
|
|
76
|
+
closeToastSuccess: {
|
|
77
|
+
en: "Close success message",
|
|
78
|
+
fr: "Fermer le message de succès",
|
|
79
|
+
de: "Erfolgsmeldung schließen",
|
|
80
|
+
nl: "Succesmelding sluiten",
|
|
81
|
+
es: "Cerrar mensaje de éxito",
|
|
82
|
+
it: "Chiudi messaggio di successo",
|
|
83
|
+
},
|
|
84
|
+
closeToastInfo: {
|
|
85
|
+
en: "Close information message",
|
|
86
|
+
fr: "Fermer l'information",
|
|
87
|
+
de: "Information schließen",
|
|
88
|
+
nl: "Informatie sluiten",
|
|
89
|
+
es: "Cerrar información",
|
|
90
|
+
it: "Chiudi informazione",
|
|
91
|
+
},
|
|
92
|
+
} as const satisfies Record<string, UiLabelDict>;
|
|
93
|
+
|
|
94
|
+
const toastCloseByStatus: Record<string, UiLabelDict> = {
|
|
95
|
+
error: uiAriaLabels.closeToastError,
|
|
96
|
+
warning: uiAriaLabels.closeToastWarning,
|
|
97
|
+
success: uiAriaLabels.closeToastSuccess,
|
|
98
|
+
info: uiAriaLabels.closeToastInfo,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export function resolveToastCloseLabel(status?: string): string {
|
|
102
|
+
const dict = status ? toastCloseByStatus[status] : undefined;
|
|
103
|
+
return resolveUiLabel(dict ?? uiAriaLabels.closeToast);
|
|
104
|
+
}
|