@wordpress/edit-site 5.14.0 → 5.16.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 +1 -6
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +22 -7
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +10 -8
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/constants.js +1 -1
- package/build/components/block-editor/constants.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +1 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +0 -4
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +114 -13
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/code-editor/index.js +60 -28
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +7 -3
- package/build/components/create-pattern-modal/index.js.map +1 -1
- package/build/components/editor/index.js +5 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +12 -7
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/screen-block.js +16 -0
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +12 -5
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
- 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 +32 -25
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -3
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +4 -2
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +13 -9
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +7 -5
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/layout/index.js +17 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/index.js +3 -3
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/index.js +2 -2
- package/build/components/page-actions/index.js.map +1 -1
- package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -16
- package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js +163 -0
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -0
- package/build/components/page-patterns/grid-item.js +83 -58
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/grid.js +5 -18
- package/build/components/page-patterns/grid.js.map +1 -1
- package/build/components/page-patterns/header.js +69 -0
- package/build/components/page-patterns/header.js.map +1 -0
- package/build/components/page-patterns/index.js +3 -1
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/pagination.js +63 -0
- package/build/components/page-patterns/pagination.js.map +1 -0
- package/build/components/page-patterns/patterns-list.js +110 -31
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +109 -0
- package/build/components/page-patterns/rename-menu-item.js.map +1 -0
- package/build/components/page-patterns/use-patterns.js +116 -118
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-template-parts/add-new-template-part.js +74 -0
- package/build/components/page-template-parts/add-new-template-part.js.map +1 -0
- package/build/components/page-template-parts/index.js +3 -25
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +1 -16
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +85 -51
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-button/index.js +4 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +10 -4
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +5 -5
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
- 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 +3 -8
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +15 -8
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +31 -15
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +34 -40
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +4 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +4 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -3
- 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 +5 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
- 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 +8 -0
- 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 +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 +2 -3
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +1 -34
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +35 -25
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +9 -7
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
- 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 +3 -2
- 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 +19 -4
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +55 -28
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +0 -5
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +72 -60
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +9 -5
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +11 -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 +20 -9
- 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 +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +1 -10
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +29 -13
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -5
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +15 -12
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +3 -1
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +12 -8
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +6 -1
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +120 -32
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +65 -7
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +138 -57
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/store/private-actions.js +9 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/utils/normalize-record-key.js +19 -0
- package/build/utils/normalize-record-key.js.map +1 -0
- package/build/utils/use-activate-theme.js +1 -1
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-debounced-input.js +5 -7
- package/build/utils/use-debounced-input.js.map +1 -1
- package/build-module/components/add-new-page/index.js +1 -6
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +20 -7
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +9 -6
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/constants.js +1 -1
- package/build-module/components/block-editor/constants.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +0 -4
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +116 -14
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/code-editor/index.js +62 -30
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +6 -3
- package/build-module/components/create-pattern-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +5 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +12 -7
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +16 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +13 -6
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
- 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 +28 -21
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -3
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +6 -4
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +13 -9
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -5
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/layout/index.js +17 -5
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/index.js +3 -3
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-actions/index.js +2 -2
- package/build-module/components/page-actions/index.js.map +1 -1
- package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -17
- package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +147 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -0
- package/build-module/components/page-patterns/grid-item.js +84 -64
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/grid.js +5 -17
- package/build-module/components/page-patterns/grid.js.map +1 -1
- package/build-module/components/page-patterns/header.js +54 -0
- package/build-module/components/page-patterns/header.js.map +1 -0
- package/build-module/components/page-patterns/index.js +3 -1
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/pagination.js +54 -0
- package/build-module/components/page-patterns/pagination.js.map +1 -0
- package/build-module/components/page-patterns/patterns-list.js +111 -34
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +97 -0
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -0
- package/build-module/components/page-patterns/use-patterns.js +116 -119
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-template-parts/add-new-template-part.js +58 -0
- package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -0
- package/build-module/components/page-template-parts/index.js +4 -24
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +2 -15
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +87 -55
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-button/index.js +4 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +10 -4
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +5 -5
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
- 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 +3 -8
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +15 -9
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +29 -16
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +34 -40
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +4 -3
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +4 -4
- 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 +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -3
- 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 +5 -4
- 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/constants.js +2 -0
- 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 +4 -4
- 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 +7 -0
- 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 +2 -2
- 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 +2 -3
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -32
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +35 -25
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +8 -7
- 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.js +4 -3
- 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 +3 -2
- 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 +18 -4
- 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-pattern-details.js +53 -28
- 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 +0 -5
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +76 -60
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +9 -5
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -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 +18 -9
- 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 +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -8
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +28 -13
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -5
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +16 -12
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +2 -1
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +11 -8
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +3 -1
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +116 -32
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +65 -9
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +139 -57
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/store/private-actions.js +9 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/utils/normalize-record-key.js +12 -0
- package/build-module/utils/normalize-record-key.js.map +1 -0
- package/build-module/utils/use-activate-theme.js +1 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-debounced-input.js +5 -7
- package/build-module/utils/use-debounced-input.js.map +1 -1
- package/build-style/style-rtl.css +281 -103
- package/build-style/style.css +281 -103
- package/package.json +39 -40
- package/src/components/add-new-page/index.js +0 -3
- package/src/components/add-new-pattern/index.js +25 -12
- package/src/components/add-new-template/utils.js +9 -6
- package/src/components/block-editor/constants.js +5 -1
- package/src/components/block-editor/editor-canvas.js +1 -1
- package/src/components/block-editor/index.js +0 -4
- package/src/components/block-editor/use-site-editor-settings.js +119 -20
- package/src/components/canvas-spinner/style.scss +14 -0
- package/src/components/code-editor/index.js +51 -33
- package/src/components/create-pattern-modal/index.js +5 -2
- package/src/components/editor/index.js +5 -5
- package/src/components/global-styles/global-styles-provider.js +7 -2
- package/src/components/global-styles/screen-block.js +15 -0
- package/src/components/global-styles/screen-revisions/index.js +64 -58
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +17 -31
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +14 -1
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +64 -48
- package/src/components/global-styles/style-variations-container.js +2 -0
- package/src/components/header-edit-mode/document-actions/index.js +8 -4
- package/src/components/header-edit-mode/document-actions/style.scss +45 -28
- package/src/components/header-edit-mode/index.js +29 -22
- package/src/components/keyboard-shortcuts/edit-mode.js +4 -5
- package/src/components/layout/index.js +49 -22
- package/src/components/layout/style.scss +4 -3
- package/src/components/page/index.js +8 -8
- package/src/components/page/style.scss +8 -5
- package/src/components/page-actions/index.js +2 -2
- package/src/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +9 -22
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
- package/src/components/page-patterns/duplicate-menu-item.js +196 -0
- package/src/components/page-patterns/grid-item.js +189 -133
- package/src/components/page-patterns/grid.js +3 -20
- package/src/components/page-patterns/header.js +69 -0
- package/src/components/page-patterns/index.js +6 -1
- package/src/components/page-patterns/pagination.js +80 -0
- package/src/components/page-patterns/patterns-list.js +172 -71
- package/src/components/page-patterns/rename-menu-item.js +115 -0
- package/src/components/page-patterns/style.scss +141 -30
- package/src/components/page-patterns/use-patterns.js +115 -169
- package/src/components/page-template-parts/add-new-template-part.js +57 -0
- package/src/components/page-template-parts/index.js +3 -23
- package/src/components/page-templates/index.js +6 -19
- package/src/components/resizable-frame/index.js +104 -51
- package/src/components/resizable-frame/style.scss +9 -9
- package/src/components/save-button/index.js +2 -0
- package/src/components/save-hub/index.js +6 -1
- package/src/components/save-hub/style.scss +1 -1
- package/src/components/save-panel/index.js +10 -4
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +2 -5
- package/src/components/sidebar-edit-mode/template-panel/index.js +15 -11
- package/src/components/sidebar-navigation-item/style.scss +5 -12
- package/src/components/sidebar-navigation-screen/index.js +30 -15
- package/src/components/sidebar-navigation-screen/style.scss +18 -0
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +48 -44
- package/src/components/sidebar-navigation-screen-main/index.js +44 -40
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +34 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +4 -3
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
- 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 +16 -7
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +27 -15
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -4
- package/src/components/sidebar-navigation-screen-page/index.js +3 -3
- package/src/components/sidebar-navigation-screen-page/status-label.js +1 -35
- package/src/components/sidebar-navigation-screen-pages/index.js +48 -33
- package/src/components/sidebar-navigation-screen-pattern/index.js +5 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +23 -3
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +74 -43
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -13
- package/src/components/sidebar-navigation-screen-patterns/index.js +103 -106
- package/src/components/sidebar-navigation-screen-patterns/style.scss +20 -0
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +7 -6
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +9 -0
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +31 -9
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
- package/src/components/sidebar-navigation-screen-templates/index.js +1 -9
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -0
- package/src/components/site-hub/index.js +48 -29
- package/src/components/site-hub/style.scss +14 -2
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -4
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
- package/src/components/table/style.scss +1 -0
- package/src/components/template-actions/index.js +2 -1
- package/src/components/template-actions/rename-menu-item.js +17 -10
- package/src/components/use-edited-entity-record/index.js +6 -1
- package/src/hooks/commands/use-common-commands.js +105 -32
- package/src/hooks/commands/use-edit-mode-commands.js +94 -23
- package/src/hooks/push-changes-to-global-styles/index.js +141 -50
- package/src/store/private-actions.js +10 -2
- package/src/style.scss +10 -12
- package/src/utils/normalize-record-key.js +11 -0
- package/src/utils/use-activate-theme.js +1 -1
- package/src/utils/use-debounced-input.js +8 -7
- package/build/components/code-editor/code-editor-text-area.js +0 -96
- package/build/components/code-editor/code-editor-text-area.js.map +0 -1
- package/build/components/keyboard-shortcuts/index.js +0 -148
- package/build/components/keyboard-shortcuts/index.js.map +0 -1
- package/build/components/page-actions/delete-page-menu-item.js.map +0 -1
- package/build/components/page-content-focus-manager/constants.js +0 -9
- package/build/components/page-content-focus-manager/constants.js.map +0 -1
- package/build-module/components/code-editor/code-editor-text-area.js +0 -84
- package/build-module/components/code-editor/code-editor-text-area.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/index.js +0 -132
- package/build-module/components/keyboard-shortcuts/index.js.map +0 -1
- package/build-module/components/page-actions/delete-page-menu-item.js.map +0 -1
- package/build-module/components/page-content-focus-manager/constants.js +0 -2
- package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
- package/src/components/code-editor/code-editor-text-area.js +0 -84
- package/src/components/keyboard-shortcuts/index.js +0 -137
- package/src/components/page-content-focus-manager/constants.js +0 -5
|
@@ -6,12 +6,15 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useState, useRef
|
|
9
|
+
import { useState, useRef } from '@wordpress/element';
|
|
10
10
|
import {
|
|
11
11
|
ResizableBox,
|
|
12
|
+
Tooltip,
|
|
12
13
|
__unstableMotion as motion,
|
|
13
14
|
} from '@wordpress/components';
|
|
14
|
-
import {
|
|
15
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
16
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
|
+
import { __ } from '@wordpress/i18n';
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Internal dependencies
|
|
@@ -33,7 +36,7 @@ const HANDLE_STYLES_OVERRIDE = {
|
|
|
33
36
|
};
|
|
34
37
|
|
|
35
38
|
// The minimum width of the frame (in px) while resizing.
|
|
36
|
-
const FRAME_MIN_WIDTH =
|
|
39
|
+
const FRAME_MIN_WIDTH = 320;
|
|
37
40
|
// The reference width of the frame (in px) used to calculate the aspect ratio.
|
|
38
41
|
const FRAME_REFERENCE_WIDTH = 1300;
|
|
39
42
|
// 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing.
|
|
@@ -42,6 +45,8 @@ const FRAME_TARGET_ASPECT_RATIO = 9 / 19.5;
|
|
|
42
45
|
// viewport's edge. If the frame is resized to be closer to the viewport's edge
|
|
43
46
|
// than this distance, then "canvas mode" will be enabled.
|
|
44
47
|
const SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200;
|
|
48
|
+
// Default size for the `frameSize` state.
|
|
49
|
+
const INITIAL_FRAME_SIZE = { width: '100%', height: '100%' };
|
|
45
50
|
|
|
46
51
|
function calculateNewHeight( width, initialAspectRatio ) {
|
|
47
52
|
const lerp = ( a, b, amount ) => {
|
|
@@ -73,34 +78,32 @@ function calculateNewHeight( width, initialAspectRatio ) {
|
|
|
73
78
|
|
|
74
79
|
function ResizableFrame( {
|
|
75
80
|
isFullWidth,
|
|
81
|
+
isOversized,
|
|
82
|
+
setIsOversized,
|
|
76
83
|
isReady,
|
|
77
84
|
children,
|
|
78
|
-
|
|
85
|
+
/** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */
|
|
86
|
+
defaultSize,
|
|
79
87
|
innerContentStyle,
|
|
80
88
|
} ) {
|
|
81
|
-
const [ frameSize, setFrameSize ] = useState(
|
|
82
|
-
width: '100%',
|
|
83
|
-
height: '100%',
|
|
84
|
-
} );
|
|
89
|
+
const [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );
|
|
85
90
|
// The width of the resizable frame when a new resize gesture starts.
|
|
86
91
|
const [ startingWidth, setStartingWidth ] = useState();
|
|
87
92
|
const [ isResizing, setIsResizing ] = useState( false );
|
|
88
|
-
const [
|
|
89
|
-
const [ isOversized, setIsOversized ] = useState( false );
|
|
93
|
+
const [ shouldShowHandle, setShouldShowHandle ] = useState( false );
|
|
90
94
|
const [ resizeRatio, setResizeRatio ] = useState( 1 );
|
|
95
|
+
const canvasMode = useSelect(
|
|
96
|
+
( select ) => unlock( select( editSiteStore ) ).getCanvasMode(),
|
|
97
|
+
[]
|
|
98
|
+
);
|
|
91
99
|
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
92
|
-
const initialAspectRatioRef = useRef( null );
|
|
93
|
-
// The width of the resizable frame on initial render.
|
|
94
|
-
const initialComputedWidthRef = useRef( null );
|
|
95
100
|
const FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };
|
|
96
101
|
const frameRef = useRef( null );
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
initialAspectRatioRef.current = offsetWidth / offsetHeight;
|
|
103
|
-
}, [] );
|
|
102
|
+
const resizableHandleHelpId = useInstanceId(
|
|
103
|
+
ResizableFrame,
|
|
104
|
+
'edit-site-resizable-frame-handle-help'
|
|
105
|
+
);
|
|
106
|
+
const defaultAspectRatio = defaultSize.width / defaultSize.height;
|
|
104
107
|
|
|
105
108
|
const handleResizeStart = ( _event, _direction, ref ) => {
|
|
106
109
|
// Remember the starting width so we don't have to get `ref.offsetWidth` on
|
|
@@ -116,7 +119,7 @@ function ResizableFrame( {
|
|
|
116
119
|
const maxDoubledDelta =
|
|
117
120
|
delta.width < 0 // is shrinking
|
|
118
121
|
? deltaAbs
|
|
119
|
-
: (
|
|
122
|
+
: ( defaultSize.width - startingWidth ) / 2;
|
|
120
123
|
const deltaToDouble = Math.min( deltaAbs, maxDoubledDelta );
|
|
121
124
|
const doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;
|
|
122
125
|
const singleSegment = 1 - doubleSegment;
|
|
@@ -125,17 +128,14 @@ function ResizableFrame( {
|
|
|
125
128
|
|
|
126
129
|
const updatedWidth = startingWidth + delta.width;
|
|
127
130
|
|
|
128
|
-
setIsOversized( updatedWidth >
|
|
131
|
+
setIsOversized( updatedWidth > defaultSize.width );
|
|
129
132
|
|
|
130
133
|
// Width will be controlled by the library (via `resizeRatio`),
|
|
131
134
|
// so we only need to update the height.
|
|
132
135
|
setFrameSize( {
|
|
133
136
|
height: isOversized
|
|
134
137
|
? '100%'
|
|
135
|
-
: calculateNewHeight(
|
|
136
|
-
updatedWidth,
|
|
137
|
-
initialAspectRatioRef.current
|
|
138
|
-
),
|
|
138
|
+
: calculateNewHeight( updatedWidth, defaultAspectRatio ),
|
|
139
139
|
} );
|
|
140
140
|
};
|
|
141
141
|
|
|
@@ -154,13 +154,37 @@ function ResizableFrame( {
|
|
|
154
154
|
if ( remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD ) {
|
|
155
155
|
// Reset the initial aspect ratio if the frame is resized slightly
|
|
156
156
|
// above the sidebar but not far enough to trigger full screen.
|
|
157
|
-
setFrameSize(
|
|
157
|
+
setFrameSize( INITIAL_FRAME_SIZE );
|
|
158
158
|
} else {
|
|
159
159
|
// Trigger full screen if the frame is resized far enough to the left.
|
|
160
160
|
setCanvasMode( 'edit' );
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
+
// Handle resize by arrow keys
|
|
165
|
+
const handleResizableHandleKeyDown = ( event ) => {
|
|
166
|
+
if ( ! [ 'ArrowLeft', 'ArrowRight' ].includes( event.key ) ) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
|
|
172
|
+
const step = 20 * ( event.shiftKey ? 5 : 1 );
|
|
173
|
+
const delta = step * ( event.key === 'ArrowLeft' ? 1 : -1 );
|
|
174
|
+
const newWidth = Math.min(
|
|
175
|
+
Math.max(
|
|
176
|
+
FRAME_MIN_WIDTH,
|
|
177
|
+
frameRef.current.resizable.offsetWidth + delta
|
|
178
|
+
),
|
|
179
|
+
defaultSize.width
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
setFrameSize( {
|
|
183
|
+
width: newWidth,
|
|
184
|
+
height: calculateNewHeight( newWidth, defaultAspectRatio ),
|
|
185
|
+
} );
|
|
186
|
+
};
|
|
187
|
+
|
|
164
188
|
const frameAnimationVariants = {
|
|
165
189
|
default: {
|
|
166
190
|
flexGrow: 0,
|
|
@@ -173,16 +197,26 @@ function ResizableFrame( {
|
|
|
173
197
|
};
|
|
174
198
|
|
|
175
199
|
const resizeHandleVariants = {
|
|
176
|
-
|
|
200
|
+
hidden: {
|
|
201
|
+
opacity: 0,
|
|
202
|
+
left: 0,
|
|
203
|
+
},
|
|
204
|
+
visible: {
|
|
177
205
|
opacity: 1,
|
|
178
206
|
left: -16,
|
|
179
207
|
},
|
|
180
|
-
|
|
208
|
+
active: {
|
|
181
209
|
opacity: 1,
|
|
182
210
|
left: -16,
|
|
183
211
|
scaleY: 1.3,
|
|
184
212
|
},
|
|
185
213
|
};
|
|
214
|
+
const currentResizeHandleVariant = ( () => {
|
|
215
|
+
if ( isResizing ) {
|
|
216
|
+
return 'active';
|
|
217
|
+
}
|
|
218
|
+
return shouldShowHandle ? 'visible' : 'hidden';
|
|
219
|
+
} )();
|
|
186
220
|
|
|
187
221
|
return (
|
|
188
222
|
<ResizableBox
|
|
@@ -217,35 +251,54 @@ function ResizableFrame( {
|
|
|
217
251
|
minWidth={ FRAME_MIN_WIDTH }
|
|
218
252
|
maxWidth={ isFullWidth ? '100%' : '150%' }
|
|
219
253
|
maxHeight={ '100%' }
|
|
220
|
-
|
|
221
|
-
|
|
254
|
+
onFocus={ () => setShouldShowHandle( true ) }
|
|
255
|
+
onBlur={ () => setShouldShowHandle( false ) }
|
|
256
|
+
onMouseOver={ () => setShouldShowHandle( true ) }
|
|
257
|
+
onMouseOut={ () => setShouldShowHandle( false ) }
|
|
222
258
|
handleComponent={ {
|
|
223
|
-
left:
|
|
224
|
-
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
259
|
+
left: canvasMode === 'view' && (
|
|
260
|
+
<>
|
|
261
|
+
<Tooltip text={ __( 'Drag to resize' ) }>
|
|
262
|
+
{ /* Disable reason: role="separator" does in fact support aria-valuenow */ }
|
|
263
|
+
{ /* eslint-disable-next-line jsx-a11y/role-supports-aria-props */ }
|
|
264
|
+
<motion.button
|
|
265
|
+
key="handle"
|
|
266
|
+
role="separator"
|
|
267
|
+
aria-orientation="vertical"
|
|
268
|
+
className={ classnames(
|
|
269
|
+
'edit-site-resizable-frame__handle',
|
|
270
|
+
{ 'is-resizing': isResizing }
|
|
271
|
+
) }
|
|
272
|
+
variants={ resizeHandleVariants }
|
|
273
|
+
animate={ currentResizeHandleVariant }
|
|
274
|
+
aria-label={ __( 'Drag to resize' ) }
|
|
275
|
+
aria-describedby={ resizableHandleHelpId }
|
|
276
|
+
aria-valuenow={
|
|
277
|
+
frameRef.current?.resizable?.offsetWidth ||
|
|
278
|
+
undefined
|
|
279
|
+
}
|
|
280
|
+
aria-valuemin={ FRAME_MIN_WIDTH }
|
|
281
|
+
aria-valuemax={ defaultSize.width }
|
|
282
|
+
onKeyDown={ handleResizableHandleKeyDown }
|
|
283
|
+
initial="hidden"
|
|
284
|
+
exit="hidden"
|
|
285
|
+
whileFocus="active"
|
|
286
|
+
whileHover="active"
|
|
287
|
+
/>
|
|
288
|
+
</Tooltip>
|
|
289
|
+
<div hidden id={ resizableHandleHelpId }>
|
|
290
|
+
{ __(
|
|
291
|
+
'Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.'
|
|
292
|
+
) }
|
|
293
|
+
</div>
|
|
294
|
+
</>
|
|
295
|
+
),
|
|
242
296
|
} }
|
|
243
297
|
onResizeStart={ handleResizeStart }
|
|
244
298
|
onResize={ handleResize }
|
|
245
299
|
onResizeStop={ handleResizeStop }
|
|
246
300
|
className={ classnames( 'edit-site-resizable-frame__inner', {
|
|
247
301
|
'is-resizing': isResizing,
|
|
248
|
-
[ oversizedClassName ]: isOversized,
|
|
249
302
|
} ) }
|
|
250
303
|
>
|
|
251
304
|
<motion.div
|
|
@@ -30,11 +30,13 @@
|
|
|
30
30
|
.edit-site-resizable-frame__handle {
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: rgba($gray-700, 0.4);
|
|
33
|
+
border: 0;
|
|
33
34
|
border-radius: $grid-unit-05;
|
|
34
35
|
cursor: col-resize;
|
|
35
36
|
display: flex;
|
|
36
37
|
height: $grid-unit-80;
|
|
37
38
|
justify-content: flex-end;
|
|
39
|
+
padding: 0;
|
|
38
40
|
position: absolute;
|
|
39
41
|
top: calc(50% - #{$grid-unit-40});
|
|
40
42
|
width: $grid-unit-05;
|
|
@@ -56,16 +58,14 @@
|
|
|
56
58
|
width: $grid-unit-40;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
&:
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
&:focus-visible {
|
|
62
|
+
// Works with Windows high contrast mode while also hiding weird outline in Safari.
|
|
63
|
+
outline: 2px solid transparent;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
color:
|
|
68
|
-
margin-right: $grid-unit-10;
|
|
69
|
-
padding: 4px 8px;
|
|
66
|
+
&:hover,
|
|
67
|
+
&:focus,
|
|
68
|
+
&.is-resizing {
|
|
69
|
+
background-color: var(--wp-admin-theme-color);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -19,6 +19,7 @@ export default function SaveButton( {
|
|
|
19
19
|
showTooltip = true,
|
|
20
20
|
defaultLabel,
|
|
21
21
|
icon,
|
|
22
|
+
__next40pxDefaultSize = false,
|
|
22
23
|
} ) {
|
|
23
24
|
const { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {
|
|
24
25
|
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
|
|
@@ -83,6 +84,7 @@ export default function SaveButton( {
|
|
|
83
84
|
*/
|
|
84
85
|
showTooltip={ showTooltip }
|
|
85
86
|
icon={ icon }
|
|
87
|
+
__next40pxDefaultSize={ __next40pxDefaultSize }
|
|
86
88
|
>
|
|
87
89
|
{ label }
|
|
88
90
|
</Button>
|
|
@@ -27,12 +27,13 @@ const PUBLISH_ON_SAVE_ENTITIES = [
|
|
|
27
27
|
];
|
|
28
28
|
|
|
29
29
|
export default function SaveHub() {
|
|
30
|
+
const saveNoticeId = 'site-edit-save-notice';
|
|
30
31
|
const { params } = useLocation();
|
|
31
32
|
|
|
32
33
|
const { __unstableMarkLastChangeAsPersistent } =
|
|
33
34
|
useDispatch( blockEditorStore );
|
|
34
35
|
|
|
35
|
-
const { createSuccessNotice, createErrorNotice } =
|
|
36
|
+
const { createSuccessNotice, createErrorNotice, removeNotice } =
|
|
36
37
|
useDispatch( noticesStore );
|
|
37
38
|
|
|
38
39
|
const { dirtyCurrentEntity, countUnsavedChanges, isDirty, isSaving } =
|
|
@@ -107,6 +108,7 @@ export default function SaveHub() {
|
|
|
107
108
|
const saveCurrentEntity = async () => {
|
|
108
109
|
if ( ! dirtyCurrentEntity ) return;
|
|
109
110
|
|
|
111
|
+
removeNotice( saveNoticeId );
|
|
110
112
|
const { kind, name, key, property } = dirtyCurrentEntity;
|
|
111
113
|
|
|
112
114
|
try {
|
|
@@ -132,6 +134,7 @@ export default function SaveHub() {
|
|
|
132
134
|
|
|
133
135
|
createSuccessNotice( __( 'Site updated.' ), {
|
|
134
136
|
type: 'snackbar',
|
|
137
|
+
id: saveNoticeId,
|
|
135
138
|
} );
|
|
136
139
|
} catch ( error ) {
|
|
137
140
|
createErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` );
|
|
@@ -148,6 +151,7 @@ export default function SaveHub() {
|
|
|
148
151
|
disabled={ isSaving }
|
|
149
152
|
aria-disabled={ isSaving }
|
|
150
153
|
className="edit-site-save-hub__button"
|
|
154
|
+
__next40pxDefaultSize
|
|
151
155
|
>
|
|
152
156
|
{ label }
|
|
153
157
|
</Button>
|
|
@@ -158,6 +162,7 @@ export default function SaveHub() {
|
|
|
158
162
|
showTooltip={ false }
|
|
159
163
|
icon={ disabled && ! isSaving ? check : null }
|
|
160
164
|
defaultLabel={ label }
|
|
165
|
+
__next40pxDefaultSize
|
|
161
166
|
/>
|
|
162
167
|
) }
|
|
163
168
|
</HStack>
|
|
@@ -39,13 +39,19 @@ const EntitiesSavedStatesForPreview = ( { onClose } ) => {
|
|
|
39
39
|
activateSaveLabel = __( 'Activate' );
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const themeName = useSelect( ( select ) => {
|
|
43
|
+
const theme = select( coreStore ).getTheme(
|
|
44
|
+
currentlyPreviewingTheme()
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return theme?.name?.rendered;
|
|
48
|
+
}, [] );
|
|
49
|
+
|
|
44
50
|
const additionalPrompt = (
|
|
45
51
|
<p>
|
|
46
52
|
{ sprintf(
|
|
47
|
-
'Saving your changes will change your active theme to
|
|
48
|
-
|
|
53
|
+
'Saving your changes will change your active theme to %s.',
|
|
54
|
+
themeName
|
|
49
55
|
) }
|
|
50
56
|
</p>
|
|
51
57
|
);
|
|
@@ -6,22 +6,24 @@ import {
|
|
|
6
6
|
store as blockEditorStore,
|
|
7
7
|
privateApis as blockEditorPrivateApis,
|
|
8
8
|
} from '@wordpress/block-editor';
|
|
9
|
+
import { useMemo } from '@wordpress/element';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Internal dependencies
|
|
12
13
|
*/
|
|
13
|
-
import { PAGE_CONTENT_BLOCK_TYPES } from '../../page-content-focus-manager/constants';
|
|
14
14
|
import { unlock } from '../../../lock-unlock';
|
|
15
15
|
|
|
16
16
|
const { BlockQuickNavigation } = unlock( blockEditorPrivateApis );
|
|
17
17
|
|
|
18
18
|
export default function PageContent() {
|
|
19
|
-
const
|
|
19
|
+
const clientIdsTree = useSelect(
|
|
20
20
|
( select ) =>
|
|
21
|
-
select( blockEditorStore ).
|
|
22
|
-
PAGE_CONTENT_BLOCK_TYPES
|
|
23
|
-
),
|
|
21
|
+
unlock( select( blockEditorStore ) ).getEnabledClientIdsTree(),
|
|
24
22
|
[]
|
|
25
23
|
);
|
|
24
|
+
const clientIds = useMemo(
|
|
25
|
+
() => clientIdsTree.map( ( { clientId } ) => clientId ),
|
|
26
|
+
[ clientIdsTree ]
|
|
27
|
+
);
|
|
26
28
|
return <BlockQuickNavigation clientIds={ clientIds } />;
|
|
27
29
|
}
|
|
@@ -212,13 +212,10 @@ export default function PageStatus( {
|
|
|
212
212
|
} )
|
|
213
213
|
}
|
|
214
214
|
value={ password }
|
|
215
|
-
/* eslint-disable jsx-a11y/no-autofocus */
|
|
216
|
-
autoFocus={ ! password }
|
|
217
|
-
/* eslint-enable jsx-a11y/no-autofocus */
|
|
218
215
|
placeholder={ __(
|
|
219
|
-
'
|
|
216
|
+
'Use a secure password'
|
|
220
217
|
) }
|
|
221
|
-
type="
|
|
218
|
+
type="text"
|
|
222
219
|
/>
|
|
223
220
|
) }
|
|
224
221
|
</BaseControl>
|
|
@@ -7,7 +7,7 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
7
7
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
8
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
|
-
import { navigation
|
|
10
|
+
import { navigation, symbol } from '@wordpress/icons';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
@@ -18,11 +18,13 @@ import TemplateAreas from './template-areas';
|
|
|
18
18
|
import LastRevision from './last-revision';
|
|
19
19
|
import SidebarCard from '../sidebar-card';
|
|
20
20
|
|
|
21
|
+
const CARD_ICONS = {
|
|
22
|
+
wp_block: symbol,
|
|
23
|
+
wp_navigation: navigation,
|
|
24
|
+
};
|
|
25
|
+
|
|
21
26
|
export default function TemplatePanel() {
|
|
22
|
-
const {
|
|
23
|
-
info: { title, description, icon },
|
|
24
|
-
record,
|
|
25
|
-
} = useSelect( ( select ) => {
|
|
27
|
+
const { title, description, icon, record } = useSelect( ( select ) => {
|
|
26
28
|
const { getEditedPostType, getEditedPostId } = select( editSiteStore );
|
|
27
29
|
const { getEditedEntityRecord } = select( coreStore );
|
|
28
30
|
const { __experimentalGetTemplateInfo: getTemplateInfo } =
|
|
@@ -31,10 +33,14 @@ export default function TemplatePanel() {
|
|
|
31
33
|
const postType = getEditedPostType();
|
|
32
34
|
const postId = getEditedPostId();
|
|
33
35
|
const _record = getEditedEntityRecord( 'postType', postType, postId );
|
|
36
|
+
const info = getTemplateInfo( _record );
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
return {
|
|
39
|
+
title: info.title,
|
|
40
|
+
description: info.description,
|
|
41
|
+
icon: info.icon,
|
|
42
|
+
record: _record,
|
|
43
|
+
};
|
|
38
44
|
}, [] );
|
|
39
45
|
|
|
40
46
|
if ( ! title && ! description ) {
|
|
@@ -46,9 +52,7 @@ export default function TemplatePanel() {
|
|
|
46
52
|
<SidebarCard
|
|
47
53
|
className="edit-site-template-card"
|
|
48
54
|
title={ decodeEntities( title ) }
|
|
49
|
-
icon={
|
|
50
|
-
record?.type === 'wp_navigation' ? navigationIcon : icon
|
|
51
|
-
}
|
|
55
|
+
icon={ CARD_ICONS[ record?.type ] ?? icon }
|
|
52
56
|
description={ decodeEntities( description ) }
|
|
53
57
|
actions={ <TemplateActions template={ record } /> }
|
|
54
58
|
>
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
&[aria-current] {
|
|
12
12
|
color: $gray-200;
|
|
13
13
|
background: $gray-800;
|
|
14
|
+
|
|
15
|
+
.edit-site-sidebar-navigation-item__drilldown-indicator {
|
|
16
|
+
fill: $gray-200;
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
&[aria-current] {
|
|
@@ -19,18 +23,7 @@
|
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
.edit-site-sidebar-navigation-item__drilldown-indicator {
|
|
22
|
-
fill: $gray-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&:is(a) {
|
|
26
|
-
text-decoration: none;
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
|
|
30
|
-
&:focus {
|
|
31
|
-
box-shadow: none;
|
|
32
|
-
outline: none;
|
|
33
|
-
}
|
|
26
|
+
fill: $gray-600;
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
&.with-suffix {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import {
|
|
5
10
|
__experimentalHStack as HStack,
|
|
6
11
|
__experimentalHeading as Heading,
|
|
7
|
-
__experimentalNavigatorToParentButton as NavigatorToParentButton,
|
|
8
12
|
__experimentalUseNavigator as useNavigator,
|
|
9
13
|
__experimentalVStack as VStack,
|
|
10
14
|
} from '@wordpress/components';
|
|
@@ -12,6 +16,7 @@ import { isRTL, __, sprintf } from '@wordpress/i18n';
|
|
|
12
16
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
13
17
|
import { store as coreStore } from '@wordpress/core-data';
|
|
14
18
|
import { useSelect } from '@wordpress/data';
|
|
19
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
* Internal dependencies
|
|
@@ -24,6 +29,8 @@ import {
|
|
|
24
29
|
currentlyPreviewingTheme,
|
|
25
30
|
} from '../../utils/is-previewing-theme';
|
|
26
31
|
|
|
32
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
33
|
+
|
|
27
34
|
export default function SidebarNavigationScreen( {
|
|
28
35
|
isRoot,
|
|
29
36
|
title,
|
|
@@ -32,7 +39,7 @@ export default function SidebarNavigationScreen( {
|
|
|
32
39
|
content,
|
|
33
40
|
footer,
|
|
34
41
|
description,
|
|
35
|
-
backPath,
|
|
42
|
+
backPath: backPathProp,
|
|
36
43
|
} ) {
|
|
37
44
|
const { dashboardLink } = useSelect( ( select ) => {
|
|
38
45
|
const { getSettings } = unlock( select( editSiteStore ) );
|
|
@@ -41,14 +48,20 @@ export default function SidebarNavigationScreen( {
|
|
|
41
48
|
};
|
|
42
49
|
}, [] );
|
|
43
50
|
const { getTheme } = useSelect( coreStore );
|
|
44
|
-
const
|
|
51
|
+
const location = useLocation();
|
|
52
|
+
const navigator = useNavigator();
|
|
45
53
|
const theme = getTheme( currentlyPreviewingTheme() );
|
|
46
54
|
const icon = isRTL() ? chevronRight : chevronLeft;
|
|
47
55
|
|
|
48
56
|
return (
|
|
49
57
|
<>
|
|
50
58
|
<VStack
|
|
51
|
-
className=
|
|
59
|
+
className={ classnames(
|
|
60
|
+
'edit-site-sidebar-navigation-screen__main',
|
|
61
|
+
{
|
|
62
|
+
'has-footer': !! footer,
|
|
63
|
+
}
|
|
64
|
+
) }
|
|
52
65
|
spacing={ 0 }
|
|
53
66
|
justify="flex-start"
|
|
54
67
|
>
|
|
@@ -57,17 +70,19 @@ export default function SidebarNavigationScreen( {
|
|
|
57
70
|
alignment="flex-start"
|
|
58
71
|
className="edit-site-sidebar-navigation-screen__title-icon"
|
|
59
72
|
>
|
|
60
|
-
{ ! isRoot &&
|
|
61
|
-
<NavigatorToParentButton
|
|
62
|
-
as={ SidebarButton }
|
|
63
|
-
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
64
|
-
label={ __( 'Back' ) }
|
|
65
|
-
showTooltip={ false }
|
|
66
|
-
/>
|
|
67
|
-
) }
|
|
68
|
-
{ ! isRoot && backPath && (
|
|
73
|
+
{ ! isRoot && (
|
|
69
74
|
<SidebarButton
|
|
70
|
-
onClick={ () =>
|
|
75
|
+
onClick={ () => {
|
|
76
|
+
const backPath =
|
|
77
|
+
backPathProp ?? location.state?.backPath;
|
|
78
|
+
if ( backPath ) {
|
|
79
|
+
navigator.goTo( backPath, {
|
|
80
|
+
isBack: true,
|
|
81
|
+
} );
|
|
82
|
+
} else {
|
|
83
|
+
navigator.goToParent();
|
|
84
|
+
}
|
|
85
|
+
} }
|
|
71
86
|
icon={ icon }
|
|
72
87
|
label={ __( 'Back' ) }
|
|
73
88
|
showTooltip={ false }
|
|
@@ -78,7 +93,7 @@ export default function SidebarNavigationScreen( {
|
|
|
78
93
|
icon={ icon }
|
|
79
94
|
label={
|
|
80
95
|
! isPreviewingTheme()
|
|
81
|
-
? __( 'Go
|
|
96
|
+
? __( 'Go to the Dashboard' )
|
|
82
97
|
: __( 'Go back to the theme showcase' )
|
|
83
98
|
}
|
|
84
99
|
href={
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
// Ensure the sidebar is always at least as tall as the viewport.
|
|
10
10
|
// This allows the footer section to be sticky at the bottom of the viewport.
|
|
11
11
|
flex-grow: 1;
|
|
12
|
+
margin-bottom: $grid-unit-20;
|
|
13
|
+
&.has-footer {
|
|
14
|
+
margin-bottom: 0;
|
|
15
|
+
}
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
.edit-site-sidebar-navigation-screen__content {
|
|
@@ -98,6 +102,20 @@
|
|
|
98
102
|
border-top: 1px solid $gray-800;
|
|
99
103
|
}
|
|
100
104
|
|
|
105
|
+
.edit-site-sidebar__notice {
|
|
106
|
+
background: $gray-800;
|
|
107
|
+
color: $gray-300;
|
|
108
|
+
margin: $grid-unit-30 0;
|
|
109
|
+
&.is-dismissible {
|
|
110
|
+
padding-right: $grid-unit-10;
|
|
111
|
+
}
|
|
112
|
+
.components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):focus,
|
|
113
|
+
.components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):active,
|
|
114
|
+
.components-notice__dismiss:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):hover {
|
|
115
|
+
color: $gray-100;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
101
119
|
/* In general style overrides are discouraged.
|
|
102
120
|
* This is a temporary solution to override the InputControl component's styles.
|
|
103
121
|
* The `Theme` component will potentially be the more appropriate approach
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
.edit-site-sidebar-navigation-details-screen-panel__label.edit-site-sidebar-navigation-details-screen-panel__label {
|
|
19
19
|
color: $gray-600;
|
|
20
20
|
width: 100px;
|
|
21
|
+
flex-shrink: 0;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
.edit-site-sidebar-navigation-details-screen-panel__value.edit-site-sidebar-navigation-details-screen-panel__value {
|