@wordpress/editor 14.41.0 → 14.41.1-next.v.202603102151.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/collab-sidebar/index.cjs +7 -4
- package/build/components/collab-sidebar/index.cjs.map +2 -2
- package/build/components/collab-sidebar/utils.cjs +13 -15
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/avatar-iframe-styles.cjs +133 -0
- package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +7 -0
- package/build/components/collaborators-overlay/collaborator-styles.cjs +38 -2
- package/build/components/collaborators-overlay/collaborator-styles.cjs.map +2 -2
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +142 -0
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +7 -0
- package/build/components/collaborators-overlay/overlay.cjs +59 -201
- package/build/components/collaborators-overlay/overlay.cjs.map +3 -3
- package/build/components/collaborators-overlay/use-block-highlighting.cjs +91 -42
- package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +2 -2
- package/build/components/collaborators-overlay/use-debounced-recompute.cjs +49 -0
- package/build/components/collaborators-overlay/use-debounced-recompute.cjs.map +7 -0
- package/build/components/collaborators-overlay/use-render-cursors.cjs +49 -50
- package/build/components/collaborators-overlay/use-render-cursors.cjs.map +2 -2
- package/build/components/collaborators-presence/avatar/component.cjs +121 -0
- package/build/components/collaborators-presence/avatar/component.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar/index.cjs +37 -0
- package/build/components/collaborators-presence/avatar/index.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar/types.cjs +19 -0
- package/build/components/collaborators-presence/avatar/types.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs +44 -0
- package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar-group/component.cjs +78 -0
- package/build/components/collaborators-presence/avatar-group/component.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar-group/index.cjs +37 -0
- package/build/components/collaborators-presence/avatar-group/index.cjs.map +7 -0
- package/build/components/collaborators-presence/avatar-group/types.cjs +19 -0
- package/build/components/collaborators-presence/avatar-group/types.cjs.map +7 -0
- package/build/components/collaborators-presence/index.cjs +17 -6
- package/build/components/collaborators-presence/index.cjs.map +3 -3
- package/build/components/collaborators-presence/list.cjs +20 -17
- package/build/components/collaborators-presence/list.cjs.map +3 -3
- package/build/components/entities-saved-states/hooks/use-is-dirty.cjs +14 -5
- package/build/components/entities-saved-states/hooks/use-is-dirty.cjs.map +2 -2
- package/build/components/global-styles/index.cjs +15 -24
- package/build/components/global-styles/index.cjs.map +3 -3
- package/build/components/global-styles-sidebar/index.cjs +6 -3
- package/build/components/global-styles-sidebar/index.cjs.map +2 -2
- package/build/components/page-attributes/parent.cjs +1 -0
- package/build/components/page-attributes/parent.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-canvas.cjs +17 -4
- package/build/components/post-revisions-preview/revisions-canvas.cjs.map +2 -2
- package/build/components/post-url/panel.cjs +1 -0
- package/build/components/post-url/panel.cjs.map +2 -2
- package/build/components/provider/use-block-editor-settings.cjs +4 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
- package/build/components/sidebar/dataform-post-summary.cjs +167 -0
- package/build/components/sidebar/dataform-post-summary.cjs.map +7 -0
- package/build/components/sidebar/post-summary.cjs +11 -0
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/visual-editor/index.cjs +1 -1
- package/build/components/visual-editor/index.cjs.map +2 -2
- package/build/dataviews/store/private-actions.cjs +4 -0
- package/build/dataviews/store/private-actions.cjs.map +2 -2
- package/build/utils/media-upload/on-success.cjs +46 -0
- package/build/utils/media-upload/on-success.cjs.map +7 -0
- package/build-module/components/collab-sidebar/index.mjs +7 -4
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/utils.mjs +13 -15
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs +120 -0
- package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/collaborator-styles.mjs +25 -1
- package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +124 -0
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/overlay.mjs +49 -201
- package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +92 -43
- package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs +24 -0
- package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs +50 -51
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
- package/build-module/components/collaborators-presence/avatar/component.mjs +90 -0
- package/build-module/components/collaborators-presence/avatar/component.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar/index.mjs +6 -0
- package/build-module/components/collaborators-presence/avatar/index.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar/types.mjs +1 -0
- package/build-module/components/collaborators-presence/avatar/types.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs +19 -0
- package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar-group/component.mjs +47 -0
- package/build-module/components/collaborators-presence/avatar-group/component.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar-group/index.mjs +6 -0
- package/build-module/components/collaborators-presence/avatar-group/index.mjs.map +7 -0
- package/build-module/components/collaborators-presence/avatar-group/types.mjs +1 -0
- package/build-module/components/collaborators-presence/avatar-group/types.mjs.map +7 -0
- package/build-module/components/collaborators-presence/index.mjs +7 -9
- package/build-module/components/collaborators-presence/index.mjs.map +2 -2
- package/build-module/components/collaborators-presence/list.mjs +11 -22
- package/build-module/components/collaborators-presence/list.mjs.map +2 -2
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs +14 -5
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs.map +2 -2
- package/build-module/components/global-styles/index.mjs +15 -24
- package/build-module/components/global-styles/index.mjs.map +2 -2
- package/build-module/components/global-styles-sidebar/index.mjs +6 -3
- package/build-module/components/global-styles-sidebar/index.mjs.map +2 -2
- package/build-module/components/page-attributes/parent.mjs +1 -0
- package/build-module/components/page-attributes/parent.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs +17 -4
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
- package/build-module/components/post-url/panel.mjs +1 -0
- package/build-module/components/post-url/panel.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +4 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/sidebar/dataform-post-summary.mjs +136 -0
- package/build-module/components/sidebar/dataform-post-summary.mjs.map +7 -0
- package/build-module/components/sidebar/post-summary.mjs +11 -0
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/visual-editor/index.mjs +1 -1
- package/build-module/components/visual-editor/index.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs +8 -1
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/utils/media-upload/on-success.mjs +25 -0
- package/build-module/utils/media-upload/on-success.mjs.map +7 -0
- package/build-style/style-rtl.css +876 -137
- package/build-style/style.css +876 -137
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts +11 -0
- package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/collaborator-styles.d.ts +17 -2
- package/build-types/components/collaborators-overlay/collaborator-styles.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +6 -0
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +21 -5
- package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts +10 -0
- package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts +2 -1
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/avatar/component.d.ts +7 -0
- package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar/index.d.ts +3 -0
- package/build-types/components/collaborators-presence/avatar/index.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar/types.d.ts +66 -0
- package/build-types/components/collaborators-presence/avatar/types.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts +17 -0
- package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar-group/component.d.ts +7 -0
- package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar-group/index.d.ts +3 -0
- package/build-types/components/collaborators-presence/avatar-group/index.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/avatar-group/types.d.ts +14 -0
- package/build-types/components/collaborators-presence/avatar-group/types.d.ts.map +1 -0
- package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
- package/build-types/components/global-styles/index.d.ts +2 -1
- package/build-types/components/global-styles/index.d.ts.map +1 -1
- package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-author/hook.d.ts +1 -1
- package/build-types/components/post-revisions-preview/revisions-canvas.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 +4 -0
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -0
- 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/media-upload/on-success.d.ts +9 -0
- package/build-types/utils/media-upload/on-success.d.ts.map +1 -0
- package/package.json +45 -44
- package/src/components/collab-sidebar/index.js +7 -4
- package/src/components/collab-sidebar/utils.js +9 -10
- package/src/components/collaborators-overlay/avatar-iframe-styles.ts +126 -0
- package/src/components/collaborators-overlay/collaborator-styles.ts +43 -2
- package/src/components/collaborators-overlay/overlay-iframe-styles.ts +125 -0
- package/src/components/collaborators-overlay/overlay.tsx +54 -207
- package/src/components/collaborators-overlay/use-block-highlighting.ts +147 -64
- package/src/components/collaborators-overlay/use-debounced-recompute.ts +32 -0
- package/src/components/collaborators-overlay/use-render-cursors.ts +72 -66
- package/src/components/collaborators-presence/avatar/component.tsx +123 -0
- package/src/components/collaborators-presence/avatar/index.ts +2 -0
- package/src/components/collaborators-presence/avatar/styles.scss +168 -0
- package/src/components/collaborators-presence/avatar/test/index.tsx +389 -0
- package/src/components/collaborators-presence/avatar/types.ts +66 -0
- package/src/components/collaborators-presence/avatar/use-image-loading-status.ts +36 -0
- package/src/components/collaborators-presence/avatar-group/component.tsx +55 -0
- package/src/components/collaborators-presence/avatar-group/index.ts +2 -0
- package/src/components/collaborators-presence/avatar-group/styles.scss +33 -0
- package/src/components/collaborators-presence/avatar-group/test/index.tsx +139 -0
- package/src/components/collaborators-presence/avatar-group/types.ts +13 -0
- package/src/components/collaborators-presence/index.tsx +4 -6
- package/src/components/collaborators-presence/list.tsx +7 -17
- package/src/components/collaborators-presence/styles/collaborators-list.scss +26 -19
- package/src/components/collaborators-presence/styles/collaborators-presence.scss +6 -2
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +14 -5
- package/src/components/global-styles/index.js +20 -27
- package/src/components/global-styles-sidebar/index.js +3 -0
- package/src/components/page-attributes/parent.js +1 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-revisions-preview/revisions-canvas.js +15 -6
- package/src/components/post-url/panel.js +1 -0
- package/src/components/post-url/style.scss +5 -0
- package/src/components/provider/use-block-editor-settings.js +5 -0
- package/src/components/sidebar/dataform-post-summary.js +149 -0
- package/src/components/sidebar/post-summary.js +15 -0
- package/src/components/visual-editor/index.js +1 -1
- package/src/dataviews/store/private-actions.ts +14 -0
- package/src/style.scss +3 -0
- package/src/utils/media-upload/on-success.js +34 -0
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
*/
|
|
24
24
|
import inserterMediaCategories from '../media-categories';
|
|
25
25
|
import { mediaUpload } from '../../utils';
|
|
26
|
+
import mediaUploadOnSuccess from '../../utils/media-upload/on-success';
|
|
26
27
|
import { default as mediaSideload } from '../../utils/media-sideload';
|
|
27
28
|
import { store as editorStore } from '../../store';
|
|
28
29
|
import { unlock } from '../../lock-unlock';
|
|
@@ -103,6 +104,7 @@ const {
|
|
|
103
104
|
isIsolatedEditorKey,
|
|
104
105
|
deviceTypeKey,
|
|
105
106
|
isNavigationOverlayContextKey,
|
|
107
|
+
mediaUploadOnSuccessKey,
|
|
106
108
|
} = unlock( privateApis );
|
|
107
109
|
|
|
108
110
|
/**
|
|
@@ -336,6 +338,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
|
|
|
336
338
|
? editMediaEntity
|
|
337
339
|
: undefined,
|
|
338
340
|
mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
|
|
341
|
+
[ mediaUploadOnSuccessKey ]: hasUploadPermissions
|
|
342
|
+
? mediaUploadOnSuccess
|
|
343
|
+
: undefined,
|
|
339
344
|
mediaSideload: hasUploadPermissions ? mediaSideload : undefined,
|
|
340
345
|
__experimentalBlockPatterns: blockPatterns,
|
|
341
346
|
[ selectBlockPatternsKey ]: ( select ) => {
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
+
import { store as coreDataStore } from '@wordpress/core-data';
|
|
7
|
+
import { DataForm } from '@wordpress/dataviews';
|
|
8
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
9
|
+
import { useMemo } from '@wordpress/element';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
14
|
+
import PostCardPanel from '../post-card-panel';
|
|
15
|
+
import PostPanelSection from '../post-panel-section';
|
|
16
|
+
import { store as editorStore } from '../../store';
|
|
17
|
+
import PostTrash from '../post-trash';
|
|
18
|
+
import usePostFields from '../post-fields';
|
|
19
|
+
import { unlock } from '../../lock-unlock';
|
|
20
|
+
|
|
21
|
+
const form = {
|
|
22
|
+
layout: {
|
|
23
|
+
type: 'panel',
|
|
24
|
+
},
|
|
25
|
+
fields: [
|
|
26
|
+
{
|
|
27
|
+
id: 'featured_media',
|
|
28
|
+
layout: {
|
|
29
|
+
type: 'regular',
|
|
30
|
+
labelPosition: 'none',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'post-content-info',
|
|
35
|
+
layout: {
|
|
36
|
+
type: 'regular',
|
|
37
|
+
labelPosition: 'none',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'status',
|
|
42
|
+
label: __( 'Status' ),
|
|
43
|
+
children: [
|
|
44
|
+
{
|
|
45
|
+
id: 'status',
|
|
46
|
+
layout: { type: 'regular', labelPosition: 'none' },
|
|
47
|
+
},
|
|
48
|
+
'password',
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
'author',
|
|
52
|
+
'date',
|
|
53
|
+
'slug',
|
|
54
|
+
'parent',
|
|
55
|
+
{
|
|
56
|
+
id: 'discussion',
|
|
57
|
+
label: __( 'Discussion' ),
|
|
58
|
+
children: [
|
|
59
|
+
{
|
|
60
|
+
id: 'comment_status',
|
|
61
|
+
layout: { type: 'regular', labelPosition: 'none' },
|
|
62
|
+
},
|
|
63
|
+
'ping_status',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
'template',
|
|
67
|
+
'format',
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default function DataFormPostSummary( { onActionPerformed } ) {
|
|
72
|
+
const { postType, postId } = useSelect( ( select ) => {
|
|
73
|
+
const { getCurrentPostType, getCurrentPostId } = unlock(
|
|
74
|
+
select( editorStore )
|
|
75
|
+
);
|
|
76
|
+
return {
|
|
77
|
+
postType: getCurrentPostType(),
|
|
78
|
+
postId: getCurrentPostId(),
|
|
79
|
+
};
|
|
80
|
+
}, [] );
|
|
81
|
+
|
|
82
|
+
const record = useSelect(
|
|
83
|
+
( select ) => {
|
|
84
|
+
if ( ! postType || ! postId ) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return select( coreDataStore ).getEditedEntityRecord(
|
|
88
|
+
'postType',
|
|
89
|
+
postType,
|
|
90
|
+
postId
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
[ postType, postId ]
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const { editEntityRecord } = useDispatch( coreDataStore );
|
|
97
|
+
|
|
98
|
+
const _fields = usePostFields( { postType } );
|
|
99
|
+
const fields = useMemo(
|
|
100
|
+
() =>
|
|
101
|
+
_fields?.map( ( field ) => {
|
|
102
|
+
if ( field.id === 'status' ) {
|
|
103
|
+
return {
|
|
104
|
+
...field,
|
|
105
|
+
elements: field.elements.filter(
|
|
106
|
+
( element ) => element.value !== 'trash'
|
|
107
|
+
),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return field;
|
|
111
|
+
} ),
|
|
112
|
+
[ _fields ]
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const onChange = ( edits ) => {
|
|
116
|
+
if (
|
|
117
|
+
edits.status &&
|
|
118
|
+
edits.status !== 'future' &&
|
|
119
|
+
record?.status === 'future' &&
|
|
120
|
+
new Date( record.date ) > new Date()
|
|
121
|
+
) {
|
|
122
|
+
edits.date = null;
|
|
123
|
+
}
|
|
124
|
+
if ( edits.status && edits.status === 'private' && record?.password ) {
|
|
125
|
+
edits.password = '';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
editEntityRecord( 'postType', postType, postId, edits );
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<PostPanelSection className="editor-post-summary">
|
|
133
|
+
<VStack spacing={ 4 }>
|
|
134
|
+
<PostCardPanel
|
|
135
|
+
postType={ postType }
|
|
136
|
+
postId={ postId }
|
|
137
|
+
onActionPerformed={ onActionPerformed }
|
|
138
|
+
/>
|
|
139
|
+
<DataForm
|
|
140
|
+
data={ record }
|
|
141
|
+
fields={ fields }
|
|
142
|
+
form={ form }
|
|
143
|
+
onChange={ onChange }
|
|
144
|
+
/>
|
|
145
|
+
<PostTrash onActionPerformed={ onActionPerformed } />
|
|
146
|
+
</VStack>
|
|
147
|
+
</PostPanelSection>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
@@ -12,6 +12,7 @@ import { addQueryArgs } from '@wordpress/url';
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
+
import DataFormPostSummary from './dataform-post-summary';
|
|
15
16
|
import PluginPostStatusInfo from '../plugin-post-status-info';
|
|
16
17
|
import PostAuthorPanel from '../post-author/panel';
|
|
17
18
|
import PostCardPanel from '../post-card-panel';
|
|
@@ -44,6 +45,20 @@ import { unlock } from '../../lock-unlock';
|
|
|
44
45
|
const PANEL_NAME = 'post-status';
|
|
45
46
|
|
|
46
47
|
export default function PostSummary( { onActionPerformed } ) {
|
|
48
|
+
const postType = useSelect(
|
|
49
|
+
( select ) => select( editorStore ).getCurrentPostType(),
|
|
50
|
+
[]
|
|
51
|
+
);
|
|
52
|
+
if (
|
|
53
|
+
window?.__experimentalDataFormInspector &&
|
|
54
|
+
[ 'page', 'post' ].includes( postType )
|
|
55
|
+
) {
|
|
56
|
+
return <DataFormPostSummary onActionPerformed={ onActionPerformed } />;
|
|
57
|
+
}
|
|
58
|
+
return <ClassicPostSummary onActionPerformed={ onActionPerformed } />;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function ClassicPostSummary( { onActionPerformed } ) {
|
|
47
62
|
const { isRemovedPostStatusPanel, postType, postId, revisionId } =
|
|
48
63
|
useSelect( ( select ) => {
|
|
49
64
|
// We use isEditorPanelRemoved to hide the panel if it was programmatically removed. We do
|
|
@@ -381,7 +381,7 @@ function VisualEditor( {
|
|
|
381
381
|
: ''
|
|
382
382
|
}${
|
|
383
383
|
isNavigationPreview
|
|
384
|
-
? `.block-editor-iframe__body{${ centerContentCSS }}`
|
|
384
|
+
? `.block-editor-iframe__body{${ centerContentCSS }padding:var(--wp--style--block-gap,2em);}`
|
|
385
385
|
: ''
|
|
386
386
|
}`,
|
|
387
387
|
// The CSS for enableResizing centers the body content vertically when resizing is enabled and applies a background
|
|
@@ -35,6 +35,9 @@ import {
|
|
|
35
35
|
pageTitleField,
|
|
36
36
|
patternTitleField,
|
|
37
37
|
notesField,
|
|
38
|
+
scheduledDateField,
|
|
39
|
+
formatField,
|
|
40
|
+
postContentInfoField,
|
|
38
41
|
} from '@wordpress/fields';
|
|
39
42
|
import {
|
|
40
43
|
altTextField,
|
|
@@ -192,6 +195,9 @@ export const registerPostTypeSchema =
|
|
|
192
195
|
const currentTheme = await registry
|
|
193
196
|
.resolveSelect( coreStore )
|
|
194
197
|
.getCurrentTheme();
|
|
198
|
+
const { disablePostFormats } = registry
|
|
199
|
+
.select( editorStore )
|
|
200
|
+
.getEditorSettings();
|
|
195
201
|
|
|
196
202
|
let canDuplicate =
|
|
197
203
|
! [ 'wp_block', 'wp_template_part' ].includes(
|
|
@@ -258,6 +264,8 @@ export const registerPostTypeSchema =
|
|
|
258
264
|
statusField,
|
|
259
265
|
! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
|
|
260
266
|
dateField,
|
|
267
|
+
! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
|
|
268
|
+
scheduledDateField,
|
|
261
269
|
slugField,
|
|
262
270
|
postTypeConfig.supports?.[ 'page-attributes' ] && parentField,
|
|
263
271
|
postTypeConfig.supports?.comments && commentStatusField,
|
|
@@ -266,6 +274,12 @@ export const registerPostTypeSchema =
|
|
|
266
274
|
postTypeConfig.supports?.trackbacks ) &&
|
|
267
275
|
discussionField,
|
|
268
276
|
templateField,
|
|
277
|
+
postTypeConfig.supports?.[ 'post-formats' ] &&
|
|
278
|
+
! disablePostFormats &&
|
|
279
|
+
formatField,
|
|
280
|
+
! DESIGN_POST_TYPES.includes( postTypeConfig.slug ) &&
|
|
281
|
+
postTypeConfig.supports?.editor &&
|
|
282
|
+
postContentInfoField,
|
|
269
283
|
passwordField,
|
|
270
284
|
postTypeConfig.supports?.editor &&
|
|
271
285
|
postTypeConfig.viewable &&
|
package/src/style.scss
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
@use "@wordpress/interface/build-style/style.css" as *;
|
|
3
3
|
@use "@wordpress/global-styles-ui/build-style/style.css" as *;
|
|
4
4
|
@use "@wordpress/dataviews/build-style/style.css" as *;
|
|
5
|
+
@use "@wordpress/fields/build-style/style.css" as *;
|
|
5
6
|
@use "@wordpress/media-editor/build-style/style.css" as *;
|
|
6
7
|
@use "./components/autocompleters/style.scss" as *;
|
|
7
8
|
@use "./components/collab-sidebar/style.scss" as *;
|
|
9
|
+
@use "./components/collaborators-presence/avatar/styles.scss" as *;
|
|
10
|
+
@use "./components/collaborators-presence/avatar-group/styles.scss" as *;
|
|
8
11
|
@use "./components/collapsible-block-toolbar/style.scss" as *;
|
|
9
12
|
@use "./components/block-visibility/style.scss" as *;
|
|
10
13
|
@use "./components/blog-title/style.scss" as *;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { dispatch } from '@wordpress/data';
|
|
5
|
+
import { store as coreDataStore } from '@wordpress/core-data';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Invalidates core-data entity records for uploaded attachments so that
|
|
9
|
+
* blocks re-fetch updated data (e.g. `media_details.sizes` after
|
|
10
|
+
* thumbnails have been generated via client-side media processing).
|
|
11
|
+
*
|
|
12
|
+
* @param {Object[]} attachments Array of attachment objects from the upload queue.
|
|
13
|
+
*/
|
|
14
|
+
export default function mediaUploadOnSuccess( attachments ) {
|
|
15
|
+
const { invalidateResolution } = dispatch( coreDataStore );
|
|
16
|
+
for ( const attachment of attachments ) {
|
|
17
|
+
if ( attachment.id ) {
|
|
18
|
+
// Invalidate with and without the query argument, since
|
|
19
|
+
// resolution keys must exactly match the args used by
|
|
20
|
+
// each consumer's getEntityRecord() call.
|
|
21
|
+
invalidateResolution( 'getEntityRecord', [
|
|
22
|
+
'postType',
|
|
23
|
+
'attachment',
|
|
24
|
+
attachment.id,
|
|
25
|
+
{ context: 'view' },
|
|
26
|
+
] );
|
|
27
|
+
invalidateResolution( 'getEntityRecord', [
|
|
28
|
+
'postType',
|
|
29
|
+
'attachment',
|
|
30
|
+
attachment.id,
|
|
31
|
+
] );
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|