@cwa/nuxt-edge 1.0.0-29138192.e49c1a0

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.
Files changed (387) hide show
  1. package/README.md +38 -0
  2. package/README.template.md +32 -0
  3. package/dist/layer/error.vue +13 -0
  4. package/dist/layer/layouts/CwaRootLayout.vue +140 -0
  5. package/dist/layer/nuxt.config.spec.ts +10 -0
  6. package/dist/layer/nuxt.config.ts +3 -0
  7. package/dist/layer/pages/_cwa/composables/useDataList.ts +50 -0
  8. package/dist/layer/pages/_cwa/composables/useDataType.ts +30 -0
  9. package/dist/layer/pages/_cwa/composables/useDynamicPageLoader.ts +28 -0
  10. package/dist/layer/pages/_cwa/composables/useItemPage.ts +172 -0
  11. package/dist/layer/pages/_cwa/composables/useListPage.ts +43 -0
  12. package/dist/layer/pages/_cwa/data/[type]/[iri].vue +17 -0
  13. package/dist/layer/pages/_cwa/data/[type].vue +131 -0
  14. package/dist/layer/pages/_cwa/data/index.vue +84 -0
  15. package/dist/layer/pages/_cwa/layouts/[iri].vue +174 -0
  16. package/dist/layer/pages/_cwa/layouts.vue +77 -0
  17. package/dist/layer/pages/_cwa/pages/[iri].vue +11 -0
  18. package/dist/layer/pages/_cwa/pages.vue +129 -0
  19. package/dist/layer/pages/_cwa/routes.vue +72 -0
  20. package/dist/layer/pages/_cwa/users/[iri].vue +248 -0
  21. package/dist/layer/pages/_cwa/users.vue +86 -0
  22. package/dist/layer/pages/_cwa.vue +43 -0
  23. package/dist/layer/pages/forgot-password.vue +32 -0
  24. package/dist/layer/pages/login.vue +33 -0
  25. package/dist/layer/pages/reset-password/[username]/[token].vue +39 -0
  26. package/dist/module.d.mts +53 -0
  27. package/dist/module.json +13 -0
  28. package/dist/module.mjs +235 -0
  29. package/dist/runtime/admin/admin.d.ts +36 -0
  30. package/dist/runtime/admin/admin.js +65 -0
  31. package/dist/runtime/admin/manageable-resource.d.ts +41 -0
  32. package/dist/runtime/admin/manageable-resource.js +206 -0
  33. package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
  34. package/dist/runtime/admin/manager-tabs-resolver.js +51 -0
  35. package/dist/runtime/admin/navigation-guard.d.ts +18 -0
  36. package/dist/runtime/admin/navigation-guard.js +55 -0
  37. package/dist/runtime/admin/resource-stack-manager.d.ts +92 -0
  38. package/dist/runtime/admin/resource-stack-manager.js +355 -0
  39. package/dist/runtime/api/api-documentation.d.ts +28 -0
  40. package/dist/runtime/api/api-documentation.js +131 -0
  41. package/dist/runtime/api/auth.d.ts +85 -0
  42. package/dist/runtime/api/auth.js +183 -0
  43. package/dist/runtime/api/fetcher/cwa-fetch.d.ts +5 -0
  44. package/dist/runtime/api/fetcher/cwa-fetch.js +20 -0
  45. package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +51 -0
  46. package/dist/runtime/api/fetcher/fetch-status-manager.js +185 -0
  47. package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
  48. package/dist/runtime/api/fetcher/fetcher.js +222 -0
  49. package/dist/runtime/api/fetcher/preload-headers.d.ts +6 -0
  50. package/dist/runtime/api/fetcher/preload-headers.js +31 -0
  51. package/dist/runtime/api/forms.d.ts +40 -0
  52. package/dist/runtime/api/forms.js +40 -0
  53. package/dist/runtime/api/mercure.d.ts +33 -0
  54. package/dist/runtime/api/mercure.js +191 -0
  55. package/dist/runtime/composables/component/html-content.d.ts +2 -0
  56. package/dist/runtime/composables/component/html-content.js +82 -0
  57. package/dist/runtime/composables/cwa-collection-pagination.d.ts +13 -0
  58. package/dist/runtime/composables/cwa-collection-pagination.js +34 -0
  59. package/dist/runtime/composables/cwa-collection-resource.d.ts +16 -0
  60. package/dist/runtime/composables/cwa-collection-resource.js +92 -0
  61. package/dist/runtime/composables/cwa-image.d.ts +19 -0
  62. package/dist/runtime/composables/cwa-image.js +43 -0
  63. package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
  64. package/dist/runtime/composables/cwa-query-bound-model.js +108 -0
  65. package/dist/runtime/composables/cwa-resource-endpoint.d.ts +5 -0
  66. package/dist/runtime/composables/cwa-resource-endpoint.js +36 -0
  67. package/dist/runtime/composables/cwa-resource-manageable.d.ts +10 -0
  68. package/dist/runtime/composables/cwa-resource-manageable.js +32 -0
  69. package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +17 -0
  70. package/dist/runtime/composables/cwa-resource-manager-tab.js +30 -0
  71. package/dist/runtime/composables/cwa-resource-model.d.ts +21 -0
  72. package/dist/runtime/composables/cwa-resource-model.js +149 -0
  73. package/dist/runtime/composables/cwa-resource-upload.d.ts +8 -0
  74. package/dist/runtime/composables/cwa-resource-upload.js +70 -0
  75. package/dist/runtime/composables/cwa-resource.d.ts +24 -0
  76. package/dist/runtime/composables/cwa-resource.js +22 -0
  77. package/dist/runtime/composables/cwa-select-input.d.ts +21 -0
  78. package/dist/runtime/composables/cwa-select-input.js +37 -0
  79. package/dist/runtime/composables/cwa-select.d.ts +15 -0
  80. package/dist/runtime/composables/cwa-select.js +24 -0
  81. package/dist/runtime/composables/cwa.d.ts +2 -0
  82. package/dist/runtime/composables/cwa.js +2 -0
  83. package/dist/runtime/composables/forgot-password.d.ts +9 -0
  84. package/dist/runtime/composables/forgot-password.js +45 -0
  85. package/dist/runtime/composables/login.d.ts +9 -0
  86. package/dist/runtime/composables/login.js +30 -0
  87. package/dist/runtime/composables/popper.d.ts +529 -0
  88. package/dist/runtime/composables/popper.js +104 -0
  89. package/dist/runtime/composables/process.d.ts +4 -0
  90. package/dist/runtime/composables/process.js +6 -0
  91. package/dist/runtime/composables/reset-password.d.ts +14 -0
  92. package/dist/runtime/composables/reset-password.js +75 -0
  93. package/dist/runtime/composables/transitions.d.ts +12 -0
  94. package/dist/runtime/composables/transitions.js +12 -0
  95. package/dist/runtime/cwa.d.ts +61 -0
  96. package/dist/runtime/cwa.js +123 -0
  97. package/dist/runtime/errors/cwa-resource-error.d.ts +18 -0
  98. package/dist/runtime/errors/cwa-resource-error.js +54 -0
  99. package/dist/runtime/plugin.d.ts +7 -0
  100. package/dist/runtime/plugin.js +18 -0
  101. package/dist/runtime/resources/resource-utils.d.ts +44 -0
  102. package/dist/runtime/resources/resource-utils.js +73 -0
  103. package/dist/runtime/resources/resources-manager.d.ts +70 -0
  104. package/dist/runtime/resources/resources-manager.js +463 -0
  105. package/dist/runtime/resources/resources.d.ts +53 -0
  106. package/dist/runtime/resources/resources.js +300 -0
  107. package/dist/runtime/route-middleware.d.ts +2 -0
  108. package/dist/runtime/route-middleware.js +86 -0
  109. package/dist/runtime/storage/storage.d.ts +20 -0
  110. package/dist/runtime/storage/storage.js +25 -0
  111. package/dist/runtime/storage/stores/admin/actions.d.ts +5 -0
  112. package/dist/runtime/storage/stores/admin/actions.js +10 -0
  113. package/dist/runtime/storage/stores/admin/admin-store.d.ts +18 -0
  114. package/dist/runtime/storage/stores/admin/admin-store.js +20 -0
  115. package/dist/runtime/storage/stores/admin/state.d.ts +7 -0
  116. package/dist/runtime/storage/stores/admin/state.js +9 -0
  117. package/dist/runtime/storage/stores/api-documentation/api-documentation-store.d.ts +16 -0
  118. package/dist/runtime/storage/stores/api-documentation/api-documentation-store.js +18 -0
  119. package/dist/runtime/storage/stores/api-documentation/state.d.ts +74 -0
  120. package/dist/runtime/storage/stores/api-documentation/state.js +6 -0
  121. package/dist/runtime/storage/stores/auth/auth-store.d.ts +16 -0
  122. package/dist/runtime/storage/stores/auth/auth-store.js +18 -0
  123. package/dist/runtime/storage/stores/auth/state.d.ts +20 -0
  124. package/dist/runtime/storage/stores/auth/state.js +15 -0
  125. package/dist/runtime/storage/stores/cwa-store-types.d.ts +14 -0
  126. package/dist/runtime/storage/stores/error/actions.d.ts +11 -0
  127. package/dist/runtime/storage/stores/error/actions.js +69 -0
  128. package/dist/runtime/storage/stores/error/error-store.d.ts +13 -0
  129. package/dist/runtime/storage/stores/error/error-store.js +21 -0
  130. package/dist/runtime/storage/stores/error/getters.d.ts +7 -0
  131. package/dist/runtime/storage/stores/error/getters.js +11 -0
  132. package/dist/runtime/storage/stores/error/state.d.ts +35 -0
  133. package/dist/runtime/storage/stores/error/state.js +15 -0
  134. package/dist/runtime/storage/stores/fetcher/actions.d.ts +49 -0
  135. package/dist/runtime/storage/stores/fetcher/actions.js +125 -0
  136. package/dist/runtime/storage/stores/fetcher/fetcher-store.d.ts +19 -0
  137. package/dist/runtime/storage/stores/fetcher/fetcher-store.js +23 -0
  138. package/dist/runtime/storage/stores/fetcher/getter-utils.d.ts +7 -0
  139. package/dist/runtime/storage/stores/fetcher/getter-utils.js +27 -0
  140. package/dist/runtime/storage/stores/fetcher/getters.d.ts +13 -0
  141. package/dist/runtime/storage/stores/fetcher/getters.js +52 -0
  142. package/dist/runtime/storage/stores/fetcher/state.d.ts +25 -0
  143. package/dist/runtime/storage/stores/fetcher/state.js +7 -0
  144. package/dist/runtime/storage/stores/mercure/mercure-store.d.ts +16 -0
  145. package/dist/runtime/storage/stores/mercure/mercure-store.js +18 -0
  146. package/dist/runtime/storage/stores/mercure/state.d.ts +5 -0
  147. package/dist/runtime/storage/stores/mercure/state.js +6 -0
  148. package/dist/runtime/storage/stores/resources/actions.d.ts +54 -0
  149. package/dist/runtime/storage/stores/resources/actions.js +390 -0
  150. package/dist/runtime/storage/stores/resources/getter-utils.d.ts +7 -0
  151. package/dist/runtime/storage/stores/resources/getter-utils.js +27 -0
  152. package/dist/runtime/storage/stores/resources/getters.d.ts +38 -0
  153. package/dist/runtime/storage/stores/resources/getters.js +251 -0
  154. package/dist/runtime/storage/stores/resources/resources-store.d.ts +19 -0
  155. package/dist/runtime/storage/stores/resources/resources-store.js +23 -0
  156. package/dist/runtime/storage/stores/resources/state.d.ts +64 -0
  157. package/dist/runtime/storage/stores/resources/state.js +24 -0
  158. package/dist/runtime/templates/assets/base.css +1 -0
  159. package/dist/runtime/templates/assets/cwa.css +1 -0
  160. package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +18 -0
  161. package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +3 -0
  162. package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
  163. package/dist/runtime/templates/components/core/ComponentPosition.vue +63 -0
  164. package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +3 -0
  165. package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
  166. package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +9 -0
  167. package/dist/runtime/templates/components/core/DialogBox.vue +95 -0
  168. package/dist/runtime/templates/components/core/DialogBox.vue.d.ts +38 -0
  169. package/dist/runtime/templates/components/core/README.md +1 -0
  170. package/dist/runtime/templates/components/core/ResourceLoader.spec.ts.snap +39 -0
  171. package/dist/runtime/templates/components/core/ResourceLoader.vue +151 -0
  172. package/dist/runtime/templates/components/core/ResourceLoader.vue.d.ts +13 -0
  173. package/dist/runtime/templates/components/core/admin/ListContainer.vue +7 -0
  174. package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
  175. package/dist/runtime/templates/components/core/admin/ListContent.vue +136 -0
  176. package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +21 -0
  177. package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
  178. package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +9 -0
  179. package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
  180. package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +9 -0
  181. package/dist/runtime/templates/components/core/admin/ListHeading.vue +32 -0
  182. package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
  183. package/dist/runtime/templates/components/core/admin/ListPagination.vue +87 -0
  184. package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +15 -0
  185. package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +18 -0
  186. package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
  187. package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +260 -0
  188. package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +12 -0
  189. package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +187 -0
  190. package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +13 -0
  191. package/dist/runtime/templates/components/core/admin/ResourceModal.vue +99 -0
  192. package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +27 -0
  193. package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
  194. package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +6 -0
  195. package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +23 -0
  196. package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
  197. package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +77 -0
  198. package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +19 -0
  199. package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
  200. package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +20 -0
  201. package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +52 -0
  202. package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +10 -0
  203. package/dist/runtime/templates/components/core/admin/RoutesTab.vue +273 -0
  204. package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +12 -0
  205. package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +18 -0
  206. package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
  207. package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue +86 -0
  208. package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue.d.ts +3 -0
  209. package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +23 -0
  210. package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
  211. package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +30 -0
  212. package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +15 -0
  213. package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +99 -0
  214. package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +6 -0
  215. package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue +112 -0
  216. package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue.d.ts +4 -0
  217. package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
  218. package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +2 -0
  219. package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
  220. package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +2 -0
  221. package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
  222. package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +2 -0
  223. package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
  224. package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +2 -0
  225. package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
  226. package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +2 -0
  227. package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
  228. package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +2 -0
  229. package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
  230. package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +2 -0
  231. package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
  232. package/dist/runtime/templates/components/core/useDataResolver.js +109 -0
  233. package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
  234. package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +164 -0
  235. package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +20 -0
  236. package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +69 -0
  237. package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +59 -0
  238. package/dist/runtime/templates/components/main/ComponentGroup.vue +107 -0
  239. package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +9 -0
  240. package/dist/runtime/templates/components/main/CwaLink.vue +51 -0
  241. package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
  242. package/dist/runtime/templates/components/main/DefaultLayout.vue +8 -0
  243. package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
  244. package/dist/runtime/templates/components/main/ErrorPage.vue +98 -0
  245. package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +6 -0
  246. package/dist/runtime/templates/components/main/Logo.vue +18 -0
  247. package/dist/runtime/templates/components/main/Logo.vue.d.ts +2 -0
  248. package/dist/runtime/templates/components/main/README.md +7 -0
  249. package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue +41 -0
  250. package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue.d.ts +7 -0
  251. package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue +48 -0
  252. package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue.d.ts +2 -0
  253. package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.d.ts +5 -0
  254. package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.js +19 -0
  255. package/dist/runtime/templates/components/main/admin/header/Header.vue +207 -0
  256. package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +2 -0
  257. package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +189 -0
  258. package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +2 -0
  259. package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +14 -0
  260. package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue.d.ts +16 -0
  261. package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +19 -0
  262. package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue.d.ts +15 -0
  263. package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +69 -0
  264. package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +12 -0
  265. package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue +19 -0
  266. package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue.d.ts +2 -0
  267. package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue +79 -0
  268. package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue.d.ts +2 -0
  269. package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue +52 -0
  270. package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue.d.ts +2 -0
  271. package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +151 -0
  272. package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +10 -0
  273. package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +192 -0
  274. package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +6 -0
  275. package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue +186 -0
  276. package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue.d.ts +9 -0
  277. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +205 -0
  278. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +2 -0
  279. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue +38 -0
  280. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue.d.ts +6 -0
  281. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue +15 -0
  282. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue.d.ts +7 -0
  283. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue +44 -0
  284. package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue.d.ts +13 -0
  285. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +59 -0
  286. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +6 -0
  287. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue +75 -0
  288. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue.d.ts +6 -0
  289. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue +41 -0
  290. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue.d.ts +6 -0
  291. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +101 -0
  292. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +6 -0
  293. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue +34 -0
  294. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue.d.ts +6 -0
  295. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +121 -0
  296. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +6 -0
  297. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue +52 -0
  298. package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue.d.ts +6 -0
  299. package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +99 -0
  300. package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +7 -0
  301. package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue +59 -0
  302. package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue.d.ts +7 -0
  303. package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue +28 -0
  304. package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue.d.ts +2 -0
  305. package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +55 -0
  306. package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +20 -0
  307. package/dist/runtime/templates/components/main/auth/LoginPage.vue +60 -0
  308. package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +23 -0
  309. package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
  310. package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +27 -0
  311. package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.spec.ts.snap +14 -0
  312. package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue +17 -0
  313. package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue.d.ts +6 -0
  314. package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.spec.ts.snap +90 -0
  315. package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue +45 -0
  316. package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +17 -0
  317. package/dist/runtime/templates/components/main/auth/_parts/InputField.spec.ts.snap +111 -0
  318. package/dist/runtime/templates/components/main/auth/_parts/InputField.vue +50 -0
  319. package/dist/runtime/templates/components/main/auth/_parts/InputField.vue.d.ts +17 -0
  320. package/dist/runtime/templates/components/ui/BackgroundParticles.vue +960 -0
  321. package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +2 -0
  322. package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
  323. package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +9 -0
  324. package/dist/runtime/templates/components/ui/ProgressBar.spec.ts.snap +71 -0
  325. package/dist/runtime/templates/components/ui/ProgressBar.vue +29 -0
  326. package/dist/runtime/templates/components/ui/ProgressBar.vue.d.ts +9 -0
  327. package/dist/runtime/templates/components/ui/README.md +6 -0
  328. package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
  329. package/dist/runtime/templates/components/ui/alert/Info.vue +13 -0
  330. package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
  331. package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +14 -0
  332. package/dist/runtime/templates/components/ui/alert/Warning.vue +8 -0
  333. package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +12 -0
  334. package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
  335. package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +52 -0
  336. package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
  337. package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +10 -0
  338. package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
  339. package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +10 -0
  340. package/dist/runtime/templates/components/ui/form/File.vue +72 -0
  341. package/dist/runtime/templates/components/ui/form/File.vue.d.ts +9 -0
  342. package/dist/runtime/templates/components/ui/form/Input.vue +22 -0
  343. package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +5 -0
  344. package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +16 -0
  345. package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
  346. package/dist/runtime/templates/components/ui/form/SearchResource.vue +212 -0
  347. package/dist/runtime/templates/components/ui/form/SearchResource.vue.d.ts +14 -0
  348. package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
  349. package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +3 -0
  350. package/dist/runtime/templates/components/ui/form/Toggle.vue +39 -0
  351. package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +6 -0
  352. package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
  353. package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +2 -0
  354. package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
  355. package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +2 -0
  356. package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
  357. package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +2 -0
  358. package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
  359. package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +2 -0
  360. package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
  361. package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +2 -0
  362. package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
  363. package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +2 -0
  364. package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
  365. package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +2 -0
  366. package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
  367. package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +2 -0
  368. package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
  369. package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +2 -0
  370. package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
  371. package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +2 -0
  372. package/dist/runtime/templates/components/utils/ContextMenu.vue +59 -0
  373. package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +21 -0
  374. package/dist/runtime/templates/components/utils/HotSpot.vue +24 -0
  375. package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +9 -0
  376. package/dist/runtime/templates/components/utils/README.md +1 -0
  377. package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
  378. package/dist/runtime/templates/components/utils/Spinner.vue +42 -0
  379. package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +5 -0
  380. package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
  381. package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +6 -0
  382. package/dist/runtime/templates/cwa-page.spec.ts.snap +20 -0
  383. package/dist/runtime/templates/cwa-page.vue +32 -0
  384. package/dist/runtime/templates/cwa-page.vue.d.ts +2 -0
  385. package/dist/runtime/types/popper.d.ts +14 -0
  386. package/dist/types.d.mts +9 -0
  387. package/package.json +108 -0
@@ -0,0 +1,15 @@
1
+ import { reactive } from "vue";
2
+ export var CwaUserRoles = /* @__PURE__ */ ((CwaUserRoles2) => {
3
+ CwaUserRoles2["SUPER_ADMIN"] = "ROLE_SUPER_ADMIN";
4
+ CwaUserRoles2["ADMIN"] = "ROLE_ADMIN";
5
+ CwaUserRoles2["ALLOWED_TO_SWITCH"] = "ROLE_ALLOWED_TO_SWITCH";
6
+ CwaUserRoles2["USER"] = "ROLE_USER";
7
+ return CwaUserRoles2;
8
+ })(CwaUserRoles || {});
9
+ export default function() {
10
+ return {
11
+ data: reactive({
12
+ user: void 0
13
+ })
14
+ };
15
+ }
@@ -0,0 +1,14 @@
1
+ import type {
2
+ SetupStoreDefinition,
3
+ Store,
4
+ StoreActions,
5
+ StoreGetters,
6
+ StoreState,
7
+ } from 'pinia'
8
+
9
+ export interface CwaStore {
10
+ useStore(): any
11
+ }
12
+
13
+ export declare type CwaPiniaStoreDefinitionInterface<N extends string, I> = SetupStoreDefinition<N, I>
14
+ export declare type CwaPiniaStoreInterface<N extends string, I> = Store<N, StoreState<I>, StoreGetters<I>, StoreActions<I>>
@@ -0,0 +1,11 @@
1
+ import type { FetchError } from 'ofetch';
2
+ import type { ApiResourceEvent } from '../../../resources/resources-manager.js';
3
+ import type { CwaErrorEvent, CwaErrorStateInterface } from './state.js';
4
+ export interface CwaErrorActionsInterface {
5
+ error(event: ApiResourceEvent, error: FetchError): void;
6
+ manual(error: CwaErrorEvent): void;
7
+ clear(): void;
8
+ removeById(id: number): void;
9
+ removeByEndpoint(endpoint: string): void;
10
+ }
11
+ export default function (errorState: CwaErrorStateInterface): CwaErrorActionsInterface;
@@ -0,0 +1,69 @@
1
+ import { ErrorType } from "./state.js";
2
+ function getErrorType(type) {
3
+ switch (type) {
4
+ case "hydra:Error":
5
+ return ErrorType.SERVER;
6
+ case "TypeError":
7
+ return ErrorType.NETWORK;
8
+ case "ConstraintViolationList":
9
+ return ErrorType.VALIDATION;
10
+ default:
11
+ return ErrorType.UNKNOWN;
12
+ }
13
+ }
14
+ export default function(errorState) {
15
+ return {
16
+ // use endpoint to make error be replace
17
+ error(event, error) {
18
+ const id = (/* @__PURE__ */ new Date()).getTime();
19
+ const err = { event, timestamp: id };
20
+ if (error.cause) {
21
+ err.type = getErrorType(error.cause.constructor.name);
22
+ err.detail = error.cause.message;
23
+ } else if (error.data?.["hydra:description"]) {
24
+ err.type = getErrorType(error.data["@type"]);
25
+ err.detail = error.data["hydra:description"];
26
+ err.violations = error.data.violations?.map((e) => ({ property: e.propertyPath, message: e.message }));
27
+ } else {
28
+ err.type = ErrorType.SERVER;
29
+ err.detail = error.data;
30
+ }
31
+ if (err.type === ErrorType.SERVER || err.type === ErrorType.VALIDATION || err.type === ErrorType.UNKNOWN) {
32
+ err.statusCode = error.statusCode;
33
+ }
34
+ errorState.byId[id] = err;
35
+ errorState.allIds.push(id);
36
+ errorState.allEndpoints.set(event.endpoint, id);
37
+ },
38
+ manual(error) {
39
+ const id = error.timestamp;
40
+ errorState.byId[id] = error;
41
+ errorState.allIds.push(id);
42
+ errorState.allEndpoints.set("unset", id);
43
+ },
44
+ clear() {
45
+ errorState.allIds = [];
46
+ errorState.allEndpoints.clear();
47
+ errorState.byId = {};
48
+ },
49
+ removeById(id) {
50
+ const err = errorState.byId[id];
51
+ if (!err) {
52
+ return;
53
+ }
54
+ delete errorState.byId[id];
55
+ errorState.allIds.splice(errorState.allIds.indexOf(id), 1);
56
+ const endpoint = err.event?.endpoint || "local";
57
+ if (endpoint) {
58
+ errorState.allEndpoints.delete(endpoint);
59
+ }
60
+ },
61
+ removeByEndpoint(endpoint) {
62
+ if (!errorState.allEndpoints.has(endpoint)) {
63
+ return;
64
+ }
65
+ const id = errorState.allEndpoints.get(endpoint);
66
+ id && this.removeById(id);
67
+ }
68
+ };
69
+ }
@@ -0,0 +1,13 @@
1
+ import type { CwaPiniaStoreDefinitionInterface, CwaPiniaStoreInterface, CwaStore } from '../cwa-store-types.js';
2
+ import type { CwaErrorStateInterface } from './state.js';
3
+ import type { CwaErrorActionsInterface } from './actions.js';
4
+ import type { CwaErrorsGettersInterface } from './getters.js';
5
+ export interface CwaErrorInterface extends CwaErrorStateInterface, CwaErrorActionsInterface, CwaErrorsGettersInterface {
6
+ }
7
+ export type CwaErrorStoreDefinitionInterface = CwaPiniaStoreDefinitionInterface<`${string}.error`, CwaErrorInterface>;
8
+ export type CwaErrorStoreInterface = CwaPiniaStoreInterface<`${string}.error`, CwaErrorInterface>;
9
+ export declare class ErrorStore implements CwaStore {
10
+ private readonly storeDefinition;
11
+ constructor(storeName: string);
12
+ useStore(): CwaErrorStoreInterface;
13
+ }
@@ -0,0 +1,21 @@
1
+ import { defineStore } from "pinia";
2
+ import CwaErrorState from "./state.js";
3
+ import CwaErrorActions from "./actions.js";
4
+ import CwaErrorGetters from "./getters.js";
5
+ export class ErrorStore {
6
+ storeDefinition;
7
+ constructor(storeName) {
8
+ this.storeDefinition = defineStore(`${storeName}.error`, () => {
9
+ const errorState = CwaErrorState();
10
+ const getters = CwaErrorGetters(errorState);
11
+ return {
12
+ ...errorState,
13
+ ...getters,
14
+ ...CwaErrorActions(errorState)
15
+ };
16
+ });
17
+ }
18
+ useStore() {
19
+ return this.storeDefinition();
20
+ }
21
+ }
@@ -0,0 +1,7 @@
1
+ import type { ComputedRef } from 'vue';
2
+ import type { CwaErrorEvent, CwaErrorStateInterface } from './state.js';
3
+ export interface CwaErrorsGettersInterface {
4
+ hasErrors: ComputedRef<boolean>;
5
+ getErrors: ComputedRef<CwaErrorEvent[]>;
6
+ }
7
+ export default function (resourcesState: CwaErrorStateInterface): CwaErrorsGettersInterface;
@@ -0,0 +1,11 @@
1
+ import { computed } from "vue";
2
+ export default function(resourcesState) {
3
+ return {
4
+ hasErrors: computed(() => {
5
+ return resourcesState.allIds.length > 0;
6
+ }),
7
+ getErrors: computed(() => {
8
+ return resourcesState.allIds.map((e) => resourcesState.byId[e]);
9
+ })
10
+ };
11
+ }
@@ -0,0 +1,35 @@
1
+ import type { ApiResourceEvent } from '../../../resources/resources-manager.js';
2
+ export interface CwaViolationError {
3
+ message: string;
4
+ property: string;
5
+ }
6
+ export declare enum ErrorType {
7
+ NETWORK = "NETWORK",
8
+ VALIDATION = "VALIDATION",
9
+ SERVER = "SERVER",
10
+ UNKNOWN = "UNKNOWN"
11
+ }
12
+ interface CwaBaseErrorEvent {
13
+ event?: ApiResourceEvent;
14
+ detail: string;
15
+ violations: CwaViolationError[];
16
+ timestamp: number;
17
+ }
18
+ interface CwaResolvedErrorEvent extends CwaBaseErrorEvent {
19
+ type: Exclude<ErrorType, ErrorType.NETWORK>;
20
+ statusCode: number;
21
+ }
22
+ interface CwaNetworkErrorEvent extends CwaBaseErrorEvent {
23
+ type: ErrorType.NETWORK;
24
+ statusCode: undefined;
25
+ }
26
+ export type CwaErrorEvent = CwaNetworkErrorEvent | CwaResolvedErrorEvent;
27
+ export interface CwaErrorStateInterface {
28
+ byId: {
29
+ [key: number]: CwaErrorEvent;
30
+ };
31
+ allIds: Array<number>;
32
+ allEndpoints: Map<string, number>;
33
+ }
34
+ export default function (): CwaErrorStateInterface;
35
+ export {};
@@ -0,0 +1,15 @@
1
+ import { reactive } from "vue";
2
+ export var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
3
+ ErrorType2["NETWORK"] = "NETWORK";
4
+ ErrorType2["VALIDATION"] = "VALIDATION";
5
+ ErrorType2["SERVER"] = "SERVER";
6
+ ErrorType2["UNKNOWN"] = "UNKNOWN";
7
+ return ErrorType2;
8
+ })(ErrorType || {});
9
+ export default function() {
10
+ return reactive({
11
+ byId: {},
12
+ allIds: [],
13
+ allEndpoints: /* @__PURE__ */ new Map()
14
+ });
15
+ }
@@ -0,0 +1,49 @@
1
+ import type { CwaResourceError } from '../../../errors/cwa-resource-error.js';
2
+ import type { CwaFetcherStateInterface } from './state.js';
3
+ import type { CwaFetcherGettersInterface } from './getters.js';
4
+ export interface StartFetchEvent {
5
+ token?: string;
6
+ path: string;
7
+ manifestPath?: string;
8
+ isPrimary?: boolean;
9
+ isCurrentSuccessResourcesResolved: boolean;
10
+ }
11
+ export interface FinishFetchEvent {
12
+ token: string;
13
+ }
14
+ export interface AddFetchResourceEvent {
15
+ token: string;
16
+ resource: string;
17
+ }
18
+ export interface StartFetchResponse {
19
+ continue: boolean;
20
+ resources: string[];
21
+ token: string;
22
+ }
23
+ export declare enum FinishFetchManifestType {
24
+ SUCCESS = "SUCCESS",
25
+ ERROR = "ERROR"
26
+ }
27
+ export interface ManifestSuccessFetchEvent {
28
+ type: FinishFetchManifestType.SUCCESS;
29
+ token: string;
30
+ resources: string[];
31
+ }
32
+ export interface ManifestErrorFetchEvent {
33
+ type: FinishFetchManifestType.ERROR;
34
+ token: string;
35
+ error: CwaResourceError;
36
+ }
37
+ interface AbortFetchEvent {
38
+ token: string;
39
+ }
40
+ export interface CwaFetcherActionsInterface {
41
+ abortFetch(event: AbortFetchEvent): void;
42
+ finishManifestFetch(event: ManifestSuccessFetchEvent | ManifestErrorFetchEvent): void;
43
+ startFetch(event: StartFetchEvent): StartFetchResponse;
44
+ finishFetch(event: FinishFetchEvent): void;
45
+ addFetchResource(event: AddFetchResourceEvent): boolean;
46
+ clearFetches(): void;
47
+ }
48
+ export default function (fetcherState: CwaFetcherStateInterface, fetcherGetters: CwaFetcherGettersInterface): CwaFetcherActionsInterface;
49
+ export {};
@@ -0,0 +1,125 @@
1
+ import { v4 as uuidv4 } from "uuid";
2
+ import { reactive } from "vue";
3
+ import { consola as logger } from "consola";
4
+ export var FinishFetchManifestType = /* @__PURE__ */ ((FinishFetchManifestType2) => {
5
+ FinishFetchManifestType2["SUCCESS"] = "SUCCESS";
6
+ FinishFetchManifestType2["ERROR"] = "ERROR";
7
+ return FinishFetchManifestType2;
8
+ })(FinishFetchManifestType || {});
9
+ export default function(fetcherState, fetcherGetters) {
10
+ function getFetchStatusFromToken(token) {
11
+ const fetchStatus = fetcherState.fetches[token];
12
+ if (!fetchStatus) {
13
+ throw new Error(`The fetch chain token '${token}' does not exist`);
14
+ }
15
+ return fetchStatus;
16
+ }
17
+ return {
18
+ abortFetch(event) {
19
+ const fetchStatus = getFetchStatusFromToken(event.token);
20
+ fetchStatus.abort = true;
21
+ },
22
+ finishManifestFetch(event) {
23
+ let fetchStatus;
24
+ try {
25
+ fetchStatus = getFetchStatusFromToken(event.token);
26
+ } catch (error) {
27
+ logger.trace(error.message);
28
+ return;
29
+ }
30
+ if (!fetchStatus.manifest) {
31
+ throw new Error(`Cannot set manifest status for '${event.token}'. The manifest was never started.`);
32
+ }
33
+ if (event.type === "SUCCESS" /* SUCCESS */) {
34
+ fetchStatus.manifest.resources = event.resources;
35
+ }
36
+ if (event.type === "ERROR" /* ERROR */) {
37
+ fetchStatus.manifest.error = event.error.asObject;
38
+ }
39
+ },
40
+ startFetch(event) {
41
+ if (event.token) {
42
+ try {
43
+ const existingFetchStatus = getFetchStatusFromToken(event.token);
44
+ return {
45
+ continue: !existingFetchStatus.abort,
46
+ resources: existingFetchStatus.resources,
47
+ token: event.token
48
+ };
49
+ } catch (error) {
50
+ return {
51
+ continue: false,
52
+ resources: [],
53
+ token: event.token
54
+ };
55
+ }
56
+ }
57
+ if (event.isPrimary && fetcherState.primaryFetch.successToken) {
58
+ const lastSuccessState = fetcherState.fetches[fetcherState.primaryFetch.successToken];
59
+ if (lastSuccessState?.path === event.path && event.isCurrentSuccessResourcesResolved) {
60
+ fetcherState.primaryFetch.fetchingToken = void 0;
61
+ for (const existingToken of Object.keys(fetcherState.fetches)) {
62
+ if (existingToken !== fetcherState.primaryFetch.successToken) {
63
+ fetcherState.fetches[existingToken].abort = true;
64
+ }
65
+ }
66
+ return {
67
+ continue: false,
68
+ resources: lastSuccessState.resources,
69
+ token: fetcherState.primaryFetch.successToken
70
+ };
71
+ }
72
+ }
73
+ const token = uuidv4();
74
+ const initialState = reactive({
75
+ path: event.path,
76
+ resources: [],
77
+ isPrimary: !!event.isPrimary
78
+ });
79
+ if (event.manifestPath) {
80
+ initialState.manifest = {
81
+ path: event.manifestPath
82
+ };
83
+ }
84
+ if (event.isPrimary) {
85
+ fetcherState.primaryFetch.fetchingToken = token;
86
+ }
87
+ fetcherState.fetches[token] = initialState;
88
+ return { token, continue: true, resources: [] };
89
+ },
90
+ finishFetch(event) {
91
+ const fetchStatus = getFetchStatusFromToken(event.token);
92
+ if (!fetchStatus.isPrimary) {
93
+ delete fetcherState.fetches[event.token];
94
+ return;
95
+ }
96
+ const initialFetchingToken = fetcherState.primaryFetch.fetchingToken;
97
+ const initialSuccessToken = fetcherState.primaryFetch.successToken;
98
+ if (event.token === initialFetchingToken) {
99
+ fetcherState.primaryFetch.fetchingToken = void 0;
100
+ fetcherState.primaryFetch.successToken = event.token;
101
+ }
102
+ if (initialSuccessToken && fetcherState.primaryFetch.successToken !== initialSuccessToken) {
103
+ delete fetcherState.fetches[initialSuccessToken];
104
+ }
105
+ if (event.token !== fetcherState.primaryFetch.successToken) {
106
+ delete fetcherState.fetches[event.token];
107
+ }
108
+ },
109
+ addFetchResource(event) {
110
+ const fetchStatus = getFetchStatusFromToken(event.token);
111
+ if (fetchStatus.resources.includes(event.resource) || !fetcherGetters.isCurrentFetchingToken.value(event.token)) {
112
+ return false;
113
+ }
114
+ fetchStatus.resources.push(event.resource);
115
+ return true;
116
+ },
117
+ clearFetches() {
118
+ fetcherState.primaryFetch.fetchingToken = void 0;
119
+ fetcherState.primaryFetch.successToken = void 0;
120
+ for (const token of Object.keys(fetcherState.fetches)) {
121
+ delete fetcherState.fetches[token];
122
+ }
123
+ }
124
+ };
125
+ }
@@ -0,0 +1,19 @@
1
+ import type { CwaPiniaStoreDefinitionInterface, CwaPiniaStoreInterface, CwaStore } from '../cwa-store-types.js';
2
+ import type { CwaFetcherActionsInterface } from './actions.js';
3
+ import type { CwaFetcherStateInterface } from './state.js';
4
+ import type { CwaFetcherGettersInterface } from './getters.js';
5
+ /**
6
+ * Interface Definitions
7
+ */
8
+ export interface CwaFetcherInterface extends CwaFetcherStateInterface, CwaFetcherActionsInterface, CwaFetcherGettersInterface {
9
+ }
10
+ export type CwaFetcherStoreDefinitionInterface = CwaPiniaStoreDefinitionInterface<`${string}.fetcher`, CwaFetcherInterface>;
11
+ export type CwaFetcherStoreInterface = CwaPiniaStoreInterface<`${string}.fetcher`, CwaFetcherInterface>;
12
+ /**
13
+ * Main Store Class
14
+ */
15
+ export declare class FetcherStore implements CwaStore {
16
+ private readonly storeDefinition;
17
+ constructor(storeName: string);
18
+ useStore(): CwaFetcherStoreInterface;
19
+ }
@@ -0,0 +1,23 @@
1
+ import {
2
+ defineStore
3
+ } from "pinia";
4
+ import CwaFetcherActions from "./actions.js";
5
+ import CwaFetcherState from "./state.js";
6
+ import CwaFetcherGetters from "./getters.js";
7
+ export class FetcherStore {
8
+ storeDefinition;
9
+ constructor(storeName) {
10
+ this.storeDefinition = defineStore(`${storeName}.fetcher`, () => {
11
+ const fetcherState = CwaFetcherState();
12
+ const getters = CwaFetcherGetters(fetcherState);
13
+ return {
14
+ ...fetcherState,
15
+ ...getters,
16
+ ...CwaFetcherActions(fetcherState, getters)
17
+ };
18
+ });
19
+ }
20
+ useStore() {
21
+ return this.storeDefinition();
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ import type { CwaFetcherStateInterface, FetchStatus } from './state.js';
2
+ export declare class FetcherGetterUtils {
3
+ private fetcherState;
4
+ constructor(fetcherState: CwaFetcherStateInterface);
5
+ getFetchStatusByToken(token: string): FetchStatus | undefined;
6
+ isFetchResolving(token: string): boolean;
7
+ }
@@ -0,0 +1,27 @@
1
+ export class FetcherGetterUtils {
2
+ fetcherState;
3
+ constructor(fetcherState) {
4
+ this.fetcherState = fetcherState;
5
+ }
6
+ getFetchStatusByToken(token) {
7
+ const fetchStatus = this.fetcherState.fetches[token];
8
+ if (!fetchStatus) {
9
+ return;
10
+ }
11
+ return fetchStatus;
12
+ }
13
+ isFetchResolving(token) {
14
+ const fetchStatus = this.getFetchStatusByToken(token);
15
+ if (!fetchStatus) {
16
+ return false;
17
+ }
18
+ if (fetchStatus.abort) {
19
+ return false;
20
+ }
21
+ const resources = fetchStatus.resources;
22
+ if (!resources.length) {
23
+ return false;
24
+ }
25
+ return !!(fetchStatus.manifest && fetchStatus.manifest.resources === void 0 && fetchStatus.manifest.error === void 0);
26
+ }
27
+ }
@@ -0,0 +1,13 @@
1
+ import type { ComputedRef } from 'vue';
2
+ import type { CwaFetcherStateInterface, FetchStatus } from './state.js';
3
+ export interface CwaFetcherGettersInterface {
4
+ resolvedSuccessFetchStatus: ComputedRef<FetchStatus | undefined>;
5
+ primaryFetchPath: ComputedRef<string | undefined>;
6
+ fetchesResolved: ComputedRef<boolean>;
7
+ isFetchResolving: ComputedRef<(token: string) => {
8
+ fetchStatus: FetchStatus | undefined;
9
+ resolving: boolean;
10
+ }>;
11
+ isCurrentFetchingToken: ComputedRef<(token: string) => boolean | undefined>;
12
+ }
13
+ export default function (fetcherState: CwaFetcherStateInterface): CwaFetcherGettersInterface;
@@ -0,0 +1,52 @@
1
+ import { computed } from "vue";
2
+ import { FetcherGetterUtils } from "./getter-utils.js";
3
+ export default function(fetcherState) {
4
+ const utils = new FetcherGetterUtils(fetcherState);
5
+ const primaryFetchPath = computed(() => {
6
+ const primaryFetchToken = fetcherState.primaryFetch.fetchingToken || fetcherState.primaryFetch.successToken;
7
+ if (!primaryFetchToken) {
8
+ return;
9
+ }
10
+ const fetchStatus = fetcherState.fetches[primaryFetchToken];
11
+ return fetchStatus?.path;
12
+ });
13
+ return {
14
+ primaryFetchPath,
15
+ resolvedSuccessFetchStatus: computed(() => {
16
+ if (!fetcherState.primaryFetch.successToken) {
17
+ return;
18
+ }
19
+ const fetchStatus = utils.getFetchStatusByToken(fetcherState.primaryFetch.successToken);
20
+ if (!fetchStatus || utils.isFetchResolving(fetcherState.primaryFetch.successToken)) {
21
+ return;
22
+ }
23
+ return fetchStatus;
24
+ }),
25
+ fetchesResolved: computed(() => {
26
+ for (const token of Object.keys(fetcherState.fetches)) {
27
+ if (utils.isFetchResolving(token)) {
28
+ return false;
29
+ }
30
+ }
31
+ return true;
32
+ }),
33
+ isFetchResolving: computed(() => {
34
+ return (token) => ({
35
+ fetchStatus: utils.getFetchStatusByToken(token),
36
+ resolving: utils.isFetchResolving(token)
37
+ });
38
+ }),
39
+ isCurrentFetchingToken: computed(() => {
40
+ return (token) => {
41
+ const fetchStatus = fetcherState.fetches[token];
42
+ if (!fetchStatus) {
43
+ throw new Error(`Failed to check if the token '${token}' is current. It does not exist.`);
44
+ }
45
+ if (fetchStatus.abort) {
46
+ return false;
47
+ }
48
+ return !fetchStatus.isPrimary || token === fetcherState.primaryFetch.fetchingToken;
49
+ };
50
+ })
51
+ };
52
+ }
@@ -0,0 +1,25 @@
1
+ import type { CwaResourceErrorObject } from '../../../errors/cwa-resource-error.js';
2
+ interface FetchManifestInterface {
3
+ path: string;
4
+ resources?: string[];
5
+ error?: CwaResourceErrorObject;
6
+ }
7
+ export interface FetchStatus {
8
+ path: string;
9
+ isPrimary: boolean;
10
+ resources: string[];
11
+ manifest?: FetchManifestInterface;
12
+ abort?: true;
13
+ }
14
+ export interface FetcherChainInterface {
15
+ [token: string]: FetchStatus;
16
+ }
17
+ export interface CwaFetcherStateInterface {
18
+ primaryFetch: {
19
+ fetchingToken?: string;
20
+ successToken?: string;
21
+ };
22
+ fetches: FetcherChainInterface;
23
+ }
24
+ export default function (): CwaFetcherStateInterface;
25
+ export {};
@@ -0,0 +1,7 @@
1
+ import { reactive } from "vue";
2
+ export default function() {
3
+ return {
4
+ primaryFetch: reactive({}),
5
+ fetches: reactive({})
6
+ };
7
+ }
@@ -0,0 +1,16 @@
1
+ import type { CwaPiniaStoreDefinitionInterface, CwaPiniaStoreInterface, CwaStore } from '../cwa-store-types.js';
2
+ import type { CwaMercureStateInterface } from './state.js';
3
+ /**
4
+ * Interface Definitions
5
+ */
6
+ export type CwaMercureInterface = CwaMercureStateInterface;
7
+ export type CwaMercureStoreDefinitionInterface = CwaPiniaStoreDefinitionInterface<`${string}.mercure`, CwaMercureInterface>;
8
+ export type CwaMercureStoreInterface = CwaPiniaStoreInterface<`${string}.mercure`, CwaMercureInterface>;
9
+ /**
10
+ * Main Store Class
11
+ */
12
+ export declare class MercureStore implements CwaStore {
13
+ private readonly storeDefinition;
14
+ constructor(storeName: string);
15
+ useStore(): CwaMercureStoreInterface;
16
+ }
@@ -0,0 +1,18 @@
1
+ import {
2
+ defineStore
3
+ } from "pinia";
4
+ import CwaMercureState from "./state.js";
5
+ export class MercureStore {
6
+ storeDefinition;
7
+ constructor(storeName) {
8
+ this.storeDefinition = defineStore(`${storeName}.mercure`, () => {
9
+ const mercureState = CwaMercureState();
10
+ return {
11
+ ...mercureState
12
+ };
13
+ });
14
+ }
15
+ useStore() {
16
+ return this.storeDefinition();
17
+ }
18
+ }
@@ -0,0 +1,5 @@
1
+ import type { Ref } from 'vue';
2
+ export interface CwaMercureStateInterface {
3
+ hub: Ref<string | null>;
4
+ }
5
+ export default function (): CwaMercureStateInterface;
@@ -0,0 +1,6 @@
1
+ import { ref } from "vue";
2
+ export default function() {
3
+ return {
4
+ hub: ref(null)
5
+ };
6
+ }