@wordpress/edit-site 5.32.0 → 5.33.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/CHANGELOG.md +2 -0
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +282 -13
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +22 -11
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/async/index.js +51 -0
- package/build/components/async/index.js.map +1 -0
- package/build/components/block-editor/block-inspector-button.js +10 -9
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +15 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +5 -1
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +35 -8
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/background-panel.js +13 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +6 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +60 -32
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +11 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +1 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +10 -9
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +1 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -3
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +2 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +1 -1
- package/build/components/global-styles/screen-background.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +1 -1
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +1 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +4 -4
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -12
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -18
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/animation.js +3 -2
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +13 -48
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +73 -7
- package/build/components/layout/router.js.map +1 -1
- package/build/components/media/index.js.map +1 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +5 -2
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +15 -17
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +5 -4
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -2
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +124 -17
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +2 -1
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +5 -10
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/page-templates-template-parts/add-new-template-part.js +2 -1
- package/build/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
- package/build/components/page-templates-template-parts/hooks.js.map +1 -1
- package/build/components/page-templates-template-parts/index.js +13 -25
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/pattern-modal/duplicate.js +6 -3
- package/build/components/pattern-modal/duplicate.js.map +1 -1
- package/build/components/pattern-modal/index.js.map +1 -1
- package/build/components/pattern-modal/rename.js +6 -3
- package/build/components/pattern-modal/rename.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
- package/build/components/rename-post-menu-item/index.js.map +1 -0
- package/build/components/resizable-frame/index.js +1 -5
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +3 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +41 -75
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +1 -1
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +1 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +29 -54
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +23 -2
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +31 -0
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +36 -9
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -15
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +22 -12
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +14 -5
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +33 -27
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +10 -7
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +22 -21
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -5
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-actions/index.js +7 -8
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +6 -3
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +10 -28
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/components.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +3 -40
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +3 -8
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +21 -96
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +1 -85
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/clone-deep.js.map +1 -1
- package/build/utils/constants.js +2 -1
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build/utils/math.js.map +1 -1
- package/build/utils/set-nested-value.js +44 -0
- package/build/utils/set-nested-value.js.map +1 -0
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-actual-current-theme.js.map +1 -1
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +283 -14
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +21 -11
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/async/index.js +44 -0
- package/build-module/components/async/index.js.map +1 -0
- package/build-module/components/block-editor/block-inspector-button.js +9 -8
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +16 -7
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +5 -1
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +35 -8
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +14 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +6 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +59 -32
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +12 -5
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +2 -2
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +11 -10
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +1 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +2 -2
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +1 -1
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +3 -3
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +8 -8
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -18
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/animation.js +4 -3
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +13 -48
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +73 -7
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +5 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +14 -16
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +5 -4
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -2
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +126 -19
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +3 -2
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +2 -6
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/page-templates-template-parts/add-new-template-part.js +3 -2
- package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +1 -1
- package/build-module/components/page-templates-template-parts/hooks.js.map +1 -1
- package/build-module/components/page-templates-template-parts/index.js +13 -25
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/pattern-modal/duplicate.js +4 -1
- package/build-module/components/pattern-modal/duplicate.js.map +1 -1
- package/build-module/components/pattern-modal/index.js.map +1 -1
- package/build-module/components/pattern-modal/rename.js +4 -1
- package/build-module/components/pattern-modal/rename.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
- package/build-module/components/rename-post-menu-item/index.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +1 -5
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +2 -2
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +42 -75
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +1 -1
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +28 -53
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +23 -2
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +31 -0
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +37 -10
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -3
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +24 -14
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +14 -5
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +34 -28
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +12 -8
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -8
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +22 -21
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -5
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/table/index.js.map +1 -1
- package/build-module/components/template-actions/index.js +7 -8
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +6 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/components.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +4 -6
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +16 -92
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +0 -83
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/clone-deep.js.map +1 -1
- package/build-module/utils/constants.js +1 -0
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/set-nested-value.js +38 -0
- package/build-module/utils/set-nested-value.js.map +1 -0
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-actual-current-theme.js.map +1 -1
- package/build-style/style-rtl.css +172 -585
- package/build-style/style.css +172 -585
- package/package.json +43 -44
- package/src/components/add-new-template/index.js +412 -12
- package/src/components/add-new-template/style.scss +0 -22
- package/src/components/add-new-template/utils.js +44 -24
- package/src/components/async/index.js +43 -0
- package/src/components/block-editor/block-inspector-button.js +9 -11
- package/src/components/block-editor/editor-canvas.js +45 -21
- package/src/components/block-editor/site-editor-canvas.js +6 -1
- package/src/components/editor/index.js +50 -13
- package/src/components/global-styles/background-panel.js +16 -0
- package/src/components/global-styles/block-preview-panel.js +6 -1
- package/src/components/global-styles/font-library-modal/context.js +76 -51
- package/src/components/global-styles/font-library-modal/font-collection.js +247 -223
- package/src/components/global-styles/font-library-modal/index.js +2 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +156 -147
- package/src/components/global-styles/font-library-modal/style.scss +31 -13
- package/src/components/global-styles/highlighted-colors.js +1 -1
- package/src/components/global-styles/hooks.js +20 -3
- package/src/components/global-styles/root-menu.js +2 -2
- package/src/components/global-styles/screen-background.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/header-edit-mode/index.js +3 -5
- package/src/components/header-edit-mode/more-menu/index.js +6 -17
- package/src/components/header-edit-mode/style.scss +1 -1
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -29
- package/src/components/keyboard-shortcuts/register.js +0 -20
- package/src/components/layout/animation.js +6 -3
- package/src/components/layout/index.js +12 -50
- package/src/components/layout/router.js +75 -12
- package/src/components/layout/style.scss +15 -37
- package/src/components/page/index.js +7 -2
- package/src/components/page-pages/index.js +33 -23
- package/src/components/page-pages/style.scss +29 -22
- package/src/components/page-patterns/dataviews-pattern-actions.js +5 -6
- package/src/components/page-patterns/header.js +4 -2
- package/src/components/page-patterns/index.js +168 -56
- package/src/components/page-patterns/search-items.js +3 -0
- package/src/components/page-patterns/style.scss +7 -6
- package/src/components/page-patterns/use-patterns.js +2 -6
- package/src/components/page-templates-template-parts/add-new-template-part.js +4 -2
- package/src/components/page-templates-template-parts/index.js +24 -39
- package/src/components/pattern-modal/duplicate.js +2 -1
- package/src/components/pattern-modal/rename.js +2 -1
- package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
- package/src/components/resizable-frame/index.js +2 -6
- package/src/components/save-panel/index.js +2 -2
- package/src/components/sidebar/index.js +52 -100
- package/src/components/sidebar/style.scss +41 -6
- package/src/components/sidebar-dataviews/default-views.js +1 -1
- package/src/components/sidebar-dataviews/index.js +1 -1
- package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
- package/src/components/sidebar-edit-mode/index.js +39 -75
- package/src/components/sidebar-edit-mode/page-panels/index.js +25 -2
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +20 -12
- package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -6
- package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/src/components/sidebar-edit-mode/style.scss +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/src/components/sidebar-navigation-item/index.js +29 -0
- package/src/components/sidebar-navigation-screen/index.js +29 -12
- package/src/components/sidebar-navigation-screen/style.scss +1 -21
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -11
- package/src/components/sidebar-navigation-screen-main/index.js +11 -23
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
- package/src/components/sidebar-navigation-screen-page/index.js +23 -13
- package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +9 -6
- package/src/components/sidebar-navigation-screen-patterns/index.js +70 -60
- package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-template/index.js +8 -12
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -7
- package/src/components/site-hub/index.js +80 -90
- package/src/components/site-hub/style.scss +14 -34
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +50 -35
- package/src/components/template-actions/index.js +8 -11
- package/src/components/welcome-guide/style.scss +1 -1
- package/src/components/welcome-guide/styles.js +6 -5
- package/src/hooks/commands/use-edit-mode-commands.js +12 -33
- package/src/hooks/push-changes-to-global-styles/index.js +1 -40
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
- package/src/index.js +9 -10
- package/src/store/actions.js +25 -141
- package/src/store/private-actions.js +0 -133
- package/src/store/test/actions.js +7 -2
- package/src/style.scss +0 -2
- package/src/utils/constants.js +1 -0
- package/src/utils/set-nested-value.js +39 -0
- package/build/components/add-new-template/new-template.js +0 -298
- package/build/components/add-new-template/new-template.js.map +0 -1
- package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
- package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -119
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/page-actions/index.js +0 -35
- package/build/components/page-actions/index.js.map +0 -1
- package/build/components/page-actions/trash-page-menu-item.js +0 -54
- package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
- package/build/components/page-templates-template-parts/actions.js +0 -207
- package/build/components/page-templates-template-parts/actions.js.map +0 -1
- package/build/components/preferences-modal/index.js +0 -38
- package/build/components/preferences-modal/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/constants.js +0 -9
- package/build/components/sidebar-edit-mode/constants.js.map +0 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
- package/build/components/template-actions/rename-menu-item.js.map +0 -1
- package/build-module/components/add-new-template/new-template.js +0 -290
- package/build-module/components/add-new-template/new-template.js.map +0 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
- package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -110
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/page-actions/index.js +0 -27
- package/build-module/components/page-actions/index.js.map +0 -1
- package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
- package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
- package/build-module/components/page-templates-template-parts/actions.js +0 -199
- package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
- package/build-module/components/preferences-modal/index.js +0 -30
- package/build-module/components/preferences-modal/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/constants.js +0 -3
- package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
- package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
- package/src/components/add-new-template/new-template.js +0 -429
- package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
- package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
- package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -151
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/page-actions/index.js +0 -30
- package/src/components/page-actions/trash-page-menu-item.js +0 -63
- package/src/components/page-templates-template-parts/actions.js +0 -277
- package/src/components/preferences-modal/index.js +0 -29
- package/src/components/sidebar-edit-mode/constants.js +0 -2
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","__","mergeBaseAndUserConfigs","cloneDeep","unlock","GlobalStylesContext","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","variations","title","settings","styles","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","map","variation","result","description"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif ( typeof object !== 'object' || ! Object.keys( object ).length ) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\tconst variations = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variationsFromTheme,\n\t\t];\n\t}, [ variationsFromTheme ] );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.map( ( variation ) => {\n\t\t\tlet result = {\n\t\t\t\t...filterObjectByProperty( cloneDeep( variation ), property ),\n\t\t\t\ttitle: variation?.title,\n\t\t\t\tdescription: variation?.description,\n\t\t\t};\n\n\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t/*\n\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t */\n\t\t\t\tresult = mergeBaseAndUserConfigs( clonedBaseVariation, result );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedStyleVariations;\n\t}, [ variations, property, baseVariation, filter ]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ChC,CAAC,EAAE,CAAEV,UAAU,EAAEb,QAAQ,EAAEY,aAAa,EAAEN,MAAM,CAAG,CAAC;AACrD"}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","__","mergeBaseAndUserConfigs","cloneDeep","unlock","GlobalStylesContext","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","variations","title","settings","styles","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","map","variation","result","description"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\tconst variations = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variationsFromTheme,\n\t\t];\n\t}, [ variationsFromTheme ] );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.map( ( variation ) => {\n\t\t\tlet result = {\n\t\t\t\t...filterObjectByProperty( cloneDeep( variation ), property ),\n\t\t\t\ttitle: variation?.title,\n\t\t\t\tdescription: variation?.description,\n\t\t\t};\n\n\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t/*\n\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t */\n\t\t\t\tresult = mergeBaseAndUserConfigs( clonedBaseVariation, result );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedSty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CAAEA,MAAO,CAAC;IAC3C;IAEA,OAAOiB,wBAAwB;EAChC,CAAC,EAAE,CAAEV,UAAU,EAAEb,QAAQ,EAAEY,aAAa,EAAEN,MAAM,CAAG,CAAC;AACrD","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -7,8 +7,7 @@ import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegister
|
|
|
7
7
|
import { dispatch } from '@wordpress/data';
|
|
8
8
|
import deprecated from '@wordpress/deprecated';
|
|
9
9
|
import { createRoot } from '@wordpress/element';
|
|
10
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
11
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
|
+
import { PluginMoreMenuItem, PluginSidebar, PluginSidebarMoreMenuItem, store as editorStore } from '@wordpress/editor';
|
|
12
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
12
|
import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
|
|
14
13
|
|
|
@@ -66,7 +65,6 @@ export function initializeEditor(id, settings) {
|
|
|
66
65
|
showBlockBreadcrumbs: true,
|
|
67
66
|
showListViewByDefault: false
|
|
68
67
|
});
|
|
69
|
-
dispatch(interfaceStore).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
|
|
70
68
|
dispatch(editSiteStore).updateSettings(settings);
|
|
71
69
|
|
|
72
70
|
// Keep the defaultTemplateTypes in the core/editor settings too,
|
|
@@ -90,9 +88,9 @@ export function reinitializeEditor() {
|
|
|
90
88
|
version: '6.3'
|
|
91
89
|
});
|
|
92
90
|
}
|
|
93
|
-
export {
|
|
94
|
-
export {
|
|
95
|
-
export {
|
|
91
|
+
export { PluginMoreMenuItem };
|
|
92
|
+
export { PluginSidebar };
|
|
93
|
+
export { PluginSidebarMoreMenuItem };
|
|
96
94
|
export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
|
|
97
95
|
export { store } from './store';
|
|
98
96
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","
|
|
1
|
+
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","PluginMoreMenuItem","PluginSidebar","PluginSidebarMoreMenuItem","editorStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","createElement","reinitializeEditor","since","version","default","PluginTemplateSettingPanel"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\tPluginMoreMenuItem,\n\tPluginSidebar,\n\tPluginSidebarMoreMenuItem,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { PluginMoreMenuItem };\nexport { PluginSidebar };\nexport { PluginSidebarMoreMenuItem };\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SACCC,kBAAkB,EAClBC,aAAa,EACbC,yBAAyB,EACzBV,KAAK,IAAIW,WAAW,QACd,mBAAmB;AAC1B,SAASX,KAAK,IAAIY,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASd,KAAK,IAAIe,aAAa,QAAQ,SAAS;AAChD,OAAOC,GAAG,MAAM,kBAAkB;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAGhB,UAAU,CAAEa,MAAO,CAAC;EAEjCf,QAAQ,CAAEJ,WAAY,CAAC,CAACuB,uBAAuB,CAAC,CAAC;EACjD,MAAMC,UAAU,GAA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C,QAAQ,CAACiC;EACpC,CAAE,CAAC;;EAEH;EACAC,MAAM,CAACC,gBAAgB,CAAE,UAAU,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEH,MAAM,CAACC,gBAAgB,CAAE,MAAM,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEjC,IAAI,CAACkC,MAAM,CAAEC,aAAA,CAAC1C,GAAG,MAAE,CAAE,CAAC;EAEtB,OAAOO,IAAI;AACZ;AAEA,OAAO,SAASoC,kBAAkBA,CAAA,EAAG;EACpCrD,UAAU,CAAE,gCAAgC,EAAE;IAC7CsD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASrD,kBAAkB;AAC3B,SAASC,aAAa;AACtB,SAASC,yBAAyB;AAClC,SAASoD,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAAS/D,KAAK,QAAQ,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,sBACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,sBACD,CAAC","ignoreList":[]}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import { parse, __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
4
|
+
import { parse } from '@wordpress/blocks';
|
|
6
5
|
import deprecated from '@wordpress/deprecated';
|
|
7
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
10
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
12
7
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
13
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
+
import { store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
14
9
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
10
|
|
|
16
11
|
/**
|
|
17
12
|
* Internal dependencies
|
|
18
13
|
*/
|
|
19
|
-
import { STORE_NAME as editSiteStoreName } from './constants';
|
|
20
|
-
import isTemplateRevertable from '../utils/is-template-revertable';
|
|
21
14
|
import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE } from '../utils/constants';
|
|
22
|
-
import {
|
|
15
|
+
import { unlock } from '../lock-unlock';
|
|
16
|
+
const {
|
|
17
|
+
interfaceStore
|
|
18
|
+
} = unlock(editorPrivateApis);
|
|
23
19
|
|
|
24
20
|
/**
|
|
25
21
|
* Dispatches an action that toggles a feature flag.
|
|
@@ -112,8 +108,10 @@ export const addTemplate = template => async ({
|
|
|
112
108
|
*
|
|
113
109
|
* @param {Object} template The template object.
|
|
114
110
|
*/
|
|
115
|
-
export const removeTemplate = template => {
|
|
116
|
-
|
|
111
|
+
export const removeTemplate = template => ({
|
|
112
|
+
registry
|
|
113
|
+
}) => {
|
|
114
|
+
return unlock(registry.dispatch(editorStore)).removeTemplates([template]);
|
|
117
115
|
};
|
|
118
116
|
|
|
119
117
|
/**
|
|
@@ -197,7 +195,7 @@ export function setEditedPostContext(context) {
|
|
|
197
195
|
*
|
|
198
196
|
* @deprecated
|
|
199
197
|
*
|
|
200
|
-
* @return {
|
|
198
|
+
* @return {Object} Action object.
|
|
201
199
|
*/
|
|
202
200
|
export function setPage() {
|
|
203
201
|
deprecated("dispatch( 'core/edit-site' ).setPage", {
|
|
@@ -326,86 +324,12 @@ export function setIsSaveViewOpened(isOpen) {
|
|
|
326
324
|
* @param {boolean} [options.allowUndo] Whether to allow the user to undo
|
|
327
325
|
* reverting the template. Default true.
|
|
328
326
|
*/
|
|
329
|
-
export const revertTemplate = (template, {
|
|
330
|
-
allowUndo = true
|
|
331
|
-
} = {}) => async ({
|
|
327
|
+
export const revertTemplate = (template, options) => ({
|
|
332
328
|
registry
|
|
333
329
|
}) => {
|
|
334
|
-
|
|
335
|
-
registry.dispatch(noticesStore).removeNotice(noticeId);
|
|
336
|
-
if (!isTemplateRevertable(template)) {
|
|
337
|
-
registry.dispatch(noticesStore).createErrorNotice(__('This template is not revertable.'), {
|
|
338
|
-
type: 'snackbar'
|
|
339
|
-
});
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
try {
|
|
343
|
-
const templateEntityConfig = registry.select(coreStore).getEntityConfig('postType', template.type);
|
|
344
|
-
if (!templateEntityConfig) {
|
|
345
|
-
registry.dispatch(noticesStore).createErrorNotice(__('The editor has encountered an unexpected error. Please reload.'), {
|
|
346
|
-
type: 'snackbar'
|
|
347
|
-
});
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const fileTemplatePath = addQueryArgs(`${templateEntityConfig.baseURL}/${template.id}`, {
|
|
351
|
-
context: 'edit',
|
|
352
|
-
source: 'theme'
|
|
353
|
-
});
|
|
354
|
-
const fileTemplate = await apiFetch({
|
|
355
|
-
path: fileTemplatePath
|
|
356
|
-
});
|
|
357
|
-
if (!fileTemplate) {
|
|
358
|
-
registry.dispatch(noticesStore).createErrorNotice(__('The editor has encountered an unexpected error. Please reload.'), {
|
|
359
|
-
type: 'snackbar'
|
|
360
|
-
});
|
|
361
|
-
return;
|
|
362
|
-
}
|
|
363
|
-
const serializeBlocks = ({
|
|
364
|
-
blocks: blocksForSerialization = []
|
|
365
|
-
}) => __unstableSerializeAndClean(blocksForSerialization);
|
|
366
|
-
const edited = registry.select(coreStore).getEditedEntityRecord('postType', template.type, template.id);
|
|
367
|
-
|
|
368
|
-
// We are fixing up the undo level here to make sure we can undo
|
|
369
|
-
// the revert in the header toolbar correctly.
|
|
370
|
-
registry.dispatch(coreStore).editEntityRecord('postType', template.type, template.id, {
|
|
371
|
-
content: serializeBlocks,
|
|
372
|
-
// Required to make the `undo` behave correctly.
|
|
373
|
-
blocks: edited.blocks,
|
|
374
|
-
// Required to revert the blocks in the editor.
|
|
375
|
-
source: 'custom' // required to avoid turning the editor into a dirty state
|
|
376
|
-
}, {
|
|
377
|
-
undoIgnore: true // Required to merge this edit with the last undo level.
|
|
378
|
-
});
|
|
379
|
-
const blocks = parse(fileTemplate?.content?.raw);
|
|
380
|
-
registry.dispatch(coreStore).editEntityRecord('postType', template.type, fileTemplate.id, {
|
|
381
|
-
content: serializeBlocks,
|
|
382
|
-
blocks,
|
|
383
|
-
source: 'theme'
|
|
384
|
-
});
|
|
385
|
-
if (allowUndo) {
|
|
386
|
-
const undoRevert = () => {
|
|
387
|
-
registry.dispatch(coreStore).editEntityRecord('postType', template.type, edited.id, {
|
|
388
|
-
content: serializeBlocks,
|
|
389
|
-
blocks: edited.blocks,
|
|
390
|
-
source: 'custom'
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
registry.dispatch(noticesStore).createSuccessNotice(__('Template reverted.'), {
|
|
394
|
-
type: 'snackbar',
|
|
395
|
-
id: noticeId,
|
|
396
|
-
actions: [{
|
|
397
|
-
label: __('Undo'),
|
|
398
|
-
onClick: undoRevert
|
|
399
|
-
}]
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
} catch (error) {
|
|
403
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('Template revert failed. Please reload.');
|
|
404
|
-
registry.dispatch(noticesStore).createErrorNotice(errorMessage, {
|
|
405
|
-
type: 'snackbar'
|
|
406
|
-
});
|
|
407
|
-
}
|
|
330
|
+
return unlock(registry.dispatch(editorStore)).revertTemplate(template, options);
|
|
408
331
|
};
|
|
332
|
+
|
|
409
333
|
/**
|
|
410
334
|
* Action that opens an editor sidebar.
|
|
411
335
|
*
|
|
@@ -414,7 +338,7 @@ export const revertTemplate = (template, {
|
|
|
414
338
|
export const openGeneralSidebar = name => ({
|
|
415
339
|
registry
|
|
416
340
|
}) => {
|
|
417
|
-
registry.dispatch(interfaceStore).enableComplementaryArea(
|
|
341
|
+
registry.dispatch(interfaceStore).enableComplementaryArea('core', name);
|
|
418
342
|
};
|
|
419
343
|
|
|
420
344
|
/**
|
|
@@ -423,7 +347,7 @@ export const openGeneralSidebar = name => ({
|
|
|
423
347
|
export const closeGeneralSidebar = () => ({
|
|
424
348
|
registry
|
|
425
349
|
}) => {
|
|
426
|
-
registry.dispatch(interfaceStore).disableComplementaryArea(
|
|
350
|
+
registry.dispatch(interfaceStore).disableComplementaryArea('core');
|
|
427
351
|
};
|
|
428
352
|
|
|
429
353
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","__","store","noticesStore","coreStore","interfaceStore","blockEditorStore","editorStore","preferencesStore","STORE_NAME","editSiteStoreName","isTemplateRevertable","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","removeTemplates","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","createErrorNotice","templateEntityConfig","select","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","path","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","createSuccessNotice","actions","label","onClick","error","errorMessage","message","code","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","setHasPageContentFocus","hasPageContentFocus","clearSelectedBlock","toggleDistractionFree"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\nimport { removeTemplates } from './private-actions';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate = ( template ) => {\n\treturn removeTemplates( [ template ] );\n};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;AAC9D,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;AACnE,SAASJ,KAAK,IAAIK,WAAW,QAAQ,mBAAmB;AACxD,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,UAAU,IAAIC,iBAAiB,QAAQ,aAAa;AAC7D,OAAOC,oBAAoB,MAAM,iCAAiC;AAClE,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B,SAASC,eAAe,QAAQ,mBAA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ACR,CAAE,CAAC;EAEH,IAAK6E,mBAAmB,EAAG;IAC1B9E,QAAQ,CAACG,QAAQ,CAAEf,gBAAiB,CAAC,CAAC2F,kBAAkB,CAAC,CAAC;EAC3D;EACA5E,QAAQ,CAAE;IACTQ,IAAI,EAAE,4BAA4B;IAClCmE;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAEhF;AAAS,CAAC,KAAM;EACnBnB,UAAU,CAAE,oDAAoD,EAAE;IACjEoB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAAC2F,qBAAqB,CAAC,CAAC;AACzD,CAAC"}
|
|
1
|
+
{"version":3,"names":["parse","deprecated","store","coreStore","blockEditorStore","editorStore","privateApis","editorPrivateApis","preferencesStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","unlock","interfaceStore","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","version","hint","setDeviceType","setTemplate","type","addTemplate","template","newTemplate","saveEntityRecord","content","editEntityRecord","id","blocks","undoIgnore","postType","removeTemplate","removeTemplates","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","context","setHomeTemplateId","setEditedPostContext","setPage","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","setIsListViewOpened","isOpen","updateSettings","settings","setIsSaveViewOpened","revertTemplate","options","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","setHasPageContentFocus","hasPageContentFocus","clearSelectedBlock","toggleDistractionFree"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\t( { registry } ) => {\n\t\treturn unlock( registry.dispatch( editorStore ) ).removeTemplates( [\n\t\t\ttemplate,\n\t\t] );\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, options ) =>\n\t( { registry } ) => {\n\t\treturn unlock( registry.dispatch( editorStore ) ).revertTemplate(\n\t\t\ttemplate,\n\t\t\toptions\n\t\t);\n\t};\n\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( 'core', name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( interfaceStore ).disableComplementaryArea( 'core' );\n\t};\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,yBAAyB;AACnE,SACCF,KAAK,IAAIG,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,QACd,oBAAoB;AAC3B,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAM;EAAEC;AAAe,CAAC,GAAGD,MAAM,CAAEL,iBAAkB,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,aAAaA,CAAEC,WAAW,EAAG;EAC5C,OAAO,UAAW;IAAEC;EAAS,CAAC,EAAG;IAChCf,UAAU,CACT,2DAA2D,EAC3D;MACCgB,KAAK,EAAE,KAAK;MACZC,WAAW,EACV;IACF,CACD,CAAC;IAEDF,QAAQ,CACNG,QAAQ,CAAEX,gBAAiB,CAAC,CAC5BY,MAAM,CAAE,gBAAgB,EAAEL,WAAY,CAAC;EAC1C,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AAC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AACG,QAAQ,CAAEN,cAAe,CAAC,CAACqD,wBAAwB,CAAE,MAAO,CAAC;AACvE,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAC1BC,IAAI,IACN,CAAE;EAAEpD;AAAS,CAAC,KAAM;EACnBf,UAAU,CAAE,+CAA+C,EAAE;IAC5DgB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAAC8D,gBAAgB,CAAEC,IAAK,CAAC;AAC1D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAChCC,mBAAmB,IACrB,CAAE;EAAEnD,QAAQ;EAAEH;AAAS,CAAC,KAAM;EAC7Bf,UAAU,CAAG,qDAAoD,EAAE;IAClEgB,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,IAAKqD,mBAAmB,EAAG;IAC1BtD,QAAQ,CAACG,QAAQ,CAAEf,gBAAiB,CAAC,CAACmE,kBAAkB,CAAC,CAAC;EAC3D;EACApD,QAAQ,CAAE;IACTQ,IAAI,EAAE,4BAA4B;IAClC2C;EACD,CAAE,CAAC;AACJ,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,qBAAqB,GACjCA,CAAA,KACA,CAAE;EAAExD;AAAS,CAAC,KAAM;EACnBf,UAAU,CAAE,oDAAoD,EAAE;IACjEgB,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EACHF,QAAQ,CAACG,QAAQ,CAAEd,WAAY,CAAC,CAACmE,qBAAqB,CAAC,CAAC;AACzD,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["STORE_NAME"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["STORE_NAME"],"sources":["@wordpress/edit-site/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-site';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createReduxStore","register","reducer","actions","privateActions","selectors","privateSelectors","STORE_NAME","unlock","storeConfig","store","registerPrivateSelectors","registerPrivateActions"],"sources":["@wordpress/edit-site/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nexport const storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\nunlock( store ).registerPrivateActions( privateActions );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,cAAc,MAAM,mBAAmB;AACnD,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,gBAAgB,MAAM,qBAAqB;AACvD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,OAAO,MAAMC,WAAW,GAAG;EAC1BP,OAAO;EACPC,OAAO;EACPE;AACD,CAAC;AAED,OAAO,MAAMK,KAAK,GAAGV,gBAAgB,CAAEO,UAAU,EAAEE,WAAY,CAAC;AAChER,QAAQ,CAAES,KAAM,CAAC;AACjBF,MAAM,CAAEE,KAAM,CAAC,CAACC,wBAAwB,CAAEL,gBAAiB,CAAC;AAC5DE,MAAM,CAAEE,KAAM,CAAC,CAACE,sBAAsB,CAAER,cAAe,CAAC"}
|
|
1
|
+
{"version":3,"names":["createReduxStore","register","reducer","actions","privateActions","selectors","privateSelectors","STORE_NAME","unlock","storeConfig","store","registerPrivateSelectors","registerPrivateActions"],"sources":["@wordpress/edit-site/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as privateActions from './private-actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\nexport const storeConfig = {\n\treducer,\n\tactions,\n\tselectors,\n};\n\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\nunlock( store ).registerPrivateActions( privateActions );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,cAAc,MAAM,mBAAmB;AACnD,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,gBAAgB,MAAM,qBAAqB;AACvD,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,OAAO,MAAMC,WAAW,GAAG;EAC1BP,OAAO;EACPC,OAAO;EACPE;AACD,CAAC;AAED,OAAO,MAAMK,KAAK,GAAGV,gBAAgB,CAAEO,UAAU,EAAEE,WAAY,CAAC;AAChER,QAAQ,CAAES,KAAM,CAAC;AACjBF,MAAM,CAAEE,KAAM,CAAC,CAACC,wBAAwB,CAAEL,gBAAiB,CAAC;AAC5DE,MAAM,CAAEE,KAAM,CAAC,CAACE,sBAAsB,CAAER,cAAe,CAAC","ignoreList":[]}
|
|
@@ -4,15 +4,6 @@
|
|
|
4
4
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
5
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
6
6
|
import { store as editorStore } from '@wordpress/editor';
|
|
7
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
9
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
10
|
-
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { TEMPLATE_POST_TYPE } from '../utils/constants';
|
|
16
7
|
|
|
17
8
|
/**
|
|
18
9
|
* Action that switches the canvas mode.
|
|
@@ -53,78 +44,4 @@ export const setEditorCanvasContainerView = view => ({
|
|
|
53
44
|
view
|
|
54
45
|
});
|
|
55
46
|
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Action that removes an array of templates.
|
|
59
|
-
*
|
|
60
|
-
* @param {Array} items An array of template or template part objects to remove.
|
|
61
|
-
*/
|
|
62
|
-
export const removeTemplates = items => async ({
|
|
63
|
-
registry
|
|
64
|
-
}) => {
|
|
65
|
-
const isTemplate = items[0].type === TEMPLATE_POST_TYPE;
|
|
66
|
-
const promiseResult = await Promise.allSettled(items.map(item => {
|
|
67
|
-
return registry.dispatch(coreStore).deleteEntityRecord('postType', item.type, item.id, {
|
|
68
|
-
force: true
|
|
69
|
-
}, {
|
|
70
|
-
throwOnError: true
|
|
71
|
-
});
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
// If all the promises were fulfilled with sucess.
|
|
75
|
-
if (promiseResult.every(({
|
|
76
|
-
status
|
|
77
|
-
}) => status === 'fulfilled')) {
|
|
78
|
-
let successMessage;
|
|
79
|
-
if (items.length === 1) {
|
|
80
|
-
// Depending on how the entity was retrieved its title might be
|
|
81
|
-
// an object or simple string.
|
|
82
|
-
const title = typeof items[0].title === 'string' ? items[0].title : items[0].title?.rendered;
|
|
83
|
-
successMessage = sprintf( /* translators: The template/part's name. */
|
|
84
|
-
__('"%s" deleted.'), decodeEntities(title));
|
|
85
|
-
} else {
|
|
86
|
-
successMessage = isTemplate ? __('Templates deleted.') : __('Template parts deleted.');
|
|
87
|
-
}
|
|
88
|
-
registry.dispatch(noticesStore).createSuccessNotice(successMessage, {
|
|
89
|
-
type: 'snackbar',
|
|
90
|
-
id: 'site-editor-template-deleted-success'
|
|
91
|
-
});
|
|
92
|
-
} else {
|
|
93
|
-
// If there was at lease one failure.
|
|
94
|
-
let errorMessage;
|
|
95
|
-
// If we were trying to delete a single template.
|
|
96
|
-
if (promiseResult.length === 1) {
|
|
97
|
-
if (promiseResult[0].reason?.message) {
|
|
98
|
-
errorMessage = promiseResult[0].reason.message;
|
|
99
|
-
} else {
|
|
100
|
-
errorMessage = isTemplate ? __('An error occurred while deleting the template.') : __('An error occurred while deleting the template part.');
|
|
101
|
-
}
|
|
102
|
-
// If we were trying to delete a multiple templates
|
|
103
|
-
} else {
|
|
104
|
-
const errorMessages = new Set();
|
|
105
|
-
const failedPromises = promiseResult.filter(({
|
|
106
|
-
status
|
|
107
|
-
}) => status === 'rejected');
|
|
108
|
-
for (const failedPromise of failedPromises) {
|
|
109
|
-
if (failedPromise.reason?.message) {
|
|
110
|
-
errorMessages.add(failedPromise.reason.message);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (errorMessages.size === 0) {
|
|
114
|
-
errorMessage = isTemplate ? __('An error occurred while deleting the templates.') : __('An error occurred while deleting the template parts.');
|
|
115
|
-
} else if (errorMessages.size === 1) {
|
|
116
|
-
errorMessage = isTemplate ? sprintf( /* translators: %s: an error message */
|
|
117
|
-
__('An error occurred while deleting the templates: %s'), [...errorMessages][0]) : sprintf( /* translators: %s: an error message */
|
|
118
|
-
__('An error occurred while deleting the template parts: %s'), [...errorMessages][0]);
|
|
119
|
-
} else {
|
|
120
|
-
errorMessage = isTemplate ? sprintf( /* translators: %s: a list of comma separated error messages */
|
|
121
|
-
__('Some errors occurred while deleting the templates: %s'), [...errorMessages].join(',')) : sprintf( /* translators: %s: a list of comma separated error messages */
|
|
122
|
-
__('Some errors occurred while deleting the template parts: %s'), [...errorMessages].join(','));
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
registry.dispatch(noticesStore).createErrorNotice(errorMessage, {
|
|
126
|
-
type: 'snackbar'
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
47
|
//# sourceMappingURL=private-actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","coreStore","noticesStore","__","sprintf","decodeEntities","TEMPLATE_POST_TYPE","setCanvasMode","mode","registry","dispatch","isMediumOrBigger","window","matchMedia","matches","__unstableSetEditorMode","type","select","get","setIsListViewOpened","setIsInserterOpened","setEditorCanvasContainerView","view","removeTemplates","items","isTemplate","promiseResult","Promise","allSettled","map","item","deleteEntityRecord","id","force","throwOnError","every","status","successMessage","length","title","rendered","createSuccessNotice","errorMessage","reason","message","errorMessages","Set","failedPromises","filter","failedPromise","add","size","join","createErrorNotice"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../utils/constants';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\t// This behavior is disabled for small viewports.\n\t\tif (\n\t\t\tisMediumOrBigger &&\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n\n/**\n * Action that removes an array of templates.\n *\n * @param {Array} items An array of template or template part objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isTemplate = items[ 0 ].type === TEMPLATE_POST_TYPE;\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with sucess.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tconst title =\n\t\t\t\t\ttypeof items[ 0 ].title === 'string'\n\t\t\t\t\t\t? items[ 0 ].title\n\t\t\t\t\t\t: items[ 0 ].title?.rendered;\n\t\t\t\tsuccessMessage = sprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isTemplate\n\t\t\t\t\t? __( 'Templates deleted.' )\n\t\t\t\t\t: __( 'Template parts deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'site-editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __( 'An error occurred while deleting the template.' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template part.'\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the templates.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts.'\n\t\t\t\t\t\t );\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;AACxD,SAASH,KAAK,IAAII,SAAS,QAAQ,sBAAsB;AACzD,SAASJ,KAAK,IAAIK,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B,MAAMC,gBAAgB,GACrBC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAClDL,QAAQ,CAACC,QAAQ,CAAEZ,gBAAiB,CAAC,CAACiB,uBAAuB,CAAE,MAAO,CAAC;EACvEL,QAAQ,CAAE;IACTM,IAAI,EAAE,iBAAiB;IACvBR;EACD,CAAE,CAAC;EACH;EACA;EACA;EACA,IACCG,gBAAgB,IAChBH,IAAI,KAAK,MAAM,IACfC,QAAQ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IAAIF,cAAc,EAAG;QAC7C,IAAKE,aAAa,CAACN,MAAM,EAAEC,OAAO,EAAG;UACpCC,aAAa,CAACK,GAAG,CAAED,aAAa,CAACN,MAAM,CAACC,OAAQ,CAAC;QAClD;MACD;MACA,IAAKC,aAAa,CAACM,IAAI,KAAK,CAAC,EAAG;QAC/BT,YAAY,GAAGjB,UAAU,GACtBtB,EAAE,CACF,iDACA,CAAC,GACDA,EAAE,CACF,sDACA,CAAC;MACL,CAAC,MAAM,IAAK0C,aAAa,CAACM,IAAI,KAAK,CAAC,EAAG;QACtCT,YAAY,GAAGjB,UAAU,GACtBrB,OAAO,EACP;QACAD,EAAE,CACD,oDACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAAE,CAAC,CACvB,CAAC,GACDzC,OAAO,EACP;QACAD,EAAE,CACD,yDACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAAE,CAAC,CACvB,CAAC;MACL,CAAC,MAAM;QACNH,YAAY,GAAGjB,UAAU,GACtBrB,OAAO,EACP;QACAD,EAAE,CACD,uDACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC,GACDhD,OAAO,EACP;QACAD,EAAE,CACD,4DACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC;MACL;IACD;IACA3C,QAAQ,CACNC,QAAQ,CAAER,YAAa,CAAC,CACxBmD,iBAAiB,CAAEX,YAAY,EAAE;MAAE1B,IAAI,EAAE;IAAW,CAAE,CAAC;EAC1D;AACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","setCanvasMode","mode","registry","dispatch","isMediumOrBigger","window","matchMedia","matches","__unstableSetEditorMode","type","select","get","setIsListViewOpened","setIsInserterOpened","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\t// This behavior is disabled for small viewports.\n\t\tif (\n\t\t\tisMediumOrBigger &&\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B,MAAMC,gBAAgB,GACrBC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAClDL,QAAQ,CAACC,QAAQ,CAAEN,gBAAiB,CAAC,CAACW,uBAAuB,CAAE,MAAO,CAAC;EACvEL,QAAQ,CAAE;IACTM,IAAI,EAAE,iBAAiB;IACvBR;EACD,CAAE,CAAC;EACH;EACA;EACA;EACA,IACCG,gBAAgB,IAChBH,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNQ,MAAM,CAAEZ,gBAAiB,CAAC,CAC1Ba,GAAG,CAAE,MAAM,EAAE,uBAAwB,CAAC,IACxC,CAAET,QAAQ,CACRQ,MAAM,CAAEZ,gBAAiB,CAAC,CAC1Ba,GAAG,CAAE,MAAM,EAAE,iBAAkB,CAAC,EACjC;IACDT,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACa,mBAAmB,CAAE,IAAK,CAAC;EAC7D,CAAC,MAAM;IACNV,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACa,mBAAmB,CAAE,KAAM,CAAC;EAC9D;EACAV,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACc,mBAAmB,CAAE,KAAM,CAAC;AAC9D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTM,IAAI,EAAE,kCAAkC;IACxCM;EACD,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC"}
|
|
1
|
+
{"version":3,"names":["getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["combineReducers","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,UAAUA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNE,QAAQ,EAAEH,MAAM,CAACG,QAAQ;QACzBC,EAAE,EAAEJ,MAAM,CAACI,EAAE;QACbC,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGN,KAAK;QACRM,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;EACH;EAEA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,UAAUA,CAAET,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACS,IAAI;EACpB;EAEA,OAAOV,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,yBAAyBA,CAAEX,KAAK,GAAGY,SAAS,EAAEX,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACY,IAAI;EACpB;EAEA,OAAOb,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC,QAAQ;EACRI,UAAU;EACVI,aAAa;EACbE,UAAU;EACVE;AACD,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["combineReducers","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;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