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,677 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onMounted, ref } from 'vue'
|
|
3
|
+
import type { Field, MediaItem } from '@katecms/core'
|
|
4
|
+
import { isMediaItem } from '@katecms/core'
|
|
5
|
+
import { useMediaLibrary } from '../../composables/useMediaLibrary'
|
|
6
|
+
import type { MediaLibraryFilterState } from '../../utils/media-library-query'
|
|
7
|
+
|
|
8
|
+
type GalleryFieldConfig = Extract<Field, { type: 'gallery' }>
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<{
|
|
11
|
+
fieldKey: string
|
|
12
|
+
field?: GalleryFieldConfig
|
|
13
|
+
}>(), {
|
|
14
|
+
field: () => ({ type: 'gallery', label: '' }),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const model = defineModel<unknown>({ default: () => [] })
|
|
18
|
+
|
|
19
|
+
const rootClass = 'katecms-gallery-field'
|
|
20
|
+
const returnFormat = computed(() => props.field?.returnFormat || 'array')
|
|
21
|
+
const insertMode = computed(() => props.field?.insert || 'append')
|
|
22
|
+
const previewSize = computed(() => props.field?.previewSize || 'thumbnail')
|
|
23
|
+
const libraryEnabled = computed(() => props.field?.library !== 'uploadedTo')
|
|
24
|
+
|
|
25
|
+
const minCount = computed(() => props.field?.min ?? 0)
|
|
26
|
+
const maxCount = computed(() => props.field?.max)
|
|
27
|
+
|
|
28
|
+
const items = ref<MediaItem[]>([])
|
|
29
|
+
|
|
30
|
+
const count = computed(() => items.value.length)
|
|
31
|
+
const canAdd = computed(() => maxCount.value == null || count.value < maxCount.value)
|
|
32
|
+
const remainingSlots = computed(() =>
|
|
33
|
+
maxCount.value == null ? Infinity : Math.max(0, maxCount.value - count.value),
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
const mimeTokens = computed(() =>
|
|
37
|
+
(props.field?.mimeTypes || '')
|
|
38
|
+
.split(/[\s,]+/)
|
|
39
|
+
.map(t => t.trim().toLowerCase())
|
|
40
|
+
.filter(Boolean),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
const acceptAttr = computed(() => {
|
|
44
|
+
if (!mimeTokens.value.length) {
|
|
45
|
+
return 'image/*'
|
|
46
|
+
}
|
|
47
|
+
return mimeTokens.value.map(t => (t.includes('/') ? t : `.${t.replace(/^\./, '')}`)).join(',')
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const selectedIds = computed(() =>
|
|
51
|
+
items.value.map(item => item.id).filter((id): id is number => typeof id === 'number'),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
function previewUrl(item: MediaItem): string {
|
|
55
|
+
const size = previewSize.value
|
|
56
|
+
const variant = item.variants?.find(v => v.size === size)
|
|
57
|
+
|| (size !== 'thumbnail' ? item.variants?.find(v => v.size === 'thumbnail') : undefined)
|
|
58
|
+
return variant?.url || item.url
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function syncModel() {
|
|
62
|
+
if (returnFormat.value === 'url') {
|
|
63
|
+
model.value = items.value.map(item => item.url)
|
|
64
|
+
}
|
|
65
|
+
else if (returnFormat.value === 'id') {
|
|
66
|
+
model.value = items.value.map(item => item.id)
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
model.value = items.value.map(item => ({ ...item }))
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function hasItem(item: MediaItem): boolean {
|
|
74
|
+
if (typeof item.id === 'number') {
|
|
75
|
+
return items.value.some(existing => existing.id === item.id)
|
|
76
|
+
}
|
|
77
|
+
return items.value.some(existing => existing.url === item.url)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function addItems(newItems: MediaItem[]) {
|
|
81
|
+
const unique = newItems.filter(item => !hasItem(item))
|
|
82
|
+
const limited = unique.slice(0, remainingSlots.value)
|
|
83
|
+
if (!limited.length) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
if (insertMode.value === 'prepend') {
|
|
87
|
+
items.value = [...limited, ...items.value]
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
items.value = [...items.value, ...limited]
|
|
91
|
+
}
|
|
92
|
+
syncModel()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function removeAt(index: number) {
|
|
96
|
+
items.value = items.value.filter((_, i) => i !== index)
|
|
97
|
+
syncModel()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function clearAll() {
|
|
101
|
+
items.value = []
|
|
102
|
+
syncModel()
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function readImageSize(blob: Blob): Promise<{ width: number, height: number }> {
|
|
106
|
+
return new Promise((resolve, reject) => {
|
|
107
|
+
const url = URL.createObjectURL(blob)
|
|
108
|
+
const img = new Image()
|
|
109
|
+
img.onload = () => {
|
|
110
|
+
URL.revokeObjectURL(url)
|
|
111
|
+
resolve({ width: img.naturalWidth, height: img.naturalHeight })
|
|
112
|
+
}
|
|
113
|
+
img.onerror = () => {
|
|
114
|
+
URL.revokeObjectURL(url)
|
|
115
|
+
reject(new Error('image load error'))
|
|
116
|
+
}
|
|
117
|
+
img.src = url
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function matchesMime(mime: string, filename: string): boolean {
|
|
122
|
+
if (!mime.startsWith('image/')) {
|
|
123
|
+
return false
|
|
124
|
+
}
|
|
125
|
+
if (!mimeTokens.value.length) {
|
|
126
|
+
return true
|
|
127
|
+
}
|
|
128
|
+
const subtype = mime.split('/')[1] || ''
|
|
129
|
+
const name = filename.toLowerCase()
|
|
130
|
+
return mimeTokens.value.some((token) => {
|
|
131
|
+
if (token.includes('/')) {
|
|
132
|
+
return token.endsWith('/*') ? mime.startsWith(token.slice(0, -1)) : mime === token
|
|
133
|
+
}
|
|
134
|
+
return subtype === token || name.endsWith(`.${token}`)
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function validateBasic(mime: string, filename: string, sizeBytes: number): string | null {
|
|
139
|
+
const field = props.field
|
|
140
|
+
if (!matchesMime(mime, filename)) {
|
|
141
|
+
return field?.mimeTypes
|
|
142
|
+
? `Invalid file type. Allowed: ${field.mimeTypes}.`
|
|
143
|
+
: 'Only image files are allowed.'
|
|
144
|
+
}
|
|
145
|
+
const mb = sizeBytes / (1024 * 1024)
|
|
146
|
+
if (field?.maxSize && mb > field.maxSize) {
|
|
147
|
+
return `File is larger than ${field.maxSize} MB.`
|
|
148
|
+
}
|
|
149
|
+
if (field?.minSize && mb < field.minSize) {
|
|
150
|
+
return `File is smaller than ${field.minSize} MB.`
|
|
151
|
+
}
|
|
152
|
+
return null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function validateDimensions(width: number, height: number): string | null {
|
|
156
|
+
const field = props.field
|
|
157
|
+
if (field?.minWidth && width < field.minWidth) {
|
|
158
|
+
return `Width is less than ${field.minWidth}px.`
|
|
159
|
+
}
|
|
160
|
+
if (field?.minHeight && height < field.minHeight) {
|
|
161
|
+
return `Height is less than ${field.minHeight}px.`
|
|
162
|
+
}
|
|
163
|
+
if (field?.maxWidth && width > field.maxWidth) {
|
|
164
|
+
return `Width is greater than ${field.maxWidth}px.`
|
|
165
|
+
}
|
|
166
|
+
if (field?.maxHeight && height > field.maxHeight) {
|
|
167
|
+
return `Height is greater than ${field.maxHeight}px.`
|
|
168
|
+
}
|
|
169
|
+
return null
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function maxReachedMessage() {
|
|
173
|
+
return maxCount.value != null ? `Maximum images: ${maxCount.value}.` : null
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const open = ref(false)
|
|
177
|
+
const {
|
|
178
|
+
items: library,
|
|
179
|
+
loading,
|
|
180
|
+
loadingMore,
|
|
181
|
+
hasMore,
|
|
182
|
+
filters,
|
|
183
|
+
months,
|
|
184
|
+
load: loadLibrary,
|
|
185
|
+
loadMore,
|
|
186
|
+
applyFilters,
|
|
187
|
+
prepend: prependLibrary,
|
|
188
|
+
replace: replaceLibrary,
|
|
189
|
+
} = useMediaLibrary(() => item => matchesMime(item.mime_type, item.filename), { baseType: 'image' })
|
|
190
|
+
const error = ref<string | null>(null)
|
|
191
|
+
const uploading = ref(false)
|
|
192
|
+
const processing = ref(false)
|
|
193
|
+
|
|
194
|
+
async function fetchLibrary() {
|
|
195
|
+
error.value = null
|
|
196
|
+
try {
|
|
197
|
+
await loadLibrary({ resetFilters: true })
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
error.value = 'Could not load the media library.'
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function onLibraryFilters(next: MediaLibraryFilterState) {
|
|
205
|
+
error.value = null
|
|
206
|
+
try {
|
|
207
|
+
await applyFilters(next)
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
error.value = 'Could not load the media library.'
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function onLoadMore() {
|
|
215
|
+
try {
|
|
216
|
+
await loadMore()
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
error.value = 'Could not load more files.'
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function openModal() {
|
|
224
|
+
if (!canAdd.value) {
|
|
225
|
+
error.value = maxReachedMessage()
|
|
226
|
+
return
|
|
227
|
+
}
|
|
228
|
+
open.value = true
|
|
229
|
+
error.value = null
|
|
230
|
+
if (libraryEnabled.value) {
|
|
231
|
+
fetchLibrary()
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function closeModal() {
|
|
236
|
+
if (processing.value) {
|
|
237
|
+
return
|
|
238
|
+
}
|
|
239
|
+
open.value = false
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
async function uploadFile(file: File | Blob, filename: string): Promise<MediaItem> {
|
|
243
|
+
const form = new FormData()
|
|
244
|
+
form.append('file', file, filename)
|
|
245
|
+
const data = await $fetch<{ media: MediaItem }>('/api/_katecms/media', {
|
|
246
|
+
method: 'POST',
|
|
247
|
+
body: form,
|
|
248
|
+
})
|
|
249
|
+
return data.media
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async function waitUntilReady(item: MediaItem): Promise<MediaItem> {
|
|
253
|
+
if (item.variants_status !== 'pending') {
|
|
254
|
+
return item
|
|
255
|
+
}
|
|
256
|
+
const maxAttempts = 60
|
|
257
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
258
|
+
await new Promise(resolve => setTimeout(resolve, 1000))
|
|
259
|
+
try {
|
|
260
|
+
const data = await $fetch<{ media: MediaItem }>(`/api/_katecms/media/${item.id}`)
|
|
261
|
+
if (data.media.variants_status !== 'pending') {
|
|
262
|
+
return data.media
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
// Keep polling on a temporary error.
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return item
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async function finalizeItems(newItems: MediaItem[]) {
|
|
273
|
+
for (const item of newItems) {
|
|
274
|
+
if (!library.value.some(m => m.id === item.id)) {
|
|
275
|
+
prependLibrary(item)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
let readyItems = newItems
|
|
280
|
+
if (returnFormat.value === 'array') {
|
|
281
|
+
const pending = newItems.filter(item => item.variants_status === 'pending')
|
|
282
|
+
if (pending.length) {
|
|
283
|
+
processing.value = true
|
|
284
|
+
try {
|
|
285
|
+
readyItems = await Promise.all(
|
|
286
|
+
newItems.map(async (item) => {
|
|
287
|
+
if (item.variants_status !== 'pending') {
|
|
288
|
+
return item
|
|
289
|
+
}
|
|
290
|
+
const ready = await waitUntilReady(item)
|
|
291
|
+
replaceLibrary(ready)
|
|
292
|
+
return ready
|
|
293
|
+
}),
|
|
294
|
+
)
|
|
295
|
+
}
|
|
296
|
+
finally {
|
|
297
|
+
processing.value = false
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
addItems(readyItems)
|
|
303
|
+
open.value = false
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function onConfirm(selected: MediaItem[]) {
|
|
307
|
+
error.value = null
|
|
308
|
+
const invalid = selected.find(item => validateDimensions(item.width ?? 0, item.height ?? 0))
|
|
309
|
+
if (invalid) {
|
|
310
|
+
error.value = validateDimensions(invalid.width ?? 0, invalid.height ?? 0)
|
|
311
|
+
return
|
|
312
|
+
}
|
|
313
|
+
finalizeItems(selected)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const fileInput = ref<HTMLInputElement>()
|
|
317
|
+
|
|
318
|
+
function triggerUpload() {
|
|
319
|
+
if (!canAdd.value) {
|
|
320
|
+
error.value = maxReachedMessage()
|
|
321
|
+
return
|
|
322
|
+
}
|
|
323
|
+
fileInput.value?.click()
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
async function onFileChange(event: Event) {
|
|
327
|
+
const input = event.target as HTMLInputElement
|
|
328
|
+
const files = Array.from(input.files || [])
|
|
329
|
+
input.value = ''
|
|
330
|
+
if (!files.length) {
|
|
331
|
+
return
|
|
332
|
+
}
|
|
333
|
+
error.value = null
|
|
334
|
+
|
|
335
|
+
const toUpload = files.slice(0, remainingSlots.value)
|
|
336
|
+
if (!toUpload.length) {
|
|
337
|
+
error.value = maxReachedMessage()
|
|
338
|
+
return
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const uploaded: MediaItem[] = []
|
|
342
|
+
uploading.value = true
|
|
343
|
+
try {
|
|
344
|
+
for (const file of toUpload) {
|
|
345
|
+
const basicError = validateBasic(file.type, file.name, file.size)
|
|
346
|
+
if (basicError) {
|
|
347
|
+
error.value = basicError
|
|
348
|
+
continue
|
|
349
|
+
}
|
|
350
|
+
try {
|
|
351
|
+
const size = await readImageSize(file)
|
|
352
|
+
const dimError = validateDimensions(size.width, size.height)
|
|
353
|
+
if (dimError) {
|
|
354
|
+
error.value = dimError
|
|
355
|
+
continue
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
catch {
|
|
359
|
+
error.value = 'Could not read the image.'
|
|
360
|
+
continue
|
|
361
|
+
}
|
|
362
|
+
try {
|
|
363
|
+
const item = await uploadFile(file, file.name)
|
|
364
|
+
uploaded.push(item)
|
|
365
|
+
}
|
|
366
|
+
catch {
|
|
367
|
+
error.value = 'Could not upload the file.'
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (uploaded.length) {
|
|
371
|
+
await finalizeItems(uploaded)
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
finally {
|
|
375
|
+
uploading.value = false
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const dragIndex = ref<number | null>(null)
|
|
380
|
+
const dropIndex = ref<number | null>(null)
|
|
381
|
+
|
|
382
|
+
function onDragStart(index: number, event: DragEvent) {
|
|
383
|
+
dragIndex.value = index
|
|
384
|
+
if (event.dataTransfer) {
|
|
385
|
+
event.dataTransfer.effectAllowed = 'move'
|
|
386
|
+
event.dataTransfer.setData('text/plain', String(index))
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function onDragOver(index: number, event: DragEvent) {
|
|
391
|
+
event.preventDefault()
|
|
392
|
+
if (dragIndex.value === null || dragIndex.value === index) {
|
|
393
|
+
dropIndex.value = null
|
|
394
|
+
return
|
|
395
|
+
}
|
|
396
|
+
dropIndex.value = index
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function onDragLeave(index: number) {
|
|
400
|
+
if (dropIndex.value === index) {
|
|
401
|
+
dropIndex.value = null
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function onDrop(index: number, event: DragEvent) {
|
|
406
|
+
event.preventDefault()
|
|
407
|
+
const from = dragIndex.value
|
|
408
|
+
dragIndex.value = null
|
|
409
|
+
dropIndex.value = null
|
|
410
|
+
if (from === null || from === index) {
|
|
411
|
+
return
|
|
412
|
+
}
|
|
413
|
+
const next = [...items.value]
|
|
414
|
+
const [moved] = next.splice(from, 1)
|
|
415
|
+
if (!moved) {
|
|
416
|
+
return
|
|
417
|
+
}
|
|
418
|
+
next.splice(index, 0, moved)
|
|
419
|
+
items.value = next
|
|
420
|
+
syncModel()
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function onDragEnd() {
|
|
424
|
+
dragIndex.value = null
|
|
425
|
+
dropIndex.value = null
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
async function restoreFromModel() {
|
|
429
|
+
const value = model.value
|
|
430
|
+
if (!Array.isArray(value) || !value.length) {
|
|
431
|
+
items.value = []
|
|
432
|
+
return
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (value.every(isMediaItem)) {
|
|
436
|
+
items.value = value as MediaItem[]
|
|
437
|
+
return
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (value.every(v => typeof v === 'string')) {
|
|
441
|
+
items.value = (value as string[]).map(url => ({ url } as MediaItem))
|
|
442
|
+
return
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (value.every(v => typeof v === 'number')) {
|
|
446
|
+
try {
|
|
447
|
+
const rows = await Promise.all((value as number[]).map(async (id) => {
|
|
448
|
+
try {
|
|
449
|
+
const data = await $fetch<{ media: MediaItem }>(`/api/_katecms/media/${id}`)
|
|
450
|
+
return data.media
|
|
451
|
+
}
|
|
452
|
+
catch {
|
|
453
|
+
return null
|
|
454
|
+
}
|
|
455
|
+
}))
|
|
456
|
+
items.value = rows.filter((item): item is MediaItem => item != null)
|
|
457
|
+
}
|
|
458
|
+
catch {
|
|
459
|
+
// Keep the model value without a preview.
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
onMounted(restoreFromModel)
|
|
465
|
+
</script>
|
|
466
|
+
|
|
467
|
+
<template>
|
|
468
|
+
<KateCmsFieldWrapper
|
|
469
|
+
:field-key="fieldKey"
|
|
470
|
+
:field="field"
|
|
471
|
+
label-tag="div"
|
|
472
|
+
>
|
|
473
|
+
<div :class="rootClass">
|
|
474
|
+
<div
|
|
475
|
+
v-if="items.length"
|
|
476
|
+
:class="`${rootClass}__grid`"
|
|
477
|
+
>
|
|
478
|
+
<div
|
|
479
|
+
v-for="(item, index) in items"
|
|
480
|
+
:key="item.id ?? `${item.url}-${index}`"
|
|
481
|
+
:class="[
|
|
482
|
+
`${rootClass}__item`,
|
|
483
|
+
{
|
|
484
|
+
'is-dragging': dragIndex === index,
|
|
485
|
+
'is-drop-target': dropIndex === index,
|
|
486
|
+
},
|
|
487
|
+
]"
|
|
488
|
+
draggable="true"
|
|
489
|
+
@dragstart="onDragStart(index, $event)"
|
|
490
|
+
@dragover="onDragOver(index, $event)"
|
|
491
|
+
@dragleave="onDragLeave(index)"
|
|
492
|
+
@drop="onDrop(index, $event)"
|
|
493
|
+
@dragend="onDragEnd"
|
|
494
|
+
>
|
|
495
|
+
<img
|
|
496
|
+
:src="previewUrl(item)"
|
|
497
|
+
:alt="item.alt || ''"
|
|
498
|
+
:class="`${rootClass}__image`"
|
|
499
|
+
>
|
|
500
|
+
<div
|
|
501
|
+
:class="`${rootClass}__remove`"
|
|
502
|
+
@mousedown.stop
|
|
503
|
+
@dragstart.stop.prevent
|
|
504
|
+
>
|
|
505
|
+
<KateCmsUiButton
|
|
506
|
+
tag="button"
|
|
507
|
+
:variant="['red', 'small', 'icon']"
|
|
508
|
+
aria-label="Remove image"
|
|
509
|
+
title="Remove"
|
|
510
|
+
@click.stop="removeAt(index)"
|
|
511
|
+
>
|
|
512
|
+
<svg
|
|
513
|
+
data-v-6c98a35a=""
|
|
514
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
515
|
+
viewBox="0 0 640 640"
|
|
516
|
+
fill="currentColor"
|
|
517
|
+
><path
|
|
518
|
+
data-v-6c98a35a=""
|
|
519
|
+
d="M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z"
|
|
520
|
+
/></svg>
|
|
521
|
+
</KateCmsUiButton>
|
|
522
|
+
</div>
|
|
523
|
+
</div>
|
|
524
|
+
</div>
|
|
525
|
+
|
|
526
|
+
<div :class="`${rootClass}__toolbar`">
|
|
527
|
+
<KateCmsUiButton
|
|
528
|
+
tag="button"
|
|
529
|
+
:disabled="!canAdd"
|
|
530
|
+
@click="openModal"
|
|
531
|
+
>
|
|
532
|
+
Add Images
|
|
533
|
+
</KateCmsUiButton>
|
|
534
|
+
|
|
535
|
+
<KateCmsUiButton
|
|
536
|
+
v-if="items.length"
|
|
537
|
+
tag="button"
|
|
538
|
+
variant="red"
|
|
539
|
+
@click="clearAll"
|
|
540
|
+
>
|
|
541
|
+
Clear
|
|
542
|
+
</KateCmsUiButton>
|
|
543
|
+
|
|
544
|
+
<span
|
|
545
|
+
v-if="maxCount != null || minCount > 0"
|
|
546
|
+
:class="`${rootClass}__counter`"
|
|
547
|
+
>
|
|
548
|
+
{{ count }}{{ maxCount != null ? ` / ${maxCount}` : '' }}
|
|
549
|
+
<template v-if="minCount > 0">
|
|
550
|
+
(min {{ minCount }})
|
|
551
|
+
</template>
|
|
552
|
+
</span>
|
|
553
|
+
</div>
|
|
554
|
+
|
|
555
|
+
<div
|
|
556
|
+
v-if="error && !open"
|
|
557
|
+
:class="`${rootClass}__error`"
|
|
558
|
+
>
|
|
559
|
+
{{ error }}
|
|
560
|
+
</div>
|
|
561
|
+
|
|
562
|
+
<input
|
|
563
|
+
:id="fieldKey"
|
|
564
|
+
ref="fileInput"
|
|
565
|
+
type="file"
|
|
566
|
+
:accept="acceptAttr"
|
|
567
|
+
multiple
|
|
568
|
+
hidden
|
|
569
|
+
@change="onFileChange"
|
|
570
|
+
>
|
|
571
|
+
|
|
572
|
+
<KateCmsMediaLibraryModal
|
|
573
|
+
:open="open"
|
|
574
|
+
media-kind="image"
|
|
575
|
+
multiple
|
|
576
|
+
:library-enabled="libraryEnabled"
|
|
577
|
+
:library="library"
|
|
578
|
+
:selected-ids="selectedIds"
|
|
579
|
+
:loading="loading"
|
|
580
|
+
:loading-more="loadingMore"
|
|
581
|
+
:has-more="hasMore"
|
|
582
|
+
:filters="filters"
|
|
583
|
+
:months="months"
|
|
584
|
+
:error="error"
|
|
585
|
+
:uploading="uploading"
|
|
586
|
+
:processing="processing"
|
|
587
|
+
@close="closeModal"
|
|
588
|
+
@confirm="onConfirm"
|
|
589
|
+
@upload="triggerUpload"
|
|
590
|
+
@load-more="onLoadMore"
|
|
591
|
+
@update:filters="onLibraryFilters"
|
|
592
|
+
/>
|
|
593
|
+
</div>
|
|
594
|
+
</KateCmsFieldWrapper>
|
|
595
|
+
</template>
|
|
596
|
+
|
|
597
|
+
<style scoped lang="scss">
|
|
598
|
+
@use "../../assets/styles" as *;
|
|
599
|
+
|
|
600
|
+
$root: '.katecms-gallery-field';
|
|
601
|
+
|
|
602
|
+
#{$root} {
|
|
603
|
+
&__grid {
|
|
604
|
+
display: grid;
|
|
605
|
+
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
|
606
|
+
gap: math-rem(8);
|
|
607
|
+
margin-bottom: math-rem(12);
|
|
608
|
+
padding: math-rem(8);
|
|
609
|
+
border: 1px solid $color-border;
|
|
610
|
+
border-radius: $border-radius;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
&__item {
|
|
614
|
+
position: relative;
|
|
615
|
+
aspect-ratio: 1 / 1;
|
|
616
|
+
border: 2px solid $color-border;
|
|
617
|
+
border-radius: $border-radius;
|
|
618
|
+
overflow: hidden;
|
|
619
|
+
background-color: $color-bg;
|
|
620
|
+
cursor: grab;
|
|
621
|
+
|
|
622
|
+
&:active {
|
|
623
|
+
cursor: grabbing;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
&.is-dragging {
|
|
627
|
+
opacity: .45;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
&.is-drop-target {
|
|
631
|
+
border-color: $color-accent;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
&:hover {
|
|
635
|
+
#{$root}__remove {
|
|
636
|
+
opacity: 1;
|
|
637
|
+
visibility: visible;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
&__image {
|
|
643
|
+
display: block;
|
|
644
|
+
width: 100%;
|
|
645
|
+
height: 100%;
|
|
646
|
+
object-fit: cover;
|
|
647
|
+
pointer-events: none;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
&__remove {
|
|
651
|
+
position: absolute;
|
|
652
|
+
top: math-rem(6);
|
|
653
|
+
right: math-rem(6);
|
|
654
|
+
opacity: 0;
|
|
655
|
+
visibility: hidden;
|
|
656
|
+
transition: opacity .2s, visibility .2s;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
&__toolbar {
|
|
660
|
+
display: flex;
|
|
661
|
+
flex-wrap: wrap;
|
|
662
|
+
align-items: center;
|
|
663
|
+
gap: math-rem(8);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
&__counter {
|
|
667
|
+
font-size: math-rem(12);
|
|
668
|
+
color: $color-muted;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
&__error {
|
|
672
|
+
margin-top: math-rem(8);
|
|
673
|
+
color: $color-danger;
|
|
674
|
+
font-size: math-rem(13);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
</style>
|