@cwa/nuxt-edge 0.0.0-29696494.72f11a4
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 +38 -0
- package/README.template.md +32 -0
- package/dist/layer/_components/TextButton.vue +13 -0
- package/dist/layer/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +172 -0
- package/dist/layer/nuxt.config.ts +8 -0
- package/dist/layer/pages/_cwa/[cwaPage0].vue +18 -0
- package/dist/layer/pages/_cwa/index/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/index/composables/useDataType.ts +41 -0
- package/dist/layer/pages/_cwa/index/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/index/composables/useItemPage.ts +200 -0
- package/dist/layer/pages/_cwa/index/composables/useListPage.ts +44 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageDataLoader.ts +51 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageLoader.ts +25 -0
- package/dist/layer/pages/_cwa/index/data/[type]/[iri].vue +22 -0
- package/dist/layer/pages/_cwa/index/data/[type].vue +132 -0
- package/dist/layer/pages/_cwa/index/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/index/layouts/[iri].vue +180 -0
- package/dist/layer/pages/_cwa/index/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/index/pages/[iri].vue +16 -0
- package/dist/layer/pages/_cwa/index/pages.vue +130 -0
- package/dist/layer/pages/_cwa/index/routes.vue +56 -0
- package/dist/layer/pages/_cwa/index/settings.vue +398 -0
- package/dist/layer/pages/_cwa/index/users/[iri].vue +337 -0
- package/dist/layer/pages/_cwa/index/users.vue +90 -0
- package/dist/layer/pages/_cwa/index.vue +43 -0
- package/dist/layer/pages/confirm-new-email/[username]/[newEmail]/[token].vue +49 -0
- package/dist/layer/pages/forgot-password.vue +31 -0
- package/dist/layer/pages/login.vue +32 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +38 -0
- package/dist/layer/pages/verify-email/[username]/[token].vue +48 -0
- package/dist/module.d.mts +15 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +292 -0
- package/dist/runtime/admin/admin.d.ts +35 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +42 -0
- package/dist/runtime/admin/manageable-resource.js +241 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +55 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +57 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +93 -0
- package/dist/runtime/admin/resource-stack-manager.js +388 -0
- package/dist/runtime/api/api-documentation.d.ts +28 -0
- package/dist/runtime/api/api-documentation.js +131 -0
- package/dist/runtime/api/auth.d.ts +100 -0
- package/dist/runtime/api/auth.js +264 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +12 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +43 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +59 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +225 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +263 -0
- package/dist/runtime/api/fetcher/preload-headers.d.ts +6 -0
- package/dist/runtime/api/fetcher/preload-headers.js +31 -0
- package/dist/runtime/api/forms.d.ts +40 -0
- package/dist/runtime/api/forms.js +40 -0
- package/dist/runtime/api/mercure.d.ts +32 -0
- package/dist/runtime/api/mercure.js +196 -0
- package/dist/runtime/api/site-config.d.ts +36 -0
- package/dist/runtime/api/site-config.js +135 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +74 -0
- package/dist/runtime/composables/cwa-collection-pagination.d.ts +13 -0
- package/dist/runtime/composables/cwa-collection-pagination.js +34 -0
- package/dist/runtime/composables/cwa-collection-resource.d.ts +18 -0
- package/dist/runtime/composables/cwa-collection-resource.js +105 -0
- package/dist/runtime/composables/cwa-image-resource.d.ts +15 -0
- package/dist/runtime/composables/cwa-image-resource.js +26 -0
- package/dist/runtime/composables/cwa-image.d.ts +24 -0
- package/dist/runtime/composables/cwa-image.js +38 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +109 -0
- package/dist/runtime/composables/cwa-resource-endpoint.d.ts +5 -0
- package/dist/runtime/composables/cwa-resource-endpoint.js +36 -0
- package/dist/runtime/composables/cwa-resource-manageable.d.ts +10 -0
- package/dist/runtime/composables/cwa-resource-manageable.js +53 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +16 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.js +30 -0
- package/dist/runtime/composables/cwa-resource-model.d.ts +21 -0
- package/dist/runtime/composables/cwa-resource-model.js +156 -0
- package/dist/runtime/composables/cwa-resource-upload.d.ts +8 -0
- package/dist/runtime/composables/cwa-resource-upload.js +70 -0
- package/dist/runtime/composables/cwa-resource.d.ts +26 -0
- package/dist/runtime/composables/cwa-resource.js +42 -0
- package/dist/runtime/composables/cwa-select-input.d.ts +21 -0
- package/dist/runtime/composables/cwa-select-input.js +37 -0
- package/dist/runtime/composables/cwa-select.d.ts +15 -0
- package/dist/runtime/composables/cwa-select.js +24 -0
- package/dist/runtime/composables/cwa.d.ts +2 -0
- package/dist/runtime/composables/cwa.js +2 -0
- package/dist/runtime/composables/forgot-password.d.ts +9 -0
- package/dist/runtime/composables/forgot-password.js +45 -0
- package/dist/runtime/composables/login.d.ts +9 -0
- package/dist/runtime/composables/login.js +30 -0
- package/dist/runtime/composables/popper.d.ts +529 -0
- package/dist/runtime/composables/popper.js +105 -0
- package/dist/runtime/composables/process.d.ts +4 -0
- package/dist/runtime/composables/process.js +6 -0
- package/dist/runtime/composables/reset-password.d.ts +14 -0
- package/dist/runtime/composables/reset-password.js +75 -0
- package/dist/runtime/composables/transitions.d.ts +12 -0
- package/dist/runtime/composables/transitions.js +12 -0
- package/dist/runtime/composables/useCwaResourceRoute.d.ts +10 -0
- package/dist/runtime/composables/useCwaResourceRoute.js +17 -0
- package/dist/runtime/composables/useCwaSiteConfig.d.ts +15 -0
- package/dist/runtime/composables/useCwaSiteConfig.js +78 -0
- package/dist/runtime/composables/useResendVerifyEmail.d.ts +6 -0
- package/dist/runtime/composables/useResendVerifyEmail.js +43 -0
- package/dist/runtime/composables/useVerifyEmail.d.ts +8 -0
- package/dist/runtime/composables/useVerifyEmail.js +84 -0
- package/dist/runtime/cwa.d.ts +70 -0
- package/dist/runtime/cwa.js +133 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +20 -0
- package/dist/runtime/errors/cwa-resource-error.js +61 -0
- package/dist/runtime/plugin.d.ts +8 -0
- package/dist/runtime/plugin.js +20 -0
- package/dist/runtime/resources/resource-utils.d.ts +52 -0
- package/dist/runtime/resources/resource-utils.js +86 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +482 -0
- package/dist/runtime/resources/resources.d.ts +61 -0
- package/dist/runtime/resources/resources.js +360 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +71 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.d.ts +2 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.js +29 -0
- package/dist/runtime/server/cwa-healthcheck.get.d.ts +4 -0
- package/dist/runtime/server/cwa-healthcheck.get.js +10 -0
- package/dist/runtime/server/cwa-urls.get.d.ts +3 -0
- package/dist/runtime/server/cwa-urls.get.js +15 -0
- package/dist/runtime/server/server-middleware.d.ts +2 -0
- package/dist/runtime/server/server-middleware.js +63 -0
- package/dist/runtime/server/server-plugin.d.ts +2 -0
- package/dist/runtime/server/server-plugin.js +59 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/useFetcher.d.ts +7 -0
- package/dist/runtime/server/useFetcher.js +40 -0
- package/dist/runtime/storage/storage.d.ts +25 -0
- package/dist/runtime/storage/storage.js +48 -0
- package/dist/runtime/storage/stores/admin/actions.d.ts +5 -0
- package/dist/runtime/storage/stores/admin/actions.js +10 -0
- package/dist/runtime/storage/stores/admin/admin-store.d.ts +18 -0
- package/dist/runtime/storage/stores/admin/admin-store.js +20 -0
- package/dist/runtime/storage/stores/admin/state.d.ts +7 -0
- package/dist/runtime/storage/stores/admin/state.js +9 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.d.ts +16 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.js +18 -0
- package/dist/runtime/storage/stores/api-documentation/state.d.ts +71 -0
- package/dist/runtime/storage/stores/api-documentation/state.js +6 -0
- package/dist/runtime/storage/stores/auth/auth-store.d.ts +16 -0
- package/dist/runtime/storage/stores/auth/auth-store.js +18 -0
- package/dist/runtime/storage/stores/auth/state.d.ts +19 -0
- package/dist/runtime/storage/stores/auth/state.js +15 -0
- package/dist/runtime/storage/stores/cwa-store-types.d.ts +14 -0
- package/dist/runtime/storage/stores/error/actions.d.ts +11 -0
- package/dist/runtime/storage/stores/error/actions.js +73 -0
- package/dist/runtime/storage/stores/error/error-store.d.ts +13 -0
- package/dist/runtime/storage/stores/error/error-store.js +21 -0
- package/dist/runtime/storage/stores/error/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/error/getters.js +11 -0
- package/dist/runtime/storage/stores/error/state.d.ts +35 -0
- package/dist/runtime/storage/stores/error/state.js +15 -0
- package/dist/runtime/storage/stores/fetcher/actions.d.ts +56 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +138 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.d.ts +19 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.js +23 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/fetcher/getters.d.ts +13 -0
- package/dist/runtime/storage/stores/fetcher/getters.js +52 -0
- package/dist/runtime/storage/stores/fetcher/state.d.ts +27 -0
- package/dist/runtime/storage/stores/fetcher/state.js +7 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.d.ts +16 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.js +18 -0
- package/dist/runtime/storage/stores/mercure/state.d.ts +5 -0
- package/dist/runtime/storage/stores/mercure/state.js +6 -0
- package/dist/runtime/storage/stores/resources/actions.d.ts +59 -0
- package/dist/runtime/storage/stores/resources/actions.js +449 -0
- package/dist/runtime/storage/stores/resources/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/resources/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/resources/getters.d.ts +38 -0
- package/dist/runtime/storage/stores/resources/getters.js +254 -0
- package/dist/runtime/storage/stores/resources/resources-store.d.ts +19 -0
- package/dist/runtime/storage/stores/resources/resources-store.js +23 -0
- package/dist/runtime/storage/stores/resources/state.d.ts +67 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -0
- package/dist/runtime/storage/stores/site-config/actions.d.ts +9 -0
- package/dist/runtime/storage/stores/site-config/actions.js +20 -0
- package/dist/runtime/storage/stores/site-config/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/site-config/getters.js +10 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.d.ts +19 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.js +23 -0
- package/dist/runtime/storage/stores/site-config/state.d.ts +13 -0
- package/dist/runtime/storage/stores/site-config/state.js +8 -0
- package/dist/runtime/templates/assets/base.css +1 -0
- package/dist/runtime/templates/assets/cwa.css +1 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +27 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPosition.d.vue.ts +4 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +64 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +4 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/DialogBox.d.vue.ts +38 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +96 -0
- package/dist/runtime/templates/components/core/DialogBox.vue.d.ts +38 -0
- package/dist/runtime/templates/components/core/README.md +1 -0
- package/dist/runtime/templates/components/core/ResourceLoader.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/ResourceLoader.spec.ts.snap +39 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue +151 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue +7 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +11 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +137 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.d.vue.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.d.vue.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +33 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +94 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +19 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.d.vue.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +404 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +368 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue +439 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.d.vue.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +110 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.d.vue.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +24 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.d.vue.ts +0 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +81 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +0 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue +42 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.d.vue.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +62 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +264 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue +45 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue +139 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue +74 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +19 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.d.vue.ts +8 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue +86 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue.d.ts +8 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +24 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +57 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +100 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.d.vue.ts +9 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue +112 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +113 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +166 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +22 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +102 -0
- package/dist/runtime/templates/components/main/ComponentGroup.d.vue.ts +13 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +68 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +138 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +13 -0
- package/dist/runtime/templates/components/main/CwaLink.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +55 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/CwaPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/CwaPage.vue +22 -0
- package/dist/runtime/templates/components/main/CwaPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/DefaultLayout.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +134 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/Logo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/README.md +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue +41 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue +48 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.d.ts +5 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.js +19 -0
- package/dist/runtime/templates/components/main/admin/header/Header.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue +209 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +155 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.d.vue.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +20 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue.d.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +70 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue +79 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue +52 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +159 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +198 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue +186 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +208 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue +38 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue +15 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue +44 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +67 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue +75 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue +41 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +114 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue +34 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +104 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue +52 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +94 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue +28 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.d.vue.ts +26 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +56 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +26 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +61 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.d.vue.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.spec.ts.snap +90 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue +59 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.d.vue.ts +22 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.spec.ts.snap +111 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue +50 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue.d.ts +22 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +1071 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/Hamburger.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.spec.ts.snap +71 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue +29 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.d.vue.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +17 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.d.vue.ts +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +18 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +13 -0
- package/dist/runtime/templates/components/ui/form/Button.d.vue.ts +53 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +53 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/File.d.vue.ts +18 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +18 -0
- package/dist/runtime/templates/components/ui/form/Input.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +17 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +17 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue +212 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/Select.d.vue.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Toggle.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +48 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/utils/ContextMenu.d.vue.ts +27 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +60 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +27 -0
- package/dist/runtime/templates/components/utils/HotSpot.d.vue.ts +12 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +28 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +12 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +44 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +7 -0
- package/dist/runtime/templates/cwa-page.d.vue.ts +3 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +9 -0
- package/dist/runtime/templates/cwa-page.vue +55 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +3 -0
- package/dist/runtime/types/index.d.ts +59 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +7 -0
- package/package.json +132 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { consola as logger } from "consola";
|
|
2
|
+
import { storeToRefs } from "pinia";
|
|
3
|
+
import { computed, watch } from "vue";
|
|
4
|
+
import { getPublishedResourceIri } from "../resources/resource-utils.js";
|
|
5
|
+
import { useProcess } from "#cwa/composables/process";
|
|
6
|
+
export default class Mercure {
|
|
7
|
+
eventSource;
|
|
8
|
+
lastEventId;
|
|
9
|
+
mercureMessageQueue = [];
|
|
10
|
+
fetcher;
|
|
11
|
+
requestCount;
|
|
12
|
+
_mercureStore;
|
|
13
|
+
_resourcesStore;
|
|
14
|
+
_fetcherStore;
|
|
15
|
+
constructor(mercureStoreDefinition, resourcesStoreDefinition, fetcherStoreDefinition) {
|
|
16
|
+
this._mercureStore = mercureStoreDefinition.useStore();
|
|
17
|
+
this._resourcesStore = resourcesStoreDefinition.useStore();
|
|
18
|
+
this._fetcherStore = fetcherStoreDefinition.useStore();
|
|
19
|
+
}
|
|
20
|
+
setFetcher(fetcher) {
|
|
21
|
+
this.fetcher = fetcher;
|
|
22
|
+
}
|
|
23
|
+
setRequestCount(requestCount) {
|
|
24
|
+
this.requestCount = requestCount;
|
|
25
|
+
}
|
|
26
|
+
setMercureHubFromLinkHeader(linkHeader) {
|
|
27
|
+
if (this.hub) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const matches = linkHeader.match(/<([^>]+)>;\s+rel="mercure".*/);
|
|
31
|
+
if (!matches?.[1]) {
|
|
32
|
+
logger.error("No Mercure rel in link header.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const { hub } = storeToRefs(this.mercureStore);
|
|
36
|
+
hub.value = matches[1];
|
|
37
|
+
logger.debug("Mercure hub set", this.hub);
|
|
38
|
+
}
|
|
39
|
+
init(forceRestart) {
|
|
40
|
+
const { isServer } = useProcess();
|
|
41
|
+
if (isServer) {
|
|
42
|
+
logger.debug("Mercure can only initialise on the client side");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!this.hubUrl) {
|
|
46
|
+
logger.warn("Cannot initialize Mercure. Hub URL is not set.");
|
|
47
|
+
this.closeMercure();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (!forceRestart && this.eventSource && this.eventSource.readyState === 1 && this.eventSource.url === this.hubUrl) {
|
|
51
|
+
logger.debug(`Mercure already initialized '${this.hubUrl}'`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.closeMercure();
|
|
55
|
+
logger.info(`Initializing Mercure '${this.hubUrl}'`);
|
|
56
|
+
this.eventSource = new EventSource(this.hubUrl, { withCredentials: true });
|
|
57
|
+
this.eventSource.onmessage = (event) => this.handleMercureMessage(event);
|
|
58
|
+
}
|
|
59
|
+
closeMercure() {
|
|
60
|
+
if (this.eventSource) {
|
|
61
|
+
this.eventSource.close();
|
|
62
|
+
logger.info("Mercure Event Source Closed");
|
|
63
|
+
} else {
|
|
64
|
+
logger.warn("No Mercure Event Source exists to close");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
get requestsInProgress() {
|
|
68
|
+
const { currentResourcesApiStateIsPending } = storeToRefs(this.resourcesStore);
|
|
69
|
+
return computed(() => {
|
|
70
|
+
return this.requestCount && this.requestCount?.value > 0 || currentResourcesApiStateIsPending.value;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
handleMercureMessage(event) {
|
|
74
|
+
const mercureMessage = {
|
|
75
|
+
event,
|
|
76
|
+
data: JSON.parse(event.data)
|
|
77
|
+
};
|
|
78
|
+
if (!this.isMessageForCurrentResource(mercureMessage)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.addMercureMessageToQueue(mercureMessage);
|
|
82
|
+
if (!this.requestsInProgress.value) {
|
|
83
|
+
this.processMessageQueue();
|
|
84
|
+
} else {
|
|
85
|
+
const unwatch = watch(this.requestsInProgress, (inProgress) => {
|
|
86
|
+
if (!inProgress) {
|
|
87
|
+
this.processMessageQueue();
|
|
88
|
+
unwatch();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
isMessageForCurrentResource(mercureMessage) {
|
|
94
|
+
const currentResources = this.resourcesStore.current.currentIds;
|
|
95
|
+
const mercureMessageResource = mercureMessage.data;
|
|
96
|
+
if (!("@id" in mercureMessageResource)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (!currentResources.includes(mercureMessageResource["@id"])) {
|
|
100
|
+
const publishedIri = getPublishedResourceIri(mercureMessageResource);
|
|
101
|
+
if (!publishedIri || !currentResources.includes(publishedIri)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
addMercureMessageToQueue(mercureMessage) {
|
|
108
|
+
this.mercureMessageQueue = [
|
|
109
|
+
...this.mercureMessageQueue.filter((existingMessage) => {
|
|
110
|
+
return existingMessage.data["@id"] !== mercureMessage.data["@id"];
|
|
111
|
+
}),
|
|
112
|
+
mercureMessage
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
async processMessageQueue() {
|
|
116
|
+
const messages = this.mercureMessageQueue;
|
|
117
|
+
this.mercureMessageQueue = [];
|
|
118
|
+
const path = this._fetcherStore.primaryFetchPath;
|
|
119
|
+
const resourceActions = this.collectResourceActions(messages);
|
|
120
|
+
const fetchedResources = await this.fetch(resourceActions.toFetch);
|
|
121
|
+
const toSave = [...resourceActions.toSave, ...fetchedResources];
|
|
122
|
+
for (const resource of toSave) {
|
|
123
|
+
this.resourcesStore.saveResource({
|
|
124
|
+
resource,
|
|
125
|
+
path,
|
|
126
|
+
isNew: true
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
collectResourceActions(messages) {
|
|
131
|
+
const toSave = [];
|
|
132
|
+
const toFetch = [];
|
|
133
|
+
for (const message of messages) {
|
|
134
|
+
this.lastEventId = message.event.lastEventId;
|
|
135
|
+
if (!this.isMessageForCurrentResource(message)) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const isDelete = Object.keys(message.data).length === 1 && message.data["@id"];
|
|
139
|
+
if (!isDelete && message.data["@type"] === "ComponentPosition") {
|
|
140
|
+
toFetch.push(message.data["@id"]);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
toSave.push(message.data);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
toSave,
|
|
147
|
+
toFetch
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
async fetch(paths) {
|
|
151
|
+
const resources = [];
|
|
152
|
+
if (paths.length) {
|
|
153
|
+
if (!this.fetcher) {
|
|
154
|
+
throw new Error("Mercure cannot fetch resources. Fetcher is not set.");
|
|
155
|
+
}
|
|
156
|
+
const fetchPromises = [];
|
|
157
|
+
for (const path of paths) {
|
|
158
|
+
const fetchPromise = this.fetcher.fetchResource({
|
|
159
|
+
path,
|
|
160
|
+
noSave: true,
|
|
161
|
+
shallowFetch: true
|
|
162
|
+
});
|
|
163
|
+
fetchPromises.push(fetchPromise);
|
|
164
|
+
}
|
|
165
|
+
await Promise.all(fetchPromises).then((responses) => {
|
|
166
|
+
for (const resource of responses) {
|
|
167
|
+
if (!resource) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
resources.push(resource);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return resources;
|
|
175
|
+
}
|
|
176
|
+
get hubUrl() {
|
|
177
|
+
if (!this.hub) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const hub = new URL(this.hub);
|
|
181
|
+
hub.searchParams.append("topic", "*");
|
|
182
|
+
if (this.lastEventId) {
|
|
183
|
+
hub.searchParams.append("Last-Event-ID", this.lastEventId);
|
|
184
|
+
}
|
|
185
|
+
return hub.toString();
|
|
186
|
+
}
|
|
187
|
+
get hub() {
|
|
188
|
+
return this.mercureStore.hub;
|
|
189
|
+
}
|
|
190
|
+
get mercureStore() {
|
|
191
|
+
return this._mercureStore;
|
|
192
|
+
}
|
|
193
|
+
get resourcesStore() {
|
|
194
|
+
return this._resourcesStore;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SiteConfigStore } from '#cwa/storage/stores/site-config/site-config-store';
|
|
2
|
+
import type CwaFetch from '#cwa/api/fetcher/cwa-fetch';
|
|
3
|
+
import type { SiteConfigParams } from '#cwa/types';
|
|
4
|
+
import type { CwaResource } from '#cwa/resources/resource-utils';
|
|
5
|
+
export default class SiteConfig {
|
|
6
|
+
private readonly cwaFetch;
|
|
7
|
+
private readonly storeDefinition;
|
|
8
|
+
private readonly userConfig;
|
|
9
|
+
private utils;
|
|
10
|
+
private readonly _store;
|
|
11
|
+
private readonly _apiState;
|
|
12
|
+
constructor(cwaFetch: CwaFetch, storeDefinition: SiteConfigStore, userConfig: Partial<SiteConfigParams>);
|
|
13
|
+
loadConfig(): Promise<SiteConfigParams>;
|
|
14
|
+
saveConfig(newConfig: Partial<SiteConfigParams>): {
|
|
15
|
+
totalConfigsChanged: number;
|
|
16
|
+
};
|
|
17
|
+
get totalRequests(): import("vue").ComputedRef<number>;
|
|
18
|
+
get apiState(): {
|
|
19
|
+
requests: import("vue").Ref<{
|
|
20
|
+
then: <TResult1 = CwaResource | undefined, TResult2 = never>(onfulfilled?: ((value: CwaResource | undefined) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>;
|
|
21
|
+
catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined) => Promise<CwaResource | TResult | undefined>;
|
|
22
|
+
finally: (onfinally?: (() => void) | null | undefined) => Promise<CwaResource | undefined>;
|
|
23
|
+
readonly [Symbol.toStringTag]: string;
|
|
24
|
+
}[], Promise<CwaResource | undefined>[] | {
|
|
25
|
+
then: <TResult1 = CwaResource | undefined, TResult2 = never>(onfulfilled?: ((value: CwaResource | undefined) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<TResult1 | TResult2>;
|
|
26
|
+
catch: <TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined) => Promise<CwaResource | TResult | undefined>;
|
|
27
|
+
finally: (onfinally?: (() => void) | null | undefined) => Promise<CwaResource | undefined>;
|
|
28
|
+
readonly [Symbol.toStringTag]: string;
|
|
29
|
+
}[]>;
|
|
30
|
+
hasError: import("vue").Ref<boolean, boolean>;
|
|
31
|
+
};
|
|
32
|
+
get isLoading(): boolean;
|
|
33
|
+
get savedSiteConfig(): Partial<SiteConfigParams> | undefined;
|
|
34
|
+
get config(): SiteConfigParams;
|
|
35
|
+
private get store();
|
|
36
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { updateSiteConfig } from "#imports";
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { XMLValidator } from "fast-xml-parser";
|
|
4
|
+
import { consola } from "consola";
|
|
5
|
+
import { useCwaSiteConfig } from "#cwa/composables/useCwaSiteConfig";
|
|
6
|
+
export default class SiteConfig {
|
|
7
|
+
constructor(cwaFetch, storeDefinition, userConfig) {
|
|
8
|
+
this.cwaFetch = cwaFetch;
|
|
9
|
+
this.storeDefinition = storeDefinition;
|
|
10
|
+
this.userConfig = userConfig;
|
|
11
|
+
this.utils = useCwaSiteConfig();
|
|
12
|
+
this._store = this.storeDefinition.useStore();
|
|
13
|
+
}
|
|
14
|
+
cwaFetch;
|
|
15
|
+
storeDefinition;
|
|
16
|
+
userConfig;
|
|
17
|
+
utils;
|
|
18
|
+
_store;
|
|
19
|
+
_apiState = {
|
|
20
|
+
requests: ref([]),
|
|
21
|
+
hasError: ref(false)
|
|
22
|
+
};
|
|
23
|
+
async loadConfig() {
|
|
24
|
+
this.store.$patch({
|
|
25
|
+
isLoading: true
|
|
26
|
+
});
|
|
27
|
+
const response = await this.cwaFetch.fetch("/_/site_config_parameters", {
|
|
28
|
+
credentials: "omit"
|
|
29
|
+
});
|
|
30
|
+
const serverConfig = this.utils.responseToConfig(response, true);
|
|
31
|
+
const resolvedConfig = this.utils.mergeConfig(this.userConfig, serverConfig);
|
|
32
|
+
this.store.$patch({
|
|
33
|
+
isLoading: false,
|
|
34
|
+
config: resolvedConfig,
|
|
35
|
+
serverConfig
|
|
36
|
+
});
|
|
37
|
+
return resolvedConfig;
|
|
38
|
+
}
|
|
39
|
+
saveConfig(newConfig) {
|
|
40
|
+
const returnData = {
|
|
41
|
+
totalConfigsChanged: 0
|
|
42
|
+
};
|
|
43
|
+
if (newConfig.sitemapXml) {
|
|
44
|
+
const validationResult = XMLValidator.validate(newConfig.sitemapXml);
|
|
45
|
+
if (validationResult !== true) {
|
|
46
|
+
consola.error(validationResult);
|
|
47
|
+
this.store.$patch({
|
|
48
|
+
isLoading: false
|
|
49
|
+
});
|
|
50
|
+
this._apiState.hasError.value = true;
|
|
51
|
+
this._apiState.requests.value = [];
|
|
52
|
+
return returnData;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (this.totalRequests.value > 0 || !this.savedSiteConfig) {
|
|
56
|
+
return returnData;
|
|
57
|
+
}
|
|
58
|
+
this._apiState.hasError.value = false;
|
|
59
|
+
this._apiState.requests.value = [];
|
|
60
|
+
const changedKeys = [];
|
|
61
|
+
for (const [newKey, newValue] of Object.entries(newConfig)) {
|
|
62
|
+
if (this.savedSiteConfig[newKey] === void 0 || newValue !== this.savedSiteConfig[newKey]) {
|
|
63
|
+
changedKeys.push(newKey);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
returnData.totalConfigsChanged = changedKeys.length;
|
|
67
|
+
const allRequests = [];
|
|
68
|
+
for (const changedKey of changedKeys) {
|
|
69
|
+
const isCreatingConfigKey = this.savedSiteConfig[changedKey] === void 0;
|
|
70
|
+
const method = isCreatingConfigKey ? "POST" : "PATCH";
|
|
71
|
+
const path = isCreatingConfigKey ? `/_/site_config_parameters` : `/_/site_config_parameters/${changedKey}`;
|
|
72
|
+
const value = typeof newConfig[changedKey] === "boolean" ? JSON.stringify(newConfig[changedKey]) : newConfig[changedKey];
|
|
73
|
+
const body = {
|
|
74
|
+
key: changedKey,
|
|
75
|
+
value
|
|
76
|
+
};
|
|
77
|
+
const request = this.cwaFetch.fetch(path, {
|
|
78
|
+
...this.cwaFetch.getRequestOptions(method),
|
|
79
|
+
body
|
|
80
|
+
});
|
|
81
|
+
allRequests.push(request);
|
|
82
|
+
}
|
|
83
|
+
this._apiState.requests.value = allRequests;
|
|
84
|
+
if (!changedKeys.length) {
|
|
85
|
+
return returnData;
|
|
86
|
+
}
|
|
87
|
+
Promise.all(this._apiState.requests.value).then((responses) => {
|
|
88
|
+
if (responses.filter((r) => r === void 0).length) {
|
|
89
|
+
this._apiState.hasError.value = true;
|
|
90
|
+
}
|
|
91
|
+
const updatedConfig = {};
|
|
92
|
+
for (const response of responses) {
|
|
93
|
+
if (response === void 0) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const configKey = response.key;
|
|
97
|
+
updatedConfig[configKey] = this.utils.processApiConfigValue(response.value);
|
|
98
|
+
}
|
|
99
|
+
const config = this.utils.mergeConfig(this.config, updatedConfig);
|
|
100
|
+
this.store.$patch({
|
|
101
|
+
isLoading: false,
|
|
102
|
+
config,
|
|
103
|
+
serverConfig: this.utils.mergeConfig(this.savedSiteConfig || {}, updatedConfig)
|
|
104
|
+
});
|
|
105
|
+
this._apiState.requests.value = [];
|
|
106
|
+
updateSiteConfig(this.utils.resolvedConfigToSiteConfig(config));
|
|
107
|
+
}).catch((err) => {
|
|
108
|
+
console.error(err);
|
|
109
|
+
this._apiState.hasError.value = true;
|
|
110
|
+
this.store.$patch({
|
|
111
|
+
isLoading: false
|
|
112
|
+
});
|
|
113
|
+
this._apiState.requests.value = [];
|
|
114
|
+
});
|
|
115
|
+
return returnData;
|
|
116
|
+
}
|
|
117
|
+
get totalRequests() {
|
|
118
|
+
return computed(() => this._apiState.requests.value.length);
|
|
119
|
+
}
|
|
120
|
+
get apiState() {
|
|
121
|
+
return { ...this._apiState };
|
|
122
|
+
}
|
|
123
|
+
get isLoading() {
|
|
124
|
+
return this.store.isLoading;
|
|
125
|
+
}
|
|
126
|
+
get savedSiteConfig() {
|
|
127
|
+
return this.store.serverConfig;
|
|
128
|
+
}
|
|
129
|
+
get config() {
|
|
130
|
+
return this.store.getConfig;
|
|
131
|
+
}
|
|
132
|
+
get store() {
|
|
133
|
+
return this._store;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createApp, h, onBeforeUnmount, onMounted, watch } from "vue";
|
|
2
|
+
import { useRouter } from "vue-router";
|
|
3
|
+
import { CwaLink } from "#components";
|
|
4
|
+
export const useHtmlContent = (container) => {
|
|
5
|
+
const router = useRouter();
|
|
6
|
+
let watchStopHandle;
|
|
7
|
+
function convertAnchor(anchor) {
|
|
8
|
+
const href = anchor.getAttribute("href");
|
|
9
|
+
if (!href) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
function hrefToUrl(href2) {
|
|
13
|
+
try {
|
|
14
|
+
const url = new URL(href2);
|
|
15
|
+
if (typeof window !== "undefined" && url.hostname === window.location.hostname) {
|
|
16
|
+
return url.pathname + url.search + url.hash;
|
|
17
|
+
}
|
|
18
|
+
return href2;
|
|
19
|
+
} catch (err) {
|
|
20
|
+
if (href2.startsWith("/")) return href2;
|
|
21
|
+
return `//${href2}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const linkProps = {
|
|
25
|
+
to: hrefToUrl(href),
|
|
26
|
+
noPrefetch: void 0,
|
|
27
|
+
prefetch: false,
|
|
28
|
+
noRel: void 0
|
|
29
|
+
};
|
|
30
|
+
for (const attr of anchor.attributes) {
|
|
31
|
+
if (!["href", "target"].includes(attr.name)) {
|
|
32
|
+
const anchorAttr = anchor.getAttribute(attr.name);
|
|
33
|
+
if (anchorAttr) {
|
|
34
|
+
linkProps[attr.name] = anchorAttr;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const innerHtml = anchor.innerHTML;
|
|
39
|
+
const app = createApp({
|
|
40
|
+
render() {
|
|
41
|
+
return h(CwaLink, linkProps, {
|
|
42
|
+
default: () => h("span", { innerHTML: innerHtml })
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
app.use(router);
|
|
47
|
+
return app;
|
|
48
|
+
}
|
|
49
|
+
function replaceAnchors() {
|
|
50
|
+
if (typeof container.value?.getElementsByTagName !== "function") {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const anchors = container.value.getElementsByTagName("a");
|
|
54
|
+
Array.from(anchors).forEach((anchor) => {
|
|
55
|
+
const nuxtLink = convertAnchor(anchor);
|
|
56
|
+
if (nuxtLink) {
|
|
57
|
+
const parent = anchor.parentNode;
|
|
58
|
+
if (parent) {
|
|
59
|
+
const linkContainer = document.createElement("span");
|
|
60
|
+
parent.replaceChild(linkContainer, anchor);
|
|
61
|
+
nuxtLink.mount(linkContainer);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
onMounted(() => {
|
|
67
|
+
watchStopHandle = watch(container, replaceAnchors, {
|
|
68
|
+
immediate: true
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
onBeforeUnmount(() => {
|
|
72
|
+
watchStopHandle && watchStopHandle();
|
|
73
|
+
});
|
|
74
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type CwaPaginationProps = {
|
|
2
|
+
currentPage: number;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
maxPagesToDisplay: number;
|
|
5
|
+
};
|
|
6
|
+
export type CwaPaginationEmits = {
|
|
7
|
+
next: [];
|
|
8
|
+
previous: [];
|
|
9
|
+
change: [value: number];
|
|
10
|
+
};
|
|
11
|
+
export declare const useCwaCollectionPagination: (props: CwaPaginationProps) => {
|
|
12
|
+
pages: import("vue").ComputedRef<number[]>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export const useCwaCollectionPagination = (props) => {
|
|
3
|
+
const pages = computed(() => {
|
|
4
|
+
if (!props.totalPages) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const allPages = Array.from(Array(props.totalPages), (_, x) => x + 1);
|
|
8
|
+
const maxPagesToDisplay = props.maxPagesToDisplay || 7;
|
|
9
|
+
if (allPages.length < maxPagesToDisplay) {
|
|
10
|
+
return allPages;
|
|
11
|
+
}
|
|
12
|
+
const displayPages = [];
|
|
13
|
+
displayPages.push(props.currentPage);
|
|
14
|
+
let lowest = props.currentPage;
|
|
15
|
+
let highest = props.currentPage;
|
|
16
|
+
let displayCounter = 1;
|
|
17
|
+
while (displayCounter < maxPagesToDisplay) {
|
|
18
|
+
displayCounter++;
|
|
19
|
+
if ((displayCounter % 2 === 0 || highest >= props.totalPages) && lowest > 1) {
|
|
20
|
+
lowest--;
|
|
21
|
+
displayPages.unshift(lowest);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (highest < props.totalPages) {
|
|
25
|
+
highest++;
|
|
26
|
+
displayPages.push(highest);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return displayPages;
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
pages
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { CwaResourceUtilsOps } from './cwa-resource.js';
|
|
3
|
+
import type { CwaResource } from '#cwa/resources/resource-utils';
|
|
4
|
+
export declare const useCwaCollectionResource: (iri: Ref<string>, ops?: CwaResourceUtilsOps) => {
|
|
5
|
+
resource: import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
6
|
+
collectionItems: import("vue").ComputedRef<CwaResource[] | undefined>;
|
|
7
|
+
isLoadingCollection: Ref<boolean, boolean>;
|
|
8
|
+
pageModel: Ref<any, any>;
|
|
9
|
+
totalPages: Ref<number, number>;
|
|
10
|
+
goToNextPage: () => void;
|
|
11
|
+
goToPreviousPage: () => void;
|
|
12
|
+
changePage: (newPageNumber: number) => void;
|
|
13
|
+
resolveResourceLink: (resource: CwaResource, property: string) => any;
|
|
14
|
+
$cwa: import("../cwa.js").default;
|
|
15
|
+
getResource: () => import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
16
|
+
exposeMeta: import("#imports").CwaResourceMeta;
|
|
17
|
+
getCurrentStyleName: (resource: CwaResource) => string | undefined;
|
|
18
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { computed, ref, watch } from "vue";
|
|
2
|
+
import { useRoute } from "vue-router";
|
|
3
|
+
import { useCwaResourceRoute } from "#cwa/composables/useCwaResourceRoute";
|
|
4
|
+
import { useCwa, useCwaResource, useQueryBoundModel } from "#imports";
|
|
5
|
+
export const useCwaCollectionResource = (iri, ops) => {
|
|
6
|
+
const cwaResource = useCwaResource(iri, ops);
|
|
7
|
+
const resource = cwaResource.getResource();
|
|
8
|
+
const isLoadingCollection = ref(false);
|
|
9
|
+
const fetchedCollectionItems = ref();
|
|
10
|
+
const loadCounter = ref(0);
|
|
11
|
+
const $cwa = useCwa();
|
|
12
|
+
const route = useRoute();
|
|
13
|
+
const { model: pageModel } = useQueryBoundModel("page", { defaultValue: 1, asNumber: true });
|
|
14
|
+
const collectionItems = computed(() => {
|
|
15
|
+
return fetchedCollectionItems.value || resource.value?.data?.collection?.["member"];
|
|
16
|
+
});
|
|
17
|
+
const dataResourceIri = computed(() => {
|
|
18
|
+
return resource.value?.data?.resourceIri;
|
|
19
|
+
});
|
|
20
|
+
const totalPages = ref(1);
|
|
21
|
+
function populateCollectionData(resource2) {
|
|
22
|
+
if (resource2?.collection?.["member"]) {
|
|
23
|
+
fetchedCollectionItems.value = resource2?.collection?.["member"];
|
|
24
|
+
const lastPagePath = resource2?.collection?.["view"]?.["last"];
|
|
25
|
+
if (!lastPagePath) {
|
|
26
|
+
totalPages.value = 1;
|
|
27
|
+
} else {
|
|
28
|
+
const urlParams = new URLSearchParams(lastPagePath.split("?")[1]);
|
|
29
|
+
const pageQueryParam = urlParams.get("page");
|
|
30
|
+
totalPages.value = pageQueryParam ? parseInt(pageQueryParam) || 1 : 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function reloadCollection() {
|
|
35
|
+
if (!dataResourceIri.value) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const currentLoadCounter = ++loadCounter.value;
|
|
39
|
+
isLoadingCollection.value = true;
|
|
40
|
+
const { response } = $cwa.fetch({ path: iri.value });
|
|
41
|
+
const { _data: resource2 } = await response;
|
|
42
|
+
if (currentLoadCounter === loadCounter.value) {
|
|
43
|
+
populateCollectionData(resource2);
|
|
44
|
+
isLoadingCollection.value = false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function goToNextPage() {
|
|
48
|
+
if (pageModel.value >= totalPages.value) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
changePage(pageModel.value + 1);
|
|
52
|
+
}
|
|
53
|
+
function goToPreviousPage() {
|
|
54
|
+
if (!pageModel.value || pageModel.value <= 1) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
changePage(pageModel.value - 1);
|
|
58
|
+
}
|
|
59
|
+
function changePage(newPageNumber) {
|
|
60
|
+
pageModel.value = newPageNumber;
|
|
61
|
+
window.scrollTo({
|
|
62
|
+
top: 0,
|
|
63
|
+
left: 0,
|
|
64
|
+
behavior: "smooth"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (route) {
|
|
68
|
+
watch(() => route.query, async (newQuery, oldQuery) => {
|
|
69
|
+
const cleanPaginationFromQuery = (q) => {
|
|
70
|
+
const cleanQuery = { ...q };
|
|
71
|
+
delete cleanQuery.perPage;
|
|
72
|
+
delete cleanQuery.page;
|
|
73
|
+
return cleanQuery;
|
|
74
|
+
};
|
|
75
|
+
const cleanedOld = cleanPaginationFromQuery(oldQuery);
|
|
76
|
+
const cleanedNew = cleanPaginationFromQuery(newQuery);
|
|
77
|
+
if (JSON.stringify(cleanedOld) !== JSON.stringify(cleanedNew)) {
|
|
78
|
+
pageModel.value = 1;
|
|
79
|
+
}
|
|
80
|
+
if (JSON.stringify(oldQuery) === JSON.stringify(newQuery)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
await reloadCollection();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
populateCollectionData(resource.value?.data);
|
|
87
|
+
watch(() => resource.value?.data, (newData) => {
|
|
88
|
+
if (newData) {
|
|
89
|
+
populateCollectionData(newData);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const { getResourceRoute } = useCwaResourceRoute();
|
|
93
|
+
return {
|
|
94
|
+
...cwaResource,
|
|
95
|
+
resource,
|
|
96
|
+
collectionItems,
|
|
97
|
+
isLoadingCollection,
|
|
98
|
+
pageModel,
|
|
99
|
+
totalPages,
|
|
100
|
+
goToNextPage,
|
|
101
|
+
goToPreviousPage,
|
|
102
|
+
changePage,
|
|
103
|
+
resolveResourceLink: getResourceRoute
|
|
104
|
+
};
|
|
105
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ImageOpsType, type MediaFile } from '#cwa/composables/cwa-image';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import type { CwaResourceUtilsOps } from './cwa-resource.js';
|
|
4
|
+
export declare const useCwaImageResource: (iri: Ref<string>, imageOps?: Pick<Partial<ImageOpsType>, "imageRef"> & Omit<ImageOpsType, "mediaObjects" | "imageRef">, ops?: CwaResourceUtilsOps) => {
|
|
5
|
+
contentUrl: import("vue").ComputedRef<string | undefined>;
|
|
6
|
+
displayMedia: import("vue").ComputedRef<MediaFile | undefined>;
|
|
7
|
+
handleLoad: () => void;
|
|
8
|
+
loaded: Ref<boolean, boolean>;
|
|
9
|
+
resource: import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
10
|
+
mediaObjects: import("vue").ComputedRef<Record<string, MediaFile[]>>;
|
|
11
|
+
$cwa: import("../cwa.js").default;
|
|
12
|
+
getResource: () => import("vue").ComputedRef<import("../storage/stores/resources/state.js").CwaCurrentResourceInterface | undefined>;
|
|
13
|
+
exposeMeta: import("./cwa-resource.js").CwaResourceMeta;
|
|
14
|
+
getCurrentStyleName: (resource: import("../resources/resource-utils.js").CwaResource) => string | undefined;
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCwaImage } from "#cwa/composables/cwa-image";
|
|
2
|
+
import { useTemplateRef, computed } from "vue";
|
|
3
|
+
import { useCwaResource } from "./cwa-resource.js";
|
|
4
|
+
export const useCwaImageResource = (iri, imageOps, ops) => {
|
|
5
|
+
const cwaResource = useCwaResource(iri, ops);
|
|
6
|
+
const resource = cwaResource.getResource();
|
|
7
|
+
const mediaObjects = computed(() => {
|
|
8
|
+
return resource.value?.data?._metadata.mediaObjects;
|
|
9
|
+
});
|
|
10
|
+
const imageRef = imageOps?.imageRef || useTemplateRef("image");
|
|
11
|
+
const {
|
|
12
|
+
contentUrl,
|
|
13
|
+
displayMedia,
|
|
14
|
+
handleLoad,
|
|
15
|
+
loaded
|
|
16
|
+
} = useCwaImage(iri, { ...imageOps, imageRef, mediaObjects });
|
|
17
|
+
return {
|
|
18
|
+
...cwaResource,
|
|
19
|
+
contentUrl,
|
|
20
|
+
displayMedia,
|
|
21
|
+
handleLoad,
|
|
22
|
+
loaded,
|
|
23
|
+
resource,
|
|
24
|
+
mediaObjects
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HTMLImageElement } from 'happy-dom';
|
|
2
|
+
import { type Ref, type ShallowRef, type ComputedRef } from 'vue';
|
|
3
|
+
export type ImageOpsType = {
|
|
4
|
+
imagineFilterName?: string;
|
|
5
|
+
fileProp?: string;
|
|
6
|
+
imageRef: ShallowRef<HTMLImageElement | null>;
|
|
7
|
+
mediaObjects: ComputedRef<Record<string, MediaFile[]>>;
|
|
8
|
+
};
|
|
9
|
+
export type MediaFile = {
|
|
10
|
+
contentUrl: string;
|
|
11
|
+
fileSize: number;
|
|
12
|
+
mimeType: string;
|
|
13
|
+
formattedFileSize: string;
|
|
14
|
+
imagineFilter?: string;
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
};
|
|
18
|
+
export type CwaImageReturnType = {
|
|
19
|
+
contentUrl: ComputedRef<string | undefined>;
|
|
20
|
+
displayMedia: ComputedRef<MediaFile | undefined>;
|
|
21
|
+
handleLoad: () => void;
|
|
22
|
+
loaded: Ref<boolean>;
|
|
23
|
+
};
|
|
24
|
+
export declare const useCwaImage: (iri: Ref<string>, ops: ImageOpsType) => CwaImageReturnType;
|