@supersoniks/concorde 4.7.4 → 4.9.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/.github/workflows/ci.yml +21 -0
- package/.github-export-ignore +30 -0
- package/.gitlab-ci.yml +13 -0
- package/CONTRIBUTING.md +59 -0
- package/DEV.md +54 -0
- package/LICENSE +21 -0
- package/OPEN_SOURCE_CHECKPOINT.md +133 -0
- package/README.md +30 -16
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde-scope/SKILL.md +2 -2
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +214 -214
- package/concorde-core.es.js +4517 -4133
- package/dist/concorde-core.bundle.js +214 -214
- package/dist/concorde-core.es.js +4517 -4133
- package/dist/docs-mock-api-sw.js +19 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/dist/js/components.js +12 -0
- package/dist/js/components.js.map +1 -0
- package/dist/js/concorde-loaded.js +5 -0
- package/dist/js/concorde-loaded.js.map +1 -0
- package/dist/js/core/_types/endpoint.js +5 -0
- package/dist/js/core/_types/endpoint.js.map +1 -0
- package/dist/js/core/_types/key.js +2 -0
- package/dist/js/core/_types/key.js.map +1 -0
- package/dist/js/core/_types/types.js +3 -0
- package/dist/js/core/_types/types.js.map +1 -0
- package/dist/js/core/components/functional/date/date.js +272 -0
- package/dist/js/core/components/functional/date/date.js.map +1 -0
- package/dist/js/core/components/functional/example/example.js +44 -0
- package/dist/js/core/components/functional/example/example.js.map +1 -0
- package/dist/js/core/components/functional/fetch/fetch.js +79 -0
- package/dist/js/core/components/functional/fetch/fetch.js.map +1 -0
- package/dist/js/core/components/functional/functional.js +17 -0
- package/dist/js/core/components/functional/functional.js.map +1 -0
- package/dist/js/core/components/functional/if/if.js +39 -0
- package/dist/js/core/components/functional/if/if.js.map +1 -0
- package/dist/js/core/components/functional/list/list.js +341 -0
- package/dist/js/core/components/functional/list/list.js.map +1 -0
- package/dist/js/core/components/functional/mix/mix.js +103 -0
- package/dist/js/core/components/functional/mix/mix.js.map +1 -0
- package/dist/js/core/components/functional/queue/queue.js +386 -0
- package/dist/js/core/components/functional/queue/queue.js.map +1 -0
- package/dist/js/core/components/functional/router/redirect.js +54 -0
- package/dist/js/core/components/functional/router/redirect.js.map +1 -0
- package/dist/js/core/components/functional/router/router.js +179 -0
- package/dist/js/core/components/functional/router/router.js.map +1 -0
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js +216 -0
- package/dist/js/core/components/functional/sdui/SDUIDescriptorTransformer.js.map +1 -0
- package/dist/js/core/components/functional/sdui/default-library.json +108 -0
- package/dist/js/core/components/functional/sdui/sdui-utils.js +64 -0
- package/dist/js/core/components/functional/sdui/sdui-utils.js.map +1 -0
- package/dist/js/core/components/functional/sdui/sdui.js +266 -0
- package/dist/js/core/components/functional/sdui/sdui.js.map +1 -0
- package/dist/js/core/components/functional/sdui/types.js +2 -0
- package/dist/js/core/components/functional/sdui/types.js.map +1 -0
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js +22 -0
- package/dist/js/core/components/functional/sonic-scope/sonic-scope.js.map +1 -0
- package/dist/js/core/components/functional/states/states.js +172 -0
- package/dist/js/core/components/functional/states/states.js.map +1 -0
- package/dist/js/core/components/functional/submit/submit.js +284 -0
- package/dist/js/core/components/functional/submit/submit.js.map +1 -0
- package/dist/js/core/components/functional/subscriber/subscriber.js +39 -0
- package/dist/js/core/components/functional/subscriber/subscriber.js.map +1 -0
- package/dist/js/core/components/functional/translation/translation.js +28 -0
- package/dist/js/core/components/functional/translation/translation.js.map +1 -0
- package/dist/js/core/components/functional/value/value.js +28 -0
- package/dist/js/core/components/functional/value/value.js.map +1 -0
- package/dist/js/core/components/ui/_css/scroll.js +25 -0
- package/dist/js/core/components/ui/_css/scroll.js.map +1 -0
- package/dist/js/core/components/ui/_css/shadow.js +22 -0
- package/dist/js/core/components/ui/_css/shadow.js.map +1 -0
- package/dist/js/core/components/ui/_css/size.js +36 -0
- package/dist/js/core/components/ui/_css/size.js.map +1 -0
- package/dist/js/core/components/ui/_css/type.js +92 -0
- package/dist/js/core/components/ui/_css/type.js.map +1 -0
- package/dist/js/core/components/ui/alert/alert.js +213 -0
- package/dist/js/core/components/ui/alert/alert.js.map +1 -0
- package/dist/js/core/components/ui/alert-messages/alert-messages.js +68 -0
- package/dist/js/core/components/ui/alert-messages/alert-messages.js.map +1 -0
- package/dist/js/core/components/ui/badge/badge.js +199 -0
- package/dist/js/core/components/ui/badge/badge.js.map +1 -0
- package/dist/js/core/components/ui/button/button.js +697 -0
- package/dist/js/core/components/ui/button/button.js.map +1 -0
- package/dist/js/core/components/ui/captcha/altchaStyles.js +226 -0
- package/dist/js/core/components/ui/captcha/altchaStyles.js.map +1 -0
- package/dist/js/core/components/ui/captcha/captcha.js +167 -0
- package/dist/js/core/components/ui/captcha/captcha.js.map +1 -0
- package/dist/js/core/components/ui/card/card-footer.js +26 -0
- package/dist/js/core/components/ui/card/card-footer.js.map +1 -0
- package/dist/js/core/components/ui/card/card-header-descripton.js +30 -0
- package/dist/js/core/components/ui/card/card-header-descripton.js.map +1 -0
- package/dist/js/core/components/ui/card/card-header.js +79 -0
- package/dist/js/core/components/ui/card/card-header.js.map +1 -0
- package/dist/js/core/components/ui/card/card-main.js +26 -0
- package/dist/js/core/components/ui/card/card-main.js.map +1 -0
- package/dist/js/core/components/ui/card/card.js +67 -0
- package/dist/js/core/components/ui/card/card.js.map +1 -0
- package/dist/js/core/components/ui/divider/divider.js +200 -0
- package/dist/js/core/components/ui/divider/divider.js.map +1 -0
- package/dist/js/core/components/ui/form/checkbox/checkbox.js +257 -0
- package/dist/js/core/components/ui/form/checkbox/checkbox.js.map +1 -0
- package/dist/js/core/components/ui/form/css/form-control.js +393 -0
- package/dist/js/core/components/ui/form/css/form-control.js.map +1 -0
- package/dist/js/core/components/ui/form/fieldset/fieldset.js +124 -0
- package/dist/js/core/components/ui/form/fieldset/fieldset.js.map +1 -0
- package/dist/js/core/components/ui/form/fieldset/legend-description.js +38 -0
- package/dist/js/core/components/ui/form/fieldset/legend-description.js.map +1 -0
- package/dist/js/core/components/ui/form/fieldset/legend.js +130 -0
- package/dist/js/core/components/ui/form/fieldset/legend.js.map +1 -0
- package/dist/js/core/components/ui/form/form-actions/form-actions.js +47 -0
- package/dist/js/core/components/ui/form/form-actions/form-actions.js.map +1 -0
- package/dist/js/core/components/ui/form/form-layout/form-layout.js +84 -0
- package/dist/js/core/components/ui/form/form-layout/form-layout.js.map +1 -0
- package/dist/js/core/components/ui/form/input/input.js +316 -0
- package/dist/js/core/components/ui/form/input/input.js.map +1 -0
- package/dist/js/core/components/ui/form/input/password-helper.js +134 -0
- package/dist/js/core/components/ui/form/input/password-helper.js.map +1 -0
- package/dist/js/core/components/ui/form/input/same-value-helper.js +85 -0
- package/dist/js/core/components/ui/form/input/same-value-helper.js.map +1 -0
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js +405 -0
- package/dist/js/core/components/ui/form/input-autocomplete/input-autocomplete.js.map +1 -0
- package/dist/js/core/components/ui/form/radio/radio.js +63 -0
- package/dist/js/core/components/ui/form/radio/radio.js.map +1 -0
- package/dist/js/core/components/ui/form/select/select.js +323 -0
- package/dist/js/core/components/ui/form/select/select.js.map +1 -0
- package/dist/js/core/components/ui/form/switch/switch.js +90 -0
- package/dist/js/core/components/ui/form/switch/switch.js.map +1 -0
- package/dist/js/core/components/ui/form/textarea/textarea.js +162 -0
- package/dist/js/core/components/ui/form/textarea/textarea.js.map +1 -0
- package/dist/js/core/components/ui/group/group.js +128 -0
- package/dist/js/core/components/ui/group/group.js.map +1 -0
- package/dist/js/core/components/ui/icon/icon.js +129 -0
- package/dist/js/core/components/ui/icon/icon.js.map +1 -0
- package/dist/js/core/components/ui/icon/icons.js +163 -0
- package/dist/js/core/components/ui/icon/icons.js.map +1 -0
- package/dist/js/core/components/ui/icon/icons.json +1 -0
- package/dist/js/core/components/ui/image/image.js +160 -0
- package/dist/js/core/components/ui/image/image.js.map +1 -0
- package/dist/js/core/components/ui/link/link.js +125 -0
- package/dist/js/core/components/ui/link/link.js.map +1 -0
- package/dist/js/core/components/ui/loader/loader.js +106 -0
- package/dist/js/core/components/ui/loader/loader.js.map +1 -0
- package/dist/js/core/components/ui/loader/styles/fixed.js +56 -0
- package/dist/js/core/components/ui/loader/styles/fixed.js.map +1 -0
- package/dist/js/core/components/ui/loader/styles/inline.js +70 -0
- package/dist/js/core/components/ui/loader/styles/inline.js.map +1 -0
- package/dist/js/core/components/ui/menu/menu-item.js +35 -0
- package/dist/js/core/components/ui/menu/menu-item.js.map +1 -0
- package/dist/js/core/components/ui/menu/menu.js +436 -0
- package/dist/js/core/components/ui/menu/menu.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-actions.js +44 -0
- package/dist/js/core/components/ui/modal/modal-actions.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-close.js +56 -0
- package/dist/js/core/components/ui/modal/modal-close.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-content.js +27 -0
- package/dist/js/core/components/ui/modal/modal-content.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-subtitle.js +34 -0
- package/dist/js/core/components/ui/modal/modal-subtitle.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-title.js +35 -0
- package/dist/js/core/components/ui/modal/modal-title.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal-utils.js +32 -0
- package/dist/js/core/components/ui/modal/modal-utils.js.map +1 -0
- package/dist/js/core/components/ui/modal/modal.js +568 -0
- package/dist/js/core/components/ui/modal/modal.js.map +1 -0
- package/dist/js/core/components/ui/pop/pop.js +337 -0
- package/dist/js/core/components/ui/pop/pop.js.map +1 -0
- package/dist/js/core/components/ui/progress/progress.js +164 -0
- package/dist/js/core/components/ui/progress/progress.js.map +1 -0
- package/dist/js/core/components/ui/table/table-caption.js +29 -0
- package/dist/js/core/components/ui/table/table-caption.js.map +1 -0
- package/dist/js/core/components/ui/table/table-tbody.js +41 -0
- package/dist/js/core/components/ui/table/table-tbody.js.map +1 -0
- package/dist/js/core/components/ui/table/table-td.js +69 -0
- package/dist/js/core/components/ui/table/table-td.js.map +1 -0
- package/dist/js/core/components/ui/table/table-tfoot.js +28 -0
- package/dist/js/core/components/ui/table/table-tfoot.js.map +1 -0
- package/dist/js/core/components/ui/table/table-th.js +80 -0
- package/dist/js/core/components/ui/table/table-th.js.map +1 -0
- package/dist/js/core/components/ui/table/table-thead.js +26 -0
- package/dist/js/core/components/ui/table/table-thead.js.map +1 -0
- package/dist/js/core/components/ui/table/table-tr.js +67 -0
- package/dist/js/core/components/ui/table/table-tr.js.map +1 -0
- package/dist/js/core/components/ui/table/table.js +106 -0
- package/dist/js/core/components/ui/table/table.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js +74 -0
- package/dist/js/core/components/ui/theme/theme-collection/core-variables.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme-collection/dark.js +39 -0
- package/dist/js/core/components/ui/theme/theme-collection/dark.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme-collection/light.js +32 -0
- package/dist/js/core/components/ui/theme/theme-collection/light.js.map +1 -0
- package/dist/js/core/components/ui/theme/theme.js +150 -0
- package/dist/js/core/components/ui/theme/theme.js.map +1 -0
- package/dist/js/core/components/ui/toast/message-subscriber.js +41 -0
- package/dist/js/core/components/ui/toast/message-subscriber.js.map +1 -0
- package/dist/js/core/components/ui/toast/toast-item.js +379 -0
- package/dist/js/core/components/ui/toast/toast-item.js.map +1 -0
- package/dist/js/core/components/ui/toast/toast.js +269 -0
- package/dist/js/core/components/ui/toast/toast.js.map +1 -0
- package/dist/js/core/components/ui/toast/types.js +2 -0
- package/dist/js/core/components/ui/toast/types.js.map +1 -0
- package/dist/js/core/components/ui/tooltip/tooltip.js +219 -0
- package/dist/js/core/components/ui/tooltip/tooltip.js.map +1 -0
- package/dist/js/core/components/ui/ui.js +41 -0
- package/dist/js/core/components/ui/ui.js.map +1 -0
- package/dist/js/core/core.js +14 -0
- package/dist/js/core/core.js.map +1 -0
- package/dist/js/core/decorators/Subscriber.js +9 -0
- package/dist/js/core/decorators/Subscriber.js.map +1 -0
- package/dist/js/core/decorators/api.js +559 -0
- package/dist/js/core/decorators/api.js.map +1 -0
- package/dist/js/core/decorators/lifecycle.js +67 -0
- package/dist/js/core/decorators/lifecycle.js.map +1 -0
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js +27 -0
- package/dist/js/core/decorators/subscriber/ancestorAttribute.js.map +1 -0
- package/dist/js/core/decorators/subscriber/autoFill.js +26 -0
- package/dist/js/core/decorators/subscriber/autoFill.js.map +1 -0
- package/dist/js/core/decorators/subscriber/autoSubscribe.js +46 -0
- package/dist/js/core/decorators/subscriber/autoSubscribe.js.map +1 -0
- package/dist/js/core/decorators/subscriber/bind.js +150 -0
- package/dist/js/core/decorators/subscriber/bind.js.map +1 -0
- package/dist/js/core/decorators/subscriber/common.js +44 -0
- package/dist/js/core/decorators/subscriber/common.js.map +1 -0
- package/dist/js/core/decorators/subscriber/dynamicPath.js +75 -0
- package/dist/js/core/decorators/subscriber/dynamicPath.js.map +1 -0
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js +138 -0
- package/dist/js/core/decorators/subscriber/dynamicPropertyWatch.js.map +1 -0
- package/dist/js/core/decorators/subscriber/handle.js +22 -0
- package/dist/js/core/decorators/subscriber/handle.js.map +1 -0
- package/dist/js/core/decorators/subscriber/onAssign.js +199 -0
- package/dist/js/core/decorators/subscriber/onAssign.js.map +1 -0
- package/dist/js/core/decorators/subscriber/publish.js +108 -0
- package/dist/js/core/decorators/subscriber/publish.js.map +1 -0
- package/dist/js/core/decorators/subscriber/publisherPath.js +16 -0
- package/dist/js/core/decorators/subscriber/publisherPath.js.map +1 -0
- package/dist/js/core/decorators/subscriber/subscribe.js +20 -0
- package/dist/js/core/decorators/subscriber/subscribe.js.map +1 -0
- package/dist/js/core/directives/DataProvider.js +127 -0
- package/dist/js/core/directives/DataProvider.js.map +1 -0
- package/dist/js/core/directives/Wording.js +221 -0
- package/dist/js/core/directives/Wording.js.map +1 -0
- package/dist/js/core/mixins/Fetcher.js +325 -0
- package/dist/js/core/mixins/Fetcher.js.map +1 -0
- package/dist/js/core/mixins/FormCheckable.js +313 -0
- package/dist/js/core/mixins/FormCheckable.js.map +1 -0
- package/dist/js/core/mixins/FormElement.js +304 -0
- package/dist/js/core/mixins/FormElement.js.map +1 -0
- package/dist/js/core/mixins/FormInput.js +82 -0
- package/dist/js/core/mixins/FormInput.js.map +1 -0
- package/dist/js/core/mixins/Subscriber.js +354 -0
- package/dist/js/core/mixins/Subscriber.js.map +1 -0
- package/dist/js/core/mixins/TemplatesContainer.js +70 -0
- package/dist/js/core/mixins/TemplatesContainer.js.map +1 -0
- package/dist/js/core/mixins/mixins.js +7 -0
- package/dist/js/core/mixins/mixins.js.map +1 -0
- package/dist/js/core/utils/AncestorAttributeObserver.js +140 -0
- package/dist/js/core/utils/AncestorAttributeObserver.js.map +1 -0
- package/dist/js/core/utils/Arrays.js +141 -0
- package/dist/js/core/utils/Arrays.js.map +1 -0
- package/dist/js/core/utils/DataBindObserver.js +265 -0
- package/dist/js/core/utils/DataBindObserver.js.map +1 -0
- package/dist/js/core/utils/Electron.js +14 -0
- package/dist/js/core/utils/Electron.js.map +1 -0
- package/dist/js/core/utils/Format.js +43 -0
- package/dist/js/core/utils/Format.js.map +1 -0
- package/dist/js/core/utils/HTML.js +248 -0
- package/dist/js/core/utils/HTML.js.map +1 -0
- package/dist/js/core/utils/LocationHandler.js +143 -0
- package/dist/js/core/utils/LocationHandler.js.map +1 -0
- package/dist/js/core/utils/Objects.js +111 -0
- package/dist/js/core/utils/Objects.js.map +1 -0
- package/dist/js/core/utils/PublisherProxy.js +946 -0
- package/dist/js/core/utils/PublisherProxy.js.map +1 -0
- package/dist/js/core/utils/Utils.js +19 -0
- package/dist/js/core/utils/Utils.js.map +1 -0
- package/dist/js/core/utils/aesCrypto.js +98 -0
- package/dist/js/core/utils/aesCrypto.js.map +1 -0
- package/dist/js/core/utils/api.js +574 -0
- package/dist/js/core/utils/api.js.map +1 -0
- package/dist/js/core/utils/dataProviderKey.js +64 -0
- package/dist/js/core/utils/dataProviderKey.js.map +1 -0
- package/dist/js/core/utils/endpoint.js +74 -0
- package/dist/js/core/utils/endpoint.js.map +1 -0
- package/dist/js/core/utils/route.js +149 -0
- package/dist/js/core/utils/route.js.map +1 -0
- package/dist/js/core/utils/url-pattern.js +3 -0
- package/dist/js/core/utils/url-pattern.js.map +1 -0
- package/dist/js/dataprovider.js +2 -0
- package/dist/js/dataprovider.js.map +1 -0
- package/dist/js/decorators.js +39 -0
- package/dist/js/decorators.js.map +1 -0
- package/dist/js/directives.js +30 -0
- package/dist/js/directives.js.map +1 -0
- package/dist/js/index.js +8 -0
- package/dist/js/index.js.map +1 -0
- package/dist/js/mixins.js +23 -0
- package/dist/js/mixins.js.map +1 -0
- package/dist/js/test-utils/TestUtils.js +10 -0
- package/dist/js/test-utils/TestUtils.js.map +1 -0
- package/dist/js/utils.js +41 -0
- package/dist/js/utils.js.map +1 -0
- package/dist/types/components.d.ts +5 -0
- package/dist/types/components.d.ts.map +1 -0
- package/dist/types/concorde-loaded.d.ts +2 -0
- package/dist/types/concorde-loaded.d.ts.map +1 -0
- package/dist/types/core/_types/endpoint.d.ts +5 -0
- package/dist/types/core/_types/endpoint.d.ts.map +1 -0
- package/dist/types/core/_types/key.d.ts +2 -0
- package/dist/types/core/_types/key.d.ts.map +1 -0
- package/dist/types/core/_types/types.d.ts +28 -0
- package/dist/types/core/_types/types.d.ts.map +1 -0
- package/dist/types/core/components/functional/date/date.d.ts +52 -0
- package/dist/types/core/components/functional/date/date.d.ts.map +1 -0
- package/dist/types/core/components/functional/example/example.d.ts +15 -0
- package/dist/types/core/components/functional/example/example.d.ts.map +1 -0
- package/dist/types/core/components/functional/fetch/fetch.d.ts +102 -0
- package/dist/types/core/components/functional/fetch/fetch.d.ts.map +1 -0
- package/dist/types/core/components/functional/functional.d.ts +17 -0
- package/dist/types/core/components/functional/functional.d.ts.map +1 -0
- package/dist/types/core/components/functional/if/if.d.ts +13 -0
- package/dist/types/core/components/functional/if/if.d.ts.map +1 -0
- package/dist/types/core/components/functional/list/list.d.ts +149 -0
- package/dist/types/core/components/functional/list/list.d.ts.map +1 -0
- package/dist/types/core/components/functional/mix/mix.d.ts +23 -0
- package/dist/types/core/components/functional/mix/mix.d.ts.map +1 -0
- package/dist/types/core/components/functional/queue/queue.d.ts +79 -0
- package/dist/types/core/components/functional/queue/queue.d.ts.map +1 -0
- package/dist/types/core/components/functional/router/redirect.d.ts +19 -0
- package/dist/types/core/components/functional/router/redirect.d.ts.map +1 -0
- package/dist/types/core/components/functional/router/router.d.ts +46 -0
- package/dist/types/core/components/functional/router/router.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts +59 -0
- package/dist/types/core/components/functional/sdui/SDUIDescriptorTransformer.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts +6 -0
- package/dist/types/core/components/functional/sdui/sdui-utils.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/sdui.d.ts +145 -0
- package/dist/types/core/components/functional/sdui/sdui.d.ts.map +1 -0
- package/dist/types/core/components/functional/sdui/types.d.ts +38 -0
- package/dist/types/core/components/functional/sdui/types.d.ts.map +1 -0
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts +6 -0
- package/dist/types/core/components/functional/sonic-scope/sonic-scope.d.ts.map +1 -0
- package/dist/types/core/components/functional/states/states.d.ts +42 -0
- package/dist/types/core/components/functional/states/states.d.ts.map +1 -0
- package/dist/types/core/components/functional/submit/submit.d.ts +37 -0
- package/dist/types/core/components/functional/submit/submit.d.ts.map +1 -0
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts +13 -0
- package/dist/types/core/components/functional/subscriber/subscriber.d.ts.map +1 -0
- package/dist/types/core/components/functional/translation/translation.d.ts +7 -0
- package/dist/types/core/components/functional/translation/translation.d.ts.map +1 -0
- package/dist/types/core/components/functional/value/value.d.ts +8 -0
- package/dist/types/core/components/functional/value/value.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/scroll.d.ts +2 -0
- package/dist/types/core/components/ui/_css/scroll.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/shadow.d.ts +3 -0
- package/dist/types/core/components/ui/_css/shadow.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/size.d.ts +3 -0
- package/dist/types/core/components/ui/_css/size.d.ts.map +1 -0
- package/dist/types/core/components/ui/_css/type.d.ts +3 -0
- package/dist/types/core/components/ui/_css/type.d.ts.map +1 -0
- package/dist/types/core/components/ui/alert/alert.d.ts +37 -0
- package/dist/types/core/components/ui/alert/alert.d.ts.map +1 -0
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts +15 -0
- package/dist/types/core/components/ui/alert-messages/alert-messages.d.ts.map +1 -0
- package/dist/types/core/components/ui/badge/badge.d.ts +27 -0
- package/dist/types/core/components/ui/badge/badge.d.ts.map +1 -0
- package/dist/types/core/components/ui/button/button.d.ts +180 -0
- package/dist/types/core/components/ui/button/button.d.ts.map +1 -0
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts +2 -0
- package/dist/types/core/components/ui/captcha/altchaStyles.d.ts.map +1 -0
- package/dist/types/core/components/ui/captcha/captcha.d.ts +30 -0
- package/dist/types/core/components/ui/captcha/captcha.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-footer.d.ts +6 -0
- package/dist/types/core/components/ui/card/card-footer.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts +6 -0
- package/dist/types/core/components/ui/card/card-header-descripton.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-header.d.ts +9 -0
- package/dist/types/core/components/ui/card/card-header.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card-main.d.ts +6 -0
- package/dist/types/core/components/ui/card/card-main.d.ts.map +1 -0
- package/dist/types/core/components/ui/card/card.d.ts +13 -0
- package/dist/types/core/components/ui/card/card.d.ts.map +1 -0
- package/dist/types/core/components/ui/divider/divider.d.ts +16 -0
- package/dist/types/core/components/ui/divider/divider.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts +176 -0
- package/dist/types/core/components/ui/form/checkbox/checkbox.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/css/form-control.d.ts +5 -0
- package/dist/types/core/components/ui/form/css/form-control.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts +24 -0
- package/dist/types/core/components/ui/form/fieldset/fieldset.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts +6 -0
- package/dist/types/core/components/ui/form/fieldset/legend-description.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts +17 -0
- package/dist/types/core/components/ui/form/fieldset/legend.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts +8 -0
- package/dist/types/core/components/ui/form/form-actions/form-actions.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts +13 -0
- package/dist/types/core/components/ui/form/form-layout/form-layout.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input/input.d.ts +123 -0
- package/dist/types/core/components/ui/form/input/input.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input/password-helper.d.ts +26 -0
- package/dist/types/core/components/ui/form/input/password-helper.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts +17 -0
- package/dist/types/core/components/ui/form/input/same-value-helper.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +155 -0
- package/dist/types/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/radio/radio.d.ts +15 -0
- package/dist/types/core/components/ui/form/radio/radio.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/select/select.d.ts +59 -0
- package/dist/types/core/components/ui/form/select/select.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/switch/switch.d.ts +6 -0
- package/dist/types/core/components/ui/form/switch/switch.d.ts.map +1 -0
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts +94 -0
- package/dist/types/core/components/ui/form/textarea/textarea.d.ts.map +1 -0
- package/dist/types/core/components/ui/group/group.d.ts +17 -0
- package/dist/types/core/components/ui/group/group.d.ts.map +1 -0
- package/dist/types/core/components/ui/icon/icon.d.ts +28 -0
- package/dist/types/core/components/ui/icon/icon.d.ts.map +1 -0
- package/dist/types/core/components/ui/icon/icons.d.ts +11 -0
- package/dist/types/core/components/ui/icon/icons.d.ts.map +1 -0
- package/dist/types/core/components/ui/image/image.d.ts +16 -0
- package/dist/types/core/components/ui/image/image.d.ts.map +1 -0
- package/dist/types/core/components/ui/link/link.d.ts +30 -0
- package/dist/types/core/components/ui/link/link.d.ts.map +1 -0
- package/dist/types/core/components/ui/loader/loader.d.ts +24 -0
- package/dist/types/core/components/ui/loader/loader.d.ts.map +1 -0
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts +2 -0
- package/dist/types/core/components/ui/loader/styles/fixed.d.ts.map +1 -0
- package/dist/types/core/components/ui/loader/styles/inline.d.ts +2 -0
- package/dist/types/core/components/ui/loader/styles/inline.d.ts.map +1 -0
- package/dist/types/core/components/ui/menu/menu-item.d.ts +6 -0
- package/dist/types/core/components/ui/menu/menu-item.d.ts.map +1 -0
- package/dist/types/core/components/ui/menu/menu.d.ts +52 -0
- package/dist/types/core/components/ui/menu/menu.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-actions.d.ts +9 -0
- package/dist/types/core/components/ui/modal/modal-actions.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-close.d.ts +11 -0
- package/dist/types/core/components/ui/modal/modal-close.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-content.d.ts +6 -0
- package/dist/types/core/components/ui/modal/modal-content.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts +6 -0
- package/dist/types/core/components/ui/modal/modal-subtitle.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-title.d.ts +6 -0
- package/dist/types/core/components/ui/modal/modal-title.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal-utils.d.ts +4 -0
- package/dist/types/core/components/ui/modal/modal-utils.d.ts.map +1 -0
- package/dist/types/core/components/ui/modal/modal.d.ts +79 -0
- package/dist/types/core/components/ui/modal/modal.d.ts.map +1 -0
- package/dist/types/core/components/ui/pop/pop.d.ts +42 -0
- package/dist/types/core/components/ui/pop/pop.d.ts.map +1 -0
- package/dist/types/core/components/ui/progress/progress.d.ts +12 -0
- package/dist/types/core/components/ui/progress/progress.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-caption.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-caption.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-tbody.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-tbody.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-td.d.ts +13 -0
- package/dist/types/core/components/ui/table/table-td.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-tfoot.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-tfoot.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-th.d.ts +12 -0
- package/dist/types/core/components/ui/table/table-th.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-thead.d.ts +6 -0
- package/dist/types/core/components/ui/table/table-thead.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table-tr.d.ts +14 -0
- package/dist/types/core/components/ui/table/table-tr.d.ts.map +1 -0
- package/dist/types/core/components/ui/table/table.d.ts +18 -0
- package/dist/types/core/components/ui/table/table.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts +2 -0
- package/dist/types/core/components/ui/theme/theme-collection/core-variables.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts +2 -0
- package/dist/types/core/components/ui/theme/theme-collection/dark.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts +2 -0
- package/dist/types/core/components/ui/theme/theme-collection/light.d.ts.map +1 -0
- package/dist/types/core/components/ui/theme/theme.d.ts +20 -0
- package/dist/types/core/components/ui/theme/theme.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts +19 -0
- package/dist/types/core/components/ui/toast/message-subscriber.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/toast-item.d.ts +41 -0
- package/dist/types/core/components/ui/toast/toast-item.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/toast.d.ts +28 -0
- package/dist/types/core/components/ui/toast/toast.d.ts.map +1 -0
- package/dist/types/core/components/ui/toast/types.d.ts +12 -0
- package/dist/types/core/components/ui/toast/types.d.ts.map +1 -0
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts +21 -0
- package/dist/types/core/components/ui/tooltip/tooltip.d.ts.map +1 -0
- package/dist/types/core/components/ui/ui.d.ts +35 -0
- package/dist/types/core/components/ui/ui.d.ts.map +1 -0
- package/dist/types/core/core.d.ts +5 -0
- package/dist/types/core/core.d.ts.map +1 -0
- package/dist/types/core/decorators/Subscriber.d.ts +11 -0
- package/dist/types/core/decorators/Subscriber.d.ts.map +1 -0
- package/dist/types/core/decorators/api.d.ts +106 -0
- package/dist/types/core/decorators/api.d.ts.map +1 -0
- package/dist/types/core/decorators/lifecycle.d.ts +19 -0
- package/dist/types/core/decorators/lifecycle.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts +11 -0
- package/dist/types/core/decorators/subscriber/ancestorAttribute.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/autoFill.d.ts +2 -0
- package/dist/types/core/decorators/subscriber/autoFill.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts +2 -0
- package/dist/types/core/decorators/subscriber/autoSubscribe.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/bind.d.ts +28 -0
- package/dist/types/core/decorators/subscriber/bind.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/common.d.ts +14 -0
- package/dist/types/core/decorators/subscriber/common.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts +23 -0
- package/dist/types/core/decorators/subscriber/dynamicPath.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts +42 -0
- package/dist/types/core/decorators/subscriber/dynamicPropertyWatch.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/handle.d.ts +74 -0
- package/dist/types/core/decorators/subscriber/handle.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/onAssign.d.ts +53 -0
- package/dist/types/core/decorators/subscriber/onAssign.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/publish.d.ts +23 -0
- package/dist/types/core/decorators/subscriber/publish.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts +3 -0
- package/dist/types/core/decorators/subscriber/publisherPath.d.ts.map +1 -0
- package/dist/types/core/decorators/subscriber/subscribe.d.ts +20 -0
- package/dist/types/core/decorators/subscriber/subscribe.d.ts.map +1 -0
- package/dist/types/core/directives/DataProvider.d.ts +45 -0
- package/dist/types/core/directives/DataProvider.d.ts.map +1 -0
- package/dist/types/core/directives/Wording.d.ts +44 -0
- package/dist/types/core/directives/Wording.d.ts.map +1 -0
- package/dist/types/core/mixins/Fetcher.d.ts +108 -0
- package/dist/types/core/mixins/Fetcher.d.ts.map +1 -0
- package/dist/types/core/mixins/FormCheckable.d.ts +95 -0
- package/dist/types/core/mixins/FormCheckable.d.ts.map +1 -0
- package/dist/types/core/mixins/FormElement.d.ts +37 -0
- package/dist/types/core/mixins/FormElement.d.ts.map +1 -0
- package/dist/types/core/mixins/FormInput.d.ts +79 -0
- package/dist/types/core/mixins/FormInput.d.ts.map +1 -0
- package/dist/types/core/mixins/Subscriber.d.ts +38 -0
- package/dist/types/core/mixins/Subscriber.d.ts.map +1 -0
- package/dist/types/core/mixins/TemplatesContainer.d.ts +14 -0
- package/dist/types/core/mixins/TemplatesContainer.d.ts.map +1 -0
- package/dist/types/core/mixins/mixins.d.ts +7 -0
- package/dist/types/core/mixins/mixins.d.ts.map +1 -0
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts +38 -0
- package/dist/types/core/utils/AncestorAttributeObserver.d.ts.map +1 -0
- package/dist/types/core/utils/Arrays.d.ts +98 -0
- package/dist/types/core/utils/Arrays.d.ts.map +1 -0
- package/dist/types/core/utils/DataBindObserver.d.ts +84 -0
- package/dist/types/core/utils/DataBindObserver.d.ts.map +1 -0
- package/dist/types/core/utils/Electron.d.ts +8 -0
- package/dist/types/core/utils/Electron.d.ts.map +1 -0
- package/dist/types/core/utils/Format.d.ts +13 -0
- package/dist/types/core/utils/Format.d.ts.map +1 -0
- package/dist/types/core/utils/HTML.d.ts +64 -0
- package/dist/types/core/utils/HTML.d.ts.map +1 -0
- package/dist/types/core/utils/LocationHandler.d.ts +48 -0
- package/dist/types/core/utils/LocationHandler.d.ts.map +1 -0
- package/dist/types/core/utils/Objects.d.ts +31 -0
- package/dist/types/core/utils/Objects.d.ts.map +1 -0
- package/dist/types/core/utils/PublisherProxy.d.ts +230 -0
- package/dist/types/core/utils/PublisherProxy.d.ts.map +1 -0
- package/dist/types/core/utils/Utils.d.ts +6 -0
- package/dist/types/core/utils/Utils.d.ts.map +1 -0
- package/dist/types/core/utils/aesCrypto.d.ts +53 -0
- package/dist/types/core/utils/aesCrypto.d.ts.map +1 -0
- package/dist/types/core/utils/api.d.ts +173 -0
- package/dist/types/core/utils/api.d.ts.map +1 -0
- package/dist/types/core/utils/dataProviderKey.d.ts +56 -0
- package/dist/types/core/utils/dataProviderKey.d.ts.map +1 -0
- package/dist/types/core/utils/endpoint.d.ts +37 -0
- package/dist/types/core/utils/endpoint.d.ts.map +1 -0
- package/dist/types/core/utils/route.d.ts +41 -0
- package/dist/types/core/utils/route.d.ts.map +1 -0
- package/dist/types/core/utils/url-pattern.d.ts +3 -0
- package/dist/types/core/utils/url-pattern.d.ts.map +1 -0
- package/dist/types/dataprovider.d.ts +2 -0
- package/dist/types/dataprovider.d.ts.map +1 -0
- package/dist/types/decorators.d.ts +28 -0
- package/dist/types/decorators.d.ts.map +1 -0
- package/dist/types/directives.d.ts +21 -0
- package/dist/types/directives.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/mixins.d.ts +204 -0
- package/dist/types/mixins.d.ts.map +1 -0
- package/dist/types/test-utils/TestUtils.d.ts +4 -0
- package/dist/types/test-utils/TestUtils.d.ts.map +1 -0
- package/dist/types/utils.d.ts +17 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/docs/assets/index-BEgZEIbv.js +11196 -0
- package/docs/docs-mock-api-sw.js +19 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +1 -1
- package/docs/src/docs/_core-concept/dataFlow.md +9 -3
- package/docs/src/docs/_decorators/bind.md +2 -2
- package/docs/src/docs/_decorators/get.md +13 -4
- package/docs/src/docs/_decorators/handle.md +5 -1
- package/docs/src/docs/_decorators/on-assign.md +2 -0
- package/docs/src/docs/_decorators/patch.md +45 -0
- package/docs/src/docs/_decorators/post.md +93 -0
- package/docs/src/docs/_decorators/publish.md +1 -1
- package/docs/src/docs/_decorators/put.md +43 -0
- package/docs/src/docs/_decorators/subscribe.md +4 -1
- package/docs/src/docs/_directives/sub.md +1 -1
- package/docs/src/docs/_getting-started/my-first-component.md +1 -1
- package/docs/src/docs/_misc/api-configuration.md +3 -1
- package/docs/src/docs/_misc/dataProviderKey.md +2 -2
- package/docs/src/docs/_misc/dynamic-path.md +71 -0
- package/docs/src/docs/_misc/endpoint.md +5 -3
- package/docs/src/docs/search/docs-search.json +540 -15
- package/docs/src/tsconfig.json +377 -353
- package/gitlab/job_github_mirror.sh +39 -0
- package/index.html +0 -1
- package/package.json +1084 -356
- package/public/docs-mock-api-sw.js +19 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/scripts/github-export.mjs +150 -0
- package/scripts/post-build.mjs +43 -0
- package/scripts/pre-build.mjs +32 -4
- package/scripts/pre-publish.mjs +2 -0
- package/src/core/components/functional/example/example.ts +3 -3
- package/src/core/components/functional/queue/queue.ts +2 -2
- package/src/core/components/ui/icon/icon.ts +17 -2
- package/src/core/components/ui/menu/menu.ts +12 -3
- package/src/core/components/ui/modal/modal.ts +1 -1
- package/src/core/decorators/Subscriber.ts +1 -0
- package/src/core/decorators/api.post.spec.ts +293 -0
- package/src/core/decorators/api.spec.ts +6 -6
- package/src/core/decorators/api.ts +641 -12
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +197 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +40 -7
- package/src/core/decorators/subscriber/autoSubscribe.ts +7 -3
- package/src/core/decorators/subscriber/bind.ts +13 -5
- package/src/core/decorators/subscriber/dynamicPath.spec.ts +53 -0
- package/src/core/decorators/subscriber/dynamicPath.ts +23 -1
- package/src/core/decorators/subscriber/handle.ts +3 -1
- package/src/core/decorators/subscriber/onAssign.ts +10 -2
- package/src/core/decorators/subscriber/publish.ts +12 -2
- package/src/core/mixins/Fetcher.ts +12 -6
- package/src/core/utils/AncestorAttributeObserver.ts +199 -0
- package/src/core/utils/HTML.ts +3 -11
- package/src/core/utils/PublisherProxy.ts +123 -48
- package/src/core/utils/api.ts +82 -13
- package/src/core/utils/dpOptions.spec.ts +56 -0
- package/src/core/utils/endpoint.ts +3 -3
- package/src/css.d.ts +19 -0
- package/src/decorators.ts +17 -1
- package/src/directives.ts +3 -2
- package/src/docs/_core-concept/dataFlow.md +9 -3
- package/src/docs/_decorators/ancestor-attribute.md +56 -8
- package/src/docs/_decorators/bind.md +2 -2
- package/src/docs/_decorators/get.md +13 -4
- package/src/docs/_decorators/handle.md +5 -1
- package/src/docs/_decorators/on-assign.md +2 -0
- package/src/docs/_decorators/patch.md +45 -0
- package/src/docs/_decorators/post.md +93 -0
- package/src/docs/_decorators/publish.md +1 -1
- package/src/docs/_decorators/put.md +43 -0
- package/src/docs/_decorators/subscribe.md +4 -1
- package/src/docs/_directives/sub.md +1 -1
- package/src/docs/_getting-started/my-first-component.md +1 -1
- package/src/docs/_misc/api-configuration.md +3 -1
- package/src/docs/_misc/dataProviderKey.md +2 -2
- package/src/docs/_misc/dynamic-path.md +71 -0
- package/src/docs/_misc/endpoint.md +5 -3
- package/src/docs/components/docs-demo-sources.ts +115 -4
- package/src/docs/components/docs-lit-demo-raw.ts +2 -26
- package/src/docs/components/docs-lit-demo.ts +9 -42
- package/src/docs/components/docs-source-excerpt.ts +53 -0
- package/src/docs/components/docs-source-link.ts +24 -8
- package/src/docs/components/docs-source-raw.ts +34 -0
- package/src/docs/example/decorators-demo-geo.ts +2 -2
- package/src/docs/example/decorators-demo-post.ts +249 -0
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +5 -5
- package/src/docs/example/decorators-demo.ts +165 -8
- package/src/docs/example/docs-api-config-demos.ts +5 -5
- package/src/docs/mock-api/router.ts +20 -0
- package/src/docs/navigation/navigation.ts +16 -0
- package/src/docs/search/docs-search.json +602 -17
- package/src/tsconfig.declarations.json +22 -0
- package/src/tsconfig.emit.json +23 -0
- package/src/tsconfig.json +3 -261
- package/src/tsconfig.tsbuildinfo +1 -1
- package/vite.config.mts +1 -1
- package/docs/assets/index-CwtPzTFq.js +0 -7508
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
import { resolveStaticPublisherPath } from "./dataProviderKey";
|
|
2
|
+
import HTML from "./HTML";
|
|
3
|
+
import Objects from "./Objects";
|
|
4
|
+
import { sonicClassPrefix } from "./Utils";
|
|
5
|
+
const DP_OPTION_KEYS = new Set([
|
|
6
|
+
"localStorageMode",
|
|
7
|
+
"expirationDelayMs",
|
|
8
|
+
"invalidateOnPageShow",
|
|
9
|
+
]);
|
|
10
|
+
function isDpOptions(value) {
|
|
11
|
+
if (value == null || typeof value !== "object" || Array.isArray(value)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return Object.keys(value).some((key) => DP_OPTION_KEYS.has(key));
|
|
15
|
+
}
|
|
16
|
+
function isLeaf(value) {
|
|
17
|
+
return Object.prototype.hasOwnProperty.call(value, "__value");
|
|
18
|
+
}
|
|
19
|
+
function isComplex(value) {
|
|
20
|
+
return typeof value === "object" && value !== null;
|
|
21
|
+
}
|
|
22
|
+
let SONIC_PREFIX = "sonic";
|
|
23
|
+
if (typeof __BUILD_DATE__ === "undefined") {
|
|
24
|
+
window.__BUILD_DATE__ = "No build date";
|
|
25
|
+
}
|
|
26
|
+
if (typeof __SONIC_PREFIX__ === "undefined") {
|
|
27
|
+
SONIC_PREFIX = "sonic";
|
|
28
|
+
}
|
|
29
|
+
export const prefix = SONIC_PREFIX;
|
|
30
|
+
const localStorageDataKey = SONIC_PREFIX == "sonic"
|
|
31
|
+
? "publisher-proxies-data"
|
|
32
|
+
: SONIC_PREFIX + "-publisher-proxies-data";
|
|
33
|
+
/**
|
|
34
|
+
* Custom Proxy contient les méthodes des publishers retournés par PublisherManager.get(publisherId) qui seront utilisées couramment
|
|
35
|
+
*/
|
|
36
|
+
export class PublisherProxy {
|
|
37
|
+
constructor(target, parentProxPub, parentKey) {
|
|
38
|
+
this._proxies_ = new Map();
|
|
39
|
+
this._is_savable_ = false;
|
|
40
|
+
this._expiration_delay_ = 1000 * 60 * 60 * 12;
|
|
41
|
+
this._invalidate_on_page_show_ = false;
|
|
42
|
+
this._invalidateListeners_ = new Set();
|
|
43
|
+
this._formInvalidateListeners_ = new Set();
|
|
44
|
+
this._assignListeners_ = new Set();
|
|
45
|
+
this._mutationListeners_ = new Set();
|
|
46
|
+
this._fillListeners_ = new Set();
|
|
47
|
+
this._templateFillListeners_ = new Set();
|
|
48
|
+
this._lockInternalMutationPublishing_ = false;
|
|
49
|
+
this._instanceCounter_ = 0;
|
|
50
|
+
this._assignmentId_ = 0;
|
|
51
|
+
this._value_ = target;
|
|
52
|
+
this.parent = parentProxPub || null;
|
|
53
|
+
this._parentKey_ = parentKey;
|
|
54
|
+
this.root = this;
|
|
55
|
+
this._instanceCounter_ = 0;
|
|
56
|
+
while (this.root.parent) {
|
|
57
|
+
this.root = this.root.parent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Supprime le proxy et ses sous proxy
|
|
62
|
+
* Supprime les écouteurs associés
|
|
63
|
+
*/
|
|
64
|
+
delete() {
|
|
65
|
+
for (const key in this._proxies_.keys()) {
|
|
66
|
+
if (key == "_parent_")
|
|
67
|
+
continue;
|
|
68
|
+
this._proxies_.get(key)?.delete();
|
|
69
|
+
}
|
|
70
|
+
this._invalidateListeners_.clear();
|
|
71
|
+
this._formInvalidateListeners_.clear();
|
|
72
|
+
this._assignListeners_.clear();
|
|
73
|
+
this._mutationListeners_.clear();
|
|
74
|
+
this._fillListeners_.clear();
|
|
75
|
+
this._templateFillListeners_.clear();
|
|
76
|
+
this._proxies_.clear();
|
|
77
|
+
PublisherProxy.instances.delete(this._instanceCounter_);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Utile pour savoir si quelque chose est en écoute d'une modification sur le proxy via une des methodes associées
|
|
81
|
+
*/
|
|
82
|
+
hasListener() {
|
|
83
|
+
return (this._templateFillListeners_.size > 0 ||
|
|
84
|
+
this._assignListeners_.size > 0 ||
|
|
85
|
+
this._invalidateListeners_.size > 0 ||
|
|
86
|
+
this._formInvalidateListeners_.size > 0 ||
|
|
87
|
+
this._mutationListeners_.size > 0 ||
|
|
88
|
+
this._fillListeners_.size > 0);
|
|
89
|
+
}
|
|
90
|
+
_publishInternalMutation_(lockInternalMutationsTransmission = false) {
|
|
91
|
+
this._mutationListeners_.forEach((handler) => handler());
|
|
92
|
+
if (this._is_savable_ && !PublisherManager.changed) {
|
|
93
|
+
PublisherManager.changed = true;
|
|
94
|
+
PublisherManager.saveId++;
|
|
95
|
+
const saveId = PublisherManager.saveId;
|
|
96
|
+
setTimeout(() => PublisherManager.getInstance().saveToLocalStorage(saveId), 1000);
|
|
97
|
+
}
|
|
98
|
+
if (lockInternalMutationsTransmission)
|
|
99
|
+
return;
|
|
100
|
+
if (this.parent) {
|
|
101
|
+
this.parent._publishInternalMutation_();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async _publishAssignement_(lockInternalMutationsTransmission = false) {
|
|
105
|
+
this._assignmentId_++;
|
|
106
|
+
const currentId = this._assignmentId_;
|
|
107
|
+
if (currentId !== this._assignmentId_)
|
|
108
|
+
return;
|
|
109
|
+
const newValue = this.get();
|
|
110
|
+
this._assignListeners_.forEach((handler) => {
|
|
111
|
+
handler(newValue);
|
|
112
|
+
});
|
|
113
|
+
this._publishInternalMutation_(lockInternalMutationsTransmission);
|
|
114
|
+
}
|
|
115
|
+
_publishInvalidation_() {
|
|
116
|
+
this._invalidateListeners_.forEach((handler) => handler());
|
|
117
|
+
}
|
|
118
|
+
_publishFormInvalidation_() {
|
|
119
|
+
this._formInvalidateListeners_.forEach((handler) => handler());
|
|
120
|
+
}
|
|
121
|
+
_publishDynamicFilling_(key, value) {
|
|
122
|
+
this._fillListeners_.forEach((handler) => {
|
|
123
|
+
if (handler[key] !== value)
|
|
124
|
+
handler[key] = value;
|
|
125
|
+
});
|
|
126
|
+
this._publishTemplateFilling_(key, value);
|
|
127
|
+
}
|
|
128
|
+
_publishTemplateFilling_(key, value) {
|
|
129
|
+
this._templateFillListeners_.forEach((handler) => {
|
|
130
|
+
const desc = Object.getOwnPropertyDescriptor(handler, key);
|
|
131
|
+
if (desc && !desc.set && !desc.writable)
|
|
132
|
+
return;
|
|
133
|
+
if (handler.propertyMap && handler.propertyMap[key]) {
|
|
134
|
+
key = handler.propertyMap[key];
|
|
135
|
+
}
|
|
136
|
+
if (typeof handler[key] != "undefined" && handler[key] !== value) {
|
|
137
|
+
handler[key] = value;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Appel la fonction "handler" (passée en paramettre) lorsque la valeur gérée par le proxy change par assignation
|
|
143
|
+
* hanlder reçois alors la nouvelle valeur interne du proxy en paramètre
|
|
144
|
+
*/
|
|
145
|
+
onAssign(handler, directHandlerCall = true) {
|
|
146
|
+
if (typeof handler != "function")
|
|
147
|
+
return;
|
|
148
|
+
if (this._assignListeners_.has(handler))
|
|
149
|
+
return;
|
|
150
|
+
this._assignListeners_.add(handler);
|
|
151
|
+
if (directHandlerCall)
|
|
152
|
+
handler(this.get());
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Stop les appels de la fonction "handler" (passée en paramettre) lorsque la valeur gérée par le proxy change par assignation
|
|
156
|
+
*/
|
|
157
|
+
offAssign(handler) {
|
|
158
|
+
this._assignListeners_.delete(handler);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Appel la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide
|
|
162
|
+
*/
|
|
163
|
+
onInvalidate(handler) {
|
|
164
|
+
if (typeof handler != "function")
|
|
165
|
+
return;
|
|
166
|
+
this._invalidateListeners_.add(handler);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Stop les appels de la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide
|
|
170
|
+
*/
|
|
171
|
+
offInvalidate(handler) {
|
|
172
|
+
if (typeof handler != "function")
|
|
173
|
+
return;
|
|
174
|
+
this._invalidateListeners_.delete(handler);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Flag les données comme étant invalides
|
|
178
|
+
*/
|
|
179
|
+
invalidate() {
|
|
180
|
+
this._publishInvalidation_();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Appel la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide
|
|
184
|
+
*/
|
|
185
|
+
onFormInvalidate(handler) {
|
|
186
|
+
if (typeof handler != "function")
|
|
187
|
+
return;
|
|
188
|
+
this._formInvalidateListeners_.add(handler);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Stop les appels de la fonction "handler" (passée en paramettre) lorsque la donnée est flaggée comme invalide
|
|
192
|
+
*/
|
|
193
|
+
offFormInvalidate(handler) {
|
|
194
|
+
if (typeof handler != "function")
|
|
195
|
+
return;
|
|
196
|
+
this._formInvalidateListeners_.delete(handler);
|
|
197
|
+
}
|
|
198
|
+
invalidateForm() {
|
|
199
|
+
this._publishFormInvalidation_();
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Appel la fonction "handler" (passée en paramettre) lorsque quelque chose change la valeur gérée par le proxy quelque soit la profondeur de la donnée
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
onInternalMutation(handler) {
|
|
206
|
+
if (typeof handler != "function")
|
|
207
|
+
return;
|
|
208
|
+
this._mutationListeners_.add(handler);
|
|
209
|
+
handler();
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Stop les Appels de la fonction "handler" (passée en paramettre) lorsque quelque chose change la valeur gérée par le proxy quelque soit la profondeur de la donnée
|
|
213
|
+
*/
|
|
214
|
+
offInternalMutation(handler) {
|
|
215
|
+
if (typeof handler != "function")
|
|
216
|
+
return;
|
|
217
|
+
this._mutationListeners_.delete(handler);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Maintient le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy
|
|
221
|
+
* Remplit uniquement les valeurs déjà présentes dans l'objet / tableau passé en paramètre
|
|
222
|
+
*/
|
|
223
|
+
startTemplateFilling(handler) {
|
|
224
|
+
this._templateFillListeners_.add(handler);
|
|
225
|
+
if (typeof this._value_ != "object")
|
|
226
|
+
return;
|
|
227
|
+
for (const z in this._value_) {
|
|
228
|
+
let valueKey = z;
|
|
229
|
+
const value = this._value_[z];
|
|
230
|
+
if (handler.propertyMap && handler.propertyMap[z]) {
|
|
231
|
+
valueKey = handler.propertyMap[z];
|
|
232
|
+
}
|
|
233
|
+
if (typeof handler[z] != "undefined" && handler[z] !== value) {
|
|
234
|
+
handler[valueKey] = value;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Arrête de maintenir le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy
|
|
240
|
+
*/
|
|
241
|
+
stopTemplateFilling(handler) {
|
|
242
|
+
this._templateFillListeners_.delete(handler);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Maintient le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy
|
|
246
|
+
* Remplit toute valeur qu'elle soit présente ou pas initialement dans l'objet
|
|
247
|
+
*/
|
|
248
|
+
startDynamicFilling(handler) {
|
|
249
|
+
this._fillListeners_.add(handler);
|
|
250
|
+
for (const z in this._value_) {
|
|
251
|
+
const value = this._value_[z];
|
|
252
|
+
if (handler[z] !== value)
|
|
253
|
+
handler[z] = value;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/*
|
|
257
|
+
* Arrête de maintenir le remplissage de l'objet / tableau "handler" passé en paramètre avec les valeurs du proxy
|
|
258
|
+
*/
|
|
259
|
+
stopDynamicFilling(handler) {
|
|
260
|
+
this._fillListeners_.delete(handler);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Assigne une nouvelle valeur au proxy ce qui déclenche la transmission de la donnée en fonction des "écouteurs" associés
|
|
264
|
+
*/
|
|
265
|
+
set(newValue, lockInternalMutationsTransmission = false) {
|
|
266
|
+
/**
|
|
267
|
+
* On retounre tout de suite si la valeur n'a pas changé
|
|
268
|
+
*/
|
|
269
|
+
if (this._value_ === newValue)
|
|
270
|
+
return true;
|
|
271
|
+
/**
|
|
272
|
+
* On retounre tout de suite si la valeur n'a pas changé
|
|
273
|
+
* et qu'elle est primitive
|
|
274
|
+
*/
|
|
275
|
+
if ((isComplex(this._value_) &&
|
|
276
|
+
isComplex(newValue) &&
|
|
277
|
+
newValue &&
|
|
278
|
+
isLeaf(this._value_) &&
|
|
279
|
+
isLeaf(newValue) &&
|
|
280
|
+
this._value_.__value === newValue.__value) ||
|
|
281
|
+
(!isComplex(newValue) && newValue === this._value_.__value)) {
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* On assigne la nouvelle valeur
|
|
286
|
+
*/
|
|
287
|
+
/** Si la valeur est complexe on assigne newValue directe sinon on le met dans une sous valeur __value */
|
|
288
|
+
this._value_ = isComplex(newValue)
|
|
289
|
+
? newValue
|
|
290
|
+
: { __value: newValue };
|
|
291
|
+
this._cachedGet_ = undefined;
|
|
292
|
+
/**
|
|
293
|
+
* Si il s'agit d'une valeur primitive (un entier, une chaine ) la valeure en renseignée par un objet contenant la vaeur {__value}
|
|
294
|
+
* On publie juste et on sen va.
|
|
295
|
+
*/
|
|
296
|
+
const isLeafNewValue = isLeaf(this._value_);
|
|
297
|
+
if (this._parentKey_ && this.parent) {
|
|
298
|
+
//si le parent n'a pas de valeur, on la crée en renseignant this.value et on retourne.
|
|
299
|
+
const valueTosetInParent = isLeaf(this._value_)
|
|
300
|
+
? this._value_.__value
|
|
301
|
+
: this._value_;
|
|
302
|
+
if (this.parent?.get() == null && this.parent?.get() == undefined) {
|
|
303
|
+
//if _parentKey_ is a number, we assume it's an array
|
|
304
|
+
if (!isNaN(Number(this._parentKey_))) {
|
|
305
|
+
const parent = [];
|
|
306
|
+
parent[Number(this._parentKey_)] = valueTosetInParent;
|
|
307
|
+
this.parent.set(parent);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this.parent.set({ [this._parentKey_]: valueTosetInParent });
|
|
311
|
+
}
|
|
312
|
+
// return;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
//on mets à jour la valeur de la clef dans l'objet parnet pour refléter le changement au ca sou elle n'existait pas
|
|
316
|
+
this.parent._value_[this._parentKey_] = valueTosetInParent;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (isLeafNewValue) {
|
|
320
|
+
// Si la valeur précédente était composite, on reset tous les sous-éléments à null
|
|
321
|
+
this._proxies_.forEach((_subProxy, key) => {
|
|
322
|
+
/**
|
|
323
|
+
*
|
|
324
|
+
* On reùmplace les undefined par des nuls pour eviter la suppression des clefs sauf pour les clef tableaux
|
|
325
|
+
**/
|
|
326
|
+
if (key != "_parent_") {
|
|
327
|
+
_subProxy.set(null);
|
|
328
|
+
this._publishDynamicFilling_(key, null);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
//await //await here gives better performance but can cause issues with some listeners
|
|
332
|
+
this._publishAssignement_(lockInternalMutationsTransmission);
|
|
333
|
+
if (this.parent && this._parentKey_) {
|
|
334
|
+
this.parent._publishDynamicFilling_(this._parentKey_, this._value_.__value);
|
|
335
|
+
}
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* On fait la diff sur l'existant.
|
|
340
|
+
* On maintient les proxys à supprimer et ceux à ajouter.
|
|
341
|
+
* On met à jour leur valeur interne
|
|
342
|
+
* On publie les maj au fur et a mesure de modifications
|
|
343
|
+
*/
|
|
344
|
+
for (const key in this._value_) {
|
|
345
|
+
const currentValue = this._value_[key];
|
|
346
|
+
if (currentValue === undefined)
|
|
347
|
+
delete this._value_[key];
|
|
348
|
+
}
|
|
349
|
+
this._proxies_.forEach((_subProxy, key) => {
|
|
350
|
+
/**
|
|
351
|
+
*
|
|
352
|
+
* On reùmplace les undefined par des nuls pour eviter la suppression des clefs sauf pour les clef tableaux
|
|
353
|
+
**/
|
|
354
|
+
const currentValue = this._value_[key];
|
|
355
|
+
if (key != "_parent_") {
|
|
356
|
+
if (currentValue === undefined &&
|
|
357
|
+
currentValue !== null &&
|
|
358
|
+
isNaN(Number(key))) {
|
|
359
|
+
_subProxy.set(null);
|
|
360
|
+
this._publishDynamicFilling_(key, null);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
/**
|
|
365
|
+
* On prévient les écouteurs que la valeur a changé
|
|
366
|
+
*/
|
|
367
|
+
//await //await here gives better performance but can cause issues with some listeners
|
|
368
|
+
this._publishAssignement_();
|
|
369
|
+
if (this.parent && this._parentKey_)
|
|
370
|
+
this.parent._publishDynamicFilling_(this._parentKey_, this._value_);
|
|
371
|
+
/**
|
|
372
|
+
* Si la donnée est complexe (objet, tableau)
|
|
373
|
+
* on crée les proxys pour les sous-éléments qui n'en on pas
|
|
374
|
+
* On renseigne les nouvelles valeurs internes des proxies
|
|
375
|
+
*/
|
|
376
|
+
if (isComplex(this._value_)) {
|
|
377
|
+
for (const key in this._value_) {
|
|
378
|
+
const v = newValue[key];
|
|
379
|
+
const isVComplex = isComplex(v);
|
|
380
|
+
const valueV = isVComplex ? v : { __value: v };
|
|
381
|
+
if (!this._proxies_.has(key)) {
|
|
382
|
+
// A surveiller ancienne version
|
|
383
|
+
// const newPublisher = new DataProvider({}, this);
|
|
384
|
+
// this._proxies_.set(key, newPublisher);
|
|
385
|
+
// newPublisher._proxies_.set("_parent_", this);
|
|
386
|
+
this._publishDynamicFilling_(key, v);
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
//await //await here gives better performance but can cause issues with some listeners
|
|
390
|
+
this._proxies_.get(key)?.set(valueV, true);
|
|
391
|
+
this._publishDynamicFilling_(key, v);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
get() {
|
|
397
|
+
trackModifiedPublisher(this);
|
|
398
|
+
if (this._cachedGet_ !== undefined)
|
|
399
|
+
return this._cachedGet_;
|
|
400
|
+
if (Object.prototype.hasOwnProperty.call(this._value_, "__value")) {
|
|
401
|
+
const v = this._value_.__value;
|
|
402
|
+
return (this._cachedGet_ = (v != undefined ? v : null));
|
|
403
|
+
}
|
|
404
|
+
return (this._cachedGet_ = (this._value_ != undefined ? this._value_ : null));
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* retourner le webcomponent auquel le proxy est associé
|
|
408
|
+
*/
|
|
409
|
+
get $tag() {
|
|
410
|
+
if (!this._instanceCounter_) {
|
|
411
|
+
PublisherProxy.instancesCounter++;
|
|
412
|
+
this._instanceCounter_ = PublisherProxy.instancesCounter;
|
|
413
|
+
}
|
|
414
|
+
PublisherProxy.instances.set(this._instanceCounter_, this);
|
|
415
|
+
const str = "<" +
|
|
416
|
+
SONIC_PREFIX +
|
|
417
|
+
'-publisher-proxy publisher="' +
|
|
418
|
+
this._instanceCounter_ +
|
|
419
|
+
'"></' +
|
|
420
|
+
SONIC_PREFIX +
|
|
421
|
+
"-publisher-proxy>";
|
|
422
|
+
return str;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
PublisherProxy.instances = new Map();
|
|
426
|
+
PublisherProxy.instancesCounter = 0;
|
|
427
|
+
/**
|
|
428
|
+
* Utilitaires de gestion des DataProvider
|
|
429
|
+
* Obtenir, replacer ou supprimer un DataProvider
|
|
430
|
+
*
|
|
431
|
+
*/
|
|
432
|
+
const modifiedCollectore = [];
|
|
433
|
+
function trackModifiedPublisher(proxy) {
|
|
434
|
+
if (modifiedCollectore.length > 0)
|
|
435
|
+
modifiedCollectore[0].add(proxy);
|
|
436
|
+
}
|
|
437
|
+
export function collectModifiedPublisher() {
|
|
438
|
+
modifiedCollectore.unshift(new Set());
|
|
439
|
+
}
|
|
440
|
+
export function getModifiedPublishers() {
|
|
441
|
+
return modifiedCollectore.shift();
|
|
442
|
+
}
|
|
443
|
+
export class PublisherManager {
|
|
444
|
+
constructor() {
|
|
445
|
+
this.enabledLocaStorageProxies = [];
|
|
446
|
+
this.publishers = new Map();
|
|
447
|
+
this.localStorageData = {};
|
|
448
|
+
this.isLocalStrorageReady = null;
|
|
449
|
+
this.initialisedData = [];
|
|
450
|
+
if (PublisherManager.instance != null)
|
|
451
|
+
throw "Singleton / use getInstance";
|
|
452
|
+
PublisherManager.instance = this;
|
|
453
|
+
this.isLocalStrorageReady = this.cleanStorageData();
|
|
454
|
+
PublisherManager.initPageShowHandler();
|
|
455
|
+
}
|
|
456
|
+
static initPageShowHandler() {
|
|
457
|
+
if (PublisherManager.pageShowHandlerInitialized)
|
|
458
|
+
return;
|
|
459
|
+
PublisherManager.pageShowHandlerInitialized = true;
|
|
460
|
+
window.addEventListener("pageshow", (e) => {
|
|
461
|
+
if (e.persisted)
|
|
462
|
+
PublisherManager.getInstance().invalidateAll();
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
invalidateAll() {
|
|
466
|
+
this.publishers.forEach((publisher) => {
|
|
467
|
+
if (!publisher._invalidate_on_page_show_) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
publisher.invalidate();
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
async cleanStorageData() {
|
|
474
|
+
return new Promise((resolve) => {
|
|
475
|
+
const doiIt = async () => {
|
|
476
|
+
try {
|
|
477
|
+
let compressedData = localStorage.getItem(localStorageDataKey);
|
|
478
|
+
let localStorageJSON = null;
|
|
479
|
+
if (compressedData)
|
|
480
|
+
localStorageJSON = await this.decompress(compressedData, "gzip");
|
|
481
|
+
if (localStorageJSON) {
|
|
482
|
+
try {
|
|
483
|
+
this.localStorageData = JSON.parse(localStorageJSON);
|
|
484
|
+
}
|
|
485
|
+
catch (e) {
|
|
486
|
+
this.localStorageData = {};
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
compressedData = await this.compress("{}", "gzip");
|
|
491
|
+
localStorage.setItem(localStorageDataKey, compressedData);
|
|
492
|
+
this.localStorageData = {};
|
|
493
|
+
}
|
|
494
|
+
const expirationDelay = 1000 * 60 * 60 * 12;
|
|
495
|
+
for (const key in this.localStorageData) {
|
|
496
|
+
const item = this.localStorageData[key];
|
|
497
|
+
const expires = new Date().getTime() -
|
|
498
|
+
(item.expirationDelayMs || expirationDelay);
|
|
499
|
+
if (item.lastModifiationMS < expires) {
|
|
500
|
+
delete this.localStorageData[key];
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
resolve(true);
|
|
504
|
+
}
|
|
505
|
+
catch (e) {
|
|
506
|
+
window.requestAnimationFrame(() => {
|
|
507
|
+
resolve(false);
|
|
508
|
+
});
|
|
509
|
+
console.warn("no publisher cache in this browser");
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
doiIt();
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* PublisherManager est un singleton
|
|
517
|
+
*/
|
|
518
|
+
static getInstance(id) {
|
|
519
|
+
if (id) {
|
|
520
|
+
const pm = PublisherManager.instances.get(id);
|
|
521
|
+
if (pm) {
|
|
522
|
+
return pm;
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
console.warn("No PublisherManager instance registered with id:", id, "creating new one");
|
|
526
|
+
return new PublisherManager();
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (PublisherManager.instance == null)
|
|
530
|
+
return new PublisherManager();
|
|
531
|
+
return PublisherManager.instance;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* shortcut static pour obtenir un publisher vias sont id/adresse sans taper getInstance.
|
|
535
|
+
* Si le publisher n'existe pas, il est créé.
|
|
536
|
+
*/
|
|
537
|
+
static get(id, options) {
|
|
538
|
+
return PublisherManager.getInstance().get(id, options);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Obtenir un publisher vias sont id/adresse
|
|
542
|
+
* Si le publisher n'existe pas, il est créé.
|
|
543
|
+
*/
|
|
544
|
+
async setLocalData(publisher, id) {
|
|
545
|
+
await this.isLocalStrorageReady;
|
|
546
|
+
publisher.set(this.localStorageData[id + "¤lang_" + HTML.getLanguage()]?.data ||
|
|
547
|
+
publisher.get());
|
|
548
|
+
}
|
|
549
|
+
get(id, options) {
|
|
550
|
+
const hasLocalStorage = options?.localStorageMode === "enabled";
|
|
551
|
+
const invalidateOnPageShow = options?.invalidateOnPageShow === true;
|
|
552
|
+
if (!this.publishers.has(id)) {
|
|
553
|
+
const data = {};
|
|
554
|
+
const publisher = createPublisher(data);
|
|
555
|
+
this.set(id, publisher);
|
|
556
|
+
}
|
|
557
|
+
const publisher = this.publishers.get(id);
|
|
558
|
+
if (hasLocalStorage && this.initialisedData.indexOf(id) === -1) {
|
|
559
|
+
if (options?.expirationDelayMs) {
|
|
560
|
+
publisher._expiration_delay_ =
|
|
561
|
+
options.expirationDelayMs;
|
|
562
|
+
}
|
|
563
|
+
publisher._is_savable_ = true;
|
|
564
|
+
this.initialisedData.push(id);
|
|
565
|
+
this.setLocalData(publisher, id);
|
|
566
|
+
}
|
|
567
|
+
if (invalidateOnPageShow) {
|
|
568
|
+
publisher._invalidate_on_page_show_ =
|
|
569
|
+
invalidateOnPageShow;
|
|
570
|
+
}
|
|
571
|
+
return this.publishers.get(id);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Remplace un publisher pour l'id fourni par un autre.
|
|
575
|
+
* L'autre publisher n'est pas supprimé.
|
|
576
|
+
*/
|
|
577
|
+
set(id, publisher) {
|
|
578
|
+
this.publishers.set(id, publisher);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @warning
|
|
582
|
+
* !!!!! ATTENTION !!!!!
|
|
583
|
+
* Il est fort à aprier que vous ne voulez pas utiliser cette methode
|
|
584
|
+
* Il s'agit d'une supression complete
|
|
585
|
+
* * du publisher de la liste
|
|
586
|
+
* * des bindings
|
|
587
|
+
* * de même que ses sous publishers
|
|
588
|
+
*
|
|
589
|
+
* UTILISEZ PLUTÔT la méthode publisher.set({}) pour réinitialiser un publisher sans perdre les ecouteurs
|
|
590
|
+
*/
|
|
591
|
+
delete(id) {
|
|
592
|
+
if (!this.publishers.has(id))
|
|
593
|
+
return false;
|
|
594
|
+
this.publishers.delete(id);
|
|
595
|
+
return true;
|
|
596
|
+
}
|
|
597
|
+
async saveToLocalStorage(saveId = 0) {
|
|
598
|
+
/**
|
|
599
|
+
* si l'id a changé et que ce n'est pas un multiple de 10, on ne sauve pas
|
|
600
|
+
* on sauvegarde quand même tous les 10 au cas ou on aurrait des changements en continue, par exemple à chaque frame
|
|
601
|
+
*/
|
|
602
|
+
if (saveId !== PublisherManager.saveId && saveId % 10 != 0)
|
|
603
|
+
return;
|
|
604
|
+
try {
|
|
605
|
+
if (!PublisherManager.changed || PublisherManager.saving)
|
|
606
|
+
return;
|
|
607
|
+
PublisherManager.saving = true;
|
|
608
|
+
PublisherManager.changed = false;
|
|
609
|
+
const keys = Array.from(this.publishers.keys());
|
|
610
|
+
let hasChanged = false;
|
|
611
|
+
for (const key of keys) {
|
|
612
|
+
const publisher = this.publishers.get(key);
|
|
613
|
+
if (!publisher?._is_savable_)
|
|
614
|
+
continue;
|
|
615
|
+
const data = publisher?.get();
|
|
616
|
+
if (!data)
|
|
617
|
+
continue;
|
|
618
|
+
this.localStorageData[key + "¤lang_" + HTML.getLanguage()] = {
|
|
619
|
+
lastModifiationMS: new Date().getTime(),
|
|
620
|
+
expirationDelayMs: publisher._expiration_delay_,
|
|
621
|
+
data: data,
|
|
622
|
+
};
|
|
623
|
+
hasChanged = true;
|
|
624
|
+
}
|
|
625
|
+
// on enregistre les données
|
|
626
|
+
if (hasChanged) {
|
|
627
|
+
const compressedData = await this.compress(JSON.stringify(this.localStorageData), "gzip");
|
|
628
|
+
localStorage.setItem(localStorageDataKey, compressedData);
|
|
629
|
+
}
|
|
630
|
+
PublisherManager.saving = false;
|
|
631
|
+
if (PublisherManager.changed) {
|
|
632
|
+
PublisherManager.saveId++;
|
|
633
|
+
const saveId = PublisherManager.saveId;
|
|
634
|
+
setTimeout(() => this.saveToLocalStorage(saveId), 1000);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
catch (e) {
|
|
638
|
+
PublisherManager.saving = false;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
async compress(string, encoding) {
|
|
642
|
+
const byteArray = new TextEncoder().encode(string);
|
|
643
|
+
const win = window;
|
|
644
|
+
const cs = new win.CompressionStream(encoding);
|
|
645
|
+
const writer = cs.writable.getWriter();
|
|
646
|
+
writer.write(byteArray);
|
|
647
|
+
writer.close();
|
|
648
|
+
const result = await new Response(cs.readable).arrayBuffer();
|
|
649
|
+
const arrayBufferView = new Uint8Array(result);
|
|
650
|
+
let str = "";
|
|
651
|
+
for (let i = 0; i < arrayBufferView.length; i++) {
|
|
652
|
+
str += String.fromCharCode(arrayBufferView[i]);
|
|
653
|
+
}
|
|
654
|
+
return btoa(str);
|
|
655
|
+
}
|
|
656
|
+
async decompress(str, encoding) {
|
|
657
|
+
const decodedString = atob(str);
|
|
658
|
+
const arrayBufferViewFromLocalStorage = Uint8Array.from(decodedString, (c) => c.charCodeAt(0));
|
|
659
|
+
const byteArray = arrayBufferViewFromLocalStorage.buffer;
|
|
660
|
+
const win = window;
|
|
661
|
+
const cs = new win.DecompressionStream(encoding);
|
|
662
|
+
const writer = cs.writable.getWriter();
|
|
663
|
+
writer.write(byteArray);
|
|
664
|
+
writer.close();
|
|
665
|
+
const result = await new Response(cs.readable).arrayBuffer();
|
|
666
|
+
return new TextDecoder().decode(result);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
PublisherManager.buildDate = __BUILD_DATE__;
|
|
670
|
+
PublisherManager.changed = false;
|
|
671
|
+
PublisherManager.saving = false;
|
|
672
|
+
PublisherManager.saveId = 0;
|
|
673
|
+
PublisherManager.instance = null;
|
|
674
|
+
PublisherManager.instances = new Map();
|
|
675
|
+
PublisherManager.pageShowHandlerInitialized = false;
|
|
676
|
+
if (typeof window !== "undefined") {
|
|
677
|
+
const win = window;
|
|
678
|
+
win[sonicClassPrefix + "PublisherManager"] =
|
|
679
|
+
win[sonicClassPrefix + "PublisherManager"] || PublisherManager;
|
|
680
|
+
}
|
|
681
|
+
const internalProps = new Set([
|
|
682
|
+
"invalidate",
|
|
683
|
+
"onInvalidate",
|
|
684
|
+
"offInvalidate",
|
|
685
|
+
"invalidateForm",
|
|
686
|
+
"onFormInvalidate",
|
|
687
|
+
"offFormInvalidate",
|
|
688
|
+
"onAssign",
|
|
689
|
+
"offAssign",
|
|
690
|
+
"startDynamicFilling",
|
|
691
|
+
"stopDynamicFilling",
|
|
692
|
+
"startTemplateFilling",
|
|
693
|
+
"stopTemplateFilling",
|
|
694
|
+
"onInternalMutation",
|
|
695
|
+
"offInternalMutation",
|
|
696
|
+
"set",
|
|
697
|
+
"get",
|
|
698
|
+
"$tag",
|
|
699
|
+
"_cachedGet_",
|
|
700
|
+
"_templateFillListeners_",
|
|
701
|
+
"_fillListeners_",
|
|
702
|
+
"_assignListeners_",
|
|
703
|
+
"_invalidateListeners_",
|
|
704
|
+
"_formInvalidateListeners_",
|
|
705
|
+
"_publishInternalMutation_",
|
|
706
|
+
"hasListener",
|
|
707
|
+
"delete",
|
|
708
|
+
"_mutationListeners_",
|
|
709
|
+
"_publishDynamicFilling_",
|
|
710
|
+
"_publishInvalidation_",
|
|
711
|
+
"_publishFormInvalidation_",
|
|
712
|
+
"_publishTemplateFilling_",
|
|
713
|
+
"_publishAssignement_",
|
|
714
|
+
"_proxies_",
|
|
715
|
+
"parent",
|
|
716
|
+
"_parentKey_",
|
|
717
|
+
"_value_",
|
|
718
|
+
"_is_savable_",
|
|
719
|
+
"_expiration_delay_",
|
|
720
|
+
"_lockInternalMutationPublishing_",
|
|
721
|
+
"_instanceCounter_",
|
|
722
|
+
"_assignmentId_",
|
|
723
|
+
"_invalidate_on_page_show_",
|
|
724
|
+
]);
|
|
725
|
+
function createPublisherHandler(publisherInstance, getProxy) {
|
|
726
|
+
return {
|
|
727
|
+
/**
|
|
728
|
+
* Lorsque l'on écrit monConteneur = publisher.maClef ou monConteneur = publisher["maClef"] monConteneur contient :
|
|
729
|
+
* Les methodes de PublisherProxy (onAssign... : voir liste dans kle tableaus si dessous), si la clef est une méthode de PublisherProxy,,
|
|
730
|
+
* Sinon un autre proxy qui a comme valeur interne la valeur corespondante à la clef dans l'objet.
|
|
731
|
+
*/
|
|
732
|
+
get: function (_publisherInstance, sKey) {
|
|
733
|
+
if (typeof sKey === "string" && internalProps.has(sKey))
|
|
734
|
+
return publisherInstance[sKey];
|
|
735
|
+
if (sKey == Symbol.toPrimitive) {
|
|
736
|
+
return () => getProxy().get();
|
|
737
|
+
}
|
|
738
|
+
// Support de la notation à points (rigolo mais pas intuitif)
|
|
739
|
+
// if (sKey.includes(".")) {
|
|
740
|
+
// const keys = sKey.split(".");
|
|
741
|
+
// return thisProxy[keys.shift()][keys.join(".")];
|
|
742
|
+
// }
|
|
743
|
+
if (!publisherInstance._proxies_.has(sKey)) {
|
|
744
|
+
const vValue = publisherInstance._value_[sKey];
|
|
745
|
+
const newPublisher = createPublisher(isComplex(vValue) ? vValue : { __value: vValue }, publisherInstance, sKey);
|
|
746
|
+
newPublisher._proxies_.set("_parent_", getProxy());
|
|
747
|
+
publisherInstance._proxies_.set(sKey, newPublisher);
|
|
748
|
+
}
|
|
749
|
+
return publisherInstance._proxies_.get(sKey);
|
|
750
|
+
},
|
|
751
|
+
/**
|
|
752
|
+
* Lorsque l'on écrit publisher.maClef = value ou publisher["maClef"] = value, on assigne la valeur à la clef dans l'objet interne.
|
|
753
|
+
* Les gestionnairs associés sopnt déclenchés en conséquence de manière profonde et remontante si nécessaire.
|
|
754
|
+
*/
|
|
755
|
+
set: function (_publisherInstance, sKey, vValue) {
|
|
756
|
+
//Fonctionnement pour la donnée interne pas de dispatch;
|
|
757
|
+
if (sKey == "_value_") {
|
|
758
|
+
publisherInstance._value_ = vValue;
|
|
759
|
+
return true;
|
|
760
|
+
}
|
|
761
|
+
if (sKey == "_cachedGet_") {
|
|
762
|
+
publisherInstance._cachedGet_ = vValue;
|
|
763
|
+
return true;
|
|
764
|
+
}
|
|
765
|
+
if (sKey == "_assignmentId_") {
|
|
766
|
+
publisherInstance._assignmentId_ = vValue;
|
|
767
|
+
return true;
|
|
768
|
+
}
|
|
769
|
+
if (sKey == "_is_savable_") {
|
|
770
|
+
publisherInstance._is_savable_ = vValue;
|
|
771
|
+
return true;
|
|
772
|
+
}
|
|
773
|
+
if (sKey == "_expiration_delay_") {
|
|
774
|
+
publisherInstance._expiration_delay_ = vValue;
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
if (sKey == "_invalidate_on_page_show_") {
|
|
778
|
+
publisherInstance._invalidate_on_page_show_ = vValue;
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
if (sKey == "_instanceCounter_") {
|
|
782
|
+
publisherInstance._instanceCounter_ = vValue;
|
|
783
|
+
return true;
|
|
784
|
+
}
|
|
785
|
+
// Support de la notation à points (rigolo mais pas intuitif)
|
|
786
|
+
// if (sKey.includes(".")) {
|
|
787
|
+
// const keys = sKey.split(".");
|
|
788
|
+
// thisProxy[keys.shift() || ""][keys.join(".")].set(vValue);
|
|
789
|
+
// return true;
|
|
790
|
+
// }
|
|
791
|
+
//Création du publisher si il n'existe pas
|
|
792
|
+
if (!publisherInstance._proxies_.has(sKey)) {
|
|
793
|
+
const newPublisher = createPublisher({}, publisherInstance, sKey);
|
|
794
|
+
newPublisher._proxies_.set("_parent_", getProxy());
|
|
795
|
+
publisherInstance._proxies_.set(sKey, newPublisher);
|
|
796
|
+
}
|
|
797
|
+
//mis à jour et publication de la donnée si elle a changé
|
|
798
|
+
const prevValue = publisherInstance._value_[sKey];
|
|
799
|
+
if (prevValue !== vValue) {
|
|
800
|
+
publisherInstance._value_[sKey] = vValue;
|
|
801
|
+
publisherInstance._publishDynamicFilling_(sKey, vValue);
|
|
802
|
+
publisherInstance._proxies_
|
|
803
|
+
.get(sKey)
|
|
804
|
+
?.set(isComplex(vValue) ? vValue : { __value: vValue });
|
|
805
|
+
}
|
|
806
|
+
//on retourne le proxy pour pouvoir chainer les assignements
|
|
807
|
+
// return publisherInstance._proxies_.get(sKey);
|
|
808
|
+
return true;
|
|
809
|
+
},
|
|
810
|
+
/**
|
|
811
|
+
* Autres propriétés classiques d'un objet implémentées par le proxy
|
|
812
|
+
*/
|
|
813
|
+
deleteProperty: function (_publisherInstance, sKey) {
|
|
814
|
+
publisherInstance._publishDynamicFilling_(sKey, null);
|
|
815
|
+
// if (!publisherInstance._proxies_.get(sKey)?.hasListener()) {
|
|
816
|
+
// publisherInstance._proxies_.delete(sKey);
|
|
817
|
+
// } else {
|
|
818
|
+
publisherInstance._proxies_.get(sKey)?.set(null);
|
|
819
|
+
// }
|
|
820
|
+
return delete publisherInstance._value_[sKey];
|
|
821
|
+
},
|
|
822
|
+
// enumerate: function (publisherInstance, sKey): CoreJSType {
|
|
823
|
+
// return publisherInstance._value_.keys();
|
|
824
|
+
// },
|
|
825
|
+
has: function (_publisherInstance, sKey) {
|
|
826
|
+
return (sKey in publisherInstance._value_ &&
|
|
827
|
+
sKey != "_lockInternalMutationPublishing_");
|
|
828
|
+
},
|
|
829
|
+
defineProperty: function (_publisherInstance, sKey, oDesc) {
|
|
830
|
+
if (oDesc && "value" in oDesc) {
|
|
831
|
+
publisherInstance._value_[sKey] = oDesc.value;
|
|
832
|
+
}
|
|
833
|
+
return true;
|
|
834
|
+
// return publisherInstance._value_;
|
|
835
|
+
},
|
|
836
|
+
getOwnPropertyDescriptor: function (_publisherInstance, sKey) {
|
|
837
|
+
sKey;
|
|
838
|
+
return {
|
|
839
|
+
enumerable: true,
|
|
840
|
+
configurable: true,
|
|
841
|
+
};
|
|
842
|
+
},
|
|
843
|
+
ownKeys: function (_publisherInstance) {
|
|
844
|
+
if (publisherInstance._value_.__value)
|
|
845
|
+
return Object.keys(publisherInstance._value_.__value);
|
|
846
|
+
return Object.keys(publisherInstance._value_);
|
|
847
|
+
},
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
export function createPublisher(target, parentProxPub = null, parentKey) {
|
|
851
|
+
const instance = new PublisherProxy(target, parentProxPub, parentKey);
|
|
852
|
+
let proxy = null;
|
|
853
|
+
const handler = createPublisherHandler(instance, () => proxy);
|
|
854
|
+
proxy = new Proxy(instance, handler);
|
|
855
|
+
return proxy;
|
|
856
|
+
}
|
|
857
|
+
// if (typeof module != "undefined") module.exports = {DataProvider: DataProvider, PublisherManager: PublisherManager};
|
|
858
|
+
// /**
|
|
859
|
+
// * A custom webcomponent wich will be linked to a publisher via its attribute "publisher"
|
|
860
|
+
// * the publisher will be found via PublisherManager.get(publisherId) and will be used to fill the component using the onAssign method
|
|
861
|
+
// */
|
|
862
|
+
class PublisherWebComponent extends HTMLElement {
|
|
863
|
+
constructor() {
|
|
864
|
+
super();
|
|
865
|
+
this.publisherId = "";
|
|
866
|
+
this.onAssign = (value) => {
|
|
867
|
+
this.innerHTML = value.toString();
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
connectedCallback() {
|
|
871
|
+
this.publisherId = this.getAttribute("publisher") || "";
|
|
872
|
+
this.publisher = PublisherProxy.instances.get(parseInt(this.publisherId));
|
|
873
|
+
this.publisher?.onAssign(this.onAssign);
|
|
874
|
+
}
|
|
875
|
+
disconnectedCallback() {
|
|
876
|
+
this.publisher?.offAssign(this.onAssign);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
try {
|
|
880
|
+
customElements.define(SONIC_PREFIX + "-publisher-proxy", PublisherWebComponent);
|
|
881
|
+
}
|
|
882
|
+
catch (e) { }
|
|
883
|
+
export const getObservables = (observable, options) => {
|
|
884
|
+
if (typeof observable === "function") {
|
|
885
|
+
const func = observable;
|
|
886
|
+
collectModifiedPublisher();
|
|
887
|
+
func();
|
|
888
|
+
return getModifiedPublishers();
|
|
889
|
+
}
|
|
890
|
+
if (typeof observable === "string") {
|
|
891
|
+
const split = observable.split(".");
|
|
892
|
+
const dataProvider = split.shift() || "";
|
|
893
|
+
let publisher = PublisherManager.get(dataProvider, options);
|
|
894
|
+
publisher = Objects.traverse(publisher, split);
|
|
895
|
+
const set = new Set();
|
|
896
|
+
set.add(publisher);
|
|
897
|
+
return set;
|
|
898
|
+
}
|
|
899
|
+
return new Set([observable]);
|
|
900
|
+
};
|
|
901
|
+
export function get(id) {
|
|
902
|
+
const path = resolveStaticPublisherPath(id);
|
|
903
|
+
return getObservables(path).values().next().value?.get();
|
|
904
|
+
}
|
|
905
|
+
function deepee(id, _defaultValue, options) {
|
|
906
|
+
const path = resolveStaticPublisherPath(id);
|
|
907
|
+
const value = getObservables(path, options).values().next()
|
|
908
|
+
.value;
|
|
909
|
+
// if (defaultValue !== undefined && value) {
|
|
910
|
+
// const innerValue = value.get();
|
|
911
|
+
// if (Objects.isEmpty(innerValue as Record<string, any>)) {
|
|
912
|
+
// value.set(defaultValue);
|
|
913
|
+
// }
|
|
914
|
+
// }
|
|
915
|
+
return value;
|
|
916
|
+
}
|
|
917
|
+
function isDataProvider(value) {
|
|
918
|
+
return (value != null &&
|
|
919
|
+
typeof value === "object" &&
|
|
920
|
+
typeof value.get === "function" &&
|
|
921
|
+
typeof value.set === "function" &&
|
|
922
|
+
typeof value.onAssign === "function");
|
|
923
|
+
}
|
|
924
|
+
function resolvePublisherRef(ref, options) {
|
|
925
|
+
if (isDataProvider(ref))
|
|
926
|
+
return ref;
|
|
927
|
+
return deepee(ref, undefined, options);
|
|
928
|
+
}
|
|
929
|
+
export function dataProvider(id, second) {
|
|
930
|
+
if (isDpOptions(second))
|
|
931
|
+
return deepee(id, undefined, second);
|
|
932
|
+
return deepee(id, second);
|
|
933
|
+
}
|
|
934
|
+
export function dp(id, second) {
|
|
935
|
+
if (isDpOptions(second))
|
|
936
|
+
return deepee(id, undefined, second);
|
|
937
|
+
return deepee(id, second);
|
|
938
|
+
}
|
|
939
|
+
export function mirrorDp(aliasKey, source) {
|
|
940
|
+
PublisherManager.getInstance().set(resolveStaticPublisherPath(aliasKey), resolvePublisherRef(source));
|
|
941
|
+
}
|
|
942
|
+
export function set(id, value) {
|
|
943
|
+
const path = resolveStaticPublisherPath(id);
|
|
944
|
+
getObservables(path).values().next().value?.set(value);
|
|
945
|
+
}
|
|
946
|
+
//# sourceMappingURL=PublisherProxy.js.map
|