@xleddyl/nuxt-cms 0.4.3 → 0.5.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.json +1 -1
- package/dist/module.mjs +22 -7
- package/dist/runtime/app/components/cms/BlockOutline.vue +56 -67
- package/dist/runtime/app/components/cms/BlockPalette.vue +3 -1
- package/dist/runtime/app/components/cms/BlocksField.vue +155 -149
- package/dist/runtime/app/components/cms/BrandMark.d.vue.ts +3 -1
- package/dist/runtime/app/components/cms/BrandMark.vue +24 -25
- package/dist/runtime/app/components/cms/BrandMark.vue.d.ts +3 -1
- package/dist/runtime/app/components/cms/{Checkbox.d.vue.ts → ConfirmGroups.d.vue.ts} +4 -4
- package/dist/runtime/app/components/cms/ConfirmGroups.vue +22 -0
- package/dist/runtime/app/components/cms/{Checkbox.vue.d.ts → ConfirmGroups.vue.d.ts} +4 -4
- package/dist/runtime/app/components/cms/EntryDrawer.d.vue.ts +2 -2
- package/dist/runtime/app/components/cms/EntryDrawer.vue +62 -47
- package/dist/runtime/app/components/cms/EntryDrawer.vue.d.ts +2 -2
- package/dist/runtime/app/components/cms/EntryForm.vue +100 -95
- package/dist/runtime/app/components/cms/FieldInput.vue +56 -32
- package/dist/runtime/app/components/cms/ImportModal.d.vue.ts +2 -2
- package/dist/runtime/app/components/cms/ImportModal.vue +80 -79
- package/dist/runtime/app/components/cms/ImportModal.vue.d.ts +2 -2
- package/dist/runtime/app/components/cms/JsonField.vue +17 -8
- package/dist/runtime/app/components/cms/ListFilters.vue +54 -63
- package/dist/runtime/app/components/cms/LocaleSwitch.vue +21 -18
- package/dist/runtime/app/components/cms/MediaDetail.vue +110 -72
- package/dist/runtime/app/components/cms/MediaField.vue +37 -29
- package/dist/runtime/app/components/cms/MediaFolderPicker.d.vue.ts +1 -0
- package/dist/runtime/app/components/cms/MediaFolderPicker.vue +77 -49
- package/dist/runtime/app/components/cms/MediaFolderPicker.vue.d.ts +1 -0
- package/dist/runtime/app/components/cms/MediaGallery.vue +300 -323
- package/dist/runtime/app/components/cms/MediaThumb.vue +7 -2
- package/dist/runtime/app/components/cms/MediaUpload.vue +37 -70
- package/dist/runtime/app/components/cms/RelationField.vue +23 -71
- package/dist/runtime/app/components/cms/RichTextField.vue +23 -177
- package/dist/runtime/app/components/cms/SettingsAccount.vue +96 -104
- package/dist/runtime/app/components/cms/SettingsColumns.vue +7 -6
- package/dist/runtime/app/components/cms/SettingsEntry.d.vue.ts +10 -1
- package/dist/runtime/app/components/cms/SettingsEntry.vue +35 -52
- package/dist/runtime/app/components/cms/SettingsEntry.vue.d.ts +10 -1
- package/dist/runtime/app/components/cms/SettingsLayout.vue +7 -4
- package/dist/runtime/app/components/cms/SettingsModal.d.vue.ts +0 -4
- package/dist/runtime/app/components/cms/SettingsModal.vue +102 -151
- package/dist/runtime/app/components/cms/SettingsModal.vue.d.ts +0 -4
- package/dist/runtime/app/components/cms/SettingsUsers.d.vue.ts +8 -1
- package/dist/runtime/app/components/cms/SettingsUsers.vue +182 -189
- package/dist/runtime/app/components/cms/SettingsUsers.vue.d.ts +8 -1
- package/dist/runtime/app/components/cms/SlugField.vue +9 -6
- package/dist/runtime/app/components/cms/StatusBadge.vue +7 -6
- package/dist/runtime/app/components/cms/TranslatableField.vue +11 -6
- package/dist/runtime/app/components/cms/VisualEditor.vue +243 -282
- package/dist/runtime/app/components/cms/WelcomeModal.vue +49 -41
- package/dist/runtime/app/composables/cms-confirm.d.ts +0 -6
- package/dist/runtime/app/composables/cms-confirm.js +13 -13
- package/dist/runtime/app/composables/cms-media-uploader.d.ts +4 -0
- package/dist/runtime/app/composables/cms-media-uploader.js +12 -40
- package/dist/runtime/app/composables/cms-theme.d.ts +3 -9
- package/dist/runtime/app/composables/cms-theme.js +1 -19
- package/dist/runtime/app/composables/cms-toast.d.ts +3 -4
- package/dist/runtime/app/composables/cms-toast.js +6 -13
- package/dist/runtime/app/layouts/cms-admin.d.vue.ts +2 -2
- package/dist/runtime/app/layouts/cms-admin.vue +184 -113
- package/dist/runtime/app/layouts/cms-admin.vue.d.ts +2 -2
- package/dist/runtime/app/layouts/cms-editor.d.vue.ts +2 -2
- package/dist/runtime/app/layouts/cms-editor.vue +9 -4
- package/dist/runtime/app/layouts/cms-editor.vue.d.ts +2 -2
- package/dist/runtime/app/pages/admin-collection.vue +178 -143
- package/dist/runtime/app/pages/admin-content.vue +35 -30
- package/dist/runtime/app/pages/admin-entry.vue +14 -9
- package/dist/runtime/app/pages/admin-login.vue +57 -54
- package/dist/runtime/app/pages/admin-media.vue +6 -4
- package/dist/runtime/app/pages/admin-preview.vue +3 -2
- package/dist/runtime/app/preview/PreviewOverlay.vue +9 -7
- package/dist/runtime/app/utils/ui.d.ts +1 -3
- package/dist/runtime/app/utils/ui.js +4 -2
- package/dist/runtime/assets/editor.css +1 -0
- package/dist/runtime/assets/main.css +1 -1
- package/dist/runtime/assets/media.css +1 -0
- package/dist/runtime/assets/shell.css +1 -0
- package/package.json +9 -8
- package/dist/runtime/app/components/cms/Alert.d.vue.ts +0 -17
- package/dist/runtime/app/components/cms/Alert.vue +0 -13
- package/dist/runtime/app/components/cms/Alert.vue.d.ts +0 -17
- package/dist/runtime/app/components/cms/Button.d.vue.ts +0 -26
- package/dist/runtime/app/components/cms/Button.vue +0 -48
- package/dist/runtime/app/components/cms/Button.vue.d.ts +0 -26
- package/dist/runtime/app/components/cms/Checkbox.vue +0 -21
- package/dist/runtime/app/components/cms/ConfirmModal.d.vue.ts +0 -3
- package/dist/runtime/app/components/cms/ConfirmModal.vue +0 -46
- package/dist/runtime/app/components/cms/ConfirmModal.vue.d.ts +0 -3
- package/dist/runtime/app/components/cms/Drawer.d.vue.ts +0 -30
- package/dist/runtime/app/components/cms/Drawer.vue +0 -61
- package/dist/runtime/app/components/cms/Drawer.vue.d.ts +0 -30
- package/dist/runtime/app/components/cms/DropdownMenu.d.vue.ts +0 -26
- package/dist/runtime/app/components/cms/DropdownMenu.vue +0 -48
- package/dist/runtime/app/components/cms/DropdownMenu.vue.d.ts +0 -26
- package/dist/runtime/app/components/cms/EmptyState.d.vue.ts +0 -19
- package/dist/runtime/app/components/cms/EmptyState.vue +0 -21
- package/dist/runtime/app/components/cms/EmptyState.vue.d.ts +0 -19
- package/dist/runtime/app/components/cms/Form.d.vue.ts +0 -37
- package/dist/runtime/app/components/cms/Form.vue +0 -63
- package/dist/runtime/app/components/cms/Form.vue.d.ts +0 -37
- package/dist/runtime/app/components/cms/FormField.d.vue.ts +0 -22
- package/dist/runtime/app/components/cms/FormField.vue +0 -35
- package/dist/runtime/app/components/cms/FormField.vue.d.ts +0 -22
- package/dist/runtime/app/components/cms/Icon.d.vue.ts +0 -6
- package/dist/runtime/app/components/cms/Icon.vue +0 -23
- package/dist/runtime/app/components/cms/Icon.vue.d.ts +0 -6
- package/dist/runtime/app/components/cms/Input.d.vue.ts +0 -27
- package/dist/runtime/app/components/cms/Input.vue +0 -46
- package/dist/runtime/app/components/cms/Input.vue.d.ts +0 -27
- package/dist/runtime/app/components/cms/Modal.d.vue.ts +0 -31
- package/dist/runtime/app/components/cms/Modal.vue +0 -49
- package/dist/runtime/app/components/cms/Modal.vue.d.ts +0 -31
- package/dist/runtime/app/components/cms/PageHeader.d.vue.ts +0 -25
- package/dist/runtime/app/components/cms/PageHeader.vue +0 -36
- package/dist/runtime/app/components/cms/PageHeader.vue.d.ts +0 -25
- package/dist/runtime/app/components/cms/Pagination.d.vue.ts +0 -15
- package/dist/runtime/app/components/cms/Pagination.vue +0 -51
- package/dist/runtime/app/components/cms/Pagination.vue.d.ts +0 -15
- package/dist/runtime/app/components/cms/PasswordInput.d.vue.ts +0 -17
- package/dist/runtime/app/components/cms/PasswordInput.vue +0 -81
- package/dist/runtime/app/components/cms/PasswordInput.vue.d.ts +0 -17
- package/dist/runtime/app/components/cms/Popover.d.vue.ts +0 -22
- package/dist/runtime/app/components/cms/Popover.vue +0 -27
- package/dist/runtime/app/components/cms/Popover.vue.d.ts +0 -22
- package/dist/runtime/app/components/cms/Search.d.vue.ts +0 -7
- package/dist/runtime/app/components/cms/Search.vue +0 -347
- package/dist/runtime/app/components/cms/Search.vue.d.ts +0 -7
- package/dist/runtime/app/components/cms/SelectMenu.d.vue.ts +0 -25
- package/dist/runtime/app/components/cms/SelectMenu.vue +0 -152
- package/dist/runtime/app/components/cms/SelectMenu.vue.d.ts +0 -25
- package/dist/runtime/app/components/cms/Spinner.d.vue.ts +0 -3
- package/dist/runtime/app/components/cms/Spinner.vue +0 -5
- package/dist/runtime/app/components/cms/Spinner.vue.d.ts +0 -3
- package/dist/runtime/app/components/cms/Switch.d.vue.ts +0 -10
- package/dist/runtime/app/components/cms/Switch.vue +0 -14
- package/dist/runtime/app/components/cms/Switch.vue.d.ts +0 -10
- package/dist/runtime/app/components/cms/Table.d.vue.ts +0 -51
- package/dist/runtime/app/components/cms/Table.vue +0 -115
- package/dist/runtime/app/components/cms/Table.vue.d.ts +0 -51
- package/dist/runtime/app/components/cms/Textarea.d.vue.ts +0 -15
- package/dist/runtime/app/components/cms/Textarea.vue +0 -16
- package/dist/runtime/app/components/cms/Textarea.vue.d.ts +0 -15
- package/dist/runtime/app/components/cms/Toaster.d.vue.ts +0 -3
- package/dist/runtime/app/components/cms/Toaster.vue +0 -48
- package/dist/runtime/app/components/cms/Toaster.vue.d.ts +0 -3
- package/dist/runtime/app/composables/cms-overlay.d.ts +0 -4
- package/dist/runtime/app/composables/cms-overlay.js +0 -23
- package/dist/runtime/assets/svg/academic-cap.svg +0 -3
- package/dist/runtime/assets/svg/adjustments-horizontal.svg +0 -3
- package/dist/runtime/assets/svg/adjustments-vertical.svg +0 -3
- package/dist/runtime/assets/svg/archive-box-arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/archive-box-x-mark.svg +0 -3
- package/dist/runtime/assets/svg/archive-box.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down-circle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down-on-square-stack.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down-on-square.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down-tray.svg +0 -3
- package/dist/runtime/assets/svg/arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-left-circle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-left-end-on-rectangle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-left-on-rectangle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-left-start-on-rectangle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-long-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-long-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-long-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-long-up.svg +0 -3
- package/dist/runtime/assets/svg/arrow-path-rounded-square.svg +0 -3
- package/dist/runtime/assets/svg/arrow-path.svg +0 -3
- package/dist/runtime/assets/svg/arrow-right-circle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-right-end-on-rectangle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-right-on-rectangle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-right-start-on-rectangle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-small-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-small-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-small-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-small-up.svg +0 -3
- package/dist/runtime/assets/svg/arrow-top-right-on-square.svg +0 -3
- package/dist/runtime/assets/svg/arrow-trending-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-trending-up.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-down-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-down-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-left-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-left-up.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-right-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-right-up.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-up-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-turn-up-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up-circle.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up-on-square-stack.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up-on-square.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up-tray.svg +0 -3
- package/dist/runtime/assets/svg/arrow-up.svg +0 -3
- package/dist/runtime/assets/svg/arrow-uturn-down.svg +0 -3
- package/dist/runtime/assets/svg/arrow-uturn-left.svg +0 -3
- package/dist/runtime/assets/svg/arrow-uturn-right.svg +0 -3
- package/dist/runtime/assets/svg/arrow-uturn-up.svg +0 -3
- package/dist/runtime/assets/svg/arrows-pointing-in.svg +0 -3
- package/dist/runtime/assets/svg/arrows-pointing-out.svg +0 -3
- package/dist/runtime/assets/svg/arrows-right-left.svg +0 -3
- package/dist/runtime/assets/svg/arrows-up-down.svg +0 -3
- package/dist/runtime/assets/svg/at-symbol.svg +0 -3
- package/dist/runtime/assets/svg/backspace.svg +0 -3
- package/dist/runtime/assets/svg/backward.svg +0 -3
- package/dist/runtime/assets/svg/banknotes.svg +0 -3
- package/dist/runtime/assets/svg/bars-2.svg +0 -3
- package/dist/runtime/assets/svg/bars-3-bottom-left.svg +0 -3
- package/dist/runtime/assets/svg/bars-3-bottom-right.svg +0 -3
- package/dist/runtime/assets/svg/bars-3-center-left.svg +0 -3
- package/dist/runtime/assets/svg/bars-3.svg +0 -3
- package/dist/runtime/assets/svg/bars-4.svg +0 -3
- package/dist/runtime/assets/svg/bars-arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/bars-arrow-up.svg +0 -3
- package/dist/runtime/assets/svg/battery-0.svg +0 -3
- package/dist/runtime/assets/svg/battery-100.svg +0 -3
- package/dist/runtime/assets/svg/battery-50.svg +0 -3
- package/dist/runtime/assets/svg/beaker.svg +0 -3
- package/dist/runtime/assets/svg/bell-alert.svg +0 -3
- package/dist/runtime/assets/svg/bell-slash.svg +0 -3
- package/dist/runtime/assets/svg/bell-snooze.svg +0 -3
- package/dist/runtime/assets/svg/bell.svg +0 -3
- package/dist/runtime/assets/svg/bold.svg +0 -3
- package/dist/runtime/assets/svg/bolt-slash.svg +0 -3
- package/dist/runtime/assets/svg/bolt.svg +0 -3
- package/dist/runtime/assets/svg/book-open.svg +0 -3
- package/dist/runtime/assets/svg/bookmark-slash.svg +0 -3
- package/dist/runtime/assets/svg/bookmark-square.svg +0 -3
- package/dist/runtime/assets/svg/bookmark.svg +0 -3
- package/dist/runtime/assets/svg/briefcase.svg +0 -3
- package/dist/runtime/assets/svg/bug-ant.svg +0 -3
- package/dist/runtime/assets/svg/building-library.svg +0 -3
- package/dist/runtime/assets/svg/building-office-2.svg +0 -3
- package/dist/runtime/assets/svg/building-office.svg +0 -3
- package/dist/runtime/assets/svg/building-storefront.svg +0 -3
- package/dist/runtime/assets/svg/cake.svg +0 -3
- package/dist/runtime/assets/svg/calculator.svg +0 -3
- package/dist/runtime/assets/svg/calendar-date-range.svg +0 -3
- package/dist/runtime/assets/svg/calendar-days.svg +0 -3
- package/dist/runtime/assets/svg/calendar.svg +0 -3
- package/dist/runtime/assets/svg/camera.svg +0 -4
- package/dist/runtime/assets/svg/chart-bar-square.svg +0 -3
- package/dist/runtime/assets/svg/chart-bar.svg +0 -3
- package/dist/runtime/assets/svg/chart-pie.svg +0 -4
- package/dist/runtime/assets/svg/chat-bubble-bottom-center-text.svg +0 -3
- package/dist/runtime/assets/svg/chat-bubble-bottom-center.svg +0 -3
- package/dist/runtime/assets/svg/chat-bubble-left-ellipsis.svg +0 -3
- package/dist/runtime/assets/svg/chat-bubble-left-right.svg +0 -3
- package/dist/runtime/assets/svg/chat-bubble-left.svg +0 -3
- package/dist/runtime/assets/svg/chat-bubble-oval-left-ellipsis.svg +0 -3
- package/dist/runtime/assets/svg/chat-bubble-oval-left.svg +0 -3
- package/dist/runtime/assets/svg/check-badge.svg +0 -3
- package/dist/runtime/assets/svg/check-circle.svg +0 -3
- package/dist/runtime/assets/svg/check.svg +0 -3
- package/dist/runtime/assets/svg/chevron-double-down.svg +0 -3
- package/dist/runtime/assets/svg/chevron-double-left.svg +0 -3
- package/dist/runtime/assets/svg/chevron-double-right.svg +0 -3
- package/dist/runtime/assets/svg/chevron-double-up.svg +0 -4
- package/dist/runtime/assets/svg/chevron-down.svg +0 -3
- package/dist/runtime/assets/svg/chevron-left.svg +0 -3
- package/dist/runtime/assets/svg/chevron-right.svg +0 -3
- package/dist/runtime/assets/svg/chevron-up-down.svg +0 -3
- package/dist/runtime/assets/svg/chevron-up.svg +0 -3
- package/dist/runtime/assets/svg/circle-stack.svg +0 -3
- package/dist/runtime/assets/svg/clipboard-document-check.svg +0 -3
- package/dist/runtime/assets/svg/clipboard-document-list.svg +0 -3
- package/dist/runtime/assets/svg/clipboard-document.svg +0 -3
- package/dist/runtime/assets/svg/clipboard.svg +0 -3
- package/dist/runtime/assets/svg/clock.svg +0 -3
- package/dist/runtime/assets/svg/cloud-arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/cloud-arrow-up.svg +0 -3
- package/dist/runtime/assets/svg/cloud.svg +0 -3
- package/dist/runtime/assets/svg/code-bracket-square.svg +0 -3
- package/dist/runtime/assets/svg/code-bracket.svg +0 -3
- package/dist/runtime/assets/svg/cog-6-tooth.svg +0 -4
- package/dist/runtime/assets/svg/cog-8-tooth.svg +0 -4
- package/dist/runtime/assets/svg/cog.svg +0 -3
- package/dist/runtime/assets/svg/command-line.svg +0 -3
- package/dist/runtime/assets/svg/computer-desktop.svg +0 -3
- package/dist/runtime/assets/svg/cpu-chip.svg +0 -3
- package/dist/runtime/assets/svg/credit-card.svg +0 -3
- package/dist/runtime/assets/svg/cube-transparent.svg +0 -3
- package/dist/runtime/assets/svg/cube.svg +0 -3
- package/dist/runtime/assets/svg/currency-bangladeshi.svg +0 -3
- package/dist/runtime/assets/svg/currency-dollar.svg +0 -3
- package/dist/runtime/assets/svg/currency-euro.svg +0 -3
- package/dist/runtime/assets/svg/currency-pound.svg +0 -3
- package/dist/runtime/assets/svg/currency-rupee.svg +0 -3
- package/dist/runtime/assets/svg/currency-yen.svg +0 -3
- package/dist/runtime/assets/svg/cursor-arrow-rays.svg +0 -3
- package/dist/runtime/assets/svg/cursor-arrow-ripple.svg +0 -3
- package/dist/runtime/assets/svg/device-phone-mobile.svg +0 -3
- package/dist/runtime/assets/svg/device-tablet.svg +0 -3
- package/dist/runtime/assets/svg/divide.svg +0 -3
- package/dist/runtime/assets/svg/document-arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/document-arrow-up.svg +0 -3
- package/dist/runtime/assets/svg/document-chart-bar.svg +0 -3
- package/dist/runtime/assets/svg/document-check.svg +0 -3
- package/dist/runtime/assets/svg/document-currency-bangladeshi.svg +0 -3
- package/dist/runtime/assets/svg/document-currency-dollar.svg +0 -3
- package/dist/runtime/assets/svg/document-currency-euro.svg +0 -3
- package/dist/runtime/assets/svg/document-currency-pound.svg +0 -3
- package/dist/runtime/assets/svg/document-currency-rupee.svg +0 -3
- package/dist/runtime/assets/svg/document-currency-yen.svg +0 -3
- package/dist/runtime/assets/svg/document-duplicate.svg +0 -3
- package/dist/runtime/assets/svg/document-magnifying-glass.svg +0 -3
- package/dist/runtime/assets/svg/document-minus.svg +0 -3
- package/dist/runtime/assets/svg/document-plus.svg +0 -3
- package/dist/runtime/assets/svg/document-text.svg +0 -3
- package/dist/runtime/assets/svg/document.svg +0 -3
- package/dist/runtime/assets/svg/ellipsis-horizontal-circle.svg +0 -3
- package/dist/runtime/assets/svg/ellipsis-horizontal.svg +0 -3
- package/dist/runtime/assets/svg/ellipsis-vertical.svg +0 -3
- package/dist/runtime/assets/svg/envelope-open.svg +0 -3
- package/dist/runtime/assets/svg/envelope.svg +0 -3
- package/dist/runtime/assets/svg/equals.svg +0 -3
- package/dist/runtime/assets/svg/exclamation-circle.svg +0 -3
- package/dist/runtime/assets/svg/exclamation-triangle.svg +0 -3
- package/dist/runtime/assets/svg/eye-dropper.svg +0 -3
- package/dist/runtime/assets/svg/eye-slash.svg +0 -3
- package/dist/runtime/assets/svg/eye.svg +0 -4
- package/dist/runtime/assets/svg/face-frown.svg +0 -3
- package/dist/runtime/assets/svg/face-smile.svg +0 -3
- package/dist/runtime/assets/svg/film.svg +0 -3
- package/dist/runtime/assets/svg/finger-print.svg +0 -3
- package/dist/runtime/assets/svg/fire.svg +0 -4
- package/dist/runtime/assets/svg/flag.svg +0 -3
- package/dist/runtime/assets/svg/folder-arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/folder-minus.svg +0 -3
- package/dist/runtime/assets/svg/folder-open.svg +0 -3
- package/dist/runtime/assets/svg/folder-plus.svg +0 -3
- package/dist/runtime/assets/svg/folder.svg +0 -3
- package/dist/runtime/assets/svg/forward.svg +0 -3
- package/dist/runtime/assets/svg/funnel.svg +0 -3
- package/dist/runtime/assets/svg/gif.svg +0 -3
- package/dist/runtime/assets/svg/gift-top.svg +0 -3
- package/dist/runtime/assets/svg/gift.svg +0 -3
- package/dist/runtime/assets/svg/globe-alt.svg +0 -3
- package/dist/runtime/assets/svg/globe-americas.svg +0 -3
- package/dist/runtime/assets/svg/globe-asia-australia.svg +0 -3
- package/dist/runtime/assets/svg/globe-europe-africa.svg +0 -3
- package/dist/runtime/assets/svg/h1.svg +0 -3
- package/dist/runtime/assets/svg/h2.svg +0 -3
- package/dist/runtime/assets/svg/h3.svg +0 -3
- package/dist/runtime/assets/svg/hand-raised.svg +0 -3
- package/dist/runtime/assets/svg/hand-thumb-down.svg +0 -3
- package/dist/runtime/assets/svg/hand-thumb-up.svg +0 -3
- package/dist/runtime/assets/svg/hashtag.svg +0 -3
- package/dist/runtime/assets/svg/heart.svg +0 -3
- package/dist/runtime/assets/svg/home-modern.svg +0 -3
- package/dist/runtime/assets/svg/home.svg +0 -3
- package/dist/runtime/assets/svg/identification.svg +0 -3
- package/dist/runtime/assets/svg/inbox-arrow-down.svg +0 -3
- package/dist/runtime/assets/svg/inbox-stack.svg +0 -3
- package/dist/runtime/assets/svg/inbox.svg +0 -3
- package/dist/runtime/assets/svg/information-circle.svg +0 -3
- package/dist/runtime/assets/svg/italic.svg +0 -3
- package/dist/runtime/assets/svg/key.svg +0 -3
- package/dist/runtime/assets/svg/language.svg +0 -3
- package/dist/runtime/assets/svg/lifebuoy.svg +0 -3
- package/dist/runtime/assets/svg/light-bulb.svg +0 -3
- package/dist/runtime/assets/svg/link-slash.svg +0 -3
- package/dist/runtime/assets/svg/link.svg +0 -3
- package/dist/runtime/assets/svg/list-bullet.svg +0 -3
- package/dist/runtime/assets/svg/lock-closed.svg +0 -3
- package/dist/runtime/assets/svg/lock-open.svg +0 -3
- package/dist/runtime/assets/svg/magnifying-glass-circle.svg +0 -3
- package/dist/runtime/assets/svg/magnifying-glass-minus.svg +0 -3
- package/dist/runtime/assets/svg/magnifying-glass-plus.svg +0 -3
- package/dist/runtime/assets/svg/magnifying-glass.svg +0 -3
- package/dist/runtime/assets/svg/map-pin.svg +0 -4
- package/dist/runtime/assets/svg/map.svg +0 -3
- package/dist/runtime/assets/svg/megaphone.svg +0 -3
- package/dist/runtime/assets/svg/microphone.svg +0 -3
- package/dist/runtime/assets/svg/minus-circle.svg +0 -3
- package/dist/runtime/assets/svg/minus-small.svg +0 -3
- package/dist/runtime/assets/svg/minus.svg +0 -3
- package/dist/runtime/assets/svg/moon.svg +0 -3
- package/dist/runtime/assets/svg/musical-note.svg +0 -3
- package/dist/runtime/assets/svg/newspaper.svg +0 -3
- package/dist/runtime/assets/svg/no-symbol.svg +0 -3
- package/dist/runtime/assets/svg/numbered-list.svg +0 -3
- package/dist/runtime/assets/svg/paint-brush.svg +0 -3
- package/dist/runtime/assets/svg/paper-airplane.svg +0 -3
- package/dist/runtime/assets/svg/paper-clip.svg +0 -3
- package/dist/runtime/assets/svg/pause-circle.svg +0 -3
- package/dist/runtime/assets/svg/pause.svg +0 -3
- package/dist/runtime/assets/svg/pencil-square.svg +0 -3
- package/dist/runtime/assets/svg/pencil.svg +0 -3
- package/dist/runtime/assets/svg/percent-badge.svg +0 -3
- package/dist/runtime/assets/svg/phone-arrow-down-left.svg +0 -3
- package/dist/runtime/assets/svg/phone-arrow-up-right.svg +0 -3
- package/dist/runtime/assets/svg/phone-x-mark.svg +0 -3
- package/dist/runtime/assets/svg/phone.svg +0 -3
- package/dist/runtime/assets/svg/photo.svg +0 -3
- package/dist/runtime/assets/svg/play-circle.svg +0 -4
- package/dist/runtime/assets/svg/play-pause.svg +0 -3
- package/dist/runtime/assets/svg/play.svg +0 -3
- package/dist/runtime/assets/svg/plus-circle.svg +0 -3
- package/dist/runtime/assets/svg/plus-small.svg +0 -3
- package/dist/runtime/assets/svg/plus.svg +0 -3
- package/dist/runtime/assets/svg/power.svg +0 -3
- package/dist/runtime/assets/svg/presentation-chart-bar.svg +0 -3
- package/dist/runtime/assets/svg/presentation-chart-line.svg +0 -3
- package/dist/runtime/assets/svg/printer.svg +0 -3
- package/dist/runtime/assets/svg/puzzle-piece.svg +0 -3
- package/dist/runtime/assets/svg/qr-code.svg +0 -4
- package/dist/runtime/assets/svg/question-mark-circle.svg +0 -3
- package/dist/runtime/assets/svg/queue-list.svg +0 -3
- package/dist/runtime/assets/svg/radio.svg +0 -3
- package/dist/runtime/assets/svg/receipt-percent.svg +0 -3
- package/dist/runtime/assets/svg/receipt-refund.svg +0 -3
- package/dist/runtime/assets/svg/rectangle-group.svg +0 -3
- package/dist/runtime/assets/svg/rectangle-stack.svg +0 -3
- package/dist/runtime/assets/svg/rocket-launch.svg +0 -3
- package/dist/runtime/assets/svg/rss.svg +0 -3
- package/dist/runtime/assets/svg/scale.svg +0 -3
- package/dist/runtime/assets/svg/scissors.svg +0 -3
- package/dist/runtime/assets/svg/server-stack.svg +0 -3
- package/dist/runtime/assets/svg/server.svg +0 -3
- package/dist/runtime/assets/svg/share.svg +0 -3
- package/dist/runtime/assets/svg/shield-check.svg +0 -3
- package/dist/runtime/assets/svg/shield-exclamation.svg +0 -3
- package/dist/runtime/assets/svg/shopping-bag.svg +0 -3
- package/dist/runtime/assets/svg/shopping-cart.svg +0 -3
- package/dist/runtime/assets/svg/signal-slash.svg +0 -3
- package/dist/runtime/assets/svg/signal.svg +0 -3
- package/dist/runtime/assets/svg/slash.svg +0 -3
- package/dist/runtime/assets/svg/sparkles.svg +0 -3
- package/dist/runtime/assets/svg/speaker-wave.svg +0 -3
- package/dist/runtime/assets/svg/speaker-x-mark.svg +0 -3
- package/dist/runtime/assets/svg/square-2-stack.svg +0 -3
- package/dist/runtime/assets/svg/square-3-stack-3d.svg +0 -3
- package/dist/runtime/assets/svg/squares-2x2.svg +0 -3
- package/dist/runtime/assets/svg/squares-plus.svg +0 -3
- package/dist/runtime/assets/svg/star.svg +0 -3
- package/dist/runtime/assets/svg/stop-circle.svg +0 -4
- package/dist/runtime/assets/svg/stop.svg +0 -3
- package/dist/runtime/assets/svg/strikethrough.svg +0 -3
- package/dist/runtime/assets/svg/sun.svg +0 -3
- package/dist/runtime/assets/svg/swatch.svg +0 -3
- package/dist/runtime/assets/svg/table-cells.svg +0 -3
- package/dist/runtime/assets/svg/tag.svg +0 -4
- package/dist/runtime/assets/svg/ticket.svg +0 -3
- package/dist/runtime/assets/svg/trash.svg +0 -3
- package/dist/runtime/assets/svg/trophy.svg +0 -3
- package/dist/runtime/assets/svg/truck.svg +0 -3
- package/dist/runtime/assets/svg/tv.svg +0 -3
- package/dist/runtime/assets/svg/underline.svg +0 -3
- package/dist/runtime/assets/svg/user-circle.svg +0 -3
- package/dist/runtime/assets/svg/user-group.svg +0 -3
- package/dist/runtime/assets/svg/user-minus.svg +0 -3
- package/dist/runtime/assets/svg/user-plus.svg +0 -3
- package/dist/runtime/assets/svg/user.svg +0 -3
- package/dist/runtime/assets/svg/users.svg +0 -3
- package/dist/runtime/assets/svg/variable.svg +0 -3
- package/dist/runtime/assets/svg/video-camera-slash.svg +0 -3
- package/dist/runtime/assets/svg/video-camera.svg +0 -3
- package/dist/runtime/assets/svg/view-columns.svg +0 -3
- package/dist/runtime/assets/svg/viewfinder-circle.svg +0 -3
- package/dist/runtime/assets/svg/wallet.svg +0 -3
- package/dist/runtime/assets/svg/wifi.svg +0 -3
- package/dist/runtime/assets/svg/window.svg +0 -3
- package/dist/runtime/assets/svg/wrench-screwdriver.svg +0 -3
- package/dist/runtime/assets/svg/wrench.svg +0 -4
- package/dist/runtime/assets/svg/x-circle.svg +0 -3
- package/dist/runtime/assets/svg/x-mark.svg +0 -3
|
@@ -14,21 +14,13 @@
|
|
|
14
14
|
v-model="locale"
|
|
15
15
|
:value="localeFilled"
|
|
16
16
|
/>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:aria-pressed="device === option.id"
|
|
25
|
-
:aria-label="option.label"
|
|
26
|
-
:title="option.label"
|
|
27
|
-
@click="device = option.id"
|
|
28
|
-
>
|
|
29
|
-
<CmsIcon :name="option.icon" class="size-4" />
|
|
30
|
-
</button>
|
|
31
|
-
</div>
|
|
17
|
+
<KSegmentedControl
|
|
18
|
+
v-model="device"
|
|
19
|
+
:options="deviceOptions"
|
|
20
|
+
size="sm"
|
|
21
|
+
icon-only
|
|
22
|
+
aria-label="Preview width"
|
|
23
|
+
/>
|
|
32
24
|
</div>
|
|
33
25
|
<div class="cms-editor-bar-end">
|
|
34
26
|
<slot name="actions" />
|
|
@@ -49,211 +41,183 @@
|
|
|
49
41
|
</div>
|
|
50
42
|
|
|
51
43
|
<aside class="cms-editor-panel" aria-label="Inspector">
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
:id="`cms-editor-tab-${tab.id}`"
|
|
57
|
-
:key="tab.id"
|
|
58
|
-
type="button"
|
|
59
|
-
role="tab"
|
|
60
|
-
class="cms-tab"
|
|
61
|
-
:class="{ 'is-active': tab.id === activeTab }"
|
|
62
|
-
:aria-selected="tab.id === activeTab"
|
|
63
|
-
:aria-controls="`cms-editor-tabpanel-${tab.id}`"
|
|
64
|
-
@click="activeTab = tab.id"
|
|
65
|
-
>
|
|
66
|
-
{{ tab.label }}
|
|
67
|
-
<span
|
|
68
|
-
v-if="tabHasError(tab.id)"
|
|
69
|
-
class="cms-editor-tab-dot"
|
|
70
|
-
aria-label="has errors"
|
|
71
|
-
/>
|
|
72
|
-
</button>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div
|
|
77
|
-
:id="`cms-editor-tabpanel-${activeTab}`"
|
|
78
|
-
ref="panel"
|
|
79
|
-
class="cms-editor-panel-body"
|
|
80
|
-
role="tabpanel"
|
|
81
|
-
:aria-labelledby="tabList.length > 1 ? `cms-editor-tab-${activeTab}` : void 0"
|
|
44
|
+
<component
|
|
45
|
+
:is="tabbed ? KTabs : 'div'"
|
|
46
|
+
v-bind="tabsBinding"
|
|
47
|
+
class="cms-editor-inspector"
|
|
82
48
|
>
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
:field="blockField"
|
|
179
|
-
:locale="locale"
|
|
180
|
-
@update:model-value="
|
|
49
|
+
<template #[panelSlot]>
|
|
50
|
+
<KForm ref="panel" as="div" :form="form" class="cms-editor-panel-body">
|
|
51
|
+
<template v-if="activeTab === 'block'">
|
|
52
|
+
<template v-if="selectedItem && selected !== null">
|
|
53
|
+
<div class="cms-editor-block-head">
|
|
54
|
+
<KButton
|
|
55
|
+
icon="arrow-left"
|
|
56
|
+
size="sm"
|
|
57
|
+
variant="ghost"
|
|
58
|
+
tone="neutral"
|
|
59
|
+
label="All blocks"
|
|
60
|
+
@click="select(null)"
|
|
61
|
+
/>
|
|
62
|
+
<span class="cms-editor-block-position k-mono">
|
|
63
|
+
{{ selected + 1 }} / {{ blocks.length }}
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="cms-editor-block-title">
|
|
67
|
+
<KIcon :name="cmsIcon(selectedBlock?.icon ?? 'rectangle-stack')" />
|
|
68
|
+
<span>{{ selectedBlock?.label ?? selectedItem.type }}</span>
|
|
69
|
+
<KBadge v-if="isHiddenBlock(selectedItem)" size="sm" label="Hidden" />
|
|
70
|
+
</div>
|
|
71
|
+
<KStack direction="row" gap="sm" wrap class="cms-editor-block-actions">
|
|
72
|
+
<KButton
|
|
73
|
+
icon="arrow-up"
|
|
74
|
+
size="sm"
|
|
75
|
+
variant="soft"
|
|
76
|
+
tone="neutral"
|
|
77
|
+
aria-label="Move up"
|
|
78
|
+
title="Move up"
|
|
79
|
+
:disabled="selected === 0"
|
|
80
|
+
@click="moveSelected(-1)"
|
|
81
|
+
/>
|
|
82
|
+
<KButton
|
|
83
|
+
icon="arrow-down"
|
|
84
|
+
size="sm"
|
|
85
|
+
variant="soft"
|
|
86
|
+
tone="neutral"
|
|
87
|
+
aria-label="Move down"
|
|
88
|
+
title="Move down"
|
|
89
|
+
:disabled="selected === blocks.length - 1"
|
|
90
|
+
@click="moveSelected(1)"
|
|
91
|
+
/>
|
|
92
|
+
<KButton
|
|
93
|
+
:icon="cmsIcon('document-duplicate')"
|
|
94
|
+
size="sm"
|
|
95
|
+
variant="soft"
|
|
96
|
+
tone="neutral"
|
|
97
|
+
label="Duplicate"
|
|
98
|
+
:disabled="!canAdd"
|
|
99
|
+
@click="duplicate(selected)"
|
|
100
|
+
/>
|
|
101
|
+
<KButton
|
|
102
|
+
v-if="canHideBlock(selectedBlock)"
|
|
103
|
+
:icon="cmsIcon(isHiddenBlock(selectedItem) ? 'eye' : 'eye-slash')"
|
|
104
|
+
size="sm"
|
|
105
|
+
variant="soft"
|
|
106
|
+
tone="neutral"
|
|
107
|
+
:label="isHiddenBlock(selectedItem) ? 'Show' : 'Hide'"
|
|
108
|
+
@click="toggleHidden(selected)"
|
|
109
|
+
/>
|
|
110
|
+
<KButton
|
|
111
|
+
icon="trash"
|
|
112
|
+
size="sm"
|
|
113
|
+
variant="soft"
|
|
114
|
+
tone="danger"
|
|
115
|
+
aria-label="Delete block"
|
|
116
|
+
title="Delete"
|
|
117
|
+
@click="remove(selected)"
|
|
118
|
+
/>
|
|
119
|
+
</KStack>
|
|
120
|
+
<KFieldMessage
|
|
121
|
+
v-if="form.errors[`${fieldKey}.${selected}`]"
|
|
122
|
+
:message="form.errors[`${fieldKey}.${selected}`]"
|
|
123
|
+
/>
|
|
124
|
+
<KFieldMessage
|
|
125
|
+
v-else
|
|
126
|
+
tone="warning"
|
|
127
|
+
:message="form.warnings[`${fieldKey}.${selected}`]"
|
|
128
|
+
/>
|
|
129
|
+
<KStack gap="md" class="cms-editor-fields">
|
|
130
|
+
<KFormField
|
|
131
|
+
v-for="(blockField, blockKey) in selectedBlock?.fields ?? {}"
|
|
132
|
+
:key="`${selected}-${blockKey}`"
|
|
133
|
+
:name="`${fieldKey}.${selected}.${blockKey}`"
|
|
134
|
+
:label="blockField.label"
|
|
135
|
+
:description="blockField.description"
|
|
136
|
+
:icon="cmsIcon(fieldIcon(blockField))"
|
|
137
|
+
:required="blockField.required"
|
|
138
|
+
>
|
|
139
|
+
<CmsFieldInput
|
|
140
|
+
:model-value="selectedItem[blockKey]"
|
|
141
|
+
:field="blockField"
|
|
142
|
+
:locale="locale"
|
|
143
|
+
@update:model-value="
|
|
181
144
|
(value) => updateBlockField(String(blockKey), value)
|
|
182
145
|
"
|
|
146
|
+
/>
|
|
147
|
+
</KFormField>
|
|
148
|
+
</KStack>
|
|
149
|
+
</template>
|
|
150
|
+
|
|
151
|
+
<template v-else>
|
|
152
|
+
<KFieldMessage
|
|
153
|
+
v-if="form.errors[fieldKey]"
|
|
154
|
+
:message="form.errors[fieldKey]"
|
|
155
|
+
/>
|
|
156
|
+
<KFieldMessage
|
|
157
|
+
v-else
|
|
158
|
+
tone="warning"
|
|
159
|
+
:message="form.warnings[fieldKey]"
|
|
183
160
|
/>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
161
|
+
<KStack v-if="blocks.length" gap="sm">
|
|
162
|
+
<span class="k-label">{{ blocksField.label }}</span>
|
|
163
|
+
<CmsBlockOutline
|
|
164
|
+
:items="blocks"
|
|
165
|
+
:field="blocksField"
|
|
166
|
+
:locale="locale"
|
|
167
|
+
:selected="selected"
|
|
168
|
+
@select="select"
|
|
169
|
+
@move="move"
|
|
170
|
+
/>
|
|
171
|
+
</KStack>
|
|
172
|
+
<KStack v-if="canAdd" gap="sm">
|
|
173
|
+
<span class="k-label">Add a block</span>
|
|
174
|
+
<CmsBlockPalette
|
|
175
|
+
:blocks="blocksField.blocks ?? {}"
|
|
176
|
+
@pick="(type) => insert(blocks.length, type)"
|
|
177
|
+
/>
|
|
178
|
+
</KStack>
|
|
179
|
+
<p v-else class="cms-field-hint">{{ maxReached }}</p>
|
|
180
|
+
</template>
|
|
181
|
+
</template>
|
|
187
182
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
183
|
+
<KStack v-else gap="md" class="cms-editor-fields">
|
|
184
|
+
<template v-for="section in sections" :key="section.id">
|
|
185
|
+
<div v-if="section.title" class="cms-editor-section-title">
|
|
186
|
+
<span class="k-label">{{ section.title }}</span>
|
|
187
|
+
<span v-if="section.description" class="cms-field-hint">
|
|
188
|
+
{{ section.description }}
|
|
189
|
+
</span>
|
|
190
|
+
</div>
|
|
191
|
+
<KFormField
|
|
192
|
+
v-for="key in section.keys"
|
|
193
|
+
:key="key"
|
|
194
|
+
:name="key"
|
|
195
|
+
:label="fields[key].label"
|
|
196
|
+
:description="fields[key].description"
|
|
197
|
+
:icon="cmsIcon(fieldIcon(fields[key]))"
|
|
198
|
+
:required="fields[key].required"
|
|
199
|
+
:data-cms-field="key"
|
|
200
|
+
:class="{ 'cms-search-focus': highlighted === key }"
|
|
201
|
+
>
|
|
202
|
+
<CmsFieldInput
|
|
203
|
+
:model-value="state[key]"
|
|
204
|
+
:field="fields[key]"
|
|
205
|
+
:locale="locale"
|
|
206
|
+
:slug-source="slugSource(fields[key])"
|
|
207
|
+
@update:model-value="(value) => setValue(key, value)"
|
|
208
|
+
/>
|
|
209
|
+
</KFormField>
|
|
210
|
+
</template>
|
|
211
|
+
</KStack>
|
|
212
|
+
</KForm>
|
|
217
213
|
</template>
|
|
218
|
-
|
|
219
|
-
<div v-else class="cms-editor-fields">
|
|
220
|
-
<template v-for="section in sections" :key="section.id">
|
|
221
|
-
<div v-if="section.title" class="cms-editor-section-title">
|
|
222
|
-
<span class="cms-label">{{ section.title }}</span>
|
|
223
|
-
<span v-if="section.description" class="cms-form-description">
|
|
224
|
-
{{ section.description }}
|
|
225
|
-
</span>
|
|
226
|
-
</div>
|
|
227
|
-
<CmsFormField
|
|
228
|
-
v-for="key in section.keys"
|
|
229
|
-
:key="key"
|
|
230
|
-
:label="fields[key].label"
|
|
231
|
-
:description="fields[key].description"
|
|
232
|
-
:icon="fieldIcon(fields[key])"
|
|
233
|
-
:name="key"
|
|
234
|
-
:required="fields[key].required"
|
|
235
|
-
:data-cms-field="key"
|
|
236
|
-
:class="{ 'is-search-focus': highlighted === key }"
|
|
237
|
-
>
|
|
238
|
-
<CmsFieldInput
|
|
239
|
-
:model-value="state[key]"
|
|
240
|
-
:field="fields[key]"
|
|
241
|
-
:locale="locale"
|
|
242
|
-
:slug-source="slugSource(fields[key])"
|
|
243
|
-
@update:model-value="(value) => setValue(key, value)"
|
|
244
|
-
/>
|
|
245
|
-
</CmsFormField>
|
|
246
|
-
</template>
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
214
|
+
</component>
|
|
249
215
|
</aside>
|
|
250
216
|
</div>
|
|
251
217
|
|
|
252
|
-
<
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
</template>
|
|
256
|
-
</CmsModal>
|
|
218
|
+
<KModal v-model:open="paletteOpen" title="Insert a block">
|
|
219
|
+
<CmsBlockPalette :blocks="blocksField.blocks ?? {}" @pick="insertFromPalette" />
|
|
220
|
+
</KModal>
|
|
257
221
|
</div>
|
|
258
222
|
</template>
|
|
259
223
|
|
|
@@ -266,15 +230,19 @@ import {
|
|
|
266
230
|
slugSourceValue
|
|
267
231
|
} from "#nuxt-cms";
|
|
268
232
|
import {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
233
|
+
Badge as KBadge,
|
|
234
|
+
Button as KButton,
|
|
235
|
+
FieldMessage as KFieldMessage,
|
|
236
|
+
Form as KForm,
|
|
237
|
+
FormField as KFormField,
|
|
238
|
+
Icon as KIcon,
|
|
239
|
+
Modal as KModal,
|
|
240
|
+
SegmentedControl as KSegmentedControl,
|
|
241
|
+
Stack as KStack,
|
|
242
|
+
Tabs as KTabs,
|
|
243
|
+
useForm
|
|
244
|
+
} from "@xleddyl/443-components-vue";
|
|
245
|
+
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watch } from "#imports";
|
|
278
246
|
import cmsConfig from "#cms-config";
|
|
279
247
|
import { buildEntrySchema, entryValidationWarnings } from "../../../shared/validation";
|
|
280
248
|
import {
|
|
@@ -298,12 +266,11 @@ import { useCmsConfirm } from "../../composables/cms-confirm";
|
|
|
298
266
|
import { useCmsFieldFocus } from "../../composables/cms-field-focus";
|
|
299
267
|
import { useCmsRuntime } from "../../composables/cms-runtime";
|
|
300
268
|
import { entryFormLayout, useCmsSettingsState } from "../../composables/cms-settings";
|
|
301
|
-
import {
|
|
302
|
-
const ROOT_KEY = "";
|
|
269
|
+
import { cmsIcon, fieldIcon } from "../../utils/ui";
|
|
303
270
|
const SEO_KEYS = ["seoTitle", "seoDescription", "seoImage"];
|
|
304
|
-
const
|
|
305
|
-
{
|
|
306
|
-
{
|
|
271
|
+
const deviceOptions = [
|
|
272
|
+
{ value: "desktop", label: "Desktop width", icon: cmsIcon("computer-desktop") },
|
|
273
|
+
{ value: "mobile", label: "Mobile width", icon: cmsIcon("device-phone-mobile") }
|
|
307
274
|
];
|
|
308
275
|
const props = defineProps({
|
|
309
276
|
entryName: { type: String, required: true },
|
|
@@ -352,6 +319,29 @@ const tabList = computed(() => {
|
|
|
352
319
|
return tabs;
|
|
353
320
|
});
|
|
354
321
|
const activeTab = ref(props.content ? "content" : "block");
|
|
322
|
+
const tabbed = computed(() => tabList.value.length > 1);
|
|
323
|
+
const panelSlot = computed(() => tabbed.value ? "panel" : "default");
|
|
324
|
+
const tabsBinding = computed(
|
|
325
|
+
() => tabbed.value ? {
|
|
326
|
+
items: tabList.value.map((tab) => {
|
|
327
|
+
const errorCount = tabErrorCount(tab.id);
|
|
328
|
+
return {
|
|
329
|
+
value: tab.id,
|
|
330
|
+
label: tab.label,
|
|
331
|
+
badge: errorCount || void 0,
|
|
332
|
+
badgeTone: "danger",
|
|
333
|
+
badgeLabel: errorCount ? `${errorCount} ${errorCount === 1 ? "error" : "errors"}` : void 0
|
|
334
|
+
};
|
|
335
|
+
}),
|
|
336
|
+
modelValue: activeTab.value,
|
|
337
|
+
panelFocusable: false,
|
|
338
|
+
stretch: true,
|
|
339
|
+
inset: true,
|
|
340
|
+
"onUpdate:modelValue": (value) => {
|
|
341
|
+
activeTab.value = String(value ?? "");
|
|
342
|
+
}
|
|
343
|
+
} : {}
|
|
344
|
+
);
|
|
355
345
|
const seoKeys = computed(() => SEO_KEYS.filter((key) => Object.hasOwn(props.fields, key)));
|
|
356
346
|
const contentFields = computed(
|
|
357
347
|
() => Object.fromEntries(
|
|
@@ -515,7 +505,7 @@ function applyFocus(focus) {
|
|
|
515
505
|
return;
|
|
516
506
|
}
|
|
517
507
|
activeTab.value = tabOfKey(key);
|
|
518
|
-
reveal(() => panel.value, key);
|
|
508
|
+
reveal(() => panel.value?.el, key);
|
|
519
509
|
}
|
|
520
510
|
onMounted(() => {
|
|
521
511
|
window.addEventListener("message", onMessage);
|
|
@@ -525,8 +515,6 @@ onMounted(() => {
|
|
|
525
515
|
onBeforeUnmount(() => {
|
|
526
516
|
window.removeEventListener("message", onMessage);
|
|
527
517
|
});
|
|
528
|
-
const errors = reactive({});
|
|
529
|
-
provide(CMS_FORM_ERRORS, errors);
|
|
530
518
|
const validateHook = computed(
|
|
531
519
|
() => props.content ? cmsConfig[props.entryName]?.validate : void 0
|
|
532
520
|
);
|
|
@@ -536,10 +524,8 @@ const schema = computed(
|
|
|
536
524
|
i18n
|
|
537
525
|
)
|
|
538
526
|
);
|
|
539
|
-
|
|
540
|
-
function issueKeys(path) {
|
|
527
|
+
function issueKey(path) {
|
|
541
528
|
const [key, index, blockKey] = path;
|
|
542
|
-
if (key === void 0) return [ROOT_KEY];
|
|
543
529
|
const keys = [String(key)];
|
|
544
530
|
if (String(key) === props.fieldKey && typeof index === "number")
|
|
545
531
|
keys.push(
|
|
@@ -547,71 +533,46 @@ function issueKeys(path) {
|
|
|
547
533
|
);
|
|
548
534
|
return keys;
|
|
549
535
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
for (const issue of issues) {
|
|
556
|
-
for (const key of issueKeys(issue.path)) errors[key] ??= issue.message;
|
|
557
|
-
}
|
|
558
|
-
return issues;
|
|
559
|
-
}
|
|
560
|
-
const warningList = computed(
|
|
561
|
-
() => entryValidationWarnings(
|
|
562
|
-
{ fields: props.fields, validate: validateHook.value },
|
|
563
|
-
state.value,
|
|
564
|
-
i18n
|
|
565
|
-
)
|
|
566
|
-
);
|
|
567
|
-
const warnings = computed(() => {
|
|
568
|
-
const grouped = {};
|
|
569
|
-
for (const issue of warningList.value) {
|
|
570
|
-
for (const key of issueKeys(issue.path)) {
|
|
571
|
-
if (key !== ROOT_KEY) grouped[key] ??= issue.message;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
return grouped;
|
|
536
|
+
const form = useForm({
|
|
537
|
+
values: state,
|
|
538
|
+
validator: schema,
|
|
539
|
+
warnings: (values) => entryValidationWarnings({ fields: props.fields, validate: validateHook.value }, values, i18n),
|
|
540
|
+
issueKey
|
|
575
541
|
});
|
|
576
|
-
provide(CMS_FORM_WARNINGS, warnings);
|
|
577
|
-
const rootWarnings = computed(() => [
|
|
578
|
-
...new Set(
|
|
579
|
-
warningList.value.filter((issue) => !issue.path.length).map((issue) => issue.message)
|
|
580
|
-
)
|
|
581
|
-
]);
|
|
582
542
|
function tabOfKey(key) {
|
|
583
543
|
if (key === props.fieldKey) return "block";
|
|
584
544
|
return SEO_KEYS.includes(key) ? "seo" : "content";
|
|
585
545
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
588
|
-
(key) => key
|
|
546
|
+
function tabErrorCount(tab) {
|
|
547
|
+
const keys = new Set(
|
|
548
|
+
Object.keys(form.errors).filter((key) => form.errors[key]).map((key) => key.split(".")[0]).filter((key) => tabOfKey(key) === tab)
|
|
549
|
+
);
|
|
550
|
+
return keys.size;
|
|
551
|
+
}
|
|
552
|
+
function firstError() {
|
|
553
|
+
const keys = Object.keys(form.errors).filter((key) => form.errors[key]);
|
|
554
|
+
const name = Object.keys(props.fields).find(
|
|
555
|
+
(field) => keys.some((key) => key === field || key.startsWith(`${field}.`))
|
|
589
556
|
);
|
|
557
|
+
if (!name) return void 0;
|
|
558
|
+
const indexes = keys.filter((key) => key.startsWith(`${name}.`)).map((key) => Number(key.split(".")[1])).filter(Number.isInteger);
|
|
559
|
+
return { name, index: indexes.length ? Math.min(...indexes) : null };
|
|
590
560
|
}
|
|
591
561
|
function validate() {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const first =
|
|
595
|
-
if (!first) return
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
if (name === props.fieldKey) {
|
|
600
|
-
select(typeof index === "number" ? index : null);
|
|
562
|
+
form.submitCount.value++;
|
|
563
|
+
if (form.validateSync()) return true;
|
|
564
|
+
const first = firstError();
|
|
565
|
+
if (!first) return false;
|
|
566
|
+
const field = props.fields[first.name];
|
|
567
|
+
if (first.name === props.fieldKey) {
|
|
568
|
+
select(first.index);
|
|
601
569
|
activeTab.value = "block";
|
|
602
570
|
} else if (field) {
|
|
603
|
-
activeTab.value = tabOfKey(name);
|
|
571
|
+
activeTab.value = tabOfKey(first.name);
|
|
604
572
|
if (isTranslatableField(field)) locale.value = i18n.defaultLocale;
|
|
605
573
|
}
|
|
606
574
|
return false;
|
|
607
575
|
}
|
|
608
|
-
watch(
|
|
609
|
-
state,
|
|
610
|
-
() => {
|
|
611
|
-
if (submitted) collectErrors();
|
|
612
|
-
},
|
|
613
|
-
{ deep: true }
|
|
614
|
-
);
|
|
615
576
|
watch(
|
|
616
577
|
() => blocks.value.length,
|
|
617
578
|
(length) => {
|