@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ano Rebel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nuxt-atelier/admin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Headless admin composables and the default admin kit (crystal-neuo) for Nuxt Atelier
|
|
4
|
+
|
|
5
|
+
Part of [Nuxt Atelier](https://nuxt-atelier.anorebel.net), a visual CMS for Nuxt. See the [documentation](https://nuxt-atelier.anorebel.net) to get started, or try the [live demo](https://nuxt-atelier-demo.anorebel.net).
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { NuxtModule } from '@nuxt/schema';
|
|
2
|
+
|
|
3
|
+
/** Lucide icons the kit uses (https://lucide.dev), bundled into the admin. */
|
|
4
|
+
declare const ICONS: string[];
|
|
5
|
+
/** An admin page of the app or a plugin, in the admin's navigation. */
|
|
6
|
+
interface AdminPage {
|
|
7
|
+
/** Its path under the admin's base: `settings` is `/admin/settings`. */
|
|
8
|
+
path: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** A Lucide icon name (`settings`); it must be one the admin bundles, or listed in `icons`. */
|
|
11
|
+
icon?: string;
|
|
12
|
+
/** Navigation group; pages without one go under "Tools". */
|
|
13
|
+
group?: string;
|
|
14
|
+
/** Lower first. */
|
|
15
|
+
order?: number;
|
|
16
|
+
/** Admin areas a user must manage to see the page (any one of them). */
|
|
17
|
+
requires?: string | string[];
|
|
18
|
+
/** The page component: a path, `~/` for the app. */
|
|
19
|
+
component: string;
|
|
20
|
+
/** Opened from elsewhere (a link, a button), not listed in the navigation. */
|
|
21
|
+
hidden?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** An admin interface language: its own name, and its messages (JSON files, merged in order). */
|
|
24
|
+
interface AdminLanguage {
|
|
25
|
+
/** Its name in that language: `Deutsch`. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Catalog files (`~/admin-i18n/de.json`); a key missing from them shows in English. */
|
|
28
|
+
messages: string | string[];
|
|
29
|
+
}
|
|
30
|
+
interface ModuleOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Admin interface languages by code (`de`, `pt-br`), loaded when someone picks one. English ships with the
|
|
33
|
+
* admin; giving `en` adds to or changes its text. Plugins add theirs with the `atelier:admin:languages` hook.
|
|
34
|
+
*/
|
|
35
|
+
languages?: Record<string, AdminLanguage>;
|
|
36
|
+
/** Pages added to the admin. Plugins add theirs with the `atelier:admin:pages` hook. */
|
|
37
|
+
pages?: AdminPage[];
|
|
38
|
+
/** More Lucide icons to bundle, for custom pages and content types. */
|
|
39
|
+
icons?: string[];
|
|
40
|
+
}
|
|
41
|
+
declare module '@nuxt/schema' {
|
|
42
|
+
interface NuxtHooks {
|
|
43
|
+
/** Add or change admin pages: plugins push theirs. */
|
|
44
|
+
'atelier:admin:pages': (pages: AdminPage[]) => void | Promise<void>;
|
|
45
|
+
/** Add admin interface languages, or messages to one (a plugin's own pages' text). */
|
|
46
|
+
'atelier:admin:languages': (languages: Record<string, AdminLanguage>) => void | Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
declare const module$1: NuxtModule<ModuleOptions>;
|
|
50
|
+
|
|
51
|
+
export { ICONS, module$1 as default };
|
|
52
|
+
export type { AdminLanguage, AdminPage, ModuleOptions };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { defineNuxtModule, createResolver, hasNuxtModule, addTemplate, resolvePath, addTypeTemplate, getLayerDirectories, addComponentsDir, extendPages, addImports } from '@nuxt/kit';
|
|
5
|
+
|
|
6
|
+
const ICONS = [
|
|
7
|
+
"layout-dashboard",
|
|
8
|
+
"file-text",
|
|
9
|
+
"files",
|
|
10
|
+
"settings",
|
|
11
|
+
"users",
|
|
12
|
+
"shield",
|
|
13
|
+
"log-out",
|
|
14
|
+
"plus",
|
|
15
|
+
"trash-2",
|
|
16
|
+
"save",
|
|
17
|
+
"search",
|
|
18
|
+
"chevron-left",
|
|
19
|
+
"chevron-down",
|
|
20
|
+
"chevron-up",
|
|
21
|
+
"upload",
|
|
22
|
+
"eye",
|
|
23
|
+
"eye-off",
|
|
24
|
+
"palette",
|
|
25
|
+
"key-round",
|
|
26
|
+
"loader-circle",
|
|
27
|
+
"check",
|
|
28
|
+
"x",
|
|
29
|
+
"menu",
|
|
30
|
+
"panel-left-open",
|
|
31
|
+
"panel-left-close",
|
|
32
|
+
"download",
|
|
33
|
+
"triangle-alert",
|
|
34
|
+
"image",
|
|
35
|
+
"lock",
|
|
36
|
+
"file",
|
|
37
|
+
"film",
|
|
38
|
+
"music",
|
|
39
|
+
"bold",
|
|
40
|
+
"italic",
|
|
41
|
+
"underline",
|
|
42
|
+
"strikethrough",
|
|
43
|
+
"code",
|
|
44
|
+
"heading-2",
|
|
45
|
+
"heading-3",
|
|
46
|
+
"list",
|
|
47
|
+
"list-ordered",
|
|
48
|
+
"quote",
|
|
49
|
+
"square-code",
|
|
50
|
+
"link",
|
|
51
|
+
"unlink",
|
|
52
|
+
"undo-2",
|
|
53
|
+
"redo-2",
|
|
54
|
+
"bell",
|
|
55
|
+
"message-square",
|
|
56
|
+
"reply",
|
|
57
|
+
"circle-check",
|
|
58
|
+
"rotate-ccw",
|
|
59
|
+
"blocks"
|
|
60
|
+
];
|
|
61
|
+
function iconsTemplate(names) {
|
|
62
|
+
const require = createRequire(import.meta.url);
|
|
63
|
+
const set = JSON.parse(readFileSync(require.resolve("@iconify-json/lucide/icons.json"), "utf8"));
|
|
64
|
+
const picked = Object.fromEntries(names.map((name) => {
|
|
65
|
+
const icon = set.icons[name] ?? set.icons[set.aliases?.[name]?.parent ?? ""];
|
|
66
|
+
if (!icon)
|
|
67
|
+
throw new Error(`[@nuxt-atelier/admin] No Lucide icon "${name}"`);
|
|
68
|
+
return [name, { body: icon.body, width: icon.width ?? set.width ?? 24, height: icon.height ?? set.height ?? 24 }];
|
|
69
|
+
}));
|
|
70
|
+
return `export default ${JSON.stringify(picked)}
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
const module$1 = defineNuxtModule({
|
|
74
|
+
meta: {
|
|
75
|
+
name: "@nuxt-atelier/admin",
|
|
76
|
+
configKey: "atelierAdmin",
|
|
77
|
+
compatibility: {
|
|
78
|
+
nuxt: ">=4.6.0"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaults: { pages: [], icons: [], languages: {} },
|
|
82
|
+
setup(options, nuxt) {
|
|
83
|
+
const { resolve } = createResolver(import.meta.url);
|
|
84
|
+
const core = nuxt.options.atelier;
|
|
85
|
+
const base = core?.admin?.base ?? "/admin";
|
|
86
|
+
nuxt.hook("modules:done", () => {
|
|
87
|
+
if (!hasNuxtModule("nuxt-atelier", nuxt))
|
|
88
|
+
console.warn("[@nuxt-atelier/admin] nuxt-atelier isn't installed: add it to `modules` too");
|
|
89
|
+
});
|
|
90
|
+
const rules = nuxt.options.routeRules;
|
|
91
|
+
for (const path of [base, `${base}/**`])
|
|
92
|
+
rules[path] = { ...rules[path], ssr: false, headers: { ...rules[path]?.headers, "x-robots-tag": "noindex, nofollow" } };
|
|
93
|
+
nuxt.options.nitro.prerender ??= {};
|
|
94
|
+
nuxt.options.nitro.prerender.ignore = [...nuxt.options.nitro.prerender.ignore ?? [], base];
|
|
95
|
+
nuxt.options.alias["#atelier-admin-passkeys"] = resolve(core?.auth?.passkeys === true ? "./runtime/passkeys" : "./runtime/passkeys-off");
|
|
96
|
+
nuxt.options.alias["#atelier-admin-runtime"] = resolve("./runtime");
|
|
97
|
+
nuxt.options.alias["#atelier-admin-ai"] = resolve("./runtime/ai-off");
|
|
98
|
+
const pages = [...options.pages ?? []];
|
|
99
|
+
const languages = { ...options.languages };
|
|
100
|
+
nuxt.hook("modules:done", async () => {
|
|
101
|
+
await nuxt.callHook("atelier:admin:pages", pages);
|
|
102
|
+
await nuxt.callHook("atelier:admin:languages", languages);
|
|
103
|
+
});
|
|
104
|
+
nuxt.options.alias["#atelier-admin-icons"] = addTemplate({
|
|
105
|
+
filename: "atelier/admin-icons.mjs",
|
|
106
|
+
getContents: () => iconsTemplate([.../* @__PURE__ */ new Set([...ICONS, ...options.icons ?? [], ...pages.flatMap((p) => p.icon ? [p.icon] : [])])])
|
|
107
|
+
}).dst;
|
|
108
|
+
nuxt.options.alias["#atelier-admin-pages"] = addTemplate({
|
|
109
|
+
filename: "atelier/admin-pages.mjs",
|
|
110
|
+
getContents: async () => {
|
|
111
|
+
const entries = await Promise.all(pages.map(async ({ component, ...page }) => ` { ...${JSON.stringify({ ...page, requires: [page.requires ?? []].flat() })}, component: () => import(${JSON.stringify(await resolvePath(component))}) },`));
|
|
112
|
+
return `export default [
|
|
113
|
+
${entries.join("\n")}
|
|
114
|
+
]
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
}).dst;
|
|
118
|
+
nuxt.options.alias["#atelier-admin-languages"] = addTemplate({
|
|
119
|
+
filename: "atelier/admin-languages.mjs",
|
|
120
|
+
getContents: async () => {
|
|
121
|
+
const entries = await Promise.all(Object.entries(languages).map(async ([code, { name, messages }]) => {
|
|
122
|
+
const files = await Promise.all([messages].flat().map((file) => resolvePath(file)));
|
|
123
|
+
return ` { code: ${JSON.stringify(code.toLowerCase())}, name: ${JSON.stringify(name)}, messages: [${files.map((f) => `() => import(${JSON.stringify(f)})`).join(", ")}] },`;
|
|
124
|
+
}));
|
|
125
|
+
return `export default [
|
|
126
|
+
${entries.join("\n")}
|
|
127
|
+
]
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
}).dst;
|
|
131
|
+
addTypeTemplate({
|
|
132
|
+
filename: "types/atelier-admin.d.ts",
|
|
133
|
+
getContents: () => `declare module '#atelier-admin-pages' {
|
|
134
|
+
const pages: { path: string, label: string, icon?: string, group?: string, order?: number, requires: string[], hidden?: boolean, component: () => Promise<{ default: import('vue').Component }> }[]
|
|
135
|
+
export default pages
|
|
136
|
+
}
|
|
137
|
+
declare module '#atelier-admin-languages' {
|
|
138
|
+
const languages: { code: string, name: string, messages: (() => Promise<{ default: Record<string, string> }>)[] }[]
|
|
139
|
+
export default languages
|
|
140
|
+
}
|
|
141
|
+
declare module '#atelier-admin-icons' {
|
|
142
|
+
const icons: Record<string, { body: string, width: number, height: number }>
|
|
143
|
+
export default icons
|
|
144
|
+
}
|
|
145
|
+
declare module '#atelier-admin-passkeys' {
|
|
146
|
+
export function signInWithPasskey(): Promise<unknown>
|
|
147
|
+
}
|
|
148
|
+
declare module '#atelier-admin-ai' {
|
|
149
|
+
export const ai: import(${JSON.stringify(resolve("./runtime/types"))}).AdminAi | null
|
|
150
|
+
}
|
|
151
|
+
`
|
|
152
|
+
});
|
|
153
|
+
const layers = getLayerDirectories(nuxt);
|
|
154
|
+
layers.forEach((layer, i) => {
|
|
155
|
+
const dir = join(layer.app, "atelier-admin");
|
|
156
|
+
if (existsSync(dir))
|
|
157
|
+
addComponentsDir({ path: dir, prefix: "AtelierAdmin", global: true, priority: layers.length - i });
|
|
158
|
+
});
|
|
159
|
+
extendPages((pages2) => {
|
|
160
|
+
const taken = pages2.filter((p) => p.path === base || p.path.startsWith(`${base}/`)).map((p) => p.path);
|
|
161
|
+
if (taken.length)
|
|
162
|
+
console.warn(`[@nuxt-atelier/admin] The admin is at ${base}, where the app has pages too (${taken.join(", ")}). Move the admin elsewhere with \`atelier: { admin: { base: '/studio' } }\` in nuxt.config.`);
|
|
163
|
+
pages2.push({ name: "atelier-admin", path: `${base}/:path(.*)*`, file: resolve("./runtime/pages/AdminPage.vue"), meta: { layout: false, atelier: "admin" } });
|
|
164
|
+
});
|
|
165
|
+
addImports([
|
|
166
|
+
"useAtelierAdmin",
|
|
167
|
+
"useAtelierSession",
|
|
168
|
+
"useAtelierAdminSchema",
|
|
169
|
+
"useAtelierPermissions",
|
|
170
|
+
"useAtelierNavigation",
|
|
171
|
+
"useAtelierCollection",
|
|
172
|
+
"useAtelierEntryForm",
|
|
173
|
+
"useAtelierUsers",
|
|
174
|
+
"useAtelierRoles",
|
|
175
|
+
"useAtelierAdminPortal",
|
|
176
|
+
"useAtelierDashboard",
|
|
177
|
+
"useAtelierSetting",
|
|
178
|
+
"useAtelierGlobalSearch",
|
|
179
|
+
"useAtelierRealtime",
|
|
180
|
+
"useAtelierPresence",
|
|
181
|
+
"useAtelierComments",
|
|
182
|
+
"useAtelierNotifications"
|
|
183
|
+
].map((name) => ({ name, from: resolve(`./runtime/composables/${name}`) })));
|
|
184
|
+
addImports({ name: "useAdminI18n", from: resolve("./runtime/i18n") });
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export { ICONS, module$1 as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./crystal-neuo/css/crystal-neuo.css";@import "./css/shell.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ai: null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ai = null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Density, Material, Platform, ThemePreference } from './crystal-neuo/runtime/axes.js';
|
|
2
|
+
export type NavMode = 'sidebar' | 'top';
|
|
3
|
+
export type SidebarStyle = 'expanded' | 'rail' | 'floating';
|
|
4
|
+
export type ContentWidth = 'contained' | 'full';
|
|
5
|
+
export interface Appearance {
|
|
6
|
+
material: Material;
|
|
7
|
+
theme: ThemePreference;
|
|
8
|
+
density: Density;
|
|
9
|
+
platform: Platform;
|
|
10
|
+
/** Glass blurs what is behind it. */
|
|
11
|
+
frost: boolean;
|
|
12
|
+
/** Specular rim light on glass. */
|
|
13
|
+
rim: boolean;
|
|
14
|
+
/** Live refraction at glass rims, where the browser supports it. */
|
|
15
|
+
refraction: boolean;
|
|
16
|
+
/** Opaque surfaces even when the OS doesn't ask for it. */
|
|
17
|
+
reduceTransparency: boolean;
|
|
18
|
+
nav: NavMode;
|
|
19
|
+
sidebar: SidebarStyle;
|
|
20
|
+
width: ContentWidth;
|
|
21
|
+
}
|
|
22
|
+
/** The attributes crystal-neuo reads, for the admin's root element. */
|
|
23
|
+
export declare function appearanceAttrs(a: Appearance, systemDark: boolean): Record<string, string | undefined>;
|
|
24
|
+
/** The app's default appearance (app config), used until the viewer picks their own, and on reset. */
|
|
25
|
+
export declare function setDefaultAppearance(defaults: Partial<Appearance>): void;
|
|
26
|
+
export declare function useAppearance(): {
|
|
27
|
+
appearance: Readonly<import("vue").Ref<{
|
|
28
|
+
readonly material: Material;
|
|
29
|
+
readonly theme: ThemePreference;
|
|
30
|
+
readonly density: Density;
|
|
31
|
+
readonly platform: Platform;
|
|
32
|
+
readonly frost: boolean;
|
|
33
|
+
readonly rim: boolean;
|
|
34
|
+
readonly refraction: boolean;
|
|
35
|
+
readonly reduceTransparency: boolean;
|
|
36
|
+
readonly nav: NavMode;
|
|
37
|
+
readonly sidebar: SidebarStyle;
|
|
38
|
+
readonly width: ContentWidth;
|
|
39
|
+
}, {
|
|
40
|
+
readonly material: Material;
|
|
41
|
+
readonly theme: ThemePreference;
|
|
42
|
+
readonly density: Density;
|
|
43
|
+
readonly platform: Platform;
|
|
44
|
+
readonly frost: boolean;
|
|
45
|
+
readonly rim: boolean;
|
|
46
|
+
readonly refraction: boolean;
|
|
47
|
+
readonly reduceTransparency: boolean;
|
|
48
|
+
readonly nav: NavMode;
|
|
49
|
+
readonly sidebar: SidebarStyle;
|
|
50
|
+
readonly width: ContentWidth;
|
|
51
|
+
}>>;
|
|
52
|
+
set: (patch: Partial<Appearance>) => void;
|
|
53
|
+
reset: () => void;
|
|
54
|
+
/** Use the platform proportions of the device in hand. */
|
|
55
|
+
matchDevice: () => void;
|
|
56
|
+
isGlass: import("vue").ComputedRef<boolean>;
|
|
57
|
+
modalOpen: import("vue").Ref<boolean, boolean>;
|
|
58
|
+
openModal: () => boolean;
|
|
59
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { computed, readonly, ref } from "vue";
|
|
2
|
+
import { DEFAULT_DENSITY, DEFAULT_MATERIAL, DEFAULT_PLATFORM, DENSITIES, GLASS_MATERIALS, MATERIALS, PLATFORMS, THEMES } from "./crystal-neuo/runtime/axes.js";
|
|
3
|
+
import { detectPlatform } from "./crystal-neuo/runtime/platform.js";
|
|
4
|
+
const NAV_MODES = ["sidebar", "top"];
|
|
5
|
+
const SIDEBAR_STYLES = ["expanded", "rail", "floating"];
|
|
6
|
+
const CONTENT_WIDTHS = ["contained", "full"];
|
|
7
|
+
const THEME_PREFERENCES = ["system", ...THEMES];
|
|
8
|
+
const DEFAULT_APPEARANCE = Object.freeze({
|
|
9
|
+
material: DEFAULT_MATERIAL,
|
|
10
|
+
theme: "system",
|
|
11
|
+
density: DEFAULT_DENSITY,
|
|
12
|
+
platform: DEFAULT_PLATFORM,
|
|
13
|
+
frost: true,
|
|
14
|
+
rim: true,
|
|
15
|
+
refraction: false,
|
|
16
|
+
reduceTransparency: false,
|
|
17
|
+
nav: "sidebar",
|
|
18
|
+
sidebar: "floating",
|
|
19
|
+
width: "contained"
|
|
20
|
+
});
|
|
21
|
+
const pick = (v, allowed, fallback) => typeof v === "string" && allowed.includes(v) ? v : fallback;
|
|
22
|
+
const flag = (v, fallback) => typeof v === "boolean" ? v : fallback;
|
|
23
|
+
function parseAppearance(raw) {
|
|
24
|
+
let v = raw;
|
|
25
|
+
if (typeof v === "string") {
|
|
26
|
+
try {
|
|
27
|
+
v = JSON.parse(v);
|
|
28
|
+
} catch {
|
|
29
|
+
v = null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const o = v && typeof v === "object" ? v : {};
|
|
33
|
+
const d = DEFAULT_APPEARANCE;
|
|
34
|
+
return {
|
|
35
|
+
material: pick(o.material, MATERIALS, d.material),
|
|
36
|
+
theme: pick(o.theme, THEME_PREFERENCES, d.theme),
|
|
37
|
+
density: pick(o.density, DENSITIES, d.density),
|
|
38
|
+
platform: pick(o.platform, PLATFORMS, d.platform),
|
|
39
|
+
frost: flag(o.frost, d.frost),
|
|
40
|
+
rim: flag(o.rim, d.rim),
|
|
41
|
+
refraction: flag(o.refraction, d.refraction),
|
|
42
|
+
reduceTransparency: flag(o.reduceTransparency, d.reduceTransparency),
|
|
43
|
+
nav: pick(o.nav, NAV_MODES, d.nav),
|
|
44
|
+
sidebar: pick(o.sidebar, SIDEBAR_STYLES, d.sidebar),
|
|
45
|
+
width: pick(o.width, CONTENT_WIDTHS, d.width)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function appearanceAttrs(a, systemDark) {
|
|
49
|
+
return {
|
|
50
|
+
"data-theme": a.theme === "system" ? systemDark ? "dark" : "light" : a.theme,
|
|
51
|
+
"data-theme-preference": a.theme,
|
|
52
|
+
"data-material": a.material,
|
|
53
|
+
"data-density": a.density,
|
|
54
|
+
"data-platform": a.platform,
|
|
55
|
+
"data-glass-frost": a.frost ? void 0 : "off",
|
|
56
|
+
"data-glass-rim": a.rim ? void 0 : "off",
|
|
57
|
+
"data-refraction": a.refraction ? "on" : "off",
|
|
58
|
+
"data-transparency": a.reduceTransparency ? "reduced" : void 0
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const STORAGE = "atelier-admin-appearance";
|
|
62
|
+
function load() {
|
|
63
|
+
try {
|
|
64
|
+
return parseAppearance(localStorage.getItem(STORAGE));
|
|
65
|
+
} catch {
|
|
66
|
+
return { ...DEFAULT_APPEARANCE };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const state = ref(load());
|
|
70
|
+
let chosen = (() => {
|
|
71
|
+
try {
|
|
72
|
+
return localStorage.getItem(STORAGE) !== null;
|
|
73
|
+
} catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
})();
|
|
77
|
+
let appDefaults = { ...DEFAULT_APPEARANCE };
|
|
78
|
+
export function setDefaultAppearance(defaults) {
|
|
79
|
+
appDefaults = parseAppearance({ ...DEFAULT_APPEARANCE, ...defaults });
|
|
80
|
+
if (!chosen)
|
|
81
|
+
state.value = { ...appDefaults };
|
|
82
|
+
}
|
|
83
|
+
const modalOpen = ref(false);
|
|
84
|
+
export function useAppearance() {
|
|
85
|
+
function set(patch) {
|
|
86
|
+
state.value = parseAppearance({ ...state.value, ...patch });
|
|
87
|
+
chosen = true;
|
|
88
|
+
try {
|
|
89
|
+
localStorage.setItem(STORAGE, JSON.stringify(state.value));
|
|
90
|
+
} catch {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function reset() {
|
|
94
|
+
state.value = { ...appDefaults };
|
|
95
|
+
chosen = false;
|
|
96
|
+
try {
|
|
97
|
+
localStorage.removeItem(STORAGE);
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
appearance: readonly(state),
|
|
103
|
+
set,
|
|
104
|
+
reset,
|
|
105
|
+
/** Use the platform proportions of the device in hand. */
|
|
106
|
+
matchDevice: () => set({ platform: detectPlatform() }),
|
|
107
|
+
isGlass: computed(() => GLASS_MATERIALS.includes(state.value.material)),
|
|
108
|
+
modalOpen,
|
|
109
|
+
openModal: () => modalOpen.value = true
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Appearance } from './appearance.js';
|
|
2
|
+
export declare function useBranding(): import("vue").ComputedRef<{
|
|
3
|
+
name: string;
|
|
4
|
+
logo: string | undefined;
|
|
5
|
+
favicon: string | undefined;
|
|
6
|
+
tokens: {
|
|
7
|
+
[k: string]: string;
|
|
8
|
+
};
|
|
9
|
+
appearance: Partial<Appearance>;
|
|
10
|
+
language: string | undefined;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useAppConfig } from "#imports";
|
|
3
|
+
export function useBranding() {
|
|
4
|
+
const config = useAppConfig();
|
|
5
|
+
return computed(() => ({
|
|
6
|
+
name: config.atelierAdmin?.name ?? "Nuxt Atelier",
|
|
7
|
+
logo: config.atelierAdmin?.logo,
|
|
8
|
+
favicon: config.atelierAdmin?.favicon,
|
|
9
|
+
// custom properties only: a token can't smuggle in other declarations
|
|
10
|
+
tokens: Object.fromEntries(Object.entries(config.atelierAdmin?.tokens ?? {}).filter(([key, value]) => /^--[\w-]+$/.test(key) && !/[;{}]/.test(value))),
|
|
11
|
+
appearance: config.atelierAdmin?.appearance ?? {},
|
|
12
|
+
language: config.atelierAdmin?.language
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
root: HTMLElement;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: 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>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, defineAsyncComponent, onBeforeUnmount, ref, watch } from "vue";
|
|
3
|
+
import customPages from "#atelier-admin-pages";
|
|
4
|
+
import { useHead, useRoute } from "#imports";
|
|
5
|
+
import { appearanceAttrs, setDefaultAppearance, useAppearance } from "../appearance";
|
|
6
|
+
import { useBranding } from "../branding";
|
|
7
|
+
import { useAtelierAdminSchema } from "../composables/useAtelierAdminSchema";
|
|
8
|
+
import { allowed } from "../composables/useAtelierNavigation";
|
|
9
|
+
import { useAtelierSession } from "../composables/useAtelierSession";
|
|
10
|
+
import { startLanguage, useAdminI18n } from "../i18n";
|
|
11
|
+
import { useOverrides } from "../overrides";
|
|
12
|
+
import AppearanceModal from "./AppearanceModal.vue";
|
|
13
|
+
import AuthFrame from "./AuthFrame.vue";
|
|
14
|
+
import CollectionList from "./CollectionList.vue";
|
|
15
|
+
import EntryEdit from "./EntryEdit.vue";
|
|
16
|
+
import Home from "./Home.vue";
|
|
17
|
+
import Icon from "./Icon";
|
|
18
|
+
import MediaLibrary from "./MediaLibrary.vue";
|
|
19
|
+
import NotFound from "./NotFound.vue";
|
|
20
|
+
import RobotsSettings from "./RobotsSettings.vue";
|
|
21
|
+
import RoleEdit from "./RoleEdit.vue";
|
|
22
|
+
import Roles from "./Roles.vue";
|
|
23
|
+
import Setup from "./Setup.vue";
|
|
24
|
+
import Shell from "./Shell.vue";
|
|
25
|
+
import SignIn from "./SignIn.vue";
|
|
26
|
+
import Toaster from "./Toaster.vue";
|
|
27
|
+
import Users from "./Users.vue";
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
root: { type: null, required: true }
|
|
30
|
+
});
|
|
31
|
+
const { t } = useAdminI18n();
|
|
32
|
+
const view = useOverrides();
|
|
33
|
+
const views = {
|
|
34
|
+
Home: view("Home", Home),
|
|
35
|
+
CollectionList: view("CollectionList", CollectionList),
|
|
36
|
+
EntryEdit: view("EntryEdit", EntryEdit),
|
|
37
|
+
Users: view("Users", Users),
|
|
38
|
+
Roles: view("Roles", Roles),
|
|
39
|
+
RoleEdit: view("RoleEdit", RoleEdit),
|
|
40
|
+
RobotsSettings: view("RobotsSettings", RobotsSettings),
|
|
41
|
+
MediaLibrary: view("MediaLibrary", MediaLibrary),
|
|
42
|
+
SignIn: view("SignIn", SignIn),
|
|
43
|
+
Setup: view("Setup", Setup),
|
|
44
|
+
NotFound: view("NotFound", NotFound)
|
|
45
|
+
};
|
|
46
|
+
const branding = useBranding();
|
|
47
|
+
setDefaultAppearance(branding.value.appearance);
|
|
48
|
+
const languageReady = ref(false);
|
|
49
|
+
void startLanguage(branding.value.language).finally(() => languageReady.value = true);
|
|
50
|
+
const { appearance } = useAppearance();
|
|
51
|
+
const media = matchMedia("(prefers-color-scheme: dark)");
|
|
52
|
+
const systemDark = ref(media.matches);
|
|
53
|
+
const onChange = (e) => systemDark.value = e.matches;
|
|
54
|
+
media.addEventListener("change", onChange);
|
|
55
|
+
onBeforeUnmount(() => media.removeEventListener("change", onChange));
|
|
56
|
+
const attrs = computed(() => appearanceAttrs(appearance.value, systemDark.value));
|
|
57
|
+
function apply() {
|
|
58
|
+
for (const [name, value] of Object.entries(attrs.value)) {
|
|
59
|
+
if (value === void 0)
|
|
60
|
+
props.root.removeAttribute(name);
|
|
61
|
+
else
|
|
62
|
+
props.root.setAttribute(name, value);
|
|
63
|
+
}
|
|
64
|
+
for (const [name, value] of Object.entries(branding.value.tokens))
|
|
65
|
+
props.root.style.setProperty(name, value);
|
|
66
|
+
}
|
|
67
|
+
apply();
|
|
68
|
+
watch([attrs, branding], apply);
|
|
69
|
+
useHead(() => ({
|
|
70
|
+
title: branding.value.name,
|
|
71
|
+
link: branding.value.favicon ? [{ rel: "icon", href: branding.value.favicon, key: "atelier-admin-favicon" }] : []
|
|
72
|
+
}));
|
|
73
|
+
const route = useRoute();
|
|
74
|
+
const segments = computed(() => [route.params.path].flat().filter((s) => !!s));
|
|
75
|
+
const session = useAtelierSession();
|
|
76
|
+
const { schema } = useAtelierAdminSchema();
|
|
77
|
+
const page = computed(() => customPages.find((p) => p.path === segments.value.join("/")));
|
|
78
|
+
const pageComponent = computed(() => page.value && defineAsyncComponent(page.value.component));
|
|
79
|
+
const pageAllowed = computed(() => !!page.value && !!schema.value && allowed(page.value.requires, schema.value.capabilities));
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<div
|
|
84
|
+
v-if="session.loading.value || !languageReady"
|
|
85
|
+
class="app-loading"
|
|
86
|
+
role="status"
|
|
87
|
+
>
|
|
88
|
+
<Icon name="loader-circle" />
|
|
89
|
+
<span class="sr-only">{{ t("common.loading") }}</span>
|
|
90
|
+
</div>
|
|
91
|
+
<AuthFrame v-else-if="session.setupNeeded.value || !session.user.value">
|
|
92
|
+
<component
|
|
93
|
+
:is="views.Setup"
|
|
94
|
+
v-if="session.setupNeeded.value"
|
|
95
|
+
/>
|
|
96
|
+
<component
|
|
97
|
+
:is="views.SignIn"
|
|
98
|
+
v-else
|
|
99
|
+
/>
|
|
100
|
+
</AuthFrame>
|
|
101
|
+
<Shell v-else>
|
|
102
|
+
<component
|
|
103
|
+
:is="views.Home"
|
|
104
|
+
v-if="!segments.length"
|
|
105
|
+
/>
|
|
106
|
+
<template v-else-if="page">
|
|
107
|
+
<component
|
|
108
|
+
:is="pageComponent"
|
|
109
|
+
v-if="pageAllowed"
|
|
110
|
+
:key="page.path"
|
|
111
|
+
/>
|
|
112
|
+
<component
|
|
113
|
+
:is="views.NotFound"
|
|
114
|
+
v-else-if="schema"
|
|
115
|
+
forbidden
|
|
116
|
+
/>
|
|
117
|
+
</template>
|
|
118
|
+
<component
|
|
119
|
+
:is="views.CollectionList"
|
|
120
|
+
v-else-if="segments[0] === 'collections' && segments.length === 2"
|
|
121
|
+
:key="segments[1]"
|
|
122
|
+
:name="segments[1]"
|
|
123
|
+
/>
|
|
124
|
+
<component
|
|
125
|
+
:is="views.EntryEdit"
|
|
126
|
+
v-else-if="segments[0] === 'collections' && segments.length === 3"
|
|
127
|
+
:id="segments[2] === 'new' ? void 0 : segments[2]"
|
|
128
|
+
:key="segments.join('/')"
|
|
129
|
+
:locale="typeof route.query.locale === 'string' ? route.query.locale : void 0"
|
|
130
|
+
kind="collection"
|
|
131
|
+
:name="segments[1]"
|
|
132
|
+
/>
|
|
133
|
+
<component
|
|
134
|
+
:is="views.EntryEdit"
|
|
135
|
+
v-else-if="segments[0] === 'singletons' && segments.length === 2"
|
|
136
|
+
:key="`${segments[1]}:${route.query.locale ?? ''}`"
|
|
137
|
+
:locale="typeof route.query.locale === 'string' ? route.query.locale : void 0"
|
|
138
|
+
kind="singleton"
|
|
139
|
+
:name="segments[1]"
|
|
140
|
+
/>
|
|
141
|
+
<component
|
|
142
|
+
:is="views.Users"
|
|
143
|
+
v-else-if="segments[0] === 'users' && segments.length === 1"
|
|
144
|
+
/>
|
|
145
|
+
<component
|
|
146
|
+
:is="views.Roles"
|
|
147
|
+
v-else-if="segments[0] === 'roles' && segments.length === 1"
|
|
148
|
+
/>
|
|
149
|
+
<component
|
|
150
|
+
:is="views.RoleEdit"
|
|
151
|
+
v-else-if="segments[0] === 'roles' && segments.length === 2"
|
|
152
|
+
:key="segments[1]"
|
|
153
|
+
:name="segments[1] === 'new' ? void 0 : segments[1]"
|
|
154
|
+
/>
|
|
155
|
+
<component
|
|
156
|
+
:is="views.MediaLibrary"
|
|
157
|
+
v-else-if="segments[0] === 'media' && segments.length === 1"
|
|
158
|
+
/>
|
|
159
|
+
<component
|
|
160
|
+
:is="views.RobotsSettings"
|
|
161
|
+
v-else-if="segments.join('/') === 'settings/robots'"
|
|
162
|
+
/>
|
|
163
|
+
<component
|
|
164
|
+
:is="views.NotFound"
|
|
165
|
+
v-else
|
|
166
|
+
/>
|
|
167
|
+
</Shell>
|
|
168
|
+
<AppearanceModal />
|
|
169
|
+
<Toaster />
|
|
170
|
+
</template>
|