@wordpress/edit-site 6.18.0 → 6.19.1
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-template/add-custom-generic-template-modal-content.js +3 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/utils.js +1 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +19 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +3 -2
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/layout/index.js +23 -15
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/header.js +1 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +3 -2
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/save-panel/index.js +14 -8
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +17 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +1 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -0
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-unsupported/index.js +24 -0
- package/build/components/sidebar-navigation-screen-unsupported/index.js.map +1 -0
- package/build/components/site-editor-routes/home.js +22 -5
- package/build/components/site-editor-routes/home.js.map +1 -1
- package/build/components/site-editor-routes/navigation-item.js +22 -9
- package/build/components/site-editor-routes/navigation-item.js.map +1 -1
- package/build/components/site-editor-routes/navigation.js +21 -5
- package/build/components/site-editor-routes/navigation.js.map +1 -1
- package/build/components/site-editor-routes/notfound.js +12 -4
- package/build/components/site-editor-routes/notfound.js.map +1 -1
- package/build/components/site-editor-routes/page-item.js +25 -9
- package/build/components/site-editor-routes/page-item.js.map +1 -1
- package/build/components/site-editor-routes/pages.js +32 -11
- package/build/components/site-editor-routes/pages.js.map +1 -1
- package/build/components/site-editor-routes/pattern-item.js +10 -3
- package/build/components/site-editor-routes/pattern-item.js.map +1 -1
- package/build/components/site-editor-routes/patterns.js +23 -4
- package/build/components/site-editor-routes/patterns.js.map +1 -1
- package/build/components/site-editor-routes/stylebook.js +25 -11
- package/build/components/site-editor-routes/stylebook.js.map +1 -1
- package/build/components/site-editor-routes/template-item.js +21 -5
- package/build/components/site-editor-routes/template-item.js.map +1 -1
- package/build/components/site-editor-routes/templates.js +27 -6
- package/build/components/site-editor-routes/templates.js.map +1 -1
- package/build/components/site-editor-routes/utils.js +20 -0
- package/build/components/site-editor-routes/utils.js.map +1 -0
- package/build/components/site-hub/index.js +39 -15
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +3 -1
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +1 -1
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +20 -3
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +3 -2
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/layout/index.js +23 -15
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/header.js +1 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +3 -2
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/save-panel/index.js +14 -8
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +15 -10
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js +17 -0
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +1 -0
- package/build-module/components/site-editor-routes/home.js +22 -5
- package/build-module/components/site-editor-routes/home.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.js +22 -9
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation.js +21 -5
- package/build-module/components/site-editor-routes/navigation.js.map +1 -1
- package/build-module/components/site-editor-routes/notfound.js +12 -4
- package/build-module/components/site-editor-routes/notfound.js.map +1 -1
- package/build-module/components/site-editor-routes/page-item.js +25 -9
- package/build-module/components/site-editor-routes/page-item.js.map +1 -1
- package/build-module/components/site-editor-routes/pages.js +32 -11
- package/build-module/components/site-editor-routes/pages.js.map +1 -1
- package/build-module/components/site-editor-routes/pattern-item.js +10 -3
- package/build-module/components/site-editor-routes/pattern-item.js.map +1 -1
- package/build-module/components/site-editor-routes/patterns.js +23 -4
- package/build-module/components/site-editor-routes/patterns.js.map +1 -1
- package/build-module/components/site-editor-routes/stylebook.js +25 -11
- package/build-module/components/site-editor-routes/stylebook.js.map +1 -1
- package/build-module/components/site-editor-routes/template-item.js +21 -5
- package/build-module/components/site-editor-routes/template-item.js.map +1 -1
- package/build-module/components/site-editor-routes/templates.js +27 -6
- package/build-module/components/site-editor-routes/templates.js.map +1 -1
- package/build-module/components/site-editor-routes/utils.js +14 -0
- package/build-module/components/site-editor-routes/utils.js.map +1 -0
- package/build-module/components/site-hub/index.js +41 -17
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +3 -1
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-style/posts-rtl.css +12 -18
- package/build-style/posts.css +12 -18
- package/build-style/style-rtl.css +12 -18
- package/build-style/style.css +12 -18
- package/package.json +42 -42
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -0
- package/src/components/add-new-template/utils.js +1 -2
- package/src/components/app/index.js +18 -3
- package/src/components/editor/use-editor-title.js +6 -6
- package/src/components/layout/index.js +34 -22
- package/src/components/layout/style.scss +6 -4
- package/src/components/page/style.scss +1 -5
- package/src/components/page-patterns/header.js +1 -1
- package/src/components/page-patterns/use-patterns.js +7 -7
- package/src/components/save-panel/index.js +16 -8
- package/src/components/sidebar/index.js +15 -13
- package/src/components/sidebar-navigation-screen/index.js +2 -2
- package/src/components/sidebar-navigation-screen-patterns/index.js +1 -0
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -1
- package/src/components/sidebar-navigation-screen-unsupported/index.js +17 -0
- package/src/components/site-editor-routes/home.js +27 -3
- package/src/components/site-editor-routes/navigation-item.js +26 -9
- package/src/components/site-editor-routes/navigation.js +21 -3
- package/src/components/site-editor-routes/notfound.js +15 -4
- package/src/components/site-editor-routes/page-item.js +29 -9
- package/src/components/site-editor-routes/pages.js +30 -10
- package/src/components/site-editor-routes/pattern-item.js +9 -1
- package/src/components/site-editor-routes/patterns.js +22 -2
- package/src/components/site-editor-routes/stylebook.js +25 -11
- package/src/components/site-editor-routes/template-item.js +25 -3
- package/src/components/site-editor-routes/templates.js +26 -4
- package/src/components/site-editor-routes/utils.js +14 -0
- package/src/components/site-hub/index.js +60 -31
- package/src/components/welcome-guide/page.js +1 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -25,8 +25,11 @@ const EMPTY_PATTERN_LIST = [];
|
|
|
25
25
|
|
|
26
26
|
const selectTemplateParts = createSelector(
|
|
27
27
|
( select, categoryId, search = '' ) => {
|
|
28
|
-
const {
|
|
29
|
-
|
|
28
|
+
const {
|
|
29
|
+
getEntityRecords,
|
|
30
|
+
getCurrentTheme,
|
|
31
|
+
isResolving: isResolvingSelector,
|
|
32
|
+
} = select( coreStore );
|
|
30
33
|
|
|
31
34
|
const query = { per_page: -1 };
|
|
32
35
|
const templateParts =
|
|
@@ -36,9 +39,7 @@ const selectTemplateParts = createSelector(
|
|
|
36
39
|
// In the case where a custom template part area has been removed we need
|
|
37
40
|
// the current list of areas to cross check against so orphaned template
|
|
38
41
|
// parts can be treated as uncategorized.
|
|
39
|
-
const knownAreas =
|
|
40
|
-
select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
|
|
41
|
-
?.default_template_part_areas || [];
|
|
42
|
+
const knownAreas = getCurrentTheme()?.default_template_part_areas || [];
|
|
42
43
|
|
|
43
44
|
const templatePartAreas = knownAreas.map( ( area ) => area.area );
|
|
44
45
|
|
|
@@ -79,8 +80,7 @@ const selectTemplateParts = createSelector(
|
|
|
79
80
|
TEMPLATE_PART_POST_TYPE,
|
|
80
81
|
{ per_page: -1 },
|
|
81
82
|
] ),
|
|
82
|
-
select( coreStore ).
|
|
83
|
-
?.default_template_part_areas,
|
|
83
|
+
select( coreStore ).getCurrentTheme()?.default_template_part_areas,
|
|
84
84
|
]
|
|
85
85
|
);
|
|
86
86
|
|
|
@@ -31,7 +31,11 @@ const { EntitiesSavedStatesExtensible, NavigableRegion } =
|
|
|
31
31
|
unlock( privateApis );
|
|
32
32
|
const { useLocation } = unlock( routerPrivateApis );
|
|
33
33
|
|
|
34
|
-
const EntitiesSavedStatesForPreview = ( {
|
|
34
|
+
const EntitiesSavedStatesForPreview = ( {
|
|
35
|
+
onClose,
|
|
36
|
+
renderDialog,
|
|
37
|
+
variant,
|
|
38
|
+
} ) => {
|
|
35
39
|
const isDirtyProps = useEntitiesSavedStatesIsDirty();
|
|
36
40
|
let activateSaveLabel;
|
|
37
41
|
if ( isDirtyProps.isDirty ) {
|
|
@@ -76,22 +80,28 @@ const EntitiesSavedStatesForPreview = ( { onClose, renderDialog } ) => {
|
|
|
76
80
|
saveEnabled: true,
|
|
77
81
|
saveLabel: activateSaveLabel,
|
|
78
82
|
renderDialog,
|
|
83
|
+
variant,
|
|
79
84
|
} }
|
|
80
85
|
/>
|
|
81
86
|
);
|
|
82
87
|
};
|
|
83
88
|
|
|
84
|
-
const _EntitiesSavedStates = ( { onClose, renderDialog } ) => {
|
|
89
|
+
const _EntitiesSavedStates = ( { onClose, renderDialog, variant } ) => {
|
|
85
90
|
if ( isPreviewingTheme() ) {
|
|
86
91
|
return (
|
|
87
92
|
<EntitiesSavedStatesForPreview
|
|
88
93
|
onClose={ onClose }
|
|
89
94
|
renderDialog={ renderDialog }
|
|
95
|
+
variant={ variant }
|
|
90
96
|
/>
|
|
91
97
|
);
|
|
92
98
|
}
|
|
93
99
|
return (
|
|
94
|
-
<EntitiesSavedStates
|
|
100
|
+
<EntitiesSavedStates
|
|
101
|
+
close={ onClose }
|
|
102
|
+
renderDialog={ renderDialog }
|
|
103
|
+
variant={ variant }
|
|
104
|
+
/>
|
|
95
105
|
);
|
|
96
106
|
};
|
|
97
107
|
|
|
@@ -130,12 +140,10 @@ export default function SavePanel() {
|
|
|
130
140
|
<Modal
|
|
131
141
|
className="edit-site-save-panel__modal"
|
|
132
142
|
onRequestClose={ onClose }
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
'Save site, content, and template changes'
|
|
136
|
-
) }
|
|
143
|
+
title={ __( 'Review changes' ) }
|
|
144
|
+
size="small"
|
|
137
145
|
>
|
|
138
|
-
<_EntitiesSavedStates onClose={ onClose } />
|
|
146
|
+
<_EntitiesSavedStates onClose={ onClose } variant="inline" />
|
|
139
147
|
</Modal>
|
|
140
148
|
) : null;
|
|
141
149
|
}
|
|
@@ -87,23 +87,25 @@ function SidebarContentWrapper( { children, shouldAnimate } ) {
|
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export
|
|
91
|
-
routeKey,
|
|
92
|
-
shouldAnimate,
|
|
93
|
-
children,
|
|
94
|
-
} ) {
|
|
90
|
+
export function SidebarNavigationProvider( { children } ) {
|
|
95
91
|
const [ navState ] = useState( createNavState );
|
|
96
92
|
|
|
97
93
|
return (
|
|
98
94
|
<SidebarNavigationContext.Provider value={ navState }>
|
|
99
|
-
|
|
100
|
-
<SidebarContentWrapper
|
|
101
|
-
shouldAnimate={ shouldAnimate }
|
|
102
|
-
key={ routeKey }
|
|
103
|
-
>
|
|
104
|
-
{ children }
|
|
105
|
-
</SidebarContentWrapper>
|
|
106
|
-
</div>
|
|
95
|
+
{ children }
|
|
107
96
|
</SidebarNavigationContext.Provider>
|
|
108
97
|
);
|
|
109
98
|
}
|
|
99
|
+
|
|
100
|
+
export function SidebarContent( { routeKey, shouldAnimate, children } ) {
|
|
101
|
+
return (
|
|
102
|
+
<div className="edit-site-sidebar__content">
|
|
103
|
+
<SidebarContentWrapper
|
|
104
|
+
shouldAnimate={ shouldAnimate }
|
|
105
|
+
key={ routeKey }
|
|
106
|
+
>
|
|
107
|
+
{ children }
|
|
108
|
+
</SidebarContentWrapper>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -122,9 +122,9 @@ export default function SidebarNavigationScreen( {
|
|
|
122
122
|
</HStack>
|
|
123
123
|
<div className="edit-site-sidebar-navigation-screen__content">
|
|
124
124
|
{ description && (
|
|
125
|
-
<
|
|
125
|
+
<div className="edit-site-sidebar-navigation-screen__description">
|
|
126
126
|
{ description }
|
|
127
|
-
</
|
|
127
|
+
</div>
|
|
128
128
|
) }
|
|
129
129
|
{ content }
|
|
130
130
|
</div>
|
|
@@ -17,7 +17,7 @@ const useTemplatePartsGroupedByArea = ( items ) => {
|
|
|
17
17
|
|
|
18
18
|
const templatePartAreas = useSelect(
|
|
19
19
|
( select ) =>
|
|
20
|
-
select( coreStore ).
|
|
20
|
+
select( coreStore ).getCurrentTheme()
|
|
21
21
|
?.default_template_part_areas || [],
|
|
22
22
|
[]
|
|
23
23
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
6
|
+
|
|
7
|
+
export default function SidebarNavigationScreenUnsupported() {
|
|
8
|
+
return (
|
|
9
|
+
<Spacer padding={ 3 }>
|
|
10
|
+
<Notice status="warning" isDismissible={ false }>
|
|
11
|
+
{ __(
|
|
12
|
+
'The theme you are currently using does not support this screen.'
|
|
13
|
+
) }
|
|
14
|
+
</Notice>
|
|
15
|
+
</Spacer>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -2,14 +2,38 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
5
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
5
6
|
import Editor from '../editor';
|
|
7
|
+
import { isClassicThemeWithStyleBookSupport } from './utils';
|
|
6
8
|
|
|
7
9
|
export const homeRoute = {
|
|
8
10
|
name: 'home',
|
|
9
11
|
path: '/',
|
|
10
12
|
areas: {
|
|
11
|
-
sidebar
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
sidebar( { siteData } ) {
|
|
14
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
15
|
+
return isBlockTheme ||
|
|
16
|
+
isClassicThemeWithStyleBookSupport( siteData ) ? (
|
|
17
|
+
<SidebarNavigationScreenMain />
|
|
18
|
+
) : (
|
|
19
|
+
<SidebarNavigationScreenUnsupported />
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
preview( { siteData } ) {
|
|
23
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
24
|
+
return isBlockTheme ||
|
|
25
|
+
isClassicThemeWithStyleBookSupport( siteData ) ? (
|
|
26
|
+
<Editor isHomeRoute />
|
|
27
|
+
) : undefined;
|
|
28
|
+
},
|
|
29
|
+
mobile( { siteData } ) {
|
|
30
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
31
|
+
return isBlockTheme ||
|
|
32
|
+
isClassicThemeWithStyleBookSupport( siteData ) ? (
|
|
33
|
+
<SidebarNavigationScreenMain />
|
|
34
|
+
) : (
|
|
35
|
+
<SidebarNavigationScreenUnsupported />
|
|
36
|
+
);
|
|
37
|
+
},
|
|
14
38
|
},
|
|
15
39
|
};
|
|
@@ -6,9 +6,9 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
10
9
|
import Editor from '../editor';
|
|
11
10
|
import SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';
|
|
11
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
13
|
|
|
14
14
|
const { useLocation } = unlock( routerPrivateApis );
|
|
@@ -20,9 +20,7 @@ function MobileNavigationItemView() {
|
|
|
20
20
|
return canvas === 'edit' ? (
|
|
21
21
|
<Editor />
|
|
22
22
|
) : (
|
|
23
|
-
<SidebarNavigationScreenNavigationMenu
|
|
24
|
-
backPath={ { postType: NAVIGATION_POST_TYPE } }
|
|
25
|
-
/>
|
|
23
|
+
<SidebarNavigationScreenNavigationMenu backPath="/navigation" />
|
|
26
24
|
);
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -30,10 +28,29 @@ export const navigationItemRoute = {
|
|
|
30
28
|
name: 'navigation-item',
|
|
31
29
|
path: '/wp_navigation/:postId',
|
|
32
30
|
areas: {
|
|
33
|
-
sidebar
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
sidebar( { siteData } ) {
|
|
32
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
33
|
+
return isBlockTheme ? (
|
|
34
|
+
<SidebarNavigationScreenNavigationMenu backPath="/navigation" />
|
|
35
|
+
) : (
|
|
36
|
+
<SidebarNavigationScreenUnsupported />
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
preview( { siteData } ) {
|
|
40
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
41
|
+
return isBlockTheme ? (
|
|
42
|
+
<Editor />
|
|
43
|
+
) : (
|
|
44
|
+
<SidebarNavigationScreenUnsupported />
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
mobile( { siteData } ) {
|
|
48
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
49
|
+
return isBlockTheme ? (
|
|
50
|
+
<MobileNavigationItemView />
|
|
51
|
+
) : (
|
|
52
|
+
<SidebarNavigationScreenUnsupported />
|
|
53
|
+
);
|
|
54
|
+
},
|
|
38
55
|
},
|
|
39
56
|
};
|
|
@@ -8,6 +8,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
8
8
|
*/
|
|
9
9
|
import Editor from '../editor';
|
|
10
10
|
import SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';
|
|
11
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
11
12
|
import { unlock } from '../../lock-unlock';
|
|
12
13
|
|
|
13
14
|
const { useLocation } = unlock( routerPrivateApis );
|
|
@@ -27,8 +28,25 @@ export const navigationRoute = {
|
|
|
27
28
|
name: 'navigation',
|
|
28
29
|
path: '/navigation',
|
|
29
30
|
areas: {
|
|
30
|
-
sidebar
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
sidebar( { siteData } ) {
|
|
32
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
33
|
+
return isBlockTheme ? (
|
|
34
|
+
<SidebarNavigationScreenNavigationMenus backPath="/" />
|
|
35
|
+
) : (
|
|
36
|
+
<SidebarNavigationScreenUnsupported />
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
preview( { siteData } ) {
|
|
40
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
41
|
+
return isBlockTheme ? <Editor /> : undefined;
|
|
42
|
+
},
|
|
43
|
+
mobile( { siteData } ) {
|
|
44
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
45
|
+
return isBlockTheme ? (
|
|
46
|
+
<MobileNavigationView />
|
|
47
|
+
) : (
|
|
48
|
+
<SidebarNavigationScreenUnsupported />
|
|
49
|
+
);
|
|
50
|
+
},
|
|
33
51
|
},
|
|
34
52
|
};
|
|
@@ -6,8 +6,19 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
+
import { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
9
10
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
10
11
|
|
|
12
|
+
function NotFoundError() {
|
|
13
|
+
return (
|
|
14
|
+
<Notice status="error" isDismissible={ false }>
|
|
15
|
+
{ __(
|
|
16
|
+
'The requested page could not be found. Please check the URL.'
|
|
17
|
+
) }
|
|
18
|
+
</Notice>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
export const notFoundRoute = {
|
|
12
23
|
name: 'notfound',
|
|
13
24
|
path: '*',
|
|
@@ -15,13 +26,13 @@ export const notFoundRoute = {
|
|
|
15
26
|
sidebar: <SidebarNavigationScreenMain />,
|
|
16
27
|
mobile: (
|
|
17
28
|
<SidebarNavigationScreenMain
|
|
18
|
-
customDescription={
|
|
29
|
+
customDescription={ <NotFoundError /> }
|
|
19
30
|
/>
|
|
20
31
|
),
|
|
21
32
|
content: (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
</
|
|
33
|
+
<Spacer padding={ 2 }>
|
|
34
|
+
<NotFoundError />
|
|
35
|
+
</Spacer>
|
|
25
36
|
),
|
|
26
37
|
},
|
|
27
38
|
};
|
|
@@ -9,19 +9,39 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
import Editor from '../editor';
|
|
10
10
|
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
11
11
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
12
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
12
13
|
|
|
13
14
|
export const pageItemRoute = {
|
|
14
15
|
name: 'page-item',
|
|
15
16
|
path: '/page/:postId',
|
|
16
17
|
areas: {
|
|
17
|
-
sidebar
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
sidebar( { siteData } ) {
|
|
19
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
20
|
+
return isBlockTheme ? (
|
|
21
|
+
<SidebarNavigationScreen
|
|
22
|
+
title={ __( 'Pages' ) }
|
|
23
|
+
backPath="/"
|
|
24
|
+
content={ <DataViewsSidebarContent postType="page" /> }
|
|
25
|
+
/>
|
|
26
|
+
) : (
|
|
27
|
+
<SidebarNavigationScreenUnsupported />
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
mobile( { siteData } ) {
|
|
31
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
32
|
+
return isBlockTheme ? (
|
|
33
|
+
<Editor />
|
|
34
|
+
) : (
|
|
35
|
+
<SidebarNavigationScreenUnsupported />
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
preview( { siteData } ) {
|
|
39
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
40
|
+
return isBlockTheme ? (
|
|
41
|
+
<Editor />
|
|
42
|
+
) : (
|
|
43
|
+
<SidebarNavigationScreenUnsupported />
|
|
44
|
+
);
|
|
45
|
+
},
|
|
26
46
|
},
|
|
27
47
|
};
|
|
@@ -9,6 +9,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
*/
|
|
10
10
|
import Editor from '../editor';
|
|
11
11
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
12
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
12
13
|
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
13
14
|
import PostList from '../post-list';
|
|
14
15
|
import { unlock } from '../../lock-unlock';
|
|
@@ -27,21 +28,40 @@ export const pagesRoute = {
|
|
|
27
28
|
name: 'pages',
|
|
28
29
|
path: '/page',
|
|
29
30
|
areas: {
|
|
30
|
-
sidebar
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
sidebar( { siteData } ) {
|
|
32
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
33
|
+
return isBlockTheme ? (
|
|
34
|
+
<SidebarNavigationScreen
|
|
35
|
+
title={ __( 'Pages' ) }
|
|
36
|
+
backPath="/"
|
|
37
|
+
content={ <DataViewsSidebarContent postType="page" /> }
|
|
38
|
+
/>
|
|
39
|
+
) : (
|
|
40
|
+
<SidebarNavigationScreenUnsupported />
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
content( { siteData } ) {
|
|
44
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
45
|
+
return isBlockTheme ? <PostList postType="page" /> : undefined;
|
|
46
|
+
},
|
|
47
|
+
preview( { query, siteData } ) {
|
|
48
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
49
|
+
if ( ! isBlockTheme ) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
39
52
|
const isListView =
|
|
40
53
|
( query.layout === 'list' || ! query.layout ) &&
|
|
41
54
|
query.isCustom !== 'true';
|
|
42
55
|
return isListView ? <Editor /> : undefined;
|
|
43
56
|
},
|
|
44
|
-
mobile
|
|
57
|
+
mobile( { siteData } ) {
|
|
58
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
59
|
+
return isBlockTheme ? (
|
|
60
|
+
<MobilePagesView />
|
|
61
|
+
) : (
|
|
62
|
+
<SidebarNavigationScreenUnsupported />
|
|
63
|
+
);
|
|
64
|
+
},
|
|
45
65
|
edit( { query } ) {
|
|
46
66
|
const hasQuickEdit =
|
|
47
67
|
( query.layout ?? 'list' ) !== 'list' && !! query.quickEdit;
|
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
|
|
6
|
+
import { isClassicThemeWithStyleBookSupport } from './utils';
|
|
6
7
|
|
|
7
8
|
export const patternItemRoute = {
|
|
8
9
|
name: 'pattern-item',
|
|
9
10
|
path: '/wp_block/:postId',
|
|
10
11
|
areas: {
|
|
11
|
-
sidebar
|
|
12
|
+
sidebar( { siteData } ) {
|
|
13
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
14
|
+
const backPath =
|
|
15
|
+
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
|
|
16
|
+
? '/'
|
|
17
|
+
: undefined;
|
|
18
|
+
return <SidebarNavigationScreenPatterns backPath={ backPath } />;
|
|
19
|
+
},
|
|
12
20
|
mobile: <Editor />,
|
|
13
21
|
preview: <Editor />,
|
|
14
22
|
},
|
|
@@ -3,13 +3,33 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
|
|
5
5
|
import PagePatterns from '../page-patterns';
|
|
6
|
+
import { isClassicThemeWithStyleBookSupport } from './utils';
|
|
6
7
|
|
|
7
8
|
export const patternsRoute = {
|
|
8
9
|
name: 'patterns',
|
|
9
10
|
path: '/pattern',
|
|
10
11
|
areas: {
|
|
11
|
-
sidebar
|
|
12
|
+
sidebar( { siteData } ) {
|
|
13
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
14
|
+
const backPath =
|
|
15
|
+
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
|
|
16
|
+
? '/'
|
|
17
|
+
: undefined;
|
|
18
|
+
return <SidebarNavigationScreenPatterns backPath={ backPath } />;
|
|
19
|
+
},
|
|
12
20
|
content: <PagePatterns />,
|
|
13
|
-
mobile
|
|
21
|
+
mobile( { siteData, query } ) {
|
|
22
|
+
const { categoryId } = query;
|
|
23
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
24
|
+
const backPath =
|
|
25
|
+
isBlockTheme || isClassicThemeWithStyleBookSupport( siteData )
|
|
26
|
+
? '/'
|
|
27
|
+
: undefined;
|
|
28
|
+
return !! categoryId ? (
|
|
29
|
+
<PagePatterns />
|
|
30
|
+
) : (
|
|
31
|
+
<SidebarNavigationScreenPatterns backPath={ backPath } />
|
|
32
|
+
);
|
|
33
|
+
},
|
|
14
34
|
},
|
|
15
35
|
};
|
|
@@ -7,22 +7,36 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
10
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
10
11
|
import { StyleBookPreview } from '../style-book';
|
|
12
|
+
import { isClassicThemeWithStyleBookSupport } from './utils';
|
|
11
13
|
|
|
12
14
|
export const stylebookRoute = {
|
|
13
15
|
name: 'stylebook',
|
|
14
16
|
path: '/stylebook',
|
|
15
17
|
areas: {
|
|
16
|
-
sidebar
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
sidebar( { siteData } ) {
|
|
19
|
+
return isClassicThemeWithStyleBookSupport( siteData ) ? (
|
|
20
|
+
<SidebarNavigationScreen
|
|
21
|
+
title={ __( 'Styles' ) }
|
|
22
|
+
backPath="/"
|
|
23
|
+
description={ __(
|
|
24
|
+
`Preview your website's visual identity: colors, typography, and blocks.`
|
|
25
|
+
) }
|
|
26
|
+
/>
|
|
27
|
+
) : (
|
|
28
|
+
<SidebarNavigationScreenUnsupported />
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
preview( { siteData } ) {
|
|
32
|
+
return isClassicThemeWithStyleBookSupport( siteData ) ? (
|
|
33
|
+
<StyleBookPreview isStatic />
|
|
34
|
+
) : undefined;
|
|
35
|
+
},
|
|
36
|
+
mobile( { siteData } ) {
|
|
37
|
+
return isClassicThemeWithStyleBookSupport( siteData ) ? (
|
|
38
|
+
<StyleBookPreview isStatic />
|
|
39
|
+
) : undefined;
|
|
40
|
+
},
|
|
27
41
|
},
|
|
28
42
|
};
|
|
@@ -3,13 +3,35 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
6
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
6
7
|
|
|
7
8
|
export const templateItemRoute = {
|
|
8
9
|
name: 'template-item',
|
|
9
10
|
path: '/wp_template/*postId',
|
|
10
11
|
areas: {
|
|
11
|
-
sidebar
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
sidebar( { siteData } ) {
|
|
13
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
14
|
+
return isBlockTheme ? (
|
|
15
|
+
<SidebarNavigationScreenTemplatesBrowse backPath="/" />
|
|
16
|
+
) : (
|
|
17
|
+
<SidebarNavigationScreenUnsupported />
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
mobile( { siteData } ) {
|
|
21
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
22
|
+
return isBlockTheme ? (
|
|
23
|
+
<Editor />
|
|
24
|
+
) : (
|
|
25
|
+
<SidebarNavigationScreenUnsupported />
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
preview( { siteData } ) {
|
|
29
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
30
|
+
return isBlockTheme ? (
|
|
31
|
+
<Editor />
|
|
32
|
+
) : (
|
|
33
|
+
<SidebarNavigationScreenUnsupported />
|
|
34
|
+
);
|
|
35
|
+
},
|
|
14
36
|
},
|
|
15
37
|
};
|
|
@@ -3,19 +3,41 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
|
|
6
|
+
import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
|
|
6
7
|
import PageTemplates from '../page-templates';
|
|
7
8
|
|
|
8
9
|
export const templatesRoute = {
|
|
9
10
|
name: 'templates',
|
|
10
11
|
path: '/template',
|
|
11
12
|
areas: {
|
|
12
|
-
sidebar
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
sidebar( { siteData } ) {
|
|
14
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
15
|
+
return isBlockTheme ? (
|
|
16
|
+
<SidebarNavigationScreenTemplatesBrowse backPath="/" />
|
|
17
|
+
) : (
|
|
18
|
+
<SidebarNavigationScreenUnsupported />
|
|
19
|
+
);
|
|
20
|
+
},
|
|
21
|
+
content( { siteData } ) {
|
|
22
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
23
|
+
return isBlockTheme ? <PageTemplates /> : undefined;
|
|
24
|
+
},
|
|
25
|
+
preview( { query, siteData } ) {
|
|
26
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
27
|
+
if ( ! isBlockTheme ) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
15
30
|
const isListView = query.layout === 'list';
|
|
16
31
|
return isListView ? <Editor /> : undefined;
|
|
17
32
|
},
|
|
18
|
-
mobile
|
|
33
|
+
mobile( { siteData } ) {
|
|
34
|
+
const isBlockTheme = siteData.currentTheme?.is_block_theme;
|
|
35
|
+
return isBlockTheme ? (
|
|
36
|
+
<PageTemplates />
|
|
37
|
+
) : (
|
|
38
|
+
<SidebarNavigationScreenUnsupported />
|
|
39
|
+
);
|
|
40
|
+
},
|
|
19
41
|
},
|
|
20
42
|
widths: {
|
|
21
43
|
content( { query } ) {
|