@wordpress/editor 14.48.2-next.v.202606191442.0 → 14.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.
- package/CHANGELOG.md +2 -0
- package/README.md +5 -13
- package/build/components/autosave-monitor/index.cjs +40 -83
- package/build/components/autosave-monitor/index.cjs.map +3 -3
- package/build/components/post-publish-panel/postpublish.cjs +0 -1
- package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
- package/build/components/post-status/index.cjs +0 -1
- package/build/components/post-status/index.cjs.map +2 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.cjs +0 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
- package/build/components/post-template/create-new-template-modal.cjs +0 -1
- package/build/components/post-template/create-new-template-modal.cjs.map +2 -2
- package/build/components/post-text-editor/utils.cjs +2 -2
- package/build/components/post-text-editor/utils.cjs.map +1 -1
- package/build/components/post-visibility/index.cjs +0 -1
- package/build/components/post-visibility/index.cjs.map +2 -2
- package/build/components/provider/disable-non-page-content-blocks.cjs +23 -3
- package/build/components/provider/disable-non-page-content-blocks.cjs.map +2 -2
- package/build/components/provider/navigation-block-editing-mode.cjs +9 -2
- package/build/components/provider/navigation-block-editing-mode.cjs.map +2 -2
- package/build/components/provider/use-block-editor-settings.cjs +2 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
- package/build/components/sidebar/dataform-post-summary.cjs +87 -32
- package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
- package/build/components/sidebar/post-summary.cjs +8 -6
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/dataviews/store/private-actions.cjs +3 -1
- package/build/dataviews/store/private-actions.cjs.map +2 -2
- package/build/store/private-actions.cjs +2 -2
- package/build/store/private-actions.cjs.map +2 -2
- package/build-module/components/autosave-monitor/index.mjs +42 -81
- package/build-module/components/autosave-monitor/index.mjs.map +2 -2
- package/build-module/components/post-publish-panel/postpublish.mjs +0 -1
- package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
- package/build-module/components/post-status/index.mjs +0 -1
- package/build-module/components/post-status/index.mjs.map +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +0 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
- package/build-module/components/post-template/create-new-template-modal.mjs +0 -1
- package/build-module/components/post-template/create-new-template-modal.mjs.map +2 -2
- package/build-module/components/post-text-editor/utils.mjs +2 -2
- package/build-module/components/post-text-editor/utils.mjs.map +1 -1
- package/build-module/components/post-visibility/index.mjs +0 -1
- package/build-module/components/post-visibility/index.mjs.map +2 -2
- package/build-module/components/provider/disable-non-page-content-blocks.mjs +23 -3
- package/build-module/components/provider/disable-non-page-content-blocks.mjs.map +2 -2
- package/build-module/components/provider/navigation-block-editing-mode.mjs +10 -3
- package/build-module/components/provider/navigation-block-editing-mode.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +2 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/sidebar/dataform-post-summary.mjs +88 -33
- package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +8 -6
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs +5 -1
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +2 -2
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-style/style-rtl.css +29 -33
- package/build-style/style.css +29 -33
- package/build-types/components/autosave-monitor/index.d.ts +11 -29
- package/build-types/components/autosave-monitor/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
- package/build-types/components/post-visibility/index.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
- package/package.json +46 -46
- package/src/components/autosave-monitor/index.js +69 -104
- package/src/components/autosave-monitor/test/index.js +137 -122
- package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -0
- package/src/components/post-publish-panel/postpublish.js +0 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +7 -2
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -0
- package/src/components/post-status/index.js +0 -1
- package/src/components/post-taxonomies/hierarchical-term-selector.js +0 -1
- package/src/components/post-template/create-new-template-modal.js +0 -1
- package/src/components/post-text-editor/utils.js +2 -2
- package/src/components/post-visibility/index.js +0 -1
- package/src/components/provider/disable-non-page-content-blocks.js +23 -6
- package/src/components/provider/navigation-block-editing-mode.js +10 -4
- package/src/components/provider/use-block-editor-settings.js +3 -1
- package/src/components/sidebar/dataform-post-summary.js +133 -49
- package/src/components/sidebar/post-summary.js +12 -10
- package/src/dataviews/store/private-actions.ts +8 -1
- package/src/store/private-actions.js +2 -2
- package/src/store/test/actions.js +2 -2
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
|
+
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
6
6
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
7
7
|
import { DataForm } from '@wordpress/dataviews';
|
|
8
|
-
import {
|
|
8
|
+
import { Stack } from '@wordpress/ui';
|
|
9
9
|
import { useMemo } from '@wordpress/element';
|
|
10
10
|
import { useViewConfig } from '@wordpress/views';
|
|
11
11
|
|
|
@@ -21,6 +21,91 @@ import { usePostTemplatePanelMode } from '../post-template/hooks';
|
|
|
21
21
|
import revisionsField from '../../dataviews/fields/revisions';
|
|
22
22
|
|
|
23
23
|
const EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };
|
|
24
|
+
const VIEW_CONFIG_FIELDS = [ 'form' ];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Bridges the legacy editor-panel visibility controls onto the DataForm summary,
|
|
28
|
+
* returning the form with the hidden fields removed. The new inspector has no
|
|
29
|
+
* concept of the Preferences → Panels switches or of `removeEditorPanel`, so we
|
|
30
|
+
* reproduce their effect on the form.
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} form The DataForm summary form configuration.
|
|
33
|
+
* @return {Object} The form with the hidden fields removed.
|
|
34
|
+
*/
|
|
35
|
+
function useInspectorPanelVisibility( form ) {
|
|
36
|
+
const {
|
|
37
|
+
isPostStatusRemoved,
|
|
38
|
+
featuredImageEnabled,
|
|
39
|
+
excerptEnabled,
|
|
40
|
+
discussionEnabled,
|
|
41
|
+
pageAttributesEnabled,
|
|
42
|
+
} = useSelect( ( select ) => {
|
|
43
|
+
const { isEditorPanelRemoved, isEditorPanelEnabled } =
|
|
44
|
+
select( editorStore );
|
|
45
|
+
return {
|
|
46
|
+
isPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),
|
|
47
|
+
featuredImageEnabled: isEditorPanelEnabled( 'featured-image' ),
|
|
48
|
+
excerptEnabled: isEditorPanelEnabled( 'post-excerpt' ),
|
|
49
|
+
discussionEnabled: isEditorPanelEnabled( 'discussion-panel' ),
|
|
50
|
+
pageAttributesEnabled: isEditorPanelEnabled( 'page-attributes' ),
|
|
51
|
+
};
|
|
52
|
+
}, [] );
|
|
53
|
+
|
|
54
|
+
const visibleForm = useMemo( () => {
|
|
55
|
+
if ( ! form.fields?.length ) {
|
|
56
|
+
return form;
|
|
57
|
+
}
|
|
58
|
+
// `featured_media`/`excerpt` are their own top-level panels and
|
|
59
|
+
// `post-content-info` is always shown, so they survive. Everything else
|
|
60
|
+
// belongs to the `post-status` summary panel: `discussion`/`parent` honor
|
|
61
|
+
// their own switch, but every one of them is hidden while the `post-status`
|
|
62
|
+
// panel is removed.
|
|
63
|
+
const visibilityById = {
|
|
64
|
+
featured_media: featuredImageEnabled,
|
|
65
|
+
excerpt: excerptEnabled,
|
|
66
|
+
'post-content-info': true,
|
|
67
|
+
discussion: discussionEnabled && ! isPostStatusRemoved,
|
|
68
|
+
parent: pageAttributesEnabled && ! isPostStatusRemoved,
|
|
69
|
+
};
|
|
70
|
+
const isFieldVisible = ( id ) =>
|
|
71
|
+
id in visibilityById ? visibilityById[ id ] : ! isPostStatusRemoved;
|
|
72
|
+
// Recurse into `children` so a panel-tied field is dropped wherever it
|
|
73
|
+
// sits in the form: the PHP view-config filter can nest such a field
|
|
74
|
+
// inside another field's group.
|
|
75
|
+
const filterFields = ( fields ) =>
|
|
76
|
+
fields.reduce( ( acc, field ) => {
|
|
77
|
+
const id = typeof field === 'string' ? field : field.id;
|
|
78
|
+
if ( ! isFieldVisible( id ) ) {
|
|
79
|
+
return acc;
|
|
80
|
+
}
|
|
81
|
+
if (
|
|
82
|
+
typeof field !== 'string' &&
|
|
83
|
+
Array.isArray( field.children )
|
|
84
|
+
) {
|
|
85
|
+
const children = filterFields( field.children );
|
|
86
|
+
// A group whose children were all removed would render as
|
|
87
|
+
// an empty panel, so drop it too.
|
|
88
|
+
if ( ! children.length ) {
|
|
89
|
+
return acc;
|
|
90
|
+
}
|
|
91
|
+
acc.push( { ...field, children } );
|
|
92
|
+
return acc;
|
|
93
|
+
}
|
|
94
|
+
acc.push( field );
|
|
95
|
+
return acc;
|
|
96
|
+
}, [] );
|
|
97
|
+
return { ...form, fields: filterFields( form.fields ) };
|
|
98
|
+
}, [
|
|
99
|
+
form,
|
|
100
|
+
isPostStatusRemoved,
|
|
101
|
+
featuredImageEnabled,
|
|
102
|
+
excerptEnabled,
|
|
103
|
+
discussionEnabled,
|
|
104
|
+
pageAttributesEnabled,
|
|
105
|
+
] );
|
|
106
|
+
|
|
107
|
+
return visibleForm;
|
|
108
|
+
}
|
|
24
109
|
|
|
25
110
|
// Some post types expose summary fields that edit entities other than the one
|
|
26
111
|
// being edited. Keyed by the post type that needs them, the related records are
|
|
@@ -89,18 +174,34 @@ function bindFieldToNamespace( field, namespace, isVisible = () => true ) {
|
|
|
89
174
|
}
|
|
90
175
|
|
|
91
176
|
export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
92
|
-
const { postType, postId } =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
177
|
+
const { postType, postId, isPostStatusRemoved, availableTemplates } =
|
|
178
|
+
useSelect( ( select ) => {
|
|
179
|
+
const {
|
|
180
|
+
getCurrentPostType,
|
|
181
|
+
getCurrentPostId,
|
|
182
|
+
isEditorPanelRemoved,
|
|
183
|
+
getEditorSettings,
|
|
184
|
+
} = select( editorStore );
|
|
185
|
+
const _availableTemplates = select(
|
|
186
|
+
coreDataStore
|
|
187
|
+
).getCurrentTheme()?.is_block_theme
|
|
188
|
+
? null
|
|
189
|
+
: getEditorSettings().availableTemplates ?? null;
|
|
190
|
+
return {
|
|
191
|
+
postType: getCurrentPostType(),
|
|
192
|
+
postId: getCurrentPostId(),
|
|
193
|
+
isPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),
|
|
194
|
+
availableTemplates: _availableTemplates,
|
|
195
|
+
};
|
|
196
|
+
}, [] );
|
|
99
197
|
const { form: formConfig } = useViewConfig( {
|
|
100
198
|
kind: 'postType',
|
|
101
199
|
name: postType,
|
|
200
|
+
fields: VIEW_CONFIG_FIELDS,
|
|
102
201
|
} );
|
|
103
|
-
|
|
202
|
+
// Bridge the legacy editor-panel visibility (Preferences → Panels and
|
|
203
|
+
// programmatic panel removal) onto the form by dropping hidden fields.
|
|
204
|
+
const form = useInspectorPanelVisibility( formConfig ?? EMPTY_FORM );
|
|
104
205
|
const record = useSelect(
|
|
105
206
|
( select ) => {
|
|
106
207
|
if ( ! postType || ! postId ) {
|
|
@@ -117,27 +218,14 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
117
218
|
|
|
118
219
|
const templatePanelMode = usePostTemplatePanelMode();
|
|
119
220
|
|
|
120
|
-
|
|
121
|
-
// alongside the post record: read-only editor data that the post's own
|
|
122
|
-
// fields consume (e.g. the `template` field's `available_templates` in
|
|
123
|
-
// classic themes), and the records of other entities targeted by namespaced
|
|
124
|
-
// fields (keyed by `${ kind }_${ name }`) together with the id used to
|
|
125
|
-
// persist edits back to each one.
|
|
126
|
-
const { entityData, entityIds, availableTemplates } = useSelect(
|
|
221
|
+
const entityRecords = useSelect(
|
|
127
222
|
( select ) => {
|
|
128
|
-
const { getEditedEntityRecord, canUser
|
|
129
|
-
select( coreDataStore );
|
|
130
|
-
|
|
131
|
-
const _availableTemplates = getCurrentTheme()?.is_block_theme
|
|
132
|
-
? null
|
|
133
|
-
: select( editorStore ).getEditorSettings()
|
|
134
|
-
.availableTemplates ?? {};
|
|
223
|
+
const { getEditedEntityRecord, canUser } = select( coreDataStore );
|
|
135
224
|
|
|
136
|
-
const
|
|
137
|
-
const ids = {};
|
|
225
|
+
const records = {};
|
|
138
226
|
|
|
139
227
|
// Other entities the current post type needs merged into its form.
|
|
140
|
-
for ( const [
|
|
228
|
+
for ( const [ namespace, entity ] of Object.entries(
|
|
141
229
|
ENTITIES[ postType ] ?? {}
|
|
142
230
|
) ) {
|
|
143
231
|
if (
|
|
@@ -153,39 +241,32 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
153
241
|
if ( entity.getId && ! id ) {
|
|
154
242
|
continue;
|
|
155
243
|
}
|
|
156
|
-
|
|
244
|
+
records[ namespace ] = getEditedEntityRecord(
|
|
157
245
|
entity.kind,
|
|
158
246
|
entity.name,
|
|
159
247
|
id
|
|
160
248
|
);
|
|
161
|
-
ids[ key ] = id;
|
|
162
249
|
}
|
|
163
250
|
|
|
164
|
-
return
|
|
165
|
-
entityData: extra,
|
|
166
|
-
entityIds: ids,
|
|
167
|
-
availableTemplates: _availableTemplates,
|
|
168
|
-
};
|
|
251
|
+
return records;
|
|
169
252
|
},
|
|
170
253
|
[ postType ]
|
|
171
254
|
);
|
|
172
255
|
|
|
173
|
-
// Merge the supplementary data onto the record
|
|
256
|
+
// Merge the supplementary data onto the record.
|
|
174
257
|
const data = useMemo( () => {
|
|
175
258
|
if ( ! record ) {
|
|
176
259
|
return record;
|
|
177
260
|
}
|
|
178
|
-
const extra = { ...
|
|
261
|
+
const extra = { ...entityRecords };
|
|
179
262
|
if ( availableTemplates && Object.keys( availableTemplates ).length ) {
|
|
180
263
|
extra.available_templates = availableTemplates;
|
|
181
264
|
}
|
|
182
|
-
if ( ! Object.keys( extra ).length ) {
|
|
183
|
-
return record;
|
|
184
|
-
}
|
|
185
265
|
return { ...record, ...extra };
|
|
186
|
-
}, [ record,
|
|
266
|
+
}, [ record, entityRecords, availableTemplates ] );
|
|
187
267
|
|
|
188
268
|
const { editEntityRecord } = useDispatch( coreDataStore );
|
|
269
|
+
const registry = useRegistry();
|
|
189
270
|
|
|
190
271
|
// Map of namespaced field id to the namespace key its entity is merged under.
|
|
191
272
|
const fieldNamespaces = useMemo( () => {
|
|
@@ -264,12 +345,13 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
264
345
|
for ( const [ key, value ] of Object.entries( edits ) ) {
|
|
265
346
|
const entity = entities[ key ];
|
|
266
347
|
if ( entity ) {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
348
|
+
// Resolve the id the same way it was resolved to read the
|
|
349
|
+
// record, so the save targets the right entity regardless of
|
|
350
|
+
// its key field (`undefined` for the `root/site` singleton).
|
|
351
|
+
const id = entity.getId
|
|
352
|
+
? entity.getId( registry.select )
|
|
353
|
+
: undefined;
|
|
354
|
+
editEntityRecord( entity.kind, entity.name, id, value );
|
|
273
355
|
} else {
|
|
274
356
|
baseEdits[ key ] = value;
|
|
275
357
|
}
|
|
@@ -299,7 +381,7 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
299
381
|
};
|
|
300
382
|
return (
|
|
301
383
|
<PostPanelSection className="editor-post-summary">
|
|
302
|
-
<
|
|
384
|
+
<Stack direction="column" gap="lg">
|
|
303
385
|
<PostCardPanel
|
|
304
386
|
postType={ postType }
|
|
305
387
|
postId={ postId }
|
|
@@ -311,8 +393,10 @@ export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
|
311
393
|
form={ form }
|
|
312
394
|
onChange={ onChange }
|
|
313
395
|
/>
|
|
314
|
-
|
|
315
|
-
|
|
396
|
+
{ ! isPostStatusRemoved && (
|
|
397
|
+
<PostTrash onActionPerformed={ onActionPerformed } />
|
|
398
|
+
) }
|
|
399
|
+
</Stack>
|
|
316
400
|
</PostPanelSection>
|
|
317
401
|
);
|
|
318
402
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { Stack } from '@wordpress/ui';
|
|
5
5
|
import { useSelect } from '@wordpress/data';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -43,7 +43,9 @@ export default function PostSummary( { onActionPerformed } ) {
|
|
|
43
43
|
);
|
|
44
44
|
if (
|
|
45
45
|
window?.__experimentalDataFormInspector &&
|
|
46
|
-
[ 'page', 'post', 'wp_template' ].includes(
|
|
46
|
+
[ 'page', 'post', 'wp_template', 'wp_template_part' ].includes(
|
|
47
|
+
postType
|
|
48
|
+
)
|
|
47
49
|
) {
|
|
48
50
|
return <DataFormPostSummary onActionPerformed={ onActionPerformed } />;
|
|
49
51
|
}
|
|
@@ -73,7 +75,7 @@ function ClassicPostSummary( { onActionPerformed } ) {
|
|
|
73
75
|
<PluginPostStatusInfo.Slot>
|
|
74
76
|
{ ( fills ) => (
|
|
75
77
|
<>
|
|
76
|
-
<
|
|
78
|
+
<Stack direction="column" gap="lg">
|
|
77
79
|
<PostCardPanel
|
|
78
80
|
postType={ postType }
|
|
79
81
|
postId={ postId }
|
|
@@ -81,13 +83,13 @@ function ClassicPostSummary( { onActionPerformed } ) {
|
|
|
81
83
|
/>
|
|
82
84
|
<PostFeaturedImagePanel withPanelBody={ false } />
|
|
83
85
|
<PostExcerptPanel />
|
|
84
|
-
<
|
|
86
|
+
<Stack direction="column" gap="xs">
|
|
85
87
|
<PostContentInformation />
|
|
86
88
|
<PostLastEditedPanel />
|
|
87
|
-
</
|
|
89
|
+
</Stack>
|
|
88
90
|
{ ! isRemovedPostStatusPanel && (
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
+
<Stack direction="column" gap="lg">
|
|
92
|
+
<Stack direction="column" gap="xs">
|
|
91
93
|
<PostStatusPanel />
|
|
92
94
|
<PostSchedulePanel />
|
|
93
95
|
<PostURLPanel />
|
|
@@ -102,13 +104,13 @@ function ClassicPostSummary( { onActionPerformed } ) {
|
|
|
102
104
|
<SiteDiscussion />
|
|
103
105
|
<PostFormatPanel />
|
|
104
106
|
{ fills }
|
|
105
|
-
</
|
|
107
|
+
</Stack>
|
|
106
108
|
<PostTrash
|
|
107
109
|
onActionPerformed={ onActionPerformed }
|
|
108
110
|
/>
|
|
109
|
-
</
|
|
111
|
+
</Stack>
|
|
110
112
|
) }
|
|
111
|
-
</
|
|
113
|
+
</Stack>
|
|
112
114
|
</>
|
|
113
115
|
) }
|
|
114
116
|
</PluginPostStatusInfo.Slot>
|
|
@@ -30,6 +30,8 @@ import {
|
|
|
30
30
|
slugField,
|
|
31
31
|
statusField,
|
|
32
32
|
authorField,
|
|
33
|
+
templateAuthorField,
|
|
34
|
+
templatePartAuthorField,
|
|
33
35
|
titleField,
|
|
34
36
|
templateField,
|
|
35
37
|
templateTitleField,
|
|
@@ -267,7 +269,12 @@ export const registerPostTypeSchema =
|
|
|
267
269
|
postTypeConfig.supports?.thumbnail &&
|
|
268
270
|
currentTheme?.theme_supports?.[ 'post-thumbnails' ] &&
|
|
269
271
|
featuredImageField,
|
|
270
|
-
postTypeConfig.
|
|
272
|
+
! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
|
|
273
|
+
postTypeConfig.supports?.author &&
|
|
274
|
+
authorField,
|
|
275
|
+
postTypeConfig.slug === 'wp_template' && templateAuthorField,
|
|
276
|
+
postTypeConfig.slug === 'wp_template_part' &&
|
|
277
|
+
templatePartAuthorField,
|
|
271
278
|
! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
|
|
272
279
|
statusField,
|
|
273
280
|
! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
|
|
@@ -71,7 +71,7 @@ describe( 'Post actions', () => {
|
|
|
71
71
|
unlock(
|
|
72
72
|
registry.dispatch( editorStore )
|
|
73
73
|
).updateDeviceTypeForViewportState( {
|
|
74
|
-
viewport: 'mobile',
|
|
74
|
+
viewport: '@mobile',
|
|
75
75
|
showStateOnCanvas: true,
|
|
76
76
|
} );
|
|
77
77
|
|
|
@@ -87,7 +87,7 @@ describe( 'Post actions', () => {
|
|
|
87
87
|
unlock(
|
|
88
88
|
registry.dispatch( editorStore )
|
|
89
89
|
).updateDeviceTypeForViewportState( {
|
|
90
|
-
viewport: 'mobile',
|
|
90
|
+
viewport: '@mobile',
|
|
91
91
|
showStateOnCanvas: false,
|
|
92
92
|
} );
|
|
93
93
|
|