@wordpress/edit-post 6.3.10 → 6.6.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 +6 -0
- package/build/components/device-preview/index.js +26 -7
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +25 -7
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/template-title/delete-template.js +6 -5
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +4 -2
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/header/template-title/template-description.js +3 -1
- package/build/components/header/template-title/template-description.js.map +1 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +5 -3
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/preferences-modal/index.js +10 -6
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +0 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +1 -1
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +16 -1
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/text-editor/index.js +11 -24
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.js +19 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build-module/components/device-preview/index.js +24 -7
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +26 -8
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/template-title/delete-template.js +6 -5
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +4 -2
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/header/template-title/template-description.js +4 -2
- package/build-module/components/header/template-title/template-description.js.map +1 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +5 -3
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +10 -6
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +0 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +1 -1
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +17 -1
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +11 -22
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +20 -2
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/index.js +7 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +41 -81
- package/build-style/style.css +41 -81
- package/package.json +27 -27
- package/src/components/block-manager/style.scss +0 -4
- package/src/components/device-preview/index.js +36 -23
- package/src/components/header/header-toolbar/index.native.js +45 -8
- package/src/components/header/header-toolbar/style.native.scss +8 -4
- package/src/components/header/style.scss +14 -36
- package/src/components/header/template-title/delete-template.js +11 -4
- package/src/components/header/template-title/edit-template-title.js +27 -25
- package/src/components/header/template-title/style.scss +26 -5
- package/src/components/header/template-title/template-description.js +3 -2
- package/src/components/layout/index.js +1 -0
- package/src/components/layout/index.native.js +8 -5
- package/src/components/preferences-modal/index.js +18 -9
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +24 -14
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -5
- package/src/components/sidebar/plugin-document-setting-panel/index.js +0 -1
- package/src/components/sidebar/post-schedule/index.js +1 -1
- package/src/components/sidebar/post-schedule/style.scss +2 -2
- package/src/components/sidebar/post-visibility/index.js +12 -2
- package/src/components/sidebar/post-visibility/style.scss +2 -30
- package/src/components/sidebar/settings-header/style.scss +1 -1
- package/src/components/text-editor/index.js +9 -19
- package/src/components/visual-editor/index.js +14 -2
- package/src/components/visual-editor/test/index.native.js +93 -0
- package/src/index.js +7 -0
- package/src/test/editor.native.js +11 -2
- package/build/components/admin-notices/index.js +0 -129
- package/build/components/admin-notices/index.js.map +0 -1
- package/build/components/block-manager/show-all.js +0 -39
- package/build/components/block-manager/show-all.js.map +0 -1
- package/build/components/editor-initialization/utils.js +0 -38
- package/build/components/editor-initialization/utils.js.map +0 -1
- package/build-module/components/admin-notices/index.js +0 -114
- package/build-module/components/admin-notices/index.js.map +0 -1
- package/build-module/components/block-manager/show-all.js +0 -29
- package/build-module/components/block-manager/show-all.js.map +0 -1
- package/build-module/components/editor-initialization/utils.js +0 -29
- package/build-module/components/editor-initialization/utils.js.map +0 -1
- package/src/components/admin-notices/index.js +0 -110
- package/src/components/admin-notices/test/index.js +0 -63
- package/src/components/block-manager/show-all.js +0 -30
- package/src/components/editor-initialization/utils.js +0 -24
|
@@ -6,7 +6,7 @@ import { Platform, ScrollView, View } from 'react-native';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useRef } from '@wordpress/element';
|
|
9
|
+
import { useCallback, useRef, useState } from '@wordpress/element';
|
|
10
10
|
import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
11
11
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
12
12
|
import { withViewportMatch } from '@wordpress/viewport';
|
|
@@ -40,7 +40,11 @@ function HeaderToolbar( {
|
|
|
40
40
|
getStylesFromColorScheme,
|
|
41
41
|
onHideKeyboard,
|
|
42
42
|
isRTL,
|
|
43
|
+
noContentSelected,
|
|
43
44
|
} ) {
|
|
45
|
+
const wasNoContentSelected = useRef( noContentSelected );
|
|
46
|
+
const [ isInserterOpen, setIsInserterOpen ] = useState( false );
|
|
47
|
+
|
|
44
48
|
const scrollViewRef = useRef( null );
|
|
45
49
|
const scrollToStart = () => {
|
|
46
50
|
// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android
|
|
@@ -79,12 +83,32 @@ function HeaderToolbar( {
|
|
|
79
83
|
return isRTL ? buttons.reverse() : buttons;
|
|
80
84
|
};
|
|
81
85
|
|
|
86
|
+
const onToggleInserter = useCallback(
|
|
87
|
+
( isOpen ) => {
|
|
88
|
+
if ( isOpen ) {
|
|
89
|
+
wasNoContentSelected.current = noContentSelected;
|
|
90
|
+
}
|
|
91
|
+
setIsInserterOpen( isOpen );
|
|
92
|
+
},
|
|
93
|
+
[ noContentSelected ]
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// Expanded mode should be preserved while the inserter is open.
|
|
97
|
+
// This way we prevent style updates during the opening transition.
|
|
98
|
+
const useExpandedMode = isInserterOpen
|
|
99
|
+
? wasNoContentSelected.current
|
|
100
|
+
: noContentSelected;
|
|
101
|
+
|
|
82
102
|
return (
|
|
83
103
|
<View
|
|
84
|
-
style={
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
style={ [
|
|
105
|
+
getStylesFromColorScheme(
|
|
106
|
+
styles[ 'header-toolbar__container' ],
|
|
107
|
+
styles[ 'header-toolbar__container--dark' ]
|
|
108
|
+
),
|
|
109
|
+
useExpandedMode &&
|
|
110
|
+
styles[ 'header-toolbar__container--expanded' ],
|
|
111
|
+
] }
|
|
88
112
|
>
|
|
89
113
|
<ScrollView
|
|
90
114
|
ref={ scrollViewRef }
|
|
@@ -93,14 +117,24 @@ function HeaderToolbar( {
|
|
|
93
117
|
showsHorizontalScrollIndicator={ false }
|
|
94
118
|
keyboardShouldPersistTaps="always"
|
|
95
119
|
alwaysBounceHorizontal={ false }
|
|
96
|
-
contentContainerStyle={
|
|
120
|
+
contentContainerStyle={
|
|
121
|
+
styles[ 'header-toolbar__scrollable-content' ]
|
|
122
|
+
}
|
|
97
123
|
>
|
|
98
|
-
<Inserter
|
|
124
|
+
<Inserter
|
|
125
|
+
disabled={ ! showInserter }
|
|
126
|
+
useExpandedMode={ useExpandedMode }
|
|
127
|
+
onToggle={ onToggleInserter }
|
|
128
|
+
/>
|
|
99
129
|
{ renderHistoryButtons() }
|
|
100
130
|
<BlockToolbar />
|
|
101
131
|
</ScrollView>
|
|
102
132
|
{ showKeyboardHideButton && (
|
|
103
|
-
<ToolbarGroup
|
|
133
|
+
<ToolbarGroup
|
|
134
|
+
passedStyle={
|
|
135
|
+
styles[ 'header-toolbar__keyboard-hide-container' ]
|
|
136
|
+
}
|
|
137
|
+
>
|
|
104
138
|
<ToolbarButton
|
|
105
139
|
title={ __( 'Hide keyboard' ) }
|
|
106
140
|
icon={ keyboardClose }
|
|
@@ -121,8 +155,10 @@ export default compose( [
|
|
|
121
155
|
getBlockRootClientId,
|
|
122
156
|
getBlockSelectionEnd,
|
|
123
157
|
hasInserterItems,
|
|
158
|
+
hasSelectedBlock,
|
|
124
159
|
} = select( blockEditorStore );
|
|
125
160
|
const { getEditorSettings } = select( editorStore );
|
|
161
|
+
const isAnyBlockSelected = hasSelectedBlock();
|
|
126
162
|
return {
|
|
127
163
|
hasRedo: select( editorStore ).hasEditorRedo(),
|
|
128
164
|
hasUndo: select( editorStore ).hasEditorUndo(),
|
|
@@ -136,6 +172,7 @@ export default compose( [
|
|
|
136
172
|
isTextModeEnabled:
|
|
137
173
|
select( editPostStore ).getEditorMode() === 'text',
|
|
138
174
|
isRTL: select( blockEditorStore ).getSettings().isRTL,
|
|
175
|
+
noContentSelected: ! isAnyBlockSelected,
|
|
139
176
|
};
|
|
140
177
|
} ),
|
|
141
178
|
withDispatch( ( dispatch ) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
2
|
+
.header-toolbar__container {
|
|
3
3
|
height: $mobile-header-toolbar-height;
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
background-color: $app-background;
|
|
@@ -7,16 +7,20 @@
|
|
|
7
7
|
border-top-width: 1px;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.
|
|
10
|
+
.header-toolbar__container--dark {
|
|
11
11
|
background-color: $app-background-dark-alt;
|
|
12
12
|
border-top-color: $background-dark-elevated;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.header-toolbar__container--expanded {
|
|
16
|
+
height: $mobile-header-toolbar-expanded-height;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.header-toolbar__scrollable-content {
|
|
16
20
|
flex-grow: 1; // Fixes RTL issue on Android.
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
.
|
|
23
|
+
.header-toolbar__keyboard-hide-container {
|
|
20
24
|
padding-right: 0;
|
|
21
25
|
padding-left: 0;
|
|
22
26
|
padding-top: 4px;
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Buttons on the right side
|
|
49
|
+
*/
|
|
50
|
+
|
|
47
51
|
.edit-post-header__settings {
|
|
48
52
|
display: inline-flex;
|
|
49
53
|
align-items: center;
|
|
@@ -51,31 +55,13 @@
|
|
|
51
55
|
padding-right: $grid-unit-05;
|
|
52
56
|
|
|
53
57
|
@include break-small () {
|
|
54
|
-
padding-right: $grid-unit-20;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Buttons in the Toolbar
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
// Adjust button paddings to scale better to mobile.
|
|
62
|
-
.editor-post-saved-state,
|
|
63
|
-
.components-button.components-button {
|
|
64
|
-
margin-right: $grid-unit-05;
|
|
65
|
-
|
|
66
|
-
@include break-small() {
|
|
67
|
-
margin-right: $grid-unit-15;
|
|
68
|
-
}
|
|
58
|
+
padding-right: $grid-unit-20 - ($grid-unit-15 * 0.5);
|
|
69
59
|
}
|
|
70
60
|
|
|
71
|
-
|
|
72
|
-
.components-button.is-tertiary {
|
|
73
|
-
padding: 0 #{ $grid-unit-15 * 0.5 };
|
|
74
|
-
}
|
|
61
|
+
gap: $grid-unit-05;
|
|
75
62
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
margin-right: 0;
|
|
63
|
+
@include break-small() {
|
|
64
|
+
gap: $grid-unit-10;
|
|
79
65
|
}
|
|
80
66
|
}
|
|
81
67
|
|
|
@@ -98,12 +84,14 @@
|
|
|
98
84
|
}
|
|
99
85
|
}
|
|
100
86
|
|
|
101
|
-
.edit-post-post-preview-dropdown {
|
|
102
|
-
|
|
103
|
-
padding-bottom: 0;
|
|
104
|
-
}
|
|
87
|
+
.edit-post-post-preview-dropdown .components-popover__content {
|
|
88
|
+
padding-bottom: 0;
|
|
105
89
|
}
|
|
106
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Show icon labels.
|
|
93
|
+
*/
|
|
94
|
+
|
|
107
95
|
.show-icon-labels.interface-pinned-items,
|
|
108
96
|
.show-icon-labels .edit-post-header,
|
|
109
97
|
.edit-post-header__dropdown {
|
|
@@ -157,17 +145,7 @@
|
|
|
157
145
|
padding-right: $grid-unit-15;
|
|
158
146
|
}
|
|
159
147
|
}
|
|
160
|
-
.components-dropdown-menu__toggle {
|
|
161
|
-
margin-left: $grid-unit;
|
|
162
|
-
padding-left: $grid-unit;
|
|
163
|
-
padding-right: $grid-unit;
|
|
164
148
|
|
|
165
|
-
@include break-small {
|
|
166
|
-
margin-left: $grid-unit-15;
|
|
167
|
-
padding-left: $grid-unit-15;
|
|
168
|
-
padding-right: $grid-unit-15;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
149
|
// The inserter has a custom label, different from its aria-label, so we don't want to display both.
|
|
172
150
|
.edit-post-header-toolbar__inserter-toggle.edit-post-header-toolbar__inserter-toggle {
|
|
173
151
|
&::after {
|
|
@@ -48,6 +48,8 @@ export default function DeleteTemplate() {
|
|
|
48
48
|
templateTitle = template.title;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
const isRevertable = template?.has_theme_file;
|
|
52
|
+
|
|
51
53
|
const onDelete = () => {
|
|
52
54
|
clearSelectedBlock();
|
|
53
55
|
setIsEditingTemplate( false );
|
|
@@ -77,14 +79,19 @@ export default function DeleteTemplate() {
|
|
|
77
79
|
<>
|
|
78
80
|
<MenuItem
|
|
79
81
|
className="edit-post-template-top-area__delete-template-button"
|
|
80
|
-
isDestructive
|
|
81
|
-
variant="secondary"
|
|
82
|
-
aria-label={ __( 'Delete template' ) }
|
|
82
|
+
isDestructive={ ! isRevertable }
|
|
83
83
|
onClick={ () => {
|
|
84
84
|
setShowConfirmDialog( true );
|
|
85
85
|
} }
|
|
86
|
+
info={
|
|
87
|
+
isRevertable
|
|
88
|
+
? __( 'Restore template to default state' )
|
|
89
|
+
: undefined
|
|
90
|
+
}
|
|
86
91
|
>
|
|
87
|
-
{
|
|
92
|
+
{ isRevertable
|
|
93
|
+
? __( 'Clear customizations' )
|
|
94
|
+
: __( 'Delete template' ) }
|
|
88
95
|
</MenuItem>
|
|
89
96
|
<ConfirmDialog
|
|
90
97
|
isOpen={ showConfirmDialog }
|
|
@@ -42,31 +42,33 @@ export default function EditTemplateTitle() {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
<div className="edit-site-template-details__group">
|
|
46
|
+
<TextControl
|
|
47
|
+
label={ __( 'Title' ) }
|
|
48
|
+
value={ templateTitle }
|
|
49
|
+
help={ __(
|
|
50
|
+
'Give the template a title that indicates its purpose, e.g. "Full Width".'
|
|
51
|
+
) }
|
|
52
|
+
onChange={ ( newTitle ) => {
|
|
53
|
+
const settings = getEditorSettings();
|
|
54
|
+
const newAvailableTemplates = mapValues(
|
|
55
|
+
settings.availableTemplates,
|
|
56
|
+
( existingTitle, id ) => {
|
|
57
|
+
if ( id !== template.slug ) {
|
|
58
|
+
return existingTitle;
|
|
59
|
+
}
|
|
60
|
+
return newTitle;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/>
|
|
62
|
+
);
|
|
63
|
+
updateEditorSettings( {
|
|
64
|
+
...settings,
|
|
65
|
+
availableTemplates: newAvailableTemplates,
|
|
66
|
+
} );
|
|
67
|
+
editEntityRecord( 'postType', 'wp_template', template.id, {
|
|
68
|
+
title: newTitle,
|
|
69
|
+
} );
|
|
70
|
+
} }
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
71
73
|
);
|
|
72
74
|
}
|
|
@@ -49,7 +49,18 @@
|
|
|
49
49
|
.edit-post-template-top-area__popover {
|
|
50
50
|
.components-popover__content {
|
|
51
51
|
min-width: 280px;
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
> div {
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.edit-site-template-details__group {
|
|
59
|
+
padding: $grid-unit-20;
|
|
60
|
+
|
|
61
|
+
.components-base-control__help {
|
|
62
|
+
margin-bottom: 0;
|
|
63
|
+
}
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
.edit-post-template-details__description {
|
|
@@ -58,19 +69,29 @@
|
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
.edit-post-template-top-area__second-menu-group {
|
|
61
|
-
margin-left: -$grid-unit-20;
|
|
62
|
-
margin-right: -$grid-unit-20;
|
|
63
|
-
padding: $grid-unit-20;
|
|
64
|
-
padding-bottom: 0;
|
|
65
72
|
border-top: $border-width solid $gray-300;
|
|
73
|
+
padding: $grid-unit-20 $grid-unit-10;
|
|
66
74
|
|
|
67
75
|
.edit-post-template-top-area__delete-template-button {
|
|
68
76
|
display: flex;
|
|
69
77
|
justify-content: center;
|
|
78
|
+
padding: $grid-unit-05 $grid-unit;
|
|
79
|
+
|
|
80
|
+
&.is-destructive {
|
|
81
|
+
padding: inherit;
|
|
82
|
+
margin-left: $grid-unit-10;
|
|
83
|
+
margin-right: $grid-unit-10;
|
|
84
|
+
width: calc(100% - #{($grid-unit * 2)});
|
|
85
|
+
|
|
86
|
+
.components-menu-item__item {
|
|
87
|
+
width: auto;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
70
90
|
|
|
71
91
|
.components-menu-item__item {
|
|
72
92
|
margin-right: 0;
|
|
73
93
|
min-width: 0;
|
|
94
|
+
width: 100%;
|
|
74
95
|
}
|
|
75
96
|
}
|
|
76
97
|
}
|
|
@@ -23,8 +23,9 @@ export default function TemplateDescription() {
|
|
|
23
23
|
if ( ! description ) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
+
|
|
26
27
|
return (
|
|
27
|
-
|
|
28
|
+
<div className="edit-site-template-details__group">
|
|
28
29
|
<Heading level={ 4 } weight={ 600 }>
|
|
29
30
|
{ title }
|
|
30
31
|
</Heading>
|
|
@@ -36,6 +37,6 @@ export default function TemplateDescription() {
|
|
|
36
37
|
>
|
|
37
38
|
{ description }
|
|
38
39
|
</Text>
|
|
39
|
-
|
|
40
|
+
</div>
|
|
40
41
|
);
|
|
41
42
|
}
|
|
@@ -115,14 +115,20 @@ class Layout extends Component {
|
|
|
115
115
|
// Add a margin view at the bottom for the header.
|
|
116
116
|
const marginBottom =
|
|
117
117
|
Platform.OS === 'android' && ! isHtmlView
|
|
118
|
-
? headerToolbarStyles.
|
|
118
|
+
? headerToolbarStyles[ 'header-toolbar__container' ].height
|
|
119
119
|
: 0;
|
|
120
120
|
|
|
121
|
+
const containerStyles = getStylesFromColorScheme(
|
|
122
|
+
styles.container,
|
|
123
|
+
styles.containerDark
|
|
124
|
+
);
|
|
125
|
+
|
|
121
126
|
const toolbarKeyboardAvoidingViewStyle = {
|
|
122
127
|
...styles.toolbarKeyboardAvoidingView,
|
|
123
128
|
left: this.state.safeAreaInsets.left,
|
|
124
129
|
right: this.state.safeAreaInsets.right,
|
|
125
130
|
bottom: this.state.safeAreaInsets.bottom,
|
|
131
|
+
backgroundColor: containerStyles.backgroundColor,
|
|
126
132
|
};
|
|
127
133
|
|
|
128
134
|
const editorStyles = [
|
|
@@ -138,10 +144,7 @@ class Layout extends Component {
|
|
|
138
144
|
return (
|
|
139
145
|
<Tooltip.Slot>
|
|
140
146
|
<SafeAreaView
|
|
141
|
-
style={
|
|
142
|
-
styles.container,
|
|
143
|
-
styles.containerDark
|
|
144
|
-
) }
|
|
147
|
+
style={ containerStyles }
|
|
145
148
|
onLayout={ this.onRootViewLayout }
|
|
146
149
|
>
|
|
147
150
|
<AutosaveMonitor disableIntervalChecks />
|
|
@@ -101,13 +101,6 @@ export default function EditPostPreferencesModal() {
|
|
|
101
101
|
'Customize options related to the block editor interface and editing flow.'
|
|
102
102
|
) }
|
|
103
103
|
>
|
|
104
|
-
<EnableFeature
|
|
105
|
-
featureName="reducedUI"
|
|
106
|
-
help={ __(
|
|
107
|
-
'Compacts options and outlines in the toolbar.'
|
|
108
|
-
) }
|
|
109
|
-
label={ __( 'Reduce the interface' ) }
|
|
110
|
-
/>
|
|
111
104
|
<EnableFeature
|
|
112
105
|
featureName="focusMode"
|
|
113
106
|
help={ __(
|
|
@@ -117,8 +110,24 @@ export default function EditPostPreferencesModal() {
|
|
|
117
110
|
/>
|
|
118
111
|
<EnableFeature
|
|
119
112
|
featureName="showIconLabels"
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
label={ __( 'Show button text labels' ) }
|
|
114
|
+
help={ __(
|
|
115
|
+
'Show text instead of icons on buttons.'
|
|
116
|
+
) }
|
|
117
|
+
/>
|
|
118
|
+
<EnableFeature
|
|
119
|
+
featureName="showListViewByDefault"
|
|
120
|
+
help={ __(
|
|
121
|
+
'Opens the block list view sidebar by default.'
|
|
122
|
+
) }
|
|
123
|
+
label={ __( 'Always open list view' ) }
|
|
124
|
+
/>
|
|
125
|
+
<EnableFeature
|
|
126
|
+
featureName="reducedUI"
|
|
127
|
+
help={ __(
|
|
128
|
+
'Compacts options and outlines in the toolbar.'
|
|
129
|
+
) }
|
|
130
|
+
label={ __( 'Reduce the interface' ) }
|
|
122
131
|
/>
|
|
123
132
|
<EnableFeature
|
|
124
133
|
featureName="themeStyles"
|
|
@@ -22,11 +22,6 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
22
22
|
description="Customize options related to the block editor interface and editing flow."
|
|
23
23
|
title="Appearance"
|
|
24
24
|
>
|
|
25
|
-
<WithSelect(WithDispatch(BaseOption))
|
|
26
|
-
featureName="reducedUI"
|
|
27
|
-
help="Compacts options and outlines in the toolbar."
|
|
28
|
-
label="Reduce the interface"
|
|
29
|
-
/>
|
|
30
25
|
<WithSelect(WithDispatch(BaseOption))
|
|
31
26
|
featureName="focusMode"
|
|
32
27
|
help="Highlights the current block and fades other content."
|
|
@@ -34,8 +29,18 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
34
29
|
/>
|
|
35
30
|
<WithSelect(WithDispatch(BaseOption))
|
|
36
31
|
featureName="showIconLabels"
|
|
37
|
-
help="
|
|
38
|
-
label="
|
|
32
|
+
help="Show text instead of icons on buttons."
|
|
33
|
+
label="Show button text labels"
|
|
34
|
+
/>
|
|
35
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
36
|
+
featureName="showListViewByDefault"
|
|
37
|
+
help="Opens the block list view sidebar by default."
|
|
38
|
+
label="Always open list view"
|
|
39
|
+
/>
|
|
40
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
41
|
+
featureName="reducedUI"
|
|
42
|
+
help="Compacts options and outlines in the toolbar."
|
|
43
|
+
label="Reduce the interface"
|
|
39
44
|
/>
|
|
40
45
|
<WithSelect(WithDispatch(BaseOption))
|
|
41
46
|
featureName="themeStyles"
|
|
@@ -148,11 +153,6 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
148
153
|
description="Customize options related to the block editor interface and editing flow."
|
|
149
154
|
title="Appearance"
|
|
150
155
|
>
|
|
151
|
-
<WithSelect(WithDispatch(BaseOption))
|
|
152
|
-
featureName="reducedUI"
|
|
153
|
-
help="Compacts options and outlines in the toolbar."
|
|
154
|
-
label="Reduce the interface"
|
|
155
|
-
/>
|
|
156
156
|
<WithSelect(WithDispatch(BaseOption))
|
|
157
157
|
featureName="focusMode"
|
|
158
158
|
help="Highlights the current block and fades other content."
|
|
@@ -160,8 +160,18 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
160
160
|
/>
|
|
161
161
|
<WithSelect(WithDispatch(BaseOption))
|
|
162
162
|
featureName="showIconLabels"
|
|
163
|
-
help="
|
|
164
|
-
label="
|
|
163
|
+
help="Show text instead of icons on buttons."
|
|
164
|
+
label="Show button text labels"
|
|
165
|
+
/>
|
|
166
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
167
|
+
featureName="showListViewByDefault"
|
|
168
|
+
help="Opens the block list view sidebar by default."
|
|
169
|
+
label="Always open list view"
|
|
170
|
+
/>
|
|
171
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
172
|
+
featureName="reducedUI"
|
|
173
|
+
help="Compacts options and outlines in the toolbar."
|
|
174
|
+
label="Reduce the interface"
|
|
165
175
|
/>
|
|
166
176
|
<WithSelect(WithDispatch(BaseOption))
|
|
167
177
|
featureName="themeStyles"
|
|
@@ -18,7 +18,7 @@ export function PostSchedule() {
|
|
|
18
18
|
<PanelRow className="edit-post-post-schedule" ref={ anchorRef }>
|
|
19
19
|
<span>{ __( 'Publish' ) }</span>
|
|
20
20
|
<Dropdown
|
|
21
|
-
popoverProps={ { anchorRef
|
|
21
|
+
popoverProps={ { anchorRef } }
|
|
22
22
|
position="bottom left"
|
|
23
23
|
contentClassName="edit-post-post-schedule__dialog"
|
|
24
24
|
renderToggle={ ( { onToggle, isOpen } ) => (
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
text-align: right;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// Zero out a blanket padding that is set on the
|
|
16
|
+
// Zero out a blanket padding that is set on the dropdown component.
|
|
17
17
|
// The datetime component has its own padding.
|
|
18
|
-
.edit-post-post-schedule__dialog .components-popover__content
|
|
18
|
+
.edit-post-post-schedule__dialog .components-popover__content {
|
|
19
19
|
padding: 0;
|
|
20
20
|
}
|
|
@@ -8,12 +8,14 @@ import {
|
|
|
8
8
|
PostVisibilityLabel,
|
|
9
9
|
PostVisibilityCheck,
|
|
10
10
|
} from '@wordpress/editor';
|
|
11
|
+
import { useRef } from '@wordpress/element';
|
|
11
12
|
|
|
12
13
|
export function PostVisibility() {
|
|
14
|
+
const rowRef = useRef();
|
|
13
15
|
return (
|
|
14
16
|
<PostVisibilityCheck
|
|
15
17
|
render={ ( { canEdit } ) => (
|
|
16
|
-
<PanelRow className="edit-post-post-visibility">
|
|
18
|
+
<PanelRow ref={ rowRef } className="edit-post-post-visibility">
|
|
17
19
|
<span>{ __( 'Visibility' ) }</span>
|
|
18
20
|
{ ! canEdit && (
|
|
19
21
|
<span>
|
|
@@ -24,6 +26,12 @@ export function PostVisibility() {
|
|
|
24
26
|
<Dropdown
|
|
25
27
|
position="bottom left"
|
|
26
28
|
contentClassName="edit-post-post-visibility__dialog"
|
|
29
|
+
popoverProps={ {
|
|
30
|
+
// Anchor the popover to the middle of the
|
|
31
|
+
// entire row so that it doesn't move around
|
|
32
|
+
// when the label changes.
|
|
33
|
+
anchorRef: rowRef.current,
|
|
34
|
+
} }
|
|
27
35
|
renderToggle={ ( { isOpen, onToggle } ) => (
|
|
28
36
|
<Button
|
|
29
37
|
aria-expanded={ isOpen }
|
|
@@ -34,7 +42,9 @@ export function PostVisibility() {
|
|
|
34
42
|
<PostVisibilityLabel />
|
|
35
43
|
</Button>
|
|
36
44
|
) }
|
|
37
|
-
renderContent={ () =>
|
|
45
|
+
renderContent={ ( { onClose } ) => (
|
|
46
|
+
<PostVisibilityForm onClose={ onClose } />
|
|
47
|
+
) }
|
|
38
48
|
/>
|
|
39
49
|
) }
|
|
40
50
|
</PanelRow>
|
|
@@ -9,34 +9,6 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.edit-post-post-visibility__dialog .components-popover__content {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
width: 257px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.edit-post-post-visibility__dialog-legend {
|
|
19
|
-
font-weight: 600;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.edit-post-post-visibility__choice {
|
|
23
|
-
margin: 10px 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.edit-post-post-visibility__dialog-radio,
|
|
27
|
-
.edit-post-post-visibility__dialog-label {
|
|
28
|
-
vertical-align: top;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.edit-post-post-visibility__dialog-password-input {
|
|
32
|
-
width: calc(100% - 20px);
|
|
33
|
-
margin-left: 20px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.edit-post-post-visibility__dialog-info {
|
|
37
|
-
color: $gray-700;
|
|
38
|
-
padding-left: 20px;
|
|
39
|
-
font-style: italic;
|
|
40
|
-
margin: 4px 0 0;
|
|
41
|
-
line-height: 1.4;
|
|
12
|
+
// sidebar width - padding - horizontal borders
|
|
13
|
+
width: $sidebar-width - $grid-unit-20 - $border-width * 2;
|
|
42
14
|
}
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
&.is-active:focus {
|
|
51
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0
|
|
51
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -#{$border-width-tab * 2} 0 0 var(--wp-admin-theme-color);
|
|
52
52
|
}
|
|
53
53
|
}
|