@wordpress/edit-post 7.14.0 → 7.15.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 +2 -0
- package/build/components/device-preview/index.js +6 -6
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js +7 -6
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +91 -49
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +1 -6
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +0 -2
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/layout/actions-panel.js +5 -10
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +2 -12
- package/build/components/layout/index.js.map +1 -1
- package/build/components/text-editor/index.js +1 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/header.native.js +1 -13
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +1 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/plugins/index.js +35 -6
- package/build/plugins/index.js.map +1 -1
- package/build/store/actions.js +12 -14
- package/build/store/actions.js.map +1 -1
- package/build-module/components/device-preview/index.js +6 -6
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js +7 -6
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +92 -53
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +1 -6
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +0 -2
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/layout/actions-panel.js +5 -10
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +4 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +2 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js +1 -10
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +2 -2
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/plugins/index.js +33 -6
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/store/actions.js +11 -14
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +9 -13
- package/build-style/style.css +9 -13
- package/package.json +32 -32
- package/src/components/device-preview/index.js +35 -39
- package/src/components/header/header-toolbar/index.js +3 -2
- package/src/components/header/header-toolbar/index.native.js +124 -68
- package/src/components/header/header-toolbar/style.native.scss +23 -4
- package/src/components/header/index.js +12 -22
- package/src/components/header/post-publish-button-or-toggle.js +0 -2
- package/src/components/layout/actions-panel.js +5 -7
- package/src/components/layout/index.js +5 -14
- package/src/components/layout/style.native.scss +1 -1
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +11 -3
- package/src/components/text-editor/index.js +0 -2
- package/src/components/visual-editor/header.native.js +1 -17
- package/src/components/visual-editor/index.js +1 -6
- package/src/components/visual-editor/test/__snapshots__/index.native.js.snap +15 -0
- package/src/components/visual-editor/test/index.native.js +118 -1
- package/src/plugins/index.js +32 -8
- package/src/store/actions.js +18 -27
- package/src/style.scss +1 -7
- package/src/components/visual-editor/style.native.scss +0 -18
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { ScrollView, StyleSheet, View } from 'react-native';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useCallback, useRef,
|
|
10
|
-
import { compose,
|
|
9
|
+
import { useCallback, useRef, useEffect, Platform } from '@wordpress/element';
|
|
10
|
+
import { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
11
11
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
12
12
|
import { withViewportMatch } from '@wordpress/viewport';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
@@ -19,10 +19,19 @@ import {
|
|
|
19
19
|
import { ToolbarGroup, ToolbarButton } from '@wordpress/components';
|
|
20
20
|
import {
|
|
21
21
|
keyboardClose,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
audio as audioIcon,
|
|
23
|
+
media as imageIcon,
|
|
24
|
+
video as videoIcon,
|
|
25
|
+
gallery as galleryIcon,
|
|
24
26
|
} from '@wordpress/icons';
|
|
25
27
|
import { store as editorStore } from '@wordpress/editor';
|
|
28
|
+
import { createBlock } from '@wordpress/blocks';
|
|
29
|
+
import {
|
|
30
|
+
toggleUndoButton,
|
|
31
|
+
toggleRedoButton,
|
|
32
|
+
subscribeOnUndoPressed,
|
|
33
|
+
subscribeOnRedoPressed,
|
|
34
|
+
} from '@wordpress/react-native-bridge';
|
|
26
35
|
|
|
27
36
|
/**
|
|
28
37
|
* Internal dependencies
|
|
@@ -30,6 +39,13 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
30
39
|
import styles from './style.scss';
|
|
31
40
|
import { store as editPostStore } from '../../../store';
|
|
32
41
|
|
|
42
|
+
const shadowStyle = {
|
|
43
|
+
shadowOffset: { width: 2, height: 2 },
|
|
44
|
+
shadowOpacity: 1,
|
|
45
|
+
shadowRadius: 6,
|
|
46
|
+
elevation: 18,
|
|
47
|
+
};
|
|
48
|
+
|
|
33
49
|
function HeaderToolbar( {
|
|
34
50
|
hasRedo,
|
|
35
51
|
hasUndo,
|
|
@@ -37,83 +53,129 @@ function HeaderToolbar( {
|
|
|
37
53
|
undo,
|
|
38
54
|
showInserter,
|
|
39
55
|
showKeyboardHideButton,
|
|
40
|
-
|
|
56
|
+
insertBlock,
|
|
41
57
|
onHideKeyboard,
|
|
42
58
|
isRTL,
|
|
43
59
|
noContentSelected,
|
|
44
60
|
} ) {
|
|
45
|
-
const
|
|
46
|
-
|
|
61
|
+
const anchorNodeRef = useRef();
|
|
62
|
+
|
|
63
|
+
const containerStyle = [
|
|
64
|
+
usePreferredColorSchemeStyle(
|
|
65
|
+
styles[ 'header-toolbar__container' ],
|
|
66
|
+
styles[ 'header-toolbar__container--dark' ]
|
|
67
|
+
),
|
|
68
|
+
{ borderTopWidth: StyleSheet.hairlineWidth },
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
useEffect( () => {
|
|
72
|
+
const onUndoSubscription = subscribeOnUndoPressed( undo );
|
|
73
|
+
const onRedoSubscription = subscribeOnRedoPressed( redo );
|
|
74
|
+
|
|
75
|
+
return () => {
|
|
76
|
+
onUndoSubscription?.remove();
|
|
77
|
+
onRedoSubscription?.remove();
|
|
78
|
+
};
|
|
79
|
+
}, [ undo, redo ] );
|
|
80
|
+
|
|
81
|
+
useEffect( () => {
|
|
82
|
+
toggleUndoButton( ! hasUndo );
|
|
83
|
+
}, [ hasUndo ] );
|
|
84
|
+
|
|
85
|
+
useEffect( () => {
|
|
86
|
+
toggleRedoButton( ! hasRedo );
|
|
87
|
+
}, [ hasRedo ] );
|
|
47
88
|
|
|
48
89
|
const scrollViewRef = useRef( null );
|
|
49
90
|
const scrollToStart = () => {
|
|
50
91
|
// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android
|
|
51
|
-
|
|
52
|
-
if ( isAndroid && isRTL ) {
|
|
92
|
+
if ( Platform.isAndroid && isRTL ) {
|
|
53
93
|
scrollViewRef.current.scrollToEnd();
|
|
54
94
|
} else {
|
|
55
95
|
scrollViewRef.current.scrollTo( { x: 0 } );
|
|
56
96
|
}
|
|
57
97
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
98
|
+
|
|
99
|
+
const onInsertBlock = useCallback(
|
|
100
|
+
( blockType ) => () => {
|
|
101
|
+
insertBlock( createBlock( blockType ), undefined, undefined, true, {
|
|
102
|
+
source: 'inserter_menu',
|
|
103
|
+
} );
|
|
104
|
+
},
|
|
105
|
+
[ insertBlock ]
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const renderMediaButtons = (
|
|
109
|
+
<ToolbarGroup>
|
|
61
110
|
<ToolbarButton
|
|
62
|
-
key="
|
|
63
|
-
title={ __( '
|
|
64
|
-
icon={
|
|
65
|
-
|
|
66
|
-
|
|
111
|
+
key="imageButton"
|
|
112
|
+
title={ __( 'Image' ) }
|
|
113
|
+
icon={ imageIcon }
|
|
114
|
+
onClick={ onInsertBlock( 'core/image' ) }
|
|
115
|
+
testID="insert-image-button"
|
|
67
116
|
extraProps={ {
|
|
68
|
-
hint: __( '
|
|
117
|
+
hint: __( 'Insert Image Block' ),
|
|
69
118
|
} }
|
|
70
|
-
|
|
119
|
+
/>
|
|
71
120
|
<ToolbarButton
|
|
72
|
-
key="
|
|
73
|
-
title={ __( '
|
|
74
|
-
icon={
|
|
75
|
-
|
|
76
|
-
|
|
121
|
+
key="videoButton"
|
|
122
|
+
title={ __( 'Video' ) }
|
|
123
|
+
icon={ videoIcon }
|
|
124
|
+
onClick={ onInsertBlock( 'core/video' ) }
|
|
125
|
+
testID="insert-video-button"
|
|
77
126
|
extraProps={ {
|
|
78
|
-
hint: __( '
|
|
127
|
+
hint: __( 'Insert Video Block' ),
|
|
79
128
|
} }
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
129
|
+
/>
|
|
130
|
+
<ToolbarButton
|
|
131
|
+
key="galleryButton"
|
|
132
|
+
title={ __( 'Gallery' ) }
|
|
133
|
+
icon={ galleryIcon }
|
|
134
|
+
onClick={ onInsertBlock( 'core/gallery' ) }
|
|
135
|
+
testID="insert-gallery-button"
|
|
136
|
+
extraProps={ {
|
|
137
|
+
hint: __( 'Insert Gallery Block' ),
|
|
138
|
+
} }
|
|
139
|
+
/>
|
|
140
|
+
<ToolbarButton
|
|
141
|
+
key="audioButton"
|
|
142
|
+
title={ __( 'Audio' ) }
|
|
143
|
+
icon={ audioIcon }
|
|
144
|
+
onClick={ onInsertBlock( 'core/audio' ) }
|
|
145
|
+
testID="insert-audio-button"
|
|
146
|
+
extraProps={ {
|
|
147
|
+
hint: __( 'Insert Audio Block' ),
|
|
148
|
+
} }
|
|
149
|
+
/>
|
|
150
|
+
</ToolbarGroup>
|
|
94
151
|
);
|
|
95
152
|
|
|
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
|
-
|
|
102
153
|
/* translators: accessibility text for the editor toolbar */
|
|
103
154
|
const toolbarAriaLabel = __( 'Document tools' );
|
|
104
155
|
|
|
156
|
+
const shadowColor = usePreferredColorSchemeStyle(
|
|
157
|
+
styles[ 'header-toolbar__keyboard-hide-shadow--light' ],
|
|
158
|
+
styles[ 'header-toolbar__keyboard-hide-shadow--dark' ]
|
|
159
|
+
);
|
|
160
|
+
const showKeyboardButtonStyles = [
|
|
161
|
+
usePreferredColorSchemeStyle(
|
|
162
|
+
styles[ 'header-toolbar__keyboard-hide-container' ],
|
|
163
|
+
styles[ 'header-toolbar__keyboard-hide-container--dark' ]
|
|
164
|
+
),
|
|
165
|
+
shadowStyle,
|
|
166
|
+
{
|
|
167
|
+
shadowColor: Platform.isAndroid
|
|
168
|
+
? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color
|
|
169
|
+
: shadowColor.color,
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
|
|
105
173
|
return (
|
|
106
174
|
<View
|
|
175
|
+
ref={ anchorNodeRef }
|
|
107
176
|
testID={ toolbarAriaLabel }
|
|
108
177
|
accessibilityLabel={ toolbarAriaLabel }
|
|
109
|
-
style={
|
|
110
|
-
getStylesFromColorScheme(
|
|
111
|
-
styles[ 'header-toolbar__container' ],
|
|
112
|
-
styles[ 'header-toolbar__container--dark' ]
|
|
113
|
-
),
|
|
114
|
-
useExpandedMode &&
|
|
115
|
-
styles[ 'header-toolbar__container--expanded' ],
|
|
116
|
-
] }
|
|
178
|
+
style={ containerStyle }
|
|
117
179
|
>
|
|
118
180
|
<ScrollView
|
|
119
181
|
ref={ scrollViewRef }
|
|
@@ -126,20 +188,13 @@ function HeaderToolbar( {
|
|
|
126
188
|
styles[ 'header-toolbar__scrollable-content' ]
|
|
127
189
|
}
|
|
128
190
|
>
|
|
129
|
-
<Inserter
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/>
|
|
134
|
-
{ renderHistoryButtons() }
|
|
135
|
-
<BlockToolbar />
|
|
191
|
+
<Inserter disabled={ ! showInserter } />
|
|
192
|
+
|
|
193
|
+
{ noContentSelected && renderMediaButtons }
|
|
194
|
+
<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />
|
|
136
195
|
</ScrollView>
|
|
137
196
|
{ showKeyboardHideButton && (
|
|
138
|
-
<ToolbarGroup
|
|
139
|
-
passedStyle={
|
|
140
|
-
styles[ 'header-toolbar__keyboard-hide-container' ]
|
|
141
|
-
}
|
|
142
|
-
>
|
|
197
|
+
<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>
|
|
143
198
|
<ToolbarButton
|
|
144
199
|
title={ __( 'Hide keyboard' ) }
|
|
145
200
|
icon={ keyboardClose }
|
|
@@ -181,7 +236,8 @@ export default compose( [
|
|
|
181
236
|
};
|
|
182
237
|
} ),
|
|
183
238
|
withDispatch( ( dispatch ) => {
|
|
184
|
-
const { clearSelectedBlock } =
|
|
239
|
+
const { clearSelectedBlock, insertBlock } =
|
|
240
|
+
dispatch( blockEditorStore );
|
|
185
241
|
const { togglePostTitleSelection } = dispatch( editorStore );
|
|
186
242
|
|
|
187
243
|
return {
|
|
@@ -191,8 +247,8 @@ export default compose( [
|
|
|
191
247
|
clearSelectedBlock();
|
|
192
248
|
togglePostTitleSelection( false );
|
|
193
249
|
},
|
|
250
|
+
insertBlock,
|
|
194
251
|
};
|
|
195
252
|
} ),
|
|
196
253
|
withViewportMatch( { isLargeViewport: 'medium' } ),
|
|
197
|
-
withPreferredColorScheme,
|
|
198
254
|
] )( HeaderToolbar );
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
height: $mobile-header-toolbar-height;
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
background-color: $app-background;
|
|
6
|
-
border-top-color:
|
|
7
|
-
|
|
6
|
+
border-top-color: $light-quaternary;
|
|
7
|
+
overflow: hidden;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.header-toolbar__container--dark {
|
|
11
|
-
background-color: $app-background-dark
|
|
12
|
-
border-top-color: $
|
|
11
|
+
background-color: $app-safe-area-background-dark;
|
|
12
|
+
border-top-color: $dark-quaternary;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.header-toolbar__container--expanded {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.header-toolbar__scrollable-content {
|
|
20
20
|
flex-grow: 1; // Fixes RTL issue on Android.
|
|
21
|
+
padding-right: 8px;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
.header-toolbar__keyboard-hide-container {
|
|
@@ -27,4 +28,22 @@
|
|
|
27
28
|
width: 44px;
|
|
28
29
|
justify-content: center;
|
|
29
30
|
align-items: center;
|
|
31
|
+
border-color: transparent;
|
|
32
|
+
background-color: $app-background;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.header-toolbar__keyboard-hide-container--dark {
|
|
36
|
+
background-color: $app-background-dark-alt;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header-toolbar__keyboard-hide-shadow--solid {
|
|
40
|
+
color: $black;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.header-toolbar__keyboard-hide-shadow--light {
|
|
44
|
+
color: $light-quaternary;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.header-toolbar__keyboard-hide-shadow--dark {
|
|
48
|
+
color: $light-primary;
|
|
30
49
|
}
|
|
@@ -32,22 +32,17 @@ const slideX = {
|
|
|
32
32
|
|
|
33
33
|
function Header( { setEntitiesSavedStatesCallback } ) {
|
|
34
34
|
const isLargeViewport = useViewportMatch( 'large' );
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
showIconLabels:
|
|
47
|
-
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
48
|
-
} ),
|
|
49
|
-
[]
|
|
50
|
-
);
|
|
35
|
+
const { hasActiveMetaboxes, isPublishSidebarOpened, showIconLabels } =
|
|
36
|
+
useSelect(
|
|
37
|
+
( select ) => ( {
|
|
38
|
+
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
39
|
+
isPublishSidebarOpened:
|
|
40
|
+
select( editPostStore ).isPublishSidebarOpened(),
|
|
41
|
+
showIconLabels:
|
|
42
|
+
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
|
|
43
|
+
} ),
|
|
44
|
+
[]
|
|
45
|
+
);
|
|
51
46
|
|
|
52
47
|
return (
|
|
53
48
|
<div className="edit-post-header">
|
|
@@ -82,19 +77,14 @@ function Header( { setEntitiesSavedStatesCallback } ) {
|
|
|
82
77
|
// when the publish sidebar has been closed.
|
|
83
78
|
<PostSavedState
|
|
84
79
|
forceIsDirty={ hasActiveMetaboxes }
|
|
85
|
-
forceIsSaving={ isSaving }
|
|
86
80
|
showIconLabels={ showIconLabels }
|
|
87
81
|
/>
|
|
88
82
|
) }
|
|
89
83
|
<DevicePreview />
|
|
90
|
-
<PostPreviewButton
|
|
91
|
-
forceIsAutosaveable={ hasActiveMetaboxes }
|
|
92
|
-
forcePreviewLink={ isSaving ? null : undefined }
|
|
93
|
-
/>
|
|
84
|
+
<PostPreviewButton forceIsAutosaveable={ hasActiveMetaboxes } />
|
|
94
85
|
<ViewLink />
|
|
95
86
|
<PostPublishButtonOrToggle
|
|
96
87
|
forceIsDirty={ hasActiveMetaboxes }
|
|
97
|
-
forceIsSaving={ isSaving }
|
|
98
88
|
setEntitiesSavedStatesCallback={
|
|
99
89
|
setEntitiesSavedStatesCallback
|
|
100
90
|
}
|
|
@@ -12,7 +12,6 @@ import { store as editPostStore } from '../../store';
|
|
|
12
12
|
|
|
13
13
|
export function PostPublishButtonOrToggle( {
|
|
14
14
|
forceIsDirty,
|
|
15
|
-
forceIsSaving,
|
|
16
15
|
hasPublishAction,
|
|
17
16
|
isBeingScheduled,
|
|
18
17
|
isPending,
|
|
@@ -67,7 +66,6 @@ export function PostPublishButtonOrToggle( {
|
|
|
67
66
|
return (
|
|
68
67
|
<PostPublishButton
|
|
69
68
|
forceIsDirty={ forceIsDirty }
|
|
70
|
-
forceIsSaving={ forceIsSaving }
|
|
71
69
|
isOpen={ isPublishSidebarOpened }
|
|
72
70
|
isToggle={ component === IS_TOGGLE }
|
|
73
71
|
onToggle={ togglePublishSidebar }
|
|
@@ -31,18 +31,17 @@ export default function ActionsPanel( {
|
|
|
31
31
|
const {
|
|
32
32
|
publishSidebarOpened,
|
|
33
33
|
hasActiveMetaboxes,
|
|
34
|
-
isSavingMetaBoxes,
|
|
35
34
|
hasNonPostEntityChanges,
|
|
36
|
-
} = useSelect(
|
|
37
|
-
|
|
35
|
+
} = useSelect(
|
|
36
|
+
( select ) => ( {
|
|
38
37
|
publishSidebarOpened:
|
|
39
38
|
select( editPostStore ).isPublishSidebarOpened(),
|
|
40
39
|
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
41
|
-
isSavingMetaBoxes: select( editPostStore ).isSavingMetaBoxes(),
|
|
42
40
|
hasNonPostEntityChanges:
|
|
43
41
|
select( editorStore ).hasNonPostEntityChanges(),
|
|
44
|
-
}
|
|
45
|
-
|
|
42
|
+
} ),
|
|
43
|
+
[]
|
|
44
|
+
);
|
|
46
45
|
|
|
47
46
|
const openEntitiesSavedStates = useCallback(
|
|
48
47
|
() => setEntitiesSavedStatesCallback( true ),
|
|
@@ -57,7 +56,6 @@ export default function ActionsPanel( {
|
|
|
57
56
|
<PostPublishPanel
|
|
58
57
|
onClose={ closePublishSidebar }
|
|
59
58
|
forceIsDirty={ hasActiveMetaboxes }
|
|
60
|
-
forceIsSaving={ isSavingMetaBoxes }
|
|
61
59
|
PrePublishExtension={ PluginPrePublishPanel.Slot }
|
|
62
60
|
PostPublishExtension={ PluginPostPublishPanel.Slot }
|
|
63
61
|
/>
|
|
@@ -12,14 +12,13 @@ import {
|
|
|
12
12
|
UnsavedChangesWarning,
|
|
13
13
|
EditorNotices,
|
|
14
14
|
EditorKeyboardShortcutsRegister,
|
|
15
|
+
EditorKeyboardShortcuts,
|
|
15
16
|
EditorSnackbars,
|
|
17
|
+
PostSyncStatusModal,
|
|
16
18
|
store as editorStore,
|
|
17
19
|
} from '@wordpress/editor';
|
|
18
20
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
19
|
-
import {
|
|
20
|
-
BlockBreadcrumb,
|
|
21
|
-
privateApis as blockEditorPrivateApis,
|
|
22
|
-
} from '@wordpress/block-editor';
|
|
21
|
+
import { BlockBreadcrumb } from '@wordpress/block-editor';
|
|
23
22
|
import { Button, ScrollLock, Popover } from '@wordpress/components';
|
|
24
23
|
import { useViewportMatch } from '@wordpress/compose';
|
|
25
24
|
import { PluginArea } from '@wordpress/plugins';
|
|
@@ -52,9 +51,6 @@ import WelcomeGuide from '../welcome-guide';
|
|
|
52
51
|
import ActionsPanel from './actions-panel';
|
|
53
52
|
import StartPageOptions from '../start-page-options';
|
|
54
53
|
import { store as editPostStore } from '../../store';
|
|
55
|
-
import { unlock } from '../../lock-unlock';
|
|
56
|
-
|
|
57
|
-
const { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );
|
|
58
54
|
|
|
59
55
|
const interfaceLabels = {
|
|
60
56
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
@@ -69,12 +65,6 @@ const interfaceLabels = {
|
|
|
69
65
|
footer: __( 'Editor footer' ),
|
|
70
66
|
};
|
|
71
67
|
|
|
72
|
-
const blockRemovalRules = {
|
|
73
|
-
'core/footnotes': __(
|
|
74
|
-
'The Footnotes block displays all footnotes found in the content. Note that any footnotes in the content will persist after removing this block.'
|
|
75
|
-
),
|
|
76
|
-
};
|
|
77
|
-
|
|
78
68
|
function Layout( { styles } ) {
|
|
79
69
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
80
70
|
const isHugeViewport = useViewportMatch( 'huge', '>=' );
|
|
@@ -214,7 +204,7 @@ function Layout( { styles } ) {
|
|
|
214
204
|
<LocalAutosaveMonitor />
|
|
215
205
|
<EditPostKeyboardShortcuts />
|
|
216
206
|
<EditorKeyboardShortcutsRegister />
|
|
217
|
-
<
|
|
207
|
+
<EditorKeyboardShortcuts />
|
|
218
208
|
<SettingsSidebar />
|
|
219
209
|
<InterfaceSkeleton
|
|
220
210
|
isDistractionFree={ isDistractionFree && isLargeViewport }
|
|
@@ -304,6 +294,7 @@ function Layout( { styles } ) {
|
|
|
304
294
|
<EditPostPreferencesModal />
|
|
305
295
|
<KeyboardShortcutHelpModal />
|
|
306
296
|
<WelcomeGuide />
|
|
297
|
+
<PostSyncStatusModal />
|
|
307
298
|
<StartPageOptions />
|
|
308
299
|
<Popover.Slot />
|
|
309
300
|
<PluginArea onError={ onPluginAreaError } />
|
|
@@ -590,6 +590,8 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
590
590
|
}
|
|
591
591
|
|
|
592
592
|
.emotion-13 {
|
|
593
|
+
font-size: 13px;
|
|
594
|
+
font-family: inherit;
|
|
593
595
|
-webkit-appearance: none;
|
|
594
596
|
-moz-appearance: none;
|
|
595
597
|
-ms-appearance: none;
|
|
@@ -616,12 +618,18 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
616
618
|
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
|
|
617
619
|
}
|
|
618
620
|
|
|
621
|
+
.emotion-13:focus {
|
|
622
|
+
box-shadow: none;
|
|
623
|
+
outline: none;
|
|
624
|
+
}
|
|
625
|
+
|
|
619
626
|
.emotion-13:focus-visible {
|
|
620
627
|
box-shadow: 0 0 0 var( --wp-admin-border-width-focus ) var(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
628
|
+
--wp-components-color-accent,
|
|
629
|
+
var( --wp-admin-theme-color, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) )
|
|
630
|
+
);
|
|
624
631
|
outline: 2px solid transparent;
|
|
632
|
+
outline-offset: 0;
|
|
625
633
|
}
|
|
626
634
|
|
|
627
635
|
.emotion-15 {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import {
|
|
5
5
|
PostTextEditor,
|
|
6
6
|
PostTitle,
|
|
7
|
-
TextEditorGlobalKeyboardShortcuts,
|
|
8
7
|
store as editorStore,
|
|
9
8
|
} from '@wordpress/editor';
|
|
10
9
|
import { Button } from '@wordpress/components';
|
|
@@ -25,7 +24,6 @@ export default function TextEditor() {
|
|
|
25
24
|
|
|
26
25
|
return (
|
|
27
26
|
<div className="edit-post-text-editor">
|
|
28
|
-
<TextEditorGlobalKeyboardShortcuts />
|
|
29
27
|
{ isRichEditingEnabled && (
|
|
30
28
|
<div className="edit-post-text-editor__toolbar">
|
|
31
29
|
<h2>{ __( 'Editing code' ) }</h2>
|
|
@@ -16,23 +16,9 @@ import {
|
|
|
16
16
|
useEditorWrapperStyles,
|
|
17
17
|
} from '@wordpress/block-editor';
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
import styles from './style.scss';
|
|
23
|
-
|
|
24
19
|
const Header = memo(
|
|
25
|
-
function EditorHeader( {
|
|
26
|
-
editTitle,
|
|
27
|
-
setTitleRef,
|
|
28
|
-
title,
|
|
29
|
-
getStylesFromColorScheme,
|
|
30
|
-
} ) {
|
|
20
|
+
function EditorHeader( { editTitle, setTitleRef, title } ) {
|
|
31
21
|
const [ wrapperStyles ] = useEditorWrapperStyles();
|
|
32
|
-
const blockHolderFocusedStyle = getStylesFromColorScheme(
|
|
33
|
-
styles.blockHolderFocused,
|
|
34
|
-
styles.blockHolderFocusedDark
|
|
35
|
-
);
|
|
36
22
|
return (
|
|
37
23
|
<View style={ wrapperStyles }>
|
|
38
24
|
<PostTitle
|
|
@@ -40,8 +26,6 @@ const Header = memo(
|
|
|
40
26
|
title={ title }
|
|
41
27
|
onUpdate={ editTitle }
|
|
42
28
|
placeholder={ __( 'Add title' ) }
|
|
43
|
-
borderStyle={ styles.blockHolderFullBordered }
|
|
44
|
-
focusedBorderColor={ blockHolderFocusedStyle.borderColor }
|
|
45
29
|
accessibilityLabel="post-title"
|
|
46
30
|
/>
|
|
47
31
|
</View>
|
|
@@ -6,11 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
VisualEditorGlobalKeyboardShortcuts,
|
|
11
|
-
PostTitle,
|
|
12
|
-
store as editorStore,
|
|
13
|
-
} from '@wordpress/editor';
|
|
9
|
+
import { PostTitle, store as editorStore } from '@wordpress/editor';
|
|
14
10
|
import {
|
|
15
11
|
WritingFlow,
|
|
16
12
|
BlockList,
|
|
@@ -345,7 +341,6 @@ export default function VisualEditor( { styles } ) {
|
|
|
345
341
|
'is-template-mode': isTemplateMode,
|
|
346
342
|
} ) }
|
|
347
343
|
>
|
|
348
|
-
<VisualEditorGlobalKeyboardShortcuts />
|
|
349
344
|
<motion.div
|
|
350
345
|
className="edit-post-visual-editor__content-area"
|
|
351
346
|
animate={ {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`when nothing is selected media buttons and picker display correctly 1`] = `
|
|
4
|
+
"<!-- wp:paragraph -->
|
|
5
|
+
<p>First example paragraph.</p>
|
|
6
|
+
<!-- /wp:paragraph -->
|
|
7
|
+
|
|
8
|
+
<!-- wp:paragraph -->
|
|
9
|
+
<p>Second example paragraph.</p>
|
|
10
|
+
<!-- /wp:paragraph -->
|
|
11
|
+
|
|
12
|
+
<!-- wp:gallery {"linkTo":"none"} -->
|
|
13
|
+
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"></figure>
|
|
14
|
+
<!-- /wp:gallery -->"
|
|
15
|
+
`;
|