@wordpress/edit-site 6.10.0 → 6.11.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-post/index.js +1 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +8 -8
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -0
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +29 -20
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +10 -8
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +23 -10
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-adapt-editor-to-canvas.js +49 -0
- package/build/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
- package/build/components/editor/use-editor-title.js +2 -2
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +6 -6
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +4 -4
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/palette.js +16 -13
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/root-menu.js +0 -4
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +0 -4
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-root.js +0 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +5 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +9 -10
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/shadows-panel.js +0 -3
- package/build/components/global-styles/shadows-panel.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +1 -4
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/ui.js +7 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +2 -2
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +0 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +43 -30
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/animation.js +1 -3
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/index.js +22 -35
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +17 -140
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +3 -3
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +1 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-templates/index.js +1 -2
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +1 -1
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/post-edit/index.js +8 -4
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +6 -52
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +1 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app/router.js +4 -4
- package/build/components/posts-app/router.js.map +1 -1
- package/build/components/resizable-frame/index.js +21 -9
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-keyboard-shortcut/index.js +78 -0
- package/build/components/save-keyboard-shortcut/index.js.map +1 -0
- package/build/components/save-panel/index.js +17 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +30 -10
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -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 +3 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +7 -12
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/site-editor-routes/home-edit.js +26 -0
- package/build/components/site-editor-routes/home-edit.js.map +1 -0
- package/build/components/site-editor-routes/home-view.js +25 -0
- package/build/components/site-editor-routes/home-view.js.map +1 -0
- package/build/components/site-editor-routes/index.js +49 -0
- package/build/components/site-editor-routes/index.js.map +1 -0
- package/build/components/site-editor-routes/navigation-edit.js +29 -0
- package/build/components/site-editor-routes/navigation-edit.js.map +1 -0
- package/build/components/site-editor-routes/navigation-item-edit.js +31 -0
- package/build/components/site-editor-routes/navigation-item-edit.js.map +1 -0
- package/build/components/site-editor-routes/navigation-item-view.js +30 -0
- package/build/components/site-editor-routes/navigation-item-view.js.map +1 -0
- package/build/components/site-editor-routes/navigation-view.js +28 -0
- package/build/components/site-editor-routes/navigation-view.js.map +1 -0
- package/build/components/site-editor-routes/pages-edit.js +43 -0
- package/build/components/site-editor-routes/pages-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +64 -0
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-list-view.js +47 -0
- package/build/components/site-editor-routes/pages-list-view.js.map +1 -0
- package/build/components/site-editor-routes/pages-view-quick-edit.js +61 -0
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
- package/build/components/site-editor-routes/pages-view.js +42 -0
- package/build/components/site-editor-routes/pages-view.js.map +1 -0
- package/build/components/site-editor-routes/patterns-edit.js +31 -0
- package/build/components/site-editor-routes/patterns-edit.js.map +1 -0
- package/build/components/site-editor-routes/patterns-view.js +29 -0
- package/build/components/site-editor-routes/patterns-view.js.map +1 -0
- package/build/components/site-editor-routes/styles-edit.js +28 -0
- package/build/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build/components/site-editor-routes/styles-view.js +27 -0
- package/build/components/site-editor-routes/styles-view.js.map +1 -0
- package/build/components/site-editor-routes/templates-edit.js +31 -0
- package/build/components/site-editor-routes/templates-edit.js.map +1 -0
- package/build/components/site-editor-routes/templates-list-view.js +34 -0
- package/build/components/site-editor-routes/templates-list-view.js.map +1 -0
- package/build/components/site-editor-routes/templates-view.js +29 -0
- package/build/components/site-editor-routes/templates-view.js.map +1 -0
- package/build/components/site-hub/index.js +3 -2
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/color-examples.js +46 -0
- package/build/components/style-book/color-examples.js.map +1 -0
- package/build/components/style-book/constants.js +75 -10
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/duotone-examples.js +55 -0
- package/build/components/style-book/duotone-examples.js.map +1 -0
- package/build/components/style-book/examples.js +46 -3
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +92 -36
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +46 -30
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +10 -6
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +12 -15
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/store/private-actions.js +8 -60
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +4 -12
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +9 -18
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/add-new-post/index.js +1 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -1
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +9 -9
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +4 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +30 -21
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +10 -8
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +23 -10
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.js +42 -0
- package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +1 -0
- package/build-module/components/editor/use-editor-title.js +3 -3
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +6 -6
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -4
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/palette.js +17 -14
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +0 -4
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +0 -4
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +0 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +5 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +9 -10
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/shadows-panel.js +0 -3
- package/build-module/components/global-styles/shadows-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +2 -5
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/ui.js +7 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +3 -3
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +0 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +44 -31
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/animation.js +1 -3
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/index.js +22 -35
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +17 -139
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +4 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-templates/index.js +1 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +1 -1
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +8 -4
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -51
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +1 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +2 -2
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app/router.js +3 -3
- package/build-module/components/posts-app/router.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +21 -10
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-keyboard-shortcut/index.js +71 -0
- package/build-module/components/save-keyboard-shortcut/index.js.map +1 -0
- package/build-module/components/save-panel/index.js +17 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +2 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +30 -10
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- 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 +4 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +8 -13
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/site-editor-routes/home-edit.js +18 -0
- package/build-module/components/site-editor-routes/home-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/home-view.js +17 -0
- package/build-module/components/site-editor-routes/home-view.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +42 -0
- package/build-module/components/site-editor-routes/index.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-edit.js +21 -0
- package/build-module/components/site-editor-routes/navigation-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-item-edit.js +23 -0
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-item-view.js +22 -0
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation-view.js +20 -0
- package/build-module/components/site-editor-routes/navigation-view.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-edit.js +35 -0
- package/build-module/components/site-editor-routes/pages-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-list-view.js +39 -0
- package/build-module/components/site-editor-routes/pages-list-view.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +53 -0
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/pages-view.js +34 -0
- package/build-module/components/site-editor-routes/pages-view.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns-edit.js +23 -0
- package/build-module/components/site-editor-routes/patterns-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/patterns-view.js +21 -0
- package/build-module/components/site-editor-routes/patterns-view.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-edit.js +20 -0
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-view.js +19 -0
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-edit.js +23 -0
- package/build-module/components/site-editor-routes/templates-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-list-view.js +26 -0
- package/build-module/components/site-editor-routes/templates-list-view.js.map +1 -0
- package/build-module/components/site-editor-routes/templates-view.js +21 -0
- package/build-module/components/site-editor-routes/templates-view.js.map +1 -0
- package/build-module/components/site-hub/index.js +3 -2
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/color-examples.js +38 -0
- package/build-module/components/style-book/color-examples.js.map +1 -0
- package/build-module/components/style-book/constants.js +74 -9
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/duotone-examples.js +48 -0
- package/build-module/components/style-book/duotone-examples.js.map +1 -0
- package/build-module/components/style-book/examples.js +47 -3
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +94 -38
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/style-book/types.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +6 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +46 -30
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +10 -6
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +12 -15
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/store/private-actions.js +6 -58
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -11
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +9 -18
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/posts-rtl.css +10 -13
- package/build-style/posts.css +10 -13
- package/build-style/style-rtl.css +127 -26
- package/build-style/style.css +127 -26
- package/package.json +43 -41
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/add-new-template/index.js +1 -1
- package/src/components/add-new-template/utils.js +12 -9
- package/src/components/app/index.js +4 -2
- package/src/components/block-editor/use-editor-iframe-props.js +22 -18
- package/src/components/block-editor/use-site-editor-settings.js +12 -10
- package/src/components/editor/index.js +34 -13
- package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
- package/src/components/editor/use-editor-title.js +3 -3
- package/src/components/global-styles/font-sizes/font-size.js +11 -15
- package/src/components/global-styles/font-sizes/font-sizes-count.js +1 -4
- package/src/components/global-styles/font-sizes/font-sizes.js +7 -9
- package/src/components/global-styles/palette.js +21 -18
- package/src/components/global-styles/root-menu.js +3 -16
- package/src/components/global-styles/screen-block-list.js +0 -7
- package/src/components/global-styles/screen-css.js +1 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/src/components/global-styles/screen-root.js +3 -12
- package/src/components/global-styles/screen-style-variations.js +4 -1
- package/src/components/global-styles/shadows-edit-panel.js +12 -13
- package/src/components/global-styles/shadows-panel.js +0 -4
- package/src/components/global-styles/typography-elements.js +3 -11
- package/src/components/global-styles/ui.js +11 -0
- package/src/components/global-styles/variations/variation.js +3 -3
- package/src/components/global-styles/variations/variations-panel.js +0 -1
- package/src/components/global-styles-sidebar/default-sidebar.js +0 -1
- package/src/components/global-styles-sidebar/index.js +86 -65
- package/src/components/global-styles-sidebar/style.scss +6 -0
- package/src/components/layout/animation.js +0 -1
- package/src/components/layout/index.js +16 -34
- package/src/components/layout/router.js +18 -133
- package/src/components/layout/style.scss +2 -2
- package/src/components/page-patterns/delete-category-menu-item.js +4 -4
- package/src/components/page-patterns/use-pattern-settings.js +1 -1
- package/src/components/page-templates/index.js +0 -1
- package/src/components/pagination/index.js +1 -1
- package/src/components/post-edit/index.js +35 -4
- package/src/components/post-fields/index.js +7 -54
- package/src/components/post-fields/style.scss +3 -0
- package/src/components/post-list/index.js +1 -1
- package/src/components/post-list/style.scss +1 -1
- package/src/components/posts-app/index.js +2 -2
- package/src/components/posts-app/router.js +3 -3
- package/src/components/resizable-frame/index.js +19 -10
- package/src/components/revisions/index.js +4 -1
- package/src/components/save-keyboard-shortcut/index.js +69 -0
- package/src/components/save-panel/index.js +30 -32
- package/src/components/sidebar-dataviews/default-views.js +2 -5
- package/src/components/sidebar-navigation-screen/index.js +2 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +47 -29
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +11 -13
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +1 -1
- package/src/components/site-editor-routes/README.md +20 -0
- package/src/components/site-editor-routes/home-edit.js +17 -0
- package/src/components/site-editor-routes/home-view.js +16 -0
- package/src/components/site-editor-routes/index.js +60 -0
- package/src/components/site-editor-routes/navigation-edit.js +22 -0
- package/src/components/site-editor-routes/navigation-item-edit.js +26 -0
- package/src/components/site-editor-routes/navigation-item-view.js +25 -0
- package/src/components/site-editor-routes/navigation-view.js +21 -0
- package/src/components/site-editor-routes/pages-edit.js +35 -0
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +56 -0
- package/src/components/site-editor-routes/pages-list-view.js +44 -0
- package/src/components/site-editor-routes/pages-view-quick-edit.js +53 -0
- package/src/components/site-editor-routes/pages-view.js +39 -0
- package/src/components/site-editor-routes/patterns-edit.js +24 -0
- package/src/components/site-editor-routes/patterns-view.js +22 -0
- package/src/components/site-editor-routes/styles-edit.js +17 -0
- package/src/components/site-editor-routes/styles-view.js +16 -0
- package/src/components/site-editor-routes/templates-edit.js +22 -0
- package/src/components/site-editor-routes/templates-list-view.js +28 -0
- package/src/components/site-editor-routes/templates-view.js +22 -0
- package/src/components/site-hub/index.js +2 -2
- package/src/components/site-hub/style.scss +4 -0
- package/src/components/style-book/color-examples.tsx +44 -0
- package/src/components/style-book/constants.ts +83 -10
- package/src/components/style-book/duotone-examples.tsx +53 -0
- package/src/components/style-book/examples.tsx +113 -0
- package/src/components/style-book/index.js +149 -52
- package/src/components/style-book/style.scss +12 -14
- package/src/components/style-book/test/categories.js +0 -5
- package/src/components/style-book/types.ts +34 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +11 -1
- package/src/hooks/commands/use-common-commands.js +60 -40
- package/src/hooks/commands/use-edit-mode-commands.js +14 -18
- package/src/hooks/commands/use-set-command-context.js +7 -9
- package/src/store/private-actions.js +7 -79
- package/src/store/private-selectors.js +4 -11
- package/src/store/reducer.js +10 -18
- package/src/style.scss +3 -0
- package/build/components/keyboard-shortcuts/global.js +0 -53
- package/build/components/keyboard-shortcuts/global.js.map +0 -1
- package/build/components/keyboard-shortcuts/register.js +0 -34
- package/build/components/keyboard-shortcuts/register.js.map +0 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -69
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/global.js +0 -46
- package/build-module/components/keyboard-shortcuts/global.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -27
- package/build-module/components/keyboard-shortcuts/register.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -62
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +0 -1
- package/src/components/keyboard-shortcuts/global.js +0 -47
- package/src/components/keyboard-shortcuts/register.js +0 -27
- package/src/components/style-book/examples.ts +0 -63
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +0 -73
|
@@ -6,7 +6,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
6
6
|
import { store as editorStore } from '@wordpress/editor';
|
|
7
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
8
|
import { useMemo, useCallback } from '@wordpress/element';
|
|
9
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
10
10
|
import { blockMeta, post, archive } from '@wordpress/icons';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -246,14 +246,17 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
|
|
|
246
246
|
if ( _needsUniqueIdentifier ) {
|
|
247
247
|
menuItemTitle = labels.template_name
|
|
248
248
|
? sprintf(
|
|
249
|
-
// translators:
|
|
250
|
-
|
|
249
|
+
// translators: 1: Name of the template e.g: "Single Item: Post". 2: Slug of the post type e.g: "book".
|
|
250
|
+
_x( '%1$s (%2$s)', 'post type menu label' ),
|
|
251
251
|
labels.template_name,
|
|
252
252
|
slug
|
|
253
253
|
)
|
|
254
254
|
: sprintf(
|
|
255
|
-
// translators:
|
|
256
|
-
|
|
255
|
+
// translators: 1: Name of the post type e.g: "Post". 2: Slug of the post type e.g: "book".
|
|
256
|
+
_x(
|
|
257
|
+
'Single item: %1$s (%2$s)',
|
|
258
|
+
'post type menu label'
|
|
259
|
+
),
|
|
257
260
|
labels.singular_name,
|
|
258
261
|
slug
|
|
259
262
|
);
|
|
@@ -410,14 +413,14 @@ export const useTaxonomiesMenuItems = ( onClickMenuItem ) => {
|
|
|
410
413
|
if ( _needsUniqueIdentifier ) {
|
|
411
414
|
menuItemTitle = labels.template_name
|
|
412
415
|
? sprintf(
|
|
413
|
-
// translators:
|
|
414
|
-
|
|
416
|
+
// translators: 1: Name of the template e.g: "Products by Category". 2s: Slug of the taxonomy e.g: "product_cat".
|
|
417
|
+
_x( '%1$s (%2$s)', 'taxonomy template menu label' ),
|
|
415
418
|
labels.template_name,
|
|
416
419
|
slug
|
|
417
420
|
)
|
|
418
421
|
: sprintf(
|
|
419
|
-
// translators:
|
|
420
|
-
|
|
422
|
+
// translators: 1: Name of the taxonomy e.g: "Category". 2: Slug of the taxonomy e.g: "product_cat".
|
|
423
|
+
_x( '%1$s (%2$s)', 'taxonomy menu label' ),
|
|
421
424
|
labels.singular_name,
|
|
422
425
|
slug
|
|
423
426
|
);
|
|
@@ -20,8 +20,9 @@ import { unlock } from '../../lock-unlock';
|
|
|
20
20
|
import { useCommonCommands } from '../../hooks/commands/use-common-commands';
|
|
21
21
|
import { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';
|
|
22
22
|
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
23
|
-
import
|
|
23
|
+
import useActiveRoute from '../layout/router';
|
|
24
24
|
import useSetCommandContext from '../../hooks/commands/use-set-command-context';
|
|
25
|
+
import { useRegisterSiteEditorRoutes } from '../site-editor-routes';
|
|
25
26
|
|
|
26
27
|
const { RouterProvider } = unlock( routerPrivateApis );
|
|
27
28
|
const { GlobalStylesProvider } = unlock( editorPrivateApis );
|
|
@@ -32,7 +33,8 @@ function AppLayout() {
|
|
|
32
33
|
useEditModeCommands();
|
|
33
34
|
useCommonCommands();
|
|
34
35
|
useSetCommandContext();
|
|
35
|
-
|
|
36
|
+
useRegisterSiteEditorRoutes();
|
|
37
|
+
const route = useActiveRoute();
|
|
36
38
|
|
|
37
39
|
return <Layout route={ route } />;
|
|
38
40
|
}
|
|
@@ -6,37 +6,37 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useSelect
|
|
9
|
+
import { useSelect } from '@wordpress/data';
|
|
10
10
|
import { ENTER, SPACE } from '@wordpress/keycodes';
|
|
11
11
|
import { useState, useEffect } from '@wordpress/element';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
import { store as editorStore } from '@wordpress/editor';
|
|
14
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
17
18
|
*/
|
|
18
19
|
import { unlock } from '../../lock-unlock';
|
|
19
|
-
import { store as editSiteStore } from '../../store';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
const { canvasMode, currentPostIsTrashed } = useSelect( ( select ) => {
|
|
23
|
-
const { getCanvasMode } = unlock( select( editSiteStore ) );
|
|
21
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
export default function useEditorIframeProps() {
|
|
24
|
+
const { params } = useLocation();
|
|
25
|
+
const history = useHistory();
|
|
26
|
+
const { canvas = 'view' } = params;
|
|
27
|
+
const currentPostIsTrashed = useSelect( ( select ) => {
|
|
28
|
+
return (
|
|
29
|
+
select( editorStore ).getCurrentPostAttribute( 'status' ) ===
|
|
30
|
+
'trash'
|
|
31
|
+
);
|
|
31
32
|
}, [] );
|
|
32
|
-
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
33
33
|
const [ isFocused, setIsFocused ] = useState( false );
|
|
34
34
|
|
|
35
35
|
useEffect( () => {
|
|
36
|
-
if (
|
|
36
|
+
if ( canvas === 'edit' ) {
|
|
37
37
|
setIsFocused( false );
|
|
38
38
|
}
|
|
39
|
-
}, [
|
|
39
|
+
}, [ canvas ] );
|
|
40
40
|
|
|
41
41
|
// In view mode, make the canvas iframe be perceived and behave as a button
|
|
42
42
|
// to switch to edit mode, with a meaningful label and no title attribute.
|
|
@@ -55,11 +55,15 @@ export default function useEditorIframeProps() {
|
|
|
55
55
|
! currentPostIsTrashed
|
|
56
56
|
) {
|
|
57
57
|
event.preventDefault();
|
|
58
|
-
|
|
58
|
+
history.push( { ...params, canvas: 'edit' }, undefined, {
|
|
59
|
+
transition: 'canvas-mode-edit-transition',
|
|
60
|
+
} );
|
|
59
61
|
}
|
|
60
62
|
},
|
|
61
63
|
onClick: () => {
|
|
62
|
-
|
|
64
|
+
history.push( { ...params, canvas: 'edit' }, undefined, {
|
|
65
|
+
transition: 'canvas-mode-edit-transition',
|
|
66
|
+
} );
|
|
63
67
|
},
|
|
64
68
|
onClickCapture: ( event ) => {
|
|
65
69
|
if ( currentPostIsTrashed ) {
|
|
@@ -72,8 +76,8 @@ export default function useEditorIframeProps() {
|
|
|
72
76
|
|
|
73
77
|
return {
|
|
74
78
|
className: clsx( 'edit-site-visual-editor__editor-canvas', {
|
|
75
|
-
'is-focused': isFocused &&
|
|
79
|
+
'is-focused': isFocused && canvas === 'view',
|
|
76
80
|
} ),
|
|
77
|
-
...(
|
|
81
|
+
...( canvas === 'view' ? viewModeIframeProps : {} ),
|
|
78
82
|
};
|
|
79
83
|
}
|
|
@@ -29,31 +29,33 @@ function useNavigateToPreviousEntityRecord() {
|
|
|
29
29
|
previousLocation?.params.canvas === 'edit';
|
|
30
30
|
const showBackButton = isFocusMode && didComeFromEditorCanvas;
|
|
31
31
|
return showBackButton ? () => history.back() : undefined;
|
|
32
|
-
//
|
|
32
|
+
// `previousLocation` changes when the component updates for any reason, not
|
|
33
33
|
// just when location changes. Until this is fixed we can't add it to deps. See
|
|
34
34
|
// https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465.
|
|
35
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
35
|
}, [ location, history ] );
|
|
37
36
|
return goBack;
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export function useSpecificEditorSettings() {
|
|
40
|
+
const { params } = useLocation();
|
|
41
|
+
const { canvas = 'view' } = params;
|
|
41
42
|
const onNavigateToEntityRecord = useNavigateToEntityRecord();
|
|
42
|
-
const {
|
|
43
|
-
|
|
44
|
-
const { getEditedPostContext,
|
|
43
|
+
const { settings, shouldUseTemplateAsDefaultRenderingMode } = useSelect(
|
|
44
|
+
( select ) => {
|
|
45
|
+
const { getEditedPostContext, getSettings } = unlock(
|
|
45
46
|
select( editSiteStore )
|
|
46
47
|
);
|
|
47
48
|
const _context = getEditedPostContext();
|
|
48
49
|
return {
|
|
49
|
-
canvasMode: getCanvasMode(),
|
|
50
50
|
settings: getSettings(),
|
|
51
51
|
// TODO: The `postType` check should be removed when the default rendering mode per post type is merged.
|
|
52
52
|
// @see https://github.com/WordPress/gutenberg/pull/62304/
|
|
53
53
|
shouldUseTemplateAsDefaultRenderingMode:
|
|
54
54
|
_context?.postId && _context?.postType !== 'post',
|
|
55
55
|
};
|
|
56
|
-
},
|
|
56
|
+
},
|
|
57
|
+
[]
|
|
58
|
+
);
|
|
57
59
|
const defaultRenderingMode = shouldUseTemplateAsDefaultRenderingMode
|
|
58
60
|
? 'template-locked'
|
|
59
61
|
: 'post-only';
|
|
@@ -65,15 +67,15 @@ export function useSpecificEditorSettings() {
|
|
|
65
67
|
|
|
66
68
|
richEditingEnabled: true,
|
|
67
69
|
supportsTemplateMode: true,
|
|
68
|
-
focusMode:
|
|
70
|
+
focusMode: canvas !== 'view',
|
|
69
71
|
defaultRenderingMode,
|
|
70
72
|
onNavigateToEntityRecord,
|
|
71
73
|
onNavigateToPreviousEntityRecord,
|
|
72
|
-
|
|
74
|
+
isPreviewMode: canvas === 'view',
|
|
73
75
|
};
|
|
74
76
|
}, [
|
|
75
77
|
settings,
|
|
76
|
-
|
|
78
|
+
canvas,
|
|
77
79
|
defaultRenderingMode,
|
|
78
80
|
onNavigateToEntityRecord,
|
|
79
81
|
onNavigateToPreviousEntityRecord,
|
|
@@ -23,6 +23,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
23
23
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
24
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
25
25
|
import { Icon, arrowUpLeft } from '@wordpress/icons';
|
|
26
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Internal dependencies
|
|
@@ -47,6 +48,7 @@ import SiteIcon from '../site-icon';
|
|
|
47
48
|
import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
|
|
48
49
|
import useEditorTitle from './use-editor-title';
|
|
49
50
|
import { useIsSiteEditorLoading } from '../layout/hooks';
|
|
51
|
+
import { useAdaptEditorToCanvas } from './use-adapt-editor-to-canvas';
|
|
50
52
|
|
|
51
53
|
const { Editor, BackButton } = unlock( editorPrivateApis );
|
|
52
54
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
@@ -79,13 +81,14 @@ const siteIconVariants = {
|
|
|
79
81
|
export default function EditSiteEditor( { isPostsList = false } ) {
|
|
80
82
|
const disableMotion = useReducedMotion();
|
|
81
83
|
const { params } = useLocation();
|
|
84
|
+
const { canvas = 'view' } = params;
|
|
82
85
|
const isLoading = useIsSiteEditorLoading();
|
|
86
|
+
useAdaptEditorToCanvas( canvas );
|
|
83
87
|
const {
|
|
84
88
|
editedPostType,
|
|
85
89
|
editedPostId,
|
|
86
90
|
contextPostType,
|
|
87
91
|
contextPostId,
|
|
88
|
-
canvasMode,
|
|
89
92
|
isEditingPage,
|
|
90
93
|
supportsGlobalStyles,
|
|
91
94
|
showIconLabels,
|
|
@@ -96,7 +99,6 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
96
99
|
const {
|
|
97
100
|
getEditorCanvasContainerView,
|
|
98
101
|
getEditedPostContext,
|
|
99
|
-
getCanvasMode,
|
|
100
102
|
isPage,
|
|
101
103
|
getEditedPostType,
|
|
102
104
|
getEditedPostId,
|
|
@@ -113,7 +115,6 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
113
115
|
editedPostId: getEditedPostId(),
|
|
114
116
|
contextPostType: _context?.postId ? _context.postType : undefined,
|
|
115
117
|
contextPostId: _context?.postId ? _context.postId : undefined,
|
|
116
|
-
canvasMode: getCanvasMode(),
|
|
117
118
|
isEditingPage: isPage(),
|
|
118
119
|
supportsGlobalStyles: getCurrentTheme()?.is_block_theme,
|
|
119
120
|
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
@@ -128,7 +129,7 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
128
129
|
const _isPreviewingTheme = isPreviewingTheme();
|
|
129
130
|
const hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();
|
|
130
131
|
const iframeProps = useEditorIframeProps();
|
|
131
|
-
const isEditMode =
|
|
132
|
+
const isEditMode = canvas === 'edit';
|
|
132
133
|
const postWithTemplate = !! contextPostId;
|
|
133
134
|
const loadingProgressId = useInstanceId(
|
|
134
135
|
CanvasLoader,
|
|
@@ -143,16 +144,16 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
143
144
|
// Forming a "block formatting context" to prevent margin collapsing.
|
|
144
145
|
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
145
146
|
css:
|
|
146
|
-
|
|
147
|
+
canvas === 'view'
|
|
147
148
|
? `body{min-height: 100vh; ${
|
|
148
149
|
currentPostIsTrashed ? '' : 'cursor: pointer;'
|
|
149
150
|
}}`
|
|
150
151
|
: undefined,
|
|
151
152
|
},
|
|
152
153
|
],
|
|
153
|
-
[ settings.styles,
|
|
154
|
+
[ settings.styles, canvas, currentPostIsTrashed ]
|
|
154
155
|
);
|
|
155
|
-
const {
|
|
156
|
+
const { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );
|
|
156
157
|
const { createSuccessNotice } = useDispatch( noticesStore );
|
|
157
158
|
const history = useHistory();
|
|
158
159
|
const onActionPerformed = useCallback(
|
|
@@ -175,7 +176,7 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
175
176
|
: newItem.title?.rendered;
|
|
176
177
|
createSuccessNotice(
|
|
177
178
|
sprintf(
|
|
178
|
-
// translators: %s: Title of the created post e.g: "
|
|
179
|
+
// translators: %s: Title of the created post or template, e.g: "Hello world".
|
|
179
180
|
__( '"%s" successfully created.' ),
|
|
180
181
|
decodeEntities( _title )
|
|
181
182
|
),
|
|
@@ -260,17 +261,37 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
260
261
|
showTooltip
|
|
261
262
|
tooltipPosition="middle right"
|
|
262
263
|
onClick={ () => {
|
|
263
|
-
|
|
264
|
+
resetZoomLevel();
|
|
265
|
+
|
|
264
266
|
// TODO: this is a temporary solution to navigate to the posts list if we are
|
|
265
267
|
// come here through `posts list` and are in focus mode editing a template, template part etc..
|
|
266
268
|
if (
|
|
267
269
|
isPostsList &&
|
|
268
270
|
params?.focusMode
|
|
269
271
|
) {
|
|
270
|
-
history.push(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
history.push(
|
|
273
|
+
{
|
|
274
|
+
page: 'gutenberg-posts-dashboard',
|
|
275
|
+
postType: 'post',
|
|
276
|
+
},
|
|
277
|
+
undefined,
|
|
278
|
+
{
|
|
279
|
+
transition:
|
|
280
|
+
'canvas-mode-view-transition',
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
} else {
|
|
284
|
+
history.push(
|
|
285
|
+
{
|
|
286
|
+
...params,
|
|
287
|
+
canvas: undefined,
|
|
288
|
+
},
|
|
289
|
+
undefined,
|
|
290
|
+
{
|
|
291
|
+
transition:
|
|
292
|
+
'canvas-mode-view-transition',
|
|
293
|
+
}
|
|
294
|
+
);
|
|
274
295
|
}
|
|
275
296
|
} }
|
|
276
297
|
>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
5
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
7
|
+
import { useLayoutEffect } from '@wordpress/element';
|
|
8
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
+
|
|
10
|
+
export function useAdaptEditorToCanvas( canvas ) {
|
|
11
|
+
const { clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
12
|
+
const {
|
|
13
|
+
setDeviceType,
|
|
14
|
+
closePublishSidebar,
|
|
15
|
+
setIsListViewOpened,
|
|
16
|
+
setIsInserterOpened,
|
|
17
|
+
} = useDispatch( editorStore );
|
|
18
|
+
const { get: getPreference } = useSelect( preferencesStore );
|
|
19
|
+
const registry = useRegistry();
|
|
20
|
+
useLayoutEffect( () => {
|
|
21
|
+
const isMediumOrBigger =
|
|
22
|
+
window.matchMedia( '(min-width: 782px)' ).matches;
|
|
23
|
+
registry.batch( () => {
|
|
24
|
+
clearSelectedBlock();
|
|
25
|
+
setDeviceType( 'Desktop' );
|
|
26
|
+
closePublishSidebar();
|
|
27
|
+
setIsInserterOpened( false );
|
|
28
|
+
|
|
29
|
+
// Check if the block list view should be open by default.
|
|
30
|
+
// If `distractionFree` mode is enabled, the block list view should not be open.
|
|
31
|
+
// This behavior is disabled for small viewports.
|
|
32
|
+
if (
|
|
33
|
+
isMediumOrBigger &&
|
|
34
|
+
canvas === 'edit' &&
|
|
35
|
+
getPreference( 'core', 'showListViewByDefault' ) &&
|
|
36
|
+
! getPreference( 'core', 'distractionFree' )
|
|
37
|
+
) {
|
|
38
|
+
setIsListViewOpened( true );
|
|
39
|
+
} else {
|
|
40
|
+
setIsListViewOpened( false );
|
|
41
|
+
}
|
|
42
|
+
} );
|
|
43
|
+
}, [
|
|
44
|
+
canvas,
|
|
45
|
+
registry,
|
|
46
|
+
clearSelectedBlock,
|
|
47
|
+
setDeviceType,
|
|
48
|
+
closePublishSidebar,
|
|
49
|
+
setIsInserterOpened,
|
|
50
|
+
setIsListViewOpened,
|
|
51
|
+
getPreference,
|
|
52
|
+
] );
|
|
53
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { _x, sprintf } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
@@ -19,8 +19,8 @@ function useEditorTitle() {
|
|
|
19
19
|
let title;
|
|
20
20
|
if ( hasLoadedPost ) {
|
|
21
21
|
title = sprintf(
|
|
22
|
-
// translators: A breadcrumb trail for the Admin document title.
|
|
23
|
-
|
|
22
|
+
// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).
|
|
23
|
+
_x( '%1$s ‹ %2$s', 'breadcrumb trail' ),
|
|
24
24
|
getTitle(),
|
|
25
25
|
POST_TYPE_LABELS[ editedPost.type ] ??
|
|
26
26
|
POST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]
|
|
@@ -27,7 +27,7 @@ import ConfirmDeleteFontSizeDialog from './confirm-delete-font-size-dialog';
|
|
|
27
27
|
import RenameFontSizeDialog from './rename-font-size-dialog';
|
|
28
28
|
import SizeControl from '../size-control';
|
|
29
29
|
|
|
30
|
-
const {
|
|
30
|
+
const { Menu } = unlock( componentsPrivateApis );
|
|
31
31
|
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
32
32
|
|
|
33
33
|
function FontSize() {
|
|
@@ -166,7 +166,7 @@ function FontSize() {
|
|
|
166
166
|
marginBottom={ 0 }
|
|
167
167
|
paddingX={ 4 }
|
|
168
168
|
>
|
|
169
|
-
<
|
|
169
|
+
<Menu
|
|
170
170
|
trigger={
|
|
171
171
|
<Button
|
|
172
172
|
size="small"
|
|
@@ -175,21 +175,17 @@ function FontSize() {
|
|
|
175
175
|
/>
|
|
176
176
|
}
|
|
177
177
|
>
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
>
|
|
181
|
-
<DropdownMenuV2.ItemLabel>
|
|
178
|
+
<Menu.Item onClick={ toggleRenameDialog }>
|
|
179
|
+
<Menu.ItemLabel>
|
|
182
180
|
{ __( 'Rename' ) }
|
|
183
|
-
</
|
|
184
|
-
</
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
>
|
|
188
|
-
<DropdownMenuV2.ItemLabel>
|
|
181
|
+
</Menu.ItemLabel>
|
|
182
|
+
</Menu.Item>
|
|
183
|
+
<Menu.Item onClick={ toggleDeleteConfirm }>
|
|
184
|
+
<Menu.ItemLabel>
|
|
189
185
|
{ __( 'Delete' ) }
|
|
190
|
-
</
|
|
191
|
-
</
|
|
192
|
-
</
|
|
186
|
+
</Menu.ItemLabel>
|
|
187
|
+
</Menu.Item>
|
|
188
|
+
</Menu>
|
|
193
189
|
</Spacer>
|
|
194
190
|
</FlexItem>
|
|
195
191
|
) }
|
|
@@ -23,10 +23,7 @@ function FontSizes() {
|
|
|
23
23
|
<Subtitle level={ 3 }>{ __( 'Font Sizes' ) }</Subtitle>
|
|
24
24
|
</HStack>
|
|
25
25
|
<ItemGroup isBordered isSeparated>
|
|
26
|
-
<NavigationButtonAsItem
|
|
27
|
-
path="/typography/font-sizes"
|
|
28
|
-
aria-label={ __( 'Edit font size presets' ) }
|
|
29
|
-
>
|
|
26
|
+
<NavigationButtonAsItem path="/typography/font-sizes">
|
|
30
27
|
<HStack direction="row">
|
|
31
28
|
<FlexItem>{ __( 'Font size presets' ) }</FlexItem>
|
|
32
29
|
<Icon icon={ isRTL() ? chevronLeft : chevronRight } />
|
|
@@ -27,7 +27,7 @@ import { useState } from '@wordpress/element';
|
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
29
|
import { unlock } from '../../../lock-unlock';
|
|
30
|
-
const {
|
|
30
|
+
const { Menu } = unlock( componentsPrivateApis );
|
|
31
31
|
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
32
32
|
import Subtitle from '../subtitle';
|
|
33
33
|
import { NavigationButtonAsItem } from '../navigation-button';
|
|
@@ -81,7 +81,7 @@ function FontSizeGroup( {
|
|
|
81
81
|
/>
|
|
82
82
|
) }
|
|
83
83
|
{ !! handleResetFontSizes && (
|
|
84
|
-
<
|
|
84
|
+
<Menu
|
|
85
85
|
trigger={
|
|
86
86
|
<Button
|
|
87
87
|
size="small"
|
|
@@ -92,16 +92,14 @@ function FontSizeGroup( {
|
|
|
92
92
|
/>
|
|
93
93
|
}
|
|
94
94
|
>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
>
|
|
98
|
-
<DropdownMenuV2.ItemLabel>
|
|
95
|
+
<Menu.Item onClick={ toggleResetDialog }>
|
|
96
|
+
<Menu.ItemLabel>
|
|
99
97
|
{ origin === 'custom'
|
|
100
98
|
? __( 'Remove font size presets' )
|
|
101
99
|
: __( 'Reset font size presets' ) }
|
|
102
|
-
</
|
|
103
|
-
</
|
|
104
|
-
</
|
|
100
|
+
</Menu.ItemLabel>
|
|
101
|
+
</Menu.Item>
|
|
102
|
+
</Menu>
|
|
105
103
|
) }
|
|
106
104
|
</FlexItem>
|
|
107
105
|
</HStack>
|
|
@@ -54,32 +54,35 @@ function Palette( { name } ) {
|
|
|
54
54
|
const screenPath = ! name
|
|
55
55
|
? '/colors/palette'
|
|
56
56
|
: '/blocks/' + encodeURIComponent( name ) + '/colors/palette';
|
|
57
|
-
const paletteButtonText =
|
|
58
|
-
colors.length > 0 ? __( 'Edit palette' ) : __( 'Add colors' );
|
|
59
57
|
|
|
60
58
|
return (
|
|
61
59
|
<VStack spacing={ 3 }>
|
|
62
60
|
<Subtitle level={ 3 }>{ __( 'Palette' ) }</Subtitle>
|
|
63
61
|
<ItemGroup isBordered isSeparated>
|
|
64
|
-
<NavigationButtonAsItem
|
|
65
|
-
path={ screenPath }
|
|
66
|
-
aria-label={ paletteButtonText }
|
|
67
|
-
>
|
|
62
|
+
<NavigationButtonAsItem path={ screenPath }>
|
|
68
63
|
<HStack direction="row">
|
|
69
|
-
{ colors.length
|
|
64
|
+
{ colors.length > 0 ? (
|
|
65
|
+
<>
|
|
66
|
+
<ZStack isLayered={ false } offset={ -8 }>
|
|
67
|
+
{ colors
|
|
68
|
+
.slice( 0, 5 )
|
|
69
|
+
.map( ( { color }, index ) => (
|
|
70
|
+
<ColorIndicatorWrapper
|
|
71
|
+
key={ `${ color }-${ index }` }
|
|
72
|
+
>
|
|
73
|
+
<ColorIndicator
|
|
74
|
+
colorValue={ color }
|
|
75
|
+
/>
|
|
76
|
+
</ColorIndicatorWrapper>
|
|
77
|
+
) ) }
|
|
78
|
+
</ZStack>
|
|
79
|
+
<FlexItem isBlock>
|
|
80
|
+
{ __( 'Edit palette' ) }
|
|
81
|
+
</FlexItem>
|
|
82
|
+
</>
|
|
83
|
+
) : (
|
|
70
84
|
<FlexItem>{ __( 'Add colors' ) }</FlexItem>
|
|
71
85
|
) }
|
|
72
|
-
<ZStack isLayered={ false } offset={ -8 }>
|
|
73
|
-
{ colors
|
|
74
|
-
.slice( 0, 5 )
|
|
75
|
-
.map( ( { color }, index ) => (
|
|
76
|
-
<ColorIndicatorWrapper
|
|
77
|
-
key={ `${ color }-${ index }` }
|
|
78
|
-
>
|
|
79
|
-
<ColorIndicator colorValue={ color } />
|
|
80
|
-
</ColorIndicatorWrapper>
|
|
81
|
-
) ) }
|
|
82
|
-
</ZStack>
|
|
83
86
|
<Icon icon={ isRTL() ? chevronLeft : chevronRight } />
|
|
84
87
|
</HStack>
|
|
85
88
|
</NavigationButtonAsItem>
|
|
@@ -48,17 +48,12 @@ function RootMenu() {
|
|
|
48
48
|
<NavigationButtonAsItem
|
|
49
49
|
icon={ typography }
|
|
50
50
|
path="/typography"
|
|
51
|
-
aria-label={ __( 'Typography styles' ) }
|
|
52
51
|
>
|
|
53
52
|
{ __( 'Typography' ) }
|
|
54
53
|
</NavigationButtonAsItem>
|
|
55
54
|
) }
|
|
56
55
|
{ hasColorPanel && (
|
|
57
|
-
<NavigationButtonAsItem
|
|
58
|
-
icon={ color }
|
|
59
|
-
path="/colors"
|
|
60
|
-
aria-label={ __( 'Colors styles' ) }
|
|
61
|
-
>
|
|
56
|
+
<NavigationButtonAsItem icon={ color } path="/colors">
|
|
62
57
|
{ __( 'Colors' ) }
|
|
63
58
|
</NavigationButtonAsItem>
|
|
64
59
|
) }
|
|
@@ -72,20 +67,12 @@ function RootMenu() {
|
|
|
72
67
|
</NavigationButtonAsItem>
|
|
73
68
|
) }
|
|
74
69
|
{ hasShadowPanel && (
|
|
75
|
-
<NavigationButtonAsItem
|
|
76
|
-
icon={ shadowIcon }
|
|
77
|
-
path="/shadows"
|
|
78
|
-
aria-label={ __( 'Shadow styles' ) }
|
|
79
|
-
>
|
|
70
|
+
<NavigationButtonAsItem icon={ shadowIcon } path="/shadows">
|
|
80
71
|
{ __( 'Shadows' ) }
|
|
81
72
|
</NavigationButtonAsItem>
|
|
82
73
|
) }
|
|
83
74
|
{ hasLayoutPanel && (
|
|
84
|
-
<NavigationButtonAsItem
|
|
85
|
-
icon={ layout }
|
|
86
|
-
path="/layout"
|
|
87
|
-
aria-label={ __( 'Layout styles' ) }
|
|
88
|
-
>
|
|
75
|
+
<NavigationButtonAsItem icon={ layout } path="/layout">
|
|
89
76
|
{ __( 'Layout' ) }
|
|
90
77
|
</NavigationButtonAsItem>
|
|
91
78
|
) }
|
|
@@ -86,16 +86,9 @@ function BlockMenuItem( { block } ) {
|
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const navigationButtonLabel = sprintf(
|
|
90
|
-
// translators: %s: is the name of a block e.g., 'Image' or 'Table'.
|
|
91
|
-
__( '%s block styles' ),
|
|
92
|
-
block.title
|
|
93
|
-
);
|
|
94
|
-
|
|
95
89
|
return (
|
|
96
90
|
<NavigationButtonAsItem
|
|
97
91
|
path={ '/blocks/' + encodeURIComponent( block.name ) }
|
|
98
|
-
aria-label={ navigationButtonLabel }
|
|
99
92
|
>
|
|
100
93
|
<HStack justify="flex-start">
|
|
101
94
|
<BlockIcon icon={ block.icon } />
|
|
@@ -71,7 +71,7 @@ function getRevisionLabel(
|
|
|
71
71
|
|
|
72
72
|
return areStylesEqual
|
|
73
73
|
? sprintf(
|
|
74
|
-
// translators:
|
|
74
|
+
// translators: 1: author display name. 2: revision creation date.
|
|
75
75
|
__(
|
|
76
76
|
'Changes saved by %1$s on %2$s. This revision matches current editor styles.'
|
|
77
77
|
),
|
|
@@ -79,7 +79,7 @@ function getRevisionLabel(
|
|
|
79
79
|
formattedModifiedDate
|
|
80
80
|
)
|
|
81
81
|
: sprintf(
|
|
82
|
-
// translators:
|
|
82
|
+
// translators: 1: author display name. 2: revision creation date.
|
|
83
83
|
__( 'Changes saved by %1$s on %2$s' ),
|
|
84
84
|
authorDisplayName,
|
|
85
85
|
formattedModifiedDate
|