@nuxt-atelier/admin 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +6 -2
- package/dist/module.d.mts +52 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +188 -0
- package/dist/runtime/admin.css +1 -0
- package/dist/runtime/ai-off.d.ts +1 -0
- package/dist/runtime/ai-off.js +1 -0
- package/dist/runtime/appearance.d.ts +59 -0
- package/dist/runtime/appearance.js +111 -0
- package/dist/runtime/branding.d.ts +11 -0
- package/dist/runtime/branding.js +14 -0
- package/dist/runtime/components/App.d.vue.ts +6 -0
- package/dist/runtime/components/App.vue +170 -0
- package/dist/runtime/components/App.vue.d.ts +6 -0
- package/dist/runtime/components/AppearanceModal.d.vue.ts +3 -0
- package/dist/runtime/components/AppearanceModal.vue +267 -0
- package/dist/runtime/components/AppearanceModal.vue.d.ts +3 -0
- package/dist/runtime/components/AuthFrame.d.vue.ts +15 -0
- package/dist/runtime/components/AuthFrame.vue +56 -0
- package/dist/runtime/components/AuthFrame.vue.d.ts +15 -0
- package/dist/runtime/components/Brand.d.vue.ts +6 -0
- package/dist/runtime/components/Brand.vue +22 -0
- package/dist/runtime/components/Brand.vue.d.ts +6 -0
- package/dist/runtime/components/CollectionList.d.vue.ts +6 -0
- package/dist/runtime/components/CollectionList.vue +312 -0
- package/dist/runtime/components/CollectionList.vue.d.ts +6 -0
- package/dist/runtime/components/CommentsPanel.d.vue.ts +9 -0
- package/dist/runtime/components/CommentsPanel.vue +228 -0
- package/dist/runtime/components/CommentsPanel.vue.d.ts +9 -0
- package/dist/runtime/components/EntryEdit.d.vue.ts +9 -0
- package/dist/runtime/components/EntryEdit.vue +451 -0
- package/dist/runtime/components/EntryEdit.vue.d.ts +9 -0
- package/dist/runtime/components/FieldInput.d.vue.ts +13 -0
- package/dist/runtime/components/FieldInput.vue +325 -0
- package/dist/runtime/components/FieldInput.vue.d.ts +13 -0
- package/dist/runtime/components/FormSubmissions.d.vue.ts +6 -0
- package/dist/runtime/components/FormSubmissions.vue +197 -0
- package/dist/runtime/components/FormSubmissions.vue.d.ts +6 -0
- package/dist/runtime/components/GlobalSearch.d.vue.ts +10 -0
- package/dist/runtime/components/GlobalSearch.vue +145 -0
- package/dist/runtime/components/GlobalSearch.vue.d.ts +10 -0
- package/dist/runtime/components/Home.d.vue.ts +3 -0
- package/dist/runtime/components/Home.vue +226 -0
- package/dist/runtime/components/Home.vue.d.ts +3 -0
- package/dist/runtime/components/Icon.d.ts +14 -0
- package/dist/runtime/components/Icon.js +12 -0
- package/dist/runtime/components/MediaDetails.d.vue.ts +11 -0
- package/dist/runtime/components/MediaDetails.vue +222 -0
- package/dist/runtime/components/MediaDetails.vue.d.ts +11 -0
- package/dist/runtime/components/MediaField.d.vue.ts +14 -0
- package/dist/runtime/components/MediaField.vue +86 -0
- package/dist/runtime/components/MediaField.vue.d.ts +14 -0
- package/dist/runtime/components/MediaGrid.d.vue.ts +13 -0
- package/dist/runtime/components/MediaGrid.vue +49 -0
- package/dist/runtime/components/MediaGrid.vue.d.ts +13 -0
- package/dist/runtime/components/MediaLibrary.d.vue.ts +12 -0
- package/dist/runtime/components/MediaLibrary.vue +151 -0
- package/dist/runtime/components/MediaLibrary.vue.d.ts +12 -0
- package/dist/runtime/components/NotFound.d.vue.ts +6 -0
- package/dist/runtime/components/NotFound.vue +29 -0
- package/dist/runtime/components/NotFound.vue.d.ts +6 -0
- package/dist/runtime/components/NotificationBell.d.vue.ts +3 -0
- package/dist/runtime/components/NotificationBell.vue +53 -0
- package/dist/runtime/components/NotificationBell.vue.d.ts +3 -0
- package/dist/runtime/components/Page.d.vue.ts +28 -0
- package/dist/runtime/components/Page.vue +84 -0
- package/dist/runtime/components/Page.vue.d.ts +28 -0
- package/dist/runtime/components/RelatedCreate.d.vue.ts +16 -0
- package/dist/runtime/components/RelatedCreate.vue +86 -0
- package/dist/runtime/components/RelatedCreate.vue.d.ts +16 -0
- package/dist/runtime/components/RevisionHistory.d.vue.ts +16 -0
- package/dist/runtime/components/RevisionHistory.vue +145 -0
- package/dist/runtime/components/RevisionHistory.vue.d.ts +16 -0
- package/dist/runtime/components/RichTextEditor.d.vue.ts +15 -0
- package/dist/runtime/components/RichTextEditor.vue +190 -0
- package/dist/runtime/components/RichTextEditor.vue.d.ts +15 -0
- package/dist/runtime/components/RobotsSettings.d.vue.ts +3 -0
- package/dist/runtime/components/RobotsSettings.vue +173 -0
- package/dist/runtime/components/RobotsSettings.vue.d.ts +3 -0
- package/dist/runtime/components/RoleEdit.d.vue.ts +6 -0
- package/dist/runtime/components/RoleEdit.vue +234 -0
- package/dist/runtime/components/RoleEdit.vue.d.ts +6 -0
- package/dist/runtime/components/Roles.d.vue.ts +3 -0
- package/dist/runtime/components/Roles.vue +129 -0
- package/dist/runtime/components/Roles.vue.d.ts +3 -0
- package/dist/runtime/components/ScheduleSection.d.vue.ts +12 -0
- package/dist/runtime/components/ScheduleSection.vue +120 -0
- package/dist/runtime/components/ScheduleSection.vue.d.ts +12 -0
- package/dist/runtime/components/SeoPanel.d.vue.ts +7 -0
- package/dist/runtime/components/SeoPanel.vue +81 -0
- package/dist/runtime/components/SeoPanel.vue.d.ts +7 -0
- package/dist/runtime/components/Setup.d.vue.ts +3 -0
- package/dist/runtime/components/Setup.vue +79 -0
- package/dist/runtime/components/Setup.vue.d.ts +3 -0
- package/dist/runtime/components/SharedBlockUsage.d.vue.ts +7 -0
- package/dist/runtime/components/SharedBlockUsage.vue +91 -0
- package/dist/runtime/components/SharedBlockUsage.vue.d.ts +7 -0
- package/dist/runtime/components/Shell.d.vue.ts +15 -0
- package/dist/runtime/components/Shell.vue +277 -0
- package/dist/runtime/components/Shell.vue.d.ts +15 -0
- package/dist/runtime/components/SignIn.d.vue.ts +3 -0
- package/dist/runtime/components/SignIn.vue +106 -0
- package/dist/runtime/components/SignIn.vue.d.ts +3 -0
- package/dist/runtime/components/Toaster.d.vue.ts +3 -0
- package/dist/runtime/components/Toaster.vue +24 -0
- package/dist/runtime/components/Toaster.vue.d.ts +3 -0
- package/dist/runtime/components/Users.d.vue.ts +3 -0
- package/dist/runtime/components/Users.vue +226 -0
- package/dist/runtime/components/Users.vue.d.ts +3 -0
- package/dist/runtime/composables/debounced.d.ts +3 -0
- package/dist/runtime/composables/debounced.js +11 -0
- package/dist/runtime/composables/useAtelierAdmin.d.ts +17 -0
- package/dist/runtime/composables/useAtelierAdmin.js +53 -0
- package/dist/runtime/composables/useAtelierAdminPortal.d.ts +3 -0
- package/dist/runtime/composables/useAtelierAdminPortal.js +5 -0
- package/dist/runtime/composables/useAtelierAdminSchema.d.ts +182 -0
- package/dist/runtime/composables/useAtelierAdminSchema.js +26 -0
- package/dist/runtime/composables/useAtelierCollection.d.ts +49 -0
- package/dist/runtime/composables/useAtelierCollection.js +77 -0
- package/dist/runtime/composables/useAtelierComments.d.ts +50 -0
- package/dist/runtime/composables/useAtelierComments.js +46 -0
- package/dist/runtime/composables/useAtelierDashboard.d.ts +42 -0
- package/dist/runtime/composables/useAtelierDashboard.js +16 -0
- package/dist/runtime/composables/useAtelierEntryForm.d.ts +77 -0
- package/dist/runtime/composables/useAtelierEntryForm.js +184 -0
- package/dist/runtime/composables/useAtelierGlobalSearch.d.ts +12 -0
- package/dist/runtime/composables/useAtelierGlobalSearch.js +17 -0
- package/dist/runtime/composables/useAtelierMediaLibrary.d.ts +75 -0
- package/dist/runtime/composables/useAtelierMediaLibrary.js +85 -0
- package/dist/runtime/composables/useAtelierNavigation.d.ts +20 -0
- package/dist/runtime/composables/useAtelierNavigation.js +37 -0
- package/dist/runtime/composables/useAtelierNotifications.d.ts +21 -0
- package/dist/runtime/composables/useAtelierNotifications.js +34 -0
- package/dist/runtime/composables/useAtelierPermissions.d.ts +11 -0
- package/dist/runtime/composables/useAtelierPermissions.js +15 -0
- package/dist/runtime/composables/useAtelierPresence.d.ts +32 -0
- package/dist/runtime/composables/useAtelierPresence.js +95 -0
- package/dist/runtime/composables/useAtelierRealtime.d.ts +10 -0
- package/dist/runtime/composables/useAtelierRealtime.js +74 -0
- package/dist/runtime/composables/useAtelierRoles.d.ts +13 -0
- package/dist/runtime/composables/useAtelierRoles.js +15 -0
- package/dist/runtime/composables/useAtelierSeo.d.ts +34 -0
- package/dist/runtime/composables/useAtelierSeo.js +57 -0
- package/dist/runtime/composables/useAtelierSession.d.ts +35 -0
- package/dist/runtime/composables/useAtelierSession.js +36 -0
- package/dist/runtime/composables/useAtelierSetting.d.ts +11 -0
- package/dist/runtime/composables/useAtelierSetting.js +16 -0
- package/dist/runtime/composables/useAtelierUsers.d.ts +18 -0
- package/dist/runtime/composables/useAtelierUsers.js +16 -0
- package/dist/runtime/crystal-neuo/VERSION +3 -0
- package/dist/runtime/crystal-neuo/components/Alert.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Alert.vue +25 -0
- package/dist/runtime/crystal-neuo/components/Alert.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Avatar.d.vue.ts +15 -0
- package/dist/runtime/crystal-neuo/components/Avatar.vue +25 -0
- package/dist/runtime/crystal-neuo/components/Avatar.vue.d.ts +15 -0
- package/dist/runtime/crystal-neuo/components/Badge.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Badge.vue +17 -0
- package/dist/runtime/crystal-neuo/components/Badge.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Breadcrumb.d.vue.ts +16 -0
- package/dist/runtime/crystal-neuo/components/Breadcrumb.vue +26 -0
- package/dist/runtime/crystal-neuo/components/Breadcrumb.vue.d.ts +16 -0
- package/dist/runtime/crystal-neuo/components/Button.d.vue.ts +35 -0
- package/dist/runtime/crystal-neuo/components/Button.vue +31 -0
- package/dist/runtime/crystal-neuo/components/Button.vue.d.ts +35 -0
- package/dist/runtime/crystal-neuo/components/Card.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Card.vue +17 -0
- package/dist/runtime/crystal-neuo/components/Card.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Checkbox.d.vue.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Checkbox.vue +45 -0
- package/dist/runtime/crystal-neuo/components/Checkbox.vue.d.ts +23 -0
- package/dist/runtime/crystal-neuo/components/DatePicker.d.vue.ts +24 -0
- package/dist/runtime/crystal-neuo/components/DatePicker.vue +43 -0
- package/dist/runtime/crystal-neuo/components/DatePicker.vue.d.ts +24 -0
- package/dist/runtime/crystal-neuo/components/Dialog.d.vue.ts +41 -0
- package/dist/runtime/crystal-neuo/components/Dialog.vue +63 -0
- package/dist/runtime/crystal-neuo/components/Dialog.vue.d.ts +41 -0
- package/dist/runtime/crystal-neuo/components/Drawer.d.vue.ts +34 -0
- package/dist/runtime/crystal-neuo/components/Drawer.vue +45 -0
- package/dist/runtime/crystal-neuo/components/Drawer.vue.d.ts +34 -0
- package/dist/runtime/crystal-neuo/components/FileUpload.d.vue.ts +32 -0
- package/dist/runtime/crystal-neuo/components/FileUpload.vue +94 -0
- package/dist/runtime/crystal-neuo/components/FileUpload.vue.d.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Input.d.vue.ts +26 -0
- package/dist/runtime/crystal-neuo/components/Input.vue +48 -0
- package/dist/runtime/crystal-neuo/components/Input.vue.d.ts +26 -0
- package/dist/runtime/crystal-neuo/components/List.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/List.vue +19 -0
- package/dist/runtime/crystal-neuo/components/List.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/ListItem.d.vue.ts +20 -0
- package/dist/runtime/crystal-neuo/components/ListItem.vue +13 -0
- package/dist/runtime/crystal-neuo/components/ListItem.vue.d.ts +20 -0
- package/dist/runtime/crystal-neuo/components/Menu.d.vue.ts +26 -0
- package/dist/runtime/crystal-neuo/components/Menu.vue +120 -0
- package/dist/runtime/crystal-neuo/components/Menu.vue.d.ts +26 -0
- package/dist/runtime/crystal-neuo/components/Modal.d.vue.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Modal.vue +37 -0
- package/dist/runtime/crystal-neuo/components/Modal.vue.d.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Nav.d.vue.ts +24 -0
- package/dist/runtime/crystal-neuo/components/Nav.vue +15 -0
- package/dist/runtime/crystal-neuo/components/Nav.vue.d.ts +24 -0
- package/dist/runtime/crystal-neuo/components/NavLink.d.vue.ts +22 -0
- package/dist/runtime/crystal-neuo/components/NavLink.vue +23 -0
- package/dist/runtime/crystal-neuo/components/NavLink.vue.d.ts +22 -0
- package/dist/runtime/crystal-neuo/components/Pagination.d.vue.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Pagination.vue +58 -0
- package/dist/runtime/crystal-neuo/components/Pagination.vue.d.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Progress.d.vue.ts +18 -0
- package/dist/runtime/crystal-neuo/components/Progress.vue +35 -0
- package/dist/runtime/crystal-neuo/components/Progress.vue.d.ts +18 -0
- package/dist/runtime/crystal-neuo/components/Radio.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Radio.vue +40 -0
- package/dist/runtime/crystal-neuo/components/Radio.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/SegmentedControl.d.vue.ts +31 -0
- package/dist/runtime/crystal-neuo/components/SegmentedControl.vue +39 -0
- package/dist/runtime/crystal-neuo/components/SegmentedControl.vue.d.ts +31 -0
- package/dist/runtime/crystal-neuo/components/Select.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Select.vue +48 -0
- package/dist/runtime/crystal-neuo/components/Select.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Sheet.d.vue.ts +29 -0
- package/dist/runtime/crystal-neuo/components/Sheet.vue +37 -0
- package/dist/runtime/crystal-neuo/components/Sheet.vue.d.ts +29 -0
- package/dist/runtime/crystal-neuo/components/Skeleton.d.vue.ts +13 -0
- package/dist/runtime/crystal-neuo/components/Skeleton.vue +17 -0
- package/dist/runtime/crystal-neuo/components/Skeleton.vue.d.ts +13 -0
- package/dist/runtime/crystal-neuo/components/Slider.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Slider.vue +41 -0
- package/dist/runtime/crystal-neuo/components/Slider.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/TabBar.d.vue.ts +28 -0
- package/dist/runtime/crystal-neuo/components/TabBar.vue +29 -0
- package/dist/runtime/crystal-neuo/components/TabBar.vue.d.ts +28 -0
- package/dist/runtime/crystal-neuo/components/Table.d.vue.ts +31 -0
- package/dist/runtime/crystal-neuo/components/Table.vue +36 -0
- package/dist/runtime/crystal-neuo/components/Table.vue.d.ts +31 -0
- package/dist/runtime/crystal-neuo/components/Tabs.d.vue.ts +40 -0
- package/dist/runtime/crystal-neuo/components/Tabs.vue +79 -0
- package/dist/runtime/crystal-neuo/components/Tabs.vue.d.ts +40 -0
- package/dist/runtime/crystal-neuo/components/Textarea.d.vue.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Textarea.vue +48 -0
- package/dist/runtime/crystal-neuo/components/Textarea.vue.d.ts +25 -0
- package/dist/runtime/crystal-neuo/components/Toast.d.vue.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Toast.vue +67 -0
- package/dist/runtime/crystal-neuo/components/Toast.vue.d.ts +32 -0
- package/dist/runtime/crystal-neuo/components/Toggle.d.vue.ts +21 -0
- package/dist/runtime/crystal-neuo/components/Toggle.vue +43 -0
- package/dist/runtime/crystal-neuo/components/Toggle.vue.d.ts +21 -0
- package/dist/runtime/crystal-neuo/components/Tooltip.d.vue.ts +23 -0
- package/dist/runtime/crystal-neuo/components/Tooltip.vue +38 -0
- package/dist/runtime/crystal-neuo/components/Tooltip.vue.d.ts +23 -0
- package/dist/runtime/crystal-neuo/components/cn.d.ts +1 -0
- package/dist/runtime/crystal-neuo/components/cn.js +3 -0
- package/dist/runtime/crystal-neuo/components/useControlAttrs.d.ts +15 -0
- package/dist/runtime/crystal-neuo/components/useControlAttrs.js +11 -0
- package/dist/runtime/crystal-neuo/components/useFocusTrap.d.ts +9 -0
- package/dist/runtime/crystal-neuo/components/useFocusTrap.js +55 -0
- package/dist/runtime/crystal-neuo/components/useModalDialog.d.ts +11 -0
- package/dist/runtime/crystal-neuo/components/useModalDialog.js +42 -0
- package/dist/runtime/crystal-neuo/contract/alert.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/alert.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/avatar.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/avatar.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/badge.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/badge.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/breadcrumb.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/breadcrumb.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/button.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/button.contract.js +22 -0
- package/dist/runtime/crystal-neuo/contract/card.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/card.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/checkbox.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/checkbox.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/date-picker.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/date-picker.contract.js +22 -0
- package/dist/runtime/crystal-neuo/contract/dialog.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/dialog.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/drawer.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/drawer.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/file-upload.contract.d.ts +17 -0
- package/dist/runtime/crystal-neuo/contract/file-upload.contract.js +36 -0
- package/dist/runtime/crystal-neuo/contract/index.d.ts +67 -0
- package/dist/runtime/crystal-neuo/contract/index.js +96 -0
- package/dist/runtime/crystal-neuo/contract/input.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/input.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/list.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/list.contract.js +21 -0
- package/dist/runtime/crystal-neuo/contract/menu.contract.d.ts +21 -0
- package/dist/runtime/crystal-neuo/contract/menu.contract.js +51 -0
- package/dist/runtime/crystal-neuo/contract/modal.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/modal.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/nav.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/nav.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/pagination.contract.d.ts +11 -0
- package/dist/runtime/crystal-neuo/contract/pagination.contract.js +32 -0
- package/dist/runtime/crystal-neuo/contract/progress.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/progress.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/radio.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/radio.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/segmented-control.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/segmented-control.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/select.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/select.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/sheet.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/sheet.contract.js +23 -0
- package/dist/runtime/crystal-neuo/contract/skeleton.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/skeleton.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/slider.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/slider.contract.js +24 -0
- package/dist/runtime/crystal-neuo/contract/tab-bar.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/tab-bar.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/table.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/table.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/tabs.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/tabs.contract.js +26 -0
- package/dist/runtime/crystal-neuo/contract/textarea.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/textarea.contract.js +19 -0
- package/dist/runtime/crystal-neuo/contract/toast.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/toast.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/toggle.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/toggle.contract.js +22 -0
- package/dist/runtime/crystal-neuo/contract/tooltip.contract.d.ts +3 -0
- package/dist/runtime/crystal-neuo/contract/tooltip.contract.js +18 -0
- package/dist/runtime/crystal-neuo/contract/types.d.ts +76 -0
- package/dist/runtime/crystal-neuo/contract/types.js +12 -0
- package/dist/runtime/crystal-neuo/css/crystal-neuo.css +1 -0
- package/dist/runtime/crystal-neuo/runtime/axes.d.ts +16 -0
- package/dist/runtime/crystal-neuo/runtime/axes.js +9 -0
- package/dist/runtime/crystal-neuo/runtime/index.d.ts +62 -0
- package/dist/runtime/crystal-neuo/runtime/index.js +115 -0
- package/dist/runtime/crystal-neuo/runtime/platform.d.ts +11 -0
- package/dist/runtime/crystal-neuo/runtime/platform.js +18 -0
- package/dist/runtime/crystal-neuo/runtime/refraction.d.ts +42 -0
- package/dist/runtime/crystal-neuo/runtime/refraction.js +183 -0
- package/dist/runtime/css/shell.css +1 -0
- package/dist/runtime/i18n/en.d.ts +2 -0
- package/dist/runtime/i18n/en.js +511 -0
- package/dist/runtime/i18n/index.d.ts +15 -0
- package/dist/runtime/i18n/index.js +52 -0
- package/dist/runtime/overrides.d.ts +5 -0
- package/dist/runtime/overrides.js +6 -0
- package/dist/runtime/pages/AdminPage.d.vue.ts +3 -0
- package/dist/runtime/pages/AdminPage.vue +49 -0
- package/dist/runtime/pages/AdminPage.vue.d.ts +3 -0
- package/dist/runtime/passkeys-off.d.ts +1 -0
- package/dist/runtime/passkeys-off.js +3 -0
- package/dist/runtime/passkeys.d.ts +1 -0
- package/dist/runtime/passkeys.js +6 -0
- package/dist/runtime/toast.d.ts +15 -0
- package/dist/runtime/toast.js +19 -0
- package/dist/runtime/types.d.ts +137 -0
- package/dist/runtime/types.js +0 -0
- package/dist/types.d.mts +3 -0
- package/package.json +59 -4
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, reactive, ref } from "vue";
|
|
3
|
+
import { atelierFetch } from "../composables/useAtelierAdmin";
|
|
4
|
+
import { useAtelierAdminSchema } from "../composables/useAtelierAdminSchema";
|
|
5
|
+
import { useAtelierPermissions } from "../composables/useAtelierPermissions";
|
|
6
|
+
import { useAtelierUsers } from "../composables/useAtelierUsers";
|
|
7
|
+
import CnAlert from "../crystal-neuo/components/Alert.vue";
|
|
8
|
+
import CnBadge from "../crystal-neuo/components/Badge.vue";
|
|
9
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
10
|
+
import CnDialog from "../crystal-neuo/components/Dialog.vue";
|
|
11
|
+
import CnInput from "../crystal-neuo/components/Input.vue";
|
|
12
|
+
import CnModal from "../crystal-neuo/components/Modal.vue";
|
|
13
|
+
import CnSelect from "../crystal-neuo/components/Select.vue";
|
|
14
|
+
import { useAdminToast } from "../toast";
|
|
15
|
+
import Icon from "./Icon";
|
|
16
|
+
import NotFound from "./NotFound.vue";
|
|
17
|
+
import Page from "./Page.vue";
|
|
18
|
+
import { useAdminI18n } from "../i18n";
|
|
19
|
+
const { t } = useAdminI18n();
|
|
20
|
+
const { manages } = useAtelierPermissions();
|
|
21
|
+
const { schema } = useAtelierAdminSchema();
|
|
22
|
+
const { users, loading, create, update, remove } = useAtelierUsers();
|
|
23
|
+
const toast = useAdminToast();
|
|
24
|
+
const roleOptions = computed(() => (schema.value?.roles ?? []).map((r) => ({ value: r.name, label: r.label ?? r.name })));
|
|
25
|
+
const roleLabel = (name) => schema.value?.roles?.find((r) => r.name === name)?.label ?? name;
|
|
26
|
+
const editing = ref(void 0);
|
|
27
|
+
const form = reactive({ email: "", name: "", role: "", password: "", sites: {} });
|
|
28
|
+
const sites = computed(() => schema.value?.sites ?? []);
|
|
29
|
+
const siteRoleOptions = computed(() => [{ value: "", label: t("users.noAccess") }, ...roleOptions.value.filter((o) => o.value !== "admin")]);
|
|
30
|
+
const error = ref("");
|
|
31
|
+
const open = computed({ get: () => editing.value !== void 0, set: (on) => !on && (editing.value = void 0) });
|
|
32
|
+
async function edit(user) {
|
|
33
|
+
Object.assign(form, { email: user?.email ?? "", name: user?.name ?? "", role: user?.role ?? roleOptions.value.find((o) => o.value !== "admin")?.value ?? "", password: "", sites: {} });
|
|
34
|
+
error.value = "";
|
|
35
|
+
editing.value = user?.id ?? null;
|
|
36
|
+
if (user && sites.value.length)
|
|
37
|
+
form.sites = await atelierFetch(`/users/${encodeURIComponent(user.id)}/sites`).catch(() => ({}));
|
|
38
|
+
}
|
|
39
|
+
async function submit() {
|
|
40
|
+
error.value = "";
|
|
41
|
+
const body = { email: form.email, name: form.name || null, role: form.role, ...form.password ? { password: form.password } : {} };
|
|
42
|
+
try {
|
|
43
|
+
const saved = editing.value ? await update.mutateAsync({ id: editing.value, ...body }) : await create.mutateAsync(body);
|
|
44
|
+
if (sites.value.length && form.role !== "admin") {
|
|
45
|
+
const roles = Object.fromEntries(Object.entries(form.sites).filter(([, role]) => role));
|
|
46
|
+
await atelierFetch(`/users/${encodeURIComponent(saved.id)}/sites`, { method: "PUT", body: { sites: roles } });
|
|
47
|
+
}
|
|
48
|
+
toast.add({ color: "success", title: editing.value ? t("users.saved") : t("users.created") });
|
|
49
|
+
editing.value = void 0;
|
|
50
|
+
} catch (e) {
|
|
51
|
+
error.value = e.errors?.map((x) => x.message).join(". ") || e.message;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const deleting = ref(null);
|
|
55
|
+
const confirmOpen = computed({ get: () => !!deleting.value, set: (on) => !on && (deleting.value = null) });
|
|
56
|
+
async function confirmDelete() {
|
|
57
|
+
const user = deleting.value;
|
|
58
|
+
try {
|
|
59
|
+
await remove.mutateAsync(user.id);
|
|
60
|
+
toast.add({ color: "success", title: t("users.deleted", { email: user.email }) });
|
|
61
|
+
} catch (e) {
|
|
62
|
+
toast.add({ color: "error", title: t("common.notDeleted"), description: e.message });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<NotFound
|
|
69
|
+
v-if="!manages('users')"
|
|
70
|
+
forbidden
|
|
71
|
+
/>
|
|
72
|
+
<Page
|
|
73
|
+
v-else
|
|
74
|
+
:title="t('nav.users')"
|
|
75
|
+
icon="users"
|
|
76
|
+
:description="t('users.description')"
|
|
77
|
+
>
|
|
78
|
+
<template #actions>
|
|
79
|
+
<CnButton @click="edit(null)">
|
|
80
|
+
<Icon name="plus" />
|
|
81
|
+
{{ t("users.new") }}
|
|
82
|
+
</CnButton>
|
|
83
|
+
</template>
|
|
84
|
+
<div class="app-table-wrap">
|
|
85
|
+
<table class="cn-table">
|
|
86
|
+
<caption class="sr-only">
|
|
87
|
+
{{ t("nav.users") }}
|
|
88
|
+
</caption>
|
|
89
|
+
<thead>
|
|
90
|
+
<tr>
|
|
91
|
+
<th scope="col">
|
|
92
|
+
{{ t("common.name") }}
|
|
93
|
+
</th>
|
|
94
|
+
<th scope="col">
|
|
95
|
+
{{ t("common.email") }}
|
|
96
|
+
</th>
|
|
97
|
+
<th scope="col">
|
|
98
|
+
{{ t("common.role") }}
|
|
99
|
+
</th>
|
|
100
|
+
<th scope="col">
|
|
101
|
+
<span class="sr-only">{{ t("common.actions") }}</span>
|
|
102
|
+
</th>
|
|
103
|
+
</tr>
|
|
104
|
+
</thead>
|
|
105
|
+
<tbody>
|
|
106
|
+
<tr v-if="loading">
|
|
107
|
+
<td colspan="4">
|
|
108
|
+
{{ t("common.loading") }}
|
|
109
|
+
</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr
|
|
112
|
+
v-for="user in users"
|
|
113
|
+
:key="user.id"
|
|
114
|
+
>
|
|
115
|
+
<td>{{ user.name || "\u2014" }}</td>
|
|
116
|
+
<td>{{ user.email }}</td>
|
|
117
|
+
<td>
|
|
118
|
+
<CnBadge
|
|
119
|
+
:variant="user.role === 'admin' ? 'primary' : 'neutral'"
|
|
120
|
+
size="sm"
|
|
121
|
+
>
|
|
122
|
+
{{ roleLabel(user.role) }}
|
|
123
|
+
</CnBadge>
|
|
124
|
+
</td>
|
|
125
|
+
<td class="app-actions-cell">
|
|
126
|
+
<CnButton
|
|
127
|
+
variant="ghost"
|
|
128
|
+
size="sm"
|
|
129
|
+
:aria-label="t('users.editOne', { email: user.email })"
|
|
130
|
+
@click="edit(user)"
|
|
131
|
+
>
|
|
132
|
+
{{ t("common.edit") }}
|
|
133
|
+
</CnButton>
|
|
134
|
+
<CnButton
|
|
135
|
+
variant="ghost"
|
|
136
|
+
size="sm"
|
|
137
|
+
:aria-label="t('users.deleteOne', { email: user.email })"
|
|
138
|
+
@click="deleting = user"
|
|
139
|
+
>
|
|
140
|
+
<Icon name="trash-2" />
|
|
141
|
+
</CnButton>
|
|
142
|
+
</td>
|
|
143
|
+
</tr>
|
|
144
|
+
</tbody>
|
|
145
|
+
</table>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<CnModal
|
|
149
|
+
v-model:open="open"
|
|
150
|
+
:title="editing ? t('users.edit') : t('users.new')"
|
|
151
|
+
>
|
|
152
|
+
<form
|
|
153
|
+
class="app-form"
|
|
154
|
+
@submit.prevent="submit"
|
|
155
|
+
>
|
|
156
|
+
<CnInput
|
|
157
|
+
v-model="form.email"
|
|
158
|
+
:label="t('common.email')"
|
|
159
|
+
type="email"
|
|
160
|
+
required
|
|
161
|
+
autocomplete="off"
|
|
162
|
+
/>
|
|
163
|
+
<CnInput
|
|
164
|
+
v-model="form.name"
|
|
165
|
+
:label="t('common.name')"
|
|
166
|
+
autocomplete="off"
|
|
167
|
+
/>
|
|
168
|
+
<CnSelect
|
|
169
|
+
v-model="form.role"
|
|
170
|
+
:label="t('common.role')"
|
|
171
|
+
:options="roleOptions"
|
|
172
|
+
/>
|
|
173
|
+
<fieldset
|
|
174
|
+
v-if="sites.length && form.role !== 'admin'"
|
|
175
|
+
class="app-form"
|
|
176
|
+
data-site-roles
|
|
177
|
+
>
|
|
178
|
+
<legend>{{ t("users.sites") }}</legend>
|
|
179
|
+
<CnSelect
|
|
180
|
+
v-for="site in sites"
|
|
181
|
+
:key="site.name"
|
|
182
|
+
v-model="form.sites[site.name]"
|
|
183
|
+
:label="site.label"
|
|
184
|
+
:options="siteRoleOptions"
|
|
185
|
+
/>
|
|
186
|
+
</fieldset>
|
|
187
|
+
<CnInput
|
|
188
|
+
v-model="form.password"
|
|
189
|
+
:label="t('common.password')"
|
|
190
|
+
type="password"
|
|
191
|
+
autocomplete="new-password"
|
|
192
|
+
:hint="editing ? t('users.passwordKeep') : t('users.passwordNew')"
|
|
193
|
+
/>
|
|
194
|
+
<CnAlert
|
|
195
|
+
v-if="error"
|
|
196
|
+
variant="danger"
|
|
197
|
+
live
|
|
198
|
+
>
|
|
199
|
+
{{ error }}
|
|
200
|
+
</CnAlert>
|
|
201
|
+
<div class="cn-modal__actions">
|
|
202
|
+
<CnButton
|
|
203
|
+
variant="ghost"
|
|
204
|
+
@click="editing = void 0"
|
|
205
|
+
>
|
|
206
|
+
{{ t("common.cancel") }}
|
|
207
|
+
</CnButton>
|
|
208
|
+
<CnButton
|
|
209
|
+
type="submit"
|
|
210
|
+
:loading="create.isPending.value || update.isPending.value"
|
|
211
|
+
>
|
|
212
|
+
{{ editing ? t("common.save") : t("users.create") }}
|
|
213
|
+
</CnButton>
|
|
214
|
+
</div>
|
|
215
|
+
</form>
|
|
216
|
+
</CnModal>
|
|
217
|
+
<CnDialog
|
|
218
|
+
v-model:open="confirmOpen"
|
|
219
|
+
:title="t('users.deleteTitle', { email: deleting?.email })"
|
|
220
|
+
:description="t('users.deleteBody')"
|
|
221
|
+
:confirm-label="t('common.delete')"
|
|
222
|
+
variant="destructive"
|
|
223
|
+
@confirm="confirmDelete"
|
|
224
|
+
/>
|
|
225
|
+
</Page>
|
|
226
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { onScopeDispose, ref, watch } from "vue";
|
|
2
|
+
export function refDebounced(source, ms) {
|
|
3
|
+
const value = ref(source.value);
|
|
4
|
+
let timer;
|
|
5
|
+
watch(source, (next) => {
|
|
6
|
+
clearTimeout(timer);
|
|
7
|
+
timer = setTimeout(() => value.value = next, ms);
|
|
8
|
+
});
|
|
9
|
+
onScopeDispose(() => clearTimeout(timer));
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const chosenSite: () => string | undefined;
|
|
2
|
+
export declare function chooseSite(site: string | undefined): void;
|
|
3
|
+
interface RequestOptions {
|
|
4
|
+
method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
5
|
+
body?: unknown;
|
|
6
|
+
query?: Record<string, string | number | undefined>;
|
|
7
|
+
}
|
|
8
|
+
/** A CMS API request (`path` under `/api/_atelier`). */
|
|
9
|
+
export declare function atelierFetch<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
10
|
+
export declare function useAtelierAdmin(): {
|
|
11
|
+
base: string;
|
|
12
|
+
passkeys: boolean;
|
|
13
|
+
api: typeof atelierFetch;
|
|
14
|
+
/** An admin path: `to('collections', 'posts')` is `/admin/collections/posts`. */
|
|
15
|
+
to: (...segments: string[]) => string;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
|
+
const csrf = () => globalThis.document?.cookie.split("; ").find((c) => c.startsWith("atelier-csrf="))?.slice("atelier-csrf=".length);
|
|
3
|
+
const SITE_KEY = "atelier-admin-site";
|
|
4
|
+
const storage = () => {
|
|
5
|
+
try {
|
|
6
|
+
return globalThis.localStorage;
|
|
7
|
+
} catch {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export const chosenSite = () => storage()?.getItem(SITE_KEY) ?? void 0;
|
|
12
|
+
export function chooseSite(site) {
|
|
13
|
+
if (site)
|
|
14
|
+
storage()?.setItem(SITE_KEY, site);
|
|
15
|
+
else
|
|
16
|
+
storage()?.removeItem(SITE_KEY);
|
|
17
|
+
}
|
|
18
|
+
function toAdminApiError(error) {
|
|
19
|
+
const e = error;
|
|
20
|
+
const details = e.data?.data ?? {};
|
|
21
|
+
return {
|
|
22
|
+
status: e.status ?? e.statusCode ?? 0,
|
|
23
|
+
message: e.data?.message ?? e.data?.statusMessage ?? e.message ?? "Request failed",
|
|
24
|
+
...typeof details.code === "string" ? { code: details.code } : {},
|
|
25
|
+
...Array.isArray(details.errors) ? { errors: details.errors } : {},
|
|
26
|
+
...Array.isArray(details.fields) ? { fields: details.fields } : {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export async function atelierFetch(path, options = {}) {
|
|
30
|
+
const token = csrf();
|
|
31
|
+
try {
|
|
32
|
+
const request = $fetch;
|
|
33
|
+
return await request(`/api/_atelier${path}`, {
|
|
34
|
+
method: options.method ?? "GET",
|
|
35
|
+
body: options.body,
|
|
36
|
+
query: options.query,
|
|
37
|
+
headers: { ...token ? { "x-atelier-csrf": token } : {}, ...chosenSite() ? { "x-atelier-site": chosenSite() } : {} }
|
|
38
|
+
});
|
|
39
|
+
} catch (error) {
|
|
40
|
+
throw toAdminApiError(error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function useAtelierAdmin() {
|
|
44
|
+
const config = useRuntimeConfig().public.atelier;
|
|
45
|
+
const base = config?.admin?.base ?? "/admin";
|
|
46
|
+
return {
|
|
47
|
+
base,
|
|
48
|
+
passkeys: config?.admin?.passkeys ?? false,
|
|
49
|
+
api: atelierFetch,
|
|
50
|
+
/** An admin path: `to('collections', 'posts')` is `/admin/collections/posts`. */
|
|
51
|
+
to: (...segments) => [base, ...segments.map(encodeURIComponent)].join("/")
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { AdminSchema } from '../types.js';
|
|
2
|
+
export declare function useAtelierAdminSchema(): {
|
|
3
|
+
schema: import("vue").ComputedRef<AdminSchema | undefined>;
|
|
4
|
+
collection: (name: string) => import("vue").ComputedRef<import("../types.js").CollectionType | undefined>;
|
|
5
|
+
singleton: (name: string) => import("vue").ComputedRef<import("../types.js").SingletonType | undefined>;
|
|
6
|
+
data: import("vue").Ref<AdminSchema, AdminSchema>;
|
|
7
|
+
error: import("vue").Ref<Error, Error>;
|
|
8
|
+
isError: import("vue").Ref<true, true>;
|
|
9
|
+
isPending: import("vue").Ref<false, false>;
|
|
10
|
+
isLoading: import("vue").Ref<false, false>;
|
|
11
|
+
isLoadingError: import("vue").Ref<false, false>;
|
|
12
|
+
isRefetchError: import("vue").Ref<true, true>;
|
|
13
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
14
|
+
isPlaceholderData: import("vue").Ref<false, false>;
|
|
15
|
+
status: import("vue").Ref<"error", "error">;
|
|
16
|
+
dataUpdatedAt: import("vue").Ref<number, number>;
|
|
17
|
+
errorUpdatedAt: import("vue").Ref<number, number>;
|
|
18
|
+
failureCount: import("vue").Ref<number, number>;
|
|
19
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
20
|
+
errorUpdateCount: import("vue").Ref<number, number>;
|
|
21
|
+
isFetched: import("vue").Ref<boolean, boolean>;
|
|
22
|
+
isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
|
|
23
|
+
isFetching: import("vue").Ref<boolean, boolean>;
|
|
24
|
+
isInitialLoading: import("vue").Ref<boolean, boolean>;
|
|
25
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
26
|
+
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
27
|
+
isStale: import("vue").Ref<boolean, boolean>;
|
|
28
|
+
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
29
|
+
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
30
|
+
fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
|
|
31
|
+
suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
32
|
+
} | {
|
|
33
|
+
schema: import("vue").ComputedRef<AdminSchema | undefined>;
|
|
34
|
+
collection: (name: string) => import("vue").ComputedRef<import("../types.js").CollectionType | undefined>;
|
|
35
|
+
singleton: (name: string) => import("vue").ComputedRef<import("../types.js").SingletonType | undefined>;
|
|
36
|
+
data: import("vue").Ref<AdminSchema, AdminSchema>;
|
|
37
|
+
error: import("vue").Ref<null, null>;
|
|
38
|
+
isError: import("vue").Ref<false, false>;
|
|
39
|
+
isPending: import("vue").Ref<false, false>;
|
|
40
|
+
isLoading: import("vue").Ref<false, false>;
|
|
41
|
+
isLoadingError: import("vue").Ref<false, false>;
|
|
42
|
+
isRefetchError: import("vue").Ref<false, false>;
|
|
43
|
+
isSuccess: import("vue").Ref<true, true>;
|
|
44
|
+
isPlaceholderData: import("vue").Ref<false, false>;
|
|
45
|
+
status: import("vue").Ref<"success", "success">;
|
|
46
|
+
dataUpdatedAt: import("vue").Ref<number, number>;
|
|
47
|
+
errorUpdatedAt: import("vue").Ref<number, number>;
|
|
48
|
+
failureCount: import("vue").Ref<number, number>;
|
|
49
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
50
|
+
errorUpdateCount: import("vue").Ref<number, number>;
|
|
51
|
+
isFetched: import("vue").Ref<boolean, boolean>;
|
|
52
|
+
isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
|
|
53
|
+
isFetching: import("vue").Ref<boolean, boolean>;
|
|
54
|
+
isInitialLoading: import("vue").Ref<boolean, boolean>;
|
|
55
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
56
|
+
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
57
|
+
isStale: import("vue").Ref<boolean, boolean>;
|
|
58
|
+
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
59
|
+
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
60
|
+
fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
|
|
61
|
+
suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
62
|
+
} | {
|
|
63
|
+
schema: import("vue").ComputedRef<AdminSchema | undefined>;
|
|
64
|
+
collection: (name: string) => import("vue").ComputedRef<import("../types.js").CollectionType | undefined>;
|
|
65
|
+
singleton: (name: string) => import("vue").ComputedRef<import("../types.js").SingletonType | undefined>;
|
|
66
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
67
|
+
error: import("vue").Ref<Error, Error>;
|
|
68
|
+
isError: import("vue").Ref<true, true>;
|
|
69
|
+
isPending: import("vue").Ref<false, false>;
|
|
70
|
+
isLoading: import("vue").Ref<false, false>;
|
|
71
|
+
isLoadingError: import("vue").Ref<true, true>;
|
|
72
|
+
isRefetchError: import("vue").Ref<false, false>;
|
|
73
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
74
|
+
isPlaceholderData: import("vue").Ref<false, false>;
|
|
75
|
+
status: import("vue").Ref<"error", "error">;
|
|
76
|
+
dataUpdatedAt: import("vue").Ref<number, number>;
|
|
77
|
+
errorUpdatedAt: import("vue").Ref<number, number>;
|
|
78
|
+
failureCount: import("vue").Ref<number, number>;
|
|
79
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
80
|
+
errorUpdateCount: import("vue").Ref<number, number>;
|
|
81
|
+
isFetched: import("vue").Ref<boolean, boolean>;
|
|
82
|
+
isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
|
|
83
|
+
isFetching: import("vue").Ref<boolean, boolean>;
|
|
84
|
+
isInitialLoading: import("vue").Ref<boolean, boolean>;
|
|
85
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
86
|
+
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
87
|
+
isStale: import("vue").Ref<boolean, boolean>;
|
|
88
|
+
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
89
|
+
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
90
|
+
fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
|
|
91
|
+
suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
92
|
+
} | {
|
|
93
|
+
schema: import("vue").ComputedRef<AdminSchema | undefined>;
|
|
94
|
+
collection: (name: string) => import("vue").ComputedRef<import("../types.js").CollectionType | undefined>;
|
|
95
|
+
singleton: (name: string) => import("vue").ComputedRef<import("../types.js").SingletonType | undefined>;
|
|
96
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
97
|
+
error: import("vue").Ref<null, null>;
|
|
98
|
+
isError: import("vue").Ref<false, false>;
|
|
99
|
+
isPending: import("vue").Ref<true, true>;
|
|
100
|
+
isLoading: import("vue").Ref<true, true>;
|
|
101
|
+
isLoadingError: import("vue").Ref<false, false>;
|
|
102
|
+
isRefetchError: import("vue").Ref<false, false>;
|
|
103
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
104
|
+
isPlaceholderData: import("vue").Ref<false, false>;
|
|
105
|
+
status: import("vue").Ref<"pending", "pending">;
|
|
106
|
+
dataUpdatedAt: import("vue").Ref<number, number>;
|
|
107
|
+
errorUpdatedAt: import("vue").Ref<number, number>;
|
|
108
|
+
failureCount: import("vue").Ref<number, number>;
|
|
109
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
110
|
+
errorUpdateCount: import("vue").Ref<number, number>;
|
|
111
|
+
isFetched: import("vue").Ref<boolean, boolean>;
|
|
112
|
+
isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
|
|
113
|
+
isFetching: import("vue").Ref<boolean, boolean>;
|
|
114
|
+
isInitialLoading: import("vue").Ref<boolean, boolean>;
|
|
115
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
116
|
+
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
117
|
+
isStale: import("vue").Ref<boolean, boolean>;
|
|
118
|
+
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
119
|
+
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
120
|
+
fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
|
|
121
|
+
suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
122
|
+
} | {
|
|
123
|
+
schema: import("vue").ComputedRef<AdminSchema | undefined>;
|
|
124
|
+
collection: (name: string) => import("vue").ComputedRef<import("../types.js").CollectionType | undefined>;
|
|
125
|
+
singleton: (name: string) => import("vue").ComputedRef<import("../types.js").SingletonType | undefined>;
|
|
126
|
+
data: import("vue").Ref<undefined, undefined>;
|
|
127
|
+
error: import("vue").Ref<null, null>;
|
|
128
|
+
isError: import("vue").Ref<false, false>;
|
|
129
|
+
isPending: import("vue").Ref<true, true>;
|
|
130
|
+
isLoadingError: import("vue").Ref<false, false>;
|
|
131
|
+
isRefetchError: import("vue").Ref<false, false>;
|
|
132
|
+
isSuccess: import("vue").Ref<false, false>;
|
|
133
|
+
isPlaceholderData: import("vue").Ref<false, false>;
|
|
134
|
+
status: import("vue").Ref<"pending", "pending">;
|
|
135
|
+
dataUpdatedAt: import("vue").Ref<number, number>;
|
|
136
|
+
errorUpdatedAt: import("vue").Ref<number, number>;
|
|
137
|
+
failureCount: import("vue").Ref<number, number>;
|
|
138
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
139
|
+
errorUpdateCount: import("vue").Ref<number, number>;
|
|
140
|
+
isFetched: import("vue").Ref<boolean, boolean>;
|
|
141
|
+
isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
|
|
142
|
+
isFetching: import("vue").Ref<boolean, boolean>;
|
|
143
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
144
|
+
isInitialLoading: import("vue").Ref<boolean, boolean>;
|
|
145
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
146
|
+
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
147
|
+
isStale: import("vue").Ref<boolean, boolean>;
|
|
148
|
+
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
149
|
+
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
150
|
+
fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
|
|
151
|
+
suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
152
|
+
} | {
|
|
153
|
+
schema: import("vue").ComputedRef<AdminSchema | undefined>;
|
|
154
|
+
collection: (name: string) => import("vue").ComputedRef<import("../types.js").CollectionType | undefined>;
|
|
155
|
+
singleton: (name: string) => import("vue").ComputedRef<import("../types.js").SingletonType | undefined>;
|
|
156
|
+
data: import("vue").Ref<AdminSchema, AdminSchema>;
|
|
157
|
+
isError: import("vue").Ref<false, false>;
|
|
158
|
+
error: import("vue").Ref<null, null>;
|
|
159
|
+
isPending: import("vue").Ref<false, false>;
|
|
160
|
+
isLoading: import("vue").Ref<false, false>;
|
|
161
|
+
isLoadingError: import("vue").Ref<false, false>;
|
|
162
|
+
isRefetchError: import("vue").Ref<false, false>;
|
|
163
|
+
isSuccess: import("vue").Ref<true, true>;
|
|
164
|
+
isPlaceholderData: import("vue").Ref<true, true>;
|
|
165
|
+
status: import("vue").Ref<"success", "success">;
|
|
166
|
+
dataUpdatedAt: import("vue").Ref<number, number>;
|
|
167
|
+
errorUpdatedAt: import("vue").Ref<number, number>;
|
|
168
|
+
failureCount: import("vue").Ref<number, number>;
|
|
169
|
+
failureReason: import("vue").Ref<Error | null, Error | null>;
|
|
170
|
+
errorUpdateCount: import("vue").Ref<number, number>;
|
|
171
|
+
isFetched: import("vue").Ref<boolean, boolean>;
|
|
172
|
+
isFetchedAfterMount: import("vue").Ref<boolean, boolean>;
|
|
173
|
+
isFetching: import("vue").Ref<boolean, boolean>;
|
|
174
|
+
isInitialLoading: import("vue").Ref<boolean, boolean>;
|
|
175
|
+
isPaused: import("vue").Ref<boolean, boolean>;
|
|
176
|
+
isRefetching: import("vue").Ref<boolean, boolean>;
|
|
177
|
+
isStale: import("vue").Ref<boolean, boolean>;
|
|
178
|
+
isEnabled: import("vue").Ref<boolean, boolean>;
|
|
179
|
+
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
180
|
+
fetchStatus: import("vue").Ref<import("@tanstack/vue-query").FetchStatus, import("@tanstack/vue-query").FetchStatus>;
|
|
181
|
+
suspense: () => Promise<import("@tanstack/vue-query").QueryObserverResult<AdminSchema, Error>>;
|
|
182
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/vue-query";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { atelierFetch, chooseSite, chosenSite } from "./useAtelierAdmin.js";
|
|
4
|
+
export function useAtelierAdminSchema() {
|
|
5
|
+
const query = useQuery({
|
|
6
|
+
queryKey: ["atelier", "schema"],
|
|
7
|
+
queryFn: async () => {
|
|
8
|
+
try {
|
|
9
|
+
return await atelierFetch("/schema");
|
|
10
|
+
} catch (error) {
|
|
11
|
+
if (error.status === 403 && chosenSite()) {
|
|
12
|
+
chooseSite(void 0);
|
|
13
|
+
return atelierFetch("/schema");
|
|
14
|
+
}
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
staleTime: 6e4
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
...query,
|
|
22
|
+
schema: computed(() => query.data.value),
|
|
23
|
+
collection: (name) => computed(() => query.data.value?.collections.find((c) => c.name === name)),
|
|
24
|
+
singleton: (name) => computed(() => query.data.value?.singletons.find((s) => s.name === name))
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { AdminApiError, CollectionType, Entry, EntryList } from '../types.js';
|
|
3
|
+
export interface ListState {
|
|
4
|
+
page: number;
|
|
5
|
+
pageSize: number;
|
|
6
|
+
/** A field or `_createdAt`/`_updatedAt`, `-` first for descending. */
|
|
7
|
+
sort: string;
|
|
8
|
+
search: string;
|
|
9
|
+
/** A filter in the API's shape, e.g. `{ category: { eq: 'news' } }`. */
|
|
10
|
+
filter?: Record<string, unknown>;
|
|
11
|
+
/** The fields shown as columns. */
|
|
12
|
+
columns: string[];
|
|
13
|
+
/** Localized collections: the locale whose versions are listed (the default locale when unset). */
|
|
14
|
+
locale?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BulkResult {
|
|
17
|
+
succeeded: string[];
|
|
18
|
+
failed: {
|
|
19
|
+
id: string;
|
|
20
|
+
error: AdminApiError;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
/** The field a list searches and shows first: `title`, `name`, else the first text field. */
|
|
24
|
+
export declare function titleField(type: CollectionType | undefined): string | undefined;
|
|
25
|
+
export declare function useAtelierCollection(name: MaybeRefOrGetter<string>, initial?: Partial<ListState>): {
|
|
26
|
+
type: import("vue").ComputedRef<CollectionType | undefined>;
|
|
27
|
+
state: {
|
|
28
|
+
page: number;
|
|
29
|
+
pageSize: number;
|
|
30
|
+
sort: string;
|
|
31
|
+
search: string;
|
|
32
|
+
filter?: Record<string, unknown>
|
|
33
|
+
/** The fields shown as columns. */
|
|
34
|
+
| undefined;
|
|
35
|
+
columns: string[];
|
|
36
|
+
locale?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
entries: import("vue").ComputedRef<Entry[]>;
|
|
39
|
+
total: import("vue").ComputedRef<number>;
|
|
40
|
+
pages: import("vue").ComputedRef<number>;
|
|
41
|
+
loading: import("vue").Ref<true, true> | import("vue").Ref<false, false>;
|
|
42
|
+
error: import("vue").ComputedRef<AdminApiError | null>;
|
|
43
|
+
refresh: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<EntryList, Error>>;
|
|
44
|
+
publish: import("@tanstack/vue-query").UseMutationReturnType<BulkResult, Error, Entry[], unknown, import("@tanstack/vue-query").MutationResult<BulkResult, Error, Entry[], unknown>>;
|
|
45
|
+
unpublish: import("@tanstack/vue-query").UseMutationReturnType<BulkResult, Error, Entry[], unknown, import("@tanstack/vue-query").MutationResult<BulkResult, Error, Entry[], unknown>>;
|
|
46
|
+
remove: import("@tanstack/vue-query").UseMutationReturnType<BulkResult, Error, Entry[], unknown, import("@tanstack/vue-query").MutationResult<BulkResult, Error, Entry[], unknown>>;
|
|
47
|
+
/** The entries as a JSON or CSV file's contents (CSV: the visible columns, then id and dates). */
|
|
48
|
+
exportEntries(entries: Entry[], format: "json" | "csv"): string;
|
|
49
|
+
};
|