@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,52 @@
1
+ <script setup>
2
+ import Notification from "./Notification.vue";
3
+ import { useCwa } from "#imports";
4
+ import { ErrorType } from "#cwa/runtime/storage/stores/error/state";
5
+ const $cwa = useCwa();
6
+ function removeError(timestamp) {
7
+ $cwa.resourcesManager.removeError(timestamp);
8
+ }
9
+ </script>
10
+
11
+ <template>
12
+ <div
13
+ aria-live="assertive"
14
+ class="cwa:pointer-events-none cwa:fixed cwa:inset-0 cwa:flex cwa:items-end cwa:pt-20 cwa:pb-4 cwa:py-6 cwa:sm:px-4 cwa:sm:items-start cwa:z-notifications"
15
+ >
16
+ <TransitionGroup
17
+ tag="ul"
18
+ class="cwa:list-none cwa:flex cwa:w-full cwa:flex-col cwa:items-center cwa:gap-y-4 cwa:sm:items-end"
19
+ enter-active-class="cwa:transform cwa:ease-out cwa:duration-300 cwa:transition"
20
+ enter-from-class="cwa:translate-y-2 cwa:opacity-0 cwa:sm:translate-y-0 cwa:sm:translate-x-2"
21
+ enter-to-class="cwa:translate-y-0 cwa:opacity-100 cwa:sm:translate-x-0"
22
+ leave-active-class="cwa:transition cwa:ease-in cwa:duration-100"
23
+ leave-from-class="cwa:opacity-100"
24
+ leave-to-class="cwa:translate-y-2 cwa:opacity-0 cwa:sm:translate-y-0 cwa:sm:translate-x-2"
25
+ >
26
+ <Notification
27
+ v-for="(error, index) in $cwa.resourcesManager.errors"
28
+ :key="error.timestamp"
29
+ :data-index="index"
30
+ @clear="() => removeError(error.timestamp)"
31
+ >
32
+ <p class="cwa:text-md cwa:font-bold cwa:text-white">
33
+ Oops! There was a problem.
34
+ </p>
35
+ <ul v-if="error.type === ErrorType.VALIDATION">
36
+ <li
37
+ v-for="violation in error.violations"
38
+ :key="`violation-${violation.property}-${error.timestamp}`"
39
+ >
40
+ {{ violation.property }}: {{ violation.message }}
41
+ </li>
42
+ </ul>
43
+ <p
44
+ v-else
45
+ class="cwa:mt-1 cwa:text-sm cwa:text-gray-500"
46
+ >
47
+ {{ error?.statusCode || "Network Error" }}: {{ error.detail }}
48
+ </p>
49
+ </Notification>
50
+ </TransitionGroup>
51
+ </div>
52
+ </template>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,151 @@
1
+ <script setup>
2
+ import { computed, onBeforeUnmount, onMounted, ref, toRef, useTemplateRef, watch } from "vue";
3
+ import { useElementSize, useWindowSize } from "@vueuse/core";
4
+ import { useCwa } from "#imports";
5
+ import { getPublishedResourceState } from "#cwa/runtime/resources/resource-utils";
6
+ const props = defineProps({
7
+ iri: { type: Object, required: true },
8
+ domElements: { type: Object, required: true }
9
+ });
10
+ const $cwa = useCwa();
11
+ const domElements = toRef(props, "domElements");
12
+ const iri = toRef(props, "iri");
13
+ const canvas = useTemplateRef("canvas");
14
+ const windowSize = useWindowSize();
15
+ const elementSizeInstances = ref([]);
16
+ watch(props.domElements, (newDomElements) => {
17
+ for (const esInstance of elementSizeInstances.value) {
18
+ esInstance.stop();
19
+ }
20
+ elementSizeInstances.value = [];
21
+ const newInstances = [];
22
+ for (const el of newDomElements) {
23
+ newInstances.push(useElementSize(el));
24
+ }
25
+ elementSizeInstances.value = newInstances;
26
+ });
27
+ const totalWidthAndHeight = computed(() => {
28
+ let totalValue = 0;
29
+ for (const esInstance of elementSizeInstances.value) {
30
+ totalValue += esInstance.width + esInstance.height;
31
+ }
32
+ return totalValue;
33
+ });
34
+ const resource = computed(() => {
35
+ if (!iri.value) {
36
+ return;
37
+ }
38
+ return $cwa.resources.getResource(iri.value).value;
39
+ });
40
+ const resourceData = computed(() => resource.value?.data);
41
+ const position = computed(() => {
42
+ const clearCoords = {
43
+ top: 999999999999,
44
+ left: 99999999999,
45
+ width: 0,
46
+ height: 0,
47
+ windowSize: {
48
+ width: windowSize.width.value,
49
+ height: windowSize.height.value
50
+ },
51
+ totalWidthAndHeight: totalWidthAndHeight.value
52
+ };
53
+ for (const domElement of domElements.value) {
54
+ if (domElement.nodeType !== 1) {
55
+ continue;
56
+ }
57
+ const domRect = domElement.getBoundingClientRect();
58
+ clearCoords.top = Math.min(clearCoords.top, domRect.top);
59
+ clearCoords.left = Math.min(clearCoords.left, domRect.left);
60
+ clearCoords.width = Math.max(clearCoords.width, domRect.right - clearCoords.left);
61
+ clearCoords.height = Math.max(clearCoords.height, domRect.bottom - clearCoords.top);
62
+ }
63
+ const addY = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
64
+ clearCoords.top += addY;
65
+ const addX = Math.max(document.body.scrollLeft, document.documentElement.scrollLeft);
66
+ clearCoords.left += addX;
67
+ return {
68
+ top: clearCoords.top,
69
+ left: clearCoords.left,
70
+ width: clearCoords.width,
71
+ height: clearCoords.height
72
+ };
73
+ });
74
+ const cssStyle = computed(() => {
75
+ return {
76
+ top: `${position.value.top}px`,
77
+ left: `${position.value.left}px`,
78
+ width: `${position.value.width}px`,
79
+ height: `${position.value.height}px`
80
+ };
81
+ });
82
+ const borderColor = computed(() => {
83
+ if (!resource.value) {
84
+ return;
85
+ }
86
+ if (resource.value.data?._metadata.adding) {
87
+ return "cwa:outline-orange";
88
+ }
89
+ const publishedState = getPublishedResourceState(resource.value);
90
+ if (publishedState !== void 0) {
91
+ return publishedState ? "cwa:outline-green" : "cwa:outline-orange";
92
+ }
93
+ return iri.value?.startsWith("/_/") ? "cwa:outline-magenta" : "cwa:outline-green";
94
+ });
95
+ async function redraw() {
96
+ drawCanvas();
97
+ }
98
+ function drawCanvas() {
99
+ if (!canvas.value) {
100
+ return;
101
+ }
102
+ const ctx = canvas.value.getContext("2d");
103
+ if (!ctx) {
104
+ return;
105
+ }
106
+ const offset = 7;
107
+ const width = Math.max(windowSize.width.value, document.body.clientWidth);
108
+ const height = Math.max(windowSize.height.value, document.body.clientHeight);
109
+ ctx.reset();
110
+ canvas.value.width = width;
111
+ canvas.value.height = height;
112
+ ctx.fillStyle = "rgba(0,0,0,0.4)";
113
+ ctx.beginPath();
114
+ ctx.rect(0, 0, width, height);
115
+ drawRoundedRect(ctx, position.value.left - offset, position.value.top - offset, position.value.width + offset * 2, position.value.height + offset * 2, 8);
116
+ ctx.fill();
117
+ }
118
+ function drawRoundedRect(ctx, x, y, width, height, radius) {
119
+ ctx.moveTo(x, y + radius);
120
+ ctx.arcTo(x, y + height, x + radius, y + height, radius);
121
+ ctx.arcTo(x + width, y + height, x + width, y + height - radius, radius);
122
+ ctx.arcTo(x + width, y, x + width - radius, y, radius);
123
+ ctx.arcTo(x, y, x, y + radius, radius);
124
+ }
125
+ onMounted(() => {
126
+ $cwa.admin.eventBus.on("redrawFocus", redraw);
127
+ watch(resourceData, $cwa.admin.emitRedraw, { deep: true, flush: "post" });
128
+ watch(canvas, (newCanvas) => newCanvas && redraw());
129
+ watch(totalWidthAndHeight, $cwa.admin.emitRedraw);
130
+ });
131
+ onBeforeUnmount(() => {
132
+ $cwa.admin.eventBus.off("redrawFocus", redraw);
133
+ });
134
+ defineExpose({
135
+ redraw
136
+ });
137
+ </script>
138
+
139
+ <template>
140
+ <client-only>
141
+ <canvas
142
+ ref="canvas"
143
+ class="cwa:z-100 cwa:pointer-events-none cwa:absolute cwa:top-0 cwa:left-0"
144
+ />
145
+ <div
146
+ :class="[borderColor]"
147
+ :style="cssStyle"
148
+ class="cwa:animate-pulse cwa:absolute cwa:outline-2 cwa:outline-offset-4 cwa:pointer-events-none cwa:outline"
149
+ />
150
+ </client-only>
151
+ </template>
@@ -0,0 +1,10 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ type __VLS_Props = {
3
+ iri: Ref<string | undefined>;
4
+ domElements: ComputedRef<HTMLElement[]>;
5
+ };
6
+ declare function redraw(): Promise<void>;
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {
8
+ redraw: typeof redraw;
9
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ export default _default;
@@ -0,0 +1,192 @@
1
+ <script setup>
2
+ import { nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from "vue";
3
+ import { useWindowSize } from "@vueuse/core";
4
+ import { useCwa } from "#cwa/runtime/composables/cwa";
5
+ const canvas = useTemplateRef("canvas");
6
+ const windowSize = useWindowSize();
7
+ const $cwa = useCwa();
8
+ const props = defineProps({
9
+ page: { type: null, required: true },
10
+ layout: { type: null, required: true }
11
+ });
12
+ async function redraw() {
13
+ divElementOverlays.value = [];
14
+ nextTick().then(() => {
15
+ drawCanvas();
16
+ divElementOverlays.value = getDivElementOverlays();
17
+ });
18
+ }
19
+ function getHatchCanvas() {
20
+ const p = document.createElement("canvas");
21
+ p.width = 32;
22
+ p.height = 16;
23
+ const pctx = p.getContext("2d");
24
+ if (!pctx) {
25
+ return;
26
+ }
27
+ const x0 = 36;
28
+ const x1 = -4;
29
+ const y0 = -2;
30
+ const y1 = 18;
31
+ const offset = 32;
32
+ pctx.strokeStyle = "rgba(255,255,255, .1)";
33
+ pctx.lineWidth = 5;
34
+ pctx.beginPath();
35
+ pctx.moveTo(x0, y0);
36
+ pctx.lineTo(x1, y1);
37
+ pctx.moveTo(x0 - offset, y0);
38
+ pctx.lineTo(x1 - offset, y1);
39
+ pctx.moveTo(x0 + offset, y0);
40
+ pctx.lineTo(x1 + offset, y1);
41
+ pctx.stroke();
42
+ return p;
43
+ }
44
+ function drawCanvas() {
45
+ if (!canvas.value) {
46
+ return;
47
+ }
48
+ const ctx = canvas.value.getContext("2d");
49
+ if (!ctx) {
50
+ return;
51
+ }
52
+ const width = Math.max(windowSize.width.value, document.body.clientWidth);
53
+ const height = Math.max(windowSize.height.value, document.body.clientHeight);
54
+ ctx.reset();
55
+ canvas.value.width = width;
56
+ canvas.value.height = height;
57
+ const hatchCanvas = getHatchCanvas();
58
+ ctx.fillStyle = hatchCanvas ? ctx.createPattern(hatchCanvas, "repeat") || "rgba(0,0,0,0.4)" : "rgba(0,0,0,0.4)";
59
+ ctx.beginPath();
60
+ if ($cwa.admin.resourceStackManager.isEditingLayout.value) {
61
+ drawLayoutFocus(ctx);
62
+ } else {
63
+ drawPageFocus(ctx);
64
+ }
65
+ ctx.fill();
66
+ }
67
+ function drawPageFocus(ctx) {
68
+ const [layoutRect] = getBoundingRect();
69
+ const pageCoords = getPageCoords();
70
+ const rightPage = pageCoords.left + pageCoords.width;
71
+ const bottomPage = pageCoords.top + pageCoords.height;
72
+ const coordsThree = { x: layoutRect.width, y: bottomPage };
73
+ const pageFocusCoords = [
74
+ { x: layoutRect.width, y: 0 },
75
+ // 2
76
+ coordsThree,
77
+ // 3
78
+ { x: rightPage, y: bottomPage },
79
+ // 4
80
+ { x: rightPage, y: pageCoords.top },
81
+ // 5
82
+ { x: pageCoords.left, y: pageCoords.top },
83
+ // 6
84
+ { x: pageCoords.left, y: bottomPage },
85
+ // 7
86
+ coordsThree,
87
+ // 8
88
+ { x: layoutRect.width, y: layoutRect.height },
89
+ // 9
90
+ { x: 0, y: layoutRect.height }
91
+ // 10
92
+ // it will return to start automatically when finished 0:0
93
+ ];
94
+ ctx.moveTo(0, 0);
95
+ for (const coords of pageFocusCoords) {
96
+ ctx.lineTo(coords.x, coords.y);
97
+ }
98
+ }
99
+ function drawLayoutFocus(ctx) {
100
+ const pageCoords = getPageCoords();
101
+ ctx.moveTo(pageCoords.left, pageCoords.top);
102
+ ctx.lineTo(pageCoords.left + pageCoords.width, pageCoords.top);
103
+ ctx.lineTo(pageCoords.left + pageCoords.width, pageCoords.top + pageCoords.height);
104
+ ctx.lineTo(pageCoords.left, pageCoords.top + pageCoords.height);
105
+ }
106
+ function getBoundingRect() {
107
+ return [
108
+ props.layout.getBoundingClientRect(),
109
+ props.page.getBoundingClientRect()
110
+ ];
111
+ }
112
+ const getPageCoords = () => {
113
+ const [layoutRect, pageRect] = getBoundingRect();
114
+ return {
115
+ top: pageRect.top - layoutRect.top,
116
+ left: pageRect.left - layoutRect.left,
117
+ width: pageRect.width,
118
+ height: pageRect.height
119
+ };
120
+ };
121
+ onMounted(() => {
122
+ $cwa.admin.eventBus.on("redrawFocus", redraw);
123
+ watch(canvas, (newCanvas) => newCanvas && redraw());
124
+ });
125
+ onBeforeUnmount(() => {
126
+ $cwa.admin.eventBus.off("redrawFocus", redraw);
127
+ });
128
+ function getDivElementOverlays() {
129
+ const pageCoords = getPageCoords();
130
+ const numberToPx = (size) => {
131
+ return `${size}px`;
132
+ };
133
+ if ($cwa.admin.resourceStackManager.isEditingLayout.value) {
134
+ return [
135
+ {
136
+ top: numberToPx(pageCoords.top),
137
+ left: numberToPx(pageCoords.left),
138
+ width: numberToPx(pageCoords.width),
139
+ height: numberToPx(pageCoords.height)
140
+ }
141
+ ];
142
+ }
143
+ const [layoutRect] = getBoundingRect();
144
+ const rightPage = pageCoords.left + pageCoords.width;
145
+ const bottomPage = pageCoords.top + pageCoords.height;
146
+ return [
147
+ {
148
+ top: "0",
149
+ left: "0",
150
+ width: numberToPx(layoutRect.width),
151
+ height: numberToPx(pageCoords.top)
152
+ },
153
+ {
154
+ top: numberToPx(pageCoords.top),
155
+ left: "0",
156
+ width: numberToPx(pageCoords.left),
157
+ height: numberToPx(pageCoords.height)
158
+ },
159
+ {
160
+ top: numberToPx(pageCoords.top),
161
+ left: numberToPx(rightPage),
162
+ width: numberToPx(layoutRect.width - rightPage),
163
+ height: numberToPx(pageCoords.height)
164
+ },
165
+ {
166
+ top: numberToPx(bottomPage),
167
+ left: "0",
168
+ width: numberToPx(layoutRect.width),
169
+ height: numberToPx(layoutRect.height - bottomPage)
170
+ }
171
+ ];
172
+ }
173
+ const divElementOverlays = ref(getDivElementOverlays());
174
+ </script>
175
+
176
+ <template>
177
+ <ClientOnly>
178
+ <div class="cwa:pointer-events-none cwa:absolute cwa:top-0 cwa:left-0">
179
+ <div
180
+ v-for="(overlay, index) of divElementOverlays"
181
+ :key="`cwa-admin-overlay-${index}`"
182
+ :style="overlay"
183
+ class="cwa:absolute cwa:pointer-events-none cwa:backdrop-blur-[1.5px] cwa:bg-black/30"
184
+ />
185
+ <canvas
186
+ id="cwa-layout-page-overlay"
187
+ ref="canvas"
188
+ class="cwa:absolute cwa:top-0 cwa:left-0 cwa:pointer-events-none"
189
+ />
190
+ </div>
191
+ </ClientOnly>
192
+ </template>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ page: HTMLDivElement;
3
+ layout: HTMLDivElement;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,186 @@
1
+ <script setup>
2
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from "vue";
3
+ import ResourceLoadingIndicator from "../_common/ResourceLoadingIndicator.vue";
4
+ import ManagerTabs from "./_parts/ManagerTabs.vue";
5
+ import CwaAdminResourceManagerContextMenu from "./_parts/CwaResourceManagerContextMenu.vue";
6
+ import { useCwa } from "#imports";
7
+ import { CwaUserRoles } from "#cwa/runtime/storage/stores/auth/state";
8
+ import ResourceManagerCtaButton from "#cwa/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue";
9
+ import AddComponentDialog from "#cwa/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue";
10
+ import { useDataResolver } from "#cwa/runtime/templates/components/core/useDataResolver";
11
+ const $cwa = useCwa();
12
+ const currentStackItem = $cwa.admin.resourceStackManager.currentStackItem;
13
+ const spacer = useTemplateRef("spacer");
14
+ const managerHolder = useTemplateRef("managerHolder");
15
+ const allTabsMeta = ref([]);
16
+ const selectedIndex = ref(0);
17
+ const isOpen = ref(false);
18
+ const virtualElement = ref({ getBoundingClientRect: () => ({}) });
19
+ const managerTabs = useTemplateRef("managerTabs");
20
+ const currentManagerTabs = ref();
21
+ const cachedPosition = { top: 0, left: 0 };
22
+ let mousedownTarget = null;
23
+ function showDefaultContext({ top, left }) {
24
+ const difference = {
25
+ top: Math.abs(top - cachedPosition.top),
26
+ left: Math.abs(left - cachedPosition.left)
27
+ };
28
+ return isOpen.value && difference.top < 10 && difference.left < 10;
29
+ }
30
+ function openContext({ top, left }) {
31
+ cachedPosition.top = top;
32
+ cachedPosition.left = left;
33
+ virtualElement.value.getBoundingClientRect = () => ({
34
+ width: 0,
35
+ height: 0,
36
+ top,
37
+ left
38
+ });
39
+ isOpen.value = true;
40
+ }
41
+ function contextMenuHandler(e, type) {
42
+ const pos = {
43
+ top: e.clientY,
44
+ left: e.clientX
45
+ };
46
+ if (showDefaultContext(pos) || !$cwa.admin.isEditing || !$cwa.admin.resourceStackManager.isContextPopulating.value) {
47
+ isOpen.value = false;
48
+ return;
49
+ }
50
+ e.preventDefault();
51
+ completeStack(e, type, true);
52
+ openContext(pos);
53
+ }
54
+ function closeContextMenu(e) {
55
+ isOpen.value = false;
56
+ completeStack(e, void 0, true);
57
+ }
58
+ function mousedownHandler(e) {
59
+ mousedownTarget = e.target;
60
+ }
61
+ function clickHandler(e, type) {
62
+ if (e.target !== mousedownTarget && !$cwa.admin.resourceStackManager.isPopulating.value) {
63
+ return;
64
+ }
65
+ completeStack(e, type);
66
+ $cwa.admin.resourceStackManager.selectStackIndex(0, false);
67
+ }
68
+ function completeStack(e, type, isContext = false) {
69
+ $cwa.admin.resourceStackManager.completeStack({ clickTarget: e.target }, isContext, type);
70
+ }
71
+ function selectTab(index) {
72
+ selectedIndex.value = index;
73
+ }
74
+ const showAdmin = computed(() => {
75
+ return $cwa.auth.hasRole(CwaUserRoles.ADMIN);
76
+ });
77
+ const showSpacer = computed(() => {
78
+ return $cwa.admin.resourceStackManager.showManager.value && !!currentStackItem;
79
+ });
80
+ const selectedTab = computed(() => {
81
+ return currentStackItem.value?.managerTabs?.[selectedIndex.value];
82
+ });
83
+ watch([spacer, managerHolder, currentStackItem, selectedIndex, allTabsMeta], () => {
84
+ if (!spacer.value || !managerHolder.value || !currentStackItem.value) {
85
+ return;
86
+ }
87
+ const newHeight = managerHolder.value.clientHeight;
88
+ spacer.value.style.height = `${newHeight}px`;
89
+ nextTick().then(() => $cwa.admin.emitRedraw());
90
+ }, {
91
+ flush: "post"
92
+ });
93
+ const resolverProps = computed(() => {
94
+ return {
95
+ iri: currentStackItem.value?.iri
96
+ };
97
+ });
98
+ useDataResolver(allTabsMeta, {
99
+ components: currentManagerTabs,
100
+ props: resolverProps,
101
+ propsValidator: (props) => {
102
+ return !!props.iri;
103
+ }
104
+ });
105
+ watch(currentStackItem, (newCurrent, oldCurrent) => {
106
+ if (oldCurrent && newCurrent && $cwa.resources.isIriPublishableEquivalent(oldCurrent.iri, newCurrent.iri)) {
107
+ return;
108
+ }
109
+ allTabsMeta.value = [];
110
+ managerTabs.value?.resetTabs();
111
+ currentManagerTabs.value = newCurrent?.managerTabs;
112
+ });
113
+ onMounted(() => {
114
+ window.addEventListener("mousedown", mousedownHandler);
115
+ window.addEventListener("resize", $cwa.admin.emitRedraw, false);
116
+ });
117
+ onBeforeUnmount(() => {
118
+ window.removeEventListener("resize", $cwa.admin.emitRedraw);
119
+ });
120
+ defineExpose({
121
+ clickHandler,
122
+ contextMenuHandler,
123
+ closeContextMenu
124
+ });
125
+ </script>
126
+
127
+ <template>
128
+ <div
129
+ v-if="showSpacer"
130
+ id="cwa-manager-spacer"
131
+ ref="spacer"
132
+ class="relative"
133
+ />
134
+ <Transition
135
+ enter-from-class="cwa:transform cwa:translate-y-full"
136
+ enter-active-class="cwa:duration-200 cwa:ease-out"
137
+ enter-to-class="cwa:translate-y-0"
138
+ leave-from-class="cwa:translate-y-0"
139
+ leave-active-class="cwa:duration-200 cwa:ease-in"
140
+ leave-to-class="cwa:transform cwa:translate-y-full"
141
+ >
142
+ <div
143
+ v-if="$cwa.admin.resourceStackManager.showManager.value"
144
+ class="fixed cwa:bottom-0 cwa:z-manager cwa:w-full cwa:text-white cwa:bg-dark/40"
145
+ @click.stop
146
+ >
147
+ <div class="cwa:dark-blur">
148
+ <div
149
+ v-if="allTabsMeta.length"
150
+ ref="managerHolder"
151
+ >
152
+ <ResourceLoadingIndicator class="cwa:absolute cwa:bottom-full cwa:left-0" />
153
+ <div class="cwa:flex">
154
+ <div class="cwa:grow">
155
+ <div class="cwa:flex cwa:items-center cwa:pt-3 cwa:px-4 cwa:gap-x-3">
156
+ <div class="cwa:grow">
157
+ <ManagerTabs
158
+ ref="managerTabs"
159
+ :tabs="allTabsMeta"
160
+ @click="selectTab"
161
+ />
162
+ </div>
163
+ <div class="cwa:flex cwa:light cwa:items-center cwa:content-center cwa:justify-center">
164
+ <ResourceManagerCtaButton />
165
+ </div>
166
+ </div>
167
+ <div class="cwa:p-4 cwa:min-h-[74px] cwa:flex cwa:items-center">
168
+ <component
169
+ :is="selectedTab"
170
+ v-if="selectedTab"
171
+ class="cwa:w-full"
172
+ />
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ </Transition>
180
+ <CwaAdminResourceManagerContextMenu
181
+ v-if="showAdmin"
182
+ v-model="isOpen"
183
+ :virtual-element="virtualElement"
184
+ />
185
+ <AddComponentDialog />
186
+ </template>
@@ -0,0 +1,9 @@
1
+ declare function contextMenuHandler(e: MouseEvent, type: 'page' | 'layout'): void;
2
+ declare function closeContextMenu(e: MouseEvent): void;
3
+ declare function clickHandler(e: MouseEvent, type: 'page' | 'layout'): void;
4
+ declare const _default: import("vue").DefineComponent<{}, {
5
+ clickHandler: typeof clickHandler;
6
+ contextMenuHandler: typeof contextMenuHandler;
7
+ closeContextMenu: typeof closeContextMenu;
8
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
9
+ export default _default;