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
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
import { pageLinkUrl } from "@katecms/core";
|
|
4
|
+
import { relationEntriesApi } from "../../utils/relation";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
fieldKey: { type: String, required: true },
|
|
7
|
+
field: { type: Object, required: false, default: () => ({ type: "page_link", label: "" }) }
|
|
8
|
+
});
|
|
9
|
+
const model = defineModel({ type: null });
|
|
10
|
+
const rootClass = "katecms-page-link-field";
|
|
11
|
+
const options = ref([]);
|
|
12
|
+
const loading = ref(false);
|
|
13
|
+
const loadError = ref(null);
|
|
14
|
+
function optionLabel(option) {
|
|
15
|
+
return option.title || option.url;
|
|
16
|
+
}
|
|
17
|
+
const selectChoices = computed(() => options.value.map((option) => ({
|
|
18
|
+
val: option.url,
|
|
19
|
+
lbl: optionLabel(option)
|
|
20
|
+
})));
|
|
21
|
+
function findOption(url) {
|
|
22
|
+
if (!url) {
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
25
|
+
return options.value.find((option) => option.url === url);
|
|
26
|
+
}
|
|
27
|
+
function emptyValue() {
|
|
28
|
+
if (props.field?.multiple) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
return props.field?.allowNull ? null : "";
|
|
32
|
+
}
|
|
33
|
+
const selected = computed({
|
|
34
|
+
get() {
|
|
35
|
+
if (props.field?.multiple) {
|
|
36
|
+
const items = Array.isArray(model.value) ? model.value : [];
|
|
37
|
+
return items.map(pageLinkUrl).filter(Boolean);
|
|
38
|
+
}
|
|
39
|
+
return pageLinkUrl(model.value);
|
|
40
|
+
},
|
|
41
|
+
set(raw) {
|
|
42
|
+
if (props.field?.multiple) {
|
|
43
|
+
const urls = Array.isArray(raw) ? raw.map((item) => String(item)) : [];
|
|
44
|
+
model.value = urls.filter((url) => !!findOption(url));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (raw === "" || raw == null) {
|
|
48
|
+
model.value = emptyValue();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const option = findOption(String(raw));
|
|
52
|
+
model.value = option ? option.url : emptyValue();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const placeholder = computed(() => {
|
|
56
|
+
if (props.field?.multiple) {
|
|
57
|
+
return "Select links";
|
|
58
|
+
}
|
|
59
|
+
if (props.field?.allowNull || !props.field?.required) {
|
|
60
|
+
return "Select link";
|
|
61
|
+
}
|
|
62
|
+
return "";
|
|
63
|
+
});
|
|
64
|
+
function mergeOptions(fetched, archives = []) {
|
|
65
|
+
const next = [
|
|
66
|
+
...archives,
|
|
67
|
+
...fetched.map((entry) => ({
|
|
68
|
+
url: entry.url,
|
|
69
|
+
title: entry.title || entry.slug,
|
|
70
|
+
type: entry.type
|
|
71
|
+
}))
|
|
72
|
+
];
|
|
73
|
+
const byUrl = new Map(next.map((option) => [option.url, option]));
|
|
74
|
+
for (const url of (Array.isArray(model.value) ? model.value : [model.value]).map(pageLinkUrl)) {
|
|
75
|
+
if (url && !byUrl.has(url)) {
|
|
76
|
+
byUrl.set(url, { url, title: url, type: "" });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
options.value = [...byUrl.values()];
|
|
80
|
+
}
|
|
81
|
+
function syncModel() {
|
|
82
|
+
if (props.field?.multiple) {
|
|
83
|
+
const urls = Array.isArray(model.value) ? model.value.map(pageLinkUrl).filter(Boolean) : [];
|
|
84
|
+
const next = urls.filter((url2) => !!findOption(url2));
|
|
85
|
+
if (next.length !== urls.length) {
|
|
86
|
+
model.value = next;
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const url = pageLinkUrl(model.value);
|
|
91
|
+
if (!url && props.field?.allowNull && (model.value === void 0 || model.value === "")) {
|
|
92
|
+
model.value = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function loadEntries() {
|
|
96
|
+
loading.value = true;
|
|
97
|
+
loadError.value = null;
|
|
98
|
+
try {
|
|
99
|
+
const res = await $fetch(relationEntriesApi({
|
|
100
|
+
postType: props.field?.postType,
|
|
101
|
+
dictionary: props.field?.dictionary,
|
|
102
|
+
archives: !!props.field?.allowArchives
|
|
103
|
+
}));
|
|
104
|
+
mergeOptions(res.entries, res.archives);
|
|
105
|
+
} catch {
|
|
106
|
+
loadError.value = "Could not load links.";
|
|
107
|
+
} finally {
|
|
108
|
+
loading.value = false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
onMounted(async () => {
|
|
112
|
+
await loadEntries();
|
|
113
|
+
syncModel();
|
|
114
|
+
});
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<template>
|
|
118
|
+
<KateCmsFieldWrapper
|
|
119
|
+
:field-key="fieldKey"
|
|
120
|
+
:field="field"
|
|
121
|
+
>
|
|
122
|
+
<div
|
|
123
|
+
v-if="loadError"
|
|
124
|
+
:class="`${rootClass}__error`"
|
|
125
|
+
>
|
|
126
|
+
{{ loadError }}
|
|
127
|
+
</div>
|
|
128
|
+
<KateCmsUiSelect
|
|
129
|
+
:id="fieldKey"
|
|
130
|
+
v-model="selected"
|
|
131
|
+
:name="fieldKey"
|
|
132
|
+
:choices="selectChoices"
|
|
133
|
+
:placeholder="placeholder"
|
|
134
|
+
:multiple="field?.multiple || false"
|
|
135
|
+
:required="field?.required || false"
|
|
136
|
+
:disabled="loading"
|
|
137
|
+
search
|
|
138
|
+
search-clearable
|
|
139
|
+
search-placeholder="Search links"
|
|
140
|
+
:selected-opt-clearable="!!field?.allowNull"
|
|
141
|
+
no-results-text="No links found"
|
|
142
|
+
:aria-label="field?.label || fieldKey"
|
|
143
|
+
/>
|
|
144
|
+
</KateCmsFieldWrapper>
|
|
145
|
+
</template>
|
|
146
|
+
|
|
147
|
+
<style scoped>
|
|
148
|
+
.katecms-page-link-field__error {
|
|
149
|
+
margin: 0 0 0.5rem;
|
|
150
|
+
color: var(--katecms-color-danger);
|
|
151
|
+
font-size: 0.8125rem;
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
fieldKey: { type: String, required: true },
|
|
5
|
+
field: { type: Object, required: false, default: () => ({ type: "password", label: "" }) },
|
|
6
|
+
autocomplete: { type: String, required: false, default: "new-password" }
|
|
7
|
+
});
|
|
8
|
+
defineOptions({ inheritAttrs: false });
|
|
9
|
+
const model = defineModel({ type: String });
|
|
10
|
+
const visible = ref(false);
|
|
11
|
+
const rootClass = "katecms-password-field";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<KateCmsFieldWrapper
|
|
16
|
+
:field-key="fieldKey"
|
|
17
|
+
:field="field"
|
|
18
|
+
>
|
|
19
|
+
<KateCmsInputControl
|
|
20
|
+
v-model="model"
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
:type="visible ? 'text' : 'password'"
|
|
23
|
+
:field-key="fieldKey"
|
|
24
|
+
:field="field"
|
|
25
|
+
:autocomplete="autocomplete"
|
|
26
|
+
>
|
|
27
|
+
<template #append>
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
:class="[
|
|
31
|
+
`${rootClass}__toggle`,
|
|
32
|
+
{ [`${rootClass}__toggle--before-addon`]: props.field?.append }
|
|
33
|
+
]"
|
|
34
|
+
:aria-label="visible ? 'Hide password' : 'Show password'"
|
|
35
|
+
:aria-pressed="visible"
|
|
36
|
+
@click="visible = !visible"
|
|
37
|
+
>
|
|
38
|
+
<svg
|
|
39
|
+
v-if="visible"
|
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
+
viewBox="0 0 24 24"
|
|
42
|
+
fill="none"
|
|
43
|
+
stroke="currentColor"
|
|
44
|
+
stroke-width="2"
|
|
45
|
+
stroke-linecap="round"
|
|
46
|
+
stroke-linejoin="round"
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
>
|
|
49
|
+
<path d="M3 3l18 18" />
|
|
50
|
+
<path d="M10.6 10.6a2 2 0 1 0 2.8 2.8" />
|
|
51
|
+
<path d="M9.4 5.5A9 9 0 0 1 12 5c6.5 0 10 7 10 7a18 18 0 0 1-2.2 3.1" />
|
|
52
|
+
<path d="M6.6 6.6C3.8 8.5 2 12 2 12s3.5 7 10 7a9.7 9.7 0 0 0 4.4-1" />
|
|
53
|
+
</svg>
|
|
54
|
+
<svg
|
|
55
|
+
v-else
|
|
56
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
+
viewBox="0 0 24 24"
|
|
58
|
+
fill="none"
|
|
59
|
+
stroke="currentColor"
|
|
60
|
+
stroke-width="2"
|
|
61
|
+
stroke-linecap="round"
|
|
62
|
+
stroke-linejoin="round"
|
|
63
|
+
aria-hidden="true"
|
|
64
|
+
>
|
|
65
|
+
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" />
|
|
66
|
+
<circle
|
|
67
|
+
cx="12"
|
|
68
|
+
cy="12"
|
|
69
|
+
r="3"
|
|
70
|
+
/>
|
|
71
|
+
</svg>
|
|
72
|
+
</button>
|
|
73
|
+
</template>
|
|
74
|
+
</KateCmsInputControl>
|
|
75
|
+
</KateCmsFieldWrapper>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<style scoped>
|
|
79
|
+
.katecms-password-field__toggle {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
flex: 0 0 auto;
|
|
84
|
+
width: 2.375rem;
|
|
85
|
+
padding: 0;
|
|
86
|
+
background-color: var(--katecms-color-bg);
|
|
87
|
+
border: 1px solid var(--katecms-color-border);
|
|
88
|
+
border-left: 0;
|
|
89
|
+
border-radius: 0 var(--katecms-border-radius-inter) var(--katecms-border-radius-inter) 0;
|
|
90
|
+
color: var(--katecms-color-ink);
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
.katecms-password-field__toggle svg {
|
|
94
|
+
display: block;
|
|
95
|
+
width: 18px;
|
|
96
|
+
height: 18px;
|
|
97
|
+
}
|
|
98
|
+
.katecms-password-field__toggle--before-addon {
|
|
99
|
+
border-radius: 0;
|
|
100
|
+
}
|
|
101
|
+
.katecms-password-field__toggle:focus {
|
|
102
|
+
outline: none;
|
|
103
|
+
}
|
|
104
|
+
.katecms-password-field__toggle:focus-visible {
|
|
105
|
+
border-color: var(--katecms-color-accent);
|
|
106
|
+
color: var(--katecms-color-accent);
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
encodeRelationEntryValue,
|
|
5
|
+
isRelationEntryValue,
|
|
6
|
+
relationFieldId
|
|
7
|
+
} from "@katecms/core";
|
|
8
|
+
import { relationEntriesApi } from "../../utils/relation";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
fieldKey: { type: String, required: true },
|
|
11
|
+
field: { type: Object, required: false, default: () => ({ type: "post_object", label: "" }) }
|
|
12
|
+
});
|
|
13
|
+
const model = defineModel({ type: null });
|
|
14
|
+
const rootClass = "katecms-post-object-field";
|
|
15
|
+
function entriesFromModel(value) {
|
|
16
|
+
const items = Array.isArray(value) ? value : value != null && value !== "" ? [value] : [];
|
|
17
|
+
return items.filter(isRelationEntryValue);
|
|
18
|
+
}
|
|
19
|
+
const entries = ref(entriesFromModel(model.value));
|
|
20
|
+
const loading = ref(false);
|
|
21
|
+
const loadError = ref(null);
|
|
22
|
+
function entryLabel(entry) {
|
|
23
|
+
return entry.title || entry.slug;
|
|
24
|
+
}
|
|
25
|
+
const selectChoices = computed(() => entries.value.map((entry) => ({
|
|
26
|
+
val: entry.id,
|
|
27
|
+
lbl: entryLabel(entry)
|
|
28
|
+
})));
|
|
29
|
+
function findEntry(id) {
|
|
30
|
+
if (!id) {
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
return entries.value.find((entry) => String(entry.id) === id);
|
|
34
|
+
}
|
|
35
|
+
function emptyValue() {
|
|
36
|
+
if (props.field?.multiple) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
return props.field?.allowNull ? null : "";
|
|
40
|
+
}
|
|
41
|
+
const selected = computed({
|
|
42
|
+
get() {
|
|
43
|
+
if (props.field?.multiple) {
|
|
44
|
+
return Array.isArray(model.value) ? model.value.map(relationFieldId).filter(Boolean) : [];
|
|
45
|
+
}
|
|
46
|
+
return relationFieldId(model.value);
|
|
47
|
+
},
|
|
48
|
+
set(raw) {
|
|
49
|
+
if (props.field?.multiple) {
|
|
50
|
+
const ids = Array.isArray(raw) ? raw.map((id) => String(id)) : [];
|
|
51
|
+
model.value = ids.map((id) => findEntry(id)).filter((entry2) => !!entry2).map((entry2) => encodeRelationEntryValue(entry2, props.field?.returnFormat));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (raw === "" || raw == null) {
|
|
55
|
+
model.value = emptyValue();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const entry = findEntry(String(raw));
|
|
59
|
+
model.value = entry ? encodeRelationEntryValue(entry, props.field?.returnFormat) : emptyValue();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const placeholder = computed(() => {
|
|
63
|
+
if (props.field?.multiple) {
|
|
64
|
+
return "Select entries";
|
|
65
|
+
}
|
|
66
|
+
if (props.field?.allowNull || !props.field?.required) {
|
|
67
|
+
return "Select entry";
|
|
68
|
+
}
|
|
69
|
+
return "";
|
|
70
|
+
});
|
|
71
|
+
function mergeEntries(fetched) {
|
|
72
|
+
const byId = new Map(fetched.map((entry) => [entry.id, entry]));
|
|
73
|
+
for (const existing of entries.value) {
|
|
74
|
+
if (!byId.has(existing.id)) {
|
|
75
|
+
byId.set(existing.id, existing);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
entries.value = [...byId.values()];
|
|
79
|
+
}
|
|
80
|
+
function syncModel() {
|
|
81
|
+
if (props.field?.multiple) {
|
|
82
|
+
const ids = Array.isArray(model.value) ? model.value.map(relationFieldId).filter(Boolean) : [];
|
|
83
|
+
const next = ids.map((id2) => findEntry(id2)).filter((entry) => !!entry);
|
|
84
|
+
if (next.length !== ids.length) {
|
|
85
|
+
model.value = next.map((entry) => encodeRelationEntryValue(entry, props.field?.returnFormat));
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const id = relationFieldId(model.value);
|
|
90
|
+
if (!id && props.field?.allowNull && (model.value === void 0 || model.value === "")) {
|
|
91
|
+
model.value = null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function loadEntries() {
|
|
95
|
+
loading.value = true;
|
|
96
|
+
loadError.value = null;
|
|
97
|
+
try {
|
|
98
|
+
const res = await $fetch(relationEntriesApi({
|
|
99
|
+
postType: props.field?.postType,
|
|
100
|
+
dictionary: props.field?.dictionary
|
|
101
|
+
}));
|
|
102
|
+
mergeEntries(res.entries);
|
|
103
|
+
} catch {
|
|
104
|
+
loadError.value = "Could not load entries.";
|
|
105
|
+
} finally {
|
|
106
|
+
loading.value = false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
onMounted(async () => {
|
|
110
|
+
await loadEntries();
|
|
111
|
+
syncModel();
|
|
112
|
+
});
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<template>
|
|
116
|
+
<KateCmsFieldWrapper
|
|
117
|
+
:field-key="fieldKey"
|
|
118
|
+
:field="field"
|
|
119
|
+
>
|
|
120
|
+
<div
|
|
121
|
+
v-if="loadError"
|
|
122
|
+
:class="`${rootClass}__error`"
|
|
123
|
+
>
|
|
124
|
+
{{ loadError }}
|
|
125
|
+
</div>
|
|
126
|
+
<KateCmsUiSelect
|
|
127
|
+
:id="fieldKey"
|
|
128
|
+
v-model="selected"
|
|
129
|
+
:name="fieldKey"
|
|
130
|
+
:choices="selectChoices"
|
|
131
|
+
:placeholder="placeholder"
|
|
132
|
+
:multiple="field?.multiple || false"
|
|
133
|
+
:required="field?.required || false"
|
|
134
|
+
:disabled="loading"
|
|
135
|
+
search
|
|
136
|
+
search-clearable
|
|
137
|
+
search-placeholder="Search entries"
|
|
138
|
+
:selected-opt-clearable="!!field?.allowNull"
|
|
139
|
+
no-results-text="No entries found"
|
|
140
|
+
:aria-label="field?.label || fieldKey"
|
|
141
|
+
/>
|
|
142
|
+
</KateCmsFieldWrapper>
|
|
143
|
+
</template>
|
|
144
|
+
|
|
145
|
+
<style scoped>
|
|
146
|
+
.katecms-post-object-field__error {
|
|
147
|
+
margin: 0 0 0.5rem;
|
|
148
|
+
color: var(--katecms-color-danger);
|
|
149
|
+
font-size: 0.8125rem;
|
|
150
|
+
}
|
|
151
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
choiceMapLookup,
|
|
5
|
+
decodeChoiceValue,
|
|
6
|
+
encodeChoiceValue
|
|
7
|
+
} from "@katecms/core";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
fieldKey: { type: String, required: true },
|
|
10
|
+
field: { type: Object, required: false, default: () => ({ type: "radio", label: "", choices: {} }) }
|
|
11
|
+
});
|
|
12
|
+
const model = defineModel({ type: null });
|
|
13
|
+
const rootClass = "katecms-radio-field";
|
|
14
|
+
const customKeys = ref([]);
|
|
15
|
+
const customDraft = ref("");
|
|
16
|
+
const configuredChoices = computed(() => props.field?.choices ?? {});
|
|
17
|
+
function rememberCustom(keys) {
|
|
18
|
+
const configured = configuredChoices.value;
|
|
19
|
+
for (const key of keys) {
|
|
20
|
+
if (!key || key in configured || customKeys.value.includes(key)) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
customKeys.value = [...customKeys.value, key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const displayChoices = computed(() => {
|
|
27
|
+
const map = { ...configuredChoices.value };
|
|
28
|
+
for (const key of customKeys.value) {
|
|
29
|
+
if (!(key in map)) {
|
|
30
|
+
map[key] = key;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return map;
|
|
34
|
+
});
|
|
35
|
+
const lookup = computed(() => choiceMapLookup(displayChoices.value));
|
|
36
|
+
function format(raw) {
|
|
37
|
+
return encodeChoiceValue(raw, lookup.value, props.field?.returnFormat);
|
|
38
|
+
}
|
|
39
|
+
function unformat(value) {
|
|
40
|
+
return decodeChoiceValue(value, lookup.value, props.field?.returnFormat);
|
|
41
|
+
}
|
|
42
|
+
const selected = computed({
|
|
43
|
+
get: () => unformat(model.value),
|
|
44
|
+
set: (raw) => {
|
|
45
|
+
model.value = raw === "" ? "" : format(raw);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
watch(selected, (raw) => {
|
|
49
|
+
rememberCustom(raw ? [raw] : []);
|
|
50
|
+
}, { immediate: true });
|
|
51
|
+
const canAddCustom = computed(
|
|
52
|
+
() => !!props.field?.allowCustomChoices && customDraft.value.trim().length > 0
|
|
53
|
+
);
|
|
54
|
+
const addLabel = computed(() => props.field?.customChoiceButtonText || "Add");
|
|
55
|
+
function addCustom() {
|
|
56
|
+
const term = customDraft.value.trim();
|
|
57
|
+
if (!term || !props.field?.allowCustomChoices) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
rememberCustom([term]);
|
|
61
|
+
selected.value = term;
|
|
62
|
+
customDraft.value = "";
|
|
63
|
+
}
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
const raw = selected.value;
|
|
66
|
+
model.value = raw === "" ? "" : format(raw);
|
|
67
|
+
});
|
|
68
|
+
function onRadioClick(value) {
|
|
69
|
+
if (props.field?.allowNull && selected.value === value) {
|
|
70
|
+
selected.value = "";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<KateCmsFieldWrapper
|
|
77
|
+
:field-key="fieldKey"
|
|
78
|
+
:field="field"
|
|
79
|
+
label-tag="div"
|
|
80
|
+
>
|
|
81
|
+
<div :class="rootClass">
|
|
82
|
+
<div
|
|
83
|
+
:class="[
|
|
84
|
+
`${rootClass}__choices`,
|
|
85
|
+
`${rootClass}__choices--${field?.layout || 'vertical'}`
|
|
86
|
+
]"
|
|
87
|
+
>
|
|
88
|
+
<label
|
|
89
|
+
v-for="(label, value) in displayChoices"
|
|
90
|
+
:key="value"
|
|
91
|
+
:class="`${rootClass}__item`"
|
|
92
|
+
>
|
|
93
|
+
<input
|
|
94
|
+
v-model="selected"
|
|
95
|
+
type="radio"
|
|
96
|
+
:name="fieldKey"
|
|
97
|
+
:value="value"
|
|
98
|
+
@click="onRadioClick(value)"
|
|
99
|
+
>
|
|
100
|
+
<span>{{ label }}</span>
|
|
101
|
+
</label>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<form
|
|
105
|
+
v-if="field?.allowCustomChoices"
|
|
106
|
+
:class="`${rootClass}__add`"
|
|
107
|
+
@submit.prevent="addCustom"
|
|
108
|
+
>
|
|
109
|
+
<KateCmsInputControl
|
|
110
|
+
v-model="customDraft"
|
|
111
|
+
:field-key="`${fieldKey}_custom`"
|
|
112
|
+
:field="{ placeholder: 'Other' }"
|
|
113
|
+
/>
|
|
114
|
+
<KateCmsUiButton
|
|
115
|
+
tag="button"
|
|
116
|
+
type="submit"
|
|
117
|
+
variant="secondary"
|
|
118
|
+
:disabled="!canAddCustom"
|
|
119
|
+
>
|
|
120
|
+
{{ addLabel }}
|
|
121
|
+
</KateCmsUiButton>
|
|
122
|
+
</form>
|
|
123
|
+
</div>
|
|
124
|
+
</KateCmsFieldWrapper>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<style scoped>
|
|
128
|
+
.katecms-radio-field {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
gap: 0.625rem;
|
|
132
|
+
}
|
|
133
|
+
.katecms-radio-field__choices {
|
|
134
|
+
display: flex;
|
|
135
|
+
gap: 0.5rem 1rem;
|
|
136
|
+
}
|
|
137
|
+
.katecms-radio-field__choices--vertical {
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
}
|
|
140
|
+
.katecms-radio-field__choices--horizontal {
|
|
141
|
+
flex-direction: row;
|
|
142
|
+
flex-wrap: wrap;
|
|
143
|
+
}
|
|
144
|
+
.katecms-radio-field__item {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
gap: 0.375rem;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
color: var(--katecms-color-ink);
|
|
150
|
+
}
|
|
151
|
+
.katecms-radio-field__item input {
|
|
152
|
+
accent-color: var(--katecms-color-accent);
|
|
153
|
+
}
|
|
154
|
+
.katecms-radio-field__add {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: 0.5rem;
|
|
158
|
+
}
|
|
159
|
+
.katecms-radio-field__add :deep(.katecms-input-control) {
|
|
160
|
+
flex: 1 1 auto;
|
|
161
|
+
min-width: 0;
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const rootClass = "katecms-range-field";
|
|
3
|
+
defineProps({
|
|
4
|
+
fieldKey: { type: String, required: true },
|
|
5
|
+
field: { type: Object, required: false, default: () => ({ type: "range", label: "" }) }
|
|
6
|
+
});
|
|
7
|
+
const model = defineModel({ type: Number });
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<KateCmsFieldWrapper
|
|
12
|
+
:field-key="fieldKey"
|
|
13
|
+
:field="field"
|
|
14
|
+
>
|
|
15
|
+
<KateCmsInputControl
|
|
16
|
+
v-model="model"
|
|
17
|
+
type="range"
|
|
18
|
+
numeric
|
|
19
|
+
:field-key="fieldKey"
|
|
20
|
+
:field="field"
|
|
21
|
+
:min="field?.min ?? void 0"
|
|
22
|
+
:max="field?.max ?? void 0"
|
|
23
|
+
:step="field?.step ?? void 0"
|
|
24
|
+
>
|
|
25
|
+
<template #append>
|
|
26
|
+
<div :class="`${rootClass}__value`">
|
|
27
|
+
{{ `${model} / ${field?.max ?? "100"}` }}
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
</KateCmsInputControl>
|
|
31
|
+
</KateCmsFieldWrapper>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style scoped>
|
|
35
|
+
.katecms-range-field__value {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 50%;
|
|
39
|
+
transform: translateX(-50%);
|
|
40
|
+
font-variant-numeric: tabular-nums;
|
|
41
|
+
font-size: 0.6875rem;
|
|
42
|
+
line-height: 1.2;
|
|
43
|
+
color: var(--katecms-color-muted);
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
min-width: 20px;
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
File without changes
|
|
File without changes
|