@wordpress/edit-site 5.31.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 +4 -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 +23 -7
- 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 +20 -5
- 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 +47 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -2
- 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 +50 -0
- package/build/components/global-styles/background-panel.js.map +1 -0
- 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 +2 -2
- 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 +88 -31
- 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 +20 -2
- 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 +3 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- 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 +8 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +34 -0
- package/build/components/global-styles/screen-background.js.map +1 -0
- 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 +2 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +6 -4
- 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 +3 -37
- 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 +6 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -2
- 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 +5 -2
- 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 +10 -3
- 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 +9 -2
- 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 +130 -0
- package/build/components/layout/animation.js.map +1 -0
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +21 -64
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +92 -23
- 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 +33 -33
- 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 +136 -39
- 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 +18 -59
- 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 +35 -80
- 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 +12 -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 +45 -16
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +8 -112
- 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 -79
- 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 +2 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +2 -2
- 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 +30 -56
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +26 -15
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- 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 +11 -17
- 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 +5 -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 +11 -7
- 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 +34 -32
- 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 +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 +16 -7
- 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 +0 -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 +1 -9
- 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 +24 -8
- 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 +20 -5
- 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 +48 -12
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -2
- 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 +44 -0
- package/build-module/components/global-styles/background-panel.js.map +1 -0
- 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 +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 +87 -31
- 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 +20 -2
- 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 +3 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- 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 +9 -3
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +26 -0
- package/build-module/components/global-styles/screen-background.js.map +1 -0
- 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 +2 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +6 -4
- 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 +4 -38
- 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 +6 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -2
- 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 +4 -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 +10 -3
- 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 +9 -2
- 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 +123 -0
- package/build-module/components/layout/animation.js.map +1 -0
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +21 -64
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +92 -23
- 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 +32 -32
- 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 +139 -42
- 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 +17 -57
- 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 +36 -81
- 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 +12 -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 +46 -17
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +10 -114
- 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 -79
- 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 +2 -2
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- 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 +29 -55
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +29 -18
- 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 +7 -5
- 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 +12 -18
- 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 +5 -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 +12 -8
- 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 +35 -33
- 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 +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 +16 -7
- 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 +0 -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 +1 -9
- 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 +287 -688
- package/build-style/style.css +287 -688
- package/package.json +44 -45
- 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 +59 -23
- package/src/components/block-editor/site-editor-canvas.js +16 -8
- package/src/components/editor/index.js +61 -17
- package/src/components/editor-canvas-container/index.js +0 -1
- package/src/components/global-styles/background-panel.js +50 -0
- package/src/components/global-styles/block-preview-panel.js +6 -1
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +104 -50
- 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 +32 -14
- package/src/components/global-styles/font-library-modal/utils/index.js +17 -4
- package/src/components/global-styles/highlighted-colors.js +1 -1
- package/src/components/global-styles/hooks.js +20 -3
- package/src/components/global-styles/palette.js +3 -1
- package/src/components/global-styles/preview-colors.js +2 -2
- package/src/components/global-styles/root-menu.js +12 -1
- package/src/components/global-styles/screen-background.js +29 -0
- package/src/components/global-styles/screen-color-palette.js +2 -2
- package/src/components/global-styles/screen-colors.js +4 -4
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/global-styles/screen-style-variations.js +4 -36
- package/src/components/global-styles/screen-typography.js +6 -9
- package/src/components/global-styles/style-variations-container.js +2 -1
- package/src/components/global-styles/style.scss +14 -12
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/global-styles/variations/style.scss +32 -17
- package/src/components/global-styles/variations/variations-color.js +4 -2
- package/src/components/global-styles/variations/variations-typography.js +4 -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 +29 -18
- 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 +125 -0
- package/src/components/layout/index.js +21 -74
- package/src/components/layout/router.js +99 -30
- package/src/components/layout/style.scss +17 -37
- package/src/components/page/index.js +7 -2
- package/src/components/page-pages/index.js +59 -65
- 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 +182 -78
- package/src/components/page-patterns/search-items.js +16 -58
- 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 +44 -103
- package/src/components/page-templates-template-parts/style.scss +5 -0
- package/src/components/pattern-modal/duplicate.js +2 -1
- package/src/components/pattern-modal/rename.js +2 -1
- package/src/components/plugin-template-setting-panel/index.js +14 -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-button/index.js +55 -26
- package/src/components/save-hub/index.js +20 -164
- package/src/components/save-panel/index.js +2 -2
- package/src/components/sidebar/index.js +52 -105
- package/src/components/sidebar/style.scss +41 -6
- package/src/components/sidebar-dataviews/default-views.js +2 -2
- package/src/components/sidebar-dataviews/index.js +2 -2
- 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 -77
- package/src/components/sidebar-edit-mode/page-panels/index.js +52 -60
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
- 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 +24 -34
- package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
- 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 +13 -30
- package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +9 -24
- 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 -67
- 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/style-book/index.js +1 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +52 -37
- 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/index.js +0 -1
- 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/selectors.js +3 -15
- package/src/store/test/actions.js +7 -2
- package/src/style.scss +0 -3
- package/src/utils/constants.js +1 -0
- package/src/utils/set-nested-value.js +39 -0
- package/build/components/actions/index.js +0 -319
- package/build/components/actions/index.js.map +0 -1
- 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 -116
- 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 -194
- 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-edit-mode/sidebar-card/index.js +0 -48
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
- package/build/components/sidebar-edit-mode/template-panel/template-areas.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/sidebar-navigation-screen-pages/index.js +0 -175
- package/build/components/sidebar-navigation-screen-pages/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/hooks/template-part-edit.js +0 -82
- package/build/hooks/template-part-edit.js.map +0 -1
- package/build/store/utils.js +0 -71
- package/build/store/utils.js.map +0 -1
- package/build-module/components/actions/index.js +0 -308
- package/build-module/components/actions/index.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 -107
- 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 -185
- 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-edit-mode/sidebar-card/index.js +0 -40
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.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/sidebar-navigation-screen-pages/index.js +0 -167
- package/build-module/components/sidebar-navigation-screen-pages/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/build-module/hooks/template-part-edit.js +0 -75
- package/build-module/hooks/template-part-edit.js.map +0 -1
- package/build-module/store/utils.js +0 -64
- package/build-module/store/utils.js.map +0 -1
- package/src/components/actions/index.js +0 -409
- 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 -147
- 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 -262
- 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-edit-mode/sidebar-card/index.js +0 -53
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -36
- package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
- package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
- package/src/hooks/template-part-edit.js +0 -89
- package/src/store/test/utils.js +0 -191
- package/src/store/utils.js +0 -69
|
@@ -10,8 +10,11 @@ var _components = require("@wordpress/components");
|
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _coreData = require("@wordpress/core-data");
|
|
12
12
|
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
+
var _router = require("@wordpress/router");
|
|
14
|
+
var _editor = require("@wordpress/editor");
|
|
13
15
|
var _store = require("../../store");
|
|
14
16
|
var _isPreviewingTheme = require("../../utils/is-previewing-theme");
|
|
17
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
15
18
|
/**
|
|
16
19
|
* WordPress dependencies
|
|
17
20
|
*/
|
|
@@ -20,46 +23,65 @@ var _isPreviewingTheme = require("../../utils/is-previewing-theme");
|
|
|
20
23
|
* Internal dependencies
|
|
21
24
|
*/
|
|
22
25
|
|
|
26
|
+
const {
|
|
27
|
+
useLocation
|
|
28
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
23
29
|
function SaveButton({
|
|
24
30
|
className = 'edit-site-save-button__button',
|
|
25
31
|
variant = 'primary',
|
|
26
32
|
showTooltip = true,
|
|
27
|
-
|
|
33
|
+
showReviewMessage,
|
|
28
34
|
icon,
|
|
29
35
|
size,
|
|
30
36
|
__next40pxDefaultSize = false
|
|
31
37
|
}) {
|
|
32
38
|
const {
|
|
33
|
-
|
|
39
|
+
params
|
|
40
|
+
} = useLocation();
|
|
41
|
+
const {
|
|
42
|
+
setIsSaveViewOpened
|
|
43
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
44
|
+
const {
|
|
45
|
+
saveDirtyEntities
|
|
46
|
+
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_editor.store));
|
|
47
|
+
const {
|
|
48
|
+
dirtyEntityRecords
|
|
49
|
+
} = (0, _editor.useEntitiesSavedStatesIsDirty)();
|
|
50
|
+
const {
|
|
34
51
|
isSaving,
|
|
35
52
|
isSaveViewOpen,
|
|
36
53
|
previewingThemeName
|
|
37
54
|
} = (0, _data.useSelect)(select => {
|
|
38
55
|
const {
|
|
39
|
-
__experimentalGetDirtyEntityRecords,
|
|
40
56
|
isSavingEntityRecord,
|
|
41
57
|
isResolving
|
|
42
58
|
} = select(_coreData.store);
|
|
43
|
-
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
44
59
|
const {
|
|
45
60
|
isSaveViewOpened
|
|
46
61
|
} = select(_store.store);
|
|
47
62
|
const isActivatingTheme = isResolving('activateTheme');
|
|
48
63
|
const currentlyPreviewingThemeId = (0, _isPreviewingTheme.currentlyPreviewingTheme)();
|
|
49
64
|
return {
|
|
50
|
-
isDirty: dirtyEntityRecords.length > 0,
|
|
51
65
|
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)) || isActivatingTheme,
|
|
52
66
|
isSaveViewOpen: isSaveViewOpened(),
|
|
53
67
|
// Do not call `getTheme` with null, it will cause a request to
|
|
54
68
|
// the server.
|
|
55
69
|
previewingThemeName: currentlyPreviewingThemeId ? select(_coreData.store).getTheme(currentlyPreviewingThemeId)?.name?.rendered : undefined
|
|
56
70
|
};
|
|
57
|
-
}, []);
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
}, [dirtyEntityRecords]);
|
|
72
|
+
const hasDirtyEntities = !!dirtyEntityRecords.length;
|
|
73
|
+
let isOnlyCurrentEntityDirty;
|
|
74
|
+
// Check if the current entity is the only entity with changes.
|
|
75
|
+
// We have some extra logic for `wp_global_styles` for now, that
|
|
76
|
+
// is used in navigation sidebar.
|
|
77
|
+
if (dirtyEntityRecords.length === 1) {
|
|
78
|
+
if (params.postId) {
|
|
79
|
+
isOnlyCurrentEntityDirty = `${dirtyEntityRecords[0].key}` === params.postId && dirtyEntityRecords[0].name === params.postType;
|
|
80
|
+
} else if (params.path?.includes('wp_global_styles')) {
|
|
81
|
+
isOnlyCurrentEntityDirty = dirtyEntityRecords[0].name === 'globalStyles';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const disabled = isSaving || !hasDirtyEntities && !(0, _isPreviewingTheme.isPreviewingTheme)();
|
|
63
85
|
const getLabel = () => {
|
|
64
86
|
if ((0, _isPreviewingTheme.isPreviewingTheme)()) {
|
|
65
87
|
if (isSaving) {
|
|
@@ -67,7 +89,7 @@ function SaveButton({
|
|
|
67
89
|
(0, _i18n.__)('Activating %s'), previewingThemeName);
|
|
68
90
|
} else if (disabled) {
|
|
69
91
|
return (0, _i18n.__)('Saved');
|
|
70
|
-
} else if (
|
|
92
|
+
} else if (hasDirtyEntities) {
|
|
71
93
|
return (0, _i18n.sprintf)( /* translators: %s: The name of theme to be activated. */
|
|
72
94
|
(0, _i18n.__)('Activate %s & Save'), previewingThemeName);
|
|
73
95
|
}
|
|
@@ -76,21 +98,28 @@ function SaveButton({
|
|
|
76
98
|
}
|
|
77
99
|
if (isSaving) {
|
|
78
100
|
return (0, _i18n.__)('Saving');
|
|
79
|
-
}
|
|
101
|
+
}
|
|
102
|
+
if (disabled) {
|
|
80
103
|
return (0, _i18n.__)('Saved');
|
|
81
|
-
}
|
|
82
|
-
|
|
104
|
+
}
|
|
105
|
+
if (!isOnlyCurrentEntityDirty && showReviewMessage) {
|
|
106
|
+
return (0, _i18n.sprintf)(
|
|
107
|
+
// translators: %d: number of unsaved changes (number).
|
|
108
|
+
(0, _i18n._n)('Review %d change…', 'Review %d changes…', dirtyEntityRecords.length), dirtyEntityRecords.length);
|
|
83
109
|
}
|
|
84
110
|
return (0, _i18n.__)('Save');
|
|
85
111
|
};
|
|
86
112
|
const label = getLabel();
|
|
113
|
+
const onClick = isOnlyCurrentEntityDirty ? () => saveDirtyEntities({
|
|
114
|
+
dirtyEntityRecords
|
|
115
|
+
}) : () => setIsSaveViewOpened(true);
|
|
87
116
|
return (0, _react.createElement)(_components.Button, {
|
|
88
117
|
variant: variant,
|
|
89
118
|
className: className,
|
|
90
119
|
"aria-disabled": disabled,
|
|
91
120
|
"aria-expanded": isSaveViewOpen,
|
|
92
121
|
isBusy: isSaving,
|
|
93
|
-
onClick: disabled ? undefined :
|
|
122
|
+
onClick: disabled ? undefined : onClick,
|
|
94
123
|
label: label
|
|
95
124
|
/*
|
|
96
125
|
* We want the tooltip to show the keyboard shortcut only when the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_store","_isPreviewingTheme","SaveButton","className","variant","showTooltip","
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","_react","createElement","Button","isBusy","shortcut","displayShortcut","primary"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ show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iBAAgB0C,QAAU;IAC1B,iBAAgB1B,cAAgB;IAChCqC,MAAM,EAAGtC,QAAU;IACnBkC,OAAO,EAAGP,QAAQ,GAAGR,SAAS,GAAGe,OAAS;IAC1CD,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAM,QAAQ,EAAGZ,QAAQ,GAAGR,SAAS,GAAGqB,yBAAe,CAACC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMAtD,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA;EAAM,GAEX2C,KACK,CAAC;AAEX","ignoreList":[]}
|
|
@@ -8,16 +8,10 @@ exports.default = SaveHub;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
11
|
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
14
12
|
var _icons = require("@wordpress/icons");
|
|
15
|
-
var _router = require("@wordpress/router");
|
|
16
|
-
var _notices = require("@wordpress/notices");
|
|
17
13
|
var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
18
14
|
var _isPreviewingTheme = require("../../utils/is-previewing-theme");
|
|
19
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
20
|
-
var _constants = require("../../utils/constants");
|
|
21
15
|
/**
|
|
22
16
|
* WordPress dependencies
|
|
23
17
|
*/
|
|
@@ -26,30 +20,9 @@ var _constants = require("../../utils/constants");
|
|
|
26
20
|
* Internal dependencies
|
|
27
21
|
*/
|
|
28
22
|
|
|
29
|
-
const {
|
|
30
|
-
useLocation
|
|
31
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
32
|
-
const PUBLISH_ON_SAVE_ENTITIES = [{
|
|
33
|
-
kind: 'postType',
|
|
34
|
-
name: _constants.NAVIGATION_POST_TYPE
|
|
35
|
-
}];
|
|
36
23
|
function SaveHub() {
|
|
37
|
-
const saveNoticeId = 'site-edit-save-notice';
|
|
38
24
|
const {
|
|
39
|
-
|
|
40
|
-
} = useLocation();
|
|
41
|
-
const {
|
|
42
|
-
__unstableMarkLastChangeAsPersistent
|
|
43
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
44
|
-
const {
|
|
45
|
-
createSuccessNotice,
|
|
46
|
-
createErrorNotice,
|
|
47
|
-
removeNotice
|
|
48
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
49
|
-
const {
|
|
50
|
-
dirtyCurrentEntity,
|
|
51
|
-
countUnsavedChanges,
|
|
52
|
-
isDirty,
|
|
25
|
+
isDisabled,
|
|
53
26
|
isSaving
|
|
54
27
|
} = (0, _data.useSelect)(select => {
|
|
55
28
|
const {
|
|
@@ -57,99 +30,22 @@ function SaveHub() {
|
|
|
57
30
|
isSavingEntityRecord
|
|
58
31
|
} = select(_coreData.store);
|
|
59
32
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
60
|
-
|
|
61
|
-
if (dirtyEntityRecords.length === 1) {
|
|
62
|
-
// if we are on global styles
|
|
63
|
-
if (params.path?.includes('wp_global_styles')) {
|
|
64
|
-
calcDirtyCurrentEntity = dirtyEntityRecords.find(record => record.name === 'globalStyles');
|
|
65
|
-
}
|
|
66
|
-
// if we are on pages
|
|
67
|
-
else if (params.postId) {
|
|
68
|
-
calcDirtyCurrentEntity = dirtyEntityRecords.find(record => record.name === params.postType && String(record.key) === params.postId);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
dirtyCurrentEntity: calcDirtyCurrentEntity,
|
|
73
|
-
isDirty: dirtyEntityRecords.length > 0,
|
|
74
|
-
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
|
|
75
|
-
countUnsavedChanges: dirtyEntityRecords.length
|
|
76
|
-
};
|
|
77
|
-
}, [params.path, params.postType, params.postId]);
|
|
78
|
-
const {
|
|
79
|
-
editEntityRecord,
|
|
80
|
-
saveEditedEntityRecord,
|
|
81
|
-
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
|
|
82
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
83
|
-
const disabled = isSaving || !isDirty && !(0, _isPreviewingTheme.isPreviewingTheme)();
|
|
84
|
-
|
|
85
|
-
// if we have only one unsaved change and it matches current context, we can show a more specific label
|
|
86
|
-
let label = dirtyCurrentEntity ? (0, _i18n.__)('Save') : (0, _i18n.sprintf)(
|
|
87
|
-
// translators: %d: number of unsaved changes (number).
|
|
88
|
-
(0, _i18n._n)('Review %d change…', 'Review %d changes…', countUnsavedChanges), countUnsavedChanges);
|
|
89
|
-
if (isSaving) {
|
|
90
|
-
label = (0, _i18n.__)('Saving');
|
|
91
|
-
}
|
|
92
|
-
const {
|
|
93
|
-
homeUrl
|
|
94
|
-
} = (0, _data.useSelect)(select => {
|
|
95
|
-
const {
|
|
96
|
-
getUnstableBase // Site index.
|
|
97
|
-
} = select(_coreData.store);
|
|
33
|
+
const _isSaving = dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key));
|
|
98
34
|
return {
|
|
99
|
-
|
|
35
|
+
isSaving: _isSaving,
|
|
36
|
+
isDisabled: _isSaving || !dirtyEntityRecords.length && !(0, _isPreviewingTheme.isPreviewingTheme)()
|
|
100
37
|
};
|
|
101
38
|
}, []);
|
|
102
|
-
const saveCurrentEntity = async () => {
|
|
103
|
-
if (!dirtyCurrentEntity) return;
|
|
104
|
-
removeNotice(saveNoticeId);
|
|
105
|
-
const {
|
|
106
|
-
kind,
|
|
107
|
-
name,
|
|
108
|
-
key,
|
|
109
|
-
property
|
|
110
|
-
} = dirtyCurrentEntity;
|
|
111
|
-
try {
|
|
112
|
-
if ('root' === dirtyCurrentEntity.kind && 'site' === name) {
|
|
113
|
-
await saveSpecifiedEntityEdits('root', 'site', undefined, [property]);
|
|
114
|
-
} else {
|
|
115
|
-
if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) {
|
|
116
|
-
editEntityRecord(kind, name, key, {
|
|
117
|
-
status: 'publish'
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
await saveEditedEntityRecord(kind, name, key);
|
|
121
|
-
}
|
|
122
|
-
__unstableMarkLastChangeAsPersistent();
|
|
123
|
-
createSuccessNotice((0, _i18n.__)('Site updated.'), {
|
|
124
|
-
type: 'snackbar',
|
|
125
|
-
actions: [{
|
|
126
|
-
label: (0, _i18n.__)('View site'),
|
|
127
|
-
url: homeUrl
|
|
128
|
-
}],
|
|
129
|
-
id: saveNoticeId
|
|
130
|
-
});
|
|
131
|
-
} catch (error) {
|
|
132
|
-
createErrorNotice(`${(0, _i18n.__)('Saving failed.')} ${error}`);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
39
|
return (0, _react.createElement)(_components.__experimentalHStack, {
|
|
136
40
|
className: "edit-site-save-hub",
|
|
137
41
|
alignment: "right",
|
|
138
42
|
spacing: 4
|
|
139
|
-
},
|
|
140
|
-
variant: "primary",
|
|
141
|
-
onClick: saveCurrentEntity,
|
|
142
|
-
isBusy: isSaving,
|
|
143
|
-
disabled: isSaving,
|
|
144
|
-
"aria-disabled": isSaving,
|
|
145
|
-
className: "edit-site-save-hub__button",
|
|
146
|
-
__next40pxDefaultSize: true
|
|
147
|
-
}, label) : (0, _react.createElement)(_saveButton.default, {
|
|
43
|
+
}, (0, _react.createElement)(_saveButton.default, {
|
|
148
44
|
className: "edit-site-save-hub__button",
|
|
149
|
-
variant:
|
|
45
|
+
variant: isDisabled ? null : 'primary',
|
|
150
46
|
showTooltip: false,
|
|
151
|
-
icon:
|
|
152
|
-
|
|
47
|
+
icon: isDisabled && !isSaving ? _icons.check : null,
|
|
48
|
+
showReviewMessage: true,
|
|
153
49
|
__next40pxDefaultSize: true
|
|
154
50
|
}));
|
|
155
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_coreData","_blockEditor","_icons","_router","_notices","_saveButton","_interopRequireDefault","_isPreviewingTheme","_lockUnlock","_constants","useLocation","unlock","routerPrivateApis","PUBLISH_ON_SAVE_ENTITIES","kind","name","NAVIGATION_POST_TYPE","SaveHub","saveNoticeId","params","__unstableMarkLastChangeAsPersistent","useDispatch","blockEditorStore","createSuccessNotice","createErrorNotice","removeNotice","noticesStore","dirtyCurrentEntity","countUnsavedChanges","isDirty","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","calcDirtyCurrentEntity","length","path","includes","find","record","postId","postType","String","key","some","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","disabled","isPreviewingTheme","label","__","sprintf","_n","homeUrl","getUnstableBase","home","saveCurrentEntity","property","undefined","typeToPublish","status","type","actions","url","id","error","_react","createElement","__experimentalHStack","className","alignment","spacing","Button","variant","onClick","isBusy","__next40pxDefaultSize","default","showTooltip","icon","check","defaultLabel"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { check } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: NAVIGATION_POST_TYPE,\n\t},\n];\n\nexport default function SaveHub() {\n\tconst saveNoticeId = 'site-edit-save-notice';\n\tconst { params } = useLocation();\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst { dirtyCurrentEntity, countUnsavedChanges, isDirty, isSaving } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\t\tisSavingEntityRecord,\n\t\t\t\t} = select( coreStore );\n\t\t\t\tconst dirtyEntityRecords =\n\t\t\t\t\t__experimentalGetDirtyEntityRecords();\n\t\t\t\tlet calcDirtyCurrentEntity = null;\n\n\t\t\t\tif ( dirtyEntityRecords.length === 1 ) {\n\t\t\t\t\t// if we are on global styles\n\t\t\t\t\tif ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\t\t\t\tcalcDirtyCurrentEntity = dirtyEntityRecords.find(\n\t\t\t\t\t\t\t( record ) => record.name === 'globalStyles'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// if we are on pages\n\t\t\t\t\telse if ( params.postId ) {\n\t\t\t\t\t\tcalcDirtyCurrentEntity = dirtyEntityRecords.find(\n\t\t\t\t\t\t\t( record ) =>\n\t\t\t\t\t\t\t\trecord.name === params.postType &&\n\t\t\t\t\t\t\t\tString( record.key ) === params.postId\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tdirtyCurrentEntity: calcDirtyCurrentEntity,\n\t\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tcountUnsavedChanges: dirtyEntityRecords.length,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ params.path, params.postType, params.postId ]\n\t\t);\n\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst disabled = isSaving || ( ! isDirty && ! isPreviewingTheme() );\n\n\t// if we have only one unsaved change and it matches current context, we can show a more specific label\n\tlet label = dirtyCurrentEntity\n\t\t? __( 'Save' )\n\t\t: sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t),\n\t\t\t\tcountUnsavedChanges\n\t\t );\n\n\tif ( isSaving ) {\n\t\tlabel = __( 'Saving' );\n\t}\n\n\tconst { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tconst saveCurrentEntity = async () => {\n\t\tif ( ! dirtyCurrentEntity ) return;\n\n\t\tremoveNotice( saveNoticeId );\n\t\tconst { kind, name, key, property } = dirtyCurrentEntity;\n\n\t\ttry {\n\t\t\tif ( 'root' === dirtyCurrentEntity.kind && 'site' === name ) {\n\t\t\t\tawait saveSpecifiedEntityEdits( 'root', 'site', undefined, [\n\t\t\t\t\tproperty,\n\t\t\t\t] );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tawait saveEditedEntityRecord( kind, name, key );\n\t\t\t}\n\n\t\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tid: saveNoticeId,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` );\n\t\t}\n\t};\n\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t{ dirtyCurrentEntity ? (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ saveCurrentEntity }\n\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\tdisabled={ isSaving }\n\t\t\t\t\taria-disabled={ isSaving }\n\t\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</Button>\n\t\t\t) : (\n\t\t\t\t<SaveButton\n\t\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\t\tvariant={ disabled ? null : 'primary' }\n\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\ticon={ disabled && ! isSaving ? check : null }\n\t\t\t\t\tdefaultLabel={ label }\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t/>\n\t\t\t) }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAC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Ba,GAAG,EAAEV;QACN,CAAC,CACD;QACDW,EAAE,EAAEnD;MACL,CAAE,CAAC;IACJ,CAAC,CAAC,OAAQoD,KAAK,EAAG;MACjB9C,iBAAiB,CAAG,GAAG,IAAA+B,QAAE,EAAE,gBAAiB,CAAG,IAAIe,KAAO,EAAE,CAAC;IAC9D;EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC1E,WAAA,CAAA2E,oBAAM;IAACC,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG;EAAG,GACnEjD,kBAAkB,GACnB,IAAA4C,MAAA,CAAAC,aAAA,EAAC1E,WAAA,CAAA+E,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBC,OAAO,EAAGlB,iBAAmB;IAC7BmB,MAAM,EAAGlD,QAAU;IACnBsB,QAAQ,EAAGtB,QAAU;IACrB,iBAAgBA,QAAU;IAC1B4C,SAAS,EAAC,4BAA4B;IACtCO,qBAAqB;EAAA,GAEnB3B,KACK,CAAC,GAET,IAAAiB,MAAA,CAAAC,aAAA,EAACnE,WAAA,CAAA6E,OAAU;IACVR,SAAS,EAAC,4BAA4B;IACtCI,OAAO,EAAG1B,QAAQ,GAAG,IAAI,GAAG,SAAW;IACvC+B,WAAW,EAAG,KAAO;IACrBC,IAAI,EAAGhC,QAAQ,IAAI,CAAEtB,QAAQ,GAAGuD,YAAK,GAAG,IAAM;IAC9CC,YAAY,EAAGhC,KAAO;IACtB2B,qBAAqB;EAAA,CACrB,CAEK,CAAC;AAEX"}
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","_react","createElement","__experimentalHStack","className","alignment","spacing","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIe,SAASO,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEG,eAAU,CAAC;IACpB,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;IAChE,MAAMI,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDL,oBAAoB,CAAEK,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNZ,QAAQ,EAAEO,SAAS;MACnBR,UAAU,EACTQ,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAE,IAAAC,oCAAiB,EAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAAyB,oBAAM;IAACC,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG;EAAG,GACrE,IAAAL,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAA0B,OAAU;IACVH,SAAS,EAAC,4BAA4B;IACtCI,OAAO,EAAGvB,UAAU,GAAG,IAAI,GAAG,SAAW;IACzCwB,WAAW,EAAG,KAAO;IACrBC,IAAI,EAAGzB,UAAU,IAAI,CAAEC,QAAQ,GAAGyB,YAAK,GAAG,IAAM;IAChDC,iBAAiB;IACjBC,qBAAqB;EAAA,CACrB,CACM,CAAC;AAEX","ignoreList":[]}
|
|
@@ -11,7 +11,6 @@ var _components = require("@wordpress/components");
|
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
13
|
var _i18n = require("@wordpress/i18n");
|
|
14
|
-
var _interface = require("@wordpress/interface");
|
|
15
14
|
var _coreData = require("@wordpress/core-data");
|
|
16
15
|
var _store = require("../../store");
|
|
17
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
@@ -31,7 +30,8 @@ var _isPreviewingTheme = require("../../utils/is-previewing-theme");
|
|
|
31
30
|
*/
|
|
32
31
|
|
|
33
32
|
const {
|
|
34
|
-
EntitiesSavedStatesExtensible
|
|
33
|
+
EntitiesSavedStatesExtensible,
|
|
34
|
+
NavigableRegion
|
|
35
35
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
36
36
|
const EntitiesSavedStatesForPreview = ({
|
|
37
37
|
onClose
|
|
@@ -120,7 +120,7 @@ function SavePanel() {
|
|
|
120
120
|
}
|
|
121
121
|
const activateSaveEnabled = (0, _isPreviewingTheme.isPreviewingTheme)() || isDirty;
|
|
122
122
|
const disabled = isSaving || !activateSaveEnabled;
|
|
123
|
-
return (0, _react.createElement)(
|
|
123
|
+
return (0, _react.createElement)(NavigableRegion, {
|
|
124
124
|
className: (0, _classnames.default)('edit-site-layout__actions', {
|
|
125
125
|
'is-entity-save-view-open': isSaveViewOpen
|
|
126
126
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_editor","_data","_i18n","_interface","_coreData","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","EntitiesSavedStatesExtensible","unlock","privateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","_react","createElement","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","isPreviewingTheme","EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","NavigableRegion","classnames","ariaLabel","Button","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"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E1B;IAC7B,CAAE,CAAG;IACL2B,SAAS,EAAG,IAAAtD,QAAE,EAAE,YAAa;EAAG,GAEhC,IAAAS,MAAA,CAAAC,aAAA;IACCoC,SAAS,EAAG,IAAAO,mBAAU,EAAE,qCAAqC,EAAE;MAC9D,oBAAoB,EAAE1B;IACvB,CAAE;EAAG,GAEL,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA6E,MAAM;IACNC,OAAO,EAAC,WAAW;IACnBV,SAAS,EAAG,IAAAO,mBAAU,EACrB,4CACD,CAAG;IACHI,OAAO,EAAGA,CAAA,KAAMd,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BQ,QAAQ,EAAGA,QAAU;IACrBO,yBAAyB;EAAA,GAEvB,IAAA1D,QAAE,EAAE,iBAAkB,CACjB,CACJ,CAAC,EACJ2B,cAAc,IACf,IAAAlB,MAAA,CAAAC,aAAA,EAACW,oBAAoB;IAAC5B,OAAO,EAAGA,OAAS;IAAC6B,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","_react","createElement","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","renderDialog","undefined","isPreviewingTheme","EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","classnames","ariaLabel","Button","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog = undefined } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-editor__toggle-save-panel-button'\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup={ 'dialog' }\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,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,QAAE,EAAE,YAAa;EAAG,GAEhC,IAAAS,MAAA,CAAAC,aAAA;IACCoC,SAAS,EAAG,IAAAM,mBAAU,EAAE,qCAAqC,EAAE;MAC9D,oBAAoB,EAAEzB;IACvB,CAAE;EAAG,GAEL,IAAAlB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA4E,MAAM;IACNC,OAAO,EAAC,WAAW;IACnBT,SAAS,EAAG,IAAAM,mBAAU,EACrB,4CACD,CAAG;IACHI,OAAO,EAAGA,CAAA,KAAMb,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,QAAU;IAC1BQ,QAAQ,EAAGA,QAAU;IACrBM,yBAAyB;EAAA,GAEvB,IAAAzD,QAAE,EAAE,iBAAkB,CACjB,CACJ,CAAC,EACJ2B,cAAc,IACf,IAAAlB,MAAA,CAAAC,aAAA,EAACW,oBAAoB;IAAC5B,OAAO,EAAGA,OAAS;IAAC6B,YAAY;EAAA,CAAE,CAEzC,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -4,31 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.SidebarNavigationContext = void 0;
|
|
8
|
+
exports.default = SidebarContent;
|
|
8
9
|
var _react = require("react");
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _element = require("@wordpress/element");
|
|
11
|
-
var
|
|
12
|
-
var _router = require("@wordpress/router");
|
|
13
|
-
var _compose = require("@wordpress/compose");
|
|
14
|
-
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
16
|
-
var _sidebarNavigationScreenTemplate = _interopRequireDefault(require("../sidebar-navigation-screen-template"));
|
|
17
|
-
var _sidebarNavigationScreenPatterns = _interopRequireDefault(require("../sidebar-navigation-screen-patterns"));
|
|
18
|
-
var _sidebarNavigationScreenPattern = _interopRequireDefault(require("../sidebar-navigation-screen-pattern"));
|
|
19
|
-
var _useSyncPathWithUrl = _interopRequireWildcard(require("../sync-state-with-url/use-sync-path-with-url"));
|
|
20
|
-
var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
|
|
21
|
-
var _sidebarNavigationScreenNavigationMenu = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menu"));
|
|
22
|
-
var _sidebarNavigationScreenGlobalStyles = _interopRequireDefault(require("../sidebar-navigation-screen-global-styles"));
|
|
23
|
-
var _sidebarNavigationScreenTemplatesBrowse = _interopRequireDefault(require("../sidebar-navigation-screen-templates-browse"));
|
|
24
|
-
var _saveHub = _interopRequireDefault(require("../save-hub"));
|
|
25
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
26
|
-
var _sidebarNavigationScreenPages = _interopRequireDefault(require("../sidebar-navigation-screen-pages"));
|
|
27
|
-
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
28
|
-
var _sidebarDataviews = _interopRequireDefault(require("../sidebar-dataviews"));
|
|
29
|
-
var _sidebarNavigationScreenPage = _interopRequireDefault(require("../sidebar-navigation-screen-page"));
|
|
30
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
var _dom = require("@wordpress/dom");
|
|
32
13
|
/**
|
|
33
14
|
* External dependencies
|
|
34
15
|
*/
|
|
@@ -37,64 +18,45 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
37
18
|
* WordPress dependencies
|
|
38
19
|
*/
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const {
|
|
45
|
-
useLocation
|
|
46
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
47
|
-
function SidebarScreenWrapper({
|
|
48
|
-
className,
|
|
49
|
-
...props
|
|
21
|
+
const SidebarNavigationContext = exports.SidebarNavigationContext = (0, _element.createContext)(() => {});
|
|
22
|
+
function SidebarContent({
|
|
23
|
+
routeKey,
|
|
24
|
+
children
|
|
50
25
|
}) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
const [navState, setNavState] = (0, _element.useState)({
|
|
27
|
+
direction: null,
|
|
28
|
+
focusSelector: null
|
|
54
29
|
});
|
|
30
|
+
const navigate = (0, _element.useCallback)((direction, focusSelector = null) => {
|
|
31
|
+
setNavState(prevState => ({
|
|
32
|
+
direction,
|
|
33
|
+
focusSelector: direction === 'forward' && focusSelector ? focusSelector : prevState.focusSelector
|
|
34
|
+
}));
|
|
35
|
+
}, []);
|
|
36
|
+
const wrapperRef = (0, _element.useRef)();
|
|
37
|
+
(0, _element.useEffect)(() => {
|
|
38
|
+
let elementToFocus;
|
|
39
|
+
if (navState.direction === 'back' && navState.focusSelector) {
|
|
40
|
+
elementToFocus = wrapperRef.current.querySelector(navState.focusSelector);
|
|
41
|
+
}
|
|
42
|
+
if (navState.direction !== null && !elementToFocus) {
|
|
43
|
+
const [firstTabbable] = _dom.focus.tabbable.find(wrapperRef.current);
|
|
44
|
+
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : wrapperRef.current;
|
|
45
|
+
}
|
|
46
|
+
elementToFocus?.focus();
|
|
47
|
+
}, [navState]);
|
|
48
|
+
const wrapperCls = (0, _classnames.default)('edit-site-sidebar__screen-wrapper', {
|
|
49
|
+
'slide-from-left': navState.direction === 'back',
|
|
50
|
+
'slide-from-right': navState.direction === 'forward'
|
|
51
|
+
});
|
|
52
|
+
return (0, _react.createElement)(SidebarNavigationContext.Provider, {
|
|
53
|
+
value: navigate
|
|
54
|
+
}, (0, _react.createElement)("div", {
|
|
55
|
+
className: "edit-site-sidebar__content"
|
|
56
|
+
}, (0, _react.createElement)("div", {
|
|
57
|
+
ref: wrapperRef,
|
|
58
|
+
key: routeKey,
|
|
59
|
+
className: wrapperCls
|
|
60
|
+
}, children)));
|
|
55
61
|
}
|
|
56
|
-
function SidebarScreens() {
|
|
57
|
-
(0, _useSyncPathWithUrl.default)();
|
|
58
|
-
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
59
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(SidebarScreenWrapper, {
|
|
60
|
-
path: "/"
|
|
61
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenMain.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
62
|
-
path: "/navigation"
|
|
63
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenNavigationMenus.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
64
|
-
path: "/navigation/:postType/:postId"
|
|
65
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenNavigationMenu.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
66
|
-
path: "/wp_global_styles"
|
|
67
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenGlobalStyles.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
68
|
-
path: "/page"
|
|
69
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenPages.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
70
|
-
path: "/pages"
|
|
71
|
-
}, (0, _react.createElement)(_sidebarNavigationScreen.default, {
|
|
72
|
-
title: (0, _i18n.__)('Manage pages'),
|
|
73
|
-
content: (0, _react.createElement)(_sidebarDataviews.default, null),
|
|
74
|
-
backPath: "/page"
|
|
75
|
-
})), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
76
|
-
path: "/page/:postId"
|
|
77
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenPage.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
78
|
-
path: "/:postType(wp_template)"
|
|
79
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, null)), !isMobileViewport && (0, _react.createElement)(SidebarScreenWrapper, {
|
|
80
|
-
path: "/patterns"
|
|
81
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenPatterns.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
82
|
-
path: "/:postType(wp_template_part)/all"
|
|
83
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenTemplatesBrowse.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
84
|
-
path: "/:postType(wp_template_part|wp_block)/:postId"
|
|
85
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenPattern.default, null)), (0, _react.createElement)(SidebarScreenWrapper, {
|
|
86
|
-
path: "/:postType(wp_template)/:postId"
|
|
87
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenTemplate.default, null)));
|
|
88
|
-
}
|
|
89
|
-
function Sidebar() {
|
|
90
|
-
const {
|
|
91
|
-
params: urlParams
|
|
92
|
-
} = useLocation();
|
|
93
|
-
const initialPath = (0, _element.useRef)((0, _useSyncPathWithUrl.getPathFromURL)(urlParams));
|
|
94
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalNavigatorProvider, {
|
|
95
|
-
className: "edit-site-sidebar__content",
|
|
96
|
-
initialPath: initialPath.current
|
|
97
|
-
}, (0, _react.createElement)(SidebarScreens, null)), (0, _react.createElement)(_saveHub.default, null));
|
|
98
|
-
}
|
|
99
|
-
var _default = exports.default = (0, _element.memo)(Sidebar);
|
|
100
62
|
//# sourceMappingURL=index.js.map
|