@xleddyl/nuxt-cms 0.9.4 → 0.10.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 +1 -1
- package/dist/module.d.mts +20 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1037 -148
- package/dist/runtime/app/blocks/CmsBlocks.d.vue.ts +1 -1
- package/dist/runtime/app/blocks/CmsBlocks.vue +57 -9
- package/dist/runtime/app/blocks/CmsBlocks.vue.d.ts +1 -1
- package/dist/runtime/app/blocks/CmsField.d.ts +24 -0
- package/dist/runtime/app/blocks/CmsField.js +16 -0
- package/dist/runtime/app/blocks/node.d.ts +37 -0
- package/dist/runtime/app/blocks/node.js +17 -0
- package/dist/runtime/app/blocks/resolve.d.ts +18 -0
- package/dist/runtime/app/blocks/resolve.js +34 -0
- package/dist/runtime/app/components/cms/BlockPicker.d.vue.ts +22 -0
- package/dist/runtime/app/components/cms/BlockPicker.vue +87 -0
- package/dist/runtime/app/components/cms/BlockPicker.vue.d.ts +22 -0
- package/dist/runtime/app/components/cms/BlockPickerPopover.d.vue.ts +38 -0
- package/dist/runtime/app/components/cms/BlockPickerPopover.vue +44 -0
- package/dist/runtime/app/components/cms/BlockPickerPopover.vue.d.ts +38 -0
- package/dist/runtime/app/components/cms/BlockTree.d.vue.ts +29 -0
- package/dist/runtime/app/components/cms/BlockTree.vue +322 -0
- package/dist/runtime/app/components/cms/BlockTree.vue.d.ts +29 -0
- package/dist/runtime/app/components/cms/BlocksField.vue +569 -219
- package/dist/runtime/app/components/cms/BrandMark.vue +7 -13
- package/dist/runtime/app/components/cms/ConfirmGroups.vue +15 -13
- package/dist/runtime/app/components/cms/{BlockPalette.vue.d.ts → EditorHistory.d.vue.ts} +6 -5
- package/dist/runtime/app/components/cms/EditorHistory.vue +34 -0
- package/dist/runtime/app/components/cms/{BlockPalette.d.vue.ts → EditorHistory.vue.d.ts} +6 -5
- package/dist/runtime/app/components/cms/EntryDrawer.d.vue.ts +11 -5
- package/dist/runtime/app/components/cms/EntryDrawer.vue +183 -152
- package/dist/runtime/app/components/cms/EntryDrawer.vue.d.ts +11 -5
- package/dist/runtime/app/components/cms/EntryForm.d.vue.ts +16 -4
- package/dist/runtime/app/components/cms/EntryForm.vue +106 -147
- package/dist/runtime/app/components/cms/EntryForm.vue.d.ts +16 -4
- package/dist/runtime/app/components/cms/FieldInput.vue +10 -2
- package/dist/runtime/app/components/cms/FormSections.d.vue.ts +22 -0
- package/dist/runtime/app/components/cms/FormSections.vue +71 -0
- package/dist/runtime/app/components/cms/FormSections.vue.d.ts +22 -0
- package/dist/runtime/app/components/cms/ImportModal.vue +46 -58
- package/dist/runtime/app/components/cms/LinkField.d.vue.ts +16 -0
- package/dist/runtime/app/components/cms/LinkField.vue +250 -0
- package/dist/runtime/app/components/cms/LinkField.vue.d.ts +16 -0
- package/dist/runtime/app/components/cms/ListFilters.vue +10 -12
- package/dist/runtime/app/components/cms/LocaleSwitch.d.vue.ts +2 -1
- package/dist/runtime/app/components/cms/LocaleSwitch.vue +19 -11
- package/dist/runtime/app/components/cms/LocaleSwitch.vue.d.ts +2 -1
- package/dist/runtime/app/components/cms/MediaDetail.d.vue.ts +2 -0
- package/dist/runtime/app/components/cms/MediaDetail.vue +112 -83
- package/dist/runtime/app/components/cms/MediaDetail.vue.d.ts +2 -0
- package/dist/runtime/app/components/cms/MediaField.vue +35 -25
- package/dist/runtime/app/components/cms/MediaFolderPicker.vue +26 -71
- package/dist/runtime/app/components/cms/MediaGallery.d.vue.ts +1 -0
- package/dist/runtime/app/components/cms/MediaGallery.vue +442 -419
- package/dist/runtime/app/components/cms/MediaGallery.vue.d.ts +1 -0
- package/dist/runtime/app/components/cms/MediaThumb.vue +9 -25
- package/dist/runtime/app/components/cms/MediaUpload.vue +1 -1
- package/dist/runtime/app/components/cms/{BlockOutline.d.vue.ts → NestedBlockList.d.vue.ts} +5 -5
- package/dist/runtime/app/components/cms/NestedBlockList.vue +87 -0
- package/dist/runtime/app/components/cms/{BlockOutline.vue.d.ts → NestedBlockList.vue.d.ts} +5 -5
- package/dist/runtime/app/components/cms/PoweredBy.vue +12 -5
- package/dist/runtime/app/components/cms/PresetModal.d.vue.ts +18 -0
- package/dist/runtime/app/components/cms/PresetModal.vue +70 -0
- package/dist/runtime/app/components/cms/PresetModal.vue.d.ts +18 -0
- package/dist/runtime/app/components/cms/RelationField.vue +2 -8
- package/dist/runtime/app/components/cms/SettingsAccount.vue +60 -71
- package/dist/runtime/app/components/cms/SettingsColumns.vue +47 -69
- package/dist/runtime/app/components/cms/SettingsEmptyAdd.d.vue.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsEmptyAdd.vue +21 -0
- package/dist/runtime/app/components/cms/SettingsEmptyAdd.vue.d.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsEntries.d.vue.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsEntries.vue +50 -0
- package/dist/runtime/app/components/cms/SettingsEntries.vue.d.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsEntry.d.vue.ts +1 -10
- package/dist/runtime/app/components/cms/SettingsEntry.vue +11 -95
- package/dist/runtime/app/components/cms/SettingsEntry.vue.d.ts +1 -10
- package/dist/runtime/app/components/cms/SettingsEntryActions.d.vue.ts +7 -0
- package/dist/runtime/app/components/cms/SettingsEntryActions.vue +40 -0
- package/dist/runtime/app/components/cms/SettingsEntryActions.vue.d.ts +7 -0
- package/dist/runtime/app/components/cms/SettingsEntryTabs.d.vue.ts +7 -0
- package/dist/runtime/app/components/cms/SettingsEntryTabs.vue +21 -0
- package/dist/runtime/app/components/cms/SettingsEntryTabs.vue.d.ts +7 -0
- package/dist/runtime/app/components/cms/SettingsFormAction.d.vue.ts +3 -0
- package/dist/runtime/app/components/cms/SettingsFormAction.vue +17 -0
- package/dist/runtime/app/components/cms/SettingsFormAction.vue.d.ts +3 -0
- package/dist/runtime/app/components/cms/SettingsLayout.vue +18 -14
- package/dist/runtime/app/components/cms/SettingsPresetForm.d.vue.ts +11 -0
- package/dist/runtime/app/components/cms/SettingsPresetForm.vue +60 -0
- package/dist/runtime/app/components/cms/SettingsPresetForm.vue.d.ts +11 -0
- package/dist/runtime/app/components/cms/SettingsPresets.d.vue.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsPresets.vue +65 -0
- package/dist/runtime/app/components/cms/SettingsPresets.vue.d.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsRecordActions.d.vue.ts +32 -0
- package/dist/runtime/app/components/cms/SettingsRecordActions.vue +45 -0
- package/dist/runtime/app/components/cms/SettingsRecordActions.vue.d.ts +32 -0
- package/dist/runtime/app/components/cms/SettingsRedirectActions.d.vue.ts +3 -0
- package/dist/runtime/app/components/cms/SettingsRedirectActions.vue +59 -0
- package/dist/runtime/app/components/cms/SettingsRedirectActions.vue.d.ts +3 -0
- package/dist/runtime/app/components/cms/SettingsRedirectForm.d.vue.ts +11 -0
- package/dist/runtime/app/components/cms/SettingsRedirectForm.vue +77 -0
- package/dist/runtime/app/components/cms/SettingsRedirectForm.vue.d.ts +11 -0
- package/dist/runtime/app/components/cms/SettingsRedirects.d.vue.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsRedirects.vue +117 -0
- package/dist/runtime/app/components/cms/SettingsRedirects.vue.d.ts +13 -0
- package/dist/runtime/app/components/cms/SettingsSecretCard.d.vue.ts +17 -0
- package/dist/runtime/app/components/cms/SettingsSecretCard.vue +43 -0
- package/dist/runtime/app/components/cms/SettingsSecretCard.vue.d.ts +17 -0
- package/dist/runtime/app/components/cms/SettingsSite.d.vue.ts +3 -0
- package/dist/runtime/app/components/cms/SettingsSite.vue +140 -0
- package/dist/runtime/app/components/cms/SettingsSite.vue.d.ts +3 -0
- package/dist/runtime/app/components/cms/SettingsUserCreate.d.vue.ts +8 -0
- package/dist/runtime/app/components/cms/SettingsUserCreate.vue +82 -0
- package/dist/runtime/app/components/cms/SettingsUserCreate.vue.d.ts +8 -0
- package/dist/runtime/app/components/cms/SettingsUserDetail.d.vue.ts +11 -0
- package/dist/runtime/app/components/cms/SettingsUserDetail.vue +179 -0
- package/dist/runtime/app/components/cms/SettingsUserDetail.vue.d.ts +11 -0
- package/dist/runtime/app/components/cms/SettingsUsers.d.vue.ts +9 -6
- package/dist/runtime/app/components/cms/SettingsUsers.vue +88 -234
- package/dist/runtime/app/components/cms/SettingsUsers.vue.d.ts +9 -6
- package/dist/runtime/app/components/cms/SharePreview.d.vue.ts +18 -0
- package/dist/runtime/app/components/cms/SharePreview.vue +219 -0
- package/dist/runtime/app/components/cms/SharePreview.vue.d.ts +18 -0
- package/dist/runtime/app/components/cms/SlugField.vue +5 -3
- package/dist/runtime/app/components/cms/StatusBadge.vue +8 -8
- package/dist/runtime/app/components/cms/TranslationBadges.d.vue.ts +7 -0
- package/dist/runtime/app/components/cms/TranslationBadges.vue +44 -0
- package/dist/runtime/app/components/cms/TranslationBadges.vue.d.ts +7 -0
- package/dist/runtime/app/components/cms/TranslationMenu.d.vue.ts +17 -0
- package/dist/runtime/app/components/cms/TranslationMenu.vue +28 -0
- package/dist/runtime/app/components/cms/TranslationMenu.vue.d.ts +17 -0
- package/dist/runtime/app/components/cms/VisualEditor.d.vue.ts +22 -4
- package/dist/runtime/app/components/cms/VisualEditor.vue +1153 -338
- package/dist/runtime/app/components/cms/VisualEditor.vue.d.ts +22 -4
- package/dist/runtime/app/components/cms/WelcomeModal.vue +32 -50
- package/dist/runtime/app/composables/cms-clipboard.d.ts +8 -0
- package/dist/runtime/app/composables/cms-clipboard.js +38 -0
- package/dist/runtime/app/composables/cms-confirm.d.ts +6 -8
- package/dist/runtime/app/composables/cms-confirm.js +5 -7
- package/dist/runtime/app/composables/cms-entry-disabled.d.ts +5 -1
- package/dist/runtime/app/composables/cms-entry-disabled.js +7 -0
- package/dist/runtime/app/composables/cms-entry-form.d.ts +15 -0
- package/dist/runtime/app/composables/cms-entry-form.js +40 -0
- package/dist/runtime/app/composables/cms-entry-settings.d.ts +30 -0
- package/dist/runtime/app/composables/cms-entry-settings.js +122 -0
- package/dist/runtime/app/composables/cms-entry.d.ts +5 -1
- package/dist/runtime/app/composables/cms-entry.js +36 -11
- package/dist/runtime/app/composables/cms-history.d.ts +10 -0
- package/dist/runtime/app/composables/cms-history.js +24 -0
- package/dist/runtime/app/composables/cms-link-targets.d.ts +10 -0
- package/dist/runtime/app/composables/cms-link-targets.js +40 -0
- package/dist/runtime/app/composables/cms-link-usage.d.ts +1 -0
- package/dist/runtime/app/composables/cms-link-usage.js +45 -0
- package/dist/runtime/app/composables/cms-media-library.d.ts +19 -9
- package/dist/runtime/app/composables/cms-media-library.js +31 -13
- package/dist/runtime/app/composables/cms-media-uploader.js +6 -20
- package/dist/runtime/app/composables/cms-permissions.d.ts +18 -0
- package/dist/runtime/app/composables/cms-permissions.js +54 -0
- package/dist/runtime/app/composables/cms-presets.d.ts +11 -0
- package/dist/runtime/app/composables/cms-presets.js +40 -0
- package/dist/runtime/app/composables/cms-preview-mode.d.ts +4 -0
- package/dist/runtime/app/composables/cms-preview-mode.js +8 -0
- package/dist/runtime/app/composables/cms-query.d.ts +3 -0
- package/dist/runtime/app/composables/cms-query.js +45 -20
- package/dist/runtime/app/composables/cms-record-list.d.ts +31 -0
- package/dist/runtime/app/composables/cms-record-list.js +75 -0
- package/dist/runtime/app/composables/cms-route.d.ts +6 -0
- package/dist/runtime/app/composables/cms-route.js +36 -0
- package/dist/runtime/app/composables/cms-runtime.d.ts +1 -0
- package/dist/runtime/app/composables/cms-save-handoff.d.ts +4 -0
- package/dist/runtime/app/composables/cms-save-handoff.js +19 -0
- package/dist/runtime/app/composables/cms-seo.d.ts +12 -0
- package/dist/runtime/app/composables/cms-seo.js +69 -0
- package/dist/runtime/app/composables/cms-settings-form.d.ts +13 -0
- package/dist/runtime/app/composables/cms-settings-form.js +29 -0
- package/dist/runtime/app/composables/cms-settings-sections.d.ts +26 -0
- package/dist/runtime/app/composables/cms-settings-sections.js +181 -0
- package/dist/runtime/app/composables/cms-settings-stores.d.ts +52 -0
- package/dist/runtime/app/composables/cms-settings-stores.js +156 -0
- package/dist/runtime/app/composables/cms-settings.d.ts +3 -3
- package/dist/runtime/app/composables/cms-settings.js +14 -8
- package/dist/runtime/app/composables/cms-site-disabled.d.ts +7 -0
- package/dist/runtime/app/composables/cms-site-disabled.js +8 -0
- package/dist/runtime/app/composables/cms-site.d.ts +7 -0
- package/dist/runtime/app/composables/cms-site.js +22 -0
- package/dist/runtime/app/composables/cms-toast.d.ts +2 -8
- package/dist/runtime/app/composables/cms-toast.js +3 -9
- package/dist/runtime/app/composables/cms-translation-actions.d.ts +15 -0
- package/dist/runtime/app/composables/cms-translation-actions.js +108 -0
- package/dist/runtime/app/css-url.d.ts +4 -0
- package/dist/runtime/app/image/CmsImage.d.vue.ts +89 -0
- package/dist/runtime/app/image/CmsImage.vue +91 -0
- package/dist/runtime/app/image/CmsImage.vue.d.ts +89 -0
- package/dist/runtime/app/layouts/cms-admin.d.vue.ts +2 -2
- package/dist/runtime/app/layouts/cms-admin.vue +98 -76
- package/dist/runtime/app/layouts/cms-admin.vue.d.ts +2 -2
- package/dist/runtime/app/layouts/cms-editor.vue +7 -2
- package/dist/runtime/app/links/CmsLink.d.vue.ts +18 -0
- package/dist/runtime/app/links/CmsLink.vue +18 -0
- package/dist/runtime/app/links/CmsLink.vue.d.ts +18 -0
- package/dist/runtime/app/middleware/cms-auth.js +13 -1
- package/dist/runtime/app/pages/admin-collection.vue +473 -297
- package/dist/runtime/app/pages/admin-content.vue +191 -54
- package/dist/runtime/app/pages/admin-entry.vue +79 -75
- package/dist/runtime/app/pages/admin-index.vue +18 -5
- package/dist/runtime/app/pages/admin-login.vue +1 -1
- package/dist/runtime/app/pages/admin-logout.vue +1 -1
- package/dist/runtime/app/pages/admin-media.vue +3 -3
- package/dist/runtime/app/pages/admin-preview.vue +112 -24
- package/dist/runtime/app/plugins/cms-field.d.ts +2 -0
- package/dist/runtime/app/plugins/cms-field.js +8 -0
- package/dist/runtime/app/plugins/cms-preview-banner.client.d.ts +2 -0
- package/dist/runtime/app/plugins/cms-preview-banner.client.js +19 -0
- package/dist/runtime/app/plugins/cms-preview.d.ts +2 -0
- package/dist/runtime/app/plugins/cms-preview.js +27 -0
- package/dist/runtime/app/preview/CmsPreviewBanner.d.vue.ts +7 -0
- package/dist/runtime/app/preview/CmsPreviewBanner.vue +63 -0
- package/dist/runtime/app/preview/CmsPreviewBanner.vue.d.ts +7 -0
- package/dist/runtime/app/preview/PreviewOverlay.d.vue.ts +17 -3
- package/dist/runtime/app/preview/PreviewOverlay.vue +629 -166
- package/dist/runtime/app/preview/PreviewOverlay.vue.d.ts +17 -3
- package/dist/runtime/app/preview/field-marker.d.ts +12 -0
- package/dist/runtime/app/preview/field-marker.js +20 -0
- package/dist/runtime/app/preview/inline-text.d.ts +15 -0
- package/dist/runtime/app/preview/inline-text.js +158 -0
- package/dist/runtime/app/utils/block-editor.d.ts +22 -0
- package/dist/runtime/app/utils/block-editor.js +12 -0
- package/dist/runtime/app/utils/keyboard.d.ts +6 -0
- package/dist/runtime/app/utils/keyboard.js +52 -0
- package/dist/runtime/app/utils/redirects.d.ts +6 -0
- package/dist/runtime/app/utils/redirects.js +7 -0
- package/dist/runtime/app/utils/ui.d.ts +8 -0
- package/dist/runtime/app/utils/ui.js +15 -1
- package/dist/runtime/app/utils/users.d.ts +15 -0
- package/dist/runtime/app/utils/users.js +14 -0
- package/dist/runtime/assets/cms.css +1 -1
- package/dist/runtime/generate.js +16 -2
- package/dist/runtime/server/api/collection-export.get.js +3 -2
- package/dist/runtime/server/api/collection-import.post.js +39 -11
- package/dist/runtime/server/api/collection.get.js +27 -9
- package/dist/runtime/server/api/collection.post.js +28 -11
- package/dist/runtime/server/api/collection.put.js +35 -13
- package/dist/runtime/server/api/item.delete.js +19 -7
- package/dist/runtime/server/api/item.get.js +3 -2
- package/dist/runtime/server/api/item.put.js +52 -18
- package/dist/runtime/server/api/link-usage.post.d.ts +5 -0
- package/dist/runtime/server/api/link-usage.post.js +21 -0
- package/dist/runtime/server/api/media-delete.post.js +4 -2
- package/dist/runtime/server/api/media-download.get.js +2 -2
- package/dist/runtime/server/api/media-folder.delete.js +8 -2
- package/dist/runtime/server/api/media-folder.patch.js +10 -2
- package/dist/runtime/server/api/media-folder.post.js +4 -2
- package/dist/runtime/server/api/media-move.post.js +7 -4
- package/dist/runtime/server/api/media-presign.post.js +2 -2
- package/dist/runtime/server/api/media-upload.put.js +2 -2
- package/dist/runtime/server/api/media-usage.post.d.ts +2 -4
- package/dist/runtime/server/api/media-usage.post.js +13 -9
- package/dist/runtime/server/api/media.delete.js +4 -2
- package/dist/runtime/server/api/media.get.js +22 -7
- package/dist/runtime/server/api/media.post.js +4 -2
- package/dist/runtime/server/api/media.put.js +33 -16
- package/dist/runtime/server/api/preset.delete.d.ts +4 -0
- package/dist/runtime/server/api/preset.delete.js +9 -0
- package/dist/runtime/server/api/preset.put.d.ts +3 -0
- package/dist/runtime/server/api/preset.put.js +23 -0
- package/dist/runtime/server/api/presets-field.get.d.ts +3 -0
- package/dist/runtime/server/api/presets-field.get.js +13 -0
- package/dist/runtime/server/api/presets-field.post.d.ts +3 -0
- package/dist/runtime/server/api/presets-field.post.js +36 -0
- package/dist/runtime/server/api/presets.get.d.ts +3 -0
- package/dist/runtime/server/api/presets.get.js +7 -0
- package/dist/runtime/server/api/preview-link.delete.d.ts +4 -0
- package/dist/runtime/server/api/preview-link.delete.js +15 -0
- package/dist/runtime/server/api/preview-links.get.d.ts +3 -0
- package/dist/runtime/server/api/preview-links.get.js +10 -0
- package/dist/runtime/server/api/preview-links.post.d.ts +3 -0
- package/dist/runtime/server/api/preview-links.post.js +17 -0
- package/dist/runtime/server/api/preview.get.d.ts +3 -0
- package/dist/runtime/server/api/preview.get.js +7 -0
- package/dist/runtime/server/api/redirect.delete.d.ts +4 -0
- package/dist/runtime/server/api/redirect.delete.js +10 -0
- package/dist/runtime/server/api/redirect.put.d.ts +3 -0
- package/dist/runtime/server/api/redirect.put.js +8 -0
- package/dist/runtime/server/api/redirects-import.post.d.ts +3 -0
- package/dist/runtime/server/api/redirects-import.post.js +13 -0
- package/dist/runtime/server/api/redirects.get.d.ts +3 -0
- package/dist/runtime/server/api/redirects.get.js +7 -0
- package/dist/runtime/server/api/redirects.post.d.ts +3 -0
- package/dist/runtime/server/api/redirects.post.js +7 -0
- package/dist/runtime/server/api/search.get.js +8 -3
- package/dist/runtime/server/api/settings.delete.js +2 -2
- package/dist/runtime/server/api/settings.get.js +4 -2
- package/dist/runtime/server/api/settings.put.js +2 -2
- package/dist/runtime/server/api/site.get.d.ts +3 -0
- package/dist/runtime/server/api/site.get.js +7 -0
- package/dist/runtime/server/api/site.put.d.ts +3 -0
- package/dist/runtime/server/api/site.put.js +16 -0
- package/dist/runtime/server/api/tags.get.js +3 -2
- package/dist/runtime/server/api/user.delete.js +8 -2
- package/dist/runtime/server/api/user.put.js +14 -4
- package/dist/runtime/server/api/users.get.js +2 -2
- package/dist/runtime/server/api/users.post.js +8 -4
- package/dist/runtime/server/middleware/hidden-site.d.ts +2 -0
- package/dist/runtime/server/middleware/hidden-site.js +8 -0
- package/dist/runtime/server/middleware/preview-links.d.ts +2 -0
- package/dist/runtime/server/middleware/preview-links.js +6 -0
- package/dist/runtime/server/middleware/redirects.d.ts +2 -0
- package/dist/runtime/server/middleware/redirects.js +18 -0
- package/dist/runtime/server/plugins/session-validate.js +4 -1
- package/dist/runtime/server/plugins/webhooks.d.ts +3 -0
- package/dist/runtime/server/plugins/webhooks.js +27 -0
- package/dist/runtime/server/routes/graphql.js +5 -3
- package/dist/runtime/server/routes/robots.d.ts +2 -0
- package/dist/runtime/server/routes/robots.js +16 -0
- package/dist/runtime/server/routes/sitemap.d.ts +2 -0
- package/dist/runtime/server/routes/sitemap.js +67 -0
- package/dist/runtime/server/utils/cached-value.d.ts +5 -0
- package/dist/runtime/server/utils/cached-value.js +24 -0
- package/dist/runtime/server/utils/content-routes.d.ts +5 -0
- package/dist/runtime/server/utils/content-routes.js +29 -0
- package/dist/runtime/server/utils/field-rules.d.ts +19 -0
- package/dist/runtime/server/utils/field-rules.js +72 -0
- package/dist/runtime/server/utils/graphql.d.ts +3 -1
- package/dist/runtime/server/utils/graphql.js +143 -28
- package/dist/runtime/server/utils/hooks.d.ts +14 -0
- package/dist/runtime/server/utils/hooks.js +71 -0
- package/dist/runtime/server/utils/import.d.ts +7 -2
- package/dist/runtime/server/utils/import.js +108 -14
- package/dist/runtime/server/utils/link-usage.d.ts +4 -0
- package/dist/runtime/server/utils/link-usage.js +28 -0
- package/dist/runtime/server/utils/media-references.d.ts +6 -1
- package/dist/runtime/server/utils/media-references.js +49 -20
- package/dist/runtime/server/utils/media-usage.d.ts +2 -0
- package/dist/runtime/server/utils/media-usage.js +5 -3
- package/dist/runtime/server/utils/page-rows.d.ts +2 -0
- package/dist/runtime/server/utils/page-rows.js +42 -29
- package/dist/runtime/server/utils/permissions.d.ts +14 -0
- package/dist/runtime/server/utils/permissions.js +43 -0
- package/dist/runtime/server/utils/presets.d.ts +18 -0
- package/dist/runtime/server/utils/presets.js +68 -0
- package/dist/runtime/server/utils/preview-links.d.ts +207 -0
- package/dist/runtime/server/utils/preview-links.js +161 -0
- package/dist/runtime/server/utils/redirects.d.ts +31 -0
- package/dist/runtime/server/utils/redirects.js +240 -0
- package/dist/runtime/server/utils/registry.js +4 -1
- package/dist/runtime/server/utils/relations.d.ts +8 -0
- package/dist/runtime/server/utils/relations.js +25 -6
- package/dist/runtime/server/utils/require-admin.d.ts +0 -1
- package/dist/runtime/server/utils/require-admin.js +4 -8
- package/dist/runtime/server/utils/search.d.ts +1 -0
- package/dist/runtime/server/utils/search.js +44 -19
- package/dist/runtime/server/utils/site.d.ts +23 -0
- package/dist/runtime/server/utils/site.js +79 -0
- package/dist/runtime/server/utils/sitemap.d.ts +12 -0
- package/dist/runtime/server/utils/sitemap.js +109 -0
- package/dist/runtime/server/utils/user-management.d.ts +4 -0
- package/dist/runtime/server/utils/user-management.js +20 -0
- package/dist/runtime/server/utils/users.d.ts +1 -1
- package/dist/runtime/server/utils/users.js +1 -1
- package/dist/runtime/server/utils/visibility.d.ts +1 -0
- package/dist/runtime/server/utils/visibility.js +6 -1
- package/dist/runtime/server/utils/webhooks.d.ts +24 -0
- package/dist/runtime/server/utils/webhooks.js +90 -0
- package/dist/runtime/shared/block-paths.d.ts +66 -0
- package/dist/runtime/shared/block-paths.js +310 -0
- package/dist/runtime/shared/block-picker.d.ts +18 -0
- package/dist/runtime/shared/block-picker.js +31 -0
- package/dist/runtime/shared/block-signature.d.ts +4 -0
- package/dist/runtime/shared/block-signature.js +46 -0
- package/dist/runtime/shared/clipboard.d.ts +31 -0
- package/dist/runtime/shared/clipboard.js +206 -0
- package/dist/runtime/shared/conditions.d.ts +36 -0
- package/dist/runtime/shared/conditions.js +100 -0
- package/dist/runtime/shared/content-routes.d.ts +42 -0
- package/dist/runtime/shared/content-routes.js +237 -0
- package/dist/runtime/shared/duplicate.js +2 -1
- package/dist/runtime/shared/editor-layout.d.ts +18 -0
- package/dist/runtime/shared/editor-layout.js +9 -0
- package/dist/runtime/shared/field-options.d.ts +21 -0
- package/dist/runtime/shared/field-options.js +90 -0
- package/dist/runtime/shared/graphql-sdl.d.ts +1 -0
- package/dist/runtime/shared/graphql-sdl.js +50 -26
- package/dist/runtime/shared/history.d.ts +27 -0
- package/dist/runtime/shared/history.js +123 -0
- package/dist/runtime/shared/hooks.d.ts +45 -0
- package/dist/runtime/shared/hooks.js +28 -0
- package/dist/runtime/shared/index.d.ts +90 -21
- package/dist/runtime/shared/index.js +121 -37
- package/dist/runtime/shared/inline-text.d.ts +38 -0
- package/dist/runtime/shared/inline-text.js +85 -0
- package/dist/runtime/shared/layout.d.ts +2 -1
- package/dist/runtime/shared/layout.js +3 -0
- package/dist/runtime/shared/links.d.ts +48 -0
- package/dist/runtime/shared/links.js +155 -0
- package/dist/runtime/shared/list-filters.d.ts +2 -0
- package/dist/runtime/shared/list-filters.js +2 -0
- package/dist/runtime/shared/media-focal.d.ts +30 -0
- package/dist/runtime/shared/media-focal.js +52 -0
- package/dist/runtime/shared/migrations-dir.d.ts +14 -0
- package/dist/runtime/shared/migrations-dir.js +48 -2
- package/dist/runtime/shared/presets.d.ts +67 -0
- package/dist/runtime/shared/presets.js +127 -0
- package/dist/runtime/shared/preview-links.d.ts +64 -0
- package/dist/runtime/shared/preview-links.js +54 -0
- package/dist/runtime/shared/preview.d.ts +124 -21
- package/dist/runtime/shared/preview.js +419 -81
- package/dist/runtime/shared/redirects.d.ts +75 -0
- package/dist/runtime/shared/redirects.js +230 -0
- package/dist/runtime/shared/roles.d.ts +57 -0
- package/dist/runtime/shared/roles.js +293 -0
- package/dist/runtime/shared/save-state.d.ts +8 -0
- package/dist/runtime/shared/save-state.js +15 -0
- package/dist/runtime/shared/search.d.ts +16 -1
- package/dist/runtime/shared/search.js +41 -7
- package/dist/runtime/shared/seo.d.ts +167 -0
- package/dist/runtime/shared/seo.js +335 -0
- package/dist/runtime/shared/transfer.js +2 -1
- package/dist/runtime/shared/translations.d.ts +29 -0
- package/dist/runtime/shared/translations.js +123 -0
- package/dist/runtime/shared/users.d.ts +1 -1
- package/dist/runtime/shared/validation.d.ts +23 -1
- package/dist/runtime/shared/validation.js +214 -64
- package/dist/runtime/webhooks.d.ts +33 -0
- package/dist/runtime/webhooks.js +57 -0
- package/dist/types.d.mts +5 -1
- package/package.json +6 -2
- package/dist/runtime/app/components/cms/BlockOutline.vue +0 -88
- package/dist/runtime/app/components/cms/BlockPalette.vue +0 -31
- package/dist/runtime/app/components/cms/SettingsModal.d.vue.ts +0 -12
- package/dist/runtime/app/components/cms/SettingsModal.vue +0 -126
- package/dist/runtime/app/components/cms/SettingsModal.vue.d.ts +0 -12
- package/dist/runtime/app/composables/cms-field-focus.d.ts +0 -4
- package/dist/runtime/app/composables/cms-field-focus.js +0 -20
|
@@ -4,34 +4,19 @@
|
|
|
4
4
|
<span class="k-visually-hidden">No media</span>
|
|
5
5
|
</span>
|
|
6
6
|
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
:alt="filename"
|
|
11
|
-
:title="filename"
|
|
12
|
-
loading="lazy"
|
|
13
|
-
class="cms-media-thumb"
|
|
14
|
-
/>
|
|
15
|
-
|
|
16
|
-
<video
|
|
17
|
-
v-else-if="kind === 'video' && url"
|
|
18
|
-
:src="url"
|
|
19
|
-
:title="filename"
|
|
20
|
-
muted
|
|
21
|
-
playsinline
|
|
22
|
-
preload="metadata"
|
|
23
|
-
class="cms-media-thumb"
|
|
24
|
-
/>
|
|
25
|
-
|
|
26
|
-
<span v-else :title="filename" class="cms-media-thumb is-fallback">
|
|
27
|
-
<KIcon :name="cmsIcon(icon)" />
|
|
28
|
-
</span>
|
|
7
|
+
<KTooltip v-else :text="filename">
|
|
8
|
+
<KThumbnail :src="url ?? void 0" :kind="kind" :alt="filename" size="sm" />
|
|
9
|
+
</KTooltip>
|
|
29
10
|
</template>
|
|
30
11
|
|
|
31
12
|
<script setup>
|
|
32
13
|
import { computed } from "#imports";
|
|
33
|
-
import {
|
|
34
|
-
|
|
14
|
+
import {
|
|
15
|
+
Icon as KIcon,
|
|
16
|
+
Thumbnail as KThumbnail,
|
|
17
|
+
Tooltip as KTooltip
|
|
18
|
+
} from "@xleddyl/443-components-vue";
|
|
19
|
+
import { mediaFilename, mediaPublicUrl, mediaTypeForKey } from "#nuxt-cms";
|
|
35
20
|
import { useCmsRuntime } from "../../composables/cms-runtime";
|
|
36
21
|
import { cmsIcon } from "../../utils/ui";
|
|
37
22
|
const props = defineProps({
|
|
@@ -41,5 +26,4 @@ const { mediaBaseUrl } = useCmsRuntime();
|
|
|
41
26
|
const kind = computed(() => props.value ? mediaTypeForKey(props.value) : "file");
|
|
42
27
|
const url = computed(() => props.value ? mediaPublicUrl(mediaBaseUrl, props.value) : null);
|
|
43
28
|
const filename = computed(() => props.value ? mediaFilename(props.value) : "");
|
|
44
|
-
const icon = computed(() => mediaIconFor(kind.value));
|
|
45
29
|
</script>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { FieldConfig } from '#nuxt-cms';
|
|
2
|
-
import type { CmsBlockValue } from '../../../shared/preview.js';
|
|
3
2
|
type __VLS_Props = {
|
|
4
|
-
items: CmsBlockValue[];
|
|
5
3
|
field: FieldConfig;
|
|
4
|
+
items: unknown;
|
|
6
5
|
locale: string;
|
|
7
|
-
|
|
6
|
+
invalid: (index: number) => boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
select: (index: number) => any;
|
|
11
|
-
|
|
11
|
+
insert: (anchor: HTMLElement) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
13
|
onSelect?: ((index: number) => any) | undefined;
|
|
14
|
-
|
|
14
|
+
onInsert?: ((anchor: HTMLElement) => any) | undefined;
|
|
15
15
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
17
17
|
export default _default;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KStack gap="sm">
|
|
3
|
+
<KTree
|
|
4
|
+
v-if="rows.length"
|
|
5
|
+
:nodes="nodes"
|
|
6
|
+
:selectable="false"
|
|
7
|
+
size="sm"
|
|
8
|
+
:label="field.label"
|
|
9
|
+
@select="(node2) => emit('select', Number(node2.id))"
|
|
10
|
+
>
|
|
11
|
+
<template #meta="{ node }">
|
|
12
|
+
<KIcon
|
|
13
|
+
v-if="rows[Number(node.id)]?.hidden"
|
|
14
|
+
:name="cmsIcon('eye-slash')"
|
|
15
|
+
label="Hidden"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
</KTree>
|
|
19
|
+
<div v-if="!readonly">
|
|
20
|
+
<KButton
|
|
21
|
+
:icon="cmsIcon('plus')"
|
|
22
|
+
label="Add a block"
|
|
23
|
+
size="sm"
|
|
24
|
+
variant="soft"
|
|
25
|
+
tone="neutral"
|
|
26
|
+
aria-haspopup="dialog"
|
|
27
|
+
:disabled="!canAdd"
|
|
28
|
+
:tooltip="canAdd ? void 0 : full"
|
|
29
|
+
@click="(event) => emit('insert', event.currentTarget)"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<KFieldMessage v-else-if="!rows.length" tone="neutral" :icon="false" message="No blocks." />
|
|
33
|
+
</KStack>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script setup>
|
|
37
|
+
import { canAddBlock, isHiddenBlock } from "#nuxt-cms";
|
|
38
|
+
import {
|
|
39
|
+
Button as KButton,
|
|
40
|
+
FieldMessage as KFieldMessage,
|
|
41
|
+
Icon as KIcon,
|
|
42
|
+
Stack as KStack,
|
|
43
|
+
Tree as KTree
|
|
44
|
+
} from "@xleddyl/443-components-vue";
|
|
45
|
+
import { computed } from "#imports";
|
|
46
|
+
import { blockSummary } from "../../../shared/preview";
|
|
47
|
+
import { useCmsRuntime } from "../../composables/cms-runtime";
|
|
48
|
+
import { cmsIcon } from "../../utils/ui";
|
|
49
|
+
const props = defineProps({
|
|
50
|
+
field: { type: Object, required: true },
|
|
51
|
+
items: { type: null, required: true },
|
|
52
|
+
locale: { type: String, required: true },
|
|
53
|
+
invalid: { type: Function, required: true },
|
|
54
|
+
readonly: { type: Boolean, required: false }
|
|
55
|
+
});
|
|
56
|
+
const emit = defineEmits(["select", "insert"]);
|
|
57
|
+
const { i18n } = useCmsRuntime();
|
|
58
|
+
const list = computed(() => Array.isArray(props.items) ? props.items : []);
|
|
59
|
+
const rows = computed(
|
|
60
|
+
() => list.value.map((item, index) => {
|
|
61
|
+
const block = props.field.blocks?.[String(item.type)];
|
|
62
|
+
return {
|
|
63
|
+
index,
|
|
64
|
+
label: block?.label ?? String(item.type),
|
|
65
|
+
icon: block?.icon ?? "rectangle-stack",
|
|
66
|
+
summary: blockSummary(block, item, props.locale, i18n.defaultLocale, 60),
|
|
67
|
+
hidden: isHiddenBlock(item),
|
|
68
|
+
invalid: props.invalid(index)
|
|
69
|
+
};
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
const nodes = computed(
|
|
73
|
+
() => rows.value.map((row) => ({
|
|
74
|
+
id: row.index,
|
|
75
|
+
label: row.label,
|
|
76
|
+
description: row.summary || void 0,
|
|
77
|
+
descriptionVariant: "text",
|
|
78
|
+
icon: cmsIcon(row.icon),
|
|
79
|
+
invalid: row.invalid
|
|
80
|
+
}))
|
|
81
|
+
);
|
|
82
|
+
const canAdd = computed(() => canAddBlock(props.field, list.value.length));
|
|
83
|
+
const full = computed(() => {
|
|
84
|
+
const max = props.field.max ?? 0;
|
|
85
|
+
return `This field holds at most ${max} ${max === 1 ? "block" : "blocks"}.`;
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { FieldConfig } from '#nuxt-cms';
|
|
2
|
-
import type { CmsBlockValue } from '../../../shared/preview.js';
|
|
3
2
|
type __VLS_Props = {
|
|
4
|
-
items: CmsBlockValue[];
|
|
5
3
|
field: FieldConfig;
|
|
4
|
+
items: unknown;
|
|
6
5
|
locale: string;
|
|
7
|
-
|
|
6
|
+
invalid: (index: number) => boolean;
|
|
7
|
+
readonly?: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
select: (index: number) => any;
|
|
11
|
-
|
|
11
|
+
insert: (anchor: HTMLElement) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
13
|
onSelect?: ((index: number) => any) | undefined;
|
|
14
|
-
|
|
14
|
+
onInsert?: ((anchor: HTMLElement) => any) | undefined;
|
|
15
15
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
17
17
|
export default _default;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<span>
|
|
3
3
|
Powered by
|
|
4
|
-
<
|
|
5
|
-
|
|
4
|
+
<KButton
|
|
5
|
+
variant="link"
|
|
6
|
+
size="xs"
|
|
6
7
|
href="https://github.com/443-studio/nuxt-cms"
|
|
7
8
|
target="_blank"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
external
|
|
10
|
+
:label="version ? `nuxt-cms v${version}` : 'nuxt-cms'"
|
|
11
|
+
/>
|
|
11
12
|
</span>
|
|
12
13
|
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import { Button as KButton } from "@xleddyl/443-components-vue";
|
|
17
|
+
import { useCmsRuntime } from "../../composables/cms-runtime";
|
|
18
|
+
const version = useCmsRuntime().version;
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CmsPresetDetails } from '../../../shared/presets.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
submitLabel?: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
save: (details: CmsPresetDetails) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_ModelProps = {
|
|
9
|
+
'open'?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:open": (value: boolean) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KFormModal
|
|
3
|
+
v-model:open="open"
|
|
4
|
+
:title="title"
|
|
5
|
+
:description="hint"
|
|
6
|
+
size="sm"
|
|
7
|
+
:form="form"
|
|
8
|
+
:submit-label="submitLabel"
|
|
9
|
+
:submit-icon="cmsIcon(CMS_PRESET_ICON)"
|
|
10
|
+
creating
|
|
11
|
+
nested
|
|
12
|
+
>
|
|
13
|
+
<KFormField label="Name" name="name" required>
|
|
14
|
+
<KInput
|
|
15
|
+
v-model="draft.name"
|
|
16
|
+
:maxlength="CMS_PRESET_NAME_MAX"
|
|
17
|
+
placeholder="Article intro"
|
|
18
|
+
autocomplete="off"
|
|
19
|
+
/>
|
|
20
|
+
</KFormField>
|
|
21
|
+
<KFormField label="Description" name="description">
|
|
22
|
+
<KTextarea
|
|
23
|
+
v-model="draft.description"
|
|
24
|
+
:maxlength="CMS_PRESET_DESCRIPTION_MAX"
|
|
25
|
+
:rows="3"
|
|
26
|
+
placeholder="Optional"
|
|
27
|
+
/>
|
|
28
|
+
</KFormField>
|
|
29
|
+
</KFormModal>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup>
|
|
33
|
+
import {
|
|
34
|
+
FormField as KFormField,
|
|
35
|
+
FormModal as KFormModal,
|
|
36
|
+
Input as KInput,
|
|
37
|
+
Textarea as KTextarea,
|
|
38
|
+
useForm
|
|
39
|
+
} from "@xleddyl/443-components-vue";
|
|
40
|
+
import { ref, watch } from "#imports";
|
|
41
|
+
import {
|
|
42
|
+
CMS_PRESET_DESCRIPTION_MAX,
|
|
43
|
+
CMS_PRESET_ICON,
|
|
44
|
+
CMS_PRESET_NAME_MAX
|
|
45
|
+
} from "../../../shared/presets";
|
|
46
|
+
import { cmsIcon } from "../../utils/ui";
|
|
47
|
+
const props = defineProps({
|
|
48
|
+
title: { type: String, required: true },
|
|
49
|
+
submitLabel: { type: String, required: false, default: "Save" },
|
|
50
|
+
hint: { type: String, required: false, default: void 0 },
|
|
51
|
+
save: { type: Function, required: true }
|
|
52
|
+
});
|
|
53
|
+
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
54
|
+
const draft = ref({ name: "", description: "" });
|
|
55
|
+
const form = useForm({
|
|
56
|
+
values: draft,
|
|
57
|
+
schema: {
|
|
58
|
+
name: { required: true, maxLength: CMS_PRESET_NAME_MAX },
|
|
59
|
+
description: { maxLength: CMS_PRESET_DESCRIPTION_MAX }
|
|
60
|
+
},
|
|
61
|
+
onSubmit: async (values) => {
|
|
62
|
+
const description = values.description.trim();
|
|
63
|
+
await props.save({ name: values.name.trim(), ...description ? { description } : {} });
|
|
64
|
+
open.value = false;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
watch(open, (value) => {
|
|
68
|
+
if (value) form.reset({ name: "", description: "" });
|
|
69
|
+
});
|
|
70
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CmsPresetDetails } from '../../../shared/presets.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
title: string;
|
|
4
|
+
submitLabel?: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
save: (details: CmsPresetDetails) => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_ModelProps = {
|
|
9
|
+
'open'?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:open": (value: boolean) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
<script setup>
|
|
14
14
|
import { isTranslatableField, selectDisplayValue } from "#nuxt-cms";
|
|
15
|
-
import { Combobox as KCombobox } from "@xleddyl/443-components-vue";
|
|
15
|
+
import { Combobox as KCombobox, toast } from "@xleddyl/443-components-vue";
|
|
16
16
|
import { computed, onMounted, ref } from "#imports";
|
|
17
17
|
import cmsConfig from "#cms-config";
|
|
18
18
|
import { useCmsRuntime } from "../../composables/cms-runtime";
|
|
19
|
-
import { useCmsToast } from "../../composables/cms-toast";
|
|
20
19
|
import { errorMessage } from "../../utils/ui";
|
|
21
20
|
const props = defineProps({
|
|
22
21
|
to: { type: String, required: true },
|
|
@@ -24,7 +23,6 @@ const props = defineProps({
|
|
|
24
23
|
multiple: { type: Boolean, required: false }
|
|
25
24
|
});
|
|
26
25
|
const model = defineModel({ type: [String, Array, null], ...{ required: true } });
|
|
27
|
-
const toast = useCmsToast();
|
|
28
26
|
const target = cmsConfig[props.to];
|
|
29
27
|
const endpoint = `/api/cms/admin/${props.to}`;
|
|
30
28
|
const selectedRows = ref(/* @__PURE__ */ new Map());
|
|
@@ -38,11 +36,7 @@ async function search(query, signal) {
|
|
|
38
36
|
return page.items.map((row) => ({ label: optionLabel(row), value: row.id }));
|
|
39
37
|
} catch (err) {
|
|
40
38
|
if (signal.aborted) throw err;
|
|
41
|
-
toast.
|
|
42
|
-
title: "Loading failed",
|
|
43
|
-
description: errorMessage(err),
|
|
44
|
-
color: "error"
|
|
45
|
-
});
|
|
39
|
+
toast.error("Loading failed", { description: errorMessage(err) });
|
|
46
40
|
return [];
|
|
47
41
|
}
|
|
48
42
|
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<KAlert v-if="isSuperAdmin" tone="neutral" title="Environment account">
|
|
3
3
|
This account signs in with the credentials of the environment variables (NUXT_CMS_ADMIN_EMAIL
|
|
4
|
-
and NUXT_CMS_ADMIN_PASSWORD). Change them there.
|
|
4
|
+
and NUXT_CMS_ADMIN_PASSWORD). Change them there. It holds every permission and cannot be
|
|
5
|
+
removed or locked out from the panel.
|
|
5
6
|
</KAlert>
|
|
6
7
|
|
|
7
8
|
<template v-else>
|
|
8
9
|
<KSettingsGroup label="Profile" description="The name shows in the sidebar.">
|
|
9
|
-
<
|
|
10
|
-
<
|
|
10
|
+
<template #actions>
|
|
11
|
+
<KButton
|
|
12
|
+
variant="soft"
|
|
13
|
+
tone="neutral"
|
|
14
|
+
type="submit"
|
|
15
|
+
size="sm"
|
|
16
|
+
:form="profileFormId"
|
|
17
|
+
:loading="profileForm.submitting.value"
|
|
18
|
+
:disabled="profile.name === (user?.name ?? '')"
|
|
19
|
+
>
|
|
20
|
+
Save
|
|
21
|
+
</KButton>
|
|
22
|
+
</template>
|
|
23
|
+
<KForm :id="profileFormId" :form="profileForm">
|
|
24
|
+
<KGrid :columns="{ base: 1, sm: 2 }">
|
|
11
25
|
<KFormField label="Name" name="name">
|
|
12
|
-
<KInput
|
|
13
|
-
v-model="profile.values.name"
|
|
14
|
-
placeholder="Your name"
|
|
15
|
-
autocomplete="name"
|
|
16
|
-
/>
|
|
26
|
+
<KInput v-model="profile.name" placeholder="Your name" autocomplete="name" />
|
|
17
27
|
</KFormField>
|
|
18
28
|
<KFormField label="Email">
|
|
19
|
-
<KInput :model-value="email" disabled />
|
|
29
|
+
<KInput :model-value="email" type="email" disabled />
|
|
20
30
|
</KFormField>
|
|
21
31
|
</KGrid>
|
|
22
|
-
<KStack direction="row" justify="end" gap="sm">
|
|
23
|
-
<KButton
|
|
24
|
-
type="submit"
|
|
25
|
-
label="Save profile"
|
|
26
|
-
size="sm"
|
|
27
|
-
:disabled="profile.values.name === (user?.name ?? '')"
|
|
28
|
-
/>
|
|
29
|
-
</KStack>
|
|
30
32
|
</KForm>
|
|
31
33
|
</KSettingsGroup>
|
|
32
34
|
|
|
@@ -34,34 +36,34 @@
|
|
|
34
36
|
label="Password"
|
|
35
37
|
:description="`At least ${MIN_PASSWORD_LENGTH} characters. Use the generate button to create one.`"
|
|
36
38
|
>
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
+
<template #actions>
|
|
40
|
+
<KButton
|
|
41
|
+
variant="soft"
|
|
42
|
+
tone="neutral"
|
|
43
|
+
type="submit"
|
|
44
|
+
size="sm"
|
|
45
|
+
:form="passwordFormId"
|
|
46
|
+
:loading="passwordForm.submitting.value"
|
|
47
|
+
>
|
|
48
|
+
Change password
|
|
49
|
+
</KButton>
|
|
50
|
+
</template>
|
|
51
|
+
<KForm :id="passwordFormId" :form="passwordForm">
|
|
52
|
+
<KFormField label="Current password" name="currentPassword" required>
|
|
39
53
|
<KPasswordInput
|
|
40
|
-
v-model="password.
|
|
41
|
-
icon="key"
|
|
54
|
+
v-model="password.currentPassword"
|
|
42
55
|
autocomplete="current-password"
|
|
43
56
|
placeholder="••••••••"
|
|
44
57
|
/>
|
|
45
58
|
</KFormField>
|
|
46
|
-
<KFormField label="New password" name="
|
|
59
|
+
<KFormField label="New password" name="newPassword" required>
|
|
47
60
|
<KPasswordInput
|
|
48
|
-
v-model="password.
|
|
49
|
-
icon="key"
|
|
61
|
+
v-model="password.newPassword"
|
|
50
62
|
autocomplete="new-password"
|
|
51
63
|
:generate="generatePassword"
|
|
52
64
|
copy
|
|
53
65
|
/>
|
|
54
66
|
</KFormField>
|
|
55
|
-
<KStack direction="row" justify="end" gap="sm">
|
|
56
|
-
<KButton
|
|
57
|
-
type="submit"
|
|
58
|
-
label="Change password"
|
|
59
|
-
size="sm"
|
|
60
|
-
:disabled="
|
|
61
|
-
!password.values.current || (password.values.next ?? '').length < MIN_PASSWORD_LENGTH
|
|
62
|
-
"
|
|
63
|
-
/>
|
|
64
|
-
</KStack>
|
|
65
67
|
</KForm>
|
|
66
68
|
</KSettingsGroup>
|
|
67
69
|
</template>
|
|
@@ -78,53 +80,40 @@ import {
|
|
|
78
80
|
Input as KInput,
|
|
79
81
|
PasswordInput as KPasswordInput,
|
|
80
82
|
SettingsGroup as KSettingsGroup,
|
|
81
|
-
|
|
83
|
+
toast,
|
|
82
84
|
useForm
|
|
83
85
|
} from "@xleddyl/443-components-vue";
|
|
84
|
-
import { watch } from "#imports";
|
|
86
|
+
import { ref, useId, watch } from "#imports";
|
|
85
87
|
import { generatePassword, useCmsAccount } from "../../composables/cms-account";
|
|
86
|
-
import { useCmsToast } from "../../composables/cms-toast";
|
|
87
88
|
import { cmsApi } from "../../utils/api";
|
|
88
|
-
import { errorMessage } from "../../utils/ui";
|
|
89
89
|
const { user, email, isSuperAdmin, refresh } = useCmsAccount();
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
const profileFormId = useId();
|
|
91
|
+
const passwordFormId = useId();
|
|
92
|
+
const profile = ref({ name: user.value?.name ?? "" });
|
|
93
|
+
const profileForm = useForm({
|
|
94
|
+
values: profile,
|
|
95
|
+
schema: { name: { maxLength: 120 } },
|
|
96
|
+
onSubmit: async (values) => {
|
|
97
|
+
await cmsApi("/api/cms/account", { method: "PUT", body: { name: values.name || null } });
|
|
98
|
+
await refresh();
|
|
99
|
+
toast.success("Profile saved");
|
|
100
|
+
}
|
|
94
101
|
});
|
|
95
102
|
watch(
|
|
96
103
|
() => user.value?.name,
|
|
97
|
-
(name) =>
|
|
104
|
+
(name) => profileForm.reset({ name: name ?? "" })
|
|
98
105
|
);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
method: "PUT",
|
|
103
|
-
body: { name: values.name || null }
|
|
104
|
-
});
|
|
105
|
-
await refresh();
|
|
106
|
-
toast.add({ title: "Profile saved", color: "success" });
|
|
107
|
-
} catch (error) {
|
|
108
|
-
toast.add({ title: "Profile not saved", description: errorMessage(error), color: "error" });
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const password = useForm({
|
|
106
|
+
const password = ref({ currentPassword: "", newPassword: "" });
|
|
107
|
+
const passwordForm = useForm({
|
|
108
|
+
values: password,
|
|
112
109
|
schema: {
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
currentPassword: { required: true },
|
|
111
|
+
newPassword: { required: true, minLength: MIN_PASSWORD_LENGTH, maxLength: 256 }
|
|
115
112
|
},
|
|
116
|
-
onSubmit:
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
await cmsApi("/api/cms/account/password", {
|
|
121
|
-
method: "PUT",
|
|
122
|
-
body: { currentPassword: values.current, newPassword: values.next }
|
|
123
|
-
});
|
|
124
|
-
password.reset();
|
|
125
|
-
toast.add({ title: "Password changed", color: "success" });
|
|
126
|
-
} catch (error) {
|
|
127
|
-
password.setError("", errorMessage(error) ?? "Password not changed.");
|
|
113
|
+
onSubmit: async (values) => {
|
|
114
|
+
await cmsApi("/api/cms/account/password", { method: "PUT", body: values });
|
|
115
|
+
passwordForm.reset({ currentPassword: "", newPassword: "" });
|
|
116
|
+
toast.success("Password changed");
|
|
128
117
|
}
|
|
129
|
-
}
|
|
118
|
+
});
|
|
130
119
|
</script>
|