@wordpress/edit-post 7.30.0 → 7.32.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/CHANGELOG.md +4 -0
- package/README.md +6 -185
- package/build/components/header/index.js +1 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +2 -7
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/init-pattern-modal/index.js +99 -0
- package/build/components/init-pattern-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/layout/actions-panel.js +4 -7
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +7 -3
- package/build/components/layout/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +3 -1
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +8 -4
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/editor.js +7 -2
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +2 -2
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +2 -2
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js +36 -19
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/index.js +4 -6
- package/build/index.js.map +1 -1
- package/build/index.native.js +2 -4
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +36 -23
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +1 -15
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +10 -5
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +2 -7
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js +93 -0
- package/build-module/components/init-pattern-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +4 -5
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +8 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +4 -2
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +9 -5
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/editor.js +7 -2
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +3 -3
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +2 -2
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/index.js +5 -5
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +2 -4
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +30 -15
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +1 -13
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +9 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +1 -7
- package/build-style/style.css +1 -7
- package/package.json +32 -32
- package/src/classic.scss +2 -1
- package/src/components/header/index.js +1 -1
- package/src/components/header/post-publish-button-or-toggle.js +2 -8
- package/src/components/init-pattern-modal/index.js +117 -0
- package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
- package/src/components/layout/actions-panel.js +5 -4
- package/src/components/layout/index.js +9 -4
- package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
- package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
- package/src/components/sidebar/post-status/index.js +2 -0
- package/src/components/sidebar/settings-sidebar/index.js +7 -5
- package/src/editor.js +12 -2
- package/src/editor.native.js +8 -2
- package/src/hooks/commands/use-common-commands.js +2 -2
- package/src/hooks/use-navigate-to-entity-record.js +37 -24
- package/src/index.js +5 -3
- package/src/index.native.js +1 -4
- package/src/store/actions.js +27 -12
- package/src/store/reducer.js +0 -13
- package/src/store/selectors.js +11 -3
- package/src/style.scss +0 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +0 -126
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +0 -1
- package/build/components/sidebar/template-summary/index.js +0 -36
- package/build/components/sidebar/template-summary/index.js.map +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +0 -118
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +0 -1
- package/build-module/components/sidebar/template-summary/index.js +0 -29
- package/build-module/components/sidebar/template-summary/index.js.map +0 -1
- package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
- package/src/components/sidebar/plugin-document-setting-panel/index.js +0 -125
- package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
- package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
- package/src/components/sidebar/template-summary/index.js +0 -37
- package/src/components/sidebar/template-summary/style.scss +0 -5
package/build-style/style.css
CHANGED
|
@@ -447,7 +447,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
447
447
|
display: none;
|
|
448
448
|
margin: 0;
|
|
449
449
|
}
|
|
450
|
-
.interface-pinned-items .components-button[aria-controls="edit-post:document"], .interface-pinned-items .components-button[aria-controls="edit-post:block"], .interface-pinned-items .components-button[aria-controls="edit-site:template"], .interface-pinned-items .components-button[aria-controls="edit-site:block-inspector"]
|
|
450
|
+
.interface-pinned-items .components-button[aria-controls="edit-post:document"], .interface-pinned-items .components-button[aria-controls="edit-post:block"], .interface-pinned-items .components-button[aria-controls="edit-site:template"], .interface-pinned-items .components-button[aria-controls="edit-site:block-inspector"] {
|
|
451
451
|
display: flex;
|
|
452
452
|
}
|
|
453
453
|
.interface-pinned-items .components-button svg {
|
|
@@ -1126,12 +1126,6 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
1126
1126
|
margin: 8px;
|
|
1127
1127
|
}
|
|
1128
1128
|
|
|
1129
|
-
h2.edit-post-template-summary__title {
|
|
1130
|
-
line-height: 24px;
|
|
1131
|
-
margin: 0 0 4px;
|
|
1132
|
-
font-weight: 500;
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
1129
|
.edit-post-text-editor {
|
|
1136
1130
|
position: relative;
|
|
1137
1131
|
width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.32.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,36 +27,36 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^27.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/deprecated": "^3.
|
|
42
|
-
"@wordpress/dom": "^3.
|
|
43
|
-
"@wordpress/editor": "^13.
|
|
44
|
-
"@wordpress/element": "^5.
|
|
45
|
-
"@wordpress/hooks": "^3.
|
|
46
|
-
"@wordpress/i18n": "^4.
|
|
47
|
-
"@wordpress/icons": "^9.
|
|
48
|
-
"@wordpress/interface": "^5.
|
|
49
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
50
|
-
"@wordpress/keycodes": "^3.
|
|
51
|
-
"@wordpress/media-utils": "^4.
|
|
52
|
-
"@wordpress/notices": "^4.
|
|
53
|
-
"@wordpress/plugins": "^6.
|
|
54
|
-
"@wordpress/preferences": "^3.
|
|
55
|
-
"@wordpress/private-apis": "^0.
|
|
56
|
-
"@wordpress/url": "^3.
|
|
57
|
-
"@wordpress/viewport": "^5.
|
|
58
|
-
"@wordpress/warning": "^2.
|
|
59
|
-
"@wordpress/widgets": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.55.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.52.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.23.0",
|
|
33
|
+
"@wordpress/block-library": "^8.32.0",
|
|
34
|
+
"@wordpress/blocks": "^12.32.0",
|
|
35
|
+
"@wordpress/commands": "^0.26.0",
|
|
36
|
+
"@wordpress/components": "^27.3.0",
|
|
37
|
+
"@wordpress/compose": "^6.32.0",
|
|
38
|
+
"@wordpress/core-commands": "^0.24.0",
|
|
39
|
+
"@wordpress/core-data": "^6.32.0",
|
|
40
|
+
"@wordpress/data": "^9.25.0",
|
|
41
|
+
"@wordpress/deprecated": "^3.55.0",
|
|
42
|
+
"@wordpress/dom": "^3.55.0",
|
|
43
|
+
"@wordpress/editor": "^13.32.0",
|
|
44
|
+
"@wordpress/element": "^5.32.0",
|
|
45
|
+
"@wordpress/hooks": "^3.55.0",
|
|
46
|
+
"@wordpress/i18n": "^4.55.0",
|
|
47
|
+
"@wordpress/icons": "^9.46.0",
|
|
48
|
+
"@wordpress/interface": "^5.32.0",
|
|
49
|
+
"@wordpress/keyboard-shortcuts": "^4.32.0",
|
|
50
|
+
"@wordpress/keycodes": "^3.55.0",
|
|
51
|
+
"@wordpress/media-utils": "^4.46.0",
|
|
52
|
+
"@wordpress/notices": "^4.23.0",
|
|
53
|
+
"@wordpress/plugins": "^6.23.0",
|
|
54
|
+
"@wordpress/preferences": "^3.32.0",
|
|
55
|
+
"@wordpress/private-apis": "^0.37.0",
|
|
56
|
+
"@wordpress/url": "^3.56.0",
|
|
57
|
+
"@wordpress/viewport": "^5.32.0",
|
|
58
|
+
"@wordpress/warning": "^2.55.0",
|
|
59
|
+
"@wordpress/widgets": "^3.32.0",
|
|
60
60
|
"classnames": "^2.3.1",
|
|
61
61
|
"memize": "^2.1.0",
|
|
62
62
|
"rememo": "^4.0.2"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
|
|
72
72
|
}
|
package/src/classic.scss
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Provide baseline auto margin for centering blocks.
|
|
2
2
|
// Specificity is kept at this level as many classic themes output
|
|
3
3
|
// rules like figure { margin: 0; } which would break centering.
|
|
4
|
-
|
|
4
|
+
// These rules should also not apply to direct children of flex layout blocks.
|
|
5
|
+
:where(.editor-styles-wrapper) :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block {
|
|
5
6
|
margin-left: auto;
|
|
6
7
|
margin-right: auto;
|
|
7
8
|
}
|
|
@@ -81,7 +81,7 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
|
|
|
81
81
|
!! select( editorStore ).getEditorSettings()
|
|
82
82
|
.onNavigateToPreviousEntityRecord,
|
|
83
83
|
isPublishSidebarOpened:
|
|
84
|
-
select(
|
|
84
|
+
select( editorStore ).isPublishSidebarOpened(),
|
|
85
85
|
showIconLabels: getPreference( 'core', 'showIconLabels' ),
|
|
86
86
|
};
|
|
87
87
|
}, [] );
|
|
@@ -5,11 +5,6 @@ import { useViewportMatch, compose } from '@wordpress/compose';
|
|
|
5
5
|
import { withDispatch, withSelect } from '@wordpress/data';
|
|
6
6
|
import { PostPublishButton, store as editorStore } from '@wordpress/editor';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { store as editPostStore } from '../../store';
|
|
12
|
-
|
|
13
8
|
export function PostPublishButtonOrToggle( {
|
|
14
9
|
forceIsDirty,
|
|
15
10
|
hasPublishAction,
|
|
@@ -85,12 +80,11 @@ export default compose(
|
|
|
85
80
|
isPublished: select( editorStore ).isCurrentPostPublished(),
|
|
86
81
|
isPublishSidebarEnabled:
|
|
87
82
|
select( editorStore ).isPublishSidebarEnabled(),
|
|
88
|
-
isPublishSidebarOpened:
|
|
89
|
-
select( editPostStore ).isPublishSidebarOpened(),
|
|
83
|
+
isPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),
|
|
90
84
|
isScheduled: select( editorStore ).isCurrentPostScheduled(),
|
|
91
85
|
} ) ),
|
|
92
86
|
withDispatch( ( dispatch ) => {
|
|
93
|
-
const { togglePublishSidebar } = dispatch(
|
|
87
|
+
const { togglePublishSidebar } = dispatch( editorStore );
|
|
94
88
|
return {
|
|
95
89
|
togglePublishSidebar,
|
|
96
90
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { __, _x } from '@wordpress/i18n';
|
|
6
|
+
import {
|
|
7
|
+
Modal,
|
|
8
|
+
Button,
|
|
9
|
+
__experimentalHStack as HStack,
|
|
10
|
+
__experimentalVStack as VStack,
|
|
11
|
+
ToggleControl,
|
|
12
|
+
TextControl,
|
|
13
|
+
} from '@wordpress/components';
|
|
14
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
15
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
16
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { unlock } from '../../lock-unlock';
|
|
23
|
+
|
|
24
|
+
const { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );
|
|
25
|
+
|
|
26
|
+
export default function InitPatternModal() {
|
|
27
|
+
const { editPost } = useDispatch( editorStore );
|
|
28
|
+
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
29
|
+
const [ syncType, setSyncType ] = useState( undefined );
|
|
30
|
+
const [ title, setTitle ] = useState( '' );
|
|
31
|
+
|
|
32
|
+
const { postType, isNewPost } = useSelect( ( select ) => {
|
|
33
|
+
const { getEditedPostAttribute, isCleanNewPost } =
|
|
34
|
+
select( editorStore );
|
|
35
|
+
return {
|
|
36
|
+
postType: getEditedPostAttribute( 'type' ),
|
|
37
|
+
isNewPost: isCleanNewPost(),
|
|
38
|
+
};
|
|
39
|
+
}, [] );
|
|
40
|
+
|
|
41
|
+
useEffect( () => {
|
|
42
|
+
if ( isNewPost && postType === 'wp_block' ) {
|
|
43
|
+
setIsModalOpen( true );
|
|
44
|
+
}
|
|
45
|
+
// We only want the modal to open when the page is first loaded.
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
+
}, [] );
|
|
48
|
+
|
|
49
|
+
if ( postType !== 'wp_block' || ! isNewPost ) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
{ isModalOpen && (
|
|
56
|
+
<Modal
|
|
57
|
+
title={ __( 'Create pattern' ) }
|
|
58
|
+
onRequestClose={ () => {
|
|
59
|
+
setIsModalOpen( false );
|
|
60
|
+
} }
|
|
61
|
+
overlayClassName="reusable-blocks-menu-items__convert-modal"
|
|
62
|
+
>
|
|
63
|
+
<form
|
|
64
|
+
onSubmit={ ( event ) => {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
setIsModalOpen( false );
|
|
67
|
+
editPost( {
|
|
68
|
+
title,
|
|
69
|
+
meta: {
|
|
70
|
+
wp_pattern_sync_status: syncType,
|
|
71
|
+
},
|
|
72
|
+
} );
|
|
73
|
+
} }
|
|
74
|
+
>
|
|
75
|
+
<VStack spacing="5">
|
|
76
|
+
<TextControl
|
|
77
|
+
label={ __( 'Name' ) }
|
|
78
|
+
value={ title }
|
|
79
|
+
onChange={ setTitle }
|
|
80
|
+
placeholder={ __( 'My pattern' ) }
|
|
81
|
+
className="patterns-create-modal__name-input"
|
|
82
|
+
__nextHasNoMarginBottom
|
|
83
|
+
__next40pxDefaultSize
|
|
84
|
+
/>
|
|
85
|
+
<ReusableBlocksRenameHint />
|
|
86
|
+
<ToggleControl
|
|
87
|
+
label={ _x(
|
|
88
|
+
'Synced',
|
|
89
|
+
'Option that makes an individual pattern synchronized'
|
|
90
|
+
) }
|
|
91
|
+
help={ __(
|
|
92
|
+
'Sync this pattern across multiple locations.'
|
|
93
|
+
) }
|
|
94
|
+
checked={ ! syncType }
|
|
95
|
+
onChange={ () => {
|
|
96
|
+
setSyncType(
|
|
97
|
+
! syncType ? 'unsynced' : undefined
|
|
98
|
+
);
|
|
99
|
+
} }
|
|
100
|
+
/>
|
|
101
|
+
<HStack justify="right">
|
|
102
|
+
<Button
|
|
103
|
+
variant="primary"
|
|
104
|
+
type="submit"
|
|
105
|
+
disabled={ ! title }
|
|
106
|
+
__experimentalIsFocusable
|
|
107
|
+
>
|
|
108
|
+
{ __( 'Create' ) }
|
|
109
|
+
</Button>
|
|
110
|
+
</HStack>
|
|
111
|
+
</VStack>
|
|
112
|
+
</form>
|
|
113
|
+
</Modal>
|
|
114
|
+
) }
|
|
115
|
+
</>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
@@ -46,4 +46,8 @@ export const textFormattingShortcuts = [
|
|
|
46
46
|
'Convert the current paragraph or heading to a heading of level 1 to 6.'
|
|
47
47
|
),
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
keyCombination: { modifier: 'primaryShift', character: '\u00a0' },
|
|
51
|
+
description: __( 'Add non breaking space.' ),
|
|
52
|
+
},
|
|
49
53
|
];
|
|
@@ -136,6 +136,10 @@ export function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {
|
|
|
136
136
|
title={ __( 'Text formatting' ) }
|
|
137
137
|
shortcuts={ textFormattingShortcuts }
|
|
138
138
|
/>
|
|
139
|
+
<ShortcutCategorySection
|
|
140
|
+
title={ __( 'List View shortcuts' ) }
|
|
141
|
+
categoryName="list-view"
|
|
142
|
+
/>
|
|
139
143
|
</Modal>
|
|
140
144
|
);
|
|
141
145
|
}
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
import {
|
|
5
5
|
EntitiesSavedStates,
|
|
6
6
|
PostPublishPanel,
|
|
7
|
+
PluginPrePublishPanel,
|
|
8
|
+
PluginPostPublishPanel,
|
|
7
9
|
store as editorStore,
|
|
8
10
|
} from '@wordpress/editor';
|
|
9
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
10
12
|
import { Button, createSlotFill } from '@wordpress/components';
|
|
11
13
|
import { __ } from '@wordpress/i18n';
|
|
12
14
|
import { useCallback } from '@wordpress/element';
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* Internal dependencies
|
|
15
18
|
*/
|
|
16
|
-
import PluginPostPublishPanel from '../sidebar/plugin-post-publish-panel';
|
|
17
|
-
import PluginPrePublishPanel from '../sidebar/plugin-pre-publish-panel';
|
|
18
19
|
import { store as editPostStore } from '../../store';
|
|
19
20
|
|
|
20
21
|
const { Fill, Slot } = createSlotFill( 'ActionsPanel' );
|
|
@@ -27,7 +28,7 @@ export default function ActionsPanel( {
|
|
|
27
28
|
isEntitiesSavedStatesOpen,
|
|
28
29
|
} ) {
|
|
29
30
|
const { closePublishSidebar, togglePublishSidebar } =
|
|
30
|
-
useDispatch(
|
|
31
|
+
useDispatch( editorStore );
|
|
31
32
|
const {
|
|
32
33
|
publishSidebarOpened,
|
|
33
34
|
hasActiveMetaboxes,
|
|
@@ -35,7 +36,7 @@ export default function ActionsPanel( {
|
|
|
35
36
|
} = useSelect(
|
|
36
37
|
( select ) => ( {
|
|
37
38
|
publishSidebarOpened:
|
|
38
|
-
select(
|
|
39
|
+
select( editorStore ).isPublishSidebarOpened(),
|
|
39
40
|
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
40
41
|
hasNonPostEntityChanges:
|
|
41
42
|
select( editorStore ).hasNonPostEntityChanges(),
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
EditorKeyboardShortcutsRegister,
|
|
15
15
|
EditorKeyboardShortcuts,
|
|
16
16
|
EditorSnackbars,
|
|
17
|
-
PostSyncStatusModal,
|
|
18
17
|
store as editorStore,
|
|
19
18
|
privateApis as editorPrivateApis,
|
|
20
19
|
} from '@wordpress/editor';
|
|
@@ -50,6 +49,7 @@ import VisualEditor from '../visual-editor';
|
|
|
50
49
|
import EditPostKeyboardShortcuts from '../keyboard-shortcuts';
|
|
51
50
|
import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
|
|
52
51
|
import EditPostPreferencesModal from '../preferences-modal';
|
|
52
|
+
import InitPatternModal from '../init-pattern-modal';
|
|
53
53
|
import BrowserURL from '../browser-url';
|
|
54
54
|
import Header from '../header';
|
|
55
55
|
import SettingsSidebar from '../sidebar/settings-sidebar';
|
|
@@ -172,7 +172,7 @@ function Layout( { initialPost } ) {
|
|
|
172
172
|
sidebarIsOpened: !! (
|
|
173
173
|
select( interfaceStore ).getActiveComplementaryArea(
|
|
174
174
|
editPostStore.name
|
|
175
|
-
) || select(
|
|
175
|
+
) || select( editorStore ).isPublishSidebarOpened()
|
|
176
176
|
),
|
|
177
177
|
isFullscreenActive:
|
|
178
178
|
select( editPostStore ).isFeatureActive( 'fullscreenMode' ),
|
|
@@ -258,7 +258,12 @@ function Layout( { initialPost } ) {
|
|
|
258
258
|
|
|
259
259
|
const secondarySidebar = () => {
|
|
260
260
|
if ( mode === 'visual' && isInserterOpened ) {
|
|
261
|
-
return
|
|
261
|
+
return (
|
|
262
|
+
<InserterSidebar
|
|
263
|
+
closeGeneralSidebar={ closeGeneralSidebar }
|
|
264
|
+
isRightSidebarOpen={ sidebarIsOpened }
|
|
265
|
+
/>
|
|
266
|
+
);
|
|
262
267
|
}
|
|
263
268
|
if ( mode === 'visual' && isListViewOpened ) {
|
|
264
269
|
return <ListViewSidebar />;
|
|
@@ -381,7 +386,7 @@ function Layout( { initialPost } ) {
|
|
|
381
386
|
<EditPostPreferencesModal />
|
|
382
387
|
<KeyboardShortcutHelpModal />
|
|
383
388
|
<WelcomeGuide />
|
|
384
|
-
<
|
|
389
|
+
<InitPatternModal />
|
|
385
390
|
<StartPageOptions />
|
|
386
391
|
<PluginArea onError={ onPluginAreaError } />
|
|
387
392
|
{ ! isDistractionFree && <SettingsSidebar /> }
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
|
|
89
89
|
// Until checkboxes WordPress-wide are updated to match the new style,
|
|
90
90
|
// checkboxes used in metaboxes have to be slightly unstyled here.
|
|
91
|
-
// @todo
|
|
91
|
+
// @todo remove this entire rule once checkboxes are the same everywhere.
|
|
92
92
|
// See: https://github.com/WordPress/gutenberg/issues/18053
|
|
93
93
|
.metabox-location-side .postbox input[type="checkbox"] {
|
|
94
94
|
border: $border-width solid $gray-700;
|
|
@@ -1,83 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );
|
|
4
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
|
+
import { PluginPostPublishPanel } from '@wordpress/editor';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Renders provided content to the post-publish panel in the publish flow
|
|
11
9
|
* (side panel that opens after a user publishes the post).
|
|
12
10
|
*
|
|
11
|
+
* @deprecated since 6.6, use `wp.editor.PluginPostPublishPanel` instead.
|
|
12
|
+
*
|
|
13
13
|
* @param {Object} props Component properties.
|
|
14
14
|
* @param {string} [props.className] An optional class name added to the panel.
|
|
15
15
|
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
16
16
|
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
|
|
17
17
|
* @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
18
18
|
* @param {Element} props.children Children to be rendered
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```js
|
|
22
|
-
* // Using ES5 syntax
|
|
23
|
-
* var __ = wp.i18n.__;
|
|
24
|
-
* var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
|
|
25
|
-
*
|
|
26
|
-
* function MyPluginPostPublishPanel() {
|
|
27
|
-
* return React.createElement(
|
|
28
|
-
* PluginPostPublishPanel,
|
|
29
|
-
* {
|
|
30
|
-
* className: 'my-plugin-post-publish-panel',
|
|
31
|
-
* title: __( 'My panel title' ),
|
|
32
|
-
* initialOpen: true,
|
|
33
|
-
* },
|
|
34
|
-
* __( 'My panel content' )
|
|
35
|
-
* );
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```jsx
|
|
41
|
-
* // Using ESNext syntax
|
|
42
|
-
* import { __ } from '@wordpress/i18n';
|
|
43
|
-
* import { PluginPostPublishPanel } from '@wordpress/edit-post';
|
|
44
|
-
*
|
|
45
|
-
* const MyPluginPostPublishPanel = () => (
|
|
46
|
-
* <PluginPostPublishPanel
|
|
47
|
-
* className="my-plugin-post-publish-panel"
|
|
48
|
-
* title={ __( 'My panel title' ) }
|
|
49
|
-
* initialOpen={ true }
|
|
50
|
-
* >
|
|
51
|
-
* { __( 'My panel content' ) }
|
|
52
|
-
* </PluginPostPublishPanel>
|
|
53
|
-
* );
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
19
|
* @return {Component} The component to be rendered.
|
|
57
20
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<Fill>
|
|
69
|
-
<PanelBody
|
|
70
|
-
className={ className }
|
|
71
|
-
initialOpen={ initialOpen || ! title }
|
|
72
|
-
title={ title }
|
|
73
|
-
icon={ icon ?? pluginIcon }
|
|
74
|
-
>
|
|
75
|
-
{ children }
|
|
76
|
-
</PanelBody>
|
|
77
|
-
</Fill>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
PluginPostPublishPanel.Slot = Slot;
|
|
82
|
-
|
|
83
|
-
export default PluginPostPublishPanel;
|
|
21
|
+
export default function EditPostPluginPostPublishPanel( props ) {
|
|
22
|
+
deprecated( 'wp.editPost.PluginPostPublishPanel', {
|
|
23
|
+
since: '6.6',
|
|
24
|
+
version: '6.8',
|
|
25
|
+
alternative: 'wp.editor.PluginPostPublishPanel',
|
|
26
|
+
} );
|
|
27
|
+
return <PluginPostPublishPanel { ...props } />;
|
|
28
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
|
|
4
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
|
+
import { PluginPrePublishPanel } from '@wordpress/editor';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Renders provided content to the pre-publish side panel in the publish flow
|
|
11
9
|
* (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
12
10
|
*
|
|
11
|
+
* @deprecated since 6.6, use `wp.editor.PluginPrePublishPanel` instead.
|
|
12
|
+
*
|
|
13
13
|
* @param {Object} props Component props.
|
|
14
14
|
* @param {string} [props.className] An optional class name added to the panel.
|
|
15
15
|
* @param {string} [props.title] Title displayed at the top of the panel.
|
|
@@ -20,67 +20,13 @@ const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
|
|
|
20
20
|
* the sidebar is pinned to toolbar.
|
|
21
21
|
* @param {Element} props.children Children to be rendered
|
|
22
22
|
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```js
|
|
25
|
-
* // Using ES5 syntax
|
|
26
|
-
* var __ = wp.i18n.__;
|
|
27
|
-
* var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
|
|
28
|
-
*
|
|
29
|
-
* function MyPluginPrePublishPanel() {
|
|
30
|
-
* return React.createElement(
|
|
31
|
-
* PluginPrePublishPanel,
|
|
32
|
-
* {
|
|
33
|
-
* className: 'my-plugin-pre-publish-panel',
|
|
34
|
-
* title: __( 'My panel title' ),
|
|
35
|
-
* initialOpen: true,
|
|
36
|
-
* },
|
|
37
|
-
* __( 'My panel content' )
|
|
38
|
-
* );
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```jsx
|
|
44
|
-
* // Using ESNext syntax
|
|
45
|
-
* import { __ } from '@wordpress/i18n';
|
|
46
|
-
* import { PluginPrePublishPanel } from '@wordpress/edit-post';
|
|
47
|
-
*
|
|
48
|
-
* const MyPluginPrePublishPanel = () => (
|
|
49
|
-
* <PluginPrePublishPanel
|
|
50
|
-
* className="my-plugin-pre-publish-panel"
|
|
51
|
-
* title={ __( 'My panel title' ) }
|
|
52
|
-
* initialOpen={ true }
|
|
53
|
-
* >
|
|
54
|
-
* { __( 'My panel content' ) }
|
|
55
|
-
* </PluginPrePublishPanel>
|
|
56
|
-
* );
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
23
|
* @return {Component} The component to be rendered.
|
|
60
24
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<Fill>
|
|
72
|
-
<PanelBody
|
|
73
|
-
className={ className }
|
|
74
|
-
initialOpen={ initialOpen || ! title }
|
|
75
|
-
title={ title }
|
|
76
|
-
icon={ icon ?? pluginIcon }
|
|
77
|
-
>
|
|
78
|
-
{ children }
|
|
79
|
-
</PanelBody>
|
|
80
|
-
</Fill>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
PluginPrePublishPanel.Slot = Slot;
|
|
85
|
-
|
|
86
|
-
export default PluginPrePublishPanel;
|
|
25
|
+
export default function EditPostPluginPrePublishPanel( props ) {
|
|
26
|
+
deprecated( 'wp.editPost.PluginPrePublishPanel', {
|
|
27
|
+
since: '6.6',
|
|
28
|
+
version: '6.8',
|
|
29
|
+
alternative: 'wp.editor.PluginPrePublishPanel',
|
|
30
|
+
} );
|
|
31
|
+
return <PluginPrePublishPanel { ...props } />;
|
|
32
|
+
}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
PostSyncStatus,
|
|
15
15
|
PostURLPanel,
|
|
16
16
|
PostTemplatePanel,
|
|
17
|
+
PostFeaturedImagePanel,
|
|
17
18
|
store as editorStore,
|
|
18
19
|
} from '@wordpress/editor';
|
|
19
20
|
|
|
@@ -60,6 +61,7 @@ export default function PostStatus() {
|
|
|
60
61
|
<PluginPostStatusInfo.Slot>
|
|
61
62
|
{ ( fills ) => (
|
|
62
63
|
<>
|
|
64
|
+
<PostFeaturedImagePanel withPanelBody={ false } />
|
|
63
65
|
<PostVisibility />
|
|
64
66
|
<PostSchedulePanel />
|
|
65
67
|
<PostTemplatePanel />
|
|
@@ -20,11 +20,12 @@ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
|
20
20
|
import {
|
|
21
21
|
store as editorStore,
|
|
22
22
|
PageAttributesPanel,
|
|
23
|
+
PluginDocumentSettingPanel,
|
|
23
24
|
PostDiscussionPanel,
|
|
24
25
|
PostExcerptPanel,
|
|
25
|
-
PostFeaturedImagePanel,
|
|
26
26
|
PostLastRevisionPanel,
|
|
27
27
|
PostTaxonomiesPanel,
|
|
28
|
+
privateApis as editorPrivateApis,
|
|
28
29
|
} from '@wordpress/editor';
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -33,14 +34,15 @@ import {
|
|
|
33
34
|
import SettingsHeader from '../settings-header';
|
|
34
35
|
import PostStatus from '../post-status';
|
|
35
36
|
import MetaBoxes from '../../meta-boxes';
|
|
36
|
-
import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
|
|
37
37
|
import PluginSidebarEditPost from '../plugin-sidebar';
|
|
38
|
-
import TemplateSummary from '../template-summary';
|
|
39
38
|
import { store as editPostStore } from '../../../store';
|
|
40
39
|
import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
41
40
|
import { unlock } from '../../../lock-unlock';
|
|
42
41
|
|
|
42
|
+
const { PostCardPanel } = unlock( editorPrivateApis );
|
|
43
|
+
|
|
43
44
|
const { Tabs } = unlock( componentsPrivateApis );
|
|
45
|
+
const { PatternOverridesPanel } = unlock( editorPrivateApis );
|
|
44
46
|
|
|
45
47
|
const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {
|
|
46
48
|
web: true,
|
|
@@ -111,20 +113,20 @@ const SidebarContent = ( {
|
|
|
111
113
|
>
|
|
112
114
|
<Tabs.Context.Provider value={ tabsContextValue }>
|
|
113
115
|
<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
|
|
116
|
+
<PostCardPanel />
|
|
114
117
|
{ ! isEditingTemplate && (
|
|
115
118
|
<>
|
|
116
119
|
<PostStatus />
|
|
117
120
|
<PluginDocumentSettingPanel.Slot />
|
|
118
121
|
<PostLastRevisionPanel />
|
|
119
122
|
<PostTaxonomiesPanel />
|
|
120
|
-
<PostFeaturedImagePanel />
|
|
121
123
|
<PostExcerptPanel />
|
|
122
124
|
<PostDiscussionPanel />
|
|
123
125
|
<PageAttributesPanel />
|
|
126
|
+
<PatternOverridesPanel />
|
|
124
127
|
<MetaBoxes location="side" />
|
|
125
128
|
</>
|
|
126
129
|
) }
|
|
127
|
-
{ isEditingTemplate && <TemplateSummary /> }
|
|
128
130
|
</Tabs.TabPanel>
|
|
129
131
|
<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
|
|
130
132
|
<BlockInspector />
|