@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
|
@@ -70,6 +70,7 @@ export default function Layout() {
|
|
|
70
70
|
const isListPage = getIsListPage(params, isMobileViewport);
|
|
71
71
|
const isEditorPage = !isListPage;
|
|
72
72
|
const {
|
|
73
|
+
isDistractionFree,
|
|
73
74
|
hasFixedToolbar,
|
|
74
75
|
canvasMode,
|
|
75
76
|
previousShortcut,
|
|
@@ -85,7 +86,8 @@ export default function Layout() {
|
|
|
85
86
|
canvasMode: getCanvasMode(),
|
|
86
87
|
previousShortcut: getAllShortcutKeyCombinations('core/edit-site/previous-region'),
|
|
87
88
|
nextShortcut: getAllShortcutKeyCombinations('core/edit-site/next-region'),
|
|
88
|
-
hasFixedToolbar: select(preferencesStore).get('fixedToolbar')
|
|
89
|
+
hasFixedToolbar: select(preferencesStore).get('core/edit-site', 'fixedToolbar'),
|
|
90
|
+
isDistractionFree: select(preferencesStore).get('core/edit-site', 'distractionFree')
|
|
89
91
|
};
|
|
90
92
|
}, []);
|
|
91
93
|
const isEditing = canvasMode === 'edit';
|
|
@@ -100,7 +102,28 @@ export default function Layout() {
|
|
|
100
102
|
const [canvasResizer, canvasSize] = useResizeObserver();
|
|
101
103
|
const [fullResizer] = useResizeObserver();
|
|
102
104
|
const [isResizing] = useState(false);
|
|
103
|
-
const isEditorLoading = useIsSiteEditorLoading(); //
|
|
105
|
+
const isEditorLoading = useIsSiteEditorLoading(); // This determines which animation variant should apply to the header.
|
|
106
|
+
// There is also a `isDistractionFreeHovering` state that gets priority
|
|
107
|
+
// when hovering the `edit-site-layout__header-container` in distraction
|
|
108
|
+
// free mode. It's set via framer and trickles down to all the children
|
|
109
|
+
// so they can use this variant state too.
|
|
110
|
+
//
|
|
111
|
+
// TODO: The issue with this is we want to have the hover state stick when hovering
|
|
112
|
+
// a popover opened via the header. We'll probably need to lift this state to
|
|
113
|
+
// handle it ourselves. Also, focusWithin the header needs to be handled.
|
|
114
|
+
|
|
115
|
+
let headerAnimationState;
|
|
116
|
+
|
|
117
|
+
if (canvasMode === 'view') {
|
|
118
|
+
// We need 'view' to always take priority so 'isDistractionFree'
|
|
119
|
+
// doesn't bleed over into the view (sidebar) state
|
|
120
|
+
headerAnimationState = 'view';
|
|
121
|
+
} else if (isDistractionFree) {
|
|
122
|
+
headerAnimationState = 'isDistractionFree';
|
|
123
|
+
} else {
|
|
124
|
+
headerAnimationState = canvasMode; // edit, view, init
|
|
125
|
+
} // Sets the right context for the command palette
|
|
126
|
+
|
|
104
127
|
|
|
105
128
|
const commandContext = canvasMode === 'edit' && isEditorPage ? 'site-editor-edit' : 'site-editor';
|
|
106
129
|
useCommandContext(commandContext);
|
|
@@ -116,52 +139,106 @@ export default function Layout() {
|
|
|
116
139
|
return createElement(Fragment, null, createElement(CommandMenu, null), createElement(KeyboardShortcutsRegister, null), createElement(KeyboardShortcutsGlobal, null), fullResizer, createElement("div", { ...navigateRegionsProps,
|
|
117
140
|
ref: navigateRegionsProps.ref,
|
|
118
141
|
className: classnames('edit-site-layout', navigateRegionsProps.className, {
|
|
142
|
+
'is-distraction-free': isDistractionFree && isEditing,
|
|
119
143
|
'is-full-canvas': isFullCanvas,
|
|
120
144
|
'is-edit-mode': isEditing,
|
|
121
145
|
'has-fixed-toolbar': hasFixedToolbar
|
|
122
146
|
})
|
|
147
|
+
}, createElement(motion.div, {
|
|
148
|
+
className: "edit-site-layout__header-container",
|
|
149
|
+
variants: {
|
|
150
|
+
isDistractionFree: {
|
|
151
|
+
opacity: 0,
|
|
152
|
+
transition: {
|
|
153
|
+
type: 'tween',
|
|
154
|
+
delay: 0.8,
|
|
155
|
+
delayChildren: 0.8
|
|
156
|
+
} // How long to wait before the header exits
|
|
157
|
+
|
|
158
|
+
},
|
|
159
|
+
isDistractionFreeHovering: {
|
|
160
|
+
opacity: 1,
|
|
161
|
+
transition: {
|
|
162
|
+
type: 'tween',
|
|
163
|
+
delay: 0.2,
|
|
164
|
+
delayChildren: 0.2
|
|
165
|
+
} // How long to wait before the header shows
|
|
166
|
+
|
|
167
|
+
},
|
|
168
|
+
view: {
|
|
169
|
+
opacity: 1
|
|
170
|
+
},
|
|
171
|
+
edit: {
|
|
172
|
+
opacity: 1
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
whileHover: isDistractionFree ? 'isDistractionFreeHovering' : undefined,
|
|
176
|
+
animate: headerAnimationState
|
|
123
177
|
}, createElement(SiteHub, {
|
|
178
|
+
as: motion.div,
|
|
179
|
+
variants: {
|
|
180
|
+
isDistractionFree: {
|
|
181
|
+
x: '-100%'
|
|
182
|
+
},
|
|
183
|
+
isDistractionFreeHovering: {
|
|
184
|
+
x: 0
|
|
185
|
+
},
|
|
186
|
+
view: {
|
|
187
|
+
x: 0
|
|
188
|
+
},
|
|
189
|
+
edit: {
|
|
190
|
+
x: 0
|
|
191
|
+
}
|
|
192
|
+
},
|
|
124
193
|
ref: hubRef,
|
|
125
194
|
className: "edit-site-layout__hub"
|
|
126
195
|
}), createElement(AnimatePresence, {
|
|
127
196
|
initial: false
|
|
128
197
|
}, isEditorPage && isEditing && createElement(NavigableRegion, {
|
|
198
|
+
key: "header",
|
|
129
199
|
className: "edit-site-layout__header",
|
|
130
200
|
ariaLabel: __('Editor top bar'),
|
|
131
201
|
as: motion.div,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
202
|
+
variants: {
|
|
203
|
+
isDistractionFree: {
|
|
204
|
+
opacity: 0,
|
|
205
|
+
y: 0
|
|
206
|
+
},
|
|
207
|
+
isDistractionFreeHovering: {
|
|
208
|
+
opacity: 1,
|
|
209
|
+
y: 0
|
|
210
|
+
},
|
|
211
|
+
view: {
|
|
212
|
+
opacity: 1,
|
|
213
|
+
y: '-100%'
|
|
214
|
+
},
|
|
215
|
+
edit: {
|
|
216
|
+
opacity: 1,
|
|
217
|
+
y: 0
|
|
218
|
+
}
|
|
137
219
|
},
|
|
138
220
|
exit: {
|
|
139
221
|
y: '-100%'
|
|
140
222
|
},
|
|
223
|
+
initial: {
|
|
224
|
+
opacity: isDistractionFree ? 1 : 0,
|
|
225
|
+
y: isDistractionFree ? 0 : '-100%'
|
|
226
|
+
},
|
|
141
227
|
transition: {
|
|
142
228
|
type: 'tween',
|
|
143
|
-
duration: disableMotion ? 0 :
|
|
229
|
+
duration: disableMotion ? 0 : 0.2,
|
|
144
230
|
ease: 'easeOut'
|
|
145
231
|
}
|
|
146
|
-
},
|
|
232
|
+
}, createElement(Header, null)))), createElement("div", {
|
|
147
233
|
className: "edit-site-layout__content"
|
|
148
|
-
}, createElement(AnimatePresence, {
|
|
149
|
-
initial: false
|
|
150
234
|
}, createElement(motion.div, {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
opacity: 0,
|
|
159
|
-
transitionEnd: {
|
|
160
|
-
display: 'none'
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
exit: {
|
|
164
|
-
opacity: 0
|
|
235
|
+
// The sidebar is needed for routing on mobile
|
|
236
|
+
// (https://github.com/WordPress/gutenberg/pull/51558/files#r1231763003),
|
|
237
|
+
// so we can't remove the element entirely. Using `inert` will make
|
|
238
|
+
// it inaccessible to screen readers and keyboard navigation.
|
|
239
|
+
inert: showSidebar ? undefined : 'inert',
|
|
240
|
+
animate: {
|
|
241
|
+
opacity: showSidebar ? 1 : 0
|
|
165
242
|
},
|
|
166
243
|
transition: {
|
|
167
244
|
type: 'tween',
|
|
@@ -172,7 +249,7 @@ export default function Layout() {
|
|
|
172
249
|
className: "edit-site-layout__sidebar"
|
|
173
250
|
}, createElement(NavigableRegion, {
|
|
174
251
|
ariaLabel: __('Navigation')
|
|
175
|
-
}, createElement(Sidebar, null)))
|
|
252
|
+
}, createElement(Sidebar, null))), createElement(SavePanel, null), showCanvas && createElement(Fragment, null, isListPage && createElement(PageMain, null), isEditorPage && createElement("div", {
|
|
176
253
|
className: classnames('edit-site-layout__canvas-container', {
|
|
177
254
|
'is-resizing': isResizing
|
|
178
255
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["classnames","useSelect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__unstableUseNavigateRegions","useNavigateRegions","useReducedMotion","useViewportMatch","useResizeObserver","__","useState","useRef","NavigableRegion","store","keyboardShortcutsStore","CommandMenu","privateApis","commandsPrivateApis","preferencesStore","blockEditorPrivateApis","routerPrivateApis","coreCommandsPrivateApis","Sidebar","Editor","ErrorBoundary","editSiteStore","getIsListPage","Header","useInitEditedEntityFromURL","SiteHub","ResizableFrame","useSyncCanvasModeWithURL","unlock","SavePanel","KeyboardShortcutsRegister","KeyboardShortcutsGlobal","useCommonCommands","useEditModeCommands","PageMain","useIsSiteEditorLoading","useCommands","useCommandContext","useLocation","useGlobalStyle","ANIMATION_DURATION","Layout","hubRef","params","isMobileViewport","isListPage","isEditorPage","hasFixedToolbar","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","getCanvasMode","get","isEditing","navigateRegionsProps","previous","next","disableMotion","showSidebar","showCanvas","isFullCanvas","canvasResizer","canvasSize","fullResizer","isResizing","isEditorLoading","commandContext","backgroundColor","gradientValue","ref","className","div","y","type","duration","ease","opacity","display","transitionEnd","width","scale","transition","background"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,gBAAgB,IAAIC,MADrB,EAECC,yBAAyB,IAAIC,eAF9B,EAGCC,4BAA4B,IAAIC,kBAHjC,QAIO,uBAJP;AAKA,SACCC,gBADD,EAECC,gBAFD,EAGC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EAAGZ,SAJf;AAKC,IAAA,kBAAkB,EAAC,6CALpB;AAMC,IAAA,iBAAiB,EAAG;AACnB6B,MAAAA,UAAU,EACTd,aADS,aACTA,aADS,cACTA,aADS,GAETD;AAHkB;AANrB,KAYC,cAAC,MAAD;AACC,IAAA,SAAS,EACRF;AAFF,IAZD,CADD,CA7BD,CAVF,CAHF,CA3CF,CA3CD,CALD,CADD;AAoKA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useRef } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport PageMain from '../page-main';\nimport { useIsSiteEditorLoading } from './hooks';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\tconst { hasFixedToolbar, canvasMode, previousShortcut, nextShortcut } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/next-region'\n\t\t\t\t),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tselect( preferencesStore ).get( 'fixedToolbar' ),\n\t\t\t};\n\t\t}, [] );\n\tconst isEditing = canvasMode === 'edit';\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && isEditing ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) || ( isEditorPage && isEditing );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst [ isResizing ] = useState( false );\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\n\t// Sets the right context for the command center\n\tconst commandContext =\n\t\tcanvasMode === 'edit' && isEditorPage\n\t\t\t? 'site-editor-edit'\n\t\t\t: 'site-editor';\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': isEditing,\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<SiteHub ref={ hubRef } className=\"edit-site-layout__hub\" />\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage && isEditing && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isEditing && <Header /> }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tanimate={\n\t\t\t\t\t\t\t\t\tshowSidebar\n\t\t\t\t\t\t\t\t\t\t? { opacity: 1, display: 'block' }\n\t\t\t\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\t\t\ttransitionEnd: {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: 'none',\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\tdisableMotion || isMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</AnimatePresence>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ isListPage && <PageMain /> }\n\t\t\t\t\t\t\t{ isEditorPage && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\t\t\tisEditorPage &&\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__canvas\"\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\t\t\tisReady={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! isEditorLoading\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ isEditing }\n\t\t\t\t\t\t\t\t\t\t\t\t\toversizedClassName=\"edit-site-layout__resizable-frame-oversized\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Editor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLoading={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisEditorLoading\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["classnames","useSelect","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","__unstableUseNavigateRegions","useNavigateRegions","useReducedMotion","useViewportMatch","useResizeObserver","__","useState","useRef","NavigableRegion","store","keyboardShortcutsStore","CommandMenu","privateApis","commandsPrivateApis","preferencesStore","blockEditorPrivateApis","routerPrivateApis","coreCommandsPrivateApis","Sidebar","Editor","ErrorBoundary","editSiteStore","getIsListPage","Header","useInitEditedEntityFromURL","SiteHub","ResizableFrame","useSyncCanvasModeWithURL","unlock","SavePanel","KeyboardShortcutsRegister","KeyboardShortcutsGlobal","useCommonCommands","useEditModeCommands","PageMain","useIsSiteEditorLoading","useCommands","useCommandContext","useLocation","useGlobalStyle","ANIMATION_DURATION","Layout","hubRef","params","isMobileViewport","isListPage","isEditorPage","isDistractionFree","hasFixedToolbar","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","getCanvasMode","get","isEditing","navigateRegionsProps","previous","next","disableMotion","showSidebar","showCanvas","isFullCanvas","canvasResizer","canvasSize","fullResizer","isResizing","isEditorLoading","headerAnimationState","commandContext","backgroundColor","gradientValue","ref","className","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","undefined","div","x","y","duration","ease","width","scale","background"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,gBAAgB,IAAIC,MADrB,EAECC,yBAAyB,IAAIC,eAF9B,EAGCC,4BAA4B,IAAIC,kBAHjC,QAIO,uBAJP;AAKA,SACCC,gBADD,EAECC,gBAFD,EAGCC,iBAHD,QAIO,oBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,KAAK,IAAIC,sBAAlB,QAAgD,+BAAhD;AACA,SACCC,WADD,EAECC,WAAW,IAAIC,mBAFhB,QAGO,qBAHP;AAIA,SAASJ,KAAK,IAAIK,gBAAlB,QAA0C,wBAA1C;AACA,SAASF,WAAW,IAAIG,sBAAxB,QAAsD,yBAAtD;AACA,SAASH,WAAW,IAAII,iBAAxB,QAAiD,mBAAjD;AACA,SA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X,MAAAA,IAAI,EAAE,OADM;AAEZU,MAAAA,QAAQ,EACP3B,aAAa,IAAIO,UAAjB,GACG,CADH,GAEG3B,kBALQ;AAMZgD,MAAAA,IAAI,EAAE;AANM;AApBd,KA6BC,cAAC,aAAD,QACC,cAAC,cAAD;AACC,IAAA,OAAO,EACN,CAAEpB,eAFJ;AAIC,IAAA,WAAW,EAAGZ,SAJf;AAKC,IAAA,kBAAkB,EAAC,6CALpB;AAMC,IAAA,iBAAiB,EAAG;AACnBmC,MAAAA,UAAU,EACTnB,aADS,aACTA,aADS,cACTA,aADS,GAETD;AAHkB;AANrB,KAYC,cAAC,MAAD;AACC,IAAA,SAAS,EACRH;AAFF,IAZD,CADD,CA7BD,CAVF,CAHF,CA3BF,CA1FD,CALD,CADD;AAmMA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useRef } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport PageMain from '../page-main';\nimport { useIsSiteEditorLoading } from './hooks';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\n\tconst {\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isEditing = canvasMode === 'edit';\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && isEditing ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) || ( isEditorPage && isEditing );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst [ isResizing ] = useState( false );\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tconst commandContext =\n\t\tcanvasMode === 'edit' && isEditorPage\n\t\t\t? 'site-editor-edit'\n\t\t\t: 'site-editor';\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<CommandMenu />\n\t\t\t<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-distraction-free': isDistractionFree && isEditing,\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': isEditing,\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\tisDistractionFree: { x: '-100%' },\n\t\t\t\t\t\t\tisDistractionFreeHovering: { x: 0 },\n\t\t\t\t\t\t\tview: { x: 0 },\n\t\t\t\t\t\t\tedit: { x: 0 },\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tref={ hubRef }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ isEditorPage && isEditing && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tkey=\"header\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\t\t\tisDistractionFree: { opacity: 0, y: 0 },\n\t\t\t\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tview: { opacity: 1, y: '-100%' },\n\t\t\t\t\t\t\t\t\tedit: { opacity: 1, y: 0 },\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: isDistractionFree ? 1 : 0,\n\t\t\t\t\t\t\t\t\ty: isDistractionFree ? 0 : '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.2,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\t// The sidebar is needed for routing on mobile\n\t\t\t\t\t\t// (https://github.com/WordPress/gutenberg/pull/51558/files#r1231763003),\n\t\t\t\t\t\t// so we can't remove the element entirely. Using `inert` will make\n\t\t\t\t\t\t// it inaccessible to screen readers and keyboard navigation.\n\t\t\t\t\t\tinert={ showSidebar ? undefined : 'inert' }\n\t\t\t\t\t\tanimate={ { opacity: showSidebar ? 1 : 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\tdisableMotion || isMobileViewport\n\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<NavigableRegion ariaLabel={ __( 'Navigation' ) }>\n\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ isListPage && <PageMain /> }\n\t\t\t\t\t\t\t{ isEditorPage && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\t\t\tisEditorPage &&\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__canvas\"\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\t\t\tisReady={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! isEditorLoading\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ isEditing }\n\t\t\t\t\t\t\t\t\t\t\t\t\toversizedClassName=\"edit-site-layout__resizable-frame-oversized\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Editor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLoading={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisEditorLoading\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -20,7 +20,7 @@ export default function Header({
|
|
|
20
20
|
}, createElement(FlexBlock, {
|
|
21
21
|
className: "edit-site-page-header__page-title"
|
|
22
22
|
}, createElement(Heading, {
|
|
23
|
-
as: "
|
|
23
|
+
as: "h2",
|
|
24
24
|
level: 4,
|
|
25
25
|
className: "edit-site-page-header__title"
|
|
26
26
|
}, title), subTitle && createElement(Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page/header.js"],"names":["__experimentalHeading","Heading","__experimentalText","Text","__experimentalHStack","HStack","FlexBlock","FlexItem","Header","title","subTitle","actions"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,qBAAqB,IAAIC,OAD1B,EAECC,kBAAkB,IAAIC,IAFvB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,SAJD,EAKCC,QALD,QAMO,uBANP;AAQA;AACA;AACA;;AAEA,eAAe,SAASC,MAAT,CAAiB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,QAAT;AAAmBC,EAAAA;AAAnB,CAAjB,EAAgD;AAC9D,SACC,cAAC,MAAD;AAAQ,IAAA,EAAE,EAAC,QAAX;AAAoB,IAAA,SAAS,EAAC,MAA9B;AAAqC,IAAA,SAAS,EAAC;AAA/C,KACC,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,OAAD;AACC,IAAA,EAAE,EAAC,IADJ;AAEC,IAAA,KAAK,EAAG,CAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGF,KALH,CADD,EAQGC,QAAQ,IACT,cAAC,IAAD;AAAM,IAAA,EAAE,EAAC,GAAT;AAAa,IAAA,SAAS,EAAC;AAAvB,KACGA,QADH,CATF,CADD,EAeC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACGC,OADH,CAfD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n\tFlexItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\n\nexport default function Header( { title, subTitle, actions } ) {\n\treturn (\n\t\t<HStack as=\"header\" alignment=\"left\" className=\"edit-site-page-header\">\n\t\t\t<FlexBlock className=\"edit-site-page-header__page-title\">\n\t\t\t\t<Heading\n\t\t\t\t\tas=\"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/page/header.js"],"names":["__experimentalHeading","Heading","__experimentalText","Text","__experimentalHStack","HStack","FlexBlock","FlexItem","Header","title","subTitle","actions"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,qBAAqB,IAAIC,OAD1B,EAECC,kBAAkB,IAAIC,IAFvB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,SAJD,EAKCC,QALD,QAMO,uBANP;AAQA;AACA;AACA;;AAEA,eAAe,SAASC,MAAT,CAAiB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,QAAT;AAAmBC,EAAAA;AAAnB,CAAjB,EAAgD;AAC9D,SACC,cAAC,MAAD;AAAQ,IAAA,EAAE,EAAC,QAAX;AAAoB,IAAA,SAAS,EAAC,MAA9B;AAAqC,IAAA,SAAS,EAAC;AAA/C,KACC,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,OAAD;AACC,IAAA,EAAE,EAAC,IADJ;AAEC,IAAA,KAAK,EAAG,CAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGF,KALH,CADD,EAQGC,QAAQ,IACT,cAAC,IAAD;AAAM,IAAA,EAAE,EAAC,GAAT;AAAa,IAAA,SAAS,EAAC;AAAvB,KACGA,QADH,CATF,CADD,EAeC,cAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,KACGC,OADH,CAfD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\tFlexBlock,\n\tFlexItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\n\nexport default function Header( { title, subTitle, actions } ) {\n\treturn (\n\t\t<HStack as=\"header\" alignment=\"left\" className=\"edit-site-page-header\">\n\t\t\t<FlexBlock className=\"edit-site-page-header__page-title\">\n\t\t\t\t<Heading\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t\tlevel={ 4 }\n\t\t\t\t\tclassName=\"edit-site-page-header__title\"\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t\t{ subTitle && (\n\t\t\t\t\t<Text as=\"p\" className=\"edit-site-page-header__sub-title\">\n\t\t\t\t\t\t{ subTitle }\n\t\t\t\t\t</Text>\n\t\t\t\t) }\n\t\t\t</FlexBlock>\n\t\t\t<FlexItem className=\"edit-site-page-header__actions\">\n\t\t\t\t{ actions }\n\t\t\t</FlexItem>\n\t\t</HStack>\n\t);\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { NavigableRegion } from '@wordpress/interface';
|
|
12
|
+
import { EditorSnackbars } from '@wordpress/editor';
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
@@ -32,6 +33,6 @@ export default function Page({
|
|
|
32
33
|
actions: actions
|
|
33
34
|
}), createElement("div", {
|
|
34
35
|
className: "edit-site-page-content"
|
|
35
|
-
}, children));
|
|
36
|
+
}, children, createElement(EditorSnackbars, null)));
|
|
36
37
|
}
|
|
37
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page/index.js"],"names":["classnames","NavigableRegion","Header","Page","title","subTitle","actions","children","className","hideTitleFromUI","classes"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,sBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,eAAe,SAASC,IAAT,CAAe;AAC7BC,EAAAA,KAD6B;AAE7BC,EAAAA,QAF6B;AAG7BC,EAAAA,OAH6B;AAI7BC,EAAAA,QAJ6B;AAK7BC,EAAAA,SAL6B;AAM7BC,EAAAA,eAAe,GAAG;AANW,CAAf,EAOX;AACH,QAAMC,OAAO,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/page/index.js"],"names":["classnames","NavigableRegion","EditorSnackbars","Header","Page","title","subTitle","actions","children","className","hideTitleFromUI","classes"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,eAAe,SAASC,IAAT,CAAe;AAC7BC,EAAAA,KAD6B;AAE7BC,EAAAA,QAF6B;AAG7BC,EAAAA,OAH6B;AAI7BC,EAAAA,QAJ6B;AAK7BC,EAAAA,SAL6B;AAM7BC,EAAAA,eAAe,GAAG;AANW,CAAf,EAOX;AACH,QAAMC,OAAO,GAAGX,UAAU,CAAE,gBAAF,EAAoBS,SAApB,CAA1B;AAEA,SACC,cAAC,eAAD;AAAiB,IAAA,SAAS,EAAGE,OAA7B;AAAuC,IAAA,SAAS,EAAGN;AAAnD,KACG,CAAEK,eAAF,IAAqBL,KAArB,IACD,cAAC,MAAD;AACC,IAAA,KAAK,EAAGA,KADT;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,OAAO,EAAGC;AAHX,IAFF,EAQC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGC,QADH,EAEC,cAAC,eAAD,OAFD,CARD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/interface';\nimport { EditorSnackbars } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\n\nexport default function Page( {\n\ttitle,\n\tsubTitle,\n\tactions,\n\tchildren,\n\tclassName,\n\thideTitleFromUI = false,\n} ) {\n\tconst classes = classnames( 'edit-site-page', className );\n\n\treturn (\n\t\t<NavigableRegion className={ classes } ariaLabel={ title }>\n\t\t\t{ ! hideTitleFromUI && title && (\n\t\t\t\t<Header\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tsubTitle={ subTitle }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div className=\"edit-site-page-content\">\n\t\t\t\t{ children }\n\t\t\t\t<EditorSnackbars />\n\t\t\t</div>\n\t\t</NavigableRegion>\n\t);\n}\n"]}
|
|
@@ -52,7 +52,8 @@ export default function DeletePageMenuItem({
|
|
|
52
52
|
}, __('Delete')), createElement(ConfirmDialog, {
|
|
53
53
|
isOpen: isModalOpen,
|
|
54
54
|
onConfirm: removePage,
|
|
55
|
-
onCancel: () => setIsModalOpen(false)
|
|
55
|
+
onCancel: () => setIsModalOpen(false),
|
|
56
|
+
confirmButtonText: __('Delete')
|
|
56
57
|
}, __('Are you sure you want to delete this page?')));
|
|
57
58
|
}
|
|
58
59
|
//# sourceMappingURL=delete-page-menu-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-actions/delete-page-menu-item.js"],"names":["useDispatch","useSelect","decodeEntities","useState","store","coreStore","__","sprintf","MenuItem","__experimentalConfirmDialog","ConfirmDialog","noticesStore","DeletePageMenuItem","postId","onRemove","isModalOpen","setIsModalOpen","createSuccessNotice","createErrorNotice","deleteEntityRecord","page","select","getEntityRecord","removePage","throwOnError","title","rendered","type","id","error","errorMessage","message","code"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,QADD,EAECC,2BAA2B,IAAIC,aAFhC,QAGO,uBAHP;AAIA,SAASN,KAAK,IAAIO,YAAlB,QAAsC,oBAAtC;AAEA,eAAe,SAASC,kBAAT,CAA6B;AAAEC,EAAAA,MAAF;AAAUC,EAAAA;AAAV,CAA7B,EAAoD;AAClE,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkCb,QAAQ,CAAE,KAAF,CAAhD;AACA,QAAM;AAAEc,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MACLlB,WAAW,CAAEW,YAAF,CADZ;AAEA,QAAM;AAAEQ,IAAAA;AAAF,MAAyBnB,WAAW,CAAEK,SAAF,CAA1C;AACA,QAAMe,IAAI,GAAGnB,SAAS,CACnBoB,MAAF,IACCA,MAAM,CAAEhB,SAAF,CAAN,CAAoBiB,eAApB,CAAqC,UAArC,EAAiD,MAAjD,EAAyDT,MAAzD,CAFoB,EAGrB,CAAEA,MAAF,CAHqB,CAAtB;;AAKA,iBAAeU,UAAf,GAA4B;AAC3B,QAAI;AACH,YAAMJ,kBAAkB,CACvB,UADuB,EAEvB,MAFuB,EAGvBN,MAHuB,EAIvB,EAJuB,EAKvB;AAAEW,QAAAA,YAAY,EAAE;AAAhB,OALuB,CAAxB;AAOAP,MAAAA,mBAAmB,CAClBV,OAAO;AACN;AACAD,MAAAA,EAAE,CAAE,eAAF,CAFI,EAGNJ,cAAc,CAAEkB,IAAI,CAACK,KAAL,CAAWC,QAAb,CAHR,CADW,EAMlB;AACCC,QAAAA,IAAI,EAAE,UADP;AAECC,QAAAA,EAAE,EAAE;AAFL,OANkB,CAAnB;AAWAd,MAAAA,QAAQ;AACR,KApBD,CAoBE,OAAQe,KAAR,EAAgB;AACjB,YAAMC,YAAY,GACjBD,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,IAAN,KAAe,eAAhC,GACGH,KAAK,CAACE,OADT,GAEGzB,EAAE,CAAE,4CAAF,CAHN;AAKAY,MAAAA,iBAAiB,CAAEY,YAAF,EAAgB;AAAEH,QAAAA,IAAI,EAAE;AAAR,OAAhB,CAAjB;AACA,KA3BD,SA2BU;AACTX,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AACD;;AACD,SACC,8BACC,cAAC,QAAD;AAAU,IAAA,OAAO,EAAG,MAAMA,cAAc,CAAE,IAAF,CAAxC;AAAmD,IAAA,aAAa;AAAhE,KACGV,EAAE,CAAE,QAAF,CADL,CADD,EAIC,cAAC,aAAD;AACC,IAAA,MAAM,EAAGS,WADV;AAEC,IAAA,SAAS,EAAGQ,UAFb;AAGC,IAAA,QAAQ,EAAG,MAAMP,cAAc,CAAE,KAAF;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/page-actions/delete-page-menu-item.js"],"names":["useDispatch","useSelect","decodeEntities","useState","store","coreStore","__","sprintf","MenuItem","__experimentalConfirmDialog","ConfirmDialog","noticesStore","DeletePageMenuItem","postId","onRemove","isModalOpen","setIsModalOpen","createSuccessNotice","createErrorNotice","deleteEntityRecord","page","select","getEntityRecord","removePage","throwOnError","title","rendered","type","id","error","errorMessage","message","code"],"mappings":";;AAAA;AACA;AACA;AACA,SA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BD,CAoBE,OAAQe,KAAR,EAAgB;AACjB,YAAMC,YAAY,GACjBD,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,IAAN,KAAe,eAAhC,GACGH,KAAK,CAACE,OADT,GAEGzB,EAAE,CAAE,4CAAF,CAHN;AAKAY,MAAAA,iBAAiB,CAAEY,YAAF,EAAgB;AAAEH,QAAAA,IAAI,EAAE;AAAR,OAAhB,CAAjB;AACA,KA3BD,SA2BU;AACTX,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AACD;;AACD,SACC,8BACC,cAAC,QAAD;AAAU,IAAA,OAAO,EAAG,MAAMA,cAAc,CAAE,IAAF,CAAxC;AAAmD,IAAA,aAAa;AAAhE,KACGV,EAAE,CAAE,QAAF,CADL,CADD,EAIC,cAAC,aAAD;AACC,IAAA,MAAM,EAAGS,WADV;AAEC,IAAA,SAAS,EAAGQ,UAFb;AAGC,IAAA,QAAQ,EAAG,MAAMP,cAAc,CAAE,KAAF,CAHhC;AAIC,IAAA,iBAAiB,EAAGV,EAAE,CAAE,QAAF;AAJvB,KAMGA,EAAE,CAAE,4CAAF,CANL,CAJD,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tMenuItem,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function DeletePageMenuItem( { postId, onRemove } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst page = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'postType', 'page', postId ),\n\t\t[ postId ]\n\t);\n\tasync function removePage() {\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\tpostId,\n\t\t\t\t{},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The page's title. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( page.title.rendered )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'edit-site-page-removed',\n\t\t\t\t}\n\t\t\t);\n\t\t\tonRemove?.();\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the page.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t} finally {\n\t\t\tsetIsModalOpen( false );\n\t\t}\n\t}\n\treturn (\n\t\t<>\n\t\t\t<MenuItem onClick={ () => setIsModalOpen( true ) } isDestructive>\n\t\t\t\t{ __( 'Delete' ) }\n\t\t\t</MenuItem>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ isModalOpen }\n\t\t\t\tonConfirm={ removePage }\n\t\t\t\tonCancel={ () => setIsModalOpen( false ) }\n\t\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t\t>\n\t\t\t\t{ __( 'Are you sure you want to delete this page?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -25,7 +25,13 @@ export default function BackToPageNotification() {
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
export function useBackToPageNotification() {
|
|
28
|
-
const
|
|
28
|
+
const {
|
|
29
|
+
isPage,
|
|
30
|
+
hasPageContentFocus
|
|
31
|
+
} = useSelect(select => ({
|
|
32
|
+
isPage: select(editSiteStore).isPage(),
|
|
33
|
+
hasPageContentFocus: select(editSiteStore).hasPageContentFocus()
|
|
34
|
+
}), []);
|
|
29
35
|
const alreadySeen = useRef(false);
|
|
30
36
|
const prevHasPageContentFocus = useRef(false);
|
|
31
37
|
const {
|
|
@@ -35,7 +41,7 @@ export function useBackToPageNotification() {
|
|
|
35
41
|
setHasPageContentFocus
|
|
36
42
|
} = useDispatch(editSiteStore);
|
|
37
43
|
useEffect(() => {
|
|
38
|
-
if (!alreadySeen.current && prevHasPageContentFocus.current && !hasPageContentFocus) {
|
|
44
|
+
if (!alreadySeen.current && isPage && prevHasPageContentFocus.current && !hasPageContentFocus) {
|
|
39
45
|
createInfoNotice(__('You are editing a template.'), {
|
|
40
46
|
isDismissible: true,
|
|
41
47
|
type: 'snackbar',
|
|
@@ -48,6 +54,6 @@ export function useBackToPageNotification() {
|
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
prevHasPageContentFocus.current = hasPageContentFocus;
|
|
51
|
-
}, [alreadySeen, prevHasPageContentFocus, hasPageContentFocus, createInfoNotice, setHasPageContentFocus]);
|
|
57
|
+
}, [alreadySeen, isPage, prevHasPageContentFocus, hasPageContentFocus, createInfoNotice, setHasPageContentFocus]);
|
|
52
58
|
}
|
|
53
59
|
//# sourceMappingURL=back-to-page-notification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-content-focus-manager/back-to-page-notification.js"],"names":["useSelect","useDispatch","useEffect","useRef","store","noticesStore","__","editSiteStore","BackToPageNotification","useBackToPageNotification","hasPageContentFocus","select","alreadySeen","prevHasPageContentFocus","createInfoNotice","setHasPageContentFocus","current","isDismissible","type","actions","label","onClick"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AAEA;AACA;AACA;AACA;;AACA,eAAe,SAASC,sBAAT,GAAkC;AAChDC,EAAAA,yBAAyB;AACzB,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASA,yBAAT,GAAqC;AAC3C,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/page-content-focus-manager/back-to-page-notification.js"],"names":["useSelect","useDispatch","useEffect","useRef","store","noticesStore","__","editSiteStore","BackToPageNotification","useBackToPageNotification","isPage","hasPageContentFocus","select","alreadySeen","prevHasPageContentFocus","createInfoNotice","setHasPageContentFocus","current","isDismissible","type","actions","label","onClick"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,aAAvC;AAEA;AACA;AACA;AACA;;AACA,eAAe,SAASC,sBAAT,GAAkC;AAChDC,EAAAA,yBAAyB;AACzB,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASA,yBAAT,GAAqC;AAC3C,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAkCX,SAAS,CAC9CY,MAAF,KAAgB;AACfF,IAAAA,MAAM,EAAEE,MAAM,CAAEL,aAAF,CAAN,CAAwBG,MAAxB,EADO;AAEfC,IAAAA,mBAAmB,EAAEC,MAAM,CAAEL,aAAF,CAAN,CAAwBI,mBAAxB;AAFN,GAAhB,CADgD,EAKhD,EALgD,CAAjD;AAQA,QAAME,WAAW,GAAGV,MAAM,CAAE,KAAF,CAA1B;AACA,QAAMW,uBAAuB,GAAGX,MAAM,CAAE,KAAF,CAAtC;AAEA,QAAM;AAAEY,IAAAA;AAAF,MAAuBd,WAAW,CAAEI,YAAF,CAAxC;AACA,QAAM;AAAEW,IAAAA;AAAF,MAA6Bf,WAAW,CAAEM,aAAF,CAA9C;AAEAL,EAAAA,SAAS,CAAE,MAAM;AAChB,QACC,CAAEW,WAAW,CAACI,OAAd,IACAP,MADA,IAEAI,uBAAuB,CAACG,OAFxB,IAGA,CAAEN,mBAJH,EAKE;AACDI,MAAAA,gBAAgB,CAAET,EAAE,CAAE,6BAAF,CAAJ,EAAuC;AACtDY,QAAAA,aAAa,EAAE,IADuC;AAEtDC,QAAAA,IAAI,EAAE,UAFgD;AAGtDC,QAAAA,OAAO,EAAE,CACR;AACCC,UAAAA,KAAK,EAAEf,EAAE,CAAE,cAAF,CADV;AAECgB,UAAAA,OAAO,EAAE,MAAMN,sBAAsB,CAAE,IAAF;AAFtC,SADQ;AAH6C,OAAvC,CAAhB;AAUAH,MAAAA,WAAW,CAACI,OAAZ,GAAsB,IAAtB;AACA;;AACDH,IAAAA,uBAAuB,CAACG,OAAxB,GAAkCN,mBAAlC;AACA,GApBQ,EAoBN,CACFE,WADE,EAEFH,MAFE,EAGFI,uBAHE,EAIFH,mBAJE,EAKFI,gBALE,EAMFC,sBANE,CApBM,CAAT;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\n/**\n * Component that displays a 'You are editing a template' notification when the\n * user switches from focusing on editing page content to editing a template.\n */\nexport default function BackToPageNotification() {\n\tuseBackToPageNotification();\n\treturn null;\n}\n\n/**\n * Hook that displays a 'You are editing a template' notification when the user\n * switches from focusing on editing page content to editing a template.\n */\nexport function useBackToPageNotification() {\n\tconst { isPage, hasPageContentFocus } = useSelect(\n\t\t( select ) => ( {\n\t\t\tisPage: select( editSiteStore ).isPage(),\n\t\t\thasPageContentFocus: select( editSiteStore ).hasPageContentFocus(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst alreadySeen = useRef( false );\n\tconst prevHasPageContentFocus = useRef( false );\n\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! alreadySeen.current &&\n\t\t\tisPage &&\n\t\t\tprevHasPageContentFocus.current &&\n\t\t\t! hasPageContentFocus\n\t\t) {\n\t\t\tcreateInfoNotice( __( 'You are editing a template.' ), {\n\t\t\t\tisDismissible: true,\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Back to page' ),\n\t\t\t\t\t\tonClick: () => setHasPageContentFocus( true ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t} );\n\t\t\talreadySeen.current = true;\n\t\t}\n\t\tprevHasPageContentFocus.current = hasPageContentFocus;\n\t}, [\n\t\talreadySeen,\n\t\tisPage,\n\t\tprevHasPageContentFocus,\n\t\thasPageContentFocus,\n\t\tcreateInfoNotice,\n\t\tsetHasPageContentFocus,\n\t] );\n}\n"]}
|
|
@@ -8,8 +8,9 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import PagePatterns from '../page-patterns';
|
|
12
|
+
import PageTemplateParts from '../page-template-parts';
|
|
11
13
|
import PageTemplates from '../page-templates';
|
|
12
|
-
import PageLibrary from '../page-library';
|
|
13
14
|
import { unlock } from '../../lock-unlock';
|
|
14
15
|
const {
|
|
15
16
|
useLocation
|
|
@@ -23,8 +24,10 @@ export default function PageMain() {
|
|
|
23
24
|
|
|
24
25
|
if (path === '/wp_template/all') {
|
|
25
26
|
return createElement(PageTemplates, null);
|
|
26
|
-
} else if (path === '/
|
|
27
|
-
return createElement(
|
|
27
|
+
} else if (path === '/wp_template_part/all') {
|
|
28
|
+
return createElement(PageTemplateParts, null);
|
|
29
|
+
} else if (path === '/patterns') {
|
|
30
|
+
return createElement(PagePatterns, null);
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-main/index.js"],"names":["privateApis","routerPrivateApis","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/page-main/index.js"],"names":["privateApis","routerPrivateApis","PagePatterns","PageTemplateParts","PageTemplates","unlock","useLocation","PageMain","params","path"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAkBD,MAAM,CAAEJ,iBAAF,CAA9B;AAEA,eAAe,SAASM,QAAT,GAAoB;AAClC,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA;AAAF;AADH,MAEFH,WAAW,EAFf;;AAIA,MAAKG,IAAI,KAAK,kBAAd,EAAmC;AAClC,WAAO,cAAC,aAAD,OAAP;AACA,GAFD,MAEO,IAAKA,IAAI,KAAK,uBAAd,EAAwC;AAC9C,WAAO,cAAC,iBAAD,OAAP;AACA,GAFM,MAEA,IAAKA,IAAI,KAAK,WAAd,EAA4B;AAClC,WAAO,cAAC,YAAD,OAAP;AACA;;AAED,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport PagePatterns from '../page-patterns';\nimport PageTemplateParts from '../page-template-parts';\nimport PageTemplates from '../page-templates';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function PageMain() {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\n\tif ( path === '/wp_template/all' ) {\n\t\treturn <PageTemplates />;\n\t} else if ( path === '/wp_template_part/all' ) {\n\t\treturn <PageTemplateParts />;\n\t} else if ( path === '/patterns' ) {\n\t\treturn <PagePatterns />;\n\t}\n\n\treturn null;\n}\n"]}
|
|
@@ -9,12 +9,11 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { BlockPreview } from '@wordpress/block-editor';
|
|
12
|
-
import { __experimentalConfirmDialog as ConfirmDialog, DropdownMenu, MenuGroup, MenuItem,
|
|
13
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
12
|
+
import { __experimentalConfirmDialog as ConfirmDialog, DropdownMenu, MenuGroup, MenuItem, __experimentalHStack as HStack, __unstableCompositeItem as CompositeItem, Tooltip, Flex } from '@wordpress/components';
|
|
14
13
|
import { useDispatch } from '@wordpress/data';
|
|
15
|
-
import { useState } from '@wordpress/element';
|
|
14
|
+
import { useState, useId } from '@wordpress/element';
|
|
16
15
|
import { __, sprintf } from '@wordpress/i18n';
|
|
17
|
-
import { Icon, moreHorizontal } from '@wordpress/icons';
|
|
16
|
+
import { Icon, header, footer, symbolFilled, moreHorizontal, lockSmall } from '@wordpress/icons';
|
|
18
17
|
import { store as noticesStore } from '@wordpress/notices';
|
|
19
18
|
import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
|
|
20
19
|
import { DELETE, BACKSPACE } from '@wordpress/keycodes';
|
|
@@ -24,14 +23,16 @@ import { DELETE, BACKSPACE } from '@wordpress/keycodes';
|
|
|
24
23
|
|
|
25
24
|
import { PATTERNS, USER_PATTERNS } from './utils';
|
|
26
25
|
import { useLink } from '../routes/link';
|
|
26
|
+
|
|
27
|
+
const THEME_PATTERN_TOOLTIP = __('Theme patterns cannot be edited.');
|
|
28
|
+
|
|
27
29
|
export default function GridItem({
|
|
28
30
|
categoryId,
|
|
29
31
|
composite,
|
|
30
32
|
icon,
|
|
31
33
|
item
|
|
32
34
|
}) {
|
|
33
|
-
const
|
|
34
|
-
const descriptionId = `edit-site-library__pattern-description-${instanceId}`;
|
|
35
|
+
const descriptionId = useId();
|
|
35
36
|
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false);
|
|
36
37
|
const {
|
|
37
38
|
__experimentalDeleteReusableBlock
|
|
@@ -46,14 +47,20 @@ export default function GridItem({
|
|
|
46
47
|
postType: item.type,
|
|
47
48
|
postId: item.type === USER_PATTERNS ? item.id : item.name,
|
|
48
49
|
categoryId,
|
|
49
|
-
categoryType: item.type
|
|
50
|
-
canvas: 'edit'
|
|
50
|
+
categoryType: item.type
|
|
51
51
|
});
|
|
52
|
+
|
|
53
|
+
const onKeyDown = event => {
|
|
54
|
+
if (DELETE === event.keyCode || BACKSPACE === event.keyCode) {
|
|
55
|
+
setIsDeleteDialogOpen(true);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
52
59
|
const isEmpty = !item.blocks?.length;
|
|
53
|
-
const patternClassNames = classnames('edit-site-
|
|
60
|
+
const patternClassNames = classnames('edit-site-patterns__pattern', {
|
|
54
61
|
'is-placeholder': isEmpty
|
|
55
62
|
});
|
|
56
|
-
const previewClassNames = classnames('edit-site-
|
|
63
|
+
const previewClassNames = classnames('edit-site-patterns__preview', {
|
|
57
64
|
'is-inactive': item.type === PATTERNS
|
|
58
65
|
});
|
|
59
66
|
|
|
@@ -71,13 +78,28 @@ export default function GridItem({
|
|
|
71
78
|
}
|
|
72
79
|
};
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
const isUserPattern = item.type === USER_PATTERNS;
|
|
82
|
+
const ariaDescriptions = [];
|
|
75
83
|
|
|
76
|
-
if (
|
|
84
|
+
if (isUserPattern) {
|
|
77
85
|
// User patterns don't have descriptions, but can be edited and deleted, so include some help text.
|
|
78
|
-
|
|
86
|
+
ariaDescriptions.push(__('Press Enter to edit, or Delete to delete the pattern.'));
|
|
79
87
|
} else if (item.description) {
|
|
80
|
-
|
|
88
|
+
ariaDescriptions.push(item.description);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (item.type === PATTERNS) {
|
|
92
|
+
ariaDescriptions.push(THEME_PATTERN_TOOLTIP);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let itemIcon = icon;
|
|
96
|
+
|
|
97
|
+
if (categoryId === 'header') {
|
|
98
|
+
itemIcon = header;
|
|
99
|
+
} else if (categoryId === 'footer') {
|
|
100
|
+
itemIcon = footer;
|
|
101
|
+
} else if (categoryId === 'uncategorized') {
|
|
102
|
+
itemIcon = symbolFilled;
|
|
81
103
|
}
|
|
82
104
|
|
|
83
105
|
return createElement(Fragment, null, createElement("div", {
|
|
@@ -88,43 +110,51 @@ export default function GridItem({
|
|
|
88
110
|
as: "div",
|
|
89
111
|
...composite,
|
|
90
112
|
onClick: item.type !== PATTERNS ? onClick : undefined,
|
|
113
|
+
onKeyDown: isUserPattern ? onKeyDown : undefined,
|
|
91
114
|
"aria-label": item.title,
|
|
92
|
-
"aria-describedby":
|
|
93
|
-
onKeyDown: event => {
|
|
94
|
-
if (DELETE === event.keyCode || BACKSPACE === event.keyCode) {
|
|
95
|
-
setIsDeleteDialogOpen(true);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
115
|
+
"aria-describedby": ariaDescriptions.length ? ariaDescriptions.map((_, index) => `${descriptionId}-${index}`).join(' ') : undefined
|
|
98
116
|
}, isEmpty && __('Empty pattern'), !isEmpty && createElement(BlockPreview, {
|
|
99
117
|
blocks: item.blocks
|
|
100
|
-
})), ariaDescription
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
id: descriptionId
|
|
106
|
-
}, ariaDescription), createElement(HStack, {
|
|
118
|
+
})), ariaDescriptions.map((ariaDescription, index) => createElement("div", {
|
|
119
|
+
key: index,
|
|
120
|
+
hidden: true,
|
|
121
|
+
id: `${descriptionId}-${index}`
|
|
122
|
+
}, ariaDescription)), createElement(HStack, {
|
|
107
123
|
"aria-hidden": "true",
|
|
108
|
-
className: "edit-site-
|
|
124
|
+
className: "edit-site-patterns__footer",
|
|
109
125
|
justify: "space-between"
|
|
110
126
|
}, createElement(HStack, {
|
|
111
127
|
alignment: "center",
|
|
112
128
|
justify: "left",
|
|
113
129
|
spacing: 3,
|
|
114
|
-
className: "edit-site-
|
|
130
|
+
className: "edit-site-patterns__pattern-title"
|
|
115
131
|
}, icon && createElement(Icon, {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
132
|
+
className: "edit-site-patterns__pattern-icon",
|
|
133
|
+
icon: itemIcon
|
|
134
|
+
}), createElement(Flex, {
|
|
135
|
+
as: "span",
|
|
136
|
+
gap: 0,
|
|
137
|
+
justify: "left"
|
|
138
|
+
}, item.title, item.type === PATTERNS && createElement(Tooltip, {
|
|
139
|
+
position: "top center",
|
|
140
|
+
text: __('Theme patterns cannot be edited.')
|
|
141
|
+
}, createElement("span", {
|
|
142
|
+
className: "edit-site-patterns__pattern-lock-icon"
|
|
143
|
+
}, createElement(Icon, {
|
|
144
|
+
style: {
|
|
145
|
+
fill: 'currentcolor'
|
|
146
|
+
},
|
|
147
|
+
icon: lockSmall,
|
|
148
|
+
size: 24
|
|
149
|
+
}))))), item.type === USER_PATTERNS && createElement(DropdownMenu, {
|
|
120
150
|
icon: moreHorizontal,
|
|
121
151
|
label: __('Actions'),
|
|
122
|
-
className: "edit-site-
|
|
152
|
+
className: "edit-site-patterns__dropdown",
|
|
123
153
|
popoverProps: {
|
|
124
154
|
placement: 'bottom-end'
|
|
125
155
|
},
|
|
126
156
|
toggleProps: {
|
|
127
|
-
className: 'edit-site-
|
|
157
|
+
className: 'edit-site-patterns__button',
|
|
128
158
|
isSmall: true,
|
|
129
159
|
describedBy: sprintf(
|
|
130
160
|
/* translators: %s: pattern name */
|