@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
|
@@ -2,31 +2,19 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useEffect, useMemo } from '@wordpress/element';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { unlock } from '../../lock-unlock';
|
|
11
|
-
import Editor from '../editor';
|
|
12
|
-
import PostList from '../post-list';
|
|
13
|
-
import PagePatterns from '../page-patterns';
|
|
14
|
-
import PageTemplates from '../page-templates';
|
|
15
|
-
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
16
|
-
import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
|
|
17
|
-
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
18
|
-
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
19
|
-
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
20
|
-
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
|
|
21
|
-
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
22
|
-
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
23
11
|
import {
|
|
24
12
|
NAVIGATION_POST_TYPE,
|
|
25
13
|
PATTERN_TYPES,
|
|
26
14
|
TEMPLATE_PART_POST_TYPE,
|
|
27
15
|
TEMPLATE_POST_TYPE,
|
|
28
16
|
} from '../../utils/constants';
|
|
29
|
-
import {
|
|
17
|
+
import { store as editSiteStore } from '../../store';
|
|
30
18
|
|
|
31
19
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
32
20
|
|
|
@@ -73,129 +61,26 @@ function useRedirectOldPaths() {
|
|
|
73
61
|
}, [ history, params ] );
|
|
74
62
|
}
|
|
75
63
|
|
|
76
|
-
export default function
|
|
64
|
+
export default function useActiveRoute() {
|
|
77
65
|
const { params } = useLocation();
|
|
78
|
-
const { postType, postId, path, layout, isCustom, canvas, quickEdit } =
|
|
79
|
-
params;
|
|
80
|
-
const hasEditCanvasMode = canvas === 'edit';
|
|
81
66
|
useRedirectOldPaths();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
key: 'pages',
|
|
89
|
-
areas: {
|
|
90
|
-
sidebar: (
|
|
91
|
-
<SidebarNavigationScreen
|
|
92
|
-
title={ __( 'Pages' ) }
|
|
93
|
-
backPath={ {} }
|
|
94
|
-
content={ <DataViewsSidebarContent /> }
|
|
95
|
-
/>
|
|
96
|
-
),
|
|
97
|
-
content: <PostList postType={ postType } />,
|
|
98
|
-
preview: ! showQuickEdit &&
|
|
99
|
-
( isListLayout || hasEditCanvasMode ) && <Editor />,
|
|
100
|
-
mobile: hasEditCanvasMode ? (
|
|
101
|
-
<Editor />
|
|
102
|
-
) : (
|
|
103
|
-
<PostList postType={ postType } />
|
|
104
|
-
),
|
|
105
|
-
edit: showQuickEdit && (
|
|
106
|
-
<PostEdit postType={ postType } postId={ postId } />
|
|
107
|
-
),
|
|
108
|
-
},
|
|
109
|
-
widths: {
|
|
110
|
-
content: isListLayout ? 380 : undefined,
|
|
111
|
-
edit: showQuickEdit ? 380 : undefined,
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Templates
|
|
117
|
-
if ( postType === TEMPLATE_POST_TYPE ) {
|
|
118
|
-
const isListLayout = isCustom !== 'true' && layout === 'list';
|
|
119
|
-
return {
|
|
120
|
-
key: 'templates',
|
|
121
|
-
areas: {
|
|
122
|
-
sidebar: (
|
|
123
|
-
<SidebarNavigationScreenTemplatesBrowse backPath={ {} } />
|
|
124
|
-
),
|
|
125
|
-
content: <PageTemplates />,
|
|
126
|
-
preview: ( isListLayout || hasEditCanvasMode ) && <Editor />,
|
|
127
|
-
mobile: hasEditCanvasMode ? <Editor /> : <PageTemplates />,
|
|
128
|
-
},
|
|
129
|
-
widths: {
|
|
130
|
-
content: isListLayout ? 380 : undefined,
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Patterns
|
|
136
|
-
if (
|
|
137
|
-
[ TEMPLATE_PART_POST_TYPE, PATTERN_TYPES.user ].includes( postType )
|
|
138
|
-
) {
|
|
139
|
-
return {
|
|
140
|
-
key: 'patterns',
|
|
141
|
-
areas: {
|
|
142
|
-
sidebar: <SidebarNavigationScreenPatterns backPath={ {} } />,
|
|
143
|
-
content: <PagePatterns />,
|
|
144
|
-
mobile: hasEditCanvasMode ? <Editor /> : <PagePatterns />,
|
|
145
|
-
preview: hasEditCanvasMode && <Editor />,
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Styles
|
|
151
|
-
if ( path === '/wp_global_styles' ) {
|
|
152
|
-
return {
|
|
153
|
-
key: 'styles',
|
|
154
|
-
areas: {
|
|
155
|
-
sidebar: (
|
|
156
|
-
<SidebarNavigationScreenGlobalStyles backPath={ {} } />
|
|
157
|
-
),
|
|
158
|
-
preview: <Editor />,
|
|
159
|
-
mobile: hasEditCanvasMode && <Editor />,
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Navigation
|
|
165
|
-
if ( postType === NAVIGATION_POST_TYPE ) {
|
|
166
|
-
if ( postId ) {
|
|
67
|
+
const routes = useSelect( ( select ) => {
|
|
68
|
+
return unlock( select( editSiteStore ) ).getRoutes();
|
|
69
|
+
}, [] );
|
|
70
|
+
return useMemo( () => {
|
|
71
|
+
const matchedRoute = routes.find( ( route ) => route.match( params ) );
|
|
72
|
+
if ( ! matchedRoute ) {
|
|
167
73
|
return {
|
|
168
|
-
key:
|
|
169
|
-
areas: {
|
|
170
|
-
|
|
171
|
-
<SidebarNavigationScreenNavigationMenu
|
|
172
|
-
backPath={ { postType: NAVIGATION_POST_TYPE } }
|
|
173
|
-
/>
|
|
174
|
-
),
|
|
175
|
-
preview: <Editor />,
|
|
176
|
-
mobile: hasEditCanvasMode && <Editor />,
|
|
177
|
-
},
|
|
74
|
+
key: 404,
|
|
75
|
+
areas: {},
|
|
76
|
+
widths: {},
|
|
178
77
|
};
|
|
179
78
|
}
|
|
79
|
+
|
|
180
80
|
return {
|
|
181
|
-
|
|
182
|
-
areas:
|
|
183
|
-
|
|
184
|
-
<SidebarNavigationScreenNavigationMenus backPath={ {} } />
|
|
185
|
-
),
|
|
186
|
-
preview: <Editor />,
|
|
187
|
-
mobile: hasEditCanvasMode && <Editor />,
|
|
188
|
-
},
|
|
81
|
+
name: matchedRoute.name,
|
|
82
|
+
areas: matchedRoute.areas,
|
|
83
|
+
widths: matchedRoute.widths,
|
|
189
84
|
};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Fallback shows the home page preview
|
|
193
|
-
return {
|
|
194
|
-
key: 'default',
|
|
195
|
-
areas: {
|
|
196
|
-
sidebar: <SidebarNavigationScreenMain />,
|
|
197
|
-
preview: <Editor />,
|
|
198
|
-
mobile: hasEditCanvasMode && <Editor />,
|
|
199
|
-
},
|
|
200
|
-
};
|
|
85
|
+
}, [ routes, params ] );
|
|
201
86
|
}
|
|
@@ -210,8 +210,8 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
210
210
|
|
|
211
211
|
.edit-site-layout__view-mode-toggle-icon {
|
|
212
212
|
display: flex;
|
|
213
|
-
height: $
|
|
214
|
-
width: $
|
|
213
|
+
height: $header-height;
|
|
214
|
+
width: $header-height;
|
|
215
215
|
justify-content: center;
|
|
216
216
|
align-items: center;
|
|
217
217
|
}
|
|
@@ -9,7 +9,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
9
9
|
import { useDispatch } from '@wordpress/data';
|
|
10
10
|
import { useState } from '@wordpress/element';
|
|
11
11
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
12
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
13
13
|
import { store as noticesStore } from '@wordpress/notices';
|
|
14
14
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
15
15
|
|
|
@@ -51,8 +51,8 @@ export default function DeleteCategoryMenuItem( { category, onClose } ) {
|
|
|
51
51
|
|
|
52
52
|
createSuccessNotice(
|
|
53
53
|
sprintf(
|
|
54
|
-
/* translators: The pattern category's name */
|
|
55
|
-
|
|
54
|
+
/* translators: %s: The pattern category's name */
|
|
55
|
+
_x( '"%s" deleted.', 'pattern category' ),
|
|
56
56
|
category.label
|
|
57
57
|
),
|
|
58
58
|
{ type: 'snackbar', id: 'pattern-category-delete' }
|
|
@@ -91,7 +91,7 @@ export default function DeleteCategoryMenuItem( { category, onClose } ) {
|
|
|
91
91
|
className="edit-site-patterns__delete-modal"
|
|
92
92
|
title={ sprintf(
|
|
93
93
|
// translators: %s: The pattern category's name.
|
|
94
|
-
|
|
94
|
+
_x( 'Delete "%s"?', 'pattern category' ),
|
|
95
95
|
decodeEntities( category.label )
|
|
96
96
|
) }
|
|
97
97
|
size="medium"
|
|
@@ -65,7 +65,7 @@ export default function Pagination( {
|
|
|
65
65
|
</HStack>
|
|
66
66
|
<Text variant="muted">
|
|
67
67
|
{ sprintf(
|
|
68
|
-
// translators:
|
|
68
|
+
// translators: 1: Current page number. 2: Total number of pages.
|
|
69
69
|
_x( '%1$s of %2$s', 'paging' ),
|
|
70
70
|
currentPage,
|
|
71
71
|
numPages
|
|
@@ -60,18 +60,40 @@ function PostEditForm( { postType, postId } ) {
|
|
|
60
60
|
);
|
|
61
61
|
const form = {
|
|
62
62
|
type: 'panel',
|
|
63
|
-
fields: [
|
|
63
|
+
fields: [
|
|
64
|
+
'featured_media',
|
|
65
|
+
'title',
|
|
66
|
+
'author',
|
|
67
|
+
'date',
|
|
68
|
+
'slug',
|
|
69
|
+
'parent',
|
|
70
|
+
'comment_status',
|
|
71
|
+
],
|
|
64
72
|
};
|
|
73
|
+
|
|
74
|
+
const fieldsWithBulkEditSupport = [
|
|
75
|
+
'title',
|
|
76
|
+
'status',
|
|
77
|
+
'date',
|
|
78
|
+
'author',
|
|
79
|
+
'comment_status',
|
|
80
|
+
];
|
|
81
|
+
|
|
65
82
|
const onChange = ( edits ) => {
|
|
66
83
|
for ( const id of ids ) {
|
|
67
84
|
if (
|
|
85
|
+
edits.status &&
|
|
68
86
|
edits.status !== 'future' &&
|
|
69
|
-
record
|
|
87
|
+
record?.status === 'future' &&
|
|
70
88
|
new Date( record.date ) > new Date()
|
|
71
89
|
) {
|
|
72
90
|
edits.date = null;
|
|
73
91
|
}
|
|
74
|
-
if (
|
|
92
|
+
if (
|
|
93
|
+
edits.status &&
|
|
94
|
+
edits.status === 'private' &&
|
|
95
|
+
record.password
|
|
96
|
+
) {
|
|
75
97
|
edits.password = '';
|
|
76
98
|
}
|
|
77
99
|
editEntityRecord( 'postType', postType, id, edits );
|
|
@@ -95,7 +117,16 @@ function PostEditForm( { postType, postId } ) {
|
|
|
95
117
|
<DataForm
|
|
96
118
|
data={ ids.length === 1 ? record : multiEdits }
|
|
97
119
|
fields={ fields }
|
|
98
|
-
form={
|
|
120
|
+
form={
|
|
121
|
+
ids.length === 1
|
|
122
|
+
? form
|
|
123
|
+
: {
|
|
124
|
+
...form,
|
|
125
|
+
fields: form.fields.filter( ( field ) =>
|
|
126
|
+
fieldsWithBulkEditSupport.includes( field )
|
|
127
|
+
),
|
|
128
|
+
}
|
|
129
|
+
}
|
|
99
130
|
onChange={ onChange }
|
|
100
131
|
/>
|
|
101
132
|
</VStack>
|
|
@@ -8,6 +8,7 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { __, sprintf } from '@wordpress/i18n';
|
|
10
10
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
+
import { featuredImageField, slugField, parentField } from '@wordpress/fields';
|
|
11
12
|
import {
|
|
12
13
|
createInterpolateElement,
|
|
13
14
|
useMemo,
|
|
@@ -33,11 +34,9 @@ import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
|
|
|
33
34
|
import {
|
|
34
35
|
LAYOUT_GRID,
|
|
35
36
|
LAYOUT_TABLE,
|
|
36
|
-
LAYOUT_LIST,
|
|
37
37
|
OPERATOR_IS_ANY,
|
|
38
38
|
} from '../../utils/constants';
|
|
39
|
-
import { default as Link
|
|
40
|
-
import Media from '../media';
|
|
39
|
+
import { default as Link } from '../routes/link';
|
|
41
40
|
|
|
42
41
|
// See https://github.com/WordPress/gutenberg/issues/55886
|
|
43
42
|
// We do not support custom statutes at the moment.
|
|
@@ -81,46 +80,6 @@ const getFormattedDate = ( dateToDisplay ) =>
|
|
|
81
80
|
getDate( dateToDisplay )
|
|
82
81
|
);
|
|
83
82
|
|
|
84
|
-
function FeaturedImage( { item, viewType } ) {
|
|
85
|
-
const isDisabled = item.status === 'trash';
|
|
86
|
-
const { onClick } = useLink( {
|
|
87
|
-
postId: item.id,
|
|
88
|
-
postType: item.type,
|
|
89
|
-
canvas: 'edit',
|
|
90
|
-
} );
|
|
91
|
-
const hasMedia = !! item.featured_media;
|
|
92
|
-
const size =
|
|
93
|
-
viewType === LAYOUT_GRID
|
|
94
|
-
? [ 'large', 'full', 'medium', 'thumbnail' ]
|
|
95
|
-
: [ 'thumbnail', 'medium', 'large', 'full' ];
|
|
96
|
-
const media = hasMedia ? (
|
|
97
|
-
<Media
|
|
98
|
-
className="edit-site-post-list__featured-image"
|
|
99
|
-
id={ item.featured_media }
|
|
100
|
-
size={ size }
|
|
101
|
-
/>
|
|
102
|
-
) : null;
|
|
103
|
-
const renderButton = viewType !== LAYOUT_LIST && ! isDisabled;
|
|
104
|
-
return (
|
|
105
|
-
<div
|
|
106
|
-
className={ `edit-site-post-list__featured-image-wrapper is-layout-${ viewType }` }
|
|
107
|
-
>
|
|
108
|
-
{ renderButton ? (
|
|
109
|
-
<button
|
|
110
|
-
className="edit-site-post-list__featured-image-button"
|
|
111
|
-
type="button"
|
|
112
|
-
onClick={ onClick }
|
|
113
|
-
aria-label={ item.title?.rendered || __( '(no title)' ) }
|
|
114
|
-
>
|
|
115
|
-
{ media }
|
|
116
|
-
</button>
|
|
117
|
-
) : (
|
|
118
|
-
media
|
|
119
|
-
) }
|
|
120
|
-
</div>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
83
|
function PostStatusField( { item } ) {
|
|
125
84
|
const status = STATUSES.find( ( { value } ) => value === item.status );
|
|
126
85
|
const label = status?.label || item.status;
|
|
@@ -190,15 +149,7 @@ function usePostFields( viewType ) {
|
|
|
190
149
|
|
|
191
150
|
const fields = useMemo(
|
|
192
151
|
() => [
|
|
193
|
-
|
|
194
|
-
id: 'featured-image',
|
|
195
|
-
label: __( 'Featured Image' ),
|
|
196
|
-
getValue: ( { item } ) => item.featured_media,
|
|
197
|
-
render: ( { item } ) => (
|
|
198
|
-
<FeaturedImage item={ item } viewType={ viewType } />
|
|
199
|
-
),
|
|
200
|
-
enableSorting: false,
|
|
201
|
-
},
|
|
152
|
+
featuredImageField,
|
|
202
153
|
{
|
|
203
154
|
label: __( 'Title' ),
|
|
204
155
|
id: 'title',
|
|
@@ -303,7 +254,7 @@ function usePostFields( viewType ) {
|
|
|
303
254
|
if ( isDraftOrPrivate ) {
|
|
304
255
|
return createInterpolateElement(
|
|
305
256
|
sprintf(
|
|
306
|
-
/* translators: %s: page creation date */
|
|
257
|
+
/* translators: %s: page creation or modification date. */
|
|
307
258
|
__( '<span>Modified: <time>%s</time></span>' ),
|
|
308
259
|
getFormattedDate( item.date )
|
|
309
260
|
),
|
|
@@ -354,7 +305,7 @@ function usePostFields( viewType ) {
|
|
|
354
305
|
if ( isPending ) {
|
|
355
306
|
return createInterpolateElement(
|
|
356
307
|
sprintf(
|
|
357
|
-
/* translators: %s:
|
|
308
|
+
/* translators: %s: page creation or modification date. */
|
|
358
309
|
__( '<span>Modified: <time>%s</time></span>' ),
|
|
359
310
|
getFormattedDate( dateToDisplay )
|
|
360
311
|
),
|
|
@@ -369,6 +320,8 @@ function usePostFields( viewType ) {
|
|
|
369
320
|
return <time>{ getFormattedDate( item.date ) }</time>;
|
|
370
321
|
},
|
|
371
322
|
},
|
|
323
|
+
slugField,
|
|
324
|
+
parentField,
|
|
372
325
|
{
|
|
373
326
|
id: 'comment_status',
|
|
374
327
|
label: __( 'Discussion' ),
|
|
@@ -412,7 +412,7 @@ export default function PostList( { postType } ) {
|
|
|
412
412
|
size="compact"
|
|
413
413
|
isPressed={ quickEdit }
|
|
414
414
|
icon={ drawerRight }
|
|
415
|
-
label={ __( '
|
|
415
|
+
label={ __( 'Details' ) }
|
|
416
416
|
onClick={ () => {
|
|
417
417
|
history.push( {
|
|
418
418
|
...location.params,
|
|
@@ -12,7 +12,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
12
12
|
*/
|
|
13
13
|
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
14
14
|
import Layout from '../layout';
|
|
15
|
-
import
|
|
15
|
+
import useActiveRoute from './router';
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
17
|
|
|
18
18
|
const { RouterProvider } = unlock( routerPrivateApis );
|
|
@@ -21,7 +21,7 @@ const { GlobalStylesProvider } = unlock( editorPrivateApis );
|
|
|
21
21
|
function PostsLayout() {
|
|
22
22
|
// This ensures the edited entity id and type are initialized properly.
|
|
23
23
|
useInitEditedEntityFromURL();
|
|
24
|
-
const route =
|
|
24
|
+
const route = useActiveRoute();
|
|
25
25
|
return <Layout route={ route } />;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -17,7 +17,7 @@ import PostList from '../post-list';
|
|
|
17
17
|
|
|
18
18
|
const { useLocation } = unlock( routerPrivateApis );
|
|
19
19
|
|
|
20
|
-
export default function
|
|
20
|
+
export default function useActiveRoute() {
|
|
21
21
|
const { params = {} } = useLocation();
|
|
22
22
|
const { postType, layout, canvas } = params;
|
|
23
23
|
const labels = useSelect(
|
|
@@ -31,7 +31,7 @@ export default function useLayoutAreas() {
|
|
|
31
31
|
if ( [ 'post' ].includes( postType ) ) {
|
|
32
32
|
const isListLayout = layout === 'list' || ! layout;
|
|
33
33
|
return {
|
|
34
|
-
|
|
34
|
+
name: 'posts-list',
|
|
35
35
|
areas: {
|
|
36
36
|
sidebar: (
|
|
37
37
|
<SidebarNavigationScreen
|
|
@@ -59,7 +59,7 @@ export default function useLayoutAreas() {
|
|
|
59
59
|
|
|
60
60
|
// Fallback shows the home page preview
|
|
61
61
|
return {
|
|
62
|
-
|
|
62
|
+
name: 'default',
|
|
63
63
|
areas: {
|
|
64
64
|
sidebar: <SidebarNavigationScreenMain />,
|
|
65
65
|
preview: <Editor isPostsList />,
|
|
@@ -13,14 +13,15 @@ import {
|
|
|
13
13
|
__unstableMotion as motion,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { useInstanceId, useReducedMotion } from '@wordpress/compose';
|
|
16
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
16
|
import { __, isRTL } from '@wordpress/i18n';
|
|
17
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
22
|
import { unlock } from '../../lock-unlock';
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
24
25
|
|
|
25
26
|
// Removes the inline styles in the drag handles.
|
|
26
27
|
const HANDLE_STYLES_OVERRIDE = {
|
|
@@ -86,6 +87,9 @@ function ResizableFrame( {
|
|
|
86
87
|
defaultSize,
|
|
87
88
|
innerContentStyle,
|
|
88
89
|
} ) {
|
|
90
|
+
const history = useHistory();
|
|
91
|
+
const { params } = useLocation();
|
|
92
|
+
const { canvas = 'view' } = params;
|
|
89
93
|
const disableMotion = useReducedMotion();
|
|
90
94
|
const [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );
|
|
91
95
|
// The width of the resizable frame when a new resize gesture starts.
|
|
@@ -93,11 +97,7 @@ function ResizableFrame( {
|
|
|
93
97
|
const [ isResizing, setIsResizing ] = useState( false );
|
|
94
98
|
const [ shouldShowHandle, setShouldShowHandle ] = useState( false );
|
|
95
99
|
const [ resizeRatio, setResizeRatio ] = useState( 1 );
|
|
96
|
-
|
|
97
|
-
( select ) => unlock( select( editSiteStore ) ).getCanvasMode(),
|
|
98
|
-
[]
|
|
99
|
-
);
|
|
100
|
-
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
100
|
+
|
|
101
101
|
const FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };
|
|
102
102
|
const frameRef = useRef( null );
|
|
103
103
|
const resizableHandleHelpId = useInstanceId(
|
|
@@ -158,7 +158,16 @@ function ResizableFrame( {
|
|
|
158
158
|
setFrameSize( INITIAL_FRAME_SIZE );
|
|
159
159
|
} else {
|
|
160
160
|
// Trigger full screen if the frame is resized far enough to the left.
|
|
161
|
-
|
|
161
|
+
history.push(
|
|
162
|
+
{
|
|
163
|
+
...params,
|
|
164
|
+
canvas: 'edit',
|
|
165
|
+
},
|
|
166
|
+
undefined,
|
|
167
|
+
{
|
|
168
|
+
transition: 'canvas-mode-edit-transition',
|
|
169
|
+
}
|
|
170
|
+
);
|
|
162
171
|
}
|
|
163
172
|
};
|
|
164
173
|
|
|
@@ -237,7 +246,7 @@ function ResizableFrame( {
|
|
|
237
246
|
}
|
|
238
247
|
} }
|
|
239
248
|
whileHover={
|
|
240
|
-
|
|
249
|
+
canvas === 'view'
|
|
241
250
|
? {
|
|
242
251
|
scale: 1.005,
|
|
243
252
|
transition: {
|
|
@@ -275,7 +284,7 @@ function ResizableFrame( {
|
|
|
275
284
|
onMouseOver={ () => setShouldShowHandle( true ) }
|
|
276
285
|
onMouseOut={ () => setShouldShowHandle( false ) }
|
|
277
286
|
handleComponent={ {
|
|
278
|
-
[ isRTL() ? 'right' : 'left' ]:
|
|
287
|
+
[ isRTL() ? 'right' : 'left' ]: canvas === 'view' && (
|
|
279
288
|
<>
|
|
280
289
|
<Tooltip text={ __( 'Drag to resize' ) }>
|
|
281
290
|
{ /* Disable reason: role="separator" does in fact support aria-valuenow */ }
|
|
@@ -53,7 +53,10 @@ function Revisions( { userConfig, blocks } ) {
|
|
|
53
53
|
[]
|
|
54
54
|
);
|
|
55
55
|
const settings = useMemo(
|
|
56
|
-
() => ( {
|
|
56
|
+
() => ( {
|
|
57
|
+
...originalSettings,
|
|
58
|
+
isPreviewMode: true,
|
|
59
|
+
} ),
|
|
57
60
|
[ originalSettings ]
|
|
58
61
|
);
|
|
59
62
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useEffect } from '@wordpress/element';
|
|
5
|
+
import {
|
|
6
|
+
useShortcut,
|
|
7
|
+
store as keyboardShortcutsStore,
|
|
8
|
+
} from '@wordpress/keyboard-shortcuts';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
11
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import { store as editSiteStore } from '../../store';
|
|
18
|
+
|
|
19
|
+
const shortcutName = 'core/edit-site/save';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Register the save keyboard shortcut in view mode.
|
|
23
|
+
*
|
|
24
|
+
* @return {null} Returns null.
|
|
25
|
+
*/
|
|
26
|
+
export default function SaveKeyboardShortcut() {
|
|
27
|
+
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
|
|
28
|
+
useSelect( coreStore );
|
|
29
|
+
const { hasNonPostEntityChanges, isPostSavingLocked } =
|
|
30
|
+
useSelect( editorStore );
|
|
31
|
+
const { savePost } = useDispatch( editorStore );
|
|
32
|
+
const { setIsSaveViewOpened } = useDispatch( editSiteStore );
|
|
33
|
+
const { registerShortcut, unregisterShortcut } = useDispatch(
|
|
34
|
+
keyboardShortcutsStore
|
|
35
|
+
);
|
|
36
|
+
useEffect( () => {
|
|
37
|
+
registerShortcut( {
|
|
38
|
+
name: shortcutName,
|
|
39
|
+
category: 'global',
|
|
40
|
+
description: __( 'Save your changes.' ),
|
|
41
|
+
keyCombination: {
|
|
42
|
+
modifier: 'primary',
|
|
43
|
+
character: 's',
|
|
44
|
+
},
|
|
45
|
+
} );
|
|
46
|
+
return () => {
|
|
47
|
+
unregisterShortcut( shortcutName );
|
|
48
|
+
};
|
|
49
|
+
}, [ registerShortcut, unregisterShortcut ] );
|
|
50
|
+
|
|
51
|
+
useShortcut( 'core/edit-site/save', ( event ) => {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
54
|
+
const hasDirtyEntities = !! dirtyEntityRecords.length;
|
|
55
|
+
const isSaving = dirtyEntityRecords.some( ( record ) =>
|
|
56
|
+
isSavingEntityRecord( record.kind, record.name, record.key )
|
|
57
|
+
);
|
|
58
|
+
if ( ! hasDirtyEntities || isSaving ) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if ( hasNonPostEntityChanges() ) {
|
|
62
|
+
setIsSaveViewOpened( true );
|
|
63
|
+
} else if ( ! isPostSavingLocked() ) {
|
|
64
|
+
savePost();
|
|
65
|
+
}
|
|
66
|
+
} );
|
|
67
|
+
|
|
68
|
+
return null;
|
|
69
|
+
}
|