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,955 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref, watch } from 'vue'
|
|
3
|
+
import { $fetch, navigateTo, useHead, useRoute } from '#imports'
|
|
4
|
+
import { buildPublicPath } from '@katecms/core'
|
|
5
|
+
import type { CollectionStatus, SelectModelValue } from '@katecms/core'
|
|
6
|
+
|
|
7
|
+
const COLLECTION_LIST_SORTS = [
|
|
8
|
+
'date-desc',
|
|
9
|
+
'date-asc',
|
|
10
|
+
'author-asc',
|
|
11
|
+
'author-desc',
|
|
12
|
+
'title-asc',
|
|
13
|
+
'title-desc',
|
|
14
|
+
] as const
|
|
15
|
+
|
|
16
|
+
type CollectionListSort = typeof COLLECTION_LIST_SORTS[number]
|
|
17
|
+
import { parseAuthError } from '../../../utils/auth-error'
|
|
18
|
+
import { localUtcOffsetMinutes, monthLabel } from '../../../utils/media-library-query'
|
|
19
|
+
import {
|
|
20
|
+
collectionApi,
|
|
21
|
+
collectionStatusLabel,
|
|
22
|
+
} from '../../../utils/collections'
|
|
23
|
+
import type {
|
|
24
|
+
AdminCollectionMeta,
|
|
25
|
+
AdminEntry,
|
|
26
|
+
CollectionListFilter,
|
|
27
|
+
CollectionListResponse,
|
|
28
|
+
} from '../../../utils/collections'
|
|
29
|
+
import { useCmsPaths } from '../../../composables/useCmsPaths'
|
|
30
|
+
|
|
31
|
+
const route = useRoute()
|
|
32
|
+
const paths = useCmsPaths()
|
|
33
|
+
const rootClass = 'katecms-collection-list'
|
|
34
|
+
|
|
35
|
+
const collectionSlug = computed(() => String(route.params.collection ?? ''))
|
|
36
|
+
const statusFilter = computed<CollectionListFilter>(() => {
|
|
37
|
+
const raw = String(route.query.status ?? 'all')
|
|
38
|
+
if (raw === 'published' || raw === 'draft' || raw === 'trash' || raw === 'all') {
|
|
39
|
+
return raw
|
|
40
|
+
}
|
|
41
|
+
return 'all'
|
|
42
|
+
})
|
|
43
|
+
const searchQuery = computed(() => String(route.query.q ?? ''))
|
|
44
|
+
const page = computed(() => Math.max(1, Number(route.query.page) || 1))
|
|
45
|
+
const monthFilter = computed(() => {
|
|
46
|
+
const raw = String(route.query.month ?? '')
|
|
47
|
+
return /^\d{4}-(0[1-9]|1[0-2])$/.test(raw) ? raw : 'all'
|
|
48
|
+
})
|
|
49
|
+
const sortFilter = computed<CollectionListSort>(() => {
|
|
50
|
+
const raw = String(route.query.sort ?? 'date-desc')
|
|
51
|
+
return (COLLECTION_LIST_SORTS as readonly string[]).includes(raw)
|
|
52
|
+
? raw as CollectionListSort
|
|
53
|
+
: 'date-desc'
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const collection = ref<AdminCollectionMeta | null>(null)
|
|
57
|
+
const entries = ref<AdminEntry[]>([])
|
|
58
|
+
const months = ref<string[]>([])
|
|
59
|
+
const counts = ref({ all: 0, published: 0, draft: 0, trash: 0 })
|
|
60
|
+
const total = ref(0)
|
|
61
|
+
const perPage = ref(10)
|
|
62
|
+
const canCreate = ref(false)
|
|
63
|
+
const canDelete = ref(false)
|
|
64
|
+
|
|
65
|
+
const loading = ref(true)
|
|
66
|
+
const error = ref<string | null>(null)
|
|
67
|
+
const pendingId = ref<number | null>(null)
|
|
68
|
+
const emptyingTrash = ref(false)
|
|
69
|
+
const deletingMarked = ref(false)
|
|
70
|
+
const markedIds = ref<number[]>([])
|
|
71
|
+
const searchInput = ref('')
|
|
72
|
+
|
|
73
|
+
const SORT_CHOICES: { val: CollectionListSort, lbl: string }[] = [
|
|
74
|
+
{ val: 'date-desc', lbl: 'Date, newest' },
|
|
75
|
+
{ val: 'date-asc', lbl: 'Date, oldest' },
|
|
76
|
+
{ val: 'author-asc', lbl: 'Author, A–Z' },
|
|
77
|
+
{ val: 'author-desc', lbl: 'Author, Z–A' },
|
|
78
|
+
{ val: 'title-asc', lbl: 'Title, A–Z' },
|
|
79
|
+
{ val: 'title-desc', lbl: 'Title, Z–A' },
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
const title = computed(() => collection.value?.labels.name || '')
|
|
83
|
+
useHead({ title })
|
|
84
|
+
|
|
85
|
+
const totalPages = computed(() => {
|
|
86
|
+
if (perPage.value < 1) {
|
|
87
|
+
return 1
|
|
88
|
+
}
|
|
89
|
+
return Math.max(1, Math.ceil(total.value / perPage.value))
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const monthChoices = computed(() => {
|
|
93
|
+
const values = [...months.value]
|
|
94
|
+
if (monthFilter.value !== 'all' && !values.includes(monthFilter.value)) {
|
|
95
|
+
values.push(monthFilter.value)
|
|
96
|
+
}
|
|
97
|
+
values.sort((a, b) => b.localeCompare(a))
|
|
98
|
+
return [
|
|
99
|
+
{ val: 'all', lbl: 'All dates' },
|
|
100
|
+
...values.map(value => ({ val: value, lbl: monthLabel(value) })),
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
const markedEntries = computed(() =>
|
|
105
|
+
entries.value.filter(entry => markedIds.value.includes(entry.id)),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
const bulkTrashIds = computed(() =>
|
|
109
|
+
statusFilter.value === 'trash'
|
|
110
|
+
? []
|
|
111
|
+
: markedEntries.value.filter(entry => entry.canUpdate).map(entry => entry.id),
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
const bulkDeleteIds = computed(() =>
|
|
115
|
+
statusFilter.value === 'trash'
|
|
116
|
+
? markedEntries.value.filter(entry => entry.canDelete).map(entry => entry.id)
|
|
117
|
+
: [],
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
const emptyMessage = computed(() => {
|
|
121
|
+
if (searchQuery.value || monthFilter.value !== 'all') {
|
|
122
|
+
return 'No entries match.'
|
|
123
|
+
}
|
|
124
|
+
if (statusFilter.value === 'trash') {
|
|
125
|
+
return 'Trash is empty.'
|
|
126
|
+
}
|
|
127
|
+
if (statusFilter.value === 'draft') {
|
|
128
|
+
return 'No drafts.'
|
|
129
|
+
}
|
|
130
|
+
if (statusFilter.value === 'published') {
|
|
131
|
+
return 'No published entries.'
|
|
132
|
+
}
|
|
133
|
+
return 'No entries yet.'
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
watch(searchQuery, (value) => {
|
|
137
|
+
searchInput.value = value
|
|
138
|
+
}, { immediate: true })
|
|
139
|
+
|
|
140
|
+
function viewUrl(entry: AdminEntry): string | null {
|
|
141
|
+
if (collection.value?.public === false) {
|
|
142
|
+
return null
|
|
143
|
+
}
|
|
144
|
+
const path = buildPublicPath(
|
|
145
|
+
collection.value?.rewrite,
|
|
146
|
+
collectionSlug.value,
|
|
147
|
+
entry.slugPath || entry.slug,
|
|
148
|
+
)
|
|
149
|
+
return entry.status === 'draft' ? `${path}?preview=1` : path
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function entryListTitle(entry: AdminEntry): string {
|
|
153
|
+
const depth = collection.value?.hierarchical ? (entry.depth ?? 0) : 0
|
|
154
|
+
if (depth < 1) {
|
|
155
|
+
return entry.title
|
|
156
|
+
}
|
|
157
|
+
return `${'— '.repeat(depth)}${entry.title}`
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function formatListDate(iso: string): string {
|
|
161
|
+
const date = new Date(iso)
|
|
162
|
+
if (Number.isNaN(date.getTime())) {
|
|
163
|
+
return iso
|
|
164
|
+
}
|
|
165
|
+
return date.toLocaleString('en-US', {
|
|
166
|
+
year: 'numeric',
|
|
167
|
+
month: 'short',
|
|
168
|
+
day: 'numeric',
|
|
169
|
+
hour: 'numeric',
|
|
170
|
+
minute: '2-digit',
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function entryAuthor(entry: AdminEntry): string {
|
|
175
|
+
return entry.authorName?.trim() || '—'
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function entryDateDisplay(entry: AdminEntry): { label: 'Published' | 'Last Modified', value: string } {
|
|
179
|
+
const publishedMs = entry.publishedAt ? Date.parse(entry.publishedAt) : Number.NaN
|
|
180
|
+
const updatedMs = Date.parse(entry.updatedAt)
|
|
181
|
+
const hasPublished = !Number.isNaN(publishedMs)
|
|
182
|
+
const hasUpdated = !Number.isNaN(updatedMs)
|
|
183
|
+
const modified = entry.status !== 'published'
|
|
184
|
+
|| !hasPublished
|
|
185
|
+
|| (hasUpdated && updatedMs - publishedMs > 2000)
|
|
186
|
+
|
|
187
|
+
if (!modified && entry.publishedAt) {
|
|
188
|
+
return { label: 'Published', value: formatListDate(entry.publishedAt) }
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
label: 'Last Modified',
|
|
192
|
+
value: formatListDate(hasUpdated ? entry.updatedAt : (entry.publishedAt ?? entry.createdAt)),
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function navigateQuery(query: Record<string, string> = {}) {
|
|
197
|
+
await navigateTo({
|
|
198
|
+
path: paths.collection(collectionSlug.value),
|
|
199
|
+
query,
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function listQuery(patch: {
|
|
204
|
+
status?: CollectionListFilter
|
|
205
|
+
q?: string
|
|
206
|
+
page?: number
|
|
207
|
+
month?: string
|
|
208
|
+
sort?: CollectionListSort
|
|
209
|
+
} = {}) {
|
|
210
|
+
const status = patch.status ?? statusFilter.value
|
|
211
|
+
const q = patch.q ?? searchQuery.value
|
|
212
|
+
const month = patch.month ?? monthFilter.value
|
|
213
|
+
const sort = patch.sort ?? sortFilter.value
|
|
214
|
+
const nextPage = patch.page ?? 1
|
|
215
|
+
const query: Record<string, string> = {}
|
|
216
|
+
if (q) {
|
|
217
|
+
query.q = q
|
|
218
|
+
}
|
|
219
|
+
else if (status !== 'all') {
|
|
220
|
+
query.status = status
|
|
221
|
+
}
|
|
222
|
+
if (month !== 'all') {
|
|
223
|
+
query.month = month
|
|
224
|
+
}
|
|
225
|
+
if (sort !== 'date-desc') {
|
|
226
|
+
query.sort = sort
|
|
227
|
+
}
|
|
228
|
+
if (nextPage > 1) {
|
|
229
|
+
query.page = String(nextPage)
|
|
230
|
+
}
|
|
231
|
+
return query
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function setStatus(status: CollectionListFilter) {
|
|
235
|
+
return navigateQuery(listQuery({ status, q: '', page: 1 }))
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function applySearch() {
|
|
239
|
+
return navigateQuery(listQuery({
|
|
240
|
+
q: searchInput.value.trim(),
|
|
241
|
+
status: 'all',
|
|
242
|
+
page: 1,
|
|
243
|
+
}))
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function setMonth(month: string) {
|
|
247
|
+
return navigateQuery(listQuery({ month, page: 1 }))
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function setSort(sort: CollectionListSort) {
|
|
251
|
+
return navigateQuery(listQuery({ sort, page: 1 }))
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function setPage(next: number) {
|
|
255
|
+
return navigateQuery(listQuery({ page: next }))
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const monthModel = computed({
|
|
259
|
+
get(): SelectModelValue {
|
|
260
|
+
return monthFilter.value
|
|
261
|
+
},
|
|
262
|
+
set(value: SelectModelValue) {
|
|
263
|
+
const raw = typeof value === 'string' ? value : 'all'
|
|
264
|
+
const month = raw === 'all' || /^\d{4}-(0[1-9]|1[0-2])$/.test(raw) ? raw : 'all'
|
|
265
|
+
void setMonth(month)
|
|
266
|
+
},
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
const sortModel = computed({
|
|
270
|
+
get(): SelectModelValue {
|
|
271
|
+
return sortFilter.value
|
|
272
|
+
},
|
|
273
|
+
set(value: SelectModelValue) {
|
|
274
|
+
const raw = typeof value === 'string' ? value : 'date-desc'
|
|
275
|
+
const sort = (COLLECTION_LIST_SORTS as readonly string[]).includes(raw)
|
|
276
|
+
? raw as CollectionListSort
|
|
277
|
+
: 'date-desc'
|
|
278
|
+
void setSort(sort)
|
|
279
|
+
},
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
function isMarked(id: number): boolean {
|
|
283
|
+
return markedIds.value.includes(id)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function toggleMarked(id: number) {
|
|
287
|
+
markedIds.value = isMarked(id)
|
|
288
|
+
? markedIds.value.filter(entry => entry !== id)
|
|
289
|
+
: [...markedIds.value, id]
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
async function load() {
|
|
293
|
+
if (!collectionSlug.value) {
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
loading.value = true
|
|
297
|
+
error.value = null
|
|
298
|
+
markedIds.value = []
|
|
299
|
+
try {
|
|
300
|
+
const res = await $fetch<CollectionListResponse>(collectionApi(collectionSlug.value), {
|
|
301
|
+
query: {
|
|
302
|
+
status: searchQuery.value ? undefined : statusFilter.value,
|
|
303
|
+
q: searchQuery.value || undefined,
|
|
304
|
+
month: monthFilter.value === 'all' ? undefined : monthFilter.value,
|
|
305
|
+
sort: sortFilter.value,
|
|
306
|
+
tz: localUtcOffsetMinutes(),
|
|
307
|
+
page: page.value,
|
|
308
|
+
},
|
|
309
|
+
})
|
|
310
|
+
collection.value = res.collection
|
|
311
|
+
entries.value = res.entries
|
|
312
|
+
months.value = res.months ?? []
|
|
313
|
+
counts.value = res.counts
|
|
314
|
+
total.value = res.total
|
|
315
|
+
perPage.value = res.perPage
|
|
316
|
+
canCreate.value = res.canCreate
|
|
317
|
+
canDelete.value = res.canDelete
|
|
318
|
+
}
|
|
319
|
+
catch (err) {
|
|
320
|
+
collection.value = null
|
|
321
|
+
entries.value = []
|
|
322
|
+
canDelete.value = false
|
|
323
|
+
error.value = parseAuthError(err, 'Could not load entries.').message
|
|
324
|
+
}
|
|
325
|
+
finally {
|
|
326
|
+
loading.value = false
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
async function moveToTrash(entry: AdminEntry) {
|
|
331
|
+
if (!entry.canUpdate || pendingId.value !== null) {
|
|
332
|
+
return
|
|
333
|
+
}
|
|
334
|
+
if (!window.confirm(`Move “${entry.title}” to trash?`)) {
|
|
335
|
+
return
|
|
336
|
+
}
|
|
337
|
+
pendingId.value = entry.id
|
|
338
|
+
error.value = null
|
|
339
|
+
try {
|
|
340
|
+
await $fetch(collectionApi(collectionSlug.value, entry.id), {
|
|
341
|
+
method: 'PATCH',
|
|
342
|
+
body: { status: 'trash' satisfies CollectionStatus },
|
|
343
|
+
})
|
|
344
|
+
await load()
|
|
345
|
+
}
|
|
346
|
+
catch (err) {
|
|
347
|
+
error.value = parseAuthError(err, 'Could not move the entry to trash.').message
|
|
348
|
+
}
|
|
349
|
+
finally {
|
|
350
|
+
pendingId.value = null
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async function restore(entry: AdminEntry) {
|
|
355
|
+
if (!entry.canUpdate || pendingId.value !== null) {
|
|
356
|
+
return
|
|
357
|
+
}
|
|
358
|
+
pendingId.value = entry.id
|
|
359
|
+
error.value = null
|
|
360
|
+
try {
|
|
361
|
+
await $fetch(collectionApi(collectionSlug.value, entry.id), {
|
|
362
|
+
method: 'PATCH',
|
|
363
|
+
body: { status: 'draft' satisfies CollectionStatus },
|
|
364
|
+
})
|
|
365
|
+
await load()
|
|
366
|
+
}
|
|
367
|
+
catch (err) {
|
|
368
|
+
error.value = parseAuthError(err, 'Could not restore the entry.').message
|
|
369
|
+
}
|
|
370
|
+
finally {
|
|
371
|
+
pendingId.value = null
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async function removePermanent(entry: AdminEntry) {
|
|
376
|
+
if (!entry.canDelete || pendingId.value !== null) {
|
|
377
|
+
return
|
|
378
|
+
}
|
|
379
|
+
if (!window.confirm(`Delete “${entry.title}” permanently? This cannot be undone.`)) {
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
pendingId.value = entry.id
|
|
383
|
+
error.value = null
|
|
384
|
+
try {
|
|
385
|
+
await $fetch(collectionApi(collectionSlug.value, entry.id), { method: 'DELETE' })
|
|
386
|
+
await load()
|
|
387
|
+
}
|
|
388
|
+
catch (err) {
|
|
389
|
+
error.value = parseAuthError(err, 'Could not delete the entry.').message
|
|
390
|
+
}
|
|
391
|
+
finally {
|
|
392
|
+
pendingId.value = null
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async function removeMarked() {
|
|
397
|
+
const trashIds = bulkTrashIds.value
|
|
398
|
+
const deleteIds = bulkDeleteIds.value
|
|
399
|
+
const ids = trashIds.length ? trashIds : deleteIds
|
|
400
|
+
if (!ids.length || deletingMarked.value || pendingId.value !== null) {
|
|
401
|
+
return
|
|
402
|
+
}
|
|
403
|
+
const permanent = deleteIds.length > 0
|
|
404
|
+
const label = permanent
|
|
405
|
+
? (ids.length === 1
|
|
406
|
+
? 'Delete 1 entry permanently? This cannot be undone.'
|
|
407
|
+
: `Delete ${ids.length} entries permanently? This cannot be undone.`)
|
|
408
|
+
: (ids.length === 1
|
|
409
|
+
? 'Move 1 entry to trash?'
|
|
410
|
+
: `Move ${ids.length} entries to trash?`)
|
|
411
|
+
if (!window.confirm(label)) {
|
|
412
|
+
return
|
|
413
|
+
}
|
|
414
|
+
deletingMarked.value = true
|
|
415
|
+
error.value = null
|
|
416
|
+
const failed: number[] = []
|
|
417
|
+
await Promise.all(ids.map(async (id) => {
|
|
418
|
+
try {
|
|
419
|
+
if (permanent) {
|
|
420
|
+
await $fetch(collectionApi(collectionSlug.value, id), { method: 'DELETE' })
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
await $fetch(collectionApi(collectionSlug.value, id), {
|
|
424
|
+
method: 'PATCH',
|
|
425
|
+
body: { status: 'trash' satisfies CollectionStatus },
|
|
426
|
+
})
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
failed.push(id)
|
|
431
|
+
}
|
|
432
|
+
}))
|
|
433
|
+
deletingMarked.value = false
|
|
434
|
+
await load()
|
|
435
|
+
if (failed.length) {
|
|
436
|
+
error.value = failed.length === 1
|
|
437
|
+
? 'Could not update 1 entry.'
|
|
438
|
+
: `Could not update ${failed.length} entries.`
|
|
439
|
+
}
|
|
440
|
+
else if (!entries.value.length && page.value > 1) {
|
|
441
|
+
await setPage(page.value - 1)
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
async function emptyTrash() {
|
|
446
|
+
if (!canDelete.value || emptyingTrash.value || pendingId.value !== null || counts.value.trash <= 0) {
|
|
447
|
+
return
|
|
448
|
+
}
|
|
449
|
+
if (!window.confirm('Permanently delete all items in the trash? This cannot be undone.')) {
|
|
450
|
+
return
|
|
451
|
+
}
|
|
452
|
+
emptyingTrash.value = true
|
|
453
|
+
error.value = null
|
|
454
|
+
try {
|
|
455
|
+
await $fetch(collectionApi(collectionSlug.value, 'trash'), { method: 'DELETE' })
|
|
456
|
+
await load()
|
|
457
|
+
}
|
|
458
|
+
catch (err) {
|
|
459
|
+
error.value = parseAuthError(err, 'Could not empty the trash.').message
|
|
460
|
+
}
|
|
461
|
+
finally {
|
|
462
|
+
emptyingTrash.value = false
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
onMounted(load)
|
|
467
|
+
watch([collectionSlug, statusFilter, searchQuery, monthFilter, sortFilter, page], load)
|
|
468
|
+
</script>
|
|
469
|
+
|
|
470
|
+
<template>
|
|
471
|
+
<div :class="rootClass">
|
|
472
|
+
<KateCmsAdminHeader :title="title">
|
|
473
|
+
<KateCmsUiButton
|
|
474
|
+
v-if="canCreate && collection"
|
|
475
|
+
tag="a"
|
|
476
|
+
:link="{ url: paths.collectionCreate(collectionSlug), title: 'Add' }"
|
|
477
|
+
>
|
|
478
|
+
Add {{ collection.labels.singularName || collection.labels.name }}
|
|
479
|
+
</KateCmsUiButton>
|
|
480
|
+
|
|
481
|
+
<KateCmsUiButton
|
|
482
|
+
v-if="bulkTrashIds.length"
|
|
483
|
+
tag="button"
|
|
484
|
+
variant="red"
|
|
485
|
+
:disabled="deletingMarked || pendingId !== null || emptyingTrash"
|
|
486
|
+
@click="removeMarked"
|
|
487
|
+
>
|
|
488
|
+
{{ deletingMarked ? 'Moving…' : `Trash selected (${bulkTrashIds.length})` }}
|
|
489
|
+
</KateCmsUiButton>
|
|
490
|
+
<KateCmsUiButton
|
|
491
|
+
v-if="bulkDeleteIds.length"
|
|
492
|
+
tag="button"
|
|
493
|
+
variant="red"
|
|
494
|
+
:disabled="deletingMarked || pendingId !== null || emptyingTrash"
|
|
495
|
+
@click="removeMarked"
|
|
496
|
+
>
|
|
497
|
+
{{ deletingMarked ? 'Deleting…' : `Delete selected (${bulkDeleteIds.length})` }}
|
|
498
|
+
</KateCmsUiButton>
|
|
499
|
+
|
|
500
|
+
<KateCmsUiButton
|
|
501
|
+
v-if="statusFilter === 'trash' && canDelete && counts.trash > 0"
|
|
502
|
+
tag="button"
|
|
503
|
+
variant="red"
|
|
504
|
+
:disabled="emptyingTrash || pendingId !== null || loading"
|
|
505
|
+
@click="emptyTrash"
|
|
506
|
+
>
|
|
507
|
+
{{ emptyingTrash ? 'Emptying…' : 'Empty Trash' }}
|
|
508
|
+
</KateCmsUiButton>
|
|
509
|
+
</KateCmsAdminHeader>
|
|
510
|
+
|
|
511
|
+
<div :class="`${rootClass}__toolbar`">
|
|
512
|
+
<div :class="`${rootClass}__tabs`">
|
|
513
|
+
<KateCmsUiButton
|
|
514
|
+
v-for="tab in [
|
|
515
|
+
{ id: 'all' as const, label: 'All', count: counts.all },
|
|
516
|
+
{ id: 'published' as const, label: 'Published', count: counts.published },
|
|
517
|
+
{ id: 'draft' as const, label: 'Draft', count: counts.draft },
|
|
518
|
+
{ id: 'trash' as const, label: 'Trash', count: counts.trash },
|
|
519
|
+
]"
|
|
520
|
+
:key="tab.id"
|
|
521
|
+
tag="button"
|
|
522
|
+
variant="tertiary"
|
|
523
|
+
:active="!searchQuery && statusFilter === tab.id"
|
|
524
|
+
@click="setStatus(tab.id)"
|
|
525
|
+
>
|
|
526
|
+
{{ tab.label }}
|
|
527
|
+
{{ tab.count }}
|
|
528
|
+
</KateCmsUiButton>
|
|
529
|
+
</div>
|
|
530
|
+
|
|
531
|
+
<div :class="`${rootClass}__filters`">
|
|
532
|
+
<KateCmsUiSelect
|
|
533
|
+
id="collection-month"
|
|
534
|
+
v-model="monthModel"
|
|
535
|
+
:choices="monthChoices"
|
|
536
|
+
aria-label="Date"
|
|
537
|
+
/>
|
|
538
|
+
<KateCmsUiSelect
|
|
539
|
+
id="collection-sort"
|
|
540
|
+
v-model="sortModel"
|
|
541
|
+
:choices="SORT_CHOICES"
|
|
542
|
+
aria-label="Sort"
|
|
543
|
+
/>
|
|
544
|
+
</div>
|
|
545
|
+
|
|
546
|
+
<form
|
|
547
|
+
:class="`${rootClass}__search`"
|
|
548
|
+
@submit.prevent="applySearch"
|
|
549
|
+
>
|
|
550
|
+
<KateCmsInputControl
|
|
551
|
+
v-model="searchInput"
|
|
552
|
+
field-key="cms-collection-search"
|
|
553
|
+
:field="{ placeholder: 'Search title or slug' }"
|
|
554
|
+
/>
|
|
555
|
+
<KateCmsUiButton
|
|
556
|
+
tag="button"
|
|
557
|
+
type="submit"
|
|
558
|
+
variant="secondary"
|
|
559
|
+
>
|
|
560
|
+
Search
|
|
561
|
+
</KateCmsUiButton>
|
|
562
|
+
</form>
|
|
563
|
+
</div>
|
|
564
|
+
|
|
565
|
+
<KateCmsUiNotice
|
|
566
|
+
v-if="loading"
|
|
567
|
+
placement="static"
|
|
568
|
+
variant="info"
|
|
569
|
+
message="Loading…"
|
|
570
|
+
:closable="false"
|
|
571
|
+
/>
|
|
572
|
+
<KateCmsUiNotice
|
|
573
|
+
v-else-if="error"
|
|
574
|
+
placement="static"
|
|
575
|
+
variant="danger"
|
|
576
|
+
:message="error"
|
|
577
|
+
@close="error = null"
|
|
578
|
+
/>
|
|
579
|
+
<KateCmsUiNotice
|
|
580
|
+
v-else-if="!entries.length"
|
|
581
|
+
placement="static"
|
|
582
|
+
variant="info"
|
|
583
|
+
:message="emptyMessage"
|
|
584
|
+
:closable="false"
|
|
585
|
+
/>
|
|
586
|
+
|
|
587
|
+
<div
|
|
588
|
+
v-else
|
|
589
|
+
:class="`${rootClass}__table-wrap`"
|
|
590
|
+
>
|
|
591
|
+
<div
|
|
592
|
+
:class="[`${rootClass}__columns`, `${rootClass}__columns--head`]"
|
|
593
|
+
role="row"
|
|
594
|
+
>
|
|
595
|
+
<span
|
|
596
|
+
role="columnheader"
|
|
597
|
+
aria-label="Select"
|
|
598
|
+
/>
|
|
599
|
+
<span role="columnheader">Title</span>
|
|
600
|
+
<span role="columnheader">Status</span>
|
|
601
|
+
<span role="columnheader">Author</span>
|
|
602
|
+
<span role="columnheader">Date</span>
|
|
603
|
+
<span
|
|
604
|
+
role="columnheader"
|
|
605
|
+
aria-label="Actions"
|
|
606
|
+
/>
|
|
607
|
+
</div>
|
|
608
|
+
<div :class="`${rootClass}__rows`">
|
|
609
|
+
<div
|
|
610
|
+
v-for="entry in entries"
|
|
611
|
+
:key="entry.id"
|
|
612
|
+
:class="[`${rootClass}__columns`, { 'is-marked': isMarked(entry.id) }]"
|
|
613
|
+
role="row"
|
|
614
|
+
>
|
|
615
|
+
<div
|
|
616
|
+
role="cell"
|
|
617
|
+
:class="`${rootClass}__check`"
|
|
618
|
+
>
|
|
619
|
+
<input
|
|
620
|
+
type="checkbox"
|
|
621
|
+
:checked="isMarked(entry.id)"
|
|
622
|
+
:aria-label="`Select ${entry.title}`"
|
|
623
|
+
@change="toggleMarked(entry.id)"
|
|
624
|
+
>
|
|
625
|
+
</div>
|
|
626
|
+
<div
|
|
627
|
+
role="cell"
|
|
628
|
+
:class="`${rootClass}__title`"
|
|
629
|
+
>
|
|
630
|
+
{{ entryListTitle(entry) }}
|
|
631
|
+
</div>
|
|
632
|
+
<div role="cell">
|
|
633
|
+
<span
|
|
634
|
+
:class="[`${rootClass}__status`, `${rootClass}__status--${entry.status}`]"
|
|
635
|
+
>
|
|
636
|
+
{{ collectionStatusLabel(entry.status) }}
|
|
637
|
+
</span>
|
|
638
|
+
</div>
|
|
639
|
+
<div role="cell">
|
|
640
|
+
{{ entryAuthor(entry) }}
|
|
641
|
+
</div>
|
|
642
|
+
<div
|
|
643
|
+
role="cell"
|
|
644
|
+
:class="`${rootClass}__date`"
|
|
645
|
+
>
|
|
646
|
+
<span :class="`${rootClass}__date-label`">{{ entryDateDisplay(entry).label }}</span>
|
|
647
|
+
<span :class="`${rootClass}__date-value`">{{ entryDateDisplay(entry).value }}</span>
|
|
648
|
+
</div>
|
|
649
|
+
<div
|
|
650
|
+
role="cell"
|
|
651
|
+
:class="`${rootClass}__actions`"
|
|
652
|
+
>
|
|
653
|
+
<KateCmsUiButton
|
|
654
|
+
v-if="entry.status !== 'trash' && viewUrl(entry)"
|
|
655
|
+
tag="a"
|
|
656
|
+
:variant="['secondary', 'small']"
|
|
657
|
+
:link="{ url: viewUrl(entry)!, title: 'View', target: '_blank' }"
|
|
658
|
+
>
|
|
659
|
+
View
|
|
660
|
+
</KateCmsUiButton>
|
|
661
|
+
<KateCmsUiButton
|
|
662
|
+
v-if="entry.canUpdate || entry.status === 'trash'"
|
|
663
|
+
tag="a"
|
|
664
|
+
:variant="['secondary', 'small']"
|
|
665
|
+
:link="{
|
|
666
|
+
url: paths.collectionEntry(collectionSlug, entry.id),
|
|
667
|
+
title: 'Edit',
|
|
668
|
+
}"
|
|
669
|
+
>
|
|
670
|
+
{{ entry.canUpdate ? 'Edit' : 'View' }}
|
|
671
|
+
</KateCmsUiButton>
|
|
672
|
+
<KateCmsUiButton
|
|
673
|
+
v-if="entry.status !== 'trash' && entry.canUpdate"
|
|
674
|
+
tag="button"
|
|
675
|
+
:variant="['red', 'small']"
|
|
676
|
+
:disabled="pendingId === entry.id || emptyingTrash"
|
|
677
|
+
@click="moveToTrash(entry)"
|
|
678
|
+
>
|
|
679
|
+
Trash
|
|
680
|
+
</KateCmsUiButton>
|
|
681
|
+
<KateCmsUiButton
|
|
682
|
+
v-if="entry.status === 'trash' && entry.canUpdate"
|
|
683
|
+
tag="button"
|
|
684
|
+
:variant="['secondary', 'small']"
|
|
685
|
+
:disabled="pendingId === entry.id || emptyingTrash"
|
|
686
|
+
@click="restore(entry)"
|
|
687
|
+
>
|
|
688
|
+
Restore
|
|
689
|
+
</KateCmsUiButton>
|
|
690
|
+
<KateCmsUiButton
|
|
691
|
+
v-if="entry.status === 'trash' && entry.canDelete"
|
|
692
|
+
tag="button"
|
|
693
|
+
:variant="['red', 'small']"
|
|
694
|
+
:disabled="pendingId === entry.id || emptyingTrash"
|
|
695
|
+
@click="removePermanent(entry)"
|
|
696
|
+
>
|
|
697
|
+
Delete
|
|
698
|
+
</KateCmsUiButton>
|
|
699
|
+
</div>
|
|
700
|
+
</div>
|
|
701
|
+
</div>
|
|
702
|
+
</div>
|
|
703
|
+
|
|
704
|
+
<div
|
|
705
|
+
v-if="totalPages > 1"
|
|
706
|
+
:class="`${rootClass}__pager`"
|
|
707
|
+
>
|
|
708
|
+
<KateCmsUiButton
|
|
709
|
+
tag="button"
|
|
710
|
+
:variant="['secondary', 'small']"
|
|
711
|
+
:disabled="page <= 1 || loading"
|
|
712
|
+
@click="setPage(page - 1)"
|
|
713
|
+
>
|
|
714
|
+
Previous
|
|
715
|
+
</KateCmsUiButton>
|
|
716
|
+
<span :class="`${rootClass}__pager-status`">
|
|
717
|
+
Page {{ page }} of {{ totalPages }}
|
|
718
|
+
</span>
|
|
719
|
+
<KateCmsUiButton
|
|
720
|
+
tag="button"
|
|
721
|
+
:variant="['secondary', 'small']"
|
|
722
|
+
:disabled="page >= totalPages || loading"
|
|
723
|
+
@click="setPage(page + 1)"
|
|
724
|
+
>
|
|
725
|
+
Next
|
|
726
|
+
</KateCmsUiButton>
|
|
727
|
+
</div>
|
|
728
|
+
</div>
|
|
729
|
+
</template>
|
|
730
|
+
|
|
731
|
+
<style scoped lang="scss">
|
|
732
|
+
@use "../../../assets/styles" as *;
|
|
733
|
+
|
|
734
|
+
$root: '.katecms-collection-list';
|
|
735
|
+
|
|
736
|
+
@include katecms-wrapper {
|
|
737
|
+
#{$root} {
|
|
738
|
+
display: flex;
|
|
739
|
+
flex: 1;
|
|
740
|
+
flex-direction: column;
|
|
741
|
+
gap: math-rem(16);
|
|
742
|
+
min-height: 0;
|
|
743
|
+
padding: 0 math-rem(8) math-rem(8);
|
|
744
|
+
overflow: hidden;
|
|
745
|
+
|
|
746
|
+
&__toolbar {
|
|
747
|
+
display: flex;
|
|
748
|
+
flex-shrink: 0;
|
|
749
|
+
flex-wrap: wrap;
|
|
750
|
+
align-items: center;
|
|
751
|
+
justify-content: space-between;
|
|
752
|
+
gap: math-rem(12);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
&__tabs {
|
|
756
|
+
display: flex;
|
|
757
|
+
flex-wrap: wrap;
|
|
758
|
+
gap: math-rem(4);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
&__tab {
|
|
762
|
+
display: inline-flex;
|
|
763
|
+
align-items: center;
|
|
764
|
+
gap: math-rem(6);
|
|
765
|
+
margin: 0;
|
|
766
|
+
padding: math-rem(6) math-rem(10);
|
|
767
|
+
border: 0;
|
|
768
|
+
border-radius: $border-radius-inter;
|
|
769
|
+
background: transparent;
|
|
770
|
+
color: $color-muted;
|
|
771
|
+
font: inherit;
|
|
772
|
+
font-size: math-rem(13);
|
|
773
|
+
font-weight: 500;
|
|
774
|
+
cursor: pointer;
|
|
775
|
+
|
|
776
|
+
&:hover {
|
|
777
|
+
background: $color-bg;
|
|
778
|
+
color: $color-ink;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
&.is-active {
|
|
782
|
+
background: $color-accent-wash;
|
|
783
|
+
color: $color-accent;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
&-count {
|
|
787
|
+
font-size: math-rem(12);
|
|
788
|
+
font-weight: 600;
|
|
789
|
+
color: inherit;
|
|
790
|
+
opacity: 0.75;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
&__search {
|
|
795
|
+
display: flex;
|
|
796
|
+
align-items: center;
|
|
797
|
+
gap: math-rem(8);
|
|
798
|
+
min-width: math-rem(220);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
&__filters {
|
|
802
|
+
display: flex;
|
|
803
|
+
flex: 1 1 math-rem(360);
|
|
804
|
+
flex-wrap: wrap;
|
|
805
|
+
gap: math-rem(8);
|
|
806
|
+
min-width: math-rem(280);
|
|
807
|
+
|
|
808
|
+
:deep(.katecms-select) {
|
|
809
|
+
flex: 1 1 math-rem(180);
|
|
810
|
+
min-width: math-rem(180);
|
|
811
|
+
max-width: math-rem(260);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
&__table {
|
|
816
|
+
&-wrap {
|
|
817
|
+
display: flex;
|
|
818
|
+
flex-direction: column;
|
|
819
|
+
min-height: 0;
|
|
820
|
+
overflow-x: auto;
|
|
821
|
+
overflow-y: hidden;
|
|
822
|
+
background: $color-surface;
|
|
823
|
+
border: 1px solid $color-border;
|
|
824
|
+
border-radius: $border-radius;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
&__columns {
|
|
829
|
+
display: grid;
|
|
830
|
+
grid-template-columns: math-rem(44) minmax(math-rem(180), 2.2fr) math-rem(110) minmax(math-rem(120), 1fr) math-rem(190) minmax(math-rem(160), auto);
|
|
831
|
+
align-items: center;
|
|
832
|
+
min-width: math-rem(820);
|
|
833
|
+
|
|
834
|
+
> [role='columnheader'],
|
|
835
|
+
> [role='cell'] {
|
|
836
|
+
min-width: 0;
|
|
837
|
+
padding: math-rem(10) math-rem(14);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
&--head {
|
|
841
|
+
flex-shrink: 0;
|
|
842
|
+
background: $color-bg;
|
|
843
|
+
border-bottom: 1px solid $color-border;
|
|
844
|
+
|
|
845
|
+
> [role='columnheader'] {
|
|
846
|
+
font-size: math-rem(12);
|
|
847
|
+
font-weight: 600;
|
|
848
|
+
text-transform: uppercase;
|
|
849
|
+
letter-spacing: 0.03em;
|
|
850
|
+
color: $color-muted;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
&__rows {
|
|
856
|
+
flex: 1;
|
|
857
|
+
min-height: 0;
|
|
858
|
+
overflow-x: hidden;
|
|
859
|
+
overflow-y: auto;
|
|
860
|
+
|
|
861
|
+
#{$root}__columns {
|
|
862
|
+
border-bottom: 1px solid $color-border;
|
|
863
|
+
|
|
864
|
+
&:last-child {
|
|
865
|
+
border-bottom: none;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
&.is-marked {
|
|
869
|
+
background: $color-accent-wash;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
&__check {
|
|
875
|
+
display: flex;
|
|
876
|
+
align-items: center;
|
|
877
|
+
|
|
878
|
+
input {
|
|
879
|
+
width: math-rem(16);
|
|
880
|
+
height: math-rem(16);
|
|
881
|
+
margin: 0;
|
|
882
|
+
accent-color: $color-accent;
|
|
883
|
+
cursor: pointer;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
&__title {
|
|
888
|
+
font-weight: 600;
|
|
889
|
+
overflow-wrap: anywhere;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
&__status {
|
|
893
|
+
display: inline-block;
|
|
894
|
+
padding: math-rem(2) math-rem(8);
|
|
895
|
+
border-radius: $border-radius-inter;
|
|
896
|
+
font-size: math-rem(12);
|
|
897
|
+
font-weight: 600;
|
|
898
|
+
|
|
899
|
+
&--published {
|
|
900
|
+
background: $color-success-bg;
|
|
901
|
+
color: $color-success;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
&--draft {
|
|
905
|
+
background: $color-info-bg;
|
|
906
|
+
color: $color-info;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
&--trash {
|
|
910
|
+
background: $color-danger-bg;
|
|
911
|
+
color: $color-danger;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
&__date {
|
|
916
|
+
display: flex;
|
|
917
|
+
flex-direction: column;
|
|
918
|
+
gap: math-rem(2);
|
|
919
|
+
white-space: nowrap;
|
|
920
|
+
|
|
921
|
+
&-label {
|
|
922
|
+
font-size: math-rem(12);
|
|
923
|
+
color: $color-muted;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
&-value {
|
|
927
|
+
font-size: math-rem(13);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
&__actions {
|
|
932
|
+
text-align: right;
|
|
933
|
+
white-space: nowrap;
|
|
934
|
+
|
|
935
|
+
display: flex;
|
|
936
|
+
justify-content: flex-end;
|
|
937
|
+
flex-wrap: wrap;
|
|
938
|
+
gap: math-rem(6);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
&__pager {
|
|
942
|
+
display: flex;
|
|
943
|
+
flex-shrink: 0;
|
|
944
|
+
align-items: center;
|
|
945
|
+
justify-content: flex-end;
|
|
946
|
+
gap: math-rem(12);
|
|
947
|
+
|
|
948
|
+
&-status {
|
|
949
|
+
font-size: math-rem(13);
|
|
950
|
+
color: $color-muted;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
</style>
|