@wordpress/edit-site 4.19.0 → 5.0.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 +6 -0
- package/build/components/add-new-template/add-custom-template-modal.js +1 -0
- package/build/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build/components/add-new-template/index.js +8 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template-part.js +21 -6
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +12 -8
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +15 -30
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +64 -0
- package/build/components/block-editor/editor-canvas.js.map +1 -0
- package/build/components/block-editor/index.js +61 -59
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +10 -44
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/editor/index.js +80 -127
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +42 -0
- package/build/components/global-styles/block-preview-panel.js.map +1 -0
- package/build/components/global-styles/context-menu.js +6 -2
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +61 -0
- package/build/components/global-styles/custom-css.js.map +1 -0
- package/build/components/global-styles/dimensions-panel.js +2 -6
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +15 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/hooks.js +5 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +10 -2
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-border.js +43 -0
- package/build/components/global-styles/screen-border.js.map +1 -0
- package/build/components/global-styles/screen-colors.js +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +42 -0
- package/build/components/global-styles/screen-css.js.map +1 -0
- package/build/components/global-styles/screen-layout.js +0 -5
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-root.js +14 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +3 -3
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/ui.js +50 -4
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +5 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +3 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -8
- package/build/components/global-styles-renderer/index.js.map +1 -0
- package/build/components/header-edit-mode/document-actions/index.js +12 -5
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +19 -12
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +11 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +231 -0
- package/build/components/layout/index.js.map +1 -0
- package/build/components/list/header.js +5 -1
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +4 -22
- package/build/components/list/index.js.map +1 -1
- package/build/components/navigate-to-link/index.js +1 -3
- package/build/components/navigate-to-link/index.js.map +1 -1
- package/build/components/routes/index.js +1 -1
- package/build/components/routes/index.js.map +1 -1
- package/build/components/sidebar/index.js +42 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +24 -4
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +53 -0
- package/build/components/sidebar-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +49 -0
- package/build/components/sidebar-navigation-screen/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js +76 -0
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +188 -0
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -0
- package/build/components/site-icon/index.js +70 -0
- package/build/components/site-icon/index.js.map +1 -0
- package/build/components/site-title/index.js +55 -0
- package/build/components/site-title/index.js.map +1 -0
- package/build/components/style-book/index.js +173 -0
- package/build/components/style-book/index.js.map +1 -0
- package/build/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +5 -4
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +53 -0
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
- package/build/index.js +2 -45
- package/build/index.js.map +1 -1
- package/build/store/actions.js +93 -43
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +35 -107
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +69 -78
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +1 -1
- package/build-module/components/add-new-template/index.js +7 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +18 -6
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +13 -9
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +15 -28
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +51 -0
- package/build-module/components/block-editor/editor-canvas.js.map +1 -0
- package/build-module/components/block-editor/index.js +61 -60
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +11 -40
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/editor/index.js +81 -124
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +32 -0
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -0
- package/build-module/components/global-styles/context-menu.js +7 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +51 -0
- package/build-module/components/global-styles/custom-css.js.map +1 -0
- package/build-module/components/global-styles/dimensions-panel.js +3 -7
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +15 -2
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +5 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +2 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +8 -2
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +27 -0
- package/build-module/components/global-styles/screen-border.js.map +1 -0
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +28 -0
- package/build-module/components/global-styles/screen-css.js.map +1 -0
- package/build-module/components/global-styles/screen-layout.js +0 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +14 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +2 -2
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/ui.js +48 -5
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +5 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +4 -4
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +4 -7
- package/build-module/components/global-styles-renderer/index.js.map +1 -0
- package/build-module/components/header-edit-mode/document-actions/index.js +13 -6
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +10 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +203 -0
- package/build-module/components/layout/index.js.map +1 -0
- package/build-module/components/list/header.js +5 -1
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +4 -19
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/navigate-to-link/index.js +1 -3
- package/build-module/components/navigate-to-link/index.js.map +1 -1
- package/build-module/components/routes/index.js +1 -1
- package/build-module/components/routes/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +30 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +27 -7
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +3 -3
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +40 -0
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +39 -0
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +165 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -0
- package/build-module/components/site-icon/index.js +55 -0
- package/build-module/components/site-icon/index.js.map +1 -0
- package/build-module/components/site-title/index.js +43 -0
- package/build-module/components/site-title/index.js.map +1 -0
- package/build-module/components/style-book/index.js +156 -0
- package/build-module/components/style-book/index.js.map +1 -0
- package/build-module/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +4 -3
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -0
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +43 -0
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +1 -0
- package/build-module/index.js +5 -36
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +87 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +35 -102
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +60 -72
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +550 -346
- package/build-style/style.css +550 -346
- package/package.json +32 -31
- package/src/components/add-new-template/add-custom-template-modal.js +1 -0
- package/src/components/add-new-template/index.js +6 -3
- package/src/components/add-new-template/new-template-part.js +15 -3
- package/src/components/add-new-template/new-template.js +14 -7
- package/src/components/add-new-template/style.scss +0 -4
- package/src/components/app/index.js +14 -43
- package/src/components/block-editor/editor-canvas.js +69 -0
- package/src/components/block-editor/index.js +102 -87
- package/src/components/block-editor/resizable-editor.js +9 -64
- package/src/components/block-editor/style.scss +25 -1
- package/src/components/code-editor/style.scss +1 -1
- package/src/components/editor/index.js +170 -236
- package/src/components/editor/style.scss +0 -22
- package/src/components/global-styles/block-preview-panel.js +29 -0
- package/src/components/global-styles/context-menu.js +11 -2
- package/src/components/global-styles/custom-css.js +73 -0
- package/src/components/global-styles/dimensions-panel.js +2 -5
- package/src/components/global-styles/global-styles-provider.js +39 -17
- package/src/components/global-styles/hooks.js +8 -3
- package/src/components/global-styles/palette.js +1 -1
- package/src/components/global-styles/screen-block-list.js +2 -1
- package/src/components/global-styles/screen-block.js +9 -1
- package/src/components/global-styles/screen-border.js +23 -0
- package/src/components/global-styles/screen-colors.js +2 -1
- package/src/components/global-styles/screen-css.js +33 -0
- package/src/components/global-styles/screen-layout.js +0 -3
- package/src/components/global-styles/screen-root.js +30 -1
- package/src/components/global-styles/screen-style-variations.js +5 -2
- package/src/components/global-styles/style.scss +31 -2
- package/src/components/global-styles/ui.js +47 -4
- package/src/components/global-styles/use-global-styles-output.js +5 -0
- package/src/components/global-styles/utils.js +8 -5
- package/src/components/{editor/global-styles-renderer.js → global-styles-renderer/index.js} +3 -9
- package/src/components/header-edit-mode/document-actions/index.js +14 -9
- package/src/components/header-edit-mode/document-actions/style.scss +8 -1
- package/src/components/header-edit-mode/index.js +96 -78
- package/src/components/header-edit-mode/style.scss +5 -33
- package/src/components/keyboard-shortcuts/index.js +13 -0
- package/src/components/layout/index.js +278 -0
- package/src/components/layout/style.scss +176 -0
- package/src/components/list/header.js +5 -1
- package/src/components/list/index.js +12 -31
- package/src/components/list/style.scss +10 -4
- package/src/components/navigate-to-link/index.js +2 -8
- package/src/components/routes/index.js +1 -1
- package/src/components/sidebar/index.js +34 -0
- package/src/components/sidebar/style.scss +8 -0
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -7
- package/src/components/sidebar-edit-mode/index.js +3 -3
- package/src/components/sidebar-edit-mode/navigation-menu-sidebar/style.scss +21 -3
- package/src/components/sidebar-edit-mode/settings-header/style.scss +47 -34
- package/src/components/sidebar-edit-mode/style.scss +0 -13
- package/src/components/sidebar-navigation-item/index.js +51 -0
- package/src/components/sidebar-navigation-item/style.scss +17 -0
- package/src/components/sidebar-navigation-screen/index.js +55 -0
- package/src/components/sidebar-navigation-screen/style.scss +41 -0
- package/src/components/sidebar-navigation-screen-main/index.js +72 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +181 -0
- package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
- package/src/components/site-icon/index.js +56 -0
- package/src/components/site-icon/style.scss +10 -0
- package/src/components/site-title/index.js +39 -0
- package/src/components/style-book/index.js +193 -0
- package/src/components/style-book/style.scss +78 -0
- package/src/components/{url-query-controller/index.js → sync-state-with-url/use-init-edited-entity-from-url.js} +3 -3
- package/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js +36 -0
- package/src/components/template-details/style.scss +4 -0
- package/src/index.js +3 -53
- package/src/store/actions.js +93 -48
- package/src/store/reducer.js +29 -91
- package/src/store/selectors.js +61 -101
- package/src/store/test/actions.js +3 -15
- package/src/store/test/reducer.js +8 -192
- package/src/store/test/selectors.js +3 -42
- package/src/style.scss +19 -3
- package/build/components/editor/global-styles-renderer.js.map +0 -1
- package/build/components/navigation-sidebar/index.js +0 -62
- package/build/components/navigation-sidebar/index.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +0 -77
- package/build/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +0 -152
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +0 -124
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
- package/build/components/url-query-controller/index.js.map +0 -1
- package/build-module/components/editor/global-styles-renderer.js.map +0 -1
- package/build-module/components/navigation-sidebar/index.js +0 -45
- package/build-module/components/navigation-sidebar/index.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js +0 -49
- package/build-module/components/navigation-sidebar/navigation-panel/constants.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +0 -131
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -66
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +0 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +0 -108
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +0 -1
- package/build-module/components/url-query-controller/index.js.map +0 -1
- package/src/components/navigation-sidebar/index.js +0 -46
- package/src/components/navigation-sidebar/navigation-panel/constants.js +0 -94
- package/src/components/navigation-sidebar/navigation-panel/index.js +0 -142
- package/src/components/navigation-sidebar/navigation-panel/style.scss +0 -152
- package/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js +0 -81
- package/src/components/navigation-sidebar/navigation-toggle/index.js +0 -114
- package/src/components/navigation-sidebar/navigation-toggle/style.scss +0 -71
- package/src/components/navigation-sidebar/navigation-toggle/test/index.js +0 -65
package/src/store/actions.js
CHANGED
|
@@ -63,16 +63,19 @@ export const setTemplate =
|
|
|
63
63
|
( templateId, templateSlug ) =>
|
|
64
64
|
async ( { dispatch, registry } ) => {
|
|
65
65
|
if ( ! templateSlug ) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
try {
|
|
67
|
+
const template = await registry
|
|
68
|
+
.resolveSelect( coreStore )
|
|
69
|
+
.getEntityRecord( 'postType', 'wp_template', templateId );
|
|
70
|
+
templateSlug = template?.slug;
|
|
71
|
+
} catch ( error ) {}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
dispatch( {
|
|
73
|
-
type: '
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
type: 'SET_EDITED_POST',
|
|
76
|
+
postType: 'wp_template',
|
|
77
|
+
id: templateId,
|
|
78
|
+
context: { templateSlug },
|
|
76
79
|
} );
|
|
77
80
|
};
|
|
78
81
|
|
|
@@ -103,9 +106,10 @@ export const addTemplate =
|
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
dispatch( {
|
|
106
|
-
type: '
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
type: 'SET_EDITED_POST',
|
|
110
|
+
postType: 'wp_template',
|
|
111
|
+
id: newTemplate.id,
|
|
112
|
+
context: { templateSlug: newTemplate.slug },
|
|
109
113
|
} );
|
|
110
114
|
};
|
|
111
115
|
|
|
@@ -165,21 +169,37 @@ export const removeTemplate =
|
|
|
165
169
|
*/
|
|
166
170
|
export function setTemplatePart( templatePartId ) {
|
|
167
171
|
return {
|
|
168
|
-
type: '
|
|
169
|
-
|
|
172
|
+
type: 'SET_EDITED_POST',
|
|
173
|
+
postType: 'wp_template_part',
|
|
174
|
+
id: templatePartId,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @deprecated
|
|
180
|
+
*/
|
|
181
|
+
export function setHomeTemplateId() {
|
|
182
|
+
deprecated( "dispatch( 'core/edit-site' ).setHomeTemplateId", {
|
|
183
|
+
since: '6.2',
|
|
184
|
+
version: '6.4',
|
|
185
|
+
} );
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
type: 'NOTHING',
|
|
170
189
|
};
|
|
171
190
|
}
|
|
172
191
|
|
|
173
192
|
/**
|
|
174
|
-
*
|
|
175
|
-
* from a given path.
|
|
193
|
+
* Set's the current block editor context.
|
|
176
194
|
*
|
|
177
|
-
* @param {
|
|
195
|
+
* @param {Object} context The context object.
|
|
196
|
+
*
|
|
197
|
+
* @return {number} The resolved template ID for the page route.
|
|
178
198
|
*/
|
|
179
|
-
export function
|
|
199
|
+
export function setEditedPostContext( context ) {
|
|
180
200
|
return {
|
|
181
|
-
type: '
|
|
182
|
-
|
|
201
|
+
type: 'SET_EDITED_POST_CONTEXT',
|
|
202
|
+
context,
|
|
183
203
|
};
|
|
184
204
|
}
|
|
185
205
|
|
|
@@ -219,17 +239,13 @@ export const setPage =
|
|
|
219
239
|
}
|
|
220
240
|
|
|
221
241
|
dispatch( {
|
|
222
|
-
type: '
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
}
|
|
231
|
-
: page,
|
|
232
|
-
templateId: template.id,
|
|
242
|
+
type: 'SET_EDITED_POST',
|
|
243
|
+
postType: 'wp_template',
|
|
244
|
+
id: template.id,
|
|
245
|
+
context: {
|
|
246
|
+
...page.context,
|
|
247
|
+
templateSlug: template.slug,
|
|
248
|
+
},
|
|
233
249
|
} );
|
|
234
250
|
|
|
235
251
|
return template.id;
|
|
@@ -238,40 +254,45 @@ export const setPage =
|
|
|
238
254
|
/**
|
|
239
255
|
* Action that sets the active navigation panel menu.
|
|
240
256
|
*
|
|
241
|
-
* @
|
|
257
|
+
* @deprecated
|
|
242
258
|
*
|
|
243
259
|
* @return {Object} Action object.
|
|
244
260
|
*/
|
|
245
|
-
export function setNavigationPanelActiveMenu(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
};
|
|
261
|
+
export function setNavigationPanelActiveMenu() {
|
|
262
|
+
deprecated( "dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu", {
|
|
263
|
+
since: '6.2',
|
|
264
|
+
version: '6.4',
|
|
265
|
+
} );
|
|
266
|
+
|
|
267
|
+
return { type: 'NOTHING' };
|
|
250
268
|
}
|
|
251
269
|
|
|
252
270
|
/**
|
|
253
271
|
* Opens the navigation panel and sets its active menu at the same time.
|
|
254
272
|
*
|
|
255
|
-
* @
|
|
273
|
+
* @deprecated
|
|
256
274
|
*/
|
|
257
|
-
export function openNavigationPanelToMenu(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
};
|
|
275
|
+
export function openNavigationPanelToMenu() {
|
|
276
|
+
deprecated( "dispatch( 'core/edit-site' ).openNavigationPanelToMenu", {
|
|
277
|
+
since: '6.2',
|
|
278
|
+
version: '6.4',
|
|
279
|
+
} );
|
|
280
|
+
|
|
281
|
+
return { type: 'NOTHING' };
|
|
262
282
|
}
|
|
263
283
|
|
|
264
284
|
/**
|
|
265
285
|
* Sets whether the navigation panel should be open.
|
|
266
286
|
*
|
|
267
|
-
* @
|
|
268
|
-
* does not toggle the state, but sets it directly.
|
|
287
|
+
* @deprecated
|
|
269
288
|
*/
|
|
270
|
-
export function setIsNavigationPanelOpened(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
};
|
|
289
|
+
export function setIsNavigationPanelOpened() {
|
|
290
|
+
deprecated( "dispatch( 'core/edit-site' ).setIsNavigationPanelOpened", {
|
|
291
|
+
since: '6.2',
|
|
292
|
+
version: '6.4',
|
|
293
|
+
} );
|
|
294
|
+
|
|
295
|
+
return { type: 'NOTHING' };
|
|
275
296
|
}
|
|
276
297
|
|
|
277
298
|
/**
|
|
@@ -509,3 +530,27 @@ export const switchEditorMode =
|
|
|
509
530
|
speak( __( 'Mosaic view selected' ), 'assertive' );
|
|
510
531
|
}
|
|
511
532
|
};
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Action that switches the canvas mode.
|
|
536
|
+
*
|
|
537
|
+
* @param {?string} mode Canvas mode.
|
|
538
|
+
*/
|
|
539
|
+
export const __unstableSetCanvasMode =
|
|
540
|
+
( mode ) =>
|
|
541
|
+
( { registry, dispatch } ) => {
|
|
542
|
+
registry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );
|
|
543
|
+
dispatch( {
|
|
544
|
+
type: 'SET_CANVAS_MODE',
|
|
545
|
+
mode,
|
|
546
|
+
} );
|
|
547
|
+
// Check if the block list view should be open by default.
|
|
548
|
+
if (
|
|
549
|
+
mode === 'edit' &&
|
|
550
|
+
registry
|
|
551
|
+
.select( preferencesStore )
|
|
552
|
+
.get( 'core/edit-site', 'showListViewByDefault' )
|
|
553
|
+
) {
|
|
554
|
+
dispatch.setIsListViewOpened( true );
|
|
555
|
+
}
|
|
556
|
+
};
|
package/src/store/reducer.js
CHANGED
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { combineReducers } from '@wordpress/data';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { MENU_ROOT } from '../components/navigation-sidebar/navigation-panel/constants';
|
|
10
|
-
|
|
11
6
|
/**
|
|
12
7
|
* Reducer returning the editing canvas device type.
|
|
13
8
|
*
|
|
@@ -56,85 +51,19 @@ export function settings( state = {}, action ) {
|
|
|
56
51
|
*/
|
|
57
52
|
export function editedPost( state = {}, action ) {
|
|
58
53
|
switch ( action.type ) {
|
|
59
|
-
case '
|
|
60
|
-
case 'SET_PAGE':
|
|
54
|
+
case 'SET_EDITED_POST':
|
|
61
55
|
return {
|
|
62
|
-
|
|
63
|
-
id: action.
|
|
64
|
-
|
|
56
|
+
postType: action.postType,
|
|
57
|
+
id: action.id,
|
|
58
|
+
context: action.context,
|
|
65
59
|
};
|
|
66
|
-
case '
|
|
67
|
-
return {
|
|
68
|
-
type: 'wp_template_part',
|
|
69
|
-
id: action.templatePartId,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return state;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Reducer for information about the site's homepage.
|
|
78
|
-
*
|
|
79
|
-
* @param {Object} state Current state.
|
|
80
|
-
* @param {Object} action Dispatched action.
|
|
81
|
-
*
|
|
82
|
-
* @return {Object} Updated state.
|
|
83
|
-
*/
|
|
84
|
-
export function homeTemplateId( state, action ) {
|
|
85
|
-
switch ( action.type ) {
|
|
86
|
-
case 'SET_HOME_TEMPLATE':
|
|
87
|
-
return action.homeTemplateId;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return state;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Reducer for information about the navigation panel, such as its active menu
|
|
95
|
-
* and whether it should be opened or closed.
|
|
96
|
-
*
|
|
97
|
-
* Note: this reducer interacts with the inserter and list view panels reducers
|
|
98
|
-
* to make sure that only one of the three panels is open at the same time.
|
|
99
|
-
*
|
|
100
|
-
* @param {Object} state Current state.
|
|
101
|
-
* @param {Object} action Dispatched action.
|
|
102
|
-
*/
|
|
103
|
-
export function navigationPanel(
|
|
104
|
-
state = { menu: MENU_ROOT, isOpen: false },
|
|
105
|
-
action
|
|
106
|
-
) {
|
|
107
|
-
switch ( action.type ) {
|
|
108
|
-
case 'SET_NAVIGATION_PANEL_ACTIVE_MENU':
|
|
60
|
+
case 'SET_EDITED_POST_CONTEXT':
|
|
109
61
|
return {
|
|
110
62
|
...state,
|
|
111
|
-
|
|
112
|
-
};
|
|
113
|
-
case 'OPEN_NAVIGATION_PANEL_TO_MENU':
|
|
114
|
-
return {
|
|
115
|
-
...state,
|
|
116
|
-
isOpen: true,
|
|
117
|
-
menu: action.menu,
|
|
118
|
-
};
|
|
119
|
-
case 'SET_IS_NAVIGATION_PANEL_OPENED':
|
|
120
|
-
return {
|
|
121
|
-
...state,
|
|
122
|
-
menu: ! action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.
|
|
123
|
-
isOpen: action.isOpen,
|
|
124
|
-
};
|
|
125
|
-
case 'SET_IS_LIST_VIEW_OPENED':
|
|
126
|
-
return {
|
|
127
|
-
...state,
|
|
128
|
-
menu: state.isOpen && action.isOpen ? MENU_ROOT : state.menu, // Set menu to root when closing panel.
|
|
129
|
-
isOpen: action.isOpen ? false : state.isOpen,
|
|
130
|
-
};
|
|
131
|
-
case 'SET_IS_INSERTER_OPENED':
|
|
132
|
-
return {
|
|
133
|
-
...state,
|
|
134
|
-
menu: state.isOpen && action.value ? MENU_ROOT : state.menu, // Set menu to root when closing panel.
|
|
135
|
-
isOpen: action.value ? false : state.isOpen,
|
|
63
|
+
context: action.context,
|
|
136
64
|
};
|
|
137
65
|
}
|
|
66
|
+
|
|
138
67
|
return state;
|
|
139
68
|
}
|
|
140
69
|
|
|
@@ -149,13 +78,12 @@ export function navigationPanel(
|
|
|
149
78
|
*/
|
|
150
79
|
export function blockInserterPanel( state = false, action ) {
|
|
151
80
|
switch ( action.type ) {
|
|
152
|
-
case 'OPEN_NAVIGATION_PANEL_TO_MENU':
|
|
153
|
-
return false;
|
|
154
|
-
case 'SET_IS_NAVIGATION_PANEL_OPENED':
|
|
155
81
|
case 'SET_IS_LIST_VIEW_OPENED':
|
|
156
82
|
return action.isOpen ? false : state;
|
|
157
83
|
case 'SET_IS_INSERTER_OPENED':
|
|
158
84
|
return action.value;
|
|
85
|
+
case 'SET_CANVAS_MODE':
|
|
86
|
+
return false;
|
|
159
87
|
}
|
|
160
88
|
return state;
|
|
161
89
|
}
|
|
@@ -171,14 +99,12 @@ export function blockInserterPanel( state = false, action ) {
|
|
|
171
99
|
*/
|
|
172
100
|
export function listViewPanel( state = false, action ) {
|
|
173
101
|
switch ( action.type ) {
|
|
174
|
-
case 'OPEN_NAVIGATION_PANEL_TO_MENU':
|
|
175
|
-
return false;
|
|
176
|
-
case 'SET_IS_NAVIGATION_PANEL_OPENED':
|
|
177
|
-
return action.isOpen ? false : state;
|
|
178
102
|
case 'SET_IS_INSERTER_OPENED':
|
|
179
103
|
return action.value ? false : state;
|
|
180
104
|
case 'SET_IS_LIST_VIEW_OPENED':
|
|
181
105
|
return action.isOpen;
|
|
106
|
+
case 'SET_CANVAS_MODE':
|
|
107
|
+
return false;
|
|
182
108
|
}
|
|
183
109
|
return state;
|
|
184
110
|
}
|
|
@@ -191,13 +117,26 @@ export function listViewPanel( state = false, action ) {
|
|
|
191
117
|
*/
|
|
192
118
|
export function saveViewPanel( state = false, action ) {
|
|
193
119
|
switch ( action.type ) {
|
|
194
|
-
case 'OPEN_NAVIGATION_PANEL_TO_MENU':
|
|
195
|
-
return false;
|
|
196
|
-
case 'SET_IS_NAVIGATION_PANEL_OPENED':
|
|
197
|
-
return action.isOpen ? false : state;
|
|
198
120
|
case 'SET_IS_SAVE_VIEW_OPENED':
|
|
199
121
|
return action.isOpen;
|
|
122
|
+
case 'SET_CANVAS_MODE':
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return state;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Reducer used to track the site editor canvas mode (edit or view).
|
|
130
|
+
*
|
|
131
|
+
* @param {Object} state Current state.
|
|
132
|
+
* @param {Object} action Dispatched action.
|
|
133
|
+
*/
|
|
134
|
+
function canvasMode( state = 'view', action ) {
|
|
135
|
+
switch ( action.type ) {
|
|
136
|
+
case 'SET_CANVAS_MODE':
|
|
137
|
+
return action.mode;
|
|
200
138
|
}
|
|
139
|
+
|
|
201
140
|
return state;
|
|
202
141
|
}
|
|
203
142
|
|
|
@@ -205,9 +144,8 @@ export default combineReducers( {
|
|
|
205
144
|
deviceType,
|
|
206
145
|
settings,
|
|
207
146
|
editedPost,
|
|
208
|
-
homeTemplateId,
|
|
209
|
-
navigationPanel,
|
|
210
147
|
blockInserterPanel,
|
|
211
148
|
listViewPanel,
|
|
212
149
|
saveViewPanel,
|
|
150
|
+
canvasMode,
|
|
213
151
|
} );
|
package/src/store/selectors.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { map } from 'lodash';
|
|
5
4
|
import createSelector from 'rememo';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -15,20 +14,6 @@ import { isTemplatePart } from '@wordpress/blocks';
|
|
|
15
14
|
import { Platform } from '@wordpress/element';
|
|
16
15
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
17
16
|
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
import {
|
|
22
|
-
MENU_ROOT,
|
|
23
|
-
MENU_TEMPLATE_PARTS,
|
|
24
|
-
MENU_TEMPLATES_UNUSED,
|
|
25
|
-
TEMPLATE_PARTS_SUB_MENUS,
|
|
26
|
-
} from '../components/navigation-sidebar/navigation-panel/constants';
|
|
27
|
-
import {
|
|
28
|
-
getTemplateLocation,
|
|
29
|
-
isTemplateSuperseded,
|
|
30
|
-
} from '../components/navigation-sidebar/navigation-panel/template-hierarchy';
|
|
31
|
-
|
|
32
17
|
/**
|
|
33
18
|
* @typedef {'template'|'template_type'} TemplateType Template type.
|
|
34
19
|
*/
|
|
@@ -161,18 +146,13 @@ export const getSettings = createSelector(
|
|
|
161
146
|
);
|
|
162
147
|
|
|
163
148
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* @param {Object} state Global application state.
|
|
167
|
-
*
|
|
168
|
-
* @return {number?} Home template ID.
|
|
149
|
+
* @deprecated
|
|
169
150
|
*/
|
|
170
|
-
export function getHomeTemplateId(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return state.editedPost;
|
|
151
|
+
export function getHomeTemplateId() {
|
|
152
|
+
deprecated( "select( 'core/edit-site' ).getHomeTemplateId", {
|
|
153
|
+
since: '6.2',
|
|
154
|
+
version: '6.4',
|
|
155
|
+
} );
|
|
176
156
|
}
|
|
177
157
|
|
|
178
158
|
/**
|
|
@@ -183,7 +163,7 @@ function getCurrentEditedPost( state ) {
|
|
|
183
163
|
* @return {TemplateType?} Template type.
|
|
184
164
|
*/
|
|
185
165
|
export function getEditedPostType( state ) {
|
|
186
|
-
return
|
|
166
|
+
return state.editedPost.postType;
|
|
187
167
|
}
|
|
188
168
|
|
|
189
169
|
/**
|
|
@@ -194,95 +174,31 @@ export function getEditedPostType( state ) {
|
|
|
194
174
|
* @return {string?} Post ID.
|
|
195
175
|
*/
|
|
196
176
|
export function getEditedPostId( state ) {
|
|
197
|
-
return
|
|
177
|
+
return state.editedPost.id;
|
|
198
178
|
}
|
|
199
179
|
|
|
200
180
|
/**
|
|
201
|
-
* Returns the
|
|
181
|
+
* Returns the edited post's context object.
|
|
202
182
|
*
|
|
183
|
+
* @deprecated
|
|
203
184
|
* @param {Object} state Global application state.
|
|
204
185
|
*
|
|
205
186
|
* @return {Object} Page.
|
|
206
187
|
*/
|
|
207
|
-
export function
|
|
208
|
-
return
|
|
188
|
+
export function getEditedPostContext( state ) {
|
|
189
|
+
return state.editedPost.context;
|
|
209
190
|
}
|
|
210
191
|
|
|
211
192
|
/**
|
|
212
|
-
* Returns the
|
|
213
|
-
*
|
|
214
|
-
* @param {Object} state Global application state.
|
|
215
|
-
*
|
|
216
|
-
* @return {string} Active menu.
|
|
217
|
-
*/
|
|
218
|
-
export function getNavigationPanelActiveMenu( state ) {
|
|
219
|
-
return state.navigationPanel.menu;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Returns the current template or template part's corresponding
|
|
224
|
-
* navigation panel's sub menu, to be used with `openNavigationPanelToMenu`.
|
|
225
|
-
*
|
|
226
|
-
* @param {Object} state Global application state.
|
|
227
|
-
*
|
|
228
|
-
* @return {string} The current template or template part's sub menu.
|
|
229
|
-
*/
|
|
230
|
-
export const getCurrentTemplateNavigationPanelSubMenu = createRegistrySelector(
|
|
231
|
-
( select ) => ( state ) => {
|
|
232
|
-
const templateType = getEditedPostType( state );
|
|
233
|
-
const templateId = getEditedPostId( state );
|
|
234
|
-
const template = templateId
|
|
235
|
-
? select( coreDataStore ).getEntityRecord(
|
|
236
|
-
'postType',
|
|
237
|
-
templateType,
|
|
238
|
-
templateId
|
|
239
|
-
)
|
|
240
|
-
: null;
|
|
241
|
-
|
|
242
|
-
if ( ! template ) {
|
|
243
|
-
return MENU_ROOT;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if ( 'wp_template_part' === templateType ) {
|
|
247
|
-
return (
|
|
248
|
-
TEMPLATE_PARTS_SUB_MENUS.find(
|
|
249
|
-
( submenu ) => submenu.area === template?.area
|
|
250
|
-
)?.menu || MENU_TEMPLATE_PARTS
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
const templates = select( coreDataStore ).getEntityRecords(
|
|
255
|
-
'postType',
|
|
256
|
-
'wp_template'
|
|
257
|
-
);
|
|
258
|
-
const showOnFront = select( coreDataStore ).getEditedEntityRecord(
|
|
259
|
-
'root',
|
|
260
|
-
'site'
|
|
261
|
-
).show_on_front;
|
|
262
|
-
|
|
263
|
-
if (
|
|
264
|
-
isTemplateSuperseded(
|
|
265
|
-
template.slug,
|
|
266
|
-
map( templates, 'slug' ),
|
|
267
|
-
showOnFront
|
|
268
|
-
)
|
|
269
|
-
) {
|
|
270
|
-
return MENU_TEMPLATES_UNUSED;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return getTemplateLocation( template.slug );
|
|
274
|
-
}
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Returns the current opened/closed state of the navigation panel.
|
|
193
|
+
* Returns the current page object.
|
|
279
194
|
*
|
|
195
|
+
* @deprecated
|
|
280
196
|
* @param {Object} state Global application state.
|
|
281
197
|
*
|
|
282
|
-
* @return {
|
|
198
|
+
* @return {Object} Page.
|
|
283
199
|
*/
|
|
284
|
-
export function
|
|
285
|
-
return state.
|
|
200
|
+
export function getPage( state ) {
|
|
201
|
+
return { context: state.editedPost.context };
|
|
286
202
|
}
|
|
287
203
|
|
|
288
204
|
/**
|
|
@@ -391,3 +307,47 @@ export const getCurrentTemplateTemplateParts = createRegistrySelector(
|
|
|
391
307
|
export function getEditorMode( state ) {
|
|
392
308
|
return __unstableGetPreference( state, 'editorMode' );
|
|
393
309
|
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Returns the current canvas mode.
|
|
313
|
+
*
|
|
314
|
+
* @param {Object} state Global application state.
|
|
315
|
+
*
|
|
316
|
+
* @return {string} Canvas mode.
|
|
317
|
+
*/
|
|
318
|
+
export function __unstableGetCanvasMode( state ) {
|
|
319
|
+
return state.canvasMode;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @deprecated
|
|
324
|
+
*/
|
|
325
|
+
export function getCurrentTemplateNavigationPanelSubMenu() {
|
|
326
|
+
deprecated(
|
|
327
|
+
"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu",
|
|
328
|
+
{
|
|
329
|
+
since: '6.2',
|
|
330
|
+
version: '6.4',
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @deprecated
|
|
337
|
+
*/
|
|
338
|
+
export function getNavigationPanelActiveMenu() {
|
|
339
|
+
deprecated( "dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu", {
|
|
340
|
+
since: '6.2',
|
|
341
|
+
version: '6.4',
|
|
342
|
+
} );
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* @deprecated
|
|
347
|
+
*/
|
|
348
|
+
export function isNavigationOpened() {
|
|
349
|
+
deprecated( "dispatch( 'core/edit-site' ).isNavigationOpened", {
|
|
350
|
+
since: '6.2',
|
|
351
|
+
version: '6.4',
|
|
352
|
+
} );
|
|
353
|
+
}
|
|
@@ -81,7 +81,7 @@ describe( 'actions', () => {
|
|
|
81
81
|
|
|
82
82
|
const select = registry.select( editSiteStore );
|
|
83
83
|
expect( select.getEditedPostId() ).toBe( ID );
|
|
84
|
-
expect( select.
|
|
84
|
+
expect( select.getEditedPostContext().templateSlug ).toBe( SLUG );
|
|
85
85
|
} );
|
|
86
86
|
|
|
87
87
|
it( 'should set the template by fetching the template slug', async () => {
|
|
@@ -109,7 +109,7 @@ describe( 'actions', () => {
|
|
|
109
109
|
|
|
110
110
|
const select = registry.select( editSiteStore );
|
|
111
111
|
expect( select.getEditedPostId() ).toBe( ID );
|
|
112
|
-
expect( select.
|
|
112
|
+
expect( select.getEditedPostContext().templateSlug ).toBe( SLUG );
|
|
113
113
|
} );
|
|
114
114
|
} );
|
|
115
115
|
|
|
@@ -146,7 +146,7 @@ describe( 'actions', () => {
|
|
|
146
146
|
|
|
147
147
|
const select = registry.select( editSiteStore );
|
|
148
148
|
expect( select.getEditedPostId() ).toBe( ID );
|
|
149
|
-
expect( select.
|
|
149
|
+
expect( select.getEditedPostContext().templateSlug ).toBe( SLUG );
|
|
150
150
|
} );
|
|
151
151
|
} );
|
|
152
152
|
|
|
@@ -207,18 +207,6 @@ describe( 'actions', () => {
|
|
|
207
207
|
const select = registry.select( editSiteStore );
|
|
208
208
|
expect( select.getEditedPostId() ).toBe( 'emptytheme//single' );
|
|
209
209
|
expect( select.getEditedPostType() ).toBe( 'wp_template' );
|
|
210
|
-
expect( select.getPage().path ).toBe( '/' );
|
|
211
|
-
} );
|
|
212
|
-
} );
|
|
213
|
-
|
|
214
|
-
describe( 'setHomeTemplateId', () => {
|
|
215
|
-
it( 'should set the home template ID', () => {
|
|
216
|
-
const registry = createRegistryWithStores();
|
|
217
|
-
|
|
218
|
-
registry.dispatch( editSiteStore ).setHomeTemplateId( 90 );
|
|
219
|
-
expect( registry.select( editSiteStore ).getHomeTemplateId() ).toBe(
|
|
220
|
-
90
|
|
221
|
-
);
|
|
222
210
|
} );
|
|
223
211
|
} );
|
|
224
212
|
|