katecms 0.0.0-stage → 1.0.0-beta.1
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/README.md +5 -3
- package/dist/module.d.mts +93 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +579 -0
- package/dist/runtime/assets/img/katecms-logo.svg +17 -0
- package/dist/runtime/composables/getCollection.d.ts +62 -0
- package/dist/runtime/composables/getCollection.js +167 -0
- package/dist/runtime/composables/getOptions.d.ts +22 -0
- package/dist/runtime/composables/getOptions.js +22 -0
- package/dist/runtime/composables/getQueryCollection.d.ts +95 -0
- package/dist/runtime/composables/getQueryCollection.js +199 -0
- package/dist/runtime/composables/getTerms.d.ts +79 -0
- package/dist/runtime/composables/getTerms.js +148 -0
- package/dist/runtime/composables/useAuth.d.ts +14 -0
- package/dist/runtime/composables/useAuth.js +33 -0
- package/dist/runtime/composables/useAuthCooldown.d.ts +6 -0
- package/dist/runtime/composables/useAuthCooldown.js +44 -0
- package/dist/runtime/composables/useCmsPaths.d.ts +15 -0
- package/dist/runtime/composables/useCmsPaths.js +21 -0
- package/dist/runtime/composables/useKateCmsExtensions.d.ts +49 -0
- package/dist/runtime/composables/useKateCmsExtensions.js +29 -0
- package/dist/runtime/composables/useMediaLibrary.d.ts +84 -0
- package/dist/runtime/composables/useMediaLibrary.js +140 -0
- package/dist/runtime/composables/useMenuAccess.d.ts +8 -0
- package/dist/runtime/composables/useMenuAccess.js +16 -0
- package/dist/runtime/internal/admin/AdminHeader.d.vue.ts +24 -0
- package/dist/runtime/internal/admin/AdminHeader.vue +91 -0
- package/dist/runtime/internal/admin/AdminHeader.vue.d.ts +24 -0
- package/dist/runtime/internal/admin/AppMenu.d.vue.ts +3 -0
- package/dist/runtime/internal/admin/AppMenu.vue +244 -0
- package/dist/runtime/internal/admin/AppMenu.vue.d.ts +3 -0
- package/dist/runtime/internal/admin/AppUser.d.vue.ts +3 -0
- package/dist/runtime/internal/admin/AppUser.vue +227 -0
- package/dist/runtime/internal/admin/AppUser.vue.d.ts +3 -0
- package/dist/runtime/internal/admin/CollectionEntryForm.d.vue.ts +41 -0
- package/dist/runtime/internal/admin/CollectionEntryForm.vue +916 -0
- package/dist/runtime/internal/admin/CollectionEntryForm.vue.d.ts +41 -0
- package/dist/runtime/internal/admin/ConfirmDialog.d.vue.ts +28 -0
- package/dist/runtime/internal/admin/ConfirmDialog.vue +136 -0
- package/dist/runtime/internal/admin/ConfirmDialog.vue.d.ts +28 -0
- package/dist/runtime/internal/admin/DictionaryTermForm.d.vue.ts +33 -0
- package/dist/runtime/internal/admin/DictionaryTermForm.vue +328 -0
- package/dist/runtime/internal/admin/DictionaryTermForm.vue.d.ts +33 -0
- package/dist/runtime/internal/admin/EntryRevisions.d.vue.ts +15 -0
- package/dist/runtime/internal/admin/EntryRevisions.vue +125 -0
- package/dist/runtime/internal/admin/EntryRevisions.vue.d.ts +15 -0
- package/dist/runtime/internal/admin/MediaLibraryFilters.d.vue.ts +16 -0
- package/dist/runtime/internal/admin/MediaLibraryFilters.vue +153 -0
- package/dist/runtime/internal/admin/MediaLibraryFilters.vue.d.ts +16 -0
- package/dist/runtime/internal/admin/MediaLibraryModal.d.vue.ts +65 -0
- package/dist/runtime/internal/admin/MediaLibraryModal.vue +451 -0
- package/dist/runtime/internal/admin/MediaLibraryModal.vue.d.ts +65 -0
- package/dist/runtime/internal/admin/OptionPageForm.d.vue.ts +26 -0
- package/dist/runtime/internal/admin/OptionPageForm.vue +222 -0
- package/dist/runtime/internal/admin/OptionPageForm.vue.d.ts +26 -0
- package/dist/runtime/internal/admin/UserAvatarField.d.vue.ts +12 -0
- package/dist/runtime/internal/admin/UserAvatarField.vue +305 -0
- package/dist/runtime/internal/admin/UserAvatarField.vue.d.ts +12 -0
- package/dist/runtime/internal/fields/AccordionField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/AccordionField.vue +220 -0
- package/dist/runtime/internal/fields/AccordionField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ButtonGroupField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ButtonGroupField.vue +109 -0
- package/dist/runtime/internal/fields/ButtonGroupField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/CheckboxField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/CheckboxField.vue +190 -0
- package/dist/runtime/internal/fields/CheckboxField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ColorPickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ColorPickerField.vue +791 -0
- package/dist/runtime/internal/fields/ColorPickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/DatePickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/DatePickerField.vue +26 -0
- package/dist/runtime/internal/fields/DatePickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/DateTimePickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/DateTimePickerField.vue +26 -0
- package/dist/runtime/internal/fields/DateTimePickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/DictionaryField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/DictionaryField.vue +345 -0
- package/dist/runtime/internal/fields/DictionaryField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/EmailField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/EmailField.vue +21 -0
- package/dist/runtime/internal/fields/EmailField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/FileField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/FileField.vue +408 -0
- package/dist/runtime/internal/fields/FileField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/FlexibleContentField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/FlexibleContentField.vue +1114 -0
- package/dist/runtime/internal/fields/FlexibleContentField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/GalleryField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/GalleryField.vue +584 -0
- package/dist/runtime/internal/fields/GalleryField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/GroupField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/GroupField.vue +111 -0
- package/dist/runtime/internal/fields/GroupField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ImageField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ImageField.vue +638 -0
- package/dist/runtime/internal/fields/ImageField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/ImageSelectField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/ImageSelectField.vue +179 -0
- package/dist/runtime/internal/fields/ImageSelectField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/LinkField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/LinkField.vue +303 -0
- package/dist/runtime/internal/fields/LinkField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/NumberField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/NumberField.vue +25 -0
- package/dist/runtime/internal/fields/NumberField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/OembedField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/OembedField.vue +161 -0
- package/dist/runtime/internal/fields/OembedField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/OpenStreetMapField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/OpenStreetMapField.vue +1502 -0
- package/dist/runtime/internal/fields/OpenStreetMapField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/PageLinkField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/PageLinkField.vue +153 -0
- package/dist/runtime/internal/fields/PageLinkField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/PasswordField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/PasswordField.vue +108 -0
- package/dist/runtime/internal/fields/PasswordField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/PostObjectField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/PostObjectField.vue +151 -0
- package/dist/runtime/internal/fields/PostObjectField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RadioField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RadioField.vue +163 -0
- package/dist/runtime/internal/fields/RadioField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RangeField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RangeField.vue +48 -0
- package/dist/runtime/internal/fields/RangeField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RelationshipField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RelationshipField.vue +525 -0
- package/dist/runtime/internal/fields/RelationshipField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/RepeaterField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/RepeaterField.vue +856 -0
- package/dist/runtime/internal/fields/RepeaterField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/SelectField.d.vue.ts +21 -0
- package/dist/runtime/internal/fields/SelectField.vue +101 -0
- package/dist/runtime/internal/fields/SelectField.vue.d.ts +21 -0
- package/dist/runtime/internal/fields/SeparatorField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/SeparatorField.vue +63 -0
- package/dist/runtime/internal/fields/SeparatorField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TabField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TabField.vue +210 -0
- package/dist/runtime/internal/fields/TabField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TextField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TextField.vue +22 -0
- package/dist/runtime/internal/fields/TextField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TextareaField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TextareaField.vue +62 -0
- package/dist/runtime/internal/fields/TextareaField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TimePickerField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TimePickerField.vue +24 -0
- package/dist/runtime/internal/fields/TimePickerField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/TrueFalseField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/TrueFalseField.vue +151 -0
- package/dist/runtime/internal/fields/TrueFalseField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/UrlField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/UrlField.vue +21 -0
- package/dist/runtime/internal/fields/UrlField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/UserField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/UserField.vue +164 -0
- package/dist/runtime/internal/fields/UserField.vue.d.ts +0 -0
- package/dist/runtime/internal/fields/WysiwygField.d.vue.ts +0 -0
- package/dist/runtime/internal/fields/WysiwygField.vue +971 -0
- package/dist/runtime/internal/fields/WysiwygField.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/DateTimeControl.d.vue.ts +90 -0
- package/dist/runtime/internal/parts/DateTimeControl.vue +568 -0
- package/dist/runtime/internal/parts/DateTimeControl.vue.d.ts +90 -0
- package/dist/runtime/internal/parts/FieldAddon.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldAddon.vue +43 -0
- package/dist/runtime/internal/parts/FieldAddon.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/FieldInstructions.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldInstructions.vue +24 -0
- package/dist/runtime/internal/parts/FieldInstructions.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/FieldLabel.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldLabel.vue +40 -0
- package/dist/runtime/internal/parts/FieldLabel.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/FieldWrapper.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/FieldWrapper.vue +47 -0
- package/dist/runtime/internal/parts/FieldWrapper.vue.d.ts +0 -0
- package/dist/runtime/internal/parts/ImageCropper.d.vue.ts +17 -0
- package/dist/runtime/internal/parts/ImageCropper.vue +363 -0
- package/dist/runtime/internal/parts/ImageCropper.vue.d.ts +17 -0
- package/dist/runtime/internal/parts/InputControl.d.vue.ts +0 -0
- package/dist/runtime/internal/parts/InputControl.vue +163 -0
- package/dist/runtime/internal/parts/InputControl.vue.d.ts +0 -0
- package/dist/runtime/internal/ui/UiButton.d.vue.ts +35 -0
- package/dist/runtime/internal/ui/UiButton.vue +204 -0
- package/dist/runtime/internal/ui/UiButton.vue.d.ts +35 -0
- package/dist/runtime/internal/ui/UiNotice.d.vue.ts +40 -0
- package/dist/runtime/internal/ui/UiNotice.vue +253 -0
- package/dist/runtime/internal/ui/UiNotice.vue.d.ts +40 -0
- package/dist/runtime/internal/ui/UiSelect.d.vue.ts +61 -0
- package/dist/runtime/internal/ui/UiSelect.vue +1212 -0
- package/dist/runtime/internal/ui/UiSelect.vue.d.ts +61 -0
- package/dist/runtime/middleware/auth-guard.d.ts +9 -0
- package/dist/runtime/middleware/auth-guard.js +37 -0
- package/dist/runtime/pages/admin/collections/[id].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/collections/[id].vue +423 -0
- package/dist/runtime/pages/admin/collections/[id].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/collections/create.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/collections/create.vue +179 -0
- package/dist/runtime/pages/admin/collections/create.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/collections/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/collections/index.vue +828 -0
- package/dist/runtime/pages/admin/collections/index.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/demo-fields.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/demo-fields.vue +1327 -0
- package/dist/runtime/pages/admin/demo-fields.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/[id].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/[id].vue +213 -0
- package/dist/runtime/pages/admin/dictionaries/[id].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/dictionaries/index.vue +387 -0
- package/dist/runtime/pages/admin/dictionaries/index.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/index.vue +138 -0
- package/dist/runtime/pages/admin/index.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/login.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/login.vue +373 -0
- package/dist/runtime/pages/admin/login.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/media.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/media.vue +1054 -0
- package/dist/runtime/pages/admin/media.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/options/[page].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/options/[page].vue +151 -0
- package/dist/runtime/pages/admin/options/[page].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/register.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/register.vue +391 -0
- package/dist/runtime/pages/admin/register.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/users/[id].d.vue.ts +3 -0
- package/dist/runtime/pages/admin/users/[id].vue +337 -0
- package/dist/runtime/pages/admin/users/[id].vue.d.ts +3 -0
- package/dist/runtime/pages/admin/users/create.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/users/create.vue +201 -0
- package/dist/runtime/pages/admin/users/create.vue.d.ts +3 -0
- package/dist/runtime/pages/admin/users/index.d.vue.ts +3 -0
- package/dist/runtime/pages/admin/users/index.vue +329 -0
- package/dist/runtime/pages/admin/users/index.vue.d.ts +3 -0
- package/dist/runtime/pages/index.d.vue.ts +3 -0
- package/dist/runtime/pages/index.vue +399 -0
- package/dist/runtime/pages/index.vue.d.ts +3 -0
- package/dist/runtime/server/api/_katecms/auth/login.post.d.ts +5 -0
- package/dist/runtime/server/api/_katecms/auth/login.post.js +44 -0
- package/dist/runtime/server/api/_katecms/auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/auth/logout.post.js +6 -0
- package/dist/runtime/server/api/_katecms/auth/register.post.d.ts +19 -0
- package/dist/runtime/server/api/_katecms/auth/register.post.js +83 -0
- package/dist/runtime/server/api/_katecms/auth/state.get.d.ts +9 -0
- package/dist/runtime/server/api/_katecms/auth/state.get.js +12 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].delete.d.ts +15 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].delete.js +59 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].get.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].get.js +50 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].patch.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/[id].patch.js +130 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.js +123 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions.get.d.ts +6 -0
- package/dist/runtime/server/api/_katecms/collections/[collection]/revisions.get.js +31 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].get.d.ts +8 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].get.js +135 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/collections/[collection].post.js +91 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.js +31 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.js +45 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.js +83 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].get.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].get.js +38 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].post.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/dictionaries/[dictionary].post.js +64 -0
- package/dist/runtime/server/api/_katecms/media/[id]/regenerate.post.d.ts +8 -0
- package/dist/runtime/server/api/_katecms/media/[id]/regenerate.post.js +30 -0
- package/dist/runtime/server/api/_katecms/media/[id].delete.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/media/[id].delete.js +22 -0
- package/dist/runtime/server/api/_katecms/media/[id].get.d.ts +9 -0
- package/dist/runtime/server/api/_katecms/media/[id].get.js +17 -0
- package/dist/runtime/server/api/_katecms/media/[id].patch.d.ts +6 -0
- package/dist/runtime/server/api/_katecms/media/[id].patch.js +48 -0
- package/dist/runtime/server/api/_katecms/media/index.get.d.ts +5 -0
- package/dist/runtime/server/api/_katecms/media/index.get.js +75 -0
- package/dist/runtime/server/api/_katecms/media/index.post.d.ts +9 -0
- package/dist/runtime/server/api/_katecms/media/index.post.js +84 -0
- package/dist/runtime/server/api/_katecms/media/regenerate.post.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/media/regenerate.post.js +30 -0
- package/dist/runtime/server/api/_katecms/menu.get.d.ts +8 -0
- package/dist/runtime/server/api/_katecms/menu.get.js +14 -0
- package/dist/runtime/server/api/_katecms/oembed.get.d.ts +2 -0
- package/dist/runtime/server/api/_katecms/oembed.get.js +53 -0
- package/dist/runtime/server/api/_katecms/options/[page].get.d.ts +7 -0
- package/dist/runtime/server/api/_katecms/options/[page].get.js +28 -0
- package/dist/runtime/server/api/_katecms/options/[page].patch.d.ts +4 -0
- package/dist/runtime/server/api/_katecms/options/[page].patch.js +36 -0
- package/dist/runtime/server/api/_katecms/query.get.d.ts +24 -0
- package/dist/runtime/server/api/_katecms/query.get.js +270 -0
- package/dist/runtime/server/api/_katecms/relation/entries.get.d.ts +17 -0
- package/dist/runtime/server/api/_katecms/relation/entries.get.js +74 -0
- package/dist/runtime/server/api/_katecms/relation/terms.get.d.ts +17 -0
- package/dist/runtime/server/api/_katecms/relation/terms.get.js +51 -0
- package/dist/runtime/server/api/_katecms/resolve.get.d.ts +17 -0
- package/dist/runtime/server/api/_katecms/resolve.get.js +116 -0
- package/dist/runtime/server/api/_katecms/terms.get.d.ts +20 -0
- package/dist/runtime/server/api/_katecms/terms.get.js +201 -0
- package/dist/runtime/server/api/_katecms/users/[id].delete.d.ts +11 -0
- package/dist/runtime/server/api/_katecms/users/[id].delete.js +45 -0
- package/dist/runtime/server/api/_katecms/users/[id].patch.d.ts +19 -0
- package/dist/runtime/server/api/_katecms/users/[id].patch.js +129 -0
- package/dist/runtime/server/api/_katecms/users.get.d.ts +10 -0
- package/dist/runtime/server/api/_katecms/users.get.js +34 -0
- package/dist/runtime/server/api/_katecms/users.post.d.ts +10 -0
- package/dist/runtime/server/api/_katecms/users.post.js +62 -0
- package/dist/runtime/server/api/uploads/[...key].get.d.ts +3 -0
- package/dist/runtime/server/api/uploads/[...key].get.js +28 -0
- package/dist/runtime/server/kit.d.ts +5 -0
- package/dist/runtime/server/kit.js +5 -0
- package/dist/runtime/server/middleware/admin-headers.d.ts +3 -0
- package/dist/runtime/server/middleware/admin-headers.js +12 -0
- package/dist/runtime/server/plugins/auto-migrate.d.ts +2 -0
- package/dist/runtime/server/plugins/auto-migrate.js +45 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/auth-attempts.d.ts +22 -0
- package/dist/runtime/server/utils/auth-attempts.js +42 -0
- package/dist/runtime/server/utils/auth-rate-limit.d.ts +11 -0
- package/dist/runtime/server/utils/auth-rate-limit.js +36 -0
- package/dist/runtime/server/utils/client-address.d.ts +16 -0
- package/dist/runtime/server/utils/client-address.js +23 -0
- package/dist/runtime/server/utils/collections.d.ts +42 -0
- package/dist/runtime/server/utils/collections.js +300 -0
- package/dist/runtime/server/utils/db.d.ts +3 -0
- package/dist/runtime/server/utils/db.js +25 -0
- package/dist/runtime/server/utils/dictionaries.d.ts +53 -0
- package/dist/runtime/server/utils/dictionaries.js +301 -0
- package/dist/runtime/server/utils/media-list.d.ts +18 -0
- package/dist/runtime/server/utils/media-list.js +84 -0
- package/dist/runtime/server/utils/media.d.ts +12 -0
- package/dist/runtime/server/utils/media.js +77 -0
- package/dist/runtime/server/utils/oembed-fetch.d.ts +4 -0
- package/dist/runtime/server/utils/oembed-fetch.js +142 -0
- package/dist/runtime/server/utils/options.d.ts +17 -0
- package/dist/runtime/server/utils/options.js +66 -0
- package/dist/runtime/server/utils/permissions.d.ts +13 -0
- package/dist/runtime/server/utils/permissions.js +20 -0
- package/dist/runtime/server/utils/public-fields-query.d.ts +6 -0
- package/dist/runtime/server/utils/public-fields-query.js +8 -0
- package/dist/runtime/server/utils/public-term.d.ts +8 -0
- package/dist/runtime/server/utils/public-term.js +80 -0
- package/dist/runtime/server/utils/regenerate.d.ts +12 -0
- package/dist/runtime/server/utils/regenerate.js +40 -0
- package/dist/runtime/server/utils/relation.d.ts +18 -0
- package/dist/runtime/server/utils/relation.js +77 -0
- package/dist/runtime/server/utils/request-address.d.ts +6 -0
- package/dist/runtime/server/utils/request-address.js +10 -0
- package/dist/runtime/server/utils/revisions.d.ts +20 -0
- package/dist/runtime/server/utils/revisions.js +172 -0
- package/dist/runtime/server/utils/session.d.ts +18 -0
- package/dist/runtime/server/utils/session.js +71 -0
- package/dist/runtime/server/utils/upload-headers.d.ts +2 -0
- package/dist/runtime/server/utils/upload-headers.js +30 -0
- package/dist/runtime/server/utils/users.d.ts +13 -0
- package/dist/runtime/server/utils/users.js +47 -0
- package/dist/runtime/utils/admin-users.d.ts +20 -0
- package/dist/runtime/utils/admin-users.js +19 -0
- package/dist/runtime/utils/auth-error.d.ts +6 -0
- package/dist/runtime/utils/auth-error.js +11 -0
- package/dist/runtime/utils/cms-paths.d.ts +5 -0
- package/dist/runtime/utils/cms-paths.js +13 -0
- package/dist/runtime/utils/collections.d.ts +176 -0
- package/dist/runtime/utils/collections.js +30 -0
- package/dist/runtime/utils/dictionaries.d.ts +65 -0
- package/dist/runtime/utils/dictionaries.js +14 -0
- package/dist/runtime/utils/field-errors.d.ts +4 -0
- package/dist/runtime/utils/field-errors.js +9 -0
- package/dist/runtime/utils/field-values.d.ts +19 -0
- package/dist/runtime/utils/field-values.js +82 -0
- package/dist/runtime/utils/helpers.d.ts +4 -0
- package/dist/runtime/utils/helpers.js +20 -0
- package/dist/runtime/utils/media-library-query.d.ts +54 -0
- package/dist/runtime/utils/media-library-query.js +190 -0
- package/dist/runtime/utils/options.d.ts +19 -0
- package/dist/runtime/utils/options.js +3 -0
- package/dist/runtime/utils/preview.d.ts +22 -0
- package/dist/runtime/utils/preview.js +33 -0
- package/dist/runtime/utils/relation.d.ts +33 -0
- package/dist/runtime/utils/relation.js +23 -0
- package/dist/runtime/utils/slugify.d.ts +2 -0
- package/dist/runtime/utils/slugify.js +4 -0
- package/dist/types.d.mts +7 -0
- package/package.json +84 -3
- package/src/admin-components.ts +124 -0
- package/src/module.ts +592 -0
- package/src/runtime/assets/img/katecms-logo.svg +17 -0
- package/src/runtime/assets/styles/_functions.scss +70 -0
- package/src/runtime/assets/styles/_index.scss +3 -0
- package/src/runtime/assets/styles/_mixins.scss +256 -0
- package/src/runtime/assets/styles/_variables.scss +35 -0
- package/src/runtime/composables/getCollection.ts +253 -0
- package/src/runtime/composables/getOptions.ts +42 -0
- package/src/runtime/composables/getQueryCollection.ts +325 -0
- package/src/runtime/composables/getTerms.ts +231 -0
- package/src/runtime/composables/useAuth.ts +43 -0
- package/src/runtime/composables/useAuthCooldown.ts +52 -0
- package/src/runtime/composables/useCmsPaths.ts +24 -0
- package/src/runtime/composables/useKateCmsExtensions.ts +81 -0
- package/src/runtime/composables/useMediaLibrary.ts +168 -0
- package/src/runtime/composables/useMenuAccess.ts +25 -0
- package/src/runtime/internal/admin/AdminHeader.vue +106 -0
- package/src/runtime/internal/admin/AppMenu.vue +290 -0
- package/src/runtime/internal/admin/AppUser.vue +260 -0
- package/src/runtime/internal/admin/CollectionEntryForm.vue +1044 -0
- package/src/runtime/internal/admin/ConfirmDialog.vue +164 -0
- package/src/runtime/internal/admin/DictionaryTermForm.vue +400 -0
- package/src/runtime/internal/admin/EntryRevisions.vue +145 -0
- package/src/runtime/internal/admin/MediaLibraryFilters.vue +186 -0
- package/src/runtime/internal/admin/MediaLibraryModal.vue +526 -0
- package/src/runtime/internal/admin/OptionPageForm.vue +277 -0
- package/src/runtime/internal/admin/UserAvatarField.vue +337 -0
- package/src/runtime/internal/fields/AccordionField.vue +258 -0
- package/src/runtime/internal/fields/ButtonGroupField.vue +144 -0
- package/src/runtime/internal/fields/CheckboxField.vue +228 -0
- package/src/runtime/internal/fields/ColorPickerField.vue +926 -0
- package/src/runtime/internal/fields/DatePickerField.vue +33 -0
- package/src/runtime/internal/fields/DateTimePickerField.vue +33 -0
- package/src/runtime/internal/fields/DictionaryField.vue +403 -0
- package/src/runtime/internal/fields/EmailField.vue +28 -0
- package/src/runtime/internal/fields/FileField.vue +480 -0
- package/src/runtime/internal/fields/FlexibleContentField.vue +1296 -0
- package/src/runtime/internal/fields/GalleryField.vue +677 -0
- package/src/runtime/internal/fields/GroupField.vue +136 -0
- package/src/runtime/internal/fields/ImageField.vue +730 -0
- package/src/runtime/internal/fields/ImageSelectField.vue +213 -0
- package/src/runtime/internal/fields/LinkField.vue +338 -0
- package/src/runtime/internal/fields/NumberField.vue +32 -0
- package/src/runtime/internal/fields/OembedField.vue +187 -0
- package/src/runtime/internal/fields/OpenStreetMapField.vue +1716 -0
- package/src/runtime/internal/fields/PageLinkField.vue +186 -0
- package/src/runtime/internal/fields/PasswordField.vue +127 -0
- package/src/runtime/internal/fields/PostObjectField.vue +187 -0
- package/src/runtime/internal/fields/RadioField.vue +195 -0
- package/src/runtime/internal/fields/RangeField.vue +62 -0
- package/src/runtime/internal/fields/RelationshipField.vue +604 -0
- package/src/runtime/internal/fields/RepeaterField.vue +999 -0
- package/src/runtime/internal/fields/SelectField.vue +118 -0
- package/src/runtime/internal/fields/SeparatorField.vue +77 -0
- package/src/runtime/internal/fields/TabField.vue +249 -0
- package/src/runtime/internal/fields/TextField.vue +29 -0
- package/src/runtime/internal/fields/TextareaField.vue +61 -0
- package/src/runtime/internal/fields/TimePickerField.vue +31 -0
- package/src/runtime/internal/fields/TrueFalseField.vue +181 -0
- package/src/runtime/internal/fields/UrlField.vue +28 -0
- package/src/runtime/internal/fields/UserField.vue +203 -0
- package/src/runtime/internal/fields/WysiwygField.vue +1061 -0
- package/src/runtime/internal/parts/DateTimeControl.vue +657 -0
- package/src/runtime/internal/parts/FieldAddon.vue +60 -0
- package/src/runtime/internal/parts/FieldInstructions.vue +38 -0
- package/src/runtime/internal/parts/FieldLabel.vue +56 -0
- package/src/runtime/internal/parts/FieldWrapper.vue +63 -0
- package/src/runtime/internal/parts/ImageCropper.vue +415 -0
- package/src/runtime/internal/parts/InputControl.vue +189 -0
- package/src/runtime/internal/ui/UiButton.vue +274 -0
- package/src/runtime/internal/ui/UiNotice.vue +302 -0
- package/src/runtime/internal/ui/UiSelect.vue +1420 -0
- package/src/runtime/middleware/auth-guard.ts +52 -0
- package/src/runtime/pages/admin/collections/[id].vue +486 -0
- package/src/runtime/pages/admin/collections/create.vue +208 -0
- package/src/runtime/pages/admin/collections/index.vue +955 -0
- package/src/runtime/pages/admin/demo-fields.vue +1354 -0
- package/src/runtime/pages/admin/dictionaries/[id].vue +246 -0
- package/src/runtime/pages/admin/dictionaries/index.vue +438 -0
- package/src/runtime/pages/admin/index.vue +155 -0
- package/src/runtime/pages/admin/login.vue +159 -0
- package/src/runtime/pages/admin/media.vue +1176 -0
- package/src/runtime/pages/admin/options/[page].vue +174 -0
- package/src/runtime/pages/admin/register.vue +179 -0
- package/src/runtime/pages/admin/users/[id].vue +382 -0
- package/src/runtime/pages/admin/users/create.vue +232 -0
- package/src/runtime/pages/admin/users/index.vue +374 -0
- package/src/runtime/pages/index.vue +265 -0
- package/src/runtime/server/api/_katecms/auth/login.post.ts +62 -0
- package/src/runtime/server/api/_katecms/auth/logout.post.ts +7 -0
- package/src/runtime/server/api/_katecms/auth/register.post.ts +112 -0
- package/src/runtime/server/api/_katecms/auth/state.get.ts +19 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/[id].delete.ts +77 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/[id].get.ts +57 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/[id].patch.ts +157 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/revisions/[revisionId].post.ts +133 -0
- package/src/runtime/server/api/_katecms/collections/[collection]/revisions.get.ts +35 -0
- package/src/runtime/server/api/_katecms/collections/[collection].get.ts +177 -0
- package/src/runtime/server/api/_katecms/collections/[collection].post.ts +111 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].delete.ts +37 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].get.ts +51 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary]/[id].patch.ts +101 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary].get.ts +43 -0
- package/src/runtime/server/api/_katecms/dictionaries/[dictionary].post.ts +78 -0
- package/src/runtime/server/api/_katecms/media/[id]/regenerate.post.ts +39 -0
- package/src/runtime/server/api/_katecms/media/[id].delete.ts +28 -0
- package/src/runtime/server/api/_katecms/media/[id].get.ts +25 -0
- package/src/runtime/server/api/_katecms/media/[id].patch.ts +60 -0
- package/src/runtime/server/api/_katecms/media/index.get.ts +96 -0
- package/src/runtime/server/api/_katecms/media/index.post.ts +104 -0
- package/src/runtime/server/api/_katecms/media/regenerate.post.ts +38 -0
- package/src/runtime/server/api/_katecms/menu.get.ts +19 -0
- package/src/runtime/server/api/_katecms/oembed.get.ts +62 -0
- package/src/runtime/server/api/_katecms/options/[page].get.ts +35 -0
- package/src/runtime/server/api/_katecms/options/[page].patch.ts +46 -0
- package/src/runtime/server/api/_katecms/query.get.ts +332 -0
- package/src/runtime/server/api/_katecms/relation/entries.get.ts +98 -0
- package/src/runtime/server/api/_katecms/relation/terms.get.ts +61 -0
- package/src/runtime/server/api/_katecms/resolve.get.ts +148 -0
- package/src/runtime/server/api/_katecms/terms.get.ts +258 -0
- package/src/runtime/server/api/_katecms/users/[id].delete.ts +57 -0
- package/src/runtime/server/api/_katecms/users/[id].patch.ts +177 -0
- package/src/runtime/server/api/_katecms/users.get.ts +48 -0
- package/src/runtime/server/api/_katecms/users.post.ts +85 -0
- package/src/runtime/server/api/uploads/[...key].get.ts +33 -0
- package/src/runtime/server/kit.ts +5 -0
- package/src/runtime/server/middleware/admin-headers.ts +14 -0
- package/src/runtime/server/plugins/auto-migrate.ts +53 -0
- package/src/runtime/server/tsconfig.json +3 -0
- package/src/runtime/server/utils/auth-attempts.ts +71 -0
- package/src/runtime/server/utils/auth-rate-limit.ts +48 -0
- package/src/runtime/server/utils/client-address.ts +41 -0
- package/src/runtime/server/utils/collections.ts +381 -0
- package/src/runtime/server/utils/db.ts +36 -0
- package/src/runtime/server/utils/dictionaries.ts +397 -0
- package/src/runtime/server/utils/media-list.ts +131 -0
- package/src/runtime/server/utils/media.ts +94 -0
- package/src/runtime/server/utils/oembed-fetch.ts +157 -0
- package/src/runtime/server/utils/options.ts +86 -0
- package/src/runtime/server/utils/permissions.ts +44 -0
- package/src/runtime/server/utils/public-fields-query.ts +14 -0
- package/src/runtime/server/utils/public-term.ts +98 -0
- package/src/runtime/server/utils/regenerate.ts +56 -0
- package/src/runtime/server/utils/relation.ts +96 -0
- package/src/runtime/server/utils/request-address.ts +16 -0
- package/src/runtime/server/utils/revisions.ts +256 -0
- package/src/runtime/server/utils/session.ts +112 -0
- package/src/runtime/server/utils/upload-headers.ts +35 -0
- package/src/runtime/server/utils/users.ts +67 -0
- package/src/runtime/utils/admin-users.ts +43 -0
- package/src/runtime/utils/auth-error.ts +22 -0
- package/src/runtime/utils/cms-paths.ts +17 -0
- package/src/runtime/utils/collections.ts +228 -0
- package/src/runtime/utils/dictionaries.ts +89 -0
- package/src/runtime/utils/field-errors.ts +12 -0
- package/src/runtime/utils/field-values.ts +101 -0
- package/src/runtime/utils/helpers.ts +33 -0
- package/src/runtime/utils/media-library-query.ts +263 -0
- package/src/runtime/utils/options.ts +25 -0
- package/src/runtime/utils/preview.ts +56 -0
- package/src/runtime/utils/relation.ts +60 -0
- package/src/runtime/utils/slugify.ts +10 -0
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
3
|
+
import { $fetch, navigateTo, useHead, useRoute } from "#imports";
|
|
4
|
+
import { buildPublicPath } from "@katecms/core";
|
|
5
|
+
const COLLECTION_LIST_SORTS = [
|
|
6
|
+
"date-desc",
|
|
7
|
+
"date-asc",
|
|
8
|
+
"author-asc",
|
|
9
|
+
"author-desc",
|
|
10
|
+
"title-asc",
|
|
11
|
+
"title-desc"
|
|
12
|
+
];
|
|
13
|
+
import { parseAuthError } from "../../../utils/auth-error";
|
|
14
|
+
import { localUtcOffsetMinutes, monthLabel } from "../../../utils/media-library-query";
|
|
15
|
+
import {
|
|
16
|
+
collectionApi,
|
|
17
|
+
collectionStatusLabel
|
|
18
|
+
} from "../../../utils/collections";
|
|
19
|
+
import { useCmsPaths } from "../../../composables/useCmsPaths";
|
|
20
|
+
const route = useRoute();
|
|
21
|
+
const paths = useCmsPaths();
|
|
22
|
+
const rootClass = "katecms-collection-list";
|
|
23
|
+
const collectionSlug = computed(() => String(route.params.collection ?? ""));
|
|
24
|
+
const statusFilter = computed(() => {
|
|
25
|
+
const raw = String(route.query.status ?? "all");
|
|
26
|
+
if (raw === "published" || raw === "draft" || raw === "trash" || raw === "all") {
|
|
27
|
+
return raw;
|
|
28
|
+
}
|
|
29
|
+
return "all";
|
|
30
|
+
});
|
|
31
|
+
const searchQuery = computed(() => String(route.query.q ?? ""));
|
|
32
|
+
const page = computed(() => Math.max(1, Number(route.query.page) || 1));
|
|
33
|
+
const monthFilter = computed(() => {
|
|
34
|
+
const raw = String(route.query.month ?? "");
|
|
35
|
+
return /^\d{4}-(0[1-9]|1[0-2])$/.test(raw) ? raw : "all";
|
|
36
|
+
});
|
|
37
|
+
const sortFilter = computed(() => {
|
|
38
|
+
const raw = String(route.query.sort ?? "date-desc");
|
|
39
|
+
return COLLECTION_LIST_SORTS.includes(raw) ? raw : "date-desc";
|
|
40
|
+
});
|
|
41
|
+
const collection = ref(null);
|
|
42
|
+
const entries = ref([]);
|
|
43
|
+
const months = ref([]);
|
|
44
|
+
const counts = ref({ all: 0, published: 0, draft: 0, trash: 0 });
|
|
45
|
+
const total = ref(0);
|
|
46
|
+
const perPage = ref(10);
|
|
47
|
+
const canCreate = ref(false);
|
|
48
|
+
const canDelete = ref(false);
|
|
49
|
+
const loading = ref(true);
|
|
50
|
+
const error = ref(null);
|
|
51
|
+
const pendingId = ref(null);
|
|
52
|
+
const emptyingTrash = ref(false);
|
|
53
|
+
const deletingMarked = ref(false);
|
|
54
|
+
const markedIds = ref([]);
|
|
55
|
+
const searchInput = ref("");
|
|
56
|
+
const SORT_CHOICES = [
|
|
57
|
+
{ val: "date-desc", lbl: "Date, newest" },
|
|
58
|
+
{ val: "date-asc", lbl: "Date, oldest" },
|
|
59
|
+
{ val: "author-asc", lbl: "Author, A\u2013Z" },
|
|
60
|
+
{ val: "author-desc", lbl: "Author, Z\u2013A" },
|
|
61
|
+
{ val: "title-asc", lbl: "Title, A\u2013Z" },
|
|
62
|
+
{ val: "title-desc", lbl: "Title, Z\u2013A" }
|
|
63
|
+
];
|
|
64
|
+
const title = computed(() => collection.value?.labels.name || "");
|
|
65
|
+
useHead({ title });
|
|
66
|
+
const totalPages = computed(() => {
|
|
67
|
+
if (perPage.value < 1) {
|
|
68
|
+
return 1;
|
|
69
|
+
}
|
|
70
|
+
return Math.max(1, Math.ceil(total.value / perPage.value));
|
|
71
|
+
});
|
|
72
|
+
const monthChoices = computed(() => {
|
|
73
|
+
const values = [...months.value];
|
|
74
|
+
if (monthFilter.value !== "all" && !values.includes(monthFilter.value)) {
|
|
75
|
+
values.push(monthFilter.value);
|
|
76
|
+
}
|
|
77
|
+
values.sort((a, b) => b.localeCompare(a));
|
|
78
|
+
return [
|
|
79
|
+
{ val: "all", lbl: "All dates" },
|
|
80
|
+
...values.map((value) => ({ val: value, lbl: monthLabel(value) }))
|
|
81
|
+
];
|
|
82
|
+
});
|
|
83
|
+
const markedEntries = computed(
|
|
84
|
+
() => entries.value.filter((entry) => markedIds.value.includes(entry.id))
|
|
85
|
+
);
|
|
86
|
+
const bulkTrashIds = computed(
|
|
87
|
+
() => statusFilter.value === "trash" ? [] : markedEntries.value.filter((entry) => entry.canUpdate).map((entry) => entry.id)
|
|
88
|
+
);
|
|
89
|
+
const bulkDeleteIds = computed(
|
|
90
|
+
() => statusFilter.value === "trash" ? markedEntries.value.filter((entry) => entry.canDelete).map((entry) => entry.id) : []
|
|
91
|
+
);
|
|
92
|
+
const emptyMessage = computed(() => {
|
|
93
|
+
if (searchQuery.value || monthFilter.value !== "all") {
|
|
94
|
+
return "No entries match.";
|
|
95
|
+
}
|
|
96
|
+
if (statusFilter.value === "trash") {
|
|
97
|
+
return "Trash is empty.";
|
|
98
|
+
}
|
|
99
|
+
if (statusFilter.value === "draft") {
|
|
100
|
+
return "No drafts.";
|
|
101
|
+
}
|
|
102
|
+
if (statusFilter.value === "published") {
|
|
103
|
+
return "No published entries.";
|
|
104
|
+
}
|
|
105
|
+
return "No entries yet.";
|
|
106
|
+
});
|
|
107
|
+
watch(searchQuery, (value) => {
|
|
108
|
+
searchInput.value = value;
|
|
109
|
+
}, { immediate: true });
|
|
110
|
+
function viewUrl(entry) {
|
|
111
|
+
if (collection.value?.public === false) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
const path = buildPublicPath(
|
|
115
|
+
collection.value?.rewrite,
|
|
116
|
+
collectionSlug.value,
|
|
117
|
+
entry.slugPath || entry.slug
|
|
118
|
+
);
|
|
119
|
+
return entry.status === "draft" ? `${path}?preview=1` : path;
|
|
120
|
+
}
|
|
121
|
+
function entryListTitle(entry) {
|
|
122
|
+
const depth = collection.value?.hierarchical ? entry.depth ?? 0 : 0;
|
|
123
|
+
if (depth < 1) {
|
|
124
|
+
return entry.title;
|
|
125
|
+
}
|
|
126
|
+
return `${"\u2014 ".repeat(depth)}${entry.title}`;
|
|
127
|
+
}
|
|
128
|
+
function formatListDate(iso) {
|
|
129
|
+
const date = new Date(iso);
|
|
130
|
+
if (Number.isNaN(date.getTime())) {
|
|
131
|
+
return iso;
|
|
132
|
+
}
|
|
133
|
+
return date.toLocaleString("en-US", {
|
|
134
|
+
year: "numeric",
|
|
135
|
+
month: "short",
|
|
136
|
+
day: "numeric",
|
|
137
|
+
hour: "numeric",
|
|
138
|
+
minute: "2-digit"
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function entryAuthor(entry) {
|
|
142
|
+
return entry.authorName?.trim() || "\u2014";
|
|
143
|
+
}
|
|
144
|
+
function entryDateDisplay(entry) {
|
|
145
|
+
const publishedMs = entry.publishedAt ? Date.parse(entry.publishedAt) : Number.NaN;
|
|
146
|
+
const updatedMs = Date.parse(entry.updatedAt);
|
|
147
|
+
const hasPublished = !Number.isNaN(publishedMs);
|
|
148
|
+
const hasUpdated = !Number.isNaN(updatedMs);
|
|
149
|
+
const modified = entry.status !== "published" || !hasPublished || hasUpdated && updatedMs - publishedMs > 2e3;
|
|
150
|
+
if (!modified && entry.publishedAt) {
|
|
151
|
+
return { label: "Published", value: formatListDate(entry.publishedAt) };
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
label: "Last Modified",
|
|
155
|
+
value: formatListDate(hasUpdated ? entry.updatedAt : entry.publishedAt ?? entry.createdAt)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
async function navigateQuery(query = {}) {
|
|
159
|
+
await navigateTo({
|
|
160
|
+
path: paths.collection(collectionSlug.value),
|
|
161
|
+
query
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function listQuery(patch = {}) {
|
|
165
|
+
const status = patch.status ?? statusFilter.value;
|
|
166
|
+
const q = patch.q ?? searchQuery.value;
|
|
167
|
+
const month = patch.month ?? monthFilter.value;
|
|
168
|
+
const sort = patch.sort ?? sortFilter.value;
|
|
169
|
+
const nextPage = patch.page ?? 1;
|
|
170
|
+
const query = {};
|
|
171
|
+
if (q) {
|
|
172
|
+
query.q = q;
|
|
173
|
+
} else if (status !== "all") {
|
|
174
|
+
query.status = status;
|
|
175
|
+
}
|
|
176
|
+
if (month !== "all") {
|
|
177
|
+
query.month = month;
|
|
178
|
+
}
|
|
179
|
+
if (sort !== "date-desc") {
|
|
180
|
+
query.sort = sort;
|
|
181
|
+
}
|
|
182
|
+
if (nextPage > 1) {
|
|
183
|
+
query.page = String(nextPage);
|
|
184
|
+
}
|
|
185
|
+
return query;
|
|
186
|
+
}
|
|
187
|
+
function setStatus(status) {
|
|
188
|
+
return navigateQuery(listQuery({ status, q: "", page: 1 }));
|
|
189
|
+
}
|
|
190
|
+
function applySearch() {
|
|
191
|
+
return navigateQuery(listQuery({
|
|
192
|
+
q: searchInput.value.trim(),
|
|
193
|
+
status: "all",
|
|
194
|
+
page: 1
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
function setMonth(month) {
|
|
198
|
+
return navigateQuery(listQuery({ month, page: 1 }));
|
|
199
|
+
}
|
|
200
|
+
function setSort(sort) {
|
|
201
|
+
return navigateQuery(listQuery({ sort, page: 1 }));
|
|
202
|
+
}
|
|
203
|
+
function setPage(next) {
|
|
204
|
+
return navigateQuery(listQuery({ page: next }));
|
|
205
|
+
}
|
|
206
|
+
const monthModel = computed({
|
|
207
|
+
get() {
|
|
208
|
+
return monthFilter.value;
|
|
209
|
+
},
|
|
210
|
+
set(value) {
|
|
211
|
+
const raw = typeof value === "string" ? value : "all";
|
|
212
|
+
const month = raw === "all" || /^\d{4}-(0[1-9]|1[0-2])$/.test(raw) ? raw : "all";
|
|
213
|
+
void setMonth(month);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const sortModel = computed({
|
|
217
|
+
get() {
|
|
218
|
+
return sortFilter.value;
|
|
219
|
+
},
|
|
220
|
+
set(value) {
|
|
221
|
+
const raw = typeof value === "string" ? value : "date-desc";
|
|
222
|
+
const sort = COLLECTION_LIST_SORTS.includes(raw) ? raw : "date-desc";
|
|
223
|
+
void setSort(sort);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
function isMarked(id) {
|
|
227
|
+
return markedIds.value.includes(id);
|
|
228
|
+
}
|
|
229
|
+
function toggleMarked(id) {
|
|
230
|
+
markedIds.value = isMarked(id) ? markedIds.value.filter((entry) => entry !== id) : [...markedIds.value, id];
|
|
231
|
+
}
|
|
232
|
+
async function load() {
|
|
233
|
+
if (!collectionSlug.value) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
loading.value = true;
|
|
237
|
+
error.value = null;
|
|
238
|
+
markedIds.value = [];
|
|
239
|
+
try {
|
|
240
|
+
const res = await $fetch(collectionApi(collectionSlug.value), {
|
|
241
|
+
query: {
|
|
242
|
+
status: searchQuery.value ? void 0 : statusFilter.value,
|
|
243
|
+
q: searchQuery.value || void 0,
|
|
244
|
+
month: monthFilter.value === "all" ? void 0 : monthFilter.value,
|
|
245
|
+
sort: sortFilter.value,
|
|
246
|
+
tz: localUtcOffsetMinutes(),
|
|
247
|
+
page: page.value
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
collection.value = res.collection;
|
|
251
|
+
entries.value = res.entries;
|
|
252
|
+
months.value = res.months ?? [];
|
|
253
|
+
counts.value = res.counts;
|
|
254
|
+
total.value = res.total;
|
|
255
|
+
perPage.value = res.perPage;
|
|
256
|
+
canCreate.value = res.canCreate;
|
|
257
|
+
canDelete.value = res.canDelete;
|
|
258
|
+
} catch (err) {
|
|
259
|
+
collection.value = null;
|
|
260
|
+
entries.value = [];
|
|
261
|
+
canDelete.value = false;
|
|
262
|
+
error.value = parseAuthError(err, "Could not load entries.").message;
|
|
263
|
+
} finally {
|
|
264
|
+
loading.value = false;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
async function moveToTrash(entry) {
|
|
268
|
+
if (!entry.canUpdate || pendingId.value !== null) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (!window.confirm(`Move \u201C${entry.title}\u201D to trash?`)) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
pendingId.value = entry.id;
|
|
275
|
+
error.value = null;
|
|
276
|
+
try {
|
|
277
|
+
await $fetch(collectionApi(collectionSlug.value, entry.id), {
|
|
278
|
+
method: "PATCH",
|
|
279
|
+
body: { status: "trash" }
|
|
280
|
+
});
|
|
281
|
+
await load();
|
|
282
|
+
} catch (err) {
|
|
283
|
+
error.value = parseAuthError(err, "Could not move the entry to trash.").message;
|
|
284
|
+
} finally {
|
|
285
|
+
pendingId.value = null;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async function restore(entry) {
|
|
289
|
+
if (!entry.canUpdate || pendingId.value !== null) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
pendingId.value = entry.id;
|
|
293
|
+
error.value = null;
|
|
294
|
+
try {
|
|
295
|
+
await $fetch(collectionApi(collectionSlug.value, entry.id), {
|
|
296
|
+
method: "PATCH",
|
|
297
|
+
body: { status: "draft" }
|
|
298
|
+
});
|
|
299
|
+
await load();
|
|
300
|
+
} catch (err) {
|
|
301
|
+
error.value = parseAuthError(err, "Could not restore the entry.").message;
|
|
302
|
+
} finally {
|
|
303
|
+
pendingId.value = null;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
async function removePermanent(entry) {
|
|
307
|
+
if (!entry.canDelete || pendingId.value !== null) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (!window.confirm(`Delete \u201C${entry.title}\u201D permanently? This cannot be undone.`)) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
pendingId.value = entry.id;
|
|
314
|
+
error.value = null;
|
|
315
|
+
try {
|
|
316
|
+
await $fetch(collectionApi(collectionSlug.value, entry.id), { method: "DELETE" });
|
|
317
|
+
await load();
|
|
318
|
+
} catch (err) {
|
|
319
|
+
error.value = parseAuthError(err, "Could not delete the entry.").message;
|
|
320
|
+
} finally {
|
|
321
|
+
pendingId.value = null;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
async function removeMarked() {
|
|
325
|
+
const trashIds = bulkTrashIds.value;
|
|
326
|
+
const deleteIds = bulkDeleteIds.value;
|
|
327
|
+
const ids = trashIds.length ? trashIds : deleteIds;
|
|
328
|
+
if (!ids.length || deletingMarked.value || pendingId.value !== null) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const permanent = deleteIds.length > 0;
|
|
332
|
+
const label = permanent ? ids.length === 1 ? "Delete 1 entry permanently? This cannot be undone." : `Delete ${ids.length} entries permanently? This cannot be undone.` : ids.length === 1 ? "Move 1 entry to trash?" : `Move ${ids.length} entries to trash?`;
|
|
333
|
+
if (!window.confirm(label)) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
deletingMarked.value = true;
|
|
337
|
+
error.value = null;
|
|
338
|
+
const failed = [];
|
|
339
|
+
await Promise.all(ids.map(async (id) => {
|
|
340
|
+
try {
|
|
341
|
+
if (permanent) {
|
|
342
|
+
await $fetch(collectionApi(collectionSlug.value, id), { method: "DELETE" });
|
|
343
|
+
} else {
|
|
344
|
+
await $fetch(collectionApi(collectionSlug.value, id), {
|
|
345
|
+
method: "PATCH",
|
|
346
|
+
body: { status: "trash" }
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
} catch {
|
|
350
|
+
failed.push(id);
|
|
351
|
+
}
|
|
352
|
+
}));
|
|
353
|
+
deletingMarked.value = false;
|
|
354
|
+
await load();
|
|
355
|
+
if (failed.length) {
|
|
356
|
+
error.value = failed.length === 1 ? "Could not update 1 entry." : `Could not update ${failed.length} entries.`;
|
|
357
|
+
} else if (!entries.value.length && page.value > 1) {
|
|
358
|
+
await setPage(page.value - 1);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
async function emptyTrash() {
|
|
362
|
+
if (!canDelete.value || emptyingTrash.value || pendingId.value !== null || counts.value.trash <= 0) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (!window.confirm("Permanently delete all items in the trash? This cannot be undone.")) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
emptyingTrash.value = true;
|
|
369
|
+
error.value = null;
|
|
370
|
+
try {
|
|
371
|
+
await $fetch(collectionApi(collectionSlug.value, "trash"), { method: "DELETE" });
|
|
372
|
+
await load();
|
|
373
|
+
} catch (err) {
|
|
374
|
+
error.value = parseAuthError(err, "Could not empty the trash.").message;
|
|
375
|
+
} finally {
|
|
376
|
+
emptyingTrash.value = false;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
onMounted(load);
|
|
380
|
+
watch([collectionSlug, statusFilter, searchQuery, monthFilter, sortFilter, page], load);
|
|
381
|
+
</script>
|
|
382
|
+
|
|
383
|
+
<template>
|
|
384
|
+
<div :class="rootClass">
|
|
385
|
+
<KateCmsAdminHeader :title="title">
|
|
386
|
+
<KateCmsUiButton
|
|
387
|
+
v-if="canCreate && collection"
|
|
388
|
+
tag="a"
|
|
389
|
+
:link="{ url: paths.collectionCreate(collectionSlug), title: 'Add' }"
|
|
390
|
+
>
|
|
391
|
+
Add {{ collection.labels.singularName || collection.labels.name }}
|
|
392
|
+
</KateCmsUiButton>
|
|
393
|
+
|
|
394
|
+
<KateCmsUiButton
|
|
395
|
+
v-if="bulkTrashIds.length"
|
|
396
|
+
tag="button"
|
|
397
|
+
variant="red"
|
|
398
|
+
:disabled="deletingMarked || pendingId !== null || emptyingTrash"
|
|
399
|
+
@click="removeMarked"
|
|
400
|
+
>
|
|
401
|
+
{{ deletingMarked ? "Moving\u2026" : `Trash selected (${bulkTrashIds.length})` }}
|
|
402
|
+
</KateCmsUiButton>
|
|
403
|
+
<KateCmsUiButton
|
|
404
|
+
v-if="bulkDeleteIds.length"
|
|
405
|
+
tag="button"
|
|
406
|
+
variant="red"
|
|
407
|
+
:disabled="deletingMarked || pendingId !== null || emptyingTrash"
|
|
408
|
+
@click="removeMarked"
|
|
409
|
+
>
|
|
410
|
+
{{ deletingMarked ? "Deleting\u2026" : `Delete selected (${bulkDeleteIds.length})` }}
|
|
411
|
+
</KateCmsUiButton>
|
|
412
|
+
|
|
413
|
+
<KateCmsUiButton
|
|
414
|
+
v-if="statusFilter === 'trash' && canDelete && counts.trash > 0"
|
|
415
|
+
tag="button"
|
|
416
|
+
variant="red"
|
|
417
|
+
:disabled="emptyingTrash || pendingId !== null || loading"
|
|
418
|
+
@click="emptyTrash"
|
|
419
|
+
>
|
|
420
|
+
{{ emptyingTrash ? "Emptying\u2026" : "Empty Trash" }}
|
|
421
|
+
</KateCmsUiButton>
|
|
422
|
+
</KateCmsAdminHeader>
|
|
423
|
+
|
|
424
|
+
<div :class="`${rootClass}__toolbar`">
|
|
425
|
+
<div :class="`${rootClass}__tabs`">
|
|
426
|
+
<KateCmsUiButton
|
|
427
|
+
v-for="tab in [
|
|
428
|
+
{ id: 'all', label: 'All', count: counts.all },
|
|
429
|
+
{ id: 'published', label: 'Published', count: counts.published },
|
|
430
|
+
{ id: 'draft', label: 'Draft', count: counts.draft },
|
|
431
|
+
{ id: 'trash', label: 'Trash', count: counts.trash }
|
|
432
|
+
]"
|
|
433
|
+
:key="tab.id"
|
|
434
|
+
tag="button"
|
|
435
|
+
variant="tertiary"
|
|
436
|
+
:active="!searchQuery && statusFilter === tab.id"
|
|
437
|
+
@click="setStatus(tab.id)"
|
|
438
|
+
>
|
|
439
|
+
{{ tab.label }}
|
|
440
|
+
{{ tab.count }}
|
|
441
|
+
</KateCmsUiButton>
|
|
442
|
+
</div>
|
|
443
|
+
|
|
444
|
+
<div :class="`${rootClass}__filters`">
|
|
445
|
+
<KateCmsUiSelect
|
|
446
|
+
id="collection-month"
|
|
447
|
+
v-model="monthModel"
|
|
448
|
+
:choices="monthChoices"
|
|
449
|
+
aria-label="Date"
|
|
450
|
+
/>
|
|
451
|
+
<KateCmsUiSelect
|
|
452
|
+
id="collection-sort"
|
|
453
|
+
v-model="sortModel"
|
|
454
|
+
:choices="SORT_CHOICES"
|
|
455
|
+
aria-label="Sort"
|
|
456
|
+
/>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
<form
|
|
460
|
+
:class="`${rootClass}__search`"
|
|
461
|
+
@submit.prevent="applySearch"
|
|
462
|
+
>
|
|
463
|
+
<KateCmsInputControl
|
|
464
|
+
v-model="searchInput"
|
|
465
|
+
field-key="cms-collection-search"
|
|
466
|
+
:field="{ placeholder: 'Search title or slug' }"
|
|
467
|
+
/>
|
|
468
|
+
<KateCmsUiButton
|
|
469
|
+
tag="button"
|
|
470
|
+
type="submit"
|
|
471
|
+
variant="secondary"
|
|
472
|
+
>
|
|
473
|
+
Search
|
|
474
|
+
</KateCmsUiButton>
|
|
475
|
+
</form>
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
<KateCmsUiNotice
|
|
479
|
+
v-if="loading"
|
|
480
|
+
placement="static"
|
|
481
|
+
variant="info"
|
|
482
|
+
message="Loading…"
|
|
483
|
+
:closable="false"
|
|
484
|
+
/>
|
|
485
|
+
<KateCmsUiNotice
|
|
486
|
+
v-else-if="error"
|
|
487
|
+
placement="static"
|
|
488
|
+
variant="danger"
|
|
489
|
+
:message="error"
|
|
490
|
+
@close="error = null"
|
|
491
|
+
/>
|
|
492
|
+
<KateCmsUiNotice
|
|
493
|
+
v-else-if="!entries.length"
|
|
494
|
+
placement="static"
|
|
495
|
+
variant="info"
|
|
496
|
+
:message="emptyMessage"
|
|
497
|
+
:closable="false"
|
|
498
|
+
/>
|
|
499
|
+
|
|
500
|
+
<div
|
|
501
|
+
v-else
|
|
502
|
+
:class="`${rootClass}__table-wrap`"
|
|
503
|
+
>
|
|
504
|
+
<div
|
|
505
|
+
:class="[`${rootClass}__columns`, `${rootClass}__columns--head`]"
|
|
506
|
+
role="row"
|
|
507
|
+
>
|
|
508
|
+
<span
|
|
509
|
+
role="columnheader"
|
|
510
|
+
aria-label="Select"
|
|
511
|
+
/>
|
|
512
|
+
<span role="columnheader">Title</span>
|
|
513
|
+
<span role="columnheader">Status</span>
|
|
514
|
+
<span role="columnheader">Author</span>
|
|
515
|
+
<span role="columnheader">Date</span>
|
|
516
|
+
<span
|
|
517
|
+
role="columnheader"
|
|
518
|
+
aria-label="Actions"
|
|
519
|
+
/>
|
|
520
|
+
</div>
|
|
521
|
+
<div :class="`${rootClass}__rows`">
|
|
522
|
+
<div
|
|
523
|
+
v-for="entry in entries"
|
|
524
|
+
:key="entry.id"
|
|
525
|
+
:class="[`${rootClass}__columns`, { 'is-marked': isMarked(entry.id) }]"
|
|
526
|
+
role="row"
|
|
527
|
+
>
|
|
528
|
+
<div
|
|
529
|
+
role="cell"
|
|
530
|
+
:class="`${rootClass}__check`"
|
|
531
|
+
>
|
|
532
|
+
<input
|
|
533
|
+
type="checkbox"
|
|
534
|
+
:checked="isMarked(entry.id)"
|
|
535
|
+
:aria-label="`Select ${entry.title}`"
|
|
536
|
+
@change="toggleMarked(entry.id)"
|
|
537
|
+
>
|
|
538
|
+
</div>
|
|
539
|
+
<div
|
|
540
|
+
role="cell"
|
|
541
|
+
:class="`${rootClass}__title`"
|
|
542
|
+
>
|
|
543
|
+
{{ entryListTitle(entry) }}
|
|
544
|
+
</div>
|
|
545
|
+
<div role="cell">
|
|
546
|
+
<span
|
|
547
|
+
:class="[`${rootClass}__status`, `${rootClass}__status--${entry.status}`]"
|
|
548
|
+
>
|
|
549
|
+
{{ collectionStatusLabel(entry.status) }}
|
|
550
|
+
</span>
|
|
551
|
+
</div>
|
|
552
|
+
<div role="cell">
|
|
553
|
+
{{ entryAuthor(entry) }}
|
|
554
|
+
</div>
|
|
555
|
+
<div
|
|
556
|
+
role="cell"
|
|
557
|
+
:class="`${rootClass}__date`"
|
|
558
|
+
>
|
|
559
|
+
<span :class="`${rootClass}__date-label`">{{ entryDateDisplay(entry).label }}</span>
|
|
560
|
+
<span :class="`${rootClass}__date-value`">{{ entryDateDisplay(entry).value }}</span>
|
|
561
|
+
</div>
|
|
562
|
+
<div
|
|
563
|
+
role="cell"
|
|
564
|
+
:class="`${rootClass}__actions`"
|
|
565
|
+
>
|
|
566
|
+
<KateCmsUiButton
|
|
567
|
+
v-if="entry.status !== 'trash' && viewUrl(entry)"
|
|
568
|
+
tag="a"
|
|
569
|
+
:variant="['secondary', 'small']"
|
|
570
|
+
:link="{ url: viewUrl(entry), title: 'View', target: '_blank' }"
|
|
571
|
+
>
|
|
572
|
+
View
|
|
573
|
+
</KateCmsUiButton>
|
|
574
|
+
<KateCmsUiButton
|
|
575
|
+
v-if="entry.canUpdate || entry.status === 'trash'"
|
|
576
|
+
tag="a"
|
|
577
|
+
:variant="['secondary', 'small']"
|
|
578
|
+
:link="{
|
|
579
|
+
url: paths.collectionEntry(collectionSlug, entry.id),
|
|
580
|
+
title: 'Edit'
|
|
581
|
+
}"
|
|
582
|
+
>
|
|
583
|
+
{{ entry.canUpdate ? "Edit" : "View" }}
|
|
584
|
+
</KateCmsUiButton>
|
|
585
|
+
<KateCmsUiButton
|
|
586
|
+
v-if="entry.status !== 'trash' && entry.canUpdate"
|
|
587
|
+
tag="button"
|
|
588
|
+
:variant="['red', 'small']"
|
|
589
|
+
:disabled="pendingId === entry.id || emptyingTrash"
|
|
590
|
+
@click="moveToTrash(entry)"
|
|
591
|
+
>
|
|
592
|
+
Trash
|
|
593
|
+
</KateCmsUiButton>
|
|
594
|
+
<KateCmsUiButton
|
|
595
|
+
v-if="entry.status === 'trash' && entry.canUpdate"
|
|
596
|
+
tag="button"
|
|
597
|
+
:variant="['secondary', 'small']"
|
|
598
|
+
:disabled="pendingId === entry.id || emptyingTrash"
|
|
599
|
+
@click="restore(entry)"
|
|
600
|
+
>
|
|
601
|
+
Restore
|
|
602
|
+
</KateCmsUiButton>
|
|
603
|
+
<KateCmsUiButton
|
|
604
|
+
v-if="entry.status === 'trash' && entry.canDelete"
|
|
605
|
+
tag="button"
|
|
606
|
+
:variant="['red', 'small']"
|
|
607
|
+
:disabled="pendingId === entry.id || emptyingTrash"
|
|
608
|
+
@click="removePermanent(entry)"
|
|
609
|
+
>
|
|
610
|
+
Delete
|
|
611
|
+
</KateCmsUiButton>
|
|
612
|
+
</div>
|
|
613
|
+
</div>
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
|
|
617
|
+
<div
|
|
618
|
+
v-if="totalPages > 1"
|
|
619
|
+
:class="`${rootClass}__pager`"
|
|
620
|
+
>
|
|
621
|
+
<KateCmsUiButton
|
|
622
|
+
tag="button"
|
|
623
|
+
:variant="['secondary', 'small']"
|
|
624
|
+
:disabled="page <= 1 || loading"
|
|
625
|
+
@click="setPage(page - 1)"
|
|
626
|
+
>
|
|
627
|
+
Previous
|
|
628
|
+
</KateCmsUiButton>
|
|
629
|
+
<span :class="`${rootClass}__pager-status`">
|
|
630
|
+
Page {{ page }} of {{ totalPages }}
|
|
631
|
+
</span>
|
|
632
|
+
<KateCmsUiButton
|
|
633
|
+
tag="button"
|
|
634
|
+
:variant="['secondary', 'small']"
|
|
635
|
+
:disabled="page >= totalPages || loading"
|
|
636
|
+
@click="setPage(page + 1)"
|
|
637
|
+
>
|
|
638
|
+
Next
|
|
639
|
+
</KateCmsUiButton>
|
|
640
|
+
</div>
|
|
641
|
+
</div>
|
|
642
|
+
</template>
|
|
643
|
+
|
|
644
|
+
<style scoped>
|
|
645
|
+
body#katecms-body .katecms-collection-list {
|
|
646
|
+
display: flex;
|
|
647
|
+
flex: 1;
|
|
648
|
+
flex-direction: column;
|
|
649
|
+
gap: 1rem;
|
|
650
|
+
min-height: 0;
|
|
651
|
+
padding: 0 0.5rem 0.5rem;
|
|
652
|
+
overflow: hidden;
|
|
653
|
+
}
|
|
654
|
+
body#katecms-body .katecms-collection-list__toolbar {
|
|
655
|
+
display: flex;
|
|
656
|
+
flex-shrink: 0;
|
|
657
|
+
flex-wrap: wrap;
|
|
658
|
+
align-items: center;
|
|
659
|
+
justify-content: space-between;
|
|
660
|
+
gap: 0.75rem;
|
|
661
|
+
}
|
|
662
|
+
body#katecms-body .katecms-collection-list__tabs {
|
|
663
|
+
display: flex;
|
|
664
|
+
flex-wrap: wrap;
|
|
665
|
+
gap: 0.25rem;
|
|
666
|
+
}
|
|
667
|
+
body#katecms-body .katecms-collection-list__tab {
|
|
668
|
+
display: inline-flex;
|
|
669
|
+
align-items: center;
|
|
670
|
+
gap: 0.375rem;
|
|
671
|
+
margin: 0;
|
|
672
|
+
padding: 0.375rem 0.625rem;
|
|
673
|
+
border: 0;
|
|
674
|
+
border-radius: var(--katecms-border-radius-inter);
|
|
675
|
+
background: transparent;
|
|
676
|
+
color: var(--katecms-color-muted);
|
|
677
|
+
font: inherit;
|
|
678
|
+
font-size: 0.8125rem;
|
|
679
|
+
font-weight: 500;
|
|
680
|
+
cursor: pointer;
|
|
681
|
+
}
|
|
682
|
+
body#katecms-body .katecms-collection-list__tab:hover {
|
|
683
|
+
background: var(--katecms-color-bg);
|
|
684
|
+
color: var(--katecms-color-ink);
|
|
685
|
+
}
|
|
686
|
+
body#katecms-body .katecms-collection-list__tab.is-active {
|
|
687
|
+
background: var(--katecms-color-accent-wash);
|
|
688
|
+
color: var(--katecms-color-accent);
|
|
689
|
+
}
|
|
690
|
+
body#katecms-body .katecms-collection-list__tab-count {
|
|
691
|
+
font-size: 0.75rem;
|
|
692
|
+
font-weight: 600;
|
|
693
|
+
color: inherit;
|
|
694
|
+
opacity: 0.75;
|
|
695
|
+
}
|
|
696
|
+
body#katecms-body .katecms-collection-list__search {
|
|
697
|
+
display: flex;
|
|
698
|
+
align-items: center;
|
|
699
|
+
gap: 0.5rem;
|
|
700
|
+
min-width: 13.75rem;
|
|
701
|
+
}
|
|
702
|
+
body#katecms-body .katecms-collection-list__filters {
|
|
703
|
+
display: flex;
|
|
704
|
+
flex: 1 1 22.5rem;
|
|
705
|
+
flex-wrap: wrap;
|
|
706
|
+
gap: 0.5rem;
|
|
707
|
+
min-width: 17.5rem;
|
|
708
|
+
}
|
|
709
|
+
body#katecms-body .katecms-collection-list__filters :deep(.katecms-select) {
|
|
710
|
+
flex: 1 1 11.25rem;
|
|
711
|
+
min-width: 11.25rem;
|
|
712
|
+
max-width: 16.25rem;
|
|
713
|
+
}
|
|
714
|
+
body#katecms-body .katecms-collection-list__table-wrap {
|
|
715
|
+
display: flex;
|
|
716
|
+
flex-direction: column;
|
|
717
|
+
min-height: 0;
|
|
718
|
+
overflow-x: auto;
|
|
719
|
+
overflow-y: hidden;
|
|
720
|
+
background: var(--katecms-color-surface);
|
|
721
|
+
border: 1px solid var(--katecms-color-border);
|
|
722
|
+
border-radius: var(--katecms-border-radius);
|
|
723
|
+
}
|
|
724
|
+
body#katecms-body .katecms-collection-list__columns {
|
|
725
|
+
display: grid;
|
|
726
|
+
grid-template-columns: 2.75rem minmax(11.25rem, 2.2fr) 6.875rem minmax(7.5rem, 1fr) 11.875rem minmax(10rem, auto);
|
|
727
|
+
align-items: center;
|
|
728
|
+
min-width: 51.25rem;
|
|
729
|
+
}
|
|
730
|
+
body#katecms-body .katecms-collection-list__columns > [role=columnheader],
|
|
731
|
+
body#katecms-body .katecms-collection-list__columns > [role=cell] {
|
|
732
|
+
min-width: 0;
|
|
733
|
+
padding: 0.625rem 0.875rem;
|
|
734
|
+
}
|
|
735
|
+
body#katecms-body .katecms-collection-list__columns--head {
|
|
736
|
+
flex-shrink: 0;
|
|
737
|
+
background: var(--katecms-color-bg);
|
|
738
|
+
border-bottom: 1px solid var(--katecms-color-border);
|
|
739
|
+
}
|
|
740
|
+
body#katecms-body .katecms-collection-list__columns--head > [role=columnheader] {
|
|
741
|
+
font-size: 0.75rem;
|
|
742
|
+
font-weight: 600;
|
|
743
|
+
text-transform: uppercase;
|
|
744
|
+
letter-spacing: 0.03em;
|
|
745
|
+
color: var(--katecms-color-muted);
|
|
746
|
+
}
|
|
747
|
+
body#katecms-body .katecms-collection-list__rows {
|
|
748
|
+
flex: 1;
|
|
749
|
+
min-height: 0;
|
|
750
|
+
overflow-x: hidden;
|
|
751
|
+
overflow-y: auto;
|
|
752
|
+
}
|
|
753
|
+
body#katecms-body .katecms-collection-list__rows .katecms-collection-list__columns {
|
|
754
|
+
border-bottom: 1px solid var(--katecms-color-border);
|
|
755
|
+
}
|
|
756
|
+
body#katecms-body .katecms-collection-list__rows .katecms-collection-list__columns:last-child {
|
|
757
|
+
border-bottom: none;
|
|
758
|
+
}
|
|
759
|
+
body#katecms-body .katecms-collection-list__rows .katecms-collection-list__columns.is-marked {
|
|
760
|
+
background: var(--katecms-color-accent-wash);
|
|
761
|
+
}
|
|
762
|
+
body#katecms-body .katecms-collection-list__check {
|
|
763
|
+
display: flex;
|
|
764
|
+
align-items: center;
|
|
765
|
+
}
|
|
766
|
+
body#katecms-body .katecms-collection-list__check input {
|
|
767
|
+
width: 1rem;
|
|
768
|
+
height: 1rem;
|
|
769
|
+
margin: 0;
|
|
770
|
+
accent-color: var(--katecms-color-accent);
|
|
771
|
+
cursor: pointer;
|
|
772
|
+
}
|
|
773
|
+
body#katecms-body .katecms-collection-list__title {
|
|
774
|
+
font-weight: 600;
|
|
775
|
+
overflow-wrap: anywhere;
|
|
776
|
+
}
|
|
777
|
+
body#katecms-body .katecms-collection-list__status {
|
|
778
|
+
display: inline-block;
|
|
779
|
+
padding: 0.125rem 0.5rem;
|
|
780
|
+
border-radius: var(--katecms-border-radius-inter);
|
|
781
|
+
font-size: 0.75rem;
|
|
782
|
+
font-weight: 600;
|
|
783
|
+
}
|
|
784
|
+
body#katecms-body .katecms-collection-list__status--published {
|
|
785
|
+
background: var(--katecms-color-success-bg);
|
|
786
|
+
color: var(--katecms-color-success);
|
|
787
|
+
}
|
|
788
|
+
body#katecms-body .katecms-collection-list__status--draft {
|
|
789
|
+
background: var(--katecms-color-info-bg);
|
|
790
|
+
color: var(--katecms-color-info);
|
|
791
|
+
}
|
|
792
|
+
body#katecms-body .katecms-collection-list__status--trash {
|
|
793
|
+
background: var(--katecms-color-danger-bg);
|
|
794
|
+
color: var(--katecms-color-danger);
|
|
795
|
+
}
|
|
796
|
+
body#katecms-body .katecms-collection-list__date {
|
|
797
|
+
display: flex;
|
|
798
|
+
flex-direction: column;
|
|
799
|
+
gap: 0.125rem;
|
|
800
|
+
white-space: nowrap;
|
|
801
|
+
}
|
|
802
|
+
body#katecms-body .katecms-collection-list__date-label {
|
|
803
|
+
font-size: 0.75rem;
|
|
804
|
+
color: var(--katecms-color-muted);
|
|
805
|
+
}
|
|
806
|
+
body#katecms-body .katecms-collection-list__date-value {
|
|
807
|
+
font-size: 0.8125rem;
|
|
808
|
+
}
|
|
809
|
+
body#katecms-body .katecms-collection-list__actions {
|
|
810
|
+
text-align: right;
|
|
811
|
+
white-space: nowrap;
|
|
812
|
+
display: flex;
|
|
813
|
+
justify-content: flex-end;
|
|
814
|
+
flex-wrap: wrap;
|
|
815
|
+
gap: 0.375rem;
|
|
816
|
+
}
|
|
817
|
+
body#katecms-body .katecms-collection-list__pager {
|
|
818
|
+
display: flex;
|
|
819
|
+
flex-shrink: 0;
|
|
820
|
+
align-items: center;
|
|
821
|
+
justify-content: flex-end;
|
|
822
|
+
gap: 0.75rem;
|
|
823
|
+
}
|
|
824
|
+
body#katecms-body .katecms-collection-list__pager-status {
|
|
825
|
+
font-size: 0.8125rem;
|
|
826
|
+
color: var(--katecms-color-muted);
|
|
827
|
+
}
|
|
828
|
+
</style>
|