@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,86 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { useAtelierEntryForm } from "../composables/useAtelierEntryForm";
|
|
4
|
+
import { singularLabel } from "../composables/useAtelierNavigation";
|
|
5
|
+
import CnAlert from "../crystal-neuo/components/Alert.vue";
|
|
6
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
7
|
+
import CnModal from "../crystal-neuo/components/Modal.vue";
|
|
8
|
+
import FieldInput from "./FieldInput.vue";
|
|
9
|
+
import { useAdminI18n } from "../i18n";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
collection: { type: String, required: true }
|
|
12
|
+
});
|
|
13
|
+
const { t } = useAdminI18n();
|
|
14
|
+
const emit = defineEmits(["created"]);
|
|
15
|
+
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
16
|
+
const edit = useAtelierEntryForm(() => ({ kind: "collection", name: props.collection }));
|
|
17
|
+
const { type, form } = edit;
|
|
18
|
+
const values = form.useStore((s) => s.values);
|
|
19
|
+
const error = ref("");
|
|
20
|
+
const singular = computed(() => singularLabel(type.value ?? { name: props.collection }));
|
|
21
|
+
async function create() {
|
|
22
|
+
error.value = "";
|
|
23
|
+
try {
|
|
24
|
+
await edit.submit();
|
|
25
|
+
} catch (e) {
|
|
26
|
+
error.value = e.message;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!form.state.isSubmitSuccessful || !edit.save.data.value)
|
|
30
|
+
return;
|
|
31
|
+
emit("created", edit.save.data.value.id);
|
|
32
|
+
form.reset();
|
|
33
|
+
open.value = false;
|
|
34
|
+
}
|
|
35
|
+
function cancel() {
|
|
36
|
+
edit.discardRecovery();
|
|
37
|
+
form.reset();
|
|
38
|
+
open.value = false;
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<CnModal
|
|
44
|
+
v-model:open="open"
|
|
45
|
+
:title="t('field.newRelated', { name: singular.toLowerCase() })"
|
|
46
|
+
size="lg"
|
|
47
|
+
>
|
|
48
|
+
<!-- not a <form>: this sits inside the entry's own form -->
|
|
49
|
+
<div
|
|
50
|
+
v-if="type"
|
|
51
|
+
class="app-form"
|
|
52
|
+
@keydown.enter.prevent
|
|
53
|
+
>
|
|
54
|
+
<FieldInput
|
|
55
|
+
v-for="(field, key) in type.fields"
|
|
56
|
+
:key="key"
|
|
57
|
+
:form="form"
|
|
58
|
+
:name="String(key)"
|
|
59
|
+
:field="field"
|
|
60
|
+
:root="values"
|
|
61
|
+
:sibling="values"
|
|
62
|
+
/>
|
|
63
|
+
<CnAlert
|
|
64
|
+
v-if="error"
|
|
65
|
+
variant="danger"
|
|
66
|
+
live
|
|
67
|
+
>
|
|
68
|
+
{{ error }}
|
|
69
|
+
</CnAlert>
|
|
70
|
+
<div class="cn-modal__actions">
|
|
71
|
+
<CnButton
|
|
72
|
+
variant="ghost"
|
|
73
|
+
@click="cancel"
|
|
74
|
+
>
|
|
75
|
+
{{ t("common.cancel") }}
|
|
76
|
+
</CnButton>
|
|
77
|
+
<CnButton
|
|
78
|
+
:loading="edit.save.isPending.value"
|
|
79
|
+
@click="create"
|
|
80
|
+
>
|
|
81
|
+
{{ t("field.createRelated", { name: singular.toLowerCase() }) }}
|
|
82
|
+
</CnButton>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</CnModal>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
collection: string;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
'open'?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
created: (id: string) => any;
|
|
10
|
+
"update:open": (value: boolean) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
+
onCreated?: ((id: string) => any) | undefined;
|
|
13
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The entry's API path (`/collections/posts/<id>`, `/singletons/home`), and its locale query. */
|
|
3
|
+
url: string;
|
|
4
|
+
query: Record<string, string>;
|
|
5
|
+
/** The version being edited: a restore saves over it. */
|
|
6
|
+
version: number | null;
|
|
7
|
+
/** Restoring needs the right to save, and no unsaved changes to lose. */
|
|
8
|
+
canRestore: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
restored: () => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onRestored?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useQuery } from "@tanstack/vue-query";
|
|
3
|
+
import { computed, ref, watch } from "vue";
|
|
4
|
+
import { diffEntries } from "#atelier/shared/diff";
|
|
5
|
+
import { atelierFetch } from "../composables/useAtelierAdmin";
|
|
6
|
+
import CnBadge from "../crystal-neuo/components/Badge.vue";
|
|
7
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
8
|
+
import CnCheckbox from "../crystal-neuo/components/Checkbox.vue";
|
|
9
|
+
import { useAdminToast } from "../toast";
|
|
10
|
+
import { useAdminI18n } from "../i18n";
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
url: { type: String, required: true },
|
|
13
|
+
query: { type: Object, required: true },
|
|
14
|
+
version: { type: [Number, null], required: true },
|
|
15
|
+
canRestore: { type: Boolean, required: true }
|
|
16
|
+
});
|
|
17
|
+
const emit = defineEmits(["restored"]);
|
|
18
|
+
const { t } = useAdminI18n();
|
|
19
|
+
const toast = useAdminToast();
|
|
20
|
+
const open = ref(false);
|
|
21
|
+
const history = useQuery({
|
|
22
|
+
queryKey: computed(() => ["atelier", "revisions", props.url, props.query]),
|
|
23
|
+
queryFn: () => atelierFetch(`${props.url}/revisions`, { query: props.query }),
|
|
24
|
+
enabled: open
|
|
25
|
+
});
|
|
26
|
+
watch(() => props.version, () => open.value && history.refetch());
|
|
27
|
+
const time = (at) => new Date(at).toLocaleString();
|
|
28
|
+
const picked = ref([]);
|
|
29
|
+
function pick(version, on) {
|
|
30
|
+
picked.value = on ? [...picked.value.filter((v) => v !== version), version].slice(-2) : picked.value.filter((v) => v !== version);
|
|
31
|
+
}
|
|
32
|
+
const changes = ref(null);
|
|
33
|
+
watch(picked, async (versions) => {
|
|
34
|
+
changes.value = null;
|
|
35
|
+
if (versions.length !== 2)
|
|
36
|
+
return;
|
|
37
|
+
const [older, newer] = versions.toSorted((a, b) => a - b);
|
|
38
|
+
const load = (v) => atelierFetch(`${props.url}/revisions/${v}`, { query: props.query });
|
|
39
|
+
const [before, after] = await Promise.all([load(older), load(newer)]);
|
|
40
|
+
changes.value = diffEntries(before.data, after.data);
|
|
41
|
+
});
|
|
42
|
+
const short = (value) => {
|
|
43
|
+
const text = typeof value === "string" ? value : JSON.stringify(value) ?? "\u2014";
|
|
44
|
+
return text.length > 60 ? `${text.slice(0, 57)}\u2026` : text;
|
|
45
|
+
};
|
|
46
|
+
function describe(change) {
|
|
47
|
+
switch (change.kind) {
|
|
48
|
+
case "field":
|
|
49
|
+
return t("history.field", { path: change.path, before: short(change.before), after: short(change.after) });
|
|
50
|
+
case "added":
|
|
51
|
+
return t("history.added", { type: change.type });
|
|
52
|
+
case "removed":
|
|
53
|
+
return t("history.removed", { type: change.type });
|
|
54
|
+
case "moved":
|
|
55
|
+
return t("history.moved", { type: change.type });
|
|
56
|
+
case "changed":
|
|
57
|
+
return t("history.changed", { type: change.type, prop: change.prop, before: short(change.before), after: short(change.after) });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const restoring = ref(null);
|
|
61
|
+
async function restore(version) {
|
|
62
|
+
restoring.value = version;
|
|
63
|
+
try {
|
|
64
|
+
await atelierFetch(`${props.url}/revisions/${version}/restore`, { method: "POST", query: props.query, body: { version: props.version } });
|
|
65
|
+
toast.add({ color: "success", title: t("history.restored", { version }) });
|
|
66
|
+
emit("restored");
|
|
67
|
+
} catch (e) {
|
|
68
|
+
toast.add({ color: "error", title: e.message });
|
|
69
|
+
} finally {
|
|
70
|
+
restoring.value = null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<details
|
|
77
|
+
class="app-comments"
|
|
78
|
+
data-history
|
|
79
|
+
@toggle="open = $event.target.open"
|
|
80
|
+
>
|
|
81
|
+
<summary class="app-section__title">
|
|
82
|
+
{{ t("history.title") }}
|
|
83
|
+
</summary>
|
|
84
|
+
<p v-if="history.data.value && !history.data.value.length">
|
|
85
|
+
{{ t("history.empty") }}
|
|
86
|
+
</p>
|
|
87
|
+
<ol
|
|
88
|
+
v-else
|
|
89
|
+
class="app-list"
|
|
90
|
+
>
|
|
91
|
+
<li
|
|
92
|
+
v-for="revision in history.data.value"
|
|
93
|
+
:key="revision.version"
|
|
94
|
+
class="app-row"
|
|
95
|
+
:data-revision="revision.version"
|
|
96
|
+
>
|
|
97
|
+
<CnCheckbox
|
|
98
|
+
:checked="picked.includes(revision.version)"
|
|
99
|
+
:label="t('history.version', { version: revision.version })"
|
|
100
|
+
@update:checked="pick(revision.version, $event)"
|
|
101
|
+
/>
|
|
102
|
+
<span class="app-muted">{{ revision.authorName ? t("history.by", { time: time(revision.createdAt), author: revision.authorName }) : time(revision.createdAt) }}</span>
|
|
103
|
+
<CnBadge
|
|
104
|
+
v-if="revision.published"
|
|
105
|
+
variant="success"
|
|
106
|
+
size="sm"
|
|
107
|
+
>
|
|
108
|
+
{{ t("status.published") }}
|
|
109
|
+
</CnBadge>
|
|
110
|
+
<CnButton
|
|
111
|
+
v-if="canRestore && revision.version !== version"
|
|
112
|
+
variant="ghost"
|
|
113
|
+
size="sm"
|
|
114
|
+
:loading="restoring === revision.version"
|
|
115
|
+
@click="restore(revision.version)"
|
|
116
|
+
>
|
|
117
|
+
{{ t("history.restore") }}
|
|
118
|
+
</CnButton>
|
|
119
|
+
</li>
|
|
120
|
+
</ol>
|
|
121
|
+
<p
|
|
122
|
+
v-if="history.data.value?.length && picked.length < 2"
|
|
123
|
+
class="app-muted"
|
|
124
|
+
>
|
|
125
|
+
{{ t("history.pick") }}
|
|
126
|
+
</p>
|
|
127
|
+
<section
|
|
128
|
+
v-if="changes"
|
|
129
|
+
data-changes
|
|
130
|
+
:aria-label="t('history.compared', { a: Math.min(...picked), b: Math.max(...picked) })"
|
|
131
|
+
>
|
|
132
|
+
<p v-if="!changes.length">
|
|
133
|
+
{{ t("history.same") }}
|
|
134
|
+
</p>
|
|
135
|
+
<ul v-else>
|
|
136
|
+
<li
|
|
137
|
+
v-for="(change, i) in changes"
|
|
138
|
+
:key="i"
|
|
139
|
+
>
|
|
140
|
+
{{ describe(change) }}
|
|
141
|
+
</li>
|
|
142
|
+
</ul>
|
|
143
|
+
</section>
|
|
144
|
+
</details>
|
|
145
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The entry's API path (`/collections/posts/<id>`, `/singletons/home`), and its locale query. */
|
|
3
|
+
url: string;
|
|
4
|
+
query: Record<string, string>;
|
|
5
|
+
/** The version being edited: a restore saves over it. */
|
|
6
|
+
version: number | null;
|
|
7
|
+
/** Restoring needs the right to save, and no unsaved changes to lose. */
|
|
8
|
+
canRestore: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
restored: () => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onRestored?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: JSONContent | null;
|
|
4
|
+
label: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (value: JSONContent | null) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((value: JSONContent | null) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
3
|
+
import { EditorContent, useEditor } from "@tiptap/vue-3";
|
|
4
|
+
import { computed, onBeforeUnmount, ref, useId, watch } from "vue";
|
|
5
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
6
|
+
import CnInput from "../crystal-neuo/components/Input.vue";
|
|
7
|
+
import CnModal from "../crystal-neuo/components/Modal.vue";
|
|
8
|
+
import { useAdminI18n } from "../i18n";
|
|
9
|
+
import Icon from "./Icon";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
modelValue: { type: [Object, null], required: false },
|
|
12
|
+
label: { type: String, required: true },
|
|
13
|
+
error: { type: String, required: false },
|
|
14
|
+
hint: { type: String, required: false },
|
|
15
|
+
disabled: { type: Boolean, required: false }
|
|
16
|
+
});
|
|
17
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
18
|
+
const { t } = useAdminI18n();
|
|
19
|
+
const labelId = useId();
|
|
20
|
+
const messageId = useId();
|
|
21
|
+
const editor = useEditor({
|
|
22
|
+
content: props.modelValue ?? "",
|
|
23
|
+
editable: !props.disabled,
|
|
24
|
+
extensions: [StarterKit.configure({
|
|
25
|
+
heading: { levels: [2, 3] },
|
|
26
|
+
link: { openOnClick: false, autolink: true, defaultProtocol: "https" }
|
|
27
|
+
})],
|
|
28
|
+
editorProps: {
|
|
29
|
+
attributes: {
|
|
30
|
+
"class": "app-richtext__content",
|
|
31
|
+
"role": "textbox",
|
|
32
|
+
"aria-multiline": "true",
|
|
33
|
+
"aria-labelledby": labelId
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
onUpdate: ({ editor: e }) => emit("update:modelValue", e.isEmpty ? null : e.getJSON())
|
|
37
|
+
});
|
|
38
|
+
onBeforeUnmount(() => editor.value?.destroy());
|
|
39
|
+
watch(() => props.modelValue, (value) => {
|
|
40
|
+
const e = editor.value;
|
|
41
|
+
if (e && JSON.stringify(value ?? null) !== JSON.stringify(e.isEmpty ? null : e.getJSON()))
|
|
42
|
+
e.commands.setContent(value ?? "", { emitUpdate: false });
|
|
43
|
+
});
|
|
44
|
+
watch(() => props.disabled, (disabled) => editor.value?.setEditable(!disabled));
|
|
45
|
+
const buttons = computed(() => [
|
|
46
|
+
{ key: "bold", icon: "bold", active: "bold", run: (e) => e.chain().focus().toggleBold().run() },
|
|
47
|
+
{ key: "italic", icon: "italic", active: "italic", run: (e) => e.chain().focus().toggleItalic().run() },
|
|
48
|
+
{ key: "underline", icon: "underline", active: "underline", run: (e) => e.chain().focus().toggleUnderline().run() },
|
|
49
|
+
{ key: "strike", icon: "strikethrough", active: "strike", run: (e) => e.chain().focus().toggleStrike().run() },
|
|
50
|
+
{ key: "code", icon: "code", active: "code", run: (e) => e.chain().focus().toggleCode().run() },
|
|
51
|
+
{ key: "h2", icon: "heading-2", active: ["heading", { level: 2 }], run: (e) => e.chain().focus().toggleHeading({ level: 2 }).run() },
|
|
52
|
+
{ key: "h3", icon: "heading-3", active: ["heading", { level: 3 }], run: (e) => e.chain().focus().toggleHeading({ level: 3 }).run() },
|
|
53
|
+
{ key: "bulletList", icon: "list", active: "bulletList", run: (e) => e.chain().focus().toggleBulletList().run() },
|
|
54
|
+
{ key: "orderedList", icon: "list-ordered", active: "orderedList", run: (e) => e.chain().focus().toggleOrderedList().run() },
|
|
55
|
+
{ key: "quote", icon: "quote", active: "blockquote", run: (e) => e.chain().focus().toggleBlockquote().run() },
|
|
56
|
+
{ key: "codeBlock", icon: "square-code", active: "codeBlock", run: (e) => e.chain().focus().toggleCodeBlock().run() }
|
|
57
|
+
]);
|
|
58
|
+
const isActive = (active) => !!active && !!editor.value && (Array.isArray(active) ? editor.value.isActive(active[0], active[1]) : editor.value.isActive(active));
|
|
59
|
+
const linking = ref(false);
|
|
60
|
+
const url = ref("");
|
|
61
|
+
function openLink() {
|
|
62
|
+
url.value = editor.value?.getAttributes("link").href ?? "";
|
|
63
|
+
linking.value = true;
|
|
64
|
+
}
|
|
65
|
+
function applyLink() {
|
|
66
|
+
const href = url.value.trim();
|
|
67
|
+
const chain = editor.value?.chain().focus().extendMarkRange("link");
|
|
68
|
+
if (href)
|
|
69
|
+
chain?.setLink({ href }).run();
|
|
70
|
+
else
|
|
71
|
+
chain?.unsetLink().run();
|
|
72
|
+
linking.value = false;
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<div
|
|
78
|
+
class="cn-field app-richtext"
|
|
79
|
+
data-rich-text
|
|
80
|
+
>
|
|
81
|
+
<span
|
|
82
|
+
:id="labelId"
|
|
83
|
+
class="cn-field__label"
|
|
84
|
+
>{{ label }}</span>
|
|
85
|
+
<div
|
|
86
|
+
v-if="editor && !disabled"
|
|
87
|
+
class="app-richtext__toolbar"
|
|
88
|
+
role="toolbar"
|
|
89
|
+
:aria-label="t('richText.toolbar')"
|
|
90
|
+
:aria-controls="labelId"
|
|
91
|
+
>
|
|
92
|
+
<button
|
|
93
|
+
v-for="b in buttons"
|
|
94
|
+
:key="b.key"
|
|
95
|
+
type="button"
|
|
96
|
+
class="app-icon-button"
|
|
97
|
+
:aria-label="t(`richText.${b.key}`)"
|
|
98
|
+
:aria-pressed="isActive(b.active)"
|
|
99
|
+
@mousedown.prevent
|
|
100
|
+
@click="b.run(editor)"
|
|
101
|
+
>
|
|
102
|
+
<Icon :name="b.icon" />
|
|
103
|
+
</button>
|
|
104
|
+
<button
|
|
105
|
+
type="button"
|
|
106
|
+
class="app-icon-button"
|
|
107
|
+
:aria-label="t('richText.link')"
|
|
108
|
+
:aria-pressed="editor.isActive('link')"
|
|
109
|
+
@mousedown.prevent
|
|
110
|
+
@click="openLink"
|
|
111
|
+
>
|
|
112
|
+
<Icon name="link" />
|
|
113
|
+
</button>
|
|
114
|
+
<button
|
|
115
|
+
v-if="editor.isActive('link')"
|
|
116
|
+
type="button"
|
|
117
|
+
class="app-icon-button"
|
|
118
|
+
:aria-label="t('richText.unlink')"
|
|
119
|
+
@mousedown.prevent
|
|
120
|
+
@click="editor.chain().focus().unsetLink().run()"
|
|
121
|
+
>
|
|
122
|
+
<Icon name="unlink" />
|
|
123
|
+
</button>
|
|
124
|
+
<button
|
|
125
|
+
type="button"
|
|
126
|
+
class="app-icon-button"
|
|
127
|
+
:aria-label="t('richText.undo')"
|
|
128
|
+
:disabled="!editor.can().undo()"
|
|
129
|
+
@mousedown.prevent
|
|
130
|
+
@click="editor.chain().focus().undo().run()"
|
|
131
|
+
>
|
|
132
|
+
<Icon name="undo-2" />
|
|
133
|
+
</button>
|
|
134
|
+
<button
|
|
135
|
+
type="button"
|
|
136
|
+
class="app-icon-button"
|
|
137
|
+
:aria-label="t('richText.redo')"
|
|
138
|
+
:disabled="!editor.can().redo()"
|
|
139
|
+
@mousedown.prevent
|
|
140
|
+
@click="editor.chain().focus().redo().run()"
|
|
141
|
+
>
|
|
142
|
+
<Icon name="redo-2" />
|
|
143
|
+
</button>
|
|
144
|
+
</div>
|
|
145
|
+
<EditorContent
|
|
146
|
+
:editor="editor"
|
|
147
|
+
class="app-richtext__editor"
|
|
148
|
+
:aria-describedby="error || hint ? messageId : void 0"
|
|
149
|
+
/>
|
|
150
|
+
<span
|
|
151
|
+
v-if="error"
|
|
152
|
+
:id="messageId"
|
|
153
|
+
class="cn-field__message"
|
|
154
|
+
role="alert"
|
|
155
|
+
>{{ error }}</span>
|
|
156
|
+
<span
|
|
157
|
+
v-else-if="hint"
|
|
158
|
+
:id="messageId"
|
|
159
|
+
class="cn-field__hint"
|
|
160
|
+
>{{ hint }}</span>
|
|
161
|
+
<CnModal
|
|
162
|
+
v-model:open="linking"
|
|
163
|
+
:title="t('richText.linkTitle')"
|
|
164
|
+
size="sm"
|
|
165
|
+
>
|
|
166
|
+
<div
|
|
167
|
+
class="app-form"
|
|
168
|
+
@keydown.enter.prevent="applyLink"
|
|
169
|
+
>
|
|
170
|
+
<CnInput
|
|
171
|
+
v-model="url"
|
|
172
|
+
:label="t('richText.url')"
|
|
173
|
+
:hint="t('richText.urlHint')"
|
|
174
|
+
type="url"
|
|
175
|
+
/>
|
|
176
|
+
<div class="cn-modal__actions">
|
|
177
|
+
<CnButton
|
|
178
|
+
variant="ghost"
|
|
179
|
+
@click="linking = false"
|
|
180
|
+
>
|
|
181
|
+
{{ t("common.cancel") }}
|
|
182
|
+
</CnButton>
|
|
183
|
+
<CnButton @click="applyLink">
|
|
184
|
+
{{ t("richText.apply") }}
|
|
185
|
+
</CnButton>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
</CnModal>
|
|
189
|
+
</div>
|
|
190
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: JSONContent | null;
|
|
4
|
+
label: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
hint?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (value: JSONContent | null) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:modelValue"?: ((value: JSONContent | null) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -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,173 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
import { useAtelierAdmin } from "../composables/useAtelierAdmin";
|
|
4
|
+
import { useAtelierPermissions } from "../composables/useAtelierPermissions";
|
|
5
|
+
import { useAtelierSetting } from "../composables/useAtelierSetting";
|
|
6
|
+
import CnAlert from "../crystal-neuo/components/Alert.vue";
|
|
7
|
+
import CnButton from "../crystal-neuo/components/Button.vue";
|
|
8
|
+
import CnTextarea from "../crystal-neuo/components/Textarea.vue";
|
|
9
|
+
import CnToggle from "../crystal-neuo/components/Toggle.vue";
|
|
10
|
+
import { useAdminI18n } from "../i18n";
|
|
11
|
+
import { useAdminToast } from "../toast";
|
|
12
|
+
import Icon from "./Icon";
|
|
13
|
+
import NotFound from "./NotFound.vue";
|
|
14
|
+
import Page from "./Page.vue";
|
|
15
|
+
const { t } = useAdminI18n();
|
|
16
|
+
const { base } = useAtelierAdmin();
|
|
17
|
+
const { manages } = useAtelierPermissions();
|
|
18
|
+
const { setting, save, reset } = useAtelierSetting("robots");
|
|
19
|
+
const toast = useAdminToast();
|
|
20
|
+
const error = ref("");
|
|
21
|
+
const lines = (list2) => list2.join("\n");
|
|
22
|
+
const list = (text) => text.split("\n").map((l) => l.trim()).filter(Boolean);
|
|
23
|
+
const indexable = ref(true);
|
|
24
|
+
const rules = ref([]);
|
|
25
|
+
watch(setting, (s) => {
|
|
26
|
+
if (!s)
|
|
27
|
+
return;
|
|
28
|
+
indexable.value = s.value.indexable;
|
|
29
|
+
rules.value = s.value.rules.map((r) => ({ userAgent: lines(r.userAgent), allow: lines(r.allow), disallow: lines(r.disallow) }));
|
|
30
|
+
}, { immediate: true });
|
|
31
|
+
const value = computed(() => ({
|
|
32
|
+
indexable: indexable.value,
|
|
33
|
+
rules: rules.value.map((r) => ({ userAgent: list(r.userAgent), allow: list(r.allow), disallow: list(r.disallow) })).filter((r) => r.userAgent.length)
|
|
34
|
+
}));
|
|
35
|
+
const preview = computed(() => [{ userAgent: ["*"], allow: [], disallow: [] }, ...value.value.rules].reduce((groups, r) => {
|
|
36
|
+
const same = groups.find((g) => g.userAgent.toSorted().join() === r.userAgent.toSorted().join());
|
|
37
|
+
if (same) {
|
|
38
|
+
same.allow.push(...r.allow);
|
|
39
|
+
same.disallow.push(...r.disallow);
|
|
40
|
+
} else {
|
|
41
|
+
groups.push({ userAgent: [...r.userAgent], allow: [...r.allow], disallow: [...r.disallow] });
|
|
42
|
+
}
|
|
43
|
+
return groups;
|
|
44
|
+
}, []).map((g) => [
|
|
45
|
+
...g.userAgent.map((ua) => `User-agent: ${ua}`),
|
|
46
|
+
...value.value.indexable ? [...new Set(g.allow)].map((p) => `Allow: ${p}`) : [],
|
|
47
|
+
...(value.value.indexable ? [.../* @__PURE__ */ new Set([base, "/api/_atelier/", ...g.disallow])] : ["/"]).map((p) => `Disallow: ${p}`)
|
|
48
|
+
].join("\n")).join("\n\n"));
|
|
49
|
+
async function submit() {
|
|
50
|
+
error.value = "";
|
|
51
|
+
try {
|
|
52
|
+
await save.mutateAsync(value.value);
|
|
53
|
+
toast.add({ color: "success", title: t("robots.saved") });
|
|
54
|
+
} catch (e) {
|
|
55
|
+
error.value = e.errors?.map((x) => `${x.path}: ${x.message}`).join(". ") || e.message;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<template>
|
|
61
|
+
<NotFound
|
|
62
|
+
v-if="!manages('settings')"
|
|
63
|
+
forbidden
|
|
64
|
+
/>
|
|
65
|
+
<Page
|
|
66
|
+
v-else
|
|
67
|
+
:title="t('robots.title')"
|
|
68
|
+
icon="search"
|
|
69
|
+
:description="t('robots.description')"
|
|
70
|
+
>
|
|
71
|
+
<p
|
|
72
|
+
v-if="setting"
|
|
73
|
+
class="app-muted"
|
|
74
|
+
data-robots-source
|
|
75
|
+
>
|
|
76
|
+
{{ t(`robots.source.${setting.source}`) }}
|
|
77
|
+
</p>
|
|
78
|
+
<form
|
|
79
|
+
class="app-form"
|
|
80
|
+
@submit.prevent="submit"
|
|
81
|
+
>
|
|
82
|
+
<CnToggle
|
|
83
|
+
v-model:checked="indexable"
|
|
84
|
+
:label="t('robots.indexable')"
|
|
85
|
+
/>
|
|
86
|
+
<p
|
|
87
|
+
v-if="!indexable"
|
|
88
|
+
class="app-muted"
|
|
89
|
+
>
|
|
90
|
+
{{ t("robots.notIndexable") }}
|
|
91
|
+
</p>
|
|
92
|
+
<fieldset
|
|
93
|
+
v-for="(rule, i) in rules"
|
|
94
|
+
:key="i"
|
|
95
|
+
class="app-fieldset"
|
|
96
|
+
>
|
|
97
|
+
<legend class="cn-label">
|
|
98
|
+
{{ t("robots.rules") }} {{ i + 1 }}
|
|
99
|
+
</legend>
|
|
100
|
+
<CnTextarea
|
|
101
|
+
v-model="rule.userAgent"
|
|
102
|
+
:label="t('robots.userAgent')"
|
|
103
|
+
:hint="t('robots.userAgentHint')"
|
|
104
|
+
:rows="2"
|
|
105
|
+
/>
|
|
106
|
+
<CnTextarea
|
|
107
|
+
v-model="rule.disallow"
|
|
108
|
+
:label="t('robots.disallow')"
|
|
109
|
+
:hint="t('robots.pathsHint')"
|
|
110
|
+
:rows="3"
|
|
111
|
+
/>
|
|
112
|
+
<CnTextarea
|
|
113
|
+
v-model="rule.allow"
|
|
114
|
+
:label="t('robots.allow')"
|
|
115
|
+
:hint="t('robots.pathsHint')"
|
|
116
|
+
:rows="2"
|
|
117
|
+
/>
|
|
118
|
+
<div>
|
|
119
|
+
<CnButton
|
|
120
|
+
variant="ghost"
|
|
121
|
+
size="sm"
|
|
122
|
+
@click="rules.splice(i, 1)"
|
|
123
|
+
>
|
|
124
|
+
<Icon name="trash-2" />
|
|
125
|
+
{{ t("robots.removeRule") }}
|
|
126
|
+
</CnButton>
|
|
127
|
+
</div>
|
|
128
|
+
</fieldset>
|
|
129
|
+
<div>
|
|
130
|
+
<CnButton
|
|
131
|
+
variant="secondary"
|
|
132
|
+
size="sm"
|
|
133
|
+
@click="rules.push({ userAgent: '*', allow: '', disallow: '' })"
|
|
134
|
+
>
|
|
135
|
+
<Icon name="plus" />
|
|
136
|
+
{{ t("robots.addRule") }}
|
|
137
|
+
</CnButton>
|
|
138
|
+
</div>
|
|
139
|
+
<section class="app-section">
|
|
140
|
+
<h2 class="app-section__title">
|
|
141
|
+
{{ t("robots.preview") }}
|
|
142
|
+
</h2>
|
|
143
|
+
<pre
|
|
144
|
+
class="app-mono"
|
|
145
|
+
data-robots-preview
|
|
146
|
+
>{{ preview }}</pre>
|
|
147
|
+
</section>
|
|
148
|
+
<CnAlert
|
|
149
|
+
v-if="error"
|
|
150
|
+
variant="danger"
|
|
151
|
+
live
|
|
152
|
+
>
|
|
153
|
+
{{ error }}
|
|
154
|
+
</CnAlert>
|
|
155
|
+
<div class="app-form__actions">
|
|
156
|
+
<CnButton
|
|
157
|
+
v-if="setting?.source === 'database'"
|
|
158
|
+
variant="ghost"
|
|
159
|
+
:loading="reset.isPending.value"
|
|
160
|
+
@click="reset.mutate()"
|
|
161
|
+
>
|
|
162
|
+
{{ t("robots.reset") }}
|
|
163
|
+
</CnButton>
|
|
164
|
+
<CnButton
|
|
165
|
+
type="submit"
|
|
166
|
+
:loading="save.isPending.value"
|
|
167
|
+
>
|
|
168
|
+
{{ t("common.save") }}
|
|
169
|
+
</CnButton>
|
|
170
|
+
</div>
|
|
171
|
+
</form>
|
|
172
|
+
</Page>
|
|
173
|
+
</template>
|