@wordpress/edit-site 5.13.0 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-page/index.js +1 -7
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +11 -11
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/new-template.js +69 -14
- package/build/components/add-new-template/new-template.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/inserter-media-categories.js +1 -22
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +29 -32
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +9 -12
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-spinner/index.js +1 -18
- package/build/components/canvas-spinner/index.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +9 -9
- package/build/components/create-pattern-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +11 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/ui.js +7 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +9 -1
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +41 -10
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +47 -17
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +17 -4
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +32 -1
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +9 -0
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +103 -26
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +1 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +3 -1
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/delete-page-menu-item.js +2 -1
- package/build/components/page-actions/delete-page-menu-item.js.map +1 -1
- package/build/components/page-content-focus-manager/back-to-page-notification.js +9 -3
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
- package/build/components/page-main/index.js +8 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/{page-library → page-patterns}/grid-item.js +61 -33
- package/build/components/page-patterns/grid-item.js.map +1 -0
- package/build/components/{page-library → page-patterns}/grid.js +1 -1
- package/build/components/page-patterns/grid.js.map +1 -0
- package/build/components/{page-library → page-patterns}/index.js +6 -6
- package/build/components/page-patterns/index.js.map +1 -0
- package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/build/components/page-patterns/no-patterns.js.map +1 -0
- package/build/components/{page-library → page-patterns}/patterns-list.js +9 -7
- package/build/components/page-patterns/patterns-list.js.map +1 -0
- package/build/components/page-patterns/search-items.js.map +1 -0
- package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
- package/build/components/{page-library → page-patterns}/use-patterns.js +12 -2
- package/build/components/page-patterns/use-patterns.js.map +1 -0
- package/build/components/{page-library → page-patterns}/utils.js +3 -3
- package/build/components/page-patterns/utils.js.map +1 -0
- package/build/components/page-template-parts/index.js +103 -0
- package/build/components/page-template-parts/index.js.map +1 -0
- package/build/components/page-templates/index.js +1 -0
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/preferences-modal/enable-feature.js +5 -1
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +43 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/index.js +6 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +4 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +7 -3
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +69 -5
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +2 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +6 -6
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +10 -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 +9 -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 -1
- 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 +29 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +13 -8
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +23 -0
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +55 -15
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +30 -0
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -20
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +1 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +22 -6
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/index.js +5 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +70 -0
- package/build/components/welcome-guide/page.js.map +1 -0
- package/build/components/welcome-guide/styles.js +1 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +71 -0
- package/build/components/welcome-guide/template.js.map +1 -0
- package/build/hooks/commands/use-common-commands.js +37 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +195 -44
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +9 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +5 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +2 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +2 -2
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/template-part-create.js +2 -2
- package/build/utils/template-part-create.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 +11 -11
- 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 +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/new-template.js +72 -17
- package/build-module/components/add-new-template/new-template.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/inserter-media-categories.js +1 -22
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +29 -32
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +9 -12
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-spinner/index.js +1 -15
- package/build-module/components/canvas-spinner/index.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +9 -9
- package/build-module/components/create-pattern-modal/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -1
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +11 -1
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/ui.js +8 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +43 -12
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +44 -20
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +15 -6
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +29 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +9 -0
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +103 -26
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +2 -1
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-actions/delete-page-menu-item.js +2 -1
- package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -1
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js +9 -3
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
- package/build-module/components/page-main/index.js +6 -3
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/{page-library → page-patterns}/grid-item.js +65 -35
- package/build-module/components/page-patterns/grid-item.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/grid.js +1 -1
- package/build-module/components/page-patterns/grid.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/index.js +5 -5
- package/build-module/components/page-patterns/index.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/build-module/components/page-patterns/no-patterns.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/patterns-list.js +9 -7
- package/build-module/components/page-patterns/patterns-list.js.map +1 -0
- package/build-module/components/page-patterns/search-items.js.map +1 -0
- package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/use-patterns.js +12 -2
- package/build-module/components/page-patterns/use-patterns.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
- package/build-module/components/page-patterns/utils.js.map +1 -0
- package/build-module/components/page-template-parts/index.js +82 -0
- package/build-module/components/page-template-parts/index.js.map +1 -0
- package/build-module/components/page-templates/index.js +1 -0
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-feature.js +5 -1
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +38 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +5 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +4 -2
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +7 -3
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +67 -5
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +5 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +11 -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 +8 -4
- 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 -1
- 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 +20 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +26 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
- 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 +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +12 -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 +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/use-pattern-details.js +21 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +54 -16
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +20 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -17
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +1 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- 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 +24 -7
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +3 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +59 -0
- package/build-module/components/welcome-guide/page.js.map +1 -0
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +60 -0
- package/build-module/components/welcome-guide/template.js.map +1 -0
- package/build-module/hooks/commands/use-common-commands.js +37 -1
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +193 -46
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +4 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +5 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +2 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +2 -2
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/template-part-create.js +1 -1
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-style/style-rtl.css +167 -51
- package/build-style/style.css +167 -51
- package/package.json +39 -39
- package/src/components/add-new-page/index.js +1 -6
- package/src/components/add-new-pattern/index.js +11 -13
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
- package/src/components/add-new-template/new-template.js +120 -24
- package/src/components/add-new-template/style.scss +30 -2
- package/src/components/block-editor/editor-canvas.js +3 -1
- package/src/components/block-editor/inserter-media-categories.js +1 -21
- package/src/components/block-editor/site-editor-canvas.js +7 -1
- package/src/components/block-editor/use-site-editor-settings.js +8 -12
- package/src/components/canvas-spinner/index.js +1 -11
- package/src/components/canvas-spinner/style.scss +4 -0
- package/src/components/create-pattern-modal/index.js +11 -12
- package/src/components/create-template-part-modal/index.js +1 -1
- package/src/components/editor/index.js +16 -1
- package/src/components/editor/style.scss +4 -0
- package/src/components/global-styles/palette.js +10 -9
- package/src/components/global-styles/stories/index.js +1 -0
- package/src/components/global-styles/ui.js +34 -24
- package/src/components/header-edit-mode/document-actions/index.js +9 -1
- package/src/components/header-edit-mode/document-actions/style.scss +8 -0
- package/src/components/header-edit-mode/index.js +112 -62
- package/src/components/header-edit-mode/more-menu/index.js +74 -30
- package/src/components/keyboard-shortcut-help-modal/index.js +21 -7
- package/src/components/keyboard-shortcuts/edit-mode.js +35 -2
- package/src/components/keyboard-shortcuts/register.js +10 -0
- package/src/components/layout/index.js +140 -76
- package/src/components/layout/style.scss +47 -1
- package/src/components/page/header.js +1 -1
- package/src/components/page/index.js +5 -1
- package/src/components/page-actions/delete-page-menu-item.js +1 -0
- package/src/components/page-content-focus-manager/back-to-page-notification.js +7 -2
- package/src/components/page-main/index.js +6 -3
- package/src/components/{page-library → page-patterns}/grid-item.js +83 -34
- package/src/components/{page-library → page-patterns}/grid.js +1 -1
- package/src/components/{page-library → page-patterns}/index.js +5 -5
- package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/src/components/{page-library → page-patterns}/patterns-list.js +13 -9
- package/src/components/{page-library → page-patterns}/style.scss +19 -15
- package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
- package/src/components/{page-library → page-patterns}/use-patterns.js +11 -2
- package/src/components/{page-library → page-patterns}/utils.js +3 -3
- package/src/components/page-template-parts/index.js +105 -0
- package/src/components/page-templates/index.js +1 -1
- package/src/components/preferences-modal/enable-feature.js +5 -2
- package/src/components/preferences-modal/index.js +35 -4
- package/src/components/sidebar/index.js +6 -6
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/index.js +4 -2
- package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
- package/src/components/sidebar-navigation-item/style.scss +2 -1
- package/src/components/sidebar-navigation-screen/index.js +4 -2
- package/src/components/sidebar-navigation-screen/style.scss +7 -2
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +57 -17
- package/src/components/sidebar-navigation-screen-main/index.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +9 -8
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +12 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +5 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +39 -8
- package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
- package/src/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/src/components/sidebar-navigation-screen-pages/index.js +2 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +13 -6
- package/src/components/sidebar-navigation-screen-pattern/style.scss +29 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +43 -1
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +75 -22
- package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +23 -0
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +1 -18
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
- package/src/components/sidebar-navigation-screen-template/style.scss +15 -15
- package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
- package/src/components/site-hub/index.js +1 -1
- package/src/components/site-hub/style.scss +4 -3
- package/src/components/start-template-options/style.scss +0 -3
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/src/components/template-actions/index.js +38 -8
- package/src/components/welcome-guide/editor.js +1 -1
- package/src/components/welcome-guide/index.js +4 -0
- package/src/components/welcome-guide/page.js +75 -0
- package/src/components/welcome-guide/style.scss +15 -1
- package/src/components/welcome-guide/styles.js +1 -1
- package/src/components/welcome-guide/template.js +82 -0
- package/src/hooks/commands/use-common-commands.js +32 -1
- package/src/hooks/commands/use-edit-mode-commands.js +182 -38
- package/src/index.js +4 -0
- package/src/store/actions.js +8 -1
- package/src/store/selectors.js +5 -0
- package/src/store/test/selectors.js +2 -0
- package/src/style.scss +3 -2
- package/src/utils/get-is-list-page.js +4 -3
- package/src/utils/template-part-create.js +1 -1
- package/build/components/page-library/grid-item.js.map +0 -1
- package/build/components/page-library/grid.js.map +0 -1
- package/build/components/page-library/index.js.map +0 -1
- package/build/components/page-library/no-patterns.js.map +0 -1
- package/build/components/page-library/patterns-list.js.map +0 -1
- package/build/components/page-library/search-items.js.map +0 -1
- package/build/components/page-library/use-library-settings.js.map +0 -1
- package/build/components/page-library/use-patterns.js.map +0 -1
- package/build/components/page-library/utils.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
- package/build-module/components/page-library/grid-item.js.map +0 -1
- package/build-module/components/page-library/grid.js.map +0 -1
- package/build-module/components/page-library/index.js.map +0 -1
- package/build-module/components/page-library/no-patterns.js.map +0 -1
- package/build-module/components/page-library/patterns-list.js.map +0 -1
- package/build-module/components/page-library/search-items.js.map +0 -1
- package/build-module/components/page-library/use-library-settings.js.map +0 -1
- package/build-module/components/page-library/use-patterns.js.map +0 -1
- package/build-module/components/page-library/utils.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
- package/src/components/sidebar-navigation-screen-library/style.scss +0 -7
- /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
- /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
- /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
|
@@ -15,6 +15,8 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
15
15
|
import { BlockEditorProvider } from '@wordpress/block-editor';
|
|
16
16
|
import { humanTimeDiff } from '@wordpress/date';
|
|
17
17
|
import { useCallback } from '@wordpress/element';
|
|
18
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
19
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* Internal dependencies
|
|
@@ -33,6 +35,24 @@ const noop = () => {};
|
|
|
33
35
|
export function SidebarNavigationItemGlobalStyles( props ) {
|
|
34
36
|
const { openGeneralSidebar } = useDispatch( editSiteStore );
|
|
35
37
|
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
38
|
+
const { createNotice } = useDispatch( noticesStore );
|
|
39
|
+
const { set: setPreference } = useDispatch( preferencesStore );
|
|
40
|
+
const { get: getPrefference } = useSelect( preferencesStore );
|
|
41
|
+
|
|
42
|
+
const turnOffDistractionFreeMode = useCallback( () => {
|
|
43
|
+
const isDistractionFree = getPrefference(
|
|
44
|
+
editSiteStore.name,
|
|
45
|
+
'distractionFree'
|
|
46
|
+
);
|
|
47
|
+
if ( ! isDistractionFree ) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
setPreference( editSiteStore.name, 'distractionFree', false );
|
|
51
|
+
createNotice( 'info', __( 'Distraction free mode turned off' ), {
|
|
52
|
+
isDismissible: true,
|
|
53
|
+
type: 'snackbar',
|
|
54
|
+
} );
|
|
55
|
+
}, [ createNotice, setPreference, getPrefference ] );
|
|
36
56
|
const hasGlobalStyleVariations = useSelect(
|
|
37
57
|
( select ) =>
|
|
38
58
|
!! select(
|
|
@@ -53,9 +73,10 @@ export function SidebarNavigationItemGlobalStyles( props ) {
|
|
|
53
73
|
<SidebarNavigationItem
|
|
54
74
|
{ ...props }
|
|
55
75
|
onClick={ () => {
|
|
56
|
-
|
|
76
|
+
turnOffDistractionFreeMode();
|
|
77
|
+
// Switch to edit mode.
|
|
57
78
|
setCanvasMode( 'edit' );
|
|
58
|
-
//
|
|
79
|
+
// Open global styles sidebar.
|
|
59
80
|
openGeneralSidebar( 'edit-site/global-styles' );
|
|
60
81
|
} }
|
|
61
82
|
/>
|
|
@@ -147,22 +168,41 @@ export default function SidebarNavigationScreenGlobalStyles() {
|
|
|
147
168
|
const { setCanvasMode, setEditorCanvasContainerView } = unlock(
|
|
148
169
|
useDispatch( editSiteStore )
|
|
149
170
|
);
|
|
171
|
+
const { createNotice } = useDispatch( noticesStore );
|
|
172
|
+
const { set: setPreference } = useDispatch( preferencesStore );
|
|
173
|
+
const { get: getPrefference } = useSelect( preferencesStore );
|
|
174
|
+
const { isViewMode, isStyleBookOpened } = useSelect( ( select ) => {
|
|
175
|
+
const { getCanvasMode, getEditorCanvasContainerView } = unlock(
|
|
176
|
+
select( editSiteStore )
|
|
177
|
+
);
|
|
178
|
+
return {
|
|
179
|
+
isViewMode: 'view' === getCanvasMode(),
|
|
180
|
+
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
181
|
+
};
|
|
182
|
+
}, [] );
|
|
150
183
|
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
184
|
+
const turnOffDistractionFreeMode = useCallback( () => {
|
|
185
|
+
const isDistractionFree = getPrefference(
|
|
186
|
+
editSiteStore.name,
|
|
187
|
+
'distractionFree'
|
|
188
|
+
);
|
|
189
|
+
if ( ! isDistractionFree ) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
setPreference( editSiteStore.name, 'distractionFree', false );
|
|
193
|
+
createNotice( 'info', __( 'Distraction free mode turned off' ), {
|
|
194
|
+
isDismissible: true,
|
|
195
|
+
type: 'snackbar',
|
|
196
|
+
} );
|
|
197
|
+
}, [ createNotice, setPreference, getPrefference ] );
|
|
157
198
|
|
|
158
|
-
const openGlobalStyles = useCallback(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
);
|
|
199
|
+
const openGlobalStyles = useCallback( async () => {
|
|
200
|
+
turnOffDistractionFreeMode();
|
|
201
|
+
return Promise.all( [
|
|
202
|
+
setCanvasMode( 'edit' ),
|
|
203
|
+
openGeneralSidebar( 'edit-site/global-styles' ),
|
|
204
|
+
] );
|
|
205
|
+
}, [ setCanvasMode, openGeneralSidebar, turnOffDistractionFreeMode ] );
|
|
166
206
|
|
|
167
207
|
const openStyleBook = useCallback( async () => {
|
|
168
208
|
await openGlobalStyles();
|
|
@@ -223,7 +263,7 @@ export default function SidebarNavigationScreenGlobalStyles() {
|
|
|
223
263
|
</>
|
|
224
264
|
}
|
|
225
265
|
/>
|
|
226
|
-
{ isStyleBookOpened && ! isMobileViewport && (
|
|
266
|
+
{ isStyleBookOpened && ! isMobileViewport && isViewMode && (
|
|
227
267
|
<StyleBook
|
|
228
268
|
enableResizing={ false }
|
|
229
269
|
isSelected={ () => false }
|
|
@@ -75,11 +75,11 @@ export default function SidebarNavigationScreenMain() {
|
|
|
75
75
|
</NavigatorButton>
|
|
76
76
|
<NavigatorButton
|
|
77
77
|
as={ SidebarNavigationItem }
|
|
78
|
-
path="/
|
|
78
|
+
path="/patterns"
|
|
79
79
|
withChevron
|
|
80
80
|
icon={ symbol }
|
|
81
81
|
>
|
|
82
|
-
{ __( '
|
|
82
|
+
{ __( 'Patterns' ) }
|
|
83
83
|
</NavigatorButton>
|
|
84
84
|
</ItemGroup>
|
|
85
85
|
}
|
|
@@ -1,45 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalHStack as HStack,
|
|
6
|
-
__experimentalVStack as VStack,
|
|
7
|
-
Button,
|
|
8
|
-
Modal,
|
|
9
|
-
} from '@wordpress/components';
|
|
4
|
+
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
10
5
|
import { __ } from '@wordpress/i18n';
|
|
11
6
|
|
|
12
7
|
export default function RenameModal( { onClose, onConfirm } ) {
|
|
13
8
|
return (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'Are you sure you want to delete this Navigation menu?'
|
|
20
|
-
) }
|
|
21
|
-
</p>
|
|
22
|
-
<HStack justify="right">
|
|
23
|
-
<Button variant="tertiary" onClick={ onClose }>
|
|
24
|
-
{ __( 'Cancel' ) }
|
|
25
|
-
</Button>
|
|
9
|
+
<ConfirmDialog
|
|
10
|
+
isOpen={ true }
|
|
11
|
+
onConfirm={ ( e ) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
onConfirm();
|
|
26
14
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onClose();
|
|
36
|
-
} }
|
|
37
|
-
>
|
|
38
|
-
{ __( 'Delete' ) }
|
|
39
|
-
</Button>
|
|
40
|
-
</HStack>
|
|
41
|
-
</VStack>
|
|
42
|
-
</form>
|
|
43
|
-
</Modal>
|
|
15
|
+
// Immediate close avoids ability to hit delete multiple times.
|
|
16
|
+
onClose();
|
|
17
|
+
} }
|
|
18
|
+
onCancel={ onClose }
|
|
19
|
+
confirmButtonText={ __( 'Delete' ) }
|
|
20
|
+
>
|
|
21
|
+
{ __( 'Are you sure you want to delete this Navigation menu?' ) }
|
|
22
|
+
</ConfirmDialog>
|
|
44
23
|
);
|
|
45
24
|
}
|
|
@@ -2,23 +2,20 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { useDispatch } from '@wordpress/data';
|
|
6
5
|
import { pencil } from '@wordpress/icons';
|
|
7
6
|
/**
|
|
8
7
|
* Internal dependencies
|
|
9
8
|
*/
|
|
10
|
-
import { store as editSiteStore } from '../../store';
|
|
11
9
|
import SidebarButton from '../sidebar-button';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
export default function EditButton() {
|
|
15
|
-
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
10
|
+
import { useLink } from '../routes/link';
|
|
16
11
|
|
|
12
|
+
export default function EditButton( { postId } ) {
|
|
13
|
+
const linkInfo = useLink( {
|
|
14
|
+
postId,
|
|
15
|
+
postType: 'wp_navigation',
|
|
16
|
+
canvas: 'edit',
|
|
17
|
+
} );
|
|
17
18
|
return (
|
|
18
|
-
<SidebarButton
|
|
19
|
-
onClick={ () => setCanvasMode( 'edit' ) }
|
|
20
|
-
label={ __( 'Edit' ) }
|
|
21
|
-
icon={ pencil }
|
|
22
|
-
/>
|
|
19
|
+
<SidebarButton { ...linkInfo } label={ __( 'Edit' ) } icon={ pencil } />
|
|
23
20
|
);
|
|
24
21
|
}
|
|
@@ -17,6 +17,7 @@ import { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-nav
|
|
|
17
17
|
import ScreenNavigationMoreMenu from './more-menu';
|
|
18
18
|
import SingleNavigationMenu from './single-navigation-menu';
|
|
19
19
|
import useNavigationMenuHandlers from './use-navigation-menu-handlers';
|
|
20
|
+
import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';
|
|
20
21
|
|
|
21
22
|
export const postType = `wp_navigation`;
|
|
22
23
|
|
|
@@ -33,11 +34,8 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
33
34
|
|
|
34
35
|
const { isSaving, isDeleting } = useSelect(
|
|
35
36
|
( select ) => {
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
isDeletingEntityRecord,
|
|
39
|
-
getEditedEntityRecord: getEditedEntityRecordSelector,
|
|
40
|
-
} = select( coreStore );
|
|
37
|
+
const { isSavingEntityRecord, isDeletingEntityRecord } =
|
|
38
|
+
select( coreStore );
|
|
41
39
|
|
|
42
40
|
return {
|
|
43
41
|
isSaving: isSavingEntityRecord( 'postType', postType, postId ),
|
|
@@ -46,7 +44,6 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
46
44
|
postType,
|
|
47
45
|
postId
|
|
48
46
|
),
|
|
49
|
-
getEditedEntityRecord: getEditedEntityRecordSelector,
|
|
50
47
|
};
|
|
51
48
|
},
|
|
52
49
|
[ postId ]
|
|
@@ -60,7 +57,7 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
60
57
|
useNavigationMenuHandlers();
|
|
61
58
|
|
|
62
59
|
const _handleDelete = () => handleDelete( navigationMenu );
|
|
63
|
-
const _handleSave = () => handleSave( navigationMenu );
|
|
60
|
+
const _handleSave = ( edits ) => handleSave( navigationMenu, edits );
|
|
64
61
|
const _handleDuplicate = () => handleDuplicate( navigationMenu );
|
|
65
62
|
|
|
66
63
|
if ( isLoading ) {
|
|
@@ -94,7 +91,11 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
94
91
|
onDuplicate={ _handleDuplicate }
|
|
95
92
|
/>
|
|
96
93
|
}
|
|
97
|
-
title={
|
|
94
|
+
title={ buildNavigationLabel(
|
|
95
|
+
navigationMenu?.title,
|
|
96
|
+
navigationMenu?.id,
|
|
97
|
+
navigationMenu?.status
|
|
98
|
+
) }
|
|
98
99
|
description={ __( 'This Navigation Menu is empty.' ) }
|
|
99
100
|
/>
|
|
100
101
|
);
|
|
@@ -11,9 +11,16 @@ import {
|
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { useState } from '@wordpress/element';
|
|
13
13
|
|
|
14
|
+
const notEmptyString = ( testString ) => testString?.trim()?.length > 0;
|
|
15
|
+
|
|
14
16
|
export default function RenameModal( { menuTitle, onClose, onSave } ) {
|
|
15
17
|
const [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );
|
|
16
18
|
|
|
19
|
+
const titleHasChanged = editedMenuTitle !== menuTitle;
|
|
20
|
+
|
|
21
|
+
const isEditedMenuTitleValid =
|
|
22
|
+
titleHasChanged && notEmptyString( editedMenuTitle );
|
|
23
|
+
|
|
17
24
|
return (
|
|
18
25
|
<Modal title={ __( 'Rename' ) } onRequestClose={ onClose }>
|
|
19
26
|
<form className="sidebar-navigation__rename-modal-form">
|
|
@@ -30,11 +37,15 @@ export default function RenameModal( { menuTitle, onClose, onSave } ) {
|
|
|
30
37
|
</Button>
|
|
31
38
|
|
|
32
39
|
<Button
|
|
33
|
-
disabled={
|
|
40
|
+
disabled={ ! isEditedMenuTitleValid }
|
|
34
41
|
variant="primary"
|
|
35
42
|
type="submit"
|
|
36
43
|
onClick={ ( e ) => {
|
|
37
44
|
e.preventDefault();
|
|
45
|
+
|
|
46
|
+
if ( ! isEditedMenuTitleValid ) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
38
49
|
onSave( { title: editedMenuTitle } );
|
|
39
50
|
|
|
40
51
|
// Immediate close avoids ability to hit save multiple times.
|
|
@@ -9,6 +9,8 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
9
9
|
import { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';
|
|
10
10
|
import ScreenNavigationMoreMenu from './more-menu';
|
|
11
11
|
import NavigationMenuEditor from './navigation-menu-editor';
|
|
12
|
+
import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';
|
|
13
|
+
import EditButton from './edit-button';
|
|
12
14
|
|
|
13
15
|
export default function SingleNavigationMenu( {
|
|
14
16
|
navigationMenu,
|
|
@@ -21,14 +23,21 @@ export default function SingleNavigationMenu( {
|
|
|
21
23
|
return (
|
|
22
24
|
<SidebarNavigationScreenWrapper
|
|
23
25
|
actions={
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
<>
|
|
27
|
+
<EditButton postId={ navigationMenu?.id } />
|
|
28
|
+
<ScreenNavigationMoreMenu
|
|
29
|
+
menuTitle={ decodeEntities( menuTitle ) }
|
|
30
|
+
onDelete={ handleDelete }
|
|
31
|
+
onSave={ handleSave }
|
|
32
|
+
onDuplicate={ handleDuplicate }
|
|
33
|
+
/>
|
|
34
|
+
</>
|
|
30
35
|
}
|
|
31
|
-
title={
|
|
36
|
+
title={ buildNavigationLabel(
|
|
37
|
+
navigationMenu?.title,
|
|
38
|
+
navigationMenu?.id,
|
|
39
|
+
navigationMenu?.status
|
|
40
|
+
) }
|
|
32
41
|
description={ __(
|
|
33
42
|
'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'
|
|
34
43
|
) }
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
.sidebar-navigation__more-menu {
|
|
2
2
|
.components-button {
|
|
3
|
-
color: $gray-
|
|
3
|
+
color: $gray-200;
|
|
4
4
|
&:hover,
|
|
5
5
|
&:focus,
|
|
6
6
|
&[aria-current] {
|
|
7
|
-
color: $
|
|
7
|
+
color: $gray-100;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
.sidebar-navigation__rename-modal-form {
|
|
13
|
-
// Fix for input focus style being cut off by the modal.
|
|
14
|
-
padding-top: 1px;
|
|
15
|
-
}
|
package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js
CHANGED
|
@@ -71,7 +71,11 @@ function useSaveNavigationMenu() {
|
|
|
71
71
|
const { createSuccessNotice, createErrorNotice } =
|
|
72
72
|
useDispatch( noticesStore );
|
|
73
73
|
|
|
74
|
-
const handleSave = async ( navigationMenu, edits
|
|
74
|
+
const handleSave = async ( navigationMenu, edits ) => {
|
|
75
|
+
if ( ! edits ) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
const postId = navigationMenu?.id;
|
|
76
80
|
// Prepare for revert in case of error.
|
|
77
81
|
const originalRecord = getEditedEntityRecord(
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
6
|
+
|
|
7
|
+
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
8
|
+
export default function buildNavigationLabel( title, id, status ) {
|
|
9
|
+
if ( ! title?.rendered ) {
|
|
10
|
+
/* translators: %s is the index of the menu in the list of menus. */
|
|
11
|
+
return sprintf( __( '(no title %s)' ), id );
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if ( status === 'publish' ) {
|
|
15
|
+
return decodeEntities( title?.rendered );
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return sprintf(
|
|
19
|
+
// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
|
|
20
|
+
__( '%1$s (%2$s)' ),
|
|
21
|
+
decodeEntities( title?.rendered ),
|
|
22
|
+
status
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
-
import { useEntityRecords } from '@wordpress/core-data';
|
|
5
|
+
import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
6
7
|
|
|
7
8
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
9
|
import {
|
|
@@ -20,6 +21,7 @@ import { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';
|
|
|
20
21
|
import { useLink } from '../routes/link';
|
|
21
22
|
import SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';
|
|
22
23
|
import useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';
|
|
24
|
+
import { unlock } from '../../lock-unlock';
|
|
23
25
|
|
|
24
26
|
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
25
27
|
function buildMenuLabel( title, id, status ) {
|
|
@@ -40,16 +42,43 @@ function buildMenuLabel( title, id, status ) {
|
|
|
40
42
|
);
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
// Save a boolean to prevent us creating a fallback more than once per session.
|
|
46
|
+
let hasCreatedFallback = false;
|
|
47
|
+
|
|
43
48
|
export default function SidebarNavigationScreenNavigationMenus() {
|
|
44
|
-
const {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
const {
|
|
50
|
+
records: navigationMenus,
|
|
51
|
+
isResolving: isResolvingNavigationMenus,
|
|
52
|
+
hasResolved: hasResolvedNavigationMenus,
|
|
53
|
+
} = useEntityRecords(
|
|
54
|
+
'postType',
|
|
55
|
+
`wp_navigation`,
|
|
56
|
+
PRELOADED_NAVIGATION_MENUS_QUERY
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const isLoading =
|
|
60
|
+
isResolvingNavigationMenus && ! hasResolvedNavigationMenus;
|
|
61
|
+
|
|
62
|
+
const { getNavigationFallbackId } = unlock( useSelect( coreStore ) );
|
|
50
63
|
|
|
51
64
|
const firstNavigationMenu = navigationMenus?.[ 0 ];
|
|
52
65
|
|
|
66
|
+
// Save a boolean to prevent us creating a fallback more than once per session.
|
|
67
|
+
if ( firstNavigationMenu ) {
|
|
68
|
+
hasCreatedFallback = true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// If there is no navigation menu found
|
|
72
|
+
// then trigger fallback algorithm to create one.
|
|
73
|
+
if (
|
|
74
|
+
! firstNavigationMenu &&
|
|
75
|
+
! isResolvingNavigationMenus &&
|
|
76
|
+
hasResolvedNavigationMenus &&
|
|
77
|
+
! hasCreatedFallback
|
|
78
|
+
) {
|
|
79
|
+
getNavigationFallbackId();
|
|
80
|
+
}
|
|
81
|
+
|
|
53
82
|
const { handleSave, handleDelete, handleDuplicate } =
|
|
54
83
|
useNavigationMenuHandlers();
|
|
55
84
|
|
|
@@ -78,7 +107,9 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
78
107
|
navigationMenu={ firstNavigationMenu }
|
|
79
108
|
handleDelete={ () => handleDelete( firstNavigationMenu ) }
|
|
80
109
|
handleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }
|
|
81
|
-
handleSave={ (
|
|
110
|
+
handleSave={ ( edits ) =>
|
|
111
|
+
handleSave( firstNavigationMenu, edits )
|
|
112
|
+
}
|
|
82
113
|
/>
|
|
83
114
|
);
|
|
84
115
|
}
|
|
@@ -76,7 +76,7 @@ function getPageDetails( page ) {
|
|
|
76
76
|
: 0;
|
|
77
77
|
const readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );
|
|
78
78
|
|
|
79
|
-
if ( wordsCounted ) {
|
|
79
|
+
if ( wordsCounted && ! page?.isPostsPage ) {
|
|
80
80
|
details.push(
|
|
81
81
|
{
|
|
82
82
|
label: __( 'Words' ),
|
|
@@ -100,7 +100,7 @@ function getPageDetails( page ) {
|
|
|
100
100
|
|
|
101
101
|
export default function PageDetails( { id } ) {
|
|
102
102
|
const { record } = useEntityRecord( 'postType', 'page', id );
|
|
103
|
-
const { parentTitle, templateTitle } = useSelect(
|
|
103
|
+
const { parentTitle, templateTitle, isPostsPage } = useSelect(
|
|
104
104
|
( select ) => {
|
|
105
105
|
const { getEditedPostContext } = unlock( select( editSiteStore ) );
|
|
106
106
|
const postContext = getEditedPostContext();
|
|
@@ -135,12 +135,16 @@ export default function PageDetails( { id } ) {
|
|
|
135
135
|
)?.title?.rendered
|
|
136
136
|
: null;
|
|
137
137
|
|
|
138
|
+
const { getEntityRecord } = select( coreStore );
|
|
139
|
+
const siteSettings = getEntityRecord( 'root', 'site' );
|
|
140
|
+
|
|
138
141
|
return {
|
|
139
142
|
parentTitle: _parentTitle,
|
|
140
143
|
templateTitle: _templateTitle,
|
|
144
|
+
isPostsPage: record?.id === siteSettings?.page_for_posts,
|
|
141
145
|
};
|
|
142
146
|
},
|
|
143
|
-
[ record?.parent ]
|
|
147
|
+
[ record?.parent, record?.id ]
|
|
144
148
|
);
|
|
145
149
|
return (
|
|
146
150
|
<SidebarNavigationScreenDetailsPanel
|
|
@@ -150,6 +154,7 @@ export default function PageDetails( { id } ) {
|
|
|
150
154
|
{ getPageDetails( {
|
|
151
155
|
parentTitle,
|
|
152
156
|
templateTitle,
|
|
157
|
+
isPostsPage,
|
|
153
158
|
...record,
|
|
154
159
|
} ).map( ( { label, value } ) => (
|
|
155
160
|
<SidebarNavigationScreenDetailsPanelRow key={ label }>
|
|
@@ -43,7 +43,7 @@ const pendingIcon = (
|
|
|
43
43
|
|
|
44
44
|
export default function StatusLabel( { status, date, short } ) {
|
|
45
45
|
const relateToNow = humanTimeDiff( date );
|
|
46
|
-
let statusLabel =
|
|
46
|
+
let statusLabel = status;
|
|
47
47
|
let statusIcon = pendingIcon;
|
|
48
48
|
switch ( status ) {
|
|
49
49
|
case 'publish':
|
|
@@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
12
12
|
import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
|
|
13
13
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
14
14
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
15
|
-
import { layout, page, home,
|
|
15
|
+
import { layout, page, home, verse, plus } from '@wordpress/icons';
|
|
16
16
|
import { useSelect } from '@wordpress/data';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -159,7 +159,7 @@ export default function SidebarNavigationScreenPages() {
|
|
|
159
159
|
itemIcon = home;
|
|
160
160
|
break;
|
|
161
161
|
case postsPage:
|
|
162
|
-
itemIcon =
|
|
162
|
+
itemIcon = verse;
|
|
163
163
|
break;
|
|
164
164
|
default:
|
|
165
165
|
itemIcon = page;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
|
|
5
5
|
import { useDispatch } from '@wordpress/data';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
6
7
|
import { pencil } from '@wordpress/icons';
|
|
7
|
-
import {
|
|
8
|
+
import { getQueryArgs } from '@wordpress/url';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
@@ -13,19 +14,26 @@ import SidebarButton from '../sidebar-button';
|
|
|
13
14
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
14
15
|
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
15
16
|
import usePatternDetails from './use-pattern-details';
|
|
16
|
-
import useNavigationMenuContent from './use-navigation-menu-content';
|
|
17
17
|
import { store as editSiteStore } from '../../store';
|
|
18
18
|
import { unlock } from '../../lock-unlock';
|
|
19
19
|
|
|
20
20
|
export default function SidebarNavigationScreenPattern() {
|
|
21
21
|
const { params } = useNavigator();
|
|
22
|
+
const { categoryType } = getQueryArgs( window.location.href );
|
|
22
23
|
const { postType, postId } = params;
|
|
23
24
|
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
24
25
|
|
|
25
26
|
useInitEditedEntityFromURL();
|
|
26
27
|
|
|
27
28
|
const patternDetails = usePatternDetails( postType, postId );
|
|
28
|
-
|
|
29
|
+
|
|
30
|
+
// The absence of a category type in the query params for template parts
|
|
31
|
+
// indicates the user has arrived at the template part via the "manage all"
|
|
32
|
+
// page and the back button should return them to that list page.
|
|
33
|
+
const backPath =
|
|
34
|
+
! categoryType && postType === 'wp_template_part'
|
|
35
|
+
? '/wp_template_part/all'
|
|
36
|
+
: '/patterns';
|
|
29
37
|
|
|
30
38
|
return (
|
|
31
39
|
<SidebarNavigationScreen
|
|
@@ -36,8 +44,7 @@ export default function SidebarNavigationScreenPattern() {
|
|
|
36
44
|
icon={ pencil }
|
|
37
45
|
/>
|
|
38
46
|
}
|
|
39
|
-
backPath={
|
|
40
|
-
content={ content }
|
|
47
|
+
backPath={ backPath }
|
|
41
48
|
{ ...patternDetails }
|
|
42
49
|
/>
|
|
43
50
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.edit-site-sidebar-navigation-screen-pattern__added-by-description {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
margin-top: $grid-unit-30;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.edit-site-sidebar-navigation-screen-pattern__added-by-description-author {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
img {
|
|
13
|
+
border-radius: $grid-unit-15;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
svg {
|
|
17
|
+
fill: $gray-600;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.edit-site-sidebar-navigation-screen-pattern__added-by-description-author-icon {
|
|
22
|
+
width: 24px;
|
|
23
|
+
height: 24px;
|
|
24
|
+
margin-right: $grid-unit-10;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.edit-site-sidebar-navigation-screen-pattern__lock-icon {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
}
|
|
@@ -22,7 +22,7 @@ export default function TemplatePartNavigationMenu( { id } ) {
|
|
|
22
22
|
size="12"
|
|
23
23
|
upperCase={ true }
|
|
24
24
|
>
|
|
25
|
-
{ title?.rendered || __( 'Navigation' ) }
|
|
25
|
+
{ title?.rendered || title || __( 'Navigation' ) }
|
|
26
26
|
</Heading>
|
|
27
27
|
<NavigationMenuEditor navigationMenuId={ id } />
|
|
28
28
|
</>
|