@supersoniks/concorde 4.9.93 → 4.9.95
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/README.md +16 -30
- package/build-infos.json +1 -1
- package/concorde-3d.bundle.js +3911 -0
- package/concorde-3d.es.js +32635 -0
- package/concorde-core.bundle.js +299 -292
- package/concorde-core.es.js +10104 -6071
- package/concorde-hugging-face-infer.bundle.js +32 -0
- package/concorde-hugging-face-infer.es.js +2952 -0
- package/concorde-shader.bundle.js +105 -0
- package/concorde-shader.es.js +7982 -0
- package/concorde-webgpu.bundle.js +296 -0
- package/concorde-webgpu.es.js +8268 -0
- package/dist/concorde-core.bundle.js +299 -292
- package/dist/concorde-core.es.js +10104 -6071
- package/dist/docs-mock-api-sw.js +110 -0
- package/dist/docs-mock-api-sw.js.map +3 -3
- package/docs/assets/{index-D2Q3JyQ6.css → index-BZiZXMU-.css} +1 -1
- package/docs/assets/index-FmK4JaIM.js +11992 -0
- package/docs/crawl/core/components/functional/jsonata/jsonata.html +79 -0
- package/docs/crawl/core/components/ui/form/checkbox/checkbox.html +1 -1
- package/docs/crawl/docs/_core-concept/dataFlow.html +12 -1
- package/docs/crawl/docs/_decorators/get.html +27 -6
- package/docs/crawl/docs/_decorators/patch.html +6 -0
- package/docs/crawl/docs/_decorators/post.html +8 -0
- package/docs/crawl/docs/_decorators/put.html +6 -0
- package/docs/crawl/docs/_misc/docs-mock-api.html +12 -0
- package/docs/crawl/docs/_misc/formelement-subscriber-removal.html +138 -0
- package/docs/crawl/docs/_misc/html-integration.html +3 -2
- package/docs/crawl/hubs/decorators.html +36 -31
- package/docs/crawl/hubs/remote-data.html +39 -36
- package/docs/crawl/index.html +2 -0
- package/docs/docs-mock-api-sw.js +110 -0
- package/docs/docs-mock-api-sw.js.map +3 -3
- package/docs/index.html +2 -2
- package/docs/llms-full.txt +240 -5
- package/docs/llms.txt +2 -0
- package/docs/sitemap.xml +6 -0
- package/docs/src/core/components/functional/jsonata/jsonata.md +56 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +1 -1
- package/docs/src/docs/_core-concept/dataFlow.md +10 -1
- package/docs/src/docs/_decorators/get.md +31 -0
- package/docs/src/docs/_decorators/patch.md +9 -0
- package/docs/src/docs/_decorators/post.md +11 -0
- package/docs/src/docs/_decorators/put.md +9 -0
- package/docs/src/docs/_misc/docs-mock-api.md +3 -0
- package/docs/src/docs/_misc/formelement-subscriber-removal.md +115 -0
- package/docs/src/docs/_misc/html-integration.md +2 -0
- package/docs/src/docs/search/docs-search.json +300 -5
- package/docs/src/tsconfig.json +286 -268
- package/package.json +382 -1080
- package/public/docs-mock-api-sw.js +110 -0
- package/public/docs-mock-api-sw.js.map +3 -3
- package/scripts/post-build.mjs +0 -43
- package/scripts/pre-build.mjs +4 -33
- package/scripts/pre-publish.mjs +0 -2
- package/src/core/components/functional/functional.ts +1 -0
- package/src/core/components/functional/jsonata/jsonata.md +56 -0
- package/src/core/components/functional/jsonata/jsonata.spec.ts +202 -0
- package/src/core/components/functional/jsonata/jsonata.ts +116 -0
- package/src/core/components/functional/sdui/sdui.md +0 -0
- package/src/core/components/ui/button/button.ts +2 -2
- package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
- package/src/core/components/ui/form/input/input.ts +0 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -0
- package/src/core/components/ui/form/select/select.ts +0 -0
- package/src/core/components/ui/form/textarea/textarea.ts +0 -0
- package/src/core/decorators/Subscriber.ts +2 -0
- package/src/core/decorators/subscriber/derive.ts +95 -0
- package/src/core/utils/derive.spec.ts +190 -0
- package/src/core/utils/derive.ts +357 -0
- package/src/core/utils/jsonataHelpers.ts +100 -0
- package/src/core/utils/jsonataRuntime.ts +88 -0
- package/src/docs/_core-concept/dataFlow.md +9 -0
- package/src/docs/_getting-started/create-a-component.md +0 -0
- package/src/docs/_misc/docs-mock-api.md +3 -0
- package/src/docs/components/docs-demo-sources.ts +26 -0
- package/src/docs/docs.ts +1 -0
- package/src/docs/example/docs-jsonata-demos.ts +128 -0
- package/src/docs/mock-api/fixtures-jsonata.ts +131 -0
- package/src/docs/mock-api/router.ts +26 -0
- package/src/docs/navigation/navigation.ts +4 -0
- package/src/docs/search/docs-search.json +2210 -615
- package/src/tsconfig.json +327 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/utils.ts +13 -0
- package/vite/config.js +23 -35
- package/dist/js/components.js +0 -12
- package/dist/js/components.js.map +0 -1
- package/dist/js/concorde-loaded.js +0 -5
- package/dist/js/concorde-loaded.js.map +0 -1
- package/dist/js/core/_types/endpoint.js +0 -5
- package/dist/js/core/_types/endpoint.js.map +0 -1
- package/dist/js/core/_types/key.js +0 -2
- package/dist/js/core/_types/key.js.map +0 -1
- package/dist/js/core/_types/types.js +0 -3
- package/dist/js/core/_types/types.js.map +0 -1
- package/dist/js/core/components/functional/date/date.js +0 -272
- package/dist/js/core/components/functional/date/date.js.map +0 -1
- package/dist/js/core/components/functional/example/example.js +0 -44
- package/dist/js/core/components/functional/example/example.js.map +0 -1
- package/dist/js/core/components/functional/fetch/fetch.js +0 -79
- package/dist/js/core/components/functional/fetch/fetch.js.map +0 -1
- package/dist/js/core/components/functional/functional.js +0 -17
- package/dist/js/core/components/functional/functional.js.map +0 -1
- package/dist/js/core/components/functional/if/if.js +0 -39
- package/dist/js/core/components/functional/if/if.js.map +0 -1
- package/dist/js/core/components/functional/list/list.js +0 -341
- package/dist/js/core/components/functional/list/list.js.map +0 -1
- package/dist/js/core/components/functional/mix/mix.js +0 -103
- package/dist/js/core/components/functional/mix/mix.js.map +0 -1
- package/dist/js/core/components/functional/queue/queue.js +0 -450
- package/dist/js/core/components/functional/queue/queue.js.map +0 -1
- package/dist/js/core/components/functional/router/redirect.js +0 -54
- package/dist/js/core/components/functional/router/redirect.js.map +0 -1
- package/dist/js/core/components/functional/router/router.js +0 -179
- package/dist/js/core/components/functional/router/router.js.map +0 -1
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js +0 -216
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js.map +0 -1
- package/dist/js/core/components/functional/sdui/default-library.json +0 -108
- package/dist/js/core/components/functional/sdui/sdui-utils.js +0 -64
- package/dist/js/core/components/functional/sdui/sdui-utils.js.map +0 -1
- package/dist/js/core/components/functional/sdui/sdui.js +0 -266
- package/dist/js/core/components/functional/sdui/sdui.js.map +0 -1
- package/dist/js/core/components/functional/sdui/types.js +0 -2
- package/dist/js/core/components/functional/sdui/types.js.map +0 -1
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js +0 -22
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js.map +0 -1
- package/dist/js/core/components/functional/states/states.js +0 -172
- package/dist/js/core/components/functional/states/states.js.map +0 -1
- package/dist/js/core/components/functional/submit/submit.js +0 -284
- package/dist/js/core/components/functional/submit/submit.js.map +0 -1
- package/dist/js/core/components/functional/subscriber/subscriber.js +0 -39
- package/dist/js/core/components/functional/subscriber/subscriber.js.map +0 -1
- package/dist/js/core/components/functional/translation/translation.js +0 -28
- package/dist/js/core/components/functional/translation/translation.js.map +0 -1
- package/dist/js/core/components/functional/value/value.js +0 -28
- package/dist/js/core/components/functional/value/value.js.map +0 -1
- package/dist/js/core/components/ui/_css/scroll.js +0 -27
- package/dist/js/core/components/ui/_css/scroll.js.map +0 -1
- package/dist/js/core/components/ui/_css/shadow.js +0 -22
- package/dist/js/core/components/ui/_css/shadow.js.map +0 -1
- package/dist/js/core/components/ui/_css/size.js +0 -36
- package/dist/js/core/components/ui/_css/size.js.map +0 -1
- package/dist/js/core/components/ui/_css/type.js +0 -92
- package/dist/js/core/components/ui/_css/type.js.map +0 -1
- package/dist/js/core/components/ui/alert/alert.js +0 -213
- package/dist/js/core/components/ui/alert/alert.js.map +0 -1
- package/dist/js/core/components/ui/alert-messages/alert-messages.js +0 -68
- package/dist/js/core/components/ui/alert-messages/alert-messages.js.map +0 -1
- package/dist/js/core/components/ui/badge/badge.js +0 -199
- package/dist/js/core/components/ui/badge/badge.js.map +0 -1
- package/dist/js/core/components/ui/button/button.js +0 -697
- package/dist/js/core/components/ui/button/button.js.map +0 -1
- package/dist/js/core/components/ui/captcha/altchaStyles.js +0 -226
- package/dist/js/core/components/ui/captcha/altchaStyles.js.map +0 -1
- package/dist/js/core/components/ui/captcha/captcha.js +0 -167
- package/dist/js/core/components/ui/captcha/captcha.js.map +0 -1
- package/dist/js/core/components/ui/card/card-footer.js +0 -26
- package/dist/js/core/components/ui/card/card-footer.js.map +0 -1
- package/dist/js/core/components/ui/card/card-header-descripton.js +0 -30
- package/dist/js/core/components/ui/card/card-header-descripton.js.map +0 -1
- package/dist/js/core/components/ui/card/card-header.js +0 -79
- package/dist/js/core/components/ui/card/card-header.js.map +0 -1
- package/dist/js/core/components/ui/card/card-main.js +0 -26
- package/dist/js/core/components/ui/card/card-main.js.map +0 -1
- package/dist/js/core/components/ui/card/card.js +0 -67
- package/dist/js/core/components/ui/card/card.js.map +0 -1
- package/dist/js/core/components/ui/divider/divider.js +0 -200
- package/dist/js/core/components/ui/divider/divider.js.map +0 -1
- package/dist/js/core/components/ui/form/checkbox/checkbox.js +0 -257
- package/dist/js/core/components/ui/form/checkbox/checkbox.js.map +0 -1
- package/dist/js/core/components/ui/form/css/form-control.js +0 -393
- package/dist/js/core/components/ui/form/css/form-control.js.map +0 -1
- package/dist/js/core/components/ui/form/fieldset/fieldset.js +0 -124
- package/dist/js/core/components/ui/form/fieldset/fieldset.js.map +0 -1
- package/dist/js/core/components/ui/form/fieldset/legend-description.js +0 -38
- package/dist/js/core/components/ui/form/fieldset/legend-description.js.map +0 -1
- package/dist/js/core/components/ui/form/fieldset/legend.js +0 -130
- package/dist/js/core/components/ui/form/fieldset/legend.js.map +0 -1
- package/dist/js/core/components/ui/form/form-actions/form-actions.js +0 -47
- package/dist/js/core/components/ui/form/form-actions/form-actions.js.map +0 -1
- package/dist/js/core/components/ui/form/form-layout/form-layout.js +0 -84
- package/dist/js/core/components/ui/form/form-layout/form-layout.js.map +0 -1
- package/dist/js/core/components/ui/form/input/input.js +0 -316
- package/dist/js/core/components/ui/form/input/input.js.map +0 -1
- package/dist/js/core/components/ui/form/input/password-helper.js +0 -134
- package/dist/js/core/components/ui/form/input/password-helper.js.map +0 -1
- package/dist/js/core/components/ui/form/input/same-value-helper.js +0 -85
- package/dist/js/core/components/ui/form/input/same-value-helper.js.map +0 -1
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js +0 -405
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js.map +0 -1
- package/dist/js/core/components/ui/form/radio/radio.js +0 -63
- package/dist/js/core/components/ui/form/radio/radio.js.map +0 -1
- package/dist/js/core/components/ui/form/select/select.js +0 -323
- package/dist/js/core/components/ui/form/select/select.js.map +0 -1
- package/dist/js/core/components/ui/form/switch/switch.js +0 -90
- package/dist/js/core/components/ui/form/switch/switch.js.map +0 -1
- package/dist/js/core/components/ui/form/textarea/textarea.js +0 -162
- package/dist/js/core/components/ui/form/textarea/textarea.js.map +0 -1
- package/dist/js/core/components/ui/group/group.js +0 -128
- package/dist/js/core/components/ui/group/group.js.map +0 -1
- package/dist/js/core/components/ui/icon/icon.js +0 -145
- package/dist/js/core/components/ui/icon/icon.js.map +0 -1
- package/dist/js/core/components/ui/icon/icons.js +0 -184
- package/dist/js/core/components/ui/icon/icons.js.map +0 -1
- package/dist/js/core/components/ui/icon/icons.json +0 -1
- package/dist/js/core/components/ui/image/image.js +0 -160
- package/dist/js/core/components/ui/image/image.js.map +0 -1
- package/dist/js/core/components/ui/link/link.js +0 -125
- package/dist/js/core/components/ui/link/link.js.map +0 -1
- package/dist/js/core/components/ui/loader/loader.js +0 -106
- package/dist/js/core/components/ui/loader/loader.js.map +0 -1
- package/dist/js/core/components/ui/loader/styles/fixed.js +0 -56
- package/dist/js/core/components/ui/loader/styles/fixed.js.map +0 -1
- package/dist/js/core/components/ui/loader/styles/inline.js +0 -70
- package/dist/js/core/components/ui/loader/styles/inline.js.map +0 -1
- package/dist/js/core/components/ui/menu/menu-item.js +0 -35
- package/dist/js/core/components/ui/menu/menu-item.js.map +0 -1
- package/dist/js/core/components/ui/menu/menu.js +0 -436
- package/dist/js/core/components/ui/menu/menu.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-actions.js +0 -44
- package/dist/js/core/components/ui/modal/modal-actions.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-close.js +0 -56
- package/dist/js/core/components/ui/modal/modal-close.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-content.js +0 -27
- package/dist/js/core/components/ui/modal/modal-content.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-subtitle.js +0 -34
- package/dist/js/core/components/ui/modal/modal-subtitle.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-title.js +0 -35
- package/dist/js/core/components/ui/modal/modal-title.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal-utils.js +0 -32
- package/dist/js/core/components/ui/modal/modal-utils.js.map +0 -1
- package/dist/js/core/components/ui/modal/modal.js +0 -568
- package/dist/js/core/components/ui/modal/modal.js.map +0 -1
- package/dist/js/core/components/ui/pop/pop.js +0 -337
- package/dist/js/core/components/ui/pop/pop.js.map +0 -1
- package/dist/js/core/components/ui/progress/progress.js +0 -164
- package/dist/js/core/components/ui/progress/progress.js.map +0 -1
- package/dist/js/core/components/ui/table/table-caption.js +0 -29
- package/dist/js/core/components/ui/table/table-caption.js.map +0 -1
- package/dist/js/core/components/ui/table/table-tbody.js +0 -41
- package/dist/js/core/components/ui/table/table-tbody.js.map +0 -1
- package/dist/js/core/components/ui/table/table-td.js +0 -69
- package/dist/js/core/components/ui/table/table-td.js.map +0 -1
- package/dist/js/core/components/ui/table/table-tfoot.js +0 -28
- package/dist/js/core/components/ui/table/table-tfoot.js.map +0 -1
- package/dist/js/core/components/ui/table/table-th.js +0 -80
- package/dist/js/core/components/ui/table/table-th.js.map +0 -1
- package/dist/js/core/components/ui/table/table-thead.js +0 -26
- package/dist/js/core/components/ui/table/table-thead.js.map +0 -1
- package/dist/js/core/components/ui/table/table-tr.js +0 -67
- package/dist/js/core/components/ui/table/table-tr.js.map +0 -1
- package/dist/js/core/components/ui/table/table.js +0 -106
- package/dist/js/core/components/ui/table/table.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js +0 -74
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme-collection/dark.js +0 -39
- package/dist/js/core/components/ui/theme/theme-collection/dark.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme-collection/light.js +0 -32
- package/dist/js/core/components/ui/theme/theme-collection/light.js.map +0 -1
- package/dist/js/core/components/ui/theme/theme.js +0 -150
- package/dist/js/core/components/ui/theme/theme.js.map +0 -1
- package/dist/js/core/components/ui/toast/message-subscriber.js +0 -41
- package/dist/js/core/components/ui/toast/message-subscriber.js.map +0 -1
- package/dist/js/core/components/ui/toast/toast-item.js +0 -379
- package/dist/js/core/components/ui/toast/toast-item.js.map +0 -1
- package/dist/js/core/components/ui/toast/toast.js +0 -269
- package/dist/js/core/components/ui/toast/toast.js.map +0 -1
- package/dist/js/core/components/ui/toast/types.js +0 -2
- package/dist/js/core/components/ui/toast/types.js.map +0 -1
- package/dist/js/core/components/ui/tooltip/tooltip.js +0 -219
- package/dist/js/core/components/ui/tooltip/tooltip.js.map +0 -1
- package/dist/js/core/components/ui/ui.js +0 -41
- package/dist/js/core/components/ui/ui.js.map +0 -1
- package/dist/js/core/core.js +0 -14
- package/dist/js/core/core.js.map +0 -1
- package/dist/js/core/decorators/Subscriber.js +0 -9
- package/dist/js/core/decorators/Subscriber.js.map +0 -1
- package/dist/js/core/decorators/api.js +0 -806
- package/dist/js/core/decorators/api.js.map +0 -1
- package/dist/js/core/decorators/lifecycle.js +0 -67
- package/dist/js/core/decorators/lifecycle.js.map +0 -1
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js +0 -27
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js.map +0 -1
- package/dist/js/core/decorators/subscriber/autoFill.js +0 -26
- package/dist/js/core/decorators/subscriber/autoFill.js.map +0 -1
- package/dist/js/core/decorators/subscriber/autoSubscribe.js +0 -46
- package/dist/js/core/decorators/subscriber/autoSubscribe.js.map +0 -1
- package/dist/js/core/decorators/subscriber/bind.js +0 -150
- package/dist/js/core/decorators/subscriber/bind.js.map +0 -1
- package/dist/js/core/decorators/subscriber/common.js +0 -44
- package/dist/js/core/decorators/subscriber/common.js.map +0 -1
- package/dist/js/core/decorators/subscriber/dynamicPath.js +0 -75
- package/dist/js/core/decorators/subscriber/dynamicPath.js.map +0 -1
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js +0 -138
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js.map +0 -1
- package/dist/js/core/decorators/subscriber/handle.js +0 -22
- package/dist/js/core/decorators/subscriber/handle.js.map +0 -1
- package/dist/js/core/decorators/subscriber/onAssign.js +0 -199
- package/dist/js/core/decorators/subscriber/onAssign.js.map +0 -1
- package/dist/js/core/decorators/subscriber/publish.js +0 -108
- package/dist/js/core/decorators/subscriber/publish.js.map +0 -1
- package/dist/js/core/decorators/subscriber/publisherPath.js +0 -16
- package/dist/js/core/decorators/subscriber/publisherPath.js.map +0 -1
- package/dist/js/core/decorators/subscriber/subscribe.js +0 -20
- package/dist/js/core/decorators/subscriber/subscribe.js.map +0 -1
- package/dist/js/core/directives/DataProvider.js +0 -127
- package/dist/js/core/directives/DataProvider.js.map +0 -1
- package/dist/js/core/directives/Wording.js +0 -221
- package/dist/js/core/directives/Wording.js.map +0 -1
- package/dist/js/core/mixins/Fetcher.js +0 -325
- package/dist/js/core/mixins/Fetcher.js.map +0 -1
- package/dist/js/core/mixins/FormCheckable.js +0 -313
- package/dist/js/core/mixins/FormCheckable.js.map +0 -1
- package/dist/js/core/mixins/FormElement.js +0 -304
- package/dist/js/core/mixins/FormElement.js.map +0 -1
- package/dist/js/core/mixins/FormInput.js +0 -82
- package/dist/js/core/mixins/FormInput.js.map +0 -1
- package/dist/js/core/mixins/Subscriber.js +0 -354
- package/dist/js/core/mixins/Subscriber.js.map +0 -1
- package/dist/js/core/mixins/TemplatesContainer.js +0 -70
- package/dist/js/core/mixins/TemplatesContainer.js.map +0 -1
- package/dist/js/core/mixins/mixins.js +0 -7
- package/dist/js/core/mixins/mixins.js.map +0 -1
- package/dist/js/core/utils/AncestorAttributeObserver.js +0 -140
- package/dist/js/core/utils/AncestorAttributeObserver.js.map +0 -1
- package/dist/js/core/utils/Arrays.js +0 -141
- package/dist/js/core/utils/Arrays.js.map +0 -1
- package/dist/js/core/utils/DataBindObserver.js +0 -265
- package/dist/js/core/utils/DataBindObserver.js.map +0 -1
- package/dist/js/core/utils/Electron.js +0 -14
- package/dist/js/core/utils/Electron.js.map +0 -1
- package/dist/js/core/utils/Format.js +0 -43
- package/dist/js/core/utils/Format.js.map +0 -1
- package/dist/js/core/utils/HTML.js +0 -272
- package/dist/js/core/utils/HTML.js.map +0 -1
- package/dist/js/core/utils/LocationHandler.js +0 -143
- package/dist/js/core/utils/LocationHandler.js.map +0 -1
- package/dist/js/core/utils/Objects.js +0 -111
- package/dist/js/core/utils/Objects.js.map +0 -1
- package/dist/js/core/utils/PublisherProxy.js +0 -946
- package/dist/js/core/utils/PublisherProxy.js.map +0 -1
- package/dist/js/core/utils/SafariScrollGuard.js +0 -384
- package/dist/js/core/utils/SafariScrollGuard.js.map +0 -1
- package/dist/js/core/utils/Utils.js +0 -19
- package/dist/js/core/utils/Utils.js.map +0 -1
- package/dist/js/core/utils/aesCrypto.js +0 -98
- package/dist/js/core/utils/aesCrypto.js.map +0 -1
- package/dist/js/core/utils/api.js +0 -595
- package/dist/js/core/utils/api.js.map +0 -1
- package/dist/js/core/utils/dataProviderKey.js +0 -64
- package/dist/js/core/utils/dataProviderKey.js.map +0 -1
- package/dist/js/core/utils/endpoint.js +0 -74
- package/dist/js/core/utils/endpoint.js.map +0 -1
- package/dist/js/core/utils/route.js +0 -149
- package/dist/js/core/utils/route.js.map +0 -1
- package/dist/js/core/utils/url-pattern.js +0 -3
- package/dist/js/core/utils/url-pattern.js.map +0 -1
- package/dist/js/dataprovider.js +0 -2
- package/dist/js/dataprovider.js.map +0 -1
- package/dist/js/decorators.js +0 -43
- package/dist/js/decorators.js.map +0 -1
- package/dist/js/directives.js +0 -30
- package/dist/js/directives.js.map +0 -1
- package/dist/js/index.js +0 -8
- package/dist/js/index.js.map +0 -1
- package/dist/js/mixins.js +0 -23
- package/dist/js/mixins.js.map +0 -1
- package/dist/js/test-utils/TestUtils.js +0 -10
- package/dist/js/test-utils/TestUtils.js.map +0 -1
- package/dist/js/utils.js +0 -44
- package/dist/js/utils.js.map +0 -1
- package/dist/types/components.d.ts +0 -5
- package/dist/types/components.d.ts.map +0 -1
- package/dist/types/concorde-loaded.d.ts +0 -2
- package/dist/types/concorde-loaded.d.ts.map +0 -1
- package/dist/types/core/_types/endpoint.d.ts +0 -5
- package/dist/types/core/_types/endpoint.d.ts.map +0 -1
- package/dist/types/core/_types/key.d.ts +0 -2
- package/dist/types/core/_types/key.d.ts.map +0 -1
- package/dist/types/core/_types/types.d.ts +0 -28
- package/dist/types/core/_types/types.d.ts.map +0 -1
- package/dist/types/core/components/functional/date/date.d.ts +0 -52
- package/dist/types/core/components/functional/date/date.d.ts.map +0 -1
- package/dist/types/core/components/functional/example/example.d.ts +0 -15
- package/dist/types/core/components/functional/example/example.d.ts.map +0 -1
- package/dist/types/core/components/functional/fetch/fetch.d.ts +0 -102
- package/dist/types/core/components/functional/fetch/fetch.d.ts.map +0 -1
- package/dist/types/core/components/functional/functional.d.ts +0 -17
- package/dist/types/core/components/functional/functional.d.ts.map +0 -1
- package/dist/types/core/components/functional/if/if.d.ts +0 -13
- package/dist/types/core/components/functional/if/if.d.ts.map +0 -1
- package/dist/types/core/components/functional/list/list.d.ts +0 -149
- package/dist/types/core/components/functional/list/list.d.ts.map +0 -1
- package/dist/types/core/components/functional/mix/mix.d.ts +0 -23
- package/dist/types/core/components/functional/mix/mix.d.ts.map +0 -1
- package/dist/types/core/components/functional/queue/queue.d.ts +0 -93
- package/dist/types/core/components/functional/queue/queue.d.ts.map +0 -1
- package/dist/types/core/components/functional/router/redirect.d.ts +0 -19
- package/dist/types/core/components/functional/router/redirect.d.ts.map +0 -1
- package/dist/types/core/components/functional/router/router.d.ts +0 -46
- package/dist/types/core/components/functional/router/router.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +0 -59
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts +0 -6
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/sdui.d.ts +0 -145
- package/dist/types/core/components/functional/sdui/sdui.d.ts.map +0 -1
- package/dist/types/core/components/functional/sdui/types.d.ts +0 -38
- package/dist/types/core/components/functional/sdui/types.d.ts.map +0 -1
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts +0 -6
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts.map +0 -1
- package/dist/types/core/components/functional/states/states.d.ts +0 -42
- package/dist/types/core/components/functional/states/states.d.ts.map +0 -1
- package/dist/types/core/components/functional/submit/submit.d.ts +0 -37
- package/dist/types/core/components/functional/submit/submit.d.ts.map +0 -1
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts +0 -13
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts.map +0 -1
- package/dist/types/core/components/functional/translation/translation.d.ts +0 -7
- package/dist/types/core/components/functional/translation/translation.d.ts.map +0 -1
- package/dist/types/core/components/functional/value/value.d.ts +0 -8
- package/dist/types/core/components/functional/value/value.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/scroll.d.ts +0 -2
- package/dist/types/core/components/ui/_css/scroll.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/shadow.d.ts +0 -3
- package/dist/types/core/components/ui/_css/shadow.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/size.d.ts +0 -3
- package/dist/types/core/components/ui/_css/size.d.ts.map +0 -1
- package/dist/types/core/components/ui/_css/type.d.ts +0 -3
- package/dist/types/core/components/ui/_css/type.d.ts.map +0 -1
- package/dist/types/core/components/ui/alert/alert.d.ts +0 -37
- package/dist/types/core/components/ui/alert/alert.d.ts.map +0 -1
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts +0 -15
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts.map +0 -1
- package/dist/types/core/components/ui/badge/badge.d.ts +0 -27
- package/dist/types/core/components/ui/badge/badge.d.ts.map +0 -1
- package/dist/types/core/components/ui/button/button.d.ts +0 -180
- package/dist/types/core/components/ui/button/button.d.ts.map +0 -1
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts +0 -2
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts.map +0 -1
- package/dist/types/core/components/ui/captcha/captcha.d.ts +0 -30
- package/dist/types/core/components/ui/captcha/captcha.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-footer.d.ts +0 -6
- package/dist/types/core/components/ui/card/card-footer.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts +0 -6
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-header.d.ts +0 -9
- package/dist/types/core/components/ui/card/card-header.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card-main.d.ts +0 -6
- package/dist/types/core/components/ui/card/card-main.d.ts.map +0 -1
- package/dist/types/core/components/ui/card/card.d.ts +0 -13
- package/dist/types/core/components/ui/card/card.d.ts.map +0 -1
- package/dist/types/core/components/ui/divider/divider.d.ts +0 -16
- package/dist/types/core/components/ui/divider/divider.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts +0 -176
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/css/form-control.d.ts +0 -5
- package/dist/types/core/components/ui/form/css/form-control.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts +0 -24
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts +0 -6
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts +0 -17
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts +0 -8
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts +0 -13
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input/input.d.ts +0 -123
- package/dist/types/core/components/ui/form/input/input.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input/password-helper.d.ts +0 -26
- package/dist/types/core/components/ui/form/input/password-helper.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts +0 -17
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +0 -155
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/radio/radio.d.ts +0 -15
- package/dist/types/core/components/ui/form/radio/radio.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/select/select.d.ts +0 -59
- package/dist/types/core/components/ui/form/select/select.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/switch/switch.d.ts +0 -6
- package/dist/types/core/components/ui/form/switch/switch.d.ts.map +0 -1
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts +0 -94
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts.map +0 -1
- package/dist/types/core/components/ui/group/group.d.ts +0 -17
- package/dist/types/core/components/ui/group/group.d.ts.map +0 -1
- package/dist/types/core/components/ui/icon/icon.d.ts +0 -30
- package/dist/types/core/components/ui/icon/icon.d.ts.map +0 -1
- package/dist/types/core/components/ui/icon/icons.d.ts +0 -13
- package/dist/types/core/components/ui/icon/icons.d.ts.map +0 -1
- package/dist/types/core/components/ui/image/image.d.ts +0 -16
- package/dist/types/core/components/ui/image/image.d.ts.map +0 -1
- package/dist/types/core/components/ui/link/link.d.ts +0 -30
- package/dist/types/core/components/ui/link/link.d.ts.map +0 -1
- package/dist/types/core/components/ui/loader/loader.d.ts +0 -24
- package/dist/types/core/components/ui/loader/loader.d.ts.map +0 -1
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts +0 -2
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts.map +0 -1
- package/dist/types/core/components/ui/loader/styles/inline.d.ts +0 -2
- package/dist/types/core/components/ui/loader/styles/inline.d.ts.map +0 -1
- package/dist/types/core/components/ui/menu/menu-item.d.ts +0 -6
- package/dist/types/core/components/ui/menu/menu-item.d.ts.map +0 -1
- package/dist/types/core/components/ui/menu/menu.d.ts +0 -52
- package/dist/types/core/components/ui/menu/menu.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-actions.d.ts +0 -9
- package/dist/types/core/components/ui/modal/modal-actions.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-close.d.ts +0 -11
- package/dist/types/core/components/ui/modal/modal-close.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-content.d.ts +0 -6
- package/dist/types/core/components/ui/modal/modal-content.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts +0 -6
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-title.d.ts +0 -6
- package/dist/types/core/components/ui/modal/modal-title.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal-utils.d.ts +0 -4
- package/dist/types/core/components/ui/modal/modal-utils.d.ts.map +0 -1
- package/dist/types/core/components/ui/modal/modal.d.ts +0 -79
- package/dist/types/core/components/ui/modal/modal.d.ts.map +0 -1
- package/dist/types/core/components/ui/pop/pop.d.ts +0 -42
- package/dist/types/core/components/ui/pop/pop.d.ts.map +0 -1
- package/dist/types/core/components/ui/progress/progress.d.ts +0 -12
- package/dist/types/core/components/ui/progress/progress.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-caption.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-caption.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-tbody.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-tbody.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-td.d.ts +0 -13
- package/dist/types/core/components/ui/table/table-td.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-tfoot.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-tfoot.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-th.d.ts +0 -12
- package/dist/types/core/components/ui/table/table-th.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-thead.d.ts +0 -6
- package/dist/types/core/components/ui/table/table-thead.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table-tr.d.ts +0 -14
- package/dist/types/core/components/ui/table/table-tr.d.ts.map +0 -1
- package/dist/types/core/components/ui/table/table.d.ts +0 -18
- package/dist/types/core/components/ui/table/table.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts +0 -2
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts +0 -2
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts +0 -2
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts.map +0 -1
- package/dist/types/core/components/ui/theme/theme.d.ts +0 -20
- package/dist/types/core/components/ui/theme/theme.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts +0 -19
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/toast-item.d.ts +0 -41
- package/dist/types/core/components/ui/toast/toast-item.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/toast.d.ts +0 -28
- package/dist/types/core/components/ui/toast/toast.d.ts.map +0 -1
- package/dist/types/core/components/ui/toast/types.d.ts +0 -12
- package/dist/types/core/components/ui/toast/types.d.ts.map +0 -1
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts +0 -21
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts.map +0 -1
- package/dist/types/core/components/ui/ui.d.ts +0 -35
- package/dist/types/core/components/ui/ui.d.ts.map +0 -1
- package/dist/types/core/core.d.ts +0 -5
- package/dist/types/core/core.d.ts.map +0 -1
- package/dist/types/core/decorators/Subscriber.d.ts +0 -11
- package/dist/types/core/decorators/Subscriber.d.ts.map +0 -1
- package/dist/types/core/decorators/api.d.ts +0 -155
- package/dist/types/core/decorators/api.d.ts.map +0 -1
- package/dist/types/core/decorators/lifecycle.d.ts +0 -19
- package/dist/types/core/decorators/lifecycle.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts +0 -11
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/autoFill.d.ts +0 -2
- package/dist/types/core/decorators/subscriber/autoFill.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts +0 -2
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/bind.d.ts +0 -28
- package/dist/types/core/decorators/subscriber/bind.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/common.d.ts +0 -14
- package/dist/types/core/decorators/subscriber/common.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts +0 -23
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts +0 -42
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/handle.d.ts +0 -74
- package/dist/types/core/decorators/subscriber/handle.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/onAssign.d.ts +0 -53
- package/dist/types/core/decorators/subscriber/onAssign.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/publish.d.ts +0 -23
- package/dist/types/core/decorators/subscriber/publish.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts +0 -3
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts.map +0 -1
- package/dist/types/core/decorators/subscriber/subscribe.d.ts +0 -20
- package/dist/types/core/decorators/subscriber/subscribe.d.ts.map +0 -1
- package/dist/types/core/directives/DataProvider.d.ts +0 -45
- package/dist/types/core/directives/DataProvider.d.ts.map +0 -1
- package/dist/types/core/directives/Wording.d.ts +0 -44
- package/dist/types/core/directives/Wording.d.ts.map +0 -1
- package/dist/types/core/mixins/Fetcher.d.ts +0 -108
- package/dist/types/core/mixins/Fetcher.d.ts.map +0 -1
- package/dist/types/core/mixins/FormCheckable.d.ts +0 -95
- package/dist/types/core/mixins/FormCheckable.d.ts.map +0 -1
- package/dist/types/core/mixins/FormElement.d.ts +0 -37
- package/dist/types/core/mixins/FormElement.d.ts.map +0 -1
- package/dist/types/core/mixins/FormInput.d.ts +0 -79
- package/dist/types/core/mixins/FormInput.d.ts.map +0 -1
- package/dist/types/core/mixins/Subscriber.d.ts +0 -38
- package/dist/types/core/mixins/Subscriber.d.ts.map +0 -1
- package/dist/types/core/mixins/TemplatesContainer.d.ts +0 -14
- package/dist/types/core/mixins/TemplatesContainer.d.ts.map +0 -1
- package/dist/types/core/mixins/mixins.d.ts +0 -7
- package/dist/types/core/mixins/mixins.d.ts.map +0 -1
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts +0 -38
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts.map +0 -1
- package/dist/types/core/utils/Arrays.d.ts +0 -98
- package/dist/types/core/utils/Arrays.d.ts.map +0 -1
- package/dist/types/core/utils/DataBindObserver.d.ts +0 -84
- package/dist/types/core/utils/DataBindObserver.d.ts.map +0 -1
- package/dist/types/core/utils/Electron.d.ts +0 -8
- package/dist/types/core/utils/Electron.d.ts.map +0 -1
- package/dist/types/core/utils/Format.d.ts +0 -13
- package/dist/types/core/utils/Format.d.ts.map +0 -1
- package/dist/types/core/utils/HTML.d.ts +0 -79
- package/dist/types/core/utils/HTML.d.ts.map +0 -1
- package/dist/types/core/utils/LocationHandler.d.ts +0 -48
- package/dist/types/core/utils/LocationHandler.d.ts.map +0 -1
- package/dist/types/core/utils/Objects.d.ts +0 -31
- package/dist/types/core/utils/Objects.d.ts.map +0 -1
- package/dist/types/core/utils/PublisherProxy.d.ts +0 -230
- package/dist/types/core/utils/PublisherProxy.d.ts.map +0 -1
- package/dist/types/core/utils/SafariScrollGuard.d.ts +0 -36
- package/dist/types/core/utils/SafariScrollGuard.d.ts.map +0 -1
- package/dist/types/core/utils/Utils.d.ts +0 -6
- package/dist/types/core/utils/Utils.d.ts.map +0 -1
- package/dist/types/core/utils/aesCrypto.d.ts +0 -53
- package/dist/types/core/utils/aesCrypto.d.ts.map +0 -1
- package/dist/types/core/utils/api.d.ts +0 -173
- package/dist/types/core/utils/api.d.ts.map +0 -1
- package/dist/types/core/utils/dataProviderKey.d.ts +0 -56
- package/dist/types/core/utils/dataProviderKey.d.ts.map +0 -1
- package/dist/types/core/utils/endpoint.d.ts +0 -37
- package/dist/types/core/utils/endpoint.d.ts.map +0 -1
- package/dist/types/core/utils/route.d.ts +0 -41
- package/dist/types/core/utils/route.d.ts.map +0 -1
- package/dist/types/core/utils/url-pattern.d.ts +0 -3
- package/dist/types/core/utils/url-pattern.d.ts.map +0 -1
- package/dist/types/dataprovider.d.ts +0 -2
- package/dist/types/dataprovider.d.ts.map +0 -1
- package/dist/types/decorators.d.ts +0 -30
- package/dist/types/decorators.d.ts.map +0 -1
- package/dist/types/directives.d.ts +0 -21
- package/dist/types/directives.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/mixins.d.ts +0 -204
- package/dist/types/mixins.d.ts.map +0 -1
- package/dist/types/test-utils/TestUtils.d.ts +0 -4
- package/dist/types/test-utils/TestUtils.d.ts.map +0 -1
- package/dist/types/utils.d.ts +0 -18
- package/dist/types/utils.d.ts.map +0 -1
- package/docs/assets/index-DURr6O71.js +0 -11453
|
@@ -1,806 +0,0 @@
|
|
|
1
|
-
import HTML from "@supersoniks/concorde/core/utils/HTML";
|
|
2
|
-
import API from "@supersoniks/concorde/core/utils/api";
|
|
3
|
-
import { setSubscribable } from "./subscriber/common";
|
|
4
|
-
import { extractDynamicDependencies, resolveDynamicPath, } from "./subscriber/dynamicPath";
|
|
5
|
-
import { getDynamicWatchKeys, observeDynamicProperty, } from "./subscriber/dynamicPropertyWatch";
|
|
6
|
-
import { getPublisherFromPath } from "./subscriber/publisherPath";
|
|
7
|
-
function asSearchableHost(component) {
|
|
8
|
-
if (component instanceof HTMLElement || component instanceof ShadowRoot) {
|
|
9
|
-
return component;
|
|
10
|
-
}
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
function readApiConfigurationFromPublisher(publisher) {
|
|
14
|
-
if (!publisher || typeof publisher.get !== "function")
|
|
15
|
-
return null;
|
|
16
|
-
const raw = publisher.get();
|
|
17
|
-
if (!raw || typeof raw !== "object")
|
|
18
|
-
return null;
|
|
19
|
-
if (!("serviceURL" in raw))
|
|
20
|
-
return null;
|
|
21
|
-
return raw;
|
|
22
|
-
}
|
|
23
|
-
function resolveScopedConfiguration(component) {
|
|
24
|
-
const host = asSearchableHost(component);
|
|
25
|
-
if (!host)
|
|
26
|
-
return null;
|
|
27
|
-
return HTML.getApiConfiguration(host);
|
|
28
|
-
}
|
|
29
|
-
function isScopedConfigurationReady(config) {
|
|
30
|
-
return typeof config?.serviceURL === "string" && config.serviceURL.length > 0;
|
|
31
|
-
}
|
|
32
|
-
/** Attributs scope dont la présence peut déclencher un GET différé (Lit → minuscules). */
|
|
33
|
-
const SCOPE_WATCH_ATTRIBUTES = [
|
|
34
|
-
"serviceURL",
|
|
35
|
-
"serviceurl",
|
|
36
|
-
"token",
|
|
37
|
-
"credentials",
|
|
38
|
-
"tokenProvider",
|
|
39
|
-
"tokenprovider",
|
|
40
|
-
"userName",
|
|
41
|
-
"username",
|
|
42
|
-
"password",
|
|
43
|
-
"eventsApiToken",
|
|
44
|
-
"eventsapitoken",
|
|
45
|
-
];
|
|
46
|
-
function isLitHost(component) {
|
|
47
|
-
return (component instanceof HTMLElement &&
|
|
48
|
-
typeof component.updateComplete !== "undefined");
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Regroupe plusieurs déclencheurs synchrones (mutations `onInternalMutation`,
|
|
52
|
-
* `rebindAll`, etc.) en un seul appel par frame — même principe que
|
|
53
|
-
* `dynamicPropertyWatch.ts` (`scheduleObservedPropertyChanges`).
|
|
54
|
-
*/
|
|
55
|
-
function createAnimationFrameCoalescedRunner(run) {
|
|
56
|
-
let frameId = null;
|
|
57
|
-
let pending = [];
|
|
58
|
-
return () => {
|
|
59
|
-
const promise = new Promise((resolve, reject) => {
|
|
60
|
-
pending.push({ resolve, reject });
|
|
61
|
-
});
|
|
62
|
-
if (frameId !== null)
|
|
63
|
-
return promise;
|
|
64
|
-
frameId = requestAnimationFrame(() => {
|
|
65
|
-
frameId = null;
|
|
66
|
-
const current = pending;
|
|
67
|
-
pending = [];
|
|
68
|
-
void run().then((value) => current.forEach(({ resolve }) => resolve(value)), (reason) => current.forEach(({ reject }) => reject(reason)));
|
|
69
|
-
});
|
|
70
|
-
return promise;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function scheduleAfterHostReady(component, callback) {
|
|
74
|
-
if (isLitHost(component)) {
|
|
75
|
-
let cancelled = false;
|
|
76
|
-
void component.updateComplete.then(() => {
|
|
77
|
-
if (!cancelled)
|
|
78
|
-
callback();
|
|
79
|
-
});
|
|
80
|
-
return () => {
|
|
81
|
-
cancelled = true;
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// HTMLElement classique : config ancêtre déjà lisible ; sinon watchScopedConfiguration.
|
|
85
|
-
callback();
|
|
86
|
-
return () => { };
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Attend que la config scope soit lisible (attributs DOM ou propriétés Lit reflect).
|
|
90
|
-
*/
|
|
91
|
-
function watchScopedConfiguration(component, onReady) {
|
|
92
|
-
const host = asSearchableHost(component);
|
|
93
|
-
if (!host)
|
|
94
|
-
return () => { };
|
|
95
|
-
let settled = false;
|
|
96
|
-
const tryNotify = () => {
|
|
97
|
-
if (settled)
|
|
98
|
-
return;
|
|
99
|
-
if (!isScopedConfigurationReady(resolveScopedConfiguration(component))) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
settled = true;
|
|
103
|
-
onReady();
|
|
104
|
-
};
|
|
105
|
-
tryNotify();
|
|
106
|
-
if (settled)
|
|
107
|
-
return () => { };
|
|
108
|
-
const cleanups = [];
|
|
109
|
-
const rafId = requestAnimationFrame(() => tryNotify());
|
|
110
|
-
cleanups.push(() => cancelAnimationFrame(rafId));
|
|
111
|
-
queueMicrotask(() => tryNotify());
|
|
112
|
-
const observer = new MutationObserver(() => tryNotify());
|
|
113
|
-
let node = host;
|
|
114
|
-
while (node) {
|
|
115
|
-
if (node instanceof Element) {
|
|
116
|
-
observer.observe(node, {
|
|
117
|
-
attributes: true,
|
|
118
|
-
attributeFilter: [...SCOPE_WATCH_ATTRIBUTES],
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
node = (node.parentNode ||
|
|
122
|
-
node.host);
|
|
123
|
-
}
|
|
124
|
-
cleanups.push(() => observer.disconnect());
|
|
125
|
-
return () => {
|
|
126
|
-
settled = true;
|
|
127
|
-
cleanups.forEach((cleanup) => cleanup());
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Handle interne des décorateurs API.
|
|
132
|
-
*
|
|
133
|
-
* Le WeakMap cible l'instance connectée, pas la valeur de payload : une
|
|
134
|
-
* opération peut donc être relancée avant son premier résultat et reste
|
|
135
|
-
* indépendante d'une affectation manuelle de la propriété décorée.
|
|
136
|
-
*/
|
|
137
|
-
class ApiOperationController {
|
|
138
|
-
constructor() {
|
|
139
|
-
this.bindings = new WeakMap();
|
|
140
|
-
}
|
|
141
|
-
bind(component, run) {
|
|
142
|
-
const binding = { run };
|
|
143
|
-
let componentBindings = this.bindings.get(component);
|
|
144
|
-
if (!componentBindings) {
|
|
145
|
-
componentBindings = new Set();
|
|
146
|
-
this.bindings.set(component, componentBindings);
|
|
147
|
-
}
|
|
148
|
-
componentBindings.add(binding);
|
|
149
|
-
return () => {
|
|
150
|
-
const currentBindings = this.bindings.get(component);
|
|
151
|
-
if (!currentBindings)
|
|
152
|
-
return;
|
|
153
|
-
currentBindings.delete(binding);
|
|
154
|
-
if (currentBindings.size === 0) {
|
|
155
|
-
this.bindings.delete(component);
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
run(component) {
|
|
160
|
-
const runs = [...(this.bindings.get(component) ?? [])].map(({ run }) => run());
|
|
161
|
-
if (runs.length === 0)
|
|
162
|
-
return Promise.resolve(undefined);
|
|
163
|
-
if (runs.length === 1)
|
|
164
|
-
return runs[0];
|
|
165
|
-
return Promise.all(runs).then(() => undefined);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
let nextApiHandlerPropertyId = 0;
|
|
169
|
-
function isPromiseLike(value) {
|
|
170
|
-
return (value !== null &&
|
|
171
|
-
(typeof value === "object" || typeof value === "function") &&
|
|
172
|
-
typeof value.then === "function");
|
|
173
|
-
}
|
|
174
|
-
function createApiMethodActionDecorator(action, options) {
|
|
175
|
-
const when = options?.when ?? "after";
|
|
176
|
-
return (_target, _propertyKey, descriptor) => {
|
|
177
|
-
const original = descriptor.value;
|
|
178
|
-
if (!original)
|
|
179
|
-
return;
|
|
180
|
-
const wrapped = function (...args) {
|
|
181
|
-
if (when === "before") {
|
|
182
|
-
return action(this).then(() => original.apply(this, args));
|
|
183
|
-
}
|
|
184
|
-
const result = original.apply(this, args);
|
|
185
|
-
if (isPromiseLike(result)) {
|
|
186
|
-
return result.then((value) => {
|
|
187
|
-
return action(this).then(() => value);
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
return action(this).then(() => result);
|
|
191
|
-
};
|
|
192
|
-
descriptor.value = wrapped;
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
export function refetch(handle, options) {
|
|
196
|
-
return createApiMethodActionDecorator((component) => handle.refetch(component), options);
|
|
197
|
-
}
|
|
198
|
-
export function send(handle, options) {
|
|
199
|
-
return createApiMethodActionDecorator((component) => handle.send(component), options);
|
|
200
|
-
}
|
|
201
|
-
function detachConfigPublisher(state) {
|
|
202
|
-
if (state.configPublisher && state.configMutationHandler) {
|
|
203
|
-
state.configPublisher.offInternalMutation(state.configMutationHandler);
|
|
204
|
-
}
|
|
205
|
-
state.configPublisher = null;
|
|
206
|
-
state.configMutationHandler = null;
|
|
207
|
-
}
|
|
208
|
-
export function get(endpoint, configurationKeyOrOptions, maybeOptions) {
|
|
209
|
-
const pathTemplate = endpoint.path;
|
|
210
|
-
const configurationKey = isGetOptions(configurationKeyOrOptions)
|
|
211
|
-
? undefined
|
|
212
|
-
: configurationKeyOrOptions;
|
|
213
|
-
const options = isGetOptions(configurationKeyOrOptions)
|
|
214
|
-
? configurationKeyOrOptions
|
|
215
|
-
: maybeOptions;
|
|
216
|
-
const pathOptions = {
|
|
217
|
-
skipEmptyPlaceholder: options?.skipEmptyPlaceholder,
|
|
218
|
-
};
|
|
219
|
-
const configurationKeyPath = configurationKey?.path;
|
|
220
|
-
const triggerKeyPath = options?.triggerKey?.path;
|
|
221
|
-
const endpointDynamicDependencies = extractDynamicDependencies(pathTemplate);
|
|
222
|
-
const configKeyDynamicDependencies = configurationKeyPath
|
|
223
|
-
? extractDynamicDependencies(configurationKeyPath)
|
|
224
|
-
: [];
|
|
225
|
-
const triggerKeyDynamicDependencies = triggerKeyPath
|
|
226
|
-
? extractDynamicDependencies(triggerKeyPath)
|
|
227
|
-
: [];
|
|
228
|
-
const mergedDynamicDependencies = [
|
|
229
|
-
...new Set([
|
|
230
|
-
...endpointDynamicDependencies,
|
|
231
|
-
...configKeyDynamicDependencies,
|
|
232
|
-
...triggerKeyDynamicDependencies,
|
|
233
|
-
]),
|
|
234
|
-
];
|
|
235
|
-
const isDynamicPath = endpointDynamicDependencies.length > 0;
|
|
236
|
-
const usesPublisherConfig = Boolean(configurationKeyPath);
|
|
237
|
-
const refetchEveryMs = options?.refetchEveryMs ?? 0;
|
|
238
|
-
const operationController = new ApiOperationController();
|
|
239
|
-
const resultHandlers = new WeakMap();
|
|
240
|
-
const decoratedTargets = new WeakSet();
|
|
241
|
-
const operationPropertyKeys = new WeakMap();
|
|
242
|
-
let handlerPropertyKey;
|
|
243
|
-
const decorator = function (target, propertyKey, descriptor) {
|
|
244
|
-
if (descriptor) {
|
|
245
|
-
const handler = descriptor.value;
|
|
246
|
-
if (!handler)
|
|
247
|
-
return;
|
|
248
|
-
decorator.registerResultHandler(target, (component, payload) => handler.call(component, payload));
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
if (!target)
|
|
252
|
-
return;
|
|
253
|
-
if (decoratedTargets.has(target)) {
|
|
254
|
-
operationPropertyKeys.get(target)?.add(propertyKey);
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
decoratedTargets.add(target);
|
|
258
|
-
operationPropertyKeys.set(target, new Set([propertyKey]));
|
|
259
|
-
setSubscribable(target);
|
|
260
|
-
const stateKey = `__get_state_${propertyKey}`;
|
|
261
|
-
target.__onConnected__((component) => {
|
|
262
|
-
const comp = component;
|
|
263
|
-
let state = comp[stateKey];
|
|
264
|
-
if (!state) {
|
|
265
|
-
state = {
|
|
266
|
-
cleanupWatchers: [],
|
|
267
|
-
cleanupOperation: null,
|
|
268
|
-
requestGeneration: 0,
|
|
269
|
-
configPublisher: null,
|
|
270
|
-
configMutationHandler: null,
|
|
271
|
-
scopeWatchCleanup: null,
|
|
272
|
-
triggerPublisher: null,
|
|
273
|
-
triggerInvalidateHandler: null,
|
|
274
|
-
refetchTimeoutId: null,
|
|
275
|
-
refetchEveryMs,
|
|
276
|
-
};
|
|
277
|
-
comp[stateKey] = state;
|
|
278
|
-
}
|
|
279
|
-
state.cleanupOperation?.();
|
|
280
|
-
state.cleanupOperation = null;
|
|
281
|
-
state.cleanupWatchers.forEach((cleanup) => cleanup());
|
|
282
|
-
state.cleanupWatchers = [];
|
|
283
|
-
state.requestGeneration++;
|
|
284
|
-
state.refetchEveryMs = refetchEveryMs;
|
|
285
|
-
clearRefetch(state);
|
|
286
|
-
const scheduleRefetch = () => {
|
|
287
|
-
clearRefetch(state);
|
|
288
|
-
if (!state.refetchEveryMs || state.refetchEveryMs <= 0)
|
|
289
|
-
return;
|
|
290
|
-
state.refetchTimeoutId = setTimeout(() => {
|
|
291
|
-
state.refetchTimeoutId = null;
|
|
292
|
-
void runFetch().catch(() => { });
|
|
293
|
-
}, state.refetchEveryMs);
|
|
294
|
-
};
|
|
295
|
-
const assignPayload = (payload) => {
|
|
296
|
-
operationPropertyKeys.get(target)?.forEach((key) => {
|
|
297
|
-
comp[key] = payload;
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
const runFetch = async () => {
|
|
301
|
-
const resolution = isDynamicPath
|
|
302
|
-
? resolveDynamicPath(component, pathTemplate, pathOptions)
|
|
303
|
-
: { ready: true, path: pathTemplate };
|
|
304
|
-
if (!resolution.ready || !resolution.path) {
|
|
305
|
-
assignPayload(undefined);
|
|
306
|
-
scheduleRefetch();
|
|
307
|
-
return undefined;
|
|
308
|
-
}
|
|
309
|
-
let config = null;
|
|
310
|
-
if (usesPublisherConfig && configurationKeyPath) {
|
|
311
|
-
const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions);
|
|
312
|
-
if (!configRes.ready || !configRes.path) {
|
|
313
|
-
assignPayload(undefined);
|
|
314
|
-
scheduleRefetch();
|
|
315
|
-
return undefined;
|
|
316
|
-
}
|
|
317
|
-
const configPublisher = getPublisherFromPath(configRes.path);
|
|
318
|
-
config = readApiConfigurationFromPublisher(configPublisher);
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
config = resolveScopedConfiguration(component);
|
|
322
|
-
}
|
|
323
|
-
if (!isScopedConfigurationReady(config)) {
|
|
324
|
-
if (!usesPublisherConfig && !state.scopeWatchCleanup) {
|
|
325
|
-
const scopeWatch = watchScopedConfiguration(component, scheduleFetchAndIgnoreErrors);
|
|
326
|
-
state.scopeWatchCleanup = scopeWatch;
|
|
327
|
-
state.cleanupWatchers.push(() => {
|
|
328
|
-
scopeWatch();
|
|
329
|
-
state.scopeWatchCleanup = null;
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
scheduleRefetch();
|
|
333
|
-
return undefined;
|
|
334
|
-
}
|
|
335
|
-
const generation = ++state.requestGeneration;
|
|
336
|
-
const api = new API(config);
|
|
337
|
-
const payload = await api.getDetailed(resolution.path);
|
|
338
|
-
if (generation !== state.requestGeneration)
|
|
339
|
-
return payload;
|
|
340
|
-
operationPropertyKeys.get(target)?.forEach((key) => {
|
|
341
|
-
comp[key] = payload;
|
|
342
|
-
});
|
|
343
|
-
scheduleRefetch();
|
|
344
|
-
resultHandlers
|
|
345
|
-
.get(target)
|
|
346
|
-
?.forEach((handler) => handler(component, payload));
|
|
347
|
-
return payload;
|
|
348
|
-
};
|
|
349
|
-
const scheduleFetch = createAnimationFrameCoalescedRunner(runFetch);
|
|
350
|
-
const scheduleFetchAndIgnoreErrors = () => {
|
|
351
|
-
void scheduleFetch().catch(() => { });
|
|
352
|
-
};
|
|
353
|
-
state.cleanupOperation = operationController.bind(component, scheduleFetch);
|
|
354
|
-
const rebindTriggerPublisher = () => {
|
|
355
|
-
detachTriggerPublisher(state);
|
|
356
|
-
if (!triggerKeyPath)
|
|
357
|
-
return;
|
|
358
|
-
const triggerResolution = resolveDynamicPath(component, triggerKeyPath, pathOptions);
|
|
359
|
-
if (!triggerResolution.ready || !triggerResolution.path) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
const publisher = getPublisherFromPath(triggerResolution.path);
|
|
363
|
-
if (!publisher)
|
|
364
|
-
return;
|
|
365
|
-
const invalidateHandler = scheduleFetchAndIgnoreErrors;
|
|
366
|
-
publisher.onInvalidate(invalidateHandler);
|
|
367
|
-
state.triggerPublisher = publisher;
|
|
368
|
-
state.triggerInvalidateHandler = invalidateHandler;
|
|
369
|
-
};
|
|
370
|
-
const rebindPublisherConfig = () => {
|
|
371
|
-
if (!usesPublisherConfig || !configurationKeyPath)
|
|
372
|
-
return;
|
|
373
|
-
detachConfigPublisher(state);
|
|
374
|
-
const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions);
|
|
375
|
-
if (!configRes.ready || !configRes.path) {
|
|
376
|
-
assignPayload(undefined);
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
const publisher = getPublisherFromPath(configRes.path);
|
|
380
|
-
if (!publisher) {
|
|
381
|
-
assignPayload(undefined);
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
const mutationHandler = scheduleFetchAndIgnoreErrors;
|
|
385
|
-
publisher.onInternalMutation(mutationHandler);
|
|
386
|
-
state.configPublisher = publisher;
|
|
387
|
-
state.configMutationHandler = mutationHandler;
|
|
388
|
-
};
|
|
389
|
-
const rebindAll = () => {
|
|
390
|
-
rebindTriggerPublisher();
|
|
391
|
-
rebindPublisherConfig();
|
|
392
|
-
if (!usesPublisherConfig) {
|
|
393
|
-
scheduleFetchAndIgnoreErrors();
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
if (usesPublisherConfig || triggerKeyDynamicDependencies.length) {
|
|
397
|
-
for (const dependency of mergedDynamicDependencies) {
|
|
398
|
-
const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, () => rebindAll());
|
|
399
|
-
state.cleanupWatchers.push(unsubscribe);
|
|
400
|
-
}
|
|
401
|
-
rebindAll();
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
const startScopedFetch = () => {
|
|
405
|
-
if (isDynamicPath) {
|
|
406
|
-
for (const dependency of endpointDynamicDependencies) {
|
|
407
|
-
const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, scheduleFetchAndIgnoreErrors);
|
|
408
|
-
state.cleanupWatchers.push(unsubscribe);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
rebindTriggerPublisher();
|
|
412
|
-
void runFetch().catch(() => { });
|
|
413
|
-
};
|
|
414
|
-
state.cleanupWatchers.push(scheduleAfterHostReady(component, startScopedFetch));
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
target.__onDisconnected__((component) => {
|
|
418
|
-
const comp = component;
|
|
419
|
-
const state = comp[stateKey];
|
|
420
|
-
if (!state)
|
|
421
|
-
return;
|
|
422
|
-
state.cleanupOperation?.();
|
|
423
|
-
state.cleanupOperation = null;
|
|
424
|
-
detachConfigPublisher(state);
|
|
425
|
-
detachTriggerPublisher(state);
|
|
426
|
-
clearRefetch(state);
|
|
427
|
-
state.cleanupWatchers.forEach((cleanup) => cleanup());
|
|
428
|
-
state.cleanupWatchers = [];
|
|
429
|
-
state.requestGeneration++;
|
|
430
|
-
operationPropertyKeys.get(target)?.forEach((key) => {
|
|
431
|
-
comp[key] = undefined;
|
|
432
|
-
});
|
|
433
|
-
});
|
|
434
|
-
};
|
|
435
|
-
decorator.refetch = (component) => {
|
|
436
|
-
return operationController.run(component);
|
|
437
|
-
};
|
|
438
|
-
decorator.registerResultHandler = (target, handler) => {
|
|
439
|
-
let handlers = resultHandlers.get(target);
|
|
440
|
-
if (!handlers) {
|
|
441
|
-
handlers = new Set();
|
|
442
|
-
resultHandlers.set(target, handlers);
|
|
443
|
-
}
|
|
444
|
-
handlers.add(handler);
|
|
445
|
-
if (!decoratedTargets.has(target)) {
|
|
446
|
-
handlerPropertyKey ??= `__get_handler_${nextApiHandlerPropertyId++}`;
|
|
447
|
-
decorator(target, handlerPropertyKey);
|
|
448
|
-
}
|
|
449
|
-
};
|
|
450
|
-
return decorator;
|
|
451
|
-
}
|
|
452
|
-
function isGetOptions(value) {
|
|
453
|
-
if (!value || typeof value !== "object")
|
|
454
|
-
return false;
|
|
455
|
-
return ("skipEmptyPlaceholder" in value ||
|
|
456
|
-
"refetchEveryMs" in value ||
|
|
457
|
-
"triggerKey" in value);
|
|
458
|
-
}
|
|
459
|
-
function isApiSendOptions(value) {
|
|
460
|
-
if (!value || typeof value !== "object")
|
|
461
|
-
return false;
|
|
462
|
-
return ("refetchEveryMs" in value ||
|
|
463
|
-
"skipIfBodyMissing" in value ||
|
|
464
|
-
"autoPostOnBodyMutation" in value ||
|
|
465
|
-
"skipEmptyPlaceholder" in value ||
|
|
466
|
-
"triggerKey" in value);
|
|
467
|
-
}
|
|
468
|
-
function detachBodyPublisher(state) {
|
|
469
|
-
if (state.bodyPublisher && state.bodyMutationHandler) {
|
|
470
|
-
state.bodyPublisher.offInternalMutation(state.bodyMutationHandler);
|
|
471
|
-
}
|
|
472
|
-
state.bodyPublisher = null;
|
|
473
|
-
state.bodyMutationHandler = null;
|
|
474
|
-
}
|
|
475
|
-
function detachTriggerPublisher(state) {
|
|
476
|
-
if (state.triggerPublisher && state.triggerInvalidateHandler) {
|
|
477
|
-
state.triggerPublisher.offInvalidate(state.triggerInvalidateHandler);
|
|
478
|
-
}
|
|
479
|
-
state.triggerPublisher = null;
|
|
480
|
-
state.triggerInvalidateHandler = null;
|
|
481
|
-
}
|
|
482
|
-
function clearRefetch(state) {
|
|
483
|
-
if (state.refetchTimeoutId) {
|
|
484
|
-
clearTimeout(state.refetchTimeoutId);
|
|
485
|
-
state.refetchTimeoutId = null;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
function readBodyFromPublisher(publisher) {
|
|
489
|
-
if (!publisher || typeof publisher.get !== "function")
|
|
490
|
-
return undefined;
|
|
491
|
-
return publisher.get();
|
|
492
|
-
}
|
|
493
|
-
function createApiSendDecorator(method, callDetailed) {
|
|
494
|
-
return function (endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) {
|
|
495
|
-
const pathTemplate = endpoint.path;
|
|
496
|
-
const bodyKeyPath = bodyKey.path;
|
|
497
|
-
const configurationKey = isApiSendOptions(configurationKeyOrOptions)
|
|
498
|
-
? undefined
|
|
499
|
-
: configurationKeyOrOptions;
|
|
500
|
-
const options = isApiSendOptions(configurationKeyOrOptions)
|
|
501
|
-
? configurationKeyOrOptions
|
|
502
|
-
: maybeOptions;
|
|
503
|
-
const configurationKeyPath = configurationKey?.path;
|
|
504
|
-
const triggerKeyPath = options?.triggerKey?.path;
|
|
505
|
-
const endpointDynamicDependencies = extractDynamicDependencies(pathTemplate);
|
|
506
|
-
const bodyKeyDynamicDependencies = extractDynamicDependencies(bodyKeyPath);
|
|
507
|
-
const configKeyDynamicDependencies = configurationKeyPath
|
|
508
|
-
? extractDynamicDependencies(configurationKeyPath)
|
|
509
|
-
: [];
|
|
510
|
-
const triggerKeyDynamicDependencies = triggerKeyPath
|
|
511
|
-
? extractDynamicDependencies(triggerKeyPath)
|
|
512
|
-
: [];
|
|
513
|
-
const mergedDynamicDependencies = [
|
|
514
|
-
...new Set([
|
|
515
|
-
...endpointDynamicDependencies,
|
|
516
|
-
...bodyKeyDynamicDependencies,
|
|
517
|
-
...configKeyDynamicDependencies,
|
|
518
|
-
...triggerKeyDynamicDependencies,
|
|
519
|
-
]),
|
|
520
|
-
];
|
|
521
|
-
const isDynamicPath = endpointDynamicDependencies.length > 0;
|
|
522
|
-
const usesPublisherConfig = Boolean(configurationKeyPath);
|
|
523
|
-
const refetchEveryMs = options?.refetchEveryMs ?? 0;
|
|
524
|
-
const skipIfBodyMissing = options?.skipIfBodyMissing ?? true;
|
|
525
|
-
const autoPostOnBodyMutation = options?.autoPostOnBodyMutation ?? true;
|
|
526
|
-
const pathOptions = {
|
|
527
|
-
skipEmptyPlaceholder: options?.skipEmptyPlaceholder,
|
|
528
|
-
};
|
|
529
|
-
const stateKeyPrefix = `__${method.toLowerCase()}_state_`;
|
|
530
|
-
const operationController = new ApiOperationController();
|
|
531
|
-
const resultHandlers = new WeakMap();
|
|
532
|
-
const decoratedTargets = new WeakSet();
|
|
533
|
-
const operationPropertyKeys = new WeakMap();
|
|
534
|
-
let handlerPropertyKey;
|
|
535
|
-
const decorator = function (target, propertyKey, descriptor) {
|
|
536
|
-
if (descriptor) {
|
|
537
|
-
const handler = descriptor.value;
|
|
538
|
-
if (!handler)
|
|
539
|
-
return;
|
|
540
|
-
decorator.registerResultHandler(target, (component, payload) => handler.call(component, payload));
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
if (!target)
|
|
544
|
-
return;
|
|
545
|
-
if (decoratedTargets.has(target)) {
|
|
546
|
-
operationPropertyKeys.get(target)?.add(propertyKey);
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
decoratedTargets.add(target);
|
|
550
|
-
operationPropertyKeys.set(target, new Set([propertyKey]));
|
|
551
|
-
setSubscribable(target);
|
|
552
|
-
const stateKey = `${stateKeyPrefix}${propertyKey}`;
|
|
553
|
-
target.__onConnected__((component) => {
|
|
554
|
-
const comp = component;
|
|
555
|
-
let state = comp[stateKey];
|
|
556
|
-
if (!state) {
|
|
557
|
-
state = {
|
|
558
|
-
cleanupWatchers: [],
|
|
559
|
-
cleanupOperation: null,
|
|
560
|
-
requestGeneration: 0,
|
|
561
|
-
configPublisher: null,
|
|
562
|
-
configMutationHandler: null,
|
|
563
|
-
scopeWatchCleanup: null,
|
|
564
|
-
bodyPublisher: null,
|
|
565
|
-
bodyMutationHandler: null,
|
|
566
|
-
triggerPublisher: null,
|
|
567
|
-
triggerInvalidateHandler: null,
|
|
568
|
-
refetchTimeoutId: null,
|
|
569
|
-
refetchEveryMs,
|
|
570
|
-
skipIfBodyMissing,
|
|
571
|
-
autoPostOnBodyMutation,
|
|
572
|
-
};
|
|
573
|
-
comp[stateKey] = state;
|
|
574
|
-
}
|
|
575
|
-
state.cleanupOperation?.();
|
|
576
|
-
state.cleanupOperation = null;
|
|
577
|
-
state.cleanupWatchers.forEach((cleanup) => cleanup());
|
|
578
|
-
state.cleanupWatchers = [];
|
|
579
|
-
state.requestGeneration++;
|
|
580
|
-
state.refetchEveryMs = refetchEveryMs;
|
|
581
|
-
state.skipIfBodyMissing = skipIfBodyMissing;
|
|
582
|
-
state.autoPostOnBodyMutation = autoPostOnBodyMutation;
|
|
583
|
-
clearRefetch(state);
|
|
584
|
-
const scheduleRefetch = () => {
|
|
585
|
-
clearRefetch(state);
|
|
586
|
-
if (!state.refetchEveryMs || state.refetchEveryMs <= 0)
|
|
587
|
-
return;
|
|
588
|
-
state.refetchTimeoutId = setTimeout(() => {
|
|
589
|
-
state.refetchTimeoutId = null;
|
|
590
|
-
void runSend().catch(() => { });
|
|
591
|
-
}, state.refetchEveryMs);
|
|
592
|
-
};
|
|
593
|
-
const assignPayload = (payload) => {
|
|
594
|
-
operationPropertyKeys.get(target)?.forEach((key) => {
|
|
595
|
-
comp[key] = payload;
|
|
596
|
-
});
|
|
597
|
-
};
|
|
598
|
-
const runSend = async () => {
|
|
599
|
-
const resolution = isDynamicPath
|
|
600
|
-
? resolveDynamicPath(component, pathTemplate, pathOptions)
|
|
601
|
-
: { ready: true, path: pathTemplate };
|
|
602
|
-
if (!resolution.ready || !resolution.path) {
|
|
603
|
-
assignPayload(undefined);
|
|
604
|
-
scheduleRefetch();
|
|
605
|
-
return undefined;
|
|
606
|
-
}
|
|
607
|
-
const bodyResolution = resolveDynamicPath(component, bodyKeyPath, pathOptions);
|
|
608
|
-
if (!bodyResolution.ready || !bodyResolution.path) {
|
|
609
|
-
assignPayload(undefined);
|
|
610
|
-
scheduleRefetch();
|
|
611
|
-
return undefined;
|
|
612
|
-
}
|
|
613
|
-
const bodyPublisher = getPublisherFromPath(bodyResolution.path);
|
|
614
|
-
const body = readBodyFromPublisher(bodyPublisher);
|
|
615
|
-
if (state.skipIfBodyMissing &&
|
|
616
|
-
(body === null || body === undefined)) {
|
|
617
|
-
scheduleRefetch();
|
|
618
|
-
return undefined;
|
|
619
|
-
}
|
|
620
|
-
let config = null;
|
|
621
|
-
if (usesPublisherConfig && configurationKeyPath) {
|
|
622
|
-
const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions);
|
|
623
|
-
if (!configRes.ready || !configRes.path) {
|
|
624
|
-
assignPayload(undefined);
|
|
625
|
-
scheduleRefetch();
|
|
626
|
-
return undefined;
|
|
627
|
-
}
|
|
628
|
-
const configPublisher = getPublisherFromPath(configRes.path);
|
|
629
|
-
config = readApiConfigurationFromPublisher(configPublisher);
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
config = resolveScopedConfiguration(component);
|
|
633
|
-
}
|
|
634
|
-
if (!isScopedConfigurationReady(config)) {
|
|
635
|
-
if (!usesPublisherConfig && !state.scopeWatchCleanup) {
|
|
636
|
-
const scopeWatch = watchScopedConfiguration(component, scheduleSendAndIgnoreErrors);
|
|
637
|
-
state.scopeWatchCleanup = scopeWatch;
|
|
638
|
-
state.cleanupWatchers.push(() => {
|
|
639
|
-
scopeWatch();
|
|
640
|
-
state.scopeWatchCleanup = null;
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
scheduleRefetch();
|
|
644
|
-
return undefined;
|
|
645
|
-
}
|
|
646
|
-
const generation = ++state.requestGeneration;
|
|
647
|
-
const api = new API(config);
|
|
648
|
-
let payload;
|
|
649
|
-
try {
|
|
650
|
-
payload = await callDetailed(api, resolution.path, body);
|
|
651
|
-
}
|
|
652
|
-
catch (error) {
|
|
653
|
-
if (generation === state.requestGeneration) {
|
|
654
|
-
resultHandlers
|
|
655
|
-
.get(target)
|
|
656
|
-
?.forEach((handler) => handler(component, undefined));
|
|
657
|
-
}
|
|
658
|
-
throw error;
|
|
659
|
-
}
|
|
660
|
-
if (generation !== state.requestGeneration)
|
|
661
|
-
return payload;
|
|
662
|
-
assignPayload(payload);
|
|
663
|
-
scheduleRefetch();
|
|
664
|
-
resultHandlers
|
|
665
|
-
.get(target)
|
|
666
|
-
?.forEach((handler) => handler(component, payload));
|
|
667
|
-
return payload;
|
|
668
|
-
};
|
|
669
|
-
const scheduleSend = createAnimationFrameCoalescedRunner(runSend);
|
|
670
|
-
const scheduleSendAndIgnoreErrors = () => {
|
|
671
|
-
void scheduleSend().catch(() => { });
|
|
672
|
-
};
|
|
673
|
-
state.cleanupOperation = operationController.bind(component, scheduleSend);
|
|
674
|
-
const rebindBodyPublisher = () => {
|
|
675
|
-
detachBodyPublisher(state);
|
|
676
|
-
if (!state.autoPostOnBodyMutation) {
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
const bodyResolution = resolveDynamicPath(component, bodyKeyPath, pathOptions);
|
|
680
|
-
if (!bodyResolution.ready || !bodyResolution.path) {
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
const publisher = getPublisherFromPath(bodyResolution.path);
|
|
684
|
-
if (!publisher)
|
|
685
|
-
return;
|
|
686
|
-
const mutationHandler = scheduleSendAndIgnoreErrors;
|
|
687
|
-
publisher.onInternalMutation(mutationHandler);
|
|
688
|
-
state.bodyPublisher = publisher;
|
|
689
|
-
state.bodyMutationHandler = mutationHandler;
|
|
690
|
-
};
|
|
691
|
-
const rebindTriggerPublisher = () => {
|
|
692
|
-
detachTriggerPublisher(state);
|
|
693
|
-
if (!triggerKeyPath)
|
|
694
|
-
return;
|
|
695
|
-
const triggerResolution = resolveDynamicPath(component, triggerKeyPath, pathOptions);
|
|
696
|
-
if (!triggerResolution.ready || !triggerResolution.path) {
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
const publisher = getPublisherFromPath(triggerResolution.path);
|
|
700
|
-
if (!publisher)
|
|
701
|
-
return;
|
|
702
|
-
const invalidateHandler = scheduleSendAndIgnoreErrors;
|
|
703
|
-
publisher.onInvalidate(invalidateHandler);
|
|
704
|
-
state.triggerPublisher = publisher;
|
|
705
|
-
state.triggerInvalidateHandler = invalidateHandler;
|
|
706
|
-
};
|
|
707
|
-
const rebindPublisherConfig = () => {
|
|
708
|
-
if (!usesPublisherConfig || !configurationKeyPath)
|
|
709
|
-
return;
|
|
710
|
-
detachConfigPublisher(state);
|
|
711
|
-
const configRes = resolveDynamicPath(component, configurationKeyPath, pathOptions);
|
|
712
|
-
if (!configRes.ready || !configRes.path) {
|
|
713
|
-
assignPayload(undefined);
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
const publisher = getPublisherFromPath(configRes.path);
|
|
717
|
-
if (!publisher) {
|
|
718
|
-
assignPayload(undefined);
|
|
719
|
-
return;
|
|
720
|
-
}
|
|
721
|
-
const mutationHandler = scheduleSendAndIgnoreErrors;
|
|
722
|
-
publisher.onInternalMutation(mutationHandler);
|
|
723
|
-
state.configPublisher = publisher;
|
|
724
|
-
state.configMutationHandler = mutationHandler;
|
|
725
|
-
};
|
|
726
|
-
const rebindAll = () => {
|
|
727
|
-
rebindBodyPublisher();
|
|
728
|
-
rebindTriggerPublisher();
|
|
729
|
-
rebindPublisherConfig();
|
|
730
|
-
if (state.autoPostOnBodyMutation) {
|
|
731
|
-
scheduleSendAndIgnoreErrors();
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
if (usesPublisherConfig ||
|
|
735
|
-
bodyKeyDynamicDependencies.length ||
|
|
736
|
-
triggerKeyDynamicDependencies.length) {
|
|
737
|
-
for (const dependency of mergedDynamicDependencies) {
|
|
738
|
-
const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, () => rebindAll());
|
|
739
|
-
state.cleanupWatchers.push(unsubscribe);
|
|
740
|
-
}
|
|
741
|
-
rebindAll();
|
|
742
|
-
}
|
|
743
|
-
else {
|
|
744
|
-
const startScopedSend = () => {
|
|
745
|
-
if (isDynamicPath) {
|
|
746
|
-
for (const dependency of endpointDynamicDependencies) {
|
|
747
|
-
const unsubscribe = observeDynamicProperty(getDynamicWatchKeys.watcherStore, getDynamicWatchKeys.hooked, component, dependency, scheduleSendAndIgnoreErrors);
|
|
748
|
-
state.cleanupWatchers.push(unsubscribe);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
rebindBodyPublisher();
|
|
752
|
-
rebindTriggerPublisher();
|
|
753
|
-
if (state.autoPostOnBodyMutation) {
|
|
754
|
-
scheduleSendAndIgnoreErrors();
|
|
755
|
-
}
|
|
756
|
-
};
|
|
757
|
-
state.cleanupWatchers.push(scheduleAfterHostReady(component, startScopedSend));
|
|
758
|
-
}
|
|
759
|
-
});
|
|
760
|
-
target.__onDisconnected__((component) => {
|
|
761
|
-
const comp = component;
|
|
762
|
-
const state = comp[stateKey];
|
|
763
|
-
if (!state)
|
|
764
|
-
return;
|
|
765
|
-
state.cleanupOperation?.();
|
|
766
|
-
state.cleanupOperation = null;
|
|
767
|
-
detachConfigPublisher(state);
|
|
768
|
-
detachBodyPublisher(state);
|
|
769
|
-
detachTriggerPublisher(state);
|
|
770
|
-
clearRefetch(state);
|
|
771
|
-
state.cleanupWatchers.forEach((cleanup) => cleanup());
|
|
772
|
-
state.cleanupWatchers = [];
|
|
773
|
-
state.requestGeneration++;
|
|
774
|
-
operationPropertyKeys.get(target)?.forEach((key) => {
|
|
775
|
-
comp[key] = undefined;
|
|
776
|
-
});
|
|
777
|
-
});
|
|
778
|
-
};
|
|
779
|
-
decorator.send = (component) => {
|
|
780
|
-
return operationController.run(component);
|
|
781
|
-
};
|
|
782
|
-
decorator.registerResultHandler = (target, handler) => {
|
|
783
|
-
let handlers = resultHandlers.get(target);
|
|
784
|
-
if (!handlers) {
|
|
785
|
-
handlers = new Set();
|
|
786
|
-
resultHandlers.set(target, handlers);
|
|
787
|
-
}
|
|
788
|
-
handlers.add(handler);
|
|
789
|
-
if (!decoratedTargets.has(target)) {
|
|
790
|
-
handlerPropertyKey ??= `__${method.toLowerCase()}_handler_${nextApiHandlerPropertyId++}`;
|
|
791
|
-
decorator(target, handlerPropertyKey);
|
|
792
|
-
}
|
|
793
|
-
};
|
|
794
|
-
return decorator;
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
export function post(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) {
|
|
798
|
-
return createApiSendDecorator("POST", (api, path, body) => api.postDetailed(path, body))(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions);
|
|
799
|
-
}
|
|
800
|
-
export function put(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) {
|
|
801
|
-
return createApiSendDecorator("PUT", (api, path, body) => api.putDetailed(path, body))(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions);
|
|
802
|
-
}
|
|
803
|
-
export function patch(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions) {
|
|
804
|
-
return createApiSendDecorator("PATCH", (api, path, body) => api.patchDetailed(path, body))(endpoint, bodyKey, configurationKeyOrOptions, maybeOptions);
|
|
805
|
-
}
|
|
806
|
-
//# sourceMappingURL=api.js.map
|