@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,322 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="root" class="cms-block-tree">
|
|
3
|
+
<KTree
|
|
4
|
+
v-model:expanded="expanded"
|
|
5
|
+
:nodes="nodes"
|
|
6
|
+
:selected="selectedId"
|
|
7
|
+
:highlighted="highlightedId"
|
|
8
|
+
:label="label"
|
|
9
|
+
size="sm"
|
|
10
|
+
:bordered="false"
|
|
11
|
+
:move-buttons="false"
|
|
12
|
+
:reorderable="!readonly"
|
|
13
|
+
nestable
|
|
14
|
+
:can-drop="canDrop"
|
|
15
|
+
empty-variant="plain"
|
|
16
|
+
:empty-icon="cmsIcon('rectangle-stack')"
|
|
17
|
+
empty-text="No blocks yet"
|
|
18
|
+
:empty-description="
|
|
19
|
+
canAdd([fieldKey]) ? 'Add the first block to start the page.' : void 0
|
|
20
|
+
"
|
|
21
|
+
@select="onSelect"
|
|
22
|
+
@move="onMove"
|
|
23
|
+
@hover="onHover"
|
|
24
|
+
>
|
|
25
|
+
<template #label="{ node }">
|
|
26
|
+
<span v-if="rowOf(node)?.kind === 'add'" class="cms-block-tree-add">
|
|
27
|
+
{{ node.label }}
|
|
28
|
+
</span>
|
|
29
|
+
<span
|
|
30
|
+
v-else
|
|
31
|
+
class="cms-block-tree-text"
|
|
32
|
+
:class="{ 'is-group': rowOf(node)?.kind === 'field' }"
|
|
33
|
+
>
|
|
34
|
+
<span class="cms-block-tree-label">{{ node.label }}</span>
|
|
35
|
+
<span v-if="node.description" class="cms-block-tree-summary">
|
|
36
|
+
{{ node.description }}
|
|
37
|
+
</span>
|
|
38
|
+
</span>
|
|
39
|
+
</template>
|
|
40
|
+
<template #meta="{ node }">
|
|
41
|
+
<template v-if="rowOf(node)?.hidden">
|
|
42
|
+
<KIcon :name="cmsIcon('eye-slash')" class="cms-block-tree-hidden" />
|
|
43
|
+
<KVisuallyHidden>Hidden</KVisuallyHidden>
|
|
44
|
+
</template>
|
|
45
|
+
</template>
|
|
46
|
+
<template #actions="{ node }">
|
|
47
|
+
<template v-if="blockRow(node)">
|
|
48
|
+
<KButton
|
|
49
|
+
v-if="!readonly && canAdd(blockListPath(blockRow(node).path))"
|
|
50
|
+
:icon="cmsIcon('plus')"
|
|
51
|
+
size="xs"
|
|
52
|
+
variant="ghost"
|
|
53
|
+
tone="neutral"
|
|
54
|
+
aria-haspopup="dialog"
|
|
55
|
+
:aria-label="`Add a block after ${node.label}`"
|
|
56
|
+
@click="(event) => insertAfter(blockRow(node).path, event)"
|
|
57
|
+
/>
|
|
58
|
+
<KDropdownMenu :items="menu(blockRow(node).path)" placement="bottom-end">
|
|
59
|
+
<KButton
|
|
60
|
+
:icon="cmsIcon('ellipsis-horizontal')"
|
|
61
|
+
size="xs"
|
|
62
|
+
variant="ghost"
|
|
63
|
+
tone="neutral"
|
|
64
|
+
:aria-label="`${node.label} actions`"
|
|
65
|
+
/>
|
|
66
|
+
</KDropdownMenu>
|
|
67
|
+
</template>
|
|
68
|
+
<KButton
|
|
69
|
+
v-else-if="fieldRow(node) && !readonly && canAdd(fieldRow(node).list)"
|
|
70
|
+
:icon="cmsIcon('plus')"
|
|
71
|
+
size="xs"
|
|
72
|
+
variant="ghost"
|
|
73
|
+
tone="neutral"
|
|
74
|
+
aria-haspopup="dialog"
|
|
75
|
+
:aria-label="`Add a block to ${node.label}`"
|
|
76
|
+
@click="(event) => appendTo(fieldRow(node).list, event)"
|
|
77
|
+
/>
|
|
78
|
+
</template>
|
|
79
|
+
<template v-if="canAdd([fieldKey]) && !readonly" #empty-actions>
|
|
80
|
+
<KButton
|
|
81
|
+
:icon="cmsIcon('plus')"
|
|
82
|
+
label="Add a block"
|
|
83
|
+
size="sm"
|
|
84
|
+
variant="soft"
|
|
85
|
+
tone="neutral"
|
|
86
|
+
aria-haspopup="dialog"
|
|
87
|
+
@click="(event) => appendTo([fieldKey], event)"
|
|
88
|
+
/>
|
|
89
|
+
</template>
|
|
90
|
+
</KTree>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script setup>
|
|
95
|
+
import {
|
|
96
|
+
blockListAt,
|
|
97
|
+
blockListPath,
|
|
98
|
+
blockPathIndex,
|
|
99
|
+
formatBlockPath,
|
|
100
|
+
isFieldVisible,
|
|
101
|
+
isHiddenBlock,
|
|
102
|
+
sameBlockPath
|
|
103
|
+
} from "#nuxt-cms";
|
|
104
|
+
import {
|
|
105
|
+
Button as KButton,
|
|
106
|
+
DropdownMenu as KDropdownMenu,
|
|
107
|
+
Icon as KIcon,
|
|
108
|
+
Tree as KTree,
|
|
109
|
+
VisuallyHidden as KVisuallyHidden
|
|
110
|
+
} from "@xleddyl/443-components-vue";
|
|
111
|
+
import { computed, nextTick, ref, watch } from "#imports";
|
|
112
|
+
import {
|
|
113
|
+
blockSummary,
|
|
114
|
+
blockTreeVisits,
|
|
115
|
+
canMoveBlock,
|
|
116
|
+
stableBlockTreeIds
|
|
117
|
+
} from "../../../shared/preview";
|
|
118
|
+
import { useCmsRuntime } from "../../composables/cms-runtime";
|
|
119
|
+
import { cmsIcon } from "../../utils/ui";
|
|
120
|
+
const props = defineProps({
|
|
121
|
+
items: { type: Array, required: true },
|
|
122
|
+
field: { type: Object, required: true },
|
|
123
|
+
fieldKey: { type: String, required: true },
|
|
124
|
+
locale: { type: String, required: true },
|
|
125
|
+
selected: { type: [Array, null], required: true },
|
|
126
|
+
highlighted: { type: [Array, null], required: true },
|
|
127
|
+
errors: { type: Set, required: true },
|
|
128
|
+
canAdd: { type: Function, required: true },
|
|
129
|
+
label: { type: String, required: true },
|
|
130
|
+
menu: { type: Function, required: true },
|
|
131
|
+
readonly: { type: Boolean, required: false }
|
|
132
|
+
});
|
|
133
|
+
const emit = defineEmits(["select", "move", "hover", "insert"]);
|
|
134
|
+
const { i18n } = useCmsRuntime();
|
|
135
|
+
const root = ref(null);
|
|
136
|
+
const rootFields = computed(() => ({ [props.fieldKey]: props.field }));
|
|
137
|
+
const rootValues = computed(() => ({ [props.fieldKey]: props.items }));
|
|
138
|
+
let counter = 0;
|
|
139
|
+
let snapshot = null;
|
|
140
|
+
const ids = computed(() => {
|
|
141
|
+
const result = stableBlockTreeIds(
|
|
142
|
+
blockTreeVisits(rootFields.value, rootValues.value),
|
|
143
|
+
snapshot,
|
|
144
|
+
() => ++counter
|
|
145
|
+
);
|
|
146
|
+
snapshot = result.snapshot;
|
|
147
|
+
return result.ids;
|
|
148
|
+
});
|
|
149
|
+
function idOf(path) {
|
|
150
|
+
const key = formatBlockPath(path);
|
|
151
|
+
return ids.value.get(key) ?? key;
|
|
152
|
+
}
|
|
153
|
+
function fieldRowId(owner, key) {
|
|
154
|
+
return `field:${idOf(owner)}:${key}`;
|
|
155
|
+
}
|
|
156
|
+
function listInvalid(list) {
|
|
157
|
+
const prefix = `${formatBlockPath(list)}.`;
|
|
158
|
+
for (const path of props.errors) if (path.startsWith(prefix)) return true;
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
const tree = computed(() => {
|
|
162
|
+
const rows = /* @__PURE__ */ new Map();
|
|
163
|
+
function addRow(list, owner, dimmed) {
|
|
164
|
+
if (props.readonly) return [];
|
|
165
|
+
const id = `add:${String(owner)}:${String(list.at(-1))}`;
|
|
166
|
+
rows.set(id, { kind: "add", list, hidden: false, dimmed });
|
|
167
|
+
return [{ id, label: "Add a block", icon: cmsIcon("plus") }];
|
|
168
|
+
}
|
|
169
|
+
function listNodes(list, field, value, owner, dimmed) {
|
|
170
|
+
const items = Array.isArray(value) ? value : [];
|
|
171
|
+
if (!items.length) return addRow(list, owner, dimmed);
|
|
172
|
+
return items.map((item, index) => blockNode([...list, index], field, item, dimmed));
|
|
173
|
+
}
|
|
174
|
+
function blockNode(path, field, item, parentDimmed) {
|
|
175
|
+
const block = field.blocks?.[String(item.type)];
|
|
176
|
+
const id = idOf(path);
|
|
177
|
+
const hidden = isHiddenBlock(item);
|
|
178
|
+
const dimmed = parentDimmed || hidden;
|
|
179
|
+
const nested = Object.entries(block?.fields ?? {}).filter(
|
|
180
|
+
([, subfield]) => subfield.type === "blocks" && isFieldVisible(subfield, item, block.fields)
|
|
181
|
+
);
|
|
182
|
+
const single = nested.length === 1 ? [...path, nested[0][0]] : null;
|
|
183
|
+
rows.set(id, { kind: "block", path, hidden, dimmed, list: single });
|
|
184
|
+
let children;
|
|
185
|
+
if (single) children = listNodes(single, nested[0][1], item[nested[0][0]], id, dimmed);
|
|
186
|
+
else if (nested.length)
|
|
187
|
+
children = nested.map(([key, subfield]) => {
|
|
188
|
+
const list = [...path, key];
|
|
189
|
+
const fieldId = fieldRowId(path, key);
|
|
190
|
+
rows.set(fieldId, { kind: "field", owner: path, list, hidden: false, dimmed });
|
|
191
|
+
return {
|
|
192
|
+
id: fieldId,
|
|
193
|
+
label: subfield.label,
|
|
194
|
+
icon: cmsIcon("queue-list"),
|
|
195
|
+
invalid: listInvalid(list),
|
|
196
|
+
muted: dimmed,
|
|
197
|
+
children: listNodes(list, subfield, item[key], fieldId, dimmed)
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
return {
|
|
201
|
+
id,
|
|
202
|
+
label: block?.label ?? String(item.type),
|
|
203
|
+
description: blockSummary(block, item, props.locale, i18n.defaultLocale, 60) || void 0,
|
|
204
|
+
icon: cmsIcon(block?.icon ?? "rectangle-stack"),
|
|
205
|
+
invalid: props.errors.has(formatBlockPath(path)),
|
|
206
|
+
muted: dimmed,
|
|
207
|
+
children
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const nodes2 = props.items.map(
|
|
211
|
+
(item, index) => blockNode([props.fieldKey, index], props.field, item, false)
|
|
212
|
+
);
|
|
213
|
+
return { nodes: nodes2, rows };
|
|
214
|
+
});
|
|
215
|
+
const nodes = computed(() => tree.value.nodes);
|
|
216
|
+
function rowOf(node) {
|
|
217
|
+
return tree.value.rows.get(node.id);
|
|
218
|
+
}
|
|
219
|
+
function blockRow(node) {
|
|
220
|
+
const row = rowOf(node);
|
|
221
|
+
return row?.kind === "block" ? row : null;
|
|
222
|
+
}
|
|
223
|
+
function fieldRow(node) {
|
|
224
|
+
const row = rowOf(node);
|
|
225
|
+
return row?.kind === "field" ? row : null;
|
|
226
|
+
}
|
|
227
|
+
const selectedId = computed(() => props.selected ? idOf(props.selected) : null);
|
|
228
|
+
const highlightedId = computed(() => props.highlighted ? idOf(props.highlighted) : null);
|
|
229
|
+
const expanded = ref([]);
|
|
230
|
+
const seen = /* @__PURE__ */ new Set();
|
|
231
|
+
watch(
|
|
232
|
+
nodes,
|
|
233
|
+
(list) => {
|
|
234
|
+
const fresh = [];
|
|
235
|
+
const walk = (items) => {
|
|
236
|
+
for (const node of items) {
|
|
237
|
+
if (!node.children?.length) continue;
|
|
238
|
+
if (!seen.has(node.id)) {
|
|
239
|
+
seen.add(node.id);
|
|
240
|
+
fresh.push(node.id);
|
|
241
|
+
}
|
|
242
|
+
walk(node.children);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
walk(list);
|
|
246
|
+
if (fresh.length) expanded.value = [...expanded.value, ...fresh];
|
|
247
|
+
},
|
|
248
|
+
{ immediate: true }
|
|
249
|
+
);
|
|
250
|
+
function ancestorIds(path) {
|
|
251
|
+
const found = [];
|
|
252
|
+
for (let end = 2; end < path.length; end += 2) {
|
|
253
|
+
const owner = path.slice(0, end);
|
|
254
|
+
found.push(idOf(owner));
|
|
255
|
+
const row = tree.value.rows.get(idOf(owner));
|
|
256
|
+
if (row?.kind === "block" && !row.list) found.push(fieldRowId(owner, String(path[end])));
|
|
257
|
+
}
|
|
258
|
+
return found;
|
|
259
|
+
}
|
|
260
|
+
function destination(move) {
|
|
261
|
+
const source = rowOf(move.node);
|
|
262
|
+
if (source?.kind !== "block") return null;
|
|
263
|
+
const parent = move.to.parent === null ? null : tree.value.rows.get(move.to.parent);
|
|
264
|
+
let list = null;
|
|
265
|
+
if (move.to.parent === null) list = [props.fieldKey];
|
|
266
|
+
else if (parent?.kind === "field") list = parent.list;
|
|
267
|
+
else if (parent?.kind === "block") list = parent.list;
|
|
268
|
+
if (!list) return null;
|
|
269
|
+
const length = blockListAt(rootValues.value, list)?.length ?? 0;
|
|
270
|
+
const sameList = sameBlockPath(blockListPath(source.path), list);
|
|
271
|
+
const index = Math.max(Math.min(move.to.index, sameList ? length - 1 : length), 0);
|
|
272
|
+
const insertion = sameList && index >= blockPathIndex(source.path) ? index + 1 : index;
|
|
273
|
+
return { from: source.path, list, index: insertion };
|
|
274
|
+
}
|
|
275
|
+
function canDrop(move) {
|
|
276
|
+
if (props.readonly) return false;
|
|
277
|
+
const target = destination(move);
|
|
278
|
+
return !!target && canMoveBlock(rootFields.value, rootValues.value, target.from, target.list);
|
|
279
|
+
}
|
|
280
|
+
function onMove(move) {
|
|
281
|
+
const target = destination(move);
|
|
282
|
+
if (!target || !canDrop(move)) return;
|
|
283
|
+
emit("move", target.from, target.list, target.index);
|
|
284
|
+
}
|
|
285
|
+
function focusedRow() {
|
|
286
|
+
const active = document.activeElement;
|
|
287
|
+
return active instanceof HTMLElement && root.value?.contains(active) ? active : root.value;
|
|
288
|
+
}
|
|
289
|
+
function onSelect(node) {
|
|
290
|
+
const row = rowOf(node);
|
|
291
|
+
if (row?.kind === "block") emit("select", row.path);
|
|
292
|
+
else if (row?.kind === "field") emit("select", row.owner);
|
|
293
|
+
else if (row?.kind === "add" && props.canAdd(row.list))
|
|
294
|
+
emit("insert", row.list, blockListAt(rootValues.value, row.list)?.length ?? 0, focusedRow());
|
|
295
|
+
}
|
|
296
|
+
function insertAfter(path, event) {
|
|
297
|
+
emit("insert", blockListPath(path), blockPathIndex(path) + 1, event.currentTarget);
|
|
298
|
+
}
|
|
299
|
+
function appendTo(list, event) {
|
|
300
|
+
emit(
|
|
301
|
+
"insert",
|
|
302
|
+
list,
|
|
303
|
+
blockListAt(rootValues.value, list)?.length ?? 0,
|
|
304
|
+
event.currentTarget
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function onHover(node) {
|
|
308
|
+
const row = node ? rowOf(node) : void 0;
|
|
309
|
+
emit("hover", row?.kind === "block" ? row.path : row?.kind === "field" ? row.owner : null);
|
|
310
|
+
}
|
|
311
|
+
watch(
|
|
312
|
+
() => props.selected ? formatBlockPath(props.selected) : null,
|
|
313
|
+
async () => {
|
|
314
|
+
const path = props.selected;
|
|
315
|
+
if (!path) return;
|
|
316
|
+
const missing = ancestorIds(path).filter((id) => !expanded.value.includes(id));
|
|
317
|
+
if (missing.length) expanded.value = [...expanded.value, ...missing];
|
|
318
|
+
await nextTick();
|
|
319
|
+
root.value?.querySelector('[role="treeitem"][aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
</script>
|
|
@@ -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;
|