@wordpress/edit-site 6.10.0 → 6.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-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 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +29 -22
- 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 +32 -14
- 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 +30 -13
- 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 +26 -24
- 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 +11 -13
- 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 +49 -2
- 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-renderer/index.js +6 -8
- package/build/components/global-styles-renderer/index.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/hooks.js +1 -10
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +23 -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/fields.js +3 -7
- package/build/components/page-patterns/fields.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/fields.js +1 -2
- package/build/components/page-templates/fields.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 +15 -5
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +4 -244
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +12 -2
- 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/index.js +11 -3
- package/build/components/sidebar/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-global-styles-wrapper/index.js +129 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- 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 +33 -71
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +43 -42
- package/build/components/sidebar-navigation-screen-main/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 +33 -0
- package/build/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build/components/site-editor-routes/styles-view.js +33 -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 +22 -8
- 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 +85 -13
- 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 +116 -3
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +161 -46
- 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 +38 -33
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +1 -9
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -12
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +61 -45
- package/build/hooks/commands/use-common-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/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.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 -4
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +30 -23
- 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 +32 -14
- 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 +31 -14
- 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 +27 -25
- 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 +11 -13
- 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 +50 -3
- 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-renderer/index.js +6 -8
- package/build-module/components/global-styles-renderer/index.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/hooks.js +1 -9
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +23 -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/fields.js +4 -8
- package/build-module/components/page-patterns/fields.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/fields.js +1 -2
- package/build-module/components/page-templates/fields.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 +15 -5
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -246
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +12 -2
- 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/index.js +11 -3
- package/build-module/components/sidebar/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-global-styles-wrapper/index.js +121 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- 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 +34 -72
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
- package/build-module/components/sidebar-navigation-screen-main/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 +25 -0
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -0
- package/build-module/components/site-editor-routes/styles-view.js +25 -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 +22 -8
- 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 +84 -12
- 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 +117 -3
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +164 -49
- 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 +38 -33
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -9
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -11
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +61 -45
- package/build-module/hooks/commands/use-common-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/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.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 +60 -14
- package/build-style/posts.css +60 -14
- package/build-style/style-rtl.css +232 -50
- package/build-style/style.css +232 -50
- package/package.json +42 -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 -4
- package/src/components/block-editor/use-editor-iframe-props.js +23 -20
- package/src/components/block-editor/use-site-editor-settings.js +12 -10
- package/src/components/editor/index.js +50 -17
- package/src/components/editor/use-adapt-editor-to-canvas.js +53 -0
- package/src/components/editor/use-editor-title.js +40 -16
- package/src/components/editor-canvas-container/style.scss +0 -1
- 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 +30 -33
- package/src/components/global-styles/screen-revisions/style.scss +11 -17
- 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 +16 -15
- 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 +53 -2
- 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-renderer/index.js +4 -10
- 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/hooks.js +1 -7
- package/src/components/layout/index.js +22 -35
- 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/fields.js +6 -12
- package/src/components/page-patterns/style.scss +0 -5
- package/src/components/page-patterns/use-pattern-settings.js +1 -1
- package/src/components/page-templates/fields.js +2 -3
- package/src/components/page-templates/index.js +0 -1
- package/src/components/pagination/index.js +1 -1
- package/src/components/post-edit/index.js +45 -6
- package/src/components/post-edit/style.scss +7 -0
- package/src/components/post-fields/index.js +22 -323
- package/src/components/post-fields/style.scss +3 -0
- package/src/components/post-list/index.js +10 -4
- package/src/components/post-list/style.scss +30 -4
- 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/index.js +23 -7
- package/src/components/sidebar-dataviews/default-views.js +2 -5
- package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
- package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
- package/src/components/sidebar-navigation-item/style.scss +2 -2
- package/src/components/sidebar-navigation-screen/index.js +2 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +42 -99
- package/src/components/sidebar-navigation-screen-main/index.js +46 -45
- 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 +26 -0
- package/src/components/site-editor-routes/styles-view.js +26 -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 +35 -18
- package/src/components/site-hub/style.scss +4 -0
- package/src/components/site-icon/style.scss +16 -0
- package/src/components/style-book/color-examples.tsx +44 -0
- package/src/components/style-book/constants.ts +94 -13
- package/src/components/style-book/duotone-examples.tsx +53 -0
- package/src/components/style-book/examples.tsx +217 -0
- package/src/components/style-book/index.js +235 -60
- 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 +65 -65
- package/src/components/welcome-guide/index.js +3 -3
- package/src/components/welcome-guide/page.js +1 -7
- package/src/components/welcome-guide/template.js +1 -8
- package/src/hooks/commands/use-common-commands.js +257 -230
- package/src/hooks/commands/use-set-command-context.js +7 -9
- package/src/index.js +1 -0
- package/src/posts.js +1 -0
- 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 -1
- package/build/components/async/index.js +0 -51
- package/build/components/async/index.js.map +0 -1
- 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/components/use-edited-entity-record/index.js +0 -60
- package/build/components/use-edited-entity-record/index.js.map +0 -1
- package/build/hooks/commands/use-edit-mode-commands.js +0 -175
- package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/build-module/components/async/index.js +0 -44
- package/build-module/components/async/index.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/build-module/components/use-edited-entity-record/index.js +0 -53
- package/build-module/components/use-edited-entity-record/index.js.map +0 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +0 -167
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/src/components/async/index.js +0 -43
- 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
- package/src/components/use-edited-entity-record/index.js +0 -58
- package/src/hooks/commands/use-edit-mode-commands.js +0 -172
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { edit, seen } from '@wordpress/icons';
|
|
6
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
9
7
|
import { useCallback } from '@wordpress/element';
|
|
10
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
11
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* Internal dependencies
|
|
@@ -16,17 +14,15 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
16
14
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
17
15
|
import { unlock } from '../../lock-unlock';
|
|
18
16
|
import { store as editSiteStore } from '../../store';
|
|
19
|
-
import SidebarButton from '../sidebar-button';
|
|
20
17
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
21
|
-
import StyleBook from '../style-book';
|
|
22
18
|
import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
|
|
23
19
|
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
24
|
-
import
|
|
20
|
+
import { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
const { openGeneralSidebar } = useDispatch( editSiteStore );
|
|
28
|
-
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
22
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
29
23
|
|
|
24
|
+
export function SidebarNavigationItemGlobalStyles( props ) {
|
|
25
|
+
const { params } = useLocation();
|
|
30
26
|
const hasGlobalStyleVariations = useSelect(
|
|
31
27
|
( select ) =>
|
|
32
28
|
!! select(
|
|
@@ -40,75 +36,54 @@ export function SidebarNavigationItemGlobalStyles( props ) {
|
|
|
40
36
|
{ ...props }
|
|
41
37
|
params={ { path: '/wp_global_styles' } }
|
|
42
38
|
uid="global-styles-navigation-item"
|
|
39
|
+
aria-current={
|
|
40
|
+
params.path && params.path.startsWith( '/wp_global_styles' )
|
|
41
|
+
}
|
|
43
42
|
/>
|
|
44
43
|
);
|
|
45
44
|
}
|
|
46
|
-
return
|
|
47
|
-
<SidebarNavigationItem
|
|
48
|
-
{ ...props }
|
|
49
|
-
onClick={ () => {
|
|
50
|
-
// Switch to edit mode.
|
|
51
|
-
setCanvasMode( 'edit' );
|
|
52
|
-
// Open global styles sidebar.
|
|
53
|
-
openGeneralSidebar( 'edit-site/global-styles' );
|
|
54
|
-
} }
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
45
|
+
return <SidebarNavigationItem { ...props } />;
|
|
57
46
|
}
|
|
58
47
|
|
|
59
|
-
export default function SidebarNavigationScreenGlobalStyles(
|
|
48
|
+
export default function SidebarNavigationScreenGlobalStyles() {
|
|
49
|
+
const history = useHistory();
|
|
50
|
+
const { params } = useLocation();
|
|
60
51
|
const { revisions, isLoading: isLoadingRevisions } =
|
|
61
52
|
useGlobalStylesRevisions();
|
|
62
53
|
const { openGeneralSidebar } = useDispatch( editSiteStore );
|
|
63
|
-
const {
|
|
64
|
-
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
65
|
-
const { setCanvasMode, setEditorCanvasContainerView } = unlock(
|
|
54
|
+
const { setEditorCanvasContainerView } = unlock(
|
|
66
55
|
useDispatch( editSiteStore )
|
|
67
56
|
);
|
|
68
|
-
const {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
isViewMode: 'view' === getCanvasMode(),
|
|
81
|
-
isStyleBookOpened:
|
|
82
|
-
'style-book' === getEditorCanvasContainerView(),
|
|
83
|
-
revisionsCount:
|
|
84
|
-
globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??
|
|
85
|
-
0,
|
|
86
|
-
};
|
|
87
|
-
},
|
|
88
|
-
[]
|
|
89
|
-
);
|
|
57
|
+
const { revisionsCount } = useSelect( ( select ) => {
|
|
58
|
+
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =
|
|
59
|
+
select( coreStore );
|
|
60
|
+
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
61
|
+
const globalStyles = globalStylesId
|
|
62
|
+
? getEntityRecord( 'root', 'globalStyles', globalStylesId )
|
|
63
|
+
: undefined;
|
|
64
|
+
return {
|
|
65
|
+
revisionsCount:
|
|
66
|
+
globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,
|
|
67
|
+
};
|
|
68
|
+
}, [] );
|
|
90
69
|
const { set: setPreference } = useDispatch( preferencesStore );
|
|
91
70
|
|
|
92
71
|
const openGlobalStyles = useCallback( async () => {
|
|
72
|
+
history.push(
|
|
73
|
+
{
|
|
74
|
+
...params,
|
|
75
|
+
canvas: 'edit',
|
|
76
|
+
},
|
|
77
|
+
undefined,
|
|
78
|
+
{
|
|
79
|
+
transition: 'canvas-mode-edit-transition',
|
|
80
|
+
}
|
|
81
|
+
);
|
|
93
82
|
return Promise.all( [
|
|
94
83
|
setPreference( 'core', 'distractionFree', false ),
|
|
95
|
-
setCanvasMode( 'edit' ),
|
|
96
84
|
openGeneralSidebar( 'edit-site/global-styles' ),
|
|
97
85
|
] );
|
|
98
|
-
}, [
|
|
99
|
-
|
|
100
|
-
const openStyleBook = useCallback( async () => {
|
|
101
|
-
await openGlobalStyles();
|
|
102
|
-
// Open the Style Book once the canvas mode is set to edit,
|
|
103
|
-
// and the global styles sidebar is open. This ensures that
|
|
104
|
-
// the Style Book is not prematurely closed.
|
|
105
|
-
setEditorCanvasContainerView( 'style-book' );
|
|
106
|
-
setIsListViewOpened( false );
|
|
107
|
-
}, [
|
|
108
|
-
openGlobalStyles,
|
|
109
|
-
setEditorCanvasContainerView,
|
|
110
|
-
setIsListViewOpened,
|
|
111
|
-
] );
|
|
86
|
+
}, [ history, params, openGeneralSidebar, setPreference ] );
|
|
112
87
|
|
|
113
88
|
const openRevisions = useCallback( async () => {
|
|
114
89
|
await openGlobalStyles();
|
|
@@ -124,16 +99,17 @@ export default function SidebarNavigationScreenGlobalStyles( { backPath } ) {
|
|
|
124
99
|
const modifiedDateTime = revisions?.[ 0 ]?.modified;
|
|
125
100
|
const shouldShowGlobalStylesFooter =
|
|
126
101
|
hasRevisions && ! isLoadingRevisions && modifiedDateTime;
|
|
127
|
-
|
|
128
102
|
return (
|
|
129
103
|
<>
|
|
130
104
|
<SidebarNavigationScreen
|
|
131
|
-
title={ __( '
|
|
105
|
+
title={ __( 'Design' ) }
|
|
106
|
+
isRoot
|
|
132
107
|
description={ __(
|
|
133
|
-
'
|
|
108
|
+
'Customize the appearance of your website using the block editor.'
|
|
134
109
|
) }
|
|
135
|
-
|
|
136
|
-
|
|
110
|
+
content={
|
|
111
|
+
<MainSidebarNavigationContent activeItem="styles-navigation-item" />
|
|
112
|
+
}
|
|
137
113
|
footer={
|
|
138
114
|
shouldShowGlobalStylesFooter && (
|
|
139
115
|
<SidebarNavigationScreenDetailsFooter
|
|
@@ -142,40 +118,7 @@ export default function SidebarNavigationScreenGlobalStyles( { backPath } ) {
|
|
|
142
118
|
/>
|
|
143
119
|
)
|
|
144
120
|
}
|
|
145
|
-
actions={
|
|
146
|
-
<>
|
|
147
|
-
{ ! isMobileViewport && (
|
|
148
|
-
<SidebarButton
|
|
149
|
-
icon={ seen }
|
|
150
|
-
label={ __( 'Style Book' ) }
|
|
151
|
-
onClick={ () =>
|
|
152
|
-
setEditorCanvasContainerView(
|
|
153
|
-
! isStyleBookOpened
|
|
154
|
-
? 'style-book'
|
|
155
|
-
: undefined
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
isPressed={ isStyleBookOpened }
|
|
159
|
-
/>
|
|
160
|
-
) }
|
|
161
|
-
<SidebarButton
|
|
162
|
-
icon={ edit }
|
|
163
|
-
label={ __( 'Edit styles' ) }
|
|
164
|
-
onClick={ async () => await openGlobalStyles() }
|
|
165
|
-
/>
|
|
166
|
-
</>
|
|
167
|
-
}
|
|
168
121
|
/>
|
|
169
|
-
{ isStyleBookOpened && ! isMobileViewport && isViewMode && (
|
|
170
|
-
<StyleBook
|
|
171
|
-
enableResizing={ false }
|
|
172
|
-
isSelected={ () => false }
|
|
173
|
-
onClick={ openStyleBook }
|
|
174
|
-
onSelect={ openStyleBook }
|
|
175
|
-
showCloseButton={ false }
|
|
176
|
-
showTabs={ false }
|
|
177
|
-
/>
|
|
178
|
-
) }
|
|
179
122
|
</>
|
|
180
123
|
);
|
|
181
124
|
}
|
|
@@ -21,6 +21,51 @@ import {
|
|
|
21
21
|
PATTERN_TYPES,
|
|
22
22
|
} from '../../utils/constants';
|
|
23
23
|
|
|
24
|
+
export function MainSidebarNavigationContent() {
|
|
25
|
+
return (
|
|
26
|
+
<ItemGroup>
|
|
27
|
+
<SidebarNavigationItem
|
|
28
|
+
uid="navigation-navigation-item"
|
|
29
|
+
params={ { postType: NAVIGATION_POST_TYPE } }
|
|
30
|
+
withChevron
|
|
31
|
+
icon={ navigation }
|
|
32
|
+
>
|
|
33
|
+
{ __( 'Navigation' ) }
|
|
34
|
+
</SidebarNavigationItem>
|
|
35
|
+
<SidebarNavigationItemGlobalStyles
|
|
36
|
+
uid="styles-navigation-item"
|
|
37
|
+
icon={ styles }
|
|
38
|
+
>
|
|
39
|
+
{ __( 'Styles' ) }
|
|
40
|
+
</SidebarNavigationItemGlobalStyles>
|
|
41
|
+
<SidebarNavigationItem
|
|
42
|
+
uid="page-navigation-item"
|
|
43
|
+
params={ { postType: 'page' } }
|
|
44
|
+
withChevron
|
|
45
|
+
icon={ page }
|
|
46
|
+
>
|
|
47
|
+
{ __( 'Pages' ) }
|
|
48
|
+
</SidebarNavigationItem>
|
|
49
|
+
<SidebarNavigationItem
|
|
50
|
+
uid="template-navigation-item"
|
|
51
|
+
params={ { postType: TEMPLATE_POST_TYPE } }
|
|
52
|
+
withChevron
|
|
53
|
+
icon={ layout }
|
|
54
|
+
>
|
|
55
|
+
{ __( 'Templates' ) }
|
|
56
|
+
</SidebarNavigationItem>
|
|
57
|
+
<SidebarNavigationItem
|
|
58
|
+
uid="patterns-navigation-item"
|
|
59
|
+
params={ { postType: PATTERN_TYPES.user } }
|
|
60
|
+
withChevron
|
|
61
|
+
icon={ symbol }
|
|
62
|
+
>
|
|
63
|
+
{ __( 'Patterns' ) }
|
|
64
|
+
</SidebarNavigationItem>
|
|
65
|
+
</ItemGroup>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
24
69
|
export default function SidebarNavigationScreenMain() {
|
|
25
70
|
const { setEditorCanvasContainerView } = unlock(
|
|
26
71
|
useDispatch( editSiteStore )
|
|
@@ -38,51 +83,7 @@ export default function SidebarNavigationScreenMain() {
|
|
|
38
83
|
description={ __(
|
|
39
84
|
'Customize the appearance of your website using the block editor.'
|
|
40
85
|
) }
|
|
41
|
-
content={
|
|
42
|
-
<>
|
|
43
|
-
<ItemGroup>
|
|
44
|
-
<SidebarNavigationItem
|
|
45
|
-
uid="navigation-navigation-item"
|
|
46
|
-
params={ { postType: NAVIGATION_POST_TYPE } }
|
|
47
|
-
withChevron
|
|
48
|
-
icon={ navigation }
|
|
49
|
-
>
|
|
50
|
-
{ __( 'Navigation' ) }
|
|
51
|
-
</SidebarNavigationItem>
|
|
52
|
-
<SidebarNavigationItemGlobalStyles
|
|
53
|
-
uid="styles-navigation-item"
|
|
54
|
-
withChevron
|
|
55
|
-
icon={ styles }
|
|
56
|
-
>
|
|
57
|
-
{ __( 'Styles' ) }
|
|
58
|
-
</SidebarNavigationItemGlobalStyles>
|
|
59
|
-
<SidebarNavigationItem
|
|
60
|
-
uid="page-navigation-item"
|
|
61
|
-
params={ { postType: 'page' } }
|
|
62
|
-
withChevron
|
|
63
|
-
icon={ page }
|
|
64
|
-
>
|
|
65
|
-
{ __( 'Pages' ) }
|
|
66
|
-
</SidebarNavigationItem>
|
|
67
|
-
<SidebarNavigationItem
|
|
68
|
-
uid="template-navigation-item"
|
|
69
|
-
params={ { postType: TEMPLATE_POST_TYPE } }
|
|
70
|
-
withChevron
|
|
71
|
-
icon={ layout }
|
|
72
|
-
>
|
|
73
|
-
{ __( 'Templates' ) }
|
|
74
|
-
</SidebarNavigationItem>
|
|
75
|
-
<SidebarNavigationItem
|
|
76
|
-
uid="patterns-navigation-item"
|
|
77
|
-
params={ { postType: PATTERN_TYPES.user } }
|
|
78
|
-
withChevron
|
|
79
|
-
icon={ symbol }
|
|
80
|
-
>
|
|
81
|
-
{ __( 'Patterns' ) }
|
|
82
|
-
</SidebarNavigationItem>
|
|
83
|
-
</ItemGroup>
|
|
84
|
-
</>
|
|
85
|
-
}
|
|
86
|
+
content={ <MainSidebarNavigationContent /> }
|
|
86
87
|
/>
|
|
87
88
|
);
|
|
88
89
|
}
|
package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { store as coreStore } from '@wordpress/core-data';
|
|
5
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
7
|
import { store as noticesStore } from '@wordpress/notices';
|
|
8
8
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
@@ -150,7 +150,7 @@ function useDuplicateNavigationMenu() {
|
|
|
150
150
|
{
|
|
151
151
|
title: sprintf(
|
|
152
152
|
/* translators: %s: Navigation menu title */
|
|
153
|
-
|
|
153
|
+
_x( '%s (Copy)', 'navigation menu' ),
|
|
154
154
|
menuTitle
|
|
155
155
|
),
|
|
156
156
|
content: navigationMenu?.content?.raw,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
4
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
6
6
|
|
|
7
7
|
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
8
8
|
export default function buildNavigationLabel( title, id, status ) {
|
|
9
9
|
if ( ! title?.rendered ) {
|
|
10
|
-
/* translators: %s
|
|
10
|
+
/* translators: %s: the index of the menu in the list of menus. */
|
|
11
11
|
return sprintf( __( '(no title %s)' ), id );
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -16,8 +16,8 @@ export default function buildNavigationLabel( title, id, status ) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
return sprintf(
|
|
19
|
-
// translators:
|
|
20
|
-
|
|
19
|
+
// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
|
|
20
|
+
_x( '%1$s (%2$s)', 'menu label' ),
|
|
21
21
|
decodeEntities( title?.rendered ),
|
|
22
22
|
status
|
|
23
23
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
4
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
|
27
27
|
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
28
28
|
function buildMenuLabel( title, id, status ) {
|
|
29
29
|
if ( ! title ) {
|
|
30
|
-
/* translators: %s
|
|
30
|
+
/* translators: %s: the index of the menu in the list of menus. */
|
|
31
31
|
return sprintf( __( '(no title %s)' ), id );
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -36,16 +36,13 @@ function buildMenuLabel( title, id, status ) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
return sprintf(
|
|
39
|
-
// translators:
|
|
40
|
-
|
|
39
|
+
// translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.).
|
|
40
|
+
_x( '%1$s (%2$s)', 'menu label' ),
|
|
41
41
|
decodeEntities( title ),
|
|
42
42
|
status
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// Save a boolean to prevent us creating a fallback more than once per session.
|
|
47
|
-
let hasCreatedFallback = false;
|
|
48
|
-
|
|
49
46
|
export default function SidebarNavigationScreenNavigationMenus( { backPath } ) {
|
|
50
47
|
const {
|
|
51
48
|
records: navigationMenus,
|
|
@@ -61,21 +58,22 @@ export default function SidebarNavigationScreenNavigationMenus( { backPath } ) {
|
|
|
61
58
|
isResolvingNavigationMenus && ! hasResolvedNavigationMenus;
|
|
62
59
|
|
|
63
60
|
const { getNavigationFallbackId } = unlock( useSelect( coreStore ) );
|
|
61
|
+
const isCreatingNavigationFallback = useSelect(
|
|
62
|
+
( select ) =>
|
|
63
|
+
select( coreStore ).isResolving( 'getNavigationFallbackId' ),
|
|
64
|
+
[]
|
|
65
|
+
);
|
|
64
66
|
|
|
65
67
|
const firstNavigationMenu = navigationMenus?.[ 0 ];
|
|
66
68
|
|
|
67
|
-
// Save a boolean to prevent us creating a fallback more than once per session.
|
|
68
|
-
if ( firstNavigationMenu ) {
|
|
69
|
-
hasCreatedFallback = true;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
69
|
// If there is no navigation menu found
|
|
73
70
|
// then trigger fallback algorithm to create one.
|
|
74
71
|
if (
|
|
75
72
|
! firstNavigationMenu &&
|
|
76
73
|
! isResolvingNavigationMenus &&
|
|
77
74
|
hasResolvedNavigationMenus &&
|
|
78
|
-
|
|
75
|
+
// Ensure a fallback navigation is created only once
|
|
76
|
+
! isCreatingNavigationFallback
|
|
79
77
|
) {
|
|
80
78
|
getNavigationFallbackId();
|
|
81
79
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Site Editor Routes
|
|
2
|
+
|
|
3
|
+
## Areas
|
|
4
|
+
|
|
5
|
+
When `canvasMode` is not `edit`, the areas avaliable to use are:
|
|
6
|
+
|
|
7
|
+
| Area | Non-mobile viewport | Mobile viewport |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `sidebar` | Always rendered. | Only if `mobile` is not provided. |
|
|
10
|
+
| `content` | Rendered if provided. | Not rendered. |
|
|
11
|
+
| `preview` | Rendered if provided. | Not rendered. |
|
|
12
|
+
| `edit` | Rendered if provided. | Not rendered. |
|
|
13
|
+
| `mobile` | Not rendered | Rendered as full-screen, if provided. |
|
|
14
|
+
|
|
15
|
+
When `canvasMode` is `edit`, the areas avaliable to use are:
|
|
16
|
+
|
|
17
|
+
| Area | Non-mobile viewport | Mobile viewport |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `preview` | Rendered as full-screen, if provided. Otherwise, it'll display an empty blank sidebar. | Not rendered. |
|
|
20
|
+
| `mobile` | Not rendered | Rendered as full-screen, if provided. Otherwise, it'll display an empty blank sidebar. |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import Editor from '../editor';
|
|
5
|
+
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
6
|
+
|
|
7
|
+
export const homeEditRoute = {
|
|
8
|
+
name: 'home-edit',
|
|
9
|
+
match: ( params ) => {
|
|
10
|
+
return params.canvas === 'edit';
|
|
11
|
+
},
|
|
12
|
+
areas: {
|
|
13
|
+
sidebar: <SidebarNavigationScreenMain />,
|
|
14
|
+
preview: <Editor />,
|
|
15
|
+
mobile: <Editor />,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import Editor from '../editor';
|
|
5
|
+
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
6
|
+
|
|
7
|
+
export const homeViewRoute = {
|
|
8
|
+
name: 'home-view',
|
|
9
|
+
match: ( params ) => {
|
|
10
|
+
return params.canvas !== 'edit';
|
|
11
|
+
},
|
|
12
|
+
areas: {
|
|
13
|
+
sidebar: <SidebarNavigationScreenMain />,
|
|
14
|
+
preview: <Editor />,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useRegistry, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useEffect } from '@wordpress/element';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { unlock } from '../../lock-unlock';
|
|
11
|
+
import { store as siteEditorStore } from '../../store';
|
|
12
|
+
import { homeViewRoute } from './home-view';
|
|
13
|
+
import { homeEditRoute } from './home-edit';
|
|
14
|
+
import { navigationViewRoute } from './navigation-view';
|
|
15
|
+
import { navigationEditRoute } from './navigation-edit';
|
|
16
|
+
import { navigationItemEditRoute } from './navigation-item-edit';
|
|
17
|
+
import { navigationItemViewRoute } from './navigation-item-view';
|
|
18
|
+
import { stylesEditRoute } from './styles-edit';
|
|
19
|
+
import { stylesViewRoute } from './styles-view';
|
|
20
|
+
import { patternsEditRoute } from './patterns-edit';
|
|
21
|
+
import { patternsViewRoute } from './patterns-view';
|
|
22
|
+
import { templatesEditRoute } from './templates-edit';
|
|
23
|
+
import { templatesListViewRoute } from './templates-list-view';
|
|
24
|
+
import { templatesViewRoute } from './templates-view';
|
|
25
|
+
import { pagesViewRoute } from './pages-view';
|
|
26
|
+
import { pagesEditRoute } from './pages-edit';
|
|
27
|
+
import { pagesListViewRoute } from './pages-list-view';
|
|
28
|
+
import { pagesListViewQuickEditRoute } from './pages-list-view-quick-edit';
|
|
29
|
+
import { pagesViewQuickEditRoute } from './pages-view-quick-edit';
|
|
30
|
+
|
|
31
|
+
const routes = [
|
|
32
|
+
pagesListViewQuickEditRoute,
|
|
33
|
+
pagesListViewRoute,
|
|
34
|
+
pagesViewQuickEditRoute,
|
|
35
|
+
pagesViewRoute,
|
|
36
|
+
pagesEditRoute,
|
|
37
|
+
templatesEditRoute,
|
|
38
|
+
templatesListViewRoute,
|
|
39
|
+
templatesViewRoute,
|
|
40
|
+
patternsViewRoute,
|
|
41
|
+
patternsEditRoute,
|
|
42
|
+
stylesViewRoute,
|
|
43
|
+
stylesEditRoute,
|
|
44
|
+
navigationItemViewRoute,
|
|
45
|
+
navigationItemEditRoute,
|
|
46
|
+
navigationViewRoute,
|
|
47
|
+
navigationEditRoute,
|
|
48
|
+
homeViewRoute,
|
|
49
|
+
homeEditRoute,
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
export function useRegisterSiteEditorRoutes() {
|
|
53
|
+
const registry = useRegistry();
|
|
54
|
+
const { registerRoute } = unlock( useDispatch( siteEditorStore ) );
|
|
55
|
+
useEffect( () => {
|
|
56
|
+
registry.batch( () => {
|
|
57
|
+
routes.forEach( registerRoute );
|
|
58
|
+
} );
|
|
59
|
+
}, [ registry, registerRoute ] );
|
|
60
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
5
|
+
import Editor from '../editor';
|
|
6
|
+
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
7
|
+
|
|
8
|
+
export const navigationEditRoute = {
|
|
9
|
+
name: 'navigation-edit',
|
|
10
|
+
match: ( params ) => {
|
|
11
|
+
return (
|
|
12
|
+
params.postType === NAVIGATION_POST_TYPE &&
|
|
13
|
+
! params.postId &&
|
|
14
|
+
params.canvas === 'edit'
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
areas: {
|
|
18
|
+
sidebar: <SidebarNavigationScreenNavigationMenus backPath={ {} } />,
|
|
19
|
+
preview: <Editor />,
|
|
20
|
+
mobile: <Editor />,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
5
|
+
import Editor from '../editor';
|
|
6
|
+
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
7
|
+
|
|
8
|
+
export const navigationItemEditRoute = {
|
|
9
|
+
name: 'navigation-item-edit',
|
|
10
|
+
match: ( params ) => {
|
|
11
|
+
return (
|
|
12
|
+
params.postType === NAVIGATION_POST_TYPE &&
|
|
13
|
+
!! params.postId &&
|
|
14
|
+
params.canvas === 'edit'
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
areas: {
|
|
18
|
+
sidebar: (
|
|
19
|
+
<SidebarNavigationScreenNavigationMenu
|
|
20
|
+
backPath={ { postType: NAVIGATION_POST_TYPE } }
|
|
21
|
+
/>
|
|
22
|
+
),
|
|
23
|
+
preview: <Editor />,
|
|
24
|
+
mobile: <Editor />,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
5
|
+
import Editor from '../editor';
|
|
6
|
+
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
7
|
+
|
|
8
|
+
export const navigationItemViewRoute = {
|
|
9
|
+
name: 'navigation-item-view',
|
|
10
|
+
match: ( params ) => {
|
|
11
|
+
return (
|
|
12
|
+
params.postType === NAVIGATION_POST_TYPE &&
|
|
13
|
+
!! params.postId &&
|
|
14
|
+
params.canvas !== 'edit'
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
areas: {
|
|
18
|
+
sidebar: (
|
|
19
|
+
<SidebarNavigationScreenNavigationMenu
|
|
20
|
+
backPath={ { postType: NAVIGATION_POST_TYPE } }
|
|
21
|
+
/>
|
|
22
|
+
),
|
|
23
|
+
preview: <Editor />,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
5
|
+
import Editor from '../editor';
|
|
6
|
+
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
7
|
+
|
|
8
|
+
export const navigationViewRoute = {
|
|
9
|
+
name: 'navigation-view',
|
|
10
|
+
match: ( params ) => {
|
|
11
|
+
return (
|
|
12
|
+
params.postType === NAVIGATION_POST_TYPE &&
|
|
13
|
+
! params.postId &&
|
|
14
|
+
params.canvas !== 'edit'
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
areas: {
|
|
18
|
+
sidebar: <SidebarNavigationScreenNavigationMenus backPath={ {} } />,
|
|
19
|
+
preview: <Editor />,
|
|
20
|
+
},
|
|
21
|
+
};
|