@supersoniks/concorde 2.0.7 → 3.0.0
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/build-infos.json +1 -0
- package/index.html +44 -0
- package/notes de migration.md +21 -0
- package/package.json +23 -290
- package/scripts/prebuild.mjs +22 -0
- package/{components.js → src/components.ts} +5 -2
- package/src/concorde-loaded.ts +3 -0
- package/src/core/_types/types.ts +55 -0
- package/src/core/components/functional/date/date.md +290 -0
- package/src/core/components/functional/date/date.ts +206 -0
- package/src/core/components/functional/example/example.ts +11 -0
- package/src/core/components/functional/fetch/fetch.md +117 -0
- package/{core/components/functional/fetch/fetch.js → src/core/components/functional/fetch/fetch.ts} +33 -37
- package/src/core/components/functional/if/if.md +16 -0
- package/src/core/components/functional/if/if.test.ts +40 -0
- package/src/core/components/functional/if/if.ts +23 -0
- package/src/core/components/functional/list/list.md +194 -0
- package/src/core/components/functional/list/list.ts +236 -0
- package/src/core/components/functional/mix/mix.md +41 -0
- package/src/core/components/functional/mix/mix.ts +95 -0
- package/src/core/components/functional/queue/queue.md +87 -0
- package/src/core/components/functional/queue/queue.ts +279 -0
- package/src/core/components/functional/router/redirect.ts +44 -0
- package/src/core/components/functional/router/router.md +112 -0
- package/src/core/components/functional/router/router.ts +108 -0
- package/src/core/components/functional/sdui/SDUIDescriptorTransformer.ts +229 -0
- package/{core → src/core}/components/functional/sdui/default-library.json +13 -13
- package/src/core/components/functional/sdui/example.json +99 -0
- package/src/core/components/functional/sdui/sdui-utils.ts +62 -0
- package/src/core/components/functional/sdui/sdui.md +356 -0
- package/src/core/components/functional/sdui/sdui.ts +230 -0
- package/src/core/components/functional/sdui/types.ts +34 -0
- package/src/core/components/functional/sonic-scope/sonic-scope.ts +13 -0
- package/src/core/components/functional/states/states.md +87 -0
- package/src/core/components/functional/states/states.ts +121 -0
- package/src/core/components/functional/submit/submit.md +48 -0
- package/src/core/components/functional/submit/submit.ts +265 -0
- package/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/src/core/components/functional/subscriber/subscriber.ts +28 -0
- package/src/core/components/functional/value/value.md +35 -0
- package/src/core/components/functional/value/value.ts +18 -0
- package/{core/components/ui/_css/scroll.js → src/core/components/ui/_css/scroll.ts} +3 -2
- package/{core/components/ui/_css/size.js → src/core/components/ui/_css/size.ts} +5 -2
- package/{core/components/ui/_css/type.js → src/core/components/ui/_css/type.ts} +5 -3
- package/src/core/components/ui/alert/alert.md +121 -0
- package/src/core/components/ui/alert/alert.ts +177 -0
- package/src/core/components/ui/badge/badge.md +102 -0
- package/{core/components/ui/badge/badge.js → src/core/components/ui/badge/badge.ts} +36 -51
- package/src/core/components/ui/button/button.md +184 -0
- package/{core/components/ui/button/button.js → src/core/components/ui/button/button.ts} +258 -302
- package/src/core/components/ui/captcha/captcha.md +12 -0
- package/src/core/components/ui/captcha/captcha.ts +88 -0
- package/src/core/components/ui/card/card-footer.ts +19 -0
- package/src/core/components/ui/card/card-header-descripton.ts +24 -0
- package/{core/components/ui/card/card-header.js → src/core/components/ui/card/card-header.ts} +28 -38
- package/src/core/components/ui/card/card-main.ts +24 -0
- package/src/core/components/ui/card/card.md +96 -0
- package/{core/components/ui/card/card.js → src/core/components/ui/card/card.ts} +23 -34
- package/src/core/components/ui/divider/divider.md +35 -0
- package/{core/components/ui/divider/divider.js → src/core/components/ui/divider/divider.ts} +35 -65
- package/src/core/components/ui/form/checkbox/checkbox.md +96 -0
- package/{core/components/ui/form/checkbox/checkbox.js → src/core/components/ui/form/checkbox/checkbox.ts} +79 -98
- package/{core/components/ui/form/css/form-control.js → src/core/components/ui/form/css/form-control.ts} +9 -5
- package/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/src/core/components/ui/form/fieldset/fieldset.ts +96 -0
- package/src/core/components/ui/form/fieldset/legend-description.ts +23 -0
- package/src/core/components/ui/form/fieldset/legend.ts +90 -0
- package/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/src/core/components/ui/form/form-actions/form-actions.ts +32 -0
- package/src/core/components/ui/form/form-layout/form-layout.md +43 -0
- package/src/core/components/ui/form/form-layout/form-layout.ts +71 -0
- package/src/core/components/ui/form/input/input.md +168 -0
- package/src/core/components/ui/form/input/input.ts +227 -0
- package/src/core/components/ui/form/input/password-helper.ts +68 -0
- package/src/core/components/ui/form/input/same-value-helper.ts +48 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +285 -0
- package/src/core/components/ui/form/radio/radio.md +86 -0
- package/src/core/components/ui/form/radio/radio.ts +44 -0
- package/src/core/components/ui/form/select/select.md +99 -0
- package/src/core/components/ui/form/select/select.ts +310 -0
- package/src/core/components/ui/form/textarea/textarea.md +66 -0
- package/src/core/components/ui/form/textarea/textarea.ts +119 -0
- package/src/core/components/ui/group/group.md +75 -0
- package/src/core/components/ui/group/group.ts +101 -0
- package/src/core/components/ui/icon/icon.md +125 -0
- package/src/core/components/ui/icon/icon.stories.ts +100 -0
- package/src/core/components/ui/icon/icon.ts +106 -0
- package/src/core/components/ui/icon/icons.json +1 -0
- package/src/core/components/ui/icon/icons.ts +130 -0
- package/src/core/components/ui/icon/svgs/cancel.svg +3 -0
- package/src/core/components/ui/icon/svgs/check-circled-outline.svg +4 -0
- package/src/core/components/ui/icon/svgs/check.svg +3 -0
- package/src/core/components/ui/icon/svgs/emoji-puzzled.svg +1 -0
- package/src/core/components/ui/icon/svgs/info-empty.svg +5 -0
- package/src/core/components/ui/icon/svgs/loader.svg +1 -0
- package/src/core/components/ui/icon/svgs/minus-small.svg +3 -0
- package/src/core/components/ui/icon/svgs/more-horiz.svg +5 -0
- package/src/core/components/ui/icon/svgs/more-vert.svg +5 -0
- package/src/core/components/ui/icon/svgs/nav-arrow-down.svg +3 -0
- package/src/core/components/ui/icon/svgs/warning-circled-outline.svg +5 -0
- package/src/core/components/ui/image/image.md +107 -0
- package/src/core/components/ui/image/image.ts +117 -0
- package/src/core/components/ui/link/link.md +43 -0
- package/src/core/components/ui/link/link.ts +108 -0
- package/src/core/components/ui/loader/loader.md +37 -0
- package/src/core/components/ui/loader/loader.stories.ts +25 -0
- package/src/core/components/ui/loader/loader.ts +81 -0
- package/{core/components/ui/loader/styles/fixed.js → src/core/components/ui/loader/styles/fixed.ts} +2 -1
- package/{core/components/ui/loader/styles/inline.js → src/core/components/ui/loader/styles/inline.ts} +3 -2
- package/src/core/components/ui/menu/menu-item.ts +30 -0
- package/src/core/components/ui/menu/menu.md +288 -0
- package/src/core/components/ui/menu/menu.ts +292 -0
- package/src/core/components/ui/modal/modal-actions.ts +35 -0
- package/src/core/components/ui/modal/modal-close.ts +36 -0
- package/src/core/components/ui/modal/modal-content.ts +19 -0
- package/src/core/components/ui/modal/modal-subtitle.ts +23 -0
- package/src/core/components/ui/modal/modal-title.ts +22 -0
- package/src/core/components/ui/modal/modal.md +123 -0
- package/src/core/components/ui/modal/modal.stories.ts +140 -0
- package/src/core/components/ui/modal/modal.ts +386 -0
- package/src/core/components/ui/pop/pop.md +79 -0
- package/src/core/components/ui/pop/pop.ts +291 -0
- package/src/core/components/ui/progress/progress.md +65 -0
- package/{core/components/ui/progress/progress.js → src/core/components/ui/progress/progress.ts} +31 -50
- package/src/core/components/ui/table/table-caption.ts +21 -0
- package/src/core/components/ui/table/table-tbody.ts +32 -0
- package/src/core/components/ui/table/table-td.ts +47 -0
- package/src/core/components/ui/table/table-tfoot.ts +20 -0
- package/src/core/components/ui/table/table-th.ts +56 -0
- package/src/core/components/ui/table/table-thead.ts +18 -0
- package/src/core/components/ui/table/table-tr.ts +48 -0
- package/src/core/components/ui/table/table.md +467 -0
- package/{core/components/ui/table/table.js → src/core/components/ui/table/table.ts} +32 -53
- package/{core/components/ui/theme/theme-collection/core-variables.js → src/core/components/ui/theme/theme-collection/core-variables.ts} +3 -2
- package/{core/components/ui/theme/theme-collection/dark.js → src/core/components/ui/theme/theme-collection/dark.ts} +5 -3
- package/{core/components/ui/theme/theme-collection/light.js → src/core/components/ui/theme/theme-collection/light.ts} +3 -2
- package/src/core/components/ui/theme/theme.ts +118 -0
- package/src/core/components/ui/toast/message-subscriber.stories.ts +43 -0
- package/src/core/components/ui/toast/message-subscriber.ts +37 -0
- package/{core/components/ui/toast/toast-item.js → src/core/components/ui/toast/toast-item.ts} +86 -113
- package/src/core/components/ui/toast/toast.ts +237 -0
- package/src/core/components/ui/toast/types.ts +14 -0
- package/src/core/components/ui/tooltip/tooltip.md +37 -0
- package/{core/components/ui/tooltip/tooltip.js → src/core/components/ui/tooltip/tooltip.ts} +26 -47
- package/{core/components/ui/ui.js → src/core/components/ui/ui.ts} +2 -0
- package/src/core/core.ts +22 -0
- package/src/core/decorators/Subscriber.ts +187 -0
- package/src/core/directives/DataProvider.ts +113 -0
- package/src/core/directives/Wording.ts +220 -0
- package/src/core/mixins/Fetcher.ts +258 -0
- package/src/core/mixins/FormCheckable.ts +287 -0
- package/src/core/mixins/FormElement.ts +275 -0
- package/src/core/mixins/FormInput.ts +135 -0
- package/src/core/mixins/Subscriber.ts +352 -0
- package/src/core/mixins/TemplatesContainer.ts +70 -0
- package/{core/mixins/mixins.d.ts → src/core/mixins/mixins.ts} +1 -1
- package/src/core/utils/Arrays.ts +161 -0
- package/src/core/utils/DataBindObserver.ts +286 -0
- package/src/core/utils/Electron.ts +15 -0
- package/src/core/utils/Format.ts +58 -0
- package/src/core/utils/HTML.ts +126 -0
- package/src/core/utils/LocationHandler.ts +139 -0
- package/src/core/utils/Objects.ts +103 -0
- package/src/core/utils/PublisherProxy.ts +786 -0
- package/src/core/utils/Utils.ts +12 -0
- package/src/core/utils/api.ts +456 -0
- package/{core/utils/url-pattern.d.ts → src/core/utils/url-pattern.ts} +1 -0
- package/{decorators.js → src/decorators.ts} +6 -2
- package/{directives.js → src/directives.ts} +11 -6
- package/src/docs/_core-concept/overview.md +57 -0
- package/src/docs/_core-concept/subscriber.md +76 -0
- package/src/docs/_getting-started/concorde-outside.md +141 -0
- package/src/docs/_getting-started/create-a-component.md +137 -0
- package/src/docs/_getting-started/pubsub.md +150 -0
- package/src/docs/_getting-started/start.md +37 -0
- package/src/docs/_getting-started/theming.md +91 -0
- package/src/docs/code.ts +281 -0
- package/src/docs/docs.ts +6 -0
- package/src/docs/example/users.ts +64 -0
- package/src/docs/navigation/navigation.ts +101 -0
- package/src/docs/prism/index.ts +6 -0
- package/src/docs/prism/prism.css +158 -0
- package/src/docs/prism/prism.js +1022 -0
- package/src/docs/search/docs-search.json +3767 -0
- package/src/docs/search/markdown-renderer.ts +40 -0
- package/src/docs/search/page.ts +40 -0
- package/src/docs/search/search.ts +184 -0
- package/src/docs.ts +2 -0
- package/src/index.ts +7 -0
- package/{mixins.js → src/mixins.ts} +10 -6
- package/src/tag-list.json +1 -0
- package/src/test-utils/TestUtils.ts +13 -0
- package/src/tsconfig.json +113 -0
- package/{utils.js → src/utils.ts} +15 -11
- package/test-utils/TestUtils.ts +13 -0
- package/vite/config.js +136 -0
- package/vite.config.mts +87 -0
- package/README.md +0 -27
- package/cli.js +0 -75
- package/components.d.ts +0 -4
- package/concorde-core.bundle.js +0 -3427
- package/concorde-core.es.js +0 -14372
- package/core/_types/types.d.ts +0 -28
- package/core/_types/types.js +0 -2
- package/core/components/functional/date/date.d.ts +0 -45
- package/core/components/functional/date/date.js +0 -243
- package/core/components/functional/example/example.d.ts +0 -7
- package/core/components/functional/example/example.js +0 -26
- package/core/components/functional/fetch/fetch.d.ts +0 -93
- package/core/components/functional/functional.js +0 -15
- package/core/components/functional/if/if.d.ts +0 -12
- package/core/components/functional/if/if.js +0 -38
- package/core/components/functional/if/if.test.d.ts +0 -1
- package/core/components/functional/if/if.test.js +0 -35
- package/core/components/functional/list/list.d.ts +0 -117
- package/core/components/functional/list/list.js +0 -214
- package/core/components/functional/mix/mix.d.ts +0 -22
- package/core/components/functional/mix/mix.js +0 -102
- package/core/components/functional/queue/queue.d.ts +0 -67
- package/core/components/functional/queue/queue.js +0 -310
- package/core/components/functional/router/redirect.d.ts +0 -18
- package/core/components/functional/router/redirect.js +0 -53
- package/core/components/functional/router/router.d.ts +0 -27
- package/core/components/functional/router/router.js +0 -119
- package/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -58
- package/core/components/functional/sdui/SDUIDescriptorTransformer.js +0 -215
- package/core/components/functional/sdui/sdui-utils.d.ts +0 -5
- package/core/components/functional/sdui/sdui-utils.js +0 -63
- package/core/components/functional/sdui/sdui.d.ts +0 -136
- package/core/components/functional/sdui/sdui.js +0 -254
- package/core/components/functional/sdui/types.d.ts +0 -37
- package/core/components/functional/sdui/types.js +0 -1
- package/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -5
- package/core/components/functional/sonic-scope/sonic-scope.js +0 -21
- package/core/components/functional/states/states.d.ts +0 -29
- package/core/components/functional/states/states.js +0 -134
- package/core/components/functional/submit/submit.d.ts +0 -30
- package/core/components/functional/submit/submit.js +0 -236
- package/core/components/functional/subscriber/subscriber.d.ts +0 -12
- package/core/components/functional/subscriber/subscriber.js +0 -38
- package/core/components/functional/value/value.d.ts +0 -7
- package/core/components/functional/value/value.js +0 -27
- package/core/components/ui/_css/scroll.d.ts +0 -1
- package/core/components/ui/_css/size.d.ts +0 -2
- package/core/components/ui/_css/type.d.ts +0 -2
- package/core/components/ui/alert/alert.d.ts +0 -34
- package/core/components/ui/alert/alert.js +0 -202
- package/core/components/ui/badge/badge.d.ts +0 -26
- package/core/components/ui/button/button.d.ts +0 -171
- package/core/components/ui/captcha/captcha.d.ts +0 -30
- package/core/components/ui/captcha/captcha.js +0 -93
- package/core/components/ui/card/card-footer.d.ts +0 -4
- package/core/components/ui/card/card-footer.js +0 -24
- package/core/components/ui/card/card-header-descripton.d.ts +0 -5
- package/core/components/ui/card/card-header-descripton.js +0 -32
- package/core/components/ui/card/card-header.d.ts +0 -8
- package/core/components/ui/card/card-main.d.ts +0 -4
- package/core/components/ui/card/card-main.js +0 -28
- package/core/components/ui/card/card.d.ts +0 -12
- package/core/components/ui/divider/divider.d.ts +0 -15
- package/core/components/ui/form/checkbox/checkbox.d.ts +0 -181
- package/core/components/ui/form/css/form-control.d.ts +0 -4
- package/core/components/ui/form/fieldset/fieldset.d.ts +0 -23
- package/core/components/ui/form/fieldset/fieldset.js +0 -118
- package/core/components/ui/form/fieldset/legend-description.d.ts +0 -5
- package/core/components/ui/form/fieldset/legend-description.js +0 -30
- package/core/components/ui/form/fieldset/legend.d.ts +0 -16
- package/core/components/ui/form/fieldset/legend.js +0 -112
- package/core/components/ui/form/form-actions/form-actions.d.ts +0 -7
- package/core/components/ui/form/form-actions/form-actions.js +0 -46
- package/core/components/ui/form/form-layout/form-layout.d.ts +0 -12
- package/core/components/ui/form/form-layout/form-layout.js +0 -83
- package/core/components/ui/form/input/input.d.ts +0 -106
- package/core/components/ui/form/input/input.js +0 -268
- package/core/components/ui/form/input/password-helper.d.ts +0 -25
- package/core/components/ui/form/input/password-helper.js +0 -119
- package/core/components/ui/form/input/same-value-helper.d.ts +0 -16
- package/core/components/ui/form/input/same-value-helper.js +0 -77
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +0 -136
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +0 -296
- package/core/components/ui/form/radio/radio.d.ts +0 -12
- package/core/components/ui/form/radio/radio.js +0 -50
- package/core/components/ui/form/select/select.d.ts +0 -58
- package/core/components/ui/form/select/select.js +0 -298
- package/core/components/ui/form/textarea/textarea.d.ts +0 -84
- package/core/components/ui/form/textarea/textarea.js +0 -150
- package/core/components/ui/group/group.d.ts +0 -16
- package/core/components/ui/group/group.js +0 -118
- package/core/components/ui/icon/icon.d.ts +0 -26
- package/core/components/ui/icon/icon.js +0 -113
- package/core/components/ui/icon/icons.d.ts +0 -10
- package/core/components/ui/icon/icons.js +0 -126
- package/core/components/ui/icon/icons.json +0 -1
- package/core/components/ui/image/image.d.ts +0 -15
- package/core/components/ui/image/image.js +0 -153
- package/core/components/ui/link/link.d.ts +0 -29
- package/core/components/ui/link/link.js +0 -124
- package/core/components/ui/loader/loader.d.ts +0 -23
- package/core/components/ui/loader/loader.js +0 -97
- package/core/components/ui/loader/styles/fixed.d.ts +0 -1
- package/core/components/ui/loader/styles/inline.d.ts +0 -1
- package/core/components/ui/menu/menu-item.d.ts +0 -5
- package/core/components/ui/menu/menu-item.js +0 -34
- package/core/components/ui/menu/menu.d.ts +0 -41
- package/core/components/ui/menu/menu.js +0 -313
- package/core/components/ui/modal/modal-actions.d.ts +0 -7
- package/core/components/ui/modal/modal-actions.js +0 -42
- package/core/components/ui/modal/modal-close.d.ts +0 -7
- package/core/components/ui/modal/modal-close.js +0 -43
- package/core/components/ui/modal/modal-content.d.ts +0 -5
- package/core/components/ui/modal/modal-content.js +0 -26
- package/core/components/ui/modal/modal-subtitle.d.ts +0 -5
- package/core/components/ui/modal/modal-subtitle.js +0 -30
- package/core/components/ui/modal/modal-title.d.ts +0 -5
- package/core/components/ui/modal/modal-title.js +0 -29
- package/core/components/ui/modal/modal.d.ts +0 -58
- package/core/components/ui/modal/modal.js +0 -401
- package/core/components/ui/pop/pop.d.ts +0 -37
- package/core/components/ui/pop/pop.js +0 -299
- package/core/components/ui/progress/progress.d.ts +0 -10
- package/core/components/ui/table/table-caption.d.ts +0 -5
- package/core/components/ui/table/table-caption.js +0 -28
- package/core/components/ui/table/table-tbody.d.ts +0 -5
- package/core/components/ui/table/table-tbody.js +0 -39
- package/core/components/ui/table/table-td.d.ts +0 -12
- package/core/components/ui/table/table-td.js +0 -68
- package/core/components/ui/table/table-tfoot.d.ts +0 -5
- package/core/components/ui/table/table-tfoot.js +0 -27
- package/core/components/ui/table/table-th.d.ts +0 -11
- package/core/components/ui/table/table-th.js +0 -73
- package/core/components/ui/table/table-thead.d.ts +0 -5
- package/core/components/ui/table/table-thead.js +0 -25
- package/core/components/ui/table/table-tr.d.ts +0 -13
- package/core/components/ui/table/table-tr.js +0 -66
- package/core/components/ui/table/table.d.ts +0 -17
- package/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -1
- package/core/components/ui/theme/theme-collection/dark.d.ts +0 -1
- package/core/components/ui/theme/theme-collection/light.d.ts +0 -1
- package/core/components/ui/theme/theme.d.ts +0 -19
- package/core/components/ui/theme/theme.js +0 -124
- package/core/components/ui/toast/message-subscriber.d.ts +0 -18
- package/core/components/ui/toast/message-subscriber.js +0 -40
- package/core/components/ui/toast/toast-item.d.ts +0 -19
- package/core/components/ui/toast/toast.d.ts +0 -25
- package/core/components/ui/toast/toast.js +0 -226
- package/core/components/ui/toast/types.d.ts +0 -11
- package/core/components/ui/toast/types.js +0 -1
- package/core/components/ui/tooltip/tooltip.d.ts +0 -10
- package/core/components/ui/ui.d.ts +0 -32
- package/core/core.d.ts +0 -4
- package/core/core.js +0 -19
- package/core/decorators/Subscriber.d.ts +0 -4
- package/core/decorators/Subscriber.js +0 -166
- package/core/directives/DataProvider.d.ts +0 -23
- package/core/directives/DataProvider.js +0 -102
- package/core/directives/Wording.d.ts +0 -42
- package/core/directives/Wording.js +0 -202
- package/core/mixins/Fetcher.d.ts +0 -90
- package/core/mixins/Fetcher.js +0 -242
- package/core/mixins/FormCheckable.d.ts +0 -88
- package/core/mixins/FormCheckable.js +0 -306
- package/core/mixins/FormElement.d.ts +0 -32
- package/core/mixins/FormElement.js +0 -272
- package/core/mixins/FormInput.d.ts +0 -70
- package/core/mixins/FormInput.js +0 -81
- package/core/mixins/Subscriber.d.ts +0 -36
- package/core/mixins/Subscriber.js +0 -333
- package/core/mixins/TemplatesContainer.d.ts +0 -13
- package/core/mixins/TemplatesContainer.js +0 -69
- package/core/mixins/mixins.js +0 -6
- package/core/utils/Arrays.d.ts +0 -97
- package/core/utils/Arrays.js +0 -140
- package/core/utils/DataBindObserver.d.ts +0 -83
- package/core/utils/DataBindObserver.js +0 -264
- package/core/utils/Electron.d.ts +0 -7
- package/core/utils/Electron.js +0 -11
- package/core/utils/Format.d.ts +0 -12
- package/core/utils/Format.js +0 -38
- package/core/utils/HTML.d.ts +0 -42
- package/core/utils/HTML.js +0 -119
- package/core/utils/LocationHandler.d.ts +0 -46
- package/core/utils/LocationHandler.js +0 -133
- package/core/utils/Objects.d.ts +0 -28
- package/core/utils/Objects.js +0 -102
- package/core/utils/PublisherProxy.d.ts +0 -176
- package/core/utils/PublisherProxy.js +0 -709
- package/core/utils/Utils.d.ts +0 -4
- package/core/utils/Utils.js +0 -12
- package/core/utils/api.d.ts +0 -139
- package/core/utils/api.js +0 -391
- package/core/utils/url-pattern.js +0 -2
- package/decorators.d.ts +0 -3
- package/directives.d.ts +0 -40
- package/img/concorde-logo.svg +0 -1
- package/img/concorde.png +0 -0
- package/img/concorde_def.png +0 -0
- package/mixins.d.ts +0 -181
- package/svg/regular/plane.svg +0 -1
- package/svg/solid/plane.svg +0 -1
- package/test-utils/TestUtils.d.ts +0 -4
- package/test-utils/TestUtils.js +0 -12
- package/utils.d.ts +0 -20
- /package/{core/components/functional/functional.d.ts → src/core/components/functional/functional.ts} +0 -0
- /package/{core → src/core}/components/ui/theme/css/tailwind.css +0 -0
- /package/{core → src/core}/components/ui/theme/css/tailwind.d.ts +0 -0
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { Objects } from "@supersoniks/concorde/utils";
|
|
2
|
-
import { PublisherManager } from "../utils/PublisherProxy";
|
|
3
|
-
function onConnected(callback) {
|
|
4
|
-
if (!this.__connectedCallbackCalls__)
|
|
5
|
-
this.__connectedCallbackCalls__ = new Set();
|
|
6
|
-
this.__connectedCallbackCalls__.add(callback);
|
|
7
|
-
}
|
|
8
|
-
function __onDisconnected__(callback) {
|
|
9
|
-
if (!this.__disconnectedCallbackCalls__)
|
|
10
|
-
this.__disconnectedCallbackCalls__ = new Set();
|
|
11
|
-
this.__disconnectedCallbackCalls__.add(callback);
|
|
12
|
-
}
|
|
13
|
-
function setSubscribable(target) {
|
|
14
|
-
if (target.__is__setSubscribable__)
|
|
15
|
-
return;
|
|
16
|
-
target.__is__setSubscribable__ = true;
|
|
17
|
-
target.__onConnected__ = onConnected;
|
|
18
|
-
target.__onDisconnected__ = __onDisconnected__;
|
|
19
|
-
// target.offConnected = onConnected;
|
|
20
|
-
// target.offDisconnected = __onDisconnected__;
|
|
21
|
-
const originalConnectedCallback = target.connectedCallback;
|
|
22
|
-
target.connectedCallback = function () {
|
|
23
|
-
originalConnectedCallback.call(this);
|
|
24
|
-
if (this.__connectedCallbackCalls__) {
|
|
25
|
-
this.__connectedCallbackCalls__.forEach((callback) => callback(this));
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const originalDisconnectedCallback = target.disconnectedCallback;
|
|
29
|
-
target.disconnectedCallback = function () {
|
|
30
|
-
originalDisconnectedCallback.call(this);
|
|
31
|
-
if (this.__disconnectedCallbackCalls__) {
|
|
32
|
-
this.__disconnectedCallbackCalls__.forEach((callback) => callback(this));
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function bind(path) {
|
|
37
|
-
const split = path.split(".");
|
|
38
|
-
if (split.length == 0) {
|
|
39
|
-
return function () {
|
|
40
|
-
//Empty def function
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const dataProvider = split.shift() || "";
|
|
44
|
-
let publisher = PublisherManager.get(dataProvider);
|
|
45
|
-
publisher = Objects.traverse(publisher, split);
|
|
46
|
-
return function (target, propertyKey) {
|
|
47
|
-
if (!target)
|
|
48
|
-
return;
|
|
49
|
-
let onAssign;
|
|
50
|
-
setSubscribable(target);
|
|
51
|
-
target.__onConnected__((component) => {
|
|
52
|
-
onAssign = (value) => {
|
|
53
|
-
component[propertyKey] = value;
|
|
54
|
-
};
|
|
55
|
-
publisher.onAssign(onAssign);
|
|
56
|
-
});
|
|
57
|
-
target.__onDisconnected__(() => {
|
|
58
|
-
publisher.offAssign(onAssign);
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export function onAssign(...values) {
|
|
63
|
-
const onAssignValues = [];
|
|
64
|
-
const confs = [];
|
|
65
|
-
for (let i = 0; i < values.length; i++) {
|
|
66
|
-
const value = values[i];
|
|
67
|
-
const split = value.split(".");
|
|
68
|
-
if (split.length == 0) {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
const dataProvider = split.shift() || "";
|
|
72
|
-
let publisher = PublisherManager.get(dataProvider);
|
|
73
|
-
publisher = Objects.traverse(publisher, split);
|
|
74
|
-
const callbacks = new Set();
|
|
75
|
-
const onAssign = (value) => {
|
|
76
|
-
onAssignValues[i] = value;
|
|
77
|
-
if (onAssignValues.filter((v) => v !== null).length == values.length)
|
|
78
|
-
callbacks.forEach((callback) => callback(...onAssignValues));
|
|
79
|
-
};
|
|
80
|
-
confs.push({ publisher, onAssign, callbacks });
|
|
81
|
-
}
|
|
82
|
-
return function (target, _propertyKey, descriptor) {
|
|
83
|
-
setSubscribable(target);
|
|
84
|
-
let callback;
|
|
85
|
-
target.__onConnected__((component) => {
|
|
86
|
-
for (const conf of confs) {
|
|
87
|
-
callback = descriptor.value.bind(component);
|
|
88
|
-
conf.callbacks.add(callback);
|
|
89
|
-
conf.publisher.onAssign(conf.onAssign);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
target.__onDisconnected__(() => {
|
|
93
|
-
for (const conf of confs) {
|
|
94
|
-
conf.callbacks.delete(callback);
|
|
95
|
-
conf.publisher.offAssign(conf.onAssign);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
export function autoSubscribe() {
|
|
101
|
-
return function (target, propertyKey, descriptor) {
|
|
102
|
-
let renderId = 0;
|
|
103
|
-
const originalMethod = descriptor.value;
|
|
104
|
-
const originalDC = target.constructor.prototype.disconnectedCallback;
|
|
105
|
-
target.constructor.prototype.disconnectedCallback = function () {
|
|
106
|
-
originalDC.apply(this);
|
|
107
|
-
this.__removeAutoSubscribe__();
|
|
108
|
-
};
|
|
109
|
-
const originalConnectedCallback = target.connectedCallback;
|
|
110
|
-
target.connectedCallback = function () {
|
|
111
|
-
originalConnectedCallback?.call(this);
|
|
112
|
-
this[propertyKey]();
|
|
113
|
-
};
|
|
114
|
-
descriptor.value = function (...args) {
|
|
115
|
-
let publishers = new Set();
|
|
116
|
-
const onAssign = () => {
|
|
117
|
-
renderId++;
|
|
118
|
-
const id = renderId;
|
|
119
|
-
window.queueMicrotask(() => {
|
|
120
|
-
if (id !== renderId)
|
|
121
|
-
return;
|
|
122
|
-
this[propertyKey]();
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
//on désabone les publishers du rendu précédant
|
|
126
|
-
publishers.forEach((publisher) => {
|
|
127
|
-
publisher.offAssign(onAssign);
|
|
128
|
-
});
|
|
129
|
-
//on collecte les publisher modifiés pour s'abonner pour la prochaine modification
|
|
130
|
-
PublisherManager.collectModifiedPublisher();
|
|
131
|
-
const result = originalMethod.apply(this, args);
|
|
132
|
-
publishers = PublisherManager.getModifiedPublishers() || new Set();
|
|
133
|
-
publishers.forEach((publisher) => {
|
|
134
|
-
publisher.onAssign(onAssign, false);
|
|
135
|
-
});
|
|
136
|
-
this.__removeAutoSubscribe__ = () => {
|
|
137
|
-
publishers.forEach((publisher) => {
|
|
138
|
-
publisher.offAssign(onAssign);
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
return result;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
export function autoFill(values) {
|
|
146
|
-
return function (target) {
|
|
147
|
-
setSubscribable(target);
|
|
148
|
-
for (const value of values) {
|
|
149
|
-
const split = value.split(".");
|
|
150
|
-
if (split.length == 0) {
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
const dataProvider = split.shift() || "";
|
|
154
|
-
let publisher = PublisherManager.get(dataProvider);
|
|
155
|
-
publisher = Objects.traverse(publisher, split);
|
|
156
|
-
target.__onConnected__((component) => {
|
|
157
|
-
publisher.startTemplateFilling(component);
|
|
158
|
-
});
|
|
159
|
-
target.__onDisconnected__(() => {
|
|
160
|
-
(component) => {
|
|
161
|
-
publisher.stopTemplateFilling(component);
|
|
162
|
-
};
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AsyncDirective } from "lit/async-directive.js";
|
|
2
|
-
import { PublisherProxy } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
3
|
-
import { SearchableDomElement } from "../utils/HTML";
|
|
4
|
-
type Observable = PublisherProxy | string | (() => unknown);
|
|
5
|
-
declare class ObserveDirective extends AsyncDirective {
|
|
6
|
-
observables: Set<PublisherProxy>;
|
|
7
|
-
unsubscribe(): void;
|
|
8
|
-
observable?: Observable;
|
|
9
|
-
node?: SearchableDomElement;
|
|
10
|
-
constructor(partInfo: any);
|
|
11
|
-
render(observable: Observable): symbol;
|
|
12
|
-
onAssign: (v: unknown) => void;
|
|
13
|
-
subscribe(observable: Observable): void;
|
|
14
|
-
disconnected(): void;
|
|
15
|
-
reconnected(): void;
|
|
16
|
-
}
|
|
17
|
-
export declare const subscribe: (observable: Observable) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
18
|
-
export declare const sub: (observable: Observable) => import("lit-html/directive").DirectiveResult<typeof ObserveDirective>;
|
|
19
|
-
export declare const get: (id: Observable) => any;
|
|
20
|
-
export declare const dataProvider: (id: Observable, defaultValue?: any) => any;
|
|
21
|
-
export declare const dp: (id: Observable, defaultValue?: any) => any;
|
|
22
|
-
export declare const set: (id: Observable, value: unknown) => void;
|
|
23
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { AsyncDirective } from "lit/async-directive.js";
|
|
2
|
-
import { directive } from "lit/directive.js";
|
|
3
|
-
import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
4
|
-
import { noChange } from "lit";
|
|
5
|
-
import Objects from "../utils/Objects";
|
|
6
|
-
function getObservables(observable) {
|
|
7
|
-
if (typeof observable === "function") {
|
|
8
|
-
const func = observable;
|
|
9
|
-
PublisherManager.collectModifiedPublisher();
|
|
10
|
-
func();
|
|
11
|
-
return PublisherManager.getModifiedPublishers() || new Set();
|
|
12
|
-
}
|
|
13
|
-
if (typeof observable === "string") {
|
|
14
|
-
const split = observable.split(".");
|
|
15
|
-
const dataProvider = split.shift() || "";
|
|
16
|
-
let publisher = PublisherManager.get(dataProvider);
|
|
17
|
-
publisher = Objects.traverse(publisher, split);
|
|
18
|
-
const set = new Set();
|
|
19
|
-
set.add(publisher);
|
|
20
|
-
return set;
|
|
21
|
-
}
|
|
22
|
-
return new Set([observable]);
|
|
23
|
-
}
|
|
24
|
-
class ObserveDirective extends AsyncDirective {
|
|
25
|
-
unsubscribe() {
|
|
26
|
-
this.observables.forEach((publisher) => publisher.offAssign(this.onAssign));
|
|
27
|
-
}
|
|
28
|
-
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
|
29
|
-
constructor(partInfo) {
|
|
30
|
-
super(partInfo);
|
|
31
|
-
this.observables = new Set();
|
|
32
|
-
this.onAssign = (v) => {
|
|
33
|
-
this.setValue(v);
|
|
34
|
-
};
|
|
35
|
-
this.node = partInfo.options?.host;
|
|
36
|
-
}
|
|
37
|
-
/* eslint-enable @typescript-eslint/no-explicit-any*/
|
|
38
|
-
render(observable) {
|
|
39
|
-
if (this.observable !== observable) {
|
|
40
|
-
this.observable = observable;
|
|
41
|
-
if (this.isConnected) {
|
|
42
|
-
this.subscribe(observable);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return noChange;
|
|
46
|
-
}
|
|
47
|
-
// Subscribes to the observable, calling the directive's asynchronous
|
|
48
|
-
// setValue API each time the value changes
|
|
49
|
-
subscribe(observable) {
|
|
50
|
-
this.unsubscribe();
|
|
51
|
-
if (typeof observable === "function") {
|
|
52
|
-
this.onAssign = () => {
|
|
53
|
-
this.setValue(observable());
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this.onAssign = (v) => {
|
|
58
|
-
this.setValue(v);
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
this.observables = getObservables(observable);
|
|
62
|
-
this.observables.forEach((publisher) => {
|
|
63
|
-
publisher.onAssign(this.onAssign);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
// When the directive is disconnected from the DOM, unsubscribe to ensure
|
|
67
|
-
// the directive instance can be garbage collected
|
|
68
|
-
disconnected() {
|
|
69
|
-
this.unsubscribe();
|
|
70
|
-
}
|
|
71
|
-
// If the subtree the directive is in was disconnected and subsequently
|
|
72
|
-
// re-connected, re-subscribe to make the directive operable again
|
|
73
|
-
reconnected() {
|
|
74
|
-
if (!this.observable)
|
|
75
|
-
return;
|
|
76
|
-
this.subscribe(this.observable);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
const dir = directive(ObserveDirective);
|
|
80
|
-
//
|
|
81
|
-
//autoUpdate directive
|
|
82
|
-
export const subscribe = dir;
|
|
83
|
-
export const sub = dir;
|
|
84
|
-
// get value
|
|
85
|
-
export const get = (id) => {
|
|
86
|
-
return getObservables(id).values().next().value.get();
|
|
87
|
-
};
|
|
88
|
-
const deepee = (id, defaultValue) => {
|
|
89
|
-
const value = getObservables(id).values().next().value;
|
|
90
|
-
if (defaultValue !== undefined) {
|
|
91
|
-
const innerValue = value.get();
|
|
92
|
-
if (Objects.isEmpty(innerValue)) {
|
|
93
|
-
value.set(defaultValue);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return value;
|
|
97
|
-
};
|
|
98
|
-
export const dataProvider = deepee;
|
|
99
|
-
export const dp = deepee;
|
|
100
|
-
export const set = (id, value) => {
|
|
101
|
-
getObservables(id).values().next().value.set(value);
|
|
102
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { AsyncDirective } from "lit/async-directive.js";
|
|
2
|
-
import { APIConfiguration } from "@supersoniks/concorde/core/utils/api";
|
|
3
|
-
import API from "@supersoniks/concorde/core/utils/api";
|
|
4
|
-
import { SearchableDomElement } from "../utils/HTML";
|
|
5
|
-
type ApiCallKey = {
|
|
6
|
-
apiConfiguration: APIConfiguration;
|
|
7
|
-
wordingProvider: string | null;
|
|
8
|
-
wordingVersionProvider: string | null;
|
|
9
|
-
};
|
|
10
|
-
type ApiCallValue = {
|
|
11
|
-
api: API;
|
|
12
|
-
keysToTranslate: Set<string>;
|
|
13
|
-
translatedKeys: Set<string>;
|
|
14
|
-
wordingProvider: string | null;
|
|
15
|
-
callIndex: number;
|
|
16
|
-
wordingVersionProvider: string | null;
|
|
17
|
-
apiCallKey: ApiCallKey;
|
|
18
|
-
};
|
|
19
|
-
export declare const loadingString = "";
|
|
20
|
-
export declare const isWordingReady: (key: string) => boolean;
|
|
21
|
-
export default class WordingDirective extends AsyncDirective {
|
|
22
|
-
static publisher: any;
|
|
23
|
-
unsubscribe(): void;
|
|
24
|
-
key?: string;
|
|
25
|
-
node?: SearchableDomElement;
|
|
26
|
-
useUnsafeHTML: boolean;
|
|
27
|
-
constructor(partInfo: any);
|
|
28
|
-
render(key: string, useUnsafeHTML?: boolean): symbol;
|
|
29
|
-
static firstCall: boolean;
|
|
30
|
-
static callApi(node: SearchableDomElement | null, key: string, relaunch?: boolean, usedApiCall?: ApiCallValue): Promise<void>;
|
|
31
|
-
static versionProviderHandlers: Map<ApiCallValue, (v: number) => void>;
|
|
32
|
-
static handleVersionProvider(node: SearchableDomElement): ((v: number) => void) | undefined;
|
|
33
|
-
onAssign: (v: unknown) => void;
|
|
34
|
-
subscribe(key: string): void;
|
|
35
|
-
disconnected(): void;
|
|
36
|
-
reconnected(): void;
|
|
37
|
-
}
|
|
38
|
-
export declare const wording: (key: string, useUnsafeHTML?: boolean | undefined) => import("lit-html/directive").DirectiveResult<typeof WordingDirective>;
|
|
39
|
-
export declare const unsafeWording: (key: string) => import("lit-html/directive").DirectiveResult<typeof WordingDirective>;
|
|
40
|
-
export declare const t: (key: string, useUnsafeHTML?: boolean | undefined) => import("lit-html/directive").DirectiveResult<typeof WordingDirective>;
|
|
41
|
-
export declare const w: (key: string, useUnsafeHTML?: boolean | undefined) => import("lit-html/directive").DirectiveResult<typeof WordingDirective>;
|
|
42
|
-
export {};
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { AsyncDirective } from "lit/async-directive.js";
|
|
2
|
-
import { directive } from "lit/directive.js";
|
|
3
|
-
import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
4
|
-
import { dp } from "@supersoniks/concorde/core/directives/DataProvider";
|
|
5
|
-
import { noChange } from "lit";
|
|
6
|
-
import API from "@supersoniks/concorde/core/utils/api";
|
|
7
|
-
import Objects from "../utils/Objects";
|
|
8
|
-
import HTML from "../utils/HTML";
|
|
9
|
-
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
10
|
-
const apiCalls = new Map();
|
|
11
|
-
const getApiCall = (node) => {
|
|
12
|
-
if (!node)
|
|
13
|
-
return null;
|
|
14
|
-
const configuration = HTML.getApiConfiguration(node);
|
|
15
|
-
const wordingProvider = HTML.getAncestorAttributeValue(node, "wordingProvider");
|
|
16
|
-
const wordingVersionProvider = HTML.getAncestorAttributeValue(node, "wordingVersionProvider");
|
|
17
|
-
const searchedKey = { apiConfiguration: configuration, wordingProvider: wordingProvider, wordingVersionProvider: wordingVersionProvider };
|
|
18
|
-
//touver une api avec la même configuration en comparant les avec l'utilitaire Objects deepEqual
|
|
19
|
-
let apiCall = null;
|
|
20
|
-
for (const [key, value] of apiCalls) {
|
|
21
|
-
if (Objects.deepEqual(key, searchedKey)) {
|
|
22
|
-
apiCall = value;
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (!apiCall) {
|
|
27
|
-
const api = new API(configuration);
|
|
28
|
-
apiCall = {
|
|
29
|
-
api,
|
|
30
|
-
keysToTranslate: new Set(),
|
|
31
|
-
translatedKeys: new Set(),
|
|
32
|
-
wordingProvider,
|
|
33
|
-
callIndex: 0,
|
|
34
|
-
wordingVersionProvider: wordingVersionProvider,
|
|
35
|
-
apiCallKey: searchedKey,
|
|
36
|
-
};
|
|
37
|
-
apiCalls.set(searchedKey, apiCall);
|
|
38
|
-
}
|
|
39
|
-
return apiCall;
|
|
40
|
-
};
|
|
41
|
-
export const loadingString = "";
|
|
42
|
-
export const isWordingReady = (key) => {
|
|
43
|
-
const value = WordingDirective.publisher["wording_" + key].get();
|
|
44
|
-
return value !== loadingString && value != null;
|
|
45
|
-
};
|
|
46
|
-
class WordingDirective extends AsyncDirective {
|
|
47
|
-
unsubscribe() {
|
|
48
|
-
WordingDirective.publisher["wording_" + this.key].offAssign(this.onAssign);
|
|
49
|
-
}
|
|
50
|
-
/* eslint-disable @typescript-eslint/no-explicit-any*/
|
|
51
|
-
constructor(partInfo) {
|
|
52
|
-
super(partInfo);
|
|
53
|
-
this.useUnsafeHTML = false;
|
|
54
|
-
this.onAssign = (v) => {
|
|
55
|
-
const value = this.useUnsafeHTML ? unsafeHTML(v) : v;
|
|
56
|
-
this.setValue(value);
|
|
57
|
-
};
|
|
58
|
-
this.node = partInfo.options.host; // options n'est pas déclaré sur PartInfo mais exist en réalité d'où le typage "any"
|
|
59
|
-
}
|
|
60
|
-
/* eslint-enable @typescript-eslint/no-explicit-any*/
|
|
61
|
-
render(key, useUnsafeHTML = false) {
|
|
62
|
-
this.useUnsafeHTML = useUnsafeHTML;
|
|
63
|
-
if (this.key !== key) {
|
|
64
|
-
this.key = key;
|
|
65
|
-
if (this.isConnected) {
|
|
66
|
-
this.subscribe(key);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return noChange;
|
|
70
|
-
}
|
|
71
|
-
static async callApi(node, key, relaunch = true, usedApiCall) {
|
|
72
|
-
await PublisherManager.getInstance().isLocalStrorageReady;
|
|
73
|
-
if (WordingDirective.firstCall) {
|
|
74
|
-
WordingDirective.firstCall = false;
|
|
75
|
-
//clean keys of the publisher that are equivalent to the loading string
|
|
76
|
-
const keys = Object.keys(WordingDirective.publisher.get());
|
|
77
|
-
for (const key of keys) {
|
|
78
|
-
if (WordingDirective.publisher.get()[key] === loadingString) {
|
|
79
|
-
delete WordingDirective.publisher[key];
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (node) {
|
|
84
|
-
const wordingVersionProvider = HTML.getAncestorAttributeValue(node, "wordingVersionProvider");
|
|
85
|
-
if (wordingVersionProvider) {
|
|
86
|
-
dp(wordingVersionProvider).onAssign(WordingDirective.handleVersionProvider(node));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
let hasWordingForKey = WordingDirective.publisher.get()["wording_" + key] != null;
|
|
90
|
-
const apiCall = usedApiCall || getApiCall(node);
|
|
91
|
-
if (!apiCall)
|
|
92
|
-
return;
|
|
93
|
-
if (hasWordingForKey && key !== "") {
|
|
94
|
-
apiCall.translatedKeys.add(key);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
apiCall.callIndex++;
|
|
98
|
-
const callIndex = apiCall.callIndex;
|
|
99
|
-
const wordingProvider = apiCall.wordingProvider ?? "";
|
|
100
|
-
// if the wording provider is unfortunately not set, we don't call the api now.
|
|
101
|
-
// We will try later
|
|
102
|
-
if (!wordingProvider && relaunch) {
|
|
103
|
-
window.setTimeout(async () => {
|
|
104
|
-
WordingDirective.callApi(null, key, false, apiCall);
|
|
105
|
-
}, 1000);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
//
|
|
109
|
-
//
|
|
110
|
-
const api = apiCall.api;
|
|
111
|
-
window.queueMicrotask(async () => {
|
|
112
|
-
hasWordingForKey = WordingDirective.publisher["wording_" + key].get() != null;
|
|
113
|
-
if (!hasWordingForKey && key !== "") {
|
|
114
|
-
apiCall.keysToTranslate.add(key);
|
|
115
|
-
WordingDirective.publisher["wording_" + key] = loadingString;
|
|
116
|
-
}
|
|
117
|
-
if (callIndex !== apiCall.callIndex)
|
|
118
|
-
return;
|
|
119
|
-
const wordings = Array.from(apiCall.keysToTranslate);
|
|
120
|
-
if (!wordings.length)
|
|
121
|
-
return;
|
|
122
|
-
const splittedUrl = wordingProvider.split("?");
|
|
123
|
-
const locationURL = splittedUrl.shift();
|
|
124
|
-
const queryString = (splittedUrl.length > 0 ? splittedUrl.join("?") + "&" : "") + "labels[]=" + wordings.join("&labels[]=");
|
|
125
|
-
const calledURL = locationURL + "?" + queryString;
|
|
126
|
-
apiCall.translatedKeys = new Set([...apiCall.translatedKeys, ...apiCall.keysToTranslate]);
|
|
127
|
-
apiCall.keysToTranslate.clear();
|
|
128
|
-
const result = (await api.get(calledURL));
|
|
129
|
-
for (const key in result) {
|
|
130
|
-
WordingDirective.publisher["wording_" + key] = result[key];
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
//check if the wording version has changed
|
|
135
|
-
static handleVersionProvider(node) {
|
|
136
|
-
const apiCall = getApiCall(node);
|
|
137
|
-
if (!apiCall)
|
|
138
|
-
return;
|
|
139
|
-
if (WordingDirective.versionProviderHandlers.has(apiCall)) {
|
|
140
|
-
return WordingDirective.versionProviderHandlers.get(apiCall);
|
|
141
|
-
}
|
|
142
|
-
const versionProviderHandler = function (version) {
|
|
143
|
-
const wordingVersionProvider = apiCall.wordingVersionProvider;
|
|
144
|
-
if (!wordingVersionProvider)
|
|
145
|
-
return;
|
|
146
|
-
//
|
|
147
|
-
const currentVersions = WordingDirective.publisher.get().__wording_versions__ ?? [];
|
|
148
|
-
if (version == null)
|
|
149
|
-
return;
|
|
150
|
-
const currentVersionData = currentVersions.find((v) => v.serviceURL === apiCall.api.serviceURL) || {
|
|
151
|
-
serviceURL: apiCall.api.serviceURL,
|
|
152
|
-
version: 0,
|
|
153
|
-
};
|
|
154
|
-
if (!currentVersions.includes(currentVersionData))
|
|
155
|
-
currentVersions.push(currentVersionData);
|
|
156
|
-
if (version === currentVersionData.version) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
currentVersionData.version = version;
|
|
160
|
-
WordingDirective.publisher.set({ __wording_versions__: currentVersions });
|
|
161
|
-
for (const apiCall of apiCalls.values()) {
|
|
162
|
-
apiCall.keysToTranslate = new Set(apiCall.translatedKeys);
|
|
163
|
-
if (apiCall.keysToTranslate.size > 0) {
|
|
164
|
-
WordingDirective.callApi(null, "", false, apiCall);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
WordingDirective.versionProviderHandlers.set(apiCall, versionProviderHandler);
|
|
169
|
-
return versionProviderHandler;
|
|
170
|
-
}
|
|
171
|
-
// Subscribes to the key, calling the directive's asynchronous
|
|
172
|
-
// setValue API each time the value changes
|
|
173
|
-
subscribe(key) {
|
|
174
|
-
this.unsubscribe();
|
|
175
|
-
// this.onAssign = (v: unknown) => {
|
|
176
|
-
// this.setValue(v);
|
|
177
|
-
// };
|
|
178
|
-
WordingDirective.publisher["wording_" + key].onAssign(this.onAssign);
|
|
179
|
-
WordingDirective.callApi(this.node, key);
|
|
180
|
-
}
|
|
181
|
-
// When the directive is disconnected from the DOM, unsubscribe to ensure
|
|
182
|
-
// the directive instance can be garbage collected
|
|
183
|
-
disconnected() {
|
|
184
|
-
this.unsubscribe();
|
|
185
|
-
}
|
|
186
|
-
// If the subtree the directive is in was disconnected and subsequently
|
|
187
|
-
// re-connected, re-subscribe to make the directive operable again
|
|
188
|
-
reconnected() {
|
|
189
|
-
if (!this.key)
|
|
190
|
-
return;
|
|
191
|
-
this.subscribe(this.key);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
WordingDirective.publisher = PublisherManager.get("sonic-wording", { localStorageMode: "enabled" });
|
|
195
|
-
WordingDirective.firstCall = true;
|
|
196
|
-
WordingDirective.versionProviderHandlers = new Map();
|
|
197
|
-
export default WordingDirective;
|
|
198
|
-
//autoUpdate directive
|
|
199
|
-
export const wording = directive(WordingDirective);
|
|
200
|
-
export const unsafeWording = (key) => wording(key, true);
|
|
201
|
-
export const t = wording;
|
|
202
|
-
export const w = wording;
|
package/core/mixins/Fetcher.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import "@supersoniks/concorde/core/components/ui/button/button";
|
|
3
|
-
import { SubscriberInterface } from "@supersoniks/concorde/core/mixins/Subscriber";
|
|
4
|
-
import API from "@supersoniks/concorde/core/utils/api";
|
|
5
|
-
import { MixinArgsType } from "../_types/types";
|
|
6
|
-
import { ResultTypeInterface } from "@supersoniks/concorde/core/utils/api";
|
|
7
|
-
type Constructor<T> = new (...args: MixinArgsType[]) => T;
|
|
8
|
-
export declare const invalidateFetchersInError: () => void;
|
|
9
|
-
export declare const onFetchError: (errorListener: (apiResponse: Response) => void) => void;
|
|
10
|
-
export declare const offFetchError: (errorListener: (apiResponse: Response) => void) => void;
|
|
11
|
-
declare const Fetcher: <T extends Constructor<SubscriberInterface<PropsType>>, PropsType extends unknown = unknown>(superClass: T, propsType?: PropsType | undefined) => {
|
|
12
|
-
new (...args: MixinArgsType[]): {
|
|
13
|
-
api: API | null;
|
|
14
|
-
/**
|
|
15
|
-
* Après le chargement des données on traverse l'objet reçu en fonctione de la cible exprimées dans cette propriété avec la dot syntaxe.
|
|
16
|
-
* C'est cette donnée cible qui est injectée dans les pros et donc disponible via le publisher disponible globalement via PublisherManager.get(dataProvider)
|
|
17
|
-
*/
|
|
18
|
-
key: string;
|
|
19
|
-
/**
|
|
20
|
-
* isFirstLoad vaut true jusqu'au premier chargement de données
|
|
21
|
-
*/
|
|
22
|
-
isFirstLoad: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* isLoading vaut true pendant le chargement des données
|
|
25
|
-
*/
|
|
26
|
-
isLoading: boolean;
|
|
27
|
-
lazyLoad?: boolean | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* IObserver est l'intersection observer qui permet de charger les données au scroll si l'attribut lazyload est renseigné
|
|
30
|
-
*/
|
|
31
|
-
iObserver: IntersectionObserver | null;
|
|
32
|
-
/**
|
|
33
|
-
* On peut désactiver le fetch programmatiquement via cette propriété.
|
|
34
|
-
* Cela est le cas pour le composant sonic-list qui ne fetch que si l'attribut fetch est renseigné
|
|
35
|
-
*/
|
|
36
|
-
isFetchEnabled: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Result of the fetch
|
|
39
|
-
*/
|
|
40
|
-
fetchedData: any;
|
|
41
|
-
_endPoint: string;
|
|
42
|
-
props: (PropsType & ResultTypeInterface) | null;
|
|
43
|
-
endPoint: string;
|
|
44
|
-
requestId: number;
|
|
45
|
-
refetchEveryMs: number;
|
|
46
|
-
refetchTimeOutId?: NodeJS.Timeout | undefined;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* C'est ici que les données sont chargées via l'utilitaire API
|
|
50
|
-
* Elles sont ensuite injectées dans le publisher en accord avec la cible définie dans la propriété key
|
|
51
|
-
* Un Toast est affiché si le chargement échoue
|
|
52
|
-
*/
|
|
53
|
-
_fetchData(): Promise<void>;
|
|
54
|
-
onInvalidate?: (() => void) | undefined;
|
|
55
|
-
disconnectedCallback(): void;
|
|
56
|
-
connectedCallback(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Première update, le comportement de lazyload est géré ici a l'aide d'un intersection observer.
|
|
59
|
-
*/
|
|
60
|
-
lazyLoadSpan?: HTMLSpanElement | undefined;
|
|
61
|
-
handleLazyLoad(): void;
|
|
62
|
-
onIntersection(entries: IntersectionObserverEntry[]): void;
|
|
63
|
-
propertyMap: object;
|
|
64
|
-
isConnected: boolean;
|
|
65
|
-
children: HTMLCollection;
|
|
66
|
-
appendChild(node: Node): Node;
|
|
67
|
-
getAncestorAttributeValue(attributeName: string): string;
|
|
68
|
-
hasAncestorAttribute(attributeName: string): boolean;
|
|
69
|
-
querySelectorAll(selector: string): NodeListOf<Element>;
|
|
70
|
-
publisher: any;
|
|
71
|
-
dataProvider: string | null;
|
|
72
|
-
noShadowDom: string | null;
|
|
73
|
-
debug: HTMLElement | null;
|
|
74
|
-
defferedDebug: boolean | null;
|
|
75
|
-
displayContents: boolean;
|
|
76
|
-
shadowRoot?: ShadowRoot | undefined;
|
|
77
|
-
dispatchEvent(event: Event): void;
|
|
78
|
-
setAttribute(name: string, value: string): void;
|
|
79
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
80
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
81
|
-
removeAttribute(name: string): void;
|
|
82
|
-
initPublisher(): void;
|
|
83
|
-
getApiConfiguration(): import("@supersoniks/concorde/core/utils/api").APIConfiguration;
|
|
84
|
-
requestUpdate(): void;
|
|
85
|
-
getAttribute(name: string): string;
|
|
86
|
-
hasAttribute(attributeName: string): boolean;
|
|
87
|
-
getBoundingClientRect(): DOMRect;
|
|
88
|
-
};
|
|
89
|
-
} & T;
|
|
90
|
-
export default Fetcher;
|