@wordpress/edit-site 6.30.1-next.a730c9c8c.0 → 6.31.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/add-custom-template-modal-content.js +1 -1
  3. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  4. package/build/components/add-new-template/index.js +1 -5
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/add-new-template/utils.js +8 -84
  7. package/build/components/add-new-template/utils.js.map +1 -1
  8. package/build/components/dataviews-actions/index.js +51 -1
  9. package/build/components/dataviews-actions/index.js.map +1 -1
  10. package/build/components/editor/index.js +1 -1
  11. package/build/components/editor/index.js.map +1 -1
  12. package/build/components/editor/use-resolve-edited-entity.js +42 -14
  13. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  14. package/build/components/page-templates/fields.js +65 -5
  15. package/build/components/page-templates/fields.js.map +1 -1
  16. package/build/components/page-templates/hooks.js +1 -1
  17. package/build/components/page-templates/hooks.js.map +1 -1
  18. package/build/components/page-templates/index.js +103 -29
  19. package/build/components/page-templates/index.js.map +1 -1
  20. package/build/components/sidebar-navigation-screen-templates-browse/content.js +11 -5
  21. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  22. package/build/components/site-editor-routes/index.js +1 -1
  23. package/build/components/site-editor-routes/index.js.map +1 -1
  24. package/build/components/site-editor-routes/template-item.js +29 -23
  25. package/build/components/site-editor-routes/template-item.js.map +1 -1
  26. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
  27. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  28. package/build-module/components/add-new-template/index.js +2 -6
  29. package/build-module/components/add-new-template/index.js.map +1 -1
  30. package/build-module/components/add-new-template/utils.js +8 -84
  31. package/build-module/components/add-new-template/utils.js.map +1 -1
  32. package/build-module/components/dataviews-actions/index.js +49 -0
  33. package/build-module/components/dataviews-actions/index.js.map +1 -1
  34. package/build-module/components/editor/index.js +1 -1
  35. package/build-module/components/editor/index.js.map +1 -1
  36. package/build-module/components/editor/use-resolve-edited-entity.js +42 -14
  37. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  38. package/build-module/components/page-templates/fields.js +65 -5
  39. package/build-module/components/page-templates/fields.js.map +1 -1
  40. package/build-module/components/page-templates/hooks.js +1 -1
  41. package/build-module/components/page-templates/hooks.js.map +1 -1
  42. package/build-module/components/page-templates/index.js +105 -31
  43. package/build-module/components/page-templates/index.js.map +1 -1
  44. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +11 -5
  45. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  46. package/build-module/components/site-editor-routes/index.js +2 -2
  47. package/build-module/components/site-editor-routes/index.js.map +1 -1
  48. package/build-module/components/site-editor-routes/template-item.js +28 -22
  49. package/build-module/components/site-editor-routes/template-item.js.map +1 -1
  50. package/package.json +41 -41
  51. package/src/components/add-new-template/add-custom-template-modal-content.js +1 -3
  52. package/src/components/add-new-template/index.js +1 -8
  53. package/src/components/add-new-template/utils.js +9 -118
  54. package/src/components/dataviews-actions/index.js +51 -0
  55. package/src/components/editor/index.js +1 -0
  56. package/src/components/editor/use-resolve-edited-entity.js +54 -7
  57. package/src/components/page-templates/fields.js +70 -4
  58. package/src/components/page-templates/hooks.js +1 -1
  59. package/src/components/page-templates/index.js +160 -57
  60. package/src/components/sidebar-navigation-screen-templates-browse/content.js +17 -7
  61. package/src/components/site-editor-routes/index.js +2 -1
  62. package/src/components/site-editor-routes/template-item.js +34 -26
@@ -6,7 +6,11 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { Icon, __experimentalHStack as HStack } from '@wordpress/components';
9
+ import {
10
+ Icon,
11
+ __experimentalHStack as HStack,
12
+ privateApis as componentsPrivateApis,
13
+ } from '@wordpress/components';
10
14
  import { __ } from '@wordpress/i18n';
11
15
  import { useState, useMemo } from '@wordpress/element';
12
16
  import { decodeEntities } from '@wordpress/html-entities';
@@ -16,15 +20,40 @@ import {
16
20
  privateApis as blockEditorPrivateApis,
17
21
  } from '@wordpress/block-editor';
18
22
  import { EditorProvider } from '@wordpress/editor';
23
+ import { privateApis as corePrivateApis } from '@wordpress/core-data';
19
24
 
20
25
  /**
21
26
  * Internal dependencies
22
27
  */
23
28
  import { useAddedBy } from './hooks';
29
+ import { useDefaultTemplateTypes } from '../add-new-template/utils';
24
30
  import usePatternSettings from '../page-patterns/use-pattern-settings';
25
31
  import { unlock } from '../../lock-unlock';
26
32
 
27
33
  const { useGlobalStyle } = unlock( blockEditorPrivateApis );
34
+ const { Badge } = unlock( componentsPrivateApis );
35
+ const { useEntityRecordsWithPermissions } = unlock( corePrivateApis );
36
+
37
+ function useAllDefaultTemplateTypes() {
38
+ const defaultTemplateTypes = useDefaultTemplateTypes();
39
+ const { records: staticRecords } = useEntityRecordsWithPermissions(
40
+ 'postType',
41
+ 'wp_registered_template',
42
+ { per_page: -1 }
43
+ );
44
+ return [
45
+ ...defaultTemplateTypes,
46
+ ...staticRecords
47
+ ?.filter( ( record ) => ! record.is_custom )
48
+ .map( ( record ) => {
49
+ return {
50
+ slug: record.slug,
51
+ title: record.title.rendered,
52
+ description: record.description,
53
+ };
54
+ } ),
55
+ ];
56
+ }
28
57
 
29
58
  function PreviewField( { item } ) {
30
59
  const settings = usePatternSettings();
@@ -68,8 +97,14 @@ export const previewField = {
68
97
  export const descriptionField = {
69
98
  label: __( 'Description' ),
70
99
  id: 'description',
71
- render: ( { item } ) => {
72
- return item.description && decodeEntities( item.description );
100
+ render: function RenderDescription( { item } ) {
101
+ const defaultTemplateTypes = useAllDefaultTemplateTypes();
102
+ const defaultTemplateType = defaultTemplateTypes.find(
103
+ ( type ) => type.slug === item.slug
104
+ );
105
+ return item.description
106
+ ? decodeEntities( item.description )
107
+ : defaultTemplateType?.description;
73
108
  },
74
109
  enableSorting: false,
75
110
  enableGlobalSearch: true,
@@ -107,6 +142,37 @@ function AuthorField( { item } ) {
107
142
  export const authorField = {
108
143
  label: __( 'Author' ),
109
144
  id: 'author',
110
- getValue: ( { item } ) => item.author_text,
145
+ getValue: ( { item } ) => item.author_text ?? item.author,
111
146
  render: AuthorField,
112
147
  };
148
+
149
+ export const activeField = {
150
+ label: __( 'Status' ),
151
+ id: 'active',
152
+ getValue: ( { item } ) => item._isActive,
153
+ render: function Render( { item } ) {
154
+ const isActive = item._isActive;
155
+ return (
156
+ <Badge intent={ isActive ? 'success' : 'default' }>
157
+ { isActive ? __( 'Active' ) : __( 'Inactive' ) }
158
+ </Badge>
159
+ );
160
+ },
161
+ };
162
+
163
+ export const slugField = {
164
+ label: __( 'Template Type' ),
165
+ id: 'slug',
166
+ getValue: ( { item } ) => item.slug,
167
+ render: function Render( { item } ) {
168
+ const defaultTemplateTypes = useAllDefaultTemplateTypes();
169
+ const defaultTemplateType = defaultTemplateTypes.find(
170
+ ( type ) => type.slug === item.slug
171
+ );
172
+ return (
173
+ defaultTemplateType?.title ||
174
+ // translators: %s is the slug of a custom template.
175
+ __( 'Custom' )
176
+ );
177
+ },
178
+ };
@@ -89,7 +89,7 @@ export function useAddedBy( postType, postId ) {
89
89
  type: 'user',
90
90
  icon: authorIcon,
91
91
  imageUrl: user?.avatar_urls?.[ 48 ],
92
- text: authorText,
92
+ text: authorText ?? user?.name,
93
93
  isCustomized: false,
94
94
  };
95
95
  }
@@ -3,11 +3,16 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { useState, useMemo, useCallback, useEffect } from '@wordpress/element';
6
- import { privateApis as corePrivateApis } from '@wordpress/core-data';
6
+ import {
7
+ privateApis as corePrivateApis,
8
+ store as coreStore,
9
+ } from '@wordpress/core-data';
7
10
  import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
8
11
  import { privateApis as routerPrivateApis } from '@wordpress/router';
9
12
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
10
13
  import { addQueryArgs } from '@wordpress/url';
14
+ import { useSelect } from '@wordpress/data';
15
+ import { useEvent } from '@wordpress/compose';
11
16
 
12
17
  /**
13
18
  * Internal dependencies
@@ -22,16 +27,22 @@ import {
22
27
  LAYOUT_LIST,
23
28
  } from '../../utils/constants';
24
29
  import { unlock } from '../../lock-unlock';
25
- import { useEditPostAction } from '../dataviews-actions';
26
- import { authorField, descriptionField, previewField } from './fields';
27
- import { useEvent } from '@wordpress/compose';
30
+ import {
31
+ useEditPostAction,
32
+ useSetActiveTemplateAction,
33
+ } from '../dataviews-actions';
34
+ import {
35
+ authorField,
36
+ descriptionField,
37
+ previewField,
38
+ activeField,
39
+ slugField,
40
+ } from './fields';
28
41
 
29
42
  const { usePostActions, templateTitleField } = unlock( editorPrivateApis );
30
43
  const { useHistory, useLocation } = unlock( routerPrivateApis );
31
44
  const { useEntityRecordsWithPermissions } = unlock( corePrivateApis );
32
45
 
33
- const EMPTY_ARRAY = [];
34
-
35
46
  const defaultLayouts = {
36
47
  [ LAYOUT_TABLE ]: {
37
48
  showMedia: false,
@@ -56,31 +67,29 @@ const DEFAULT_VIEW = {
56
67
  titleField: 'title',
57
68
  descriptionField: 'description',
58
69
  mediaField: 'preview',
59
- fields: [ 'author' ],
70
+ fields: [ 'author', 'active', 'slug' ],
60
71
  filters: [],
61
72
  ...defaultLayouts[ LAYOUT_GRID ],
62
73
  };
63
74
 
64
75
  export default function PageTemplates() {
65
76
  const { path, query } = useLocation();
66
- const { activeView = 'all', layout, postId } = query;
77
+ const { activeView = 'active', layout, postId } = query;
67
78
  const [ selection, setSelection ] = useState( [ postId ] );
68
-
69
79
  const defaultView = useMemo( () => {
70
80
  const usedType = layout ?? DEFAULT_VIEW.type;
71
81
  return {
72
82
  ...DEFAULT_VIEW,
73
83
  type: usedType,
74
- filters:
75
- activeView !== 'all'
76
- ? [
77
- {
78
- field: 'author',
79
- operator: 'isAny',
80
- value: [ activeView ],
81
- },
82
- ]
83
- : [],
84
+ filters: ! [ 'active', 'user' ].includes( activeView )
85
+ ? [
86
+ {
87
+ field: 'author',
88
+ operator: 'isAny',
89
+ value: [ activeView ],
90
+ },
91
+ ]
92
+ : [],
84
93
  ...defaultLayouts[ usedType ],
85
94
  };
86
95
  }, [ layout, activeView ] );
@@ -98,23 +107,116 @@ export default function PageTemplates() {
98
107
  useEffect( () => {
99
108
  setView( ( currentView ) => ( {
100
109
  ...currentView,
101
- filters:
102
- activeView !== 'all'
103
- ? [
104
- {
105
- field: 'author',
106
- operator: OPERATOR_IS_ANY,
107
- value: [ activeView ],
108
- },
109
- ]
110
- : [],
110
+ filters: ! [ 'active', 'user' ].includes( activeView )
111
+ ? [
112
+ {
113
+ field: 'author',
114
+ operator: OPERATOR_IS_ANY,
115
+ value: [ activeView ],
116
+ },
117
+ ]
118
+ : [],
111
119
  } ) );
112
120
  }, [ setView, activeView ] );
113
121
 
114
- const { records, isResolving: isLoadingData } =
122
+ const activeTemplatesOption = useSelect(
123
+ ( select ) =>
124
+ select( coreStore ).getEntityRecord( 'root', 'site' )
125
+ ?.active_templates
126
+ );
127
+ // Todo: this will have to be better so that we're not fetching all the
128
+ // records all the time. Active templates query will need to move server
129
+ // side.
130
+ const { records: userRecords, isResolving: isLoadingUserRecords } =
115
131
  useEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {
116
132
  per_page: -1,
117
133
  } );
134
+ const { records: staticRecords, isResolving: isLoadingStaticData } =
135
+ useEntityRecordsWithPermissions( 'postType', 'wp_registered_template', {
136
+ per_page: -1,
137
+ } );
138
+
139
+ const activeTemplates = useMemo( () => {
140
+ const _active = [ ...staticRecords ].filter(
141
+ ( record ) => ! record.is_custom
142
+ );
143
+ if ( activeTemplatesOption ) {
144
+ for ( const activeSlug in activeTemplatesOption ) {
145
+ const activeId = activeTemplatesOption[ activeSlug ];
146
+ if ( activeId === false ) {
147
+ // Remove the template from the array.
148
+ const index = _active.findIndex(
149
+ ( template ) => template.slug === activeSlug
150
+ );
151
+ if ( index !== -1 ) {
152
+ _active.splice( index, 1 );
153
+ }
154
+ } else {
155
+ // Replace the template in the array.
156
+ const template = userRecords.find(
157
+ ( { id } ) => id === activeId
158
+ );
159
+ if ( template ) {
160
+ const index = _active.findIndex(
161
+ ( { slug } ) => slug === template.slug
162
+ );
163
+ if ( index !== -1 ) {
164
+ _active[ index ] = template;
165
+ } else {
166
+ _active.push( template );
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ return _active;
173
+ }, [ userRecords, staticRecords, activeTemplatesOption ] );
174
+
175
+ let _records;
176
+ let isLoadingData;
177
+ if ( activeView === 'active' ) {
178
+ _records = activeTemplates;
179
+ isLoadingData = isLoadingUserRecords || isLoadingStaticData;
180
+ } else if ( activeView === 'user' ) {
181
+ _records = userRecords;
182
+ isLoadingData = isLoadingUserRecords;
183
+ } else {
184
+ _records = staticRecords;
185
+ isLoadingData = isLoadingStaticData;
186
+ }
187
+
188
+ const records = useMemo( () => {
189
+ return _records.map( ( record ) => ( {
190
+ ...record,
191
+ _isActive:
192
+ typeof record.id === 'string'
193
+ ? activeTemplatesOption[ record.slug ] === record.id ||
194
+ activeTemplatesOption[ record.slug ] === undefined
195
+ : Object.values( activeTemplatesOption ).includes(
196
+ record.id
197
+ ),
198
+ } ) );
199
+ }, [ _records, activeTemplatesOption ] );
200
+
201
+ const users = useSelect(
202
+ ( select ) => {
203
+ const { getUser } = select( coreStore );
204
+ return records.reduce( ( acc, record ) => {
205
+ if ( record.author_text ) {
206
+ if ( ! acc[ record.author_text ] ) {
207
+ acc[ record.author_text ] = record.author_text;
208
+ }
209
+ } else if ( record.author ) {
210
+ if ( ! acc[ record.author ] ) {
211
+ acc[ record.author ] = getUser( record.author );
212
+ }
213
+ }
214
+ return acc;
215
+ }, {} );
216
+ },
217
+ [ records ]
218
+ );
219
+
118
220
  const history = useHistory();
119
221
  const onChangeSelection = useCallback(
120
222
  ( items ) => {
@@ -130,32 +232,27 @@ export default function PageTemplates() {
130
232
  [ history, path, view?.type ]
131
233
  );
132
234
 
133
- const authors = useMemo( () => {
134
- if ( ! records ) {
135
- return EMPTY_ARRAY;
136
- }
137
- const authorsSet = new Set();
138
- records.forEach( ( template ) => {
139
- authorsSet.add( template.author_text );
140
- } );
141
- return Array.from( authorsSet ).map( ( author ) => ( {
142
- value: author,
143
- label: author,
144
- } ) );
145
- }, [ records ] );
146
-
147
- const fields = useMemo(
148
- () => [
235
+ const fields = useMemo( () => {
236
+ const _fields = [
149
237
  previewField,
150
238
  templateTitleField,
151
239
  descriptionField,
152
- {
153
- ...authorField,
154
- elements: authors,
155
- },
156
- ],
157
- [ authors ]
158
- );
240
+ activeField,
241
+ slugField,
242
+ ];
243
+ const elements = [];
244
+ for ( const author in users ) {
245
+ elements.push( {
246
+ value: users[ author ]?.id ?? author,
247
+ label: users[ author ]?.name ?? author,
248
+ } );
249
+ }
250
+ _fields.push( {
251
+ ...authorField,
252
+ elements,
253
+ } );
254
+ return _fields;
255
+ }, [ users ] );
159
256
 
160
257
  const { data, paginationInfo } = useMemo( () => {
161
258
  return filterSortAndPaginate( records, view, fields );
@@ -166,9 +263,13 @@ export default function PageTemplates() {
166
263
  context: 'list',
167
264
  } );
168
265
  const editAction = useEditPostAction();
266
+ const setActiveTemplateAction = useSetActiveTemplateAction();
169
267
  const actions = useMemo(
170
- () => [ editAction, ...postTypeActions ],
171
- [ postTypeActions, editAction ]
268
+ () =>
269
+ activeView === 'user'
270
+ ? [ setActiveTemplateAction, editAction, ...postTypeActions ]
271
+ : [ setActiveTemplateAction, ...postTypeActions ],
272
+ [ postTypeActions, setActiveTemplateAction, editAction, activeView ]
172
273
  );
173
274
 
174
275
  const onChangeView = useEvent( ( newView ) => {
@@ -199,8 +300,10 @@ export default function PageTemplates() {
199
300
  onChangeView={ onChangeView }
200
301
  onChangeSelection={ onChangeSelection }
201
302
  isItemClickable={ () => true }
202
- onClickItem={ ( { id } ) => {
203
- history.navigate( `/wp_template/${ id }?canvas=edit` );
303
+ onClickItem={ ( item ) => {
304
+ history.navigate(
305
+ `/${ item.type }/${ item.id }?canvas=edit`
306
+ );
204
307
  } }
205
308
  selection={ selection }
206
309
  defaultLayouts={ defaultLayouts }
@@ -14,7 +14,6 @@ import { addQueryArgs } from '@wordpress/url';
14
14
  import SidebarNavigationItem from '../sidebar-navigation-item';
15
15
  import { useAddedBy } from '../page-templates/hooks';
16
16
  import { layout } from '@wordpress/icons';
17
- import { TEMPLATE_POST_TYPE } from '../../utils/constants';
18
17
  import { unlock } from '../../lock-unlock';
19
18
 
20
19
  const { useLocation } = unlock( routerPrivateApis );
@@ -37,11 +36,15 @@ function TemplateDataviewItem( { template, isActive } ) {
37
36
 
38
37
  export default function DataviewsTemplatesSidebarContent() {
39
38
  const {
40
- query: { activeView = 'all' },
39
+ query: { activeView = 'active' },
41
40
  } = useLocation();
42
- const { records } = useEntityRecords( 'postType', TEMPLATE_POST_TYPE, {
43
- per_page: -1,
44
- } );
41
+ const { records } = useEntityRecords(
42
+ 'postType',
43
+ 'wp_registered_template',
44
+ {
45
+ per_page: -1,
46
+ }
47
+ );
45
48
  const firstItemPerAuthorText = useMemo( () => {
46
49
  const firstItemPerAuthor = records?.reduce( ( acc, template ) => {
47
50
  const author = template.author_text;
@@ -61,9 +64,16 @@ export default function DataviewsTemplatesSidebarContent() {
61
64
  <SidebarNavigationItem
62
65
  to="/template"
63
66
  icon={ layout }
64
- aria-current={ activeView === 'all' }
67
+ aria-current={ activeView === 'active' }
68
+ >
69
+ { __( 'Active templates' ) }
70
+ </SidebarNavigationItem>
71
+ <SidebarNavigationItem
72
+ to={ addQueryArgs( '/template', { activeView: 'user' } ) }
73
+ icon={ layout }
74
+ aria-current={ activeView === 'user' }
65
75
  >
66
- { __( 'All templates' ) }
76
+ { __( 'Custom templates' ) }
67
77
  </SidebarNavigationItem>
68
78
  { firstItemPerAuthorText.map( ( template ) => {
69
79
  return (
@@ -17,7 +17,7 @@ import { patternsRoute } from './patterns';
17
17
  import { patternItemRoute } from './pattern-item';
18
18
  import { templatePartItemRoute } from './template-part-item';
19
19
  import { templatesRoute } from './templates';
20
- import { templateItemRoute } from './template-item';
20
+ import { templateItemRoute, staticTemplateItemRoute } from './template-item';
21
21
  import { pagesRoute } from './pages';
22
22
  import { pageItemRoute } from './page-item';
23
23
  import { stylebookRoute } from './stylebook';
@@ -27,6 +27,7 @@ const routes = [
27
27
  pageItemRoute,
28
28
  pagesRoute,
29
29
  templateItemRoute,
30
+ staticTemplateItemRoute,
30
31
  templatesRoute,
31
32
  templatePartItemRoute,
32
33
  patternItemRoute,
@@ -5,33 +5,41 @@ import Editor from '../editor';
5
5
  import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';
6
6
  import SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';
7
7
 
8
+ const areas = {
9
+ sidebar( { siteData } ) {
10
+ const isBlockTheme = siteData.currentTheme?.is_block_theme;
11
+ return isBlockTheme ? (
12
+ <SidebarNavigationScreenTemplatesBrowse backPath="/" />
13
+ ) : (
14
+ <SidebarNavigationScreenUnsupported />
15
+ );
16
+ },
17
+ mobile( { siteData } ) {
18
+ const isBlockTheme = siteData.currentTheme?.is_block_theme;
19
+ return isBlockTheme ? (
20
+ <Editor />
21
+ ) : (
22
+ <SidebarNavigationScreenUnsupported />
23
+ );
24
+ },
25
+ preview( { siteData } ) {
26
+ const isBlockTheme = siteData.currentTheme?.is_block_theme;
27
+ return isBlockTheme ? (
28
+ <Editor />
29
+ ) : (
30
+ <SidebarNavigationScreenUnsupported />
31
+ );
32
+ },
33
+ };
34
+
8
35
  export const templateItemRoute = {
9
36
  name: 'template-item',
10
37
  path: '/wp_template/*postId',
11
- areas: {
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
- },
36
- },
38
+ areas,
39
+ };
40
+
41
+ export const staticTemplateItemRoute = {
42
+ name: 'static-template-item',
43
+ path: '/wp_registered_template/*postId',
44
+ areas,
37
45
  };