@wordpress/edit-site 6.48.2-next.v.202606191442.0 → 6.49.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-post/index.cjs +0 -1
  3. package/build/components/add-new-post/index.cjs.map +2 -2
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs +0 -1
  5. package/build/components/add-new-template/add-custom-generic-template-modal-content.cjs.map +2 -2
  6. package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +0 -1
  7. package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +2 -2
  8. package/build/components/layout/index.cjs +6 -7
  9. package/build/components/layout/index.cjs.map +3 -3
  10. package/build/components/page-patterns/fields.cjs +2 -51
  11. package/build/components/page-patterns/fields.cjs.map +3 -3
  12. package/build/components/page-patterns/index.cjs +12 -23
  13. package/build/components/page-patterns/index.cjs.map +2 -2
  14. package/build/components/page-templates/index-legacy.cjs +5 -28
  15. package/build/components/page-templates/index-legacy.cjs.map +2 -2
  16. package/build/components/sidebar-dataviews/index.cjs +3 -1
  17. package/build/components/sidebar-dataviews/index.cjs.map +2 -2
  18. package/build/components/sidebar-navigation-item/index.cjs +9 -0
  19. package/build/components/sidebar-navigation-item/index.cjs.map +2 -2
  20. package/build/components/sidebar-navigation-screen-main/index.cjs +40 -47
  21. package/build/components/sidebar-navigation-screen-main/index.cjs.map +2 -2
  22. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs +0 -1
  23. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.cjs.map +2 -2
  24. package/build/components/sidebar-navigation-screen-patterns/index.cjs +5 -2
  25. package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +2 -2
  26. package/build-module/components/add-new-post/index.mjs +0 -1
  27. package/build-module/components/add-new-post/index.mjs.map +2 -2
  28. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs +0 -1
  29. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.mjs.map +2 -2
  30. package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +0 -1
  31. package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +2 -2
  32. package/build-module/components/layout/index.mjs +1 -2
  33. package/build-module/components/layout/index.mjs.map +2 -2
  34. package/build-module/components/page-patterns/fields.mjs +2 -40
  35. package/build-module/components/page-patterns/fields.mjs.map +2 -2
  36. package/build-module/components/page-patterns/index.mjs +14 -29
  37. package/build-module/components/page-patterns/index.mjs.map +2 -2
  38. package/build-module/components/page-templates/index-legacy.mjs +6 -29
  39. package/build-module/components/page-templates/index-legacy.mjs.map +2 -2
  40. package/build-module/components/sidebar-dataviews/index.mjs +3 -1
  41. package/build-module/components/sidebar-dataviews/index.mjs.map +2 -2
  42. package/build-module/components/sidebar-navigation-item/index.mjs +9 -0
  43. package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
  44. package/build-module/components/sidebar-navigation-screen-main/index.mjs +41 -48
  45. package/build-module/components/sidebar-navigation-screen-main/index.mjs.map +2 -2
  46. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs +0 -1
  47. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.mjs.map +2 -2
  48. package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +5 -2
  49. package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
  50. package/build-style/style-rtl.css +29 -33
  51. package/build-style/style.css +29 -33
  52. package/package.json +48 -48
  53. package/src/components/add-new-post/index.js +0 -1
  54. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +0 -1
  55. package/src/components/add-new-template-legacy/add-custom-generic-template-modal-content.js +0 -1
  56. package/src/components/layout/index.js +1 -2
  57. package/src/components/page-patterns/fields.js +1 -48
  58. package/src/components/page-patterns/index.js +17 -29
  59. package/src/components/page-templates/index-legacy.js +6 -33
  60. package/src/components/sidebar-dataviews/index.js +3 -0
  61. package/src/components/sidebar-navigation-item/index.js +11 -0
  62. package/src/components/sidebar-navigation-screen-main/index.js +49 -56
  63. package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +0 -1
  64. package/src/components/sidebar-navigation-screen-patterns/index.js +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "6.48.2-next.v.202606191442.0+17fe7db8a",
3
+ "version": "6.49.1",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -47,52 +47,52 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@react-spring/web": "^9.4.5",
50
- "@wordpress/a11y": "^4.48.2-next.v.202606191442.0+17fe7db8a",
51
- "@wordpress/admin-ui": "^2.3.2-next.v.202606191442.0+17fe7db8a",
52
- "@wordpress/api-fetch": "^7.48.2-next.v.202606191442.0+17fe7db8a",
53
- "@wordpress/base-styles": "^10.0.2-next.v.202606191442.0+17fe7db8a",
54
- "@wordpress/blob": "^4.48.2-next.v.202606191442.0+17fe7db8a",
55
- "@wordpress/block-editor": "^15.22.1-next.v.202606191442.0+17fe7db8a",
56
- "@wordpress/block-library": "^10.0.1-next.v.202606191442.0+17fe7db8a",
57
- "@wordpress/blocks": "^15.21.3-next.v.202606191442.0+17fe7db8a",
58
- "@wordpress/commands": "^1.48.2-next.v.202606191442.0+17fe7db8a",
59
- "@wordpress/components": "^35.1.1-next.v.202606191442.0+17fe7db8a",
60
- "@wordpress/compose": "^8.1.2-next.v.202606191442.0+17fe7db8a",
61
- "@wordpress/core-data": "^7.48.2-next.v.202606191442.0+17fe7db8a",
62
- "@wordpress/data": "^10.48.2-next.v.202606191442.0+17fe7db8a",
63
- "@wordpress/dataviews": "^17.0.1-next.v.202606191442.0+17fe7db8a",
64
- "@wordpress/date": "^5.48.2-next.v.202606191442.0+17fe7db8a",
65
- "@wordpress/deprecated": "^4.48.2-next.v.202606191442.0+17fe7db8a",
66
- "@wordpress/dom": "^4.48.2-next.v.202606191442.0+17fe7db8a",
67
- "@wordpress/editor": "^14.48.2-next.v.202606191442.0+17fe7db8a",
68
- "@wordpress/element": "^8.0.2-next.v.202606191442.0+17fe7db8a",
69
- "@wordpress/escape-html": "^3.48.2-next.v.202606191442.0+17fe7db8a",
70
- "@wordpress/fields": "^0.40.2-next.v.202606191442.0+17fe7db8a",
71
- "@wordpress/global-styles-engine": "^1.15.2-next.v.202606191442.0+17fe7db8a",
72
- "@wordpress/global-styles-ui": "^1.15.2-next.v.202606191442.0+17fe7db8a",
73
- "@wordpress/hooks": "^4.48.2-next.v.202606191442.0+17fe7db8a",
74
- "@wordpress/html-entities": "^4.48.2-next.v.202606191442.0+17fe7db8a",
75
- "@wordpress/i18n": "^6.21.2-next.v.202606191442.0+17fe7db8a",
76
- "@wordpress/icons": "^14.0.2-next.v.202606191442.0+17fe7db8a",
77
- "@wordpress/keyboard-shortcuts": "^5.48.2-next.v.202606191442.0+17fe7db8a",
78
- "@wordpress/keycodes": "^4.48.2-next.v.202606191442.0+17fe7db8a",
79
- "@wordpress/media-utils": "^5.48.2-next.v.202606191442.0+17fe7db8a",
80
- "@wordpress/notices": "^5.48.2-next.v.202606191442.0+17fe7db8a",
81
- "@wordpress/patterns": "^2.48.2-next.v.202606191442.0+17fe7db8a",
82
- "@wordpress/plugins": "^7.48.2-next.v.202606191442.0+17fe7db8a",
83
- "@wordpress/preferences": "^4.48.2-next.v.202606191442.0+17fe7db8a",
84
- "@wordpress/primitives": "^4.48.2-next.v.202606191442.0+17fe7db8a",
85
- "@wordpress/private-apis": "^1.48.2-next.v.202606191442.0+17fe7db8a",
86
- "@wordpress/reusable-blocks": "^5.48.2-next.v.202606191442.0+17fe7db8a",
87
- "@wordpress/router": "^1.48.2-next.v.202606191442.0+17fe7db8a",
88
- "@wordpress/style-engine": "^2.49.1-next.v.202606191442.0+17fe7db8a",
89
- "@wordpress/theme": "^0.16.1-next.v.202606191442.0+17fe7db8a",
90
- "@wordpress/ui": "^0.16.1-next.v.202606191442.0+17fe7db8a",
91
- "@wordpress/url": "^4.48.2-next.v.202606191442.0+17fe7db8a",
92
- "@wordpress/viewport": "^6.48.2-next.v.202606191442.0+17fe7db8a",
93
- "@wordpress/views": "^1.15.2-next.v.202606191442.0+17fe7db8a",
94
- "@wordpress/widgets": "^4.48.2-next.v.202606191442.0+17fe7db8a",
95
- "@wordpress/wordcount": "^4.48.2-next.v.202606191442.0+17fe7db8a",
50
+ "@wordpress/a11y": "^4.49.0",
51
+ "@wordpress/admin-ui": "^2.4.1",
52
+ "@wordpress/api-fetch": "^7.49.0",
53
+ "@wordpress/base-styles": "^10.1.0",
54
+ "@wordpress/blob": "^4.49.0",
55
+ "@wordpress/block-editor": "^15.22.1",
56
+ "@wordpress/block-library": "^10.0.1",
57
+ "@wordpress/blocks": "^15.22.0",
58
+ "@wordpress/commands": "^1.49.1",
59
+ "@wordpress/components": "^36.0.1",
60
+ "@wordpress/compose": "^8.2.0",
61
+ "@wordpress/core-data": "^7.49.1",
62
+ "@wordpress/data": "^10.49.0",
63
+ "@wordpress/dataviews": "^17.0.1",
64
+ "@wordpress/date": "^5.49.0",
65
+ "@wordpress/deprecated": "^4.49.0",
66
+ "@wordpress/dom": "^4.49.0",
67
+ "@wordpress/editor": "^14.49.1",
68
+ "@wordpress/element": "^8.1.0",
69
+ "@wordpress/escape-html": "^3.49.0",
70
+ "@wordpress/fields": "^0.41.1",
71
+ "@wordpress/global-styles-engine": "^1.16.0",
72
+ "@wordpress/global-styles-ui": "^1.16.1",
73
+ "@wordpress/hooks": "^4.49.0",
74
+ "@wordpress/html-entities": "^4.49.0",
75
+ "@wordpress/i18n": "^6.22.0",
76
+ "@wordpress/icons": "^15.0.0",
77
+ "@wordpress/keyboard-shortcuts": "^5.49.0",
78
+ "@wordpress/keycodes": "^4.49.0",
79
+ "@wordpress/media-utils": "^5.49.1",
80
+ "@wordpress/notices": "^5.49.1",
81
+ "@wordpress/patterns": "^2.49.1",
82
+ "@wordpress/plugins": "^7.49.1",
83
+ "@wordpress/preferences": "^4.49.1",
84
+ "@wordpress/primitives": "^4.49.0",
85
+ "@wordpress/private-apis": "^1.49.0",
86
+ "@wordpress/reusable-blocks": "^5.49.1",
87
+ "@wordpress/router": "^1.49.0",
88
+ "@wordpress/style-engine": "^2.49.0",
89
+ "@wordpress/theme": "^0.17.0",
90
+ "@wordpress/ui": "^0.16.1",
91
+ "@wordpress/url": "^4.49.0",
92
+ "@wordpress/viewport": "^6.49.0",
93
+ "@wordpress/views": "^1.16.1",
94
+ "@wordpress/widgets": "^4.49.1",
95
+ "@wordpress/wordcount": "^4.49.0",
96
96
  "change-case": "^4.1.2",
97
97
  "clsx": "^2.1.1",
98
98
  "colord": "^2.9.3",
@@ -107,5 +107,5 @@
107
107
  "publishConfig": {
108
108
  "access": "public"
109
109
  },
110
- "gitHead": "1b6a19222df5a88f161880b5789efb3171d8f425"
110
+ "gitHead": "9a75283890dda96ae1d37197b5070fae8c9cf66f"
111
111
  }
@@ -98,7 +98,6 @@ export default function AddNewPostModal( { postType, onSave, onClose } ) {
98
98
  <form onSubmit={ createPost }>
99
99
  <VStack spacing={ 4 }>
100
100
  <TextControl
101
- __next40pxDefaultSize
102
101
  label={ __( 'Title' ) }
103
102
  onChange={ setTitle }
104
103
  placeholder={ __( 'No title' ) }
@@ -52,7 +52,6 @@ function AddCustomGenericTemplateModalContent( { createTemplate, onBack } ) {
52
52
  <form onSubmit={ onCreateTemplate }>
53
53
  <VStack spacing={ 6 }>
54
54
  <TextControl
55
- __next40pxDefaultSize
56
55
  label={ __( 'Name' ) }
57
56
  value={ title }
58
57
  onChange={ setTitle }
@@ -52,7 +52,6 @@ function AddCustomGenericTemplateModalContent( { createTemplate, onBack } ) {
52
52
  <form onSubmit={ onCreateTemplate }>
53
53
  <VStack spacing={ 6 }>
54
54
  <TextControl
55
- __next40pxDefaultSize
56
55
  label={ __( 'Name' ) }
57
56
  value={ title }
58
57
  onChange={ setTitle }
@@ -27,7 +27,7 @@ import {
27
27
  privateApis as editorPrivateApis,
28
28
  } from '@wordpress/editor';
29
29
  import { privateApis as routerPrivateApis } from '@wordpress/router';
30
- import { privateApis as themePrivateApis } from '@wordpress/theme';
30
+ import { ThemeProvider } from '@wordpress/theme';
31
31
  import { PluginArea } from '@wordpress/plugins';
32
32
  import { SnackbarNotices, store as noticesStore } from '@wordpress/notices';
33
33
  import { useDispatch, useSelect } from '@wordpress/data';
@@ -49,7 +49,6 @@ import SavePanel from '../save-panel';
49
49
 
50
50
  const { useLocation } = unlock( routerPrivateApis );
51
51
  const { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );
52
- const { ThemeProvider } = unlock( themePrivateApis );
53
52
 
54
53
  const ANIMATION_DURATION = 0.3;
55
54
  const CONTENT_COLOR = { background: '#ffffff' };
@@ -1,16 +1,9 @@
1
- /**
2
- * External dependencies
3
- */
4
- import clsx from 'clsx';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
9
- import { __experimentalHStack as HStack } from '@wordpress/components';
10
4
  import { __, _x } from '@wordpress/i18n';
11
- import { useState, useMemo, useId } from '@wordpress/element';
5
+ import { useMemo, useId } from '@wordpress/element';
12
6
  import { BlockPreview } from '@wordpress/block-editor';
13
- import { Icon } from '@wordpress/icons';
14
7
  import { parse } from '@wordpress/blocks';
15
8
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
16
9
 
@@ -22,7 +15,6 @@ import {
22
15
  PATTERN_SYNC_TYPES,
23
16
  OPERATOR_IS,
24
17
  } from '../../utils/constants';
25
- import { useAddedBy } from '../page-templates/hooks';
26
18
  import { unlock } from '../../lock-unlock';
27
19
 
28
20
  const { useStyle } = unlock( editorPrivateApis );
@@ -117,42 +109,3 @@ export const patternStatusField = {
117
109
  },
118
110
  enableSorting: false,
119
111
  };
120
-
121
- function AuthorField( { item } ) {
122
- const [ isImageLoaded, setIsImageLoaded ] = useState( false );
123
- const { text, icon, imageUrl } = useAddedBy( item.type, item.id );
124
-
125
- return (
126
- <HStack alignment="left" spacing={ 0 }>
127
- { imageUrl && (
128
- <div
129
- className={ clsx( 'fields-controls__author-avatar', {
130
- 'is-loaded': isImageLoaded,
131
- } ) }
132
- >
133
- <img
134
- onLoad={ () => setIsImageLoaded( true ) }
135
- alt=""
136
- src={ imageUrl }
137
- />
138
- </div>
139
- ) }
140
- { ! imageUrl && (
141
- <div className="fields-controls__author-icon">
142
- <Icon icon={ icon } />
143
- </div>
144
- ) }
145
- <span className="fields-controls__author-name">{ text }</span>
146
- </HStack>
147
- );
148
- }
149
-
150
- export const templatePartAuthorField = {
151
- label: __( 'Author' ),
152
- id: 'author',
153
- getValue: ( { item } ) => item.author_text,
154
- render: AuthorField,
155
- filterBy: {
156
- isPrimary: true,
157
- },
158
- };
@@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n';
6
6
  import { useMemo } from '@wordpress/element';
7
7
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
8
8
  import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';
9
- import { useEntityRecords, store as coreStore } from '@wordpress/core-data';
9
+ import { store as coreStore } from '@wordpress/core-data';
10
10
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
11
11
  import { privateApis as routerPrivateApis } from '@wordpress/router';
12
12
  import { useView, useViewConfig } from '@wordpress/views';
@@ -26,18 +26,16 @@ import { unlock } from '../../lock-unlock';
26
26
  import usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';
27
27
  import PatternsActions from './actions';
28
28
  import { useEditPostAction } from '../dataviews-actions';
29
- import {
30
- patternStatusField,
31
- previewField,
32
- templatePartAuthorField,
33
- } from './fields';
29
+ import { patternStatusField, previewField } from './fields';
34
30
  import usePatternCategories from '../sidebar-navigation-screen-patterns/use-pattern-categories';
35
31
 
36
32
  const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
37
- const { usePostActions, patternTitleField } = unlock( editorPrivateApis );
33
+ const { usePostActions, usePostFields, patternTitleField } =
34
+ unlock( editorPrivateApis );
38
35
  const { useLocation, useHistory } = unlock( routerPrivateApis );
39
36
 
40
37
  const EMPTY_ARRAY = [];
38
+ const VIEW_CONFIG_FIELDS = [ 'default_view', 'default_layouts' ];
41
39
 
42
40
  function usePagePatternsHeader( type, categoryId ) {
43
41
  const { patternCategories } = usePatternCategories();
@@ -76,6 +74,7 @@ export default function DataviewsPatterns() {
76
74
  useViewConfig( {
77
75
  kind: 'postType',
78
76
  name: postType,
77
+ fields: VIEW_CONFIG_FIELDS,
79
78
  } );
80
79
  const { view, updateView, isModified, resetToDefault } = useView( {
81
80
  kind: 'postType',
@@ -105,38 +104,27 @@ export default function DataviewsPatterns() {
105
104
  syncStatus: viewSyncStatus,
106
105
  } );
107
106
 
108
- const { records } = useEntityRecords( 'postType', TEMPLATE_PART_POST_TYPE, {
109
- per_page: -1,
107
+ const templatePartFields = usePostFields( {
108
+ postType: TEMPLATE_PART_POST_TYPE,
110
109
  } );
111
-
112
- const authors = useMemo( () => {
113
- if ( ! records ) {
114
- return EMPTY_ARRAY;
115
- }
116
- const authorsSet = new Set();
117
- records.forEach( ( template ) => {
118
- authorsSet.add( template.author_text );
119
- } );
120
- return Array.from( authorsSet ).map( ( author ) => ( {
121
- value: author,
122
- label: author,
123
- } ) );
124
- }, [ records ] );
110
+ const templatePartAuthorField = templatePartFields.find(
111
+ ( field ) => field.id === 'author'
112
+ );
125
113
 
126
114
  const fields = useMemo( () => {
127
115
  const _fields = [ previewField, patternTitleField ];
128
116
 
129
117
  if ( postType === PATTERN_TYPES.user ) {
130
118
  _fields.push( patternStatusField );
131
- } else if ( postType === TEMPLATE_PART_POST_TYPE ) {
132
- _fields.push( {
133
- ...templatePartAuthorField,
134
- elements: authors,
135
- } );
119
+ } else if (
120
+ postType === TEMPLATE_PART_POST_TYPE &&
121
+ templatePartAuthorField
122
+ ) {
123
+ _fields.push( templatePartAuthorField );
136
124
  }
137
125
 
138
126
  return _fields;
139
- }, [ postType, authors ] );
127
+ }, [ postType, templatePartAuthorField ] );
140
128
 
141
129
  const { data, paginationInfo } = useMemo( () => {
142
130
  // Search is managed server-side as well as filters for patterns.
@@ -19,12 +19,14 @@ import AddNewTemplate from '../add-new-template-legacy';
19
19
  import { TEMPLATE_POST_TYPE } from '../../utils/constants';
20
20
  import { unlock } from '../../lock-unlock';
21
21
  import { useEditPostAction } from '../dataviews-actions';
22
- import { authorField, previewField } from './fields';
22
+ import { previewField } from './fields';
23
23
 
24
24
  const { usePostActions, usePostFields } = unlock( editorPrivateApis );
25
25
  const { useHistory, useLocation } = unlock( routerPrivateApis );
26
26
  const { useEntityRecordsWithPermissions } = unlock( corePrivateApis );
27
27
 
28
+ const VIEW_CONFIG_FIELDS = [ 'default_view', 'default_layouts', 'view_list' ];
29
+
28
30
  export default function PageTemplates() {
29
31
  const { path, query } = useLocation();
30
32
  const { activeView = 'all', postId } = query;
@@ -37,6 +39,7 @@ export default function PageTemplates() {
37
39
  } = useViewConfig( {
38
40
  kind: 'postType',
39
41
  name: TEMPLATE_POST_TYPE,
42
+ fields: VIEW_CONFIG_FIELDS,
40
43
  } );
41
44
  const activeViewOverrides = useMemo(
42
45
  () => viewList?.find( ( v ) => v.slug === activeView )?.view ?? {},
@@ -83,40 +86,10 @@ export default function PageTemplates() {
83
86
  [ history, path, view?.type ]
84
87
  );
85
88
 
86
- const authors = useMemo( () => {
87
- if ( ! records ) {
88
- return [];
89
- }
90
- const authorsSet = new Set();
91
- records.forEach( ( template ) => {
92
- authorsSet.add( template.author_text );
93
- } );
94
- return Array.from( authorsSet ).map( ( author ) => ( {
95
- value: author,
96
- label: author,
97
- } ) );
98
- }, [ records ] );
99
-
100
89
  const postFields = usePostFields( { postType: TEMPLATE_POST_TYPE } );
101
90
  const fields = useMemo( () => {
102
- const __fields = [
103
- previewField,
104
- {
105
- ...authorField,
106
- elements: authors,
107
- },
108
- ];
109
- // TODO: Only `description` and `title` are sourced from the shared
110
- // `@wordpress/fields` registry so far. The remaining local fields
111
- // (e.g. `previewField`, `authorField`) should also be evaluated for
112
- // migration to the shared registry.
113
- return [
114
- ...__fields,
115
- ...( postFields || [] ).filter( ( field ) =>
116
- [ 'description', 'title' ].includes( field.id )
117
- ),
118
- ];
119
- }, [ authors, postFields ] );
91
+ return [ previewField, ...( postFields || [] ) ];
92
+ }, [ postFields ] );
120
93
 
121
94
  const { data, paginationInfo } = useMemo( () => {
122
95
  return filterSortAndPaginate( records, view, fields );
@@ -23,6 +23,8 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
23
23
 
24
24
  const { useLocation } = unlock( routerPrivateApis );
25
25
 
26
+ const VIEW_CONFIG_FIELDS = [ 'view_list' ];
27
+
26
28
  const SLUG_TO_ICON = {
27
29
  all: pages,
28
30
  published,
@@ -47,6 +49,7 @@ export default function DataViewsSidebarContent( {
47
49
  const { view_list: viewList } = useViewConfig( {
48
50
  kind: 'postType',
49
51
  name: postType,
52
+ fields: VIEW_CONFIG_FIELDS,
50
53
  } );
51
54
  if ( ! postType ) {
52
55
  return null;
@@ -22,6 +22,17 @@ import { SidebarNavigationContext } from '../sidebar';
22
22
  const { useHistory, useLink, useLocation } = unlock( routerPrivateApis );
23
23
 
24
24
  export default function SidebarNavigationItem( {
25
+ isHidden = false,
26
+ ...props
27
+ } ) {
28
+ if ( isHidden ) {
29
+ return null;
30
+ }
31
+
32
+ return <SidebarNavigationItemContent { ...props } />;
33
+ }
34
+
35
+ function SidebarNavigationItemContent( {
25
36
  className,
26
37
  icon,
27
38
  withChevron = false,
@@ -23,52 +23,46 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
23
23
  export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
24
24
  return (
25
25
  <ItemGroup className="edit-site-sidebar-navigation-screen-main">
26
- { isBlockBasedTheme && (
27
- <>
28
- <SidebarNavigationItem
29
- to="/identity"
30
- uid="identity-navigation-item"
31
- icon={ siteLogo }
32
- activeOnRouteName="identity"
33
- >
34
- { _x( 'Identity', 'site identity' ) }
35
- </SidebarNavigationItem>
36
- <SidebarNavigationItem
37
- to="/styles"
38
- uid="global-styles-navigation-item"
39
- icon={ styles }
40
- activeOnRouteName="styles"
41
- >
42
- { __( 'Styles' ) }
43
- </SidebarNavigationItem>
44
- <SidebarNavigationItem
45
- uid="page-navigation-item"
46
- to="/page"
47
- withChevron
48
- icon={ page }
49
- >
50
- { __( 'Pages' ) }
51
- </SidebarNavigationItem>
52
- <SidebarNavigationItem
53
- uid="navigation-navigation-item"
54
- to="/navigation"
55
- withChevron
56
- icon={ navigation }
57
- >
58
- { __( 'Navigation' ) }
59
- </SidebarNavigationItem>
60
- </>
61
- ) }
62
- { ! isBlockBasedTheme && (
63
- <SidebarNavigationItem
64
- uid="stylebook-navigation-item"
65
- to="/stylebook"
66
- withChevron
67
- icon={ styles }
68
- >
69
- { __( 'Styles' ) }
70
- </SidebarNavigationItem>
71
- ) }
26
+ <SidebarNavigationItem
27
+ to="/identity"
28
+ uid="identity-navigation-item"
29
+ icon={ siteLogo }
30
+ activeOnRouteName="identity"
31
+ isHidden={ ! isBlockBasedTheme }
32
+ >
33
+ { _x( 'Identity', 'site identity' ) }
34
+ </SidebarNavigationItem>
35
+ <SidebarNavigationItem
36
+ to={ isBlockBasedTheme ? '/styles' : '/stylebook' }
37
+ uid={
38
+ isBlockBasedTheme
39
+ ? 'global-styles-navigation-item'
40
+ : 'stylebook-navigation-item'
41
+ }
42
+ icon={ styles }
43
+ activeOnRouteName={ isBlockBasedTheme ? 'styles' : undefined }
44
+ withChevron={ ! isBlockBasedTheme }
45
+ >
46
+ { __( 'Styles' ) }
47
+ </SidebarNavigationItem>
48
+ <SidebarNavigationItem
49
+ uid="page-navigation-item"
50
+ to="/page"
51
+ withChevron
52
+ icon={ page }
53
+ isHidden={ ! isBlockBasedTheme }
54
+ >
55
+ { __( 'Pages' ) }
56
+ </SidebarNavigationItem>
57
+ <SidebarNavigationItem
58
+ uid="navigation-navigation-item"
59
+ to="/navigation"
60
+ withChevron
61
+ icon={ navigation }
62
+ isHidden={ ! isBlockBasedTheme }
63
+ >
64
+ { __( 'Navigation' ) }
65
+ </SidebarNavigationItem>
72
66
  <SidebarNavigationItem
73
67
  uid="patterns-navigation-item"
74
68
  to="/pattern"
@@ -77,16 +71,15 @@ export function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {
77
71
  >
78
72
  { __( 'Patterns' ) }
79
73
  </SidebarNavigationItem>
80
- { isBlockBasedTheme && (
81
- <SidebarNavigationItem
82
- uid="template-navigation-item"
83
- to="/template"
84
- withChevron
85
- icon={ layout }
86
- >
87
- { __( 'Templates' ) }
88
- </SidebarNavigationItem>
89
- ) }
74
+ <SidebarNavigationItem
75
+ uid="template-navigation-item"
76
+ to="/template"
77
+ withChevron
78
+ icon={ layout }
79
+ isHidden={ ! isBlockBasedTheme }
80
+ >
81
+ { __( 'Templates' ) }
82
+ </SidebarNavigationItem>
90
83
  </ItemGroup>
91
84
  );
92
85
  }
@@ -31,7 +31,6 @@ export default function RenameModal( { menuTitle, onClose, onSave } ) {
31
31
  <form className="sidebar-navigation__rename-modal-form">
32
32
  <VStack spacing="3">
33
33
  <TextControl
34
- __next40pxDefaultSize
35
34
  value={ editedMenuTitle }
36
35
  placeholder={ __( 'Navigation title' ) }
37
36
  onChange={ setEditedMenuTitle }
@@ -27,6 +27,8 @@ import usePatternCategories from './use-pattern-categories';
27
27
  import useTemplatePartAreas from './use-template-part-areas';
28
28
  import { unlock } from '../../lock-unlock';
29
29
 
30
+ const VIEW_CONFIG_FIELDS = [ 'view_list' ];
31
+
30
32
  const { useLocation } = unlock( routerPrivateApis );
31
33
 
32
34
  function CategoriesGroup( {
@@ -89,10 +91,12 @@ export default function SidebarNavigationScreenPatterns( { backPath } ) {
89
91
  const { view_list: templatePartViews } = useViewConfig( {
90
92
  kind: 'postType',
91
93
  name: TEMPLATE_PART_POST_TYPE,
94
+ fields: VIEW_CONFIG_FIELDS,
92
95
  } );
93
96
  const { view_list: patternViews } = useViewConfig( {
94
97
  kind: 'postType',
95
98
  name: PATTERN_TYPES.user,
99
+ fields: VIEW_CONFIG_FIELDS,
96
100
  } );
97
101
 
98
102
  const { templatePartAreas, isLoading, hasTemplateParts } =