@xleddyl/nuxt-cms 0.9.4 → 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 +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
|
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
36
36
|
default: boolean;
|
|
37
37
|
};
|
|
38
38
|
}>> & Readonly<{}>, {
|
|
39
|
-
field: string;
|
|
40
39
|
blocks: readonly CmsBlockItem[] | null;
|
|
41
40
|
entry: string;
|
|
41
|
+
field: string;
|
|
42
42
|
annotate: boolean;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
44
44
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,36 +1,84 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
:is="block.component"
|
|
2
|
+
<CmsBlockNode
|
|
4
3
|
v-for="block in resolved"
|
|
5
4
|
:key="block.key"
|
|
6
|
-
|
|
5
|
+
:block="block"
|
|
6
|
+
:parent="parentOf(block)"
|
|
7
|
+
:attrs="annotating ? annotation(block) : null"
|
|
7
8
|
/>
|
|
9
|
+
<button
|
|
10
|
+
v-if="placeholder"
|
|
11
|
+
type="button"
|
|
12
|
+
class="cms-preview-empty-button is-nested"
|
|
13
|
+
v-bind="cmsTokenRoot(cmsPreviewTheme)"
|
|
14
|
+
:data-cms-insert="placeholder"
|
|
15
|
+
>
|
|
16
|
+
<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
17
|
+
<path
|
|
18
|
+
d="M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
<span>Add a block</span>
|
|
22
|
+
</button>
|
|
8
23
|
</template>
|
|
9
24
|
|
|
10
25
|
<script setup>
|
|
11
|
-
import { computed } from "#imports";
|
|
12
|
-
import {
|
|
26
|
+
import { computed, inject, toRaw } from "#imports";
|
|
27
|
+
import { cmsPreviewEditable, cmsPreviewTheme, cmsTokenRoot } from "../preview/field-marker";
|
|
28
|
+
import { CMS_BLOCK_PARENT, CmsBlockNode } from "./node";
|
|
29
|
+
import { cmsBlockAnnotation, cmsBlockScope, cmsBlockTypeName, resolveCmsBlocks } from "./resolve";
|
|
13
30
|
const props = defineProps({
|
|
14
31
|
blocks: { type: Array, default: null },
|
|
15
32
|
entry: { type: String, default: void 0 },
|
|
16
33
|
field: { type: String, default: void 0 },
|
|
17
34
|
annotate: { type: Boolean, default: false }
|
|
18
35
|
});
|
|
36
|
+
const parent = inject(CMS_BLOCK_PARENT, null);
|
|
37
|
+
const scope = computed(
|
|
38
|
+
() => cmsBlockScope(
|
|
39
|
+
{ entry: props.entry, field: props.field },
|
|
40
|
+
parent?.value ? {
|
|
41
|
+
...parent.value,
|
|
42
|
+
props: Object.fromEntries(
|
|
43
|
+
Object.entries(parent.value.props).map(([key, value]) => [key, toRaw(value)])
|
|
44
|
+
)
|
|
45
|
+
} : null,
|
|
46
|
+
toRaw(props.blocks)
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
const annotating = computed(() => props.annotate || !!parent?.value?.annotate);
|
|
19
50
|
function warnMissing(item) {
|
|
20
51
|
if (!import.meta.dev) return;
|
|
21
|
-
const name = cmsBlockTypeName(
|
|
52
|
+
const name = cmsBlockTypeName(
|
|
53
|
+
item,
|
|
54
|
+
scope.value.schemaPath ? scope.value.entry : void 0,
|
|
55
|
+
scope.value.schemaPath ?? void 0
|
|
56
|
+
) ?? item.type;
|
|
22
57
|
console.warn(
|
|
23
58
|
`[nuxt-cms] <CmsBlocks> has no component for block '${name}': set component on the block in cms.config, or pass entry and field when the data has no __typename`
|
|
24
59
|
);
|
|
25
60
|
}
|
|
26
61
|
const resolved = computed(
|
|
27
62
|
() => resolveCmsBlocks(props.blocks, {
|
|
28
|
-
entry:
|
|
29
|
-
field:
|
|
63
|
+
entry: scope.value.schemaPath ? scope.value.entry : void 0,
|
|
64
|
+
field: scope.value.schemaPath ?? void 0,
|
|
30
65
|
onMissing: warnMissing
|
|
31
66
|
})
|
|
32
67
|
);
|
|
68
|
+
const placeholder = computed(
|
|
69
|
+
() => parent?.value && annotating.value && cmsPreviewEditable.value && !resolved.value.length ? `${scope.value.listPath}.${props.blocks?.length ?? 0}` : null
|
|
70
|
+
);
|
|
71
|
+
function parentOf(block) {
|
|
72
|
+
return {
|
|
73
|
+
entry: scope.value.entry,
|
|
74
|
+
schemaPath: scope.value.schemaPath,
|
|
75
|
+
itemPath: `${scope.value.listPath}.${block.index}`,
|
|
76
|
+
type: block.type,
|
|
77
|
+
props: block.props,
|
|
78
|
+
annotate: annotating.value
|
|
79
|
+
};
|
|
80
|
+
}
|
|
33
81
|
function annotation(block) {
|
|
34
|
-
return
|
|
82
|
+
return cmsBlockAnnotation(block, scope.value, !!parent?.value);
|
|
35
83
|
}
|
|
36
84
|
</script>
|
|
@@ -36,9 +36,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
36
36
|
default: boolean;
|
|
37
37
|
};
|
|
38
38
|
}>> & Readonly<{}>, {
|
|
39
|
-
field: string;
|
|
40
39
|
blocks: readonly CmsBlockItem[] | null;
|
|
41
40
|
entry: string;
|
|
41
|
+
field: string;
|
|
42
42
|
annotate: boolean;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
44
44
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
name: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
as: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
name: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
as: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {
|
|
22
|
+
as: string;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineComponent, h } from "#imports";
|
|
2
|
+
import { CMS_FIELD_ATTRIBUTE, cmsFieldMarking } from "../preview/field-marker.js";
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: "CmsField",
|
|
5
|
+
props: {
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
as: { type: String, default: "span" }
|
|
8
|
+
},
|
|
9
|
+
setup(props, { slots }) {
|
|
10
|
+
return () => h(
|
|
11
|
+
props.as,
|
|
12
|
+
cmsFieldMarking.value ? { [CMS_FIELD_ATTRIBUTE]: props.name } : null,
|
|
13
|
+
slots.default?.()
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey, PropType } from 'vue';
|
|
2
|
+
import type { CmsBlockParent, ResolvedCmsBlock } from './resolve.js';
|
|
3
|
+
export type CmsBlockParentContext = CmsBlockParent & {
|
|
4
|
+
annotate: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const CMS_BLOCK_PARENT: InjectionKey<ComputedRef<CmsBlockParentContext>>;
|
|
7
|
+
export declare const CmsBlockNode: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
block: {
|
|
9
|
+
type: PropType<ResolvedCmsBlock>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
parent: {
|
|
13
|
+
type: PropType<CmsBlockParentContext>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
attrs: {
|
|
17
|
+
type: PropType<Record<string, unknown> | null>;
|
|
18
|
+
default: null;
|
|
19
|
+
};
|
|
20
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
block: {
|
|
24
|
+
type: PropType<ResolvedCmsBlock>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
parent: {
|
|
28
|
+
type: PropType<CmsBlockParentContext>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
attrs: {
|
|
32
|
+
type: PropType<Record<string, unknown> | null>;
|
|
33
|
+
default: null;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
36
|
+
attrs: Record<string, unknown> | null;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed, defineComponent, h, provide } from "#imports";
|
|
2
|
+
export const CMS_BLOCK_PARENT = Symbol("cms-block-parent");
|
|
3
|
+
export const CmsBlockNode = defineComponent({
|
|
4
|
+
name: "CmsBlockNode",
|
|
5
|
+
props: {
|
|
6
|
+
block: { type: Object, required: true },
|
|
7
|
+
parent: { type: Object, required: true },
|
|
8
|
+
attrs: { type: Object, default: null }
|
|
9
|
+
},
|
|
10
|
+
setup(props) {
|
|
11
|
+
provide(
|
|
12
|
+
CMS_BLOCK_PARENT,
|
|
13
|
+
computed(() => props.parent)
|
|
14
|
+
);
|
|
15
|
+
return () => h(props.block.component, { ...props.block.props, ...props.attrs });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -14,6 +14,24 @@ export declare const isHiddenCmsBlock: (item: CmsBlockItem) => boolean;
|
|
|
14
14
|
export declare function cmsBlockTypeName(item: CmsBlockItem, entry?: string, field?: string): string | undefined;
|
|
15
15
|
export declare function cmsBlockComponent(item: CmsBlockItem, entry?: string, field?: string): Component | undefined;
|
|
16
16
|
export declare function cmsBlockProps(item: CmsBlockItem): Record<string, unknown>;
|
|
17
|
+
export interface CmsBlockScope {
|
|
18
|
+
entry?: string;
|
|
19
|
+
schemaPath: string | null;
|
|
20
|
+
listPath: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CmsBlockParent {
|
|
23
|
+
entry?: string;
|
|
24
|
+
schemaPath: string | null;
|
|
25
|
+
itemPath: string;
|
|
26
|
+
type: string;
|
|
27
|
+
props: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export declare function nestedBlocksField(parent: Pick<CmsBlockParent, 'props'>, blocks: unknown, field?: string): string | undefined;
|
|
30
|
+
export declare function cmsBlockScope(options: {
|
|
31
|
+
entry?: string;
|
|
32
|
+
field?: string;
|
|
33
|
+
}, parent?: CmsBlockParent | null, blocks?: unknown): CmsBlockScope;
|
|
34
|
+
export declare function cmsBlockAnnotation(block: Pick<ResolvedCmsBlock, 'index' | 'type'>, scope: Pick<CmsBlockScope, 'listPath'>, nested: boolean): Record<string, string | number>;
|
|
17
35
|
export declare function resolveCmsBlocks(blocks: readonly CmsBlockItem[] | null | undefined, options?: {
|
|
18
36
|
entry?: string;
|
|
19
37
|
field?: string;
|
|
@@ -16,6 +16,40 @@ export function cmsBlockProps(item) {
|
|
|
16
16
|
)
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
|
+
export function nestedBlocksField(parent, blocks, field) {
|
|
20
|
+
if (field) return field;
|
|
21
|
+
if (!blocks) return void 0;
|
|
22
|
+
return Object.entries(parent.props).find(([, value]) => value === blocks)?.[0];
|
|
23
|
+
}
|
|
24
|
+
export function cmsBlockScope(options, parent, blocks) {
|
|
25
|
+
if (!parent) {
|
|
26
|
+
const field = options.field ?? CONTENT_BODY_FIELD;
|
|
27
|
+
return {
|
|
28
|
+
entry: options.entry,
|
|
29
|
+
schemaPath: options.entry ? field : null,
|
|
30
|
+
listPath: field
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const key = nestedBlocksField(parent, blocks, options.field) ?? "_";
|
|
34
|
+
const entry = options.entry ?? parent.entry;
|
|
35
|
+
return {
|
|
36
|
+
entry,
|
|
37
|
+
schemaPath: entry && parent.schemaPath ? `${parent.schemaPath}.${parent.type}.${key}` : null,
|
|
38
|
+
listPath: `${parent.itemPath}.${key}`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function cmsBlockAnnotation(block, scope, nested) {
|
|
42
|
+
const path = `${scope.listPath}.${block.index}`;
|
|
43
|
+
return nested ? {
|
|
44
|
+
"data-cms-block-path": path,
|
|
45
|
+
"data-cms-block-parent": scope.listPath.slice(0, scope.listPath.lastIndexOf(".")),
|
|
46
|
+
"data-cms-block-type": block.type
|
|
47
|
+
} : {
|
|
48
|
+
"data-cms-block": block.index,
|
|
49
|
+
"data-cms-block-path": path,
|
|
50
|
+
"data-cms-block-type": block.type
|
|
51
|
+
};
|
|
52
|
+
}
|
|
19
53
|
export function resolveCmsBlocks(blocks, options = {}) {
|
|
20
54
|
const resolved = [];
|
|
21
55
|
(blocks ?? []).forEach((item, index) => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BlockConfig } from '#nuxt-cms';
|
|
2
|
+
import type { CmsBlockPreset } from '../../../shared/presets.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
blocks: Record<string, BlockConfig>;
|
|
5
|
+
disabledReason?: string;
|
|
6
|
+
pasteCount?: number;
|
|
7
|
+
presets?: CmsBlockPreset[];
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
pick: (type: string) => any;
|
|
12
|
+
paste: () => any;
|
|
13
|
+
close: () => any;
|
|
14
|
+
preset: (id: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onPick?: ((type: string) => any) | undefined;
|
|
17
|
+
onPaste?: (() => any) | undefined;
|
|
18
|
+
onClose?: (() => any) | undefined;
|
|
19
|
+
onPreset?: ((id: string) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KCommandList
|
|
3
|
+
:groups="groups"
|
|
4
|
+
:pinned="pinned"
|
|
5
|
+
:label="label"
|
|
6
|
+
placeholder="Search blocks"
|
|
7
|
+
:empty-text="emptyText"
|
|
8
|
+
@select="choose"
|
|
9
|
+
@close="emit('close')"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { CommandList as KCommandList } from "@xleddyl/443-components-vue";
|
|
15
|
+
import { computed } from "#imports";
|
|
16
|
+
import { blockPickerGroups } from "../../../shared/block-picker";
|
|
17
|
+
import { CMS_PRESET_ICON, CMS_PRESET_PICKER_GROUP, presetPickerItem } from "../../../shared/presets";
|
|
18
|
+
import { cmsIcon } from "../../utils/ui";
|
|
19
|
+
const PASTE_ID = "cms:paste";
|
|
20
|
+
const PRESET_PREFIX = "cms:preset:";
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
blocks: { type: Object, required: true },
|
|
23
|
+
disabledReason: { type: String, required: false, default: void 0 },
|
|
24
|
+
pasteCount: { type: Number, required: false, default: 0 },
|
|
25
|
+
presets: { type: Array, required: false, default: () => [] },
|
|
26
|
+
label: { type: String, required: false, default: "Available blocks" }
|
|
27
|
+
});
|
|
28
|
+
const emit = defineEmits(["pick", "paste", "preset", "close"]);
|
|
29
|
+
const disabledState = computed(
|
|
30
|
+
() => props.disabledReason ? { disabled: true, disabledReason: props.disabledReason } : {}
|
|
31
|
+
);
|
|
32
|
+
const presetGroup = computed(
|
|
33
|
+
() => props.presets.length ? [
|
|
34
|
+
{
|
|
35
|
+
id: "cms:presets",
|
|
36
|
+
label: CMS_PRESET_PICKER_GROUP,
|
|
37
|
+
items: props.presets.map((preset) => {
|
|
38
|
+
const item = presetPickerItem(preset);
|
|
39
|
+
return {
|
|
40
|
+
...item,
|
|
41
|
+
id: `${PRESET_PREFIX}${item.id}`,
|
|
42
|
+
icon: cmsIcon(CMS_PRESET_ICON),
|
|
43
|
+
...disabledState.value
|
|
44
|
+
};
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
] : []
|
|
48
|
+
);
|
|
49
|
+
const groups = computed(() => [
|
|
50
|
+
...blockPickerGroups(props.blocks, () => props.disabledReason).map((group) => ({
|
|
51
|
+
id: group.id || "other",
|
|
52
|
+
label: group.label ?? (presetGroup.value.length ? "Blocks" : void 0),
|
|
53
|
+
items: group.items.map((item) => ({
|
|
54
|
+
id: item.type,
|
|
55
|
+
label: item.label,
|
|
56
|
+
description: item.description,
|
|
57
|
+
icon: cmsIcon(item.icon),
|
|
58
|
+
keywords: item.keywords,
|
|
59
|
+
disabled: item.disabled,
|
|
60
|
+
disabledReason: item.disabledReason,
|
|
61
|
+
data: item.type
|
|
62
|
+
}))
|
|
63
|
+
})),
|
|
64
|
+
...presetGroup.value
|
|
65
|
+
]);
|
|
66
|
+
function pinned(query) {
|
|
67
|
+
const count = props.pasteCount;
|
|
68
|
+
if (!count || query) return [];
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
id: PASTE_ID,
|
|
72
|
+
label: `Paste ${count} ${count === 1 ? "block" : "blocks"}`,
|
|
73
|
+
description: "From the clipboard",
|
|
74
|
+
icon: cmsIcon("clipboard"),
|
|
75
|
+
...disabledState.value
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
function emptyText(query) {
|
|
80
|
+
return `No block matches "${query}".`;
|
|
81
|
+
}
|
|
82
|
+
function choose(item) {
|
|
83
|
+
if (item.id === PASTE_ID) emit("paste");
|
|
84
|
+
else if (item.id.startsWith(PRESET_PREFIX)) emit("preset", item.id.slice(PRESET_PREFIX.length));
|
|
85
|
+
else if (item.data) emit("pick", item.data);
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BlockConfig } from '#nuxt-cms';
|
|
2
|
+
import type { CmsBlockPreset } from '../../../shared/presets.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
blocks: Record<string, BlockConfig>;
|
|
5
|
+
disabledReason?: string;
|
|
6
|
+
pasteCount?: number;
|
|
7
|
+
presets?: CmsBlockPreset[];
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
pick: (type: string) => any;
|
|
12
|
+
paste: () => any;
|
|
13
|
+
close: () => any;
|
|
14
|
+
preset: (id: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onPick?: ((type: string) => any) | undefined;
|
|
17
|
+
onPaste?: (() => any) | undefined;
|
|
18
|
+
onClose?: (() => any) | undefined;
|
|
19
|
+
onPreset?: ((id: string) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BlockConfig } from '#nuxt-cms';
|
|
2
|
+
import type { OverlayAnchorTarget } from '@xleddyl/443-components-vue';
|
|
3
|
+
import type { CmsBlockPreset } from '../../../shared/presets.js';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
blocks: Record<string, BlockConfig>;
|
|
6
|
+
disabledReason?: string;
|
|
7
|
+
pasteCount?: number;
|
|
8
|
+
presets?: CmsBlockPreset[];
|
|
9
|
+
label?: string;
|
|
10
|
+
anchor?: OverlayAnchorTarget | null;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_ModelProps = {
|
|
13
|
+
'open'?: boolean;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare var __VLS_9: {};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
default?: (props: typeof __VLS_9) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
pick: (type: string) => any;
|
|
22
|
+
paste: () => any;
|
|
23
|
+
preset: (id: string) => any;
|
|
24
|
+
"update:open": (value: boolean) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
onPick?: ((type: string) => any) | undefined;
|
|
27
|
+
onPaste?: (() => any) | undefined;
|
|
28
|
+
onPreset?: ((id: string) => any) | undefined;
|
|
29
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<KPopover v-model:open="open" :anchor="anchor" :label="label" placement="bottom-start" sheet>
|
|
3
|
+
<template v-if="$slots.default" #default><slot /></template>
|
|
4
|
+
<template #content>
|
|
5
|
+
<CmsBlockPicker
|
|
6
|
+
v-if="open"
|
|
7
|
+
:blocks="blocks"
|
|
8
|
+
:disabled-reason="disabledReason"
|
|
9
|
+
:paste-count="pasteCount"
|
|
10
|
+
:presets="presets"
|
|
11
|
+
@pick="pick"
|
|
12
|
+
@paste="paste"
|
|
13
|
+
@preset="preset"
|
|
14
|
+
@close="open = false"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
</KPopover>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { Popover as KPopover } from "@xleddyl/443-components-vue";
|
|
22
|
+
defineProps({
|
|
23
|
+
blocks: { type: Object, required: true },
|
|
24
|
+
disabledReason: { type: String, required: false, default: void 0 },
|
|
25
|
+
pasteCount: { type: Number, required: false, default: 0 },
|
|
26
|
+
presets: { type: Array, required: false, default: () => [] },
|
|
27
|
+
label: { type: String, required: false, default: "Insert a block" },
|
|
28
|
+
anchor: { type: null, required: false, default: null }
|
|
29
|
+
});
|
|
30
|
+
const emit = defineEmits(["pick", "paste", "preset"]);
|
|
31
|
+
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
32
|
+
function pick(type) {
|
|
33
|
+
open.value = false;
|
|
34
|
+
emit("pick", type);
|
|
35
|
+
}
|
|
36
|
+
function paste() {
|
|
37
|
+
open.value = false;
|
|
38
|
+
emit("paste");
|
|
39
|
+
}
|
|
40
|
+
function preset(id) {
|
|
41
|
+
open.value = false;
|
|
42
|
+
emit("preset", id);
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BlockConfig } from '#nuxt-cms';
|
|
2
|
+
import type { OverlayAnchorTarget } from '@xleddyl/443-components-vue';
|
|
3
|
+
import type { CmsBlockPreset } from '../../../shared/presets.js';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
blocks: Record<string, BlockConfig>;
|
|
6
|
+
disabledReason?: string;
|
|
7
|
+
pasteCount?: number;
|
|
8
|
+
presets?: CmsBlockPreset[];
|
|
9
|
+
label?: string;
|
|
10
|
+
anchor?: OverlayAnchorTarget | null;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_ModelProps = {
|
|
13
|
+
'open'?: boolean;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare var __VLS_9: {};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
default?: (props: typeof __VLS_9) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
pick: (type: string) => any;
|
|
22
|
+
paste: () => any;
|
|
23
|
+
preset: (id: string) => any;
|
|
24
|
+
"update:open": (value: boolean) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
26
|
+
onPick?: ((type: string) => any) | undefined;
|
|
27
|
+
onPaste?: (() => any) | undefined;
|
|
28
|
+
onPreset?: ((id: string) => any) | undefined;
|
|
29
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CmsBlockPath, FieldConfig } from '#nuxt-cms';
|
|
2
|
+
import type { MenuItems } from '@xleddyl/443-components-vue';
|
|
3
|
+
import type { CmsBlockValue } from '../../../shared/preview.js';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
items: CmsBlockValue[];
|
|
6
|
+
field: FieldConfig;
|
|
7
|
+
fieldKey: string;
|
|
8
|
+
locale: string;
|
|
9
|
+
selected: CmsBlockPath | null;
|
|
10
|
+
highlighted: CmsBlockPath | null;
|
|
11
|
+
errors: ReadonlySet<string>;
|
|
12
|
+
canAdd: (list: CmsBlockPath) => boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
menu: (path: CmsBlockPath) => MenuItems;
|
|
15
|
+
readonly?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
select: (path: CmsBlockPath) => any;
|
|
19
|
+
hover: (path: CmsBlockPath | null) => any;
|
|
20
|
+
insert: (list: CmsBlockPath, index: number, anchor: HTMLElement) => any;
|
|
21
|
+
move: (from: CmsBlockPath, toList: CmsBlockPath, toIndex: number) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onSelect?: ((path: CmsBlockPath) => any) | undefined;
|
|
24
|
+
onHover?: ((path: CmsBlockPath | null) => any) | undefined;
|
|
25
|
+
onInsert?: ((list: CmsBlockPath, index: number, anchor: HTMLElement) => any) | undefined;
|
|
26
|
+
onMove?: ((from: CmsBlockPath, toList: CmsBlockPath, toIndex: number) => any) | undefined;
|
|
27
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|