@xleddyl/nuxt-cms 0.9.3 → 0.10.0
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 -218
- 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 -146
- 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 +29 -5
- 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 +42 -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 +9 -8
- package/dist/runtime/app/components/cms/TranslationBadges.d.vue.ts +7 -0
- package/dist/runtime/app/components/cms/TranslationBadges.vue +45 -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 +1152 -335
- 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 +190 -53
- 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 +29 -10
- 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 +145 -29
- 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/single-row.d.ts +3 -0
- package/dist/runtime/server/utils/single-row.js +4 -0
- 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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KForm :id="formId" :form="form">
|
|
3
|
+
<KFormField label="Name" name="name" required>
|
|
4
|
+
<KInput
|
|
5
|
+
v-model="draft.name"
|
|
6
|
+
:maxlength="CMS_PRESET_NAME_MAX"
|
|
7
|
+
placeholder="Article intro"
|
|
8
|
+
autocomplete="off"
|
|
9
|
+
/>
|
|
10
|
+
</KFormField>
|
|
11
|
+
<KFormField label="Description" name="description">
|
|
12
|
+
<KTextarea
|
|
13
|
+
v-model="draft.description"
|
|
14
|
+
:maxlength="CMS_PRESET_DESCRIPTION_MAX"
|
|
15
|
+
:rows="3"
|
|
16
|
+
placeholder="Optional"
|
|
17
|
+
/>
|
|
18
|
+
</KFormField>
|
|
19
|
+
<KFieldMessage tone="neutral" :icon="false" :message="presetMeta(preset)" />
|
|
20
|
+
</KForm>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import {
|
|
25
|
+
FieldMessage as KFieldMessage,
|
|
26
|
+
Form as KForm,
|
|
27
|
+
FormField as KFormField,
|
|
28
|
+
Input as KInput,
|
|
29
|
+
Textarea as KTextarea,
|
|
30
|
+
toast,
|
|
31
|
+
useForm
|
|
32
|
+
} from "@xleddyl/443-components-vue";
|
|
33
|
+
import { ref } from "#imports";
|
|
34
|
+
import { CMS_PRESET_DESCRIPTION_MAX, CMS_PRESET_NAME_MAX } from "../../../shared/presets";
|
|
35
|
+
import { presetMeta } from "../../composables/cms-settings-stores";
|
|
36
|
+
import { useCmsSettingsForm } from "../../composables/cms-settings-form";
|
|
37
|
+
import { cmsApi } from "../../utils/api";
|
|
38
|
+
const props = defineProps({
|
|
39
|
+
preset: { type: Object, required: true }
|
|
40
|
+
});
|
|
41
|
+
const emit = defineEmits(["saved"]);
|
|
42
|
+
const draft = ref({ name: props.preset.name, description: props.preset.description ?? "" });
|
|
43
|
+
const form = useForm({
|
|
44
|
+
values: draft,
|
|
45
|
+
schema: {
|
|
46
|
+
name: { required: true, maxLength: CMS_PRESET_NAME_MAX },
|
|
47
|
+
description: { maxLength: CMS_PRESET_DESCRIPTION_MAX }
|
|
48
|
+
},
|
|
49
|
+
onSubmit: async (values) => {
|
|
50
|
+
const description = values.description.trim();
|
|
51
|
+
const saved = await cmsApi(`/api/cms/presets/${props.preset.id}`, {
|
|
52
|
+
method: "PUT",
|
|
53
|
+
body: { name: values.name.trim(), ...description ? { description } : {} }
|
|
54
|
+
});
|
|
55
|
+
toast.success("Preset saved");
|
|
56
|
+
emit("saved", saved);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const formId = useCmsSettingsForm({ submitting: form.submitting });
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CmsBlockPreset } from '../../../shared/presets.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
preset: CmsBlockPreset;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
saved: (preset: CmsBlockPreset) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
onSaved?: ((preset: CmsBlockPreset) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SettingsModalPage } from '@xleddyl/443-components-vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page?: SettingsModalPage;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
open: (page: SettingsModalPage) => any;
|
|
7
|
+
back: () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onOpen?: ((page: SettingsModalPage) => any) | undefined;
|
|
10
|
+
onBack?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<CmsSettingsPresetForm
|
|
3
|
+
v-if="page && current"
|
|
4
|
+
:key="page.id"
|
|
5
|
+
:preset="current"
|
|
6
|
+
@saved="onSaved"
|
|
7
|
+
/>
|
|
8
|
+
<KSkeletonForm v-else-if="page && !store.loaded.value" :fields="2" />
|
|
9
|
+
<KRecordList
|
|
10
|
+
v-else
|
|
11
|
+
:items="items"
|
|
12
|
+
:loading="!store.loaded.value"
|
|
13
|
+
label="Block presets"
|
|
14
|
+
:empty-icon="cmsIcon(CMS_PRESET_ICON)"
|
|
15
|
+
empty-text="No presets yet"
|
|
16
|
+
empty-description="Use Save as preset in the menu of a block to keep a copy of it here."
|
|
17
|
+
@row-click="(item2) => open(item2.preset)"
|
|
18
|
+
>
|
|
19
|
+
<template #action="{ item }">
|
|
20
|
+
<KButton
|
|
21
|
+
:icon="cmsIcon('pencil')"
|
|
22
|
+
variant="ghost"
|
|
23
|
+
tone="neutral"
|
|
24
|
+
size="sm"
|
|
25
|
+
square
|
|
26
|
+
aria-label="Edit"
|
|
27
|
+
@click="open(item.preset)"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
</KRecordList>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script setup>
|
|
34
|
+
import {
|
|
35
|
+
Button as KButton,
|
|
36
|
+
RecordList as KRecordList,
|
|
37
|
+
SkeletonForm as KSkeletonForm
|
|
38
|
+
} from "@xleddyl/443-components-vue";
|
|
39
|
+
import { computed, onMounted } from "#imports";
|
|
40
|
+
import { CMS_PRESET_ICON } from "../../../shared/presets";
|
|
41
|
+
import { presetMeta, useCmsPresetStore } from "../../composables/cms-settings-stores";
|
|
42
|
+
import { cmsIcon } from "../../utils/ui";
|
|
43
|
+
const props = defineProps({
|
|
44
|
+
page: { type: Object, required: false }
|
|
45
|
+
});
|
|
46
|
+
const emit = defineEmits(["open", "back"]);
|
|
47
|
+
const store = useCmsPresetStore();
|
|
48
|
+
onMounted(store.load);
|
|
49
|
+
const current = computed(() => store.find(props.page?.id));
|
|
50
|
+
const items = computed(
|
|
51
|
+
() => store.items.value.map((preset) => ({
|
|
52
|
+
id: preset.id,
|
|
53
|
+
preset,
|
|
54
|
+
title: preset.name,
|
|
55
|
+
description: [presetMeta(preset), preset.description].filter(Boolean).join(" \xB7 ")
|
|
56
|
+
}))
|
|
57
|
+
);
|
|
58
|
+
function open(preset) {
|
|
59
|
+
emit("open", { id: preset.id, label: preset.name });
|
|
60
|
+
}
|
|
61
|
+
function onSaved(preset) {
|
|
62
|
+
store.saved(preset);
|
|
63
|
+
emit("back");
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SettingsModalPage } from '@xleddyl/443-components-vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page?: SettingsModalPage;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
open: (page: SettingsModalPage) => any;
|
|
7
|
+
back: () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onOpen?: ((page: SettingsModalPage) => any) | undefined;
|
|
10
|
+
onBack?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SettingsModalPage } from '@xleddyl/443-components-vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page?: SettingsModalPage;
|
|
4
|
+
addLabel?: string;
|
|
5
|
+
newLabel?: string;
|
|
6
|
+
addIcon?: string;
|
|
7
|
+
hideAdd?: boolean;
|
|
8
|
+
deletable?: boolean;
|
|
9
|
+
deleteDisabled?: boolean;
|
|
10
|
+
deleteHint?: string;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_1: {}, __VLS_11: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
list?: (props: typeof __VLS_1) => any;
|
|
15
|
+
} & {
|
|
16
|
+
default?: (props: typeof __VLS_11) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
delete: () => any;
|
|
20
|
+
open: (page: SettingsModalPage) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onDelete?: (() => any) | undefined;
|
|
23
|
+
onOpen?: ((page: SettingsModalPage) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template v-if="!page">
|
|
3
|
+
<slot name="list" />
|
|
4
|
+
<KButton v-if="!hideAdd" :icon="cmsIcon(addIcon)" size="sm" @click="openNew">
|
|
5
|
+
{{ addLabel }}
|
|
6
|
+
</KButton>
|
|
7
|
+
</template>
|
|
8
|
+
<template v-else>
|
|
9
|
+
<slot />
|
|
10
|
+
<KButton
|
|
11
|
+
v-if="deletable"
|
|
12
|
+
size="sm"
|
|
13
|
+
variant="soft"
|
|
14
|
+
tone="danger"
|
|
15
|
+
icon="trash"
|
|
16
|
+
:disabled="deleteDisabled"
|
|
17
|
+
:disabled-reason="deleteHint"
|
|
18
|
+
@click="emit('delete')"
|
|
19
|
+
>
|
|
20
|
+
Delete
|
|
21
|
+
</KButton>
|
|
22
|
+
<CmsSettingsFormAction />
|
|
23
|
+
</template>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
import { Button as KButton } from "@xleddyl/443-components-vue";
|
|
28
|
+
import { CMS_NEW_RECORD } from "../../composables/cms-route";
|
|
29
|
+
import { cmsIcon } from "../../utils/ui";
|
|
30
|
+
import CmsSettingsFormAction from "./SettingsFormAction.vue";
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
page: { type: Object, required: false, default: void 0 },
|
|
33
|
+
addLabel: { type: String, required: false, default: "Add" },
|
|
34
|
+
newLabel: { type: String, required: false, default: "New" },
|
|
35
|
+
addIcon: { type: String, required: false, default: "plus" },
|
|
36
|
+
hideAdd: { type: Boolean, required: false, default: false },
|
|
37
|
+
deletable: { type: Boolean, required: false },
|
|
38
|
+
deleteDisabled: { type: Boolean, required: false },
|
|
39
|
+
deleteHint: { type: String, required: false, default: void 0 }
|
|
40
|
+
});
|
|
41
|
+
const emit = defineEmits(["open", "delete"]);
|
|
42
|
+
function openNew() {
|
|
43
|
+
emit("open", { id: CMS_NEW_RECORD, label: props.newLabel });
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SettingsModalPage } from '@xleddyl/443-components-vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page?: SettingsModalPage;
|
|
4
|
+
addLabel?: string;
|
|
5
|
+
newLabel?: string;
|
|
6
|
+
addIcon?: string;
|
|
7
|
+
hideAdd?: boolean;
|
|
8
|
+
deletable?: boolean;
|
|
9
|
+
deleteDisabled?: boolean;
|
|
10
|
+
deleteHint?: string;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_1: {}, __VLS_11: {};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
list?: (props: typeof __VLS_1) => any;
|
|
15
|
+
} & {
|
|
16
|
+
default?: (props: typeof __VLS_11) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
delete: () => any;
|
|
20
|
+
open: (page: SettingsModalPage) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onDelete?: (() => any) | undefined;
|
|
23
|
+
onOpen?: ((page: SettingsModalPage) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<CmsSettingsRecordActions v-bind="$attrs">
|
|
3
|
+
<template #list>
|
|
4
|
+
<KDropdownMenu :items="menuItems" placement="bottom-end" label="Import and export">
|
|
5
|
+
<KButton
|
|
6
|
+
icon="ellipsis-horizontal"
|
|
7
|
+
variant="ghost"
|
|
8
|
+
tone="neutral"
|
|
9
|
+
size="sm"
|
|
10
|
+
square
|
|
11
|
+
aria-label="Import and export"
|
|
12
|
+
:loading="store.importing.value"
|
|
13
|
+
/>
|
|
14
|
+
</KDropdownMenu>
|
|
15
|
+
</template>
|
|
16
|
+
</CmsSettingsRecordActions>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import {
|
|
21
|
+
Button as KButton,
|
|
22
|
+
DropdownMenu as KDropdownMenu,
|
|
23
|
+
useFileDialog
|
|
24
|
+
} from "@xleddyl/443-components-vue";
|
|
25
|
+
import { computed } from "#imports";
|
|
26
|
+
import { useCmsRedirects } from "../../composables/cms-settings-stores";
|
|
27
|
+
import { cmsIcon } from "../../utils/ui";
|
|
28
|
+
import CmsSettingsRecordActions from "./SettingsRecordActions.vue";
|
|
29
|
+
defineOptions({ inheritAttrs: false });
|
|
30
|
+
const store = useCmsRedirects();
|
|
31
|
+
const fileDialog = useFileDialog({ accept: ".csv,.json,text/csv,application/json" });
|
|
32
|
+
async function importFile() {
|
|
33
|
+
const [file] = await fileDialog.open();
|
|
34
|
+
if (file) await store.importFile(file);
|
|
35
|
+
}
|
|
36
|
+
const empty = computed(() => !store.items.value.length);
|
|
37
|
+
const menuItems = computed(() => [
|
|
38
|
+
{
|
|
39
|
+
label: "Import CSV or JSON",
|
|
40
|
+
icon: cmsIcon("arrow-up-tray"),
|
|
41
|
+
onSelect: () => void importFile()
|
|
42
|
+
},
|
|
43
|
+
{ type: "separator" },
|
|
44
|
+
{
|
|
45
|
+
label: "Export CSV",
|
|
46
|
+
icon: cmsIcon("arrow-down-tray"),
|
|
47
|
+
disabled: empty.value,
|
|
48
|
+
disabledReason: "No redirects to export",
|
|
49
|
+
onSelect: store.exportCsv
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "Export JSON",
|
|
53
|
+
icon: cmsIcon("arrow-down-tray"),
|
|
54
|
+
disabled: empty.value,
|
|
55
|
+
disabledReason: "No redirects to export",
|
|
56
|
+
onSelect: store.exportJson
|
|
57
|
+
}
|
|
58
|
+
]);
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CmsRedirect } from '#nuxt-cms';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
redirect?: CmsRedirect;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
saved: (redirect: CmsRedirect) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
onSaved?: ((redirect: CmsRedirect) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KForm :id="formId" :form="form">
|
|
3
|
+
<KGrid :columns="{ base: 1, sm: 2 }">
|
|
4
|
+
<KFormField label="From" name="from" required>
|
|
5
|
+
<KInput v-model="draft.from" placeholder="/old-page" autocomplete="off" />
|
|
6
|
+
</KFormField>
|
|
7
|
+
<KFormField label="To" name="to" required>
|
|
8
|
+
<KInput
|
|
9
|
+
v-model="draft.to"
|
|
10
|
+
placeholder="/new-page or https://example.com"
|
|
11
|
+
autocomplete="off"
|
|
12
|
+
/>
|
|
13
|
+
</KFormField>
|
|
14
|
+
</KGrid>
|
|
15
|
+
<KGrid :columns="{ base: 1, sm: 2 }">
|
|
16
|
+
<KFormField label="Status" name="status">
|
|
17
|
+
<KSelect v-model="draft.status" :options="REDIRECT_STATUS_OPTIONS" />
|
|
18
|
+
</KFormField>
|
|
19
|
+
<KFormField label="Query string" name="keepQuery">
|
|
20
|
+
<KSwitch v-model="draft.keepQuery" label="Keep the visitor's query" />
|
|
21
|
+
</KFormField>
|
|
22
|
+
</KGrid>
|
|
23
|
+
</KForm>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script setup>
|
|
27
|
+
import { redirectFromErrors, redirectToErrors } from "#nuxt-cms";
|
|
28
|
+
import {
|
|
29
|
+
Form as KForm,
|
|
30
|
+
FormField as KFormField,
|
|
31
|
+
Grid as KGrid,
|
|
32
|
+
Input as KInput,
|
|
33
|
+
Select as KSelect,
|
|
34
|
+
Switch as KSwitch,
|
|
35
|
+
toast,
|
|
36
|
+
useForm
|
|
37
|
+
} from "@xleddyl/443-components-vue";
|
|
38
|
+
import { ref } from "#imports";
|
|
39
|
+
import { useCmsSettingsForm } from "../../composables/cms-settings-form";
|
|
40
|
+
import { cmsApi } from "../../utils/api";
|
|
41
|
+
import { REDIRECT_STATUS_OPTIONS } from "../../utils/redirects";
|
|
42
|
+
const props = defineProps({
|
|
43
|
+
redirect: { type: Object, required: false }
|
|
44
|
+
});
|
|
45
|
+
const emit = defineEmits(["saved"]);
|
|
46
|
+
const draft = ref({
|
|
47
|
+
from: props.redirect?.from ?? "",
|
|
48
|
+
to: props.redirect?.to ?? "",
|
|
49
|
+
status: props.redirect?.status ?? 301,
|
|
50
|
+
keepQuery: props.redirect?.keepQuery ?? true
|
|
51
|
+
});
|
|
52
|
+
const form = useForm({
|
|
53
|
+
values: draft,
|
|
54
|
+
schema: {
|
|
55
|
+
from: { required: true, validate: (value) => redirectFromErrors(value.trim())[0] },
|
|
56
|
+
to: { required: true, validate: (value) => redirectToErrors(value.trim())[0] }
|
|
57
|
+
},
|
|
58
|
+
onSubmit: async (values) => {
|
|
59
|
+
const creating = !props.redirect;
|
|
60
|
+
const saved = await cmsApi(
|
|
61
|
+
creating ? "/api/cms/redirects" : `/api/cms/redirects/${props.redirect.id}`,
|
|
62
|
+
{
|
|
63
|
+
method: creating ? "POST" : "PUT",
|
|
64
|
+
body: {
|
|
65
|
+
from: values.from.trim(),
|
|
66
|
+
to: values.to.trim(),
|
|
67
|
+
status: values.status,
|
|
68
|
+
keepQuery: values.keepQuery
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
toast.success(creating ? "Redirect added" : "Redirect saved");
|
|
73
|
+
emit("saved", saved);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const formId = useCmsSettingsForm({ creating: () => !props.redirect, submitting: form.submitting });
|
|
77
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CmsRedirect } from '#nuxt-cms';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
redirect?: CmsRedirect;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
saved: (redirect: CmsRedirect) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
onSaved?: ((redirect: CmsRedirect) => any) | undefined;
|
|
9
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SettingsModalPage } from '@xleddyl/443-components-vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page?: SettingsModalPage;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
open: (page: SettingsModalPage) => any;
|
|
7
|
+
back: () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onOpen?: ((page: SettingsModalPage) => any) | undefined;
|
|
10
|
+
onBack?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KFieldset v-if="page && (isNew || current)">
|
|
3
|
+
<CmsSettingsRedirectForm :key="page.id" :redirect="current" @saved="onSaved" />
|
|
4
|
+
</KFieldset>
|
|
5
|
+
<KSkeletonForm v-else-if="page && !store.loaded.value" :fields="4" :columns="2" />
|
|
6
|
+
<KStack v-else>
|
|
7
|
+
<KInput
|
|
8
|
+
v-if="store.items.value.length"
|
|
9
|
+
v-model="search"
|
|
10
|
+
type="search"
|
|
11
|
+
size="sm"
|
|
12
|
+
icon="magnifying-glass"
|
|
13
|
+
clearable
|
|
14
|
+
placeholder="Search redirects"
|
|
15
|
+
aria-label="Search redirects"
|
|
16
|
+
/>
|
|
17
|
+
<KRecordList
|
|
18
|
+
:items="items"
|
|
19
|
+
:loading="!store.loaded.value"
|
|
20
|
+
label="Redirects"
|
|
21
|
+
:empty-icon="cmsIcon(search ? 'magnifying-glass' : 'arrow-uturn-right')"
|
|
22
|
+
:empty-text="search ? 'No redirects found' : 'No redirects yet'"
|
|
23
|
+
:empty-description="
|
|
24
|
+
search ? `Nothing matches \u201C${search}\u201D.` : 'A redirect sends visitors from an old path to a new one. Changing the slug of a published item adds one for you.'
|
|
25
|
+
"
|
|
26
|
+
@row-click="(item2) => open(item2.redirect)"
|
|
27
|
+
>
|
|
28
|
+
<template #action="{ item }">
|
|
29
|
+
<KButton
|
|
30
|
+
:icon="cmsIcon('pencil')"
|
|
31
|
+
variant="ghost"
|
|
32
|
+
tone="neutral"
|
|
33
|
+
size="sm"
|
|
34
|
+
square
|
|
35
|
+
aria-label="Edit"
|
|
36
|
+
@click="open(item.redirect)"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
<template v-if="!search" #empty-actions>
|
|
40
|
+
<CmsSettingsEmptyAdd
|
|
41
|
+
label="Add redirect"
|
|
42
|
+
new-label="New redirect"
|
|
43
|
+
@open="emit('open', $event)"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
46
|
+
</KRecordList>
|
|
47
|
+
<KPagination
|
|
48
|
+
v-if="filtered.length > PAGE_SIZE"
|
|
49
|
+
v-model:page="pageNumber"
|
|
50
|
+
:total="filtered.length"
|
|
51
|
+
:page-size="PAGE_SIZE"
|
|
52
|
+
size="sm"
|
|
53
|
+
/>
|
|
54
|
+
</KStack>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script setup>
|
|
58
|
+
import {
|
|
59
|
+
Button as KButton,
|
|
60
|
+
Fieldset as KFieldset,
|
|
61
|
+
Input as KInput,
|
|
62
|
+
Pagination as KPagination,
|
|
63
|
+
RecordList as KRecordList,
|
|
64
|
+
SkeletonForm as KSkeletonForm,
|
|
65
|
+
Stack as KStack
|
|
66
|
+
} from "@xleddyl/443-components-vue";
|
|
67
|
+
import { computed, onMounted, ref, watch } from "#imports";
|
|
68
|
+
import { CMS_NEW_RECORD } from "../../composables/cms-route";
|
|
69
|
+
import { useCmsRedirects } from "../../composables/cms-settings-stores";
|
|
70
|
+
import { cmsIcon } from "../../utils/ui";
|
|
71
|
+
import { REDIRECT_STATUS_LABELS } from "../../utils/redirects";
|
|
72
|
+
const PAGE_SIZE = 25;
|
|
73
|
+
const props = defineProps({
|
|
74
|
+
page: { type: Object, required: false }
|
|
75
|
+
});
|
|
76
|
+
const emit = defineEmits(["open", "back"]);
|
|
77
|
+
const store = useCmsRedirects();
|
|
78
|
+
onMounted(store.load);
|
|
79
|
+
const isNew = computed(() => props.page?.id === CMS_NEW_RECORD);
|
|
80
|
+
const current = computed(() => store.find(props.page?.id));
|
|
81
|
+
const search = ref("");
|
|
82
|
+
const pageNumber = ref(1);
|
|
83
|
+
watch(search, () => {
|
|
84
|
+
pageNumber.value = 1;
|
|
85
|
+
});
|
|
86
|
+
const filtered = computed(() => {
|
|
87
|
+
const term = search.value.trim().toLowerCase();
|
|
88
|
+
const list = store.sorted.value;
|
|
89
|
+
if (!term) return list;
|
|
90
|
+
return list.filter(
|
|
91
|
+
(redirect) => redirect.from.toLowerCase().includes(term) || redirect.to.toLowerCase().includes(term)
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
function statusLabel(status) {
|
|
95
|
+
return REDIRECT_STATUS_LABELS[status];
|
|
96
|
+
}
|
|
97
|
+
const items = computed(
|
|
98
|
+
() => filtered.value.slice((pageNumber.value - 1) * PAGE_SIZE, pageNumber.value * PAGE_SIZE).map((redirect) => ({
|
|
99
|
+
id: redirect.id,
|
|
100
|
+
redirect,
|
|
101
|
+
title: `${redirect.from} \u2192 ${redirect.to}`,
|
|
102
|
+
description: [
|
|
103
|
+
statusLabel(redirect.status),
|
|
104
|
+
redirect.keepQuery ? "Keeps the query" : "Drops the query",
|
|
105
|
+
redirect.source === "auto" ? "Added when a page moved" : "Added by hand"
|
|
106
|
+
].join(" \xB7 "),
|
|
107
|
+
badge: { label: String(redirect.status) }
|
|
108
|
+
}))
|
|
109
|
+
);
|
|
110
|
+
function open(redirect) {
|
|
111
|
+
emit("open", { id: redirect.id, label: redirect.from });
|
|
112
|
+
}
|
|
113
|
+
function onSaved(redirect) {
|
|
114
|
+
store.upsert(redirect);
|
|
115
|
+
emit("back");
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SettingsModalPage } from '@xleddyl/443-components-vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page?: SettingsModalPage;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
open: (page: SettingsModalPage) => any;
|
|
7
|
+
back: () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onOpen?: ((page: SettingsModalPage) => any) | undefined;
|
|
10
|
+
onBack?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
items: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
copyLabel?: string;
|
|
9
|
+
secretKey?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
done: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onDone?: (() => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KCard :title="title" :description="description">
|
|
3
|
+
<KDescriptionList :items="rows">
|
|
4
|
+
<template #value="{ item }">
|
|
5
|
+
<span :class="{ 'k-mono': item.key === secretKey }">{{ item.value }}</span>
|
|
6
|
+
</template>
|
|
7
|
+
</KDescriptionList>
|
|
8
|
+
<template #footer>
|
|
9
|
+
<KCopyButton
|
|
10
|
+
variant="soft"
|
|
11
|
+
tone="neutral"
|
|
12
|
+
:value="copyText"
|
|
13
|
+
:label="copyLabel"
|
|
14
|
+
copied-label="Copied"
|
|
15
|
+
show-label
|
|
16
|
+
size="sm"
|
|
17
|
+
/>
|
|
18
|
+
<KButton variant="ghost" tone="neutral" size="sm" @click="emit('done')">Done</KButton>
|
|
19
|
+
</template>
|
|
20
|
+
</KCard>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import {
|
|
25
|
+
Button as KButton,
|
|
26
|
+
Card as KCard,
|
|
27
|
+
CopyButton as KCopyButton,
|
|
28
|
+
DescriptionList as KDescriptionList
|
|
29
|
+
} from "@xleddyl/443-components-vue";
|
|
30
|
+
import { computed } from "#imports";
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
title: { type: String, required: true },
|
|
33
|
+
description: { type: String, required: true },
|
|
34
|
+
items: { type: Array, required: true },
|
|
35
|
+
copyLabel: { type: String, required: false, default: "Copy credentials" },
|
|
36
|
+
secretKey: { type: String, required: false, default: "password" }
|
|
37
|
+
});
|
|
38
|
+
const emit = defineEmits(["done"]);
|
|
39
|
+
const rows = computed(() => props.items.map((item) => ({ key: item.label.toLowerCase(), ...item })));
|
|
40
|
+
const copyText = computed(
|
|
41
|
+
() => props.items.map((item) => `${item.label}: ${item.value}`).join("\n")
|
|
42
|
+
);
|
|
43
|
+
</script>
|